{"version":3,"file":"compiler.js","sources":["../../../packages/compiler/src/version.js","../../../packages/compiler/src/template_parser/template_ast.js","../../../packages/compiler/src/aot/static_symbol.js","../../../packages/compiler/src/ml_parser/tags.js","../../../packages/compiler/src/ml_parser/html_tags.js","../../../packages/compiler/src/selector.js","../../../packages/compiler/src/util.js","../../../packages/compiler/src/compile_metadata.js","../../../packages/compiler/src/compile_reflector.js","../../../packages/compiler/src/config.js","../../../packages/compiler/src/expression_parser/ast.js","../../../packages/compiler/src/chars.js","../../../packages/compiler/src/injectable.js","../../../packages/compiler/src/assertions.js","../../../packages/compiler/src/ml_parser/interpolation_config.js","../../../packages/compiler/src/expression_parser/lexer.js","../../../packages/compiler/src/expression_parser/parser.js","../../../packages/compiler/src/parse_util.js","../../../packages/compiler/src/ast_path.js","../../../packages/compiler/src/ml_parser/ast.js","../../../packages/compiler/src/ml_parser/lexer.js","../../../packages/compiler/src/ml_parser/parser.js","../../../packages/compiler/src/i18n/digest.js","../../../packages/compiler/src/i18n/i18n_ast.js","../../../packages/compiler/src/i18n/serializers/placeholder.js","../../../packages/compiler/src/i18n/i18n_parser.js","../../../packages/compiler/src/i18n/parse_util.js","../../../packages/compiler/src/i18n/extractor_merger.js","../../../packages/compiler/src/ml_parser/xml_tags.js","../../../packages/compiler/src/ml_parser/xml_parser.js","../../../packages/compiler/src/i18n/serializers/serializer.js","../../../packages/compiler/src/i18n/serializers/xml_helper.js","../../../packages/compiler/src/i18n/serializers/xliff.js","../../../packages/compiler/src/i18n/serializers/xliff2.js","../../../packages/compiler/src/i18n/serializers/xmb.js","../../../packages/compiler/src/i18n/serializers/xtb.js","../../../packages/compiler/src/ml_parser/html_parser.js","../../../packages/compiler/src/i18n/translation_bundle.js","../../../packages/compiler/src/i18n/i18n_html_parser.js","../../../packages/compiler/src/identifiers.js","../../../packages/compiler/src/ml_parser/html_whitespaces.js","../../../packages/compiler/src/ml_parser/icu_ast_expander.js","../../../packages/compiler/src/provider_analyzer.js","../../../packages/compiler/src/schema/element_schema_registry.js","../../../packages/compiler/src/style_url_resolver.js","../../../packages/compiler/src/template_parser/binding_parser.js","../../../packages/compiler/src/template_parser/template_preparser.js","../../../packages/compiler/src/template_parser/template_parser.js","../../../packages/compiler/src/resource_loader.js","../../../packages/compiler/src/url_resolver.js","../../../packages/compiler/src/directive_normalizer.js","../../../packages/compiler/src/directive_resolver.js","../../../packages/compiler/src/aot/util.js","../../../packages/compiler/src/lifecycle_reflector.js","../../../packages/compiler/src/ng_module_resolver.js","../../../packages/compiler/src/pipe_resolver.js","../../../packages/compiler/src/summary_resolver.js","../../../packages/compiler/src/metadata_resolver.js","../../../packages/compiler/src/output/output_ast.js","../../../packages/compiler/src/output/value_util.js","../../../packages/compiler/src/view_compiler/provider_compiler.js","../../../packages/compiler/src/ng_module_compiler.js","../../../packages/compiler/src/output/source_map.js","../../../packages/compiler/src/output/abstract_emitter.js","../../../packages/compiler/src/output/ts_emitter.js","../../../packages/compiler/src/schema/dom_security_schema.js","../../../packages/compiler/src/schema/dom_element_schema_registry.js","../../../packages/compiler/src/shadow_css.js","../../../packages/compiler/src/style_compiler.js","../../../packages/compiler/src/compiler_util/expression_converter.js","../../../packages/compiler/src/view_compiler/view_compiler.js","../../../packages/compiler/src/aot/generated_file.js","../../../packages/compiler/src/aot/summary_serializer.js","../../../packages/compiler/src/aot/compiler.js","../../../packages/compiler/src/aot/static_reflector.js","../../../packages/compiler/src/aot/static_symbol_resolver.js","../../../packages/compiler/src/aot/summary_resolver.js","../../../packages/compiler/src/aot/compiler_factory.js","../../../packages/compiler/src/output/output_interpreter.js","../../../packages/compiler/src/output/abstract_js_emitter.js","../../../packages/compiler/src/output/output_jit.js","../../../packages/compiler/src/jit/compiler.js","../../../packages/compiler/src/i18n/message_bundle.js","../../../packages/compiler/src/i18n/extractor.js","../../../packages/compiler/src/i18n/index.js","../../../packages/compiler/src/jit/jit_reflector.js","../../../packages/compiler/src/jit/compiler_factory.js","../../../packages/compiler/src/compiler.js","../../../packages/compiler/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the common package.\n */\nimport { Version } from '@angular/core';\n/**\n * \\@stable\n */\nexport const VERSION = new Version('4.4.6');\n//# sourceMappingURL=version.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * A segment of text within the template.\n */\nexport class TextAst {\n /**\n * @param {?} value\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n constructor(value, ngContentIndex, sourceSpan) {\n this.value = value;\n this.ngContentIndex = ngContentIndex;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitText(this, context); }\n}\nfunction TextAst_tsickle_Closure_declarations() {\n /** @type {?} */\n TextAst.prototype.value;\n /** @type {?} */\n TextAst.prototype.ngContentIndex;\n /** @type {?} */\n TextAst.prototype.sourceSpan;\n}\n/**\n * A bound expression within the text of a template.\n */\nexport class BoundTextAst {\n /**\n * @param {?} value\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n constructor(value, ngContentIndex, sourceSpan) {\n this.value = value;\n this.ngContentIndex = ngContentIndex;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitBoundText(this, context);\n }\n}\nfunction BoundTextAst_tsickle_Closure_declarations() {\n /** @type {?} */\n BoundTextAst.prototype.value;\n /** @type {?} */\n BoundTextAst.prototype.ngContentIndex;\n /** @type {?} */\n BoundTextAst.prototype.sourceSpan;\n}\n/**\n * A plain attribute on an element.\n */\nexport class AttrAst {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(name, value, sourceSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitAttr(this, context); }\n}\nfunction AttrAst_tsickle_Closure_declarations() {\n /** @type {?} */\n AttrAst.prototype.name;\n /** @type {?} */\n AttrAst.prototype.value;\n /** @type {?} */\n AttrAst.prototype.sourceSpan;\n}\n/**\n * A binding for an element property (e.g. `[property]=\"expression\"`) or an animation trigger (e.g.\n * `[\\@trigger]=\"stateExp\"`)\n */\nexport class BoundElementPropertyAst {\n /**\n * @param {?} name\n * @param {?} type\n * @param {?} securityContext\n * @param {?} value\n * @param {?} unit\n * @param {?} sourceSpan\n */\n constructor(name, type, securityContext, value, unit, sourceSpan) {\n this.name = name;\n this.type = type;\n this.securityContext = securityContext;\n this.value = value;\n this.unit = unit;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitElementProperty(this, context);\n }\n /**\n * @return {?}\n */\n get isAnimation() { return this.type === PropertyBindingType.Animation; }\n}\nfunction BoundElementPropertyAst_tsickle_Closure_declarations() {\n /** @type {?} */\n BoundElementPropertyAst.prototype.name;\n /** @type {?} */\n BoundElementPropertyAst.prototype.type;\n /** @type {?} */\n BoundElementPropertyAst.prototype.securityContext;\n /** @type {?} */\n BoundElementPropertyAst.prototype.value;\n /** @type {?} */\n BoundElementPropertyAst.prototype.unit;\n /** @type {?} */\n BoundElementPropertyAst.prototype.sourceSpan;\n}\n/**\n * A binding for an element event (e.g. `(event)=\"handler()\"`) or an animation trigger event (e.g.\n * `(\\@trigger.phase)=\"callback($event)\"`).\n */\nexport class BoundEventAst {\n /**\n * @param {?} name\n * @param {?} target\n * @param {?} phase\n * @param {?} handler\n * @param {?} sourceSpan\n */\n constructor(name, target, phase, handler, sourceSpan) {\n this.name = name;\n this.target = target;\n this.phase = phase;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} name\n * @param {?} target\n * @param {?} phase\n * @return {?}\n */\n static calcFullName(name, target, phase) {\n if (target) {\n return `${target}:${name}`;\n }\n else if (phase) {\n return `@${name}.${phase}`;\n }\n else {\n return name;\n }\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitEvent(this, context);\n }\n /**\n * @return {?}\n */\n get fullName() { return BoundEventAst.calcFullName(this.name, this.target, this.phase); }\n /**\n * @return {?}\n */\n get isAnimation() { return !!this.phase; }\n}\nfunction BoundEventAst_tsickle_Closure_declarations() {\n /** @type {?} */\n BoundEventAst.prototype.name;\n /** @type {?} */\n BoundEventAst.prototype.target;\n /** @type {?} */\n BoundEventAst.prototype.phase;\n /** @type {?} */\n BoundEventAst.prototype.handler;\n /** @type {?} */\n BoundEventAst.prototype.sourceSpan;\n}\n/**\n * A reference declaration on an element (e.g. `let someName=\"expression\"`).\n */\nexport class ReferenceAst {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(name, value, sourceSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitReference(this, context);\n }\n}\nfunction ReferenceAst_tsickle_Closure_declarations() {\n /** @type {?} */\n ReferenceAst.prototype.name;\n /** @type {?} */\n ReferenceAst.prototype.value;\n /** @type {?} */\n ReferenceAst.prototype.sourceSpan;\n}\n/**\n * A variable declaration on a (e.g. `var-someName=\"someLocalName\"`).\n */\nexport class VariableAst {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(name, value, sourceSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitVariable(this, context);\n }\n}\nfunction VariableAst_tsickle_Closure_declarations() {\n /** @type {?} */\n VariableAst.prototype.name;\n /** @type {?} */\n VariableAst.prototype.value;\n /** @type {?} */\n VariableAst.prototype.sourceSpan;\n}\n/**\n * An element declaration in a template.\n */\nexport class ElementAst {\n /**\n * @param {?} name\n * @param {?} attrs\n * @param {?} inputs\n * @param {?} outputs\n * @param {?} references\n * @param {?} directives\n * @param {?} providers\n * @param {?} hasViewContainer\n * @param {?} queryMatches\n * @param {?} children\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n * @param {?} endSourceSpan\n */\n constructor(name, attrs, inputs, outputs, references, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan, endSourceSpan) {\n this.name = name;\n this.attrs = attrs;\n this.inputs = inputs;\n this.outputs = outputs;\n this.references = references;\n this.directives = directives;\n this.providers = providers;\n this.hasViewContainer = hasViewContainer;\n this.queryMatches = queryMatches;\n this.children = children;\n this.ngContentIndex = ngContentIndex;\n this.sourceSpan = sourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitElement(this, context);\n }\n}\nfunction ElementAst_tsickle_Closure_declarations() {\n /** @type {?} */\n ElementAst.prototype.name;\n /** @type {?} */\n ElementAst.prototype.attrs;\n /** @type {?} */\n ElementAst.prototype.inputs;\n /** @type {?} */\n ElementAst.prototype.outputs;\n /** @type {?} */\n ElementAst.prototype.references;\n /** @type {?} */\n ElementAst.prototype.directives;\n /** @type {?} */\n ElementAst.prototype.providers;\n /** @type {?} */\n ElementAst.prototype.hasViewContainer;\n /** @type {?} */\n ElementAst.prototype.queryMatches;\n /** @type {?} */\n ElementAst.prototype.children;\n /** @type {?} */\n ElementAst.prototype.ngContentIndex;\n /** @type {?} */\n ElementAst.prototype.sourceSpan;\n /** @type {?} */\n ElementAst.prototype.endSourceSpan;\n}\n/**\n * A `` element included in an Angular template.\n */\nexport class EmbeddedTemplateAst {\n /**\n * @param {?} attrs\n * @param {?} outputs\n * @param {?} references\n * @param {?} variables\n * @param {?} directives\n * @param {?} providers\n * @param {?} hasViewContainer\n * @param {?} queryMatches\n * @param {?} children\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n constructor(attrs, outputs, references, variables, directives, providers, hasViewContainer, queryMatches, children, ngContentIndex, sourceSpan) {\n this.attrs = attrs;\n this.outputs = outputs;\n this.references = references;\n this.variables = variables;\n this.directives = directives;\n this.providers = providers;\n this.hasViewContainer = hasViewContainer;\n this.queryMatches = queryMatches;\n this.children = children;\n this.ngContentIndex = ngContentIndex;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitEmbeddedTemplate(this, context);\n }\n}\nfunction EmbeddedTemplateAst_tsickle_Closure_declarations() {\n /** @type {?} */\n EmbeddedTemplateAst.prototype.attrs;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.outputs;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.references;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.variables;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.directives;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.providers;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.hasViewContainer;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.queryMatches;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.children;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.ngContentIndex;\n /** @type {?} */\n EmbeddedTemplateAst.prototype.sourceSpan;\n}\n/**\n * A directive property with a bound value (e.g. `*ngIf=\"condition\").\n */\nexport class BoundDirectivePropertyAst {\n /**\n * @param {?} directiveName\n * @param {?} templateName\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(directiveName, templateName, value, sourceSpan) {\n this.directiveName = directiveName;\n this.templateName = templateName;\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitDirectiveProperty(this, context);\n }\n}\nfunction BoundDirectivePropertyAst_tsickle_Closure_declarations() {\n /** @type {?} */\n BoundDirectivePropertyAst.prototype.directiveName;\n /** @type {?} */\n BoundDirectivePropertyAst.prototype.templateName;\n /** @type {?} */\n BoundDirectivePropertyAst.prototype.value;\n /** @type {?} */\n BoundDirectivePropertyAst.prototype.sourceSpan;\n}\n/**\n * A directive declared on an element.\n */\nexport class DirectiveAst {\n /**\n * @param {?} directive\n * @param {?} inputs\n * @param {?} hostProperties\n * @param {?} hostEvents\n * @param {?} contentQueryStartId\n * @param {?} sourceSpan\n */\n constructor(directive, inputs, hostProperties, hostEvents, contentQueryStartId, sourceSpan) {\n this.directive = directive;\n this.inputs = inputs;\n this.hostProperties = hostProperties;\n this.hostEvents = hostEvents;\n this.contentQueryStartId = contentQueryStartId;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitDirective(this, context);\n }\n}\nfunction DirectiveAst_tsickle_Closure_declarations() {\n /** @type {?} */\n DirectiveAst.prototype.directive;\n /** @type {?} */\n DirectiveAst.prototype.inputs;\n /** @type {?} */\n DirectiveAst.prototype.hostProperties;\n /** @type {?} */\n DirectiveAst.prototype.hostEvents;\n /** @type {?} */\n DirectiveAst.prototype.contentQueryStartId;\n /** @type {?} */\n DirectiveAst.prototype.sourceSpan;\n}\n/**\n * A provider declared on an element\n */\nexport class ProviderAst {\n /**\n * @param {?} token\n * @param {?} multiProvider\n * @param {?} eager\n * @param {?} providers\n * @param {?} providerType\n * @param {?} lifecycleHooks\n * @param {?} sourceSpan\n */\n constructor(token, multiProvider, eager, providers, providerType, lifecycleHooks, sourceSpan) {\n this.token = token;\n this.multiProvider = multiProvider;\n this.eager = eager;\n this.providers = providers;\n this.providerType = providerType;\n this.lifecycleHooks = lifecycleHooks;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n // No visit method in the visitor for now...\n return null;\n }\n}\nfunction ProviderAst_tsickle_Closure_declarations() {\n /** @type {?} */\n ProviderAst.prototype.token;\n /** @type {?} */\n ProviderAst.prototype.multiProvider;\n /** @type {?} */\n ProviderAst.prototype.eager;\n /** @type {?} */\n ProviderAst.prototype.providers;\n /** @type {?} */\n ProviderAst.prototype.providerType;\n /** @type {?} */\n ProviderAst.prototype.lifecycleHooks;\n /** @type {?} */\n ProviderAst.prototype.sourceSpan;\n}\nexport let ProviderAstType = {};\nProviderAstType.PublicService = 0;\nProviderAstType.PrivateService = 1;\nProviderAstType.Component = 2;\nProviderAstType.Directive = 3;\nProviderAstType.Builtin = 4;\nProviderAstType[ProviderAstType.PublicService] = \"PublicService\";\nProviderAstType[ProviderAstType.PrivateService] = \"PrivateService\";\nProviderAstType[ProviderAstType.Component] = \"Component\";\nProviderAstType[ProviderAstType.Directive] = \"Directive\";\nProviderAstType[ProviderAstType.Builtin] = \"Builtin\";\n/**\n * Position where content is to be projected (instance of `` in a template).\n */\nexport class NgContentAst {\n /**\n * @param {?} index\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n constructor(index, ngContentIndex, sourceSpan) {\n this.index = index;\n this.ngContentIndex = ngContentIndex;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) {\n return visitor.visitNgContent(this, context);\n }\n}\nfunction NgContentAst_tsickle_Closure_declarations() {\n /** @type {?} */\n NgContentAst.prototype.index;\n /** @type {?} */\n NgContentAst.prototype.ngContentIndex;\n /** @type {?} */\n NgContentAst.prototype.sourceSpan;\n}\nexport let PropertyBindingType = {};\nPropertyBindingType.Property = 0;\nPropertyBindingType.Attribute = 1;\nPropertyBindingType.Class = 2;\nPropertyBindingType.Style = 3;\nPropertyBindingType.Animation = 4;\nPropertyBindingType[PropertyBindingType.Property] = \"Property\";\nPropertyBindingType[PropertyBindingType.Attribute] = \"Attribute\";\nPropertyBindingType[PropertyBindingType.Class] = \"Class\";\nPropertyBindingType[PropertyBindingType.Style] = \"Style\";\nPropertyBindingType[PropertyBindingType.Animation] = \"Animation\";\n/**\n * A visitor that accepts each node but doesn't do anything. It is intended to be used\n * as the base class for a visitor that is only interested in a subset of the node types.\n */\nexport class NullTemplateVisitor {\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitNgContent(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitEmbeddedTemplate(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitElement(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitReference(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitVariable(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitEvent(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitElementProperty(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitAttr(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitBoundText(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitText(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitDirective(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitDirectiveProperty(ast, context) { }\n}\n/**\n * Base class that can be used to build a visitor that visits each node\n * in an template ast recursively.\n */\nexport class RecursiveTemplateAstVisitor extends NullTemplateVisitor {\n constructor() { super(); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitEmbeddedTemplate(ast, context) {\n return this.visitChildren(context, visit => {\n visit(ast.attrs);\n visit(ast.references);\n visit(ast.variables);\n visit(ast.directives);\n visit(ast.providers);\n visit(ast.children);\n });\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitElement(ast, context) {\n return this.visitChildren(context, visit => {\n visit(ast.attrs);\n visit(ast.inputs);\n visit(ast.outputs);\n visit(ast.references);\n visit(ast.directives);\n visit(ast.providers);\n visit(ast.children);\n });\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitDirective(ast, context) {\n return this.visitChildren(context, visit => {\n visit(ast.inputs);\n visit(ast.hostProperties);\n visit(ast.hostEvents);\n });\n }\n /**\n * @template T\n * @param {?} context\n * @param {?} cb\n * @return {?}\n */\n visitChildren(context, cb) {\n let /** @type {?} */ results = [];\n let /** @type {?} */ t = this;\n /**\n * @template T\n * @param {?} children\n * @return {?}\n */\n function visit(children) {\n if (children && children.length)\n results.push(templateVisitAll(t, children, context));\n }\n cb(visit);\n return [].concat.apply([], results);\n }\n}\n/**\n * Visit every node in a list of {\\@link TemplateAst}s with the given {\\@link TemplateAstVisitor}.\n * @param {?} visitor\n * @param {?} asts\n * @param {?=} context\n * @return {?}\n */\nexport function templateVisitAll(visitor, asts, context = null) {\n const /** @type {?} */ result = [];\n const /** @type {?} */ visit = visitor.visit ?\n (ast) => ((visitor.visit))(ast, context) || ast.visit(visitor, context) :\n (ast) => ast.visit(visitor, context);\n asts.forEach(ast => {\n const /** @type {?} */ astResult = visit(ast);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\n//# sourceMappingURL=template_ast.js.map","/**\n * A token representing the a reference to a static type.\n *\n * This token is unique for a filePath and name and can be used as a hash table key.\n */\nexport class StaticSymbol {\n /**\n * @param {?} filePath\n * @param {?} name\n * @param {?} members\n */\n constructor(filePath, name, members) {\n this.filePath = filePath;\n this.name = name;\n this.members = members;\n }\n /**\n * @return {?}\n */\n assertNoMembers() {\n if (this.members.length) {\n throw new Error(`Illegal state: symbol without members expected, but got ${JSON.stringify(this)}.`);\n }\n }\n}\nfunction StaticSymbol_tsickle_Closure_declarations() {\n /** @type {?} */\n StaticSymbol.prototype.filePath;\n /** @type {?} */\n StaticSymbol.prototype.name;\n /** @type {?} */\n StaticSymbol.prototype.members;\n}\n/**\n * A cache of static symbol used by the StaticReflector to return the same symbol for the\n * same symbol values.\n */\nexport class StaticSymbolCache {\n constructor() {\n this.cache = new Map();\n }\n /**\n * @param {?} declarationFile\n * @param {?} name\n * @param {?=} members\n * @return {?}\n */\n get(declarationFile, name, members) {\n members = members || [];\n const /** @type {?} */ memberSuffix = members.length ? `.${members.join('.')}` : '';\n const /** @type {?} */ key = `\"${declarationFile}\".${name}${memberSuffix}`;\n let /** @type {?} */ result = this.cache.get(key);\n if (!result) {\n result = new StaticSymbol(declarationFile, name, members);\n this.cache.set(key, result);\n }\n return result;\n }\n}\nfunction StaticSymbolCache_tsickle_Closure_declarations() {\n /** @type {?} */\n StaticSymbolCache.prototype.cache;\n}\n//# sourceMappingURL=static_symbol.js.map","export let TagContentType = {};\nTagContentType.RAW_TEXT = 0;\nTagContentType.ESCAPABLE_RAW_TEXT = 1;\nTagContentType.PARSABLE_DATA = 2;\nTagContentType[TagContentType.RAW_TEXT] = \"RAW_TEXT\";\nTagContentType[TagContentType.ESCAPABLE_RAW_TEXT] = \"ESCAPABLE_RAW_TEXT\";\nTagContentType[TagContentType.PARSABLE_DATA] = \"PARSABLE_DATA\";\n/**\n * @param {?} elementName\n * @return {?}\n */\nexport function splitNsName(elementName) {\n if (elementName[0] != ':') {\n return [null, elementName];\n }\n const /** @type {?} */ colonIndex = elementName.indexOf(':', 1);\n if (colonIndex == -1) {\n throw new Error(`Unsupported format \"${elementName}\" expecting \":namespace:name\"`);\n }\n return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nexport function isNgContainer(tagName) {\n return splitNsName(tagName)[1] === 'ng-container';\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nexport function isNgContent(tagName) {\n return splitNsName(tagName)[1] === 'ng-content';\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nexport function isNgTemplate(tagName) {\n return splitNsName(tagName)[1] === 'ng-template';\n}\n/**\n * @param {?} fullName\n * @return {?}\n */\nexport function getNsPrefix(fullName) {\n return fullName === null ? null : splitNsName(fullName)[0];\n}\n/**\n * @param {?} prefix\n * @param {?} localName\n * @return {?}\n */\nexport function mergeNsAndName(prefix, localName) {\n return prefix ? `:${prefix}:${localName}` : localName;\n}\n// see http://www.w3.org/TR/html51/syntax.html#named-character-references\n// see https://html.spec.whatwg.org/multipage/entities.json\n// This list is not exhaustive to keep the compiler footprint low.\n// The `{` / `ƫ` syntax should be used when the named character reference does not\n// exist.\nexport const /** @type {?} */ NAMED_ENTITIES = {\n 'Aacute': '\\u00C1',\n 'aacute': '\\u00E1',\n 'Acirc': '\\u00C2',\n 'acirc': '\\u00E2',\n 'acute': '\\u00B4',\n 'AElig': '\\u00C6',\n 'aelig': '\\u00E6',\n 'Agrave': '\\u00C0',\n 'agrave': '\\u00E0',\n 'alefsym': '\\u2135',\n 'Alpha': '\\u0391',\n 'alpha': '\\u03B1',\n 'amp': '&',\n 'and': '\\u2227',\n 'ang': '\\u2220',\n 'apos': '\\u0027',\n 'Aring': '\\u00C5',\n 'aring': '\\u00E5',\n 'asymp': '\\u2248',\n 'Atilde': '\\u00C3',\n 'atilde': '\\u00E3',\n 'Auml': '\\u00C4',\n 'auml': '\\u00E4',\n 'bdquo': '\\u201E',\n 'Beta': '\\u0392',\n 'beta': '\\u03B2',\n 'brvbar': '\\u00A6',\n 'bull': '\\u2022',\n 'cap': '\\u2229',\n 'Ccedil': '\\u00C7',\n 'ccedil': '\\u00E7',\n 'cedil': '\\u00B8',\n 'cent': '\\u00A2',\n 'Chi': '\\u03A7',\n 'chi': '\\u03C7',\n 'circ': '\\u02C6',\n 'clubs': '\\u2663',\n 'cong': '\\u2245',\n 'copy': '\\u00A9',\n 'crarr': '\\u21B5',\n 'cup': '\\u222A',\n 'curren': '\\u00A4',\n 'dagger': '\\u2020',\n 'Dagger': '\\u2021',\n 'darr': '\\u2193',\n 'dArr': '\\u21D3',\n 'deg': '\\u00B0',\n 'Delta': '\\u0394',\n 'delta': '\\u03B4',\n 'diams': '\\u2666',\n 'divide': '\\u00F7',\n 'Eacute': '\\u00C9',\n 'eacute': '\\u00E9',\n 'Ecirc': '\\u00CA',\n 'ecirc': '\\u00EA',\n 'Egrave': '\\u00C8',\n 'egrave': '\\u00E8',\n 'empty': '\\u2205',\n 'emsp': '\\u2003',\n 'ensp': '\\u2002',\n 'Epsilon': '\\u0395',\n 'epsilon': '\\u03B5',\n 'equiv': '\\u2261',\n 'Eta': '\\u0397',\n 'eta': '\\u03B7',\n 'ETH': '\\u00D0',\n 'eth': '\\u00F0',\n 'Euml': '\\u00CB',\n 'euml': '\\u00EB',\n 'euro': '\\u20AC',\n 'exist': '\\u2203',\n 'fnof': '\\u0192',\n 'forall': '\\u2200',\n 'frac12': '\\u00BD',\n 'frac14': '\\u00BC',\n 'frac34': '\\u00BE',\n 'frasl': '\\u2044',\n 'Gamma': '\\u0393',\n 'gamma': '\\u03B3',\n 'ge': '\\u2265',\n 'gt': '>',\n 'harr': '\\u2194',\n 'hArr': '\\u21D4',\n 'hearts': '\\u2665',\n 'hellip': '\\u2026',\n 'Iacute': '\\u00CD',\n 'iacute': '\\u00ED',\n 'Icirc': '\\u00CE',\n 'icirc': '\\u00EE',\n 'iexcl': '\\u00A1',\n 'Igrave': '\\u00CC',\n 'igrave': '\\u00EC',\n 'image': '\\u2111',\n 'infin': '\\u221E',\n 'int': '\\u222B',\n 'Iota': '\\u0399',\n 'iota': '\\u03B9',\n 'iquest': '\\u00BF',\n 'isin': '\\u2208',\n 'Iuml': '\\u00CF',\n 'iuml': '\\u00EF',\n 'Kappa': '\\u039A',\n 'kappa': '\\u03BA',\n 'Lambda': '\\u039B',\n 'lambda': '\\u03BB',\n 'lang': '\\u27E8',\n 'laquo': '\\u00AB',\n 'larr': '\\u2190',\n 'lArr': '\\u21D0',\n 'lceil': '\\u2308',\n 'ldquo': '\\u201C',\n 'le': '\\u2264',\n 'lfloor': '\\u230A',\n 'lowast': '\\u2217',\n 'loz': '\\u25CA',\n 'lrm': '\\u200E',\n 'lsaquo': '\\u2039',\n 'lsquo': '\\u2018',\n 'lt': '<',\n 'macr': '\\u00AF',\n 'mdash': '\\u2014',\n 'micro': '\\u00B5',\n 'middot': '\\u00B7',\n 'minus': '\\u2212',\n 'Mu': '\\u039C',\n 'mu': '\\u03BC',\n 'nabla': '\\u2207',\n 'nbsp': '\\u00A0',\n 'ndash': '\\u2013',\n 'ne': '\\u2260',\n 'ni': '\\u220B',\n 'not': '\\u00AC',\n 'notin': '\\u2209',\n 'nsub': '\\u2284',\n 'Ntilde': '\\u00D1',\n 'ntilde': '\\u00F1',\n 'Nu': '\\u039D',\n 'nu': '\\u03BD',\n 'Oacute': '\\u00D3',\n 'oacute': '\\u00F3',\n 'Ocirc': '\\u00D4',\n 'ocirc': '\\u00F4',\n 'OElig': '\\u0152',\n 'oelig': '\\u0153',\n 'Ograve': '\\u00D2',\n 'ograve': '\\u00F2',\n 'oline': '\\u203E',\n 'Omega': '\\u03A9',\n 'omega': '\\u03C9',\n 'Omicron': '\\u039F',\n 'omicron': '\\u03BF',\n 'oplus': '\\u2295',\n 'or': '\\u2228',\n 'ordf': '\\u00AA',\n 'ordm': '\\u00BA',\n 'Oslash': '\\u00D8',\n 'oslash': '\\u00F8',\n 'Otilde': '\\u00D5',\n 'otilde': '\\u00F5',\n 'otimes': '\\u2297',\n 'Ouml': '\\u00D6',\n 'ouml': '\\u00F6',\n 'para': '\\u00B6',\n 'permil': '\\u2030',\n 'perp': '\\u22A5',\n 'Phi': '\\u03A6',\n 'phi': '\\u03C6',\n 'Pi': '\\u03A0',\n 'pi': '\\u03C0',\n 'piv': '\\u03D6',\n 'plusmn': '\\u00B1',\n 'pound': '\\u00A3',\n 'prime': '\\u2032',\n 'Prime': '\\u2033',\n 'prod': '\\u220F',\n 'prop': '\\u221D',\n 'Psi': '\\u03A8',\n 'psi': '\\u03C8',\n 'quot': '\\u0022',\n 'radic': '\\u221A',\n 'rang': '\\u27E9',\n 'raquo': '\\u00BB',\n 'rarr': '\\u2192',\n 'rArr': '\\u21D2',\n 'rceil': '\\u2309',\n 'rdquo': '\\u201D',\n 'real': '\\u211C',\n 'reg': '\\u00AE',\n 'rfloor': '\\u230B',\n 'Rho': '\\u03A1',\n 'rho': '\\u03C1',\n 'rlm': '\\u200F',\n 'rsaquo': '\\u203A',\n 'rsquo': '\\u2019',\n 'sbquo': '\\u201A',\n 'Scaron': '\\u0160',\n 'scaron': '\\u0161',\n 'sdot': '\\u22C5',\n 'sect': '\\u00A7',\n 'shy': '\\u00AD',\n 'Sigma': '\\u03A3',\n 'sigma': '\\u03C3',\n 'sigmaf': '\\u03C2',\n 'sim': '\\u223C',\n 'spades': '\\u2660',\n 'sub': '\\u2282',\n 'sube': '\\u2286',\n 'sum': '\\u2211',\n 'sup': '\\u2283',\n 'sup1': '\\u00B9',\n 'sup2': '\\u00B2',\n 'sup3': '\\u00B3',\n 'supe': '\\u2287',\n 'szlig': '\\u00DF',\n 'Tau': '\\u03A4',\n 'tau': '\\u03C4',\n 'there4': '\\u2234',\n 'Theta': '\\u0398',\n 'theta': '\\u03B8',\n 'thetasym': '\\u03D1',\n 'thinsp': '\\u2009',\n 'THORN': '\\u00DE',\n 'thorn': '\\u00FE',\n 'tilde': '\\u02DC',\n 'times': '\\u00D7',\n 'trade': '\\u2122',\n 'Uacute': '\\u00DA',\n 'uacute': '\\u00FA',\n 'uarr': '\\u2191',\n 'uArr': '\\u21D1',\n 'Ucirc': '\\u00DB',\n 'ucirc': '\\u00FB',\n 'Ugrave': '\\u00D9',\n 'ugrave': '\\u00F9',\n 'uml': '\\u00A8',\n 'upsih': '\\u03D2',\n 'Upsilon': '\\u03A5',\n 'upsilon': '\\u03C5',\n 'Uuml': '\\u00DC',\n 'uuml': '\\u00FC',\n 'weierp': '\\u2118',\n 'Xi': '\\u039E',\n 'xi': '\\u03BE',\n 'Yacute': '\\u00DD',\n 'yacute': '\\u00FD',\n 'yen': '\\u00A5',\n 'yuml': '\\u00FF',\n 'Yuml': '\\u0178',\n 'Zeta': '\\u0396',\n 'zeta': '\\u03B6',\n 'zwj': '\\u200D',\n 'zwnj': '\\u200C',\n};\n// The &ngsp; pseudo-entity is denoting a space. see:\n// https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart\nexport const /** @type {?} */ NGSP_UNICODE = '\\uE500';\nNAMED_ENTITIES['ngsp'] = NGSP_UNICODE;\n//# sourceMappingURL=tags.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { TagContentType } from './tags';\nexport class HtmlTagDefinition {\n /**\n * @param {?=} __0\n */\n constructor({ closedByChildren, requiredParents, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false } = {}) {\n this.closedByChildren = {};\n this.closedByParent = false;\n this.canSelfClose = false;\n if (closedByChildren && closedByChildren.length > 0) {\n closedByChildren.forEach(tagName => this.closedByChildren[tagName] = true);\n }\n this.isVoid = isVoid;\n this.closedByParent = closedByParent || isVoid;\n if (requiredParents && requiredParents.length > 0) {\n this.requiredParents = {};\n // The first parent is the list is automatically when none of the listed parents are present\n this.parentToAdd = requiredParents[0];\n requiredParents.forEach(tagName => this.requiredParents[tagName] = true);\n }\n this.implicitNamespacePrefix = implicitNamespacePrefix || null;\n this.contentType = contentType;\n this.ignoreFirstLf = ignoreFirstLf;\n }\n /**\n * @param {?} currentParent\n * @return {?}\n */\n requireExtraParent(currentParent) {\n if (!this.requiredParents) {\n return false;\n }\n if (!currentParent) {\n return true;\n }\n const /** @type {?} */ lcParent = currentParent.toLowerCase();\n const /** @type {?} */ isParentTemplate = lcParent === 'template' || currentParent === 'ng-template';\n return !isParentTemplate && this.requiredParents[lcParent] != true;\n }\n /**\n * @param {?} name\n * @return {?}\n */\n isClosedByChild(name) {\n return this.isVoid || name.toLowerCase() in this.closedByChildren;\n }\n}\nfunction HtmlTagDefinition_tsickle_Closure_declarations() {\n /** @type {?} */\n HtmlTagDefinition.prototype.closedByChildren;\n /** @type {?} */\n HtmlTagDefinition.prototype.closedByParent;\n /** @type {?} */\n HtmlTagDefinition.prototype.requiredParents;\n /** @type {?} */\n HtmlTagDefinition.prototype.parentToAdd;\n /** @type {?} */\n HtmlTagDefinition.prototype.implicitNamespacePrefix;\n /** @type {?} */\n HtmlTagDefinition.prototype.contentType;\n /** @type {?} */\n HtmlTagDefinition.prototype.isVoid;\n /** @type {?} */\n HtmlTagDefinition.prototype.ignoreFirstLf;\n /** @type {?} */\n HtmlTagDefinition.prototype.canSelfClose;\n}\n// see http://www.w3.org/TR/html51/syntax.html#optional-tags\n// This implementation does not fully conform to the HTML5 spec.\nconst /** @type {?} */ TAG_DEFINITIONS = {\n 'base': new HtmlTagDefinition({ isVoid: true }),\n 'meta': new HtmlTagDefinition({ isVoid: true }),\n 'area': new HtmlTagDefinition({ isVoid: true }),\n 'embed': new HtmlTagDefinition({ isVoid: true }),\n 'link': new HtmlTagDefinition({ isVoid: true }),\n 'img': new HtmlTagDefinition({ isVoid: true }),\n 'input': new HtmlTagDefinition({ isVoid: true }),\n 'param': new HtmlTagDefinition({ isVoid: true }),\n 'hr': new HtmlTagDefinition({ isVoid: true }),\n 'br': new HtmlTagDefinition({ isVoid: true }),\n 'source': new HtmlTagDefinition({ isVoid: true }),\n 'track': new HtmlTagDefinition({ isVoid: true }),\n 'wbr': new HtmlTagDefinition({ isVoid: true }),\n 'p': new HtmlTagDefinition({\n closedByChildren: [\n 'address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset', 'footer', 'form',\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr',\n 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'\n ],\n closedByParent: true\n }),\n 'thead': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'] }),\n 'tbody': new HtmlTagDefinition({ closedByChildren: ['tbody', 'tfoot'], closedByParent: true }),\n 'tfoot': new HtmlTagDefinition({ closedByChildren: ['tbody'], closedByParent: true }),\n 'tr': new HtmlTagDefinition({\n closedByChildren: ['tr'],\n requiredParents: ['tbody', 'tfoot', 'thead'],\n closedByParent: true\n }),\n 'td': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),\n 'th': new HtmlTagDefinition({ closedByChildren: ['td', 'th'], closedByParent: true }),\n 'col': new HtmlTagDefinition({ requiredParents: ['colgroup'], isVoid: true }),\n 'svg': new HtmlTagDefinition({ implicitNamespacePrefix: 'svg' }),\n 'math': new HtmlTagDefinition({ implicitNamespacePrefix: 'math' }),\n 'li': new HtmlTagDefinition({ closedByChildren: ['li'], closedByParent: true }),\n 'dt': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'] }),\n 'dd': new HtmlTagDefinition({ closedByChildren: ['dt', 'dd'], closedByParent: true }),\n 'rb': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n 'rt': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n 'rtc': new HtmlTagDefinition({ closedByChildren: ['rb', 'rtc', 'rp'], closedByParent: true }),\n 'rp': new HtmlTagDefinition({ closedByChildren: ['rb', 'rt', 'rtc', 'rp'], closedByParent: true }),\n 'optgroup': new HtmlTagDefinition({ closedByChildren: ['optgroup'], closedByParent: true }),\n 'option': new HtmlTagDefinition({ closedByChildren: ['option', 'optgroup'], closedByParent: true }),\n 'pre': new HtmlTagDefinition({ ignoreFirstLf: true }),\n 'listing': new HtmlTagDefinition({ ignoreFirstLf: true }),\n 'style': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),\n 'script': new HtmlTagDefinition({ contentType: TagContentType.RAW_TEXT }),\n 'title': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT }),\n 'textarea': new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true }),\n};\nconst /** @type {?} */ _DEFAULT_TAG_DEFINITION = new HtmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nexport function getHtmlTagDefinition(tagName) {\n return TAG_DEFINITIONS[tagName.toLowerCase()] || _DEFAULT_TAG_DEFINITION;\n}\n//# sourceMappingURL=html_tags.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { getHtmlTagDefinition } from './ml_parser/html_tags';\nconst /** @type {?} */ _SELECTOR_REGEXP = new RegExp('(\\\\:not\\\\()|' +\n '([-\\\\w]+)|' +\n '(?:\\\\.([-\\\\w]+))|' +\n // \"-\" should appear first in the regexp below as FF31 parses \"[.-\\w]\" as a range\n '(?:\\\\[([-.\\\\w*]+)(?:=([\\\"\\']?)([^\\\\]\\\"\\']*)\\\\5)?\\\\])|' +\n // \"[name=\"value\"]\",\n // \"[name='value']\"\n '(\\\\))|' +\n '(\\\\s*,\\\\s*)', // \",\"\n'g');\n/**\n * A css selector contains an element name,\n * css classes and attribute/value pairs with the purpose\n * of selecting subsets out of them.\n */\nexport class CssSelector {\n constructor() {\n this.element = null;\n this.classNames = [];\n this.attrs = [];\n this.notSelectors = [];\n }\n /**\n * @param {?} selector\n * @return {?}\n */\n static parse(selector) {\n const /** @type {?} */ results = [];\n const /** @type {?} */ _addResult = (res, cssSel) => {\n if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 &&\n cssSel.attrs.length == 0) {\n cssSel.element = '*';\n }\n res.push(cssSel);\n };\n let /** @type {?} */ cssSelector = new CssSelector();\n let /** @type {?} */ match;\n let /** @type {?} */ current = cssSelector;\n let /** @type {?} */ inNot = false;\n _SELECTOR_REGEXP.lastIndex = 0;\n while (match = _SELECTOR_REGEXP.exec(selector)) {\n if (match[1]) {\n if (inNot) {\n throw new Error('Nesting :not is not allowed in a selector');\n }\n inNot = true;\n current = new CssSelector();\n cssSelector.notSelectors.push(current);\n }\n if (match[2]) {\n current.setElement(match[2]);\n }\n if (match[3]) {\n current.addClassName(match[3]);\n }\n if (match[4]) {\n current.addAttribute(match[4], match[6]);\n }\n if (match[7]) {\n inNot = false;\n current = cssSelector;\n }\n if (match[8]) {\n if (inNot) {\n throw new Error('Multiple selectors in :not are not supported');\n }\n _addResult(results, cssSelector);\n cssSelector = current = new CssSelector();\n }\n }\n _addResult(results, cssSelector);\n return results;\n }\n /**\n * @return {?}\n */\n isElementSelector() {\n return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&\n this.notSelectors.length === 0;\n }\n /**\n * @return {?}\n */\n hasElementSelector() { return !!this.element; }\n /**\n * @param {?=} element\n * @return {?}\n */\n setElement(element = null) { this.element = element; }\n /**\n * Gets a template string for an element that matches the selector.\n * @return {?}\n */\n getMatchingElementTemplate() {\n const /** @type {?} */ tagName = this.element || 'div';\n const /** @type {?} */ classAttr = this.classNames.length > 0 ? ` class=\"${this.classNames.join(' ')}\"` : '';\n let /** @type {?} */ attrs = '';\n for (let /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n const /** @type {?} */ attrName = this.attrs[i];\n const /** @type {?} */ attrValue = this.attrs[i + 1] !== '' ? `=\"${this.attrs[i + 1]}\"` : '';\n attrs += ` ${attrName}${attrValue}`;\n }\n return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs}/>` :\n `<${tagName}${classAttr}${attrs}>`;\n }\n /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n addAttribute(name, value = '') {\n this.attrs.push(name, value && value.toLowerCase() || '');\n }\n /**\n * @param {?} name\n * @return {?}\n */\n addClassName(name) { this.classNames.push(name.toLowerCase()); }\n /**\n * @return {?}\n */\n toString() {\n let /** @type {?} */ res = this.element || '';\n if (this.classNames) {\n this.classNames.forEach(klass => res += `.${klass}`);\n }\n if (this.attrs) {\n for (let /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n const /** @type {?} */ name = this.attrs[i];\n const /** @type {?} */ value = this.attrs[i + 1];\n res += `[${name}${value ? '=' + value : ''}]`;\n }\n }\n this.notSelectors.forEach(notSelector => res += `:not(${notSelector})`);\n return res;\n }\n}\nfunction CssSelector_tsickle_Closure_declarations() {\n /** @type {?} */\n CssSelector.prototype.element;\n /** @type {?} */\n CssSelector.prototype.classNames;\n /** @type {?} */\n CssSelector.prototype.attrs;\n /** @type {?} */\n CssSelector.prototype.notSelectors;\n}\n/**\n * Reads a list of CssSelectors and allows to calculate which ones\n * are contained in a given CssSelector.\n */\nexport class SelectorMatcher {\n constructor() {\n this._elementMap = new Map();\n this._elementPartialMap = new Map();\n this._classMap = new Map();\n this._classPartialMap = new Map();\n this._attrValueMap = new Map();\n this._attrValuePartialMap = new Map();\n this._listContexts = [];\n }\n /**\n * @param {?} notSelectors\n * @return {?}\n */\n static createNotMatcher(notSelectors) {\n const /** @type {?} */ notMatcher = new SelectorMatcher();\n notMatcher.addSelectables(notSelectors, null);\n return notMatcher;\n }\n /**\n * @param {?} cssSelectors\n * @param {?=} callbackCtxt\n * @return {?}\n */\n addSelectables(cssSelectors, callbackCtxt) {\n let /** @type {?} */ listContext = ((null));\n if (cssSelectors.length > 1) {\n listContext = new SelectorListContext(cssSelectors);\n this._listContexts.push(listContext);\n }\n for (let /** @type {?} */ i = 0; i < cssSelectors.length; i++) {\n this._addSelectable(cssSelectors[i], callbackCtxt, listContext);\n }\n }\n /**\n * Add an object that can be found later on by calling `match`.\n * @param {?} cssSelector A css selector\n * @param {?} callbackCtxt An opaque object that will be given to the callback of the `match` function\n * @param {?} listContext\n * @return {?}\n */\n _addSelectable(cssSelector, callbackCtxt, listContext) {\n let /** @type {?} */ matcher = this;\n const /** @type {?} */ element = cssSelector.element;\n const /** @type {?} */ classNames = cssSelector.classNames;\n const /** @type {?} */ attrs = cssSelector.attrs;\n const /** @type {?} */ selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const /** @type {?} */ isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let /** @type {?} */ i = 0; i < classNames.length; i++) {\n const /** @type {?} */ isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const /** @type {?} */ className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n const /** @type {?} */ isTerminal = i === attrs.length - 2;\n const /** @type {?} */ name = attrs[i];\n const /** @type {?} */ value = attrs[i + 1];\n if (isTerminal) {\n const /** @type {?} */ terminalMap = matcher._attrValueMap;\n let /** @type {?} */ terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const /** @type {?} */ partialMap = matcher._attrValuePartialMap;\n let /** @type {?} */ partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }\n /**\n * @param {?} map\n * @param {?} name\n * @param {?} selectable\n * @return {?}\n */\n _addTerminal(map, name, selectable) {\n let /** @type {?} */ terminalList = map.get(name);\n if (!terminalList) {\n terminalList = [];\n map.set(name, terminalList);\n }\n terminalList.push(selectable);\n }\n /**\n * @param {?} map\n * @param {?} name\n * @return {?}\n */\n _addPartial(map, name) {\n let /** @type {?} */ matcher = map.get(name);\n if (!matcher) {\n matcher = new SelectorMatcher();\n map.set(name, matcher);\n }\n return matcher;\n }\n /**\n * Find the objects that have been added via `addSelectable`\n * whose css selector is contained in the given css selector.\n * @param {?} cssSelector A css selector\n * @param {?} matchedCallback This callback will be called with the object handed into `addSelectable`\n * @return {?} boolean true if a match was found\n */\n match(cssSelector, matchedCallback) {\n let /** @type {?} */ result = false;\n const /** @type {?} */ element = ((cssSelector.element));\n const /** @type {?} */ classNames = cssSelector.classNames;\n const /** @type {?} */ attrs = cssSelector.attrs;\n for (let /** @type {?} */ i = 0; i < this._listContexts.length; i++) {\n this._listContexts[i].alreadyMatched = false;\n }\n result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;\n result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) ||\n result;\n if (classNames) {\n for (let /** @type {?} */ i = 0; i < classNames.length; i++) {\n const /** @type {?} */ className = classNames[i];\n result =\n this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;\n result =\n this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||\n result;\n }\n }\n if (attrs) {\n for (let /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n const /** @type {?} */ name = attrs[i];\n const /** @type {?} */ value = attrs[i + 1];\n const /** @type {?} */ terminalValuesMap = ((this._attrValueMap.get(name)));\n if (value) {\n result =\n this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;\n const /** @type {?} */ partialValuesMap = ((this._attrValuePartialMap.get(name)));\n if (value) {\n result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;\n }\n }\n return result;\n }\n /**\n * \\@internal\n * @param {?} map\n * @param {?} name\n * @param {?} cssSelector\n * @param {?} matchedCallback\n * @return {?}\n */\n _matchTerminal(map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n let /** @type {?} */ selectables = map.get(name) || [];\n const /** @type {?} */ starSelectables = ((map.get('*')));\n if (starSelectables) {\n selectables = selectables.concat(starSelectables);\n }\n if (selectables.length === 0) {\n return false;\n }\n let /** @type {?} */ selectable;\n let /** @type {?} */ result = false;\n for (let /** @type {?} */ i = 0; i < selectables.length; i++) {\n selectable = selectables[i];\n result = selectable.finalize(cssSelector, matchedCallback) || result;\n }\n return result;\n }\n /**\n * \\@internal\n * @param {?} map\n * @param {?} name\n * @param {?} cssSelector\n * @param {?} matchedCallback\n * @return {?}\n */\n _matchPartial(map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n const /** @type {?} */ nestedSelector = map.get(name);\n if (!nestedSelector) {\n return false;\n }\n // TODO(perf): get rid of recursion and measure again\n // TODO(perf): don't pass the whole selector into the recursion,\n // but only the not processed parts\n return nestedSelector.match(cssSelector, matchedCallback);\n }\n}\nfunction SelectorMatcher_tsickle_Closure_declarations() {\n /** @type {?} */\n SelectorMatcher.prototype._elementMap;\n /** @type {?} */\n SelectorMatcher.prototype._elementPartialMap;\n /** @type {?} */\n SelectorMatcher.prototype._classMap;\n /** @type {?} */\n SelectorMatcher.prototype._classPartialMap;\n /** @type {?} */\n SelectorMatcher.prototype._attrValueMap;\n /** @type {?} */\n SelectorMatcher.prototype._attrValuePartialMap;\n /** @type {?} */\n SelectorMatcher.prototype._listContexts;\n}\nexport class SelectorListContext {\n /**\n * @param {?} selectors\n */\n constructor(selectors) {\n this.selectors = selectors;\n this.alreadyMatched = false;\n }\n}\nfunction SelectorListContext_tsickle_Closure_declarations() {\n /** @type {?} */\n SelectorListContext.prototype.alreadyMatched;\n /** @type {?} */\n SelectorListContext.prototype.selectors;\n}\nexport class SelectorContext {\n /**\n * @param {?} selector\n * @param {?} cbContext\n * @param {?} listContext\n */\n constructor(selector, cbContext, listContext) {\n this.selector = selector;\n this.cbContext = cbContext;\n this.listContext = listContext;\n this.notSelectors = selector.notSelectors;\n }\n /**\n * @param {?} cssSelector\n * @param {?} callback\n * @return {?}\n */\n finalize(cssSelector, callback) {\n let /** @type {?} */ result = true;\n if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n const /** @type {?} */ notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);\n result = !notMatcher.match(cssSelector, null);\n }\n if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {\n if (this.listContext) {\n this.listContext.alreadyMatched = true;\n }\n callback(this.selector, this.cbContext);\n }\n return result;\n }\n}\nfunction SelectorContext_tsickle_Closure_declarations() {\n /** @type {?} */\n SelectorContext.prototype.notSelectors;\n /** @type {?} */\n SelectorContext.prototype.selector;\n /** @type {?} */\n SelectorContext.prototype.cbContext;\n /** @type {?} */\n SelectorContext.prototype.listContext;\n}\n//# sourceMappingURL=selector.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ɵisPromise as isPromise } from '@angular/core';\nexport const /** @type {?} */ MODULE_SUFFIX = '';\nconst /** @type {?} */ CAMEL_CASE_REGEXP = /([A-Z])/g;\nconst /** @type {?} */ DASH_CASE_REGEXP = /-+([a-z0-9])/g;\n/**\n * @param {?} input\n * @return {?}\n */\nexport function camelCaseToDashCase(input) {\n return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());\n}\n/**\n * @param {?} input\n * @return {?}\n */\nexport function dashCaseToCamelCase(input) {\n return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());\n}\n/**\n * @param {?} input\n * @param {?} defaultValues\n * @return {?}\n */\nexport function splitAtColon(input, defaultValues) {\n return _splitAt(input, ':', defaultValues);\n}\n/**\n * @param {?} input\n * @param {?} defaultValues\n * @return {?}\n */\nexport function splitAtPeriod(input, defaultValues) {\n return _splitAt(input, '.', defaultValues);\n}\n/**\n * @param {?} input\n * @param {?} character\n * @param {?} defaultValues\n * @return {?}\n */\nfunction _splitAt(input, character, defaultValues) {\n const /** @type {?} */ characterIndex = input.indexOf(character);\n if (characterIndex == -1)\n return defaultValues;\n return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];\n}\n/**\n * @param {?} value\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\nexport function visitValue(value, visitor, context) {\n if (Array.isArray(value)) {\n return visitor.visitArray(/** @type {?} */ (value), context);\n }\n if (isStrictStringMap(value)) {\n return visitor.visitStringMap(/** @type {?} */ (value), context);\n }\n if (value == null || typeof value == 'string' || typeof value == 'number' ||\n typeof value == 'boolean') {\n return visitor.visitPrimitive(value, context);\n }\n return visitor.visitOther(value, context);\n}\n/**\n * @param {?} val\n * @return {?}\n */\nexport function isDefined(val) {\n return val !== null && val !== undefined;\n}\n/**\n * @template T\n * @param {?} val\n * @return {?}\n */\nexport function noUndefined(val) {\n return val === undefined ? ((null)) : val;\n}\nexport class ValueTransformer {\n /**\n * @param {?} arr\n * @param {?} context\n * @return {?}\n */\n visitArray(arr, context) {\n return arr.map(value => visitValue(value, this, context));\n }\n /**\n * @param {?} map\n * @param {?} context\n * @return {?}\n */\n visitStringMap(map, context) {\n const /** @type {?} */ result = {};\n Object.keys(map).forEach(key => { result[key] = visitValue(map[key], this, context); });\n return result;\n }\n /**\n * @param {?} value\n * @param {?} context\n * @return {?}\n */\n visitPrimitive(value, context) { return value; }\n /**\n * @param {?} value\n * @param {?} context\n * @return {?}\n */\n visitOther(value, context) { return value; }\n}\nexport const /** @type {?} */ SyncAsync = {\n assertSync: (value) => {\n if (isPromise(value)) {\n throw new Error(`Illegal state: value cannot be a promise`);\n }\n return value;\n },\n then: (value, cb) => { return isPromise(value) ? value.then(cb) : cb(value); },\n all: (syncAsyncValues) => {\n return syncAsyncValues.some(isPromise) ? Promise.all(syncAsyncValues) : (syncAsyncValues);\n }\n};\n/**\n * @param {?} msg\n * @param {?=} parseErrors\n * @return {?}\n */\nexport function syntaxError(msg, parseErrors) {\n const /** @type {?} */ error = Error(msg);\n ((error))[ERROR_SYNTAX_ERROR] = true;\n if (parseErrors)\n ((error))[ERROR_PARSE_ERRORS] = parseErrors;\n return error;\n}\nconst /** @type {?} */ ERROR_SYNTAX_ERROR = 'ngSyntaxError';\nconst /** @type {?} */ ERROR_PARSE_ERRORS = 'ngParseErrors';\n/**\n * @param {?} error\n * @return {?}\n */\nexport function isSyntaxError(error) {\n return ((error))[ERROR_SYNTAX_ERROR];\n}\n/**\n * @param {?} error\n * @return {?}\n */\nexport function getParseErrors(error) {\n return ((error))[ERROR_PARSE_ERRORS] || [];\n}\n/**\n * @param {?} s\n * @return {?}\n */\nexport function escapeRegExp(s) {\n return s.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n}\nconst /** @type {?} */ STRING_MAP_PROTO = Object.getPrototypeOf({});\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction isStrictStringMap(obj) {\n return typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;\n}\n/**\n * @param {?} str\n * @return {?}\n */\nexport function utf8Encode(str) {\n let /** @type {?} */ encoded = '';\n for (let /** @type {?} */ index = 0; index < str.length; index++) {\n let /** @type {?} */ codePoint = str.charCodeAt(index);\n // decode surrogate\n // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {\n const /** @type {?} */ low = str.charCodeAt(index + 1);\n if (low >= 0xdc00 && low <= 0xdfff) {\n index++;\n codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;\n }\n }\n if (codePoint <= 0x7f) {\n encoded += String.fromCharCode(codePoint);\n }\n else if (codePoint <= 0x7ff) {\n encoded += String.fromCharCode(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);\n }\n else if (codePoint <= 0xffff) {\n encoded += String.fromCharCode((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n }\n else if (codePoint <= 0x1fffff) {\n encoded += String.fromCharCode(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);\n }\n }\n return encoded;\n}\n//# sourceMappingURL=util.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ChangeDetectionStrategy, ViewEncapsulation, ɵstringify as stringify } from '@angular/core';\nimport { StaticSymbol } from './aot/static_symbol';\nimport { CssSelector } from './selector';\nimport { splitAtColon } from './util';\n// group 0: \"[prop] or (event) or @trigger\"\n// group 1: \"prop\" from \"[prop]\"\n// group 2: \"event\" from \"(event)\"\n// group 3: \"@trigger\" from \"@trigger\"\nconst /** @type {?} */ HOST_REG_EXP = /^(?:(?:\\[([^\\]]+)\\])|(?:\\(([^\\)]+)\\)))|(\\@[-\\w]+)$/;\n/**\n * @param {?} name\n * @return {?}\n */\nfunction _sanitizeIdentifier(name) {\n return name.replace(/\\W/g, '_');\n}\nlet /** @type {?} */ _anonymousTypeIndex = 0;\n/**\n * @param {?} compileIdentifier\n * @return {?}\n */\nexport function identifierName(compileIdentifier) {\n if (!compileIdentifier || !compileIdentifier.reference) {\n return null;\n }\n const /** @type {?} */ ref = compileIdentifier.reference;\n if (ref instanceof StaticSymbol) {\n return ref.name;\n }\n if (ref['__anonymousType']) {\n return ref['__anonymousType'];\n }\n let /** @type {?} */ identifier = stringify(ref);\n if (identifier.indexOf('(') >= 0) {\n // case: anonymous functions!\n identifier = `anonymous_${_anonymousTypeIndex++}`;\n ref['__anonymousType'] = identifier;\n }\n else {\n identifier = _sanitizeIdentifier(identifier);\n }\n return identifier;\n}\n/**\n * @param {?} compileIdentifier\n * @return {?}\n */\nexport function identifierModuleUrl(compileIdentifier) {\n const /** @type {?} */ ref = compileIdentifier.reference;\n if (ref instanceof StaticSymbol) {\n return ref.filePath;\n }\n // Runtime type\n return `./${stringify(ref)}`;\n}\n/**\n * @param {?} compType\n * @param {?} embeddedTemplateIndex\n * @return {?}\n */\nexport function viewClassName(compType, embeddedTemplateIndex) {\n return `View_${identifierName({ reference: compType })}_${embeddedTemplateIndex}`;\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nexport function rendererTypeName(compType) {\n return `RenderType_${identifierName({ reference: compType })}`;\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nexport function hostViewClassName(compType) {\n return `HostView_${identifierName({ reference: compType })}`;\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nexport function componentFactoryName(compType) {\n return `${identifierName({ reference: compType })}NgFactory`;\n}\nexport let CompileSummaryKind = {};\nCompileSummaryKind.Pipe = 0;\nCompileSummaryKind.Directive = 1;\nCompileSummaryKind.NgModule = 2;\nCompileSummaryKind.Injectable = 3;\nCompileSummaryKind[CompileSummaryKind.Pipe] = \"Pipe\";\nCompileSummaryKind[CompileSummaryKind.Directive] = \"Directive\";\nCompileSummaryKind[CompileSummaryKind.NgModule] = \"NgModule\";\nCompileSummaryKind[CompileSummaryKind.Injectable] = \"Injectable\";\n/**\n * @param {?} token\n * @return {?}\n */\nexport function tokenName(token) {\n return token.value != null ? _sanitizeIdentifier(token.value) : identifierName(token.identifier);\n}\n/**\n * @param {?} token\n * @return {?}\n */\nexport function tokenReference(token) {\n if (token.identifier != null) {\n return token.identifier.reference;\n }\n else {\n return token.value;\n }\n}\n/**\n * Metadata about a stylesheet\n */\nexport class CompileStylesheetMetadata {\n /**\n * @param {?=} __0\n */\n constructor({ moduleUrl, styles, styleUrls } = {}) {\n this.moduleUrl = moduleUrl || null;\n this.styles = _normalizeArray(styles);\n this.styleUrls = _normalizeArray(styleUrls);\n }\n}\nfunction CompileStylesheetMetadata_tsickle_Closure_declarations() {\n /** @type {?} */\n CompileStylesheetMetadata.prototype.moduleUrl;\n /** @type {?} */\n CompileStylesheetMetadata.prototype.styles;\n /** @type {?} */\n CompileStylesheetMetadata.prototype.styleUrls;\n}\n/**\n * Metadata regarding compilation of a template.\n */\nexport class CompileTemplateMetadata {\n /**\n * @param {?} __0\n */\n constructor({ encapsulation, template, templateUrl, styles, styleUrls, externalStylesheets, animations, ngContentSelectors, interpolation, isInline, preserveWhitespaces }) {\n this.encapsulation = encapsulation;\n this.template = template;\n this.templateUrl = templateUrl;\n this.styles = _normalizeArray(styles);\n this.styleUrls = _normalizeArray(styleUrls);\n this.externalStylesheets = _normalizeArray(externalStylesheets);\n this.animations = animations ? flatten(animations) : [];\n this.ngContentSelectors = ngContentSelectors || [];\n if (interpolation && interpolation.length != 2) {\n throw new Error(`'interpolation' should have a start and an end symbol.`);\n }\n this.interpolation = interpolation;\n this.isInline = isInline;\n this.preserveWhitespaces = preserveWhitespaces;\n }\n /**\n * @return {?}\n */\n toSummary() {\n return {\n ngContentSelectors: this.ngContentSelectors,\n encapsulation: this.encapsulation,\n };\n }\n}\nfunction CompileTemplateMetadata_tsickle_Closure_declarations() {\n /** @type {?} */\n CompileTemplateMetadata.prototype.encapsulation;\n /** @type {?} */\n CompileTemplateMetadata.prototype.template;\n /** @type {?} */\n CompileTemplateMetadata.prototype.templateUrl;\n /** @type {?} */\n CompileTemplateMetadata.prototype.isInline;\n /** @type {?} */\n CompileTemplateMetadata.prototype.styles;\n /** @type {?} */\n CompileTemplateMetadata.prototype.styleUrls;\n /** @type {?} */\n CompileTemplateMetadata.prototype.externalStylesheets;\n /** @type {?} */\n CompileTemplateMetadata.prototype.animations;\n /** @type {?} */\n CompileTemplateMetadata.prototype.ngContentSelectors;\n /** @type {?} */\n CompileTemplateMetadata.prototype.interpolation;\n /** @type {?} */\n CompileTemplateMetadata.prototype.preserveWhitespaces;\n}\n/**\n * Metadata regarding compilation of a directive.\n */\nexport class CompileDirectiveMetadata {\n /**\n * @param {?} __0\n * @return {?}\n */\n static create({ isHost, type, isComponent, selector, exportAs, changeDetection, inputs, outputs, host, providers, viewProviders, queries, viewQueries, entryComponents, template, componentViewType, rendererType, componentFactory }) {\n const /** @type {?} */ hostListeners = {};\n const /** @type {?} */ hostProperties = {};\n const /** @type {?} */ hostAttributes = {};\n if (host != null) {\n Object.keys(host).forEach(key => {\n const /** @type {?} */ value = host[key];\n const /** @type {?} */ matches = key.match(HOST_REG_EXP);\n if (matches === null) {\n hostAttributes[key] = value;\n }\n else if (matches[1] != null) {\n hostProperties[matches[1]] = value;\n }\n else if (matches[2] != null) {\n hostListeners[matches[2]] = value;\n }\n });\n }\n const /** @type {?} */ inputsMap = {};\n if (inputs != null) {\n inputs.forEach((bindConfig) => {\n // canonical syntax: `dirProp: elProp`\n // if there is no `:`, use dirProp = elProp\n const /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n inputsMap[parts[0]] = parts[1];\n });\n }\n const /** @type {?} */ outputsMap = {};\n if (outputs != null) {\n outputs.forEach((bindConfig) => {\n // canonical syntax: `dirProp: elProp`\n // if there is no `:`, use dirProp = elProp\n const /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n outputsMap[parts[0]] = parts[1];\n });\n }\n return new CompileDirectiveMetadata({\n isHost,\n type,\n isComponent: !!isComponent, selector, exportAs, changeDetection,\n inputs: inputsMap,\n outputs: outputsMap,\n hostListeners,\n hostProperties,\n hostAttributes,\n providers,\n viewProviders,\n queries,\n viewQueries,\n entryComponents,\n template,\n componentViewType,\n rendererType,\n componentFactory,\n });\n }\n /**\n * @param {?} __0\n */\n constructor({ isHost, type, isComponent, selector, exportAs, changeDetection, inputs, outputs, hostListeners, hostProperties, hostAttributes, providers, viewProviders, queries, viewQueries, entryComponents, template, componentViewType, rendererType, componentFactory }) {\n this.isHost = !!isHost;\n this.type = type;\n this.isComponent = isComponent;\n this.selector = selector;\n this.exportAs = exportAs;\n this.changeDetection = changeDetection;\n this.inputs = inputs;\n this.outputs = outputs;\n this.hostListeners = hostListeners;\n this.hostProperties = hostProperties;\n this.hostAttributes = hostAttributes;\n this.providers = _normalizeArray(providers);\n this.viewProviders = _normalizeArray(viewProviders);\n this.queries = _normalizeArray(queries);\n this.viewQueries = _normalizeArray(viewQueries);\n this.entryComponents = _normalizeArray(entryComponents);\n this.template = template;\n this.componentViewType = componentViewType;\n this.rendererType = rendererType;\n this.componentFactory = componentFactory;\n }\n /**\n * @return {?}\n */\n toSummary() {\n return {\n summaryKind: CompileSummaryKind.Directive,\n type: this.type,\n isComponent: this.isComponent,\n selector: this.selector,\n exportAs: this.exportAs,\n inputs: this.inputs,\n outputs: this.outputs,\n hostListeners: this.hostListeners,\n hostProperties: this.hostProperties,\n hostAttributes: this.hostAttributes,\n providers: this.providers,\n viewProviders: this.viewProviders,\n queries: this.queries,\n viewQueries: this.viewQueries,\n entryComponents: this.entryComponents,\n changeDetection: this.changeDetection,\n template: this.template && this.template.toSummary(),\n componentViewType: this.componentViewType,\n rendererType: this.rendererType,\n componentFactory: this.componentFactory\n };\n }\n}\nfunction CompileDirectiveMetadata_tsickle_Closure_declarations() {\n /** @type {?} */\n CompileDirectiveMetadata.prototype.isHost;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.type;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.isComponent;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.selector;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.exportAs;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.changeDetection;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.inputs;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.outputs;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.hostListeners;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.hostProperties;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.hostAttributes;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.providers;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.viewProviders;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.queries;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.viewQueries;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.entryComponents;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.template;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.componentViewType;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.rendererType;\n /** @type {?} */\n CompileDirectiveMetadata.prototype.componentFactory;\n}\n/**\n * Construct {\\@link CompileDirectiveMetadata} from {\\@link ComponentTypeMetadata} and a selector.\n * @param {?} hostTypeReference\n * @param {?} compMeta\n * @param {?} hostViewType\n * @return {?}\n */\nexport function createHostComponentMeta(hostTypeReference, compMeta, hostViewType) {\n const /** @type {?} */ template = CssSelector.parse(/** @type {?} */ ((compMeta.selector)))[0].getMatchingElementTemplate();\n return CompileDirectiveMetadata.create({\n isHost: true,\n type: { reference: hostTypeReference, diDeps: [], lifecycleHooks: [] },\n template: new CompileTemplateMetadata({\n encapsulation: ViewEncapsulation.None,\n template: template,\n templateUrl: '',\n styles: [],\n styleUrls: [],\n ngContentSelectors: [],\n animations: [],\n isInline: true,\n externalStylesheets: [],\n interpolation: null,\n preserveWhitespaces: false,\n }),\n exportAs: null,\n changeDetection: ChangeDetectionStrategy.Default,\n inputs: [],\n outputs: [],\n host: {},\n isComponent: true,\n selector: '*',\n providers: [],\n viewProviders: [],\n queries: [],\n viewQueries: [],\n componentViewType: hostViewType,\n rendererType: { id: '__Host__', encapsulation: ViewEncapsulation.None, styles: [], data: {} },\n entryComponents: [],\n componentFactory: null\n });\n}\nexport class CompilePipeMetadata {\n /**\n * @param {?} __0\n */\n constructor({ type, name, pure }) {\n this.type = type;\n this.name = name;\n this.pure = !!pure;\n }\n /**\n * @return {?}\n */\n toSummary() {\n return {\n summaryKind: CompileSummaryKind.Pipe,\n type: this.type,\n name: this.name,\n pure: this.pure\n };\n }\n}\nfunction CompilePipeMetadata_tsickle_Closure_declarations() {\n /** @type {?} */\n CompilePipeMetadata.prototype.type;\n /** @type {?} */\n CompilePipeMetadata.prototype.name;\n /** @type {?} */\n CompilePipeMetadata.prototype.pure;\n}\n/**\n * Metadata regarding compilation of a module.\n */\nexport class CompileNgModuleMetadata {\n /**\n * @param {?} __0\n */\n constructor({ type, providers, declaredDirectives, exportedDirectives, declaredPipes, exportedPipes, entryComponents, bootstrapComponents, importedModules, exportedModules, schemas, transitiveModule, id }) {\n this.type = type || null;\n this.declaredDirectives = _normalizeArray(declaredDirectives);\n this.exportedDirectives = _normalizeArray(exportedDirectives);\n this.declaredPipes = _normalizeArray(declaredPipes);\n this.exportedPipes = _normalizeArray(exportedPipes);\n this.providers = _normalizeArray(providers);\n this.entryComponents = _normalizeArray(entryComponents);\n this.bootstrapComponents = _normalizeArray(bootstrapComponents);\n this.importedModules = _normalizeArray(importedModules);\n this.exportedModules = _normalizeArray(exportedModules);\n this.schemas = _normalizeArray(schemas);\n this.id = id || null;\n this.transitiveModule = transitiveModule || null;\n }\n /**\n * @return {?}\n */\n toSummary() {\n const /** @type {?} */ module = ((this.transitiveModule));\n return {\n summaryKind: CompileSummaryKind.NgModule,\n type: this.type,\n entryComponents: module.entryComponents,\n providers: module.providers,\n modules: module.modules,\n exportedDirectives: module.exportedDirectives,\n exportedPipes: module.exportedPipes\n };\n }\n}\nfunction CompileNgModuleMetadata_tsickle_Closure_declarations() {\n /** @type {?} */\n CompileNgModuleMetadata.prototype.type;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.declaredDirectives;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.exportedDirectives;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.declaredPipes;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.exportedPipes;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.entryComponents;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.bootstrapComponents;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.providers;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.importedModules;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.exportedModules;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.schemas;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.id;\n /** @type {?} */\n CompileNgModuleMetadata.prototype.transitiveModule;\n}\nexport class TransitiveCompileNgModuleMetadata {\n constructor() {\n this.directivesSet = new Set();\n this.directives = [];\n this.exportedDirectivesSet = new Set();\n this.exportedDirectives = [];\n this.pipesSet = new Set();\n this.pipes = [];\n this.exportedPipesSet = new Set();\n this.exportedPipes = [];\n this.modulesSet = new Set();\n this.modules = [];\n this.entryComponentsSet = new Set();\n this.entryComponents = [];\n this.providers = [];\n }\n /**\n * @param {?} provider\n * @param {?} module\n * @return {?}\n */\n addProvider(provider, module) {\n this.providers.push({ provider: provider, module: module });\n }\n /**\n * @param {?} id\n * @return {?}\n */\n addDirective(id) {\n if (!this.directivesSet.has(id.reference)) {\n this.directivesSet.add(id.reference);\n this.directives.push(id);\n }\n }\n /**\n * @param {?} id\n * @return {?}\n */\n addExportedDirective(id) {\n if (!this.exportedDirectivesSet.has(id.reference)) {\n this.exportedDirectivesSet.add(id.reference);\n this.exportedDirectives.push(id);\n }\n }\n /**\n * @param {?} id\n * @return {?}\n */\n addPipe(id) {\n if (!this.pipesSet.has(id.reference)) {\n this.pipesSet.add(id.reference);\n this.pipes.push(id);\n }\n }\n /**\n * @param {?} id\n * @return {?}\n */\n addExportedPipe(id) {\n if (!this.exportedPipesSet.has(id.reference)) {\n this.exportedPipesSet.add(id.reference);\n this.exportedPipes.push(id);\n }\n }\n /**\n * @param {?} id\n * @return {?}\n */\n addModule(id) {\n if (!this.modulesSet.has(id.reference)) {\n this.modulesSet.add(id.reference);\n this.modules.push(id);\n }\n }\n /**\n * @param {?} ec\n * @return {?}\n */\n addEntryComponent(ec) {\n if (!this.entryComponentsSet.has(ec.componentType)) {\n this.entryComponentsSet.add(ec.componentType);\n this.entryComponents.push(ec);\n }\n }\n}\nfunction TransitiveCompileNgModuleMetadata_tsickle_Closure_declarations() {\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.directivesSet;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.directives;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.exportedDirectivesSet;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.exportedDirectives;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.pipesSet;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.pipes;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.exportedPipesSet;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.exportedPipes;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.modulesSet;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.modules;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.entryComponentsSet;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.entryComponents;\n /** @type {?} */\n TransitiveCompileNgModuleMetadata.prototype.providers;\n}\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction _normalizeArray(obj) {\n return obj || [];\n}\nexport class ProviderMeta {\n /**\n * @param {?} token\n * @param {?} __1\n */\n constructor(token, { useClass, useValue, useExisting, useFactory, deps, multi }) {\n this.token = token;\n this.useClass = useClass || null;\n this.useValue = useValue;\n this.useExisting = useExisting;\n this.useFactory = useFactory || null;\n this.dependencies = deps || null;\n this.multi = !!multi;\n }\n}\nfunction ProviderMeta_tsickle_Closure_declarations() {\n /** @type {?} */\n ProviderMeta.prototype.token;\n /** @type {?} */\n ProviderMeta.prototype.useClass;\n /** @type {?} */\n ProviderMeta.prototype.useValue;\n /** @type {?} */\n ProviderMeta.prototype.useExisting;\n /** @type {?} */\n ProviderMeta.prototype.useFactory;\n /** @type {?} */\n ProviderMeta.prototype.dependencies;\n /** @type {?} */\n ProviderMeta.prototype.multi;\n}\n/**\n * @template T\n * @param {?} list\n * @return {?}\n */\nexport function flatten(list) {\n return list.reduce((flat, item) => {\n const /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;\n return ((flat)).concat(flatItem);\n }, []);\n}\n/**\n * @param {?} url\n * @return {?}\n */\nexport function sourceUrl(url) {\n // Note: We need 3 \"/\" so that ng shows up as a separate domain\n // in the chrome dev tools.\n return url.replace(/(\\w+:\\/\\/[\\w:-]+)?(\\/+)?/, 'ng:///');\n}\n/**\n * @param {?} ngModuleType\n * @param {?} compMeta\n * @param {?} templateMeta\n * @return {?}\n */\nexport function templateSourceUrl(ngModuleType, compMeta, templateMeta) {\n let /** @type {?} */ url;\n if (templateMeta.isInline) {\n if (compMeta.type.reference instanceof StaticSymbol) {\n // Note: a .ts file might contain multiple components with inline templates,\n // so we need to give them unique urls, as these will be used for sourcemaps.\n url = `${compMeta.type.reference.filePath}.${compMeta.type.reference.name}.html`;\n }\n else {\n url = `${identifierName(ngModuleType)}/${identifierName(compMeta.type)}.html`;\n }\n }\n else {\n url = ((templateMeta.templateUrl));\n }\n // always prepend ng:// to make angular resources easy to find and not clobber\n // user resources.\n return sourceUrl(url);\n}\n/**\n * @param {?} meta\n * @param {?} id\n * @return {?}\n */\nexport function sharedStylesheetJitUrl(meta, id) {\n const /** @type {?} */ pathParts = ((meta.moduleUrl)).split(/\\/\\\\/g);\n const /** @type {?} */ baseName = pathParts[pathParts.length - 1];\n return sourceUrl(`css/${id}${baseName}.ngstyle.js`);\n}\n/**\n * @param {?} moduleMeta\n * @return {?}\n */\nexport function ngModuleJitUrl(moduleMeta) {\n return sourceUrl(`${identifierName(moduleMeta.type)}/module.ngfactory.js`);\n}\n/**\n * @param {?} ngModuleType\n * @param {?} compMeta\n * @return {?}\n */\nexport function templateJitUrl(ngModuleType, compMeta) {\n return sourceUrl(`${identifierName(ngModuleType)}/${identifierName(compMeta.type)}.ngfactory.js`);\n}\n//# sourceMappingURL=compile_metadata.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Provides access to reflection data about symbols that the compiler needs.\n * @abstract\n */\nexport class CompileReflector {\n /**\n * @abstract\n * @param {?} typeOrFunc\n * @return {?}\n */\n parameters(typeOrFunc) { }\n /**\n * @abstract\n * @param {?} typeOrFunc\n * @return {?}\n */\n annotations(typeOrFunc) { }\n /**\n * @abstract\n * @param {?} typeOrFunc\n * @return {?}\n */\n propMetadata(typeOrFunc) { }\n /**\n * @abstract\n * @param {?} type\n * @param {?} lcProperty\n * @return {?}\n */\n hasLifecycleHook(type, lcProperty) { }\n /**\n * @abstract\n * @param {?} type\n * @param {?} cmpMetadata\n * @return {?}\n */\n componentModuleUrl(type, cmpMetadata) { }\n /**\n * @abstract\n * @param {?} ref\n * @return {?}\n */\n resolveExternalReference(ref) { }\n}\n//# sourceMappingURL=compile_reflector.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ViewEncapsulation } from '@angular/core';\nimport { noUndefined } from './util';\nexport class CompilerConfig {\n /**\n * @param {?=} __0\n */\n constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, useJit = true, missingTranslation, enableLegacyTemplate, preserveWhitespaces } = {}) {\n this.defaultEncapsulation = defaultEncapsulation;\n this.useJit = !!useJit;\n this.missingTranslation = missingTranslation || null;\n this.enableLegacyTemplate = enableLegacyTemplate !== false;\n this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));\n }\n}\nfunction CompilerConfig_tsickle_Closure_declarations() {\n /** @type {?} */\n CompilerConfig.prototype.defaultEncapsulation;\n /** @type {?} */\n CompilerConfig.prototype.enableLegacyTemplate;\n /** @type {?} */\n CompilerConfig.prototype.useJit;\n /** @type {?} */\n CompilerConfig.prototype.missingTranslation;\n /** @type {?} */\n CompilerConfig.prototype.preserveWhitespaces;\n}\n/**\n * @param {?} preserveWhitespacesOption\n * @param {?=} defaultSetting\n * @return {?}\n */\nexport function preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting = true) {\n return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;\n}\n//# sourceMappingURL=config.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport class ParserError {\n /**\n * @param {?} message\n * @param {?} input\n * @param {?} errLocation\n * @param {?=} ctxLocation\n */\n constructor(message, input, errLocation, ctxLocation) {\n this.input = input;\n this.errLocation = errLocation;\n this.ctxLocation = ctxLocation;\n this.message = `Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`;\n }\n}\nfunction ParserError_tsickle_Closure_declarations() {\n /** @type {?} */\n ParserError.prototype.message;\n /** @type {?} */\n ParserError.prototype.input;\n /** @type {?} */\n ParserError.prototype.errLocation;\n /** @type {?} */\n ParserError.prototype.ctxLocation;\n}\nexport class ParseSpan {\n /**\n * @param {?} start\n * @param {?} end\n */\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n}\nfunction ParseSpan_tsickle_Closure_declarations() {\n /** @type {?} */\n ParseSpan.prototype.start;\n /** @type {?} */\n ParseSpan.prototype.end;\n}\nexport class AST {\n /**\n * @param {?} span\n */\n constructor(span) {\n this.span = span;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) { return null; }\n /**\n * @return {?}\n */\n toString() { return 'AST'; }\n}\nfunction AST_tsickle_Closure_declarations() {\n /** @type {?} */\n AST.prototype.span;\n}\n/**\n * Represents a quoted expression of the form:\n *\n * quote = prefix `:` uninterpretedExpression\n * prefix = identifier\n * uninterpretedExpression = arbitrary string\n *\n * A quoted expression is meant to be pre-processed by an AST transformer that\n * converts it into another AST that no longer contains quoted expressions.\n * It is meant to allow third-party developers to extend Angular template\n * expression language. The `uninterpretedExpression` part of the quote is\n * therefore not interpreted by the Angular's own expression parser.\n */\nexport class Quote extends AST {\n /**\n * @param {?} span\n * @param {?} prefix\n * @param {?} uninterpretedExpression\n * @param {?} location\n */\n constructor(span, prefix, uninterpretedExpression, location) {\n super(span);\n this.prefix = prefix;\n this.uninterpretedExpression = uninterpretedExpression;\n this.location = location;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) { return visitor.visitQuote(this, context); }\n /**\n * @return {?}\n */\n toString() { return 'Quote'; }\n}\nfunction Quote_tsickle_Closure_declarations() {\n /** @type {?} */\n Quote.prototype.prefix;\n /** @type {?} */\n Quote.prototype.uninterpretedExpression;\n /** @type {?} */\n Quote.prototype.location;\n}\nexport class EmptyExpr extends AST {\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n // do nothing\n }\n}\nexport class ImplicitReceiver extends AST {\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitImplicitReceiver(this, context);\n }\n}\n/**\n * Multiple expressions separated by a semicolon.\n */\nexport class Chain extends AST {\n /**\n * @param {?} span\n * @param {?} expressions\n */\n constructor(span, expressions) {\n super(span);\n this.expressions = expressions;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) { return visitor.visitChain(this, context); }\n}\nfunction Chain_tsickle_Closure_declarations() {\n /** @type {?} */\n Chain.prototype.expressions;\n}\nexport class Conditional extends AST {\n /**\n * @param {?} span\n * @param {?} condition\n * @param {?} trueExp\n * @param {?} falseExp\n */\n constructor(span, condition, trueExp, falseExp) {\n super(span);\n this.condition = condition;\n this.trueExp = trueExp;\n this.falseExp = falseExp;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitConditional(this, context);\n }\n}\nfunction Conditional_tsickle_Closure_declarations() {\n /** @type {?} */\n Conditional.prototype.condition;\n /** @type {?} */\n Conditional.prototype.trueExp;\n /** @type {?} */\n Conditional.prototype.falseExp;\n}\nexport class PropertyRead extends AST {\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n */\n constructor(span, receiver, name) {\n super(span);\n this.receiver = receiver;\n this.name = name;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitPropertyRead(this, context);\n }\n}\nfunction PropertyRead_tsickle_Closure_declarations() {\n /** @type {?} */\n PropertyRead.prototype.receiver;\n /** @type {?} */\n PropertyRead.prototype.name;\n}\nexport class PropertyWrite extends AST {\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n * @param {?} value\n */\n constructor(span, receiver, name, value) {\n super(span);\n this.receiver = receiver;\n this.name = name;\n this.value = value;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitPropertyWrite(this, context);\n }\n}\nfunction PropertyWrite_tsickle_Closure_declarations() {\n /** @type {?} */\n PropertyWrite.prototype.receiver;\n /** @type {?} */\n PropertyWrite.prototype.name;\n /** @type {?} */\n PropertyWrite.prototype.value;\n}\nexport class SafePropertyRead extends AST {\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n */\n constructor(span, receiver, name) {\n super(span);\n this.receiver = receiver;\n this.name = name;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitSafePropertyRead(this, context);\n }\n}\nfunction SafePropertyRead_tsickle_Closure_declarations() {\n /** @type {?} */\n SafePropertyRead.prototype.receiver;\n /** @type {?} */\n SafePropertyRead.prototype.name;\n}\nexport class KeyedRead extends AST {\n /**\n * @param {?} span\n * @param {?} obj\n * @param {?} key\n */\n constructor(span, obj, key) {\n super(span);\n this.obj = obj;\n this.key = key;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitKeyedRead(this, context);\n }\n}\nfunction KeyedRead_tsickle_Closure_declarations() {\n /** @type {?} */\n KeyedRead.prototype.obj;\n /** @type {?} */\n KeyedRead.prototype.key;\n}\nexport class KeyedWrite extends AST {\n /**\n * @param {?} span\n * @param {?} obj\n * @param {?} key\n * @param {?} value\n */\n constructor(span, obj, key, value) {\n super(span);\n this.obj = obj;\n this.key = key;\n this.value = value;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitKeyedWrite(this, context);\n }\n}\nfunction KeyedWrite_tsickle_Closure_declarations() {\n /** @type {?} */\n KeyedWrite.prototype.obj;\n /** @type {?} */\n KeyedWrite.prototype.key;\n /** @type {?} */\n KeyedWrite.prototype.value;\n}\nexport class BindingPipe extends AST {\n /**\n * @param {?} span\n * @param {?} exp\n * @param {?} name\n * @param {?} args\n */\n constructor(span, exp, name, args) {\n super(span);\n this.exp = exp;\n this.name = name;\n this.args = args;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) { return visitor.visitPipe(this, context); }\n}\nfunction BindingPipe_tsickle_Closure_declarations() {\n /** @type {?} */\n BindingPipe.prototype.exp;\n /** @type {?} */\n BindingPipe.prototype.name;\n /** @type {?} */\n BindingPipe.prototype.args;\n}\nexport class LiteralPrimitive extends AST {\n /**\n * @param {?} span\n * @param {?} value\n */\n constructor(span, value) {\n super(span);\n this.value = value;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitLiteralPrimitive(this, context);\n }\n}\nfunction LiteralPrimitive_tsickle_Closure_declarations() {\n /** @type {?} */\n LiteralPrimitive.prototype.value;\n}\nexport class LiteralArray extends AST {\n /**\n * @param {?} span\n * @param {?} expressions\n */\n constructor(span, expressions) {\n super(span);\n this.expressions = expressions;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitLiteralArray(this, context);\n }\n}\nfunction LiteralArray_tsickle_Closure_declarations() {\n /** @type {?} */\n LiteralArray.prototype.expressions;\n}\nexport class LiteralMap extends AST {\n /**\n * @param {?} span\n * @param {?} keys\n * @param {?} values\n */\n constructor(span, keys, values) {\n super(span);\n this.keys = keys;\n this.values = values;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitLiteralMap(this, context);\n }\n}\nfunction LiteralMap_tsickle_Closure_declarations() {\n /** @type {?} */\n LiteralMap.prototype.keys;\n /** @type {?} */\n LiteralMap.prototype.values;\n}\nexport class Interpolation extends AST {\n /**\n * @param {?} span\n * @param {?} strings\n * @param {?} expressions\n */\n constructor(span, strings, expressions) {\n super(span);\n this.strings = strings;\n this.expressions = expressions;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitInterpolation(this, context);\n }\n}\nfunction Interpolation_tsickle_Closure_declarations() {\n /** @type {?} */\n Interpolation.prototype.strings;\n /** @type {?} */\n Interpolation.prototype.expressions;\n}\nexport class Binary extends AST {\n /**\n * @param {?} span\n * @param {?} operation\n * @param {?} left\n * @param {?} right\n */\n constructor(span, operation, left, right) {\n super(span);\n this.operation = operation;\n this.left = left;\n this.right = right;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitBinary(this, context);\n }\n}\nfunction Binary_tsickle_Closure_declarations() {\n /** @type {?} */\n Binary.prototype.operation;\n /** @type {?} */\n Binary.prototype.left;\n /** @type {?} */\n Binary.prototype.right;\n}\nexport class PrefixNot extends AST {\n /**\n * @param {?} span\n * @param {?} expression\n */\n constructor(span, expression) {\n super(span);\n this.expression = expression;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitPrefixNot(this, context);\n }\n}\nfunction PrefixNot_tsickle_Closure_declarations() {\n /** @type {?} */\n PrefixNot.prototype.expression;\n}\nexport class NonNullAssert extends AST {\n /**\n * @param {?} span\n * @param {?} expression\n */\n constructor(span, expression) {\n super(span);\n this.expression = expression;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitNonNullAssert(this, context);\n }\n}\nfunction NonNullAssert_tsickle_Closure_declarations() {\n /** @type {?} */\n NonNullAssert.prototype.expression;\n}\nexport class MethodCall extends AST {\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n * @param {?} args\n */\n constructor(span, receiver, name, args) {\n super(span);\n this.receiver = receiver;\n this.name = name;\n this.args = args;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitMethodCall(this, context);\n }\n}\nfunction MethodCall_tsickle_Closure_declarations() {\n /** @type {?} */\n MethodCall.prototype.receiver;\n /** @type {?} */\n MethodCall.prototype.name;\n /** @type {?} */\n MethodCall.prototype.args;\n}\nexport class SafeMethodCall extends AST {\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n * @param {?} args\n */\n constructor(span, receiver, name, args) {\n super(span);\n this.receiver = receiver;\n this.name = name;\n this.args = args;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitSafeMethodCall(this, context);\n }\n}\nfunction SafeMethodCall_tsickle_Closure_declarations() {\n /** @type {?} */\n SafeMethodCall.prototype.receiver;\n /** @type {?} */\n SafeMethodCall.prototype.name;\n /** @type {?} */\n SafeMethodCall.prototype.args;\n}\nexport class FunctionCall extends AST {\n /**\n * @param {?} span\n * @param {?} target\n * @param {?} args\n */\n constructor(span, target, args) {\n super(span);\n this.target = target;\n this.args = args;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) {\n return visitor.visitFunctionCall(this, context);\n }\n}\nfunction FunctionCall_tsickle_Closure_declarations() {\n /** @type {?} */\n FunctionCall.prototype.target;\n /** @type {?} */\n FunctionCall.prototype.args;\n}\nexport class ASTWithSource extends AST {\n /**\n * @param {?} ast\n * @param {?} source\n * @param {?} location\n * @param {?} errors\n */\n constructor(ast, source, location, errors) {\n super(new ParseSpan(0, source == null ? 0 : source.length));\n this.ast = ast;\n this.source = source;\n this.location = location;\n this.errors = errors;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context = null) { return this.ast.visit(visitor, context); }\n /**\n * @return {?}\n */\n toString() { return `${this.source} in ${this.location}`; }\n}\nfunction ASTWithSource_tsickle_Closure_declarations() {\n /** @type {?} */\n ASTWithSource.prototype.ast;\n /** @type {?} */\n ASTWithSource.prototype.source;\n /** @type {?} */\n ASTWithSource.prototype.location;\n /** @type {?} */\n ASTWithSource.prototype.errors;\n}\nexport class TemplateBinding {\n /**\n * @param {?} span\n * @param {?} key\n * @param {?} keyIsVar\n * @param {?} name\n * @param {?} expression\n */\n constructor(span, key, keyIsVar, name, expression) {\n this.span = span;\n this.key = key;\n this.keyIsVar = keyIsVar;\n this.name = name;\n this.expression = expression;\n }\n}\nfunction TemplateBinding_tsickle_Closure_declarations() {\n /** @type {?} */\n TemplateBinding.prototype.span;\n /** @type {?} */\n TemplateBinding.prototype.key;\n /** @type {?} */\n TemplateBinding.prototype.keyIsVar;\n /** @type {?} */\n TemplateBinding.prototype.name;\n /** @type {?} */\n TemplateBinding.prototype.expression;\n}\nexport class NullAstVisitor {\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitBinary(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitChain(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitConditional(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitFunctionCall(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitImplicitReceiver(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitInterpolation(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedRead(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedWrite(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralArray(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralMap(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralPrimitive(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitMethodCall(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPipe(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPrefixNot(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitNonNullAssert(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyRead(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyWrite(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitQuote(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafeMethodCall(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafePropertyRead(ast, context) { }\n}\nexport class RecursiveAstVisitor {\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitBinary(ast, context) {\n ast.left.visit(this);\n ast.right.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitChain(ast, context) { return this.visitAll(ast.expressions, context); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitConditional(ast, context) {\n ast.condition.visit(this);\n ast.trueExp.visit(this);\n ast.falseExp.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPipe(ast, context) {\n ast.exp.visit(this);\n this.visitAll(ast.args, context);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitFunctionCall(ast, context) {\n ((ast.target)).visit(this);\n this.visitAll(ast.args, context);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitImplicitReceiver(ast, context) { return null; }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitInterpolation(ast, context) {\n return this.visitAll(ast.expressions, context);\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedRead(ast, context) {\n ast.obj.visit(this);\n ast.key.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedWrite(ast, context) {\n ast.obj.visit(this);\n ast.key.visit(this);\n ast.value.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralArray(ast, context) {\n return this.visitAll(ast.expressions, context);\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralMap(ast, context) { return this.visitAll(ast.values, context); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralPrimitive(ast, context) { return null; }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitMethodCall(ast, context) {\n ast.receiver.visit(this);\n return this.visitAll(ast.args, context);\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPrefixNot(ast, context) {\n ast.expression.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitNonNullAssert(ast, context) {\n ast.expression.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyRead(ast, context) {\n ast.receiver.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyWrite(ast, context) {\n ast.receiver.visit(this);\n ast.value.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafePropertyRead(ast, context) {\n ast.receiver.visit(this);\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafeMethodCall(ast, context) {\n ast.receiver.visit(this);\n return this.visitAll(ast.args, context);\n }\n /**\n * @param {?} asts\n * @param {?} context\n * @return {?}\n */\n visitAll(asts, context) {\n asts.forEach(ast => ast.visit(this, context));\n return null;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitQuote(ast, context) { return null; }\n}\nexport class AstTransformer {\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitImplicitReceiver(ast, context) { return ast; }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitInterpolation(ast, context) {\n return new Interpolation(ast.span, ast.strings, this.visitAll(ast.expressions));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralPrimitive(ast, context) {\n return new LiteralPrimitive(ast.span, ast.value);\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyRead(ast, context) {\n return new PropertyRead(ast.span, ast.receiver.visit(this), ast.name);\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyWrite(ast, context) {\n return new PropertyWrite(ast.span, ast.receiver.visit(this), ast.name, ast.value.visit(this));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafePropertyRead(ast, context) {\n return new SafePropertyRead(ast.span, ast.receiver.visit(this), ast.name);\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitMethodCall(ast, context) {\n return new MethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafeMethodCall(ast, context) {\n return new SafeMethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitFunctionCall(ast, context) {\n return new FunctionCall(ast.span, /** @type {?} */ ((ast.target)).visit(this), this.visitAll(ast.args));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralArray(ast, context) {\n return new LiteralArray(ast.span, this.visitAll(ast.expressions));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralMap(ast, context) {\n return new LiteralMap(ast.span, ast.keys, this.visitAll(ast.values));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitBinary(ast, context) {\n return new Binary(ast.span, ast.operation, ast.left.visit(this), ast.right.visit(this));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPrefixNot(ast, context) {\n return new PrefixNot(ast.span, ast.expression.visit(this));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitNonNullAssert(ast, context) {\n return new NonNullAssert(ast.span, ast.expression.visit(this));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitConditional(ast, context) {\n return new Conditional(ast.span, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPipe(ast, context) {\n return new BindingPipe(ast.span, ast.exp.visit(this), ast.name, this.visitAll(ast.args));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedRead(ast, context) {\n return new KeyedRead(ast.span, ast.obj.visit(this), ast.key.visit(this));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedWrite(ast, context) {\n return new KeyedWrite(ast.span, ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this));\n }\n /**\n * @param {?} asts\n * @return {?}\n */\n visitAll(asts) {\n const /** @type {?} */ res = new Array(asts.length);\n for (let /** @type {?} */ i = 0; i < asts.length; ++i) {\n res[i] = asts[i].visit(this);\n }\n return res;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitChain(ast, context) {\n return new Chain(ast.span, this.visitAll(ast.expressions));\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitQuote(ast, context) {\n return new Quote(ast.span, ast.prefix, ast.uninterpretedExpression, ast.location);\n }\n}\n/**\n * @param {?} ast\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\nexport function visitAstChildren(ast, visitor, context) {\n /**\n * @param {?} ast\n * @return {?}\n */\n function visit(ast) {\n visitor.visit && visitor.visit(ast, context) || ast.visit(visitor, context);\n }\n /**\n * @template T\n * @param {?} asts\n * @return {?}\n */\n function visitAll(asts) { asts.forEach(visit); }\n ast.visit({\n /**\n * @param {?} ast\n * @return {?}\n */\n visitBinary(ast) {\n visit(ast.left);\n visit(ast.right);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitChain(ast) { visitAll(ast.expressions); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitConditional(ast) {\n visit(ast.condition);\n visit(ast.trueExp);\n visit(ast.falseExp);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitFunctionCall(ast) {\n if (ast.target) {\n visit(ast.target);\n }\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitImplicitReceiver(ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitInterpolation(ast) { visitAll(ast.expressions); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitKeyedRead(ast) {\n visit(ast.obj);\n visit(ast.key);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitKeyedWrite(ast) {\n visit(ast.obj);\n visit(ast.key);\n visit(ast.obj);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitLiteralArray(ast) { visitAll(ast.expressions); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitLiteralMap(ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitLiteralPrimitive(ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitMethodCall(ast) {\n visit(ast.receiver);\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPipe(ast) {\n visit(ast.exp);\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPrefixNot(ast) { visit(ast.expression); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitNonNullAssert(ast) { visit(ast.expression); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPropertyRead(ast) { visit(ast.receiver); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPropertyWrite(ast) {\n visit(ast.receiver);\n visit(ast.value);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitQuote(ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitSafeMethodCall(ast) {\n visit(ast.receiver);\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitSafePropertyRead(ast) { visit(ast.receiver); },\n });\n}\n//# sourceMappingURL=ast.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport const $EOF = 0;\nexport const /** @type {?} */ $TAB = 9;\nexport const /** @type {?} */ $LF = 10;\nexport const /** @type {?} */ $VTAB = 11;\nexport const /** @type {?} */ $FF = 12;\nexport const /** @type {?} */ $CR = 13;\nexport const /** @type {?} */ $SPACE = 32;\nexport const /** @type {?} */ $BANG = 33;\nexport const /** @type {?} */ $DQ = 34;\nexport const /** @type {?} */ $HASH = 35;\nexport const /** @type {?} */ $$ = 36;\nexport const /** @type {?} */ $PERCENT = 37;\nexport const /** @type {?} */ $AMPERSAND = 38;\nexport const /** @type {?} */ $SQ = 39;\nexport const /** @type {?} */ $LPAREN = 40;\nexport const /** @type {?} */ $RPAREN = 41;\nexport const /** @type {?} */ $STAR = 42;\nexport const /** @type {?} */ $PLUS = 43;\nexport const /** @type {?} */ $COMMA = 44;\nexport const /** @type {?} */ $MINUS = 45;\nexport const /** @type {?} */ $PERIOD = 46;\nexport const /** @type {?} */ $SLASH = 47;\nexport const /** @type {?} */ $COLON = 58;\nexport const /** @type {?} */ $SEMICOLON = 59;\nexport const /** @type {?} */ $LT = 60;\nexport const /** @type {?} */ $EQ = 61;\nexport const /** @type {?} */ $GT = 62;\nexport const /** @type {?} */ $QUESTION = 63;\nexport const /** @type {?} */ $0 = 48;\nexport const /** @type {?} */ $9 = 57;\nexport const /** @type {?} */ $A = 65;\nexport const /** @type {?} */ $E = 69;\nexport const /** @type {?} */ $F = 70;\nexport const /** @type {?} */ $X = 88;\nexport const /** @type {?} */ $Z = 90;\nexport const /** @type {?} */ $LBRACKET = 91;\nexport const /** @type {?} */ $BACKSLASH = 92;\nexport const /** @type {?} */ $RBRACKET = 93;\nexport const /** @type {?} */ $CARET = 94;\nexport const /** @type {?} */ $_ = 95;\nexport const /** @type {?} */ $a = 97;\nexport const /** @type {?} */ $e = 101;\nexport const /** @type {?} */ $f = 102;\nexport const /** @type {?} */ $n = 110;\nexport const /** @type {?} */ $r = 114;\nexport const /** @type {?} */ $t = 116;\nexport const /** @type {?} */ $u = 117;\nexport const /** @type {?} */ $v = 118;\nexport const /** @type {?} */ $x = 120;\nexport const /** @type {?} */ $z = 122;\nexport const /** @type {?} */ $LBRACE = 123;\nexport const /** @type {?} */ $BAR = 124;\nexport const /** @type {?} */ $RBRACE = 125;\nexport const /** @type {?} */ $NBSP = 160;\nexport const /** @type {?} */ $PIPE = 124;\nexport const /** @type {?} */ $TILDA = 126;\nexport const /** @type {?} */ $AT = 64;\nexport const /** @type {?} */ $BT = 96;\n/**\n * @param {?} code\n * @return {?}\n */\nexport function isWhitespace(code) {\n return (code >= $TAB && code <= $SPACE) || (code == $NBSP);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nexport function isDigit(code) {\n return $0 <= code && code <= $9;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nexport function isAsciiLetter(code) {\n return code >= $a && code <= $z || code >= $A && code <= $Z;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nexport function isAsciiHexDigit(code) {\n return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);\n}\n//# sourceMappingURL=chars.js.map","/**\n * A replacement for \\@Injectable to be used in the compiler, so that\n * we don't try to evaluate the metadata in the compiler during AoT.\n * This decorator is enough to make the compiler work with the ReflectiveInjector though.\n * \\@Annotation\n * @return {?}\n */\nexport function CompilerInjectable() {\n return (x) => x;\n}\n//# sourceMappingURL=injectable.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { isDevMode } from '@angular/core';\n/**\n * @param {?} identifier\n * @param {?} value\n * @return {?}\n */\nexport function assertArrayOfStrings(identifier, value) {\n if (!isDevMode() || value == null) {\n return;\n }\n if (!Array.isArray(value)) {\n throw new Error(`Expected '${identifier}' to be an array of strings.`);\n }\n for (let /** @type {?} */ i = 0; i < value.length; i += 1) {\n if (typeof value[i] !== 'string') {\n throw new Error(`Expected '${identifier}' to be an array of strings.`);\n }\n }\n}\nconst /** @type {?} */ INTERPOLATION_BLACKLIST_REGEXPS = [\n /^\\s*$/,\n /[<>]/,\n /^[{}]$/,\n /&(#|[a-z])/i,\n /^\\/\\//,\n];\n/**\n * @param {?} identifier\n * @param {?} value\n * @return {?}\n */\nexport function assertInterpolationSymbols(identifier, value) {\n if (value != null && !(Array.isArray(value) && value.length == 2)) {\n throw new Error(`Expected '${identifier}' to be an array, [start, end].`);\n }\n else if (isDevMode() && value != null) {\n const /** @type {?} */ start = (value[0]);\n const /** @type {?} */ end = (value[1]);\n // black list checking\n INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {\n if (regexp.test(start) || regexp.test(end)) {\n throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);\n }\n });\n }\n}\n//# sourceMappingURL=assertions.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { assertInterpolationSymbols } from '../assertions';\nexport class InterpolationConfig {\n /**\n * @param {?} start\n * @param {?} end\n */\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * @param {?} markers\n * @return {?}\n */\n static fromArray(markers) {\n if (!markers) {\n return DEFAULT_INTERPOLATION_CONFIG;\n }\n assertInterpolationSymbols('interpolation', markers);\n return new InterpolationConfig(markers[0], markers[1]);\n }\n}\nfunction InterpolationConfig_tsickle_Closure_declarations() {\n /** @type {?} */\n InterpolationConfig.prototype.start;\n /** @type {?} */\n InterpolationConfig.prototype.end;\n}\nexport const /** @type {?} */ DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');\n//# sourceMappingURL=interpolation_config.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as chars from '../chars';\nimport { CompilerInjectable } from '../injectable';\nexport let TokenType = {};\nTokenType.Character = 0;\nTokenType.Identifier = 1;\nTokenType.Keyword = 2;\nTokenType.String = 3;\nTokenType.Operator = 4;\nTokenType.Number = 5;\nTokenType.Error = 6;\nTokenType[TokenType.Character] = \"Character\";\nTokenType[TokenType.Identifier] = \"Identifier\";\nTokenType[TokenType.Keyword] = \"Keyword\";\nTokenType[TokenType.String] = \"String\";\nTokenType[TokenType.Operator] = \"Operator\";\nTokenType[TokenType.Number] = \"Number\";\nTokenType[TokenType.Error] = \"Error\";\nconst /** @type {?} */ KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];\nexport class Lexer {\n /**\n * @param {?} text\n * @return {?}\n */\n tokenize(text) {\n const /** @type {?} */ scanner = new _Scanner(text);\n const /** @type {?} */ tokens = [];\n let /** @type {?} */ token = scanner.scanToken();\n while (token != null) {\n tokens.push(token);\n token = scanner.scanToken();\n }\n return tokens;\n }\n}\nLexer.decorators = [\n { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nLexer.ctorParameters = () => [];\nfunction Lexer_tsickle_Closure_declarations() {\n /** @type {?} */\n Lexer.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Lexer.ctorParameters;\n}\nexport class Token {\n /**\n * @param {?} index\n * @param {?} type\n * @param {?} numValue\n * @param {?} strValue\n */\n constructor(index, type, numValue, strValue) {\n this.index = index;\n this.type = type;\n this.numValue = numValue;\n this.strValue = strValue;\n }\n /**\n * @param {?} code\n * @return {?}\n */\n isCharacter(code) {\n return this.type == TokenType.Character && this.numValue == code;\n }\n /**\n * @return {?}\n */\n isNumber() { return this.type == TokenType.Number; }\n /**\n * @return {?}\n */\n isString() { return this.type == TokenType.String; }\n /**\n * @param {?} operater\n * @return {?}\n */\n isOperator(operater) {\n return this.type == TokenType.Operator && this.strValue == operater;\n }\n /**\n * @return {?}\n */\n isIdentifier() { return this.type == TokenType.Identifier; }\n /**\n * @return {?}\n */\n isKeyword() { return this.type == TokenType.Keyword; }\n /**\n * @return {?}\n */\n isKeywordLet() { return this.type == TokenType.Keyword && this.strValue == 'let'; }\n /**\n * @return {?}\n */\n isKeywordAs() { return this.type == TokenType.Keyword && this.strValue == 'as'; }\n /**\n * @return {?}\n */\n isKeywordNull() { return this.type == TokenType.Keyword && this.strValue == 'null'; }\n /**\n * @return {?}\n */\n isKeywordUndefined() {\n return this.type == TokenType.Keyword && this.strValue == 'undefined';\n }\n /**\n * @return {?}\n */\n isKeywordTrue() { return this.type == TokenType.Keyword && this.strValue == 'true'; }\n /**\n * @return {?}\n */\n isKeywordFalse() { return this.type == TokenType.Keyword && this.strValue == 'false'; }\n /**\n * @return {?}\n */\n isKeywordThis() { return this.type == TokenType.Keyword && this.strValue == 'this'; }\n /**\n * @return {?}\n */\n isError() { return this.type == TokenType.Error; }\n /**\n * @return {?}\n */\n toNumber() { return this.type == TokenType.Number ? this.numValue : -1; }\n /**\n * @return {?}\n */\n toString() {\n switch (this.type) {\n case TokenType.Character:\n case TokenType.Identifier:\n case TokenType.Keyword:\n case TokenType.Operator:\n case TokenType.String:\n case TokenType.Error:\n return this.strValue;\n case TokenType.Number:\n return this.numValue.toString();\n default:\n return null;\n }\n }\n}\nfunction Token_tsickle_Closure_declarations() {\n /** @type {?} */\n Token.prototype.index;\n /** @type {?} */\n Token.prototype.type;\n /** @type {?} */\n Token.prototype.numValue;\n /** @type {?} */\n Token.prototype.strValue;\n}\n/**\n * @param {?} index\n * @param {?} code\n * @return {?}\n */\nfunction newCharacterToken(index, code) {\n return new Token(index, TokenType.Character, code, String.fromCharCode(code));\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newIdentifierToken(index, text) {\n return new Token(index, TokenType.Identifier, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newKeywordToken(index, text) {\n return new Token(index, TokenType.Keyword, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newOperatorToken(index, text) {\n return new Token(index, TokenType.Operator, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} text\n * @return {?}\n */\nfunction newStringToken(index, text) {\n return new Token(index, TokenType.String, 0, text);\n}\n/**\n * @param {?} index\n * @param {?} n\n * @return {?}\n */\nfunction newNumberToken(index, n) {\n return new Token(index, TokenType.Number, n, '');\n}\n/**\n * @param {?} index\n * @param {?} message\n * @return {?}\n */\nfunction newErrorToken(index, message) {\n return new Token(index, TokenType.Error, 0, message);\n}\nexport const /** @type {?} */ EOF = new Token(-1, TokenType.Character, 0, '');\nclass _Scanner {\n /**\n * @param {?} input\n */\n constructor(input) {\n this.input = input;\n this.peek = 0;\n this.index = -1;\n this.length = input.length;\n this.advance();\n }\n /**\n * @return {?}\n */\n advance() {\n this.peek = ++this.index >= this.length ? chars.$EOF : this.input.charCodeAt(this.index);\n }\n /**\n * @return {?}\n */\n scanToken() {\n const /** @type {?} */ input = this.input, /** @type {?} */ length = this.length;\n let /** @type {?} */ peek = this.peek, /** @type {?} */ index = this.index;\n // Skip whitespace.\n while (peek <= chars.$SPACE) {\n if (++index >= length) {\n peek = chars.$EOF;\n break;\n }\n else {\n peek = input.charCodeAt(index);\n }\n }\n this.peek = peek;\n this.index = index;\n if (index >= length) {\n return null;\n }\n // Handle identifiers and numbers.\n if (isIdentifierStart(peek))\n return this.scanIdentifier();\n if (chars.isDigit(peek))\n return this.scanNumber(index);\n const /** @type {?} */ start = index;\n switch (peek) {\n case chars.$PERIOD:\n this.advance();\n return chars.isDigit(this.peek) ? this.scanNumber(start) :\n newCharacterToken(start, chars.$PERIOD);\n case chars.$LPAREN:\n case chars.$RPAREN:\n case chars.$LBRACE:\n case chars.$RBRACE:\n case chars.$LBRACKET:\n case chars.$RBRACKET:\n case chars.$COMMA:\n case chars.$COLON:\n case chars.$SEMICOLON:\n return this.scanCharacter(start, peek);\n case chars.$SQ:\n case chars.$DQ:\n return this.scanString();\n case chars.$HASH:\n case chars.$PLUS:\n case chars.$MINUS:\n case chars.$STAR:\n case chars.$SLASH:\n case chars.$PERCENT:\n case chars.$CARET:\n return this.scanOperator(start, String.fromCharCode(peek));\n case chars.$QUESTION:\n return this.scanComplexOperator(start, '?', chars.$PERIOD, '.');\n case chars.$LT:\n case chars.$GT:\n return this.scanComplexOperator(start, String.fromCharCode(peek), chars.$EQ, '=');\n case chars.$BANG:\n case chars.$EQ:\n return this.scanComplexOperator(start, String.fromCharCode(peek), chars.$EQ, '=', chars.$EQ, '=');\n case chars.$AMPERSAND:\n return this.scanComplexOperator(start, '&', chars.$AMPERSAND, '&');\n case chars.$BAR:\n return this.scanComplexOperator(start, '|', chars.$BAR, '|');\n case chars.$NBSP:\n while (chars.isWhitespace(this.peek))\n this.advance();\n return this.scanToken();\n }\n this.advance();\n return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0);\n }\n /**\n * @param {?} start\n * @param {?} code\n * @return {?}\n */\n scanCharacter(start, code) {\n this.advance();\n return newCharacterToken(start, code);\n }\n /**\n * @param {?} start\n * @param {?} str\n * @return {?}\n */\n scanOperator(start, str) {\n this.advance();\n return newOperatorToken(start, str);\n }\n /**\n * Tokenize a 2/3 char long operator\n *\n * @param {?} start start index in the expression\n * @param {?} one first symbol (always part of the operator)\n * @param {?} twoCode code point for the second symbol\n * @param {?} two second symbol (part of the operator when the second code point matches)\n * @param {?=} threeCode code point for the third symbol\n * @param {?=} three third symbol (part of the operator when provided and matches source expression)\n * @return {?}\n */\n scanComplexOperator(start, one, twoCode, two, threeCode, three) {\n this.advance();\n let /** @type {?} */ str = one;\n if (this.peek == twoCode) {\n this.advance();\n str += two;\n }\n if (threeCode != null && this.peek == threeCode) {\n this.advance();\n str += three;\n }\n return newOperatorToken(start, str);\n }\n /**\n * @return {?}\n */\n scanIdentifier() {\n const /** @type {?} */ start = this.index;\n this.advance();\n while (isIdentifierPart(this.peek))\n this.advance();\n const /** @type {?} */ str = this.input.substring(start, this.index);\n return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, str) :\n newIdentifierToken(start, str);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n scanNumber(start) {\n let /** @type {?} */ simple = (this.index === start);\n this.advance(); // Skip initial digit.\n while (true) {\n if (chars.isDigit(this.peek)) {\n // Do nothing.\n }\n else if (this.peek == chars.$PERIOD) {\n simple = false;\n }\n else if (isExponentStart(this.peek)) {\n this.advance();\n if (isExponentSign(this.peek))\n this.advance();\n if (!chars.isDigit(this.peek))\n return this.error('Invalid exponent', -1);\n simple = false;\n }\n else {\n break;\n }\n this.advance();\n }\n const /** @type {?} */ str = this.input.substring(start, this.index);\n const /** @type {?} */ value = simple ? parseIntAutoRadix(str) : parseFloat(str);\n return newNumberToken(start, value);\n }\n /**\n * @return {?}\n */\n scanString() {\n const /** @type {?} */ start = this.index;\n const /** @type {?} */ quote = this.peek;\n this.advance(); // Skip initial quote.\n let /** @type {?} */ buffer = '';\n let /** @type {?} */ marker = this.index;\n const /** @type {?} */ input = this.input;\n while (this.peek != quote) {\n if (this.peek == chars.$BACKSLASH) {\n buffer += input.substring(marker, this.index);\n this.advance();\n let /** @type {?} */ unescapedCode;\n // Workaround for TS2.1-introduced type strictness\n this.peek = this.peek;\n if (this.peek == chars.$u) {\n // 4 character hex code for unicode character.\n const /** @type {?} */ hex = input.substring(this.index + 1, this.index + 5);\n if (/^[0-9a-f]+$/i.test(hex)) {\n unescapedCode = parseInt(hex, 16);\n }\n else {\n return this.error(`Invalid unicode escape [\\\\u${hex}]`, 0);\n }\n for (let /** @type {?} */ i = 0; i < 5; i++) {\n this.advance();\n }\n }\n else {\n unescapedCode = unescape(this.peek);\n this.advance();\n }\n buffer += String.fromCharCode(unescapedCode);\n marker = this.index;\n }\n else if (this.peek == chars.$EOF) {\n return this.error('Unterminated quote', 0);\n }\n else {\n this.advance();\n }\n }\n const /** @type {?} */ last = input.substring(marker, this.index);\n this.advance(); // Skip terminating quote.\n return newStringToken(start, buffer + last);\n }\n /**\n * @param {?} message\n * @param {?} offset\n * @return {?}\n */\n error(message, offset) {\n const /** @type {?} */ position = this.index + offset;\n return newErrorToken(position, `Lexer Error: ${message} at column ${position} in expression [${this.input}]`);\n }\n}\nfunction _Scanner_tsickle_Closure_declarations() {\n /** @type {?} */\n _Scanner.prototype.length;\n /** @type {?} */\n _Scanner.prototype.peek;\n /** @type {?} */\n _Scanner.prototype.index;\n /** @type {?} */\n _Scanner.prototype.input;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isIdentifierStart(code) {\n return (chars.$a <= code && code <= chars.$z) || (chars.$A <= code && code <= chars.$Z) ||\n (code == chars.$_) || (code == chars.$$);\n}\n/**\n * @param {?} input\n * @return {?}\n */\nexport function isIdentifier(input) {\n if (input.length == 0)\n return false;\n const /** @type {?} */ scanner = new _Scanner(input);\n if (!isIdentifierStart(scanner.peek))\n return false;\n scanner.advance();\n while (scanner.peek !== chars.$EOF) {\n if (!isIdentifierPart(scanner.peek))\n return false;\n scanner.advance();\n }\n return true;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isIdentifierPart(code) {\n return chars.isAsciiLetter(code) || chars.isDigit(code) || (code == chars.$_) ||\n (code == chars.$$);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isExponentStart(code) {\n return code == chars.$e || code == chars.$E;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isExponentSign(code) {\n return code == chars.$MINUS || code == chars.$PLUS;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nexport function isQuote(code) {\n return code === chars.$SQ || code === chars.$DQ || code === chars.$BT;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction unescape(code) {\n switch (code) {\n case chars.$n:\n return chars.$LF;\n case chars.$f:\n return chars.$FF;\n case chars.$r:\n return chars.$CR;\n case chars.$t:\n return chars.$TAB;\n case chars.$v:\n return chars.$VTAB;\n default:\n return code;\n }\n}\n/**\n * @param {?} text\n * @return {?}\n */\nfunction parseIntAutoRadix(text) {\n const /** @type {?} */ result = parseInt(text);\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n//# sourceMappingURL=lexer.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as chars from '../chars';\nimport { CompilerInjectable } from '../injectable';\nimport { DEFAULT_INTERPOLATION_CONFIG } from '../ml_parser/interpolation_config';\nimport { escapeRegExp } from '../util';\nimport { ASTWithSource, Binary, BindingPipe, Chain, Conditional, EmptyExpr, FunctionCall, ImplicitReceiver, Interpolation, KeyedRead, KeyedWrite, LiteralArray, LiteralMap, LiteralPrimitive, MethodCall, NonNullAssert, ParseSpan, ParserError, PrefixNot, PropertyRead, PropertyWrite, Quote, SafeMethodCall, SafePropertyRead, TemplateBinding } from './ast';\nimport { EOF, Lexer, TokenType, isIdentifier, isQuote } from './lexer';\nexport class SplitInterpolation {\n /**\n * @param {?} strings\n * @param {?} expressions\n * @param {?} offsets\n */\n constructor(strings, expressions, offsets) {\n this.strings = strings;\n this.expressions = expressions;\n this.offsets = offsets;\n }\n}\nfunction SplitInterpolation_tsickle_Closure_declarations() {\n /** @type {?} */\n SplitInterpolation.prototype.strings;\n /** @type {?} */\n SplitInterpolation.prototype.expressions;\n /** @type {?} */\n SplitInterpolation.prototype.offsets;\n}\nexport class TemplateBindingParseResult {\n /**\n * @param {?} templateBindings\n * @param {?} warnings\n * @param {?} errors\n */\n constructor(templateBindings, warnings, errors) {\n this.templateBindings = templateBindings;\n this.warnings = warnings;\n this.errors = errors;\n }\n}\nfunction TemplateBindingParseResult_tsickle_Closure_declarations() {\n /** @type {?} */\n TemplateBindingParseResult.prototype.templateBindings;\n /** @type {?} */\n TemplateBindingParseResult.prototype.warnings;\n /** @type {?} */\n TemplateBindingParseResult.prototype.errors;\n}\n/**\n * @param {?} config\n * @return {?}\n */\nfunction _createInterpolateRegExp(config) {\n const /** @type {?} */ pattern = escapeRegExp(config.start) + '([\\\\s\\\\S]*?)' + escapeRegExp(config.end);\n return new RegExp(pattern, 'g');\n}\nexport class Parser {\n /**\n * @param {?} _lexer\n */\n constructor(_lexer) {\n this._lexer = _lexer;\n this.errors = [];\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parseAction(input, location, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n this._checkNoInterpolation(input, location, interpolationConfig);\n const /** @type {?} */ sourceToLex = this._stripComments(input);\n const /** @type {?} */ tokens = this._lexer.tokenize(this._stripComments(input));\n const /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, true, this.errors, input.length - sourceToLex.length)\n .parseChain();\n return new ASTWithSource(ast, input, location, this.errors);\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parseBinding(input, location, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);\n return new ASTWithSource(ast, input, location, this.errors);\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parseSimpleBinding(input, location, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);\n const /** @type {?} */ errors = SimpleExpressionChecker.check(ast);\n if (errors.length > 0) {\n this._reportError(`Host binding expression cannot contain ${errors.join(' ')}`, input, location);\n }\n return new ASTWithSource(ast, input, location, this.errors);\n }\n /**\n * @param {?} message\n * @param {?} input\n * @param {?} errLocation\n * @param {?=} ctxLocation\n * @return {?}\n */\n _reportError(message, input, errLocation, ctxLocation) {\n this.errors.push(new ParserError(message, input, errLocation, ctxLocation));\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?} interpolationConfig\n * @return {?}\n */\n _parseBindingAst(input, location, interpolationConfig) {\n // Quotes expressions use 3rd-party expression language. We don't want to use\n // our lexer or parser for that, so we check for that ahead of time.\n const /** @type {?} */ quote = this._parseQuote(input, location);\n if (quote != null) {\n return quote;\n }\n this._checkNoInterpolation(input, location, interpolationConfig);\n const /** @type {?} */ sourceToLex = this._stripComments(input);\n const /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);\n return new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, input.length - sourceToLex.length)\n .parseChain();\n }\n /**\n * @param {?} input\n * @param {?} location\n * @return {?}\n */\n _parseQuote(input, location) {\n if (input == null)\n return null;\n const /** @type {?} */ prefixSeparatorIndex = input.indexOf(':');\n if (prefixSeparatorIndex == -1)\n return null;\n const /** @type {?} */ prefix = input.substring(0, prefixSeparatorIndex).trim();\n if (!isIdentifier(prefix))\n return null;\n const /** @type {?} */ uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);\n return new Quote(new ParseSpan(0, input.length), prefix, uninterpretedExpression, location);\n }\n /**\n * @param {?} prefixToken\n * @param {?} input\n * @param {?} location\n * @return {?}\n */\n parseTemplateBindings(prefixToken, input, location) {\n const /** @type {?} */ tokens = this._lexer.tokenize(input);\n if (prefixToken) {\n // Prefix the tokens with the tokens from prefixToken but have them take no space (0 index).\n const /** @type {?} */ prefixTokens = this._lexer.tokenize(prefixToken).map(t => {\n t.index = 0;\n return t;\n });\n tokens.unshift(...prefixTokens);\n }\n return new _ParseAST(input, location, tokens, input.length, false, this.errors, 0)\n .parseTemplateBindings();\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parseInterpolation(input, location, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const /** @type {?} */ split = this.splitInterpolation(input, location, interpolationConfig);\n if (split == null)\n return null;\n const /** @type {?} */ expressions = [];\n for (let /** @type {?} */ i = 0; i < split.expressions.length; ++i) {\n const /** @type {?} */ expressionText = split.expressions[i];\n const /** @type {?} */ sourceToLex = this._stripComments(expressionText);\n const /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);\n const /** @type {?} */ ast = new _ParseAST(input, location, tokens, sourceToLex.length, false, this.errors, split.offsets[i] + (expressionText.length - sourceToLex.length))\n .parseChain();\n expressions.push(ast);\n }\n return new ASTWithSource(new Interpolation(new ParseSpan(0, input == null ? 0 : input.length), split.strings, expressions), input, location, this.errors);\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?=} interpolationConfig\n * @return {?}\n */\n splitInterpolation(input, location, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);\n const /** @type {?} */ parts = input.split(regexp);\n if (parts.length <= 1) {\n return null;\n }\n const /** @type {?} */ strings = [];\n const /** @type {?} */ expressions = [];\n const /** @type {?} */ offsets = [];\n let /** @type {?} */ offset = 0;\n for (let /** @type {?} */ i = 0; i < parts.length; i++) {\n const /** @type {?} */ part = parts[i];\n if (i % 2 === 0) {\n // fixed string\n strings.push(part);\n offset += part.length;\n }\n else if (part.trim().length > 0) {\n offset += interpolationConfig.start.length;\n expressions.push(part);\n offsets.push(offset);\n offset += part.length + interpolationConfig.end.length;\n }\n else {\n this._reportError('Blank expressions are not allowed in interpolated strings', input, `at column ${this._findInterpolationErrorColumn(parts, i, interpolationConfig)} in`, location);\n expressions.push('$implict');\n offsets.push(offset);\n }\n }\n return new SplitInterpolation(strings, expressions, offsets);\n }\n /**\n * @param {?} input\n * @param {?} location\n * @return {?}\n */\n wrapLiteralPrimitive(input, location) {\n return new ASTWithSource(new LiteralPrimitive(new ParseSpan(0, input == null ? 0 : input.length), input), input, location, this.errors);\n }\n /**\n * @param {?} input\n * @return {?}\n */\n _stripComments(input) {\n const /** @type {?} */ i = this._commentStart(input);\n return i != null ? input.substring(0, i).trim() : input;\n }\n /**\n * @param {?} input\n * @return {?}\n */\n _commentStart(input) {\n let /** @type {?} */ outerQuote = null;\n for (let /** @type {?} */ i = 0; i < input.length - 1; i++) {\n const /** @type {?} */ char = input.charCodeAt(i);\n const /** @type {?} */ nextChar = input.charCodeAt(i + 1);\n if (char === chars.$SLASH && nextChar == chars.$SLASH && outerQuote == null)\n return i;\n if (outerQuote === char) {\n outerQuote = null;\n }\n else if (outerQuote == null && isQuote(char)) {\n outerQuote = char;\n }\n }\n return null;\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?} interpolationConfig\n * @return {?}\n */\n _checkNoInterpolation(input, location, interpolationConfig) {\n const /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);\n const /** @type {?} */ parts = input.split(regexp);\n if (parts.length > 1) {\n this._reportError(`Got interpolation (${interpolationConfig.start}${interpolationConfig.end}) where expression was expected`, input, `at column ${this._findInterpolationErrorColumn(parts, 1, interpolationConfig)} in`, location);\n }\n }\n /**\n * @param {?} parts\n * @param {?} partInErrIdx\n * @param {?} interpolationConfig\n * @return {?}\n */\n _findInterpolationErrorColumn(parts, partInErrIdx, interpolationConfig) {\n let /** @type {?} */ errLocation = '';\n for (let /** @type {?} */ j = 0; j < partInErrIdx; j++) {\n errLocation += j % 2 === 0 ?\n parts[j] :\n `${interpolationConfig.start}${parts[j]}${interpolationConfig.end}`;\n }\n return errLocation.length;\n }\n}\nParser.decorators = [\n { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nParser.ctorParameters = () => [\n { type: Lexer, },\n];\nfunction Parser_tsickle_Closure_declarations() {\n /** @type {?} */\n Parser.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Parser.ctorParameters;\n /** @type {?} */\n Parser.prototype.errors;\n /** @type {?} */\n Parser.prototype._lexer;\n}\nexport class _ParseAST {\n /**\n * @param {?} input\n * @param {?} location\n * @param {?} tokens\n * @param {?} inputLength\n * @param {?} parseAction\n * @param {?} errors\n * @param {?} offset\n */\n constructor(input, location, tokens, inputLength, parseAction, errors, offset) {\n this.input = input;\n this.location = location;\n this.tokens = tokens;\n this.inputLength = inputLength;\n this.parseAction = parseAction;\n this.errors = errors;\n this.offset = offset;\n this.rparensExpected = 0;\n this.rbracketsExpected = 0;\n this.rbracesExpected = 0;\n this.index = 0;\n }\n /**\n * @param {?} offset\n * @return {?}\n */\n peek(offset) {\n const /** @type {?} */ i = this.index + offset;\n return i < this.tokens.length ? this.tokens[i] : EOF;\n }\n /**\n * @return {?}\n */\n get next() { return this.peek(0); }\n /**\n * @return {?}\n */\n get inputIndex() {\n return (this.index < this.tokens.length) ? this.next.index + this.offset :\n this.inputLength + this.offset;\n }\n /**\n * @param {?} start\n * @return {?}\n */\n span(start) { return new ParseSpan(start, this.inputIndex); }\n /**\n * @return {?}\n */\n advance() { this.index++; }\n /**\n * @param {?} code\n * @return {?}\n */\n optionalCharacter(code) {\n if (this.next.isCharacter(code)) {\n this.advance();\n return true;\n }\n else {\n return false;\n }\n }\n /**\n * @return {?}\n */\n peekKeywordLet() { return this.next.isKeywordLet(); }\n /**\n * @return {?}\n */\n peekKeywordAs() { return this.next.isKeywordAs(); }\n /**\n * @param {?} code\n * @return {?}\n */\n expectCharacter(code) {\n if (this.optionalCharacter(code))\n return;\n this.error(`Missing expected ${String.fromCharCode(code)}`);\n }\n /**\n * @param {?} op\n * @return {?}\n */\n optionalOperator(op) {\n if (this.next.isOperator(op)) {\n this.advance();\n return true;\n }\n else {\n return false;\n }\n }\n /**\n * @param {?} operator\n * @return {?}\n */\n expectOperator(operator) {\n if (this.optionalOperator(operator))\n return;\n this.error(`Missing expected operator ${operator}`);\n }\n /**\n * @return {?}\n */\n expectIdentifierOrKeyword() {\n const /** @type {?} */ n = this.next;\n if (!n.isIdentifier() && !n.isKeyword()) {\n this.error(`Unexpected token ${n}, expected identifier or keyword`);\n return '';\n }\n this.advance();\n return (n.toString());\n }\n /**\n * @return {?}\n */\n expectIdentifierOrKeywordOrString() {\n const /** @type {?} */ n = this.next;\n if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {\n this.error(`Unexpected token ${n}, expected identifier, keyword, or string`);\n return '';\n }\n this.advance();\n return (n.toString());\n }\n /**\n * @return {?}\n */\n parseChain() {\n const /** @type {?} */ exprs = [];\n const /** @type {?} */ start = this.inputIndex;\n while (this.index < this.tokens.length) {\n const /** @type {?} */ expr = this.parsePipe();\n exprs.push(expr);\n if (this.optionalCharacter(chars.$SEMICOLON)) {\n if (!this.parseAction) {\n this.error('Binding expression cannot contain chained expression');\n }\n while (this.optionalCharacter(chars.$SEMICOLON)) {\n } // read all semicolons\n }\n else if (this.index < this.tokens.length) {\n this.error(`Unexpected token '${this.next}'`);\n }\n }\n if (exprs.length == 0)\n return new EmptyExpr(this.span(start));\n if (exprs.length == 1)\n return exprs[0];\n return new Chain(this.span(start), exprs);\n }\n /**\n * @return {?}\n */\n parsePipe() {\n let /** @type {?} */ result = this.parseExpression();\n if (this.optionalOperator('|')) {\n if (this.parseAction) {\n this.error('Cannot have a pipe in an action expression');\n }\n do {\n const /** @type {?} */ name = this.expectIdentifierOrKeyword();\n const /** @type {?} */ args = [];\n while (this.optionalCharacter(chars.$COLON)) {\n args.push(this.parseExpression());\n }\n result = new BindingPipe(this.span(result.span.start), result, name, args);\n } while (this.optionalOperator('|'));\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseExpression() { return this.parseConditional(); }\n /**\n * @return {?}\n */\n parseConditional() {\n const /** @type {?} */ start = this.inputIndex;\n const /** @type {?} */ result = this.parseLogicalOr();\n if (this.optionalOperator('?')) {\n const /** @type {?} */ yes = this.parsePipe();\n let /** @type {?} */ no;\n if (!this.optionalCharacter(chars.$COLON)) {\n const /** @type {?} */ end = this.inputIndex;\n const /** @type {?} */ expression = this.input.substring(start, end);\n this.error(`Conditional expression ${expression} requires all 3 expressions`);\n no = new EmptyExpr(this.span(start));\n }\n else {\n no = this.parsePipe();\n }\n return new Conditional(this.span(start), result, yes, no);\n }\n else {\n return result;\n }\n }\n /**\n * @return {?}\n */\n parseLogicalOr() {\n // '||'\n let /** @type {?} */ result = this.parseLogicalAnd();\n while (this.optionalOperator('||')) {\n const /** @type {?} */ right = this.parseLogicalAnd();\n result = new Binary(this.span(result.span.start), '||', result, right);\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseLogicalAnd() {\n // '&&'\n let /** @type {?} */ result = this.parseEquality();\n while (this.optionalOperator('&&')) {\n const /** @type {?} */ right = this.parseEquality();\n result = new Binary(this.span(result.span.start), '&&', result, right);\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseEquality() {\n // '==','!=','===','!=='\n let /** @type {?} */ result = this.parseRelational();\n while (this.next.type == TokenType.Operator) {\n const /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '==':\n case '===':\n case '!=':\n case '!==':\n this.advance();\n const /** @type {?} */ right = this.parseRelational();\n result = new Binary(this.span(result.span.start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseRelational() {\n // '<', '>', '<=', '>='\n let /** @type {?} */ result = this.parseAdditive();\n while (this.next.type == TokenType.Operator) {\n const /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '<':\n case '>':\n case '<=':\n case '>=':\n this.advance();\n const /** @type {?} */ right = this.parseAdditive();\n result = new Binary(this.span(result.span.start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseAdditive() {\n // '+', '-'\n let /** @type {?} */ result = this.parseMultiplicative();\n while (this.next.type == TokenType.Operator) {\n const /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '+':\n case '-':\n this.advance();\n let /** @type {?} */ right = this.parseMultiplicative();\n result = new Binary(this.span(result.span.start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseMultiplicative() {\n // '*', '%', '/'\n let /** @type {?} */ result = this.parsePrefix();\n while (this.next.type == TokenType.Operator) {\n const /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '*':\n case '%':\n case '/':\n this.advance();\n let /** @type {?} */ right = this.parsePrefix();\n result = new Binary(this.span(result.span.start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n /**\n * @return {?}\n */\n parsePrefix() {\n if (this.next.type == TokenType.Operator) {\n const /** @type {?} */ start = this.inputIndex;\n const /** @type {?} */ operator = this.next.strValue;\n let /** @type {?} */ result;\n switch (operator) {\n case '+':\n this.advance();\n return this.parsePrefix();\n case '-':\n this.advance();\n result = this.parsePrefix();\n return new Binary(this.span(start), operator, new LiteralPrimitive(new ParseSpan(start, start), 0), result);\n case '!':\n this.advance();\n result = this.parsePrefix();\n return new PrefixNot(this.span(start), result);\n }\n }\n return this.parseCallChain();\n }\n /**\n * @return {?}\n */\n parseCallChain() {\n let /** @type {?} */ result = this.parsePrimary();\n while (true) {\n if (this.optionalCharacter(chars.$PERIOD)) {\n result = this.parseAccessMemberOrMethodCall(result, false);\n }\n else if (this.optionalOperator('?.')) {\n result = this.parseAccessMemberOrMethodCall(result, true);\n }\n else if (this.optionalCharacter(chars.$LBRACKET)) {\n this.rbracketsExpected++;\n const /** @type {?} */ key = this.parsePipe();\n this.rbracketsExpected--;\n this.expectCharacter(chars.$RBRACKET);\n if (this.optionalOperator('=')) {\n const /** @type {?} */ value = this.parseConditional();\n result = new KeyedWrite(this.span(result.span.start), result, key, value);\n }\n else {\n result = new KeyedRead(this.span(result.span.start), result, key);\n }\n }\n else if (this.optionalCharacter(chars.$LPAREN)) {\n this.rparensExpected++;\n const /** @type {?} */ args = this.parseCallArguments();\n this.rparensExpected--;\n this.expectCharacter(chars.$RPAREN);\n result = new FunctionCall(this.span(result.span.start), result, args);\n }\n else if (this.optionalOperator('!')) {\n result = new NonNullAssert(this.span(result.span.start), result);\n }\n else {\n return result;\n }\n }\n }\n /**\n * @return {?}\n */\n parsePrimary() {\n const /** @type {?} */ start = this.inputIndex;\n if (this.optionalCharacter(chars.$LPAREN)) {\n this.rparensExpected++;\n const /** @type {?} */ result = this.parsePipe();\n this.rparensExpected--;\n this.expectCharacter(chars.$RPAREN);\n return result;\n }\n else if (this.next.isKeywordNull()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), null);\n }\n else if (this.next.isKeywordUndefined()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), void 0);\n }\n else if (this.next.isKeywordTrue()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), true);\n }\n else if (this.next.isKeywordFalse()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), false);\n }\n else if (this.next.isKeywordThis()) {\n this.advance();\n return new ImplicitReceiver(this.span(start));\n }\n else if (this.optionalCharacter(chars.$LBRACKET)) {\n this.rbracketsExpected++;\n const /** @type {?} */ elements = this.parseExpressionList(chars.$RBRACKET);\n this.rbracketsExpected--;\n this.expectCharacter(chars.$RBRACKET);\n return new LiteralArray(this.span(start), elements);\n }\n else if (this.next.isCharacter(chars.$LBRACE)) {\n return this.parseLiteralMap();\n }\n else if (this.next.isIdentifier()) {\n return this.parseAccessMemberOrMethodCall(new ImplicitReceiver(this.span(start)), false);\n }\n else if (this.next.isNumber()) {\n const /** @type {?} */ value = this.next.toNumber();\n this.advance();\n return new LiteralPrimitive(this.span(start), value);\n }\n else if (this.next.isString()) {\n const /** @type {?} */ literalValue = this.next.toString();\n this.advance();\n return new LiteralPrimitive(this.span(start), literalValue);\n }\n else if (this.index >= this.tokens.length) {\n this.error(`Unexpected end of expression: ${this.input}`);\n return new EmptyExpr(this.span(start));\n }\n else {\n this.error(`Unexpected token ${this.next}`);\n return new EmptyExpr(this.span(start));\n }\n }\n /**\n * @param {?} terminator\n * @return {?}\n */\n parseExpressionList(terminator) {\n const /** @type {?} */ result = [];\n if (!this.next.isCharacter(terminator)) {\n do {\n result.push(this.parsePipe());\n } while (this.optionalCharacter(chars.$COMMA));\n }\n return result;\n }\n /**\n * @return {?}\n */\n parseLiteralMap() {\n const /** @type {?} */ keys = [];\n const /** @type {?} */ values = [];\n const /** @type {?} */ start = this.inputIndex;\n this.expectCharacter(chars.$LBRACE);\n if (!this.optionalCharacter(chars.$RBRACE)) {\n this.rbracesExpected++;\n do {\n const /** @type {?} */ quoted = this.next.isString();\n const /** @type {?} */ key = this.expectIdentifierOrKeywordOrString();\n keys.push({ key, quoted });\n this.expectCharacter(chars.$COLON);\n values.push(this.parsePipe());\n } while (this.optionalCharacter(chars.$COMMA));\n this.rbracesExpected--;\n this.expectCharacter(chars.$RBRACE);\n }\n return new LiteralMap(this.span(start), keys, values);\n }\n /**\n * @param {?} receiver\n * @param {?=} isSafe\n * @return {?}\n */\n parseAccessMemberOrMethodCall(receiver, isSafe = false) {\n const /** @type {?} */ start = receiver.span.start;\n const /** @type {?} */ id = this.expectIdentifierOrKeyword();\n if (this.optionalCharacter(chars.$LPAREN)) {\n this.rparensExpected++;\n const /** @type {?} */ args = this.parseCallArguments();\n this.expectCharacter(chars.$RPAREN);\n this.rparensExpected--;\n const /** @type {?} */ span = this.span(start);\n return isSafe ? new SafeMethodCall(span, receiver, id, args) :\n new MethodCall(span, receiver, id, args);\n }\n else {\n if (isSafe) {\n if (this.optionalOperator('=')) {\n this.error('The \\'?.\\' operator cannot be used in the assignment');\n return new EmptyExpr(this.span(start));\n }\n else {\n return new SafePropertyRead(this.span(start), receiver, id);\n }\n }\n else {\n if (this.optionalOperator('=')) {\n if (!this.parseAction) {\n this.error('Bindings cannot contain assignments');\n return new EmptyExpr(this.span(start));\n }\n const /** @type {?} */ value = this.parseConditional();\n return new PropertyWrite(this.span(start), receiver, id, value);\n }\n else {\n return new PropertyRead(this.span(start), receiver, id);\n }\n }\n }\n }\n /**\n * @return {?}\n */\n parseCallArguments() {\n if (this.next.isCharacter(chars.$RPAREN))\n return [];\n const /** @type {?} */ positionals = [];\n do {\n positionals.push(this.parsePipe());\n } while (this.optionalCharacter(chars.$COMMA));\n return (positionals);\n }\n /**\n * An identifier, a keyword, a string with an optional `-` inbetween.\n * @return {?}\n */\n expectTemplateBindingKey() {\n let /** @type {?} */ result = '';\n let /** @type {?} */ operatorFound = false;\n do {\n result += this.expectIdentifierOrKeywordOrString();\n operatorFound = this.optionalOperator('-');\n if (operatorFound) {\n result += '-';\n }\n } while (operatorFound);\n return result.toString();\n }\n /**\n * @return {?}\n */\n parseTemplateBindings() {\n const /** @type {?} */ bindings = [];\n let /** @type {?} */ prefix = ((null));\n const /** @type {?} */ warnings = [];\n while (this.index < this.tokens.length) {\n const /** @type {?} */ start = this.inputIndex;\n let /** @type {?} */ keyIsVar = this.peekKeywordLet();\n if (keyIsVar) {\n this.advance();\n }\n let /** @type {?} */ rawKey = this.expectTemplateBindingKey();\n let /** @type {?} */ key = rawKey;\n if (!keyIsVar) {\n if (prefix == null) {\n prefix = key;\n }\n else {\n key = prefix + key[0].toUpperCase() + key.substring(1);\n }\n }\n this.optionalCharacter(chars.$COLON);\n let /** @type {?} */ name = ((null));\n let /** @type {?} */ expression = ((null));\n if (keyIsVar) {\n if (this.optionalOperator('=')) {\n name = this.expectTemplateBindingKey();\n }\n else {\n name = '\\$implicit';\n }\n }\n else if (this.peekKeywordAs()) {\n const /** @type {?} */ letStart = this.inputIndex;\n this.advance(); // consume `as`\n name = rawKey;\n key = this.expectTemplateBindingKey(); // read local var name\n keyIsVar = true;\n }\n else if (this.next !== EOF && !this.peekKeywordLet()) {\n const /** @type {?} */ start = this.inputIndex;\n const /** @type {?} */ ast = this.parsePipe();\n const /** @type {?} */ source = this.input.substring(start - this.offset, this.inputIndex - this.offset);\n expression = new ASTWithSource(ast, source, this.location, this.errors);\n }\n bindings.push(new TemplateBinding(this.span(start), key, keyIsVar, name, expression));\n if (this.peekKeywordAs() && !keyIsVar) {\n const /** @type {?} */ letStart = this.inputIndex;\n this.advance(); // consume `as`\n const /** @type {?} */ letName = this.expectTemplateBindingKey(); // read local var name\n bindings.push(new TemplateBinding(this.span(letStart), letName, true, key, /** @type {?} */ ((null))));\n }\n if (!this.optionalCharacter(chars.$SEMICOLON)) {\n this.optionalCharacter(chars.$COMMA);\n }\n }\n return new TemplateBindingParseResult(bindings, warnings, this.errors);\n }\n /**\n * @param {?} message\n * @param {?=} index\n * @return {?}\n */\n error(message, index = null) {\n this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));\n this.skip();\n }\n /**\n * @param {?=} index\n * @return {?}\n */\n locationText(index = null) {\n if (index == null)\n index = this.index;\n return (index < this.tokens.length) ? `at column ${this.tokens[index].index + 1} in` :\n `at the end of the expression`;\n }\n /**\n * @return {?}\n */\n skip() {\n let /** @type {?} */ n = this.next;\n while (this.index < this.tokens.length && !n.isCharacter(chars.$SEMICOLON) &&\n (this.rparensExpected <= 0 || !n.isCharacter(chars.$RPAREN)) &&\n (this.rbracesExpected <= 0 || !n.isCharacter(chars.$RBRACE)) &&\n (this.rbracketsExpected <= 0 || !n.isCharacter(chars.$RBRACKET))) {\n if (this.next.isError()) {\n this.errors.push(new ParserError(/** @type {?} */ ((this.next.toString())), this.input, this.locationText(), this.location));\n }\n this.advance();\n n = this.next;\n }\n }\n}\nfunction _ParseAST_tsickle_Closure_declarations() {\n /** @type {?} */\n _ParseAST.prototype.rparensExpected;\n /** @type {?} */\n _ParseAST.prototype.rbracketsExpected;\n /** @type {?} */\n _ParseAST.prototype.rbracesExpected;\n /** @type {?} */\n _ParseAST.prototype.index;\n /** @type {?} */\n _ParseAST.prototype.input;\n /** @type {?} */\n _ParseAST.prototype.location;\n /** @type {?} */\n _ParseAST.prototype.tokens;\n /** @type {?} */\n _ParseAST.prototype.inputLength;\n /** @type {?} */\n _ParseAST.prototype.parseAction;\n /** @type {?} */\n _ParseAST.prototype.errors;\n /** @type {?} */\n _ParseAST.prototype.offset;\n}\nclass SimpleExpressionChecker {\n constructor() {\n this.errors = [];\n }\n /**\n * @param {?} ast\n * @return {?}\n */\n static check(ast) {\n const /** @type {?} */ s = new SimpleExpressionChecker();\n ast.visit(s);\n return s.errors;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitImplicitReceiver(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitInterpolation(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralPrimitive(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyRead(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPropertyWrite(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafePropertyRead(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitMethodCall(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitSafeMethodCall(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitFunctionCall(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralArray(ast, context) { this.visitAll(ast.expressions); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitLiteralMap(ast, context) { this.visitAll(ast.values); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitBinary(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPrefixNot(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitNonNullAssert(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitConditional(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPipe(ast, context) { this.errors.push('pipes'); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedRead(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitKeyedWrite(ast, context) { }\n /**\n * @param {?} asts\n * @return {?}\n */\n visitAll(asts) { return asts.map(node => node.visit(this)); }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitChain(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitQuote(ast, context) { }\n}\nfunction SimpleExpressionChecker_tsickle_Closure_declarations() {\n /** @type {?} */\n SimpleExpressionChecker.prototype.errors;\n}\n//# sourceMappingURL=parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as chars from './chars';\nimport { identifierModuleUrl, identifierName } from './compile_metadata';\nexport class ParseLocation {\n /**\n * @param {?} file\n * @param {?} offset\n * @param {?} line\n * @param {?} col\n */\n constructor(file, offset, line, col) {\n this.file = file;\n this.offset = offset;\n this.line = line;\n this.col = col;\n }\n /**\n * @return {?}\n */\n toString() {\n return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;\n }\n /**\n * @param {?} delta\n * @return {?}\n */\n moveBy(delta) {\n const /** @type {?} */ source = this.file.content;\n const /** @type {?} */ len = source.length;\n let /** @type {?} */ offset = this.offset;\n let /** @type {?} */ line = this.line;\n let /** @type {?} */ col = this.col;\n while (offset > 0 && delta < 0) {\n offset--;\n delta++;\n const /** @type {?} */ ch = source.charCodeAt(offset);\n if (ch == chars.$LF) {\n line--;\n const /** @type {?} */ priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode(chars.$LF));\n col = priorLine > 0 ? offset - priorLine : offset;\n }\n else {\n col--;\n }\n }\n while (offset < len && delta > 0) {\n const /** @type {?} */ ch = source.charCodeAt(offset);\n offset++;\n delta--;\n if (ch == chars.$LF) {\n line++;\n col = 0;\n }\n else {\n col++;\n }\n }\n return new ParseLocation(this.file, offset, line, col);\n }\n /**\n * @param {?} maxChars\n * @param {?} maxLines\n * @return {?}\n */\n getContext(maxChars, maxLines) {\n const /** @type {?} */ content = this.file.content;\n let /** @type {?} */ startOffset = this.offset;\n if (startOffset != null) {\n if (startOffset > content.length - 1) {\n startOffset = content.length - 1;\n }\n let /** @type {?} */ endOffset = startOffset;\n let /** @type {?} */ ctxChars = 0;\n let /** @type {?} */ ctxLines = 0;\n while (ctxChars < maxChars && startOffset > 0) {\n startOffset--;\n ctxChars++;\n if (content[startOffset] == '\\n') {\n if (++ctxLines == maxLines) {\n break;\n }\n }\n }\n ctxChars = 0;\n ctxLines = 0;\n while (ctxChars < maxChars && endOffset < content.length - 1) {\n endOffset++;\n ctxChars++;\n if (content[endOffset] == '\\n') {\n if (++ctxLines == maxLines) {\n break;\n }\n }\n }\n return {\n before: content.substring(startOffset, this.offset),\n after: content.substring(this.offset, endOffset + 1),\n };\n }\n return null;\n }\n}\nfunction ParseLocation_tsickle_Closure_declarations() {\n /** @type {?} */\n ParseLocation.prototype.file;\n /** @type {?} */\n ParseLocation.prototype.offset;\n /** @type {?} */\n ParseLocation.prototype.line;\n /** @type {?} */\n ParseLocation.prototype.col;\n}\nexport class ParseSourceFile {\n /**\n * @param {?} content\n * @param {?} url\n */\n constructor(content, url) {\n this.content = content;\n this.url = url;\n }\n}\nfunction ParseSourceFile_tsickle_Closure_declarations() {\n /** @type {?} */\n ParseSourceFile.prototype.content;\n /** @type {?} */\n ParseSourceFile.prototype.url;\n}\nexport class ParseSourceSpan {\n /**\n * @param {?} start\n * @param {?} end\n * @param {?=} details\n */\n constructor(start, end, details = null) {\n this.start = start;\n this.end = end;\n this.details = details;\n }\n /**\n * @return {?}\n */\n toString() {\n return this.start.file.content.substring(this.start.offset, this.end.offset);\n }\n}\nfunction ParseSourceSpan_tsickle_Closure_declarations() {\n /** @type {?} */\n ParseSourceSpan.prototype.start;\n /** @type {?} */\n ParseSourceSpan.prototype.end;\n /** @type {?} */\n ParseSourceSpan.prototype.details;\n}\nexport let ParseErrorLevel = {};\nParseErrorLevel.WARNING = 0;\nParseErrorLevel.ERROR = 1;\nParseErrorLevel[ParseErrorLevel.WARNING] = \"WARNING\";\nParseErrorLevel[ParseErrorLevel.ERROR] = \"ERROR\";\nexport class ParseError {\n /**\n * @param {?} span\n * @param {?} msg\n * @param {?=} level\n */\n constructor(span, msg, level = ParseErrorLevel.ERROR) {\n this.span = span;\n this.msg = msg;\n this.level = level;\n }\n /**\n * @return {?}\n */\n contextualMessage() {\n const /** @type {?} */ ctx = this.span.start.getContext(100, 3);\n return ctx ? ` (\"${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}\")` : '';\n }\n /**\n * @return {?}\n */\n toString() {\n const /** @type {?} */ details = this.span.details ? `, ${this.span.details}` : '';\n return `${this.msg}${this.contextualMessage()}: ${this.span.start}${details}`;\n }\n}\nfunction ParseError_tsickle_Closure_declarations() {\n /** @type {?} */\n ParseError.prototype.span;\n /** @type {?} */\n ParseError.prototype.msg;\n /** @type {?} */\n ParseError.prototype.level;\n}\n/**\n * @param {?} kind\n * @param {?} type\n * @return {?}\n */\nexport function typeSourceSpan(kind, type) {\n const /** @type {?} */ moduleUrl = identifierModuleUrl(type);\n const /** @type {?} */ sourceFileName = moduleUrl != null ? `in ${kind} ${identifierName(type)} in ${moduleUrl}` :\n `in ${kind} ${identifierName(type)}`;\n const /** @type {?} */ sourceFile = new ParseSourceFile('', sourceFileName);\n return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));\n}\n//# sourceMappingURL=parse_util.js.map","/**\n * A path is an ordered set of elements. Typically a path is to a\n * particular offset in a source file. The head of the list is the top\n * most node. The tail is the node that contains the offset directly.\n *\n * For example, the expresion `a + b + c` might have an ast that looks\n * like:\n * +\n * / \\\n * a +\n * / \\\n * b c\n *\n * The path to the node at offset 9 would be `['+' at 1-10, '+' at 7-10,\n * 'c' at 9-10]` and the path the node at offset 1 would be\n * `['+' at 1-10, 'a' at 1-2]`.\n */\nexport class AstPath {\n /**\n * @param {?} path\n * @param {?=} position\n */\n constructor(path, position = -1) {\n this.path = path;\n this.position = position;\n }\n /**\n * @return {?}\n */\n get empty() { return !this.path || !this.path.length; }\n /**\n * @return {?}\n */\n get head() { return this.path[0]; }\n /**\n * @return {?}\n */\n get tail() { return this.path[this.path.length - 1]; }\n /**\n * @param {?} node\n * @return {?}\n */\n parentOf(node) {\n return node && this.path[this.path.indexOf(node) - 1];\n }\n /**\n * @param {?} node\n * @return {?}\n */\n childOf(node) { return this.path[this.path.indexOf(node) + 1]; }\n /**\n * @template N\n * @param {?} ctor\n * @return {?}\n */\n first(ctor) {\n for (let /** @type {?} */ i = this.path.length - 1; i >= 0; i--) {\n let /** @type {?} */ item = this.path[i];\n if (item instanceof ctor)\n return (item);\n }\n }\n /**\n * @param {?} node\n * @return {?}\n */\n push(node) { this.path.push(node); }\n /**\n * @return {?}\n */\n pop() { return ((this.path.pop())); }\n}\nfunction AstPath_tsickle_Closure_declarations() {\n /** @type {?} */\n AstPath.prototype.path;\n /** @type {?} */\n AstPath.prototype.position;\n}\n//# sourceMappingURL=ast_path.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { AstPath } from '../ast_path';\nexport class Text {\n /**\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitText(this, context); }\n}\nfunction Text_tsickle_Closure_declarations() {\n /** @type {?} */\n Text.prototype.value;\n /** @type {?} */\n Text.prototype.sourceSpan;\n}\nexport class Expansion {\n /**\n * @param {?} switchValue\n * @param {?} type\n * @param {?} cases\n * @param {?} sourceSpan\n * @param {?} switchValueSourceSpan\n */\n constructor(switchValue, type, cases, sourceSpan, switchValueSourceSpan) {\n this.switchValue = switchValue;\n this.type = type;\n this.cases = cases;\n this.sourceSpan = sourceSpan;\n this.switchValueSourceSpan = switchValueSourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitExpansion(this, context); }\n}\nfunction Expansion_tsickle_Closure_declarations() {\n /** @type {?} */\n Expansion.prototype.switchValue;\n /** @type {?} */\n Expansion.prototype.type;\n /** @type {?} */\n Expansion.prototype.cases;\n /** @type {?} */\n Expansion.prototype.sourceSpan;\n /** @type {?} */\n Expansion.prototype.switchValueSourceSpan;\n}\nexport class ExpansionCase {\n /**\n * @param {?} value\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} valueSourceSpan\n * @param {?} expSourceSpan\n */\n constructor(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) {\n this.value = value;\n this.expression = expression;\n this.sourceSpan = sourceSpan;\n this.valueSourceSpan = valueSourceSpan;\n this.expSourceSpan = expSourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitExpansionCase(this, context); }\n}\nfunction ExpansionCase_tsickle_Closure_declarations() {\n /** @type {?} */\n ExpansionCase.prototype.value;\n /** @type {?} */\n ExpansionCase.prototype.expression;\n /** @type {?} */\n ExpansionCase.prototype.sourceSpan;\n /** @type {?} */\n ExpansionCase.prototype.valueSourceSpan;\n /** @type {?} */\n ExpansionCase.prototype.expSourceSpan;\n}\nexport class Attribute {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?=} valueSpan\n */\n constructor(name, value, sourceSpan, valueSpan) {\n this.name = name;\n this.value = value;\n this.sourceSpan = sourceSpan;\n this.valueSpan = valueSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitAttribute(this, context); }\n}\nfunction Attribute_tsickle_Closure_declarations() {\n /** @type {?} */\n Attribute.prototype.name;\n /** @type {?} */\n Attribute.prototype.value;\n /** @type {?} */\n Attribute.prototype.sourceSpan;\n /** @type {?} */\n Attribute.prototype.valueSpan;\n}\nexport class Element {\n /**\n * @param {?} name\n * @param {?} attrs\n * @param {?} children\n * @param {?} sourceSpan\n * @param {?=} startSourceSpan\n * @param {?=} endSourceSpan\n */\n constructor(name, attrs, children, sourceSpan, startSourceSpan = null, endSourceSpan = null) {\n this.name = name;\n this.attrs = attrs;\n this.children = children;\n this.sourceSpan = sourceSpan;\n this.startSourceSpan = startSourceSpan;\n this.endSourceSpan = endSourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitElement(this, context); }\n}\nfunction Element_tsickle_Closure_declarations() {\n /** @type {?} */\n Element.prototype.name;\n /** @type {?} */\n Element.prototype.attrs;\n /** @type {?} */\n Element.prototype.children;\n /** @type {?} */\n Element.prototype.sourceSpan;\n /** @type {?} */\n Element.prototype.startSourceSpan;\n /** @type {?} */\n Element.prototype.endSourceSpan;\n}\nexport class Comment {\n /**\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitComment(this, context); }\n}\nfunction Comment_tsickle_Closure_declarations() {\n /** @type {?} */\n Comment.prototype.value;\n /** @type {?} */\n Comment.prototype.sourceSpan;\n}\n/**\n * @param {?} visitor\n * @param {?} nodes\n * @param {?=} context\n * @return {?}\n */\nexport function visitAll(visitor, nodes, context = null) {\n const /** @type {?} */ result = [];\n const /** @type {?} */ visit = visitor.visit ?\n (ast) => ((visitor.visit))(ast, context) || ast.visit(visitor, context) :\n (ast) => ast.visit(visitor, context);\n nodes.forEach(ast => {\n const /** @type {?} */ astResult = visit(ast);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\nexport class RecursiveVisitor {\n constructor() { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitElement(ast, context) {\n this.visitChildren(context, visit => {\n visit(ast.attrs);\n visit(ast.children);\n });\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitAttribute(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitText(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitComment(ast, context) { }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitExpansion(ast, context) {\n return this.visitChildren(context, visit => { visit(ast.cases); });\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(ast, context) { }\n /**\n * @template T\n * @param {?} context\n * @param {?} cb\n * @return {?}\n */\n visitChildren(context, cb) {\n let /** @type {?} */ results = [];\n let /** @type {?} */ t = this;\n /**\n * @template T\n * @param {?} children\n * @return {?}\n */\n function visit(children) {\n if (children)\n results.push(visitAll(t, children, context));\n }\n cb(visit);\n return [].concat.apply([], results);\n }\n}\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction spanOf(ast) {\n const /** @type {?} */ start = ast.sourceSpan.start.offset;\n let /** @type {?} */ end = ast.sourceSpan.end.offset;\n if (ast instanceof Element) {\n if (ast.endSourceSpan) {\n end = ast.endSourceSpan.end.offset;\n }\n else if (ast.children && ast.children.length) {\n end = spanOf(ast.children[ast.children.length - 1]).end;\n }\n }\n return { start, end };\n}\n/**\n * @param {?} nodes\n * @param {?} position\n * @return {?}\n */\nexport function findNode(nodes, position) {\n const /** @type {?} */ path = [];\n const /** @type {?} */ visitor = new class extends RecursiveVisitor {\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visit(ast, context) {\n const /** @type {?} */ span = spanOf(ast);\n if (span.start <= position && position < span.end) {\n path.push(ast);\n }\n else {\n // Returning a value here will result in the children being skipped.\n return true;\n }\n }\n };\n visitAll(visitor, nodes);\n return new AstPath(path, position);\n}\n//# sourceMappingURL=ast.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as chars from '../chars';\nimport { ParseError, ParseLocation, ParseSourceFile, ParseSourceSpan } from '../parse_util';\nimport { DEFAULT_INTERPOLATION_CONFIG } from './interpolation_config';\nimport { NAMED_ENTITIES, TagContentType } from './tags';\nexport let TokenType = {};\nTokenType.TAG_OPEN_START = 0;\nTokenType.TAG_OPEN_END = 1;\nTokenType.TAG_OPEN_END_VOID = 2;\nTokenType.TAG_CLOSE = 3;\nTokenType.TEXT = 4;\nTokenType.ESCAPABLE_RAW_TEXT = 5;\nTokenType.RAW_TEXT = 6;\nTokenType.COMMENT_START = 7;\nTokenType.COMMENT_END = 8;\nTokenType.CDATA_START = 9;\nTokenType.CDATA_END = 10;\nTokenType.ATTR_NAME = 11;\nTokenType.ATTR_VALUE = 12;\nTokenType.DOC_TYPE = 13;\nTokenType.EXPANSION_FORM_START = 14;\nTokenType.EXPANSION_CASE_VALUE = 15;\nTokenType.EXPANSION_CASE_EXP_START = 16;\nTokenType.EXPANSION_CASE_EXP_END = 17;\nTokenType.EXPANSION_FORM_END = 18;\nTokenType.EOF = 19;\nTokenType[TokenType.TAG_OPEN_START] = \"TAG_OPEN_START\";\nTokenType[TokenType.TAG_OPEN_END] = \"TAG_OPEN_END\";\nTokenType[TokenType.TAG_OPEN_END_VOID] = \"TAG_OPEN_END_VOID\";\nTokenType[TokenType.TAG_CLOSE] = \"TAG_CLOSE\";\nTokenType[TokenType.TEXT] = \"TEXT\";\nTokenType[TokenType.ESCAPABLE_RAW_TEXT] = \"ESCAPABLE_RAW_TEXT\";\nTokenType[TokenType.RAW_TEXT] = \"RAW_TEXT\";\nTokenType[TokenType.COMMENT_START] = \"COMMENT_START\";\nTokenType[TokenType.COMMENT_END] = \"COMMENT_END\";\nTokenType[TokenType.CDATA_START] = \"CDATA_START\";\nTokenType[TokenType.CDATA_END] = \"CDATA_END\";\nTokenType[TokenType.ATTR_NAME] = \"ATTR_NAME\";\nTokenType[TokenType.ATTR_VALUE] = \"ATTR_VALUE\";\nTokenType[TokenType.DOC_TYPE] = \"DOC_TYPE\";\nTokenType[TokenType.EXPANSION_FORM_START] = \"EXPANSION_FORM_START\";\nTokenType[TokenType.EXPANSION_CASE_VALUE] = \"EXPANSION_CASE_VALUE\";\nTokenType[TokenType.EXPANSION_CASE_EXP_START] = \"EXPANSION_CASE_EXP_START\";\nTokenType[TokenType.EXPANSION_CASE_EXP_END] = \"EXPANSION_CASE_EXP_END\";\nTokenType[TokenType.EXPANSION_FORM_END] = \"EXPANSION_FORM_END\";\nTokenType[TokenType.EOF] = \"EOF\";\nexport class Token {\n /**\n * @param {?} type\n * @param {?} parts\n * @param {?} sourceSpan\n */\n constructor(type, parts, sourceSpan) {\n this.type = type;\n this.parts = parts;\n this.sourceSpan = sourceSpan;\n }\n}\nfunction Token_tsickle_Closure_declarations() {\n /** @type {?} */\n Token.prototype.type;\n /** @type {?} */\n Token.prototype.parts;\n /** @type {?} */\n Token.prototype.sourceSpan;\n}\nexport class TokenError extends ParseError {\n /**\n * @param {?} errorMsg\n * @param {?} tokenType\n * @param {?} span\n */\n constructor(errorMsg, tokenType, span) {\n super(span, errorMsg);\n this.tokenType = tokenType;\n }\n}\nfunction TokenError_tsickle_Closure_declarations() {\n /** @type {?} */\n TokenError.prototype.tokenType;\n}\nexport class TokenizeResult {\n /**\n * @param {?} tokens\n * @param {?} errors\n */\n constructor(tokens, errors) {\n this.tokens = tokens;\n this.errors = errors;\n }\n}\nfunction TokenizeResult_tsickle_Closure_declarations() {\n /** @type {?} */\n TokenizeResult.prototype.tokens;\n /** @type {?} */\n TokenizeResult.prototype.errors;\n}\n/**\n * @param {?} source\n * @param {?} url\n * @param {?} getTagDefinition\n * @param {?=} tokenizeExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\nexport function tokenize(source, url, getTagDefinition, tokenizeExpansionForms = false, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, tokenizeExpansionForms, interpolationConfig)\n .tokenize();\n}\nconst /** @type {?} */ _CR_OR_CRLF_REGEXP = /\\r\\n?/g;\n/**\n * @param {?} charCode\n * @return {?}\n */\nfunction _unexpectedCharacterErrorMsg(charCode) {\n const /** @type {?} */ char = charCode === chars.$EOF ? 'EOF' : String.fromCharCode(charCode);\n return `Unexpected character \"${char}\"`;\n}\n/**\n * @param {?} entitySrc\n * @return {?}\n */\nfunction _unknownEntityErrorMsg(entitySrc) {\n return `Unknown entity \"${entitySrc}\" - use the \"&#;\" or \"&#x;\" syntax`;\n}\nclass _ControlFlowError {\n /**\n * @param {?} error\n */\n constructor(error) {\n this.error = error;\n }\n}\nfunction _ControlFlowError_tsickle_Closure_declarations() {\n /** @type {?} */\n _ControlFlowError.prototype.error;\n}\nclass _Tokenizer {\n /**\n * @param {?} _file The html source\n * @param {?} _getTagDefinition\n * @param {?} _tokenizeIcu Whether to tokenize ICU messages (considered as text nodes when false)\n * @param {?=} _interpolationConfig\n */\n constructor(_file, _getTagDefinition, _tokenizeIcu, _interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n this._file = _file;\n this._getTagDefinition = _getTagDefinition;\n this._tokenizeIcu = _tokenizeIcu;\n this._interpolationConfig = _interpolationConfig;\n this._peek = -1;\n this._nextPeek = -1;\n this._index = -1;\n this._line = 0;\n this._column = -1;\n this._expansionCaseStack = [];\n this._inInterpolation = false;\n this.tokens = [];\n this.errors = [];\n this._input = _file.content;\n this._length = _file.content.length;\n this._advance();\n }\n /**\n * @param {?} content\n * @return {?}\n */\n _processCarriageReturns(content) {\n // http://www.w3.org/TR/html5/syntax.html#preprocessing-the-input-stream\n // In order to keep the original position in the source, we can not\n // pre-process it.\n // Instead CRs are processed right before instantiating the tokens.\n return content.replace(_CR_OR_CRLF_REGEXP, '\\n');\n }\n /**\n * @return {?}\n */\n tokenize() {\n while (this._peek !== chars.$EOF) {\n const /** @type {?} */ start = this._getLocation();\n try {\n if (this._attemptCharCode(chars.$LT)) {\n if (this._attemptCharCode(chars.$BANG)) {\n if (this._attemptCharCode(chars.$LBRACKET)) {\n this._consumeCdata(start);\n }\n else if (this._attemptCharCode(chars.$MINUS)) {\n this._consumeComment(start);\n }\n else {\n this._consumeDocType(start);\n }\n }\n else if (this._attemptCharCode(chars.$SLASH)) {\n this._consumeTagClose(start);\n }\n else {\n this._consumeTagOpen(start);\n }\n }\n else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {\n this._consumeText();\n }\n }\n catch (e) {\n if (e instanceof _ControlFlowError) {\n this.errors.push(e.error);\n }\n else {\n throw e;\n }\n }\n }\n this._beginToken(TokenType.EOF);\n this._endToken([]);\n return new TokenizeResult(mergeTextTokens(this.tokens), this.errors);\n }\n /**\n * \\@internal\n * @return {?}\n */\n _tokenizeExpansionForm() {\n if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {\n this._consumeExpansionFormStart();\n return true;\n }\n if (isExpansionCaseStart(this._peek) && this._isInExpansionForm()) {\n this._consumeExpansionCaseStart();\n return true;\n }\n if (this._peek === chars.$RBRACE) {\n if (this._isInExpansionCase()) {\n this._consumeExpansionCaseEnd();\n return true;\n }\n if (this._isInExpansionForm()) {\n this._consumeExpansionFormEnd();\n return true;\n }\n }\n return false;\n }\n /**\n * @return {?}\n */\n _getLocation() {\n return new ParseLocation(this._file, this._index, this._line, this._column);\n }\n /**\n * @param {?=} start\n * @param {?=} end\n * @return {?}\n */\n _getSpan(start = this._getLocation(), end = this._getLocation()) {\n return new ParseSourceSpan(start, end);\n }\n /**\n * @param {?} type\n * @param {?=} start\n * @return {?}\n */\n _beginToken(type, start = this._getLocation()) {\n this._currentTokenStart = start;\n this._currentTokenType = type;\n }\n /**\n * @param {?} parts\n * @param {?=} end\n * @return {?}\n */\n _endToken(parts, end = this._getLocation()) {\n const /** @type {?} */ token = new Token(this._currentTokenType, parts, new ParseSourceSpan(this._currentTokenStart, end));\n this.tokens.push(token);\n this._currentTokenStart = ((null));\n this._currentTokenType = ((null));\n return token;\n }\n /**\n * @param {?} msg\n * @param {?} span\n * @return {?}\n */\n _createError(msg, span) {\n if (this._isInExpansionForm()) {\n msg += ` (Do you have an unescaped \"{\" in your template? Use \"{{ '{' }}\") to escape it.)`;\n }\n const /** @type {?} */ error = new TokenError(msg, this._currentTokenType, span);\n this._currentTokenStart = ((null));\n this._currentTokenType = ((null));\n return new _ControlFlowError(error);\n }\n /**\n * @return {?}\n */\n _advance() {\n if (this._index >= this._length) {\n throw this._createError(_unexpectedCharacterErrorMsg(chars.$EOF), this._getSpan());\n }\n if (this._peek === chars.$LF) {\n this._line++;\n this._column = 0;\n }\n else if (this._peek !== chars.$LF && this._peek !== chars.$CR) {\n this._column++;\n }\n this._index++;\n this._peek = this._index >= this._length ? chars.$EOF : this._input.charCodeAt(this._index);\n this._nextPeek =\n this._index + 1 >= this._length ? chars.$EOF : this._input.charCodeAt(this._index + 1);\n }\n /**\n * @param {?} charCode\n * @return {?}\n */\n _attemptCharCode(charCode) {\n if (this._peek === charCode) {\n this._advance();\n return true;\n }\n return false;\n }\n /**\n * @param {?} charCode\n * @return {?}\n */\n _attemptCharCodeCaseInsensitive(charCode) {\n if (compareCharCodeCaseInsensitive(this._peek, charCode)) {\n this._advance();\n return true;\n }\n return false;\n }\n /**\n * @param {?} charCode\n * @return {?}\n */\n _requireCharCode(charCode) {\n const /** @type {?} */ location = this._getLocation();\n if (!this._attemptCharCode(charCode)) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location, location));\n }\n }\n /**\n * @param {?} chars\n * @return {?}\n */\n _attemptStr(chars) {\n const /** @type {?} */ len = chars.length;\n if (this._index + len > this._length) {\n return false;\n }\n const /** @type {?} */ initialPosition = this._savePosition();\n for (let /** @type {?} */ i = 0; i < len; i++) {\n if (!this._attemptCharCode(chars.charCodeAt(i))) {\n // If attempting to parse the string fails, we want to reset the parser\n // to where it was before the attempt\n this._restorePosition(initialPosition);\n return false;\n }\n }\n return true;\n }\n /**\n * @param {?} chars\n * @return {?}\n */\n _attemptStrCaseInsensitive(chars) {\n for (let /** @type {?} */ i = 0; i < chars.length; i++) {\n if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {\n return false;\n }\n }\n return true;\n }\n /**\n * @param {?} chars\n * @return {?}\n */\n _requireStr(chars) {\n const /** @type {?} */ location = this._getLocation();\n if (!this._attemptStr(chars)) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(location));\n }\n }\n /**\n * @param {?} predicate\n * @return {?}\n */\n _attemptCharCodeUntilFn(predicate) {\n while (!predicate(this._peek)) {\n this._advance();\n }\n }\n /**\n * @param {?} predicate\n * @param {?} len\n * @return {?}\n */\n _requireCharCodeUntilFn(predicate, len) {\n const /** @type {?} */ start = this._getLocation();\n this._attemptCharCodeUntilFn(predicate);\n if (this._index - start.offset < len) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan(start, start));\n }\n }\n /**\n * @param {?} char\n * @return {?}\n */\n _attemptUntilChar(char) {\n while (this._peek !== char) {\n this._advance();\n }\n }\n /**\n * @param {?} decodeEntities\n * @return {?}\n */\n _readChar(decodeEntities) {\n if (decodeEntities && this._peek === chars.$AMPERSAND) {\n return this._decodeEntity();\n }\n else {\n const /** @type {?} */ index = this._index;\n this._advance();\n return this._input[index];\n }\n }\n /**\n * @return {?}\n */\n _decodeEntity() {\n const /** @type {?} */ start = this._getLocation();\n this._advance();\n if (this._attemptCharCode(chars.$HASH)) {\n const /** @type {?} */ isHex = this._attemptCharCode(chars.$x) || this._attemptCharCode(chars.$X);\n const /** @type {?} */ numberStart = this._getLocation().offset;\n this._attemptCharCodeUntilFn(isDigitEntityEnd);\n if (this._peek != chars.$SEMICOLON) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());\n }\n this._advance();\n const /** @type {?} */ strNum = this._input.substring(numberStart, this._index - 1);\n try {\n const /** @type {?} */ charCode = parseInt(strNum, isHex ? 16 : 10);\n return String.fromCharCode(charCode);\n }\n catch (e) {\n const /** @type {?} */ entity = this._input.substring(start.offset + 1, this._index - 1);\n throw this._createError(_unknownEntityErrorMsg(entity), this._getSpan(start));\n }\n }\n else {\n const /** @type {?} */ startPosition = this._savePosition();\n this._attemptCharCodeUntilFn(isNamedEntityEnd);\n if (this._peek != chars.$SEMICOLON) {\n this._restorePosition(startPosition);\n return '&';\n }\n this._advance();\n const /** @type {?} */ name = this._input.substring(start.offset + 1, this._index - 1);\n const /** @type {?} */ char = NAMED_ENTITIES[name];\n if (!char) {\n throw this._createError(_unknownEntityErrorMsg(name), this._getSpan(start));\n }\n return char;\n }\n }\n /**\n * @param {?} decodeEntities\n * @param {?} firstCharOfEnd\n * @param {?} attemptEndRest\n * @return {?}\n */\n _consumeRawText(decodeEntities, firstCharOfEnd, attemptEndRest) {\n let /** @type {?} */ tagCloseStart;\n const /** @type {?} */ textStart = this._getLocation();\n this._beginToken(decodeEntities ? TokenType.ESCAPABLE_RAW_TEXT : TokenType.RAW_TEXT, textStart);\n const /** @type {?} */ parts = [];\n while (true) {\n tagCloseStart = this._getLocation();\n if (this._attemptCharCode(firstCharOfEnd) && attemptEndRest()) {\n break;\n }\n if (this._index > tagCloseStart.offset) {\n // add the characters consumed by the previous if statement to the output\n parts.push(this._input.substring(tagCloseStart.offset, this._index));\n }\n while (this._peek !== firstCharOfEnd) {\n parts.push(this._readChar(decodeEntities));\n }\n }\n return this._endToken([this._processCarriageReturns(parts.join(''))], tagCloseStart);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _consumeComment(start) {\n this._beginToken(TokenType.COMMENT_START, start);\n this._requireCharCode(chars.$MINUS);\n this._endToken([]);\n const /** @type {?} */ textToken = this._consumeRawText(false, chars.$MINUS, () => this._attemptStr('->'));\n this._beginToken(TokenType.COMMENT_END, textToken.sourceSpan.end);\n this._endToken([]);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _consumeCdata(start) {\n this._beginToken(TokenType.CDATA_START, start);\n this._requireStr('CDATA[');\n this._endToken([]);\n const /** @type {?} */ textToken = this._consumeRawText(false, chars.$RBRACKET, () => this._attemptStr(']>'));\n this._beginToken(TokenType.CDATA_END, textToken.sourceSpan.end);\n this._endToken([]);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _consumeDocType(start) {\n this._beginToken(TokenType.DOC_TYPE, start);\n this._attemptUntilChar(chars.$GT);\n this._advance();\n this._endToken([this._input.substring(start.offset + 2, this._index - 1)]);\n }\n /**\n * @return {?}\n */\n _consumePrefixAndName() {\n const /** @type {?} */ nameOrPrefixStart = this._index;\n let /** @type {?} */ prefix = ((null));\n while (this._peek !== chars.$COLON && !isPrefixEnd(this._peek)) {\n this._advance();\n }\n let /** @type {?} */ nameStart;\n if (this._peek === chars.$COLON) {\n this._advance();\n prefix = this._input.substring(nameOrPrefixStart, this._index - 1);\n nameStart = this._index;\n }\n else {\n nameStart = nameOrPrefixStart;\n }\n this._requireCharCodeUntilFn(isNameEnd, this._index === nameStart ? 1 : 0);\n const /** @type {?} */ name = this._input.substring(nameStart, this._index);\n return [prefix, name];\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _consumeTagOpen(start) {\n const /** @type {?} */ savedPos = this._savePosition();\n let /** @type {?} */ tagName;\n let /** @type {?} */ lowercaseTagName;\n try {\n if (!chars.isAsciiLetter(this._peek)) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());\n }\n const /** @type {?} */ nameStart = this._index;\n this._consumeTagOpenStart(start);\n tagName = this._input.substring(nameStart, this._index);\n lowercaseTagName = tagName.toLowerCase();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n while (this._peek !== chars.$SLASH && this._peek !== chars.$GT) {\n this._consumeAttributeName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (this._attemptCharCode(chars.$EQ)) {\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._consumeAttributeValue();\n }\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n this._consumeTagOpenEnd();\n }\n catch (e) {\n if (e instanceof _ControlFlowError) {\n // When the start tag is invalid, assume we want a \"<\"\n this._restorePosition(savedPos);\n // Back to back text tokens are merged at the end\n this._beginToken(TokenType.TEXT, start);\n this._endToken(['<']);\n return;\n }\n throw e;\n }\n const /** @type {?} */ contentTokenType = this._getTagDefinition(tagName).contentType;\n if (contentTokenType === TagContentType.RAW_TEXT) {\n this._consumeRawTextWithTagClose(lowercaseTagName, false);\n }\n else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {\n this._consumeRawTextWithTagClose(lowercaseTagName, true);\n }\n }\n /**\n * @param {?} lowercaseTagName\n * @param {?} decodeEntities\n * @return {?}\n */\n _consumeRawTextWithTagClose(lowercaseTagName, decodeEntities) {\n const /** @type {?} */ textToken = this._consumeRawText(decodeEntities, chars.$LT, () => {\n if (!this._attemptCharCode(chars.$SLASH))\n return false;\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (!this._attemptStrCaseInsensitive(lowercaseTagName))\n return false;\n this._attemptCharCodeUntilFn(isNotWhitespace);\n return this._attemptCharCode(chars.$GT);\n });\n this._beginToken(TokenType.TAG_CLOSE, textToken.sourceSpan.end);\n this._endToken([/** @type {?} */ ((null)), lowercaseTagName]);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _consumeTagOpenStart(start) {\n this._beginToken(TokenType.TAG_OPEN_START, start);\n const /** @type {?} */ parts = this._consumePrefixAndName();\n this._endToken(parts);\n }\n /**\n * @return {?}\n */\n _consumeAttributeName() {\n this._beginToken(TokenType.ATTR_NAME);\n const /** @type {?} */ prefixAndName = this._consumePrefixAndName();\n this._endToken(prefixAndName);\n }\n /**\n * @return {?}\n */\n _consumeAttributeValue() {\n this._beginToken(TokenType.ATTR_VALUE);\n let /** @type {?} */ value;\n if (this._peek === chars.$SQ || this._peek === chars.$DQ) {\n const /** @type {?} */ quoteChar = this._peek;\n this._advance();\n const /** @type {?} */ parts = [];\n while (this._peek !== quoteChar) {\n parts.push(this._readChar(true));\n }\n value = parts.join('');\n this._advance();\n }\n else {\n const /** @type {?} */ valueStart = this._index;\n this._requireCharCodeUntilFn(isNameEnd, 1);\n value = this._input.substring(valueStart, this._index);\n }\n this._endToken([this._processCarriageReturns(value)]);\n }\n /**\n * @return {?}\n */\n _consumeTagOpenEnd() {\n const /** @type {?} */ tokenType = this._attemptCharCode(chars.$SLASH) ? TokenType.TAG_OPEN_END_VOID : TokenType.TAG_OPEN_END;\n this._beginToken(tokenType);\n this._requireCharCode(chars.$GT);\n this._endToken([]);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _consumeTagClose(start) {\n this._beginToken(TokenType.TAG_CLOSE, start);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n const /** @type {?} */ prefixAndName = this._consumePrefixAndName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._requireCharCode(chars.$GT);\n this._endToken(prefixAndName);\n }\n /**\n * @return {?}\n */\n _consumeExpansionFormStart() {\n this._beginToken(TokenType.EXPANSION_FORM_START, this._getLocation());\n this._requireCharCode(chars.$LBRACE);\n this._endToken([]);\n this._expansionCaseStack.push(TokenType.EXPANSION_FORM_START);\n this._beginToken(TokenType.RAW_TEXT, this._getLocation());\n const /** @type {?} */ condition = this._readUntil(chars.$COMMA);\n this._endToken([condition], this._getLocation());\n this._requireCharCode(chars.$COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._beginToken(TokenType.RAW_TEXT, this._getLocation());\n const /** @type {?} */ type = this._readUntil(chars.$COMMA);\n this._endToken([type], this._getLocation());\n this._requireCharCode(chars.$COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n /**\n * @return {?}\n */\n _consumeExpansionCaseStart() {\n this._beginToken(TokenType.EXPANSION_CASE_VALUE, this._getLocation());\n const /** @type {?} */ value = this._readUntil(chars.$LBRACE).trim();\n this._endToken([value], this._getLocation());\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._beginToken(TokenType.EXPANSION_CASE_EXP_START, this._getLocation());\n this._requireCharCode(chars.$LBRACE);\n this._endToken([], this._getLocation());\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._expansionCaseStack.push(TokenType.EXPANSION_CASE_EXP_START);\n }\n /**\n * @return {?}\n */\n _consumeExpansionCaseEnd() {\n this._beginToken(TokenType.EXPANSION_CASE_EXP_END, this._getLocation());\n this._requireCharCode(chars.$RBRACE);\n this._endToken([], this._getLocation());\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._expansionCaseStack.pop();\n }\n /**\n * @return {?}\n */\n _consumeExpansionFormEnd() {\n this._beginToken(TokenType.EXPANSION_FORM_END, this._getLocation());\n this._requireCharCode(chars.$RBRACE);\n this._endToken([]);\n this._expansionCaseStack.pop();\n }\n /**\n * @return {?}\n */\n _consumeText() {\n const /** @type {?} */ start = this._getLocation();\n this._beginToken(TokenType.TEXT, start);\n const /** @type {?} */ parts = [];\n do {\n if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {\n parts.push(this._interpolationConfig.start);\n this._inInterpolation = true;\n }\n else if (this._interpolationConfig && this._inInterpolation &&\n this._attemptStr(this._interpolationConfig.end)) {\n parts.push(this._interpolationConfig.end);\n this._inInterpolation = false;\n }\n else {\n parts.push(this._readChar(true));\n }\n } while (!this._isTextEnd());\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n }\n /**\n * @return {?}\n */\n _isTextEnd() {\n if (this._peek === chars.$LT || this._peek === chars.$EOF) {\n return true;\n }\n if (this._tokenizeIcu && !this._inInterpolation) {\n if (isExpansionFormStart(this._input, this._index, this._interpolationConfig)) {\n // start of an expansion form\n return true;\n }\n if (this._peek === chars.$RBRACE && this._isInExpansionCase()) {\n // end of and expansion case\n return true;\n }\n }\n return false;\n }\n /**\n * @return {?}\n */\n _savePosition() {\n return [this._peek, this._index, this._column, this._line, this.tokens.length];\n }\n /**\n * @param {?} char\n * @return {?}\n */\n _readUntil(char) {\n const /** @type {?} */ start = this._index;\n this._attemptUntilChar(char);\n return this._input.substring(start, this._index);\n }\n /**\n * @param {?} position\n * @return {?}\n */\n _restorePosition(position) {\n this._peek = position[0];\n this._index = position[1];\n this._column = position[2];\n this._line = position[3];\n const /** @type {?} */ nbTokens = position[4];\n if (nbTokens < this.tokens.length) {\n // remove any extra tokens\n this.tokens = this.tokens.slice(0, nbTokens);\n }\n }\n /**\n * @return {?}\n */\n _isInExpansionCase() {\n return this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n TokenType.EXPANSION_CASE_EXP_START;\n }\n /**\n * @return {?}\n */\n _isInExpansionForm() {\n return this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n TokenType.EXPANSION_FORM_START;\n }\n}\nfunction _Tokenizer_tsickle_Closure_declarations() {\n /** @type {?} */\n _Tokenizer.prototype._input;\n /** @type {?} */\n _Tokenizer.prototype._length;\n /** @type {?} */\n _Tokenizer.prototype._peek;\n /** @type {?} */\n _Tokenizer.prototype._nextPeek;\n /** @type {?} */\n _Tokenizer.prototype._index;\n /** @type {?} */\n _Tokenizer.prototype._line;\n /** @type {?} */\n _Tokenizer.prototype._column;\n /** @type {?} */\n _Tokenizer.prototype._currentTokenStart;\n /** @type {?} */\n _Tokenizer.prototype._currentTokenType;\n /** @type {?} */\n _Tokenizer.prototype._expansionCaseStack;\n /** @type {?} */\n _Tokenizer.prototype._inInterpolation;\n /** @type {?} */\n _Tokenizer.prototype.tokens;\n /** @type {?} */\n _Tokenizer.prototype.errors;\n /** @type {?} */\n _Tokenizer.prototype._file;\n /** @type {?} */\n _Tokenizer.prototype._getTagDefinition;\n /** @type {?} */\n _Tokenizer.prototype._tokenizeIcu;\n /** @type {?} */\n _Tokenizer.prototype._interpolationConfig;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNotWhitespace(code) {\n return !chars.isWhitespace(code) || code === chars.$EOF;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNameEnd(code) {\n return chars.isWhitespace(code) || code === chars.$GT || code === chars.$SLASH ||\n code === chars.$SQ || code === chars.$DQ || code === chars.$EQ;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isPrefixEnd(code) {\n return (code < chars.$a || chars.$z < code) && (code < chars.$A || chars.$Z < code) &&\n (code < chars.$0 || code > chars.$9);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isDigitEntityEnd(code) {\n return code == chars.$SEMICOLON || code == chars.$EOF || !chars.isAsciiHexDigit(code);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNamedEntityEnd(code) {\n return code == chars.$SEMICOLON || code == chars.$EOF || !chars.isAsciiLetter(code);\n}\n/**\n * @param {?} input\n * @param {?} offset\n * @param {?} interpolationConfig\n * @return {?}\n */\nfunction isExpansionFormStart(input, offset, interpolationConfig) {\n const /** @type {?} */ isInterpolationStart = interpolationConfig ? input.indexOf(interpolationConfig.start, offset) == offset : false;\n return input.charCodeAt(offset) == chars.$LBRACE && !isInterpolationStart;\n}\n/**\n * @param {?} peek\n * @return {?}\n */\nfunction isExpansionCaseStart(peek) {\n return peek === chars.$EQ || chars.isAsciiLetter(peek) || chars.isDigit(peek);\n}\n/**\n * @param {?} code1\n * @param {?} code2\n * @return {?}\n */\nfunction compareCharCodeCaseInsensitive(code1, code2) {\n return toUpperCaseCharCode(code1) == toUpperCaseCharCode(code2);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction toUpperCaseCharCode(code) {\n return code >= chars.$a && code <= chars.$z ? code - chars.$a + chars.$A : code;\n}\n/**\n * @param {?} srcTokens\n * @return {?}\n */\nfunction mergeTextTokens(srcTokens) {\n const /** @type {?} */ dstTokens = [];\n let /** @type {?} */ lastDstToken = undefined;\n for (let /** @type {?} */ i = 0; i < srcTokens.length; i++) {\n const /** @type {?} */ token = srcTokens[i];\n if (lastDstToken && lastDstToken.type == TokenType.TEXT && token.type == TokenType.TEXT) {\n lastDstToken.parts[0] += token.parts[0];\n lastDstToken.sourceSpan.end = token.sourceSpan.end;\n }\n else {\n lastDstToken = token;\n dstTokens.push(lastDstToken);\n }\n }\n return dstTokens;\n}\n//# sourceMappingURL=lexer.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ParseError, ParseSourceSpan } from '../parse_util';\nimport * as html from './ast';\nimport { DEFAULT_INTERPOLATION_CONFIG } from './interpolation_config';\nimport * as lex from './lexer';\nimport { getNsPrefix, isNgContainer, mergeNsAndName } from './tags';\nexport class TreeError extends ParseError {\n /**\n * @param {?} elementName\n * @param {?} span\n * @param {?} msg\n */\n constructor(elementName, span, msg) {\n super(span, msg);\n this.elementName = elementName;\n }\n /**\n * @param {?} elementName\n * @param {?} span\n * @param {?} msg\n * @return {?}\n */\n static create(elementName, span, msg) {\n return new TreeError(elementName, span, msg);\n }\n}\nfunction TreeError_tsickle_Closure_declarations() {\n /** @type {?} */\n TreeError.prototype.elementName;\n}\nexport class ParseTreeResult {\n /**\n * @param {?} rootNodes\n * @param {?} errors\n */\n constructor(rootNodes, errors) {\n this.rootNodes = rootNodes;\n this.errors = errors;\n }\n}\nfunction ParseTreeResult_tsickle_Closure_declarations() {\n /** @type {?} */\n ParseTreeResult.prototype.rootNodes;\n /** @type {?} */\n ParseTreeResult.prototype.errors;\n}\nexport class Parser {\n /**\n * @param {?} getTagDefinition\n */\n constructor(getTagDefinition) {\n this.getTagDefinition = getTagDefinition;\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parse(source, url, parseExpansionForms = false, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const /** @type {?} */ tokensAndErrors = lex.tokenize(source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);\n const /** @type {?} */ treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();\n return new ParseTreeResult(treeAndErrors.rootNodes, ((tokensAndErrors.errors)).concat(treeAndErrors.errors));\n }\n}\nfunction Parser_tsickle_Closure_declarations() {\n /** @type {?} */\n Parser.prototype.getTagDefinition;\n}\nclass _TreeBuilder {\n /**\n * @param {?} tokens\n * @param {?} getTagDefinition\n */\n constructor(tokens, getTagDefinition) {\n this.tokens = tokens;\n this.getTagDefinition = getTagDefinition;\n this._index = -1;\n this._rootNodes = [];\n this._errors = [];\n this._elementStack = [];\n this._advance();\n }\n /**\n * @return {?}\n */\n build() {\n while (this._peek.type !== lex.TokenType.EOF) {\n if (this._peek.type === lex.TokenType.TAG_OPEN_START) {\n this._consumeStartTag(this._advance());\n }\n else if (this._peek.type === lex.TokenType.TAG_CLOSE) {\n this._consumeEndTag(this._advance());\n }\n else if (this._peek.type === lex.TokenType.CDATA_START) {\n this._closeVoidElement();\n this._consumeCdata(this._advance());\n }\n else if (this._peek.type === lex.TokenType.COMMENT_START) {\n this._closeVoidElement();\n this._consumeComment(this._advance());\n }\n else if (this._peek.type === lex.TokenType.TEXT || this._peek.type === lex.TokenType.RAW_TEXT ||\n this._peek.type === lex.TokenType.ESCAPABLE_RAW_TEXT) {\n this._closeVoidElement();\n this._consumeText(this._advance());\n }\n else if (this._peek.type === lex.TokenType.EXPANSION_FORM_START) {\n this._consumeExpansion(this._advance());\n }\n else {\n // Skip all other tokens...\n this._advance();\n }\n }\n return new ParseTreeResult(this._rootNodes, this._errors);\n }\n /**\n * @return {?}\n */\n _advance() {\n const /** @type {?} */ prev = this._peek;\n if (this._index < this.tokens.length - 1) {\n // Note: there is always an EOF token at the end\n this._index++;\n }\n this._peek = this.tokens[this._index];\n return prev;\n }\n /**\n * @param {?} type\n * @return {?}\n */\n _advanceIf(type) {\n if (this._peek.type === type) {\n return this._advance();\n }\n return null;\n }\n /**\n * @param {?} startToken\n * @return {?}\n */\n _consumeCdata(startToken) {\n this._consumeText(this._advance());\n this._advanceIf(lex.TokenType.CDATA_END);\n }\n /**\n * @param {?} token\n * @return {?}\n */\n _consumeComment(token) {\n const /** @type {?} */ text = this._advanceIf(lex.TokenType.RAW_TEXT);\n this._advanceIf(lex.TokenType.COMMENT_END);\n const /** @type {?} */ value = text != null ? text.parts[0].trim() : null;\n this._addToParent(new html.Comment(value, token.sourceSpan));\n }\n /**\n * @param {?} token\n * @return {?}\n */\n _consumeExpansion(token) {\n const /** @type {?} */ switchValue = this._advance();\n const /** @type {?} */ type = this._advance();\n const /** @type {?} */ cases = [];\n // read =\n while (this._peek.type === lex.TokenType.EXPANSION_CASE_VALUE) {\n const /** @type {?} */ expCase = this._parseExpansionCase();\n if (!expCase)\n return; // error\n cases.push(expCase);\n }\n // read the final }\n if (this._peek.type !== lex.TokenType.EXPANSION_FORM_END) {\n this._errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return;\n }\n const /** @type {?} */ sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);\n this._addToParent(new html.Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));\n this._advance();\n }\n /**\n * @return {?}\n */\n _parseExpansionCase() {\n const /** @type {?} */ value = this._advance();\n // read {\n if (this._peek.type !== lex.TokenType.EXPANSION_CASE_EXP_START) {\n this._errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));\n return null;\n }\n // read until }\n const /** @type {?} */ start = this._advance();\n const /** @type {?} */ exp = this._collectExpansionExpTokens(start);\n if (!exp)\n return null;\n const /** @type {?} */ end = this._advance();\n exp.push(new lex.Token(lex.TokenType.EOF, [], end.sourceSpan));\n // parse everything in between { and }\n const /** @type {?} */ parsedExp = new _TreeBuilder(exp, this.getTagDefinition).build();\n if (parsedExp.errors.length > 0) {\n this._errors = this._errors.concat(/** @type {?} */ (parsedExp.errors));\n return null;\n }\n const /** @type {?} */ sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);\n const /** @type {?} */ expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);\n return new html.ExpansionCase(value.parts[0], parsedExp.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);\n }\n /**\n * @param {?} start\n * @return {?}\n */\n _collectExpansionExpTokens(start) {\n const /** @type {?} */ exp = [];\n const /** @type {?} */ expansionFormStack = [lex.TokenType.EXPANSION_CASE_EXP_START];\n while (true) {\n if (this._peek.type === lex.TokenType.EXPANSION_FORM_START ||\n this._peek.type === lex.TokenType.EXPANSION_CASE_EXP_START) {\n expansionFormStack.push(this._peek.type);\n }\n if (this._peek.type === lex.TokenType.EXPANSION_CASE_EXP_END) {\n if (lastOnStack(expansionFormStack, lex.TokenType.EXPANSION_CASE_EXP_START)) {\n expansionFormStack.pop();\n if (expansionFormStack.length == 0)\n return exp;\n }\n else {\n this._errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return null;\n }\n }\n if (this._peek.type === lex.TokenType.EXPANSION_FORM_END) {\n if (lastOnStack(expansionFormStack, lex.TokenType.EXPANSION_FORM_START)) {\n expansionFormStack.pop();\n }\n else {\n this._errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return null;\n }\n }\n if (this._peek.type === lex.TokenType.EOF) {\n this._errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));\n return null;\n }\n exp.push(this._advance());\n }\n }\n /**\n * @param {?} token\n * @return {?}\n */\n _consumeText(token) {\n let /** @type {?} */ text = token.parts[0];\n if (text.length > 0 && text[0] == '\\n') {\n const /** @type {?} */ parent = this._getParentElement();\n if (parent != null && parent.children.length == 0 &&\n this.getTagDefinition(parent.name).ignoreFirstLf) {\n text = text.substring(1);\n }\n }\n if (text.length > 0) {\n this._addToParent(new html.Text(text, token.sourceSpan));\n }\n }\n /**\n * @return {?}\n */\n _closeVoidElement() {\n const /** @type {?} */ el = this._getParentElement();\n if (el && this.getTagDefinition(el.name).isVoid) {\n this._elementStack.pop();\n }\n }\n /**\n * @param {?} startTagToken\n * @return {?}\n */\n _consumeStartTag(startTagToken) {\n const /** @type {?} */ prefix = startTagToken.parts[0];\n const /** @type {?} */ name = startTagToken.parts[1];\n const /** @type {?} */ attrs = [];\n while (this._peek.type === lex.TokenType.ATTR_NAME) {\n attrs.push(this._consumeAttr(this._advance()));\n }\n const /** @type {?} */ fullName = this._getElementFullName(prefix, name, this._getParentElement());\n let /** @type {?} */ selfClosing = false;\n // Note: There could have been a tokenizer error\n // so that we don't get a token for the end tag...\n if (this._peek.type === lex.TokenType.TAG_OPEN_END_VOID) {\n this._advance();\n selfClosing = true;\n const /** @type {?} */ tagDef = this.getTagDefinition(fullName);\n if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {\n this._errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void and foreign elements can be self closed \"${startTagToken.parts[1]}\"`));\n }\n }\n else if (this._peek.type === lex.TokenType.TAG_OPEN_END) {\n this._advance();\n selfClosing = false;\n }\n const /** @type {?} */ end = this._peek.sourceSpan.start;\n const /** @type {?} */ span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);\n const /** @type {?} */ el = new html.Element(fullName, attrs, [], span, span, undefined);\n this._pushElement(el);\n if (selfClosing) {\n this._popElement(fullName);\n el.endSourceSpan = span;\n }\n }\n /**\n * @param {?} el\n * @return {?}\n */\n _pushElement(el) {\n const /** @type {?} */ parentEl = this._getParentElement();\n if (parentEl && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {\n this._elementStack.pop();\n }\n const /** @type {?} */ tagDef = this.getTagDefinition(el.name);\n const { parent, container } = this._getParentElementSkippingContainers();\n if (parent && tagDef.requireExtraParent(parent.name)) {\n const /** @type {?} */ newParent = new html.Element(tagDef.parentToAdd, [], [], el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n this._insertBeforeContainer(parent, container, newParent);\n }\n this._addToParent(el);\n this._elementStack.push(el);\n }\n /**\n * @param {?} endTagToken\n * @return {?}\n */\n _consumeEndTag(endTagToken) {\n const /** @type {?} */ fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getParentElement());\n if (this._getParentElement()) {\n ((this._getParentElement())).endSourceSpan = endTagToken.sourceSpan;\n }\n if (this.getTagDefinition(fullName).isVoid) {\n this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, `Void elements do not have end tags \"${endTagToken.parts[1]}\"`));\n }\n else if (!this._popElement(fullName)) {\n const /** @type {?} */ 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`;\n this._errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));\n }\n }\n /**\n * @param {?} fullName\n * @return {?}\n */\n _popElement(fullName) {\n for (let /** @type {?} */ stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n const /** @type {?} */ el = this._elementStack[stackIndex];\n if (el.name == fullName) {\n this._elementStack.splice(stackIndex, this._elementStack.length - stackIndex);\n return true;\n }\n if (!this.getTagDefinition(el.name).closedByParent) {\n return false;\n }\n }\n return false;\n }\n /**\n * @param {?} attrName\n * @return {?}\n */\n _consumeAttr(attrName) {\n const /** @type {?} */ fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);\n let /** @type {?} */ end = attrName.sourceSpan.end;\n let /** @type {?} */ value = '';\n let /** @type {?} */ valueSpan = ((undefined));\n if (this._peek.type === lex.TokenType.ATTR_VALUE) {\n const /** @type {?} */ valueToken = this._advance();\n value = valueToken.parts[0];\n end = valueToken.sourceSpan.end;\n valueSpan = valueToken.sourceSpan;\n }\n return new html.Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);\n }\n /**\n * @return {?}\n */\n _getParentElement() {\n return this._elementStack.length > 0 ? this._elementStack[this._elementStack.length - 1] : null;\n }\n /**\n * Returns the parent in the DOM and the container.\n *\n * `` elements are skipped as they are not rendered as DOM element.\n * @return {?}\n */\n _getParentElementSkippingContainers() {\n let /** @type {?} */ container = null;\n for (let /** @type {?} */ i = this._elementStack.length - 1; i >= 0; i--) {\n if (!isNgContainer(this._elementStack[i].name)) {\n return { parent: this._elementStack[i], container };\n }\n container = this._elementStack[i];\n }\n return { parent: null, container };\n }\n /**\n * @param {?} node\n * @return {?}\n */\n _addToParent(node) {\n const /** @type {?} */ parent = this._getParentElement();\n if (parent != null) {\n parent.children.push(node);\n }\n else {\n this._rootNodes.push(node);\n }\n }\n /**\n * Insert a node between the parent and the container.\n * When no container is given, the node is appended as a child of the parent.\n * Also updates the element stack accordingly.\n *\n * \\@internal\n * @param {?} parent\n * @param {?} container\n * @param {?} node\n * @return {?}\n */\n _insertBeforeContainer(parent, container, node) {\n if (!container) {\n this._addToParent(node);\n this._elementStack.push(node);\n }\n else {\n if (parent) {\n // replace the container with the new node in the children\n const /** @type {?} */ index = parent.children.indexOf(container);\n parent.children[index] = node;\n }\n else {\n this._rootNodes.push(node);\n }\n node.children.push(container);\n this._elementStack.splice(this._elementStack.indexOf(container), 0, node);\n }\n }\n /**\n * @param {?} prefix\n * @param {?} localName\n * @param {?} parentElement\n * @return {?}\n */\n _getElementFullName(prefix, localName, parentElement) {\n if (prefix == null) {\n prefix = ((this.getTagDefinition(localName).implicitNamespacePrefix));\n if (prefix == null && parentElement != null) {\n prefix = getNsPrefix(parentElement.name);\n }\n }\n return mergeNsAndName(prefix, localName);\n }\n}\nfunction _TreeBuilder_tsickle_Closure_declarations() {\n /** @type {?} */\n _TreeBuilder.prototype._index;\n /** @type {?} */\n _TreeBuilder.prototype._peek;\n /** @type {?} */\n _TreeBuilder.prototype._rootNodes;\n /** @type {?} */\n _TreeBuilder.prototype._errors;\n /** @type {?} */\n _TreeBuilder.prototype._elementStack;\n /** @type {?} */\n _TreeBuilder.prototype.tokens;\n /** @type {?} */\n _TreeBuilder.prototype.getTagDefinition;\n}\n/**\n * @param {?} stack\n * @param {?} element\n * @return {?}\n */\nfunction lastOnStack(stack, element) {\n return stack.length > 0 && stack[stack.length - 1] === element;\n}\n//# sourceMappingURL=parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { utf8Encode } from '../util';\n/**\n * @param {?} message\n * @return {?}\n */\nexport function digest(message) {\n return message.id || sha1(serializeNodes(message.nodes).join('') + `[${message.meaning}]`);\n}\n/**\n * @param {?} message\n * @return {?}\n */\nexport function decimalDigest(message) {\n if (message.id) {\n return message.id;\n }\n const /** @type {?} */ visitor = new _SerializerIgnoreIcuExpVisitor();\n const /** @type {?} */ parts = message.nodes.map(a => a.visit(visitor, null));\n return computeMsgId(parts.join(''), message.meaning);\n}\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * The visitor is also used in the i18n parser tests\n *\n * \\@internal\n */\nclass _SerializerVisitor {\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { return text.value; }\n /**\n * @param {?} container\n * @param {?} context\n * @return {?}\n */\n visitContainer(container, context) {\n return `[${container.children.map(child => child.visit(this)).join(', ')}]`;\n }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitIcu(icu, context) {\n const /** @type {?} */ strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);\n return `{${icu.expression}, ${icu.type}, ${strCases.join(', ')}}`;\n }\n /**\n * @param {?} ph\n * @param {?} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n return ph.isVoid ?\n `` :\n `${ph.children.map(child => child.visit(this)).join(', ')}`;\n }\n /**\n * @param {?} ph\n * @param {?} context\n * @return {?}\n */\n visitPlaceholder(ph, context) {\n return ph.value ? `${ph.value}` : ``;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n return `${ph.value.visit(this)}`;\n }\n}\nconst /** @type {?} */ serializerVisitor = new _SerializerVisitor();\n/**\n * @param {?} nodes\n * @return {?}\n */\nexport function serializeNodes(nodes) {\n return nodes.map(a => a.visit(serializerVisitor, null));\n}\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.\n *\n * \\@internal\n */\nclass _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor {\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitIcu(icu, context) {\n let /** @type {?} */ strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);\n // Do not take the expression into account\n return `{${icu.type}, ${strCases.join(', ')}}`;\n }\n}\n/**\n * Compute the SHA1 of the given string\n *\n * see http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\n *\n * WARNING: this function has not been designed not tested with security in mind.\n * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.\n * @param {?} str\n * @return {?}\n */\nexport function sha1(str) {\n const /** @type {?} */ utf8 = utf8Encode(str);\n const /** @type {?} */ words32 = stringToWords32(utf8, Endian.Big);\n const /** @type {?} */ len = utf8.length * 8;\n const /** @type {?} */ w = new Array(80);\n let [a, b, c, d, e] = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n words32[len >> 5] |= 0x80 << (24 - len % 32);\n words32[((len + 64 >> 9) << 4) + 15] = len;\n for (let /** @type {?} */ i = 0; i < words32.length; i += 16) {\n const [h0, h1, h2, h3, h4] = [a, b, c, d, e];\n for (let /** @type {?} */ j = 0; j < 80; j++) {\n if (j < 16) {\n w[j] = words32[i + j];\n }\n else {\n w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n }\n const [f, k] = fk(j, b, c, d);\n const /** @type {?} */ temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);\n [e, d, c, b, a] = [d, c, rol32(b, 30), a, temp];\n }\n [a, b, c, d, e] = [add32(a, h0), add32(b, h1), add32(c, h2), add32(d, h3), add32(e, h4)];\n }\n return byteStringToHexString(words32ToByteString([a, b, c, d, e]));\n}\n/**\n * @param {?} index\n * @param {?} b\n * @param {?} c\n * @param {?} d\n * @return {?}\n */\nfunction fk(index, b, c, d) {\n if (index < 20) {\n return [(b & c) | (~b & d), 0x5a827999];\n }\n if (index < 40) {\n return [b ^ c ^ d, 0x6ed9eba1];\n }\n if (index < 60) {\n return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];\n }\n return [b ^ c ^ d, 0xca62c1d6];\n}\n/**\n * Compute the fingerprint of the given string\n *\n * The output is 64 bit number encoded as a decimal string\n *\n * based on:\n * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java\n * @param {?} str\n * @return {?}\n */\nexport function fingerprint(str) {\n const /** @type {?} */ utf8 = utf8Encode(str);\n let [hi, lo] = [hash32(utf8, 0), hash32(utf8, 102072)];\n if (hi == 0 && (lo == 0 || lo == 1)) {\n hi = hi ^ 0x130f9bef;\n lo = lo ^ -0x6b5f56d8;\n }\n return [hi, lo];\n}\n/**\n * @param {?} msg\n * @param {?} meaning\n * @return {?}\n */\nexport function computeMsgId(msg, meaning) {\n let [hi, lo] = fingerprint(msg);\n if (meaning) {\n const [him, lom] = fingerprint(meaning);\n [hi, lo] = add64(rol64([hi, lo], 1), [him, lom]);\n }\n return byteStringToDecString(words32ToByteString([hi & 0x7fffffff, lo]));\n}\n/**\n * @param {?} str\n * @param {?} c\n * @return {?}\n */\nfunction hash32(str, c) {\n let [a, b] = [0x9e3779b9, 0x9e3779b9];\n let /** @type {?} */ i;\n const /** @type {?} */ len = str.length;\n for (i = 0; i + 12 <= len; i += 12) {\n a = add32(a, wordAt(str, i, Endian.Little));\n b = add32(b, wordAt(str, i + 4, Endian.Little));\n c = add32(c, wordAt(str, i + 8, Endian.Little));\n [a, b, c] = mix([a, b, c]);\n }\n a = add32(a, wordAt(str, i, Endian.Little));\n b = add32(b, wordAt(str, i + 4, Endian.Little));\n // the first byte of c is reserved for the length\n c = add32(c, len);\n c = add32(c, wordAt(str, i + 8, Endian.Little) << 8);\n return mix([a, b, c])[2];\n}\n/**\n * @param {?} __0\n * @return {?}\n */\nfunction mix([a, b, c]) {\n a = sub32(a, b);\n a = sub32(a, c);\n a ^= c >>> 13;\n b = sub32(b, c);\n b = sub32(b, a);\n b ^= a << 8;\n c = sub32(c, a);\n c = sub32(c, b);\n c ^= b >>> 13;\n a = sub32(a, b);\n a = sub32(a, c);\n a ^= c >>> 12;\n b = sub32(b, c);\n b = sub32(b, a);\n b ^= a << 16;\n c = sub32(c, a);\n c = sub32(c, b);\n c ^= b >>> 5;\n a = sub32(a, b);\n a = sub32(a, c);\n a ^= c >>> 3;\n b = sub32(b, c);\n b = sub32(b, a);\n b ^= a << 10;\n c = sub32(c, a);\n c = sub32(c, b);\n c ^= b >>> 15;\n return [a, b, c];\n}\nlet Endian = {};\nEndian.Little = 0;\nEndian.Big = 1;\nEndian[Endian.Little] = \"Little\";\nEndian[Endian.Big] = \"Big\";\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction add32(a, b) {\n return add32to64(a, b)[1];\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction add32to64(a, b) {\n const /** @type {?} */ low = (a & 0xffff) + (b & 0xffff);\n const /** @type {?} */ high = (a >>> 16) + (b >>> 16) + (low >>> 16);\n return [high >>> 16, (high << 16) | (low & 0xffff)];\n}\n/**\n * @param {?} __0\n * @param {?} __1\n * @return {?}\n */\nfunction add64([ah, al], [bh, bl]) {\n const [carry, l] = add32to64(al, bl);\n const /** @type {?} */ h = add32(add32(ah, bh), carry);\n return [h, l];\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction sub32(a, b) {\n const /** @type {?} */ low = (a & 0xffff) - (b & 0xffff);\n const /** @type {?} */ high = (a >> 16) - (b >> 16) + (low >> 16);\n return (high << 16) | (low & 0xffff);\n}\n/**\n * @param {?} a\n * @param {?} count\n * @return {?}\n */\nfunction rol32(a, count) {\n return (a << count) | (a >>> (32 - count));\n}\n/**\n * @param {?} __0\n * @param {?} count\n * @return {?}\n */\nfunction rol64([hi, lo], count) {\n const /** @type {?} */ h = (hi << count) | (lo >>> (32 - count));\n const /** @type {?} */ l = (lo << count) | (hi >>> (32 - count));\n return [h, l];\n}\n/**\n * @param {?} str\n * @param {?} endian\n * @return {?}\n */\nfunction stringToWords32(str, endian) {\n const /** @type {?} */ words32 = Array((str.length + 3) >>> 2);\n for (let /** @type {?} */ i = 0; i < words32.length; i++) {\n words32[i] = wordAt(str, i * 4, endian);\n }\n return words32;\n}\n/**\n * @param {?} str\n * @param {?} index\n * @return {?}\n */\nfunction byteAt(str, index) {\n return index >= str.length ? 0 : str.charCodeAt(index) & 0xff;\n}\n/**\n * @param {?} str\n * @param {?} index\n * @param {?} endian\n * @return {?}\n */\nfunction wordAt(str, index, endian) {\n let /** @type {?} */ word = 0;\n if (endian === Endian.Big) {\n for (let /** @type {?} */ i = 0; i < 4; i++) {\n word += byteAt(str, index + i) << (24 - 8 * i);\n }\n }\n else {\n for (let /** @type {?} */ i = 0; i < 4; i++) {\n word += byteAt(str, index + i) << 8 * i;\n }\n }\n return word;\n}\n/**\n * @param {?} words32\n * @return {?}\n */\nfunction words32ToByteString(words32) {\n return words32.reduce((str, word) => str + word32ToByteString(word), '');\n}\n/**\n * @param {?} word\n * @return {?}\n */\nfunction word32ToByteString(word) {\n let /** @type {?} */ str = '';\n for (let /** @type {?} */ i = 0; i < 4; i++) {\n str += String.fromCharCode((word >>> 8 * (3 - i)) & 0xff);\n }\n return str;\n}\n/**\n * @param {?} str\n * @return {?}\n */\nfunction byteStringToHexString(str) {\n let /** @type {?} */ hex = '';\n for (let /** @type {?} */ i = 0; i < str.length; i++) {\n const /** @type {?} */ b = byteAt(str, i);\n hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);\n }\n return hex.toLowerCase();\n}\n/**\n * @param {?} str\n * @return {?}\n */\nfunction byteStringToDecString(str) {\n let /** @type {?} */ decimal = '';\n let /** @type {?} */ toThePower = '1';\n for (let /** @type {?} */ i = str.length - 1; i >= 0; i--) {\n decimal = addBigInt(decimal, numberTimesBigInt(byteAt(str, i), toThePower));\n toThePower = numberTimesBigInt(256, toThePower);\n }\n return decimal.split('').reverse().join('');\n}\n/**\n * @param {?} x\n * @param {?} y\n * @return {?}\n */\nfunction addBigInt(x, y) {\n let /** @type {?} */ sum = '';\n const /** @type {?} */ len = Math.max(x.length, y.length);\n for (let /** @type {?} */ i = 0, /** @type {?} */ carry = 0; i < len || carry; i++) {\n const /** @type {?} */ tmpSum = carry + +(x[i] || 0) + +(y[i] || 0);\n if (tmpSum >= 10) {\n carry = 1;\n sum += tmpSum - 10;\n }\n else {\n carry = 0;\n sum += tmpSum;\n }\n }\n return sum;\n}\n/**\n * @param {?} num\n * @param {?} b\n * @return {?}\n */\nfunction numberTimesBigInt(num, b) {\n let /** @type {?} */ product = '';\n let /** @type {?} */ bToThePower = b;\n for (; num !== 0; num = num >>> 1) {\n if (num & 1)\n product = addBigInt(product, bToThePower);\n bToThePower = addBigInt(bToThePower, bToThePower);\n }\n return product;\n}\n//# sourceMappingURL=digest.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport class Message {\n /**\n * @param {?} nodes message AST\n * @param {?} placeholders maps placeholder names to static content\n * @param {?} placeholderToMessage maps placeholder names to messages (used for nested ICU messages)\n * @param {?} meaning\n * @param {?} description\n * @param {?} id\n */\n constructor(nodes, placeholders, placeholderToMessage, meaning, description, id) {\n this.nodes = nodes;\n this.placeholders = placeholders;\n this.placeholderToMessage = placeholderToMessage;\n this.meaning = meaning;\n this.description = description;\n this.id = id;\n if (nodes.length) {\n this.sources = [{\n filePath: nodes[0].sourceSpan.start.file.url,\n startLine: nodes[0].sourceSpan.start.line + 1,\n startCol: nodes[0].sourceSpan.start.col + 1,\n endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,\n endCol: nodes[0].sourceSpan.start.col + 1\n }];\n }\n else {\n this.sources = [];\n }\n }\n}\nfunction Message_tsickle_Closure_declarations() {\n /** @type {?} */\n Message.prototype.sources;\n /** @type {?} */\n Message.prototype.nodes;\n /** @type {?} */\n Message.prototype.placeholders;\n /** @type {?} */\n Message.prototype.placeholderToMessage;\n /** @type {?} */\n Message.prototype.meaning;\n /** @type {?} */\n Message.prototype.description;\n /** @type {?} */\n Message.prototype.id;\n}\nexport class Text {\n /**\n * @param {?} value\n * @param {?} sourceSpan\n */\n constructor(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitText(this, context); }\n}\nfunction Text_tsickle_Closure_declarations() {\n /** @type {?} */\n Text.prototype.value;\n /** @type {?} */\n Text.prototype.sourceSpan;\n}\nexport class Container {\n /**\n * @param {?} children\n * @param {?} sourceSpan\n */\n constructor(children, sourceSpan) {\n this.children = children;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitContainer(this, context); }\n}\nfunction Container_tsickle_Closure_declarations() {\n /** @type {?} */\n Container.prototype.children;\n /** @type {?} */\n Container.prototype.sourceSpan;\n}\nexport class Icu {\n /**\n * @param {?} expression\n * @param {?} type\n * @param {?} cases\n * @param {?} sourceSpan\n */\n constructor(expression, type, cases, sourceSpan) {\n this.expression = expression;\n this.type = type;\n this.cases = cases;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitIcu(this, context); }\n}\nfunction Icu_tsickle_Closure_declarations() {\n /** @type {?} */\n Icu.prototype.expressionPlaceholder;\n /** @type {?} */\n Icu.prototype.expression;\n /** @type {?} */\n Icu.prototype.type;\n /** @type {?} */\n Icu.prototype.cases;\n /** @type {?} */\n Icu.prototype.sourceSpan;\n}\nexport class TagPlaceholder {\n /**\n * @param {?} tag\n * @param {?} attrs\n * @param {?} startName\n * @param {?} closeName\n * @param {?} children\n * @param {?} isVoid\n * @param {?} sourceSpan\n */\n constructor(tag, attrs, startName, closeName, children, isVoid, sourceSpan) {\n this.tag = tag;\n this.attrs = attrs;\n this.startName = startName;\n this.closeName = closeName;\n this.children = children;\n this.isVoid = isVoid;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitTagPlaceholder(this, context); }\n}\nfunction TagPlaceholder_tsickle_Closure_declarations() {\n /** @type {?} */\n TagPlaceholder.prototype.tag;\n /** @type {?} */\n TagPlaceholder.prototype.attrs;\n /** @type {?} */\n TagPlaceholder.prototype.startName;\n /** @type {?} */\n TagPlaceholder.prototype.closeName;\n /** @type {?} */\n TagPlaceholder.prototype.children;\n /** @type {?} */\n TagPlaceholder.prototype.isVoid;\n /** @type {?} */\n TagPlaceholder.prototype.sourceSpan;\n}\nexport class Placeholder {\n /**\n * @param {?} value\n * @param {?} name\n * @param {?} sourceSpan\n */\n constructor(value, name, sourceSpan) {\n this.value = value;\n this.name = name;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitPlaceholder(this, context); }\n}\nfunction Placeholder_tsickle_Closure_declarations() {\n /** @type {?} */\n Placeholder.prototype.value;\n /** @type {?} */\n Placeholder.prototype.name;\n /** @type {?} */\n Placeholder.prototype.sourceSpan;\n}\nexport class IcuPlaceholder {\n /**\n * @param {?} value\n * @param {?} name\n * @param {?} sourceSpan\n */\n constructor(value, name, sourceSpan) {\n this.value = value;\n this.name = name;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n visit(visitor, context) { return visitor.visitIcuPlaceholder(this, context); }\n}\nfunction IcuPlaceholder_tsickle_Closure_declarations() {\n /** @type {?} */\n IcuPlaceholder.prototype.value;\n /** @type {?} */\n IcuPlaceholder.prototype.name;\n /** @type {?} */\n IcuPlaceholder.prototype.sourceSpan;\n}\nexport class CloneVisitor {\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { return new Text(text.value, text.sourceSpan); }\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n visitContainer(container, context) {\n const /** @type {?} */ children = container.children.map(n => n.visit(this, context));\n return new Container(children, container.sourceSpan);\n }\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n visitIcu(icu, context) {\n const /** @type {?} */ cases = {};\n Object.keys(icu.cases).forEach(key => cases[key] = icu.cases[key].visit(this, context));\n const /** @type {?} */ msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan);\n msg.expressionPlaceholder = icu.expressionPlaceholder;\n return msg;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n const /** @type {?} */ children = ph.children.map(n => n.visit(this, context));\n return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan);\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) {\n return new Placeholder(ph.value, ph.name, ph.sourceSpan);\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);\n }\n}\nexport class RecurseVisitor {\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { }\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n visitContainer(container, context) {\n container.children.forEach(child => child.visit(this));\n }\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n visitIcu(icu, context) {\n Object.keys(icu.cases).forEach(k => { icu.cases[k].visit(this); });\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n ph.children.forEach(child => child.visit(this));\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) { }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) { }\n}\n//# sourceMappingURL=i18n_ast.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nconst TAG_TO_PLACEHOLDER_NAMES = {\n 'A': 'LINK',\n 'B': 'BOLD_TEXT',\n 'BR': 'LINE_BREAK',\n 'EM': 'EMPHASISED_TEXT',\n 'H1': 'HEADING_LEVEL1',\n 'H2': 'HEADING_LEVEL2',\n 'H3': 'HEADING_LEVEL3',\n 'H4': 'HEADING_LEVEL4',\n 'H5': 'HEADING_LEVEL5',\n 'H6': 'HEADING_LEVEL6',\n 'HR': 'HORIZONTAL_RULE',\n 'I': 'ITALIC_TEXT',\n 'LI': 'LIST_ITEM',\n 'LINK': 'MEDIA_LINK',\n 'OL': 'ORDERED_LIST',\n 'P': 'PARAGRAPH',\n 'Q': 'QUOTATION',\n 'S': 'STRIKETHROUGH_TEXT',\n 'SMALL': 'SMALL_TEXT',\n 'SUB': 'SUBSTRIPT',\n 'SUP': 'SUPERSCRIPT',\n 'TBODY': 'TABLE_BODY',\n 'TD': 'TABLE_CELL',\n 'TFOOT': 'TABLE_FOOTER',\n 'TH': 'TABLE_HEADER_CELL',\n 'THEAD': 'TABLE_HEADER',\n 'TR': 'TABLE_ROW',\n 'TT': 'MONOSPACED_TEXT',\n 'U': 'UNDERLINED_TEXT',\n 'UL': 'UNORDERED_LIST',\n};\n/**\n * Creates unique names for placeholder with different content.\n *\n * Returns the same placeholder name when the content is identical.\n *\n * \\@internal\n */\nexport class PlaceholderRegistry {\n constructor() {\n this._placeHolderNameCounts = {};\n this._signatureToName = {};\n }\n /**\n * @param {?} tag\n * @param {?} attrs\n * @param {?} isVoid\n * @return {?}\n */\n getStartTagPlaceholderName(tag, attrs, isVoid) {\n const /** @type {?} */ signature = this._hashTag(tag, attrs, isVoid);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n const /** @type {?} */ upperTag = tag.toUpperCase();\n const /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`;\n const /** @type {?} */ name = this._generateUniqueName(isVoid ? baseName : `START_${baseName}`);\n this._signatureToName[signature] = name;\n return name;\n }\n /**\n * @param {?} tag\n * @return {?}\n */\n getCloseTagPlaceholderName(tag) {\n const /** @type {?} */ signature = this._hashClosingTag(tag);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n const /** @type {?} */ upperTag = tag.toUpperCase();\n const /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`;\n const /** @type {?} */ name = this._generateUniqueName(`CLOSE_${baseName}`);\n this._signatureToName[signature] = name;\n return name;\n }\n /**\n * @param {?} name\n * @param {?} content\n * @return {?}\n */\n getPlaceholderName(name, content) {\n const /** @type {?} */ upperName = name.toUpperCase();\n const /** @type {?} */ signature = `PH: ${upperName}=${content}`;\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n const /** @type {?} */ uniqueName = this._generateUniqueName(upperName);\n this._signatureToName[signature] = uniqueName;\n return uniqueName;\n }\n /**\n * @param {?} name\n * @return {?}\n */\n getUniquePlaceholder(name) {\n return this._generateUniqueName(name.toUpperCase());\n }\n /**\n * @param {?} tag\n * @param {?} attrs\n * @param {?} isVoid\n * @return {?}\n */\n _hashTag(tag, attrs, isVoid) {\n const /** @type {?} */ start = `<${tag}`;\n const /** @type {?} */ strAttrs = Object.keys(attrs).sort().map((name) => ` ${name}=${attrs[name]}`).join('');\n const /** @type {?} */ end = isVoid ? '/>' : `>`;\n return start + strAttrs + end;\n }\n /**\n * @param {?} tag\n * @return {?}\n */\n _hashClosingTag(tag) { return this._hashTag(`/${tag}`, {}, false); }\n /**\n * @param {?} base\n * @return {?}\n */\n _generateUniqueName(base) {\n const /** @type {?} */ seen = this._placeHolderNameCounts.hasOwnProperty(base);\n if (!seen) {\n this._placeHolderNameCounts[base] = 1;\n return base;\n }\n const /** @type {?} */ id = this._placeHolderNameCounts[base];\n this._placeHolderNameCounts[base] = id + 1;\n return `${base}_${id}`;\n }\n}\nfunction PlaceholderRegistry_tsickle_Closure_declarations() {\n /** @type {?} */\n PlaceholderRegistry.prototype._placeHolderNameCounts;\n /** @type {?} */\n PlaceholderRegistry.prototype._signatureToName;\n}\n//# sourceMappingURL=placeholder.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Lexer as ExpressionLexer } from '../expression_parser/lexer';\nimport { Parser as ExpressionParser } from '../expression_parser/parser';\nimport * as html from '../ml_parser/ast';\nimport { getHtmlTagDefinition } from '../ml_parser/html_tags';\nimport * as i18n from './i18n_ast';\nimport { PlaceholderRegistry } from './serializers/placeholder';\nconst /** @type {?} */ _expParser = new ExpressionParser(new ExpressionLexer());\n/**\n * Returns a function converting html nodes to an i18n Message given an interpolationConfig\n * @param {?} interpolationConfig\n * @return {?}\n */\nexport function createI18nMessageFactory(interpolationConfig) {\n const /** @type {?} */ visitor = new _I18nVisitor(_expParser, interpolationConfig);\n return (nodes, meaning, description, id) => visitor.toI18nMessage(nodes, meaning, description, id);\n}\nclass _I18nVisitor {\n /**\n * @param {?} _expressionParser\n * @param {?} _interpolationConfig\n */\n constructor(_expressionParser, _interpolationConfig) {\n this._expressionParser = _expressionParser;\n this._interpolationConfig = _interpolationConfig;\n }\n /**\n * @param {?} nodes\n * @param {?} meaning\n * @param {?} description\n * @param {?} id\n * @return {?}\n */\n toI18nMessage(nodes, meaning, description, id) {\n this._isIcu = nodes.length == 1 && nodes[0] instanceof html.Expansion;\n this._icuDepth = 0;\n this._placeholderRegistry = new PlaceholderRegistry();\n this._placeholderToContent = {};\n this._placeholderToMessage = {};\n const /** @type {?} */ i18nodes = html.visitAll(this, nodes, {});\n return new i18n.Message(i18nodes, this._placeholderToContent, this._placeholderToMessage, meaning, description, id);\n }\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n visitElement(el, context) {\n const /** @type {?} */ children = html.visitAll(this, el.children);\n const /** @type {?} */ attrs = {};\n el.attrs.forEach(attr => {\n // Do not visit the attributes, translatable ones are top-level ASTs\n attrs[attr.name] = attr.value;\n });\n const /** @type {?} */ isVoid = getHtmlTagDefinition(el.name).isVoid;\n const /** @type {?} */ startPhName = this._placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);\n this._placeholderToContent[startPhName] = ((el.sourceSpan)).toString();\n let /** @type {?} */ closePhName = '';\n if (!isVoid) {\n closePhName = this._placeholderRegistry.getCloseTagPlaceholderName(el.name);\n this._placeholderToContent[closePhName] = ``;\n }\n return new i18n.TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, /** @type {?} */ ((el.sourceSpan)));\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) {\n return this._visitTextWithInterpolation(attribute.value, attribute.sourceSpan);\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) {\n return this._visitTextWithInterpolation(text.value, /** @type {?} */ ((text.sourceSpan)));\n }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { return null; }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitExpansion(icu, context) {\n this._icuDepth++;\n const /** @type {?} */ i18nIcuCases = {};\n const /** @type {?} */ i18nIcu = new i18n.Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);\n icu.cases.forEach((caze) => {\n i18nIcuCases[caze.value] = new i18n.Container(caze.expression.map((node) => node.visit(this, {})), caze.expSourceSpan);\n });\n this._icuDepth--;\n if (this._isIcu || this._icuDepth > 0) {\n // Returns an ICU node when:\n // - the message (vs a part of the message) is an ICU message, or\n // - the ICU message is nested.\n const /** @type {?} */ expPh = this._placeholderRegistry.getUniquePlaceholder(`VAR_${icu.type}`);\n i18nIcu.expressionPlaceholder = expPh;\n this._placeholderToContent[expPh] = icu.switchValue;\n return i18nIcu;\n }\n // Else returns a placeholder\n // ICU placeholders should not be replaced with their original content but with the their\n // translations. We need to create a new visitor (they are not re-entrant) to compute the\n // message id.\n // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg\n const /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());\n const /** @type {?} */ visitor = new _I18nVisitor(this._expressionParser, this._interpolationConfig);\n this._placeholderToMessage[phName] = visitor.toI18nMessage([icu], '', '', '');\n return new i18n.IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);\n }\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(icuCase, context) {\n throw new Error('Unreachable code');\n }\n /**\n * @param {?} text\n * @param {?} sourceSpan\n * @return {?}\n */\n _visitTextWithInterpolation(text, sourceSpan) {\n const /** @type {?} */ splitInterpolation = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig);\n if (!splitInterpolation) {\n // No expression, return a single text\n return new i18n.Text(text, sourceSpan);\n }\n // Return a group of text + expressions\n const /** @type {?} */ nodes = [];\n const /** @type {?} */ container = new i18n.Container(nodes, sourceSpan);\n const { start: sDelimiter, end: eDelimiter } = this._interpolationConfig;\n for (let /** @type {?} */ i = 0; i < splitInterpolation.strings.length - 1; i++) {\n const /** @type {?} */ expression = splitInterpolation.expressions[i];\n const /** @type {?} */ baseName = _extractPlaceholderName(expression) || 'INTERPOLATION';\n const /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName(baseName, expression);\n if (splitInterpolation.strings[i].length) {\n // No need to add empty strings\n nodes.push(new i18n.Text(splitInterpolation.strings[i], sourceSpan));\n }\n nodes.push(new i18n.Placeholder(expression, phName, sourceSpan));\n this._placeholderToContent[phName] = sDelimiter + expression + eDelimiter;\n }\n // The last index contains no expression\n const /** @type {?} */ lastStringIdx = splitInterpolation.strings.length - 1;\n if (splitInterpolation.strings[lastStringIdx].length) {\n nodes.push(new i18n.Text(splitInterpolation.strings[lastStringIdx], sourceSpan));\n }\n return container;\n }\n}\nfunction _I18nVisitor_tsickle_Closure_declarations() {\n /** @type {?} */\n _I18nVisitor.prototype._isIcu;\n /** @type {?} */\n _I18nVisitor.prototype._icuDepth;\n /** @type {?} */\n _I18nVisitor.prototype._placeholderRegistry;\n /** @type {?} */\n _I18nVisitor.prototype._placeholderToContent;\n /** @type {?} */\n _I18nVisitor.prototype._placeholderToMessage;\n /** @type {?} */\n _I18nVisitor.prototype._expressionParser;\n /** @type {?} */\n _I18nVisitor.prototype._interpolationConfig;\n}\nconst /** @type {?} */ _CUSTOM_PH_EXP = /\\/\\/[\\s\\S]*i18n[\\s\\S]*\\([\\s\\S]*ph[\\s\\S]*=[\\s\\S]*(\"|')([\\s\\S]*?)\\1[\\s\\S]*\\)/g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction _extractPlaceholderName(input) {\n return input.split(_CUSTOM_PH_EXP)[2];\n}\n//# sourceMappingURL=i18n_parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ParseError } from '../parse_util';\n/**\n * An i18n error.\n */\nexport class I18nError extends ParseError {\n /**\n * @param {?} span\n * @param {?} msg\n */\n constructor(span, msg) { super(span, msg); }\n}\n//# sourceMappingURL=parse_util.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as html from '../ml_parser/ast';\nimport { ParseTreeResult } from '../ml_parser/parser';\nimport * as i18n from './i18n_ast';\nimport { createI18nMessageFactory } from './i18n_parser';\nimport { I18nError } from './parse_util';\nconst /** @type {?} */ _I18N_ATTR = 'i18n';\nconst /** @type {?} */ _I18N_ATTR_PREFIX = 'i18n-';\nconst /** @type {?} */ _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;\nconst /** @type {?} */ MEANING_SEPARATOR = '|';\nconst /** @type {?} */ ID_SEPARATOR = '@@';\n/**\n * Extract translatable messages from an html AST\n * @param {?} nodes\n * @param {?} interpolationConfig\n * @param {?} implicitTags\n * @param {?} implicitAttrs\n * @return {?}\n */\nexport function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {\n const /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);\n return visitor.extract(nodes, interpolationConfig);\n}\n/**\n * @param {?} nodes\n * @param {?} translations\n * @param {?} interpolationConfig\n * @param {?} implicitTags\n * @param {?} implicitAttrs\n * @return {?}\n */\nexport function mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {\n const /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);\n return visitor.merge(nodes, translations, interpolationConfig);\n}\nexport class ExtractionResult {\n /**\n * @param {?} messages\n * @param {?} errors\n */\n constructor(messages, errors) {\n this.messages = messages;\n this.errors = errors;\n }\n}\nfunction ExtractionResult_tsickle_Closure_declarations() {\n /** @type {?} */\n ExtractionResult.prototype.messages;\n /** @type {?} */\n ExtractionResult.prototype.errors;\n}\nlet _VisitorMode = {};\n_VisitorMode.Extract = 0;\n_VisitorMode.Merge = 1;\n_VisitorMode[_VisitorMode.Extract] = \"Extract\";\n_VisitorMode[_VisitorMode.Merge] = \"Merge\";\n/**\n * This Visitor is used:\n * 1. to extract all the translatable strings from an html AST (see `extract()`),\n * 2. to replace the translatable strings with the actual translations (see `merge()`)\n *\n * \\@internal\n */\nclass _Visitor {\n /**\n * @param {?} _implicitTags\n * @param {?} _implicitAttrs\n */\n constructor(_implicitTags, _implicitAttrs) {\n this._implicitTags = _implicitTags;\n this._implicitAttrs = _implicitAttrs;\n }\n /**\n * Extracts the messages from the tree\n * @param {?} nodes\n * @param {?} interpolationConfig\n * @return {?}\n */\n extract(nodes, interpolationConfig) {\n this._init(_VisitorMode.Extract, interpolationConfig);\n nodes.forEach(node => node.visit(this, null));\n if (this._inI18nBlock) {\n this._reportError(nodes[nodes.length - 1], 'Unclosed block');\n }\n return new ExtractionResult(this._messages, this._errors);\n }\n /**\n * Returns a tree where all translatable nodes are translated\n * @param {?} nodes\n * @param {?} translations\n * @param {?} interpolationConfig\n * @return {?}\n */\n merge(nodes, translations, interpolationConfig) {\n this._init(_VisitorMode.Merge, interpolationConfig);\n this._translations = translations;\n // Construct a single fake root element\n const /** @type {?} */ wrapper = new html.Element('wrapper', [], nodes, /** @type {?} */ ((undefined)), undefined, undefined);\n const /** @type {?} */ translatedNode = wrapper.visit(this, null);\n if (this._inI18nBlock) {\n this._reportError(nodes[nodes.length - 1], 'Unclosed block');\n }\n return new ParseTreeResult(translatedNode.children, this._errors);\n }\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(icuCase, context) {\n // Parse cases for translatable html attributes\n const /** @type {?} */ expression = html.visitAll(this, icuCase.expression, context);\n if (this._mode === _VisitorMode.Merge) {\n return new html.ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);\n }\n }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitExpansion(icu, context) {\n this._mayBeAddBlockChildren(icu);\n const /** @type {?} */ wasInIcu = this._inIcu;\n if (!this._inIcu) {\n // nested ICU messages should not be extracted but top-level translated as a whole\n if (this._isInTranslatableSection) {\n this._addMessage([icu]);\n }\n this._inIcu = true;\n }\n const /** @type {?} */ cases = html.visitAll(this, icu.cases, context);\n if (this._mode === _VisitorMode.Merge) {\n icu = new html.Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan);\n }\n this._inIcu = wasInIcu;\n return icu;\n }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) {\n const /** @type {?} */ isOpening = _isOpeningComment(comment);\n if (isOpening && this._isInTranslatableSection) {\n this._reportError(comment, 'Could not start a block inside a translatable section');\n return;\n }\n const /** @type {?} */ isClosing = _isClosingComment(comment);\n if (isClosing && !this._inI18nBlock) {\n this._reportError(comment, 'Trying to close an unopened block');\n return;\n }\n if (!this._inI18nNode && !this._inIcu) {\n if (!this._inI18nBlock) {\n if (isOpening) {\n this._inI18nBlock = true;\n this._blockStartDepth = this._depth;\n this._blockChildren = [];\n this._blockMeaningAndDesc = ((comment.value)).replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim();\n this._openTranslatableSection(comment);\n }\n }\n else {\n if (isClosing) {\n if (this._depth == this._blockStartDepth) {\n this._closeTranslatableSection(comment, this._blockChildren);\n this._inI18nBlock = false;\n const /** @type {?} */ message = ((this._addMessage(this._blockChildren, this._blockMeaningAndDesc)));\n // merge attributes in sections\n const /** @type {?} */ nodes = this._translateMessage(comment, message);\n return html.visitAll(this, nodes);\n }\n else {\n this._reportError(comment, 'I18N blocks should not cross element boundaries');\n return;\n }\n }\n }\n }\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) {\n if (this._isInTranslatableSection) {\n this._mayBeAddBlockChildren(text);\n }\n return text;\n }\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n visitElement(el, context) {\n this._mayBeAddBlockChildren(el);\n this._depth++;\n const /** @type {?} */ wasInI18nNode = this._inI18nNode;\n const /** @type {?} */ wasInImplicitNode = this._inImplicitNode;\n let /** @type {?} */ childNodes = [];\n let /** @type {?} */ translatedChildNodes = ((undefined));\n // Extract:\n // - top level nodes with the (implicit) \"i18n\" attribute if not already in a section\n // - ICU messages\n const /** @type {?} */ i18nAttr = _getI18nAttr(el);\n const /** @type {?} */ i18nMeta = i18nAttr ? i18nAttr.value : '';\n const /** @type {?} */ isImplicit = this._implicitTags.some(tag => el.name === tag) && !this._inIcu &&\n !this._isInTranslatableSection;\n const /** @type {?} */ isTopLevelImplicit = !wasInImplicitNode && isImplicit;\n this._inImplicitNode = wasInImplicitNode || isImplicit;\n if (!this._isInTranslatableSection && !this._inIcu) {\n if (i18nAttr || isTopLevelImplicit) {\n this._inI18nNode = true;\n const /** @type {?} */ message = ((this._addMessage(el.children, i18nMeta)));\n translatedChildNodes = this._translateMessage(el, message);\n }\n if (this._mode == _VisitorMode.Extract) {\n const /** @type {?} */ isTranslatable = i18nAttr || isTopLevelImplicit;\n if (isTranslatable)\n this._openTranslatableSection(el);\n html.visitAll(this, el.children);\n if (isTranslatable)\n this._closeTranslatableSection(el, el.children);\n }\n }\n else {\n if (i18nAttr || isTopLevelImplicit) {\n this._reportError(el, 'Could not mark an element as translatable inside a translatable section');\n }\n if (this._mode == _VisitorMode.Extract) {\n // Descend into child nodes for extraction\n html.visitAll(this, el.children);\n }\n }\n if (this._mode === _VisitorMode.Merge) {\n const /** @type {?} */ visitNodes = translatedChildNodes || el.children;\n visitNodes.forEach(child => {\n const /** @type {?} */ visited = child.visit(this, context);\n if (visited && !this._isInTranslatableSection) {\n // Do not add the children from translatable sections (= i18n blocks here)\n // They will be added later in this loop when the block closes (i.e. on ``)\n childNodes = childNodes.concat(visited);\n }\n });\n }\n this._visitAttributesOf(el);\n this._depth--;\n this._inI18nNode = wasInI18nNode;\n this._inImplicitNode = wasInImplicitNode;\n if (this._mode === _VisitorMode.Merge) {\n const /** @type {?} */ translatedAttrs = this._translateAttributes(el);\n return new html.Element(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);\n }\n return null;\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) {\n throw new Error('unreachable code');\n }\n /**\n * @param {?} mode\n * @param {?} interpolationConfig\n * @return {?}\n */\n _init(mode, interpolationConfig) {\n this._mode = mode;\n this._inI18nBlock = false;\n this._inI18nNode = false;\n this._depth = 0;\n this._inIcu = false;\n this._msgCountAtSectionStart = undefined;\n this._errors = [];\n this._messages = [];\n this._inImplicitNode = false;\n this._createI18nMessage = createI18nMessageFactory(interpolationConfig);\n }\n /**\n * @param {?} el\n * @return {?}\n */\n _visitAttributesOf(el) {\n const /** @type {?} */ explicitAttrNameToValue = {};\n const /** @type {?} */ implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX))\n .forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value);\n el.attrs.forEach(attr => {\n if (attr.name in explicitAttrNameToValue) {\n this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(name => attr.name === name)) {\n this._addMessage([attr]);\n }\n });\n }\n /**\n * @param {?} ast\n * @param {?=} msgMeta\n * @return {?}\n */\n _addMessage(ast, msgMeta) {\n if (ast.length == 0 ||\n ast.length == 1 && ast[0] instanceof html.Attribute && !((ast[0])).value) {\n // Do not create empty messages\n return null;\n }\n const { meaning, description, id } = _parseMessageMeta(msgMeta);\n const /** @type {?} */ message = this._createI18nMessage(ast, meaning, description, id);\n this._messages.push(message);\n return message;\n }\n /**\n * @param {?} el\n * @param {?} message\n * @return {?}\n */\n _translateMessage(el, message) {\n if (message && this._mode === _VisitorMode.Merge) {\n const /** @type {?} */ nodes = this._translations.get(message);\n if (nodes) {\n return nodes;\n }\n this._reportError(el, `Translation unavailable for message id=\"${this._translations.digest(message)}\"`);\n }\n return [];\n }\n /**\n * @param {?} el\n * @return {?}\n */\n _translateAttributes(el) {\n const /** @type {?} */ attributes = el.attrs;\n const /** @type {?} */ i18nParsedMessageMeta = {};\n attributes.forEach(attr => {\n if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n _parseMessageMeta(attr.value);\n }\n });\n const /** @type {?} */ translatedAttributes = [];\n attributes.forEach((attr) => {\n if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {\n // strip i18n specific attributes\n return;\n }\n if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) {\n const { meaning, description, id } = i18nParsedMessageMeta[attr.name];\n const /** @type {?} */ message = this._createI18nMessage([attr], meaning, description, id);\n const /** @type {?} */ nodes = this._translations.get(message);\n if (nodes) {\n if (nodes.length == 0) {\n translatedAttributes.push(new html.Attribute(attr.name, '', attr.sourceSpan));\n }\n else if (nodes[0] instanceof html.Text) {\n const /** @type {?} */ value = ((nodes[0])).value;\n translatedAttributes.push(new html.Attribute(attr.name, value, attr.sourceSpan));\n }\n else {\n this._reportError(el, `Unexpected translation for attribute \"${attr.name}\" (id=\"${id || this._translations.digest(message)}\")`);\n }\n }\n else {\n this._reportError(el, `Translation unavailable for attribute \"${attr.name}\" (id=\"${id || this._translations.digest(message)}\")`);\n }\n }\n else {\n translatedAttributes.push(attr);\n }\n });\n return translatedAttributes;\n }\n /**\n * Add the node as a child of the block when:\n * - we are in a block,\n * - we are not inside a ICU message (those are handled separately),\n * - the node is a \"direct child\" of the block\n * @param {?} node\n * @return {?}\n */\n _mayBeAddBlockChildren(node) {\n if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) {\n this._blockChildren.push(node);\n }\n }\n /**\n * Marks the start of a section, see `_closeTranslatableSection`\n * @param {?} node\n * @return {?}\n */\n _openTranslatableSection(node) {\n if (this._isInTranslatableSection) {\n this._reportError(node, 'Unexpected section start');\n }\n else {\n this._msgCountAtSectionStart = this._messages.length;\n }\n }\n /**\n * A translatable section could be:\n * - the content of translatable element,\n * - nodes between `` and `` comments\n * @return {?}\n */\n get _isInTranslatableSection() {\n return this._msgCountAtSectionStart !== void 0;\n }\n /**\n * Terminates a section.\n *\n * If a section has only one significant children (comments not significant) then we should not\n * keep the message from this children:\n *\n * `

{ICU message}

` would produce two messages:\n * - one for the

content with meaning and description,\n * - another one for the ICU message.\n *\n * In this case the last message is discarded as it contains less information (the AST is\n * otherwise identical).\n *\n * Note that we should still keep messages extracted from attributes inside the section (ie in the\n * ICU message here)\n * @param {?} node\n * @param {?} directChildren\n * @return {?}\n */\n _closeTranslatableSection(node, directChildren) {\n if (!this._isInTranslatableSection) {\n this._reportError(node, 'Unexpected section end');\n return;\n }\n const /** @type {?} */ startIndex = this._msgCountAtSectionStart;\n const /** @type {?} */ significantChildren = directChildren.reduce((count, node) => count + (node instanceof html.Comment ? 0 : 1), 0);\n if (significantChildren == 1) {\n for (let /** @type {?} */ i = this._messages.length - 1; i >= ((startIndex)); i--) {\n const /** @type {?} */ ast = this._messages[i].nodes;\n if (!(ast.length == 1 && ast[0] instanceof i18n.Text)) {\n this._messages.splice(i, 1);\n break;\n }\n }\n }\n this._msgCountAtSectionStart = undefined;\n }\n /**\n * @param {?} node\n * @param {?} msg\n * @return {?}\n */\n _reportError(node, msg) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), msg));\n }\n}\nfunction _Visitor_tsickle_Closure_declarations() {\n /** @type {?} */\n _Visitor.prototype._depth;\n /** @type {?} */\n _Visitor.prototype._inI18nNode;\n /** @type {?} */\n _Visitor.prototype._inImplicitNode;\n /** @type {?} */\n _Visitor.prototype._inI18nBlock;\n /** @type {?} */\n _Visitor.prototype._blockMeaningAndDesc;\n /** @type {?} */\n _Visitor.prototype._blockChildren;\n /** @type {?} */\n _Visitor.prototype._blockStartDepth;\n /** @type {?} */\n _Visitor.prototype._inIcu;\n /** @type {?} */\n _Visitor.prototype._msgCountAtSectionStart;\n /** @type {?} */\n _Visitor.prototype._errors;\n /** @type {?} */\n _Visitor.prototype._mode;\n /** @type {?} */\n _Visitor.prototype._messages;\n /** @type {?} */\n _Visitor.prototype._translations;\n /** @type {?} */\n _Visitor.prototype._createI18nMessage;\n /** @type {?} */\n _Visitor.prototype._implicitTags;\n /** @type {?} */\n _Visitor.prototype._implicitAttrs;\n}\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isOpeningComment(n) {\n return !!(n instanceof html.Comment && n.value && n.value.startsWith('i18n'));\n}\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isClosingComment(n) {\n return !!(n instanceof html.Comment && n.value && n.value === '/i18n');\n}\n/**\n * @param {?} p\n * @return {?}\n */\nfunction _getI18nAttr(p) {\n return p.attrs.find(attr => attr.name === _I18N_ATTR) || null;\n}\n/**\n * @param {?=} i18n\n * @return {?}\n */\nfunction _parseMessageMeta(i18n) {\n if (!i18n)\n return { meaning: '', description: '', id: '' };\n const /** @type {?} */ idIndex = i18n.indexOf(ID_SEPARATOR);\n const /** @type {?} */ descIndex = i18n.indexOf(MEANING_SEPARATOR);\n const [meaningAndDesc, id] = (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''];\n const [meaning, description] = (descIndex > -1) ?\n [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :\n ['', meaningAndDesc];\n return { meaning, description, id };\n}\n//# sourceMappingURL=extractor_merger.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { TagContentType } from './tags';\nexport class XmlTagDefinition {\n constructor() {\n this.closedByParent = false;\n this.contentType = TagContentType.PARSABLE_DATA;\n this.isVoid = false;\n this.ignoreFirstLf = false;\n this.canSelfClose = true;\n }\n /**\n * @param {?} currentParent\n * @return {?}\n */\n requireExtraParent(currentParent) { return false; }\n /**\n * @param {?} name\n * @return {?}\n */\n isClosedByChild(name) { return false; }\n}\nfunction XmlTagDefinition_tsickle_Closure_declarations() {\n /** @type {?} */\n XmlTagDefinition.prototype.closedByParent;\n /** @type {?} */\n XmlTagDefinition.prototype.requiredParents;\n /** @type {?} */\n XmlTagDefinition.prototype.parentToAdd;\n /** @type {?} */\n XmlTagDefinition.prototype.implicitNamespacePrefix;\n /** @type {?} */\n XmlTagDefinition.prototype.contentType;\n /** @type {?} */\n XmlTagDefinition.prototype.isVoid;\n /** @type {?} */\n XmlTagDefinition.prototype.ignoreFirstLf;\n /** @type {?} */\n XmlTagDefinition.prototype.canSelfClose;\n}\nconst /** @type {?} */ _TAG_DEFINITION = new XmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nexport function getXmlTagDefinition(tagName) {\n return _TAG_DEFINITION;\n}\n//# sourceMappingURL=xml_tags.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Parser } from './parser';\nimport { getXmlTagDefinition } from './xml_tags';\nexport { ParseTreeResult, TreeError } from './parser';\nexport class XmlParser extends Parser {\n constructor() { super(getXmlTagDefinition); }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @return {?}\n */\n parse(source, url, parseExpansionForms = false) {\n return super.parse(source, url, parseExpansionForms);\n }\n}\n//# sourceMappingURL=xml_parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as i18n from '../i18n_ast';\n/**\n * @abstract\n */\nexport class Serializer {\n /**\n * @abstract\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n write(messages, locale) { }\n /**\n * @abstract\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n load(content, url) { }\n /**\n * @abstract\n * @param {?} message\n * @return {?}\n */\n digest(message) { }\n /**\n * @param {?} message\n * @return {?}\n */\n createNameMapper(message) { return null; }\n}\n/**\n * A simple mapper that take a function to transform an internal name to a public name\n */\nexport class SimplePlaceholderMapper extends i18n.RecurseVisitor {\n /**\n * @param {?} message\n * @param {?} mapName\n */\n constructor(message, mapName) {\n super();\n this.mapName = mapName;\n this.internalToPublic = {};\n this.publicToNextId = {};\n this.publicToInternal = {};\n message.nodes.forEach(node => node.visit(this));\n }\n /**\n * @param {?} internalName\n * @return {?}\n */\n toPublicName(internalName) {\n return this.internalToPublic.hasOwnProperty(internalName) ?\n this.internalToPublic[internalName] :\n null;\n }\n /**\n * @param {?} publicName\n * @return {?}\n */\n toInternalName(publicName) {\n return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :\n null;\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { return null; }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n this.visitPlaceholderName(ph.startName);\n super.visitTagPlaceholder(ph, context);\n this.visitPlaceholderName(ph.closeName);\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) { this.visitPlaceholderName(ph.name); }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n this.visitPlaceholderName(ph.name);\n }\n /**\n * @param {?} internalName\n * @return {?}\n */\n visitPlaceholderName(internalName) {\n if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n return;\n }\n let /** @type {?} */ publicName = this.mapName(internalName);\n if (this.publicToInternal.hasOwnProperty(publicName)) {\n // Create a new XMB when it has already been used\n const /** @type {?} */ nextId = this.publicToNextId[publicName];\n this.publicToNextId[publicName] = nextId + 1;\n publicName = `${publicName}_${nextId}`;\n }\n else {\n this.publicToNextId[publicName] = 1;\n }\n this.internalToPublic[internalName] = publicName;\n this.publicToInternal[publicName] = internalName;\n }\n}\nfunction SimplePlaceholderMapper_tsickle_Closure_declarations() {\n /** @type {?} */\n SimplePlaceholderMapper.prototype.internalToPublic;\n /** @type {?} */\n SimplePlaceholderMapper.prototype.publicToNextId;\n /** @type {?} */\n SimplePlaceholderMapper.prototype.publicToInternal;\n /** @type {?} */\n SimplePlaceholderMapper.prototype.mapName;\n}\n//# sourceMappingURL=serializer.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nclass _Visitor {\n /**\n * @param {?} tag\n * @return {?}\n */\n visitTag(tag) {\n const /** @type {?} */ strAttrs = this._serializeAttributes(tag.attrs);\n if (tag.children.length == 0) {\n return `<${tag.name}${strAttrs}/>`;\n }\n const /** @type {?} */ strChildren = tag.children.map(node => node.visit(this));\n return `<${tag.name}${strAttrs}>${strChildren.join('')}`;\n }\n /**\n * @param {?} text\n * @return {?}\n */\n visitText(text) { return text.value; }\n /**\n * @param {?} decl\n * @return {?}\n */\n visitDeclaration(decl) {\n return ``;\n }\n /**\n * @param {?} attrs\n * @return {?}\n */\n _serializeAttributes(attrs) {\n const /** @type {?} */ strAttrs = Object.keys(attrs).map((name) => `${name}=\"${attrs[name]}\"`).join(' ');\n return strAttrs.length > 0 ? ' ' + strAttrs : '';\n }\n /**\n * @param {?} doctype\n * @return {?}\n */\n visitDoctype(doctype) {\n return ``;\n }\n}\nconst /** @type {?} */ _visitor = new _Visitor();\n/**\n * @param {?} nodes\n * @return {?}\n */\nexport function serialize(nodes) {\n return nodes.map((node) => node.visit(_visitor)).join('');\n}\nexport class Declaration {\n /**\n * @param {?} unescapedAttrs\n */\n constructor(unescapedAttrs) {\n this.attrs = {};\n Object.keys(unescapedAttrs).forEach((k) => {\n this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n });\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n visit(visitor) { return visitor.visitDeclaration(this); }\n}\nfunction Declaration_tsickle_Closure_declarations() {\n /** @type {?} */\n Declaration.prototype.attrs;\n}\nexport class Doctype {\n /**\n * @param {?} rootTag\n * @param {?} dtd\n */\n constructor(rootTag, dtd) {\n this.rootTag = rootTag;\n this.dtd = dtd;\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n visit(visitor) { return visitor.visitDoctype(this); }\n}\nfunction Doctype_tsickle_Closure_declarations() {\n /** @type {?} */\n Doctype.prototype.rootTag;\n /** @type {?} */\n Doctype.prototype.dtd;\n}\nexport class Tag {\n /**\n * @param {?} name\n * @param {?=} unescapedAttrs\n * @param {?=} children\n */\n constructor(name, unescapedAttrs = {}, children = []) {\n this.name = name;\n this.children = children;\n this.attrs = {};\n Object.keys(unescapedAttrs).forEach((k) => {\n this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n });\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n visit(visitor) { return visitor.visitTag(this); }\n}\nfunction Tag_tsickle_Closure_declarations() {\n /** @type {?} */\n Tag.prototype.attrs;\n /** @type {?} */\n Tag.prototype.name;\n /** @type {?} */\n Tag.prototype.children;\n}\nexport class Text {\n /**\n * @param {?} unescapedValue\n */\n constructor(unescapedValue) { this.value = _escapeXml(unescapedValue); }\n /**\n * @param {?} visitor\n * @return {?}\n */\n visit(visitor) { return visitor.visitText(this); }\n}\nfunction Text_tsickle_Closure_declarations() {\n /** @type {?} */\n Text.prototype.value;\n}\nexport class CR extends Text {\n /**\n * @param {?=} ws\n */\n constructor(ws = 0) { super(`\\n${new Array(ws + 1).join(' ')}`); }\n}\nconst /** @type {?} */ _ESCAPED_CHARS = [\n [/&/g, '&'],\n [/\"/g, '"'],\n [/'/g, '''],\n [//g, '>'],\n];\n/**\n * @param {?} text\n * @return {?}\n */\nfunction _escapeXml(text) {\n return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);\n}\n//# sourceMappingURL=xml_helper.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as ml from '../../ml_parser/ast';\nimport { XmlParser } from '../../ml_parser/xml_parser';\nimport { digest } from '../digest';\nimport * as i18n from '../i18n_ast';\nimport { I18nError } from '../parse_util';\nimport { Serializer } from './serializer';\nimport * as xml from './xml_helper';\nconst /** @type {?} */ _VERSION = '1.2';\nconst /** @type {?} */ _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';\n// TODO(vicb): make this a param (s/_/-/)\nconst /** @type {?} */ _DEFAULT_SOURCE_LANG = 'en';\nconst /** @type {?} */ _PLACEHOLDER_TAG = 'x';\nconst /** @type {?} */ _FILE_TAG = 'file';\nconst /** @type {?} */ _SOURCE_TAG = 'source';\nconst /** @type {?} */ _TARGET_TAG = 'target';\nconst /** @type {?} */ _UNIT_TAG = 'trans-unit';\nconst /** @type {?} */ _CONTEXT_GROUP_TAG = 'context-group';\nconst /** @type {?} */ _CONTEXT_TAG = 'context';\nexport class Xliff extends Serializer {\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n write(messages, locale) {\n const /** @type {?} */ visitor = new _WriteVisitor();\n const /** @type {?} */ transUnits = [];\n messages.forEach(message => {\n let /** @type {?} */ contextTags = [];\n message.sources.forEach((source) => {\n let /** @type {?} */ contextGroupTag = new xml.Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });\n contextGroupTag.children.push(new xml.CR(10), new xml.Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new xml.Text(source.filePath)]), new xml.CR(10), new xml.Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new xml.Text(`${source.startLine}`)]), new xml.CR(8));\n contextTags.push(new xml.CR(8), contextGroupTag);\n });\n const /** @type {?} */ transUnit = new xml.Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });\n transUnit.children.push(new xml.CR(8), new xml.Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), ...contextTags);\n if (message.description) {\n transUnit.children.push(new xml.CR(8), new xml.Tag('note', { priority: '1', from: 'description' }, [new xml.Text(message.description)]));\n }\n if (message.meaning) {\n transUnit.children.push(new xml.CR(8), new xml.Tag('note', { priority: '1', from: 'meaning' }, [new xml.Text(message.meaning)]));\n }\n transUnit.children.push(new xml.CR(6));\n transUnits.push(new xml.CR(6), transUnit);\n });\n const /** @type {?} */ body = new xml.Tag('body', {}, [...transUnits, new xml.CR(4)]);\n const /** @type {?} */ file = new xml.Tag('file', {\n 'source-language': locale || _DEFAULT_SOURCE_LANG,\n datatype: 'plaintext',\n original: 'ng2.template',\n }, [new xml.CR(4), body, new xml.CR(2)]);\n const /** @type {?} */ xliff = new xml.Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new xml.CR(2), file, new xml.CR()]);\n return xml.serialize([\n new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }), new xml.CR(), xliff, new xml.CR()\n ]);\n }\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n load(content, url) {\n // xliff to xml nodes\n const /** @type {?} */ xliffParser = new XliffParser();\n const { locale, msgIdToHtml, errors } = xliffParser.parse(content, url);\n // xml nodes to i18n nodes\n const /** @type {?} */ i18nNodesByMsgId = {};\n const /** @type {?} */ converter = new XmlToI18n();\n Object.keys(msgIdToHtml).forEach(msgId => {\n const { i18nNodes, errors: e } = converter.convert(msgIdToHtml[msgId], url);\n errors.push(...e);\n i18nNodesByMsgId[msgId] = i18nNodes;\n });\n if (errors.length) {\n throw new Error(`xliff parse errors:\\n${errors.join('\\n')}`);\n }\n return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId };\n }\n /**\n * @param {?} message\n * @return {?}\n */\n digest(message) { return digest(message); }\n}\nclass _WriteVisitor {\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { return [new xml.Text(text.value)]; }\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n visitContainer(container, context) {\n const /** @type {?} */ nodes = [];\n container.children.forEach((node) => nodes.push(...node.visit(this)));\n return nodes;\n }\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n visitIcu(icu, context) {\n const /** @type {?} */ nodes = [new xml.Text(`{${icu.expressionPlaceholder}, ${icu.type}, `)];\n Object.keys(icu.cases).forEach((c) => {\n nodes.push(new xml.Text(`${c} {`), ...icu.cases[c].visit(this), new xml.Text(`} `));\n });\n nodes.push(new xml.Text(`}`));\n return nodes;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n const /** @type {?} */ ctype = getCtypeForTag(ph.tag);\n const /** @type {?} */ startTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype });\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n const /** @type {?} */ closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype });\n return [startTagPh, ...this.serialize(ph.children), closeTagPh];\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) {\n return [new xml.Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n return [new xml.Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n }\n /**\n * @param {?} nodes\n * @return {?}\n */\n serialize(nodes) {\n return [].concat(...nodes.map(node => node.visit(this)));\n }\n}\nclass XliffParser {\n constructor() {\n this._locale = null;\n }\n /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n parse(xliff, url) {\n this._unitMlString = null;\n this._msgIdToHtml = {};\n const /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n this._errors = xml.errors;\n ml.visitAll(this, xml.rootNodes, null);\n return {\n msgIdToHtml: this._msgIdToHtml,\n errors: this._errors,\n locale: this._locale,\n };\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n visitElement(element, context) {\n switch (element.name) {\n case _UNIT_TAG:\n this._unitMlString = ((null));\n const /** @type {?} */ idAttr = element.attrs.find((attr) => attr.name === 'id');\n if (!idAttr) {\n this._addError(element, `<${_UNIT_TAG}> misses the \"id\" attribute`);\n }\n else {\n const /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, `Duplicated translations for msg ${id}`);\n }\n else {\n ml.visitAll(this, element.children, null);\n if (typeof this._unitMlString === 'string') {\n this._msgIdToHtml[id] = this._unitMlString;\n }\n else {\n this._addError(element, `Message ${id} misses a translation`);\n }\n }\n }\n break;\n case _SOURCE_TAG:\n // ignore source message\n break;\n case _TARGET_TAG:\n const /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n const /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n const /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n const /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n this._unitMlString = innerText;\n break;\n case _FILE_TAG:\n const /** @type {?} */ localeAttr = element.attrs.find((attr) => attr.name === 'target-language');\n if (localeAttr) {\n this._locale = localeAttr.value;\n }\n ml.visitAll(this, element.children, null);\n break;\n default:\n // TODO(vicb): assert file structure, xliff version\n // For now only recurse on unhandled nodes\n ml.visitAll(this, element.children, null);\n }\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { }\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n visitExpansion(expansion, context) { }\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(expansionCase, context) { }\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n _addError(node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n }\n}\nfunction XliffParser_tsickle_Closure_declarations() {\n /** @type {?} */\n XliffParser.prototype._unitMlString;\n /** @type {?} */\n XliffParser.prototype._errors;\n /** @type {?} */\n XliffParser.prototype._msgIdToHtml;\n /** @type {?} */\n XliffParser.prototype._locale;\n}\nclass XmlToI18n {\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n convert(message, url) {\n const /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n const /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] :\n ml.visitAll(this, xmlIcu.rootNodes);\n return {\n i18nNodes: i18nNodes,\n errors: this._errors,\n };\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { return new i18n.Text(text.value, /** @type {?} */ ((text.sourceSpan))); }\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n visitElement(el, context) {\n if (el.name === _PLACEHOLDER_TAG) {\n const /** @type {?} */ nameAttr = el.attrs.find((attr) => attr.name === 'id');\n if (nameAttr) {\n return new i18n.Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n }\n this._addError(el, `<${_PLACEHOLDER_TAG}> misses the \"id\" attribute`);\n }\n else {\n this._addError(el, `Unexpected tag`);\n }\n return null;\n }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitExpansion(icu, context) {\n const /** @type {?} */ caseMap = {};\n ml.visitAll(this, icu.cases).forEach((c) => {\n caseMap[c.value] = new i18n.Container(c.nodes, icu.sourceSpan);\n });\n return new i18n.Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n }\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(icuCase, context) {\n return {\n value: icuCase.value,\n nodes: ml.visitAll(this, icuCase.expression),\n };\n }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { }\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n _addError(node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n }\n}\nfunction XmlToI18n_tsickle_Closure_declarations() {\n /** @type {?} */\n XmlToI18n.prototype._errors;\n}\n/**\n * @param {?} tag\n * @return {?}\n */\nfunction getCtypeForTag(tag) {\n switch (tag.toLowerCase()) {\n case 'br':\n return 'lb';\n case 'img':\n return 'image';\n default:\n return `x-${tag}`;\n }\n}\n//# sourceMappingURL=xliff.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as ml from '../../ml_parser/ast';\nimport { XmlParser } from '../../ml_parser/xml_parser';\nimport { decimalDigest } from '../digest';\nimport * as i18n from '../i18n_ast';\nimport { I18nError } from '../parse_util';\nimport { Serializer } from './serializer';\nimport * as xml from './xml_helper';\nconst /** @type {?} */ _VERSION = '2.0';\nconst /** @type {?} */ _XMLNS = 'urn:oasis:names:tc:xliff:document:2.0';\n// TODO(vicb): make this a param (s/_/-/)\nconst /** @type {?} */ _DEFAULT_SOURCE_LANG = 'en';\nconst /** @type {?} */ _PLACEHOLDER_TAG = 'ph';\nconst /** @type {?} */ _PLACEHOLDER_SPANNING_TAG = 'pc';\nconst /** @type {?} */ _XLIFF_TAG = 'xliff';\nconst /** @type {?} */ _SOURCE_TAG = 'source';\nconst /** @type {?} */ _TARGET_TAG = 'target';\nconst /** @type {?} */ _UNIT_TAG = 'unit';\nexport class Xliff2 extends Serializer {\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n write(messages, locale) {\n const /** @type {?} */ visitor = new _WriteVisitor();\n const /** @type {?} */ units = [];\n messages.forEach(message => {\n const /** @type {?} */ unit = new xml.Tag(_UNIT_TAG, { id: message.id });\n const /** @type {?} */ notes = new xml.Tag('notes');\n if (message.description || message.meaning) {\n if (message.description) {\n notes.children.push(new xml.CR(8), new xml.Tag('note', { category: 'description' }, [new xml.Text(message.description)]));\n }\n if (message.meaning) {\n notes.children.push(new xml.CR(8), new xml.Tag('note', { category: 'meaning' }, [new xml.Text(message.meaning)]));\n }\n }\n message.sources.forEach((source) => {\n notes.children.push(new xml.CR(8), new xml.Tag('note', { category: 'location' }, [\n new xml.Text(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? ',' + source.endLine : ''}`)\n ]));\n });\n notes.children.push(new xml.CR(6));\n unit.children.push(new xml.CR(6), notes);\n const /** @type {?} */ segment = new xml.Tag('segment');\n segment.children.push(new xml.CR(8), new xml.Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), new xml.CR(6));\n unit.children.push(new xml.CR(6), segment, new xml.CR(4));\n units.push(new xml.CR(4), unit);\n });\n const /** @type {?} */ file = new xml.Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, [...units, new xml.CR(2)]);\n const /** @type {?} */ xliff = new xml.Tag(_XLIFF_TAG, { version: _VERSION, xmlns: _XMLNS, srcLang: locale || _DEFAULT_SOURCE_LANG }, [new xml.CR(2), file, new xml.CR()]);\n return xml.serialize([\n new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }), new xml.CR(), xliff, new xml.CR()\n ]);\n }\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n load(content, url) {\n // xliff to xml nodes\n const /** @type {?} */ xliff2Parser = new Xliff2Parser();\n const { locale, msgIdToHtml, errors } = xliff2Parser.parse(content, url);\n // xml nodes to i18n nodes\n const /** @type {?} */ i18nNodesByMsgId = {};\n const /** @type {?} */ converter = new XmlToI18n();\n Object.keys(msgIdToHtml).forEach(msgId => {\n const { i18nNodes, errors: e } = converter.convert(msgIdToHtml[msgId], url);\n errors.push(...e);\n i18nNodesByMsgId[msgId] = i18nNodes;\n });\n if (errors.length) {\n throw new Error(`xliff2 parse errors:\\n${errors.join('\\n')}`);\n }\n return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId };\n }\n /**\n * @param {?} message\n * @return {?}\n */\n digest(message) { return decimalDigest(message); }\n}\nclass _WriteVisitor {\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { return [new xml.Text(text.value)]; }\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n visitContainer(container, context) {\n const /** @type {?} */ nodes = [];\n container.children.forEach((node) => nodes.push(...node.visit(this)));\n return nodes;\n }\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n visitIcu(icu, context) {\n const /** @type {?} */ nodes = [new xml.Text(`{${icu.expressionPlaceholder}, ${icu.type}, `)];\n Object.keys(icu.cases).forEach((c) => {\n nodes.push(new xml.Text(`${c} {`), ...icu.cases[c].visit(this), new xml.Text(`} `));\n });\n nodes.push(new xml.Text(`}`));\n return nodes;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n const /** @type {?} */ type = getTypeForTag(ph.tag);\n if (ph.isVoid) {\n const /** @type {?} */ tagPh = new xml.Tag(_PLACEHOLDER_TAG, {\n id: (this._nextPlaceholderId++).toString(),\n equiv: ph.startName,\n type: type,\n disp: `<${ph.tag}/>`,\n });\n return [tagPh];\n }\n const /** @type {?} */ tagPc = new xml.Tag(_PLACEHOLDER_SPANNING_TAG, {\n id: (this._nextPlaceholderId++).toString(),\n equivStart: ph.startName,\n equivEnd: ph.closeName,\n type: type,\n dispStart: `<${ph.tag}>`,\n dispEnd: ``,\n });\n const /** @type {?} */ nodes = [].concat(...ph.children.map(node => node.visit(this)));\n if (nodes.length) {\n nodes.forEach((node) => tagPc.children.push(node));\n }\n else {\n tagPc.children.push(new xml.Text(''));\n }\n return [tagPc];\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) {\n const /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();\n return [new xml.Tag(_PLACEHOLDER_TAG, {\n id: idStr,\n equiv: ph.name,\n disp: `{{${ph.value}}}`,\n })];\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n const /** @type {?} */ cases = Object.keys(ph.value.cases).map((value) => value + ' {...}').join(' ');\n const /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();\n return [new xml.Tag(_PLACEHOLDER_TAG, { id: idStr, equiv: ph.name, disp: `{${ph.value.expression}, ${ph.value.type}, ${cases}}` })];\n }\n /**\n * @param {?} nodes\n * @return {?}\n */\n serialize(nodes) {\n this._nextPlaceholderId = 0;\n return [].concat(...nodes.map(node => node.visit(this)));\n }\n}\nfunction _WriteVisitor_tsickle_Closure_declarations() {\n /** @type {?} */\n _WriteVisitor.prototype._nextPlaceholderId;\n}\nclass Xliff2Parser {\n constructor() {\n this._locale = null;\n }\n /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n parse(xliff, url) {\n this._unitMlString = null;\n this._msgIdToHtml = {};\n const /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n this._errors = xml.errors;\n ml.visitAll(this, xml.rootNodes, null);\n return {\n msgIdToHtml: this._msgIdToHtml,\n errors: this._errors,\n locale: this._locale,\n };\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n visitElement(element, context) {\n switch (element.name) {\n case _UNIT_TAG:\n this._unitMlString = null;\n const /** @type {?} */ idAttr = element.attrs.find((attr) => attr.name === 'id');\n if (!idAttr) {\n this._addError(element, `<${_UNIT_TAG}> misses the \"id\" attribute`);\n }\n else {\n const /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, `Duplicated translations for msg ${id}`);\n }\n else {\n ml.visitAll(this, element.children, null);\n if (typeof this._unitMlString === 'string') {\n this._msgIdToHtml[id] = this._unitMlString;\n }\n else {\n this._addError(element, `Message ${id} misses a translation`);\n }\n }\n }\n break;\n case _SOURCE_TAG:\n // ignore source message\n break;\n case _TARGET_TAG:\n const /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n const /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n const /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n const /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n this._unitMlString = innerText;\n break;\n case _XLIFF_TAG:\n const /** @type {?} */ localeAttr = element.attrs.find((attr) => attr.name === 'trgLang');\n if (localeAttr) {\n this._locale = localeAttr.value;\n }\n const /** @type {?} */ versionAttr = element.attrs.find((attr) => attr.name === 'version');\n if (versionAttr) {\n const /** @type {?} */ version = versionAttr.value;\n if (version !== '2.0') {\n this._addError(element, `The XLIFF file version ${version} is not compatible with XLIFF 2.0 serializer`);\n }\n else {\n ml.visitAll(this, element.children, null);\n }\n }\n break;\n default:\n ml.visitAll(this, element.children, null);\n }\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { }\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n visitExpansion(expansion, context) { }\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(expansionCase, context) { }\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n _addError(node, message) {\n this._errors.push(new I18nError(node.sourceSpan, message));\n }\n}\nfunction Xliff2Parser_tsickle_Closure_declarations() {\n /** @type {?} */\n Xliff2Parser.prototype._unitMlString;\n /** @type {?} */\n Xliff2Parser.prototype._errors;\n /** @type {?} */\n Xliff2Parser.prototype._msgIdToHtml;\n /** @type {?} */\n Xliff2Parser.prototype._locale;\n}\nclass XmlToI18n {\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n convert(message, url) {\n const /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n const /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] :\n [].concat(...ml.visitAll(this, xmlIcu.rootNodes));\n return {\n i18nNodes,\n errors: this._errors,\n };\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { return new i18n.Text(text.value, text.sourceSpan); }\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n visitElement(el, context) {\n switch (el.name) {\n case _PLACEHOLDER_TAG:\n const /** @type {?} */ nameAttr = el.attrs.find((attr) => attr.name === 'equiv');\n if (nameAttr) {\n return [new i18n.Placeholder('', nameAttr.value, el.sourceSpan)];\n }\n this._addError(el, `<${_PLACEHOLDER_TAG}> misses the \"equiv\" attribute`);\n break;\n case _PLACEHOLDER_SPANNING_TAG:\n const /** @type {?} */ startAttr = el.attrs.find((attr) => attr.name === 'equivStart');\n const /** @type {?} */ endAttr = el.attrs.find((attr) => attr.name === 'equivEnd');\n if (!startAttr) {\n this._addError(el, `<${_PLACEHOLDER_TAG}> misses the \"equivStart\" attribute`);\n }\n else if (!endAttr) {\n this._addError(el, `<${_PLACEHOLDER_TAG}> misses the \"equivEnd\" attribute`);\n }\n else {\n const /** @type {?} */ startId = startAttr.value;\n const /** @type {?} */ endId = endAttr.value;\n const /** @type {?} */ nodes = [];\n return nodes.concat(new i18n.Placeholder('', startId, el.sourceSpan), ...el.children.map(node => node.visit(this, null)), new i18n.Placeholder('', endId, el.sourceSpan));\n }\n break;\n default:\n this._addError(el, `Unexpected tag`);\n }\n return null;\n }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitExpansion(icu, context) {\n const /** @type {?} */ caseMap = {};\n ml.visitAll(this, icu.cases).forEach((c) => {\n caseMap[c.value] = new i18n.Container(c.nodes, icu.sourceSpan);\n });\n return new i18n.Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n }\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(icuCase, context) {\n return {\n value: icuCase.value,\n nodes: [].concat(...ml.visitAll(this, icuCase.expression)),\n };\n }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { }\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n _addError(node, message) {\n this._errors.push(new I18nError(node.sourceSpan, message));\n }\n}\nfunction XmlToI18n_tsickle_Closure_declarations() {\n /** @type {?} */\n XmlToI18n.prototype._errors;\n}\n/**\n * @param {?} tag\n * @return {?}\n */\nfunction getTypeForTag(tag) {\n switch (tag.toLowerCase()) {\n case 'br':\n case 'b':\n case 'i':\n case 'u':\n return 'fmt';\n case 'img':\n return 'image';\n case 'a':\n return 'link';\n default:\n return 'other';\n }\n}\n//# sourceMappingURL=xliff2.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { decimalDigest } from '../digest';\nimport { Serializer, SimplePlaceholderMapper } from './serializer';\nimport * as xml from './xml_helper';\nconst /** @type {?} */ _MESSAGES_TAG = 'messagebundle';\nconst /** @type {?} */ _MESSAGE_TAG = 'msg';\nconst /** @type {?} */ _PLACEHOLDER_TAG = 'ph';\nconst /** @type {?} */ _EXEMPLE_TAG = 'ex';\nconst /** @type {?} */ _SOURCE_TAG = 'source';\nconst /** @type {?} */ _DOCTYPE = `\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n`;\nexport class Xmb extends Serializer {\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n write(messages, locale) {\n const /** @type {?} */ exampleVisitor = new ExampleVisitor();\n const /** @type {?} */ visitor = new _Visitor();\n let /** @type {?} */ rootNode = new xml.Tag(_MESSAGES_TAG);\n messages.forEach(message => {\n const /** @type {?} */ attrs = { id: message.id };\n if (message.description) {\n attrs['desc'] = message.description;\n }\n if (message.meaning) {\n attrs['meaning'] = message.meaning;\n }\n let /** @type {?} */ sourceTags = [];\n message.sources.forEach((source) => {\n sourceTags.push(new xml.Tag(_SOURCE_TAG, {}, [\n new xml.Text(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? ',' + source.endLine : ''}`)\n ]));\n });\n rootNode.children.push(new xml.CR(2), new xml.Tag(_MESSAGE_TAG, attrs, [...sourceTags, ...visitor.serialize(message.nodes)]));\n });\n rootNode.children.push(new xml.CR());\n return xml.serialize([\n new xml.Declaration({ version: '1.0', encoding: 'UTF-8' }),\n new xml.CR(),\n new xml.Doctype(_MESSAGES_TAG, _DOCTYPE),\n new xml.CR(),\n exampleVisitor.addDefaultExamples(rootNode),\n new xml.CR(),\n ]);\n }\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n load(content, url) {\n throw new Error('Unsupported');\n }\n /**\n * @param {?} message\n * @return {?}\n */\n digest(message) { return digest(message); }\n /**\n * @param {?} message\n * @return {?}\n */\n createNameMapper(message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n }\n}\nclass _Visitor {\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { return [new xml.Text(text.value)]; }\n /**\n * @param {?} container\n * @param {?} context\n * @return {?}\n */\n visitContainer(container, context) {\n const /** @type {?} */ nodes = [];\n container.children.forEach((node) => nodes.push(...node.visit(this)));\n return nodes;\n }\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n visitIcu(icu, context) {\n const /** @type {?} */ nodes = [new xml.Text(`{${icu.expressionPlaceholder}, ${icu.type}, `)];\n Object.keys(icu.cases).forEach((c) => {\n nodes.push(new xml.Text(`${c} {`), ...icu.cases[c].visit(this), new xml.Text(`} `));\n });\n nodes.push(new xml.Text(`}`));\n return nodes;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n const /** @type {?} */ startEx = new xml.Tag(_EXEMPLE_TAG, {}, [new xml.Text(`<${ph.tag}>`)]);\n const /** @type {?} */ startTagPh = new xml.Tag(_PLACEHOLDER_TAG, { name: ph.startName }, [startEx]);\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n const /** @type {?} */ closeEx = new xml.Tag(_EXEMPLE_TAG, {}, [new xml.Text(``)]);\n const /** @type {?} */ closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, { name: ph.closeName }, [closeEx]);\n return [startTagPh, ...this.serialize(ph.children), closeTagPh];\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) {\n return [new xml.Tag(_PLACEHOLDER_TAG, { name: ph.name })];\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n return [new xml.Tag(_PLACEHOLDER_TAG, { name: ph.name })];\n }\n /**\n * @param {?} nodes\n * @return {?}\n */\n serialize(nodes) {\n return [].concat(...nodes.map(node => node.visit(this)));\n }\n}\n/**\n * @param {?} message\n * @return {?}\n */\nexport function digest(message) {\n return decimalDigest(message);\n}\nclass ExampleVisitor {\n /**\n * @param {?} node\n * @return {?}\n */\n addDefaultExamples(node) {\n node.visit(this);\n return node;\n }\n /**\n * @param {?} tag\n * @return {?}\n */\n visitTag(tag) {\n if (tag.name === _PLACEHOLDER_TAG) {\n if (!tag.children || tag.children.length == 0) {\n const /** @type {?} */ exText = new xml.Text(tag.attrs['name'] || '...');\n tag.children = [new xml.Tag(_EXEMPLE_TAG, {}, [exText])];\n }\n }\n else if (tag.children) {\n tag.children.forEach(node => node.visit(this));\n }\n }\n /**\n * @param {?} text\n * @return {?}\n */\n visitText(text) { }\n /**\n * @param {?} decl\n * @return {?}\n */\n visitDeclaration(decl) { }\n /**\n * @param {?} doctype\n * @return {?}\n */\n visitDoctype(doctype) { }\n}\n/**\n * @param {?} internalName\n * @return {?}\n */\nexport function toPublicName(internalName) {\n return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n}\n//# sourceMappingURL=xmb.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as ml from '../../ml_parser/ast';\nimport { XmlParser } from '../../ml_parser/xml_parser';\nimport * as i18n from '../i18n_ast';\nimport { I18nError } from '../parse_util';\nimport { Serializer, SimplePlaceholderMapper } from './serializer';\nimport { digest, toPublicName } from './xmb';\nconst /** @type {?} */ _TRANSLATIONS_TAG = 'translationbundle';\nconst /** @type {?} */ _TRANSLATION_TAG = 'translation';\nconst /** @type {?} */ _PLACEHOLDER_TAG = 'ph';\nexport class Xtb extends Serializer {\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n write(messages, locale) { throw new Error('Unsupported'); }\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n load(content, url) {\n // xtb to xml nodes\n const /** @type {?} */ xtbParser = new XtbParser();\n const { locale, msgIdToHtml, errors } = xtbParser.parse(content, url);\n // xml nodes to i18n nodes\n const /** @type {?} */ i18nNodesByMsgId = {};\n const /** @type {?} */ converter = new XmlToI18n();\n // Because we should be able to load xtb files that rely on features not supported by angular,\n // we need to delay the conversion of html to i18n nodes so that non angular messages are not\n // converted\n Object.keys(msgIdToHtml).forEach(msgId => {\n const /** @type {?} */ valueFn = function () {\n const { i18nNodes, errors } = converter.convert(msgIdToHtml[msgId], url);\n if (errors.length) {\n throw new Error(`xtb parse errors:\\n${errors.join('\\n')}`);\n }\n return i18nNodes;\n };\n createLazyProperty(i18nNodesByMsgId, msgId, valueFn);\n });\n if (errors.length) {\n throw new Error(`xtb parse errors:\\n${errors.join('\\n')}`);\n }\n return { locale: /** @type {?} */ ((locale)), i18nNodesByMsgId };\n }\n /**\n * @param {?} message\n * @return {?}\n */\n digest(message) { return digest(message); }\n /**\n * @param {?} message\n * @return {?}\n */\n createNameMapper(message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n }\n}\n/**\n * @param {?} messages\n * @param {?} id\n * @param {?} valueFn\n * @return {?}\n */\nfunction createLazyProperty(messages, id, valueFn) {\n Object.defineProperty(messages, id, {\n configurable: true,\n enumerable: true,\n get: function () {\n const /** @type {?} */ value = valueFn();\n Object.defineProperty(messages, id, { enumerable: true, value });\n return value;\n },\n set: _ => { throw new Error('Could not overwrite an XTB translation'); },\n });\n}\nclass XtbParser {\n constructor() {\n this._locale = null;\n }\n /**\n * @param {?} xtb\n * @param {?} url\n * @return {?}\n */\n parse(xtb, url) {\n this._bundleDepth = 0;\n this._msgIdToHtml = {};\n // We can not parse the ICU messages at this point as some messages might not originate\n // from Angular that could not be lex'd.\n const /** @type {?} */ xml = new XmlParser().parse(xtb, url, false);\n this._errors = xml.errors;\n ml.visitAll(this, xml.rootNodes);\n return {\n msgIdToHtml: this._msgIdToHtml,\n errors: this._errors,\n locale: this._locale,\n };\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n visitElement(element, context) {\n switch (element.name) {\n case _TRANSLATIONS_TAG:\n this._bundleDepth++;\n if (this._bundleDepth > 1) {\n this._addError(element, `<${_TRANSLATIONS_TAG}> elements can not be nested`);\n }\n const /** @type {?} */ langAttr = element.attrs.find((attr) => attr.name === 'lang');\n if (langAttr) {\n this._locale = langAttr.value;\n }\n ml.visitAll(this, element.children, null);\n this._bundleDepth--;\n break;\n case _TRANSLATION_TAG:\n const /** @type {?} */ idAttr = element.attrs.find((attr) => attr.name === 'id');\n if (!idAttr) {\n this._addError(element, `<${_TRANSLATION_TAG}> misses the \"id\" attribute`);\n }\n else {\n const /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, `Duplicated translations for msg ${id}`);\n }\n else {\n const /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n const /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n const /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n const /** @type {?} */ innerText = content.slice(/** @type {?} */ ((innerTextStart)), /** @type {?} */ ((innerTextEnd)));\n this._msgIdToHtml[id] = innerText;\n }\n }\n break;\n default:\n this._addError(element, 'Unexpected tag');\n }\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { }\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n visitExpansion(expansion, context) { }\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(expansionCase, context) { }\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n _addError(node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n }\n}\nfunction XtbParser_tsickle_Closure_declarations() {\n /** @type {?} */\n XtbParser.prototype._bundleDepth;\n /** @type {?} */\n XtbParser.prototype._errors;\n /** @type {?} */\n XtbParser.prototype._msgIdToHtml;\n /** @type {?} */\n XtbParser.prototype._locale;\n}\nclass XmlToI18n {\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n convert(message, url) {\n const /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n const /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] :\n ml.visitAll(this, xmlIcu.rootNodes);\n return {\n i18nNodes,\n errors: this._errors,\n };\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { return new i18n.Text(text.value, /** @type {?} */ ((text.sourceSpan))); }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitExpansion(icu, context) {\n const /** @type {?} */ caseMap = {};\n ml.visitAll(this, icu.cases).forEach(c => {\n caseMap[c.value] = new i18n.Container(c.nodes, icu.sourceSpan);\n });\n return new i18n.Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n }\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(icuCase, context) {\n return {\n value: icuCase.value,\n nodes: ml.visitAll(this, icuCase.expression),\n };\n }\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n visitElement(el, context) {\n if (el.name === _PLACEHOLDER_TAG) {\n const /** @type {?} */ nameAttr = el.attrs.find((attr) => attr.name === 'name');\n if (nameAttr) {\n return new i18n.Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n }\n this._addError(el, `<${_PLACEHOLDER_TAG}> misses the \"name\" attribute`);\n }\n else {\n this._addError(el, `Unexpected tag`);\n }\n return null;\n }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { }\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n _addError(node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n }\n}\nfunction XmlToI18n_tsickle_Closure_declarations() {\n /** @type {?} */\n XmlToI18n.prototype._errors;\n}\n//# sourceMappingURL=xtb.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { CompilerInjectable } from '../injectable';\nimport { getHtmlTagDefinition } from './html_tags';\nimport { DEFAULT_INTERPOLATION_CONFIG } from './interpolation_config';\nimport { Parser } from './parser';\nexport { ParseTreeResult, TreeError } from './parser';\nexport class HtmlParser extends Parser {\n constructor() { super(getHtmlTagDefinition); }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parse(source, url, parseExpansionForms = false, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n return super.parse(source, url, parseExpansionForms, interpolationConfig);\n }\n}\nHtmlParser.decorators = [\n { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nHtmlParser.ctorParameters = () => [];\nfunction HtmlParser_tsickle_Closure_declarations() {\n /** @type {?} */\n HtmlParser.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n HtmlParser.ctorParameters;\n}\n//# sourceMappingURL=html_parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { MissingTranslationStrategy } from '@angular/core';\nimport { HtmlParser } from '../ml_parser/html_parser';\nimport { I18nError } from './parse_util';\n/**\n * A container for translated messages\n */\nexport class TranslationBundle {\n /**\n * @param {?=} _i18nNodesByMsgId\n * @param {?=} locale\n * @param {?=} digest\n * @param {?=} mapperFactory\n * @param {?=} missingTranslationStrategy\n * @param {?=} console\n */\n constructor(_i18nNodesByMsgId = {}, locale, digest, mapperFactory, missingTranslationStrategy = MissingTranslationStrategy.Warning, console) {\n this._i18nNodesByMsgId = _i18nNodesByMsgId;\n this.digest = digest;\n this.mapperFactory = mapperFactory;\n this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console);\n }\n /**\n * @param {?} content\n * @param {?} url\n * @param {?} serializer\n * @param {?} missingTranslationStrategy\n * @param {?=} console\n * @return {?}\n */\n static load(content, url, serializer, missingTranslationStrategy, console) {\n const { locale, i18nNodesByMsgId } = serializer.load(content, url);\n const /** @type {?} */ digestFn = (m) => serializer.digest(m);\n const /** @type {?} */ mapperFactory = (m) => ((serializer.createNameMapper(m)));\n return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);\n }\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n get(srcMsg) {\n const /** @type {?} */ html = this._i18nToHtml.convert(srcMsg);\n if (html.errors.length) {\n throw new Error(html.errors.join('\\n'));\n }\n return html.nodes;\n }\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n has(srcMsg) { return this.digest(srcMsg) in this._i18nNodesByMsgId; }\n}\nfunction TranslationBundle_tsickle_Closure_declarations() {\n /** @type {?} */\n TranslationBundle.prototype._i18nToHtml;\n /** @type {?} */\n TranslationBundle.prototype._i18nNodesByMsgId;\n /** @type {?} */\n TranslationBundle.prototype.digest;\n /** @type {?} */\n TranslationBundle.prototype.mapperFactory;\n}\nclass I18nToHtmlVisitor {\n /**\n * @param {?=} _i18nNodesByMsgId\n * @param {?=} _locale\n * @param {?=} _digest\n * @param {?=} _mapperFactory\n * @param {?=} _missingTranslationStrategy\n * @param {?=} _console\n */\n constructor(_i18nNodesByMsgId = {}, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {\n this._i18nNodesByMsgId = _i18nNodesByMsgId;\n this._locale = _locale;\n this._digest = _digest;\n this._mapperFactory = _mapperFactory;\n this._missingTranslationStrategy = _missingTranslationStrategy;\n this._console = _console;\n this._contextStack = [];\n this._errors = [];\n }\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n convert(srcMsg) {\n this._contextStack.length = 0;\n this._errors.length = 0;\n // i18n to text\n const /** @type {?} */ text = this._convertToText(srcMsg);\n // text to html\n const /** @type {?} */ url = srcMsg.nodes[0].sourceSpan.start.file.url;\n const /** @type {?} */ html = new HtmlParser().parse(text, url, true);\n return {\n nodes: html.rootNodes,\n errors: [...this._errors, ...html.errors],\n };\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n visitText(text, context) { return text.value; }\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n visitContainer(container, context) {\n return container.children.map(n => n.visit(this)).join('');\n }\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n visitIcu(icu, context) {\n const /** @type {?} */ cases = Object.keys(icu.cases).map(k => `${k} {${icu.cases[k].visit(this)}}`);\n // TODO(vicb): Once all format switch to using expression placeholders\n // we should throw when the placeholder is not in the source message\n const /** @type {?} */ exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ?\n this._srcMsg.placeholders[icu.expression] :\n icu.expression;\n return `{${exp}, ${icu.type}, ${cases.join(' ')}}`;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitPlaceholder(ph, context) {\n const /** @type {?} */ phName = this._mapper(ph.name);\n if (this._srcMsg.placeholders.hasOwnProperty(phName)) {\n return this._srcMsg.placeholders[phName];\n }\n if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) {\n return this._convertToText(this._srcMsg.placeholderToMessage[phName]);\n }\n this._addError(ph, `Unknown placeholder \"${ph.name}\"`);\n return '';\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitTagPlaceholder(ph, context) {\n const /** @type {?} */ tag = `${ph.tag}`;\n const /** @type {?} */ attrs = Object.keys(ph.attrs).map(name => `${name}=\"${ph.attrs[name]}\"`).join(' ');\n if (ph.isVoid) {\n return `<${tag} ${attrs}/>`;\n }\n const /** @type {?} */ children = ph.children.map((c) => c.visit(this)).join('');\n return `<${tag} ${attrs}>${children}`;\n }\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n visitIcuPlaceholder(ph, context) {\n // An ICU placeholder references the source message to be serialized\n return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]);\n }\n /**\n * Convert a source message to a translated text string:\n * - text nodes are replaced with their translation,\n * - placeholders are replaced with their content,\n * - ICU nodes are converted to ICU expressions.\n * @param {?} srcMsg\n * @return {?}\n */\n _convertToText(srcMsg) {\n const /** @type {?} */ id = this._digest(srcMsg);\n const /** @type {?} */ mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;\n let /** @type {?} */ nodes;\n this._contextStack.push({ msg: this._srcMsg, mapper: this._mapper });\n this._srcMsg = srcMsg;\n if (this._i18nNodesByMsgId.hasOwnProperty(id)) {\n // When there is a translation use its nodes as the source\n // And create a mapper to convert serialized placeholder names to internal names\n nodes = this._i18nNodesByMsgId[id];\n this._mapper = (name) => mapper ? ((mapper.toInternalName(name))) : name;\n }\n else {\n // When no translation has been found\n // - report an error / a warning / nothing,\n // - use the nodes from the original message\n // - placeholders are already internal and need no mapper\n if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) {\n const /** @type {?} */ ctx = this._locale ? ` for locale \"${this._locale}\"` : '';\n this._addError(srcMsg.nodes[0], `Missing translation for message \"${id}\"${ctx}`);\n }\n else if (this._console &&\n this._missingTranslationStrategy === MissingTranslationStrategy.Warning) {\n const /** @type {?} */ ctx = this._locale ? ` for locale \"${this._locale}\"` : '';\n this._console.warn(`Missing translation for message \"${id}\"${ctx}`);\n }\n nodes = srcMsg.nodes;\n this._mapper = (name) => name;\n }\n const /** @type {?} */ text = nodes.map(node => node.visit(this)).join('');\n const /** @type {?} */ context = ((this._contextStack.pop()));\n this._srcMsg = context.msg;\n this._mapper = context.mapper;\n return text;\n }\n /**\n * @param {?} el\n * @param {?} msg\n * @return {?}\n */\n _addError(el, msg) {\n this._errors.push(new I18nError(el.sourceSpan, msg));\n }\n}\nfunction I18nToHtmlVisitor_tsickle_Closure_declarations() {\n /** @type {?} */\n I18nToHtmlVisitor.prototype._srcMsg;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._contextStack;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._errors;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._mapper;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._i18nNodesByMsgId;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._locale;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._digest;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._mapperFactory;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._missingTranslationStrategy;\n /** @type {?} */\n I18nToHtmlVisitor.prototype._console;\n}\n//# sourceMappingURL=translation_bundle.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { MissingTranslationStrategy } from '@angular/core';\nimport { DEFAULT_INTERPOLATION_CONFIG } from '../ml_parser/interpolation_config';\nimport { ParseTreeResult } from '../ml_parser/parser';\nimport { digest } from './digest';\nimport { mergeTranslations } from './extractor_merger';\nimport { Xliff } from './serializers/xliff';\nimport { Xliff2 } from './serializers/xliff2';\nimport { Xmb } from './serializers/xmb';\nimport { Xtb } from './serializers/xtb';\nimport { TranslationBundle } from './translation_bundle';\nexport class I18NHtmlParser {\n /**\n * @param {?} _htmlParser\n * @param {?=} translations\n * @param {?=} translationsFormat\n * @param {?=} missingTranslation\n * @param {?=} console\n */\n constructor(_htmlParser, translations, translationsFormat, missingTranslation = MissingTranslationStrategy.Warning, console) {\n this._htmlParser = _htmlParser;\n if (translations) {\n const serializer = createSerializer(translationsFormat);\n this._translationBundle =\n TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console);\n }\n else {\n this._translationBundle =\n new TranslationBundle({}, null, digest, undefined, missingTranslation, console);\n }\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n parse(source, url, parseExpansionForms = false, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {\n const /** @type {?} */ parseResult = this._htmlParser.parse(source, url, parseExpansionForms, interpolationConfig);\n if (parseResult.errors.length) {\n return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);\n }\n return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {});\n }\n}\nfunction I18NHtmlParser_tsickle_Closure_declarations() {\n /** @type {?} */\n I18NHtmlParser.prototype.getTagDefinition;\n /** @type {?} */\n I18NHtmlParser.prototype._translationBundle;\n /** @type {?} */\n I18NHtmlParser.prototype._htmlParser;\n}\n/**\n * @param {?=} format\n * @return {?}\n */\nfunction createSerializer(format) {\n format = (format || 'xlf').toLowerCase();\n switch (format) {\n case 'xmb':\n return new Xmb();\n case 'xtb':\n return new Xtb();\n case 'xliff2':\n case 'xlf2':\n return new Xliff2();\n case 'xliff':\n case 'xlf':\n default:\n return new Xliff();\n }\n}\n//# sourceMappingURL=i18n_html_parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ANALYZE_FOR_ENTRY_COMPONENTS, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, ElementRef, Injector, LOCALE_ID, NgModuleFactory, NgModuleRef, QueryList, Renderer, SecurityContext, TRANSLATIONS_FORMAT, TemplateRef, ViewContainerRef, ViewEncapsulation, ɵCodegenComponentFactoryResolver, ɵEMPTY_ARRAY, ɵEMPTY_MAP, ɵand, ɵccf, ɵcmf, ɵcrt, ɵdid, ɵeld, ɵinlineInterpolate, ɵinterpolate, ɵmod, ɵmpd, ɵncd, ɵnov, ɵpad, ɵpid, ɵpod, ɵppd, ɵprd, ɵqud, ɵregisterModuleFactory, ɵted, ɵunv, ɵvid } from '@angular/core';\nconst /** @type {?} */ CORE = '@angular/core';\nexport class Identifiers {\n}\nIdentifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {\n name: 'ANALYZE_FOR_ENTRY_COMPONENTS',\n moduleName: CORE,\n runtime: ANALYZE_FOR_ENTRY_COMPONENTS\n};\nIdentifiers.ElementRef = { name: 'ElementRef', moduleName: CORE, runtime: ElementRef };\nIdentifiers.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE, runtime: NgModuleRef };\nIdentifiers.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE, runtime: ViewContainerRef };\nIdentifiers.ChangeDetectorRef = {\n name: 'ChangeDetectorRef',\n moduleName: CORE,\n runtime: ChangeDetectorRef\n};\nIdentifiers.QueryList = { name: 'QueryList', moduleName: CORE, runtime: QueryList };\nIdentifiers.TemplateRef = { name: 'TemplateRef', moduleName: CORE, runtime: TemplateRef };\nIdentifiers.CodegenComponentFactoryResolver = {\n name: 'ɵCodegenComponentFactoryResolver',\n moduleName: CORE,\n runtime: ɵCodegenComponentFactoryResolver\n};\nIdentifiers.ComponentFactoryResolver = {\n name: 'ComponentFactoryResolver',\n moduleName: CORE,\n runtime: ComponentFactoryResolver\n};\nIdentifiers.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE, runtime: ComponentFactory };\nIdentifiers.ComponentRef = { name: 'ComponentRef', moduleName: CORE, runtime: ComponentRef };\nIdentifiers.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE, runtime: NgModuleFactory };\nIdentifiers.createModuleFactory = {\n name: 'ɵcmf',\n moduleName: CORE,\n runtime: ɵcmf,\n};\nIdentifiers.moduleDef = {\n name: 'ɵmod',\n moduleName: CORE,\n runtime: ɵmod,\n};\nIdentifiers.moduleProviderDef = {\n name: 'ɵmpd',\n moduleName: CORE,\n runtime: ɵmpd,\n};\nIdentifiers.RegisterModuleFactoryFn = {\n name: 'ɵregisterModuleFactory',\n moduleName: CORE,\n runtime: ɵregisterModuleFactory,\n};\nIdentifiers.Injector = { name: 'Injector', moduleName: CORE, runtime: Injector };\nIdentifiers.ViewEncapsulation = {\n name: 'ViewEncapsulation',\n moduleName: CORE,\n runtime: ViewEncapsulation\n};\nIdentifiers.ChangeDetectionStrategy = {\n name: 'ChangeDetectionStrategy',\n moduleName: CORE,\n runtime: ChangeDetectionStrategy\n};\nIdentifiers.SecurityContext = {\n name: 'SecurityContext',\n moduleName: CORE,\n runtime: SecurityContext,\n};\nIdentifiers.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE, runtime: LOCALE_ID };\nIdentifiers.TRANSLATIONS_FORMAT = {\n name: 'TRANSLATIONS_FORMAT',\n moduleName: CORE,\n runtime: TRANSLATIONS_FORMAT\n};\nIdentifiers.inlineInterpolate = {\n name: 'ɵinlineInterpolate',\n moduleName: CORE,\n runtime: ɵinlineInterpolate\n};\nIdentifiers.interpolate = { name: 'ɵinterpolate', moduleName: CORE, runtime: ɵinterpolate };\nIdentifiers.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE, runtime: ɵEMPTY_ARRAY };\nIdentifiers.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE, runtime: ɵEMPTY_MAP };\nIdentifiers.Renderer = { name: 'Renderer', moduleName: CORE, runtime: Renderer };\nIdentifiers.viewDef = { name: 'ɵvid', moduleName: CORE, runtime: ɵvid };\nIdentifiers.elementDef = { name: 'ɵeld', moduleName: CORE, runtime: ɵeld };\nIdentifiers.anchorDef = { name: 'ɵand', moduleName: CORE, runtime: ɵand };\nIdentifiers.textDef = { name: 'ɵted', moduleName: CORE, runtime: ɵted };\nIdentifiers.directiveDef = { name: 'ɵdid', moduleName: CORE, runtime: ɵdid };\nIdentifiers.providerDef = { name: 'ɵprd', moduleName: CORE, runtime: ɵprd };\nIdentifiers.queryDef = { name: 'ɵqud', moduleName: CORE, runtime: ɵqud };\nIdentifiers.pureArrayDef = { name: 'ɵpad', moduleName: CORE, runtime: ɵpad };\nIdentifiers.pureObjectDef = { name: 'ɵpod', moduleName: CORE, runtime: ɵpod };\nIdentifiers.purePipeDef = { name: 'ɵppd', moduleName: CORE, runtime: ɵppd };\nIdentifiers.pipeDef = { name: 'ɵpid', moduleName: CORE, runtime: ɵpid };\nIdentifiers.nodeValue = { name: 'ɵnov', moduleName: CORE, runtime: ɵnov };\nIdentifiers.ngContentDef = { name: 'ɵncd', moduleName: CORE, runtime: ɵncd };\nIdentifiers.unwrapValue = { name: 'ɵunv', moduleName: CORE, runtime: ɵunv };\nIdentifiers.createRendererType2 = { name: 'ɵcrt', moduleName: CORE, runtime: ɵcrt };\nIdentifiers.RendererType2 = {\n name: 'RendererType2',\n moduleName: CORE,\n // type only\n runtime: null\n};\nIdentifiers.ViewDefinition = {\n name: 'ɵViewDefinition',\n moduleName: CORE,\n // type only\n runtime: null\n};\nIdentifiers.createComponentFactory = { name: 'ɵccf', moduleName: CORE, runtime: ɵccf };\nfunction Identifiers_tsickle_Closure_declarations() {\n /** @type {?} */\n Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS;\n /** @type {?} */\n Identifiers.ElementRef;\n /** @type {?} */\n Identifiers.NgModuleRef;\n /** @type {?} */\n Identifiers.ViewContainerRef;\n /** @type {?} */\n Identifiers.ChangeDetectorRef;\n /** @type {?} */\n Identifiers.QueryList;\n /** @type {?} */\n Identifiers.TemplateRef;\n /** @type {?} */\n Identifiers.CodegenComponentFactoryResolver;\n /** @type {?} */\n Identifiers.ComponentFactoryResolver;\n /** @type {?} */\n Identifiers.ComponentFactory;\n /** @type {?} */\n Identifiers.ComponentRef;\n /** @type {?} */\n Identifiers.NgModuleFactory;\n /** @type {?} */\n Identifiers.createModuleFactory;\n /** @type {?} */\n Identifiers.moduleDef;\n /** @type {?} */\n Identifiers.moduleProviderDef;\n /** @type {?} */\n Identifiers.RegisterModuleFactoryFn;\n /** @type {?} */\n Identifiers.Injector;\n /** @type {?} */\n Identifiers.ViewEncapsulation;\n /** @type {?} */\n Identifiers.ChangeDetectionStrategy;\n /** @type {?} */\n Identifiers.SecurityContext;\n /** @type {?} */\n Identifiers.LOCALE_ID;\n /** @type {?} */\n Identifiers.TRANSLATIONS_FORMAT;\n /** @type {?} */\n Identifiers.inlineInterpolate;\n /** @type {?} */\n Identifiers.interpolate;\n /** @type {?} */\n Identifiers.EMPTY_ARRAY;\n /** @type {?} */\n Identifiers.EMPTY_MAP;\n /** @type {?} */\n Identifiers.Renderer;\n /** @type {?} */\n Identifiers.viewDef;\n /** @type {?} */\n Identifiers.elementDef;\n /** @type {?} */\n Identifiers.anchorDef;\n /** @type {?} */\n Identifiers.textDef;\n /** @type {?} */\n Identifiers.directiveDef;\n /** @type {?} */\n Identifiers.providerDef;\n /** @type {?} */\n Identifiers.queryDef;\n /** @type {?} */\n Identifiers.pureArrayDef;\n /** @type {?} */\n Identifiers.pureObjectDef;\n /** @type {?} */\n Identifiers.purePipeDef;\n /** @type {?} */\n Identifiers.pipeDef;\n /** @type {?} */\n Identifiers.nodeValue;\n /** @type {?} */\n Identifiers.ngContentDef;\n /** @type {?} */\n Identifiers.unwrapValue;\n /** @type {?} */\n Identifiers.createRendererType2;\n /** @type {?} */\n Identifiers.RendererType2;\n /** @type {?} */\n Identifiers.ViewDefinition;\n /** @type {?} */\n Identifiers.createComponentFactory;\n}\n/**\n * @param {?} reference\n * @return {?}\n */\nexport function createTokenForReference(reference) {\n return { identifier: { reference: reference } };\n}\n/**\n * @param {?} reflector\n * @param {?} reference\n * @return {?}\n */\nexport function createTokenForExternalReference(reflector, reference) {\n return createTokenForReference(reflector.resolveExternalReference(reference));\n}\n//# sourceMappingURL=identifiers.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport * as html from './ast';\nimport { ParseTreeResult } from './parser';\nimport { NGSP_UNICODE } from './tags';\nexport const /** @type {?} */ PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';\nconst /** @type {?} */ SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);\n// Equivalent to \\s with \\u00a0 (non-breaking space) excluded.\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\nconst /** @type {?} */ WS_CHARS = ' \\f\\n\\r\\t\\v\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';\nconst /** @type {?} */ NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);\nconst /** @type {?} */ WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, 'g');\n/**\n * @param {?} attrs\n * @return {?}\n */\nfunction hasPreserveWhitespacesAttr(attrs) {\n return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);\n}\n/**\n * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:\n * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32\n * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character\n * and later on replaced by a space. We are re-implementing the same idea here.\n * @param {?} value\n * @return {?}\n */\nexport function replaceNgsp(value) {\n // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE\n return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');\n}\n/**\n * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:\n * - consider spaces, tabs and new lines as whitespace characters;\n * - drop text nodes consisting of whitespace characters only;\n * - for all other text nodes replace consecutive whitespace characters with one space;\n * - convert &ngsp; pseudo-entity to a single space;\n *\n * Removal and trimming of whitespaces have positive performance impact (less code to generate\n * while compiling templates, faster view creation). At the same time it can be \"destructive\"\n * in some cases (whitespaces can influence layout). Because of the potential of breaking layout\n * this visitor is not activated by default in Angular 4 and people need to explicitly opt-in for\n * whitespace removal. The default option for whitespace removal will be revisited post Angular 5\n * and might be changed to \"on\" by default.\n */\nclass WhitespaceVisitor {\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n visitElement(element, context) {\n if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {\n // don't descent into elements where we need to preserve whitespaces\n // but still visit all attributes to eliminate one used as a market to preserve WS\n return new html.Element(element.name, html.visitAll(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n }\n return new html.Element(element.name, element.attrs, html.visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) {\n return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) {\n const /** @type {?} */ isNotBlank = text.value.match(NO_WS_REGEXP);\n if (isNotBlank) {\n return new html.Text(replaceNgsp(text.value).replace(WS_REPLACE_REGEXP, ' '), text.sourceSpan);\n }\n return null;\n }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { return comment; }\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n visitExpansion(expansion, context) { return expansion; }\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(expansionCase, context) { return expansionCase; }\n}\n/**\n * @param {?} htmlAstWithErrors\n * @return {?}\n */\nexport function removeWhitespaces(htmlAstWithErrors) {\n return new ParseTreeResult(html.visitAll(new WhitespaceVisitor(), htmlAstWithErrors.rootNodes), htmlAstWithErrors.errors);\n}\n//# sourceMappingURL=html_whitespaces.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { ParseError } from '../parse_util';\nimport * as html from './ast';\n// http://cldr.unicode.org/index/cldr-spec/plural-rules\nconst /** @type {?} */ PLURAL_CASES = ['zero', 'one', 'two', 'few', 'many', 'other'];\n/**\n * Expands special forms into elements.\n *\n * For example,\n *\n * ```\n * { messages.length, plural,\n * =0 {zero}\n * =1 {one}\n * other {more than one}\n * }\n * ```\n *\n * will be expanded into\n *\n * ```\n * \n * zero\n * one\n * more than one\n * \n * ```\n * @param {?} nodes\n * @return {?}\n */\nexport function expandNodes(nodes) {\n const /** @type {?} */ expander = new _Expander();\n return new ExpansionResult(html.visitAll(expander, nodes), expander.isExpanded, expander.errors);\n}\nexport class ExpansionResult {\n /**\n * @param {?} nodes\n * @param {?} expanded\n * @param {?} errors\n */\n constructor(nodes, expanded, errors) {\n this.nodes = nodes;\n this.expanded = expanded;\n this.errors = errors;\n }\n}\nfunction ExpansionResult_tsickle_Closure_declarations() {\n /** @type {?} */\n ExpansionResult.prototype.nodes;\n /** @type {?} */\n ExpansionResult.prototype.expanded;\n /** @type {?} */\n ExpansionResult.prototype.errors;\n}\nexport class ExpansionError extends ParseError {\n /**\n * @param {?} span\n * @param {?} errorMsg\n */\n constructor(span, errorMsg) { super(span, errorMsg); }\n}\n/**\n * Expand expansion forms (plural, select) to directives\n *\n * \\@internal\n */\nclass _Expander {\n constructor() {\n this.isExpanded = false;\n this.errors = [];\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n visitElement(element, context) {\n return new html.Element(element.name, element.attrs, html.visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n }\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n visitAttribute(attribute, context) { return attribute; }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n visitText(text, context) { return text; }\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n visitComment(comment, context) { return comment; }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n visitExpansion(icu, context) {\n this.isExpanded = true;\n return icu.type == 'plural' ? _expandPluralForm(icu, this.errors) :\n _expandDefaultForm(icu, this.errors);\n }\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n visitExpansionCase(icuCase, context) {\n throw new Error('Should not be reached');\n }\n}\nfunction _Expander_tsickle_Closure_declarations() {\n /** @type {?} */\n _Expander.prototype.isExpanded;\n /** @type {?} */\n _Expander.prototype.errors;\n}\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandPluralForm(ast, errors) {\n const /** @type {?} */ children = ast.cases.map(c => {\n if (PLURAL_CASES.indexOf(c.value) == -1 && !c.value.match(/^=\\d+$/)) {\n errors.push(new ExpansionError(c.valueSourceSpan, `Plural cases should be \"=\" or one of ${PLURAL_CASES.join(\", \")}`));\n }\n const /** @type {?} */ expansionResult = expandNodes(c.expression);\n errors.push(...expansionResult.errors);\n return new html.Element(`ng-template`, [new html.Attribute('ngPluralCase', `${c.value}`, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n });\n const /** @type {?} */ switchAttr = new html.Attribute('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan);\n return new html.Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandDefaultForm(ast, errors) {\n const /** @type {?} */ children = ast.cases.map(c => {\n const /** @type {?} */ expansionResult = expandNodes(c.expression);\n errors.push(...expansionResult.errors);\n if (c.value === 'other') {\n // other is the default case when no values match\n return new html.Element(`ng-template`, [new html.Attribute('ngSwitchDefault', '', c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n }\n return new html.Element(`ng-template`, [new html.Attribute('ngSwitchCase', `${c.value}`, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n });\n const /** @type {?} */ switchAttr = new html.Attribute('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan);\n return new html.Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n//# sourceMappingURL=icu_ast_expander.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { tokenName, tokenReference } from './compile_metadata';\nimport { Identifiers, createTokenForExternalReference } from './identifiers';\nimport { ParseError } from './parse_util';\nimport { ProviderAst, ProviderAstType } from './template_parser/template_ast';\nexport class ProviderError extends ParseError {\n /**\n * @param {?} message\n * @param {?} span\n */\n constructor(message, span) { super(span, message); }\n}\nexport class ProviderViewContext {\n /**\n * @param {?} reflector\n * @param {?} component\n */\n constructor(reflector, component) {\n this.reflector = reflector;\n this.component = component;\n this.errors = [];\n this.viewQueries = _getViewQueries(component);\n this.viewProviders = new Map();\n component.viewProviders.forEach((provider) => {\n if (this.viewProviders.get(tokenReference(provider.token)) == null) {\n this.viewProviders.set(tokenReference(provider.token), true);\n }\n });\n }\n}\nfunction ProviderViewContext_tsickle_Closure_declarations() {\n /**\n * \\@internal\n * @type {?}\n */\n ProviderViewContext.prototype.viewQueries;\n /**\n * \\@internal\n * @type {?}\n */\n ProviderViewContext.prototype.viewProviders;\n /** @type {?} */\n ProviderViewContext.prototype.errors;\n /** @type {?} */\n ProviderViewContext.prototype.reflector;\n /** @type {?} */\n ProviderViewContext.prototype.component;\n}\nexport class ProviderElementContext {\n /**\n * @param {?} viewContext\n * @param {?} _parent\n * @param {?} _isViewRoot\n * @param {?} _directiveAsts\n * @param {?} attrs\n * @param {?} refs\n * @param {?} isTemplate\n * @param {?} contentQueryStartId\n * @param {?} _sourceSpan\n */\n constructor(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {\n this.viewContext = viewContext;\n this._parent = _parent;\n this._isViewRoot = _isViewRoot;\n this._directiveAsts = _directiveAsts;\n this._sourceSpan = _sourceSpan;\n this._transformedProviders = new Map();\n this._seenProviders = new Map();\n this._hasViewContainer = false;\n this._queriedTokens = new Map();\n this._attrs = {};\n attrs.forEach((attrAst) => this._attrs[attrAst.name] = attrAst.value);\n const directivesMeta = _directiveAsts.map(directiveAst => directiveAst.directive);\n this._allProviders =\n _resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);\n this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);\n Array.from(this._allProviders.values()).forEach((provider) => {\n this._addQueryReadsTo(provider.token, provider.token, this._queriedTokens);\n });\n if (isTemplate) {\n const templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers.TemplateRef);\n this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);\n }\n refs.forEach((refAst) => {\n let defaultQueryValue = refAst.value ||\n createTokenForExternalReference(this.viewContext.reflector, Identifiers.ElementRef);\n this._addQueryReadsTo({ value: refAst.name }, defaultQueryValue, this._queriedTokens);\n });\n if (this._queriedTokens.get(this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef))) {\n this._hasViewContainer = true;\n }\n // create the providers that we know are eager first\n Array.from(this._allProviders.values()).forEach((provider) => {\n const eager = provider.eager || this._queriedTokens.get(tokenReference(provider.token));\n if (eager) {\n this._getOrCreateLocalProvider(provider.providerType, provider.token, true);\n }\n });\n }\n /**\n * @return {?}\n */\n afterElement() {\n // collect lazy providers\n Array.from(this._allProviders.values()).forEach((provider) => {\n this._getOrCreateLocalProvider(provider.providerType, provider.token, false);\n });\n }\n /**\n * @return {?}\n */\n get transformProviders() {\n // Note: Maps keep their insertion order.\n const /** @type {?} */ lazyProviders = [];\n const /** @type {?} */ eagerProviders = [];\n this._transformedProviders.forEach(provider => {\n if (provider.eager) {\n eagerProviders.push(provider);\n }\n else {\n lazyProviders.push(provider);\n }\n });\n return lazyProviders.concat(eagerProviders);\n }\n /**\n * @return {?}\n */\n get transformedDirectiveAsts() {\n const /** @type {?} */ sortedProviderTypes = this.transformProviders.map(provider => provider.token.identifier);\n const /** @type {?} */ sortedDirectives = this._directiveAsts.slice();\n sortedDirectives.sort((dir1, dir2) => sortedProviderTypes.indexOf(dir1.directive.type) -\n sortedProviderTypes.indexOf(dir2.directive.type));\n return sortedDirectives;\n }\n /**\n * @return {?}\n */\n get transformedHasViewContainer() { return this._hasViewContainer; }\n /**\n * @return {?}\n */\n get queryMatches() {\n const /** @type {?} */ allMatches = [];\n this._queriedTokens.forEach((matches) => { allMatches.push(...matches); });\n return allMatches;\n }\n /**\n * @param {?} token\n * @param {?} defaultValue\n * @param {?} queryReadTokens\n * @return {?}\n */\n _addQueryReadsTo(token, defaultValue, queryReadTokens) {\n this._getQueriesFor(token).forEach((query) => {\n const /** @type {?} */ queryValue = query.meta.read || defaultValue;\n const /** @type {?} */ tokenRef = tokenReference(queryValue);\n let /** @type {?} */ queryMatches = queryReadTokens.get(tokenRef);\n if (!queryMatches) {\n queryMatches = [];\n queryReadTokens.set(tokenRef, queryMatches);\n }\n queryMatches.push({ queryId: query.queryId, value: queryValue });\n });\n }\n /**\n * @param {?} token\n * @return {?}\n */\n _getQueriesFor(token) {\n const /** @type {?} */ result = [];\n let /** @type {?} */ currentEl = this;\n let /** @type {?} */ distance = 0;\n let /** @type {?} */ queries;\n while (currentEl !== null) {\n queries = currentEl._contentQueries.get(tokenReference(token));\n if (queries) {\n result.push(...queries.filter((query) => query.meta.descendants || distance <= 1));\n }\n if (currentEl._directiveAsts.length > 0) {\n distance++;\n }\n currentEl = currentEl._parent;\n }\n queries = this.viewContext.viewQueries.get(tokenReference(token));\n if (queries) {\n result.push(...queries);\n }\n return result;\n }\n /**\n * @param {?} requestingProviderType\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n _getOrCreateLocalProvider(requestingProviderType, token, eager) {\n const /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n if (!resolvedProvider || ((requestingProviderType === ProviderAstType.Directive ||\n requestingProviderType === ProviderAstType.PublicService) &&\n resolvedProvider.providerType === ProviderAstType.PrivateService) ||\n ((requestingProviderType === ProviderAstType.PrivateService ||\n requestingProviderType === ProviderAstType.PublicService) &&\n resolvedProvider.providerType === ProviderAstType.Builtin)) {\n return null;\n }\n let /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n if (transformedProviderAst) {\n return transformedProviderAst;\n }\n if (this._seenProviders.get(tokenReference(token)) != null) {\n this.viewContext.errors.push(new ProviderError(`Cannot instantiate cyclic dependency! ${tokenName(token)}`, this._sourceSpan));\n return null;\n }\n this._seenProviders.set(tokenReference(token), true);\n const /** @type {?} */ transformedProviders = resolvedProvider.providers.map((provider) => {\n let /** @type {?} */ transformedUseValue = provider.useValue;\n let /** @type {?} */ transformedUseExisting = ((provider.useExisting));\n let /** @type {?} */ transformedDeps = ((undefined));\n if (provider.useExisting != null) {\n const /** @type {?} */ existingDiDep = ((this._getDependency(resolvedProvider.providerType, { token: provider.useExisting }, eager)));\n if (existingDiDep.token != null) {\n transformedUseExisting = existingDiDep.token;\n }\n else {\n transformedUseExisting = ((null));\n transformedUseValue = existingDiDep.value;\n }\n }\n else if (provider.useFactory) {\n const /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n transformedDeps =\n deps.map((dep) => ((this._getDependency(resolvedProvider.providerType, dep, eager))));\n }\n else if (provider.useClass) {\n const /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n transformedDeps =\n deps.map((dep) => ((this._getDependency(resolvedProvider.providerType, dep, eager))));\n }\n return _transformProvider(provider, {\n useExisting: transformedUseExisting,\n useValue: transformedUseValue,\n deps: transformedDeps\n });\n });\n transformedProviderAst =\n _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n return transformedProviderAst;\n }\n /**\n * @param {?} requestingProviderType\n * @param {?} dep\n * @param {?=} eager\n * @return {?}\n */\n _getLocalDependency(requestingProviderType, dep, eager = false) {\n if (dep.isAttribute) {\n const /** @type {?} */ attrValue = this._attrs[((dep.token)).value];\n return { isValue: true, value: attrValue == null ? null : attrValue };\n }\n if (dep.token != null) {\n // access builtints\n if ((requestingProviderType === ProviderAstType.Directive ||\n requestingProviderType === ProviderAstType.Component)) {\n if (tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.Renderer) ||\n tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.ElementRef) ||\n tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.ChangeDetectorRef) ||\n tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.TemplateRef)) {\n return dep;\n }\n if (tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.ViewContainerRef)) {\n this._hasViewContainer = true;\n }\n }\n // access the injector\n if (tokenReference(dep.token) ===\n this.viewContext.reflector.resolveExternalReference(Identifiers.Injector)) {\n return dep;\n }\n // access providers\n if (this._getOrCreateLocalProvider(requestingProviderType, dep.token, eager) != null) {\n return dep;\n }\n }\n return null;\n }\n /**\n * @param {?} requestingProviderType\n * @param {?} dep\n * @param {?=} eager\n * @return {?}\n */\n _getDependency(requestingProviderType, dep, eager = false) {\n let /** @type {?} */ currElement = this;\n let /** @type {?} */ currEager = eager;\n let /** @type {?} */ result = null;\n if (!dep.isSkipSelf) {\n result = this._getLocalDependency(requestingProviderType, dep, eager);\n }\n if (dep.isSelf) {\n if (!result && dep.isOptional) {\n result = { isValue: true, value: null };\n }\n }\n else {\n // check parent elements\n while (!result && currElement._parent) {\n const /** @type {?} */ prevElement = currElement;\n currElement = currElement._parent;\n if (prevElement._isViewRoot) {\n currEager = false;\n }\n result = currElement._getLocalDependency(ProviderAstType.PublicService, dep, currEager);\n }\n // check @Host restriction\n if (!result) {\n if (!dep.isHost || this.viewContext.component.isHost ||\n this.viewContext.component.type.reference === tokenReference(/** @type {?} */ ((dep.token))) ||\n this.viewContext.viewProviders.get(tokenReference(/** @type {?} */ ((dep.token)))) != null) {\n result = dep;\n }\n else {\n result = dep.isOptional ? result = { isValue: true, value: null } : null;\n }\n }\n }\n if (!result) {\n this.viewContext.errors.push(new ProviderError(`No provider for ${tokenName(/** @type {?} */ ((dep.token)))}`, this._sourceSpan));\n }\n return result;\n }\n}\nfunction ProviderElementContext_tsickle_Closure_declarations() {\n /** @type {?} */\n ProviderElementContext.prototype._contentQueries;\n /** @type {?} */\n ProviderElementContext.prototype._transformedProviders;\n /** @type {?} */\n ProviderElementContext.prototype._seenProviders;\n /** @type {?} */\n ProviderElementContext.prototype._allProviders;\n /** @type {?} */\n ProviderElementContext.prototype._attrs;\n /** @type {?} */\n ProviderElementContext.prototype._hasViewContainer;\n /** @type {?} */\n ProviderElementContext.prototype._queriedTokens;\n /** @type {?} */\n ProviderElementContext.prototype.viewContext;\n /** @type {?} */\n ProviderElementContext.prototype._parent;\n /** @type {?} */\n ProviderElementContext.prototype._isViewRoot;\n /** @type {?} */\n ProviderElementContext.prototype._directiveAsts;\n /** @type {?} */\n ProviderElementContext.prototype._sourceSpan;\n}\nexport class NgModuleProviderAnalyzer {\n /**\n * @param {?} reflector\n * @param {?} ngModule\n * @param {?} extraProviders\n * @param {?} sourceSpan\n */\n constructor(reflector, ngModule, extraProviders, sourceSpan) {\n this.reflector = reflector;\n this._transformedProviders = new Map();\n this._seenProviders = new Map();\n this._errors = [];\n this._allProviders = new Map();\n ngModule.transitiveModule.modules.forEach((ngModuleType) => {\n const ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };\n _resolveProviders([ngModuleProvider], ProviderAstType.PublicService, true, sourceSpan, this._errors, this._allProviders);\n });\n _resolveProviders(ngModule.transitiveModule.providers.map(entry => entry.provider).concat(extraProviders), ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders);\n }\n /**\n * @return {?}\n */\n parse() {\n Array.from(this._allProviders.values()).forEach((provider) => {\n this._getOrCreateLocalProvider(provider.token, provider.eager);\n });\n if (this._errors.length > 0) {\n const /** @type {?} */ errorString = this._errors.join('\\n');\n throw new Error(`Provider parse errors:\\n${errorString}`);\n }\n // Note: Maps keep their insertion order.\n const /** @type {?} */ lazyProviders = [];\n const /** @type {?} */ eagerProviders = [];\n this._transformedProviders.forEach(provider => {\n if (provider.eager) {\n eagerProviders.push(provider);\n }\n else {\n lazyProviders.push(provider);\n }\n });\n return lazyProviders.concat(eagerProviders);\n }\n /**\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n _getOrCreateLocalProvider(token, eager) {\n const /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n if (!resolvedProvider) {\n return null;\n }\n let /** @type {?} */ transformedProviderAst = this._transformedProviders.get(tokenReference(token));\n if (transformedProviderAst) {\n return transformedProviderAst;\n }\n if (this._seenProviders.get(tokenReference(token)) != null) {\n this._errors.push(new ProviderError(`Cannot instantiate cyclic dependency! ${tokenName(token)}`, resolvedProvider.sourceSpan));\n return null;\n }\n this._seenProviders.set(tokenReference(token), true);\n const /** @type {?} */ transformedProviders = resolvedProvider.providers.map((provider) => {\n let /** @type {?} */ transformedUseValue = provider.useValue;\n let /** @type {?} */ transformedUseExisting = ((provider.useExisting));\n let /** @type {?} */ transformedDeps = ((undefined));\n if (provider.useExisting != null) {\n const /** @type {?} */ existingDiDep = this._getDependency({ token: provider.useExisting }, eager, resolvedProvider.sourceSpan);\n if (existingDiDep.token != null) {\n transformedUseExisting = existingDiDep.token;\n }\n else {\n transformedUseExisting = ((null));\n transformedUseValue = existingDiDep.value;\n }\n }\n else if (provider.useFactory) {\n const /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n transformedDeps =\n deps.map((dep) => this._getDependency(dep, eager, resolvedProvider.sourceSpan));\n }\n else if (provider.useClass) {\n const /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n transformedDeps =\n deps.map((dep) => this._getDependency(dep, eager, resolvedProvider.sourceSpan));\n }\n return _transformProvider(provider, {\n useExisting: transformedUseExisting,\n useValue: transformedUseValue,\n deps: transformedDeps\n });\n });\n transformedProviderAst =\n _transformProviderAst(resolvedProvider, { eager: eager, providers: transformedProviders });\n this._transformedProviders.set(tokenReference(token), transformedProviderAst);\n return transformedProviderAst;\n }\n /**\n * @param {?} dep\n * @param {?=} eager\n * @param {?=} requestorSourceSpan\n * @return {?}\n */\n _getDependency(dep, eager = false, requestorSourceSpan) {\n let /** @type {?} */ foundLocal = false;\n if (!dep.isSkipSelf && dep.token != null) {\n // access the injector\n if (tokenReference(dep.token) ===\n this.reflector.resolveExternalReference(Identifiers.Injector) ||\n tokenReference(dep.token) ===\n this.reflector.resolveExternalReference(Identifiers.ComponentFactoryResolver)) {\n foundLocal = true;\n // access providers\n }\n else if (this._getOrCreateLocalProvider(dep.token, eager) != null) {\n foundLocal = true;\n }\n }\n let /** @type {?} */ result = dep;\n if (dep.isSelf && !foundLocal) {\n if (dep.isOptional) {\n result = { isValue: true, value: null };\n }\n else {\n this._errors.push(new ProviderError(`No provider for ${tokenName(/** @type {?} */ ((dep.token)))}`, requestorSourceSpan));\n }\n }\n return result;\n }\n}\nfunction NgModuleProviderAnalyzer_tsickle_Closure_declarations() {\n /** @type {?} */\n NgModuleProviderAnalyzer.prototype._transformedProviders;\n /** @type {?} */\n NgModuleProviderAnalyzer.prototype._seenProviders;\n /** @type {?} */\n NgModuleProviderAnalyzer.prototype._allProviders;\n /** @type {?} */\n NgModuleProviderAnalyzer.prototype._errors;\n /** @type {?} */\n NgModuleProviderAnalyzer.prototype.reflector;\n}\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProvider(provider, { useExisting, useValue, deps }) {\n return {\n token: provider.token,\n useClass: provider.useClass,\n useExisting: useExisting,\n useFactory: provider.useFactory,\n useValue: useValue,\n deps: deps,\n multi: provider.multi\n };\n}\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProviderAst(provider, { eager, providers }) {\n return new ProviderAst(provider.token, provider.multiProvider, provider.eager || eager, providers, provider.providerType, provider.lifecycleHooks, provider.sourceSpan);\n}\n/**\n * @param {?} directives\n * @param {?} sourceSpan\n * @param {?} targetErrors\n * @return {?}\n */\nfunction _resolveProvidersFromDirectives(directives, sourceSpan, targetErrors) {\n const /** @type {?} */ providersByToken = new Map();\n directives.forEach((directive) => {\n const /** @type {?} */ dirProvider = { token: { identifier: directive.type }, useClass: directive.type };\n _resolveProviders([dirProvider], directive.isComponent ? ProviderAstType.Component : ProviderAstType.Directive, true, sourceSpan, targetErrors, providersByToken);\n });\n // Note: directives need to be able to overwrite providers of a component!\n const /** @type {?} */ directivesWithComponentFirst = directives.filter(dir => dir.isComponent).concat(directives.filter(dir => !dir.isComponent));\n directivesWithComponentFirst.forEach((directive) => {\n _resolveProviders(directive.providers, ProviderAstType.PublicService, false, sourceSpan, targetErrors, providersByToken);\n _resolveProviders(directive.viewProviders, ProviderAstType.PrivateService, false, sourceSpan, targetErrors, providersByToken);\n });\n return providersByToken;\n}\n/**\n * @param {?} providers\n * @param {?} providerType\n * @param {?} eager\n * @param {?} sourceSpan\n * @param {?} targetErrors\n * @param {?} targetProvidersByToken\n * @return {?}\n */\nfunction _resolveProviders(providers, providerType, eager, sourceSpan, targetErrors, targetProvidersByToken) {\n providers.forEach((provider) => {\n let /** @type {?} */ resolvedProvider = targetProvidersByToken.get(tokenReference(provider.token));\n if (resolvedProvider != null && !!resolvedProvider.multiProvider !== !!provider.multi) {\n targetErrors.push(new ProviderError(`Mixing multi and non multi provider is not possible for token ${tokenName(resolvedProvider.token)}`, sourceSpan));\n }\n if (!resolvedProvider) {\n const /** @type {?} */ lifecycleHooks = provider.token.identifier &&\n ((provider.token.identifier)).lifecycleHooks ?\n ((provider.token.identifier)).lifecycleHooks :\n [];\n const /** @type {?} */ isUseValue = !(provider.useClass || provider.useExisting || provider.useFactory);\n resolvedProvider = new ProviderAst(provider.token, !!provider.multi, eager || isUseValue, [provider], providerType, lifecycleHooks, sourceSpan);\n targetProvidersByToken.set(tokenReference(provider.token), resolvedProvider);\n }\n else {\n if (!provider.multi) {\n resolvedProvider.providers.length = 0;\n }\n resolvedProvider.providers.push(provider);\n }\n });\n}\n/**\n * @param {?} component\n * @return {?}\n */\nfunction _getViewQueries(component) {\n // Note: queries start with id 1 so we can use the number in a Bloom filter!\n let /** @type {?} */ viewQueryId = 1;\n const /** @type {?} */ viewQueries = new Map();\n if (component.viewQueries) {\n component.viewQueries.forEach((query) => _addQueryToTokenMap(viewQueries, { meta: query, queryId: viewQueryId++ }));\n }\n return viewQueries;\n}\n/**\n * @param {?} contentQueryStartId\n * @param {?} directives\n * @return {?}\n */\nfunction _getContentQueries(contentQueryStartId, directives) {\n let /** @type {?} */ contentQueryId = contentQueryStartId;\n const /** @type {?} */ contentQueries = new Map();\n directives.forEach((directive, directiveIndex) => {\n if (directive.queries) {\n directive.queries.forEach((query) => _addQueryToTokenMap(contentQueries, { meta: query, queryId: contentQueryId++ }));\n }\n });\n return contentQueries;\n}\n/**\n * @param {?} map\n * @param {?} query\n * @return {?}\n */\nfunction _addQueryToTokenMap(map, query) {\n query.meta.selectors.forEach((token) => {\n let /** @type {?} */ entry = map.get(tokenReference(token));\n if (!entry) {\n entry = [];\n map.set(tokenReference(token), entry);\n }\n entry.push(query);\n });\n}\n//# sourceMappingURL=provider_analyzer.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @abstract\n */\nexport class ElementSchemaRegistry {\n /**\n * @abstract\n * @param {?} tagName\n * @param {?} propName\n * @param {?} schemaMetas\n * @return {?}\n */\n hasProperty(tagName, propName, schemaMetas) { }\n /**\n * @abstract\n * @param {?} tagName\n * @param {?} schemaMetas\n * @return {?}\n */\n hasElement(tagName, schemaMetas) { }\n /**\n * @abstract\n * @param {?} elementName\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\n securityContext(elementName, propName, isAttribute) { }\n /**\n * @abstract\n * @return {?}\n */\n allKnownElementNames() { }\n /**\n * @abstract\n * @param {?} propName\n * @return {?}\n */\n getMappedPropName(propName) { }\n /**\n * @abstract\n * @return {?}\n */\n getDefaultComponentElementName() { }\n /**\n * @abstract\n * @param {?} name\n * @return {?}\n */\n validateProperty(name) { }\n /**\n * @abstract\n * @param {?} name\n * @return {?}\n */\n validateAttribute(name) { }\n /**\n * @abstract\n * @param {?} propName\n * @return {?}\n */\n normalizeAnimationStyleProperty(propName) { }\n /**\n * @abstract\n * @param {?} camelCaseProp\n * @param {?} userProvidedProp\n * @param {?} val\n * @return {?}\n */\n normalizeAnimationStyleValue(camelCaseProp, userProvidedProp, val) { }\n}\n//# sourceMappingURL=element_schema_registry.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport class StyleWithImports {\n /**\n * @param {?} style\n * @param {?} styleUrls\n */\n constructor(style, styleUrls) {\n this.style = style;\n this.styleUrls = styleUrls;\n }\n}\nfunction StyleWithImports_tsickle_Closure_declarations() {\n /** @type {?} */\n StyleWithImports.prototype.style;\n /** @type {?} */\n StyleWithImports.prototype.styleUrls;\n}\n/**\n * @param {?} url\n * @return {?}\n */\nexport function isStyleUrlResolvable(url) {\n if (url == null || url.length === 0 || url[0] == '/')\n return false;\n const /** @type {?} */ schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);\n return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';\n}\n/**\n * Rewrites stylesheets by resolving and removing the \\@import urls that\n * are either relative or don't have a `package:` scheme\n * @param {?} resolver\n * @param {?} baseUrl\n * @param {?} cssText\n * @return {?}\n */\nexport function extractStyleUrls(resolver, baseUrl, cssText) {\n const /** @type {?} */ foundUrls = [];\n const /** @type {?} */ modifiedCssText = cssText.replace(CSS_COMMENT_REGEXP, '').replace(CSS_IMPORT_REGEXP, (...m) => {\n const /** @type {?} */ url = m[1] || m[2];\n if (!isStyleUrlResolvable(url)) {\n // Do not attempt to resolve non-package absolute URLs with URI scheme\n return m[0];\n }\n foundUrls.push(resolver.resolve(baseUrl, url));\n return '';\n });\n return new StyleWithImports(modifiedCssText, foundUrls);\n}\nconst /** @type {?} */ CSS_IMPORT_REGEXP = /@import\\s+(?:url\\()?\\s*(?:(?:['\"]([^'\"]*))|([^;\\)\\s]*))[^;]*;?/g;\nconst /** @type {?} */ CSS_COMMENT_REGEXP = /\\/\\*[\\s\\S]+?\\*\\//g;\nconst /** @type {?} */ URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;\n//# sourceMappingURL=style_url_resolver.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { SecurityContext } from '@angular/core';\nimport { EmptyExpr, RecursiveAstVisitor } from '../expression_parser/ast';\nimport { mergeNsAndName } from '../ml_parser/tags';\nimport { ParseError, ParseErrorLevel, ParseSourceSpan } from '../parse_util';\nimport { CssSelector } from '../selector';\nimport { splitAtColon, splitAtPeriod } from '../util';\nimport { BoundElementPropertyAst, BoundEventAst, PropertyBindingType, VariableAst } from './template_ast';\nconst /** @type {?} */ PROPERTY_PARTS_SEPARATOR = '.';\nconst /** @type {?} */ ATTRIBUTE_PREFIX = 'attr';\nconst /** @type {?} */ CLASS_PREFIX = 'class';\nconst /** @type {?} */ STYLE_PREFIX = 'style';\nconst /** @type {?} */ ANIMATE_PROP_PREFIX = 'animate-';\nexport let BoundPropertyType = {};\nBoundPropertyType.DEFAULT = 0;\nBoundPropertyType.LITERAL_ATTR = 1;\nBoundPropertyType.ANIMATION = 2;\nBoundPropertyType[BoundPropertyType.DEFAULT] = \"DEFAULT\";\nBoundPropertyType[BoundPropertyType.LITERAL_ATTR] = \"LITERAL_ATTR\";\nBoundPropertyType[BoundPropertyType.ANIMATION] = \"ANIMATION\";\n/**\n * Represents a parsed property.\n */\nexport class BoundProperty {\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} type\n * @param {?} sourceSpan\n */\n constructor(name, expression, type, sourceSpan) {\n this.name = name;\n this.expression = expression;\n this.type = type;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @return {?}\n */\n get isLiteral() { return this.type === BoundPropertyType.LITERAL_ATTR; }\n /**\n * @return {?}\n */\n get isAnimation() { return this.type === BoundPropertyType.ANIMATION; }\n}\nfunction BoundProperty_tsickle_Closure_declarations() {\n /** @type {?} */\n BoundProperty.prototype.name;\n /** @type {?} */\n BoundProperty.prototype.expression;\n /** @type {?} */\n BoundProperty.prototype.type;\n /** @type {?} */\n BoundProperty.prototype.sourceSpan;\n}\n/**\n * Parses bindings in templates and in the directive host area.\n */\nexport class BindingParser {\n /**\n * @param {?} _exprParser\n * @param {?} _interpolationConfig\n * @param {?} _schemaRegistry\n * @param {?} pipes\n * @param {?} _targetErrors\n */\n constructor(_exprParser, _interpolationConfig, _schemaRegistry, pipes, _targetErrors) {\n this._exprParser = _exprParser;\n this._interpolationConfig = _interpolationConfig;\n this._schemaRegistry = _schemaRegistry;\n this._targetErrors = _targetErrors;\n this.pipesByName = new Map();\n this._usedPipes = new Map();\n pipes.forEach(pipe => this.pipesByName.set(pipe.name, pipe));\n }\n /**\n * @return {?}\n */\n getUsedPipes() { return Array.from(this._usedPipes.values()); }\n /**\n * @param {?} dirMeta\n * @param {?} elementSelector\n * @param {?} sourceSpan\n * @return {?}\n */\n createDirectiveHostPropertyAsts(dirMeta, elementSelector, sourceSpan) {\n if (dirMeta.hostProperties) {\n const /** @type {?} */ boundProps = [];\n Object.keys(dirMeta.hostProperties).forEach(propName => {\n const /** @type {?} */ expression = dirMeta.hostProperties[propName];\n if (typeof expression === 'string') {\n this.parsePropertyBinding(propName, expression, true, sourceSpan, [], boundProps);\n }\n else {\n this._reportError(`Value of the host property binding \"${propName}\" needs to be a string representing an expression but got \"${expression}\" (${typeof expression})`, sourceSpan);\n }\n });\n return boundProps.map((prop) => this.createElementPropertyAst(elementSelector, prop));\n }\n return null;\n }\n /**\n * @param {?} dirMeta\n * @param {?} sourceSpan\n * @return {?}\n */\n createDirectiveHostEventAsts(dirMeta, sourceSpan) {\n if (dirMeta.hostListeners) {\n const /** @type {?} */ targetEventAsts = [];\n Object.keys(dirMeta.hostListeners).forEach(propName => {\n const /** @type {?} */ expression = dirMeta.hostListeners[propName];\n if (typeof expression === 'string') {\n this.parseEvent(propName, expression, sourceSpan, [], targetEventAsts);\n }\n else {\n this._reportError(`Value of the host listener \"${propName}\" needs to be a string representing an expression but got \"${expression}\" (${typeof expression})`, sourceSpan);\n }\n });\n return targetEventAsts;\n }\n return null;\n }\n /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n parseInterpolation(value, sourceSpan) {\n const /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n const /** @type {?} */ ast = ((this._exprParser.parseInterpolation(value, sourceInfo, this._interpolationConfig)));\n if (ast)\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n this._checkPipes(ast, sourceSpan);\n return ast;\n }\n catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n }\n /**\n * @param {?} prefixToken\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @param {?} targetVars\n * @return {?}\n */\n parseInlineTemplateBinding(prefixToken, value, sourceSpan, targetMatchableAttrs, targetProps, targetVars) {\n const /** @type {?} */ bindings = this._parseTemplateBindings(prefixToken, value, sourceSpan);\n for (let /** @type {?} */ i = 0; i < bindings.length; i++) {\n const /** @type {?} */ binding = bindings[i];\n if (binding.keyIsVar) {\n targetVars.push(new VariableAst(binding.key, binding.name, sourceSpan));\n }\n else if (binding.expression) {\n this._parsePropertyAst(binding.key, binding.expression, sourceSpan, targetMatchableAttrs, targetProps);\n }\n else {\n targetMatchableAttrs.push([binding.key, '']);\n this.parseLiteralAttr(binding.key, null, sourceSpan, targetMatchableAttrs, targetProps);\n }\n }\n }\n /**\n * @param {?} prefixToken\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n _parseTemplateBindings(prefixToken, value, sourceSpan) {\n const /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n const /** @type {?} */ bindingsResult = this._exprParser.parseTemplateBindings(prefixToken, value, sourceInfo);\n this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);\n bindingsResult.templateBindings.forEach((binding) => {\n if (binding.expression) {\n this._checkPipes(binding.expression, sourceSpan);\n }\n });\n bindingsResult.warnings.forEach((warning) => { this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING); });\n return bindingsResult.templateBindings;\n }\n catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return [];\n }\n }\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n parseLiteralAttr(name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n if (_isAnimationLabel(name)) {\n name = name.substring(1);\n if (value) {\n this._reportError(`Assigning animation triggers via @prop=\"exp\" attributes with an expression is invalid.` +\n ` Use property bindings (e.g. [@prop]=\"exp\") or use an attribute without a value (e.g. @prop) instead.`, sourceSpan, ParseErrorLevel.ERROR);\n }\n this._parseAnimation(name, value, sourceSpan, targetMatchableAttrs, targetProps);\n }\n else {\n targetProps.push(new BoundProperty(name, this._exprParser.wrapLiteralPrimitive(value, ''), BoundPropertyType.LITERAL_ATTR, sourceSpan));\n }\n }\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} isHost\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n parsePropertyBinding(name, expression, isHost, sourceSpan, targetMatchableAttrs, targetProps) {\n let /** @type {?} */ isAnimationProp = false;\n if (name.startsWith(ANIMATE_PROP_PREFIX)) {\n isAnimationProp = true;\n name = name.substring(ANIMATE_PROP_PREFIX.length);\n }\n else if (_isAnimationLabel(name)) {\n isAnimationProp = true;\n name = name.substring(1);\n }\n if (isAnimationProp) {\n this._parseAnimation(name, expression, sourceSpan, targetMatchableAttrs, targetProps);\n }\n else {\n this._parsePropertyAst(name, this._parseBinding(expression, isHost, sourceSpan), sourceSpan, targetMatchableAttrs, targetProps);\n }\n }\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n parsePropertyInterpolation(name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n const /** @type {?} */ expr = this.parseInterpolation(value, sourceSpan);\n if (expr) {\n this._parsePropertyAst(name, expr, sourceSpan, targetMatchableAttrs, targetProps);\n return true;\n }\n return false;\n }\n /**\n * @param {?} name\n * @param {?} ast\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n _parsePropertyAst(name, ast, sourceSpan, targetMatchableAttrs, targetProps) {\n targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);\n targetProps.push(new BoundProperty(name, ast, BoundPropertyType.DEFAULT, sourceSpan));\n }\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetProps\n * @return {?}\n */\n _parseAnimation(name, expression, sourceSpan, targetMatchableAttrs, targetProps) {\n // This will occur when a @trigger is not paired with an expression.\n // For animations it is valid to not have an expression since */void\n // states will be applied by angular when the element is attached/detached\n const /** @type {?} */ ast = this._parseBinding(expression || 'undefined', false, sourceSpan);\n targetMatchableAttrs.push([name, /** @type {?} */ ((ast.source))]);\n targetProps.push(new BoundProperty(name, ast, BoundPropertyType.ANIMATION, sourceSpan));\n }\n /**\n * @param {?} value\n * @param {?} isHostBinding\n * @param {?} sourceSpan\n * @return {?}\n */\n _parseBinding(value, isHostBinding, sourceSpan) {\n const /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n const /** @type {?} */ ast = isHostBinding ?\n this._exprParser.parseSimpleBinding(value, sourceInfo, this._interpolationConfig) :\n this._exprParser.parseBinding(value, sourceInfo, this._interpolationConfig);\n if (ast)\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n this._checkPipes(ast, sourceSpan);\n return ast;\n }\n catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n }\n /**\n * @param {?} elementSelector\n * @param {?} boundProp\n * @return {?}\n */\n createElementPropertyAst(elementSelector, boundProp) {\n if (boundProp.isAnimation) {\n return new BoundElementPropertyAst(boundProp.name, PropertyBindingType.Animation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan);\n }\n let /** @type {?} */ unit = null;\n let /** @type {?} */ bindingType = ((undefined));\n let /** @type {?} */ boundPropertyName = null;\n const /** @type {?} */ parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);\n let /** @type {?} */ securityContexts = ((undefined));\n // Check check for special cases (prefix style, attr, class)\n if (parts.length > 1) {\n if (parts[0] == ATTRIBUTE_PREFIX) {\n boundPropertyName = parts[1];\n this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);\n securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true);\n const /** @type {?} */ nsSeparatorIdx = boundPropertyName.indexOf(':');\n if (nsSeparatorIdx > -1) {\n const /** @type {?} */ ns = boundPropertyName.substring(0, nsSeparatorIdx);\n const /** @type {?} */ name = boundPropertyName.substring(nsSeparatorIdx + 1);\n boundPropertyName = mergeNsAndName(ns, name);\n }\n bindingType = PropertyBindingType.Attribute;\n }\n else if (parts[0] == CLASS_PREFIX) {\n boundPropertyName = parts[1];\n bindingType = PropertyBindingType.Class;\n securityContexts = [SecurityContext.NONE];\n }\n else if (parts[0] == STYLE_PREFIX) {\n unit = parts.length > 2 ? parts[2] : null;\n boundPropertyName = parts[1];\n bindingType = PropertyBindingType.Style;\n securityContexts = [SecurityContext.STYLE];\n }\n }\n // If not a special case, use the full property name\n if (boundPropertyName === null) {\n boundPropertyName = this._schemaRegistry.getMappedPropName(boundProp.name);\n securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, false);\n bindingType = PropertyBindingType.Property;\n this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, false);\n }\n return new BoundElementPropertyAst(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan);\n }\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetEvents\n * @return {?}\n */\n parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n if (_isAnimationLabel(name)) {\n name = name.substr(1);\n this._parseAnimationEvent(name, expression, sourceSpan, targetEvents);\n }\n else {\n this._parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents);\n }\n }\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetEvents\n * @return {?}\n */\n _parseAnimationEvent(name, expression, sourceSpan, targetEvents) {\n const /** @type {?} */ matches = splitAtPeriod(name, [name, '']);\n const /** @type {?} */ eventName = matches[0];\n const /** @type {?} */ phase = matches[1].toLowerCase();\n if (phase) {\n switch (phase) {\n case 'start':\n case 'done':\n const /** @type {?} */ ast = this._parseAction(expression, sourceSpan);\n targetEvents.push(new BoundEventAst(eventName, null, phase, ast, sourceSpan));\n break;\n default:\n this._reportError(`The provided animation output phase value \"${phase}\" for \"@${eventName}\" is not supported (use start or done)`, sourceSpan);\n break;\n }\n }\n else {\n this._reportError(`The animation trigger output event (@${eventName}) is missing its phase value name (start or done are currently supported)`, sourceSpan);\n }\n }\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} targetMatchableAttrs\n * @param {?} targetEvents\n * @return {?}\n */\n _parseEvent(name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n // long format: 'target: eventName'\n const [target, eventName] = splitAtColon(name, [/** @type {?} */ ((null)), name]);\n const /** @type {?} */ ast = this._parseAction(expression, sourceSpan);\n targetMatchableAttrs.push([/** @type {?} */ ((name)), /** @type {?} */ ((ast.source))]);\n targetEvents.push(new BoundEventAst(eventName, target, null, ast, sourceSpan));\n // Don't detect directives for event names for now,\n // so don't add the event name to the matchableAttrs\n }\n /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n _parseAction(value, sourceSpan) {\n const /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n const /** @type {?} */ ast = this._exprParser.parseAction(value, sourceInfo, this._interpolationConfig);\n if (ast) {\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n }\n if (!ast || ast.ast instanceof EmptyExpr) {\n this._reportError(`Empty expressions are not allowed`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n this._checkPipes(ast, sourceSpan);\n return ast;\n }\n catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo);\n }\n }\n /**\n * @param {?} message\n * @param {?} sourceSpan\n * @param {?=} level\n * @return {?}\n */\n _reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {\n this._targetErrors.push(new ParseError(sourceSpan, message, level));\n }\n /**\n * @param {?} errors\n * @param {?} sourceSpan\n * @return {?}\n */\n _reportExpressionParserErrors(errors, sourceSpan) {\n for (const /** @type {?} */ error of errors) {\n this._reportError(error.message, sourceSpan);\n }\n }\n /**\n * @param {?} ast\n * @param {?} sourceSpan\n * @return {?}\n */\n _checkPipes(ast, sourceSpan) {\n if (ast) {\n const /** @type {?} */ collector = new PipeCollector();\n ast.visit(collector);\n collector.pipes.forEach((ast, pipeName) => {\n const /** @type {?} */ pipeMeta = this.pipesByName.get(pipeName);\n if (!pipeMeta) {\n this._reportError(`The pipe '${pipeName}' could not be found`, new ParseSourceSpan(sourceSpan.start.moveBy(ast.span.start), sourceSpan.start.moveBy(ast.span.end)));\n }\n else {\n this._usedPipes.set(pipeName, pipeMeta);\n }\n });\n }\n }\n /**\n * @param {?} propName the name of the property / attribute\n * @param {?} sourceSpan\n * @param {?} isAttr true when binding to an attribute\n * @return {?}\n */\n _validatePropertyOrAttributeName(propName, sourceSpan, isAttr) {\n const /** @type {?} */ report = isAttr ? this._schemaRegistry.validateAttribute(propName) :\n this._schemaRegistry.validateProperty(propName);\n if (report.error) {\n this._reportError(/** @type {?} */ ((report.msg)), sourceSpan, ParseErrorLevel.ERROR);\n }\n }\n}\nfunction BindingParser_tsickle_Closure_declarations() {\n /** @type {?} */\n BindingParser.prototype.pipesByName;\n /** @type {?} */\n BindingParser.prototype._usedPipes;\n /** @type {?} */\n BindingParser.prototype._exprParser;\n /** @type {?} */\n BindingParser.prototype._interpolationConfig;\n /** @type {?} */\n BindingParser.prototype._schemaRegistry;\n /** @type {?} */\n BindingParser.prototype._targetErrors;\n}\nexport class PipeCollector extends RecursiveAstVisitor {\n constructor() {\n super(...arguments);\n this.pipes = new Map();\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n visitPipe(ast, context) {\n this.pipes.set(ast.name, ast);\n ast.exp.visit(this);\n this.visitAll(ast.args, context);\n return null;\n }\n}\nfunction PipeCollector_tsickle_Closure_declarations() {\n /** @type {?} */\n PipeCollector.prototype.pipes;\n}\n/**\n * @param {?} name\n * @return {?}\n */\nfunction _isAnimationLabel(name) {\n return name[0] == '@';\n}\n/**\n * @param {?} registry\n * @param {?} selector\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\nexport function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {\n const /** @type {?} */ ctxs = [];\n CssSelector.parse(selector).forEach((selector) => {\n const /** @type {?} */ elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();\n const /** @type {?} */ notElementNames = new Set(selector.notSelectors.filter(selector => selector.isElementSelector())\n .map((selector) => selector.element));\n const /** @type {?} */ possibleElementNames = elementNames.filter(elementName => !notElementNames.has(elementName));\n ctxs.push(...possibleElementNames.map(elementName => registry.securityContext(elementName, propName, isAttribute)));\n });\n return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();\n}\n//# sourceMappingURL=binding_parser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { isNgContent } from '../ml_parser/tags';\nconst /** @type {?} */ NG_CONTENT_SELECT_ATTR = 'select';\nconst /** @type {?} */ LINK_ELEMENT = 'link';\nconst /** @type {?} */ LINK_STYLE_REL_ATTR = 'rel';\nconst /** @type {?} */ LINK_STYLE_HREF_ATTR = 'href';\nconst /** @type {?} */ LINK_STYLE_REL_VALUE = 'stylesheet';\nconst /** @type {?} */ STYLE_ELEMENT = 'style';\nconst /** @type {?} */ SCRIPT_ELEMENT = 'script';\nconst /** @type {?} */ NG_NON_BINDABLE_ATTR = 'ngNonBindable';\nconst /** @type {?} */ NG_PROJECT_AS = 'ngProjectAs';\n/**\n * @param {?} ast\n * @return {?}\n */\nexport function preparseElement(ast) {\n let /** @type {?} */ selectAttr = ((null));\n let /** @type {?} */ hrefAttr = ((null));\n let /** @type {?} */ relAttr = ((null));\n let /** @type {?} */ nonBindable = false;\n let /** @type {?} */ projectAs = ((null));\n ast.attrs.forEach(attr => {\n const /** @type {?} */ lcAttrName = attr.name.toLowerCase();\n if (lcAttrName == NG_CONTENT_SELECT_ATTR) {\n selectAttr = attr.value;\n }\n else if (lcAttrName == LINK_STYLE_HREF_ATTR) {\n hrefAttr = attr.value;\n }\n else if (lcAttrName == LINK_STYLE_REL_ATTR) {\n relAttr = attr.value;\n }\n else if (attr.name == NG_NON_BINDABLE_ATTR) {\n nonBindable = true;\n }\n else if (attr.name == NG_PROJECT_AS) {\n if (attr.value.length > 0) {\n projectAs = attr.value;\n }\n }\n });\n selectAttr = normalizeNgContentSelect(selectAttr);\n const /** @type {?} */ nodeName = ast.name.toLowerCase();\n let /** @type {?} */ type = PreparsedElementType.OTHER;\n if (isNgContent(nodeName)) {\n type = PreparsedElementType.NG_CONTENT;\n }\n else if (nodeName == STYLE_ELEMENT) {\n type = PreparsedElementType.STYLE;\n }\n else if (nodeName == SCRIPT_ELEMENT) {\n type = PreparsedElementType.SCRIPT;\n }\n else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {\n type = PreparsedElementType.STYLESHEET;\n }\n return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);\n}\nexport let PreparsedElementType = {};\nPreparsedElementType.NG_CONTENT = 0;\nPreparsedElementType.STYLE = 1;\nPreparsedElementType.STYLESHEET = 2;\nPreparsedElementType.SCRIPT = 3;\nPreparsedElementType.OTHER = 4;\nPreparsedElementType[PreparsedElementType.NG_CONTENT] = \"NG_CONTENT\";\nPreparsedElementType[PreparsedElementType.STYLE] = \"STYLE\";\nPreparsedElementType[PreparsedElementType.STYLESHEET] = \"STYLESHEET\";\nPreparsedElementType[PreparsedElementType.SCRIPT] = \"SCRIPT\";\nPreparsedElementType[PreparsedElementType.OTHER] = \"OTHER\";\nexport class PreparsedElement {\n /**\n * @param {?} type\n * @param {?} selectAttr\n * @param {?} hrefAttr\n * @param {?} nonBindable\n * @param {?} projectAs\n */\n constructor(type, selectAttr, hrefAttr, nonBindable, projectAs) {\n this.type = type;\n this.selectAttr = selectAttr;\n this.hrefAttr = hrefAttr;\n this.nonBindable = nonBindable;\n this.projectAs = projectAs;\n }\n}\nfunction PreparsedElement_tsickle_Closure_declarations() {\n /** @type {?} */\n PreparsedElement.prototype.type;\n /** @type {?} */\n PreparsedElement.prototype.selectAttr;\n /** @type {?} */\n PreparsedElement.prototype.hrefAttr;\n /** @type {?} */\n PreparsedElement.prototype.nonBindable;\n /** @type {?} */\n PreparsedElement.prototype.projectAs;\n}\n/**\n * @param {?} selectAttr\n * @return {?}\n */\nfunction normalizeNgContentSelect(selectAttr) {\n if (selectAttr === null || selectAttr.length === 0) {\n return '*';\n }\n return selectAttr;\n}\n//# sourceMappingURL=template_preparser.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Inject, InjectionToken, Optional, ɵConsole as Console } from '@angular/core';\nimport { identifierName } from '../compile_metadata';\nimport { CompileReflector } from '../compile_reflector';\nimport { CompilerConfig } from '../config';\nimport { ASTWithSource, EmptyExpr } from '../expression_parser/ast';\nimport { Parser } from '../expression_parser/parser';\nimport { I18NHtmlParser } from '../i18n/i18n_html_parser';\nimport { Identifiers, createTokenForExternalReference, createTokenForReference } from '../identifiers';\nimport { CompilerInjectable } from '../injectable';\nimport * as html from '../ml_parser/ast';\nimport { ParseTreeResult } from '../ml_parser/html_parser';\nimport { removeWhitespaces, replaceNgsp } from '../ml_parser/html_whitespaces';\nimport { expandNodes } from '../ml_parser/icu_ast_expander';\nimport { InterpolationConfig } from '../ml_parser/interpolation_config';\nimport { isNgTemplate, splitNsName } from '../ml_parser/tags';\nimport { ParseError, ParseErrorLevel, ParseSourceSpan } from '../parse_util';\nimport { ProviderElementContext, ProviderViewContext } from '../provider_analyzer';\nimport { ElementSchemaRegistry } from '../schema/element_schema_registry';\nimport { CssSelector, SelectorMatcher } from '../selector';\nimport { isStyleUrlResolvable } from '../style_url_resolver';\nimport { syntaxError } from '../util';\nimport { BindingParser } from './binding_parser';\nimport { AttrAst, BoundDirectivePropertyAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, PropertyBindingType, ReferenceAst, TextAst, VariableAst, templateVisitAll } from './template_ast';\nimport { PreparsedElementType, preparseElement } from './template_preparser';\nconst /** @type {?} */ BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\\[\\(([^\\)]+)\\)\\]|\\[([^\\]]+)\\]|\\(([^\\)]+)\\))$/;\n// Group 1 = \"bind-\"\nconst /** @type {?} */ KW_BIND_IDX = 1;\n// Group 2 = \"let-\"\nconst /** @type {?} */ KW_LET_IDX = 2;\n// Group 3 = \"ref-/#\"\nconst /** @type {?} */ KW_REF_IDX = 3;\n// Group 4 = \"on-\"\nconst /** @type {?} */ KW_ON_IDX = 4;\n// Group 5 = \"bindon-\"\nconst /** @type {?} */ KW_BINDON_IDX = 5;\n// Group 6 = \"@\"\nconst /** @type {?} */ KW_AT_IDX = 6;\n// Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\nconst /** @type {?} */ IDENT_KW_IDX = 7;\n// Group 8 = identifier inside [()]\nconst /** @type {?} */ IDENT_BANANA_BOX_IDX = 8;\n// Group 9 = identifier inside []\nconst /** @type {?} */ IDENT_PROPERTY_IDX = 9;\n// Group 10 = identifier inside ()\nconst /** @type {?} */ IDENT_EVENT_IDX = 10;\n// deprecated in 4.x\nconst /** @type {?} */ TEMPLATE_ELEMENT = 'template';\n// deprecated in 4.x\nconst /** @type {?} */ TEMPLATE_ATTR = 'template';\nconst /** @type {?} */ TEMPLATE_ATTR_PREFIX = '*';\nconst /** @type {?} */ CLASS_ATTR = 'class';\nconst /** @type {?} */ TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];\nconst /** @type {?} */ TEMPLATE_ELEMENT_DEPRECATION_WARNING = 'The