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YAWD,WAVMD,IAAKE,KAAK,CACrB3E,QACA4E,KAAM,OACNC,SAAU,KACVC,KAAM,yCAC0BT,mBAEhCC,qBAKN,IAACH,MAAAlJ,KAAAmJ,UAAA","names":["i0","ctx_r1","cultureSwitch","l","t","error","LoginFormComponent","loading","login","EventEmitter","userNameInputElement","submitted","showPassword","loginForm","FormGroup","userName","FormControl","Validators","required","password","loginFormControls","this","controls","pagePaths","PagePaths","submitForm","markAllAsTouched","valid","emit","ngAfterViewInit","nativeElement","focus","selectors","viewQuery","rf","ctx","ElementRef","_r1","LoginFormComponent_i_20_Template","LoginFormComponent_i_21_Template","LoginFormComponent_a_27_Template","LoginFormComponent_div_28_Template","LoginFormComponent_span_32_Template","LoginFormComponent_ng_template_33_Template","forgotPassword","length","loadingTemplate_r3","CommonModule","i1","ReactiveFormsModule","i2","TranslateModule","i3","PrependBasePathPipe","styles","image_r2","LoginComponent_ng_container_13_ng_container_1_swiper_slide_2_Template","ctx_r2","loginImages","LoginComponent_ng_container_13_ng_container_1_Template","image_r4","LoginComponent","_costaBackendApiService","inject","CostaBackendApiService","_marketService","MarketService","_ngbModalService","NgbModal","_changeDetectorRef","ChangeDetectorRef","_errorMessagesService","ErrorMessagesService","_translateService","TranslateService","loginError","isLoadingImages","constructor","register","ngOnInit","hasLanguageSwitch","getLanguageSwitchLink","isLoginCarouselEnabled","getLoginImages","_this","_asyncToGenerator","removeOldLoginData","resp","value","prefetchUserData","hasLoginConfirmAlert","showInfo","instant","redirectToBase","page","location","href","origin","err","BEError","title","msg","hasLoginErrorWarningEnabled","showErrorAlert","then","e","message","_this2","window","extconf","LoginCarousel","detectChanges","initializeCarousel","swiper","document","querySelector","swiperParams","pagination","enabled","clickable","el","navigation","prevEl","nextEl","autoplay","delay","loop","slidesPerView","threshold","Object","assign","initialize","sessionStorage","removeItem","SessionStorageKey","AGENCY_DATA_EXT","AGENCY_DATA_FULL","AGENCY_DATA","GROUP_LIST","USER_DATA","ISO_CODE","BOOKING_LIST_BY_ADV_BKD","BOOKING_LIST_BY_ADV_OPT","BOOKING_LIST_BY_ADV","LOYALTY_PROGRAM","LOYALTY_PROGRAM_NUMBER","_this3","isNewBookingSearchEnabled","getUserProfile","standalone","features","decls","vars","consts","template","$event","LoginComponent_ng_container_13_Template","LoginComponent_ng_template_14_Template","LoginComponent_ng_template_16_Template","request","loader_r5","LoginBannerComponent","showSuccessAlert","_x","_x2","_x3","_showSuccessAlert","apply","arguments","text","confirmButtonText","console","debug","Swal","isVisible","fire","icon","iconHtml","html","errorsPerSection","showSuccess","showInfoAlert","showConfirmationAlert","okButton","cancelbutton","combineAndRenderSections","sectionKeys","tempErrorMessage","i","len","join","clearErrorForSection","key","appendErrorForSectionByClassName","label","push","appendErrorForSection","renderErrorMessageForSection","factory","ɵfac","providedIn","cancelButtonText","showCancelButton","focusConfirm","focusCancel","reverseButtons","_showErrorAlert","Error","_showInfoAlert"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/components/login/login-form/login-form.component.html","./src/app/components/login/login-form/login-form.component.ts","./src/app/Root/CostaClick/Pages/login/login.component.html","./src/app/Root/CostaClick/Pages/login/login.component.ts","./src/app/utils/Navigation/redirectToBase.utils.ts","./src/app/utils/Alerts/showSuccessAlert.utils.ts","./src/app/services/error-messages.service.ts","./src/app/utils/Alerts/showConfirmationAlert.utils.ts","./src/app/utils/Alerts/showErrorAlert.utils.ts","./src/app/utils/Alerts/showInfoAlert.utils.ts"],"sourcesContent":["
\n
\n

Login

\n
\n
\n \n \n
\n
\n \n
\n \n \n \n \n \n
\n
\n \n
\n
\n
{{ error }}
\n
\n
\n
\n \n
\n
\n
\n
\n","import {AfterViewInit, Component, ElementRef, EventEmitter, Input, Output, ViewChild} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { LoginForm } from '@interfaces/Login/LoginForm.interface';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { PrependBasePathPipe } from '@pipes/prepend-base-path.pipe';\nimport { PagePaths } from '@values/Navigation/PagePaths.value';\n\n@Component({\n selector: 'cck-login-form',\n standalone: true,\n imports: [CommonModule, ReactiveFormsModule, TranslateModule, PrependBasePathPipe],\n templateUrl: './login-form.component.html',\n styleUrls: ['./login-form.component.scss'],\n})\nexport class LoginFormComponent implements AfterViewInit {\n @Input() error: string;\n @Input() loading: boolean;\n @Input() cultureSwitch: { l: string; t: string } = null;\n @Output() login = new EventEmitter>();\n\n @ViewChild(\"userNameInputElement\", { static : true , read: ElementRef}) userNameInputElement : ElementRef;\n\n public submitted = false;\n public showPassword = false;\n\n public loginForm = new FormGroup({\n userName: new FormControl('', [Validators.required]),\n password: new FormControl('', [Validators.required]),\n });\n\n get loginFormControls(): LoginForm {\n return this.loginForm.controls;\n }\n\n get pagePaths() {\n return PagePaths;\n }\n\n submitForm() {\n this.submitted = true;\n this.loginForm.markAllAsTouched();\n\n if (this.loginForm.valid) {\n this.login.emit(this.loginForm);\n }\n }\n\n ngAfterViewInit(): void {\n this.userNameInputElement.nativeElement.focus();\n }\n}\n","
\n
\n
\n \n
\n\n

{{ 'HomePage.label_agencyOwner' | translate }}

\n \n
\n
\n
\n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n\n \n \n \n \n
\n \n
\n
\n
\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, inject, OnInit } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { BEError } from '@classes/BEError.class';\nimport { LoginBannerComponent } from '@components/login/login-banner/login-banner.component';\nimport { LoginFormComponent } from '@components/login/login-form/login-form.component';\nimport { ModalChangePasswordComponent } from '@components/user-menu/modal-change-password/modal-change-password.component';\nimport { SessionStorageKey } from '@enums/SessionStorageKey.enum';\nimport { LoginForm } from '@interfaces/Login/LoginForm.interface';\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\nimport { TranslateModule, TranslateService } from '@ngx-translate/core';\nimport { PrependBasePathPipe } from '@pipes/prepend-base-path.pipe';\nimport { UserPasswordComponent } from '@root/LoggedOnArea/user-password/user-password.component';\nimport { CostaBackendApiService } from '@services/costa-backend-api.service';\nimport { MarketService } from '@services/market.service';\nimport { HTMLSwiperElement } from '@type/Elements/HTMLSwiperElement.type';\nimport { redirectTo } from '@utils/Navigation/redirectTo.utils';\nimport { redirectToBase } from '@utils/Navigation/redirectToBase.utils';\nimport { PagePaths } from '@values/Navigation/PagePaths.value';\nimport { take } from 'rxjs';\nimport { SwiperOptions } from 'swiper/types';\nimport { register } from 'swiper/element/bundle';\nimport { ErrorMessagesService } from '@services/error-messages.service';\n\n@Component({\n standalone: true,\n templateUrl: './login.component.html',\n styleUrls: ['./login.component.scss'],\n imports: [CommonModule, LoginFormComponent, LoginBannerComponent, TranslateModule, PrependBasePathPipe],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n})\nexport class LoginComponent implements OnInit {\n private readonly _costaBackendApiService = inject(CostaBackendApiService);\n private readonly _marketService = inject(MarketService);\n private readonly _ngbModalService = inject(NgbModal);\n private readonly _changeDetectorRef = inject(ChangeDetectorRef);\n private readonly _errorMessagesService = inject(ErrorMessagesService);\n private readonly _translateService = inject(TranslateService);\n\n public loginError: string = null;\n public loading = false;\n public cultureSwitch: { l: string; t: string } = null;\n\n public isLoadingImages = true;\n public loginImages: string[] = [];\n\n get pagePaths() {\n return PagePaths;\n }\n\n constructor() {\n register();\n }\n\n ngOnInit(): void {\n if (this._marketService.hasLanguageSwitch()) this.cultureSwitch = this._marketService.getLanguageSwitchLink();\n\n if (this._marketService.isLoginCarouselEnabled()) this.getLoginImages();\n else this.isLoadingImages = false;\n }\n\n public async login(loginForm: FormGroup) {\n try {\n if (this.loading) return;\n\n const { userName, password } = loginForm.controls;\n this.loading = true;\n this.loginError = null;\n this.removeOldLoginData();\n\n const resp = await this._costaBackendApiService.login(userName.value, password.value);\n await this.prefetchUserData();\n\n if (this._marketService.hasLoginConfirmAlert()) {\n await this._errorMessagesService.showInfo(\n this._translateService.instant('Booking.login_confirmation_alert_text'),\n )\n }\n\n redirectToBase(resp);\n } catch (err) {\n this.loading = false;\n\n if (!(err instanceof BEError)) return;\n\n const title = this._translateService.instant('Booking.login_error_warning_title');\n const msg = \"
\" + this._translateService.instant('Booking.login_error_warning_msg') +\"
\";\n if (this._marketService.hasLoginErrorWarningEnabled()) {\n this._errorMessagesService.showErrorAlert(msg, title).then(e=>{});\n } else {\n this.loginError = err.message;\n }\n }\n }\n\n public async getLoginImages() {\n this.isLoadingImages = true;\n\n try {\n this.loginImages = window?.extconf?.LoginCarousel ?? [];\n this.isLoadingImages = false;\n this._changeDetectorRef.detectChanges();\n this.initializeCarousel();\n } catch {\n this.isLoadingImages = false;\n }\n }\n\n private initializeCarousel() {\n const swiper = document.querySelector('.loginCarousel') as HTMLSwiperElement;\n const swiperParams: SwiperOptions = {\n pagination: {\n enabled: true,\n clickable: true,\n el: document.querySelector('swiper-container.loginCarousel .paginationElement') as HTMLDivElement,\n },\n navigation: {\n enabled: true,\n prevEl: document.querySelector('swiper-container.loginCarousel .prevElement') as HTMLDivElement,\n nextEl: document.querySelector('swiper-container.loginCarousel .nextElement') as HTMLDivElement,\n },\n autoplay: {\n delay: 5000,\n },\n loop: true,\n slidesPerView: 1,\n threshold: 30,\n };\n Object.assign(swiper, swiperParams);\n swiper.initialize();\n }\n\n private removeOldLoginData() {\n sessionStorage.removeItem(SessionStorageKey.AGENCY_DATA_EXT);\n sessionStorage.removeItem(SessionStorageKey.AGENCY_DATA_FULL);\n sessionStorage.removeItem(SessionStorageKey.AGENCY_DATA);\n sessionStorage.removeItem(SessionStorageKey.GROUP_LIST);\n sessionStorage.removeItem(SessionStorageKey.USER_DATA);\n sessionStorage.removeItem(SessionStorageKey.ISO_CODE);\n sessionStorage.removeItem(SessionStorageKey.BOOKING_LIST_BY_ADV_BKD);\n sessionStorage.removeItem(SessionStorageKey.BOOKING_LIST_BY_ADV_OPT);\n sessionStorage.removeItem(SessionStorageKey.BOOKING_LIST_BY_ADV);\n sessionStorage.removeItem(SessionStorageKey.LOYALTY_PROGRAM);\n sessionStorage.removeItem(SessionStorageKey.LOYALTY_PROGRAM_NUMBER);\n }\n\n private async prefetchUserData() {\n if (this._marketService.isNewBookingSearchEnabled()) {\n await this._costaBackendApiService.getUserProfile();\n }\n }\n}\n","export function redirectToBase(page: string) {\n location.href = `${location.origin}${page}`;\n}\n","import Swal from '@global/config/defaultSwal';\n\nexport async function showSuccessAlert(title: string, text: string, confirmButtonText: string) {\n console.debug('[ShowSuccess] text: ', text);\n if (!Swal.isVisible()) {\n return await Swal.fire({\n title,\n icon: 'success',\n iconHtml: `\n \n `,\n html: `\n

${text}

\n `,\n confirmButtonText,\n });\n } else {\n return null;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { showConfirmationAlert } from '@utils/Alerts/showConfirmationAlert.utils';\nimport { showErrorAlert } from '@utils/Alerts/showErrorAlert.utils';\nimport { showInfoAlert } from '@utils/Alerts/showInfoAlert.utils';\nimport { showSuccessAlert } from '@utils/Alerts/showSuccessAlert.utils';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ErrorMessagesService {\n private readonly _translateService = inject(TranslateService);\n\n private errorsPerSection = {};\n\n public showSuccess(message, title = null) {\n return showSuccessAlert(title, message, this._translateService.instant('Global.btn_OK'));\n }\n\n public showInfo(message, title = null) {\n return showInfoAlert(title, message, this._translateService.instant('Global.btn_OK'));\n }\n\n public showErrorAlert(message, title = null) {\n return showErrorAlert(title, message, this._translateService.instant('Global.btn_OK'));\n }\n\n public showConfirmationAlert(message, title = null, okButton = null, cancelbutton = null, icon = null) {\n console.debug('showConfirmationAlert', {\n message: message,\n title: title,\n okButton: okButton,\n cancelbutton: cancelbutton,\n icon: icon,\n });\n return showConfirmationAlert(\n title,\n message,\n okButton ?? this._translateService.instant('Global.btn_OK'),\n cancelbutton ?? this._translateService.instant('Global.btn_Cancel'),\n icon\n );\n }\n\n public showSuccessAlert(message, title = null) {\n return showSuccessAlert(title, message, this._translateService.instant('Global.btn_OK'));\n }\n\n public combineAndRenderSections(sectionKeys) {\n let tempErrorMessage = '';\n for (let i = 0, len = sectionKeys.length; i < len; ++i) {\n if (this.errorsPerSection[sectionKeys[i]]) {\n tempErrorMessage += this.errorsPerSection[sectionKeys[i]].join('
');\n tempErrorMessage += '
';\n }\n }\n\n return tempErrorMessage;\n }\n\n public clearErrorForSection(key) {\n if (!this.errorsPerSection[key]) {\n return;\n }\n\n delete this.errorsPerSection[key];\n }\n\n public appendErrorForSectionByClassName(key, label) {\n if (!this.errorsPerSection[key]) {\n this.errorsPerSection[key] = [];\n }\n\n this.errorsPerSection[key].push(this._translateService.instant(label));\n }\n\n public appendErrorForSection(key, message) {\n if (!this.errorsPerSection[key]) {\n this.errorsPerSection[key] = [];\n }\n\n this.errorsPerSection[key].push(message);\n }\n\n public renderErrorMessageForSection(key) {\n const message = this.errorsPerSection[key].join('
');\n return message;\n }\n}\n","import Swal from '@global/config/defaultSwal';\n\nexport function showConfirmationAlert(\n title: string | HTMLElement,\n html: string | HTMLElement,\n confirmButtonText: string,\n cancelButtonText: string,\n icon?: string,\n) {\n icon = icon || 'warning';\n let iconHtml = ``;\n\n return Swal.fire({\n title,\n html: `\n
${html}
\n `,\n confirmButtonText,\n cancelButtonText,\n showCancelButton: true,\n focusConfirm: false,\n focusCancel: true,\n reverseButtons: true,\n iconHtml\n });\n}\n","import Swal from '@global/config/defaultSwal';\n\nexport async function showErrorAlert(title: string, text: string, confirmButtonText: string) {\n const err = new Error();\n // Error.captureStackTrace(err);\n console.error(err);\n if (!Swal.isVisible()) {\n return await Swal.fire({\n title,\n html: `\n
${text}
\n `,\n confirmButtonText,\n });\n } else {\n return null;\n }\n}\n","import Swal from '@global/config/defaultSwal';\n\nexport async function showInfoAlert(title: string, text: string, confirmButtonText: string) {\n console.debug('[ShowInfo] text: ', text);\n if (!Swal.isVisible()) {\n return await Swal.fire({\n title,\n icon: 'info',\n iconHtml: null,\n html: `\n
${text}
\n `,\n confirmButtonText,\n });\n } else {\n return null;\n }\n}\n"],"x_google_ignoreList":[]}