{"version":3,"sources":["./$_lazy_route_resource lazy namespace object","./src/app/app.component.html","./src/app/app-routing.module.ts","./src/app/app.component.scss","./src/app/app.component.ts","./src/app/app.module.ts","./src/app/core/guards/auth.guard.ts","./src/app/core/interceptor/httpconfig.interceptor.ts","./src/app/services/notification.service.ts","./src/app/services/user.service.ts","./src/environments/environment.ts","./src/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,wE;;;;;;;;;;;;ACZA;AAAe,gGAAiC,E;;;;;;;;;;;;;;;;;;;ACAP;AACc;AAEF;AAErD,MAAM,MAAM,GAAW;IACrB;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO;SACf;QACD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,EAAE;gBACR,YAAY,EAAE,GAAG,EAAE,CAAC,4KAA4B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;aACzE;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,YAAY,EAAE,GAAG,EAAE,CAAC,4PAAgD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;gBACjG,gBAAgB,EAAE,CAAC,iEAAS,CAAC;aAC9B;SACF;KACF;IACD,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;CAC/B,CAAC;AAMF,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;CAAI;AAApB,gBAAgB;IAJ5B,8DAAQ,CAAC;QACR,OAAO,EAAE,CAAC,4DAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvC,OAAO,EAAE,CAAC,4DAAY,CAAC;KACxB,CAAC;GACW,gBAAgB,CAAI;AAAJ;;;;;;;;;;;;;AC9B7B;AAAe,6GAA8C,+HAA+H,E;;;;;;;;;;;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,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC","file":"main-es2015.js","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./$$_lazy_route_resource lazy recursive\";","export default \"\";","import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { AuthGuard } from './core/guards/auth.guard';\n\nconst routes: Routes = [\n {\n path: '',\n data: {\n title: 'Login'\n },\n children: [\n {\n path: '',\n loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule),\n },\n {\n path: 'dashboard',\n loadChildren: () => import('./container/dashboard/dashboard.module').then(m => m.DashboardModule),\n canActivateChild: [AuthGuard]\n }\n ]\n },\n { path: '**', redirectTo: '' }\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes)],\n exports: [RouterModule]\n})\nexport class AppRoutingModule { }\n","export default \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuc2NzcyJ9 */\";","import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.scss']\n})\nexport class AppComponent {\n title = 'newsletter';\n}\n","import { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { NgModule, ErrorHandler, Injectable } from '@angular/core';\nimport { LocationStrategy, HashLocationStrategy } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\n\nimport { HttpConfigInterceptor } from './core/interceptor/httpconfig.interceptor';\n\nimport { ToastrModule } from 'ngx-toastr';\nimport {NgbModule} from '@ng-bootstrap/ng-bootstrap';\nimport { NgSelectModule } from '@ng-select/ng-select'; \nimport { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';\nimport { NgxCaptchaModule } from 'ngx-captcha';\n\n@NgModule({\n declarations: [\n AppComponent,\n ],\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n FormsModule,\n ReactiveFormsModule,\n AppRoutingModule,\n NgxCaptchaModule,\n HttpClientModule,\n ToastrModule.forRoot({\n positionClass: 'toast-top-right'\n }),\n NgMultiSelectDropDownModule.forRoot(),\n NgbModule,\n NgSelectModule\n ],\n providers: [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: HttpConfigInterceptor,\n multi: true\n },\n ],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n","import { Injectable } from '@angular/core';\nimport { CanActivate, CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, Router } from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { JwtHelperService } from \"@auth0/angular-jwt\";\n\nimport { UserService } from '../../services/user.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthGuard implements CanActivate, CanActivateChild {\n constructor(private router: Router,\n private userService: UserService) { }\n\n helper = new JwtHelperService();\n canActivate(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot): boolean {\n let token = this.userService.userValue;\n const decodedToken = this.helper.decodeToken(token.token);\n let validity = this.helper.isTokenExpired(token?.accessToken);\n if (token != null && validity == true) {\n return true;\n }\n else {\n localStorage.removeItem('user');\n this.userService.userSubject.next(null);\n this.router.navigate(['/login']);\n return false;\n }\n }\n canActivateChild(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot): boolean {\n let token = this.userService.userValue;\n const decodedToken = this.helper.decodeToken(token?.token);\n let validity = this.helper.isTokenExpired(token?.accessToken);\n if (token != null && validity == true) {\n return true;\n }\n else {\n localStorage.removeItem('user');\n this.userService.userSubject.next(null);\n this.router.navigate(['/login']);\n return false;\n }\n }\n\n}\n","import { Injectable } from '@angular/core';\r\nimport { HttpErrorResponse, HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';\r\nimport { catchError, finalize, retry } from 'rxjs/operators';\r\nimport { Observable, throwError } from 'rxjs';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { UserService } from '../../services/user.service';\r\nimport { NotificationService } from '../../services/notification.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class HttpConfigInterceptor implements HttpInterceptor {\r\n constructor(\r\n private user: UserService,\r\n private notificationService: NotificationService,\r\n private router: Router) { }\r\n intercept(req: HttpRequest, next: HttpHandler) {\r\n // Get the auth token from localstorage.\r\n const authToken: any = JSON.parse(localStorage.getItem('user'));\r\n let newHeaders = req.headers;\r\n if (authToken) {\r\n // If we have a token, we append it to our new headers\r\n newHeaders = newHeaders.append('Authorization', authToken.token);\r\n newHeaders = newHeaders.append('macaddress', \"\");\r\n newHeaders = newHeaders.append('userId', authToken.userId);\r\n }\r\n const authReq = req.clone({ headers: newHeaders });\r\n // Clone the request and replace the original headers with\r\n // cloned headers, updated with the authorization.\r\n // const authReq = req.clone({\r\n // headers: req.headers.set('x-auth-token', authToken)\r\n // });\r\n\r\n // send cloned request with header to the next handler.\r\n return next.handle(authReq)\r\n .pipe(\r\n // retry on failure\r\n retry(0),\r\n\r\n // handle errors\r\n catchError((err: HttpErrorResponse) => {\r\n console.log(err);\r\n if(err.status == 401){\r\n this.user.logout();\r\n location.reload();\r\n }\r\n \r\n const errorMessage = this.setError(err);\r\n return throwError(err);\r\n }),\r\n // profiling\r\n finalize(() => {\r\n const profilingMsg = `${req.method} \"${req.urlWithParams}\"`;\r\n // console.log(profilingMsg);\r\n })\r\n // return next.handle(authReq);\r\n\r\n );\r\n }\r\n\r\n setError(error: HttpErrorResponse): string {\r\n let errorMessage = 'Unknown error occured';\r\n if (error.error instanceof ErrorEvent) {\r\n // Client side error\r\n errorMessage = error.error.message;\r\n } else {\r\n // server side error\r\n if (error.status !== 0) {\r\n errorMessage = error.error.message;\r\n }\r\n }\r\n return errorMessage;\r\n }\r\n\r\n\r\n}\r\n\r\n","import { Injectable } from '@angular/core';\nimport { ToastrService } from 'ngx-toastr';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NotificationService {\n\n constructor(private toastr: ToastrService) { }\n\n showSuccess(message, title) {\n // this.toastr.success(message, title)\n this.toastr.success(message, title, {\n timeOut: 1000,\n });\n }\n\n showError(message, title) {\n this.toastr.error(message, title)\n }\n\n showInfo(message, title) {\n this.toastr.info(message, title)\n }\n\n showWarning(message, title) {\n this.toastr.warning(message, title)\n }\n \n\n\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Router } from '@angular/router';\n\nimport { environment } from '../../environments/environment'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UserService {\n public userSubject: BehaviorSubject;\n public user: Observable;\n constructor(private http: HttpClient,\n private router: Router) {\n this.userSubject = new BehaviorSubject(JSON.parse(localStorage.getItem('user')));\n this.user = this.userSubject.asObservable();\n }\n\n login(data) {\n return this.http.post(`${environment.url}/SendOTP`, data);\n }\n\n signup(data) {\n return this.http.post(`${environment.url}/SignUp`, data);\n }\n\n confirmOTP(data) {\n return this.http.post(`${environment.url}/verifyOTP`, data);\n }\n\n generateToken(data) {\n return this.http.post(`${environment.url}/GenerateToken`, data);\n }\n\n getUserDetails(data) {\n return this.http.post(`${environment.url}/UserRegDetails`, data);\n }\n\n sendOTPForSignup(data) {\n return this.http.post(`${environment.url}/SendOTP`, data);\n }\n\n confirmOTPForSignup(data) {\n return this.http.post(`${environment.url}/SignupVerifyOTP`, data);\n }\n\n getAllProfessions(data) {\n return this.http.post(`${environment.url}/DisplayProfession`, data);\n }\n\n getUserSubscription(data) {\n return this.http.post(`${environment.url}/SubscriptionData`, data);\n }\n addSubscriptionData(data) {\n return this.http.post(`${environment.url}/AddSubscriptionData`, data);\n }\n\n getNavigator(data){\n return this.http.post(`${environment.url}/Navigators`, data);\n }\n getUnsubscribe(data){\n return this.http.post(`${environment.url}/Unsubscribe`, data);\n }\n public get userValue(): any {\n return this.userSubject.value;\n }\n changeToken(token: any) {\n this.userSubject.next(token);\n }\n logout() {\n localStorage.removeItem('user');\n this.userSubject.next(null);\n this.router.navigate(['/login']);\n // location.reload(true);\n }\n\n unsubscribe() {\n localStorage.removeItem('user');\n this.userSubject.next(null);\n this.router.navigate(['/login']);\n // location.reload(true);\n }\n}\n","// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport const environment = {\n // url : \"http://newsletterapi.manupatra.com/API/Newsletter\",\n url : \"https://updates.manupatra.com/newsletterapi/api/newsletter\",\n production: false\n};\n\n/*\n * For easier debugging in development mode, you can import the following file\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\n *\n * This import should be commented out in production mode because it will have a negative impact\n * on performance if an error is thrown.\n */\n// import 'zone.js/dist/zone-error'; // Included with Angular CLI.\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.error(err));\n"],"sourceRoot":"webpack:///"}