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

/***/ 4322:
/*!**********************************************************************!*\
  !*** ./src/app/register/foreign-document/foreign-document.module.ts ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ForeignDocumentPageModule": () => (/* binding */ ForeignDocumentPageModule)
/* harmony export */ });
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common */ 90944);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_common__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ 2508);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ 61380);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic/angular */ 93819);
/* harmony import */ var _foreign_document_page__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foreign-document.page */ 89632);
/* harmony import */ var _shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared-module/shared-module.module */ 69270);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_4__);








const routes = [
    {
        path: '',
        component: _foreign_document_page__WEBPACK_IMPORTED_MODULE_2__.ForeignDocumentPage
    }
];
class ForeignDocumentPageModule {
}
ForeignDocumentPageModule.ɵfac = function ForeignDocumentPageModule_Factory(t) { return new (t || ForeignDocumentPageModule)(); };
ForeignDocumentPageModule.ɵmod = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineNgModule"]({ type: ForeignDocumentPageModule });
ForeignDocumentPageModule.ɵinj = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjector"]({ imports: [_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_3__.SharedModuleModule,
        _angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormsModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.ReactiveFormsModule,
        _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.IonicModule,
        _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterModule.forChild(routes)] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵsetNgModuleScope"](ForeignDocumentPageModule, { declarations: [_foreign_document_page__WEBPACK_IMPORTED_MODULE_2__.ForeignDocumentPage], imports: [_shared_module_shared_module_module__WEBPACK_IMPORTED_MODULE_3__.SharedModuleModule,
        _angular_common__WEBPACK_IMPORTED_MODULE_0__.CommonModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormsModule,
        _angular_forms__WEBPACK_IMPORTED_MODULE_5__.ReactiveFormsModule,
        _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.IonicModule, _angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterModule] }); })();


/***/ }),

/***/ 89632:
/*!********************************************************************!*\
  !*** ./src/app/register/foreign-document/foreign-document.page.ts ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ForeignDocumentPage": () => (/* binding */ ForeignDocumentPage)
/* harmony export */ });
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 83910);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/forms */ 2508);
/* harmony import */ var _shared_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @shared/services */ 17253);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ 61380);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_angular_router__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _shared_services_focus_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @shared/services/focus.service */ 37763);
/* harmony import */ var _shared_services_init_register_has_company_storage_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @shared/services/init.register.has-company.storage.service */ 91056);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 90944);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_angular_common__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ionic/angular */ 93819);
/* harmony import */ var _shared_components_full_logo_full_logo_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/components/full-logo/full-logo.component */ 33159);
/* harmony import */ var _shared_directives__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @shared/directives */ 94221);
/* harmony import */ var _ngx_translate_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ngx-translate/core */ 38699);












const _c0 = function (a0) { return { "min-height": a0, "position": "relative" }; };
class ForeignDocumentPage {
    constructor(formBuilder, api, notificatorService, activatedRoute, loadingService, keyboardService, deviceInfoService, navigationService, logService, translateConfigService, focusService, utilsService, showToastModalErroCodeZero, initRegisterHasCompanyStorageService) {
        this.formBuilder = formBuilder;
        this.api = api;
        this.notificatorService = notificatorService;
        this.activatedRoute = activatedRoute;
        this.loadingService = loadingService;
        this.keyboardService = keyboardService;
        this.deviceInfoService = deviceInfoService;
        this.navigationService = navigationService;
        this.logService = logService;
        this.translateConfigService = translateConfigService;
        this.focusService = focusService;
        this.utilsService = utilsService;
        this.showToastModalErroCodeZero = showToastModalErroCodeZero;
        this.initRegisterHasCompanyStorageService = initRegisterHasCompanyStorageService;
        this.onSubmit = () => {
            const document = this.clearInput(this.foreignDocumentForm.controls.document.value);
            const validationResult = this.validateInput(document);
            const documentUppercase = this.utilsService.convertToUppercase(document);
            if (!validationResult) {
                this.logService.logError('user::register-document');
                const notification = {
                    title: this.translateConfigService.translate('PG_IDENTIFY_FOREIGN_TOAST_INVALID_DATA_TITLE'),
                    message: this.translateConfigService.translate('PG_IDENTIFY_FOREIGN_TOAST_INVALID_DATA_MESSAGE'),
                    type: 'error'
                };
                this.notificatorService.notify(notification);
            }
            else {
                let onHideSubscription = null;
                const data = documentUppercase.replace(/[^\w]/g, '');
                const onKeyboardHideCallback = () => {
                    if (onHideSubscription) {
                        onHideSubscription.unsubscribe();
                    }
                    this.loadingService.show(this.translateConfigService.translate('LOADING_PROCESSING_DATA'), 'identity-validator-document');
                    const isValidCpf = this.validateCpfType(data);
                    if (isValidCpf) {
                        const cleanedDocument = this.utilsService.cleanedInput(data);
                        this.initRegisterHasCompanyStorageService.set({
                            document: cleanedDocument,
                            context: this.context
                        });
                        this.verifyDocument(cleanedDocument);
                    }
                    else {
                        this.initRegisterHasCompanyStorageService.set({
                            document: documentUppercase,
                            context: this.context,
                            foreign: 'true'
                        });
                        this.api.verifyForeignDocument(documentUppercase).subscribe(response => {
                            this.onSubmitSuccessResponse(response, true);
                        }, error => this.onSubmitErrorResponse(error, true));
                    }
                };
                onHideSubscription = this.keyboardService.onHideObservable?.subscribe(onKeyboardHideCallback);
                if (!this.keyboardService.isVisible()) {
                    onKeyboardHideCallback();
                }
                else {
                    this.keyboardService.hide();
                }
            }
        };
        this.clearInput = data => data.trim();
        this.onSubmitSuccessResponse = (response, isforeign) => {
            //  Quando é estrangeiro o RESPONSE retorna somente true.
            if (!response && !isforeign) {
                this.loadingService.hide(null, 'identity-validator-document').then(() => {
                    this.goToNextStep(isforeign);
                });
                return;
            }
            else {
                isforeign = true;
                this.loadingService.hide(null, 'identity-validator-document').then(() => {
                    this.goToNextStep(isforeign);
                });
            }
        };
        this.onSubmitErrorResponse = (response, isforeigin) => {
            console.log('onSubmitErrorResponse:', JSON.stringify(response));
            this.logService.logError('http::register-document', `${response?.error?.detail ?? ''}`, JSON.stringify(response));
            this.loadingService.hide(null, 'identity-validator-document').then(() => {
                if (response?.status === 0) {
                    this.logService.logError('http::register-document', 'Unknown error', response);
                    this.showToastModalErroCodeZero.showToast();
                    return;
                }
                if (response.status === 400) {
                    this.logService.logError('http::register-document');
                    const notification = {
                        title: this.translateConfigService.translate('PG_IDENTIFY_FOREIGN_TOAST_ERROR_REQUEST_TITLE'),
                        message: `${this.translateConfigService.translate('PG_IDENTIFY_FOREIGN_TOAST_ERROR_REQUEST_MESSAGE')} (cod. 400)`,
                        type: 'error'
                    };
                    this.notificatorService.notify(notification);
                }
                else if (response.status === 404) {
                    this.goToNextStep(isforeigin);
                }
                else {
                    const { title, message } = this.getTitleAndMessage(response);
                    this.toastNotificationError(title, message, response?.status === 0 ? 10000 : 5000);
                }
            });
        };
        this.goToNextStep = (isforeign) => {
            const context = this.context;
            const foreign = isforeign;
            const docInputValue = this.foreignDocumentForm.controls.document.value;
            const document = foreign
                ? this.clearInput(docInputValue)
                : this.utilsService.cleanedInput(docInputValue);
            const documentUppercase = this.utilsService.convertToUppercase(document);
            const navigationOptions = {
                queryParams: {
                    context,
                    document: documentUppercase,
                    foreign
                }
            };
            this.navigationService.forward(['/identity-validator-full-name'], navigationOptions);
        };
        this.goOneStepBack = () => {
            this.navigationService.back(['/identity-validator']);
        };
        this.validateCpfType = documentCpf => {
            const cpf = documentCpf.replace(/[^\w]/g, '');
            if (cpf.toString().length !== 11 || /^(\d)\1{10}$/.test(cpf)) {
                return false;
            }
            let result = true;
            [9, 10].forEach(j => {
                let sum = 0;
                let remainder;
                cpf
                    .split(/(?=)/)
                    .splice(0, j)
                    .forEach((e, i) => {
                    sum += parseInt(e, 10) * (j + 2 - (i + 1));
                });
                remainder = sum % 11;
                remainder = remainder < 2 ? 0 : 11 - remainder;
                if (remainder !== parseInt(cpf.substring(j, j + 1), 10)) {
                    result = false;
                }
            });
            return result;
        };
        // this.activatedRoute.queryParams.subscribe(params => {
        //   this.context = params.context ? params.context : '';
        // });
    }
    ionViewWillEnter() {
        this.focusService.applyFocusQuerySelector('documentforeign', 100);
        const data = this.initRegisterHasCompanyStorageService.get();
        if (data) {
            console.log(data);
            this.context = data?.context;
        }
    }
    ngOnInit() {
        this.foreignDocumentForm = this.formBuilder.group({
            document: ['']
        });
    }
    validateInput(value) {
        const isValidCpf = this.validateCpfType(value);
        if (isValidCpf) {
            return true;
        }
        return this.validateDocumentLettersAndNumbers(value);
    }
    validateDocumentLettersAndNumbers(value) {
        const regex = new RegExp('^[A-Za-z0-9]{4,}$');
        return regex.test(value);
    }
    verifyDocument(document) {
        this.api
            .verifyDocument(document)
            .pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.take)(1))
            .subscribe(response => {
            this.onSubmitSuccessResponse(response, false);
        }, error => this.onSubmitErrorResponse(error, true));
    }
    getTitleAndMessage(response) {
        let title = '';
        let message = '';
        const codStatus = response?.status ? `(cod. ${response.status})` : '';
        const status = response?.status;
        title = this.translateConfigService.translate('PG_IDENTIFY_FOREIGN_TOAST_SERVICE_ERROR_TITLE');
        message = `${this.translateConfigService.translate('TOAST_SERVICE_TEMPORARILY_UNAVAILABLE_MESSAGE')}  ${codStatus}`;
        return { title, message };
    }
    toastNotificationError(title, message, timeout) {
        const notification = {
            title,
            message,
            type: 'error',
            timeout
        };
        this.notificatorService.notify(notification);
    }
}
ForeignDocumentPage.ɵfac = function ForeignDocumentPage_Factory(t) { return new (t || ForeignDocumentPage)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_9__.UntypedFormBuilder), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.ApiService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.NotificatorService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_router__WEBPACK_IMPORTED_MODULE_2__.ActivatedRoute), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.LoadingService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.KeyboardService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.DeviceInfoService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.NavigationService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.LogService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.TranslateConfigService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services_focus_service__WEBPACK_IMPORTED_MODULE_3__.FocusService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.UtilsService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services__WEBPACK_IMPORTED_MODULE_1__.ShowToastAndModalErroCodeZeroService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_shared_services_init_register_has_company_storage_service__WEBPACK_IMPORTED_MODULE_4__.InitRegisterHasCompanyStorageService)); };
ForeignDocumentPage.ɵcmp = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({ type: ForeignDocumentPage, selectors: [["app-foreign-document"]], decls: 24, vars: 16, consts: [[1, "ion-no-border", 2, "height", "0"], [3, "ngStyle"], ["tabindex", "-1", 1, "ion-margin-vertical"], [1, "flex-auto"], [1, "ion-margin-vertical"], [3, "formGroup", "ngSubmit"], [1, "input-holder"], ["for", "document"], ["id", "documentforeign", "tabindex", "1"], ["tabindex", "2", "id", "document", "appAutoFocus", "", "type", "text", "formControlName", "document", 3, "placeholder"], [1, "button-holder"], ["tabindex", "3", "type", "button", 1, "back", 3, "click"], ["role", "button", "type", "submit"], ["tabindex", "4"]], template: function ForeignDocumentPage_Template(rf, ctx) { if (rf & 1) {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "ion-header", 0);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "ion-content")(2, "ion-grid", 1)(3, "ion-row")(4, "ion-col", 2);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](5, "app-full-logo");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "ion-row", 3)(7, "ion-col", 4)(8, "form", 5);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("ngSubmit", function ForeignDocumentPage_Template_form_ngSubmit_8_listener() { return ctx.onSubmit(); });
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](9, "div", 6)(10, "ion-label", 7)(11, "span", 8);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](12);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](13, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](14, "input", 9);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](15, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](16, "div", 10)(17, "button", 11);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function ForeignDocumentPage_Template_button_click_17_listener() { return ctx.goOneStepBack(); });
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](18);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](19, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](20, "button", 12)(21, "span", 13);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](22);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](23, "translate");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()()()()()()()();
    } if (rf & 2) {
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngStyle", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](14, _c0, ctx.deviceInfoService.getDeviceHeight() + "px"));
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](6);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("formGroup", ctx.foreignDocumentForm);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](13, 6, "PG_IDENTIFY_FOREIGN_TEXT"), " ");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("placeholder", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](15, 8, "PG_IDENTIFY_FOREIGN_INPUT"));
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](19, 10, "BTN_BACK"), " ");
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
        _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](23, 12, "BTN_NEXT"), "");
    } }, dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.NgStyle, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonCol, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonContent, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonGrid, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonHeader, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonLabel, _ionic_angular__WEBPACK_IMPORTED_MODULE_10__.IonRow, _angular_forms__WEBPACK_IMPORTED_MODULE_9__["ɵNgNoValidate"], _angular_forms__WEBPACK_IMPORTED_MODULE_9__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_9__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_9__.NgControlStatusGroup, _angular_forms__WEBPACK_IMPORTED_MODULE_9__.FormGroupDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_9__.FormControlName, _shared_components_full_logo_full_logo_component__WEBPACK_IMPORTED_MODULE_6__.FullLogoComponent, _shared_directives__WEBPACK_IMPORTED_MODULE_7__.AutoFocusDirective, _ngx_translate_core__WEBPACK_IMPORTED_MODULE_11__.TranslatePipe], styles: ["ion-label[_ngcontent-%COMP%] {\n  color: #656768;\n  font-weight: 500;\n}\n\ninput[_ngcontent-%COMP%] {\n  text-transform: uppercase;\n}\n\n[_ngcontent-%COMP%]::-webkit-input-placeholder {\n  \n  text-transform: none;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvcmVpZ24tZG9jdW1lbnQucGFnZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsY0FBQTtFQUNBLGdCQUFBO0FBQ0Y7O0FBRUE7RUFDRSx5QkFBQTtBQUNGOztBQUNBO0VBQ0Usb0JBQUE7RUFDQSxvQkFBQTtBQUVGIiwiZmlsZSI6ImZvcmVpZ24tZG9jdW1lbnQucGFnZS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiaW9uLWxhYmVsIHtcbiAgY29sb3I6ICM2NTY3Njg7XG4gIGZvbnQtd2VpZ2h0OiA1MDA7XG59XG5cbmlucHV0IHtcbiAgdGV4dC10cmFuc2Zvcm06IHVwcGVyY2FzZTtcbn1cbjo6LXdlYmtpdC1pbnB1dC1wbGFjZWhvbGRlciB7XG4gIC8qIFdlYktpdCBicm93c2VycyAqL1xuICB0ZXh0LXRyYW5zZm9ybTogbm9uZTtcbn1cbiJdfQ== */"] });


/***/ }),

/***/ 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' });


/***/ }),

/***/ 91056:
/*!******************************************************************************!*\
  !*** ./src/app/shared/services/init.register.has-company.storage.service.ts ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "InitRegisterHasCompanyStorageService": () => (/* binding */ InitRegisterHasCompanyStorageService)
/* 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 _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__);
/* harmony import */ var _simple_storage_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./simple.storage.service */ 19725);



class InitRegisterHasCompanyStorageService {
  constructor(simpleStorageService) {
    this.simpleStorageService = simpleStorageService;
    this.KEY = 'REGISTER_HAS_COMPANY';
    this.cache = null; // Cache em memória opcional
  }

  set(data) {
    this.simpleStorageService.set(this.KEY, data);
    this.cache = data; // Atualiza o cache
  }

  get() {
    const data = this.simpleStorageService.get(this.KEY);
    this.cache = data; // Atualiza o cache

    return data;
  }

  remove() {
    var _this = 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* () {
      _this.simpleStorageService.remove(_this.KEY);

      _this.cache = null; // Limpa o cache
    })();
  }

}

InitRegisterHasCompanyStorageService.ɵfac = function InitRegisterHasCompanyStorageService_Factory(t) {
  return new (t || InitRegisterHasCompanyStorageService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_simple_storage_service__WEBPACK_IMPORTED_MODULE_2__.SimpleStorageService));
};

InitRegisterHasCompanyStorageService.ɵprov = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
  token: InitRegisterHasCompanyStorageService,
  factory: InitRegisterHasCompanyStorageService.ɵfac,
  providedIn: 'root'
});

/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "SimpleStorageService": () => (/* binding */ SimpleStorageService)
/* harmony export */ });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 45449);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_angular_core__WEBPACK_IMPORTED_MODULE_0__);

class SimpleStorageService {
    constructor() { }
    set(key, value) {
        localStorage.setItem(key, JSON.stringify(value));
    }
    get(key) {
        const item = JSON.parse(localStorage.getItem(key));
        return item ?? null;
    }
    remove(key) {
        localStorage.removeItem(key);
    }
    clear() {
        localStorage.clear();
    }
}
SimpleStorageService.ɵfac = function SimpleStorageService_Factory(t) { return new (t || SimpleStorageService)(); };
SimpleStorageService.ɵprov = /*@__PURE__*/ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: SimpleStorageService, factory: SimpleStorageService.ɵfac, providedIn: 'root' });


/***/ })

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