([]);\r\n const [tableLoading, setTableLoading] = useState(false);\r\n const [show, setShow] = useState(false);\r\n const [novo, setNovo] = useState(false);\r\n const [reloadGrid, setReloadGrid] = useState(false);\r\n\r\n //Effects\r\n useEffect(() => {\r\n (async () => {\r\n try {\r\n setTableLoading(true);\r\n\r\n const response = await faturamentoService.obterTitulos();\r\n setTableData(response);\r\n } catch (error) {\r\n toastContext.notification(getSingleErrorMessage(error), \"error\");\r\n } finally {\r\n setTableLoading(false);\r\n }\r\n })();\r\n }, [reloadGrid]);\r\n\r\n //Handles\r\n const handleClose = () => setShow(false);\r\n\r\n const iniciarDownload = useCallback((arquivo: Blob, nomeArquivo: string) => {\r\n const downloadUrl = window.URL.createObjectURL(new Blob([arquivo]));\r\n const link = document.createElement('a');\r\n link.href = downloadUrl;\r\n link.setAttribute('download', nomeArquivo);\r\n document.body.appendChild(link);\r\n link.click();\r\n link.remove();\r\n }, []);\r\n\r\n const handleObterBoleto = useCallback(async (titulo: IFinanceiroTituloReceber) => {\r\n try {\r\n setTableLoading(true);\r\n const response = await faturamentoService.gerarBoleto(titulo.idTitulo);\r\n let nomeArquivo = `${format(parseISO(titulo.vencimento.toString()), 'MMMM', { locale: pt }).toUpperCase()}-${format(parseISO(titulo.vencimento.toString()), 'yyyy', { locale: pt }).toUpperCase()}`;\r\n iniciarDownload(new Blob([response]), `${nomeArquivo}.pdf`);\r\n } catch (error) {\r\n toastContext.notification(getSingleErrorMessage(error), \"error\");\r\n } finally {\r\n setTableLoading(false);\r\n }\r\n }, []);\r\n\r\n const handleObterXMLNofaFiscal = async ({ idNotaFiscal }: IFinanceiroTituloReceber) => {\r\n try {\r\n setTableLoading(true);\r\n const response = await faturamentoService.xmlNotaFiscal(idNotaFiscal);\r\n iniciarDownload(new Blob([response]), `${idNotaFiscal}.xml`);\r\n } catch (error) {\r\n toastContext.notification(getSingleErrorMessage(error), \"error\");\r\n } finally {\r\n setTableLoading(false);\r\n }\r\n };\r\n\r\n const handleObterNofaFiscal = async ({ idNotaFiscal }: IFinanceiroTituloReceber) => {\r\n try {\r\n setTableLoading(true);\r\n const response = await faturamentoService.pdfNotaFiscal(idNotaFiscal);\r\n iniciarDownload(new Blob([response]), `${idNotaFiscal}.pdf`);\r\n } catch (error) {\r\n toastContext.notification(\"Não foi possível gerar a nota fiscal. Tente novamente. Se o erro persistir entre em contato com a Alumisoft.\", \"error\");\r\n } finally {\r\n setTableLoading(false);\r\n }\r\n };\r\n\r\n const handleSave = () => {\r\n formRef.current?.submitForm();\r\n setNovo(false);\r\n };\r\n\r\n\r\n const columns = useMemo(\r\n () => [\r\n {\r\n Header: \"Fatura\",\r\n accessor: \"documento\",\r\n display: \"align-middle\",\r\n Cell: ({ row: { original } }: { row: { original: IFinanceiroTituloReceber } }) => (\r\n {format(parseISO(original.vencimento.toString()), 'MMMM', { locale: pt }).toUpperCase()} - {format(parseISO(original.vencimento.toString()), 'yyyy', { locale: pt }).toUpperCase()} \r\n )\r\n },\r\n {\r\n Header: \"Valor\",\r\n accessor: \"valor\",\r\n display: \"align-middle\",\r\n Cell: ({ row: { original } }: { row: { original: IFinanceiroTituloReceber } }) => (\r\n {new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(original.valor)} \r\n )\r\n },\r\n {\r\n Header: \"Vencimento\",\r\n accessor: \"vencimento\",\r\n display: \"align-middle\",\r\n Cell: ({ row: { original } }: { row: { original: IFinanceiroTituloReceber } }) => (\r\n {format(parseISO(original.vencimento.toString()), 'dd/MM/yyyy', { locale: pt })} \r\n )\r\n },\r\n {\r\n Header: \"Status\",\r\n accessor: \"status\",\r\n display: \"align-middle\",\r\n Cell: ({ row: { original } }: { row: { original: IFinanceiroTituloReceber } }) => (\r\n <>\r\n {original.status === 0 && (Aguardando Pagamento )}\r\n {original.status === 2 && (Pago )}\r\n >\r\n )\r\n },\r\n {\r\n Header: \"Estabelecimento\",\r\n accessor: \"estabelecimento\",\r\n display: \"align-middle\"\r\n },\r\n {\r\n Header: \"2º Via\",\r\n accessor: \"boleto\",\r\n disableSortBy: true,\r\n display: \"text-center column-table-2b\",\r\n Cell: ({ row: { original } }: { row: { original: IFinanceiroTituloReceber } }) => (\r\n <>\r\n {original.status === 0 ? (\r\n handleObterBoleto(original)}\r\n >\r\n \r\n \r\n ) : ( - )}\r\n\r\n >\r\n ),\r\n },\r\n {\r\n Header: \"Nota Fiscal\",\r\n accessor: \"notafiscal\",\r\n disableSortBy: true,\r\n display: \"text-center column-table-2b\",\r\n Cell: ({ row: { original } }: { row: { original: IFinanceiroTituloReceber } }) => (\r\n <>\r\n {original.statusElaboracao === 1 ? (\r\n handleObterNofaFiscal(original)}\r\n >\r\n \r\n \r\n ) : ( - )}\r\n {original.temXMLNFSE === 1 ? (\r\n handleObterXMLNofaFiscal(original)}\r\n >\r\n \r\n \r\n ) : ( - )}\r\n >\r\n ),\r\n },\r\n ],\r\n []\r\n );\r\n\r\n return (\r\n <>\r\n \r\n
\r\n
\r\n
\r\n
Faturas \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n *Lista dos últimos dois anos \r\n {tableData && (\r\n \r\n )}\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n {/* Modal Adicionar Cor */}\r\n \r\n \r\n {novo ? \"Adicionar Cor\" : \"Editar Cor\"} \r\n \r\n \r\n\r\n \r\n \r\n \r\n Fechar\r\n \r\n \r\n Salvar\r\n \r\n \r\n \r\n >\r\n );\r\n};\r\n\r\nexport default Fatura;\r\n","import React, { createContext } from \"react\";\r\nimport { toast, ToastContainer } from \"react-toastify\";\r\nimport * as Yup from \"yup\";\r\nimport \"./styles.css\"\r\n\r\ninterface Tipo {\r\n notification: any\r\n}\r\ninterface Notificacao {\r\n (\r\n responseError: any\r\n ): any\r\n}\r\n\r\nconst ToastErrorContext = createContext({} as Tipo);\r\n\r\nconst ToastContent = ({ title, message, icon }: any) => {\r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n
{title} \r\n {message.map((msg: any, idx: number) => {\r\n return
{msg}
\r\n }\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst ToastErrorProvider: React.FC = ({ children }) => {\r\n const notification: Notificacao = (responseError) => {\r\n\r\n if (!(responseError instanceof Yup.ValidationError)) { \r\n\r\n let critico: any = [];\r\n let alerta: any = [];\r\n let informacao: any = [];\r\n\r\n console.log(responseError?.request?.response);\r\n if (responseError.request.response) {\r\n const request = JSON.parse(responseError?.request?.response);\r\n\r\n request.forEach((res: any) => {\r\n const { message, notificationLevel } = res;\r\n\r\n if (notificationLevel?.description == 'Critical')\r\n critico.push(message);\r\n else if (notificationLevel?.description == 'Warning')\r\n alerta.push(message);\r\n else if (notificationLevel?.description == 'Information')\r\n informacao.push(message);\r\n else\r\n critico.push(message);\r\n });\r\n\r\n if (alerta != \"\") {\r\n toast.warn(\r\n ,\r\n {\r\n position: \"top-right\",\r\n autoClose: 4000,\r\n hideProgressBar: false,\r\n closeOnClick: true,\r\n pauseOnHover: true,\r\n draggable: true,\r\n progress: undefined,\r\n }\r\n );\r\n }\r\n if (informacao != \"\") {\r\n toast.info(\r\n ,\r\n {\r\n position: \"top-right\",\r\n autoClose: 4000,\r\n hideProgressBar: false,\r\n closeOnClick: true,\r\n pauseOnHover: true,\r\n draggable: true,\r\n progress: undefined,\r\n }\r\n );\r\n }\r\n if (critico != \"\") {\r\n toast.error(\r\n ,\r\n {\r\n position: \"top-right\",\r\n autoClose: 4000,\r\n hideProgressBar: false,\r\n closeOnClick: true,\r\n pauseOnHover: true,\r\n draggable: true,\r\n progress: undefined,\r\n }\r\n );\r\n }\r\n }\r\n }\r\n }\r\n\r\n return (\r\n \r\n {children}\r\n \r\n \r\n );\r\n};\r\n\r\nexport { ToastErrorProvider, ToastErrorContext };\r\n","import api from './api';\r\nimport { IFaleconosco } from '../common/interfaces/faleconosco.interfaces';\r\n\r\nexport function enviar(faleconosco : IFaleconosco) {\r\n return api.post('/faleconosco', faleconosco).then(res => res.data);\r\n}","import { Col, Row } from \"react-bootstrap\";\r\nimport { BsTelephone } from 'react-icons/bs';\r\n\r\n const ContatoCem = () => {\r\n return(\r\n \r\n \r\n CANAIS DE ATENDIMENTO \r\n Nossos canais de comunicação estão abertos de segunda à sexta-feira, das 08:00 às 17:00.
\r\n +55 (15) 3035-8250\r\n \r\n \r\n \r\n COMERCIAL \r\n Se tiver dúvidas relacionadas ao valor da sua mensalidade, alterações de cadastro, ou qualquer outra informação relacionada ao seu contrato.
\r\n \r\n +55 (15) 99120-7449\r\n \r\n \r\n \r\n \r\n \r\n FINANCEIRO \r\n Se tiver dúvidas sobre segunda via de boleto, ou informações ligadas ao financeiro.
\r\n \r\n \r\n +55 (15) 99660-1996\r\n
\r\n \r\n \r\n \r\n +55 (15)98144-7272\r\n
\r\n \r\n \r\n \r\n \r\n \r\n RELACIONAMENTO \r\n Caso tenha alguma sugestão ou elogio, entre em contato com nossa equipe de Relacionamento.
\r\n \r\n \r\n +55 (15) 99182-1792\r\n
\r\n \r\n \r\n \r\n \r\n \r\n SUPORTE TÉCNICO \r\n Caso tenha dificuldades na utilização ou necessite de alguma assistência em nossos produtos, contate nossa equipe de suporte.
\r\n \r\n \r\n +55 (15) 98176-0877\r\n
\r\n \r\n \r\n \r\n
\r\n )\r\n};\r\n\r\nconst ContatoPref = () => {\r\n return(\r\n \r\n \r\n CANAIS DE ATENDIMENTO \r\n Nossos canais de comunicação estão abertos de segunda à sexta-feira, das 08:00 às 17:00.
\r\n \r\n +55 (15) 99725-0783\r\n \r\n \r\n \r\n \r\n \r\n COMERCIAL \r\n Se tiver dúvidas relacionadas ao valor da sua mensalidade, alterações de cadastro, ou qualquer outra informação relacionada ao seu contrato.
\r\n \r\n +55 (15) 99120-7449\r\n \r\n \r\n \r\n +55 (15) 99859-9489\r\n \r\n \r\n \r\n \r\n\r\n \r\n FINANCEIRO \r\n Se tiver dúvidas sobre segunda via de boleto, ou informações ligadas ao financeiro.
\r\n \r\n \r\n +55 (15) 99680-4923\r\n
\r\n \r\n \r\n \r\n \r\n \r\n OUVIDORIA
\r\n Caso tenha alguma sugestão ou elogio, entre em contato com nossa ouvidoria.
\r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nconst ContatoFak = () => {\r\n return(\r\n \r\n \r\n CANAIS DE ATENDIMENTO \r\n Nossos canais de comunicação estão abertos de segunda à sexta-feira, das 08:00 às 17:00.
\r\n \r\n \r\n +55 (15) 3500-8520\r\n
\r\n \r\n \r\n \r\n COMERCIAL \r\n Se tiver dúvidas relacionadas ao valor da sua mensalidade, alterações de cadastro, ou qualquer outra informação relacionada ao seu contrato.
\r\n \r\n +55 (15) 99138-0134\r\n \r\n \r\n \r\n \r\n \r\n FINANCEIRO \r\n Se tiver dúvidas sobre segunda via de boleto, ou informações ligadas ao financeiro.
\r\n \r\n \r\n +55 (15) 99609-3219\r\n
\r\n \r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nexport {\r\n ContatoCem,\r\n ContatoPref,\r\n ContatoFak,\r\n};","import React, { useContext, useState, useRef } from \"react\";\r\nimport { Button, Col, Row } from \"react-bootstrap\";\r\nimport { ToastContext } from \"../../contexts/toast/toastContext\";\r\n\r\nimport { Form } from \"@unform/web\";\r\nimport { SubmitHandler, FormHandles } from \"@unform/core\";\r\nimport getValidationErrors from \"../../helpers/getValidateErrors\";\r\nimport { TextArea } from \"../../components/Form\";\r\nimport './styles.css'\r\nimport * as Yup from \"yup\";\r\n\r\nimport { ToastErrorContext } from \"../../contexts/toast/toastErrorContext\";\r\nimport * as faleconoscoService from \"../../services/faleconosco\";\r\nimport { IFaleconosco } from \"../../common/interfaces/faleconosco.interfaces\";\r\nimport { ContatoCem } from \"./components\";\r\n\r\nconst Contato: React.FC = () => {\r\n\r\n\r\n // Refs\r\n const formRef = useRef(null);\r\n const [loading, setLoading] = useState(false);\r\n\r\n\r\n //Context\r\n const toastContext = useContext(ToastContext);\r\n const toastError = useContext(ToastErrorContext);\r\n\r\n // Handles\r\n const handleSave = () => {\r\n formRef.current?.submitForm();\r\n };\r\n\r\n const handleSubmit: SubmitHandler = async (\r\n faleconosco: IFaleconosco,\r\n { reset }\r\n ) => {\r\n try {\r\n\r\n setLoading(true);\r\n formRef.current?.setErrors({});\r\n\r\n const message = \"Campo obrigatório\";\r\n\r\n const schema = Yup.object().shape({\r\n mensagem: Yup.string().required(message),\r\n });\r\n\r\n await schema.validate(faleconosco, { abortEarly: false });\r\n\r\n let request = {\r\n assunto: \"Portal do Cliente - Dúvidas ou sugestões\",\r\n mensagem: faleconosco.mensagem\r\n }\r\n\r\n await faleconoscoService.enviar(request);\r\n reset();\r\n\r\n //Toast\r\n toastContext.notification(\"A ação foi concluída.\", \"success\");\r\n } catch (err) {\r\n formRef.current?.setErrors(getValidationErrors(err));\r\n toastError.notification(err);\r\n }\r\n finally {\r\n setLoading(false);\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n \r\n
\r\n
\r\n
\r\n
Contato \r\n \r\n
\r\n
\r\n
\r\n
\r\n >\r\n );\r\n};\r\n\r\nexport default Contato;\r\n","import React, {\r\n useEffect,\r\n useMemo,\r\n useState,\r\n} from \"react\";\r\nimport { format, parseISO } from 'date-fns';\r\nimport pt from 'date-fns/locale/pt';\r\n\r\nimport DataTable from \"../../components/DataTable\";\r\nimport * as contratoService from \"../../services/contrato.service\";\r\nimport { IContrato,IContratoItem } from \"../../common/interfaces/contrato.interfaces\";\r\nimport DataNotFound from \"../../components/DataNotFound\";\r\nimport { Col, Row } from \"react-bootstrap\";\r\n\r\nconst Contrato: React.FC = () => {\r\n\r\n //Fields Typed\r\n const DataTableTS: any = DataTable;\r\n\r\n //States\r\n const [tableData, setTableData] = useState([]);\r\n const [tableLoading, setTableLoading] = useState(false);\r\n const [reloadGrid, setReloadGrid] = useState(false);\r\n\r\n //Effects\r\n useEffect(() => {\r\n (async () => {\r\n try {\r\n setTableLoading(true);\r\n\r\n const response = await contratoService.obterContratos();\r\n setTableData(response);\r\n } catch (error) {\r\n } finally {\r\n setTableLoading(false);\r\n }\r\n })();\r\n }, [reloadGrid]);\r\n\r\n const columns = useMemo(\r\n () => [\r\n {\r\n Header: \"Produto\",\r\n accessor: \"produto\",\r\n display: \"align-middle\",\r\n },\r\n {\r\n Header: \"Renovação\",\r\n accessor: \"validade\",\r\n display: \"align-middle\",\r\n Cell: ({ row: { original } }: { row: { original: IContratoItem } }) => (\r\n {format(parseISO(original.inicio.toString()), 'dd/MM/yyyy', { locale: pt })} - {format(parseISO(original.fim.toString()), 'dd/MM/yyyy', { locale: pt })} \r\n )\r\n },\r\n {\r\n Header: \"Valor\",\r\n accessor: \"valor\",\r\n display: \"align-middle\",\r\n Cell: ({ row: { original } }: { row: { original: IContratoItem } }) => (\r\n {new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(original.valor)} \r\n )\r\n },\r\n ],\r\n []\r\n );\r\n\r\n return (\r\n <>\r\n \r\n
\r\n
\r\n
\r\n
Contratos \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {tableData && (\r\n tableData.map(c => (\r\n
\r\n
\r\n
\r\n \r\n
Código Contrato \r\n
{c.codigoContrato}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n Contato Comercial\r\n \r\n \r\n Nome \r\n {c.gerenteContaNome}
\r\n \r\n \r\n E-mail \r\n {c.gerenteContaContatoEmail}
\r\n \r\n \r\n Telefone \r\n {c.gerenteContaTelefone}
\r\n \r\n \r\n Produtos Contratados\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n ))\r\n \r\n )}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n >\r\n );\r\n};\r\n\r\nexport default Contrato;\r\n","import api from './api';\r\nimport { IContrato } from '../common/interfaces/contrato.interfaces';\r\n\r\nexport function obterContratos(): Promise {\r\n return api.get('/contratos').then(res => res.data);\r\n}\r\n","import { FormHandles, SubmitHandler } from \"@unform/core\";\r\nimport React, { useContext, useEffect, useRef, useState } from \"react\";\r\nimport { Form } from '@unform/web'\r\nimport * as Yup from 'yup'\r\nimport { validateCNPJ, validateCPF } from 'validations-br';\r\n\r\nimport { ToastContext } from \"../../contexts/toast/toastContext\";\r\nimport Logo from \"../../assets/imgs/logos/2025/alumisoft.svg\";\r\nimport { ISolicitarAcesso } from \"../../common/interfaces/solicitarAcesso.interfaces\";\r\nimport { Input } from \"../../components/Form\";\r\nimport { getSingleErrorMessage } from \"../../helpers/getSingleErrorMessage\";\r\nimport getValidationErrors from \"../../helpers/getValidateErrors\";\r\nimport api from \"../../services/api\";\r\nimport { BsFillKeyFill } from \"react-icons/bs\";\r\n\r\n\r\nconst SolicitarAcesso: React.FC = () => {\r\n\r\n const formRef = useRef(null);\r\n const [loading, setLoading] = useState(false);\r\n const toastContext = useContext(ToastContext);\r\n\r\n\r\n const schema = Yup.object().shape({\r\n email: Yup\r\n .string()\r\n .email(\"Digite um e-mail valido\")\r\n .required('O e-mail é obrigatório.'),\r\n\r\n cnpj: Yup\r\n .string()\r\n .required('CNPJ ou CPF é obrigatório.')\r\n .test(\"is-valid\",\r\n \"CNPJ ou CPF inválido\",\r\n (value: string | undefined) => {\r\n if (!value) {\r\n return false;\r\n }\r\n const cleanValue = value.replace(/\\D/g, ''); // Remove non-digit characters\r\n \r\n if (cleanValue.length === 11) {\r\n return validateCPF(cleanValue);\r\n } else if (cleanValue.length === 14) {\r\n return validateCNPJ(cleanValue);\r\n } else {\r\n return false;\r\n }\r\n }\r\n ),\r\n });\r\n\r\n useEffect(() =>{\r\n formRef.current?.setErrors({});\r\n\r\n });\r\n\r\n const handleSubmit: SubmitHandler = async (form) => {\r\n try{\r\n setLoading(true);\r\n\r\n form.cnpj = form.cnpj.replaceAll(\".\", \"\").replace(\"/\", \"\").replace(\"-\", \"\");\r\n await schema.validate(form, { abortEarly: false })\r\n var response:any = await api.post(\"acesso/solicitar-acesso\", form)\r\n .catch(error => {\r\n if (error.response) {\r\n toastContext.notification(\"Não foi possível concluir a ação\", \"Aviso\");\r\n };\r\n });\r\n \r\n if(response.data)\r\n toastContext.notification(\"Solicitação concluida com sucesso, por favor verifique sua caixa de e-mail\", \"success\");\r\n else\r\n toastContext.notification(\"Solicitação de acesso em análise, entraremos em contato por e-mail\", \"success\");\r\n }catch(error: any){\r\n if (error instanceof Yup.ValidationError)\r\n {\r\n toastContext.notification(error.errors, \"error\");\r\n formRef.current?.setErrors(getValidationErrors(error));\r\n }\r\n else\r\n {\r\n toastContext.notification(getSingleErrorMessage(error), \"error\");\r\n } \r\n }finally{\r\n setLoading(false);\r\n }\r\n }\r\n \r\n return (\r\n <>\r\n \r\n\r\n \r\n
\r\n \r\n Seja bem-vindo(a) ao Portal do cliente \r\n Informe os dados solicitados abaixo para seguir com a solicitação de acesso\r\n
\r\n \r\n E-mail \r\n \r\n {} \r\n
\r\n \r\n \r\n CNPJ/CPF \r\n \r\n
\r\n\r\n \r\n \r\n {loading ? \"Enviando...\" : \"Solicitar Acesso ao Sistema\"}\r\n \r\n \r\n
\r\n \r\n
\r\n\r\n >\r\n )\r\n}\r\n\r\nexport default SolicitarAcesso;\r\n","import { FormHandles, SubmitHandler } from \"@unform/core\";\r\nimport React, { useContext, useEffect, useRef, useState } from \"react\";\r\nimport { Form } from '@unform/web'\r\nimport * as Yup from 'yup'\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { BsCheckLg, BsXLg } from 'react-icons/bs';\r\n\r\nimport { ToastContext } from \"../../contexts/toast/toastContext\";\r\nimport Logo from \"../../assets/imgs/logo-eg.svg\";\r\nimport { Input } from \"../../components/Form\";\r\nimport { getSingleErrorMessage } from \"../../helpers/getSingleErrorMessage\";\r\nimport getValidationErrors from \"../../helpers/getValidateErrors\";\r\nimport api from \"../../services/api\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\ninterface ICadastrarSenha{\r\n senha:string,\r\n confirmacaoSenha:string,\r\n codigoAcesso:string,\r\n token: string\r\n}\r\n\r\nconst CadastrarSenha: React.FC = () => {\r\n\r\n const formRef = useRef(null);\r\n const [loading, setLoading] = useState(false);\r\n const [upperCase, setUpperCase] = useState(false);\r\n const [hasNumber, setHasNumber] = useState(false);\r\n const [hasMin, setHasMin] = useState(false);\r\n const [hasMax, setHasMax] = useState(false);\r\n const [samePassword, setSamePassword] = useState(false);\r\n const toastContext = useContext(ToastContext);\r\n let { search } = useLocation();\r\n const history = useHistory();\r\n \r\n const schema = Yup.object().shape({\r\n senha: Yup.string()\r\n .matches(/^(?=.*?[a-z])/,\"A senha precisa ter pelo menos uma letra.\")\r\n .matches(/^(?=.*?[0-9])/, \"A senha precisa ter pelo menos um número.\")\r\n .matches(/^(?=.*?[0-9])/, \"A senha precisa ter no mínimo 6 caracteres.\")\r\n .matches(/^(?=.*?[0-9])/, \"A senha não pode ter mais do que 14 caracteres.\")\r\n .min(6, 'A senha precisa ter no mínimo 6 caracteres.')\r\n .max(14, 'A senha precisa ter no máximo 14 caracteres.')\r\n .required('A senha é obrigatória.'),\r\n\r\n confirmacaoSenha: Yup.string()\r\n .oneOf([Yup.ref(\"senha\"), null], \"Senha não confere. Digite a mesma senha nos dois campos.\"),\r\n \r\n codigoAcesso: Yup\r\n .string()\r\n .required(\"Código de acesso é obrigatório.\")\r\n });\r\n\r\n useEffect(() =>{\r\n formRef.current?.setErrors({});\r\n });\r\n\r\n const ValidateField = (password: string) => {\r\n setUpperCase(new RegExp(/^(?=.*?[a-z,A-Z])/).test(password));\r\n setHasNumber(new RegExp(/^(?=.*?[0-9])/).test(password));\r\n setHasMin(new RegExp(/^[^\\s]{6,}$/).test(password));\r\n setHasMax(new RegExp(/^[^\\s]{0,14}$/).test(password));\r\n\r\n }\r\n\r\n const ValidateSamePassword = (password: string) => {\r\n if(formRef?.current?.getFieldValue(\"confirmaSenha\") != '')\r\n setSamePassword(formRef?.current?.getFieldValue(\"confirmaSenha\") === formRef?.current?.getFieldValue(\"senha\"));\r\n }\r\n\r\n const handleSubmit: SubmitHandler = async (form) => {\r\n try{\r\n setLoading(true);\r\n const query = new URLSearchParams(search);\r\n form.token = query.get(\"t\") || '';\r\n \r\n await schema.validate(form, { abortEarly: false })\r\n \r\n var response = await api.post(\"acesso/cadastrar-senha\", form);\r\n\r\n if(response.data)\r\n {\r\n toastContext.notification(\"Senha cadastrada com sucesso.\", \"success\");\r\n setTimeout(() => history.push(\"/\"), 4000);\r\n }\r\n else \r\n {\r\n toastContext.notification(\"Código de Acesso inválido.\", \"success\");\r\n }\r\n \r\n }catch(error: any){\r\n if (error instanceof Yup.ValidationError)\r\n {\r\n formRef.current?.setErrors(getValidationErrors(error));\r\n }\r\n else\r\n {\r\n toastContext.notification(getSingleErrorMessage(error), \"error\");\r\n } \r\n }finally{\r\n setLoading(false);\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n \r\n\r\n \r\n
\r\n \r\n
Valide sua conta para ter acesso ao Portal do cliente \r\n Cadastre uma senha e informe o código recebido por e-mail \r\n \r\n \r\n
Senha \r\n
ValidateField(e.target.value)} />\r\n
\r\n
\r\n \r\n A senha precisa ter pelo menos uma letra. {upperCase ? : }\r\n \r\n \r\n A senha precisa ter pelo menos um número. {hasNumber ? : }\r\n \r\n \r\n A senha precisa ter no mínimo 6 caracteres. {hasMin ? : }\r\n \r\n \r\n A senha não pode ter mais do que 14 caracteres. {hasMax ? : }\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
Confirmação da Senha \r\n
ValidateSamePassword(e.target.value)} />\r\n
\r\n
\r\n \r\n As senhas precisam ser iguais {samePassword ? : }\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n Código de Acesso \r\n \r\n
\r\n\r\n \r\n \r\n {loading ? \"Gravando...\" : \"Gravar Senha\"}\r\n \r\n
\r\n \r\n
\r\n >\r\n )\r\n}\r\n\r\nexport default CadastrarSenha;\r\n","export default __webpack_public_path__ + \"static/media/PortaldoCliente.1d61b45e.svg\";","export default __webpack_public_path__ + \"static/media/alumisoft_branco.ca3a4566.svg\";","export default __webpack_public_path__ + \"static/media/preference_branco.5532af08.svg\";","export default __webpack_public_path__ + \"static/media/faktory_branco.416c9388.svg\";","import React, { useState } from \"react\";\r\nimport { BsArrowRight } from \"react-icons/bs\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { IBtnCompany } from '../../../common/interfaces/company.interfaces';\r\nimport '../style.css';\r\n\r\nconst BtnCompany : React.FC = (dados) => {\r\nconst [classBtn, setClassBtn] = useState(\"shadow btn \" + `${dados.className}`);\r\n\r\n return(<>\r\n \r\n \r\n \r\n \r\n Acesse\r\n \r\n
\r\n \r\n \r\n >)\r\n};\r\n\r\nexport default BtnCompany;\r\n","import React from \"react\";\r\nimport { Col, Row } from \"react-bootstrap\";\r\nimport { BsArrowRight } from \"react-icons/bs\";\r\nimport Logo from \"../../assets/imgs/logo-eg.svg\";\r\nimport PortalCliente from '../../assets/imgs/logos/2025/PortaldoCliente.svg';\r\nimport AlumisoftBr from '../../assets/imgs/logos/2025/alumisoft_branco.svg';\r\nimport EPrefBr from '../../assets/imgs/logos/2025/preference_branco.svg';\r\nimport FaktoryBr from '../../assets/imgs/logos/2025/faktory_branco.svg';\r\nimport BtnCompany from \"./components/btnCompany\";\r\nimport './style.css';\r\n\r\nconst SelectionCompany : React.FC = () => {\r\n\r\n return(\r\n <>\r\n \r\n >\r\n )};\r\n\r\nexport default SelectionCompany;","import React from \"react\";\r\nimport { Row, Col } from \"react-bootstrap\";\r\nimport { BsArrowRight } from \"react-icons/bs\";\r\nimport { Link } from \"react-router-dom\";\r\nimport EPref from '../../../../assets/imgs/logos/2025/preference_branco.svg'\r\n\r\nconst MaintenancEpref: React.FC = () => {\r\n return(\r\n \r\n
\r\n \r\n \r\n \r\n +55 (15) 99680-4923\r\n \r\n \r\n Site em Manutenção \r\n Estamos realizando atualizações para melhorar a sua experiência.
\r\n Retornaremos em breve.
\r\n\r\n \r\n \r\n Voltar para página inicial \r\n \r\n \r\n
\r\n
\r\n )\r\n};\r\nexport default MaintenancEpref;\r\n","import React from \"react\";\r\nimport { Row, Col } from \"react-bootstrap\";\r\nimport { Link } from \"react-router-dom\";\r\nimport { BsArrowRight } from \"react-icons/bs\";\r\nimport Faktory from '../../../../assets/imgs/logos/2025/faktory_branco.svg'\r\nimport '../../style.css'\r\n\r\nconst MaintenancFaktory: React.FC = () => {\r\n return(\r\n \r\n
\r\n \r\n \r\n Site em Manutenção \r\n Estamos realizando atualizações para melhorar a sua experiência.
\r\n Retornaremos em breve.
\r\n \r\n \r\n Página Inicial \r\n \r\n \r\n
\r\n
\r\n )\r\n};\r\nexport default MaintenancFaktory;\r\n","\r\nimport React from 'react';\r\nimport { Switch } from 'react-router-dom';\r\n\r\nimport Route from './Route';\r\nimport SignIn from '../pages/SignIn';\r\nimport Home from '../pages/Home';\r\n\r\nimport EsqueceuSuaSenha from '../pages/SignIn/EsqueceuSuaSenha';\r\nimport MeuPrimeiroAcesso from '../pages/SignIn/MeuPrimeiroAcesso';\r\nimport NovaSenha from '../pages/SignIn/NovaSenha';\r\n\r\nimport MinhaConta from '../pages/MinhaConta';\r\nimport Fatura from '../pages/Fatura';\r\nimport Contato from '../pages/Contato';\r\nimport Contrato from '../pages/Contrato';\r\nimport SolicitarAcesso from '../pages/SolicitarAcesso';\r\nimport CadastrarSenha from '../pages/CadastrarSenha';\r\nimport SelectionCompany from '../pages/SelecaoEmpresa';\r\nimport MaintenancEpref from '../pages/SelecaoEmpresa/components/Manutencao/Preference';\r\nimport MaintenancFaktory from '../pages/SelecaoEmpresa/components/Manutencao/Faktory';\r\n\r\nconst Routes: React.FC = () => (\r\n \r\n {/* Rotas Publicas */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n {/* Rotas Privadas */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n)\r\n\r\nexport default Routes;","import React, { createContext, useRef, useState } from \"react\";\r\nimport { Button, Spinner } from \"react-bootstrap\";\r\nimport SweetAlert from \"react-bootstrap-sweetalert\";\r\n\r\ninterface Tipos {\r\n warning: any,\r\n danger: any,\r\n info: any,\r\n custom: any,\r\n alert: any,\r\n close: () => void,\r\n}\r\n\r\ninterface Dados {(\r\n title: string, \r\n message: string, \r\n onConfirm: () => void,\r\n):any}\r\n\r\nconst SweetAlertContext = createContext({} as Tipos);\r\n\r\nconst initialState = {\r\n alert: null,\r\n};\r\n\r\nconst SweetAlertProvider:React.FC = ({ children }) => {\r\n const [state, setState] = useState(initialState);\r\n \r\n const close = () => {\r\n setState({ ...state, alert: null });\r\n };\r\n\r\n const confirmEvent = async(onConfirm: any) => {\r\n try {\r\n await onConfirm();\r\n close();\r\n } catch{\r\n close();\r\n }\r\n }\r\n\r\n const closeEvent = async(onClose: any) => {\r\n try {\r\n await onClose();\r\n close();\r\n } catch{\r\n close();\r\n }\r\n }\r\n\r\n const warning: Dados = (title, message, onConfirm, onClose = close) => {\r\n setState({\r\n ...state,\r\n alert: (\r\n confirmEvent(onConfirm())}\r\n onCancel={() => closeEvent(onClose)}\r\n cancelBtnText=\"Cancelar\"\r\n confirmBtnText=\"Confirmar\" \r\n >\r\n {message}\r\n \r\n ),\r\n });\r\n };\r\n\r\n const info: Dados = (title, message, onConfirm) => {\r\n setState({\r\n ...state,\r\n alert: (\r\n \r\n {message}\r\n \r\n ),\r\n });\r\n };\r\n\r\n const danger: Dados = (title, message, onConfirm) => { \r\n setState({\r\n ...state, \r\n alert: ( \r\n \r\n {message} \r\n \r\n ),\r\n });\r\n };\r\n\r\n const custom: Dados = (title, message, buttons) => {\r\n setState({\r\n ...state,\r\n alert: (\r\n {\r\n return true;\r\n }}\r\n openAnim\r\n customButtons={<>{buttons}>}\r\n >\r\n {message}\r\n \r\n ),\r\n });\r\n };\r\n\r\n const alert: Dados = (title, message) => {\r\n setState({\r\n ...state,\r\n alert: (\r\n \r\n {message}\r\n \r\n ),\r\n });\r\n };\r\n\r\n return (\r\n \r\n {children}\r\n {state?.alert}\r\n \r\n );\r\n};\r\n\r\nexport { SweetAlertProvider, SweetAlertContext };\r\n","import React from 'react';\r\n\r\nimport { AuthProvider } from './auth';\r\nimport { SweetAlertProvider } from '../contexts/sweetAlert/alertContext'\r\nimport { ToastProvider } from '../contexts/toast/toastContext'\r\nimport { ToastErrorProvider } from '../contexts/toast/toastErrorContext'\r\nconst AppProvider: React.FC = ({ children }) => (\r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n \r\n \r\n)\r\n\r\nexport default AppProvider;","\r\nimport { BrowserRouter, Router } from 'react-router-dom';\r\nimport { GlobalStyle } from './styles/global';\r\nimport history from './helpers/history'\r\n\r\nimport './common/api-fake'\r\n\r\nimport Routes from './routes';\r\nimport AppProvider from './hooks';\r\n\r\nexport function App() {\r\n\r\n return (\r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n );\r\n}\r\n\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport {App} from './App';\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n"],"sourceRoot":""}