(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([[6957],{

/***/ 36957:
/*!**********************************************************************************!*\
  !*** ./src/app/logistic-events/create/event-date-time/event-date-time.module.ts ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "EventDateTimePageModule": () => (/* binding */ EventDateTimePageModule)
/* harmony export */ });
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/router */ 61380);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _event_date_time_page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event-date-time.page */ 13378);
/* harmony import */ var src_app_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/shared-module/shared-module.module */ 69270);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_3__);





const routes = [
    {
        path: '',
        component: _event_date_time_page__WEBPACK_IMPORTED_MODULE_1__.EventDateTimePage
    }
];
class EventDateTimePageModule {
}
EventDateTimePageModule.ɵfac = function EventDateTimePageModule_Factory(t) { return new (t || EventDateTimePageModule)(); };
EventDateTimePageModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineNgModule"]({ type: EventDateTimePageModule });
EventDateTimePageModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjector"]({ imports: [
        // CommonModule,
        // FormsModule,
        // ReactiveFormsModule,
        // IonicModule,
        // FontAwesomeModule,
        src_app_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_2__.SharedModuleModule,
        _angular_router__WEBPACK_IMPORTED_MODULE_0__.RouterModule.forChild(routes)] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵsetNgModuleScope"](EventDateTimePageModule, { declarations: [_event_date_time_page__WEBPACK_IMPORTED_MODULE_1__.EventDateTimePage], imports: [
        // CommonModule,
        // FormsModule,
        // ReactiveFormsModule,
        // IonicModule,
        // FontAwesomeModule,
        src_app_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_2__.SharedModuleModule, _angular_router__WEBPACK_IMPORTED_MODULE_0__.RouterModule] }); })();


/***/ }),

/***/ 13378:
/*!********************************************************************************!*\
  !*** ./src/app/logistic-events/create/event-date-time/event-date-time.page.ts ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "EventDateTimePage": () => (/* binding */ EventDateTimePage)
/* harmony export */ });
/* harmony import */ var _Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 71670);
/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @shared/components */ 7667);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ 56908);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/forms */ 2508);
/* harmony import */ var _shared_services__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @shared/services */ 17253);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ionic/angular */ 93819);
/* harmony import */ var _shared_services_focus_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @shared/services/focus.service */ 37763);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/common */ 90944);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_angular_common__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _shared_components_header_header_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../shared/components/header/header.component */ 36290);
/* harmony import */ var _shared_components_customtimepicker_customtimepicker_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../shared/components/customtimepicker/customtimepicker.component */ 31044);
/* harmony import */ var _ngx_translate_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ngx-translate/core */ 38699);













function EventDateTimePage_div_15_div_1_Template(rf, ctx) {
  if (rf & 1) {
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "div", 15);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
  }

  if (rf & 2) {
    const e_r3 = ctx.$implicit;
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", e_r3.message, " ");
  }
}

function EventDateTimePage_div_15_Template(rf, ctx) {
  if (rf & 1) {
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "div", 13);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtemplate"](1, EventDateTimePage_div_15_div_1_Template, 2, 1, "div", 14);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
  }

  if (rf & 2) {
    const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"]();
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("ngForOf", ctx_r0.getFieldInputValidationErrors("startDate"));
  }
}

function EventDateTimePage_div_26_div_1_Template(rf, ctx) {
  if (rf & 1) {
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "div", 15);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
  }

  if (rf & 2) {
    const e_r6 = ctx.$implicit;
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", e_r6.message, " ");
  }
}

function EventDateTimePage_div_26_Template(rf, ctx) {
  if (rf & 1) {
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](0, "div", 13);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtemplate"](1, EventDateTimePage_div_26_div_1_Template, 2, 1, "div", 14);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
  }

  if (rf & 2) {
    const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵnextContext"]();
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
    _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("ngForOf", ctx_r1.getFieldInputValidationErrors("endDate"));
  }
}

class EventDateTimePage {
  constructor(formBuilder, navigationService, notificatorService, createLogisticEventService, modalController, momentService, translateConfigService, platform, datePickerService, focusService) {
    var _this = this;

    this.formBuilder = formBuilder;
    this.navigationService = navigationService;
    this.notificatorService = notificatorService;
    this.createLogisticEventService = createLogisticEventService;
    this.modalController = modalController;
    this.momentService = momentService;
    this.translateConfigService = translateConfigService;
    this.platform = platform;
    this.datePickerService = datePickerService;
    this.focusService = focusService;
    this.existPendings = false;
    this.desabledBtnNext = false;
    this.todayDate = null;
    this.startDate = null;
    this.startDay = null;
    this.endDate = null;
    this.minDate = null;
    this.maxDate = null;
    this.approveEventReview = '';
    this.recurrenceDates = [];

    this.setInitialValueForTodayDate = () => {
      this.todayDate = new Date();
    };

    this.setInitialValueForStartDay = () => {
      const startDay = this.createLogisticEventService.getStartDate();

      if (!startDay) {
        this.startDay = moment__WEBPACK_IMPORTED_MODULE_2___default()().format('YYYY-MM-DD');
      } else {
        this.startDay = moment__WEBPACK_IMPORTED_MODULE_2___default()(startDay).format('YYYY-MM-DD');
      }

      this.eventDateForm.controls.startDay.setValue(this.startDay);
    };

    this.setInitialValueForStartDate = () => {
      const startDate = this.createLogisticEventService.getStartDate();

      if (!startDate) {
        this.startDate = moment__WEBPACK_IMPORTED_MODULE_2___default()();
      } else {
        this.startDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(startDate);
      }

      this.eventDateForm.controls.startDate.setValue(this.startDate);
      this.hourStartSelected = this.startDate?.format('HH:mm');
    };

    this.setInitialValueForEndDate = () => {
      const endDate = this.createLogisticEventService.getEndDate();

      if (!endDate) {
        this.endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()();

        if (moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).hours() === 23) {
          this.endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).set({
            minutes: 59
          });
        } else {
          this.endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).add(1, 'hours');
        }
      } else {
        this.endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(endDate);
      }

      this.eventDateForm.controls.endDate.setValue(this.endDate);
      this.hourEndSelected = this.endDate?.format('HH:mm');
    };

    this.setMinDate = () => {
      this.minDate = new Date();
      this.minDate.setHours(0 - this.minDate.getTimezoneOffset() / 60, 0, 0, 0);
    };

    this.setMaxDate = () => {
      this.maxDate = new Date();
      this.maxDate.setHours(23 - this.maxDate.getTimezoneOffset() / 60);
      this.maxDate.setMinutes(59, 59, 0);
      this.maxDate.setFullYear(this.maxDate.getFullYear() + 100);
    };

    this.onSubmit = () => {
      this.cleanValidationErrors();
      const startDay = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.startDay);
      let startDate = this.startDate;
      let endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate);
      this.compareEndDateAndStartDate(endDate, startDate);

      if (this.max24h && !this.recurrenceDates.length) {
        const addDayEnd = moment__WEBPACK_IMPORTED_MODULE_2___default()(startDay).add(1, 'd');
        const month = addDayEnd.month();
        const year = addDayEnd.year();
        const day = addDayEnd.date();
        endDate = endDate.date(day).month(month).year(year).set({
          seconds: 59
        });
      } else {
        if (!this.recurrenceDates.length) {
          endDate = endDate.date(startDay.date()).month(startDay.month()).year(startDay.year()).set({
            seconds: 59
          });
        } else {
          const lastDate = this.recurrenceDates.slice().pop();
          const lastDateWithTime = moment__WEBPACK_IMPORTED_MODULE_2___default()(lastDate.happensAt).set({
            hours: moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).hours(),
            minutes: moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).minutes(),
            seconds: moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).seconds()
          });
          console.log('lastDateWithTime', lastDateWithTime.format('YYYY-MM-DDTHH:mm:ss[Z]'));
          endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).set({
            seconds: 59
          });
          endDate = lastDateWithTime;
          console.log('EndDate', endDate.format('YYYY-MM-DDTHH:mm:ss[Z]'));
        }
      }

      startDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(startDate).date(startDay.date()).month(startDay.month()).year(startDay.year()).set({
        seconds: 0
      });
      const data = {
        startDate: moment__WEBPACK_IMPORTED_MODULE_2___default()(startDate).format(),
        endDate: moment__WEBPACK_IMPORTED_MODULE_2___default()(endDate).format()
      };
      console.log('starDate', data.startDate);
      console.log('endDate', data.endDate);
      const validationResult = this.validateInput(data);

      if (!!validationResult.length) {
        this.setValidationErrors(validationResult);
        const notification = {
          title: this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TOAST_INVALID_DATA_TITLE'),
          message: this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TOAST_INVALID_DATA_NESSAGE'),
          type: 'error'
        };
        this.notificatorService.notify(notification);
      } else {
        this.createLogisticEventService.setStartDate(startDate);
        this.createLogisticEventService.setEndDate(endDate);
        this.createLogisticEventService.setRecurrent(this.recurrenceDates.length > 0);
        this.createLogisticEventService.setRecurrenceDates(this.recurrenceDates);

        if (this.max24h) {
          this.desabledBtnNext = true;
          this.messageNotificationFutureEvent(endDate);
          setTimeout(() => {
            this.navigationService.forward(['/logistic-events/create/event-driver']);
            this.desabledBtnNext = false;
          }, 1000);
        } else {
          this.navigationService.forward(['/logistic-events/create/event-driver']);
        }
      }
    };

    this.validateInput = data => {
      const errors = [];
      const startDateValidationErrors = this.validateStartDate(data);

      if (startDateValidationErrors) {
        errors.push(startDateValidationErrors);
      }

      const endDateValidationErrors = this.validateEndDate(data);

      if (endDateValidationErrors) {
        errors.push(endDateValidationErrors);
      }

      return errors;
    };

    this.validateStartDate = data => {
      const currentDate = new Date();
      currentDate.setHours(0);
      currentDate.setMinutes(0);
      currentDate.setSeconds(0);
      currentDate.setMilliseconds(0);
      const startDate = new Date(data.startDate);

      if (currentDate.getTime() > startDate.getTime()) {
        return {
          field: 'startDate',
          message: this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TEXT_FIELD_STARTDATE')
        };
      }

      return null;
    };

    this.validateEndDate = data => {
      const startDate = new Date(data.startDate);
      const endDate = new Date(data.endDate);
      endDate.setDate(startDate.getDate());
      endDate.setMonth(startDate.getMonth());
      endDate.setFullYear(startDate.getFullYear());
      const now = new Date();

      if (this.max24h) {
        return null;
      }

      if (endDate.getTime() < startDate.getTime()) {
        return {
          field: 'endDate',
          message: this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TEXT_FIELD_ENDDATE_POST_START')
        };
      } else if (endDate.getTime() < now.getTime()) {
        return {
          field: 'endDate',
          message: this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TEXT_FIELD_ENDDATE_POST_NOW')
        };
      }

      return null;
    };

    this.goOneStepBack = () => {
      const action = this.createLogisticEventService.getAction();
      const navigationExtras = {
        state: {
          onBack: true,
          action
        }
      };
      this.navigationService.back(['/logistic-events/create/event-name'], navigationExtras);
    };

    this.setValidationErrors = errors => {
      this.eventDateFormErrors = errors;
    };

    this.cleanValidationErrors = () => {
      this.eventDateFormErrors = [];
    };

    this.thereIsFieldInputValidationErrors = field => this.eventDateFormErrors.find(e => e.field === field);

    this.getFieldInputValidationErrors = field => this.eventDateFormErrors.filter(e => e.field === field);

    this.onOpenPickDateModal = /*#__PURE__*/function () {
      var _ref = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (pickMode) {
        const options = {
          pickMode
        };
        const modal = yield _this.modalController.create({
          component: _shared_components__WEBPACK_IMPORTED_MODULE_1__.PickDateModalComponent,
          componentProps: {
            startDate: _this.startDay,
            recurrence: pickMode === 'multi' ? _this.recurrenceDates : [],
            options
          }
        });
        modal.onDidDismiss().then(_this.onPickDateModalComponentDidDismiss);
        yield modal.present();
      });

      return function (_x) {
        return _ref.apply(this, arguments);
      };
    }(); // public openPickerHourDialog(openPicker: 'startDate' | 'endDate') {
    //   if (this.platform.is('cordova') && this.platform.is('android')) {
    //     this.openPickerHour(openPicker);
    //   } else {
    //     if (openPicker === 'startDate') {
    //       this.onOpenPickStartDatetimeModal();
    //     } else {
    //       this.onOpenPickEndDatetimeModal();
    //     }
    //   }
    // }


    this.onPickDateModalComponentDidDismiss = response => {
      if (!response?.data && response.data.code !== 'OK') {
        this.startDay = this.startDay ? this.startDay : moment__WEBPACK_IMPORTED_MODULE_2___default()();
        this.recurrenceDates = [];
        return;
      }

      if (response.data) {
        if (response.data.code === 'OK') {
          this.startDay = response.data.data.date;

          if (response.data.data.pickMode === 'single') {
            this.startDay = moment__WEBPACK_IMPORTED_MODULE_2___default()(response.data.data.date);
          } else {
            if (response.data.data.recurrence.length > 0) {
              const recurrences = this.mapRecurrenceDates(response.data.data.recurrence, this.eventId);
              this.recurrenceDates = recurrences.slice(); // criando uma cópia do array original

              this.startDay = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.recurrenceDates[0].happensAt);
            } else {
              this.recurrenceDates = [];
            }
          }

          console.log('startDay', moment__WEBPACK_IMPORTED_MODULE_2___default()(this.startDay).format('DD/MM/YYYY'));
          console.log('mapRecurrenceDates', this.recurrenceDates);
        }
      }
    };

    this.onOpenPickStartDatetimeModal = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      _this.onOpenPickDatetimeModal(new Date(_this.startDate), _this.onPickStartDatetimeModalComponentDidDismiss);
    });
    this.onOpenPickEndDatetimeModal = /*#__PURE__*/(0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      _this.onOpenPickDatetimeModal(new Date(_this.endDate), _this.onPickEndDatetimeModalComponentDidDismiss);
    });

    this.onOpenPickDatetimeModal = /*#__PURE__*/function () {
      var _ref4 = (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (value, dismissCallback) {
        const modal = yield _this.modalController.create({
          component: _shared_components__WEBPACK_IMPORTED_MODULE_1__.PickDatetimeModalComponent,
          componentProps: {
            startDate: value
          }
        });
        modal.onDidDismiss().then(dismissCallback);
        yield modal.present();
      });

      return function (_x2, _x3) {
        return _ref4.apply(this, arguments);
      };
    }();

    this.onPickStartDatetimeModalComponentDidDismiss = response => {
      if (response.data) {
        if (response.data.code === 'OK') {
          this.startDate = response.data.data.date;
          this.endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.startDate).add(1, 'hours');
        } else {}
      }
    };

    this.onPickEndDatetimeModalComponentDidDismiss = response => {
      if (response.data) {
        if (response.data.code === 'OK') {
          this.endDate = response.data.data.date;
        }
      }
    };

    this.approveEventReview = this.createLogisticEventService.getApproveEventReview() ? this.createLogisticEventService.getApproveEventReview() : '';
    this.recurrenceDates = this.createLogisticEventService.getRecurrenceDates();
    this.eventId = +this.createLogisticEventService.getId();
  }

  ionViewWillEnter() {
    this.focusService.applyFocusQuerySelector('create_event_date', 3500);
  }

  ngOnInit() {
    // TODO Get from localstorage, if there is something set it as the initial value.
    this.eventDateForm = this.formBuilder.group({
      startDay: [''],
      startDate: [''],
      endDate: ['']
    });
    this.eventDateFormErrors = [];
    this.setInitialValueForTodayDate();
    this.setInitialValueForStartDay();
    this.setInitialValueForStartDate();
    this.setInitialValueForEndDate();
    this.setMinDate();
    this.setMaxDate();
  }

  get minDateISOString() {
    return this.minDate.toISOString();
  }

  get maxDateISOString() {
    return this.maxDate.toISOString();
  }

  openPickerHourDialog(openPicker, event) {
    if (openPicker === 'startDate') {
      this.hourStartSelected = event;
      const now = new Date();
      const fullDateNow = new Date(now.toDateString() + ' ' + event);
      this.startDate = fullDateNow;
      this.endDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.startDate).add(1, 'hours').toDate();
      this.hourEndSelected = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).format('HH:mm');
    } else {
      const now = new Date();
      const fullDateNow = new Date(now.toDateString() + ' ' + event);
      this.endDate = fullDateNow;
      this.hourEndSelected = moment__WEBPACK_IMPORTED_MODULE_2___default()(this.endDate).format('HH:mm');
    }
  }

  getDateToBeShow() {
    return this.momentService.formatAs(this.startDay, 'DD/MM/YYYY');
  }

  getStartDatetimeToBeShow() {
    return this.momentService.formatAs(this.startDate, 'HH[h]mm[min]');
  }

  getEndDatetimeToBeShow() {
    return this.momentService.formatAs(this.endDate, 'HH[h]mm[min]');
  }

  compareEndDateAndStartDate(endDate, startDate) {
    const startMoment = moment__WEBPACK_IMPORTED_MODULE_2___default()(startDate.toISOString());
    const endMoment = moment__WEBPACK_IMPORTED_MODULE_2___default()(endDate.toISOString());
    const startHour = startMoment.hour();
    const startMinute = startMoment.minute();
    const startSecond = startMoment.second();
    const endHour = endMoment.hour();
    const endMinute = endMoment.minute();
    const endSecond = endMoment.second();

    if (endHour < startHour || endHour === startHour && endMinute < startMinute || endHour === startHour && endMinute === startMinute && endSecond < startSecond) {
      this.max24h = true;
    } else {
      this.max24h = false;
    }

    return this.max24h;
  }

  messageNotificationFutureEvent(endDate) {
    const textcloseat = this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TOAST_FUTURE_EVENT_MESSAGE_CLOSE_AT');
    const texttheday = this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TOAST_FUTURE_EVENT_MESSAGE_THE_DAY');
    const message = `${textcloseat} ${this.getEndDatetimeToBeShow()} ${texttheday} ${moment__WEBPACK_IMPORTED_MODULE_2___default()(endDate).format('DD/MM/YYYY')}`;
    const notification = {
      title: this.translateConfigService.translate('PG_CREATE_LG_DATE_STEP_TOAST_FUTURE_EVENT_TITLE'),
      message,
      type: 'success',
      timeout: 10000
    };
    const time = setTimeout(() => {
      this.max24h = false;
      this.notificatorService.notify(notification);
      clearTimeout(time);
    }, 500);
  }

  mapRecurrenceDates(dates, eventId) {
    return dates.map(date => {
      const formattedDate = moment__WEBPACK_IMPORTED_MODULE_2___default()(date).format('YYYY-MM-DD');
      return {
        eventId,
        happensAt: formattedDate
      };
    });
  }

  openPickerHour(openPicker) {
    var _this2 = this;

    return (0,_Volumes_case_workspace_work_APPS_KA_APP_WORK_NOW_KA_PASS_V2_2_6_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
      const result = yield _this2.datePickerService.openPickerHour(openPicker, _this2.startDate, _this2.endDate);

      if (!result.endDate && result.startDate) {
        return;
      }

      _this2.startDate = result.startDate;
      _this2.endDate = result.endDate;
    })();
  }

}

EventDateTimePage.ɵfac = function EventDateTimePage_Factory(t) {
  return new (t || EventDateTimePage)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_9__.UntypedFormBuilder), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_4__.NavigationService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_4__.NotificatorService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_4__.CreateLogisticEventService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_ionic_angular__WEBPACK_IMPORTED_MODULE_10__.ModalController), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_4__.MomentService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_4__.TranslateConfigService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_ionic_angular__WEBPACK_IMPORTED_MODULE_10__.Platform), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_4__.DatePickerService), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_shared_services_focus_service__WEBPACK_IMPORTED_MODULE_5__.FocusService));
};

EventDateTimePage.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineComponent"]({
  type: EventDateTimePage,
  selectors: [["app-event-date-time"]],
  decls: 34,
  vars: 33,
  consts: [["defaultHref", "/logistic-events/create/event-name", 3, "title", "showBadge", "refresh", "menuToggle"], [1, "centralized-content", "ion-padding-horizontal"], [1, "page-title"], ["id", "create_event_date", 1, "sub-title"], [3, "formGroup", "ngSubmit"], ["lines", "none", 1, "input-holder", 3, "disabled"], ["type", "button", 1, "hidden-input-button", 3, "click"], ["class", "errors", 4, "ngIf"], [3, "valueHour", "timeSet"], ["lines", "none", 1, "input-holder"], [1, "button-holder"], ["type", "button", 1, "back", 3, "click"], ["type", "submit", 3, "disabled"], [1, "errors"], ["class", "error", 4, "ngFor", "ngForOf"], [1, "error"]],
  template: function EventDateTimePage_Template(rf, ctx) {
    if (rf & 1) {
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelement"](0, "app-header", 0);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](1, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](2, "ion-content")(3, "div", 1)(4, "div", 2)(5, "div", 3);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](6);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](7, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](8, "form", 4);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("ngSubmit", function EventDateTimePage_Template_form_ngSubmit_8_listener() {
        return ctx.onSubmit();
      });
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](9, "ion-item", 5)(10, "ion-label");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](11);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](12, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](13, "button", 6);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("click", function EventDateTimePage_Template_button_click_13_listener() {
        return ctx.onOpenPickDateModal("single");
      });
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](14);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtemplate"](15, EventDateTimePage_div_15_Template, 2, 1, "div", 7);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](16, "ion-item", 5)(17, "ion-label");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](18);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](19, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](20, "app-custom-timepicker", 8);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("timeSet", function EventDateTimePage_Template_app_custom_timepicker_timeSet_20_listener($event) {
        return ctx.openPickerHourDialog("startDate", $event);
      });
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](21, "ion-item", 9)(22, "ion-label");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](23);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](24, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](25, "app-custom-timepicker", 8);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("timeSet", function EventDateTimePage_Template_app_custom_timepicker_timeSet_25_listener($event) {
        return ctx.openPickerHourDialog("endDate", $event);
      });
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtemplate"](26, EventDateTimePage_div_26_Template, 2, 1, "div", 7);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](27, "div", 10)(28, "button", 11);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵlistener"]("click", function EventDateTimePage_Template_button_click_28_listener() {
        return ctx.goOneStepBack();
      });
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](29);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](30, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]();
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementStart"](31, "button", 12);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtext"](32);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipe"](33, "translate");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵelementEnd"]()()()()();
    }

    if (rf & 2) {
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("title", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](1, 19, "PG_CREATE_LG_DATE_STEP_HEADER_TITLE"))("showBadge", true)("refresh", false)("menuToggle", false);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](6);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](7, 21, "PG_CREATE_LG_DATE_STEP_TEXT_SUBTITLE"), " ");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](2);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("formGroup", ctx.eventDateForm);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("disabled", ctx.approveEventReview === "TRUE");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](2);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](12, 23, "PG_CREATE_LG_DATE_STEP_TEXT_DAY"), " ");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](3);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", ctx.getDateToBeShow(), " ");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("ngIf", ctx.thereIsFieldInputValidationErrors("startDate"));
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("disabled", ctx.approveEventReview === "TRUE");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](2);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](19, 25, "PG_CREATE_LG_DATE_STEP_TEXT_STARTAT"), " ");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](2);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("valueHour", ctx.hourStartSelected);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](3);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](24, 27, "PG_CREATE_LG_DATE_STEP_TEXT_ENDAT"), " ");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](2);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("valueHour", ctx.hourEndSelected);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("ngIf", ctx.thereIsFieldInputValidationErrors("endDate"));
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](3);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](30, 29, "BTN_BACK"), " ");
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](2);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵproperty"]("disabled", ctx.desabledBtnNext);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵadvance"](1);
      _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵtextInterpolate"](_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵpipeBind1"](33, 31, "BTN_NEXT"));
    }
  },
  dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_6__.NgForOf, _angular_common__WEBPACK_IMPORTED_MODULE_6__.NgIf, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonContent, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonItem, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonLabel, _angular_forms__WEBPACK_IMPORTED_MODULE_9__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_9__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_9__.FormGroupDirective, _shared_components_header_header_component__WEBPACK_IMPORTED_MODULE_7__.HeaderComponent, _shared_components_customtimepicker_customtimepicker_component__WEBPACK_IMPORTED_MODULE_8__.CustomTimepickerComponent, _ngx_translate_core__WEBPACK_IMPORTED_MODULE_11__.TranslatePipe],
  styles: ["ion-content[_ngcontent-%COMP%] {\n  --background: #f1f1f1;\n}\n\nion-toolbar[_ngcontent-%COMP%] {\n  font-family: \"Nunito\", sans-serif;\n}\n\nion-toolbar[_ngcontent-%COMP%]   ion-img[_ngcontent-%COMP%] {\n  height: 25px;\n  width: 25px;\n}\n\nion-toolbar[_ngcontent-%COMP%]   ion-title[_ngcontent-%COMP%] {\n  letter-spacing: 1px;\n}\n\nion-toolbar[_ngcontent-%COMP%]   ion-button[_ngcontent-%COMP%]   fa-icon[_ngcontent-%COMP%] {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  height: 24px;\n  padding: 0;\n  width: 24px;\n  margin: 0;\n  font-size: 19px;\n  color: #656768;\n}\n\nion-toolbar[_ngcontent-%COMP%]   ion-button.hover[_ngcontent-%COMP%] {\n  background: #fff;\n}\n\n.centralized-content[_ngcontent-%COMP%] {\n  height: calc(100vh - 56px);\n  display: flex;\n  justify-content: flex-start;\n  flex-direction: column;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .input-holder[_ngcontent-%COMP%] {\n  border: 1px solid #eeeeee;\n  border-radius: 32px;\n  margin: 8px auto 0;\n  width: 100%;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .button-holder.more-config[_ngcontent-%COMP%] {\n  margin-top: 2em;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .errors[_ngcontent-%COMP%] {\n  width: 80%;\n  margin: 12px 10% 0;\n  color: #f0181b;\n  text-align: center;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .page-title[_ngcontent-%COMP%] {\n  margin-top: 30px;\n  margin-bottom: 26px;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .page-title[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%] {\n  font-weight: bold;\n  text-align: center;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .page-title[_ngcontent-%COMP%]   .sub-title[_ngcontent-%COMP%] {\n  text-align: center;\n  color: #656768;\n  font-size: 0.9em;\n  margin-top: 4px;\n}\n\n.centralized-content[_ngcontent-%COMP%]   .hidden-input-button[_ngcontent-%COMP%] {\n  background-color: #fff;\n  height: 100%;\n  font-size: 1em;\n}\n\n.pulsate-fwd[_ngcontent-%COMP%] {\n  animation: pulsate-fwd 0.5s ease-in-out infinite both;\n  outline: none;\n}\n\n@keyframes pulsate-fwd {\n  0% {\n    transform: scale(1);\n  }\n  50% {\n    transform: scale(1.5);\n  }\n  100% {\n    transform: scale(1);\n  }\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV2ZW50LWRhdGUtdGltZS5wYWdlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxxQkFBQTtBQUNGOztBQUNBO0VBQ0UsaUNBQUE7QUFFRjs7QUFBRTtFQUNFLFlBQUE7RUFDQSxXQUFBO0FBRUo7O0FBQ0U7RUFDRSxtQkFBQTtBQUNKOztBQUdJO0VBQ0UsYUFBQTtFQUNBLHVCQUFBO0VBQ0EsbUJBQUE7RUFDQSxZQUFBO0VBQ0EsVUFBQTtFQUNBLFdBQUE7RUFDQSxTQUFBO0VBQ0EsZUFBQTtFQUNBLGNBQUE7QUFETjs7QUFJSTtFQUNFLGdCQUFBO0FBRk47O0FBT0E7RUFDRSwwQkFBQTtFQUNBLGFBQUE7RUFDQSwyQkFBQTtFQUNBLHNCQUFBO0FBSkY7O0FBTUU7RUFDRSx5QkFBQTtFQUNBLG1CQUFBO0VBQ0Esa0JBQUE7RUFDQSxXQUFBO0FBSko7O0FBUUk7RUFDRSxlQUFBO0VBQ0EsYUFBQTtFQUNBLHVCQUFBO0VBQ0EsbUJBQUE7QUFOTjs7QUFVRTtFQUNFLFVBQUE7RUFDQSxrQkFBQTtFQUNBLGNBQUE7RUFDQSxrQkFBQTtBQVJKOztBQVdFO0VBQ0UsZ0JBQUE7RUFDQSxtQkFBQTtBQVRKOztBQVdJO0VBQ0UsaUJBQUE7RUFDQSxrQkFBQTtBQVROOztBQVlJO0VBQ0Usa0JBQUE7RUFDQSxjQUFBO0VBQ0EsZ0JBQUE7RUFDQSxlQUFBO0FBVk47O0FBY0U7RUFDRSxzQkFBQTtFQUNBLFlBQUE7RUFDQSxjQUFBO0FBWko7O0FBZUE7RUFDRSxxREFBQTtFQUNBLGFBQUE7QUFaRjs7QUFlQTtFQUNFO0lBQ0UsbUJBQUE7RUFaRjtFQWNBO0lBQ0UscUJBQUE7RUFaRjtFQWNBO0lBQ0UsbUJBQUE7RUFaRjtBQUNGIiwiZmlsZSI6ImV2ZW50LWRhdGUtdGltZS5wYWdlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyJpb24tY29udGVudCB7XG4gIC0tYmFja2dyb3VuZDogI2YxZjFmMTtcbn1cbmlvbi10b29sYmFyIHtcbiAgZm9udC1mYW1pbHk6IFwiTnVuaXRvXCIsIHNhbnMtc2VyaWY7XG5cbiAgaW9uLWltZyB7XG4gICAgaGVpZ2h0OiAyNXB4O1xuICAgIHdpZHRoOiAyNXB4O1xuICB9XG5cbiAgaW9uLXRpdGxlIHtcbiAgICBsZXR0ZXItc3BhY2luZzogMXB4O1xuICB9XG5cbiAgaW9uLWJ1dHRvbiB7XG4gICAgZmEtaWNvbiB7XG4gICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgaGVpZ2h0OiAyNHB4O1xuICAgICAgcGFkZGluZzogMDtcbiAgICAgIHdpZHRoOiAyNHB4O1xuICAgICAgbWFyZ2luOiAwO1xuICAgICAgZm9udC1zaXplOiAxOXB4O1xuICAgICAgY29sb3I6ICM2NTY3Njg7XG4gICAgfVxuXG4gICAgJi5ob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kOiAjZmZmO1xuICAgIH1cbiAgfVxufVxuXG4uY2VudHJhbGl6ZWQtY29udGVudCB7XG4gIGhlaWdodDogY2FsYygxMDB2aCAtIDU2cHgpO1xuICBkaXNwbGF5OiBmbGV4O1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG5cbiAgLmlucHV0LWhvbGRlciB7XG4gICAgYm9yZGVyOiAxcHggc29saWQgI2VlZWVlZTtcbiAgICBib3JkZXItcmFkaXVzOiAzMnB4O1xuICAgIG1hcmdpbjogOHB4IGF1dG8gMDtcbiAgICB3aWR0aDogMTAwJTtcbiAgfVxuXG4gIC5idXR0b24taG9sZGVyIHtcbiAgICAmLm1vcmUtY29uZmlnIHtcbiAgICAgIG1hcmdpbi10b3A6IDJlbTtcbiAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgfVxuICB9XG5cbiAgLmVycm9ycyB7XG4gICAgd2lkdGg6IDgwJTtcbiAgICBtYXJnaW46IDEycHggMTAlIDA7XG4gICAgY29sb3I6ICNmMDE4MWI7XG4gICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICB9XG5cbiAgLnBhZ2UtdGl0bGUge1xuICAgIG1hcmdpbi10b3A6IDMwcHg7XG4gICAgbWFyZ2luLWJvdHRvbTogMjZweDtcblxuICAgIC50aXRsZSB7XG4gICAgICBmb250LXdlaWdodDogYm9sZDtcbiAgICAgIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgICB9XG5cbiAgICAuc3ViLXRpdGxlIHtcbiAgICAgIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgICAgIGNvbG9yOiAjNjU2NzY4O1xuICAgICAgZm9udC1zaXplOiAwLjllbTtcbiAgICAgIG1hcmdpbi10b3A6IDRweDtcbiAgICB9XG4gIH1cblxuICAuaGlkZGVuLWlucHV0LWJ1dHRvbiB7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcbiAgICBoZWlnaHQ6IDEwMCU7XG4gICAgZm9udC1zaXplOiAxZW07XG4gIH1cbn1cbi5wdWxzYXRlLWZ3ZCB7XG4gIGFuaW1hdGlvbjogcHVsc2F0ZS1md2QgMC41cyBlYXNlLWluLW91dCBpbmZpbml0ZSBib3RoO1xuICBvdXRsaW5lOiBub25lO1xufVxuXG5Aa2V5ZnJhbWVzIHB1bHNhdGUtZndkIHtcbiAgMCUge1xuICAgIHRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbiAgNTAlIHtcbiAgICB0cmFuc2Zvcm06IHNjYWxlKDEuNSk7XG4gIH1cbiAgMTAwJSB7XG4gICAgdHJhbnNmb3JtOiBzY2FsZSgxKTtcbiAgfVxufVxuIl19 */"]
});

/***/ }),

/***/ 37763:
/*!**************************************************!*\
  !*** ./src/app/shared/services/focus.service.ts ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FocusService": () => (/* binding */ FocusService)
/* harmony export */ });
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/router */ 61380);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 59151);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_1__);




class FocusService {
    constructor(router) {
        this.router = router;
    }
    focusInRouterNavigate() {
        this.router.events.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.filter)(event => event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_0__.NavigationEnd)).subscribe(() => {
            const mainHeader = document.querySelector('#focusHeader');
            if (mainHeader) {
                mainHeader?.focus();
            }
        });
    }
    /**
     *
     * @param selector ID preference selector exemple: this.applyFocusQuerySelector('myselectorid', 300)
     * not necessary # .
     * @param time
     */
    applyFocusQuerySelector(selector, time) {
        setTimeout(() => {
            const nextTag = document.querySelector(`#${selector}`);
            nextTag?.focus();
        }, time);
    }
}
FocusService.ɵfac = function FocusService_Factory(t) { return new (t || FocusService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_0__.Router)); };
FocusService.ɵprov = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: FocusService, factory: FocusService.ɵfac, providedIn: 'root' });


/***/ })

}])
//# sourceMappingURL=6957.js.map