import { __assign, __decorate } from "tslib";
import { Component, Input } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { ActivatedRoute } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { FieldType, FormField } from "@seniorsistemas/angular-components";
import { Subject } from "rxjs";
import { map, takeUntil } from "rxjs/operators";
import { EmployeeDependentService } from "../../../../../core/entities/employee-dependent-core/employee-dependent-core.service";
import { StateService } from "../../../../../core/entities/state/state.service";
import { CivilCertificateType } from "../../../../../core/enums/civil-certificate-type";
import { configEnabledFields, createFilterString } from "../../../../utils/helpers";
import { isValidFilter } from "../../../../../shared/utils/utils";
var EmployeeDependentDocumentTabComponent = /** @class */ (function () {
    function EmployeeDependentDocumentTabComponent(translate, route, service, stateService) {
        var _this = this;
        this.translate = translate;
        this.route = route;
        this.service = service;
        this.stateService = stateService;
        this.stateLookupDisplayFields = ["code", "name"];
        this.stateLookupSeparator = " - ";
        this.civilCertificateType = Object.keys(CivilCertificateType)
            .map(function (item) {
            return {
                label: _this.translate.instant("hcm_contract.employment_contract.employee_dependent_civil_certificate_type_" + item),
                value: item,
            };
        });
        this.ngUnsubscribe = new Subject();
        this.createFormGroup();
        this.route.data
            .pipe(takeUntil(this.ngUnsubscribe))
            .subscribe(function (data) { return _this.onRouteDataChange(data); });
    }
    EmployeeDependentDocumentTabComponent.prototype.ngOnInit = function () {
        this.subscribeEvents();
        this.parentFormGroup.addControl("documentDependentPersonData", this.formGroup);
        this.stateSearchFields = this.getStateSearchFields();
        this.stateSearchGridFields = this.getStateSearchFields();
    };
    EmployeeDependentDocumentTabComponent.prototype.onRouteDataChange = function (data) {
        this.localeConfig = data.localeConfig;
    };
    EmployeeDependentDocumentTabComponent.prototype.subscribeEvents = function () {
        var _this = this;
        this.service.getDependentFormData()
            .pipe(takeUntil(this.ngUnsubscribe))
            .subscribe(function (data) {
            var _a;
            _this.formGroup.patchValue((_a = data === null || data === void 0 ? void 0 : data.personDependentData) === null || _a === void 0 ? void 0 : _a.documentDependentPersonData);
            if (!_this.dependentId) {
                _this.enableTogglesWhenExistsData();
            }
            else {
                _this.enableTogglesWhenExistsData();
            }
        });
        this.service.getOpenSideBarAndStartForm()
            .subscribe(function (data) {
            _this.dependentId = data === null || data === void 0 ? void 0 : data.dependentId;
            Object.keys(_this.formGroupToggle.controls).forEach(function (control) {
                _this.formGroupToggle.get(control).setValue(false);
                _this.disableFieldsByDocument(control, false);
                _this.formGroupToggle.get(control).enable();
            });
        });
    };
    EmployeeDependentDocumentTabComponent.prototype.enableTogglesWhenExistsData = function () {
        var documentDependentPersonData = this.formGroup.getRawValue();
        if (documentDependentPersonData === null || documentDependentPersonData === void 0 ? void 0 : documentDependentPersonData.civilCertificateRegisterNumber) {
            var toggleControl = this.formGroupToggle.get("toggleCivilCertificate");
            toggleControl.setValue(true);
            this.disableFieldsByDocument("toggleCivilCertificate");
        }
        if (documentDependentPersonData === null || documentDependentPersonData === void 0 ? void 0 : documentDependentPersonData.rgNumber) {
            var toggleRgControl = this.formGroupToggle.get("toggleRg");
            toggleRgControl.setValue(true);
            this.disableFieldsByDocument("toggleRg");
        }
        if (documentDependentPersonData === null || documentDependentPersonData === void 0 ? void 0 : documentDependentPersonData.deathCertificateRegisterNumber) {
            var toggleDeathControl = this.formGroupToggle.get("toggleDeath");
            toggleDeathControl.setValue(true);
            this.disableFieldsByDocument("toggleDeath");
        }
    };
    EmployeeDependentDocumentTabComponent.prototype.createFormGroup = function () {
        this.formGroupToggle = new FormGroup({
            toggleRg: new FormControl(null),
            toggleCivilCertificate: new FormControl(null),
            toggleDeath: new FormControl(null),
        });
        this.formGroup = new FormGroup({
            rgNumber: new FormControl({ value: null, disabled: true }, Validators.maxLength(13)),
            rgIssuer: new FormControl({ value: null, disabled: true }, Validators.maxLength(6)),
            rgIssuerStateId: new FormControl({ value: null, disabled: true }),
            rgIssueDate: new FormControl({ value: null, disabled: true }),
            civilCertificateType: new FormControl({ value: null, disabled: true }),
            civilCertificateIssueDate: new FormControl({ value: null, disabled: true }),
            civilCertificateRegisterNumber: new FormControl({ value: null, disabled: true }, Validators.maxLength(255)),
            civilCertificateTerm: new FormControl({ value: null, disabled: true }, Validators.maxLength(255)),
            civilCertificateBook: new FormControl({ value: null, disabled: true }, Validators.maxLength(255)),
            civilCertificatePage: new FormControl({ value: null, disabled: true }, Validators.maxLength(255)),
            civilCertificateNotaryOffice: new FormControl({ value: null, disabled: true }, Validators.maxLength(255)),
            civilCertificateStateId: new FormControl({ value: null, disabled: true }),
            deathCertificateIssueDate: new FormControl({ value: null, disabled: true }),
            deathCertificateRegisterNumber: new FormControl({ value: null, disabled: true }, Validators.maxLength(40)),
            deathCertificateNumber: new FormControl({ value: null, disabled: true }, Validators.maxLength(10)),
        });
    };
    Object.defineProperty(EmployeeDependentDocumentTabComponent.prototype, "getDisableRg", {
        get: function () {
            return !this.formGroupToggle.get("toggleRg").value;
        },
        enumerable: true,
        configurable: true
    });
    EmployeeDependentDocumentTabComponent.prototype.getProp = function (obj, path) {
        return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
    };
    EmployeeDependentDocumentTabComponent.prototype.onStateLookupRequest = function (value) {
        var _this = this;
        var sort = this.stateLookupDisplayFields.map(function (field) { return ({ field: field, order: 1 }); });
        var filterQuery = this.getStateSearchFields()
            .filter(function (_a) {
            var type = _a.type;
            return isValidFilter(type, value);
        })
            .map(function (formField) { return createFilterString(formField, value, { textSeachEnum: true }); })
            .filter(function (s) { return !!s; })
            .join(" or ");
        var displayFields = this.stateLookupDisplayFields;
        this.stateService
            .list({ sort: sort, filterQuery: filterQuery, displayFields: displayFields })
            .pipe(takeUntil(this.ngUnsubscribe))
            .pipe(map(function (list) { return (__assign(__assign({}, list), { contents: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.stateLookupDisplayFields
                    .map(function (field) {
                    if (field.indexOf(".") > 0) {
                        item[field] = _this.getProp(item, field);
                    }
                    return item[field];
                })
                    .join(_this.stateLookupSeparator) })); }) })); }))
            .subscribe(function (list) {
            _this.stateLookupSuggestions = list.contents;
        });
    };
    EmployeeDependentDocumentTabComponent.prototype.onStateSearchRequest = function (event) {
        var _this = this;
        var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
        var page = first / rows;
        var sort = multiSortMeta;
        var filterQuery = this.getStateSearchFields()
            .filter(function (_a) {
            var name = _a.name;
            return !!filterData[name] && filterData[name] !== "";
        })
            .map(function (_a) {
            var name = _a.name, type = _a.type;
            var value = filterData[name];
            if (typeof value === "number") {
                return name + " eq " + value;
            }
            else if (type === FieldType.Enum) {
                return name + " eq '" + value + "'";
            }
            else if (type === FieldType.String) {
                return "containing(upper(" + name + "), upper('" + value.replace(/'/g, "\\'") + "'))";
            }
            else {
                return name + " eq '" + value + "'";
            }
        })
            .join(" and ");
        var displayFields = this.stateLookupDisplayFields;
        this.stateService
            .list({ page: page, sort: sort, filterQuery: filterQuery, displayFields: displayFields })
            .pipe(takeUntil(this.ngUnsubscribe))
            .pipe(map(function (list) { return (__assign(__assign({}, list), { contents: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.stateLookupDisplayFields
                    .map(function (field) {
                    if (field.indexOf(".") > 0) {
                        item[field] = _this.getProp(item, field);
                    }
                    return item[field];
                })
                    .join(_this.stateLookupSeparator) })); }) })); }))
            .subscribe(function (list) {
            _this.stateSearchGridData = list.contents;
            _this.stateSearchTotalRecords = list.totalElements;
        });
    };
    EmployeeDependentDocumentTabComponent.prototype.getStateSearchFields = function () {
        return [
            new FormField({
                name: "code",
                label: this.translate.instant("hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_code_description"),
                type: FieldType.Integer,
            }),
            new FormField({
                name: "name",
                label: this.translate.instant("hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_name_description"),
                type: FieldType.String,
            }),
        ];
    };
    EmployeeDependentDocumentTabComponent.prototype.disableFieldsByDocument = function (documentType, customCondition) {
        switch (documentType) {
            case "toggleRg": {
                var enableFields = customCondition ? customCondition : this.formGroupToggle.get("toggleRg").value;
                configEnabledFields(this.formGroup, enableFields, ["rgNumber", "rgIssuer", "rgIssuerStateId", "rgIssueDate"]);
                break;
            }
            case "toggleCivilCertificate": {
                var enableFields = customCondition ? customCondition : this.formGroupToggle.get("toggleCivilCertificate").value;
                configEnabledFields(this.formGroup, enableFields, [
                    "civilCertificateType",
                    "civilCertificateIssueDate",
                    "civilCertificateRegisterNumber",
                    "civilCertificateTerm",
                    "civilCertificateBook",
                    "civilCertificatePage",
                    "civilCertificateNotaryOffice",
                    "civilCertificateStateId",
                ]);
                break;
            }
            case "toggleDeath": {
                var enableFields = customCondition ? customCondition : this.formGroupToggle.get("toggleDeath").value;
                configEnabledFields(this.formGroup, enableFields, ["deathCertificateIssueDate", "deathCertificateRegisterNumber", "deathCertificateNumber"]);
                break;
            }
        }
    };
    EmployeeDependentDocumentTabComponent.ctorParameters = function () { return [
        { type: TranslateService },
        { type: ActivatedRoute },
        { type: EmployeeDependentService },
        { type: StateService }
    ]; };
    __decorate([
        Input()
    ], EmployeeDependentDocumentTabComponent.prototype, "parentFormGroup", void 0);
    EmployeeDependentDocumentTabComponent = __decorate([
        Component({
            selector: "fnd-employee-dependent-document-tab",
            template: "<div class=\"ui-fluid\" [formGroup]=\"formGroup\">\n    <p-fieldset>\n        <p-header class=\"toggle-header-fieldset\" [formGroup]=\"formGroupToggle\">\n            {{ 'hcm_contract.employment_contract.employee_dependent_document_rg_title' | translate }}\n            <div class=\"ui-inputgroup\">\n                <div class=\"input-switch-padding\"></div>\n                <span *ngIf=\"formGroupToggle.get('toggleRg').value\">\n                    {{ 'hcm_contract.employment_contract.yes' | translate }}\n                </span>\n                <span\n                    *ngIf=\"!formGroupToggle.get('toggleRg').value\">{{ 'hcm_contract.employment_contract.no' | translate }}</span>\n                <p-inputSwitch  id=\"toggleRg\" formControlName=\"toggleRg\" (onChange)=\"disableFieldsByDocument('toggleRg')\"></p-inputSwitch>\n            </div>\n        </p-header>\n        <div class=\"ui-g\">\n            <div id=\"dv-rg-number\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-rg-number\" for=\"ff-rg-number\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_number' | translate\n                    }}</label>\n\n                <input id=\"ff-rg-number\" type=\"text\" pInputText formControlName=\"rgNumber\" autocomplete=\"off\"/>\n\n                <s-control-errors\n                    id=\"er-rg-number\"\n                    [control]=\"formGroup.get('rgNumber')\"\n                    [errorMessages]=\"{\n                maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n                value: formGroup.get('rgNumber').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- \u00D3rg\u00E3o emissor -->\n            <div id=\"dv-rg-issuer\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-rg-issuer\" for=\"ff-rg-issuer\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer' | translate\n                    }}</label>\n\n                <input id=\"ff-rg-issuer\" type=\"text\" pInputText formControlName=\"rgIssuer\" autocomplete=\"off\"/>\n\n                <s-control-errors\n                    id=\"er-rg-issuer\"\n                    [control]=\"formGroup.get('rgIssuer')\"\n                    [errorMessages]=\"{\n      maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n        value: formGroup.get('rgIssuer').errors?.maxlength?.requiredLength\n      })\n    }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- Estado emissor -->\n            <div id=\"dv-rg-issuer-state-id\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-rg-issuer-state-id\" for=\"ff-rg-issuer-state-id\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id'\n                            | translate\n                    }}\n                </label>\n                <s-lookup dataKey=\"id\" id=\"ff-rg-issuer-state-id\" name=\"rgIssuerStateId\"\n                          formControlName=\"rgIssuerStateId\"\n                          [searchFields]=\"stateSearchFields\" [searchGridFields]=\"stateSearchFields\"\n                          [searchGridData]=\"stateSearchGridData\" [multiple]=\"false\"\n                          [lookupSuggestions]=\"stateLookupSuggestions\"\n                          (onLookupRequest)=\"onStateLookupRequest($event)\"\n                          (onSearchRequest)=\"onStateSearchRequest($event)\"\n                          lookupDisplayField=\"label\"\n                          [lookupEmptyMessage]=\"'hcm_contract.employment_contract.admission_generic_lookup_empty_message' | translate\"\n                          [searchTotalRecords]=\"stateSearchTotalRecords\"\n                          [searchTitle]=\"'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id_lookup_tittle' | translate\"\n                          [searchEmptyTitle]=\"'hcm_contract.employment_contract.admission_generic_lookup_empty_message' | translate\"\n                          [filterLabel]=\"'hcm_contract.employment_contract.admission_generic_filter_label' | translate\"\n                          [filterTitle]=\"'hcm_contract.employment_contract.admission_generic_filter_title' | translate\"\n                          [clearLabel]=\"'hcm_contract.employment_contract.admission_generic_clear_label' | translate\"\n                          [cancelLabel]=\"'hcm_contract.employment_contract.admission_generic_btn_cancel_label' | translate\"\n                          [selectLabel]=\"'hcm_contract.employment_contract.admission_generic_select' | translate\"\n                          [searchTotalRecordsLabel]=\"'hcm_contract.employment_contract.total_records' | translate: {value: stateSearchTotalRecords}\"\n                          [emptyFieldLabel]=\"'hcm_contract.employment_contract.admission_generic_empty_field' | translate\">\n                </s-lookup>\n            </div>\n\n            <!-- Data de emiss\u00E3o -->\n            <div id=\"dv-rg-issue-date\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-rg-issue-date\" for=\"ff-rg-issue-date\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issue_date' | translate\n                    }}</label>\n\n                <p-calendar\n                    id=\"ff-rg-issue-date\"\n                    name=\"rgIssueDate\"\n                    formControlName=\"rgIssueDate\"\n                    [dateFormat]=\"localeConfig?.calendar?.dateFormat\"\n                    [locale]=\"localeConfig?.calendar\"\n                    [showIcon]=\"true\"\n                    icon=\"fa fa-calendar\"\n                    sCalendarMask\n                ></p-calendar>\n            </div>\n        </div>\n    </p-fieldset>\n    <p-fieldset>\n        <p-header class=\"toggle-header-fieldset\" [formGroup]=\"formGroupToggle\">\n            {{ 'hcm_contract.employment_contract.employee_dependent_document_civil_certificate_title' | translate }}\n            <div class=\"ui-inputgroup\">\n                <div class=\"input-switch-padding\"></div>\n                <span\n                    *ngIf=\"formGroupToggle.get('toggleCivilCertificate').value\">{{ 'hcm_contract.employment_contract.yes' | translate }}</span>\n                <span\n                    *ngIf=\"!formGroupToggle.get('toggleCivilCertificate').value\">{{ 'hcm_contract.employment_contract.no' | translate }}</span>\n                <p-inputSwitch  id=\"toggleCivilCertificate\" formControlName=\"toggleCivilCertificate\" (onChange)=\"disableFieldsByDocument('toggleCivilCertificate')\"></p-inputSwitch>\n            </div>\n        </p-header>\n        <div class=\"ui-g\">\n\n             <!-- Tipo de certificado civil -->\n             <div id=\"dv-civil-certificate-type\" class=\"ui-sm-12 ui-md-6 ui-lg-6\">\n                <label id=\"lb-civil-certificate-type\" for=\"ff-civilCertificateType\">{{\n                        'hcm_contract.employment_contract.employee_dependent_civil_certificate_type_placeholder'\n                        | translate\n                    }}</label>\n                <p-dropdown inputId=\"civilCertificateType\" id=\"ff-civilCertificateType\" name=\"maritalStatusType\"\n                            [options]=\"civilCertificateType\"\n                            formControlName=\"civilCertificateType\"\n                            placeholder=\"{{'hcm_contract.employment_contract.employee_dependent_civil_certificate_type_placeholder' | translate}}\">\n                </p-dropdown>\n            </div>\n            \n            <!-- Data de emiss\u00E3o da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-issue-date\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-issue-date\" for=\"ff-civil-certificate-issue-date\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_issue_date' | translate\n                    }}</label>\n                <p-calendar\n                    id=\"ff-civil-certificate-issue-date\"\n                    name=\"civilCertificateIssueDate\"\n                    formControlName=\"civilCertificateIssueDate\"\n                    [dateFormat]=\"localeConfig?.calendar.dateFormat\"\n                    [locale]=\"localeConfig?.calendar\"\n                    [showIcon]=\"true\"\n                    icon=\"fa fa-calendar\"\n                    sCalendarMask\n                ></p-calendar>\n            </div>\n\n            <!-- Matr\u00EDcula da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-register-number\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-register-number\" for=\"ff-civil-certificate-register-number\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_register_number'\n                            | translate\n                    }}</label>\n                <input\n                    id=\"ff-civil-certificate-register-number\"\n                    type=\"text\"\n                    pInputText\n                    formControlName=\"civilCertificateRegisterNumber\"\n                    autocomplete=\"off\"\n                />\n                <s-control-errors\n                    id=\"er-civil-certificate-register-number\"\n                    [control]=\"formGroup.get('civilCertificateRegisterNumber')\"\n                    [errorMessages]=\"{\n        maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n          value: formGroup.get('civilCertificateRegisterNumber').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- Termo da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-term\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-term\" for=\"ff-civil-certificate-term\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_term' | translate\n                    }}</label>\n                <input id=\"ff-civil-certificate-term\" type=\"text\" pInputText formControlName=\"civilCertificateTerm\"\n                       autocomplete=\"off\"/>\n                <s-control-errors\n                    id=\"er-civil-certificate-term\"\n                    [control]=\"formGroup.get('civilCertificateTerm')\"\n                    [errorMessages]=\"{\n        maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n          value: formGroup.get('civilCertificateTerm').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- Livro da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-book\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-book\" for=\"ff-civil-certificate-book\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_book' | translate\n                    }}</label>\n                <input id=\"ff-civil-certificate-book\" type=\"text\" pInputText formControlName=\"civilCertificateBook\"\n                       autocomplete=\"off\"/>\n                <s-control-errors\n                    id=\"er-civil-certificate-book\"\n                    [control]=\"formGroup.get('civilCertificateBook')\"\n                    [errorMessages]=\"{\n        maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n          value: formGroup.get('civilCertificateBook').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- Folha da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-page\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-page\" for=\"ff-civil-certificate-page\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_page' | translate\n                    }}</label>\n                <input id=\"ff-civil-certificate-page\" type=\"text\" pInputText formControlName=\"civilCertificatePage\"\n                       autocomplete=\"off\"/>\n                <s-control-errors\n                    id=\"er-civil-certificate-page\"\n                    [control]=\"formGroup.get('civilCertificatePage')\"\n                    [errorMessages]=\"{\n        maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n          value: formGroup.get('civilCertificatePage').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- Cart\u00F3rio da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-notary-office\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-notary-office\" for=\"ff-civil-certificate-notary-office\">{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_notary_office' | translate\n                    }}</label>\n                <input\n                    id=\"ff-civil-certificate-notary-office\"\n                    type=\"text\"\n                    pInputText\n                    formControlName=\"civilCertificateNotaryOffice\"\n                    autocomplete=\"off\"\n                />\n                <s-control-errors\n                    id=\"er-civil-certificate-notary-office\"\n                    [control]=\"formGroup.get('civilCertificateNotaryOffice')\"\n                    [errorMessages]=\"{\n        maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n          value: formGroup.get('civilCertificateNotaryOffice').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n\n            <!-- Estado de emiss\u00E3o da certid\u00E3o nascimento -->\n            <div id=\"dv-civil-certificate-state-id\" class=\"ui-sm-12 ui-md-4\">\n                <label id=\"lb-civil-certificate-state-id\" for=\"ff-civil-certificate-state-id\"\n                >{{\n                        'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_state_id' | translate\n                    }}\n                </label>\n\n                <s-lookup dataKey=\"id\" id=\"ff-civil-certificate-state-id\" name=\"civilCertificateStateId\"\n                          formControlName=\"civilCertificateStateId\"\n                          [searchFields]=\"stateSearchFields\" [searchGridFields]=\"stateSearchFields\"\n                          [searchGridData]=\"stateSearchGridData\" [multiple]=\"false\"\n                          [lookupSuggestions]=\"stateLookupSuggestions\"\n                          (onLookupRequest)=\"onStateLookupRequest($event)\"\n                          (onSearchRequest)=\"onStateSearchRequest($event)\"\n                          lookupDisplayField=\"label\"\n                          [lookupEmptyMessage]=\"'hcm_contract.employment_contract.admission_generic_lookup_empty_message' | translate\"\n                          [searchTotalRecords]=\"stateSearchTotalRecords\"\n                          [searchTitle]=\"'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id_lookup_tittle' | translate\"\n                          [searchEmptyTitle]=\"'hcm_contract.employment_contract.admission_generic_lookup_empty_message' | translate\"\n                          [filterLabel]=\"'hcm_contract.employment_contract.admission_generic_filter_label' | translate\"\n                          [filterTitle]=\"'hcm_contract.employment_contract.admission_generic_filter_title' | translate\"\n                          [clearLabel]=\"'hcm_contract.employment_contract.admission_generic_clear_label' | translate\"\n                          [cancelLabel]=\"'hcm_contract.employment_contract.admission_generic_btn_cancel_label' | translate\"\n                          [selectLabel]=\"'hcm_contract.employment_contract.admission_generic_select' | translate\"\n                          [searchTotalRecordsLabel]=\"'hcm_contract.employment_contract.total_records' | translate: {value: stateSearchTotalRecords}\"\n                          [emptyFieldLabel]=\"'hcm_contract.employment_contract.admission_generic_empty_field' | translate\">\n                </s-lookup>\n            </div>\n        </div>\n    </p-fieldset>\n    <p-fieldset>\n        <p-header class=\"toggle-header-fieldset\" [formGroup]=\"formGroupToggle\">\n            {{ 'hcm_contract.employment_contract.employee_dependent_document_certificate_death_title' | translate }}\n            <div class=\"ui-inputgroup\">\n                <div class=\"input-switch-padding\"></div>\n                <span\n                    *ngIf=\"formGroupToggle.get('toggleDeath').value\">{{ 'hcm_contract.employment_contract.yes' | translate }}</span>\n                <span\n                    *ngIf=\"!formGroupToggle.get('toggleDeath').value\">{{ 'hcm_contract.employment_contract.no' | translate }}</span>\n                <p-inputSwitch\n                    id=\"toggleDeath\"\n                    formControlName=\"toggleDeath\"\n                    (onChange)=\"disableFieldsByDocument('toggleDeath')\">\n                </p-inputSwitch>\n            </div>\n        </p-header>\n        <div class=\"ui-g\">\n            <!--- Data da certid\u00E3o de \u00F3bito-->\n            <div class=\"ui-md-4 ui-sm-12\">\n                <label id=\"lb-death-date\"\n                       for=\"ff-death-date\">{{ 'hcm_contract.employment_contract.employee_dependent_death_date' | translate }}</label>\n                <p-calendar\n                    id=\"ff-death-date\"\n                    name=\"deathCertificateIssueDate\"\n                    formControlName=\"deathCertificateIssueDate\"\n                    [dateFormat]=\"localeConfig?.calendar.dateFormat\"\n                    [locale]=\"localeConfig?.calendar\"\n                    [showIcon]=\"true\"\n                    icon=\"fa fa-calendar\"\n                    sCalendarMask\n                ></p-calendar>\n            </div>\n            <!--- Matricula da certid\u00E3o de \u00F3bito-->\n            <div class=\"ui-md-4 ui-sm-12\">\n                <label id=\"lb-death-certificate-registry\"\n                       for=\"ff-death-certificate-registry\">{{ 'hcm_contract.employment_contract.employee_dependent_death_certificate_register' | translate }}</label>\n                <input pInputText id=\"ff-death-certificate-registry\" formControlName=\"deathCertificateRegisterNumber\">\n                <s-control-errors\n                    id=\"er-death-certificate-registry\"\n                    [control]=\"formGroup.get('deathCertificateRegisterNumber')\"\n                    [errorMessages]=\"{\n                maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n                value: formGroup.get('deathCertificateRegisterNumber').errors?.maxlength?.requiredLength\n        })\n      }\"\n                ></s-control-errors>\n            </div>\n            <!--N\u00BA certid\u00E3o de \u00F3bito-->\n            <div class=\"ui-md-4 ui-sm-12\">\n                <label id=\"lb-death-certificate-number\"\n                       for=\"ff-death-certificate-registry\">{{ 'hcm_contract.employment_contract.employee_dependent_death_certificate_number' | translate }}</label>\n                <input pInputText id=\"ff-death-certificate-number\" formControlName=\"deathCertificateNumber\">\n                <s-control-errors\n                    id=\"er-death-certificate-number\"\n                    [control]=\"formGroup.get('deathCertificateNumber')\"\n                    [errorMessages]=\"{\n                        maxlength: translate.instant('hcm_contract.employment_contract.admission_generic_field_validator_max_length', {\n                        value: formGroup.get('deathCertificateNumber').errors?.maxlength?.requiredLength})\n                  }\"\n                ></s-control-errors>\n            </div>\n        </div>\n    </p-fieldset>\n</div>\n",
            styles: [".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]
        })
    ], EmployeeDependentDocumentTabComponent);
    return EmployeeDependentDocumentTabComponent;
}());
export { EmployeeDependentDocumentTabComponent };
//# sourceMappingURL=data:application/json;base64, 