{ "version": 3, "sources": ["src/app/base/component/unauthurized/home/home.component.ts"], "sourcesContent": ["import { Component, Injector } from '@angular/core';\nimport { Data } from '@angular/router';\n// Rxjs\nimport { first } from 'rxjs/operators';\n// Caloudi\nimport { BaseComponent } from '@base';\nimport environment from '@env';\n\n@Component({\n selector: 'app-home',\n templateUrl: './home.component.html',\n styleUrls: ['./home.component.sass'],\n})\nexport class HomeComponent extends BaseComponent {\n constructor(public readonly injector: Injector) {\n super(injector);\n\n this.route.data.pipe(first()).subscribe((data: DirectData) => {\n const user = this.authenticationService.currentUser.value;\n if (!user) {\n this.router.navigate(['/login']);\n return;\n }\n if (this.router.url === '/reload') return;\n const homeRoutherLink = user ? user.userMenu.homeRouterLink : environment.homeRouterLink;\n this.router.navigate([data?.redirectTo?.length > 0 ? '/pages/' + data.redirectTo : homeRoutherLink]);\n\n this.logger.debug('home:', [homeRoutherLink, data, user], 'from:', [this.router.routerState.snapshot.url]);\n });\n }\n}\n\ninterface DirectData extends Data {\n redirectTo: string;\n path: string;\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;AAAA,IAaa;AAbb;;;AAGA;AAEA;AACA;;AAOM,IAAO,gBAAP,MAAO,uBAAsB,cAAa;MAC9C,YAA4B,UAAkB;AAC5C,cAAM,QAAQ;AADY,aAAA,WAAA;AAG1B,aAAK,MAAM,KAAK,KAAK,MAAK,CAAE,EAAE,UAAU,CAAC,SAAoB;AAC3D,gBAAM,OAAO,KAAK,sBAAsB,YAAY;AACpD,cAAI,CAAC,MAAM;AACT,iBAAK,OAAO,SAAS,CAAC,QAAQ,CAAC;AAC/B;UACF;AACA,cAAI,KAAK,OAAO,QAAQ;AAAW;AACnC,gBAAM,kBAAkB,OAAO,KAAK,SAAS,iBAAiB,oBAAY;AAC1E,eAAK,OAAO,SAAS,CAAC,MAAM,YAAY,SAAS,IAAI,YAAY,KAAK,aAAa,eAAe,CAAC;AAEnG,eAAK,OAAO,MAAM,SAAS,CAAC,iBAAiB,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,OAAO,YAAY,SAAS,GAAG,CAAC;QAC3G,CAAC;MACH;;;2CAhBW,gBAAa,4BAAA,QAAA,CAAA;QAAA;MAAA;;;4CAAb,gBAAa,WAAA,CAAA,CAAA,UAAA,CAAA,GAAA,UAAA,CAAA,oCAAA,GAAA,OAAA,GAAA,MAAA,GAAA,UAAA,SAAA,uBAAA,IAAA,KAAA;QAAA,EAAA,CAAA;MAAA;;;iFAAb,eAAa,EAAA,WAAA,iBAAA,UAAA,8DAAA,YAAA,GAAA,CAAA;IAAA,GAAA;;;", "names": [] }