{"version":3,"sources":["webpack:///7.7.bundle.js","webpack:///./app/registration/registration.module.ts","webpack:///./app/registration/registration.routing.ts","webpack:///./app/registration/registration.component.ts","webpack:///./app/registration/registration.template.html","webpack:///./app/registration/registration.style.scss","webpack:///./app/registration/registration.declarations.ts","webpack:///./app/registration/equal-to-validator/equal-to.directive.ts"],"names":["webpackJsonp","614","module","exports","__webpack_require__","__decorate","this","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__metadata","k","v","metadata","core_1","router_1","forms_1","shared_module_1","auth_service_1","registration_routing_1","registration_declarations_1","RegistrationModule","NgModule","id","imports","RouterModule","FormsModule","SharedModule","routing","declarations","default","slice","providers","AuthService","615","registration_component_1","routes","path","component","RegistrationComponent","forChild","616","authService","router","error","user","name","email","password","passwordConfirm","prototype","goToHomePage","navigate","save","_this","registrationSubscription","register","subscribe","err","json","ngOnDestroy","unsubscribe","Component","template","styles","selector","_a","_b","Router","617","618","619","equal_to_directive_1","value","EqualToDirective","620","invalidResult","equalTo","valid","ngOnChanges","changes","control","errors","validate","setErrors","validator","isInvalid","Input","String","Directive","provide","NG_VALIDATORS","useExisting","multi"],"mappings":"AAAAA,cAAc,IAERC,IACA,SAASC,EAAQC,EAASC,GAE/B,YACA,IAAIC,GAAcC,MAAQA,KAAKD,YAAe,SAAUE,EAAYC,EAAQC,EAAKC,GAC7E,GAA2HC,GAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,CACrH,IAAuB,gBAAZQ,UAAoD,kBAArBA,SAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,OACpH,KAAK,GAAIU,GAAIb,EAAWO,OAAS,EAAGM,GAAK,EAAGA,KAAST,EAAIJ,EAAWa,MAAIL,GAAKH,EAAI,EAAID,EAAEI,GAAKH,EAAI,EAAID,EAAEH,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A,SAAYC,GACR,GAAIA,EAAQH,SAAWnF,KAAKuF,QAAS,CACjC,GAAMC,GAASxF,KAAKyF,SAASzF,KAAKuF,QAElCvF,MAAKuF,QAAQG,UAAUF,KAI/BR,EAAAxB,UAAAmC,UAAA,SAAUrF,GACN,GAAMsF,GAAYtF,GAAKA,EAAEyE,QAAU/E,KAAKmF,OAExC,OAAOS,GAAY5F,KAAKkF,cAAgB,MAG5CF,EAAAxB,UAAAiC,SAAA,SAASnF,GAEL,MADAN,MAAKuF,QAAUjF,EACRN,KAAK2F,UAAUrF,IA1B1BP,GAACqB,EAAAyE,MAAM,aPgLF7E,EAAW,cAAe8E,SAC3Bd,EAAiBxB,UAAW,UAAW,QOxL/CwB,EAAAjF,GAACqB,EAAA2E,WACGxB,SAAU,cACVjC,YAAa0D,QAAS1E,EAAA2E,cAAeC,YAAalB,EAAkBmB,OAAO,MP4LtEnF,EAAW,yBACZgE,KO1LKnF,GAAAmF,iBAAgBA","file":"7.7.bundle.js","sourcesContent":["webpackJsonp([7],{\n\n/***/ 614:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n\t    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\t    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\t    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\t    return c > 3 && r && Object.defineProperty(target, key, r), r;\n\t};\n\tvar __metadata = (this && this.__metadata) || function (k, v) {\n\t    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n\t};\n\tvar core_1 = __webpack_require__(3);\n\tvar router_1 = __webpack_require__(29);\n\tvar forms_1 = __webpack_require__(389);\n\tvar shared_module_1 = __webpack_require__(387);\n\tvar auth_service_1 = __webpack_require__(77);\n\tvar registration_routing_1 = __webpack_require__(615);\n\tvar registration_declarations_1 = __webpack_require__(619);\n\tvar RegistrationModule = (function () {\n\t    function RegistrationModule() {\n\t    }\n\t    RegistrationModule = __decorate([\n\t        core_1.NgModule({\n\t            id: module.id,\n\t            imports: [router_1.RouterModule, forms_1.FormsModule, shared_module_1.SharedModule, registration_routing_1.routing],\n\t            declarations: registration_declarations_1.default.slice(),\n\t            exports: registration_declarations_1.default.slice(),\n\t            providers: [\n\t                auth_service_1.AuthService\n\t            ]\n\t        }), \n\t        __metadata('design:paramtypes', [])\n\t    ], RegistrationModule);\n\t    return RegistrationModule;\n\t}());\n\texports.RegistrationModule = RegistrationModule;\n\n\n/***/ },\n\n/***/ 615:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar router_1 = __webpack_require__(29);\n\tvar registration_component_1 = __webpack_require__(616);\n\texports.routes = [\n\t    { path: '', component: registration_component_1.RegistrationComponent }\n\t];\n\texports.routing = router_1.RouterModule.forChild(exports.routes);\n\n\n/***/ },\n\n/***/ 616:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n\t    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\t    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\t    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\t    return c > 3 && r && Object.defineProperty(target, key, r), r;\n\t};\n\tvar __metadata = (this && this.__metadata) || function (k, v) {\n\t    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n\t};\n\tvar core_1 = __webpack_require__(3);\n\tvar router_1 = __webpack_require__(29);\n\tvar auth_service_1 = __webpack_require__(77);\n\tvar RegistrationComponent = (function () {\n\t    function RegistrationComponent(authService, router) {\n\t        this.authService = authService;\n\t        this.router = router;\n\t        this.error = '';\n\t        this.user = {\n\t            name: '',\n\t            email: '',\n\t            password: '',\n\t            passwordConfirm: ''\n\t        };\n\t    }\n\t    RegistrationComponent.prototype.goToHomePage = function () {\n\t        this.router.navigate(['/']);\n\t    };\n\t    RegistrationComponent.prototype.save = function () {\n\t        var _this = this;\n\t        this.registrationSubscription = this.authService.register(this.user)\n\t            .subscribe(function () {\n\t            _this.goToHomePage();\n\t        }, function (err) {\n\t            _this.error = err.json().error || 'Unable to register';\n\t        });\n\t    };\n\t    RegistrationComponent.prototype.ngOnDestroy = function () {\n\t        if (this.registrationSubscription) {\n\t            this.registrationSubscription.unsubscribe();\n\t        }\n\t    };\n\t    RegistrationComponent = __decorate([\n\t        core_1.Component({\n\t            template: __webpack_require__(617),\n\t            styles: [__webpack_require__(618)],\n\t            selector: 'sh-registration'\n\t        }), \n\t        __metadata('design:paramtypes', [(typeof (_a = typeof auth_service_1.AuthService !== 'undefined' && auth_service_1.AuthService) === 'function' && _a) || Object, (typeof (_b = typeof router_1.Router !== 'undefined' && router_1.Router) === 'function' && _b) || Object])\n\t    ], RegistrationComponent);\n\t    return RegistrationComponent;\n\t    var _a, _b;\n\t}());\n\texports.RegistrationComponent = RegistrationComponent;\n\n\n/***/ },\n\n/***/ 617:\n/***/ function(module, exports) {\n\n\tmodule.exports = \"<div class=\\\"row\\\">\\n    <div class=\\\"col m3\\\"></div>\\n    <div class=\\\"col m6 section\\\">\\n        <h2>Registration</h2><br />\\n        <div class=\\\"red-text text-darken-4\\\">{{error}}</div>\\n        <form class=\\\"registration\\\" (ngSubmit)=\\\"save()\\\" #regForm=\\\"ngForm\\\" novalidate>\\n            <label class=\\\"registration__label\\\">\\n                Username: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.name\\\"\\n                       name=\\\"name\\\"\\n                       #name=\\\"ngModel\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       type=\\\"text\\\"\\n                       required\\n                       minlength=\\\"5\\\"\\n                       maxlength=\\\"12\\\"\\n                       pattern=\\\"^[a-zA-Z0-9]*$\\\"\\n                />\\n                <div *ngIf=\\\"name.touched && name.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"name.errors.required\\\">Username should be filled</span>\\n                    <span *ngIf=\\\"name.errors.minlength && !name.errors.pattern\\\">Username is too short</span>\\n                    <span *ngIf=\\\"name.errors.maxlength && !name.errors.pattern\\\">Username is too long</span>\\n                    <span *ngIf=\\\"name.errors.pattern\\\">Username can contain only letters or digits</span>\\n                </div>\\n            </label>\\n\\n            <label class=\\\"registration__label\\\">\\n                Email: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.email\\\"\\n                       name=\\\"email\\\"\\n                       #email=\\\"ngModel\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       type=\\\"text\\\"\\n                       pattern=\\\"^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\\\\/0-9=?A-Z^_`a-z{|}~]+(\\\\.[-!#$%&'*+\\\\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$\\\"\\n                       required\\n                />\\n                <div *ngIf=\\\"email.touched && email.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"email.errors.required\\\">Email should be filled</span>\\n                    <span *ngIf=\\\"email.errors.pattern\\\">Email has an invalid format</span>\\n                </div>\\n            </label>\\n\\n            <label class=\\\"registration__label\\\">\\n                Password: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.password\\\"\\n                       name=\\\"password\\\"\\n                       #password=\\\"ngModel\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       autocomplete=\\\"new-password\\\"\\n                       type=\\\"password\\\"\\n                       minlength=\\\"8\\\"\\n                       required\\n                />\\n                <div *ngIf=\\\"password.touched && password.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"password.errors.required\\\">Password should be filled</span>\\n                    <span *ngIf=\\\"password.errors.minlength\\\">Password must have at least 8 characters</span>\\n                </div>\\n            </label>\\n\\n            <label class=\\\"registration__label\\\">\\n                Password confirmation: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.passwordConfirm\\\"\\n                       name=\\\"passwordConfirm\\\"\\n                       #passwordConfirm=\\\"ngModel\\\"\\n                       shEqualTo=\\\"{{user.password}}\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       type=\\\"password\\\"\\n                       required\\n                />\\n                <div *ngIf=\\\"passwordConfirm.touched && passwordConfirm.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"passwordConfirm.errors.required\\\" >Password confirmation should be filled</span>\\n                    <span *ngIf=\\\"passwordConfirm.errors.equalTo\\\">Value entered in Confirm password field is not correct</span>\\n                </div>\\n            </label>\\n\\n            <button class=\\\"registration__button waves-effect waves-light btn blue-grey darken-1\\\" type=\\\"submit\\\"\\n                    [disabled]=\\\"!regForm.form.valid\\\">SUBMIT</button>\\n            <button class=\\\"registration__button btn btn-flat\\\" type=\\\"button\\\"\\n                    (click)=\\\"goToHomePage()\\\">Cancel</button>\\n        </form>\\n    </div>\\n</div>\\n\"\n\n/***/ },\n\n/***/ 618:\n/***/ function(module, exports) {\n\n\tmodule.exports = \".registration__label{display:block;margin-bottom:10px}.registration__field{margin:0}.registration__field-error-message{margin-bottom:10px}.registration__button{width:100%;margin:10px 0 20px}\\n\"\n\n/***/ },\n\n/***/ 619:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar registration_component_1 = __webpack_require__(616);\n\tvar equal_to_directive_1 = __webpack_require__(620);\n\tObject.defineProperty(exports, \"__esModule\", { value: true });\n\texports.default = [\n\t    registration_component_1.RegistrationComponent,\n\t    equal_to_directive_1.EqualToDirective\n\t];\n\n\n/***/ },\n\n/***/ 620:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n\t    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n\t    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n\t    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\t    return c > 3 && r && Object.defineProperty(target, key, r), r;\n\t};\n\tvar __metadata = (this && this.__metadata) || function (k, v) {\n\t    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n\t};\n\tvar core_1 = __webpack_require__(3);\n\tvar forms_1 = __webpack_require__(389);\n\tvar EqualToDirective = (function () {\n\t    function EqualToDirective() {\n\t        this.invalidResult = {\n\t            equalTo: {\n\t                valid: false\n\t            }\n\t        };\n\t    }\n\t    EqualToDirective.prototype.ngOnChanges = function (changes) {\n\t        if (changes.equalTo && this.control) {\n\t            var errors = this.validate(this.control);\n\t            this.control.setErrors(errors);\n\t        }\n\t    };\n\t    EqualToDirective.prototype.validator = function (c) {\n\t        var isInvalid = c && c.value !== this.equalTo;\n\t        return isInvalid ? this.invalidResult : null;\n\t    };\n\t    EqualToDirective.prototype.validate = function (c) {\n\t        this.control = c;\n\t        return this.validator(c);\n\t    };\n\t    __decorate([\n\t        core_1.Input('shEqualTo'), \n\t        __metadata('design:type', String)\n\t    ], EqualToDirective.prototype, \"equalTo\", void 0);\n\t    EqualToDirective = __decorate([\n\t        core_1.Directive({\n\t            selector: '[shEqualTo]',\n\t            providers: [{ provide: forms_1.NG_VALIDATORS, useExisting: EqualToDirective, multi: true }]\n\t        }), \n\t        __metadata('design:paramtypes', [])\n\t    ], EqualToDirective);\n\t    return EqualToDirective;\n\t}());\n\texports.EqualToDirective = EqualToDirective;\n\n\n/***/ }\n\n});\n\n\n// WEBPACK FOOTER //\n// 7.7.bundle.js","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { FormsModule } from '@angular/forms';\n\nimport { SharedModule } from '../shared/shared.module';\nimport { AuthService } from '../core/auth/auth.service';\n\nimport { routing } from './registration.routing';\n\nimport REGISTRATION_DECLARATIONS from './registration.declarations';\n\n@NgModule({\n    id: module.id,\n    imports: [ RouterModule, FormsModule, SharedModule, routing ],\n    declarations: [ ...REGISTRATION_DECLARATIONS ],\n    exports: [ ...REGISTRATION_DECLARATIONS ],\n    providers: [\n        AuthService\n    ]\n})\nexport class RegistrationModule {}\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/registration/registration.module.ts","import { RouterModule } from '@angular/router';\n\nimport { RegistrationComponent } from './registration.component';\n\nexport const routes = [\n    { path: '', component: RegistrationComponent }\n];\n\nexport const routing = RouterModule.forChild(routes);\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/registration/registration.routing.ts","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Subscription } from 'rxjs/Rx';\nimport { IUserRegistrationData } from '../core/auth/auth.interfaces';\nimport { AuthService } from '../core/auth/auth.service';\n\n@Component({\n    template: require('./registration.template.html'),\n    styles: [require('./registration.style.scss')],\n    selector: 'sh-registration'\n})\nexport class RegistrationComponent {\n    private registrationSubscription: Subscription;\n    private error: string = '';\n    private user: IUserRegistrationData = {\n        name: '',\n        email: '',\n        password: '',\n        passwordConfirm: ''\n    };\n\n    constructor(private authService: AuthService, private router: Router) { }\n\n    goToHomePage() {\n        this.router.navigate(['/']);\n    }\n\n    save() {\n        this.registrationSubscription = this.authService.register(this.user)\n            .subscribe(() => {\n                this.goToHomePage();\n            }, err => {\n                this.error = err.json().error || 'Unable to register';\n            });\n    }\n\n    ngOnDestroy() {\n        if (this.registrationSubscription) {\n            this.registrationSubscription.unsubscribe();\n        }\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/registration/registration.component.ts","module.exports = \"<div class=\\\"row\\\">\\n    <div class=\\\"col m3\\\"></div>\\n    <div class=\\\"col m6 section\\\">\\n        <h2>Registration</h2><br />\\n        <div class=\\\"red-text text-darken-4\\\">{{error}}</div>\\n        <form class=\\\"registration\\\" (ngSubmit)=\\\"save()\\\" #regForm=\\\"ngForm\\\" novalidate>\\n            <label class=\\\"registration__label\\\">\\n                Username: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.name\\\"\\n                       name=\\\"name\\\"\\n                       #name=\\\"ngModel\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       type=\\\"text\\\"\\n                       required\\n                       minlength=\\\"5\\\"\\n                       maxlength=\\\"12\\\"\\n                       pattern=\\\"^[a-zA-Z0-9]*$\\\"\\n                />\\n                <div *ngIf=\\\"name.touched && name.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"name.errors.required\\\">Username should be filled</span>\\n                    <span *ngIf=\\\"name.errors.minlength && !name.errors.pattern\\\">Username is too short</span>\\n                    <span *ngIf=\\\"name.errors.maxlength && !name.errors.pattern\\\">Username is too long</span>\\n                    <span *ngIf=\\\"name.errors.pattern\\\">Username can contain only letters or digits</span>\\n                </div>\\n            </label>\\n\\n            <label class=\\\"registration__label\\\">\\n                Email: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.email\\\"\\n                       name=\\\"email\\\"\\n                       #email=\\\"ngModel\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       type=\\\"text\\\"\\n                       pattern=\\\"^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\\\\/0-9=?A-Z^_`a-z{|}~]+(\\\\.[-!#$%&'*+\\\\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$\\\"\\n                       required\\n                />\\n                <div *ngIf=\\\"email.touched && email.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"email.errors.required\\\">Email should be filled</span>\\n                    <span *ngIf=\\\"email.errors.pattern\\\">Email has an invalid format</span>\\n                </div>\\n            </label>\\n\\n            <label class=\\\"registration__label\\\">\\n                Password: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.password\\\"\\n                       name=\\\"password\\\"\\n                       #password=\\\"ngModel\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       autocomplete=\\\"new-password\\\"\\n                       type=\\\"password\\\"\\n                       minlength=\\\"8\\\"\\n                       required\\n                />\\n                <div *ngIf=\\\"password.touched && password.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"password.errors.required\\\">Password should be filled</span>\\n                    <span *ngIf=\\\"password.errors.minlength\\\">Password must have at least 8 characters</span>\\n                </div>\\n            </label>\\n\\n            <label class=\\\"registration__label\\\">\\n                Password confirmation: <b class=\\\"red-text\\\">*</b>\\n                <input [(ngModel)]=\\\"user.passwordConfirm\\\"\\n                       name=\\\"passwordConfirm\\\"\\n                       #passwordConfirm=\\\"ngModel\\\"\\n                       shEqualTo=\\\"{{user.password}}\\\"\\n                       class=\\\"registration__field black-text\\\"\\n                       type=\\\"password\\\"\\n                       required\\n                />\\n                <div *ngIf=\\\"passwordConfirm.touched && passwordConfirm.errors\\\" class=\\\"red-text text-darken-4\\\">\\n                    <span *ngIf=\\\"passwordConfirm.errors.required\\\" >Password confirmation should be filled</span>\\n                    <span *ngIf=\\\"passwordConfirm.errors.equalTo\\\">Value entered in Confirm password field is not correct</span>\\n                </div>\\n            </label>\\n\\n            <button class=\\\"registration__button waves-effect waves-light btn blue-grey darken-1\\\" type=\\\"submit\\\"\\n                    [disabled]=\\\"!regForm.form.valid\\\">SUBMIT</button>\\n            <button class=\\\"registration__button btn btn-flat\\\" type=\\\"button\\\"\\n                    (click)=\\\"goToHomePage()\\\">Cancel</button>\\n        </form>\\n    </div>\\n</div>\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/registration/registration.template.html\n// module id = 617\n// module chunks = 7","module.exports = \".registration__label{display:block;margin-bottom:10px}.registration__field{margin:0}.registration__field-error-message{margin-bottom:10px}.registration__button{width:100%;margin:10px 0 20px}\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./app/registration/registration.style.scss\n// module id = 618\n// module chunks = 7","import { RegistrationComponent } from './registration.component';\nimport { EqualToDirective } from './equal-to-validator/equal-to.directive';\n\nexport default [\n    RegistrationComponent,\n    EqualToDirective\n];\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/registration/registration.declarations.ts","import { Directive, Input, OnChanges } from '@angular/core';\nimport { Validator, NG_VALIDATORS, AbstractControl, FormControl } from '@angular/forms';\nimport { IEqualToResult } from './equal-to.interfaces';\n\n@Directive({\n    selector: '[shEqualTo]',\n    providers: [{provide: NG_VALIDATORS, useExisting: EqualToDirective, multi: true}]\n})\n\nexport class EqualToDirective implements Validator, OnChanges {\n    // tslint:disable-next-line:no-input-rename\n    @Input('shEqualTo') equalTo: string;\n    control: FormControl;\n    invalidResult: IEqualToResult = {\n        equalTo: {\n            valid: false\n        }\n    };\n\n    constructor() {}\n\n    ngOnChanges(changes) {\n        if (changes.equalTo && this.control) {\n            const errors = this.validate(this.control);\n\n            this.control.setErrors(errors);\n        }\n    }\n\n    validator(c: AbstractControl) {\n        const isInvalid = c && c.value !== this.equalTo;\n\n        return isInvalid ? this.invalidResult : null;\n    }\n\n    validate(c: FormControl) {\n        this.control = c;\n        return this.validator(c);\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ../~/angular2-template-loader!./app/registration/equal-to-validator/equal-to.directive.ts"],"sourceRoot":""}