(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-obrigacoes-geracao-policia-federal-geracao-policia-federal-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.html":
/*!*************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.html ***!
  \*************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar\n        [sisFormularioId]=\"constantes.sisFormularioId\"\n        [botoesComando]=\"constantes.listaForm\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n    <div class=\"col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <div class=\"\">\n                <app-form-legenda></app-form-legenda>\n                <div class=\"card-body widget-body\">\n                    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\n                        <app-validacoes></app-validacoes>\n                        <div class=\"row\">\n                            <div class=\"col-lg-2\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"periodoDe\"\n                                           class=\"required\">{{\"labels.periodoDe\" | translate }}</label>\n                                    <app-data id=\"periodoDe\"\n                                              name=\"periodoDe\"\n                                              [(ngModel)]=\"data.dataI\"\n                                              autofocus\n                                              class=\"dataHora\"\n                                              required=\"true\"\n                                              (click)=\"checkTroca($event)\">\n                                    </app-data>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-2\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"ate\"\n                                           class=\"required\">{{\"labels.ate\" | translate}}</label>\n                                    <app-data id=\"ate\"\n                                              name=\"ate\"\n                                              [(ngModel)]=\"data.dataF\"\n                                              class=\"dataHora\"\n                                              [formatDateTime]=\"mascara.getFormatData\"\n                                              required=\"true\"\n                                              (click)=\"checkTroca($event)\">\n                                    </app-data>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-4\">\n                                <label for=\"localizacao\">{{\"labels.localizacao\" | translate}}</label>\n                                <app-combo-multi-padrao id=\"localizacao\" name=\"localizacao\" tabela=\"Localizacao\" chave=\"CodLocal\"\n                                                        descricao=\"DescrLocal\" ativos=\"true\" (outObjeto)=\"trataSit($event)\"\n                                                        (click)=\"checkTroca($event)\">\n                                </app-combo-multi-padrao>\n                            </div>\n                        </div>\n                        <div class=\"row mt-2\">\n                            <div class=\"col-lg-12\">\n                                <div class=\"custom-control custom-checkbox\">\n                                    <input id=\"apresentaSomenteSaldoLiberado\"\n                                        name=\"apresentaSomenteSaldoLiberado\"\n                                        [(ngModel)]=\"data.apresentaSomenteSaldoLiberado\"\n                                        class=\"custom-control-input checkbox-success\" type=\"checkbox\"\n                                        (ngModelChange)=\"geraDados = true\">\n                                    <label class=\"custom-control-label\"\n                                        for=\"apresentaSomenteSaldoLiberado\">{{'labels.apresentaSomenteSaldoLiberado'\n                                        | translate}}</label>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"clearfix\">&nbsp;</div>\n                        <div class=\"form-group\">\n                            <button class=\"btn btn-success mr-2\" type=\"submit\" (click)=\"setaTipoMov('')\">\n                                {{ 'buttons.geracaoArquivo' | translate }}\n                            </button>\n                            <button class=\"btn btn-success mr-2\" type=\"submit\" (click)=\"setaTipoMov('A')\">\n                                {{ 'buttons.anexoXIA' | translate }}\n                            </button>\n                            <button class=\"btn btn-success mr-2\" type=\"submit\" (click)=\"setaTipoMov('D')\">\n                                {{ 'buttons.anexoXID' | translate }}\n                            </button>\n                            <button class=\"btn btn-success mr-2\" type=\"submit\" (click)=\"setaTipoMov('E')\">\n                                {{ 'buttons.anexoXIE' | translate }}\n                            </button>\n                        </div>\n                    </form>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\n");

/***/ }),

/***/ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.ts":
/*!*********************************************************************************************************************************!*\
  !*** ./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.ts ***!
  \*********************************************************************************************************************************/
/*! exports provided: GeracaoPoliciaFederalFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPoliciaFederalFormComponent", function() { return GeracaoPoliciaFederalFormComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _geracao_policia_federal_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geracao-policia-federal.constants */ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.constants.ts");
/* harmony import */ var _geracao_policia_federal_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geracao-policia-federal.model */ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.model.ts");
/* harmony import */ var _geracao_policia_federal_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geracao-policia-federal.service */ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_cpf_cnpj_cpf_cnpj_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/cpf-cnpj/cpf-cnpj.service */ "./src/app/shared/services/funcoes/cpf-cnpj/cpf-cnpj.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};















var GeracaoPoliciaFederalFormComponent = /** @class */ (function (_super) {
    __extends(GeracaoPoliciaFederalFormComponent, _super);
    function GeracaoPoliciaFederalFormComponent(router, loginService, configuracao, messageService, permissoesUtils, funcoesService, service, cpfCnpjService) {
        var _this = _super.call(this, new _geracao_policia_federal_constants__WEBPACK_IMPORTED_MODULE_10__["GeracaoPoliciaFederalConstants"](), funcoesService) || this;
        _this.router = router;
        _this.loginService = loginService;
        _this.configuracao = configuracao;
        _this.messageService = messageService;
        _this.permissoesUtils = permissoesUtils;
        _this.funcoesService = funcoesService;
        _this.service = service;
        _this.cpfCnpjService = cpfCnpjService;
        _this.mensagens = [];
        _this.constantes = new _geracao_policia_federal_constants__WEBPACK_IMPORTED_MODULE_10__["GeracaoPoliciaFederalConstants"]();
        _this.target = _this.funcoesService.getTargetLocation();
        _this.data = new _geracao_policia_federal_model__WEBPACK_IMPORTED_MODULE_11__["GeracaoPoliciaFederalFiltro"]();
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["Mascaras"]();
        _this.apolice = "";
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.data.responsavel = _this.configuracao.lerConfig('CTR', 'Responsavel');
                _this.data.cPF = _this.configuracao.lerConfig('CTR', 'cpf');
                _this.data.rG = _this.configuracao.lerConfig('CTR', 'rg');
                _this.data.orgaoExPed = _this.configuracao.lerConfig('CTR', 'OrgaoExped');
                _this.data.cLF = _this.configuracao.lerConfig('CTR', 'CLF');
                _this.data.grupo = _this.configuracao.lerConfig('CTR', 'Grupo');
                _this.data.atividade = _this.configuracao.lerConfig('CTR', 'Atividade');
                _this.data.cNAE = _this.configuracao.lerConfig('CTR', 'CNAE');
            }
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    GeracaoPoliciaFederalFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () {
            _this.geraDados = true;
            _this.configuracao.getConfig(_this.constantes.listaParam, _this.loadConfig);
        }, function () { return _this.permissoesUtils.back(); }, true);
    };
    GeracaoPoliciaFederalFormComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    GeracaoPoliciaFederalFormComponent.prototype.onSubmit = function (form) {
        var _this = this;
        var login = this.loginService.getLogin();
        var dtAtual = new Date(this.data.dataI);
        if (form.invalid) {
            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get("formError").emit(form);
            return;
        }
        switch (this.data.tipoMov) {
            case "D":
                this.constantes.reportId = "REL0171-1";
                this.constantes.reportTitulo.titulo = "Anexo XI-D";
                break;
            case "E":
                this.constantes.reportId = "REL0171-2";
                this.constantes.reportTitulo.titulo = "Anexo XI-E";
                break;
            case "A":
                this.constantes.reportId = "REL0171-3";
                this.constantes.reportTitulo.titulo = "Anexo XI-A";
                break;
            default:
                this.data.periodo = (dtAtual.getMonth() + 1).toString() + dtAtual.getFullYear().toString();
                if (this.data.periodo.length !== 6) {
                    this.data.periodo = "0" + this.data.periodo;
                }
                break;
        }
        this.constantes.paramRelatorio = {
            filialId: login.filialId === undefined ? this.data.filialId : login.filialId,
            colaboradorId: login.colaboradorId,
            dataI: this.data.dataI === undefined ? "" : this.data.dataI,
            dataF: this.data.dataF === undefined ? "" : this.data.dataF,
            areas: this.data.localizacao === undefined ? "" : this.data.localizacao,
            geraDados: this.geraDados,
            responsavel: this.data.responsavel === undefined ? "" : this.data.responsavel,
            cpf: this.data.cPF === undefined ? "" : this.cpfCnpjService.formata_cpf_cnpj(this.data.cPF),
            rg: this.data.rG === undefined ? "" : this.data.rG,
            orgaoExPed: this.data.orgaoExPed === undefined ? "" : this.data.orgaoExPed,
            apresentaSomenteSaldoLiberado: !!this.data.apresentaSomenteSaldoLiberado
        };
        if (this.data.tipoMov === "A") {
            Object.assign(this.constantes.paramRelatorio, {
                clf: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(this.data.cLF),
                grupo: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(this.data.grupo),
                atividade: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(this.data.atividade),
                cnae: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(this.data.cNAE)
            });
        }
        if (["D", "E", "A"].includes(this.data.tipoMov)) {
            this.print();
        }
        if (this.data.tipoMov === "") {
            var per = this.funcoesService.dateTimeUtils.getPeriodo(this.data.periodo);
            if (per.error) {
                this.messageService.warning('titles.geracaoPoliciaFederal', 'messages.periodoInformadoInvalido');
                return;
            }
            this.data.periodo = per.periodo;
            var filtroArq = new _geracao_policia_federal_model__WEBPACK_IMPORTED_MODULE_11__["GeracaoPoliciaFederalFiltro"]();
            filtroArq.filialId = login.filialId;
            filtroArq.dataI = this.data.dataI;
            filtroArq.dataF = this.data.dataF;
            filtroArq.areas = this.data.localizacao;
            filtroArq.colaboradorId = login.colaboradorId;
            filtroArq.apresentaSomenteSaldoLiberado = this.data.apresentaSomenteSaldoLiberado;
            this.service.getFileExportacao(filtroArq).subscribe(function (resp) {
                if (!resp.validationResult.isValid) {
                    _this.messageService.warning("titles.geracaoPoliciaFederal", resp.validationResult.erros[0].message);
                    return;
                }
                _this.download(resp.fileText, resp.fileName, 'text/javascript');
                _this.messageService.success("titles.geracaoPoliciaFederal", "messages.arquivoPoliciaFederalGerado");
            });
        }
        this.geraDados = false;
        this.data.tipoMov = "";
    };
    GeracaoPoliciaFederalFormComponent.prototype.onCancelar = function () {
        this.data = new _geracao_policia_federal_model__WEBPACK_IMPORTED_MODULE_11__["GeracaoPoliciaFederalFiltro"]();
    };
    GeracaoPoliciaFederalFormComponent.prototype.setaTipoMov = function (tipo) {
        this.data.tipoMov = tipo;
    };
    GeracaoPoliciaFederalFormComponent.prototype.printParams = function () {
        var login = this.loginService.getLogin();
        switch (this.data.tipoMov) {
            case "D": {
                this.constantes.reportId = "REL0171-1";
                this.constantes.reportTitulo.titulo = "Anexo XI-D";
                break;
            }
            case "E": {
                this.constantes.reportId = "REL0171-2";
                this.constantes.reportTitulo.titulo = "Anexo XI-E";
                break;
            }
            case "A": {
                this.constantes.reportId = "REL0171-3";
                this.constantes.reportTitulo.titulo = "Anexo XI-A";
                break;
            }
            default: {
                break;
            }
        }
        this.constantes.paramRelatorio = {
            filialId: login.filialId === undefined ? this.data.filialId : login.filialId,
            colaboradorId: login.colaboradorId,
            dataI: this.data.dataI === undefined ? "" : this.data.dataI,
            dataF: this.data.dataF === undefined ? "" : this.data.dataF,
            areas: this.data.localizacao === undefined ? "" : this.data.localizacao,
            geraDados: this.geraDados,
            responsavel: this.data.responsavel === undefined ? "" : this.data.responsavel,
            cpf: this.data.cPF === undefined ? "" : this.data.cPF,
            rg: this.data.rG === undefined ? "" : this.data.rG,
            orgaoExPed: this.data.orgaoExPed === undefined ? "" : this.data.orgaoExPed,
            apresentaSomenteSaldoLiberado: !!this.data.apresentaSomenteSaldoLiberado
        };
        this.geraDados = false;
        this.data.tipoMov = "";
    };
    GeracaoPoliciaFederalFormComponent.prototype.trataSit = function (selectedItems) {
        this.data.localizacao = selectedItems;
    };
    GeracaoPoliciaFederalFormComponent.prototype.download = function (content, filename, contentType) {
        if (!contentType) {
            contentType = 'application/octet-stream';
        }
        var a = document.createElement('a');
        var blob = new Blob([content], { 'type': contentType });
        a.href = window.URL.createObjectURL(blob);
        a.download = filename;
        a.click();
    };
    GeracaoPoliciaFederalFormComponent.prototype.checkTroca = function (event) {
        if (this.funcoesService.isUndefinedOrNull(event)) {
            return;
        }
        this.geraDados = !event.target.onChange;
    };
    GeracaoPoliciaFederalFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__["LoginService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_4__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__["FuncoesService"] },
        { type: _geracao_policia_federal_service__WEBPACK_IMPORTED_MODULE_12__["GeracaoPoliciaFederalService"] },
        { type: app_shared_services_funcoes_cpf_cnpj_cpf_cnpj_service__WEBPACK_IMPORTED_MODULE_14__["CpfCnpjService"] }
    ]; };
    GeracaoPoliciaFederalFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-geracao-policia-federal-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-policia-federal-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__["LoginService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_4__["PermissoesUtilsService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__["FuncoesService"],
            _geracao_policia_federal_service__WEBPACK_IMPORTED_MODULE_12__["GeracaoPoliciaFederalService"],
            app_shared_services_funcoes_cpf_cnpj_cpf_cnpj_service__WEBPACK_IMPORTED_MODULE_14__["CpfCnpjService"]])
    ], GeracaoPoliciaFederalFormComponent);
    return GeracaoPoliciaFederalFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.constants.ts":
/*!***********************************************************************************************!*\
  !*** ./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.constants.ts ***!
  \***********************************************************************************************/
/*! exports provided: GeracaoPoliciaFederalConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPoliciaFederalConstants", function() { return GeracaoPoliciaFederalConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var GeracaoPoliciaFederalConstants = /** @class */ (function () {
    function GeracaoPoliciaFederalConstants() {
        this.sisFormularioId = 255017;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.permissoes" }
        ];
        this.nomeForm = "titles.GeracaoPoliciaFederal";
        this.reportId = "REL0171";
        this.reportTitulo = { "titulo": "Geração Policia Federal", "subTitulo": "" };
        this.listaForm = [
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' }
        ];
        this.listaParam = [
            { 'sistema': 'CTR', 'parametros': ["Responsavel", "CPF", "RG", "OrgaoExped", "CLF", "Grupo", "Atividade", "CNAE"] }
        ];
    }
    return GeracaoPoliciaFederalConstants;
}());



/***/ }),

/***/ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.model.ts":
/*!*******************************************************************************************!*\
  !*** ./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.model.ts ***!
  \*******************************************************************************************/
/*! exports provided: GeracaoPoliciaFederalFiltro, RelPoliciaFederal */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPoliciaFederalFiltro", function() { return GeracaoPoliciaFederalFiltro; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RelPoliciaFederal", function() { return RelPoliciaFederal; });
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var GeracaoPoliciaFederalFiltro = /** @class */ (function () {
    function GeracaoPoliciaFederalFiltro() {
        this.filialId = 0;
        this.dataI = moment__WEBPACK_IMPORTED_MODULE_0__().startOf('month').toDate();
        this.dataF = new Date();
        this.localizacao = "";
        this.tipoMov = "";
        this.colaboradorId = 0;
        this.periodo = moment__WEBPACK_IMPORTED_MODULE_0__().format('MM/YYYY');
    }
    return GeracaoPoliciaFederalFiltro;
}());

var RelPoliciaFederal = /** @class */ (function () {
    function RelPoliciaFederal() {
        this.filialId = 0;
        this.dataI = "";
        this.dataF = "";
        this.localizacao = "";
        this.tipoMov = "";
        this.colaboradorId = 0;
    }
    return RelPoliciaFederal;
}());



/***/ }),

/***/ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.module.ts":
/*!********************************************************************************************!*\
  !*** ./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.module.ts ***!
  \********************************************************************************************/
/*! exports provided: GeracaoPoliciaFederalModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPoliciaFederalModule", function() { return GeracaoPoliciaFederalModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _geracao_policia_federal_routing_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./geracao-policia-federal.routing.module */ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.routing.module.ts");
/* harmony import */ var _geracao_policia_federal_form_geracao_policia_federal_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./geracao-policia-federal-form/geracao-policia-federal-form.component */ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var GeracaoPoliciaFederalModule = /** @class */ (function () {
    function GeracaoPoliciaFederalModule() {
    }
    GeracaoPoliciaFederalModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _geracao_policia_federal_routing_module__WEBPACK_IMPORTED_MODULE_2__["GeracaoPoliciaFederalRoutingModule"]],
            declarations: [_geracao_policia_federal_form_geracao_policia_federal_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoPoliciaFederalFormComponent"]],
            providers: []
        })
    ], GeracaoPoliciaFederalModule);
    return GeracaoPoliciaFederalModule;
}());



/***/ }),

/***/ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.routing.module.ts":
/*!****************************************************************************************************!*\
  !*** ./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.routing.module.ts ***!
  \****************************************************************************************************/
/*! exports provided: GeracaoPoliciaFederalRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPoliciaFederalRoutingModule", function() { return GeracaoPoliciaFederalRoutingModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _geracao_policia_federal_form_geracao_policia_federal_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./geracao-policia-federal-form/geracao-policia-federal-form.component */ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal-form/geracao-policia-federal-form.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var MRoutes = [
    {
        path: "",
        component: _geracao_policia_federal_form_geracao_policia_federal_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoPoliciaFederalFormComponent"],
        data: { breadcrumb: "geracaoPoliciaFederal", formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
];
var GeracaoPoliciaFederalRoutingModule = /** @class */ (function () {
    function GeracaoPoliciaFederalRoutingModule() {
    }
    GeracaoPoliciaFederalRoutingModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(MRoutes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]],
        })
    ], GeracaoPoliciaFederalRoutingModule);
    return GeracaoPoliciaFederalRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.service.ts":
/*!*********************************************************************************************!*\
  !*** ./src/app/pages/obrigacoes/geracao-policia-federal/geracao-policia-federal.service.ts ***!
  \*********************************************************************************************/
/*! exports provided: GeracaoPoliciaFederalService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPoliciaFederalService", function() { return GeracaoPoliciaFederalService; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _app_error_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../app.error-handler */ "./src/app/app.error-handler.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var GeracaoPoliciaFederalService = /** @class */ (function () {
    function GeracaoPoliciaFederalService(http) {
        this.http = http;
    }
    GeracaoPoliciaFederalService.prototype.getFileExportacao = function (param) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_2__["environment"].service_url + "/api/v1/obrigacoes/geracaoPoliciaFederal/getFileExportacao", param)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    GeracaoPoliciaFederalService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_3__["HttpClient"] }
    ]; };
    GeracaoPoliciaFederalService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_3__["HttpClient"]])
    ], GeracaoPoliciaFederalService);
    return GeracaoPoliciaFederalService;
}());



/***/ }),

/***/ "./src/app/shared/services/funcoes/cpf-cnpj/cpf-cnpj.service.ts":
/*!**********************************************************************!*\
  !*** ./src/app/shared/services/funcoes/cpf-cnpj/cpf-cnpj.service.ts ***!
  \**********************************************************************/
/*! exports provided: CpfCnpjService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CpfCnpjService", function() { return CpfCnpjService; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};


var CpfCnpjService = /** @class */ (function () {
    function CpfCnpjService() {
        this.mask$ = new rxjs__WEBPACK_IMPORTED_MODULE_1__["BehaviorSubject"]('AA.AAA.AAA/AAAA-00');
    }
    CpfCnpjService.prototype.verifica_cpf_cnpj = function (valor) {
        valor = valor.toString();
        valor = valor.replace(/[^0-9A-Za-z]/g, '');
        if (valor.length === 11) {
            return 'CPF';
        }
        else if (valor.length === 14) {
            return 'CNPJ';
        }
        else {
            return false;
        }
    };
    CpfCnpjService.prototype.valida_cpf = function (valor) {
        if (!valor)
            return true;
        valor = valor.replace(/[^0-9]/g, '');
        if (!/^\d{11}$/.test(valor))
            return false;
        // elimina CPFs inválidos conhecidos (ex: 00000000000, 11111111111 etc.)
        if (/^(\d)\1{10}$/.test(valor))
            return false;
        var digitos = valor.substring(0, 9);
        // calcula 1º DV
        var soma = 0;
        for (var i = 0; i < 9; i++) {
            soma += parseInt(digitos.charAt(i), 10) * (10 - i);
        }
        var resto = soma % 11;
        var dv1 = resto < 2 ? 0 : 11 - resto;
        // calcula 2º DV
        soma = 0;
        var digitosMaisDv1 = digitos + dv1;
        for (var i = 0; i < 10; i++) {
            soma += parseInt(digitosMaisDv1.charAt(i), 10) * (11 - i);
        }
        resto = soma % 11;
        var dv2 = resto < 2 ? 0 : 11 - resto;
        // monta CPF completo calculado
        var cpfCalculado = digitos + dv1.toString() + dv2.toString();
        return valor === cpfCalculado;
    };
    CpfCnpjService.prototype.valida_cnpj = function (cnpj) {
        function calc_digitos_cnpj(digitos) {
            var soma = 0;
            var peso = digitos.length === 12 ? 5 : 6; // 1º DV começa em 5, 2º em 6
            for (var i = 0; i < digitos.length; i++) {
                var char = digitos.charAt(i);
                var valorNumerico = void 0;
                if (/[0-9]/.test(char)) {
                    valorNumerico = parseInt(char, 10);
                }
                else if (/[A-Z]/.test(char)) {
                    valorNumerico = char.charCodeAt(0) - 48; // NT 49/2024
                }
                else {
                    throw new Error("Caractere inv\u00E1lido no CNPJ: '" + char + "'");
                }
                soma += valorNumerico * peso;
                peso--;
                if (peso < 2)
                    peso = 9;
            }
            var resto = soma % 11;
            return resto < 2 ? 0 : 11 - resto;
        }
        cnpj = cnpj.replace(/[^0-9A-Za-z]/g, '').toUpperCase();
        if (!/^[0-9A-Z]{12}[0-9]{2}$/.test(cnpj)) {
            return false;
        }
        var corpo = cnpj.substring(0, 12);
        var dv1Informado = parseInt(cnpj.charAt(12), 10);
        var dv2Informado = parseInt(cnpj.charAt(13), 10);
        var dv1Calculado = calc_digitos_cnpj(corpo);
        var dv2Calculado = calc_digitos_cnpj(corpo + dv1Calculado);
        return dv1Informado === dv1Calculado && dv2Informado === dv2Calculado;
    };
    CpfCnpjService.prototype.valida_cpf_cnpj = function (valor) {
        var valida = this.verifica_cpf_cnpj(valor);
        if (valida === 'CPF') {
            return this.valida_cpf(valor);
        }
        else if (valida === 'CNPJ') {
            return this.valida_cnpj(valor);
        }
        else {
            return false;
        }
    };
    CpfCnpjService.prototype.formata_cpf_cnpj = function (valor) {
        var formatado = "";
        var valida = this.verifica_cpf_cnpj(valor);
        if (valida === 'CPF') {
            if (this.valida_cpf(valor)) {
                formatado = valor.substr(0, 3) + '.';
                formatado += valor.substr(3, 3) + '.';
                formatado += valor.substr(6, 3) + '-';
                formatado += valor.substr(9, 2) + '';
            }
        }
        else if (valida === 'CNPJ') {
            if (this.valida_cnpj(valor)) {
                formatado = valor.substr(0, 2) + '.';
                formatado += valor.substr(2, 3) + '.';
                formatado += valor.substr(5, 3) + '/';
                formatado += valor.substr(8, 4) + '-';
                formatado += valor.substr(12, 14) + '';
            }
        }
        return formatado;
    };
    CpfCnpjService.prototype.format = function (documento, tipo) {
        var _this = this;
        if (tipo === void 0) { tipo = ''; }
        var valor = documento.replace(/[^a-zA-Z0-9]/g, '') || '';
        setTimeout(function () {
            var novaMask = 'AA.AAA.AAA/AAAA-00';
            if (tipo === 'F') {
                novaMask = '000.000.000-00';
            }
            else if (tipo === 'J') {
                if (/^[0-9]{14}$/.test(valor)) {
                    novaMask = '00.000.000/0000-00';
                }
                else if (valor.length >= 14 && /[a-zA-Z]/.test(valor)) {
                    novaMask = 'AA.AAA.AAA/AAAA-00';
                }
            }
            else {
                // tipo vazio
                if (/^[0-9]{11}$/.test(valor)) {
                    novaMask = '000.000.000-00';
                }
                else if (/^[0-9]{14}$/.test(valor)) {
                    novaMask = '00.000.000/0000-00';
                }
                else if (valor.length >= 14 && /[a-zA-Z]/.test(valor)) {
                    novaMask = 'AA.AAA.AAA/AAAA-00';
                }
            }
            _this.mask$.next(novaMask);
        });
    };
    CpfCnpjService.prototype.length = function (tipo) {
        if (tipo === 'F') {
            return 14;
        }
        else {
            return 18;
        }
    };
    CpfCnpjService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])({
            providedIn: 'root'
        }),
        __metadata("design:paramtypes", [])
    ], CpfCnpjService);
    return CpfCnpjService;
}());



/***/ })

}]);
//# sourceMappingURL=app-pages-obrigacoes-geracao-policia-federal-geracao-policia-federal-module.js.map