webpackJsonp([0],[ /* 0 */ /***/ function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(process) {\"use strict\";\nvar platform_browser_dynamic_1 = __webpack_require__(2);\nvar core_1 = __webpack_require__(4);\nvar app_module_1 = __webpack_require__(24);\nif (process.env.ENV === 'production') {\n core_1.enableProdMode();\n}\nplatform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy9tYWluLnRzPzdkNjQiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcGxhdGZvcm1Ccm93c2VyRHluYW1pYyB9IGZyb20gJ0Bhbmd1bGFyL3BsYXRmb3JtLWJyb3dzZXItZHluYW1pYyc7XG5pbXBvcnQgeyBlbmFibGVQcm9kTW9kZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQXBwTW9kdWxlIH0gZnJvbSAnLi9hcHAvYXBwLm1vZHVsZSc7XG5pZiAocHJvY2Vzcy5lbnYuRU5WID09PSAncHJvZHVjdGlvbicpIHtcbiAgZW5hYmxlUHJvZE1vZGUoKTtcbn1cbnBsYXRmb3JtQnJvd3NlckR5bmFtaWMoKS5ib290c3RyYXBNb2R1bGUoQXBwTW9kdWxlKTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBub2RlX21vZHVsZXMvYW5ndWxhcjItdGVtcGxhdGUtbG9hZGVyIS4vc3JjL21haW4udHMiXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Iiwic291cmNlUm9vdCI6IiJ9"); /***/ }, /* 1 */, /* 2 */, /* 3 */, /* 4 */, /* 5 */, /* 6 */, /* 7 */, /* 8 */, /* 9 */, /* 10 */, /* 11 */, /* 12 */, /* 13 */, /* 14 */, /* 15 */, /* 16 */, /* 17 */, /* 18 */, /* 19 */, /* 20 */, /* 21 */, /* 22 */, /* 23 */, /* 24 */ /***/ function(module, exports, __webpack_require__) { eval("\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar core_1 = __webpack_require__(4);\nvar forms_1 = __webpack_require__(25);\nvar platform_browser_1 = __webpack_require__(22);\nvar app_component_1 = __webpack_require__(29);\nvar app_routing_1 = __webpack_require__(31);\nvar home_component_1 = __webpack_require__(62);\nvar archive_component_1 = __webpack_require__(104);\nvar bin_component_1 = __webpack_require__(106);\nvar about_component_1 = __webpack_require__(108);\nvar spinner_1 = __webpack_require__(111);\nvar angular2_notifications_1 = __webpack_require__(63);\nvar dragula_1 = __webpack_require__(112);\nvar fluid_height_1 = __webpack_require__(113);\nvar dragula_2 = __webpack_require__(76);\nvar notes_table_1 = __webpack_require__(114);\nvar notes_table_service_1 = __webpack_require__(88);\nvar bin_table_service_1 = __webpack_require__(101);\nvar archive_table_service_1 = __webpack_require__(102);\nvar AppModule = (function () {\n function AppModule() {\n }\n AppModule = __decorate([\n core_1.NgModule({\n imports: [\n platform_browser_1.BrowserModule,\n app_routing_1.AppRoutingModule,\n angular2_notifications_1.SimpleNotificationsModule,\n forms_1.FormsModule\n ],\n declarations: [\n app_component_1.AppComponent,\n home_component_1.HomeComponent,\n archive_component_1.ArchiveComponent,\n bin_component_1.BinComponent,\n about_component_1.AboutComponent,\n spinner_1.Spinner,\n dragula_1.Dragula,\n fluid_height_1.FluidHeightDirective\n ],\n providers: [dragula_2.DragulaService, notes_table_1.NotesTable, notes_table_service_1.NotesTableService, bin_table_service_1.BinNotesTableService, archive_table_service_1.ArchiveNotesTableService],\n bootstrap: [app_component_1.AppComponent]\n }), \n __metadata('design:paramtypes', [])\n ], AppModule);\n return AppModule;\n}());\nexports.AppModule = AppModule;\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYXBwL2FwcC5tb2R1bGUudHM/MjU2YSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgRm9ybXNNb2R1bGUgfSAgIGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcbmltcG9ydCB7IEJyb3dzZXJNb2R1bGUgfSAgZnJvbSAnQGFuZ3VsYXIvcGxhdGZvcm0tYnJvd3Nlcic7XG5pbXBvcnQgeyBBcHBDb21wb25lbnQgfSBmcm9tICcuL2FwcC5jb21wb25lbnQnO1xuaW1wb3J0IHsgQXBwUm91dGluZ01vZHVsZSB9IGZyb20gJy4vYXBwLnJvdXRpbmcnO1xuaW1wb3J0IHsgSG9tZUNvbXBvbmVudCB9IGZyb20gJy4vY29tcG9uZW50cy9ob21lL2hvbWUuY29tcG9uZW50JztcbmltcG9ydCB7IEFyY2hpdmVDb21wb25lbnQgfSBmcm9tICcuL2NvbXBvbmVudHMvYXJjaGl2ZS1ub3Rlcy9hcmNoaXZlLmNvbXBvbmVudCc7XG5pbXBvcnQgeyBCaW5Db21wb25lbnQgfSBmcm9tICcuL2NvbXBvbmVudHMvYmluL2Jpbi5jb21wb25lbnQnO1xuaW1wb3J0IHsgQWJvdXRDb21wb25lbnQgfSBmcm9tICcuL2NvbXBvbmVudHMvYWJvdXQvYWJvdXQuY29tcG9uZW50JztcbmltcG9ydCB7IFNwaW5uZXIgfSBmcm9tICcuL2NvbXBvbmVudHMvc3Bpbm5lci9zcGlubmVyJztcblxuaW1wb3J0IHsgTm90aWZpY2F0aW9uc1NlcnZpY2UsIFNpbXBsZU5vdGlmaWNhdGlvbnNNb2R1bGUgfSBmcm9tIFwiYW5ndWxhcjItbm90aWZpY2F0aW9uc1wiO1xuXG5pbXBvcnQgeyBEcmFndWxhIH0gZnJvbSAnLi9kaXJlY3RpdmVzL2RyYWd1bGEnO1xuaW1wb3J0IHsgRmx1aWRIZWlnaHREaXJlY3RpdmUgfSBmcm9tICcuL2RpcmVjdGl2ZXMvZmx1aWQtaGVpZ2h0JztcbmltcG9ydCB7IERyYWd1bGFTZXJ2aWNlIH0gZnJvbSAnLi9wcm92aWRlcnMvZHJhZ3VsYSc7XG5pbXBvcnQgeyBOb3Rlc1RhYmxlIH0gZnJvbSAnLi9zZXJ2aWNlcy9ub3Rlc190YWJsZSc7XG5pbXBvcnQgeyBOb3Rlc1RhYmxlU2VydmljZSB9IGZyb20gJy4vc2VydmljZXMvbm90ZXNfdGFibGUuc2VydmljZSc7XG5pbXBvcnQgeyBCaW5Ob3Rlc1RhYmxlU2VydmljZSB9IGZyb20gJy4vc2VydmljZXMvYmluX3RhYmxlLnNlcnZpY2UnO1xuaW1wb3J0IHsgQXJjaGl2ZU5vdGVzVGFibGVTZXJ2aWNlIH0gZnJvbSAnLi9zZXJ2aWNlcy9hcmNoaXZlX3RhYmxlLnNlcnZpY2UnO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbXG4gICAgQnJvd3Nlck1vZHVsZSxcbiAgICBBcHBSb3V0aW5nTW9kdWxlLFxuICAgIFNpbXBsZU5vdGlmaWNhdGlvbnNNb2R1bGUsXG4gICAgRm9ybXNNb2R1bGVcbiAgXSxcbiAgZGVjbGFyYXRpb25zOiBbXG4gICAgQXBwQ29tcG9uZW50LFxuICAgIEhvbWVDb21wb25lbnQsXG4gICAgQXJjaGl2ZUNvbXBvbmVudCxcbiAgICBCaW5Db21wb25lbnQsXG4gICAgQWJvdXRDb21wb25lbnQsXG4gICAgU3Bpbm5lcixcbiAgICBEcmFndWxhLFxuICAgIEZsdWlkSGVpZ2h0RGlyZWN0aXZlXG4gIF0sXG4gIHByb3ZpZGVyczogWyBEcmFndWxhU2VydmljZSwgTm90ZXNUYWJsZSwgTm90ZXNUYWJsZVNlcnZpY2UsIEJpbk5vdGVzVGFibGVTZXJ2aWNlLCBBcmNoaXZlTm90ZXNUYWJsZVNlcnZpY2UgXSxcbiAgYm9vdHN0cmFwOiBbIEFwcENvbXBvbmVudCBdXG59KVxuZXhwb3J0IGNsYXNzIEFwcE1vZHVsZSB7IH1cblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBub2RlX21vZHVsZXMvYW5ndWxhcjItdGVtcGxhdGUtbG9hZGVyIS4vc3JjL2FwcC9hcHAubW9kdWxlLnRzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBc0JBO0FBQUE7QUFBQTtBQXBCQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBQUE7QUFDQTtBQUFBO0FBQUE7Iiwic291cmNlUm9vdCI6IiJ9"); /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { eval("/**\n * @license Angular v2.4.1\n * (c) 2010-2016 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n true ? factory(exports, __webpack_require__(4), __webpack_require__(26), __webpack_require__(5), __webpack_require__(6), __webpack_require__(27)) :\n typeof define === 'function' && define.amd ? define(['exports', '@angular/core', 'rxjs/operator/toPromise', 'rxjs/Subject', 'rxjs/Observable', 'rxjs/observable/fromPromise'], factory) :\n (factory((global.ng = global.ng || {}, global.ng.forms = global.ng.forms || {}),global.ng.core,global.Rx.Observable.prototype,global.Rx,global.Rx,global.Rx.Observable));\n}(this, function (exports,_angular_core,rxjs_operator_toPromise,rxjs_Subject,rxjs_Observable,rxjs_observable_fromPromise) { 'use strict';\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 * Base class for control directives.\n * *\n * Only used internally in the forms module.\n * *\n * @abstract\n */\n var AbstractControlDirective = (function () {\n function AbstractControlDirective() {\n }\n Object.defineProperty(AbstractControlDirective.prototype, \"control\", {\n /**\n * @return {?}\n */\n get: function () { throw new Error('unimplemented'); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"value\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.value : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valid\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.valid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"invalid\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.invalid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pending\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.pending : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"errors\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.errors : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pristine\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.pristine : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"dirty\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.dirty : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"touched\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.touched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"untouched\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.untouched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"disabled\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.disabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"enabled\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.enabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"statusChanges\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.statusChanges : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valueChanges\", {\n /**\n * @return {?}\n */\n get: function () { return this.control ? this.control.valueChanges : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"path\", {\n /**\n * @return {?}\n */\n get: function () { return null; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?=} value\n * @return {?}\n */\n AbstractControlDirective.prototype.reset = function (value) {\n if (value === void 0) { value = undefined; }\n if (this.control)\n this.control.reset(value);\n };\n /**\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControlDirective.prototype.hasError = function (errorCode, path) {\n if (path === void 0) { path = null; }\n return this.control ? this.control.hasError(errorCode, path) : false;\n };\n /**\n * @param {?} errorCode\n * @param {?=} path\n * @return {?}\n */\n AbstractControlDirective.prototype.getError = function (errorCode, path) {\n if (path === void 0) { path = null; }\n return this.control ? this.control.getError(errorCode, path) : null;\n };\n return AbstractControlDirective;\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 var __extends$1 = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n /**\n * A directive that contains multiple {@link NgControl}s.\n * *\n * Only used by the forms module.\n * *\n */\n var ControlContainer = (function (_super) {\n __extends$1(ControlContainer, _super);\n function ControlContainer() {\n _super.apply(this, arguments);\n }\n Object.defineProperty(ControlContainer.prototype, \"formDirective\", {\n /**\n * Get the form to which this container belongs.\n * @return {?}\n */\n get: function () { return null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ControlContainer.prototype, \"path\", {\n /**\n * Get the path to this container.\n * @return {?}\n */\n get: function () { return null; },\n enumerable: true,\n configurable: true\n });\n return ControlContainer;\n }(AbstractControlDirective));\n\n /**\n * @param {?} obj\n * @return {?}\n */\n function isPresent(obj) {\n return obj != null;\n }\n /**\n * @param {?} obj\n * @return {?}\n */\n function isBlank(obj) {\n return obj == null;\n }\n /**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\n function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n }\n /**\n * @param {?} o\n * @return {?}\n */\n function isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n }\n /**\n * @param {?} obj\n * @return {?}\n */\n function isPrimitive(obj) {\n return !isJsObject(obj);\n }\n\n /**\n * Wraps Javascript Objects\n */\n var StringMapWrapper = (function () {\n function StringMapWrapper() {\n }\n /**\n * @param {?} m1\n * @param {?} m2\n * @return {?}\n */\n StringMapWrapper.merge = function (m1, m2) {\n var /** @type {?} */ m = {};\n for (var _i = 0, _a = Object.keys(m1); _i < _a.length; _i++) {\n var k = _a[_i];\n m[k] = m1[k];\n }\n for (var _b = 0, _c = Object.keys(m2); _b < _c.length; _b++) {\n var k = _c[_b];\n m[k] = m2[k];\n }\n return m;\n };\n /**\n * @param {?} m1\n * @param {?} m2\n * @return {?}\n */\n StringMapWrapper.equals = function (m1, m2) {\n var /** @type {?} */ k1 = Object.keys(m1);\n var /** @type {?} */ k2 = Object.keys(m2);\n if (k1.length != k2.length) {\n return false;\n }\n for (var /** @type {?} */ i = 0; i < k1.length; i++) {\n var /** @type {?} */ key = k1[i];\n if (m1[key] !== m2[key]) {\n return false;\n }\n }\n return true;\n };\n return StringMapWrapper;\n }());\n var ListWrapper = (function () {\n function ListWrapper() {\n }\n /**\n * @param {?} arr\n * @param {?} condition\n * @return {?}\n */\n ListWrapper.findLast = function (arr, condition) {\n for (var /** @type {?} */ i = arr.length - 1; i >= 0; i--) {\n if (condition(arr[i])) {\n return arr[i];\n }\n }\n return null;\n };\n /**\n * @param {?} list\n * @param {?} items\n * @return {?}\n */\n ListWrapper.removeAll = function (list, items) {\n for (var /** @type {?} */ i = 0; i < items.length; ++i) {\n var /** @type {?} */ index = list.indexOf(items[i]);\n if (index > -1) {\n list.splice(index, 1);\n }\n }\n };\n /**\n * @param {?} list\n * @param {?} el\n * @return {?}\n */\n ListWrapper.remove = function (list, el) {\n var /** @type {?} */ index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n return true;\n }\n return false;\n };\n /**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\n ListWrapper.equals = function (a, b) {\n if (a.length != b.length)\n return false;\n for (var /** @type {?} */ i = 0; i < a.length; ++i) {\n if (a[i] !== b[i])\n return false;\n }\n return true;\n };\n /**\n * @param {?} list\n * @return {?}\n */\n ListWrapper.flatten = function (list) {\n return list.reduce(function (flat, item) {\n var /** @type {?} */ flatItem = Array.isArray(item) ? ListWrapper.flatten(item) : item;\n return ((flat)).concat(flatItem);\n }, []);\n };\n return ListWrapper;\n }());\n\n var /** @type {?} */ isPromise = _angular_core.__core_private__.isPromise;\n\n /**\n * @param {?} value\n * @return {?}\n */\n function isEmptyInputValue(value) {\n return value == null || typeof value === 'string' && value.length === 0;\n }\n /**\n * Providers for validators to be used for {@link FormControl}s in a form.\n *\n * Provide this using `multi: true` to add validators.\n *\n * ### Example\n *\n * {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}\n * @stable\n */\n var /** @type {?} */ NG_VALIDATORS = new _angular_core.OpaqueToken('NgValidators');\n /**\n * Providers for asynchronous validators to be used for {@link FormControl}s\n * in a form.\n *\n * Provide this using `multi: true` to add validators.\n *\n * See {@link NG_VALIDATORS} for more details.\n *\n * @stable\n */\n var /** @type {?} */ NG_ASYNC_VALIDATORS = new _angular_core.OpaqueToken('NgAsyncValidators');\n /**\n * Provides a set of validators used by form controls.\n * *\n * A validator is a function that processes a {@link FormControl} or collection of\n * controls and returns a map of errors. A null map means that validation has passed.\n * *\n * ### Example\n * *\n * ```typescript\n * var loginControl = new FormControl(\"\", Validators.required)\n * ```\n * *\n */\n var Validators = (function () {\n function Validators() {\n }\n /**\n * Validator that requires controls to have a non-empty value.\n * @param {?} control\n * @return {?}\n */\n Validators.required = function (control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n };\n /**\n * Validator that requires control value to be true.\n * @param {?} control\n * @return {?}\n */\n Validators.requiredTrue = function (control) {\n return control.value === true ? null : { 'required': true };\n };\n /**\n * Validator that requires controls to have a value of a minimum length.\n * @param {?} minLength\n * @return {?}\n */\n Validators.minLength = function (minLength) {\n return function (control) {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ length = control.value ? control.value.length : 0;\n return length < minLength ?\n { 'minlength': { 'requiredLength': minLength, 'actualLength': length } } :\n null;\n };\n };\n /**\n * Validator that requires controls to have a value of a maximum length.\n * @param {?} maxLength\n * @return {?}\n */\n Validators.maxLength = function (maxLength) {\n return function (control) {\n var /** @type {?} */ length = control.value ? control.value.length : 0;\n return length > maxLength ?\n { 'maxlength': { 'requiredLength': maxLength, 'actualLength': length } } :\n null;\n };\n };\n /**\n * Validator that requires a control to match a regex to its value.\n * @param {?} pattern\n * @return {?}\n */\n Validators.pattern = function (pattern) {\n if (!pattern)\n return Validators.nullValidator;\n var /** @type {?} */ regex;\n var /** @type {?} */ regexStr;\n if (typeof pattern === 'string') {\n regexStr = \"^\" + pattern + \"$\";\n regex = new RegExp(regexStr);\n }\n else {\n regexStr = pattern.toString();\n regex = pattern;\n }\n return function (control) {\n if (isEmptyInputValue(control.value)) {\n return null; // don't validate empty values to allow optional controls\n }\n var /** @type {?} */ value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n };\n /**\n * No-op validator.\n * @param {?} c\n * @return {?}\n */\n Validators.nullValidator = function (c) { return null; };\n /**\n * Compose multiple validators into a single function that returns the union\n * of the individual error maps.\n * @param {?} validators\n * @return {?}\n */\n Validators.compose = function (validators) {\n if (!validators)\n return null;\n var /** @type {?} */ presentValidators = validators.filter(isPresent);\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n return _mergeErrors(_executeValidators(control, presentValidators));\n };\n };\n /**\n * @param {?} validators\n * @return {?}\n */\n Validators.composeAsync = function (validators) {\n if (!validators)\n return null;\n var /** @type {?} */ presentValidators = validators.filter(isPresent);\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n var /** @type {?} */ promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);\n return Promise.all(promises).then(_mergeErrors);\n };\n };\n return Validators;\n }());\n /**\n * @param {?} obj\n * @return {?}\n */\n function _convertToPromise(obj) {\n return isPromise(obj) ? obj : rxjs_operator_toPromise.toPromise.call(obj);\n }\n /**\n * @param {?} control\n * @param {?} validators\n * @return {?}\n */\n function _executeValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n }\n /**\n * @param {?} control\n * @param {?} validators\n * @return {?}\n */\n function _executeAsyncValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n }\n /**\n * @param {?} arrayOfErrors\n * @return {?}\n */\n function _mergeErrors(arrayOfErrors) {\n var /** @type {?} */ res = arrayOfErrors.reduce(function (res, errors) {\n return isPresent(errors) ? StringMapWrapper.merge(res, errors) : res;\n }, {});\n return Object.keys(res).length === 0 ? null : res;\n }\n\n /**\n * Used to provide a {@link ControlValueAccessor} for form controls.\n *\n * See {@link DefaultValueAccessor} for how to implement one.\n * @stable\n */\n var /** @type {?} */ NG_VALUE_ACCESSOR = new _angular_core.OpaqueToken('NgValueAccessor');\n\n var /** @type {?} */ CHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return CheckboxControlValueAccessor; }),\n multi: true,\n };\n /**\n * The accessor for writing a value and listening to changes on a checkbox input element.\n * *\n * ### Example\n * ```\n * \n * ```\n * *\n * @stable\n */\n var CheckboxControlValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n */\n function CheckboxControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.writeValue = function (value) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'checked', value);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n /**\n * @param {?} fn\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n CheckboxControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n CheckboxControlValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]',\n host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },\n providers: [CHECKBOX_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n CheckboxControlValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ]; };\n return CheckboxControlValueAccessor;\n }());\n\n var /** @type {?} */ DEFAULT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return DefaultValueAccessor; }),\n multi: true\n };\n /**\n * The default accessor for writing a value and listening to changes that is used by the\n * {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName} directives.\n * *\n * ### Example\n * ```\n * \n * ```\n * *\n * @stable\n */\n var DefaultValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n */\n function DefaultValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n DefaultValueAccessor.prototype.writeValue = function (value) {\n var /** @type {?} */ normalizedValue = value == null ? '' : value;\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n DefaultValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n /**\n * @param {?} fn\n * @return {?}\n */\n DefaultValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n DefaultValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n DefaultValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]',\n // TODO: vsavkin replace the above selector with the one below it once\n // https://github.com/angular/angular/issues/3011 is implemented\n // selector: '[ngControl],[ngModel],[ngFormControl]',\n host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },\n providers: [DEFAULT_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n DefaultValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ]; };\n return DefaultValueAccessor;\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 * @param {?} validator\n * @return {?}\n */\n function normalizeValidator(validator) {\n if (((validator)).validate) {\n return function (c) { return ((validator)).validate(c); };\n }\n else {\n return (validator);\n }\n }\n /**\n * @param {?} validator\n * @return {?}\n */\n function normalizeAsyncValidator(validator) {\n if (((validator)).validate) {\n return function (c) { return ((validator)).validate(c); };\n }\n else {\n return (validator);\n }\n }\n\n var /** @type {?} */ NUMBER_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return NumberValueAccessor; }),\n multi: true\n };\n /**\n * The accessor for writing a number value and listening to changes that is used by the\n * {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName} directives.\n * *\n * ### Example\n * ```\n * \n * ```\n */\n var NumberValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n */\n function NumberValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n NumberValueAccessor.prototype.writeValue = function (value) {\n // The value needs to be normalized for IE9, otherwise it is set to 'null' when null\n var /** @type {?} */ normalizedValue = value == null ? '' : value;\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n NumberValueAccessor.prototype.registerOnChange = function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n NumberValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n NumberValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n NumberValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]',\n host: {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()'\n },\n providers: [NUMBER_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n NumberValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ]; };\n return NumberValueAccessor;\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 var __extends$2 = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n /**\n * @return {?}\n */\n function unimplemented() {\n throw new Error('unimplemented');\n }\n /**\n * A base class that all control directive extend.\n * It binds a {@link FormControl} object to a DOM element.\n * *\n * Used internally by Angular forms.\n * *\n * @abstract\n */\n var NgControl = (function (_super) {\n __extends$2(NgControl, _super);\n function NgControl() {\n _super.apply(this, arguments);\n /** @internal */\n this._parent = null;\n this.name = null;\n this.valueAccessor = null;\n /** @internal */\n this._rawValidators = [];\n /** @internal */\n this._rawAsyncValidators = [];\n }\n Object.defineProperty(NgControl.prototype, \"validator\", {\n /**\n * @return {?}\n */\n get: function () { return (unimplemented()); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgControl.prototype, \"asyncValidator\", {\n /**\n * @return {?}\n */\n get: function () { return (unimplemented()); },\n enumerable: true,\n configurable: true\n });\n /**\n * @abstract\n * @param {?} newValue\n * @return {?}\n */\n NgControl.prototype.viewToModelUpdate = function (newValue) { };\n return NgControl;\n }(AbstractControlDirective));\n\n var /** @type {?} */ RADIO_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return RadioControlValueAccessor; }),\n multi: true\n };\n /**\n * Internal class used by Angular to uncheck radio buttons with the matching name.\n */\n var RadioControlRegistry = (function () {\n function RadioControlRegistry() {\n this._accessors = [];\n }\n /**\n * @param {?} control\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.add = function (control, accessor) {\n this._accessors.push([control, accessor]);\n };\n /**\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.remove = function (accessor) {\n for (var /** @type {?} */ i = this._accessors.length - 1; i >= 0; --i) {\n if (this._accessors[i][1] === accessor) {\n this._accessors.splice(i, 1);\n return;\n }\n }\n };\n /**\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype.select = function (accessor) {\n var _this = this;\n this._accessors.forEach(function (c) {\n if (_this._isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].fireUncheck(accessor.value);\n }\n });\n };\n /**\n * @param {?} controlPair\n * @param {?} accessor\n * @return {?}\n */\n RadioControlRegistry.prototype._isSameGroup = function (controlPair, accessor) {\n if (!controlPair[0].control)\n return false;\n return controlPair[0]._parent === accessor._control._parent &&\n controlPair[1].name === accessor.name;\n };\n RadioControlRegistry.decorators = [\n { type: _angular_core.Injectable },\n ];\n /** @nocollapse */\n RadioControlRegistry.ctorParameters = function () { return []; };\n return RadioControlRegistry;\n }());\n /**\n * *\n * Used by {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName}\n * to keep the view synced with the {@link FormControl} model.\n * *\n * *\n * If you have imported the {@link FormsModule} or the {@link ReactiveFormsModule}, this\n * value accessor will be active on any radio control that has a form directive. You do\n * **not** need to add a special selector to activate it.\n * *\n * ### How to use radio buttons with form directives\n * *\n * To use radio buttons in a template-driven form, you'll want to ensure that radio buttons\n * in the same group have the same `name` attribute. Radio buttons with different `name`\n * attributes do not affect each other.\n * *\n * {@example forms/ts/radioButtons/radio_button_example.ts region='TemplateDriven'}\n * *\n * When using radio buttons in a reactive form, radio buttons in the same group should have the\n * same `formControlName`. You can also add a `name` attribute, but it's optional.\n * *\n * {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'}\n * *\n * * **npm package**: `@angular/forms`\n * *\n * @stable\n */\n var RadioControlValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n * @param {?} _registry\n * @param {?} _injector\n */\n function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this._registry = _registry;\n this._injector = _injector;\n this.onChange = function () { };\n this.onTouched = function () { };\n }\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype.ngOnInit = function () {\n this._control = this._injector.get(NgControl);\n this._checkName();\n this._registry.add(this._control, this);\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype.ngOnDestroy = function () { this._registry.remove(this); };\n /**\n * @param {?} value\n * @return {?}\n */\n RadioControlValueAccessor.prototype.writeValue = function (value) {\n this._state = value === this.value;\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'checked', this._state);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RadioControlValueAccessor.prototype.registerOnChange = function (fn) {\n var _this = this;\n this._fn = fn;\n this.onChange = function () {\n fn(_this.value);\n _this._registry.select(_this);\n };\n };\n /**\n * @param {?} value\n * @return {?}\n */\n RadioControlValueAccessor.prototype.fireUncheck = function (value) { this.writeValue(value); };\n /**\n * @param {?} fn\n * @return {?}\n */\n RadioControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n RadioControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype._checkName = function () {\n if (this.name && this.formControlName && this.name !== this.formControlName) {\n this._throwNameError();\n }\n if (!this.name && this.formControlName)\n this.name = this.formControlName;\n };\n /**\n * @return {?}\n */\n RadioControlValueAccessor.prototype._throwNameError = function () {\n throw new Error(\"\\n If you define both a name and a formControlName attribute on your radio button, their values\\n must match. Ex: \\n \");\n };\n RadioControlValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]',\n host: { '(change)': 'onChange()', '(blur)': 'onTouched()' },\n providers: [RADIO_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n RadioControlValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n { type: RadioControlRegistry, },\n { type: _angular_core.Injector, },\n ]; };\n RadioControlValueAccessor.propDecorators = {\n 'name': [{ type: _angular_core.Input },],\n 'formControlName': [{ type: _angular_core.Input },],\n 'value': [{ type: _angular_core.Input },],\n };\n return RadioControlValueAccessor;\n }());\n\n var /** @type {?} */ RANGE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return RangeValueAccessor; }),\n multi: true\n };\n /**\n * The accessor for writing a range value and listening to changes that is used by the\n * {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName} directives.\n * *\n * ### Example\n * ```\n * \n * ```\n */\n var RangeValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n */\n function RangeValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n RangeValueAccessor.prototype.writeValue = function (value) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RangeValueAccessor.prototype.registerOnChange = function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n RangeValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n RangeValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n RangeValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]',\n host: {\n '(change)': 'onChange($event.target.value)',\n '(input)': 'onChange($event.target.value)',\n '(blur)': 'onTouched()'\n },\n providers: [RANGE_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n RangeValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ]; };\n return RangeValueAccessor;\n }());\n\n var /** @type {?} */ SELECT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return SelectControlValueAccessor; }),\n multi: true\n };\n /**\n * @param {?} id\n * @param {?} value\n * @return {?}\n */\n function _buildValueString(id, value) {\n if (id == null)\n return \"\" + value;\n if (!isPrimitive(value))\n value = 'Object';\n return (id + \": \" + value).slice(0, 50);\n }\n /**\n * @param {?} valueString\n * @return {?}\n */\n function _extractId(valueString) {\n return valueString.split(':')[0];\n }\n /**\n * *\n * Used by {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName}\n * to keep the view synced with the {@link FormControl} model.\n * *\n * *\n * If you have imported the {@link FormsModule} or the {@link ReactiveFormsModule}, this\n * value accessor will be active on any select control that has a form directive. You do\n * **not** need to add a special selector to activate it.\n * *\n * ### How to use select controls with form directives\n * *\n * To use a select in a template-driven form, simply add an `ngModel` and a `name`\n * attribute to the main `` tag. Like in the former example, you have the\n * choice of binding to the `value` or `ngValue` property on the select's options.\n * *\n * {@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'}\n * *\n * Note: We listen to the 'change' event because 'input' events aren't fired\n * for selects in Firefox and IE:\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1024350\n * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/\n * *\n * * **npm package**: `@angular/forms`\n * *\n */\n var SelectControlValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n */\n function SelectControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /** @internal */\n this._optionMap = new Map();\n /** @internal */\n this._idCounter = 0;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n SelectControlValueAccessor.prototype.writeValue = function (value) {\n this.value = value;\n var /** @type {?} */ valueString = _buildValueString(this._getOptionId(value), value);\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', valueString);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectControlValueAccessor.prototype.registerOnChange = function (fn) {\n var _this = this;\n this.onChange = function (valueString) {\n _this.value = valueString;\n fn(_this._getOptionValue(valueString));\n };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n SelectControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /**\n * @return {?}\n */\n SelectControlValueAccessor.prototype._registerOption = function () { return (this._idCounter++).toString(); };\n /**\n * @param {?} value\n * @return {?}\n */\n SelectControlValueAccessor.prototype._getOptionId = function (value) {\n for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {\n var id = _a[_i];\n if (looseIdentical(this._optionMap.get(id), value))\n return id;\n }\n return null;\n };\n /**\n * @param {?} valueString\n * @return {?}\n */\n SelectControlValueAccessor.prototype._getOptionValue = function (valueString) {\n var /** @type {?} */ id = _extractId(valueString);\n return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;\n };\n SelectControlValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]',\n host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },\n providers: [SELECT_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n SelectControlValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ]; };\n return SelectControlValueAccessor;\n }());\n /**\n * *\n * *\n * See docs for {@link SelectControlValueAccessor} for usage examples.\n * *\n */\n var NgSelectOption = (function () {\n /**\n * @param {?} _element\n * @param {?} _renderer\n * @param {?} _select\n */\n function NgSelectOption(_element, _renderer, _select) {\n this._element = _element;\n this._renderer = _renderer;\n this._select = _select;\n if (this._select)\n this.id = this._select._registerOption();\n }\n Object.defineProperty(NgSelectOption.prototype, \"ngValue\", {\n /**\n * @param {?} value\n * @return {?}\n */\n set: function (value) {\n if (this._select == null)\n return;\n this._select._optionMap.set(this.id, value);\n this._setElementValue(_buildValueString(this.id, value));\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgSelectOption.prototype, \"value\", {\n /**\n * @param {?} value\n * @return {?}\n */\n set: function (value) {\n this._setElementValue(value);\n if (this._select)\n this._select.writeValue(this._select.value);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} value\n * @return {?}\n */\n NgSelectOption.prototype._setElementValue = function (value) {\n this._renderer.setElementProperty(this._element.nativeElement, 'value', value);\n };\n /**\n * @return {?}\n */\n NgSelectOption.prototype.ngOnDestroy = function () {\n if (this._select) {\n this._select._optionMap.delete(this.id);\n this._select.writeValue(this._select.value);\n }\n };\n NgSelectOption.decorators = [\n { type: _angular_core.Directive, args: [{ selector: 'option' },] },\n ];\n /** @nocollapse */\n NgSelectOption.ctorParameters = function () { return [\n { type: _angular_core.ElementRef, },\n { type: _angular_core.Renderer, },\n { type: SelectControlValueAccessor, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Host },] },\n ]; };\n NgSelectOption.propDecorators = {\n 'ngValue': [{ type: _angular_core.Input, args: ['ngValue',] },],\n 'value': [{ type: _angular_core.Input, args: ['value',] },],\n };\n return NgSelectOption;\n }());\n\n var /** @type {?} */ SELECT_MULTIPLE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return SelectMultipleControlValueAccessor; }),\n multi: true\n };\n /**\n * @param {?} id\n * @param {?} value\n * @return {?}\n */\n function _buildValueString$1(id, value) {\n if (id == null)\n return \"\" + value;\n if (typeof value === 'string')\n value = \"'\" + value + \"'\";\n if (!isPrimitive(value))\n value = 'Object';\n return (id + \": \" + value).slice(0, 50);\n }\n /**\n * @param {?} valueString\n * @return {?}\n */\n function _extractId$1(valueString) {\n return valueString.split(':')[0];\n }\n /**\n * The accessor for writing a value and listening to changes on a select element.\n * *\n */\n var SelectMultipleControlValueAccessor = (function () {\n /**\n * @param {?} _renderer\n * @param {?} _elementRef\n */\n function SelectMultipleControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n /** @internal */\n this._optionMap = new Map();\n /** @internal */\n this._idCounter = 0;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n /**\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.writeValue = function (value) {\n var _this = this;\n this.value = value;\n var /** @type {?} */ optionSelectedStateSetter;\n if (Array.isArray(value)) {\n // convert values to ids\n var /** @type {?} */ ids_1 = value.map(function (v) { return _this._getOptionId(v); });\n optionSelectedStateSetter = function (opt, o) { opt._setSelected(ids_1.indexOf(o.toString()) > -1); };\n }\n else {\n optionSelectedStateSetter = function (opt, o) { opt._setSelected(false); };\n }\n this._optionMap.forEach(optionSelectedStateSetter);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.registerOnChange = function (fn) {\n var _this = this;\n this.onChange = function (_) {\n var /** @type {?} */ selected = [];\n if (_.hasOwnProperty('selectedOptions')) {\n var /** @type {?} */ options = _.selectedOptions;\n for (var /** @type {?} */ i = 0; i < options.length; i++) {\n var /** @type {?} */ opt = options.item(i);\n var /** @type {?} */ val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n else {\n var /** @type {?} */ options = (_.options);\n for (var /** @type {?} */ i = 0; i < options.length; i++) {\n var /** @type {?} */ opt = options.item(i);\n if (opt.selected) {\n var /** @type {?} */ val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n _this.value = selected;\n fn(selected);\n };\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n /**\n * @param {?} isDisabled\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /**\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._registerOption = function (value) {\n var /** @type {?} */ id = (this._idCounter++).toString();\n this._optionMap.set(id, value);\n return id;\n };\n /**\n * @param {?} value\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._getOptionId = function (value) {\n for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) {\n var id = _a[_i];\n if (looseIdentical(this._optionMap.get(id)._value, value))\n return id;\n }\n return null;\n };\n /**\n * @param {?} valueString\n * @return {?}\n */\n SelectMultipleControlValueAccessor.prototype._getOptionValue = function (valueString) {\n var /** @type {?} */ id = _extractId$1(valueString);\n return this._optionMap.has(id) ? this._optionMap.get(id)._value : valueString;\n };\n SelectMultipleControlValueAccessor.decorators = [\n { type: _angular_core.Directive, args: [{\n selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]',\n host: { '(change)': 'onChange($event.target)', '(blur)': 'onTouched()' },\n providers: [SELECT_MULTIPLE_VALUE_ACCESSOR]\n },] },\n ];\n /** @nocollapse */\n SelectMultipleControlValueAccessor.ctorParameters = function () { return [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ]; };\n return SelectMultipleControlValueAccessor;\n }());\n /**\n * Marks `