{"version":3,"file":"compiler.umd.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../@angular/compiler.es5.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}","import * as tslib_1 from \"tslib\";\n/**\n * @license Angular v4.4.6\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\nimport { ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactoryResolver, ComponentRef, ContentChild, ContentChildren, Directive, ElementRef, Host, HostBinding, HostListener, Inject, Injectable, InjectionToken, Injector, Input, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory, NgModuleRef, Optional, Output, PACKAGE_ROOT_URL, Pipe, Query, QueryList, ReflectiveInjector, Renderer, SecurityContext, Self, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Type, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation, animate, createPlatformFactory, group, isDevMode, keyframes, platformCore, resolveForwardRef, sequence, state, style, transition, trigger, ɵCodegenComponentFactoryResolver, ɵConsole, ɵEMPTY_ARRAY, ɵEMPTY_MAP, ɵERROR_COMPONENT_TYPE, ɵReflectionCapabilities, ɵand, ɵccf, ɵcmf, ɵcrt, ɵdid, ɵeld, ɵelementEventFullName, ɵgetComponentViewDefinitionFactory, ɵinlineInterpolate, ɵinterpolate, ɵisPromise, ɵmod, ɵmpd, ɵncd, ɵnov, ɵpad, ɵpid, ɵpod, ɵppd, ɵprd, ɵqud, ɵregisterModuleFactory, ɵstringify, ɵted, ɵunv, ɵvid } from '@angular/core';\n/**\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 */\n/**\n * \\@stable\n */\nvar VERSION = new Version('4.4.6');\n/**\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 */\nvar TextAst = (function () {\n /**\n * @param {?} value\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n function TextAst(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 TextAst.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };\n return TextAst;\n}());\n/**\n * A bound expression within the text of a template.\n */\nvar BoundTextAst = (function () {\n /**\n * @param {?} value\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n function BoundTextAst(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 BoundTextAst.prototype.visit = function (visitor, context) {\n return visitor.visitBoundText(this, context);\n };\n return BoundTextAst;\n}());\n/**\n * A plain attribute on an element.\n */\nvar AttrAst = (function () {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n */\n function AttrAst(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 AttrAst.prototype.visit = function (visitor, context) { return visitor.visitAttr(this, context); };\n return AttrAst;\n}());\n/**\n * A binding for an element property (e.g. `[property]=\"expression\"`) or an animation trigger (e.g.\n * `[\\@trigger]=\"stateExp\"`)\n */\nvar BoundElementPropertyAst = (function () {\n /**\n * @param {?} name\n * @param {?} type\n * @param {?} securityContext\n * @param {?} value\n * @param {?} unit\n * @param {?} sourceSpan\n */\n function BoundElementPropertyAst(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 BoundElementPropertyAst.prototype.visit = function (visitor, context) {\n return visitor.visitElementProperty(this, context);\n };\n Object.defineProperty(BoundElementPropertyAst.prototype, \"isAnimation\", {\n /**\n * @return {?}\n */\n get: function () { return this.type === PropertyBindingType.Animation; },\n enumerable: true,\n configurable: true\n });\n return BoundElementPropertyAst;\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 */\nvar BoundEventAst = (function () {\n /**\n * @param {?} name\n * @param {?} target\n * @param {?} phase\n * @param {?} handler\n * @param {?} sourceSpan\n */\n function BoundEventAst(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 BoundEventAst.calcFullName = function (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 BoundEventAst.prototype.visit = function (visitor, context) {\n return visitor.visitEvent(this, context);\n };\n Object.defineProperty(BoundEventAst.prototype, \"fullName\", {\n /**\n * @return {?}\n */\n get: function () { return BoundEventAst.calcFullName(this.name, this.target, this.phase); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BoundEventAst.prototype, \"isAnimation\", {\n /**\n * @return {?}\n */\n get: function () { return !!this.phase; },\n enumerable: true,\n configurable: true\n });\n return BoundEventAst;\n}());\n/**\n * A reference declaration on an element (e.g. `let someName=\"expression\"`).\n */\nvar ReferenceAst = (function () {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n */\n function ReferenceAst(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 ReferenceAst.prototype.visit = function (visitor, context) {\n return visitor.visitReference(this, context);\n };\n return ReferenceAst;\n}());\n/**\n * A variable declaration on a (e.g. `var-someName=\"someLocalName\"`).\n */\nvar VariableAst = (function () {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n */\n function VariableAst(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 VariableAst.prototype.visit = function (visitor, context) {\n return visitor.visitVariable(this, context);\n };\n return VariableAst;\n}());\n/**\n * An element declaration in a template.\n */\nvar ElementAst = (function () {\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 function ElementAst(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 ElementAst.prototype.visit = function (visitor, context) {\n return visitor.visitElement(this, context);\n };\n return ElementAst;\n}());\n/**\n * A `` element included in an Angular template.\n */\nvar EmbeddedTemplateAst = (function () {\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 function EmbeddedTemplateAst(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 EmbeddedTemplateAst.prototype.visit = function (visitor, context) {\n return visitor.visitEmbeddedTemplate(this, context);\n };\n return EmbeddedTemplateAst;\n}());\n/**\n * A directive property with a bound value (e.g. `*ngIf=\"condition\").\n */\nvar BoundDirectivePropertyAst = (function () {\n /**\n * @param {?} directiveName\n * @param {?} templateName\n * @param {?} value\n * @param {?} sourceSpan\n */\n function BoundDirectivePropertyAst(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 BoundDirectivePropertyAst.prototype.visit = function (visitor, context) {\n return visitor.visitDirectiveProperty(this, context);\n };\n return BoundDirectivePropertyAst;\n}());\n/**\n * A directive declared on an element.\n */\nvar DirectiveAst = (function () {\n /**\n * @param {?} directive\n * @param {?} inputs\n * @param {?} hostProperties\n * @param {?} hostEvents\n * @param {?} contentQueryStartId\n * @param {?} sourceSpan\n */\n function DirectiveAst(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 DirectiveAst.prototype.visit = function (visitor, context) {\n return visitor.visitDirective(this, context);\n };\n return DirectiveAst;\n}());\n/**\n * A provider declared on an element\n */\nvar ProviderAst = (function () {\n /**\n * @param {?} token\n * @param {?} multiProvider\n * @param {?} eager\n * @param {?} providers\n * @param {?} providerType\n * @param {?} lifecycleHooks\n * @param {?} sourceSpan\n */\n function ProviderAst(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 ProviderAst.prototype.visit = function (visitor, context) {\n // No visit method in the visitor for now...\n return null;\n };\n return ProviderAst;\n}());\nvar 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 */\nvar NgContentAst = (function () {\n /**\n * @param {?} index\n * @param {?} ngContentIndex\n * @param {?} sourceSpan\n */\n function NgContentAst(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 NgContentAst.prototype.visit = function (visitor, context) {\n return visitor.visitNgContent(this, context);\n };\n return NgContentAst;\n}());\nvar 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 */\nvar NullTemplateVisitor = (function () {\n function NullTemplateVisitor() {\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitNgContent = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitEmbeddedTemplate = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitElement = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitReference = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitVariable = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitEvent = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitElementProperty = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitAttr = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitBoundText = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitText = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitDirective = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullTemplateVisitor.prototype.visitDirectiveProperty = function (ast, context) { };\n return NullTemplateVisitor;\n}());\n/**\n * Base class that can be used to build a visitor that visits each node\n * in an template ast recursively.\n */\nvar RecursiveTemplateAstVisitor = (function (_super) {\n tslib_1.__extends(RecursiveTemplateAstVisitor, _super);\n function RecursiveTemplateAstVisitor() {\n return _super.call(this) || this;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveTemplateAstVisitor.prototype.visitEmbeddedTemplate = function (ast, context) {\n return this.visitChildren(context, function (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 RecursiveTemplateAstVisitor.prototype.visitElement = function (ast, context) {\n return this.visitChildren(context, function (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 RecursiveTemplateAstVisitor.prototype.visitDirective = function (ast, context) {\n return this.visitChildren(context, function (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 RecursiveTemplateAstVisitor.prototype.visitChildren = function (context, cb) {\n var /** @type {?} */ results = [];\n var /** @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 return RecursiveTemplateAstVisitor;\n}(NullTemplateVisitor));\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 */\nfunction templateVisitAll(visitor, asts, context) {\n if (context === void 0) { context = null; }\n var /** @type {?} */ result = [];\n var /** @type {?} */ visit = visitor.visit ?\n function (ast) { return ((visitor.visit))(ast, context) || ast.visit(visitor, context); } :\n function (ast) { return ast.visit(visitor, context); };\n asts.forEach(function (ast) {\n var /** @type {?} */ astResult = visit(ast);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\n/**\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 */\nvar StaticSymbol = (function () {\n /**\n * @param {?} filePath\n * @param {?} name\n * @param {?} members\n */\n function StaticSymbol(filePath, name, members) {\n this.filePath = filePath;\n this.name = name;\n this.members = members;\n }\n /**\n * @return {?}\n */\n StaticSymbol.prototype.assertNoMembers = function () {\n if (this.members.length) {\n throw new Error(\"Illegal state: symbol without members expected, but got \" + JSON.stringify(this) + \".\");\n }\n };\n return StaticSymbol;\n}());\n/**\n * A cache of static symbol used by the StaticReflector to return the same symbol for the\n * same symbol values.\n */\nvar StaticSymbolCache = (function () {\n function StaticSymbolCache() {\n this.cache = new Map();\n }\n /**\n * @param {?} declarationFile\n * @param {?} name\n * @param {?=} members\n * @return {?}\n */\n StaticSymbolCache.prototype.get = function (declarationFile, name, members) {\n members = members || [];\n var /** @type {?} */ memberSuffix = members.length ? \".\" + members.join('.') : '';\n var /** @type {?} */ key = \"\\\"\" + declarationFile + \"\\\".\" + name + memberSuffix;\n var /** @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 return StaticSymbolCache;\n}());\nvar 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 */\nfunction splitNsName(elementName) {\n if (elementName[0] != ':') {\n return [null, elementName];\n }\n var /** @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 */\nfunction isNgContainer(tagName) {\n return splitNsName(tagName)[1] === 'ng-container';\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction isNgContent(tagName) {\n return splitNsName(tagName)[1] === 'ng-content';\n}\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction isNgTemplate(tagName) {\n return splitNsName(tagName)[1] === 'ng-template';\n}\n/**\n * @param {?} fullName\n * @return {?}\n */\nfunction getNsPrefix(fullName) {\n return fullName === null ? null : splitNsName(fullName)[0];\n}\n/**\n * @param {?} prefix\n * @param {?} localName\n * @return {?}\n */\nfunction 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.\nvar 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\nvar NGSP_UNICODE = '\\uE500';\nNAMED_ENTITIES['ngsp'] = NGSP_UNICODE;\n/**\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 */\nvar HtmlTagDefinition = (function () {\n /**\n * @param {?=} __0\n */\n function HtmlTagDefinition(_a) {\n var _b = _a === void 0 ? {} : _a, closedByChildren = _b.closedByChildren, requiredParents = _b.requiredParents, implicitNamespacePrefix = _b.implicitNamespacePrefix, _c = _b.contentType, contentType = _c === void 0 ? TagContentType.PARSABLE_DATA : _c, _d = _b.closedByParent, closedByParent = _d === void 0 ? false : _d, _e = _b.isVoid, isVoid = _e === void 0 ? false : _e, _f = _b.ignoreFirstLf, ignoreFirstLf = _f === void 0 ? false : _f;\n var _this = this;\n this.closedByChildren = {};\n this.closedByParent = false;\n this.canSelfClose = false;\n if (closedByChildren && closedByChildren.length > 0) {\n closedByChildren.forEach(function (tagName) { return _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(function (tagName) { return _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 HtmlTagDefinition.prototype.requireExtraParent = function (currentParent) {\n if (!this.requiredParents) {\n return false;\n }\n if (!currentParent) {\n return true;\n }\n var /** @type {?} */ lcParent = currentParent.toLowerCase();\n var /** @type {?} */ isParentTemplate = lcParent === 'template' || currentParent === 'ng-template';\n return !isParentTemplate && this.requiredParents[lcParent] != true;\n };\n /**\n * @param {?} name\n * @return {?}\n */\n HtmlTagDefinition.prototype.isClosedByChild = function (name) {\n return this.isVoid || name.toLowerCase() in this.closedByChildren;\n };\n return HtmlTagDefinition;\n}());\n// see http://www.w3.org/TR/html51/syntax.html#optional-tags\n// This implementation does not fully conform to the HTML5 spec.\nvar 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};\nvar _DEFAULT_TAG_DEFINITION = new HtmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction getHtmlTagDefinition(tagName) {\n return TAG_DEFINITIONS[tagName.toLowerCase()] || _DEFAULT_TAG_DEFINITION;\n}\n/**\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 */\nvar _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 */\nvar CssSelector = (function () {\n function CssSelector() {\n this.element = null;\n this.classNames = [];\n this.attrs = [];\n this.notSelectors = [];\n }\n /**\n * @param {?} selector\n * @return {?}\n */\n CssSelector.parse = function (selector) {\n var /** @type {?} */ results = [];\n var /** @type {?} */ _addResult = function (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 var /** @type {?} */ cssSelector = new CssSelector();\n var /** @type {?} */ match;\n var /** @type {?} */ current = cssSelector;\n var /** @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 CssSelector.prototype.isElementSelector = function () {\n return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 &&\n this.notSelectors.length === 0;\n };\n /**\n * @return {?}\n */\n CssSelector.prototype.hasElementSelector = function () { return !!this.element; };\n /**\n * @param {?=} element\n * @return {?}\n */\n CssSelector.prototype.setElement = function (element) {\n if (element === void 0) { element = null; }\n this.element = element;\n };\n /**\n * Gets a template string for an element that matches the selector.\n * @return {?}\n */\n CssSelector.prototype.getMatchingElementTemplate = function () {\n var /** @type {?} */ tagName = this.element || 'div';\n var /** @type {?} */ classAttr = this.classNames.length > 0 ? \" class=\\\"\" + this.classNames.join(' ') + \"\\\"\" : '';\n var /** @type {?} */ attrs = '';\n for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n var /** @type {?} */ attrName = this.attrs[i];\n var /** @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 CssSelector.prototype.addAttribute = function (name, value) {\n if (value === void 0) { value = ''; }\n this.attrs.push(name, value && value.toLowerCase() || '');\n };\n /**\n * @param {?} name\n * @return {?}\n */\n CssSelector.prototype.addClassName = function (name) { this.classNames.push(name.toLowerCase()); };\n /**\n * @return {?}\n */\n CssSelector.prototype.toString = function () {\n var /** @type {?} */ res = this.element || '';\n if (this.classNames) {\n this.classNames.forEach(function (klass) { return res += \".\" + klass; });\n }\n if (this.attrs) {\n for (var /** @type {?} */ i = 0; i < this.attrs.length; i += 2) {\n var /** @type {?} */ name = this.attrs[i];\n var /** @type {?} */ value = this.attrs[i + 1];\n res += \"[\" + name + (value ? '=' + value : '') + \"]\";\n }\n }\n this.notSelectors.forEach(function (notSelector) { return res += \":not(\" + notSelector + \")\"; });\n return res;\n };\n return CssSelector;\n}());\n/**\n * Reads a list of CssSelectors and allows to calculate which ones\n * are contained in a given CssSelector.\n */\nvar SelectorMatcher = (function () {\n function SelectorMatcher() {\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 SelectorMatcher.createNotMatcher = function (notSelectors) {\n var /** @type {?} */ notMatcher = new SelectorMatcher();\n notMatcher.addSelectables(notSelectors, null);\n return notMatcher;\n };\n /**\n * @param {?} cssSelectors\n * @param {?=} callbackCtxt\n * @return {?}\n */\n SelectorMatcher.prototype.addSelectables = function (cssSelectors, callbackCtxt) {\n var /** @type {?} */ listContext = ((null));\n if (cssSelectors.length > 1) {\n listContext = new SelectorListContext(cssSelectors);\n this._listContexts.push(listContext);\n }\n for (var /** @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 SelectorMatcher.prototype._addSelectable = function (cssSelector, callbackCtxt, listContext) {\n var /** @type {?} */ matcher = this;\n var /** @type {?} */ element = cssSelector.element;\n var /** @type {?} */ classNames = cssSelector.classNames;\n var /** @type {?} */ attrs = cssSelector.attrs;\n var /** @type {?} */ selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n var /** @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 (var /** @type {?} */ i = 0; i < classNames.length; i++) {\n var /** @type {?} */ isTerminal = attrs.length === 0 && i === classNames.length - 1;\n var /** @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 (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n var /** @type {?} */ isTerminal = i === attrs.length - 2;\n var /** @type {?} */ name = attrs[i];\n var /** @type {?} */ value = attrs[i + 1];\n if (isTerminal) {\n var /** @type {?} */ terminalMap = matcher._attrValueMap;\n var /** @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 var /** @type {?} */ partialMap = matcher._attrValuePartialMap;\n var /** @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 SelectorMatcher.prototype._addTerminal = function (map, name, selectable) {\n var /** @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 SelectorMatcher.prototype._addPartial = function (map, name) {\n var /** @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 SelectorMatcher.prototype.match = function (cssSelector, matchedCallback) {\n var /** @type {?} */ result = false;\n var /** @type {?} */ element = ((cssSelector.element));\n var /** @type {?} */ classNames = cssSelector.classNames;\n var /** @type {?} */ attrs = cssSelector.attrs;\n for (var /** @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 (var /** @type {?} */ i = 0; i < classNames.length; i++) {\n var /** @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 (var /** @type {?} */ i = 0; i < attrs.length; i += 2) {\n var /** @type {?} */ name = attrs[i];\n var /** @type {?} */ value = attrs[i + 1];\n var /** @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 var /** @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 SelectorMatcher.prototype._matchTerminal = function (map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n var /** @type {?} */ selectables = map.get(name) || [];\n var /** @type {?} */ starSelectables = ((map.get('*')));\n if (starSelectables) {\n selectables = selectables.concat(starSelectables);\n }\n if (selectables.length === 0) {\n return false;\n }\n var /** @type {?} */ selectable;\n var /** @type {?} */ result = false;\n for (var /** @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 SelectorMatcher.prototype._matchPartial = function (map, name, cssSelector, matchedCallback) {\n if (!map || typeof name !== 'string') {\n return false;\n }\n var /** @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 return SelectorMatcher;\n}());\nvar SelectorListContext = (function () {\n /**\n * @param {?} selectors\n */\n function SelectorListContext(selectors) {\n this.selectors = selectors;\n this.alreadyMatched = false;\n }\n return SelectorListContext;\n}());\nvar SelectorContext = (function () {\n /**\n * @param {?} selector\n * @param {?} cbContext\n * @param {?} listContext\n */\n function SelectorContext(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 SelectorContext.prototype.finalize = function (cssSelector, callback) {\n var /** @type {?} */ result = true;\n if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n var /** @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 return SelectorContext;\n}());\n/**\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 */\nvar MODULE_SUFFIX = '';\nvar DASH_CASE_REGEXP = /-+([a-z0-9])/g;\n/**\n * @param {?} input\n * @return {?}\n */\n/**\n * @param {?} input\n * @return {?}\n */\nfunction dashCaseToCamelCase(input) {\n return input.replace(DASH_CASE_REGEXP, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n return m[1].toUpperCase();\n });\n}\n/**\n * @param {?} input\n * @param {?} defaultValues\n * @return {?}\n */\nfunction splitAtColon(input, defaultValues) {\n return _splitAt(input, ':', defaultValues);\n}\n/**\n * @param {?} input\n * @param {?} defaultValues\n * @return {?}\n */\nfunction 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 var /** @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 */\nfunction 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 */\nfunction isDefined(val) {\n return val !== null && val !== undefined;\n}\n/**\n * @template T\n * @param {?} val\n * @return {?}\n */\nfunction noUndefined(val) {\n return val === undefined ? ((null)) : val;\n}\nvar ValueTransformer = (function () {\n function ValueTransformer() {\n }\n /**\n * @param {?} arr\n * @param {?} context\n * @return {?}\n */\n ValueTransformer.prototype.visitArray = function (arr, context) {\n var _this = this;\n return arr.map(function (value) { return visitValue(value, _this, context); });\n };\n /**\n * @param {?} map\n * @param {?} context\n * @return {?}\n */\n ValueTransformer.prototype.visitStringMap = function (map, context) {\n var _this = this;\n var /** @type {?} */ result = {};\n Object.keys(map).forEach(function (key) { result[key] = visitValue(map[key], _this, context); });\n return result;\n };\n /**\n * @param {?} value\n * @param {?} context\n * @return {?}\n */\n ValueTransformer.prototype.visitPrimitive = function (value, context) { return value; };\n /**\n * @param {?} value\n * @param {?} context\n * @return {?}\n */\n ValueTransformer.prototype.visitOther = function (value, context) { return value; };\n return ValueTransformer;\n}());\nvar SyncAsync = {\n assertSync: function (value) {\n if (ɵisPromise(value)) {\n throw new Error(\"Illegal state: value cannot be a promise\");\n }\n return value;\n },\n then: function (value, cb) { return ɵisPromise(value) ? value.then(cb) : cb(value); },\n all: function (syncAsyncValues) {\n return syncAsyncValues.some(ɵisPromise) ? Promise.all(syncAsyncValues) : (syncAsyncValues);\n }\n};\n/**\n * @param {?} msg\n * @param {?=} parseErrors\n * @return {?}\n */\nfunction syntaxError(msg, parseErrors) {\n var /** @type {?} */ error = Error(msg);\n ((error))[ERROR_SYNTAX_ERROR] = true;\n if (parseErrors)\n ((error))[ERROR_PARSE_ERRORS] = parseErrors;\n return error;\n}\nvar ERROR_SYNTAX_ERROR = 'ngSyntaxError';\nvar ERROR_PARSE_ERRORS = 'ngParseErrors';\n/**\n * @param {?} error\n * @return {?}\n */\nfunction isSyntaxError(error) {\n return ((error))[ERROR_SYNTAX_ERROR];\n}\n/**\n * @param {?} error\n * @return {?}\n */\nfunction getParseErrors(error) {\n return ((error))[ERROR_PARSE_ERRORS] || [];\n}\n/**\n * @param {?} s\n * @return {?}\n */\nfunction escapeRegExp(s) {\n return s.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n}\nvar 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 */\nfunction utf8Encode(str) {\n var /** @type {?} */ encoded = '';\n for (var /** @type {?} */ index = 0; index < str.length; index++) {\n var /** @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 var /** @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/**\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// 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\"\nvar HOST_REG_EXP = /^(?:(?:\\[([^\\]]+)\\])|(?:\\(([^\\)]+)\\)))|(\\@[-\\w]+)$/;\n/**\n * @param {?} name\n * @return {?}\n */\nfunction _sanitizeIdentifier(name) {\n return name.replace(/\\W/g, '_');\n}\nvar _anonymousTypeIndex = 0;\n/**\n * @param {?} compileIdentifier\n * @return {?}\n */\nfunction identifierName(compileIdentifier) {\n if (!compileIdentifier || !compileIdentifier.reference) {\n return null;\n }\n var /** @type {?} */ ref = compileIdentifier.reference;\n if (ref instanceof StaticSymbol) {\n return ref.name;\n }\n if (ref['__anonymousType']) {\n return ref['__anonymousType'];\n }\n var /** @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 */\nfunction identifierModuleUrl(compileIdentifier) {\n var /** @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 */\nfunction viewClassName(compType, embeddedTemplateIndex) {\n return \"View_\" + identifierName({ reference: compType }) + \"_\" + embeddedTemplateIndex;\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nfunction rendererTypeName(compType) {\n return \"RenderType_\" + identifierName({ reference: compType });\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nfunction hostViewClassName(compType) {\n return \"HostView_\" + identifierName({ reference: compType });\n}\n/**\n * @param {?} compType\n * @return {?}\n */\nfunction componentFactoryName(compType) {\n return identifierName({ reference: compType }) + \"NgFactory\";\n}\nvar 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 */\nfunction tokenName(token) {\n return token.value != null ? _sanitizeIdentifier(token.value) : identifierName(token.identifier);\n}\n/**\n * @param {?} token\n * @return {?}\n */\nfunction 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 */\nvar CompileStylesheetMetadata = (function () {\n /**\n * @param {?=} __0\n */\n function CompileStylesheetMetadata(_a) {\n var _b = _a === void 0 ? {} : _a, moduleUrl = _b.moduleUrl, styles = _b.styles, styleUrls = _b.styleUrls;\n this.moduleUrl = moduleUrl || null;\n this.styles = _normalizeArray(styles);\n this.styleUrls = _normalizeArray(styleUrls);\n }\n return CompileStylesheetMetadata;\n}());\n/**\n * Metadata regarding compilation of a template.\n */\nvar CompileTemplateMetadata = (function () {\n /**\n * @param {?} __0\n */\n function CompileTemplateMetadata(_a) {\n var encapsulation = _a.encapsulation, template = _a.template, templateUrl = _a.templateUrl, styles = _a.styles, styleUrls = _a.styleUrls, externalStylesheets = _a.externalStylesheets, animations = _a.animations, ngContentSelectors = _a.ngContentSelectors, interpolation = _a.interpolation, isInline = _a.isInline, preserveWhitespaces = _a.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 CompileTemplateMetadata.prototype.toSummary = function () {\n return {\n ngContentSelectors: this.ngContentSelectors,\n encapsulation: this.encapsulation,\n };\n };\n return CompileTemplateMetadata;\n}());\n/**\n * Metadata regarding compilation of a directive.\n */\nvar CompileDirectiveMetadata = (function () {\n /**\n * @param {?} __0\n */\n function CompileDirectiveMetadata(_a) {\n var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, hostListeners = _a.hostListeners, hostProperties = _a.hostProperties, hostAttributes = _a.hostAttributes, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.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 * @param {?} __0\n * @return {?}\n */\n CompileDirectiveMetadata.create = function (_a) {\n var isHost = _a.isHost, type = _a.type, isComponent = _a.isComponent, selector = _a.selector, exportAs = _a.exportAs, changeDetection = _a.changeDetection, inputs = _a.inputs, outputs = _a.outputs, host = _a.host, providers = _a.providers, viewProviders = _a.viewProviders, queries = _a.queries, viewQueries = _a.viewQueries, entryComponents = _a.entryComponents, template = _a.template, componentViewType = _a.componentViewType, rendererType = _a.rendererType, componentFactory = _a.componentFactory;\n var /** @type {?} */ hostListeners = {};\n var /** @type {?} */ hostProperties = {};\n var /** @type {?} */ hostAttributes = {};\n if (host != null) {\n Object.keys(host).forEach(function (key) {\n var /** @type {?} */ value = host[key];\n var /** @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 var /** @type {?} */ inputsMap = {};\n if (inputs != null) {\n inputs.forEach(function (bindConfig) {\n // canonical syntax: `dirProp: elProp`\n // if there is no `:`, use dirProp = elProp\n var /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n inputsMap[parts[0]] = parts[1];\n });\n }\n var /** @type {?} */ outputsMap = {};\n if (outputs != null) {\n outputs.forEach(function (bindConfig) {\n // canonical syntax: `dirProp: elProp`\n // if there is no `:`, use dirProp = elProp\n var /** @type {?} */ parts = splitAtColon(bindConfig, [bindConfig, bindConfig]);\n outputsMap[parts[0]] = parts[1];\n });\n }\n return new CompileDirectiveMetadata({\n isHost: isHost,\n type: type,\n isComponent: !!isComponent, selector: selector, exportAs: exportAs, changeDetection: changeDetection,\n inputs: inputsMap,\n outputs: outputsMap,\n hostListeners: hostListeners,\n hostProperties: hostProperties,\n hostAttributes: hostAttributes,\n providers: providers,\n viewProviders: viewProviders,\n queries: queries,\n viewQueries: viewQueries,\n entryComponents: entryComponents,\n template: template,\n componentViewType: componentViewType,\n rendererType: rendererType,\n componentFactory: componentFactory,\n });\n };\n /**\n * @return {?}\n */\n CompileDirectiveMetadata.prototype.toSummary = function () {\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 return CompileDirectiveMetadata;\n}());\n/**\n * Construct {\\@link CompileDirectiveMetadata} from {\\@link ComponentTypeMetadata} and a selector.\n * @param {?} hostTypeReference\n * @param {?} compMeta\n * @param {?} hostViewType\n * @return {?}\n */\nfunction createHostComponentMeta(hostTypeReference, compMeta, hostViewType) {\n var /** @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}\nvar CompilePipeMetadata = (function () {\n /**\n * @param {?} __0\n */\n function CompilePipeMetadata(_a) {\n var type = _a.type, name = _a.name, pure = _a.pure;\n this.type = type;\n this.name = name;\n this.pure = !!pure;\n }\n /**\n * @return {?}\n */\n CompilePipeMetadata.prototype.toSummary = function () {\n return {\n summaryKind: CompileSummaryKind.Pipe,\n type: this.type,\n name: this.name,\n pure: this.pure\n };\n };\n return CompilePipeMetadata;\n}());\n/**\n * Metadata regarding compilation of a module.\n */\nvar CompileNgModuleMetadata = (function () {\n /**\n * @param {?} __0\n */\n function CompileNgModuleMetadata(_a) {\n var type = _a.type, providers = _a.providers, declaredDirectives = _a.declaredDirectives, exportedDirectives = _a.exportedDirectives, declaredPipes = _a.declaredPipes, exportedPipes = _a.exportedPipes, entryComponents = _a.entryComponents, bootstrapComponents = _a.bootstrapComponents, importedModules = _a.importedModules, exportedModules = _a.exportedModules, schemas = _a.schemas, transitiveModule = _a.transitiveModule, id = _a.id;\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 CompileNgModuleMetadata.prototype.toSummary = function () {\n var /** @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 return CompileNgModuleMetadata;\n}());\nvar TransitiveCompileNgModuleMetadata = (function () {\n function TransitiveCompileNgModuleMetadata() {\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 TransitiveCompileNgModuleMetadata.prototype.addProvider = function (provider, module) {\n this.providers.push({ provider: provider, module: module });\n };\n /**\n * @param {?} id\n * @return {?}\n */\n TransitiveCompileNgModuleMetadata.prototype.addDirective = function (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 TransitiveCompileNgModuleMetadata.prototype.addExportedDirective = function (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 TransitiveCompileNgModuleMetadata.prototype.addPipe = function (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 TransitiveCompileNgModuleMetadata.prototype.addExportedPipe = function (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 TransitiveCompileNgModuleMetadata.prototype.addModule = function (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 TransitiveCompileNgModuleMetadata.prototype.addEntryComponent = function (ec) {\n if (!this.entryComponentsSet.has(ec.componentType)) {\n this.entryComponentsSet.add(ec.componentType);\n this.entryComponents.push(ec);\n }\n };\n return TransitiveCompileNgModuleMetadata;\n}());\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction _normalizeArray(obj) {\n return obj || [];\n}\nvar ProviderMeta = (function () {\n /**\n * @param {?} token\n * @param {?} __1\n */\n function ProviderMeta(token, _a) {\n var useClass = _a.useClass, useValue = _a.useValue, useExisting = _a.useExisting, useFactory = _a.useFactory, deps = _a.deps, multi = _a.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 return ProviderMeta;\n}());\n/**\n * @template T\n * @param {?} list\n * @return {?}\n */\nfunction flatten(list) {\n return list.reduce(function (flat, item) {\n var /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;\n return ((flat)).concat(flatItem);\n }, []);\n}\n/**\n * @param {?} url\n * @return {?}\n */\nfunction 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 */\nfunction templateSourceUrl(ngModuleType, compMeta, templateMeta) {\n var /** @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 */\nfunction sharedStylesheetJitUrl(meta, id) {\n var /** @type {?} */ pathParts = ((meta.moduleUrl)).split(/\\/\\\\/g);\n var /** @type {?} */ baseName = pathParts[pathParts.length - 1];\n return sourceUrl(\"css/\" + id + baseName + \".ngstyle.js\");\n}\n/**\n * @param {?} moduleMeta\n * @return {?}\n */\nfunction ngModuleJitUrl(moduleMeta) {\n return sourceUrl(identifierName(moduleMeta.type) + \"/module.ngfactory.js\");\n}\n/**\n * @param {?} ngModuleType\n * @param {?} compMeta\n * @return {?}\n */\nfunction templateJitUrl(ngModuleType, compMeta) {\n return sourceUrl(identifierName(ngModuleType) + \"/\" + identifierName(compMeta.type) + \".ngfactory.js\");\n}\n/**\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 */\nvar CompileReflector = (function () {\n function CompileReflector() {\n }\n /**\n * @abstract\n * @param {?} typeOrFunc\n * @return {?}\n */\n CompileReflector.prototype.parameters = function (typeOrFunc) { };\n /**\n * @abstract\n * @param {?} typeOrFunc\n * @return {?}\n */\n CompileReflector.prototype.annotations = function (typeOrFunc) { };\n /**\n * @abstract\n * @param {?} typeOrFunc\n * @return {?}\n */\n CompileReflector.prototype.propMetadata = function (typeOrFunc) { };\n /**\n * @abstract\n * @param {?} type\n * @param {?} lcProperty\n * @return {?}\n */\n CompileReflector.prototype.hasLifecycleHook = function (type, lcProperty) { };\n /**\n * @abstract\n * @param {?} type\n * @param {?} cmpMetadata\n * @return {?}\n */\n CompileReflector.prototype.componentModuleUrl = function (type, cmpMetadata) { };\n /**\n * @abstract\n * @param {?} ref\n * @return {?}\n */\n CompileReflector.prototype.resolveExternalReference = function (ref) { };\n return CompileReflector;\n}());\n/**\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 */\nvar CompilerConfig = (function () {\n /**\n * @param {?=} __0\n */\n function CompilerConfig(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.defaultEncapsulation, defaultEncapsulation = _c === void 0 ? ViewEncapsulation.Emulated : _c, _d = _b.useJit, useJit = _d === void 0 ? true : _d, missingTranslation = _b.missingTranslation, enableLegacyTemplate = _b.enableLegacyTemplate, preserveWhitespaces = _b.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 return CompilerConfig;\n}());\n/**\n * @param {?} preserveWhitespacesOption\n * @param {?=} defaultSetting\n * @return {?}\n */\nfunction preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting) {\n if (defaultSetting === void 0) { defaultSetting = true; }\n return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;\n}\n/**\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 */\nvar ParserError = (function () {\n /**\n * @param {?} message\n * @param {?} input\n * @param {?} errLocation\n * @param {?=} ctxLocation\n */\n function ParserError(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 return ParserError;\n}());\nvar ParseSpan = (function () {\n /**\n * @param {?} start\n * @param {?} end\n */\n function ParseSpan(start, end) {\n this.start = start;\n this.end = end;\n }\n return ParseSpan;\n}());\nvar AST = (function () {\n /**\n * @param {?} span\n */\n function AST(span) {\n this.span = span;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n AST.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return null;\n };\n /**\n * @return {?}\n */\n AST.prototype.toString = function () { return 'AST'; };\n return AST;\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 */\nvar Quote = (function (_super) {\n tslib_1.__extends(Quote, _super);\n /**\n * @param {?} span\n * @param {?} prefix\n * @param {?} uninterpretedExpression\n * @param {?} location\n */\n function Quote(span, prefix, uninterpretedExpression, location) {\n var _this = _super.call(this, span) || this;\n _this.prefix = prefix;\n _this.uninterpretedExpression = uninterpretedExpression;\n _this.location = location;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Quote.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitQuote(this, context);\n };\n /**\n * @return {?}\n */\n Quote.prototype.toString = function () { return 'Quote'; };\n return Quote;\n}(AST));\nvar EmptyExpr = (function (_super) {\n tslib_1.__extends(EmptyExpr, _super);\n function EmptyExpr() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n EmptyExpr.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n // do nothing\n };\n return EmptyExpr;\n}(AST));\nvar ImplicitReceiver = (function (_super) {\n tslib_1.__extends(ImplicitReceiver, _super);\n function ImplicitReceiver() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n ImplicitReceiver.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitImplicitReceiver(this, context);\n };\n return ImplicitReceiver;\n}(AST));\n/**\n * Multiple expressions separated by a semicolon.\n */\nvar Chain = (function (_super) {\n tslib_1.__extends(Chain, _super);\n /**\n * @param {?} span\n * @param {?} expressions\n */\n function Chain(span, expressions) {\n var _this = _super.call(this, span) || this;\n _this.expressions = expressions;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Chain.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitChain(this, context);\n };\n return Chain;\n}(AST));\nvar Conditional = (function (_super) {\n tslib_1.__extends(Conditional, _super);\n /**\n * @param {?} span\n * @param {?} condition\n * @param {?} trueExp\n * @param {?} falseExp\n */\n function Conditional(span, condition, trueExp, falseExp) {\n var _this = _super.call(this, span) || this;\n _this.condition = condition;\n _this.trueExp = trueExp;\n _this.falseExp = falseExp;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Conditional.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitConditional(this, context);\n };\n return Conditional;\n}(AST));\nvar PropertyRead = (function (_super) {\n tslib_1.__extends(PropertyRead, _super);\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n */\n function PropertyRead(span, receiver, name) {\n var _this = _super.call(this, span) || this;\n _this.receiver = receiver;\n _this.name = name;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n PropertyRead.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitPropertyRead(this, context);\n };\n return PropertyRead;\n}(AST));\nvar PropertyWrite = (function (_super) {\n tslib_1.__extends(PropertyWrite, _super);\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n * @param {?} value\n */\n function PropertyWrite(span, receiver, name, value) {\n var _this = _super.call(this, span) || this;\n _this.receiver = receiver;\n _this.name = name;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n PropertyWrite.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitPropertyWrite(this, context);\n };\n return PropertyWrite;\n}(AST));\nvar SafePropertyRead = (function (_super) {\n tslib_1.__extends(SafePropertyRead, _super);\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n */\n function SafePropertyRead(span, receiver, name) {\n var _this = _super.call(this, span) || this;\n _this.receiver = receiver;\n _this.name = name;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n SafePropertyRead.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitSafePropertyRead(this, context);\n };\n return SafePropertyRead;\n}(AST));\nvar KeyedRead = (function (_super) {\n tslib_1.__extends(KeyedRead, _super);\n /**\n * @param {?} span\n * @param {?} obj\n * @param {?} key\n */\n function KeyedRead(span, obj, key) {\n var _this = _super.call(this, span) || this;\n _this.obj = obj;\n _this.key = key;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n KeyedRead.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitKeyedRead(this, context);\n };\n return KeyedRead;\n}(AST));\nvar KeyedWrite = (function (_super) {\n tslib_1.__extends(KeyedWrite, _super);\n /**\n * @param {?} span\n * @param {?} obj\n * @param {?} key\n * @param {?} value\n */\n function KeyedWrite(span, obj, key, value) {\n var _this = _super.call(this, span) || this;\n _this.obj = obj;\n _this.key = key;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n KeyedWrite.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitKeyedWrite(this, context);\n };\n return KeyedWrite;\n}(AST));\nvar BindingPipe = (function (_super) {\n tslib_1.__extends(BindingPipe, _super);\n /**\n * @param {?} span\n * @param {?} exp\n * @param {?} name\n * @param {?} args\n */\n function BindingPipe(span, exp, name, args) {\n var _this = _super.call(this, span) || this;\n _this.exp = exp;\n _this.name = name;\n _this.args = args;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n BindingPipe.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitPipe(this, context);\n };\n return BindingPipe;\n}(AST));\nvar LiteralPrimitive = (function (_super) {\n tslib_1.__extends(LiteralPrimitive, _super);\n /**\n * @param {?} span\n * @param {?} value\n */\n function LiteralPrimitive(span, value) {\n var _this = _super.call(this, span) || this;\n _this.value = value;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n LiteralPrimitive.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitLiteralPrimitive(this, context);\n };\n return LiteralPrimitive;\n}(AST));\nvar LiteralArray = (function (_super) {\n tslib_1.__extends(LiteralArray, _super);\n /**\n * @param {?} span\n * @param {?} expressions\n */\n function LiteralArray(span, expressions) {\n var _this = _super.call(this, span) || this;\n _this.expressions = expressions;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n LiteralArray.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitLiteralArray(this, context);\n };\n return LiteralArray;\n}(AST));\nvar LiteralMap = (function (_super) {\n tslib_1.__extends(LiteralMap, _super);\n /**\n * @param {?} span\n * @param {?} keys\n * @param {?} values\n */\n function LiteralMap(span, keys, values) {\n var _this = _super.call(this, span) || this;\n _this.keys = keys;\n _this.values = values;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n LiteralMap.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitLiteralMap(this, context);\n };\n return LiteralMap;\n}(AST));\nvar Interpolation = (function (_super) {\n tslib_1.__extends(Interpolation, _super);\n /**\n * @param {?} span\n * @param {?} strings\n * @param {?} expressions\n */\n function Interpolation(span, strings, expressions) {\n var _this = _super.call(this, span) || this;\n _this.strings = strings;\n _this.expressions = expressions;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Interpolation.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitInterpolation(this, context);\n };\n return Interpolation;\n}(AST));\nvar Binary = (function (_super) {\n tslib_1.__extends(Binary, _super);\n /**\n * @param {?} span\n * @param {?} operation\n * @param {?} left\n * @param {?} right\n */\n function Binary(span, operation, left, right) {\n var _this = _super.call(this, span) || this;\n _this.operation = operation;\n _this.left = left;\n _this.right = right;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Binary.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitBinary(this, context);\n };\n return Binary;\n}(AST));\nvar PrefixNot = (function (_super) {\n tslib_1.__extends(PrefixNot, _super);\n /**\n * @param {?} span\n * @param {?} expression\n */\n function PrefixNot(span, expression) {\n var _this = _super.call(this, span) || this;\n _this.expression = expression;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n PrefixNot.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitPrefixNot(this, context);\n };\n return PrefixNot;\n}(AST));\nvar NonNullAssert = (function (_super) {\n tslib_1.__extends(NonNullAssert, _super);\n /**\n * @param {?} span\n * @param {?} expression\n */\n function NonNullAssert(span, expression) {\n var _this = _super.call(this, span) || this;\n _this.expression = expression;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n NonNullAssert.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitNonNullAssert(this, context);\n };\n return NonNullAssert;\n}(AST));\nvar MethodCall = (function (_super) {\n tslib_1.__extends(MethodCall, _super);\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n * @param {?} args\n */\n function MethodCall(span, receiver, name, args) {\n var _this = _super.call(this, span) || this;\n _this.receiver = receiver;\n _this.name = name;\n _this.args = args;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n MethodCall.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitMethodCall(this, context);\n };\n return MethodCall;\n}(AST));\nvar SafeMethodCall = (function (_super) {\n tslib_1.__extends(SafeMethodCall, _super);\n /**\n * @param {?} span\n * @param {?} receiver\n * @param {?} name\n * @param {?} args\n */\n function SafeMethodCall(span, receiver, name, args) {\n var _this = _super.call(this, span) || this;\n _this.receiver = receiver;\n _this.name = name;\n _this.args = args;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n SafeMethodCall.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitSafeMethodCall(this, context);\n };\n return SafeMethodCall;\n}(AST));\nvar FunctionCall = (function (_super) {\n tslib_1.__extends(FunctionCall, _super);\n /**\n * @param {?} span\n * @param {?} target\n * @param {?} args\n */\n function FunctionCall(span, target, args) {\n var _this = _super.call(this, span) || this;\n _this.target = target;\n _this.args = args;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n FunctionCall.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return visitor.visitFunctionCall(this, context);\n };\n return FunctionCall;\n}(AST));\nvar ASTWithSource = (function (_super) {\n tslib_1.__extends(ASTWithSource, _super);\n /**\n * @param {?} ast\n * @param {?} source\n * @param {?} location\n * @param {?} errors\n */\n function ASTWithSource(ast, source, location, errors) {\n var _this = _super.call(this, new ParseSpan(0, source == null ? 0 : source.length)) || this;\n _this.ast = ast;\n _this.source = source;\n _this.location = location;\n _this.errors = errors;\n return _this;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n ASTWithSource.prototype.visit = function (visitor, context) {\n if (context === void 0) { context = null; }\n return this.ast.visit(visitor, context);\n };\n /**\n * @return {?}\n */\n ASTWithSource.prototype.toString = function () { return this.source + \" in \" + this.location; };\n return ASTWithSource;\n}(AST));\nvar TemplateBinding = (function () {\n /**\n * @param {?} span\n * @param {?} key\n * @param {?} keyIsVar\n * @param {?} name\n * @param {?} expression\n */\n function TemplateBinding(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 return TemplateBinding;\n}());\nvar NullAstVisitor = (function () {\n function NullAstVisitor() {\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitBinary = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitChain = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitConditional = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitFunctionCall = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitInterpolation = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitKeyedRead = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitKeyedWrite = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitLiteralArray = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitLiteralMap = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitMethodCall = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitPipe = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitPrefixNot = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitNonNullAssert = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitPropertyRead = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitPropertyWrite = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitQuote = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitSafeMethodCall = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n NullAstVisitor.prototype.visitSafePropertyRead = function (ast, context) { };\n return NullAstVisitor;\n}());\nvar RecursiveAstVisitor = (function () {\n function RecursiveAstVisitor() {\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitBinary = function (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 RecursiveAstVisitor.prototype.visitChain = function (ast, context) { return this.visitAll(ast.expressions, context); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitConditional = function (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 RecursiveAstVisitor.prototype.visitPipe = function (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 RecursiveAstVisitor.prototype.visitFunctionCall = function (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 RecursiveAstVisitor.prototype.visitImplicitReceiver = function (ast, context) { return null; };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitInterpolation = function (ast, context) {\n return this.visitAll(ast.expressions, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitKeyedRead = function (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 RecursiveAstVisitor.prototype.visitKeyedWrite = function (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 RecursiveAstVisitor.prototype.visitLiteralArray = function (ast, context) {\n return this.visitAll(ast.expressions, context);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitLiteralMap = function (ast, context) { return this.visitAll(ast.values, context); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitLiteralPrimitive = function (ast, context) { return null; };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitMethodCall = function (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 RecursiveAstVisitor.prototype.visitPrefixNot = function (ast, context) {\n ast.expression.visit(this);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitNonNullAssert = function (ast, context) {\n ast.expression.visit(this);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitPropertyRead = function (ast, context) {\n ast.receiver.visit(this);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitPropertyWrite = function (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 RecursiveAstVisitor.prototype.visitSafePropertyRead = function (ast, context) {\n ast.receiver.visit(this);\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitSafeMethodCall = function (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 RecursiveAstVisitor.prototype.visitAll = function (asts, context) {\n var _this = this;\n asts.forEach(function (ast) { return ast.visit(_this, context); });\n return null;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveAstVisitor.prototype.visitQuote = function (ast, context) { return null; };\n return RecursiveAstVisitor;\n}());\nvar AstTransformer = (function () {\n function AstTransformer() {\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitImplicitReceiver = function (ast, context) { return ast; };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitInterpolation = function (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 AstTransformer.prototype.visitLiteralPrimitive = function (ast, context) {\n return new LiteralPrimitive(ast.span, ast.value);\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitPropertyRead = function (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 AstTransformer.prototype.visitPropertyWrite = function (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 AstTransformer.prototype.visitSafePropertyRead = function (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 AstTransformer.prototype.visitMethodCall = function (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 AstTransformer.prototype.visitSafeMethodCall = function (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 AstTransformer.prototype.visitFunctionCall = function (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 AstTransformer.prototype.visitLiteralArray = function (ast, context) {\n return new LiteralArray(ast.span, this.visitAll(ast.expressions));\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitLiteralMap = function (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 AstTransformer.prototype.visitBinary = function (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 AstTransformer.prototype.visitPrefixNot = function (ast, context) {\n return new PrefixNot(ast.span, ast.expression.visit(this));\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitNonNullAssert = function (ast, context) {\n return new NonNullAssert(ast.span, ast.expression.visit(this));\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitConditional = function (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 AstTransformer.prototype.visitPipe = function (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 AstTransformer.prototype.visitKeyedRead = function (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 AstTransformer.prototype.visitKeyedWrite = function (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 AstTransformer.prototype.visitAll = function (asts) {\n var /** @type {?} */ res = new Array(asts.length);\n for (var /** @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 AstTransformer.prototype.visitChain = function (ast, context) {\n return new Chain(ast.span, this.visitAll(ast.expressions));\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AstTransformer.prototype.visitQuote = function (ast, context) {\n return new Quote(ast.span, ast.prefix, ast.uninterpretedExpression, ast.location);\n };\n return AstTransformer;\n}());\n/**\n * @param {?} ast\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\nfunction 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: function (ast) {\n visit(ast.left);\n visit(ast.right);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitChain: function (ast) { visitAll(ast.expressions); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitConditional: function (ast) {\n visit(ast.condition);\n visit(ast.trueExp);\n visit(ast.falseExp);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitFunctionCall: function (ast) {\n if (ast.target) {\n visit(ast.target);\n }\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitImplicitReceiver: function (ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitInterpolation: function (ast) { visitAll(ast.expressions); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitKeyedRead: function (ast) {\n visit(ast.obj);\n visit(ast.key);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitKeyedWrite: function (ast) {\n visit(ast.obj);\n visit(ast.key);\n visit(ast.obj);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitLiteralArray: function (ast) { visitAll(ast.expressions); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitLiteralMap: function (ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitLiteralPrimitive: function (ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitMethodCall: function (ast) {\n visit(ast.receiver);\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPipe: function (ast) {\n visit(ast.exp);\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPrefixNot: function (ast) { visit(ast.expression); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitNonNullAssert: function (ast) { visit(ast.expression); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPropertyRead: function (ast) { visit(ast.receiver); },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitPropertyWrite: function (ast) {\n visit(ast.receiver);\n visit(ast.value);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitQuote: function (ast) { },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitSafeMethodCall: function (ast) {\n visit(ast.receiver);\n visitAll(ast.args);\n },\n /**\n * @param {?} ast\n * @return {?}\n */\n visitSafePropertyRead: function (ast) { visit(ast.receiver); },\n });\n}\n/**\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 */\nvar $EOF = 0;\nvar $TAB = 9;\nvar $LF = 10;\nvar $VTAB = 11;\nvar $FF = 12;\nvar $CR = 13;\nvar $SPACE = 32;\nvar $BANG = 33;\nvar $DQ = 34;\nvar $HASH = 35;\nvar $$ = 36;\nvar $PERCENT = 37;\nvar $AMPERSAND = 38;\nvar $SQ = 39;\nvar $LPAREN = 40;\nvar $RPAREN = 41;\nvar $STAR = 42;\nvar $PLUS = 43;\nvar $COMMA = 44;\nvar $MINUS = 45;\nvar $PERIOD = 46;\nvar $SLASH = 47;\nvar $COLON = 58;\nvar $SEMICOLON = 59;\nvar $LT = 60;\nvar $EQ = 61;\nvar $GT = 62;\nvar $QUESTION = 63;\nvar $0 = 48;\nvar $9 = 57;\nvar $A = 65;\nvar $E = 69;\nvar $F = 70;\nvar $X = 88;\nvar $Z = 90;\nvar $LBRACKET = 91;\nvar $BACKSLASH = 92;\nvar $RBRACKET = 93;\nvar $CARET = 94;\nvar $_ = 95;\nvar $a = 97;\nvar $e = 101;\nvar $f = 102;\nvar $n = 110;\nvar $r = 114;\nvar $t = 116;\nvar $u = 117;\nvar $v = 118;\nvar $x = 120;\nvar $z = 122;\nvar $LBRACE = 123;\nvar $BAR = 124;\nvar $RBRACE = 125;\nvar $NBSP = 160;\nvar $BT = 96;\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isWhitespace(code) {\n return (code >= $TAB && code <= $SPACE) || (code == $NBSP);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isDigit(code) {\n return $0 <= code && code <= $9;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isAsciiLetter(code) {\n return code >= $a && code <= $z || code >= $A && code <= $Z;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isAsciiHexDigit(code) {\n return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code);\n}\n/**\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 */\nfunction CompilerInjectable() {\n return function (x) { return x; };\n}\n/**\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 * @param {?} identifier\n * @param {?} value\n * @return {?}\n */\nfunction 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 (var /** @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}\nvar INTERPOLATION_BLACKLIST_REGEXPS = [\n /^\\s*$/,\n /[<>]/,\n /^[{}]$/,\n /&(#|[a-z])/i,\n /^\\/\\//,\n];\n/**\n * @param {?} identifier\n * @param {?} value\n * @return {?}\n */\nfunction 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 var /** @type {?} */ start_1 = (value[0]);\n var /** @type {?} */ end_1 = (value[1]);\n // black list checking\n INTERPOLATION_BLACKLIST_REGEXPS.forEach(function (regexp) {\n if (regexp.test(start_1) || regexp.test(end_1)) {\n throw new Error(\"['\" + start_1 + \"', '\" + end_1 + \"'] contains unusable interpolation symbol.\");\n }\n });\n }\n}\n/**\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 */\nvar InterpolationConfig = (function () {\n /**\n * @param {?} start\n * @param {?} end\n */\n function InterpolationConfig(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * @param {?} markers\n * @return {?}\n */\n InterpolationConfig.fromArray = function (markers) {\n if (!markers) {\n return DEFAULT_INTERPOLATION_CONFIG;\n }\n assertInterpolationSymbols('interpolation', markers);\n return new InterpolationConfig(markers[0], markers[1]);\n };\n return InterpolationConfig;\n}());\nvar DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');\n/**\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 */\nvar 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\";\nvar KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];\nvar Lexer = (function () {\n function Lexer() {\n }\n /**\n * @param {?} text\n * @return {?}\n */\n Lexer.prototype.tokenize = function (text) {\n var /** @type {?} */ scanner = new _Scanner(text);\n var /** @type {?} */ tokens = [];\n var /** @type {?} */ token = scanner.scanToken();\n while (token != null) {\n tokens.push(token);\n token = scanner.scanToken();\n }\n return tokens;\n };\n return Lexer;\n}());\nLexer.decorators = [\n { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nLexer.ctorParameters = function () { return []; };\nvar Token = (function () {\n /**\n * @param {?} index\n * @param {?} type\n * @param {?} numValue\n * @param {?} strValue\n */\n function Token(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 Token.prototype.isCharacter = function (code) {\n return this.type == TokenType.Character && this.numValue == code;\n };\n /**\n * @return {?}\n */\n Token.prototype.isNumber = function () { return this.type == TokenType.Number; };\n /**\n * @return {?}\n */\n Token.prototype.isString = function () { return this.type == TokenType.String; };\n /**\n * @param {?} operater\n * @return {?}\n */\n Token.prototype.isOperator = function (operater) {\n return this.type == TokenType.Operator && this.strValue == operater;\n };\n /**\n * @return {?}\n */\n Token.prototype.isIdentifier = function () { return this.type == TokenType.Identifier; };\n /**\n * @return {?}\n */\n Token.prototype.isKeyword = function () { return this.type == TokenType.Keyword; };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordLet = function () { return this.type == TokenType.Keyword && this.strValue == 'let'; };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordAs = function () { return this.type == TokenType.Keyword && this.strValue == 'as'; };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordNull = function () { return this.type == TokenType.Keyword && this.strValue == 'null'; };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordUndefined = function () {\n return this.type == TokenType.Keyword && this.strValue == 'undefined';\n };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordTrue = function () { return this.type == TokenType.Keyword && this.strValue == 'true'; };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordFalse = function () { return this.type == TokenType.Keyword && this.strValue == 'false'; };\n /**\n * @return {?}\n */\n Token.prototype.isKeywordThis = function () { return this.type == TokenType.Keyword && this.strValue == 'this'; };\n /**\n * @return {?}\n */\n Token.prototype.isError = function () { return this.type == TokenType.Error; };\n /**\n * @return {?}\n */\n Token.prototype.toNumber = function () { return this.type == TokenType.Number ? this.numValue : -1; };\n /**\n * @return {?}\n */\n Token.prototype.toString = function () {\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 return Token;\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}\nvar EOF = new Token(-1, TokenType.Character, 0, '');\nvar _Scanner = (function () {\n /**\n * @param {?} input\n */\n function _Scanner(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 _Scanner.prototype.advance = function () {\n this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);\n };\n /**\n * @return {?}\n */\n _Scanner.prototype.scanToken = function () {\n var /** @type {?} */ input = this.input, /** @type {?} */ length = this.length;\n var /** @type {?} */ peek = this.peek, /** @type {?} */ index = this.index;\n // Skip whitespace.\n while (peek <= $SPACE) {\n if (++index >= length) {\n peek = $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 (isDigit(peek))\n return this.scanNumber(index);\n var /** @type {?} */ start = index;\n switch (peek) {\n case $PERIOD:\n this.advance();\n return isDigit(this.peek) ? this.scanNumber(start) :\n newCharacterToken(start, $PERIOD);\n case $LPAREN:\n case $RPAREN:\n case $LBRACE:\n case $RBRACE:\n case $LBRACKET:\n case $RBRACKET:\n case $COMMA:\n case $COLON:\n case $SEMICOLON:\n return this.scanCharacter(start, peek);\n case $SQ:\n case $DQ:\n return this.scanString();\n case $HASH:\n case $PLUS:\n case $MINUS:\n case $STAR:\n case $SLASH:\n case $PERCENT:\n case $CARET:\n return this.scanOperator(start, String.fromCharCode(peek));\n case $QUESTION:\n return this.scanComplexOperator(start, '?', $PERIOD, '.');\n case $LT:\n case $GT:\n return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');\n case $BANG:\n case $EQ:\n return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');\n case $AMPERSAND:\n return this.scanComplexOperator(start, '&', $AMPERSAND, '&');\n case $BAR:\n return this.scanComplexOperator(start, '|', $BAR, '|');\n case $NBSP:\n while (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 _Scanner.prototype.scanCharacter = function (start, code) {\n this.advance();\n return newCharacterToken(start, code);\n };\n /**\n * @param {?} start\n * @param {?} str\n * @return {?}\n */\n _Scanner.prototype.scanOperator = function (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 _Scanner.prototype.scanComplexOperator = function (start, one, twoCode, two, threeCode, three) {\n this.advance();\n var /** @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 _Scanner.prototype.scanIdentifier = function () {\n var /** @type {?} */ start = this.index;\n this.advance();\n while (isIdentifierPart(this.peek))\n this.advance();\n var /** @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 _Scanner.prototype.scanNumber = function (start) {\n var /** @type {?} */ simple = (this.index === start);\n this.advance(); // Skip initial digit.\n while (true) {\n if (isDigit(this.peek)) {\n // Do nothing.\n }\n else if (this.peek == $PERIOD) {\n simple = false;\n }\n else if (isExponentStart(this.peek)) {\n this.advance();\n if (isExponentSign(this.peek))\n this.advance();\n if (!isDigit(this.peek))\n return this.error('Invalid exponent', -1);\n simple = false;\n }\n else {\n break;\n }\n this.advance();\n }\n var /** @type {?} */ str = this.input.substring(start, this.index);\n var /** @type {?} */ value = simple ? parseIntAutoRadix(str) : parseFloat(str);\n return newNumberToken(start, value);\n };\n /**\n * @return {?}\n */\n _Scanner.prototype.scanString = function () {\n var /** @type {?} */ start = this.index;\n var /** @type {?} */ quote = this.peek;\n this.advance(); // Skip initial quote.\n var /** @type {?} */ buffer = '';\n var /** @type {?} */ marker = this.index;\n var /** @type {?} */ input = this.input;\n while (this.peek != quote) {\n if (this.peek == $BACKSLASH) {\n buffer += input.substring(marker, this.index);\n this.advance();\n var /** @type {?} */ unescapedCode = void 0;\n // Workaround for TS2.1-introduced type strictness\n this.peek = this.peek;\n if (this.peek == $u) {\n // 4 character hex code for unicode character.\n var /** @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 (var /** @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 == $EOF) {\n return this.error('Unterminated quote', 0);\n }\n else {\n this.advance();\n }\n }\n var /** @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 _Scanner.prototype.error = function (message, offset) {\n var /** @type {?} */ position = this.index + offset;\n return newErrorToken(position, \"Lexer Error: \" + message + \" at column \" + position + \" in expression [\" + this.input + \"]\");\n };\n return _Scanner;\n}());\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isIdentifierStart(code) {\n return ($a <= code && code <= $z) || ($A <= code && code <= $Z) ||\n (code == $_) || (code == $$);\n}\n/**\n * @param {?} input\n * @return {?}\n */\nfunction isIdentifier(input) {\n if (input.length == 0)\n return false;\n var /** @type {?} */ scanner = new _Scanner(input);\n if (!isIdentifierStart(scanner.peek))\n return false;\n scanner.advance();\n while (scanner.peek !== $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 isAsciiLetter(code) || isDigit(code) || (code == $_) ||\n (code == $$);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isExponentStart(code) {\n return code == $e || code == $E;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isExponentSign(code) {\n return code == $MINUS || code == $PLUS;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isQuote(code) {\n return code === $SQ || code === $DQ || code === $BT;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction unescape(code) {\n switch (code) {\n case $n:\n return $LF;\n case $f:\n return $FF;\n case $r:\n return $CR;\n case $t:\n return $TAB;\n case $v:\n return $VTAB;\n default:\n return code;\n }\n}\n/**\n * @param {?} text\n * @return {?}\n */\nfunction parseIntAutoRadix(text) {\n var /** @type {?} */ result = parseInt(text);\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n/**\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 */\nvar SplitInterpolation = (function () {\n /**\n * @param {?} strings\n * @param {?} expressions\n * @param {?} offsets\n */\n function SplitInterpolation(strings, expressions, offsets) {\n this.strings = strings;\n this.expressions = expressions;\n this.offsets = offsets;\n }\n return SplitInterpolation;\n}());\nvar TemplateBindingParseResult = (function () {\n /**\n * @param {?} templateBindings\n * @param {?} warnings\n * @param {?} errors\n */\n function TemplateBindingParseResult(templateBindings, warnings, errors) {\n this.templateBindings = templateBindings;\n this.warnings = warnings;\n this.errors = errors;\n }\n return TemplateBindingParseResult;\n}());\n/**\n * @param {?} config\n * @return {?}\n */\nfunction _createInterpolateRegExp(config) {\n var /** @type {?} */ pattern = escapeRegExp(config.start) + '([\\\\s\\\\S]*?)' + escapeRegExp(config.end);\n return new RegExp(pattern, 'g');\n}\nvar Parser = (function () {\n /**\n * @param {?} _lexer\n */\n function Parser(_lexer) {\n this._lexer = _lexer;\n this.errors = [];\n }\n /**\n * @param {?} input\n * @param {?} location\n * @param {?=} interpolationConfig\n * @return {?}\n */\n Parser.prototype.parseAction = function (input, location, interpolationConfig) {\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n this._checkNoInterpolation(input, location, interpolationConfig);\n var /** @type {?} */ sourceToLex = this._stripComments(input);\n var /** @type {?} */ tokens = this._lexer.tokenize(this._stripComments(input));\n var /** @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 Parser.prototype.parseBinding = function (input, location, interpolationConfig) {\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @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 Parser.prototype.parseSimpleBinding = function (input, location, interpolationConfig) {\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @type {?} */ ast = this._parseBindingAst(input, location, interpolationConfig);\n var /** @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 Parser.prototype._reportError = function (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 Parser.prototype._parseBindingAst = function (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 var /** @type {?} */ quote = this._parseQuote(input, location);\n if (quote != null) {\n return quote;\n }\n this._checkNoInterpolation(input, location, interpolationConfig);\n var /** @type {?} */ sourceToLex = this._stripComments(input);\n var /** @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 Parser.prototype._parseQuote = function (input, location) {\n if (input == null)\n return null;\n var /** @type {?} */ prefixSeparatorIndex = input.indexOf(':');\n if (prefixSeparatorIndex == -1)\n return null;\n var /** @type {?} */ prefix = input.substring(0, prefixSeparatorIndex).trim();\n if (!isIdentifier(prefix))\n return null;\n var /** @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 Parser.prototype.parseTemplateBindings = function (prefixToken, input, location) {\n var /** @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 var /** @type {?} */ prefixTokens = this._lexer.tokenize(prefixToken).map(function (t) {\n t.index = 0;\n return t;\n });\n tokens.unshift.apply(tokens, 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 Parser.prototype.parseInterpolation = function (input, location, interpolationConfig) {\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @type {?} */ split = this.splitInterpolation(input, location, interpolationConfig);\n if (split == null)\n return null;\n var /** @type {?} */ expressions = [];\n for (var /** @type {?} */ i = 0; i < split.expressions.length; ++i) {\n var /** @type {?} */ expressionText = split.expressions[i];\n var /** @type {?} */ sourceToLex = this._stripComments(expressionText);\n var /** @type {?} */ tokens = this._lexer.tokenize(sourceToLex);\n var /** @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 Parser.prototype.splitInterpolation = function (input, location, interpolationConfig) {\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);\n var /** @type {?} */ parts = input.split(regexp);\n if (parts.length <= 1) {\n return null;\n }\n var /** @type {?} */ strings = [];\n var /** @type {?} */ expressions = [];\n var /** @type {?} */ offsets = [];\n var /** @type {?} */ offset = 0;\n for (var /** @type {?} */ i = 0; i < parts.length; i++) {\n var /** @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 Parser.prototype.wrapLiteralPrimitive = function (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 Parser.prototype._stripComments = function (input) {\n var /** @type {?} */ i = this._commentStart(input);\n return i != null ? input.substring(0, i).trim() : input;\n };\n /**\n * @param {?} input\n * @return {?}\n */\n Parser.prototype._commentStart = function (input) {\n var /** @type {?} */ outerQuote = null;\n for (var /** @type {?} */ i = 0; i < input.length - 1; i++) {\n var /** @type {?} */ char = input.charCodeAt(i);\n var /** @type {?} */ nextChar = input.charCodeAt(i + 1);\n if (char === $SLASH && nextChar == $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 Parser.prototype._checkNoInterpolation = function (input, location, interpolationConfig) {\n var /** @type {?} */ regexp = _createInterpolateRegExp(interpolationConfig);\n var /** @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 Parser.prototype._findInterpolationErrorColumn = function (parts, partInErrIdx, interpolationConfig) {\n var /** @type {?} */ errLocation = '';\n for (var /** @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 return Parser;\n}());\nParser.decorators = [\n { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nParser.ctorParameters = function () { return [\n { type: Lexer, },\n]; };\nvar _ParseAST = (function () {\n /**\n * @param {?} input\n * @param {?} location\n * @param {?} tokens\n * @param {?} inputLength\n * @param {?} parseAction\n * @param {?} errors\n * @param {?} offset\n */\n function _ParseAST(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 _ParseAST.prototype.peek = function (offset) {\n var /** @type {?} */ i = this.index + offset;\n return i < this.tokens.length ? this.tokens[i] : EOF;\n };\n Object.defineProperty(_ParseAST.prototype, \"next\", {\n /**\n * @return {?}\n */\n get: function () { return this.peek(0); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(_ParseAST.prototype, \"inputIndex\", {\n /**\n * @return {?}\n */\n get: function () {\n return (this.index < this.tokens.length) ? this.next.index + this.offset :\n this.inputLength + this.offset;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} start\n * @return {?}\n */\n _ParseAST.prototype.span = function (start) { return new ParseSpan(start, this.inputIndex); };\n /**\n * @return {?}\n */\n _ParseAST.prototype.advance = function () { this.index++; };\n /**\n * @param {?} code\n * @return {?}\n */\n _ParseAST.prototype.optionalCharacter = function (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 _ParseAST.prototype.peekKeywordLet = function () { return this.next.isKeywordLet(); };\n /**\n * @return {?}\n */\n _ParseAST.prototype.peekKeywordAs = function () { return this.next.isKeywordAs(); };\n /**\n * @param {?} code\n * @return {?}\n */\n _ParseAST.prototype.expectCharacter = function (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 _ParseAST.prototype.optionalOperator = function (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 _ParseAST.prototype.expectOperator = function (operator) {\n if (this.optionalOperator(operator))\n return;\n this.error(\"Missing expected operator \" + operator);\n };\n /**\n * @return {?}\n */\n _ParseAST.prototype.expectIdentifierOrKeyword = function () {\n var /** @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 _ParseAST.prototype.expectIdentifierOrKeywordOrString = function () {\n var /** @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 _ParseAST.prototype.parseChain = function () {\n var /** @type {?} */ exprs = [];\n var /** @type {?} */ start = this.inputIndex;\n while (this.index < this.tokens.length) {\n var /** @type {?} */ expr = this.parsePipe();\n exprs.push(expr);\n if (this.optionalCharacter($SEMICOLON)) {\n if (!this.parseAction) {\n this.error('Binding expression cannot contain chained expression');\n }\n while (this.optionalCharacter($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 _ParseAST.prototype.parsePipe = function () {\n var /** @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 var /** @type {?} */ name = this.expectIdentifierOrKeyword();\n var /** @type {?} */ args = [];\n while (this.optionalCharacter($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 _ParseAST.prototype.parseExpression = function () { return this.parseConditional(); };\n /**\n * @return {?}\n */\n _ParseAST.prototype.parseConditional = function () {\n var /** @type {?} */ start = this.inputIndex;\n var /** @type {?} */ result = this.parseLogicalOr();\n if (this.optionalOperator('?')) {\n var /** @type {?} */ yes = this.parsePipe();\n var /** @type {?} */ no = void 0;\n if (!this.optionalCharacter($COLON)) {\n var /** @type {?} */ end = this.inputIndex;\n var /** @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 _ParseAST.prototype.parseLogicalOr = function () {\n // '||'\n var /** @type {?} */ result = this.parseLogicalAnd();\n while (this.optionalOperator('||')) {\n var /** @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 _ParseAST.prototype.parseLogicalAnd = function () {\n // '&&'\n var /** @type {?} */ result = this.parseEquality();\n while (this.optionalOperator('&&')) {\n var /** @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 _ParseAST.prototype.parseEquality = function () {\n // '==','!=','===','!=='\n var /** @type {?} */ result = this.parseRelational();\n while (this.next.type == TokenType.Operator) {\n var /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '==':\n case '===':\n case '!=':\n case '!==':\n this.advance();\n var /** @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 _ParseAST.prototype.parseRelational = function () {\n // '<', '>', '<=', '>='\n var /** @type {?} */ result = this.parseAdditive();\n while (this.next.type == TokenType.Operator) {\n var /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '<':\n case '>':\n case '<=':\n case '>=':\n this.advance();\n var /** @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 _ParseAST.prototype.parseAdditive = function () {\n // '+', '-'\n var /** @type {?} */ result = this.parseMultiplicative();\n while (this.next.type == TokenType.Operator) {\n var /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '+':\n case '-':\n this.advance();\n var /** @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 _ParseAST.prototype.parseMultiplicative = function () {\n // '*', '%', '/'\n var /** @type {?} */ result = this.parsePrefix();\n while (this.next.type == TokenType.Operator) {\n var /** @type {?} */ operator = this.next.strValue;\n switch (operator) {\n case '*':\n case '%':\n case '/':\n this.advance();\n var /** @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 _ParseAST.prototype.parsePrefix = function () {\n if (this.next.type == TokenType.Operator) {\n var /** @type {?} */ start = this.inputIndex;\n var /** @type {?} */ operator = this.next.strValue;\n var /** @type {?} */ result = void 0;\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 _ParseAST.prototype.parseCallChain = function () {\n var /** @type {?} */ result = this.parsePrimary();\n while (true) {\n if (this.optionalCharacter($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($LBRACKET)) {\n this.rbracketsExpected++;\n var /** @type {?} */ key = this.parsePipe();\n this.rbracketsExpected--;\n this.expectCharacter($RBRACKET);\n if (this.optionalOperator('=')) {\n var /** @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($LPAREN)) {\n this.rparensExpected++;\n var /** @type {?} */ args = this.parseCallArguments();\n this.rparensExpected--;\n this.expectCharacter($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 _ParseAST.prototype.parsePrimary = function () {\n var /** @type {?} */ start = this.inputIndex;\n if (this.optionalCharacter($LPAREN)) {\n this.rparensExpected++;\n var /** @type {?} */ result = this.parsePipe();\n this.rparensExpected--;\n this.expectCharacter($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($LBRACKET)) {\n this.rbracketsExpected++;\n var /** @type {?} */ elements = this.parseExpressionList($RBRACKET);\n this.rbracketsExpected--;\n this.expectCharacter($RBRACKET);\n return new LiteralArray(this.span(start), elements);\n }\n else if (this.next.isCharacter($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 var /** @type {?} */ value = this.next.toNumber();\n this.advance();\n return new LiteralPrimitive(this.span(start), value);\n }\n else if (this.next.isString()) {\n var /** @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 _ParseAST.prototype.parseExpressionList = function (terminator) {\n var /** @type {?} */ result = [];\n if (!this.next.isCharacter(terminator)) {\n do {\n result.push(this.parsePipe());\n } while (this.optionalCharacter($COMMA));\n }\n return result;\n };\n /**\n * @return {?}\n */\n _ParseAST.prototype.parseLiteralMap = function () {\n var /** @type {?} */ keys = [];\n var /** @type {?} */ values = [];\n var /** @type {?} */ start = this.inputIndex;\n this.expectCharacter($LBRACE);\n if (!this.optionalCharacter($RBRACE)) {\n this.rbracesExpected++;\n do {\n var /** @type {?} */ quoted = this.next.isString();\n var /** @type {?} */ key = this.expectIdentifierOrKeywordOrString();\n keys.push({ key: key, quoted: quoted });\n this.expectCharacter($COLON);\n values.push(this.parsePipe());\n } while (this.optionalCharacter($COMMA));\n this.rbracesExpected--;\n this.expectCharacter($RBRACE);\n }\n return new LiteralMap(this.span(start), keys, values);\n };\n /**\n * @param {?} receiver\n * @param {?=} isSafe\n * @return {?}\n */\n _ParseAST.prototype.parseAccessMemberOrMethodCall = function (receiver, isSafe) {\n if (isSafe === void 0) { isSafe = false; }\n var /** @type {?} */ start = receiver.span.start;\n var /** @type {?} */ id = this.expectIdentifierOrKeyword();\n if (this.optionalCharacter($LPAREN)) {\n this.rparensExpected++;\n var /** @type {?} */ args = this.parseCallArguments();\n this.expectCharacter($RPAREN);\n this.rparensExpected--;\n var /** @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 var /** @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 _ParseAST.prototype.parseCallArguments = function () {\n if (this.next.isCharacter($RPAREN))\n return [];\n var /** @type {?} */ positionals = [];\n do {\n positionals.push(this.parsePipe());\n } while (this.optionalCharacter($COMMA));\n return (positionals);\n };\n /**\n * An identifier, a keyword, a string with an optional `-` inbetween.\n * @return {?}\n */\n _ParseAST.prototype.expectTemplateBindingKey = function () {\n var /** @type {?} */ result = '';\n var /** @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 _ParseAST.prototype.parseTemplateBindings = function () {\n var /** @type {?} */ bindings = [];\n var /** @type {?} */ prefix = ((null));\n var /** @type {?} */ warnings = [];\n while (this.index < this.tokens.length) {\n var /** @type {?} */ start = this.inputIndex;\n var /** @type {?} */ keyIsVar = this.peekKeywordLet();\n if (keyIsVar) {\n this.advance();\n }\n var /** @type {?} */ rawKey = this.expectTemplateBindingKey();\n var /** @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($COLON);\n var /** @type {?} */ name = ((null));\n var /** @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 var /** @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 var /** @type {?} */ start_2 = this.inputIndex;\n var /** @type {?} */ ast = this.parsePipe();\n var /** @type {?} */ source = this.input.substring(start_2 - 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 var /** @type {?} */ letStart = this.inputIndex;\n this.advance(); // consume `as`\n var /** @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($SEMICOLON)) {\n this.optionalCharacter($COMMA);\n }\n }\n return new TemplateBindingParseResult(bindings, warnings, this.errors);\n };\n /**\n * @param {?} message\n * @param {?=} index\n * @return {?}\n */\n _ParseAST.prototype.error = function (message, index) {\n if (index === void 0) { 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 _ParseAST.prototype.locationText = function (index) {\n if (index === void 0) { 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 _ParseAST.prototype.skip = function () {\n var /** @type {?} */ n = this.next;\n while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) &&\n (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&\n (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&\n (this.rbracketsExpected <= 0 || !n.isCharacter($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 return _ParseAST;\n}());\nvar SimpleExpressionChecker = (function () {\n function SimpleExpressionChecker() {\n this.errors = [];\n }\n /**\n * @param {?} ast\n * @return {?}\n */\n SimpleExpressionChecker.check = function (ast) {\n var /** @type {?} */ s = new SimpleExpressionChecker();\n ast.visit(s);\n return s.errors;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitImplicitReceiver = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitInterpolation = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitLiteralPrimitive = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitPropertyRead = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitPropertyWrite = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitSafePropertyRead = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitMethodCall = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitSafeMethodCall = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitFunctionCall = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitLiteralArray = function (ast, context) { this.visitAll(ast.expressions); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitLiteralMap = function (ast, context) { this.visitAll(ast.values); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitBinary = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitPrefixNot = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitNonNullAssert = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitConditional = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitPipe = function (ast, context) { this.errors.push('pipes'); };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitKeyedRead = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitKeyedWrite = function (ast, context) { };\n /**\n * @param {?} asts\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitAll = function (asts) {\n var _this = this;\n return asts.map(function (node) { return node.visit(_this); });\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitChain = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n SimpleExpressionChecker.prototype.visitQuote = function (ast, context) { };\n return SimpleExpressionChecker;\n}());\n/**\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 */\nvar ParseLocation = (function () {\n /**\n * @param {?} file\n * @param {?} offset\n * @param {?} line\n * @param {?} col\n */\n function ParseLocation(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 ParseLocation.prototype.toString = function () {\n return this.offset != null ? this.file.url + \"@\" + this.line + \":\" + this.col : this.file.url;\n };\n /**\n * @param {?} delta\n * @return {?}\n */\n ParseLocation.prototype.moveBy = function (delta) {\n var /** @type {?} */ source = this.file.content;\n var /** @type {?} */ len = source.length;\n var /** @type {?} */ offset = this.offset;\n var /** @type {?} */ line = this.line;\n var /** @type {?} */ col = this.col;\n while (offset > 0 && delta < 0) {\n offset--;\n delta++;\n var /** @type {?} */ ch = source.charCodeAt(offset);\n if (ch == $LF) {\n line--;\n var /** @type {?} */ priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));\n col = priorLine > 0 ? offset - priorLine : offset;\n }\n else {\n col--;\n }\n }\n while (offset < len && delta > 0) {\n var /** @type {?} */ ch = source.charCodeAt(offset);\n offset++;\n delta--;\n if (ch == $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 ParseLocation.prototype.getContext = function (maxChars, maxLines) {\n var /** @type {?} */ content = this.file.content;\n var /** @type {?} */ startOffset = this.offset;\n if (startOffset != null) {\n if (startOffset > content.length - 1) {\n startOffset = content.length - 1;\n }\n var /** @type {?} */ endOffset = startOffset;\n var /** @type {?} */ ctxChars = 0;\n var /** @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 return ParseLocation;\n}());\nvar ParseSourceFile = (function () {\n /**\n * @param {?} content\n * @param {?} url\n */\n function ParseSourceFile(content, url) {\n this.content = content;\n this.url = url;\n }\n return ParseSourceFile;\n}());\nvar ParseSourceSpan = (function () {\n /**\n * @param {?} start\n * @param {?} end\n * @param {?=} details\n */\n function ParseSourceSpan(start, end, details) {\n if (details === void 0) { details = null; }\n this.start = start;\n this.end = end;\n this.details = details;\n }\n /**\n * @return {?}\n */\n ParseSourceSpan.prototype.toString = function () {\n return this.start.file.content.substring(this.start.offset, this.end.offset);\n };\n return ParseSourceSpan;\n}());\nvar ParseErrorLevel = {};\nParseErrorLevel.WARNING = 0;\nParseErrorLevel.ERROR = 1;\nParseErrorLevel[ParseErrorLevel.WARNING] = \"WARNING\";\nParseErrorLevel[ParseErrorLevel.ERROR] = \"ERROR\";\nvar ParseError = (function () {\n /**\n * @param {?} span\n * @param {?} msg\n * @param {?=} level\n */\n function ParseError(span, msg, level) {\n if (level === void 0) { level = ParseErrorLevel.ERROR; }\n this.span = span;\n this.msg = msg;\n this.level = level;\n }\n /**\n * @return {?}\n */\n ParseError.prototype.contextualMessage = function () {\n var /** @type {?} */ ctx = this.span.start.getContext(100, 3);\n return ctx ? \" (\\\"\" + ctx.before + \"[\" + ParseErrorLevel[this.level] + \" ->]\" + ctx.after + \"\\\")\" : '';\n };\n /**\n * @return {?}\n */\n ParseError.prototype.toString = function () {\n var /** @type {?} */ details = this.span.details ? \", \" + this.span.details : '';\n return \"\" + this.msg + this.contextualMessage() + \": \" + this.span.start + details;\n };\n return ParseError;\n}());\n/**\n * @param {?} kind\n * @param {?} type\n * @return {?}\n */\nfunction typeSourceSpan(kind, type) {\n var /** @type {?} */ moduleUrl = identifierModuleUrl(type);\n var /** @type {?} */ sourceFileName = moduleUrl != null ? \"in \" + kind + \" \" + identifierName(type) + \" in \" + moduleUrl :\n \"in \" + kind + \" \" + identifierName(type);\n var /** @type {?} */ sourceFile = new ParseSourceFile('', sourceFileName);\n return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1));\n}\n/**\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 */\nvar AstPath = (function () {\n /**\n * @param {?} path\n * @param {?=} position\n */\n function AstPath(path, position) {\n if (position === void 0) { position = -1; }\n this.path = path;\n this.position = position;\n }\n Object.defineProperty(AstPath.prototype, \"empty\", {\n /**\n * @return {?}\n */\n get: function () { return !this.path || !this.path.length; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AstPath.prototype, \"head\", {\n /**\n * @return {?}\n */\n get: function () { return this.path[0]; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AstPath.prototype, \"tail\", {\n /**\n * @return {?}\n */\n get: function () { return this.path[this.path.length - 1]; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} node\n * @return {?}\n */\n AstPath.prototype.parentOf = function (node) {\n return node && this.path[this.path.indexOf(node) - 1];\n };\n /**\n * @param {?} node\n * @return {?}\n */\n AstPath.prototype.childOf = function (node) { return this.path[this.path.indexOf(node) + 1]; };\n /**\n * @template N\n * @param {?} ctor\n * @return {?}\n */\n AstPath.prototype.first = function (ctor) {\n for (var /** @type {?} */ i = this.path.length - 1; i >= 0; i--) {\n var /** @type {?} */ item = this.path[i];\n if (item instanceof ctor)\n return (item);\n }\n };\n /**\n * @param {?} node\n * @return {?}\n */\n AstPath.prototype.push = function (node) { this.path.push(node); };\n /**\n * @return {?}\n */\n AstPath.prototype.pop = function () { return ((this.path.pop())); };\n return AstPath;\n}());\n/**\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 */\nvar Text = (function () {\n /**\n * @param {?} value\n * @param {?} sourceSpan\n */\n function Text(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n Text.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };\n return Text;\n}());\nvar Expansion = (function () {\n /**\n * @param {?} switchValue\n * @param {?} type\n * @param {?} cases\n * @param {?} sourceSpan\n * @param {?} switchValueSourceSpan\n */\n function Expansion(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 Expansion.prototype.visit = function (visitor, context) { return visitor.visitExpansion(this, context); };\n return Expansion;\n}());\nvar ExpansionCase = (function () {\n /**\n * @param {?} value\n * @param {?} expression\n * @param {?} sourceSpan\n * @param {?} valueSourceSpan\n * @param {?} expSourceSpan\n */\n function ExpansionCase(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 ExpansionCase.prototype.visit = function (visitor, context) { return visitor.visitExpansionCase(this, context); };\n return ExpansionCase;\n}());\nvar Attribute$1 = (function () {\n /**\n * @param {?} name\n * @param {?} value\n * @param {?} sourceSpan\n * @param {?=} valueSpan\n */\n function Attribute$1(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 Attribute$1.prototype.visit = function (visitor, context) { return visitor.visitAttribute(this, context); };\n return Attribute$1;\n}());\nvar Element = (function () {\n /**\n * @param {?} name\n * @param {?} attrs\n * @param {?} children\n * @param {?} sourceSpan\n * @param {?=} startSourceSpan\n * @param {?=} endSourceSpan\n */\n function Element(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan) {\n if (startSourceSpan === void 0) { startSourceSpan = null; }\n if (endSourceSpan === void 0) { 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 Element.prototype.visit = function (visitor, context) { return visitor.visitElement(this, context); };\n return Element;\n}());\nvar Comment = (function () {\n /**\n * @param {?} value\n * @param {?} sourceSpan\n */\n function Comment(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?} context\n * @return {?}\n */\n Comment.prototype.visit = function (visitor, context) { return visitor.visitComment(this, context); };\n return Comment;\n}());\n/**\n * @param {?} visitor\n * @param {?} nodes\n * @param {?=} context\n * @return {?}\n */\nfunction visitAll(visitor, nodes, context) {\n if (context === void 0) { context = null; }\n var /** @type {?} */ result = [];\n var /** @type {?} */ visit = visitor.visit ?\n function (ast) { return ((visitor.visit))(ast, context) || ast.visit(visitor, context); } :\n function (ast) { return ast.visit(visitor, context); };\n nodes.forEach(function (ast) {\n var /** @type {?} */ astResult = visit(ast);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\nvar RecursiveVisitor = (function () {\n function RecursiveVisitor() {\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveVisitor.prototype.visitElement = function (ast, context) {\n this.visitChildren(context, function (visit) {\n visit(ast.attrs);\n visit(ast.children);\n });\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveVisitor.prototype.visitAttribute = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveVisitor.prototype.visitText = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveVisitor.prototype.visitComment = function (ast, context) { };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveVisitor.prototype.visitExpansion = function (ast, context) {\n return this.visitChildren(context, function (visit) { visit(ast.cases); });\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n RecursiveVisitor.prototype.visitExpansionCase = function (ast, context) { };\n /**\n * @template T\n * @param {?} context\n * @param {?} cb\n * @return {?}\n */\n RecursiveVisitor.prototype.visitChildren = function (context, cb) {\n var /** @type {?} */ results = [];\n var /** @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 return RecursiveVisitor;\n}());\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction spanOf(ast) {\n var /** @type {?} */ start = ast.sourceSpan.start.offset;\n var /** @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: start, end: end };\n}\n/**\n * @param {?} nodes\n * @param {?} position\n * @return {?}\n */\nfunction findNode(nodes, position) {\n var /** @type {?} */ path = [];\n var /** @type {?} */ visitor = new (function (_super) {\n tslib_1.__extends(class_1, _super);\n function class_1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n class_1.prototype.visit = function (ast, context) {\n var /** @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 return class_1;\n }(RecursiveVisitor));\n visitAll(visitor, nodes);\n return new AstPath(path, position);\n}\n/**\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 */\nvar TokenType$1 = {};\nTokenType$1.TAG_OPEN_START = 0;\nTokenType$1.TAG_OPEN_END = 1;\nTokenType$1.TAG_OPEN_END_VOID = 2;\nTokenType$1.TAG_CLOSE = 3;\nTokenType$1.TEXT = 4;\nTokenType$1.ESCAPABLE_RAW_TEXT = 5;\nTokenType$1.RAW_TEXT = 6;\nTokenType$1.COMMENT_START = 7;\nTokenType$1.COMMENT_END = 8;\nTokenType$1.CDATA_START = 9;\nTokenType$1.CDATA_END = 10;\nTokenType$1.ATTR_NAME = 11;\nTokenType$1.ATTR_VALUE = 12;\nTokenType$1.DOC_TYPE = 13;\nTokenType$1.EXPANSION_FORM_START = 14;\nTokenType$1.EXPANSION_CASE_VALUE = 15;\nTokenType$1.EXPANSION_CASE_EXP_START = 16;\nTokenType$1.EXPANSION_CASE_EXP_END = 17;\nTokenType$1.EXPANSION_FORM_END = 18;\nTokenType$1.EOF = 19;\nTokenType$1[TokenType$1.TAG_OPEN_START] = \"TAG_OPEN_START\";\nTokenType$1[TokenType$1.TAG_OPEN_END] = \"TAG_OPEN_END\";\nTokenType$1[TokenType$1.TAG_OPEN_END_VOID] = \"TAG_OPEN_END_VOID\";\nTokenType$1[TokenType$1.TAG_CLOSE] = \"TAG_CLOSE\";\nTokenType$1[TokenType$1.TEXT] = \"TEXT\";\nTokenType$1[TokenType$1.ESCAPABLE_RAW_TEXT] = \"ESCAPABLE_RAW_TEXT\";\nTokenType$1[TokenType$1.RAW_TEXT] = \"RAW_TEXT\";\nTokenType$1[TokenType$1.COMMENT_START] = \"COMMENT_START\";\nTokenType$1[TokenType$1.COMMENT_END] = \"COMMENT_END\";\nTokenType$1[TokenType$1.CDATA_START] = \"CDATA_START\";\nTokenType$1[TokenType$1.CDATA_END] = \"CDATA_END\";\nTokenType$1[TokenType$1.ATTR_NAME] = \"ATTR_NAME\";\nTokenType$1[TokenType$1.ATTR_VALUE] = \"ATTR_VALUE\";\nTokenType$1[TokenType$1.DOC_TYPE] = \"DOC_TYPE\";\nTokenType$1[TokenType$1.EXPANSION_FORM_START] = \"EXPANSION_FORM_START\";\nTokenType$1[TokenType$1.EXPANSION_CASE_VALUE] = \"EXPANSION_CASE_VALUE\";\nTokenType$1[TokenType$1.EXPANSION_CASE_EXP_START] = \"EXPANSION_CASE_EXP_START\";\nTokenType$1[TokenType$1.EXPANSION_CASE_EXP_END] = \"EXPANSION_CASE_EXP_END\";\nTokenType$1[TokenType$1.EXPANSION_FORM_END] = \"EXPANSION_FORM_END\";\nTokenType$1[TokenType$1.EOF] = \"EOF\";\nvar Token$1 = (function () {\n /**\n * @param {?} type\n * @param {?} parts\n * @param {?} sourceSpan\n */\n function Token$1(type, parts, sourceSpan) {\n this.type = type;\n this.parts = parts;\n this.sourceSpan = sourceSpan;\n }\n return Token$1;\n}());\nvar TokenError = (function (_super) {\n tslib_1.__extends(TokenError, _super);\n /**\n * @param {?} errorMsg\n * @param {?} tokenType\n * @param {?} span\n */\n function TokenError(errorMsg, tokenType, span) {\n var _this = _super.call(this, span, errorMsg) || this;\n _this.tokenType = tokenType;\n return _this;\n }\n return TokenError;\n}(ParseError));\nvar TokenizeResult = (function () {\n /**\n * @param {?} tokens\n * @param {?} errors\n */\n function TokenizeResult(tokens, errors) {\n this.tokens = tokens;\n this.errors = errors;\n }\n return TokenizeResult;\n}());\n/**\n * @param {?} source\n * @param {?} url\n * @param {?} getTagDefinition\n * @param {?=} tokenizeExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\nfunction tokenize(source, url, getTagDefinition, tokenizeExpansionForms, interpolationConfig) {\n if (tokenizeExpansionForms === void 0) { tokenizeExpansionForms = false; }\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n return new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, tokenizeExpansionForms, interpolationConfig)\n .tokenize();\n}\nvar _CR_OR_CRLF_REGEXP = /\\r\\n?/g;\n/**\n * @param {?} charCode\n * @return {?}\n */\nfunction _unexpectedCharacterErrorMsg(charCode) {\n var /** @type {?} */ char = charCode === $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}\nvar _ControlFlowError = (function () {\n /**\n * @param {?} error\n */\n function _ControlFlowError(error) {\n this.error = error;\n }\n return _ControlFlowError;\n}());\nvar _Tokenizer = (function () {\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 function _Tokenizer(_file, _getTagDefinition, _tokenizeIcu, _interpolationConfig) {\n if (_interpolationConfig === void 0) { _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 _Tokenizer.prototype._processCarriageReturns = function (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 _Tokenizer.prototype.tokenize = function () {\n while (this._peek !== $EOF) {\n var /** @type {?} */ start = this._getLocation();\n try {\n if (this._attemptCharCode($LT)) {\n if (this._attemptCharCode($BANG)) {\n if (this._attemptCharCode($LBRACKET)) {\n this._consumeCdata(start);\n }\n else if (this._attemptCharCode($MINUS)) {\n this._consumeComment(start);\n }\n else {\n this._consumeDocType(start);\n }\n }\n else if (this._attemptCharCode($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$1.EOF);\n this._endToken([]);\n return new TokenizeResult(mergeTextTokens(this.tokens), this.errors);\n };\n /**\n * \\@internal\n * @return {?}\n */\n _Tokenizer.prototype._tokenizeExpansionForm = function () {\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 === $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 _Tokenizer.prototype._getLocation = function () {\n return new ParseLocation(this._file, this._index, this._line, this._column);\n };\n /**\n * @param {?=} start\n * @param {?=} end\n * @return {?}\n */\n _Tokenizer.prototype._getSpan = function (start, end) {\n if (start === void 0) { start = this._getLocation(); }\n if (end === void 0) { end = this._getLocation(); }\n return new ParseSourceSpan(start, end);\n };\n /**\n * @param {?} type\n * @param {?=} start\n * @return {?}\n */\n _Tokenizer.prototype._beginToken = function (type, start) {\n if (start === void 0) { start = this._getLocation(); }\n this._currentTokenStart = start;\n this._currentTokenType = type;\n };\n /**\n * @param {?} parts\n * @param {?=} end\n * @return {?}\n */\n _Tokenizer.prototype._endToken = function (parts, end) {\n if (end === void 0) { end = this._getLocation(); }\n var /** @type {?} */ token = new Token$1(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 _Tokenizer.prototype._createError = function (msg, span) {\n if (this._isInExpansionForm()) {\n msg += \" (Do you have an unescaped \\\"{\\\" in your template? Use \\\"{{ '{' }}\\\") to escape it.)\";\n }\n var /** @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 _Tokenizer.prototype._advance = function () {\n if (this._index >= this._length) {\n throw this._createError(_unexpectedCharacterErrorMsg($EOF), this._getSpan());\n }\n if (this._peek === $LF) {\n this._line++;\n this._column = 0;\n }\n else if (this._peek !== $LF && this._peek !== $CR) {\n this._column++;\n }\n this._index++;\n this._peek = this._index >= this._length ? $EOF : this._input.charCodeAt(this._index);\n this._nextPeek =\n this._index + 1 >= this._length ? $EOF : this._input.charCodeAt(this._index + 1);\n };\n /**\n * @param {?} charCode\n * @return {?}\n */\n _Tokenizer.prototype._attemptCharCode = function (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 _Tokenizer.prototype._attemptCharCodeCaseInsensitive = function (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 _Tokenizer.prototype._requireCharCode = function (charCode) {\n var /** @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 _Tokenizer.prototype._attemptStr = function (chars) {\n var /** @type {?} */ len = chars.length;\n if (this._index + len > this._length) {\n return false;\n }\n var /** @type {?} */ initialPosition = this._savePosition();\n for (var /** @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 _Tokenizer.prototype._attemptStrCaseInsensitive = function (chars) {\n for (var /** @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 _Tokenizer.prototype._requireStr = function (chars) {\n var /** @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 _Tokenizer.prototype._attemptCharCodeUntilFn = function (predicate) {\n while (!predicate(this._peek)) {\n this._advance();\n }\n };\n /**\n * @param {?} predicate\n * @param {?} len\n * @return {?}\n */\n _Tokenizer.prototype._requireCharCodeUntilFn = function (predicate, len) {\n var /** @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 _Tokenizer.prototype._attemptUntilChar = function (char) {\n while (this._peek !== char) {\n this._advance();\n }\n };\n /**\n * @param {?} decodeEntities\n * @return {?}\n */\n _Tokenizer.prototype._readChar = function (decodeEntities) {\n if (decodeEntities && this._peek === $AMPERSAND) {\n return this._decodeEntity();\n }\n else {\n var /** @type {?} */ index = this._index;\n this._advance();\n return this._input[index];\n }\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._decodeEntity = function () {\n var /** @type {?} */ start = this._getLocation();\n this._advance();\n if (this._attemptCharCode($HASH)) {\n var /** @type {?} */ isHex = this._attemptCharCode($x) || this._attemptCharCode($X);\n var /** @type {?} */ numberStart = this._getLocation().offset;\n this._attemptCharCodeUntilFn(isDigitEntityEnd);\n if (this._peek != $SEMICOLON) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());\n }\n this._advance();\n var /** @type {?} */ strNum = this._input.substring(numberStart, this._index - 1);\n try {\n var /** @type {?} */ charCode = parseInt(strNum, isHex ? 16 : 10);\n return String.fromCharCode(charCode);\n }\n catch (e) {\n var /** @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 var /** @type {?} */ startPosition = this._savePosition();\n this._attemptCharCodeUntilFn(isNamedEntityEnd);\n if (this._peek != $SEMICOLON) {\n this._restorePosition(startPosition);\n return '&';\n }\n this._advance();\n var /** @type {?} */ name = this._input.substring(start.offset + 1, this._index - 1);\n var /** @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 _Tokenizer.prototype._consumeRawText = function (decodeEntities, firstCharOfEnd, attemptEndRest) {\n var /** @type {?} */ tagCloseStart;\n var /** @type {?} */ textStart = this._getLocation();\n this._beginToken(decodeEntities ? TokenType$1.ESCAPABLE_RAW_TEXT : TokenType$1.RAW_TEXT, textStart);\n var /** @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 _Tokenizer.prototype._consumeComment = function (start) {\n var _this = this;\n this._beginToken(TokenType$1.COMMENT_START, start);\n this._requireCharCode($MINUS);\n this._endToken([]);\n var /** @type {?} */ textToken = this._consumeRawText(false, $MINUS, function () { return _this._attemptStr('->'); });\n this._beginToken(TokenType$1.COMMENT_END, textToken.sourceSpan.end);\n this._endToken([]);\n };\n /**\n * @param {?} start\n * @return {?}\n */\n _Tokenizer.prototype._consumeCdata = function (start) {\n var _this = this;\n this._beginToken(TokenType$1.CDATA_START, start);\n this._requireStr('CDATA[');\n this._endToken([]);\n var /** @type {?} */ textToken = this._consumeRawText(false, $RBRACKET, function () { return _this._attemptStr(']>'); });\n this._beginToken(TokenType$1.CDATA_END, textToken.sourceSpan.end);\n this._endToken([]);\n };\n /**\n * @param {?} start\n * @return {?}\n */\n _Tokenizer.prototype._consumeDocType = function (start) {\n this._beginToken(TokenType$1.DOC_TYPE, start);\n this._attemptUntilChar($GT);\n this._advance();\n this._endToken([this._input.substring(start.offset + 2, this._index - 1)]);\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumePrefixAndName = function () {\n var /** @type {?} */ nameOrPrefixStart = this._index;\n var /** @type {?} */ prefix = ((null));\n while (this._peek !== $COLON && !isPrefixEnd(this._peek)) {\n this._advance();\n }\n var /** @type {?} */ nameStart;\n if (this._peek === $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 var /** @type {?} */ name = this._input.substring(nameStart, this._index);\n return [prefix, name];\n };\n /**\n * @param {?} start\n * @return {?}\n */\n _Tokenizer.prototype._consumeTagOpen = function (start) {\n var /** @type {?} */ savedPos = this._savePosition();\n var /** @type {?} */ tagName;\n var /** @type {?} */ lowercaseTagName;\n try {\n if (!isAsciiLetter(this._peek)) {\n throw this._createError(_unexpectedCharacterErrorMsg(this._peek), this._getSpan());\n }\n var /** @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 !== $SLASH && this._peek !== $GT) {\n this._consumeAttributeName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (this._attemptCharCode($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$1.TEXT, start);\n this._endToken(['<']);\n return;\n }\n throw e;\n }\n var /** @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 _Tokenizer.prototype._consumeRawTextWithTagClose = function (lowercaseTagName, decodeEntities) {\n var _this = this;\n var /** @type {?} */ textToken = this._consumeRawText(decodeEntities, $LT, function () {\n if (!_this._attemptCharCode($SLASH))\n return false;\n _this._attemptCharCodeUntilFn(isNotWhitespace);\n if (!_this._attemptStrCaseInsensitive(lowercaseTagName))\n return false;\n _this._attemptCharCodeUntilFn(isNotWhitespace);\n return _this._attemptCharCode($GT);\n });\n this._beginToken(TokenType$1.TAG_CLOSE, textToken.sourceSpan.end);\n this._endToken([/** @type {?} */ ((null)), lowercaseTagName]);\n };\n /**\n * @param {?} start\n * @return {?}\n */\n _Tokenizer.prototype._consumeTagOpenStart = function (start) {\n this._beginToken(TokenType$1.TAG_OPEN_START, start);\n var /** @type {?} */ parts = this._consumePrefixAndName();\n this._endToken(parts);\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeAttributeName = function () {\n this._beginToken(TokenType$1.ATTR_NAME);\n var /** @type {?} */ prefixAndName = this._consumePrefixAndName();\n this._endToken(prefixAndName);\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeAttributeValue = function () {\n this._beginToken(TokenType$1.ATTR_VALUE);\n var /** @type {?} */ value;\n if (this._peek === $SQ || this._peek === $DQ) {\n var /** @type {?} */ quoteChar = this._peek;\n this._advance();\n var /** @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 var /** @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 _Tokenizer.prototype._consumeTagOpenEnd = function () {\n var /** @type {?} */ tokenType = this._attemptCharCode($SLASH) ? TokenType$1.TAG_OPEN_END_VOID : TokenType$1.TAG_OPEN_END;\n this._beginToken(tokenType);\n this._requireCharCode($GT);\n this._endToken([]);\n };\n /**\n * @param {?} start\n * @return {?}\n */\n _Tokenizer.prototype._consumeTagClose = function (start) {\n this._beginToken(TokenType$1.TAG_CLOSE, start);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n var /** @type {?} */ prefixAndName = this._consumePrefixAndName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._requireCharCode($GT);\n this._endToken(prefixAndName);\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeExpansionFormStart = function () {\n this._beginToken(TokenType$1.EXPANSION_FORM_START, this._getLocation());\n this._requireCharCode($LBRACE);\n this._endToken([]);\n this._expansionCaseStack.push(TokenType$1.EXPANSION_FORM_START);\n this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());\n var /** @type {?} */ condition = this._readUntil($COMMA);\n this._endToken([condition], this._getLocation());\n this._requireCharCode($COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._beginToken(TokenType$1.RAW_TEXT, this._getLocation());\n var /** @type {?} */ type = this._readUntil($COMMA);\n this._endToken([type], this._getLocation());\n this._requireCharCode($COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeExpansionCaseStart = function () {\n this._beginToken(TokenType$1.EXPANSION_CASE_VALUE, this._getLocation());\n var /** @type {?} */ value = this._readUntil($LBRACE).trim();\n this._endToken([value], this._getLocation());\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._beginToken(TokenType$1.EXPANSION_CASE_EXP_START, this._getLocation());\n this._requireCharCode($LBRACE);\n this._endToken([], this._getLocation());\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._expansionCaseStack.push(TokenType$1.EXPANSION_CASE_EXP_START);\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeExpansionCaseEnd = function () {\n this._beginToken(TokenType$1.EXPANSION_CASE_EXP_END, this._getLocation());\n this._requireCharCode($RBRACE);\n this._endToken([], this._getLocation());\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._expansionCaseStack.pop();\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeExpansionFormEnd = function () {\n this._beginToken(TokenType$1.EXPANSION_FORM_END, this._getLocation());\n this._requireCharCode($RBRACE);\n this._endToken([]);\n this._expansionCaseStack.pop();\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._consumeText = function () {\n var /** @type {?} */ start = this._getLocation();\n this._beginToken(TokenType$1.TEXT, start);\n var /** @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 _Tokenizer.prototype._isTextEnd = function () {\n if (this._peek === $LT || this._peek === $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 === $RBRACE && this._isInExpansionCase()) {\n // end of and expansion case\n return true;\n }\n }\n return false;\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._savePosition = function () {\n return [this._peek, this._index, this._column, this._line, this.tokens.length];\n };\n /**\n * @param {?} char\n * @return {?}\n */\n _Tokenizer.prototype._readUntil = function (char) {\n var /** @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 _Tokenizer.prototype._restorePosition = function (position) {\n this._peek = position[0];\n this._index = position[1];\n this._column = position[2];\n this._line = position[3];\n var /** @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 _Tokenizer.prototype._isInExpansionCase = function () {\n return this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n TokenType$1.EXPANSION_CASE_EXP_START;\n };\n /**\n * @return {?}\n */\n _Tokenizer.prototype._isInExpansionForm = function () {\n return this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n TokenType$1.EXPANSION_FORM_START;\n };\n return _Tokenizer;\n}());\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNotWhitespace(code) {\n return !isWhitespace(code) || code === $EOF;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNameEnd(code) {\n return isWhitespace(code) || code === $GT || code === $SLASH ||\n code === $SQ || code === $DQ || code === $EQ;\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isPrefixEnd(code) {\n return (code < $a || $z < code) && (code < $A || $Z < code) &&\n (code < $0 || code > $9);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isDigitEntityEnd(code) {\n return code == $SEMICOLON || code == $EOF || !isAsciiHexDigit(code);\n}\n/**\n * @param {?} code\n * @return {?}\n */\nfunction isNamedEntityEnd(code) {\n return code == $SEMICOLON || code == $EOF || !isAsciiLetter(code);\n}\n/**\n * @param {?} input\n * @param {?} offset\n * @param {?} interpolationConfig\n * @return {?}\n */\nfunction isExpansionFormStart(input, offset, interpolationConfig) {\n var /** @type {?} */ isInterpolationStart = interpolationConfig ? input.indexOf(interpolationConfig.start, offset) == offset : false;\n return input.charCodeAt(offset) == $LBRACE && !isInterpolationStart;\n}\n/**\n * @param {?} peek\n * @return {?}\n */\nfunction isExpansionCaseStart(peek) {\n return peek === $EQ || isAsciiLetter(peek) || 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 >= $a && code <= $z ? code - $a + $A : code;\n}\n/**\n * @param {?} srcTokens\n * @return {?}\n */\nfunction mergeTextTokens(srcTokens) {\n var /** @type {?} */ dstTokens = [];\n var /** @type {?} */ lastDstToken = undefined;\n for (var /** @type {?} */ i = 0; i < srcTokens.length; i++) {\n var /** @type {?} */ token = srcTokens[i];\n if (lastDstToken && lastDstToken.type == TokenType$1.TEXT && token.type == TokenType$1.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/**\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 */\nvar TreeError = (function (_super) {\n tslib_1.__extends(TreeError, _super);\n /**\n * @param {?} elementName\n * @param {?} span\n * @param {?} msg\n */\n function TreeError(elementName, span, msg) {\n var _this = _super.call(this, span, msg) || this;\n _this.elementName = elementName;\n return _this;\n }\n /**\n * @param {?} elementName\n * @param {?} span\n * @param {?} msg\n * @return {?}\n */\n TreeError.create = function (elementName, span, msg) {\n return new TreeError(elementName, span, msg);\n };\n return TreeError;\n}(ParseError));\nvar ParseTreeResult = (function () {\n /**\n * @param {?} rootNodes\n * @param {?} errors\n */\n function ParseTreeResult(rootNodes, errors) {\n this.rootNodes = rootNodes;\n this.errors = errors;\n }\n return ParseTreeResult;\n}());\nvar Parser$1 = (function () {\n /**\n * @param {?} getTagDefinition\n */\n function Parser$1(getTagDefinition) {\n this.getTagDefinition = getTagDefinition;\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n Parser$1.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @type {?} */ tokensAndErrors = tokenize(source, url, this.getTagDefinition, parseExpansionForms, interpolationConfig);\n var /** @type {?} */ treeAndErrors = new _TreeBuilder(tokensAndErrors.tokens, this.getTagDefinition).build();\n return new ParseTreeResult(treeAndErrors.rootNodes, ((tokensAndErrors.errors)).concat(treeAndErrors.errors));\n };\n return Parser$1;\n}());\nvar _TreeBuilder = (function () {\n /**\n * @param {?} tokens\n * @param {?} getTagDefinition\n */\n function _TreeBuilder(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 _TreeBuilder.prototype.build = function () {\n while (this._peek.type !== TokenType$1.EOF) {\n if (this._peek.type === TokenType$1.TAG_OPEN_START) {\n this._consumeStartTag(this._advance());\n }\n else if (this._peek.type === TokenType$1.TAG_CLOSE) {\n this._consumeEndTag(this._advance());\n }\n else if (this._peek.type === TokenType$1.CDATA_START) {\n this._closeVoidElement();\n this._consumeCdata(this._advance());\n }\n else if (this._peek.type === TokenType$1.COMMENT_START) {\n this._closeVoidElement();\n this._consumeComment(this._advance());\n }\n else if (this._peek.type === TokenType$1.TEXT || this._peek.type === TokenType$1.RAW_TEXT ||\n this._peek.type === TokenType$1.ESCAPABLE_RAW_TEXT) {\n this._closeVoidElement();\n this._consumeText(this._advance());\n }\n else if (this._peek.type === TokenType$1.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 _TreeBuilder.prototype._advance = function () {\n var /** @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 _TreeBuilder.prototype._advanceIf = function (type) {\n if (this._peek.type === type) {\n return this._advance();\n }\n return null;\n };\n /**\n * @param {?} startToken\n * @return {?}\n */\n _TreeBuilder.prototype._consumeCdata = function (startToken) {\n this._consumeText(this._advance());\n this._advanceIf(TokenType$1.CDATA_END);\n };\n /**\n * @param {?} token\n * @return {?}\n */\n _TreeBuilder.prototype._consumeComment = function (token) {\n var /** @type {?} */ text = this._advanceIf(TokenType$1.RAW_TEXT);\n this._advanceIf(TokenType$1.COMMENT_END);\n var /** @type {?} */ value = text != null ? text.parts[0].trim() : null;\n this._addToParent(new Comment(value, token.sourceSpan));\n };\n /**\n * @param {?} token\n * @return {?}\n */\n _TreeBuilder.prototype._consumeExpansion = function (token) {\n var /** @type {?} */ switchValue = this._advance();\n var /** @type {?} */ type = this._advance();\n var /** @type {?} */ cases = [];\n // read =\n while (this._peek.type === TokenType$1.EXPANSION_CASE_VALUE) {\n var /** @type {?} */ expCase = this._parseExpansionCase();\n if (!expCase)\n return; // error\n cases.push(expCase);\n }\n // read the final }\n if (this._peek.type !== TokenType$1.EXPANSION_FORM_END) {\n this._errors.push(TreeError.create(null, this._peek.sourceSpan, \"Invalid ICU message. Missing '}'.\"));\n return;\n }\n var /** @type {?} */ sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end);\n this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));\n this._advance();\n };\n /**\n * @return {?}\n */\n _TreeBuilder.prototype._parseExpansionCase = function () {\n var /** @type {?} */ value = this._advance();\n // read {\n if (this._peek.type !== TokenType$1.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 var /** @type {?} */ start = this._advance();\n var /** @type {?} */ exp = this._collectExpansionExpTokens(start);\n if (!exp)\n return null;\n var /** @type {?} */ end = this._advance();\n exp.push(new Token$1(TokenType$1.EOF, [], end.sourceSpan));\n // parse everything in between { and }\n var /** @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 var /** @type {?} */ sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end);\n var /** @type {?} */ expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end);\n return new ExpansionCase(value.parts[0], parsedExp.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan);\n };\n /**\n * @param {?} start\n * @return {?}\n */\n _TreeBuilder.prototype._collectExpansionExpTokens = function (start) {\n var /** @type {?} */ exp = [];\n var /** @type {?} */ expansionFormStack = [TokenType$1.EXPANSION_CASE_EXP_START];\n while (true) {\n if (this._peek.type === TokenType$1.EXPANSION_FORM_START ||\n this._peek.type === TokenType$1.EXPANSION_CASE_EXP_START) {\n expansionFormStack.push(this._peek.type);\n }\n if (this._peek.type === TokenType$1.EXPANSION_CASE_EXP_END) {\n if (lastOnStack(expansionFormStack, TokenType$1.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 === TokenType$1.EXPANSION_FORM_END) {\n if (lastOnStack(expansionFormStack, TokenType$1.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 === TokenType$1.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 _TreeBuilder.prototype._consumeText = function (token) {\n var /** @type {?} */ text = token.parts[0];\n if (text.length > 0 && text[0] == '\\n') {\n var /** @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 Text(text, token.sourceSpan));\n }\n };\n /**\n * @return {?}\n */\n _TreeBuilder.prototype._closeVoidElement = function () {\n var /** @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 _TreeBuilder.prototype._consumeStartTag = function (startTagToken) {\n var /** @type {?} */ prefix = startTagToken.parts[0];\n var /** @type {?} */ name = startTagToken.parts[1];\n var /** @type {?} */ attrs = [];\n while (this._peek.type === TokenType$1.ATTR_NAME) {\n attrs.push(this._consumeAttr(this._advance()));\n }\n var /** @type {?} */ fullName = this._getElementFullName(prefix, name, this._getParentElement());\n var /** @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 === TokenType$1.TAG_OPEN_END_VOID) {\n this._advance();\n selfClosing = true;\n var /** @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 === TokenType$1.TAG_OPEN_END) {\n this._advance();\n selfClosing = false;\n }\n var /** @type {?} */ end = this._peek.sourceSpan.start;\n var /** @type {?} */ span = new ParseSourceSpan(startTagToken.sourceSpan.start, end);\n var /** @type {?} */ el = new 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 _TreeBuilder.prototype._pushElement = function (el) {\n var /** @type {?} */ parentEl = this._getParentElement();\n if (parentEl && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {\n this._elementStack.pop();\n }\n var /** @type {?} */ tagDef = this.getTagDefinition(el.name);\n var _a = this._getParentElementSkippingContainers(), parent = _a.parent, container = _a.container;\n if (parent && tagDef.requireExtraParent(parent.name)) {\n var /** @type {?} */ newParent = new 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 _TreeBuilder.prototype._consumeEndTag = function (endTagToken) {\n var /** @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 var /** @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 _TreeBuilder.prototype._popElement = function (fullName) {\n for (var /** @type {?} */ stackIndex = this._elementStack.length - 1; stackIndex >= 0; stackIndex--) {\n var /** @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 _TreeBuilder.prototype._consumeAttr = function (attrName) {\n var /** @type {?} */ fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);\n var /** @type {?} */ end = attrName.sourceSpan.end;\n var /** @type {?} */ value = '';\n var /** @type {?} */ valueSpan = ((undefined));\n if (this._peek.type === TokenType$1.ATTR_VALUE) {\n var /** @type {?} */ valueToken = this._advance();\n value = valueToken.parts[0];\n end = valueToken.sourceSpan.end;\n valueSpan = valueToken.sourceSpan;\n }\n return new Attribute$1(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, end), valueSpan);\n };\n /**\n * @return {?}\n */\n _TreeBuilder.prototype._getParentElement = function () {\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 _TreeBuilder.prototype._getParentElementSkippingContainers = function () {\n var /** @type {?} */ container = null;\n for (var /** @type {?} */ i = this._elementStack.length - 1; i >= 0; i--) {\n if (!isNgContainer(this._elementStack[i].name)) {\n return { parent: this._elementStack[i], container: container };\n }\n container = this._elementStack[i];\n }\n return { parent: null, container: container };\n };\n /**\n * @param {?} node\n * @return {?}\n */\n _TreeBuilder.prototype._addToParent = function (node) {\n var /** @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 _TreeBuilder.prototype._insertBeforeContainer = function (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 var /** @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 _TreeBuilder.prototype._getElementFullName = function (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 return _TreeBuilder;\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/**\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 * @param {?} message\n * @return {?}\n */\nfunction digest(message) {\n return message.id || sha1(serializeNodes(message.nodes).join('') + (\"[\" + message.meaning + \"]\"));\n}\n/**\n * @param {?} message\n * @return {?}\n */\nfunction decimalDigest(message) {\n if (message.id) {\n return message.id;\n }\n var /** @type {?} */ visitor = new _SerializerIgnoreIcuExpVisitor();\n var /** @type {?} */ parts = message.nodes.map(function (a) { return 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 */\nvar _SerializerVisitor = (function () {\n function _SerializerVisitor() {\n }\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n _SerializerVisitor.prototype.visitText = function (text, context) { return text.value; };\n /**\n * @param {?} container\n * @param {?} context\n * @return {?}\n */\n _SerializerVisitor.prototype.visitContainer = function (container, context) {\n var _this = this;\n return \"[\" + container.children.map(function (child) { return child.visit(_this); }).join(', ') + \"]\";\n };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n _SerializerVisitor.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ strCases = Object.keys(icu.cases).map(function (k) { return 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 _SerializerVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n var _this = this;\n return ph.isVoid ?\n \"\" :\n \"\" + ph.children.map(function (child) { return child.visit(_this); }).join(', ') + \"\";\n };\n /**\n * @param {?} ph\n * @param {?} context\n * @return {?}\n */\n _SerializerVisitor.prototype.visitPlaceholder = function (ph, context) {\n return ph.value ? \"\" + ph.value + \"\" : \"\";\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _SerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n return \"\" + ph.value.visit(this) + \"\";\n };\n return _SerializerVisitor;\n}());\nvar serializerVisitor = new _SerializerVisitor();\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction serializeNodes(nodes) {\n return nodes.map(function (a) { return 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 */\nvar _SerializerIgnoreIcuExpVisitor = (function (_super) {\n tslib_1.__extends(_SerializerIgnoreIcuExpVisitor, _super);\n function _SerializerIgnoreIcuExpVisitor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n _SerializerIgnoreIcuExpVisitor.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ strCases = Object.keys(icu.cases).map(function (k) { return k + \" {\" + icu.cases[k].visit(_this) + \"}\"; });\n // Do not take the expression into account\n return \"{\" + icu.type + \", \" + strCases.join(', ') + \"}\";\n };\n return _SerializerIgnoreIcuExpVisitor;\n}(_SerializerVisitor));\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 */\nfunction sha1(str) {\n var /** @type {?} */ utf8 = utf8Encode(str);\n var /** @type {?} */ words32 = stringToWords32(utf8, Endian.Big);\n var /** @type {?} */ len = utf8.length * 8;\n var /** @type {?} */ w = new Array(80);\n var _a = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0], a = _a[0], b = _a[1], c = _a[2], d = _a[3], e = _a[4];\n words32[len >> 5] |= 0x80 << (24 - len % 32);\n words32[((len + 64 >> 9) << 4) + 15] = len;\n for (var /** @type {?} */ i = 0; i < words32.length; i += 16) {\n var _b = [a, b, c, d, e], h0 = _b[0], h1 = _b[1], h2 = _b[2], h3 = _b[3], h4 = _b[4];\n for (var /** @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 var _c = fk(j, b, c, d), f = _c[0], k = _c[1];\n var /** @type {?} */ temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);\n _d = [d, c, rol32(b, 30), a, temp], e = _d[0], d = _d[1], c = _d[2], b = _d[3], a = _d[4];\n }\n _e = [add32(a, h0), add32(b, h1), add32(c, h2), add32(d, h3), add32(e, h4)], a = _e[0], b = _e[1], c = _e[2], d = _e[3], e = _e[4];\n }\n return byteStringToHexString(words32ToByteString([a, b, c, d, e]));\n var _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 */\nfunction fingerprint(str) {\n var /** @type {?} */ utf8 = utf8Encode(str);\n var _a = [hash32(utf8, 0), hash32(utf8, 102072)], hi = _a[0], lo = _a[1];\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 */\nfunction computeMsgId(msg, meaning) {\n var _a = fingerprint(msg), hi = _a[0], lo = _a[1];\n if (meaning) {\n var _b = fingerprint(meaning), him = _b[0], lom = _b[1];\n _c = add64(rol64([hi, lo], 1), [him, lom]), hi = _c[0], lo = _c[1];\n }\n return byteStringToDecString(words32ToByteString([hi & 0x7fffffff, lo]));\n var _c;\n}\n/**\n * @param {?} str\n * @param {?} c\n * @return {?}\n */\nfunction hash32(str, c) {\n var _a = [0x9e3779b9, 0x9e3779b9], a = _a[0], b = _a[1];\n var /** @type {?} */ i;\n var /** @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 _b = mix([a, b, c]), a = _b[0], b = _b[1], c = _b[2];\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 var _b;\n}\n/**\n * @param {?} __0\n * @return {?}\n */\nfunction mix(_a) {\n var a = _a[0], b = _a[1], c = _a[2];\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}\nvar 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 var /** @type {?} */ low = (a & 0xffff) + (b & 0xffff);\n var /** @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(_a, _b) {\n var ah = _a[0], al = _a[1];\n var bh = _b[0], bl = _b[1];\n var _c = add32to64(al, bl), carry = _c[0], l = _c[1];\n var /** @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 var /** @type {?} */ low = (a & 0xffff) - (b & 0xffff);\n var /** @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(_a, count) {\n var hi = _a[0], lo = _a[1];\n var /** @type {?} */ h = (hi << count) | (lo >>> (32 - count));\n var /** @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 var /** @type {?} */ words32 = Array((str.length + 3) >>> 2);\n for (var /** @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 var /** @type {?} */ word = 0;\n if (endian === Endian.Big) {\n for (var /** @type {?} */ i = 0; i < 4; i++) {\n word += byteAt(str, index + i) << (24 - 8 * i);\n }\n }\n else {\n for (var /** @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(function (str, word) { return str + word32ToByteString(word); }, '');\n}\n/**\n * @param {?} word\n * @return {?}\n */\nfunction word32ToByteString(word) {\n var /** @type {?} */ str = '';\n for (var /** @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 var /** @type {?} */ hex = '';\n for (var /** @type {?} */ i = 0; i < str.length; i++) {\n var /** @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 var /** @type {?} */ decimal = '';\n var /** @type {?} */ toThePower = '1';\n for (var /** @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 var /** @type {?} */ sum = '';\n var /** @type {?} */ len = Math.max(x.length, y.length);\n for (var /** @type {?} */ i = 0, /** @type {?} */ carry = 0; i < len || carry; i++) {\n var /** @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 var /** @type {?} */ product = '';\n var /** @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/**\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 */\nvar Message = (function () {\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 function Message(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 return Message;\n}());\nvar Text$1 = (function () {\n /**\n * @param {?} value\n * @param {?} sourceSpan\n */\n function Text$1(value, sourceSpan) {\n this.value = value;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Text$1.prototype.visit = function (visitor, context) { return visitor.visitText(this, context); };\n return Text$1;\n}());\nvar Container = (function () {\n /**\n * @param {?} children\n * @param {?} sourceSpan\n */\n function Container(children, sourceSpan) {\n this.children = children;\n this.sourceSpan = sourceSpan;\n }\n /**\n * @param {?} visitor\n * @param {?=} context\n * @return {?}\n */\n Container.prototype.visit = function (visitor, context) { return visitor.visitContainer(this, context); };\n return Container;\n}());\nvar Icu = (function () {\n /**\n * @param {?} expression\n * @param {?} type\n * @param {?} cases\n * @param {?} sourceSpan\n */\n function Icu(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 Icu.prototype.visit = function (visitor, context) { return visitor.visitIcu(this, context); };\n return Icu;\n}());\nvar TagPlaceholder = (function () {\n /**\n * @param {?} tag\n * @param {?} attrs\n * @param {?} startName\n * @param {?} closeName\n * @param {?} children\n * @param {?} isVoid\n * @param {?} sourceSpan\n */\n function TagPlaceholder(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 TagPlaceholder.prototype.visit = function (visitor, context) { return visitor.visitTagPlaceholder(this, context); };\n return TagPlaceholder;\n}());\nvar Placeholder = (function () {\n /**\n * @param {?} value\n * @param {?} name\n * @param {?} sourceSpan\n */\n function Placeholder(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 Placeholder.prototype.visit = function (visitor, context) { return visitor.visitPlaceholder(this, context); };\n return Placeholder;\n}());\nvar IcuPlaceholder = (function () {\n /**\n * @param {?} value\n * @param {?} name\n * @param {?} sourceSpan\n */\n function IcuPlaceholder(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 IcuPlaceholder.prototype.visit = function (visitor, context) { return visitor.visitIcuPlaceholder(this, context); };\n return IcuPlaceholder;\n}());\nvar CloneVisitor = (function () {\n function CloneVisitor() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n CloneVisitor.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n CloneVisitor.prototype.visitContainer = function (container, context) {\n var _this = this;\n var /** @type {?} */ children = container.children.map(function (n) { return n.visit(_this, context); });\n return new Container(children, container.sourceSpan);\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n CloneVisitor.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ cases = {};\n Object.keys(icu.cases).forEach(function (key) { return cases[key] = icu.cases[key].visit(_this, context); });\n var /** @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 CloneVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n var _this = this;\n var /** @type {?} */ children = ph.children.map(function (n) { return 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 CloneVisitor.prototype.visitPlaceholder = function (ph, context) {\n return new Placeholder(ph.value, ph.name, ph.sourceSpan);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n CloneVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);\n };\n return CloneVisitor;\n}());\nvar RecurseVisitor = (function () {\n function RecurseVisitor() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n RecurseVisitor.prototype.visitText = function (text, context) { };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n RecurseVisitor.prototype.visitContainer = function (container, context) {\n var _this = this;\n container.children.forEach(function (child) { return child.visit(_this); });\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n RecurseVisitor.prototype.visitIcu = function (icu, context) {\n var _this = this;\n Object.keys(icu.cases).forEach(function (k) { icu.cases[k].visit(_this); });\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n RecurseVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n var _this = this;\n ph.children.forEach(function (child) { return child.visit(_this); });\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n RecurseVisitor.prototype.visitPlaceholder = function (ph, context) { };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n RecurseVisitor.prototype.visitIcuPlaceholder = function (ph, context) { };\n return RecurseVisitor;\n}());\n/**\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 */\nvar 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 */\nvar PlaceholderRegistry = (function () {\n function PlaceholderRegistry() {\n this._placeHolderNameCounts = {};\n this._signatureToName = {};\n }\n /**\n * @param {?} tag\n * @param {?} attrs\n * @param {?} isVoid\n * @return {?}\n */\n PlaceholderRegistry.prototype.getStartTagPlaceholderName = function (tag, attrs, isVoid) {\n var /** @type {?} */ signature = this._hashTag(tag, attrs, isVoid);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n var /** @type {?} */ upperTag = tag.toUpperCase();\n var /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || \"TAG_\" + upperTag;\n var /** @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 PlaceholderRegistry.prototype.getCloseTagPlaceholderName = function (tag) {\n var /** @type {?} */ signature = this._hashClosingTag(tag);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n var /** @type {?} */ upperTag = tag.toUpperCase();\n var /** @type {?} */ baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || \"TAG_\" + upperTag;\n var /** @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 PlaceholderRegistry.prototype.getPlaceholderName = function (name, content) {\n var /** @type {?} */ upperName = name.toUpperCase();\n var /** @type {?} */ signature = \"PH: \" + upperName + \"=\" + content;\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n var /** @type {?} */ uniqueName = this._generateUniqueName(upperName);\n this._signatureToName[signature] = uniqueName;\n return uniqueName;\n };\n /**\n * @param {?} name\n * @return {?}\n */\n PlaceholderRegistry.prototype.getUniquePlaceholder = function (name) {\n return this._generateUniqueName(name.toUpperCase());\n };\n /**\n * @param {?} tag\n * @param {?} attrs\n * @param {?} isVoid\n * @return {?}\n */\n PlaceholderRegistry.prototype._hashTag = function (tag, attrs, isVoid) {\n var /** @type {?} */ start = \"<\" + tag;\n var /** @type {?} */ strAttrs = Object.keys(attrs).sort().map(function (name) { return \" \" + name + \"=\" + attrs[name]; }).join('');\n var /** @type {?} */ end = isVoid ? '/>' : \">\";\n return start + strAttrs + end;\n };\n /**\n * @param {?} tag\n * @return {?}\n */\n PlaceholderRegistry.prototype._hashClosingTag = function (tag) { return this._hashTag(\"/\" + tag, {}, false); };\n /**\n * @param {?} base\n * @return {?}\n */\n PlaceholderRegistry.prototype._generateUniqueName = function (base) {\n var /** @type {?} */ seen = this._placeHolderNameCounts.hasOwnProperty(base);\n if (!seen) {\n this._placeHolderNameCounts[base] = 1;\n return base;\n }\n var /** @type {?} */ id = this._placeHolderNameCounts[base];\n this._placeHolderNameCounts[base] = id + 1;\n return base + \"_\" + id;\n };\n return PlaceholderRegistry;\n}());\n/**\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 */\nvar _expParser = new Parser(new Lexer());\n/**\n * Returns a function converting html nodes to an i18n Message given an interpolationConfig\n * @param {?} interpolationConfig\n * @return {?}\n */\nfunction createI18nMessageFactory(interpolationConfig) {\n var /** @type {?} */ visitor = new _I18nVisitor(_expParser, interpolationConfig);\n return function (nodes, meaning, description, id) { return visitor.toI18nMessage(nodes, meaning, description, id); };\n}\nvar _I18nVisitor = (function () {\n /**\n * @param {?} _expressionParser\n * @param {?} _interpolationConfig\n */\n function _I18nVisitor(_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 _I18nVisitor.prototype.toI18nMessage = function (nodes, meaning, description, id) {\n this._isIcu = nodes.length == 1 && nodes[0] instanceof Expansion;\n this._icuDepth = 0;\n this._placeholderRegistry = new PlaceholderRegistry();\n this._placeholderToContent = {};\n this._placeholderToMessage = {};\n var /** @type {?} */ i18nodes = visitAll(this, nodes, {});\n return new Message(i18nodes, this._placeholderToContent, this._placeholderToMessage, meaning, description, id);\n };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n _I18nVisitor.prototype.visitElement = function (el, context) {\n var /** @type {?} */ children = visitAll(this, el.children);\n var /** @type {?} */ attrs = {};\n el.attrs.forEach(function (attr) {\n // Do not visit the attributes, translatable ones are top-level ASTs\n attrs[attr.name] = attr.value;\n });\n var /** @type {?} */ isVoid = getHtmlTagDefinition(el.name).isVoid;\n var /** @type {?} */ startPhName = this._placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);\n this._placeholderToContent[startPhName] = ((el.sourceSpan)).toString();\n var /** @type {?} */ closePhName = '';\n if (!isVoid) {\n closePhName = this._placeholderRegistry.getCloseTagPlaceholderName(el.name);\n this._placeholderToContent[closePhName] = \"\";\n }\n return new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, /** @type {?} */ ((el.sourceSpan)));\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n _I18nVisitor.prototype.visitAttribute = function (attribute, context) {\n return this._visitTextWithInterpolation(attribute.value, attribute.sourceSpan);\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n _I18nVisitor.prototype.visitText = function (text, context) {\n return this._visitTextWithInterpolation(text.value, /** @type {?} */ ((text.sourceSpan)));\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n _I18nVisitor.prototype.visitComment = function (comment, context) { return null; };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n _I18nVisitor.prototype.visitExpansion = function (icu, context) {\n var _this = this;\n this._icuDepth++;\n var /** @type {?} */ i18nIcuCases = {};\n var /** @type {?} */ i18nIcu = new Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);\n icu.cases.forEach(function (caze) {\n i18nIcuCases[caze.value] = new Container(caze.expression.map(function (node) { return 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 var /** @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 var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());\n var /** @type {?} */ visitor = new _I18nVisitor(this._expressionParser, this._interpolationConfig);\n this._placeholderToMessage[phName] = visitor.toI18nMessage([icu], '', '', '');\n return new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n _I18nVisitor.prototype.visitExpansionCase = function (icuCase, context) {\n throw new Error('Unreachable code');\n };\n /**\n * @param {?} text\n * @param {?} sourceSpan\n * @return {?}\n */\n _I18nVisitor.prototype._visitTextWithInterpolation = function (text, sourceSpan) {\n var /** @type {?} */ splitInterpolation = this._expressionParser.splitInterpolation(text, sourceSpan.start.toString(), this._interpolationConfig);\n if (!splitInterpolation) {\n // No expression, return a single text\n return new Text$1(text, sourceSpan);\n }\n // Return a group of text + expressions\n var /** @type {?} */ nodes = [];\n var /** @type {?} */ container = new Container(nodes, sourceSpan);\n var _a = this._interpolationConfig, sDelimiter = _a.start, eDelimiter = _a.end;\n for (var /** @type {?} */ i = 0; i < splitInterpolation.strings.length - 1; i++) {\n var /** @type {?} */ expression = splitInterpolation.expressions[i];\n var /** @type {?} */ baseName = _extractPlaceholderName(expression) || 'INTERPOLATION';\n var /** @type {?} */ phName = this._placeholderRegistry.getPlaceholderName(baseName, expression);\n if (splitInterpolation.strings[i].length) {\n // No need to add empty strings\n nodes.push(new Text$1(splitInterpolation.strings[i], sourceSpan));\n }\n nodes.push(new Placeholder(expression, phName, sourceSpan));\n this._placeholderToContent[phName] = sDelimiter + expression + eDelimiter;\n }\n // The last index contains no expression\n var /** @type {?} */ lastStringIdx = splitInterpolation.strings.length - 1;\n if (splitInterpolation.strings[lastStringIdx].length) {\n nodes.push(new Text$1(splitInterpolation.strings[lastStringIdx], sourceSpan));\n }\n return container;\n };\n return _I18nVisitor;\n}());\nvar _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/**\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 * An i18n error.\n */\nvar I18nError = (function (_super) {\n tslib_1.__extends(I18nError, _super);\n /**\n * @param {?} span\n * @param {?} msg\n */\n function I18nError(span, msg) {\n return _super.call(this, span, msg) || this;\n }\n return I18nError;\n}(ParseError));\n/**\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 */\nvar _I18N_ATTR = 'i18n';\nvar _I18N_ATTR_PREFIX = 'i18n-';\nvar _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/;\nvar MEANING_SEPARATOR = '|';\nvar 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 */\nfunction extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {\n var /** @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 */\nfunction mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) {\n var /** @type {?} */ visitor = new _Visitor(implicitTags, implicitAttrs);\n return visitor.merge(nodes, translations, interpolationConfig);\n}\nvar ExtractionResult = (function () {\n /**\n * @param {?} messages\n * @param {?} errors\n */\n function ExtractionResult(messages, errors) {\n this.messages = messages;\n this.errors = errors;\n }\n return ExtractionResult;\n}());\nvar _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 */\nvar _Visitor = (function () {\n /**\n * @param {?} _implicitTags\n * @param {?} _implicitAttrs\n */\n function _Visitor(_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 _Visitor.prototype.extract = function (nodes, interpolationConfig) {\n var _this = this;\n this._init(_VisitorMode.Extract, interpolationConfig);\n nodes.forEach(function (node) { return 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 _Visitor.prototype.merge = function (nodes, translations, interpolationConfig) {\n this._init(_VisitorMode.Merge, interpolationConfig);\n this._translations = translations;\n // Construct a single fake root element\n var /** @type {?} */ wrapper = new Element('wrapper', [], nodes, /** @type {?} */ ((undefined)), undefined, undefined);\n var /** @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 _Visitor.prototype.visitExpansionCase = function (icuCase, context) {\n // Parse cases for translatable html attributes\n var /** @type {?} */ expression = visitAll(this, icuCase.expression, context);\n if (this._mode === _VisitorMode.Merge) {\n return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan);\n }\n };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n _Visitor.prototype.visitExpansion = function (icu, context) {\n this._mayBeAddBlockChildren(icu);\n var /** @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 var /** @type {?} */ cases = visitAll(this, icu.cases, context);\n if (this._mode === _VisitorMode.Merge) {\n icu = new 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 _Visitor.prototype.visitComment = function (comment, context) {\n var /** @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 var /** @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 var /** @type {?} */ message = ((this._addMessage(this._blockChildren, this._blockMeaningAndDesc)));\n // merge attributes in sections\n var /** @type {?} */ nodes = this._translateMessage(comment, message);\n return 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 _Visitor.prototype.visitText = function (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 _Visitor.prototype.visitElement = function (el, context) {\n var _this = this;\n this._mayBeAddBlockChildren(el);\n this._depth++;\n var /** @type {?} */ wasInI18nNode = this._inI18nNode;\n var /** @type {?} */ wasInImplicitNode = this._inImplicitNode;\n var /** @type {?} */ childNodes = [];\n var /** @type {?} */ translatedChildNodes = ((undefined));\n // Extract:\n // - top level nodes with the (implicit) \"i18n\" attribute if not already in a section\n // - ICU messages\n var /** @type {?} */ i18nAttr = _getI18nAttr(el);\n var /** @type {?} */ i18nMeta = i18nAttr ? i18nAttr.value : '';\n var /** @type {?} */ isImplicit = this._implicitTags.some(function (tag) { return el.name === tag; }) && !this._inIcu &&\n !this._isInTranslatableSection;\n var /** @type {?} */ isTopLevelImplicit = !wasInImplicitNode && isImplicit;\n this._inImplicitNode = wasInImplicitNode || isImplicit;\n if (!this._isInTranslatableSection && !this._inIcu) {\n if (i18nAttr || isTopLevelImplicit) {\n this._inI18nNode = true;\n var /** @type {?} */ message = ((this._addMessage(el.children, i18nMeta)));\n translatedChildNodes = this._translateMessage(el, message);\n }\n if (this._mode == _VisitorMode.Extract) {\n var /** @type {?} */ isTranslatable = i18nAttr || isTopLevelImplicit;\n if (isTranslatable)\n this._openTranslatableSection(el);\n 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 visitAll(this, el.children);\n }\n }\n if (this._mode === _VisitorMode.Merge) {\n var /** @type {?} */ visitNodes = translatedChildNodes || el.children;\n visitNodes.forEach(function (child) {\n var /** @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 var /** @type {?} */ translatedAttrs = this._translateAttributes(el);\n return new 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 _Visitor.prototype.visitAttribute = function (attribute, context) {\n throw new Error('unreachable code');\n };\n /**\n * @param {?} mode\n * @param {?} interpolationConfig\n * @return {?}\n */\n _Visitor.prototype._init = function (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 _Visitor.prototype._visitAttributesOf = function (el) {\n var _this = this;\n var /** @type {?} */ explicitAttrNameToValue = {};\n var /** @type {?} */ implicitAttrNames = this._implicitAttrs[el.name] || [];\n el.attrs.filter(function (attr) { return attr.name.startsWith(_I18N_ATTR_PREFIX); })\n .forEach(function (attr) { return explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] =\n attr.value; });\n el.attrs.forEach(function (attr) {\n if (attr.name in explicitAttrNameToValue) {\n _this._addMessage([attr], explicitAttrNameToValue[attr.name]);\n }\n else if (implicitAttrNames.some(function (name) { return attr.name === name; })) {\n _this._addMessage([attr]);\n }\n });\n };\n /**\n * @param {?} ast\n * @param {?=} msgMeta\n * @return {?}\n */\n _Visitor.prototype._addMessage = function (ast, msgMeta) {\n if (ast.length == 0 ||\n ast.length == 1 && ast[0] instanceof Attribute$1 && !((ast[0])).value) {\n // Do not create empty messages\n return null;\n }\n var _a = _parseMessageMeta(msgMeta), meaning = _a.meaning, description = _a.description, id = _a.id;\n var /** @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 _Visitor.prototype._translateMessage = function (el, message) {\n if (message && this._mode === _VisitorMode.Merge) {\n var /** @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 _Visitor.prototype._translateAttributes = function (el) {\n var _this = this;\n var /** @type {?} */ attributes = el.attrs;\n var /** @type {?} */ i18nParsedMessageMeta = {};\n attributes.forEach(function (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 var /** @type {?} */ translatedAttributes = [];\n attributes.forEach(function (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 var _a = i18nParsedMessageMeta[attr.name], meaning = _a.meaning, description = _a.description, id = _a.id;\n var /** @type {?} */ message = _this._createI18nMessage([attr], meaning, description, id);\n var /** @type {?} */ nodes = _this._translations.get(message);\n if (nodes) {\n if (nodes.length == 0) {\n translatedAttributes.push(new Attribute$1(attr.name, '', attr.sourceSpan));\n }\n else if (nodes[0] instanceof Text) {\n var /** @type {?} */ value = ((nodes[0])).value;\n translatedAttributes.push(new Attribute$1(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 _Visitor.prototype._mayBeAddBlockChildren = function (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 _Visitor.prototype._openTranslatableSection = function (node) {\n if (this._isInTranslatableSection) {\n this._reportError(node, 'Unexpected section start');\n }\n else {\n this._msgCountAtSectionStart = this._messages.length;\n }\n };\n Object.defineProperty(_Visitor.prototype, \"_isInTranslatableSection\", {\n /**\n * A translatable section could be:\n * - the content of translatable element,\n * - nodes between `` and `` comments\n * @return {?}\n */\n get: function () {\n return this._msgCountAtSectionStart !== void 0;\n },\n enumerable: true,\n configurable: true\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 _Visitor.prototype._closeTranslatableSection = function (node, directChildren) {\n if (!this._isInTranslatableSection) {\n this._reportError(node, 'Unexpected section end');\n return;\n }\n var /** @type {?} */ startIndex = this._msgCountAtSectionStart;\n var /** @type {?} */ significantChildren = directChildren.reduce(function (count, node) { return count + (node instanceof Comment ? 0 : 1); }, 0);\n if (significantChildren == 1) {\n for (var /** @type {?} */ i = this._messages.length - 1; i >= ((startIndex)); i--) {\n var /** @type {?} */ ast = this._messages[i].nodes;\n if (!(ast.length == 1 && ast[0] instanceof Text$1)) {\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 _Visitor.prototype._reportError = function (node, msg) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), msg));\n };\n return _Visitor;\n}());\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isOpeningComment(n) {\n return !!(n instanceof Comment && n.value && n.value.startsWith('i18n'));\n}\n/**\n * @param {?} n\n * @return {?}\n */\nfunction _isClosingComment(n) {\n return !!(n instanceof Comment && n.value && n.value === '/i18n');\n}\n/**\n * @param {?} p\n * @return {?}\n */\nfunction _getI18nAttr(p) {\n return p.attrs.find(function (attr) { return 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 var /** @type {?} */ idIndex = i18n.indexOf(ID_SEPARATOR);\n var /** @type {?} */ descIndex = i18n.indexOf(MEANING_SEPARATOR);\n var _a = (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, ''], meaningAndDesc = _a[0], id = _a[1];\n var _b = (descIndex > -1) ?\n [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] :\n ['', meaningAndDesc], meaning = _b[0], description = _b[1];\n return { meaning: meaning, description: description, id: id };\n}\n/**\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 */\nvar XmlTagDefinition = (function () {\n function XmlTagDefinition() {\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 XmlTagDefinition.prototype.requireExtraParent = function (currentParent) { return false; };\n /**\n * @param {?} name\n * @return {?}\n */\n XmlTagDefinition.prototype.isClosedByChild = function (name) { return false; };\n return XmlTagDefinition;\n}());\nvar _TAG_DEFINITION = new XmlTagDefinition();\n/**\n * @param {?} tagName\n * @return {?}\n */\nfunction getXmlTagDefinition(tagName) {\n return _TAG_DEFINITION;\n}\n/**\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 */\nvar XmlParser = (function (_super) {\n tslib_1.__extends(XmlParser, _super);\n function XmlParser() {\n return _super.call(this, getXmlTagDefinition) || this;\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @return {?}\n */\n XmlParser.prototype.parse = function (source, url, parseExpansionForms) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n return _super.prototype.parse.call(this, source, url, parseExpansionForms);\n };\n return XmlParser;\n}(Parser$1));\n/**\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 */\nvar Serializer = (function () {\n function Serializer() {\n }\n /**\n * @abstract\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Serializer.prototype.write = function (messages, locale) { };\n /**\n * @abstract\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Serializer.prototype.load = function (content, url) { };\n /**\n * @abstract\n * @param {?} message\n * @return {?}\n */\n Serializer.prototype.digest = function (message) { };\n /**\n * @param {?} message\n * @return {?}\n */\n Serializer.prototype.createNameMapper = function (message) { return null; };\n return Serializer;\n}());\n/**\n * A simple mapper that take a function to transform an internal name to a public name\n */\nvar SimplePlaceholderMapper = (function (_super) {\n tslib_1.__extends(SimplePlaceholderMapper, _super);\n /**\n * @param {?} message\n * @param {?} mapName\n */\n function SimplePlaceholderMapper(message, mapName) {\n var _this = _super.call(this) || this;\n _this.mapName = mapName;\n _this.internalToPublic = {};\n _this.publicToNextId = {};\n _this.publicToInternal = {};\n message.nodes.forEach(function (node) { return node.visit(_this); });\n return _this;\n }\n /**\n * @param {?} internalName\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.toPublicName = function (internalName) {\n return this.internalToPublic.hasOwnProperty(internalName) ?\n this.internalToPublic[internalName] :\n null;\n };\n /**\n * @param {?} publicName\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.toInternalName = function (publicName) {\n return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] :\n null;\n };\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitText = function (text, context) { return null; };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitTagPlaceholder = function (ph, context) {\n this.visitPlaceholderName(ph.startName);\n _super.prototype.visitTagPlaceholder.call(this, ph, context);\n this.visitPlaceholderName(ph.closeName);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitPlaceholder = function (ph, context) { this.visitPlaceholderName(ph.name); };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitIcuPlaceholder = function (ph, context) {\n this.visitPlaceholderName(ph.name);\n };\n /**\n * @param {?} internalName\n * @return {?}\n */\n SimplePlaceholderMapper.prototype.visitPlaceholderName = function (internalName) {\n if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n return;\n }\n var /** @type {?} */ publicName = this.mapName(internalName);\n if (this.publicToInternal.hasOwnProperty(publicName)) {\n // Create a new XMB when it has already been used\n var /** @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 return SimplePlaceholderMapper;\n}(RecurseVisitor));\n/**\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 */\nvar _Visitor$1 = (function () {\n function _Visitor$1() {\n }\n /**\n * @param {?} tag\n * @return {?}\n */\n _Visitor$1.prototype.visitTag = function (tag) {\n var _this = this;\n var /** @type {?} */ strAttrs = this._serializeAttributes(tag.attrs);\n if (tag.children.length == 0) {\n return \"<\" + tag.name + strAttrs + \"/>\";\n }\n var /** @type {?} */ strChildren = tag.children.map(function (node) { return node.visit(_this); });\n return \"<\" + tag.name + strAttrs + \">\" + strChildren.join('') + \"\";\n };\n /**\n * @param {?} text\n * @return {?}\n */\n _Visitor$1.prototype.visitText = function (text) { return text.value; };\n /**\n * @param {?} decl\n * @return {?}\n */\n _Visitor$1.prototype.visitDeclaration = function (decl) {\n return \"\";\n };\n /**\n * @param {?} attrs\n * @return {?}\n */\n _Visitor$1.prototype._serializeAttributes = function (attrs) {\n var /** @type {?} */ strAttrs = Object.keys(attrs).map(function (name) { return name + \"=\\\"\" + attrs[name] + \"\\\"\"; }).join(' ');\n return strAttrs.length > 0 ? ' ' + strAttrs : '';\n };\n /**\n * @param {?} doctype\n * @return {?}\n */\n _Visitor$1.prototype.visitDoctype = function (doctype) {\n return \"\";\n };\n return _Visitor$1;\n}());\nvar _visitor = new _Visitor$1();\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction serialize(nodes) {\n return nodes.map(function (node) { return node.visit(_visitor); }).join('');\n}\nvar Declaration = (function () {\n /**\n * @param {?} unescapedAttrs\n */\n function Declaration(unescapedAttrs) {\n var _this = this;\n this.attrs = {};\n Object.keys(unescapedAttrs).forEach(function (k) {\n _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n });\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Declaration.prototype.visit = function (visitor) { return visitor.visitDeclaration(this); };\n return Declaration;\n}());\nvar Doctype = (function () {\n /**\n * @param {?} rootTag\n * @param {?} dtd\n */\n function Doctype(rootTag, dtd) {\n this.rootTag = rootTag;\n this.dtd = dtd;\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Doctype.prototype.visit = function (visitor) { return visitor.visitDoctype(this); };\n return Doctype;\n}());\nvar Tag = (function () {\n /**\n * @param {?} name\n * @param {?=} unescapedAttrs\n * @param {?=} children\n */\n function Tag(name, unescapedAttrs, children) {\n if (unescapedAttrs === void 0) { unescapedAttrs = {}; }\n if (children === void 0) { children = []; }\n var _this = this;\n this.name = name;\n this.children = children;\n this.attrs = {};\n Object.keys(unescapedAttrs).forEach(function (k) {\n _this.attrs[k] = _escapeXml(unescapedAttrs[k]);\n });\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Tag.prototype.visit = function (visitor) { return visitor.visitTag(this); };\n return Tag;\n}());\nvar Text$2 = (function () {\n /**\n * @param {?} unescapedValue\n */\n function Text$2(unescapedValue) {\n this.value = _escapeXml(unescapedValue);\n }\n /**\n * @param {?} visitor\n * @return {?}\n */\n Text$2.prototype.visit = function (visitor) { return visitor.visitText(this); };\n return Text$2;\n}());\nvar CR = (function (_super) {\n tslib_1.__extends(CR, _super);\n /**\n * @param {?=} ws\n */\n function CR(ws) {\n if (ws === void 0) { ws = 0; }\n return _super.call(this, \"\\n\" + new Array(ws + 1).join(' ')) || this;\n }\n return CR;\n}(Text$2));\nvar _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(function (text, entry) { return text.replace(entry[0], entry[1]); }, text);\n}\n/**\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 */\nvar _VERSION = '1.2';\nvar _XMLNS = 'urn:oasis:names:tc:xliff:document:1.2';\n// TODO(vicb): make this a param (s/_/-/)\nvar _DEFAULT_SOURCE_LANG = 'en';\nvar _PLACEHOLDER_TAG = 'x';\nvar _FILE_TAG = 'file';\nvar _SOURCE_TAG = 'source';\nvar _TARGET_TAG = 'target';\nvar _UNIT_TAG = 'trans-unit';\nvar _CONTEXT_GROUP_TAG = 'context-group';\nvar _CONTEXT_TAG = 'context';\nvar Xliff = (function (_super) {\n tslib_1.__extends(Xliff, _super);\n function Xliff() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xliff.prototype.write = function (messages, locale) {\n var /** @type {?} */ visitor = new _WriteVisitor();\n var /** @type {?} */ transUnits = [];\n messages.forEach(function (message) {\n var /** @type {?} */ contextTags = [];\n message.sources.forEach(function (source) {\n var /** @type {?} */ contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { purpose: 'location' });\n contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'sourcefile' }, [new Text$2(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 'context-type': 'linenumber' }, [new Text$2(\"\" + source.startLine)]), new CR(8));\n contextTags.push(new CR(8), contextGroupTag);\n });\n var /** @type {?} */ transUnit = new Tag(_UNIT_TAG, { id: message.id, datatype: 'html' });\n (_a = transUnit.children).push.apply(_a, [new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes))].concat(contextTags));\n if (message.description) {\n transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'description' }, [new Text$2(message.description)]));\n }\n if (message.meaning) {\n transUnit.children.push(new CR(8), new Tag('note', { priority: '1', from: 'meaning' }, [new Text$2(message.meaning)]));\n }\n transUnit.children.push(new CR(6));\n transUnits.push(new CR(6), transUnit);\n var _a;\n });\n var /** @type {?} */ body = new Tag('body', {}, transUnits.concat([new CR(4)]));\n var /** @type {?} */ file = new Tag('file', {\n 'source-language': locale || _DEFAULT_SOURCE_LANG,\n datatype: 'plaintext',\n original: 'ng2.template',\n }, [new CR(4), body, new CR(2)]);\n var /** @type {?} */ xliff = new Tag('xliff', { version: _VERSION, xmlns: _XMLNS }, [new CR(2), file, new CR()]);\n return serialize([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n ]);\n };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xliff.prototype.load = function (content, url) {\n // xliff to xml nodes\n var /** @type {?} */ xliffParser = new XliffParser();\n var _a = xliffParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n // xml nodes to i18n nodes\n var /** @type {?} */ i18nNodesByMsgId = {};\n var /** @type {?} */ converter = new XmlToI18n();\n Object.keys(msgIdToHtml).forEach(function (msgId) {\n var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n errors.push.apply(errors, 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: i18nNodesByMsgId };\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xliff.prototype.digest = function (message) { return digest(message); };\n return Xliff;\n}(Serializer));\nvar _WriteVisitor = (function () {\n function _WriteVisitor() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitContainer = function (container, context) {\n var _this = this;\n var /** @type {?} */ nodes = [];\n container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n return nodes;\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n Object.keys(icu.cases).forEach(function (c) {\n nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n });\n nodes.push(new Text$2(\"}\"));\n return nodes;\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n var /** @type {?} */ ctype = getCtypeForTag(ph.tag);\n var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.startName, ctype: ctype });\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG, { id: ph.closeName, ctype: ctype });\n return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitPlaceholder = function (ph, context) {\n return [new Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor.prototype.visitIcuPlaceholder = function (ph, context) {\n return [new Tag(_PLACEHOLDER_TAG, { id: ph.name })];\n };\n /**\n * @param {?} nodes\n * @return {?}\n */\n _WriteVisitor.prototype.serialize = function (nodes) {\n var _this = this;\n return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n };\n return _WriteVisitor;\n}());\nvar XliffParser = (function () {\n function XliffParser() {\n this._locale = null;\n }\n /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n XliffParser.prototype.parse = function (xliff, url) {\n this._unitMlString = null;\n this._msgIdToHtml = {};\n var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n this._errors = xml.errors;\n 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 XliffParser.prototype.visitElement = function (element, context) {\n switch (element.name) {\n case _UNIT_TAG:\n this._unitMlString = ((null));\n var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n if (!idAttr) {\n this._addError(element, \"<\" + _UNIT_TAG + \"> misses the \\\"id\\\" attribute\");\n }\n else {\n var /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, \"Duplicated translations for msg \" + id);\n }\n else {\n 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 var /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n var /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n var /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n this._unitMlString = innerText;\n break;\n case _FILE_TAG:\n var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'target-language'; });\n if (localeAttr) {\n this._locale = localeAttr.value;\n }\n 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 visitAll(this, element.children, null);\n }\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitAttribute = function (attribute, context) { };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitText = function (text, context) { };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitComment = function (comment, context) { };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitExpansion = function (expansion, context) { };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n XliffParser.prototype.visitExpansionCase = function (expansionCase, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XliffParser.prototype._addError = function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XliffParser;\n}());\nvar XmlToI18n = (function () {\n function XmlToI18n() {\n }\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n XmlToI18n.prototype.convert = function (message, url) {\n var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] :\n 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 XmlToI18n.prototype.visitText = function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitElement = function (el, context) {\n if (el.name === _PLACEHOLDER_TAG) {\n var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'id'; });\n if (nameAttr) {\n return new 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 XmlToI18n.prototype.visitExpansion = function (icu, context) {\n var /** @type {?} */ caseMap = {};\n visitAll(this, icu.cases).forEach(function (c) {\n caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n });\n return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitExpansionCase = function (icuCase, context) {\n return {\n value: icuCase.value,\n nodes: visitAll(this, icuCase.expression),\n };\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitComment = function (comment, context) { };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XmlToI18n.prototype.visitAttribute = function (attribute, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XmlToI18n.prototype._addError = function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XmlToI18n;\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/**\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 */\nvar _VERSION$1 = '2.0';\nvar _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:2.0';\n// TODO(vicb): make this a param (s/_/-/)\nvar _DEFAULT_SOURCE_LANG$1 = 'en';\nvar _PLACEHOLDER_TAG$1 = 'ph';\nvar _PLACEHOLDER_SPANNING_TAG = 'pc';\nvar _XLIFF_TAG = 'xliff';\nvar _SOURCE_TAG$1 = 'source';\nvar _TARGET_TAG$1 = 'target';\nvar _UNIT_TAG$1 = 'unit';\nvar Xliff2 = (function (_super) {\n tslib_1.__extends(Xliff2, _super);\n function Xliff2() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xliff2.prototype.write = function (messages, locale) {\n var /** @type {?} */ visitor = new _WriteVisitor$1();\n var /** @type {?} */ units = [];\n messages.forEach(function (message) {\n var /** @type {?} */ unit = new Tag(_UNIT_TAG$1, { id: message.id });\n var /** @type {?} */ notes = new Tag('notes');\n if (message.description || message.meaning) {\n if (message.description) {\n notes.children.push(new CR(8), new Tag('note', { category: 'description' }, [new Text$2(message.description)]));\n }\n if (message.meaning) {\n notes.children.push(new CR(8), new Tag('note', { category: 'meaning' }, [new Text$2(message.meaning)]));\n }\n }\n message.sources.forEach(function (source) {\n notes.children.push(new CR(8), new Tag('note', { category: 'location' }, [\n new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n ]));\n });\n notes.children.push(new CR(6));\n unit.children.push(new CR(6), notes);\n var /** @type {?} */ segment = new Tag('segment');\n segment.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), new CR(6));\n unit.children.push(new CR(6), segment, new CR(4));\n units.push(new CR(4), unit);\n });\n var /** @type {?} */ file = new Tag('file', { 'original': 'ng.template', id: 'ngi18n' }, units.concat([new CR(2)]));\n var /** @type {?} */ xliff = new Tag(_XLIFF_TAG, { version: _VERSION$1, xmlns: _XMLNS$1, srcLang: locale || _DEFAULT_SOURCE_LANG$1 }, [new CR(2), file, new CR()]);\n return serialize([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }), new CR(), xliff, new CR()\n ]);\n };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xliff2.prototype.load = function (content, url) {\n // xliff to xml nodes\n var /** @type {?} */ xliff2Parser = new Xliff2Parser();\n var _a = xliff2Parser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n // xml nodes to i18n nodes\n var /** @type {?} */ i18nNodesByMsgId = {};\n var /** @type {?} */ converter = new XmlToI18n$1();\n Object.keys(msgIdToHtml).forEach(function (msgId) {\n var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, e = _a.errors;\n errors.push.apply(errors, 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: i18nNodesByMsgId };\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xliff2.prototype.digest = function (message) { return decimalDigest(message); };\n return Xliff2;\n}(Serializer));\nvar _WriteVisitor$1 = (function () {\n function _WriteVisitor$1() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor$1.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor$1.prototype.visitContainer = function (container, context) {\n var _this = this;\n var /** @type {?} */ nodes = [];\n container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n return nodes;\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor$1.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n Object.keys(icu.cases).forEach(function (c) {\n nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n });\n nodes.push(new Text$2(\"}\"));\n return nodes;\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor$1.prototype.visitTagPlaceholder = function (ph, context) {\n var _this = this;\n var /** @type {?} */ type = getTypeForTag(ph.tag);\n if (ph.isVoid) {\n var /** @type {?} */ tagPh = new Tag(_PLACEHOLDER_TAG$1, {\n id: (this._nextPlaceholderId++).toString(),\n equiv: ph.startName,\n type: type,\n disp: \"<\" + ph.tag + \"/>\",\n });\n return [tagPh];\n }\n var /** @type {?} */ tagPc = new 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 var /** @type {?} */ nodes = [].concat.apply([], ph.children.map(function (node) { return node.visit(_this); }));\n if (nodes.length) {\n nodes.forEach(function (node) { return tagPc.children.push(node); });\n }\n else {\n tagPc.children.push(new Text$2(''));\n }\n return [tagPc];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor$1.prototype.visitPlaceholder = function (ph, context) {\n var /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();\n return [new Tag(_PLACEHOLDER_TAG$1, {\n id: idStr,\n equiv: ph.name,\n disp: \"{{\" + ph.value + \"}}\",\n })];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _WriteVisitor$1.prototype.visitIcuPlaceholder = function (ph, context) {\n var /** @type {?} */ cases = Object.keys(ph.value.cases).map(function (value) { return value + ' {...}'; }).join(' ');\n var /** @type {?} */ idStr = (this._nextPlaceholderId++).toString();\n return [new Tag(_PLACEHOLDER_TAG$1, { id: idStr, equiv: ph.name, disp: \"{\" + ph.value.expression + \", \" + ph.value.type + \", \" + cases + \"}\" })];\n };\n /**\n * @param {?} nodes\n * @return {?}\n */\n _WriteVisitor$1.prototype.serialize = function (nodes) {\n var _this = this;\n this._nextPlaceholderId = 0;\n return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n };\n return _WriteVisitor$1;\n}());\nvar Xliff2Parser = (function () {\n function Xliff2Parser() {\n this._locale = null;\n }\n /**\n * @param {?} xliff\n * @param {?} url\n * @return {?}\n */\n Xliff2Parser.prototype.parse = function (xliff, url) {\n this._unitMlString = null;\n this._msgIdToHtml = {};\n var /** @type {?} */ xml = new XmlParser().parse(xliff, url, false);\n this._errors = xml.errors;\n 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 Xliff2Parser.prototype.visitElement = function (element, context) {\n switch (element.name) {\n case _UNIT_TAG$1:\n this._unitMlString = null;\n var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n if (!idAttr) {\n this._addError(element, \"<\" + _UNIT_TAG$1 + \"> misses the \\\"id\\\" attribute\");\n }\n else {\n var /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, \"Duplicated translations for msg \" + id);\n }\n else {\n 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$1:\n // ignore source message\n break;\n case _TARGET_TAG$1:\n var /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n var /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n var /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n var /** @type {?} */ innerText = content.slice(innerTextStart, innerTextEnd);\n this._unitMlString = innerText;\n break;\n case _XLIFF_TAG:\n var /** @type {?} */ localeAttr = element.attrs.find(function (attr) { return attr.name === 'trgLang'; });\n if (localeAttr) {\n this._locale = localeAttr.value;\n }\n var /** @type {?} */ versionAttr = element.attrs.find(function (attr) { return attr.name === 'version'; });\n if (versionAttr) {\n var /** @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 visitAll(this, element.children, null);\n }\n }\n break;\n default:\n visitAll(this, element.children, null);\n }\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitAttribute = function (attribute, context) { };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitText = function (text, context) { };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitComment = function (comment, context) { };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitExpansion = function (expansion, context) { };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n Xliff2Parser.prototype.visitExpansionCase = function (expansionCase, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n Xliff2Parser.prototype._addError = function (node, message) {\n this._errors.push(new I18nError(node.sourceSpan, message));\n };\n return Xliff2Parser;\n}());\nvar XmlToI18n$1 = (function () {\n function XmlToI18n$1() {\n }\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n XmlToI18n$1.prototype.convert = function (message, url) {\n var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] : [].concat.apply([], 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 XmlToI18n$1.prototype.visitText = function (text, context) { return new Text$1(text.value, text.sourceSpan); };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$1.prototype.visitElement = function (el, context) {\n var _this = this;\n switch (el.name) {\n case _PLACEHOLDER_TAG$1:\n var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'equiv'; });\n if (nameAttr) {\n return [new Placeholder('', nameAttr.value, el.sourceSpan)];\n }\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equiv\\\" attribute\");\n break;\n case _PLACEHOLDER_SPANNING_TAG:\n var /** @type {?} */ startAttr = el.attrs.find(function (attr) { return attr.name === 'equivStart'; });\n var /** @type {?} */ endAttr = el.attrs.find(function (attr) { return attr.name === 'equivEnd'; });\n if (!startAttr) {\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equivStart\\\" attribute\");\n }\n else if (!endAttr) {\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$1 + \"> misses the \\\"equivEnd\\\" attribute\");\n }\n else {\n var /** @type {?} */ startId = startAttr.value;\n var /** @type {?} */ endId = endAttr.value;\n var /** @type {?} */ nodes = [];\n return nodes.concat.apply(nodes, [new Placeholder('', startId, el.sourceSpan)].concat(el.children.map(function (node) { return node.visit(_this, null); }), [new 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 XmlToI18n$1.prototype.visitExpansion = function (icu, context) {\n var /** @type {?} */ caseMap = {};\n visitAll(this, icu.cases).forEach(function (c) {\n caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n });\n return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$1.prototype.visitExpansionCase = function (icuCase, context) {\n return {\n value: icuCase.value,\n nodes: [].concat.apply([], visitAll(this, icuCase.expression)),\n };\n };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$1.prototype.visitComment = function (comment, context) { };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$1.prototype.visitAttribute = function (attribute, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XmlToI18n$1.prototype._addError = function (node, message) {\n this._errors.push(new I18nError(node.sourceSpan, message));\n };\n return XmlToI18n$1;\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/**\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 */\nvar _MESSAGES_TAG = 'messagebundle';\nvar _MESSAGE_TAG = 'msg';\nvar _PLACEHOLDER_TAG$2 = 'ph';\nvar _EXEMPLE_TAG = 'ex';\nvar _SOURCE_TAG$2 = 'source';\nvar _DOCTYPE = \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\";\nvar Xmb = (function (_super) {\n tslib_1.__extends(Xmb, _super);\n function Xmb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xmb.prototype.write = function (messages, locale) {\n var /** @type {?} */ exampleVisitor = new ExampleVisitor();\n var /** @type {?} */ visitor = new _Visitor$2();\n var /** @type {?} */ rootNode = new Tag(_MESSAGES_TAG);\n messages.forEach(function (message) {\n var /** @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 var /** @type {?} */ sourceTags = [];\n message.sources.forEach(function (source) {\n sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [\n new Text$2(source.filePath + \":\" + source.startLine + (source.endLine !== source.startLine ? ',' + source.endLine : ''))\n ]));\n });\n rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, sourceTags.concat(visitor.serialize(message.nodes))));\n });\n rootNode.children.push(new CR());\n return serialize([\n new Declaration({ version: '1.0', encoding: 'UTF-8' }),\n new CR(),\n new Doctype(_MESSAGES_TAG, _DOCTYPE),\n new CR(),\n exampleVisitor.addDefaultExamples(rootNode),\n new CR(),\n ]);\n };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xmb.prototype.load = function (content, url) {\n throw new Error('Unsupported');\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xmb.prototype.digest = function (message) { return digest$1(message); };\n /**\n * @param {?} message\n * @return {?}\n */\n Xmb.prototype.createNameMapper = function (message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n };\n return Xmb;\n}(Serializer));\nvar _Visitor$2 = (function () {\n function _Visitor$2() {\n }\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n _Visitor$2.prototype.visitText = function (text, context) { return [new Text$2(text.value)]; };\n /**\n * @param {?} container\n * @param {?} context\n * @return {?}\n */\n _Visitor$2.prototype.visitContainer = function (container, context) {\n var _this = this;\n var /** @type {?} */ nodes = [];\n container.children.forEach(function (node) { return nodes.push.apply(nodes, node.visit(_this)); });\n return nodes;\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n _Visitor$2.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ nodes = [new Text$2(\"{\" + icu.expressionPlaceholder + \", \" + icu.type + \", \")];\n Object.keys(icu.cases).forEach(function (c) {\n nodes.push.apply(nodes, [new Text$2(c + \" {\")].concat(icu.cases[c].visit(_this), [new Text$2(\"} \")]));\n });\n nodes.push(new Text$2(\"}\"));\n return nodes;\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _Visitor$2.prototype.visitTagPlaceholder = function (ph, context) {\n var /** @type {?} */ startEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"<\" + ph.tag + \">\")]);\n var /** @type {?} */ startTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.startName }, [startEx]);\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n var /** @type {?} */ closeEx = new Tag(_EXEMPLE_TAG, {}, [new Text$2(\"\")]);\n var /** @type {?} */ closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { name: ph.closeName }, [closeEx]);\n return [startTagPh].concat(this.serialize(ph.children), [closeTagPh]);\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _Visitor$2.prototype.visitPlaceholder = function (ph, context) {\n return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name })];\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n _Visitor$2.prototype.visitIcuPlaceholder = function (ph, context) {\n return [new Tag(_PLACEHOLDER_TAG$2, { name: ph.name })];\n };\n /**\n * @param {?} nodes\n * @return {?}\n */\n _Visitor$2.prototype.serialize = function (nodes) {\n var _this = this;\n return [].concat.apply([], nodes.map(function (node) { return node.visit(_this); }));\n };\n return _Visitor$2;\n}());\n/**\n * @param {?} message\n * @return {?}\n */\nfunction digest$1(message) {\n return decimalDigest(message);\n}\nvar ExampleVisitor = (function () {\n function ExampleVisitor() {\n }\n /**\n * @param {?} node\n * @return {?}\n */\n ExampleVisitor.prototype.addDefaultExamples = function (node) {\n node.visit(this);\n return node;\n };\n /**\n * @param {?} tag\n * @return {?}\n */\n ExampleVisitor.prototype.visitTag = function (tag) {\n var _this = this;\n if (tag.name === _PLACEHOLDER_TAG$2) {\n if (!tag.children || tag.children.length == 0) {\n var /** @type {?} */ exText = new Text$2(tag.attrs['name'] || '...');\n tag.children = [new Tag(_EXEMPLE_TAG, {}, [exText])];\n }\n }\n else if (tag.children) {\n tag.children.forEach(function (node) { return node.visit(_this); });\n }\n };\n /**\n * @param {?} text\n * @return {?}\n */\n ExampleVisitor.prototype.visitText = function (text) { };\n /**\n * @param {?} decl\n * @return {?}\n */\n ExampleVisitor.prototype.visitDeclaration = function (decl) { };\n /**\n * @param {?} doctype\n * @return {?}\n */\n ExampleVisitor.prototype.visitDoctype = function (doctype) { };\n return ExampleVisitor;\n}());\n/**\n * @param {?} internalName\n * @return {?}\n */\nfunction toPublicName(internalName) {\n return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n}\n/**\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 */\nvar _TRANSLATIONS_TAG = 'translationbundle';\nvar _TRANSLATION_TAG = 'translation';\nvar _PLACEHOLDER_TAG$3 = 'ph';\nvar Xtb = (function (_super) {\n tslib_1.__extends(Xtb, _super);\n function Xtb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} messages\n * @param {?} locale\n * @return {?}\n */\n Xtb.prototype.write = function (messages, locale) { throw new Error('Unsupported'); };\n /**\n * @param {?} content\n * @param {?} url\n * @return {?}\n */\n Xtb.prototype.load = function (content, url) {\n // xtb to xml nodes\n var /** @type {?} */ xtbParser = new XtbParser();\n var _a = xtbParser.parse(content, url), locale = _a.locale, msgIdToHtml = _a.msgIdToHtml, errors = _a.errors;\n // xml nodes to i18n nodes\n var /** @type {?} */ i18nNodesByMsgId = {};\n var /** @type {?} */ converter = new XmlToI18n$2();\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(function (msgId) {\n var /** @type {?} */ valueFn = function () {\n var _a = converter.convert(msgIdToHtml[msgId], url), i18nNodes = _a.i18nNodes, errors = _a.errors;\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: i18nNodesByMsgId };\n };\n /**\n * @param {?} message\n * @return {?}\n */\n Xtb.prototype.digest = function (message) { return digest$1(message); };\n /**\n * @param {?} message\n * @return {?}\n */\n Xtb.prototype.createNameMapper = function (message) {\n return new SimplePlaceholderMapper(message, toPublicName);\n };\n return Xtb;\n}(Serializer));\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 var /** @type {?} */ value = valueFn();\n Object.defineProperty(messages, id, { enumerable: true, value: value });\n return value;\n },\n set: function (_) { throw new Error('Could not overwrite an XTB translation'); },\n });\n}\nvar XtbParser = (function () {\n function XtbParser() {\n this._locale = null;\n }\n /**\n * @param {?} xtb\n * @param {?} url\n * @return {?}\n */\n XtbParser.prototype.parse = function (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 var /** @type {?} */ xml = new XmlParser().parse(xtb, url, false);\n this._errors = xml.errors;\n 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 XtbParser.prototype.visitElement = function (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 var /** @type {?} */ langAttr = element.attrs.find(function (attr) { return attr.name === 'lang'; });\n if (langAttr) {\n this._locale = langAttr.value;\n }\n visitAll(this, element.children, null);\n this._bundleDepth--;\n break;\n case _TRANSLATION_TAG:\n var /** @type {?} */ idAttr = element.attrs.find(function (attr) { return attr.name === 'id'; });\n if (!idAttr) {\n this._addError(element, \"<\" + _TRANSLATION_TAG + \"> misses the \\\"id\\\" attribute\");\n }\n else {\n var /** @type {?} */ id = idAttr.value;\n if (this._msgIdToHtml.hasOwnProperty(id)) {\n this._addError(element, \"Duplicated translations for msg \" + id);\n }\n else {\n var /** @type {?} */ innerTextStart = ((element.startSourceSpan)).end.offset;\n var /** @type {?} */ innerTextEnd = ((element.endSourceSpan)).start.offset;\n var /** @type {?} */ content = ((element.startSourceSpan)).start.file.content;\n var /** @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 XtbParser.prototype.visitAttribute = function (attribute, context) { };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitText = function (text, context) { };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitComment = function (comment, context) { };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitExpansion = function (expansion, context) { };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n XtbParser.prototype.visitExpansionCase = function (expansionCase, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XtbParser.prototype._addError = function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XtbParser;\n}());\nvar XmlToI18n$2 = (function () {\n function XmlToI18n$2() {\n }\n /**\n * @param {?} message\n * @param {?} url\n * @return {?}\n */\n XmlToI18n$2.prototype.convert = function (message, url) {\n var /** @type {?} */ xmlIcu = new XmlParser().parse(message, url, true);\n this._errors = xmlIcu.errors;\n var /** @type {?} */ i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ?\n [] :\n 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 XmlToI18n$2.prototype.visitText = function (text, context) { return new Text$1(text.value, /** @type {?} */ ((text.sourceSpan))); };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$2.prototype.visitExpansion = function (icu, context) {\n var /** @type {?} */ caseMap = {};\n visitAll(this, icu.cases).forEach(function (c) {\n caseMap[c.value] = new Container(c.nodes, icu.sourceSpan);\n });\n return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan);\n };\n /**\n * @param {?} icuCase\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$2.prototype.visitExpansionCase = function (icuCase, context) {\n return {\n value: icuCase.value,\n nodes: visitAll(this, icuCase.expression),\n };\n };\n /**\n * @param {?} el\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$2.prototype.visitElement = function (el, context) {\n if (el.name === _PLACEHOLDER_TAG$3) {\n var /** @type {?} */ nameAttr = el.attrs.find(function (attr) { return attr.name === 'name'; });\n if (nameAttr) {\n return new Placeholder('', nameAttr.value, /** @type {?} */ ((el.sourceSpan)));\n }\n this._addError(el, \"<\" + _PLACEHOLDER_TAG$3 + \"> 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 XmlToI18n$2.prototype.visitComment = function (comment, context) { };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n XmlToI18n$2.prototype.visitAttribute = function (attribute, context) { };\n /**\n * @param {?} node\n * @param {?} message\n * @return {?}\n */\n XmlToI18n$2.prototype._addError = function (node, message) {\n this._errors.push(new I18nError(/** @type {?} */ ((node.sourceSpan)), message));\n };\n return XmlToI18n$2;\n}());\n/**\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 */\nvar HtmlParser = (function (_super) {\n tslib_1.__extends(HtmlParser, _super);\n function HtmlParser() {\n return _super.call(this, getHtmlTagDefinition) || this;\n }\n /**\n * @param {?} source\n * @param {?} url\n * @param {?=} parseExpansionForms\n * @param {?=} interpolationConfig\n * @return {?}\n */\n HtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n return _super.prototype.parse.call(this, source, url, parseExpansionForms, interpolationConfig);\n };\n return HtmlParser;\n}(Parser$1));\nHtmlParser.decorators = [\n { type: CompilerInjectable },\n];\n/**\n * @nocollapse\n */\nHtmlParser.ctorParameters = function () { return []; };\n/**\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 container for translated messages\n */\nvar TranslationBundle = (function () {\n /**\n * @param {?=} _i18nNodesByMsgId\n * @param {?=} locale\n * @param {?=} digest\n * @param {?=} mapperFactory\n * @param {?=} missingTranslationStrategy\n * @param {?=} console\n */\n function TranslationBundle(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console) {\n if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\n if (missingTranslationStrategy === void 0) { missingTranslationStrategy = MissingTranslationStrategy.Warning; }\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 TranslationBundle.load = function (content, url, serializer, missingTranslationStrategy, console) {\n var _a = serializer.load(content, url), locale = _a.locale, i18nNodesByMsgId = _a.i18nNodesByMsgId;\n var /** @type {?} */ digestFn = function (m) { return serializer.digest(m); };\n var /** @type {?} */ mapperFactory = function (m) { return ((serializer.createNameMapper(m))); };\n return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console);\n };\n /**\n * @param {?} srcMsg\n * @return {?}\n */\n TranslationBundle.prototype.get = function (srcMsg) {\n var /** @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 TranslationBundle.prototype.has = function (srcMsg) { return this.digest(srcMsg) in this._i18nNodesByMsgId; };\n return TranslationBundle;\n}());\nvar I18nToHtmlVisitor = (function () {\n /**\n * @param {?=} _i18nNodesByMsgId\n * @param {?=} _locale\n * @param {?=} _digest\n * @param {?=} _mapperFactory\n * @param {?=} _missingTranslationStrategy\n * @param {?=} _console\n */\n function I18nToHtmlVisitor(_i18nNodesByMsgId, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) {\n if (_i18nNodesByMsgId === void 0) { _i18nNodesByMsgId = {}; }\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 I18nToHtmlVisitor.prototype.convert = function (srcMsg) {\n this._contextStack.length = 0;\n this._errors.length = 0;\n // i18n to text\n var /** @type {?} */ text = this._convertToText(srcMsg);\n // text to html\n var /** @type {?} */ url = srcMsg.nodes[0].sourceSpan.start.file.url;\n var /** @type {?} */ html = new HtmlParser().parse(text, url, true);\n return {\n nodes: html.rootNodes,\n errors: this._errors.concat(html.errors),\n };\n };\n /**\n * @param {?} text\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitText = function (text, context) { return text.value; };\n /**\n * @param {?} container\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitContainer = function (container, context) {\n var _this = this;\n return container.children.map(function (n) { return n.visit(_this); }).join('');\n };\n /**\n * @param {?} icu\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitIcu = function (icu, context) {\n var _this = this;\n var /** @type {?} */ cases = Object.keys(icu.cases).map(function (k) { return 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 var /** @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 I18nToHtmlVisitor.prototype.visitPlaceholder = function (ph, context) {\n var /** @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 I18nToHtmlVisitor.prototype.visitTagPlaceholder = function (ph, context) {\n var _this = this;\n var /** @type {?} */ tag = \"\" + ph.tag;\n var /** @type {?} */ attrs = Object.keys(ph.attrs).map(function (name) { return name + \"=\\\"\" + ph.attrs[name] + \"\\\"\"; }).join(' ');\n if (ph.isVoid) {\n return \"<\" + tag + \" \" + attrs + \"/>\";\n }\n var /** @type {?} */ children = ph.children.map(function (c) { return c.visit(_this); }).join('');\n return \"<\" + tag + \" \" + attrs + \">\" + children + \"\";\n };\n /**\n * @param {?} ph\n * @param {?=} context\n * @return {?}\n */\n I18nToHtmlVisitor.prototype.visitIcuPlaceholder = function (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 I18nToHtmlVisitor.prototype._convertToText = function (srcMsg) {\n var _this = this;\n var /** @type {?} */ id = this._digest(srcMsg);\n var /** @type {?} */ mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null;\n var /** @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 = function (name) { return 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 var /** @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 var /** @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 = function (name) { return name; };\n }\n var /** @type {?} */ text = nodes.map(function (node) { return node.visit(_this); }).join('');\n var /** @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 I18nToHtmlVisitor.prototype._addError = function (el, msg) {\n this._errors.push(new I18nError(el.sourceSpan, msg));\n };\n return I18nToHtmlVisitor;\n}());\n/**\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 */\nvar I18NHtmlParser = (function () {\n /**\n * @param {?} _htmlParser\n * @param {?=} translations\n * @param {?=} translationsFormat\n * @param {?=} missingTranslation\n * @param {?=} console\n */\n function I18NHtmlParser(_htmlParser, translations, translationsFormat, missingTranslation, console) {\n if (missingTranslation === void 0) { missingTranslation = MissingTranslationStrategy.Warning; }\n this._htmlParser = _htmlParser;\n if (translations) {\n var 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 I18NHtmlParser.prototype.parse = function (source, url, parseExpansionForms, interpolationConfig) {\n if (parseExpansionForms === void 0) { parseExpansionForms = false; }\n if (interpolationConfig === void 0) { interpolationConfig = DEFAULT_INTERPOLATION_CONFIG; }\n var /** @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 return I18NHtmlParser;\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/**\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 */\nvar CORE = '@angular/core';\nvar Identifiers = (function () {\n function Identifiers() {\n }\n return 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 };\n/**\n * @param {?} reference\n * @return {?}\n */\nfunction createTokenForReference(reference) {\n return { identifier: { reference: reference } };\n}\n/**\n * @param {?} reflector\n * @param {?} reference\n * @return {?}\n */\nfunction createTokenForExternalReference(reflector, reference) {\n return createTokenForReference(reflector.resolveExternalReference(reference));\n}\n/**\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 */\nvar PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';\nvar 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\nvar WS_CHARS = ' \\f\\n\\r\\t\\v\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';\nvar NO_WS_REGEXP = new RegExp(\"[^\" + WS_CHARS + \"]\");\nvar WS_REPLACE_REGEXP = new RegExp(\"[\" + WS_CHARS + \"]{2,}\", 'g');\n/**\n * @param {?} attrs\n * @return {?}\n */\nfunction hasPreserveWhitespacesAttr(attrs) {\n return attrs.some(function (attr) { return 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 */\nfunction 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 */\nvar WhitespaceVisitor = (function () {\n function WhitespaceVisitor() {\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitElement = function (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 Element(element.name, visitAll(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n }\n return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitAttribute = function (attribute, context) {\n return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;\n };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitText = function (text, context) {\n var /** @type {?} */ isNotBlank = text.value.match(NO_WS_REGEXP);\n if (isNotBlank) {\n return new 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 WhitespaceVisitor.prototype.visitComment = function (comment, context) { return comment; };\n /**\n * @param {?} expansion\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitExpansion = function (expansion, context) { return expansion; };\n /**\n * @param {?} expansionCase\n * @param {?} context\n * @return {?}\n */\n WhitespaceVisitor.prototype.visitExpansionCase = function (expansionCase, context) { return expansionCase; };\n return WhitespaceVisitor;\n}());\n/**\n * @param {?} htmlAstWithErrors\n * @return {?}\n */\nfunction removeWhitespaces(htmlAstWithErrors) {\n return new ParseTreeResult(visitAll(new WhitespaceVisitor(), htmlAstWithErrors.rootNodes), htmlAstWithErrors.errors);\n}\n/**\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// http://cldr.unicode.org/index/cldr-spec/plural-rules\nvar 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 */\nfunction expandNodes(nodes) {\n var /** @type {?} */ expander = new _Expander();\n return new ExpansionResult(visitAll(expander, nodes), expander.isExpanded, expander.errors);\n}\nvar ExpansionResult = (function () {\n /**\n * @param {?} nodes\n * @param {?} expanded\n * @param {?} errors\n */\n function ExpansionResult(nodes, expanded, errors) {\n this.nodes = nodes;\n this.expanded = expanded;\n this.errors = errors;\n }\n return ExpansionResult;\n}());\nvar ExpansionError = (function (_super) {\n tslib_1.__extends(ExpansionError, _super);\n /**\n * @param {?} span\n * @param {?} errorMsg\n */\n function ExpansionError(span, errorMsg) {\n return _super.call(this, span, errorMsg) || this;\n }\n return ExpansionError;\n}(ParseError));\n/**\n * Expand expansion forms (plural, select) to directives\n *\n * \\@internal\n */\nvar _Expander = (function () {\n function _Expander() {\n this.isExpanded = false;\n this.errors = [];\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitElement = function (element, context) {\n return new Element(element.name, element.attrs, visitAll(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan);\n };\n /**\n * @param {?} attribute\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitAttribute = function (attribute, context) { return attribute; };\n /**\n * @param {?} text\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitText = function (text, context) { return text; };\n /**\n * @param {?} comment\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitComment = function (comment, context) { return comment; };\n /**\n * @param {?} icu\n * @param {?} context\n * @return {?}\n */\n _Expander.prototype.visitExpansion = function (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 _Expander.prototype.visitExpansionCase = function (icuCase, context) {\n throw new Error('Should not be reached');\n };\n return _Expander;\n}());\n/**\n * @param {?} ast\n * @param {?} errors\n * @return {?}\n */\nfunction _expandPluralForm(ast, errors) {\n var /** @type {?} */ children = ast.cases.map(function (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 var /** @type {?} */ expansionResult = expandNodes(c.expression);\n errors.push.apply(errors, expansionResult.errors);\n return new Element(\"ng-template\", [new Attribute$1('ngPluralCase', \"\" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n });\n var /** @type {?} */ switchAttr = new Attribute$1('[ngPlural]', ast.switchValue, ast.switchValueSourceSpan);\n return new 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 var /** @type {?} */ children = ast.cases.map(function (c) {\n var /** @type {?} */ expansionResult = expandNodes(c.expression);\n errors.push.apply(errors, expansionResult.errors);\n if (c.value === 'other') {\n // other is the default case when no values match\n return new Element(\"ng-template\", [new Attribute$1('ngSwitchDefault', '', c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n }\n return new Element(\"ng-template\", [new Attribute$1('ngSwitchCase', \"\" + c.value, c.valueSourceSpan)], expansionResult.nodes, c.sourceSpan, c.sourceSpan, c.sourceSpan);\n });\n var /** @type {?} */ switchAttr = new Attribute$1('[ngSwitch]', ast.switchValue, ast.switchValueSourceSpan);\n return new Element('ng-container', [switchAttr], children, ast.sourceSpan, ast.sourceSpan, ast.sourceSpan);\n}\n/**\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 */\nvar ProviderError = (function (_super) {\n tslib_1.__extends(ProviderError, _super);\n /**\n * @param {?} message\n * @param {?} span\n */\n function ProviderError(message, span) {\n return _super.call(this, span, message) || this;\n }\n return ProviderError;\n}(ParseError));\nvar ProviderViewContext = (function () {\n /**\n * @param {?} reflector\n * @param {?} component\n */\n function ProviderViewContext(reflector, component) {\n var _this = this;\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(function (provider) {\n if (_this.viewProviders.get(tokenReference(provider.token)) == null) {\n _this.viewProviders.set(tokenReference(provider.token), true);\n }\n });\n }\n return ProviderViewContext;\n}());\nvar ProviderElementContext = (function () {\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 function ProviderElementContext(viewContext, _parent, _isViewRoot, _directiveAsts, attrs, refs, isTemplate, contentQueryStartId, _sourceSpan) {\n var _this = this;\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(function (attrAst) { return _this._attrs[attrAst.name] = attrAst.value; });\n var directivesMeta = _directiveAsts.map(function (directiveAst) { return directiveAst.directive; });\n this._allProviders =\n _resolveProvidersFromDirectives(directivesMeta, _sourceSpan, viewContext.errors);\n this._contentQueries = _getContentQueries(contentQueryStartId, directivesMeta);\n Array.from(this._allProviders.values()).forEach(function (provider) {\n _this._addQueryReadsTo(provider.token, provider.token, _this._queriedTokens);\n });\n if (isTemplate) {\n var templateRefId = createTokenForExternalReference(this.viewContext.reflector, Identifiers.TemplateRef);\n this._addQueryReadsTo(templateRefId, templateRefId, this._queriedTokens);\n }\n refs.forEach(function (refAst) {\n var 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(function (provider) {\n var 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 ProviderElementContext.prototype.afterElement = function () {\n var _this = this;\n // collect lazy providers\n Array.from(this._allProviders.values()).forEach(function (provider) {\n _this._getOrCreateLocalProvider(provider.providerType, provider.token, false);\n });\n };\n Object.defineProperty(ProviderElementContext.prototype, \"transformProviders\", {\n /**\n * @return {?}\n */\n get: function () {\n // Note: Maps keep their insertion order.\n var /** @type {?} */ lazyProviders = [];\n var /** @type {?} */ eagerProviders = [];\n this._transformedProviders.forEach(function (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 enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProviderElementContext.prototype, \"transformedDirectiveAsts\", {\n /**\n * @return {?}\n */\n get: function () {\n var /** @type {?} */ sortedProviderTypes = this.transformProviders.map(function (provider) { return provider.token.identifier; });\n var /** @type {?} */ sortedDirectives = this._directiveAsts.slice();\n sortedDirectives.sort(function (dir1, dir2) { return sortedProviderTypes.indexOf(dir1.directive.type) -\n sortedProviderTypes.indexOf(dir2.directive.type); });\n return sortedDirectives;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProviderElementContext.prototype, \"transformedHasViewContainer\", {\n /**\n * @return {?}\n */\n get: function () { return this._hasViewContainer; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProviderElementContext.prototype, \"queryMatches\", {\n /**\n * @return {?}\n */\n get: function () {\n var /** @type {?} */ allMatches = [];\n this._queriedTokens.forEach(function (matches) { allMatches.push.apply(allMatches, matches); });\n return allMatches;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} token\n * @param {?} defaultValue\n * @param {?} queryReadTokens\n * @return {?}\n */\n ProviderElementContext.prototype._addQueryReadsTo = function (token, defaultValue, queryReadTokens) {\n this._getQueriesFor(token).forEach(function (query) {\n var /** @type {?} */ queryValue = query.meta.read || defaultValue;\n var /** @type {?} */ tokenRef = tokenReference(queryValue);\n var /** @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 ProviderElementContext.prototype._getQueriesFor = function (token) {\n var /** @type {?} */ result = [];\n var /** @type {?} */ currentEl = this;\n var /** @type {?} */ distance = 0;\n var /** @type {?} */ queries;\n while (currentEl !== null) {\n queries = currentEl._contentQueries.get(tokenReference(token));\n if (queries) {\n result.push.apply(result, queries.filter(function (query) { return 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.apply(result, queries);\n }\n return result;\n };\n /**\n * @param {?} requestingProviderType\n * @param {?} token\n * @param {?} eager\n * @return {?}\n */\n ProviderElementContext.prototype._getOrCreateLocalProvider = function (requestingProviderType, token, eager) {\n var _this = this;\n var /** @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 var /** @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 var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {\n var /** @type {?} */ transformedUseValue = provider.useValue;\n var /** @type {?} */ transformedUseExisting = ((provider.useExisting));\n var /** @type {?} */ transformedDeps = ((undefined));\n if (provider.useExisting != null) {\n var /** @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 var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n transformedDeps =\n deps.map(function (dep) { return ((_this._getDependency(resolvedProvider.providerType, dep, eager))); });\n }\n else if (provider.useClass) {\n var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n transformedDeps =\n deps.map(function (dep) { return ((_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 ProviderElementContext.prototype._getLocalDependency = function (requestingProviderType, dep, eager) {\n if (eager === void 0) { eager = false; }\n if (dep.isAttribute) {\n var /** @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 ProviderElementContext.prototype._getDependency = function (requestingProviderType, dep, eager) {\n if (eager === void 0) { eager = false; }\n var /** @type {?} */ currElement = this;\n var /** @type {?} */ currEager = eager;\n var /** @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 var /** @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 return ProviderElementContext;\n}());\nvar NgModuleProviderAnalyzer = (function () {\n /**\n * @param {?} reflector\n * @param {?} ngModule\n * @param {?} extraProviders\n * @param {?} sourceSpan\n */\n function NgModuleProviderAnalyzer(reflector, ngModule, extraProviders, sourceSpan) {\n var _this = this;\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(function (ngModuleType) {\n var ngModuleProvider = { token: { identifier: ngModuleType }, useClass: ngModuleType };\n _resolveProviders([ngModuleProvider], ProviderAstType.PublicService, true, sourceSpan, _this._errors, _this._allProviders);\n });\n _resolveProviders(ngModule.transitiveModule.providers.map(function (entry) { return entry.provider; }).concat(extraProviders), ProviderAstType.PublicService, false, sourceSpan, this._errors, this._allProviders);\n }\n /**\n * @return {?}\n */\n NgModuleProviderAnalyzer.prototype.parse = function () {\n var _this = this;\n Array.from(this._allProviders.values()).forEach(function (provider) {\n _this._getOrCreateLocalProvider(provider.token, provider.eager);\n });\n if (this._errors.length > 0) {\n var /** @type {?} */ errorString = this._errors.join('\\n');\n throw new Error(\"Provider parse errors:\\n\" + errorString);\n }\n // Note: Maps keep their insertion order.\n var /** @type {?} */ lazyProviders = [];\n var /** @type {?} */ eagerProviders = [];\n this._transformedProviders.forEach(function (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 NgModuleProviderAnalyzer.prototype._getOrCreateLocalProvider = function (token, eager) {\n var _this = this;\n var /** @type {?} */ resolvedProvider = this._allProviders.get(tokenReference(token));\n if (!resolvedProvider) {\n return null;\n }\n var /** @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 var /** @type {?} */ transformedProviders = resolvedProvider.providers.map(function (provider) {\n var /** @type {?} */ transformedUseValue = provider.useValue;\n var /** @type {?} */ transformedUseExisting = ((provider.useExisting));\n var /** @type {?} */ transformedDeps = ((undefined));\n if (provider.useExisting != null) {\n var /** @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 var /** @type {?} */ deps = provider.deps || provider.useFactory.diDeps;\n transformedDeps =\n deps.map(function (dep) { return _this._getDependency(dep, eager, resolvedProvider.sourceSpan); });\n }\n else if (provider.useClass) {\n var /** @type {?} */ deps = provider.deps || provider.useClass.diDeps;\n transformedDeps =\n deps.map(function (dep) { return _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 NgModuleProviderAnalyzer.prototype._getDependency = function (dep, eager, requestorSourceSpan) {\n if (eager === void 0) { eager = false; }\n var /** @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 var /** @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 return NgModuleProviderAnalyzer;\n}());\n/**\n * @param {?} provider\n * @param {?} __1\n * @return {?}\n */\nfunction _transformProvider(provider, _a) {\n var useExisting = _a.useExisting, useValue = _a.useValue, deps = _a.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, _a) {\n var eager = _a.eager, providers = _a.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 var /** @type {?} */ providersByToken = new Map();\n directives.forEach(function (directive) {\n var /** @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 var /** @type {?} */ directivesWithComponentFirst = directives.filter(function (dir) { return dir.isComponent; }).concat(directives.filter(function (dir) { return !dir.isComponent; }));\n directivesWithComponentFirst.forEach(function (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(function (provider) {\n var /** @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 var /** @type {?} */ lifecycleHooks = provider.token.identifier &&\n ((provider.token.identifier)).lifecycleHooks ?\n ((provider.token.identifier)).lifecycleHooks :\n [];\n var /** @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 var /** @type {?} */ viewQueryId = 1;\n var /** @type {?} */ viewQueries = new Map();\n if (component.viewQueries) {\n component.viewQueries.forEach(function (query) { return _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 var /** @type {?} */ contentQueryId = contentQueryStartId;\n var /** @type {?} */ contentQueries = new Map();\n directives.forEach(function (directive, directiveIndex) {\n if (directive.queries) {\n directive.queries.forEach(function (query) { return _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(function (token) {\n var /** @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/**\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 */\nvar ElementSchemaRegistry = (function () {\n function ElementSchemaRegistry() {\n }\n /**\n * @abstract\n * @param {?} tagName\n * @param {?} propName\n * @param {?} schemaMetas\n * @return {?}\n */\n ElementSchemaRegistry.prototype.hasProperty = function (tagName, propName, schemaMetas) { };\n /**\n * @abstract\n * @param {?} tagName\n * @param {?} schemaMetas\n * @return {?}\n */\n ElementSchemaRegistry.prototype.hasElement = function (tagName, schemaMetas) { };\n /**\n * @abstract\n * @param {?} elementName\n * @param {?} propName\n * @param {?} isAttribute\n * @return {?}\n */\n ElementSchemaRegistry.prototype.securityContext = function (elementName, propName, isAttribute) { };\n /**\n * @abstract\n * @return {?}\n */\n ElementSchemaRegistry.prototype.allKnownElementNames = function () { };\n /**\n * @abstract\n * @param {?} propName\n * @return {?}\n */\n ElementSchemaRegistry.prototype.getMappedPropName = function (propName) { };\n /**\n * @abstract\n * @return {?}\n */\n ElementSchemaRegistry.prototype.getDefaultComponentElementName = function () { };\n /**\n * @abstract\n * @param {?} name\n * @return {?}\n */\n ElementSchemaRegistry.prototype.validateProperty = function (name) { };\n /**\n * @abstract\n * @param {?} name\n * @return {?}\n */\n ElementSchemaRegistry.prototype.validateAttribute = function (name) { };\n /**\n * @abstract\n * @param {?} propName\n * @return {?}\n */\n ElementSchemaRegistry.prototype.normalizeAnimationStyleProperty = function (propName) { };\n /**\n * @abstract\n * @param {?} camelCaseProp\n * @param {?} userProvidedProp\n * @param {?} val\n * @return {?}\n */\n ElementSchemaRegistry.prototype.normalizeAnimationStyleValue = function (camelCaseProp, userProvidedProp, val) { };\n return ElementSchemaRegistry;\n}());\n/**\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 */\nvar StyleWithImports = (function () {\n /**\n * @param {?} style\n * @param {?} styleUrls\n */\n function StyleWithImports(style$$1, styleUrls) {\n this.style = style$$1;\n this.styleUrls = styleUrls;\n }\n return StyleWithImports;\n}());\n/**\n * @param {?} url\n * @return {?}\n */\nfunction isStyleUrlResolvable(url) {\n if (url == null || url.length === 0 || url[0] == '/')\n return false;\n var /** @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 */\nfunction extractStyleUrls(resolver, baseUrl, cssText) {\n var /** @type {?} */ foundUrls = [];\n var /** @type {?} */ modifiedCssText = cssText.replace(CSS_COMMENT_REGEXP, '').replace(CSS_IMPORT_REGEXP, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n var /** @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}\nvar CSS_IMPORT_REGEXP = /@import\\s+(?:url\\()?\\s*(?:(?:['\"]([^'\"]*))|([^;\\)\\s]*))[^;]*;?/g;\nvar CSS_COMMENT_REGEXP = /\\/\\*[\\s\\S]+?\\*\\//g;\nvar URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;\n/**\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 */\nvar PROPERTY_PARTS_SEPARATOR = '.';\nvar ATTRIBUTE_PREFIX = 'attr';\nvar CLASS_PREFIX = 'class';\nvar STYLE_PREFIX = 'style';\nvar ANIMATE_PROP_PREFIX = 'animate-';\nvar 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 */\nvar BoundProperty = (function () {\n /**\n * @param {?} name\n * @param {?} expression\n * @param {?} type\n * @param {?} sourceSpan\n */\n function BoundProperty(name, expression, type, sourceSpan) {\n this.name = name;\n this.expression = expression;\n this.type = type;\n this.sourceSpan = sourceSpan;\n }\n Object.defineProperty(BoundProperty.prototype, \"isLiteral\", {\n /**\n * @return {?}\n */\n get: function () { return this.type === BoundPropertyType.LITERAL_ATTR; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BoundProperty.prototype, \"isAnimation\", {\n /**\n * @return {?}\n */\n get: function () { return this.type === BoundPropertyType.ANIMATION; },\n enumerable: true,\n configurable: true\n });\n return BoundProperty;\n}());\n/**\n * Parses bindings in templates and in the directive host area.\n */\nvar BindingParser = (function () {\n /**\n * @param {?} _exprParser\n * @param {?} _interpolationConfig\n * @param {?} _schemaRegistry\n * @param {?} pipes\n * @param {?} _targetErrors\n */\n function BindingParser(_exprParser, _interpolationConfig, _schemaRegistry, pipes, _targetErrors) {\n var _this = this;\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(function (pipe) { return _this.pipesByName.set(pipe.name, pipe); });\n }\n /**\n * @return {?}\n */\n BindingParser.prototype.getUsedPipes = function () { return Array.from(this._usedPipes.values()); };\n /**\n * @param {?} dirMeta\n * @param {?} elementSelector\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype.createDirectiveHostPropertyAsts = function (dirMeta, elementSelector, sourceSpan) {\n var _this = this;\n if (dirMeta.hostProperties) {\n var /** @type {?} */ boundProps_1 = [];\n Object.keys(dirMeta.hostProperties).forEach(function (propName) {\n var /** @type {?} */ expression = dirMeta.hostProperties[propName];\n if (typeof expression === 'string') {\n _this.parsePropertyBinding(propName, expression, true, sourceSpan, [], boundProps_1);\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_1.map(function (prop) { return _this.createElementPropertyAst(elementSelector, prop); });\n }\n return null;\n };\n /**\n * @param {?} dirMeta\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype.createDirectiveHostEventAsts = function (dirMeta, sourceSpan) {\n var _this = this;\n if (dirMeta.hostListeners) {\n var /** @type {?} */ targetEventAsts_1 = [];\n Object.keys(dirMeta.hostListeners).forEach(function (propName) {\n var /** @type {?} */ expression = dirMeta.hostListeners[propName];\n if (typeof expression === 'string') {\n _this.parseEvent(propName, expression, sourceSpan, [], targetEventAsts_1);\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_1;\n }\n return null;\n };\n /**\n * @param {?} value\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype.parseInterpolation = function (value, sourceSpan) {\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @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 BindingParser.prototype.parseInlineTemplateBinding = function (prefixToken, value, sourceSpan, targetMatchableAttrs, targetProps, targetVars) {\n var /** @type {?} */ bindings = this._parseTemplateBindings(prefixToken, value, sourceSpan);\n for (var /** @type {?} */ i = 0; i < bindings.length; i++) {\n var /** @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 BindingParser.prototype._parseTemplateBindings = function (prefixToken, value, sourceSpan) {\n var _this = this;\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @type {?} */ bindingsResult = this._exprParser.parseTemplateBindings(prefixToken, value, sourceInfo);\n this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);\n bindingsResult.templateBindings.forEach(function (binding) {\n if (binding.expression) {\n _this._checkPipes(binding.expression, sourceSpan);\n }\n });\n bindingsResult.warnings.forEach(function (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 BindingParser.prototype.parseLiteralAttr = function (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 BindingParser.prototype.parsePropertyBinding = function (name, expression, isHost, sourceSpan, targetMatchableAttrs, targetProps) {\n var /** @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 BindingParser.prototype.parsePropertyInterpolation = function (name, value, sourceSpan, targetMatchableAttrs, targetProps) {\n var /** @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 BindingParser.prototype._parsePropertyAst = function (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 BindingParser.prototype._parseAnimation = function (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 var /** @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 BindingParser.prototype._parseBinding = function (value, isHostBinding, sourceSpan) {\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @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 BindingParser.prototype.createElementPropertyAst = function (elementSelector, boundProp) {\n if (boundProp.isAnimation) {\n return new BoundElementPropertyAst(boundProp.name, PropertyBindingType.Animation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan);\n }\n var /** @type {?} */ unit = null;\n var /** @type {?} */ bindingType = ((undefined));\n var /** @type {?} */ boundPropertyName = null;\n var /** @type {?} */ parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);\n var /** @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 var /** @type {?} */ nsSeparatorIdx = boundPropertyName.indexOf(':');\n if (nsSeparatorIdx > -1) {\n var /** @type {?} */ ns = boundPropertyName.substring(0, nsSeparatorIdx);\n var /** @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 BindingParser.prototype.parseEvent = function (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 BindingParser.prototype._parseAnimationEvent = function (name, expression, sourceSpan, targetEvents) {\n var /** @type {?} */ matches = splitAtPeriod(name, [name, '']);\n var /** @type {?} */ eventName = matches[0];\n var /** @type {?} */ phase = matches[1].toLowerCase();\n if (phase) {\n switch (phase) {\n case 'start':\n case 'done':\n var /** @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 BindingParser.prototype._parseEvent = function (name, expression, sourceSpan, targetMatchableAttrs, targetEvents) {\n // long format: 'target: eventName'\n var _a = splitAtColon(name, [/** @type {?} */ ((null)), name]), target = _a[0], eventName = _a[1];\n var /** @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 BindingParser.prototype._parseAction = function (value, sourceSpan) {\n var /** @type {?} */ sourceInfo = sourceSpan.start.toString();\n try {\n var /** @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 BindingParser.prototype._reportError = function (message, sourceSpan, level) {\n if (level === void 0) { level = ParseErrorLevel.ERROR; }\n this._targetErrors.push(new ParseError(sourceSpan, message, level));\n };\n /**\n * @param {?} errors\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._reportExpressionParserErrors = function (errors, sourceSpan) {\n for (var _i = 0, errors_1 = errors; _i < errors_1.length; _i++) {\n var error = errors_1[_i];\n this._reportError(error.message, sourceSpan);\n }\n };\n /**\n * @param {?} ast\n * @param {?} sourceSpan\n * @return {?}\n */\n BindingParser.prototype._checkPipes = function (ast, sourceSpan) {\n var _this = this;\n if (ast) {\n var /** @type {?} */ collector = new PipeCollector();\n ast.visit(collector);\n collector.pipes.forEach(function (ast, pipeName) {\n var /** @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 BindingParser.prototype._validatePropertyOrAttributeName = function (propName, sourceSpan, isAttr) {\n var /** @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 return BindingParser;\n}());\nvar PipeCollector = (function (_super) {\n tslib_1.__extends(PipeCollector, _super);\n function PipeCollector() {\n var _this = _super.apply(this, arguments) || this;\n _this.pipes = new Map();\n return _this;\n }\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n PipeCollector.prototype.visitPipe = function (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 return PipeCollector;\n}(RecursiveAstVisitor));\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 */\nfunction calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {\n var /** @type {?} */ ctxs = [];\n CssSelector.parse(selector).forEach(function (selector) {\n var /** @type {?} */ elementNames = selector.element ? [selector.element] : registry.allKnownElementNames();\n var /** @type {?} */ notElementNames = new Set(selector.notSelectors.filter(function (selector) { return selector.isElementSelector(); })\n .map(function (selector) { return selector.element; }));\n var /** @type {?} */ possibleElementNames = elementNames.filter(function (elementName) { return !notElementNames.has(elementName); });\n ctxs.push.apply(ctxs, possibleElementNames.map(function (elementName) { return registry.securityContext(elementName, propName, isAttribute); }));\n });\n return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();\n}\n/**\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 */\nvar NG_CONTENT_SELECT_ATTR = 'select';\nvar LINK_ELEMENT = 'link';\nvar LINK_STYLE_REL_ATTR = 'rel';\nvar LINK_STYLE_HREF_ATTR = 'href';\nvar LINK_STYLE_REL_VALUE = 'stylesheet';\nvar STYLE_ELEMENT = 'style';\nvar SCRIPT_ELEMENT = 'script';\nvar NG_NON_BINDABLE_ATTR = 'ngNonBindable';\nvar NG_PROJECT_AS = 'ngProjectAs';\n/**\n * @param {?} ast\n * @return {?}\n */\nfunction preparseElement(ast) {\n var /** @type {?} */ selectAttr = ((null));\n var /** @type {?} */ hrefAttr = ((null));\n var /** @type {?} */ relAttr = ((null));\n var /** @type {?} */ nonBindable = false;\n var /** @type {?} */ projectAs = ((null));\n ast.attrs.forEach(function (attr) {\n var /** @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 var /** @type {?} */ nodeName = ast.name.toLowerCase();\n var /** @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}\nvar 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\";\nvar PreparsedElement = (function () {\n /**\n * @param {?} type\n * @param {?} selectAttr\n * @param {?} hrefAttr\n * @param {?} nonBindable\n * @param {?} projectAs\n */\n function PreparsedElement(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 return PreparsedElement;\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/**\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 */\nvar BIND_NAME_REGEXP = /^(?:(?:(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.+))|\\[\\(([^\\)]+)\\)\\]|\\[([^\\]]+)\\]|\\(([^\\)]+)\\))$/;\n// Group 1 = \"bind-\"\nvar KW_BIND_IDX = 1;\n// Group 2 = \"let-\"\nvar KW_LET_IDX = 2;\n// Group 3 = \"ref-/#\"\nvar KW_REF_IDX = 3;\n// Group 4 = \"on-\"\nvar KW_ON_IDX = 4;\n// Group 5 = \"bindon-\"\nvar KW_BINDON_IDX = 5;\n// Group 6 = \"@\"\nvar KW_AT_IDX = 6;\n// Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\nvar IDENT_KW_IDX = 7;\n// Group 8 = identifier inside [()]\nvar IDENT_BANANA_BOX_IDX = 8;\n// Group 9 = identifier inside []\nvar IDENT_PROPERTY_IDX = 9;\n// Group 10 = identifier inside ()\nvar IDENT_EVENT_IDX = 10;\n// deprecated in 4.x\nvar TEMPLATE_ELEMENT = 'template';\n// deprecated in 4.x\nvar TEMPLATE_ATTR = 'template';\nvar TEMPLATE_ATTR_PREFIX = '*';\nvar CLASS_ATTR = 'class';\nvar TEXT_CSS_SELECTOR = CssSelector.parse('*')[0];\nvar TEMPLATE_ELEMENT_DEPRECATION_WARNING = 'The