@credithub/harlan-components 1.86.4 → 1.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,3 +18,4 @@ export type { ScoreResponse, ScoreState } from '@/@types/domain/scoreTypes';
18
18
  export type { RegistroVeiculo, VeiculosState } from '@/@types/domain/veiculosTypes';
19
19
  export type { SCRState } from '@/@types/domain/scrTypes';
20
20
  export type { ScoreSerasaState } from '@/@types/domain/scoreTypes';
21
+ export type { ProtestosPagosBaixadosState } from '@/@types/domain/protestosPagosBaixadosTypes';
@@ -39,7 +39,7 @@ var spin = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObjec
39
39
  // Componente Spinner sutil
40
40
  var Spinner = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"], ["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"])), spin);
41
41
  var ConsultaSimplesSection = function (_a) {
42
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
42
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
43
43
  var documento = _a.documento, children = _a.children, onClose = _a.onClose, isFinancial = _a.isFinancial, rest = __rest(_a, ["documento", "children", "onClose", "isFinancial"]);
44
44
  var ctx = useContext(Queries.Finder);
45
45
  var data = useGlobalData().data;
@@ -84,17 +84,16 @@ var ConsultaSimplesSection = function (_a) {
84
84
  ? "".concat(data.processosJuridicos, " ").concat(data.processosJuridicos === 1 ? 'Processo Jurídico' : 'Processos Jurídicos')
85
85
  : '',
86
86
  loaded: (_l = (_k = data.processosJuridicosData) === null || _k === void 0 ? void 0 : _k.isLoaded) !== null && _l !== void 0 ? _l : false
87
+ },
88
+ {
89
+ label: 'Liminar',
90
+ text: data.liminar &&
91
+ (data.liminar.totalProtestos === 'NADA CONSTA' ||
92
+ data.liminar.message === 'Encontrado')
93
+ ? 'Indício de Liminar'
94
+ : '',
95
+ loaded: (_o = (_m = data.liminar) === null || _m === void 0 ? void 0 : _m.isLoaded) !== null && _o !== void 0 ? _o : false
87
96
  }
88
- // {
89
- // label: 'Liminar',
90
- // text:
91
- // data.liminar &&
92
- // (data.liminar.totalProtestos === 'NADA CONSTA' ||
93
- // data.liminar.message === 'Encontrado')
94
- // ? 'Indício de Liminar'
95
- // : '',
96
- // loaded: data.liminar?.isLoaded ?? false
97
- // }
98
97
  ].filter(function (e) { return (e.label === 'Liminar' ? isFinancial : e); });
99
98
  var isError = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error;
100
99
  var isLoading = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading;
@@ -103,7 +102,7 @@ var ConsultaSimplesSection = function (_a) {
103
102
  data.dividasPublicas ||
104
103
  data.processosJuridicos ||
105
104
  receitaStatus ||
106
- ((_m = data.liminar) === null || _m === void 0 ? void 0 : _m.message) === 'Encontrado';
105
+ ((_p = data.liminar) === null || _p === void 0 ? void 0 : _p.message) === 'Encontrado';
107
106
  var statusType = isError ? 'warning' : hasPendencias ? 'error' : 'success';
108
107
  return (React.createElement(Section, __assign({ title: "Consulta Simples", subtitle: "Consulta de informa\u00E7\u00F5es do documento.", description: React.createElement(React.Fragment, null,
109
108
  React.createElement(StatusMessage, null, format(new Date(), "dd/MM/yyyy 'às' HH:mm")),
@@ -72,6 +72,7 @@ import { flattenData, selectRelevantData } from './dataUtils';
72
72
  import { processStream } from './processStream';
73
73
  import { createQueryAndMessages } from './queryUtils';
74
74
  import { BetaTag, ChatInput, ChatInputContainer, Container, ContainerInput, GenerativeAi, Header, HeaderContent, InitialMessageBox, InitialMessageContent, LoadingDots, Message, MessageHistory, SendButton, Title } from './styles';
75
+ import { isDocumentHistoryReady, isGlobalReady } from '../../../utils/isGlobalReady';
75
76
  var GenerativeAI = function (_a) {
76
77
  var _b, _c, _d;
77
78
  var documento = _a.documento, refreshQuery = _a.refreshQuery, _e = _a.isFinancial, isFinancial = _e === void 0 ? false : _e;
@@ -89,14 +90,14 @@ var GenerativeAI = function (_a) {
89
90
  var lastQueryRef = useRef(null);
90
91
  var lastUserMessageRef = useRef(null);
91
92
  var messageHistoryRef = useRef(null);
92
- // const isGlobalDataReady = useMemo(() => {
93
- // return isFinancial
94
- // ? isGlobalReady(globalData) // clientes financeiros
95
- // : isDocumentHistoryReady(globalData); // demais clientes
96
- // }, [globalData, isFinancial]);
97
93
  var isGlobalDataReady = useMemo(function () {
98
- return !!globalData.documentHistory; // verificação direta
99
- }, [globalData]);
94
+ return isFinancial
95
+ ? isGlobalReady(globalData) // clientes financeiros
96
+ : isDocumentHistoryReady(globalData); // demais clientes
97
+ }, [globalData, isFinancial]);
98
+ /*const isGlobalDataReady = useMemo(() => {
99
+ return !!globalData.documentHistory; // verificação direta
100
+ }, [globalData]);*/
100
101
  // Atualiza o payload serializado sempre que os dados globais mudarem
101
102
  useEffect(function () {
102
103
  if (globalData && documento && isGlobalDataReady) {
@@ -2,6 +2,24 @@ interface LiminarProtestosDoPassadoProps {
2
2
  /** CNPJ/CPF analisado para detectar instrumentos de protesto que sumiram do CENPROT */
3
3
  documento: string;
4
4
  }
5
+ export interface ProtestoHistoricoItem {
6
+ cpfCnpj: string;
7
+ data: string;
8
+ dataProtesto: string;
9
+ valor: number;
10
+ valorProtestado: number;
11
+ temAnuencia: boolean;
12
+ nomeApresentante: string | null;
13
+ nomeCedente: string | null;
14
+ chave: string;
15
+ creation: string;
16
+ custas: number;
17
+ missingAt: string;
18
+ protestoProvavelmenteExpirado: boolean;
19
+ }
20
+ export interface ProtestoHistoricoResponse {
21
+ [key: string]: ProtestoHistoricoItem[];
22
+ }
5
23
  /**
6
24
  * Hook que identifica indícios de liminar de sustação de protesto.
7
25
  *
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
13
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
14
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -34,12 +45,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
46
  }
36
47
  };
37
- import XPathUtils from '../../utils/xpath';
38
48
  import { Client } from '@credithub/webservice';
39
49
  import { useCallback, useContext } from 'react';
40
50
  import { WebService } from '../webservice';
41
51
  import { useGlobalData } from '../../contexts/globalDataContext';
42
- import { difference, uniq } from 'lodash';
52
+ import PostHogContext from '../../contexts/PostHogContext';
43
53
  /**
44
54
  * Hook que identifica indícios de liminar de sustação de protesto.
45
55
  *
@@ -54,7 +64,8 @@ var useLiminarProtestosDoPassado = function (_a) {
54
64
  var _b;
55
65
  var documento = _a.documento;
56
66
  var client = useContext(WebService);
57
- var globalData = useGlobalData().data;
67
+ var posthog = useContext(PostHogContext).posthog;
68
+ var _c = useGlobalData(), globalData = _c.data, setData = _c.setData;
58
69
  /** Máximo de requisições simultâneas ao endpoint de PDF. */
59
70
  var MAX_CONCURRENT = 10;
60
71
  /** Timeout (ms) por requisição individual ao PDF. */
@@ -64,22 +75,23 @@ var useLiminarProtestosDoPassado = function (_a) {
64
75
  * Retorna `true` quando há PDF, `false` caso contrário ou erro.
65
76
  */
66
77
  var possuiPdf = function (nm_chave) { return __awaiter(void 0, void 0, void 0, function () {
67
- var ctrl, timer, response, _a;
68
- return __generator(this, function (_b) {
69
- switch (_b.label) {
78
+ var ctrl, timer, response, error_1;
79
+ return __generator(this, function (_a) {
80
+ switch (_a.label) {
70
81
  case 0:
71
82
  ctrl = new AbortController();
72
83
  timer = setTimeout(function () { return ctrl.abort(); }, PDF_TIMEOUT);
73
- _b.label = 1;
84
+ _a.label = 1;
74
85
  case 1:
75
- _b.trys.push([1, 4, 5, 6]);
86
+ _a.trys.push([1, 4, 5, 6]);
76
87
  return [4 /*yield*/, client.request("SELECT FROM 'PDFPROTESTO'.'PDF'", { nm_chave: nm_chave, documento: documento }, undefined, ctrl.signal)];
77
88
  case 2:
78
- response = _b.sent();
89
+ response = _a.sent();
79
90
  return [4 /*yield*/, response.json()];
80
- case 3: return [2 /*return*/, !!(_b.sent())];
91
+ case 3: return [2 /*return*/, !!(_a.sent())];
81
92
  case 4:
82
- _a = _b.sent();
93
+ error_1 = _a.sent();
94
+ console.error('Erro ao verificar PDF:', error_1);
83
95
  return [2 /*return*/, false]; // considera oculto se erro ou timeout
84
96
  case 5:
85
97
  clearTimeout(timer);
@@ -89,20 +101,19 @@ var useLiminarProtestosDoPassado = function (_a) {
89
101
  });
90
102
  }); };
91
103
  var fetch = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
92
- var data, parsed, nodes, numerosChave, ocultos, running, idx, launch, _loop_1;
93
- var _a;
94
- return __generator(this, function (_b) {
95
- switch (_b.label) {
96
- case 0: return [4 /*yield*/, client.request("SELECT FROM 'IEPTB'.'PASTQUERIES'", {
104
+ var data, parsedData, _a, _b, numerosChave, ocultos, running, idx, launch, _loop_1;
105
+ return __generator(this, function (_c) {
106
+ switch (_c.label) {
107
+ case 0: return [4 /*yield*/, client.request("SELECT FROM 'Protestos'.'History'", {
97
108
  documento: documento
98
109
  })];
99
110
  case 1:
100
- data = _b.sent();
111
+ data = _c.sent();
112
+ _b = (_a = Object).values;
101
113
  return [4 /*yield*/, Client.WebService.parse(data)];
102
114
  case 2:
103
- parsed = (_b.sent());
104
- nodes = XPathUtils.selectArray('//protesto/nm_chave', parsed);
105
- numerosChave = difference(uniq(nodes.map(function (n) { return n.textContent || ''; })), ((_a = globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) === null || _a === void 0 ? void 0 : _a.nmChaves) || []);
115
+ parsedData = _b.apply(_a, [(_c.sent())]).flat();
116
+ numerosChave = parsedData.filter(function (item) { return item.missingAt; }).map(function (item) { return item.chave; });
106
117
  ocultos = [];
107
118
  running = [];
108
119
  idx = 0;
@@ -117,7 +128,7 @@ var useLiminarProtestosDoPassado = function (_a) {
117
128
  }
118
129
  });
119
130
  }); };
120
- _b.label = 3;
131
+ _c.label = 3;
121
132
  case 3:
122
133
  if (!(idx < numerosChave.length || running.length)) return [3 /*break*/, 6];
123
134
  _loop_1 = function () {
@@ -132,15 +143,27 @@ var useLiminarProtestosDoPassado = function (_a) {
132
143
  _loop_1();
133
144
  }
134
145
  if (!running.length) return [3 /*break*/, 5];
135
- return [4 /*yield*/, Promise.all(running)];
146
+ return [4 /*yield*/, Promise.race(running)];
136
147
  case 4:
137
- _b.sent();
138
- _b.label = 5;
148
+ _c.sent();
149
+ _c.label = 5;
139
150
  case 5: return [3 /*break*/, 3];
140
- case 6: return [2 /*return*/, {
141
- possuiIndiciosDeLiminarProtestosDoPassado: ocultos.length > 0,
142
- protestosDoPassadoIds: ocultos
143
- }];
151
+ case 6:
152
+ setData(function (prev) { return (__assign(__assign({}, prev), { protestosPagosBaixados: {
153
+ isLoaded: true,
154
+ protestos: parsedData.filter(function (item) { return item.missingAt; }).filter(function (item) { return !ocultos.includes(item.chave); })
155
+ } })); });
156
+ if (ocultos.length > 0 && posthog) {
157
+ posthog.capture('liminar_protestos_ocultos', {
158
+ documento: documento,
159
+ quantidade: ocultos.length,
160
+ instrumentos: ocultos
161
+ });
162
+ }
163
+ return [2 /*return*/, {
164
+ possuiIndiciosDeLiminarProtestosDoPassado: ocultos.length > 0,
165
+ protestosDoPassadoIds: ocultos
166
+ }];
144
167
  }
145
168
  });
146
169
  }); }, [client, documento, (_b = globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) === null || _b === void 0 ? void 0 : _b.nmChaves]);
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ProtestosPagosBaixados: React.FC;
3
+ export default ProtestosPagosBaixados;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import Section from "../section";
3
+ import { RequestStatus } from '../webservice';
4
+ import ProtestosIcon from '../../assets/icones/protestos';
5
+ import { useGlobalData } from '../../contexts/globalDataContext';
6
+ import { ResultContent } from '../interface/result';
7
+ import AddItemField from '../common/addItem';
8
+ import { formatDocument } from '../../utils/string';
9
+ import { formatMoney } from '../../utils/number';
10
+ import StatusMessage from '../interface/statusMessage';
11
+ var ProtestosPagosBaixados = function () {
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
13
+ var data = useGlobalData().data;
14
+ return (React.createElement(Section, { ctx: {
15
+ type: ((_a = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _a === void 0 ? void 0 : _a.isLoaded) ? RequestStatus.Success : RequestStatus.Loading,
16
+ error: null,
17
+ response: undefined,
18
+ refetch: function () { },
19
+ document: '',
20
+ Section: Section,
21
+ progress: 90,
22
+ }, title: "Protestos pagos e/ou baixados", subtitle: "Protestos pagos e/ou baixados", description: React.createElement(StatusMessage, { type: ((_c = (_b = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _b === void 0 ? void 0 : _b.protestos) === null || _c === void 0 ? void 0 : _c.length) ? 'error' : 'default' }, !((_e = (_d = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _d === void 0 ? void 0 : _d.protestos) === null || _e === void 0 ? void 0 : _e.length)
23
+ ? 'Não foram encontradas ocorrências'
24
+ : ((_g = (_f = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _f === void 0 ? void 0 : _f.protestos) === null || _g === void 0 ? void 0 : _g.length) === 1
25
+ ? 'Foi encontrado um protesto'
26
+ : "Foram encontrados ".concat((_j = (_h = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _h === void 0 ? void 0 : _h.protestos) === null || _j === void 0 ? void 0 : _j.length, " protestos")), variant: ((_l = (_k = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _k === void 0 ? void 0 : _k.protestos) === null || _l === void 0 ? void 0 : _l.length) ? 'error' : 'default', icon: ProtestosIcon, onSuccess: function () {
27
+ var _a, _b;
28
+ return (React.createElement("div", null, (_b = (_a = data === null || data === void 0 ? void 0 : data.protestosPagosBaixados) === null || _a === void 0 ? void 0 : _a.protestos) === null || _b === void 0 ? void 0 : _b.map(function (protesto) { return (React.createElement(ResultContent, { key: protesto.chave, print: "repeat(7, 1fr)", desktop: "repeat(8, 1fr)", tablet: "repeat(4, 1fr)", mobile: "repeat(2, 1fr)" },
29
+ React.createElement(AddItemField, { name: "Quem Protestou", value: protesto.nomeCedente }),
30
+ React.createElement(AddItemField, { name: "Atrav\u00E9s De", value: protesto.nomeApresentante }),
31
+ React.createElement(AddItemField, { name: "CPF/CNPJ Protestado", value: formatDocument(protesto.cpfCnpj) }),
32
+ React.createElement(AddItemField, { name: "Data Do Protesto", value: protesto.dataProtesto }),
33
+ React.createElement(AddItemField, { name: "Possui Anu\u00EAncia / Protesto Pago", value: protesto.temAnuencia ? 'Sim' : 'Não' }),
34
+ React.createElement(AddItemField, { name: "Valor Do Protesto", value: formatMoney(protesto.valor) }),
35
+ protesto.custas && (React.createElement(AddItemField, { name: "Custas de Cart\u00F3rio para Baixa", value: formatMoney(protesto.custas) })))); })));
36
+ } }));
37
+ };
38
+ export default ProtestosPagosBaixados;
@@ -32,7 +32,6 @@ var ConsultaScoreSerasa = function (_a) {
32
32
  var _j = useSafeQuery("SELECT FROM 'ScoreSerasa'.'Consulta'", { documento: documento }, (_c = (_b = consultasComplementaresContext === null || consultasComplementaresContext === void 0 ? void 0 : consultasComplementaresContext.consultasComplementares) === null || _b === void 0 ? void 0 : _b.scoreSerasa) === null || _c === void 0 ? void 0 : _c.consultaRealizada), response = _j.response, isLoading = _j.isLoading, error = _j.error, loadingProgress = _j.loadingProgress;
33
33
  var scoreData = (_e = (_d = response === null || response === void 0 ? void 0 : response.document) === null || _d === void 0 ? void 0 : _d.dados) === null || _e === void 0 ? void 0 : _e.score;
34
34
  var inadProb = parseProb(scoreData === null || scoreData === void 0 ? void 0 : scoreData.probabilidade_inadimplencia);
35
- console.log(scoreData);
36
35
  var scoreRef = useRef(null);
37
36
  var consultaRealizada = useMemo(function () {
38
37
  var _a, _b;
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  import { HasCreditsType } from './components/consultasComplementares';
3
+ import { PostHog } from 'posthog-js';
4
+ type ConsultaSimplesPosthog = PostHog;
3
5
  type ConsultaSimplesProps = {
4
6
  onClickQSA: (cpfCnpj: string) => void;
7
+ posthog?: ConsultaSimplesPosthog;
5
8
  documento: string;
6
9
  apiKey: string;
7
10
  onClose?: () => void;
@@ -11,6 +11,7 @@ import ConsultaSimplesSection from './components/consultaSimplesSection/consulta
11
11
  import { ConsultasComplementaresProvider } from './components/consultasComplementares';
12
12
  import Dominios from './components/dominios/dominios';
13
13
  import ConsultaImoveis from './components/imoveis/imoveisService';
14
+ import Liminar from './components/liminar/liminar';
14
15
  import ProtestosSP from './components/protestos/protestosSp';
15
16
  import ConsultaScore from './components/score/scoreService';
16
17
  import ConsultaScoreSerasa from './components/scoreSerasa/scoreSerasa';
@@ -21,6 +22,8 @@ import GlobalStyle from './styles/globalStyle';
21
22
  import theme from './styles/theme';
22
23
  import useToggle from './hooks/useToggle';
23
24
  import Modal from './components/common/modal';
25
+ import ProtestosPagosBaixados from './components/protestosPagosBaixados';
26
+ import { PostHogProvider } from './contexts/PostHogContext';
24
27
  Chart.register.apply(Chart, registerables);
25
28
  var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n margin-bottom: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"], ["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n margin-bottom: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"])));
26
29
  var FinderDependency = function (_a) {
@@ -54,43 +57,46 @@ var HasCreditsVerification = function (_a) {
54
57
  ".")));
55
58
  };
56
59
  var ConsultaSimples = function (_a) {
57
- var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits, _b = _a.initRefinBoaVista, initRefinBoaVista = _b === void 0 ? false : _b, _c = _a.initRefinSerasa, initRefinSerasa = _c === void 0 ? false : _c, _d = _a.initVeiculos, initVeiculos = _d === void 0 ? false : _d, _e = _a.printMode, printMode = _e === void 0 ? false : _e, _f = _a.isFinancial, isFinancial = _f === void 0 ? false : _f, _g = _a.tags, tags = _g === void 0 ? [] : _g;
60
+ var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits, _b = _a.initRefinBoaVista, initRefinBoaVista = _b === void 0 ? false : _b, _c = _a.initRefinSerasa, initRefinSerasa = _c === void 0 ? false : _c, _d = _a.initVeiculos, initVeiculos = _d === void 0 ? false : _d, _e = _a.printMode, printMode = _e === void 0 ? false : _e, _f = _a.isFinancial, isFinancial = _f === void 0 ? false : _f, _g = _a.tags, tags = _g === void 0 ? [] : _g, posthog = _a.posthog;
58
61
  var documento = _documento.replace(/\D+/g, '');
59
62
  return (React.createElement(ThemeProvider, { theme: theme },
60
63
  React.createElement(ErrorModalProvider, null,
61
- React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
62
- React.createElement(WebServiceProvider, { credential: apiKey },
63
- React.createElement(HasCreditsVerification, { documento: documento, apiKey: apiKey },
64
- React.createElement(Queries.Dominios.Request, { data: { documento: documento, cnpj: documento } },
65
- React.createElement(Queries.Finder.Request, { data: { documento: documento } },
66
- React.createElement(FinderDependency, { documento: documento },
67
- React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
68
- React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
69
- React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
70
- React.createElement(Wrapper, null,
71
- React.createElement(GlobalDataProvider, null,
72
- React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial },
73
- React.createElement(ConsultaRfbProvider, { documento: documento },
74
- React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
75
- React.createElement(Addresses, { apiKey: apiKey }),
76
- React.createElement(Contacts, null),
77
- React.createElement(Partners, { onClickQSA: onClickQSA })),
78
- React.createElement(Dominios, null),
79
- React.createElement(BankAccounts, null),
80
- React.createElement(GraficosAnaliticosDependency, { documento: documento },
81
- React.createElement(ChartSystem, { documento: documento }),
82
- React.createElement(ConsultaSCR, { documento: documento }),
83
- React.createElement(RefinBoaVista, { documento: documento }),
84
- React.createElement(RefinSerasa, { documento: documento }),
85
- React.createElement(ConsultaScore, { documento: documento }),
86
- React.createElement(ConsultaScoreSerasa, { documento: documento }),
87
- React.createElement(ConsultaImoveis, { documento: documento }),
88
- React.createElement(Veiculos, { documento: documento })),
89
- React.createElement(ProtestosSP, null),
90
- React.createElement(Protestos, null),
91
- React.createElement(CCF, null),
92
- React.createElement(DividasPublicas, null),
93
- React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))))),
64
+ React.createElement(PostHogProvider, { posthog: posthog },
65
+ React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
66
+ React.createElement(WebServiceProvider, { credential: apiKey },
67
+ React.createElement(HasCreditsVerification, { documento: documento, apiKey: apiKey },
68
+ React.createElement(Queries.Dominios.Request, { data: { documento: documento, cnpj: documento } },
69
+ React.createElement(Queries.Finder.Request, { data: { documento: documento } },
70
+ React.createElement(FinderDependency, { documento: documento },
71
+ React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
72
+ React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
73
+ React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
74
+ React.createElement(Wrapper, null,
75
+ React.createElement(GlobalDataProvider, null,
76
+ React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial },
77
+ React.createElement(ConsultaRfbProvider, { documento: documento },
78
+ React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
79
+ React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),
80
+ React.createElement(Addresses, { apiKey: apiKey }),
81
+ React.createElement(Contacts, null),
82
+ React.createElement(Partners, { onClickQSA: onClickQSA })),
83
+ React.createElement(Dominios, null),
84
+ React.createElement(BankAccounts, null),
85
+ React.createElement(GraficosAnaliticosDependency, { documento: documento },
86
+ React.createElement(ChartSystem, { documento: documento }),
87
+ React.createElement(ConsultaSCR, { documento: documento }),
88
+ React.createElement(RefinBoaVista, { documento: documento }),
89
+ React.createElement(RefinSerasa, { documento: documento }),
90
+ React.createElement(ConsultaScore, { documento: documento }),
91
+ React.createElement(ConsultaScoreSerasa, { documento: documento }),
92
+ React.createElement(ConsultaImoveis, { documento: documento }),
93
+ React.createElement(Veiculos, { documento: documento })),
94
+ React.createElement(ProtestosSP, null),
95
+ React.createElement(Protestos, null),
96
+ React.createElement(ProtestosPagosBaixados, null),
97
+ React.createElement(CCF, null),
98
+ React.createElement(DividasPublicas, null),
99
+ React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico }))))))))))))))),
94
100
  React.createElement(GlobalStyle, null)));
95
101
  };
96
102
  export default ConsultaSimples;
@@ -0,0 +1,13 @@
1
+ import { PostHog } from 'posthog-js';
2
+ import React from 'react';
3
+ type PostHogContextType = {
4
+ posthog: PostHog | undefined;
5
+ };
6
+ declare const PostHogContext: React.Context<PostHogContextType>;
7
+ interface PostHogProviderProps {
8
+ posthog: PostHog | undefined;
9
+ children: React.ReactNode;
10
+ }
11
+ export declare const PostHogProvider: React.FC<PostHogProviderProps>;
12
+ export declare const usePostHog: () => PostHogContextType;
13
+ export default PostHogContext;
@@ -0,0 +1,15 @@
1
+ import React, { createContext, useContext } from 'react';
2
+ // Create the context with a default value
3
+ var PostHogContext = createContext({
4
+ posthog: undefined,
5
+ });
6
+ // Provider component
7
+ export var PostHogProvider = function (_a) {
8
+ var posthog = _a.posthog, children = _a.children;
9
+ return (React.createElement(PostHogContext.Provider, { value: { posthog: posthog } }, children));
10
+ };
11
+ // Hook to use the PostHog context
12
+ export var usePostHog = function () {
13
+ return useContext(PostHogContext);
14
+ };
15
+ export default PostHogContext;