UNPKG

ng-server

Version:

A NodeJs server for Angular 2 applications

1 lines 326 kB
webpackJsonp([0],[function(module,exports,__webpack_require__){eval('"use strict";\r\nvar platform_browser_dynamic_1 = __webpack_require__(1);\r\nvar core_1 = __webpack_require__(3);\r\nvar app_module_1 = __webpack_require__(23);\r\nif (true) {\r\n core_1.enableProdMode();\r\n}\r\nplatform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/bootstrap/main.ts\n// module id = 0\n// module chunks = 0\n//# sourceURL=webpack:///./src/bootstrap/main.ts?')},,,,,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){eval('"use strict";\r\nvar __decorate = (this && this.__decorate) || function (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\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\r\n};\r\nvar core_1 = __webpack_require__(3);\r\nvar platform_browser_1 = __webpack_require__(21);\r\nvar http_1 = __webpack_require__(24);\r\nvar forms_1 = __webpack_require__(25);\r\nvar root_component_1 = __webpack_require__(29);\r\nvar core_components_1 = __webpack_require__(31);\r\nvar app_routes_1 = __webpack_require__(127);\r\n// GENERAL MODULE =======================================\r\nvar general_providers_1 = __webpack_require__(130);\r\nvar general_components_1 = __webpack_require__(131);\r\n// EMPRESA MODULE =======================================\r\nvar empresa_components_1 = __webpack_require__(132);\r\nvar empresa_providers_1 = __webpack_require__(133);\r\nvar AppModule = (function () {\r\n function AppModule() {\r\n }\r\n AppModule = __decorate([\r\n core_1.NgModule({\r\n id: \'core\',\r\n imports: [platform_browser_1.BrowserModule, http_1.HttpModule, forms_1.FormsModule, app_routes_1.routing],\r\n declarations: [].concat(core_components_1.COMPONENTS_LIST)\r\n .concat(general_components_1.GENERAL_COMPONENTS)\r\n .concat(empresa_components_1.EMPRESA_COMPONENTS),\r\n providers: [app_routes_1.appRoutingProviders]\r\n .concat(general_providers_1.GENERAL_PROVIDERS)\r\n .concat(empresa_providers_1.EMPRESA_PROVIDDERS),\r\n bootstrap: [root_component_1.RootComponent]\r\n }), \r\n __metadata(\'design:paramtypes\', [])\r\n ], AppModule);\r\n return AppModule;\r\n}());\r\nexports.AppModule = AppModule;\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/core/app.module.ts\n// module id = 23\n// module chunks = 0\n//# sourceURL=webpack:///./src/core/app.module.ts?')},,function(module,exports,__webpack_require__){eval("/**\n * @license Angular v2.2.4\n * (c) 2010-2016 Google, Inc. https://angular.io/\n * License: MIT\n */\n(function (global, factory) {\n true ? factory(exports, __webpack_require__(3), __webpack_require__(26), __webpack_require__(4), __webpack_require__(5), __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 * @stable\n */\n var AbstractControlDirective = (function () {\n function AbstractControlDirective() {\n }\n Object.defineProperty(AbstractControlDirective.prototype, \"control\", {\n get: function () { throw new Error('unimplemented'); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"value\", {\n get: function () { return this.control ? this.control.value : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valid\", {\n get: function () { return this.control ? this.control.valid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"invalid\", {\n get: function () { return this.control ? this.control.invalid : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pending\", {\n get: function () { return this.control ? this.control.pending : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"errors\", {\n get: function () { return this.control ? this.control.errors : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"pristine\", {\n get: function () { return this.control ? this.control.pristine : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"dirty\", {\n get: function () { return this.control ? this.control.dirty : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"touched\", {\n get: function () { return this.control ? this.control.touched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"untouched\", {\n get: function () { return this.control ? this.control.untouched : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"disabled\", {\n get: function () { return this.control ? this.control.disabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"enabled\", {\n get: function () { return this.control ? this.control.enabled : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"statusChanges\", {\n get: function () { return this.control ? this.control.statusChanges : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"valueChanges\", {\n get: function () { return this.control ? this.control.valueChanges : null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AbstractControlDirective.prototype, \"path\", {\n get: function () { return null; },\n enumerable: true,\n configurable: true\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 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 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 * @stable\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 */\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 */\n get: function () { return null; },\n enumerable: true,\n configurable: true\n });\n return ControlContainer;\n }(AbstractControlDirective));\n\n function isPresent(obj) {\n return obj != null;\n }\n function isBlank(obj) {\n return obj == null;\n }\n // JS has NaN !== NaN\n function looseIdentical(a, b) {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n }\n function isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\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 StringMapWrapper.merge = function (m1, m2) {\n var 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 StringMapWrapper.equals = function (m1, m2) {\n var k1 = Object.keys(m1);\n var k2 = Object.keys(m2);\n if (k1.length != k2.length) {\n return false;\n }\n for (var i = 0; i < k1.length; i++) {\n var 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 ListWrapper.removeAll = function (list, items) {\n for (var i = 0; i < items.length; ++i) {\n var index = list.indexOf(items[i]);\n if (index > -1) {\n list.splice(index, 1);\n }\n }\n };\n ListWrapper.remove = function (list, el) {\n var index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n return true;\n }\n return false;\n };\n ListWrapper.equals = function (a, b) {\n if (a.length != b.length)\n return false;\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i])\n return false;\n }\n return true;\n };\n ListWrapper.flatten = function (list) {\n return list.reduce(function (flat, item) {\n var flatItem = Array.isArray(item) ? ListWrapper.flatten(item) : item;\n return flat.concat(flatItem);\n }, []);\n };\n return ListWrapper;\n }());\n\n var isPromise = _angular_core.__core_private__.isPromise;\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 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 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 * @stable\n */\n var Validators = (function () {\n function Validators() {\n }\n /**\n * Validator that requires controls to have a non-empty value.\n */\n Validators.required = function (control) {\n return isEmptyInputValue(control.value) ? { 'required': true } : null;\n };\n /**\n * Validator that requires controls to have a value of a minimum length.\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 length = typeof control.value === 'string' ? 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 */\n Validators.maxLength = function (maxLength) {\n return function (control) {\n var length = typeof control.value === 'string' ? 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 */\n Validators.pattern = function (pattern) {\n if (!pattern)\n return Validators.nullValidator;\n var regex;\n var 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 value = control.value;\n return regex.test(value) ? null :\n { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } };\n };\n };\n /**\n * No-op validator.\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 */\n Validators.compose = function (validators) {\n if (!validators)\n return null;\n var 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 Validators.composeAsync = function (validators) {\n if (!validators)\n return null;\n var presentValidators = validators.filter(isPresent);\n if (presentValidators.length == 0)\n return null;\n return function (control) {\n var promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);\n return Promise.all(promises).then(_mergeErrors);\n };\n };\n return Validators;\n }());\n function _convertToPromise(obj) {\n return isPromise(obj) ? obj : rxjs_operator_toPromise.toPromise.call(obj);\n }\n function _executeValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n }\n function _executeAsyncValidators(control, validators) {\n return validators.map(function (v) { return v(control); });\n }\n function _mergeErrors(arrayOfErrors) {\n var 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 NG_VALUE_ACCESSOR = new _angular_core.OpaqueToken('NgValueAccessor');\n\n var 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 * <input type=\"checkbox\" name=\"rememberLogin\" ngModel>\n * ```\n *\n * @stable\n */\n var CheckboxControlValueAccessor = (function () {\n function CheckboxControlValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n CheckboxControlValueAccessor.prototype.writeValue = function (value) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'checked', value);\n };\n CheckboxControlValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n CheckboxControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\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 = [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ];\n return CheckboxControlValueAccessor;\n }());\n\n var 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 * <input type=\"text\" name=\"searchQuery\" ngModel>\n * ```\n *\n * @stable\n */\n var DefaultValueAccessor = (function () {\n function DefaultValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n DefaultValueAccessor.prototype.writeValue = function (value) {\n var normalizedValue = value == null ? '' : value;\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n DefaultValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; };\n DefaultValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\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 = [\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 function normalizeValidator(validator) {\n if (validator.validate) {\n return function (c) { return validator.validate(c); };\n }\n else {\n return validator;\n }\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 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 * <input type=\"number\" [(ngModel)]=\"age\">\n * ```\n */\n var NumberValueAccessor = (function () {\n function NumberValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\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 normalizedValue = value == null ? '' : value;\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', normalizedValue);\n };\n NumberValueAccessor.prototype.registerOnChange = function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n NumberValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\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 = [\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 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 * @stable\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 get: function () { return unimplemented(); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NgControl.prototype, \"asyncValidator\", {\n get: function () { return unimplemented(); },\n enumerable: true,\n configurable: true\n });\n return NgControl;\n }(AbstractControlDirective));\n\n var 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 RadioControlRegistry.prototype.add = function (control, accessor) {\n this._accessors.push([control, accessor]);\n };\n RadioControlRegistry.prototype.remove = function (accessor) {\n for (var 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 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 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 = [];\n return RadioControlRegistry;\n }());\n /**\n * @whatItDoes Writes radio control values and listens to radio control changes.\n *\n * Used by {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName}\n * to keep the view synced with the {@link FormControl} model.\n *\n * @howToUse\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 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 RadioControlValueAccessor.prototype.ngOnInit = function () {\n this._control = this._injector.get(NgControl);\n this._checkName();\n this._registry.add(this._control, this);\n };\n RadioControlValueAccessor.prototype.ngOnDestroy = function () { this._registry.remove(this); };\n RadioControlValueAccessor.prototype.writeValue = function (value) {\n this._state = value === this.value;\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'checked', this._state);\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 RadioControlValueAccessor.prototype.fireUncheck = function (value) { this.writeValue(value); };\n RadioControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n RadioControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\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 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: <input type=\\\"radio\\\" formControlName=\\\"food\\\" name=\\\"food\\\">\\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 = [\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 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 * <input type=\"range\" [(ngModel)]=\"age\" >\n * ```\n */\n var RangeValueAccessor = (function () {\n function RangeValueAccessor(_renderer, _elementRef) {\n this._renderer = _renderer;\n this._elementRef = _elementRef;\n this.onChange = function (_) { };\n this.onTouched = function () { };\n }\n RangeValueAccessor.prototype.writeValue = function (value) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', parseFloat(value));\n };\n RangeValueAccessor.prototype.registerOnChange = function (fn) {\n this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); };\n };\n RangeValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\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 = [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ];\n return RangeValueAccessor;\n }());\n\n var SELECT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return SelectControlValueAccessor; }),\n multi: true\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 function _extractId(valueString) {\n return valueString.split(':')[0];\n }\n /**\n * @whatItDoes Writes values and listens to changes on a select element.\n *\n * Used by {@link NgModel}, {@link FormControlDirective}, and {@link FormControlName}\n * to keep the view synced with the {@link FormControl} model.\n *\n * @howToUse\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 `<select>` tag.\n *\n * If your option values are simple strings, you can bind to the normal `value` property\n * on the option. If your option values happen to be objects (and you'd like to save the\n * selection in your form as an object), use `ngValue` instead:\n *\n * {@example forms/ts/selectControl/select_control_example.ts region='Component'}\n *\n * In reactive forms, you'll also want to add your form directive (`formControlName` or\n * `formControl`) on the main `<select>` 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 * @stable\n */\n var SelectControlValueAccessor = (function () {\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 SelectControlValueAccessor.prototype.writeValue = function (value) {\n this.value = value;\n var valueString = _buildValueString(this._getOptionId(value), value);\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', valueString);\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 SelectControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n SelectControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n SelectControlValueAccessor.prototype._registerOption = function () { return (this._idCounter++).toString(); };\n /** @internal */\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 /** @internal */\n SelectControlValueAccessor.prototype._getOptionValue = function (valueString) {\n var 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 = [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ];\n return SelectControlValueAccessor;\n }());\n /**\n * @whatItDoes Marks `<option>` as dynamic, so Angular can be notified when options change.\n *\n * @howToUse\n *\n * See docs for {@link SelectControlValueAccessor} for usage examples.\n *\n * @stable\n */\n var NgSelectOption = (function () {\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 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 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 /** @internal */\n NgSelectOption.prototype._setElementValue = function (value) {\n this._renderer.setElementProperty(this._element.nativeElement, 'value', value);\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 = [\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 SELECT_MULTIPLE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: _angular_core.forwardRef(function () { return SelectMultipleControlValueAccessor; }),\n multi: true\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 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 * @stable\n */\n var SelectMultipleControlValueAccessor = (function () {\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 SelectMultipleControlValueAccessor.prototype.writeValue = function (value) {\n var _this = this;\n this.value = value;\n if (value == null)\n return;\n var values = value;\n // convert values to ids\n var ids = values.map(function (v) { return _this._getOptionId(v); });\n this._optionMap.forEach(function (opt, o) { opt._setSelected(ids.indexOf(o.toString()) > -1); });\n };\n SelectMultipleControlValueAccessor.prototype.registerOnChange = function (fn) {\n var _this = this;\n this.onChange = function (_) {\n var selected = [];\n if (_.hasOwnProperty('selectedOptions')) {\n var options = _.selectedOptions;\n for (var i = 0; i < options.length; i++) {\n var opt = options.item(i);\n var val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n else {\n var options = _.options;\n for (var i = 0; i < options.length; i++) {\n var opt = options.item(i);\n if (opt.selected) {\n var val = _this._getOptionValue(opt.value);\n selected.push(val);\n }\n }\n }\n fn(selected);\n };\n };\n SelectMultipleControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; };\n SelectMultipleControlValueAccessor.prototype.setDisabledState = function (isDisabled) {\n this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);\n };\n /** @internal */\n SelectMultipleControlValueAccessor.prototype._registerOption = function (value) {\n var id = (this._idCounter++).toString();\n this._optionMap.set(id, value);\n return id;\n };\n /** @internal */\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 /** @internal */\n SelectMultipleControlValueAccessor.prototype._getOptionValue = function (valueString) {\n var 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 = [\n { type: _angular_core.Renderer, },\n { type: _angular_core.ElementRef, },\n ];\n return SelectMultipleControlV