(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["default~app-pages-especificos-cargill-movimentos-interface-rds-interface-rds-module~app-pages-especi~45e9cf8d"],{

/***/ "./src/app/pages/especificos/cargill/movimentos/monitor-interface-rds/monitor-interface-rds.model.ts":
/*!***********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cargill/movimentos/monitor-interface-rds/monitor-interface-rds.model.ts ***!
  \***********************************************************************************************************/
/*! exports provided: MonitorInterfaceRdsFiltroVo, MonitorInterfaceRdsDto, MonitorInterfaceRdsHistoricoDto, MonitorInterfaceRdsAjuste */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonitorInterfaceRdsFiltroVo", function() { return MonitorInterfaceRdsFiltroVo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonitorInterfaceRdsDto", function() { return MonitorInterfaceRdsDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonitorInterfaceRdsHistoricoDto", function() { return MonitorInterfaceRdsHistoricoDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonitorInterfaceRdsAjuste", function() { return MonitorInterfaceRdsAjuste; });
/* harmony import */ var _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var MonitorInterfaceRdsFiltroVo = /** @class */ (function () {
    function MonitorInterfaceRdsFiltroVo() {
        this.dtInicio = _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].getFirstDayOfMonth(new Date());
        this.dtFim = _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].getFinalDay();
        this.flagIntegracao = "T"; //Corresponde às situações da listaSituacoes
        this.modal = "T";
        this.tipoData = "DtIntegracao";
    }
    MonitorInterfaceRdsFiltroVo.listaSituacoes = function (value) {
        if (value === void 0) { value = ""; }
        var lista = [
            { value: "T", label: "Todos" },
            { value: "Concluído", label: "Concluído" },
            { value: "Aberto", label: "Aberto" },
            { value: "Reprocessar", label: "Reprocessar" },
            { value: "Erro", label: "Erro" }
        ];
        if (value !== "") {
            var i = lista.findIndex(function (x) { return x.value === value; });
            return lista[i].label;
        }
        else {
            return lista;
        }
    };
    MonitorInterfaceRdsFiltroVo.modais = function (value) {
        if (value === void 0) { value = ""; }
        var lista = [
            { value: "T", label: "Todos" },
            { value: "R", label: "Rodoviário" },
            { value: "F", label: "Ferroviário" },
            { value: "H", label: "Barcaça" },
        ];
        if (value !== "") {
            var i = lista.findIndex(function (x) { return x.value === value; });
            return lista[i].label;
        }
        else {
            return lista;
        }
    };
    return MonitorInterfaceRdsFiltroVo;
}());

var MonitorInterfaceRdsDto = /** @class */ (function () {
    function MonitorInterfaceRdsDto() {
        this.flag = false;
    }
    return MonitorInterfaceRdsDto;
}());

var MonitorInterfaceRdsHistoricoDto = /** @class */ (function () {
    function MonitorInterfaceRdsHistoricoDto() {
    }
    return MonitorInterfaceRdsHistoricoDto;
}());

var MonitorInterfaceRdsAjuste = /** @class */ (function () {
    function MonitorInterfaceRdsAjuste() {
        this.notas = [];
    }
    return MonitorInterfaceRdsAjuste;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cargill/movimentos/monitor-interface-rds/monitor-interface-rds.service.ts":
/*!*************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cargill/movimentos/monitor-interface-rds/monitor-interface-rds.service.ts ***!
  \*************************************************************************************************************/
/*! exports provided: MonitorInterfaceRdsService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonitorInterfaceRdsService", function() { return MonitorInterfaceRdsService; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/base/specifics.base.service */ "./src/app/shared/services/base/specifics.base.service.ts");
/* harmony import */ var _monitor_interface_rds_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./monitor-interface-rds.model */ "./src/app/pages/especificos/cargill/movimentos/monitor-interface-rds/monitor-interface-rds.model.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 MonitorInterfaceRdsService = /** @class */ (function (_super) {
    __extends(MonitorInterfaceRdsService, _super);
    function MonitorInterfaceRdsService(http) {
        var _this = _super.call(this, http, "cargill/monitorInterfaceRds") || this;
        _this.http = http;
        _this.filter = new _monitor_interface_rds_model__WEBPACK_IMPORTED_MODULE_6__["MonitorInterfaceRdsFiltroVo"]();
        return _this;
    }
    MonitorInterfaceRdsService.prototype.getDados = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/getByFiltro", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.getDadosRDS = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/getRdsByFiltro", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.reprocessar = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/reprocessar", { fichas: filter })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.getHistoricoById = function (id) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/getHistoricoById/" + id)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.cancelamentoDeFicha = function (idRegistro) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/cancelamentoDeFicha/" + idRegistro)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.saveAjuste = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/saveAjuste", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.excluir = function (data) {
        return this.http
            .put(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/remove", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.prototype.revogarExclusao = function (idRegistro) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cargill/monitorInterfaceRds/revogarExclusao/" + idRegistro)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_4__["ErrorHandler"].handleError));
    };
    MonitorInterfaceRdsService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"] }
    ]; };
    MonitorInterfaceRdsService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]])
    ], MonitorInterfaceRdsService);
    return MonitorInterfaceRdsService;
}(app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_5__["SpecificsBaseService"]));



/***/ }),

/***/ "./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=default~app-pages-especificos-cargill-movimentos-interface-rds-interface-rds-module~app-pages-especi~45e9cf8d.js.map