@navservice/core 1.25.0 → 1.30.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.
@@ -0,0 +1,805 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ var __webpack_modules__ = ({
10
+ "./src/config_env/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ A: () => (__rspack_default_export)
13
+ });
14
+ class config_env {
15
+ static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
16
+ static init(config) {
17
+ config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
18
+ }
19
+ static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
20
+ return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
21
+ }
22
+ }
23
+ /* export default */ const __rspack_default_export = (config_env);
24
+
25
+
26
+ },
27
+ "./src/utils/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
28
+
29
+ // EXPORTS
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ "default": () => (/* binding */ src_utils)
32
+ });
33
+
34
+ ;// CONCATENATED MODULE: external "axios"
35
+ const external_axios_namespaceObject = require("axios");
36
+ var external_axios_default = /*#__PURE__*/__webpack_require__.n(external_axios_namespaceObject);
37
+ // EXTERNAL MODULE: ./src/config_env/index.ts
38
+ var config_env = __webpack_require__("./src/config_env/index.ts");
39
+ ;// CONCATENATED MODULE: ./src/utils/_api.ts
40
+
41
+
42
+
43
+ const _api_api = class _api {
44
+ static servidor_service_usuario = class servidor_service_usuario {
45
+ static get #axios() {
46
+ return external_axios_default().create({
47
+ baseURL: config_env/* ["default"].PUBLIC_BASE_URL_BACKEND_PRINCIPAL */.A.PUBLIC_BASE_URL_BACKEND_PRINCIPAL
48
+ });
49
+ }
50
+ static async post({ url, data, setToken = true }) {
51
+ return await this.#axios.post(url, data, _api.headers({
52
+ setToken: setToken
53
+ }));
54
+ }
55
+ static async get({ url, params, setToken = true }) {
56
+ const queryParams = new URLSearchParams();
57
+ if (params) {
58
+ Object.entries(params).forEach(([key, value])=>{
59
+ console.log('13');
60
+ if (value !== null && value !== undefined) {
61
+ console.log('14');
62
+ queryParams.append(key, value);
63
+ console.log('15');
64
+ }
65
+ });
66
+ }
67
+ const queryString = queryParams.toString();
68
+ const fullUrl = queryString ? `${url}?${queryString}` : url;
69
+ return await this.#axios.get(fullUrl, _api.headers({
70
+ setToken: setToken
71
+ }));
72
+ }
73
+ static async patch({ url, data, setToken = true }) {
74
+ return await this.#axios.patch(url, data, _api.headers({
75
+ setToken: setToken
76
+ }));
77
+ }
78
+ static async delete({ url }) {
79
+ return await this.#axios.delete(url);
80
+ }
81
+ };
82
+ static headers({ setToken = true }) {
83
+ const get_auth_user = src_utils.session_sorage.get_item_session_storage("auth_user");
84
+ if (setToken === true) {
85
+ return {
86
+ headers: {
87
+ Authorization: `Bearer ${get_auth_user?.data?.usuario?.token}`,
88
+ "Content-type": "application/json"
89
+ }
90
+ };
91
+ } else {
92
+ return {
93
+ headers: {
94
+ "Content-type": "application/json"
95
+ }
96
+ };
97
+ }
98
+ }
99
+ };
100
+ /* export default */ const utils_api = (_api_api);
101
+
102
+ ;// CONCATENATED MODULE: ./src/utils/_data.ts
103
+ const _data = class _data {
104
+ static YYYY_MM_DD_00_00_00(newData) {
105
+ let dataAtual = new Date();
106
+ if (newData) {
107
+ dataAtual = new Date(newData);
108
+ }
109
+ const options = {
110
+ timeZone: "America/Sao_Paulo",
111
+ ano: "numeric",
112
+ mes: "numeric",
113
+ dia: "numeric",
114
+ hora: "numeric"
115
+ };
116
+ const horarioFormatado = dataAtual.toLocaleString("pt-BR", options);
117
+ const [data, hora] = horarioFormatado.split(",");
118
+ const [dia, mes, ano] = data.split("/");
119
+ return `${ano}-${mes}-${dia} ${hora}`;
120
+ }
121
+ static DD_MM_YYYY_00_00_00(newData) {
122
+ let dataAtual = new Date();
123
+ if (newData) {
124
+ dataAtual = new Date(newData);
125
+ }
126
+ const options = {
127
+ timeZone: "America/Sao_Paulo",
128
+ ano: "numeric",
129
+ mes: "numeric",
130
+ dia: "numeric",
131
+ hora: "numeric"
132
+ };
133
+ return dataAtual.toLocaleString("pt-BR", options);
134
+ }
135
+ static DD_MM_YYYY_00_00(newData) {
136
+ let dataAtual = new Date();
137
+ if (newData) {
138
+ dataAtual = new Date(newData);
139
+ }
140
+ const options = {
141
+ timeZone: "America/Sao_Paulo",
142
+ ano: "numeric",
143
+ mes: "numeric",
144
+ dia: "numeric",
145
+ hora: "numeric"
146
+ };
147
+ const dataFormatada = dataAtual.toLocaleString("pt-BR", options).replace(",", "");
148
+ return dataFormatada;
149
+ }
150
+ static DD_MM_YYYY(newData) {
151
+ let dataAtual = new Date();
152
+ if (newData) {
153
+ dataAtual = new Date(newData);
154
+ }
155
+ const options = {
156
+ timeZone: "America/Sao_Paulo",
157
+ ano: "numeric",
158
+ mes: "numeric",
159
+ dia: "numeric",
160
+ hora: "numeric"
161
+ };
162
+ return dataAtual.toLocaleString("pt-BR", options);
163
+ }
164
+ static YYYY_MM_DD(newData) {
165
+ let dataAtual = new Date();
166
+ if (newData) {
167
+ dataAtual = new Date(newData);
168
+ }
169
+ const options = {
170
+ timeZone: "America/Sao_Paulo",
171
+ ano: "numeric",
172
+ mes: "numeric",
173
+ dia: "numeric",
174
+ hora: "numeric"
175
+ };
176
+ const horarioFormatado = dataAtual.toLocaleString("pt-BR", options);
177
+ const [data] = horarioFormatado.split(",");
178
+ const [dia, mes, ano] = data.split("/");
179
+ return `${ano}-${mes}-${dia}`;
180
+ }
181
+ static DIFERENCA_SEGUNDOS(data) {
182
+ var dataInicial = new Date(data);
183
+ var dataAtual = new Date();
184
+ var diferenca = Number(dataAtual) - Number(dataInicial);
185
+ var diferencaEmSegundos = Math.floor(diferenca / 1000);
186
+ return diferencaEmSegundos;
187
+ }
188
+ static DIFERENCA_DIAS(data) {
189
+ var dataInicial = new Date(data);
190
+ var dataAtual = new Date();
191
+ var diferenca = dataAtual.getTime() - dataInicial.getTime(); // Obtém a diferença em milissegundos
192
+ var diferencaEmDias = Math.floor(diferenca / (1000 * 60 * 60 * 24)); // Calcula a diferença em dias
193
+ return diferencaEmDias;
194
+ }
195
+ };
196
+ /* export default */ const utils_data = (_data);
197
+
198
+ ;// CONCATENATED MODULE: ./src/utils/_form.ts
199
+ class _form {
200
+ static regex_cpf_cnpj(value) {
201
+ let tempValue = value.replace(/\D/g, "");
202
+ if (tempValue.length > 14) {
203
+ tempValue = tempValue.slice(0, 14);
204
+ }
205
+ if (tempValue.length <= 11) {
206
+ tempValue = tempValue.replace(/^(\d{0,3})(\d{0,3})(\d{0,3})(\d{0,2})$/, (match, p1, p2, p3, p4)=>{
207
+ let result = p1;
208
+ if (p2) result += "." + p2;
209
+ if (p3) result += "." + p3;
210
+ if (p4) result += "-" + p4;
211
+ return result;
212
+ });
213
+ } else {
214
+ tempValue = tempValue.replace(/^(\d{0,2})(\d{0,3})(\d{0,3})(\d{0,4})(\d{0,2})$/, (match, p1, p2, p3, p4, p5)=>{
215
+ let result = p1;
216
+ if (p2) result += "." + p2;
217
+ if (p3) result += "." + p3;
218
+ if (p4) result += "/" + p4;
219
+ if (p5) result += "-" + p5;
220
+ return result;
221
+ });
222
+ }
223
+ return tempValue;
224
+ }
225
+ static formatar_cpf(value) {
226
+ const cpf = value.replace(/\D/g, "");
227
+ if (cpf.length > 11) {
228
+ return cpf.slice(0, 11);
229
+ }
230
+ return cpf.replace(/^(\d{0,3})(\d{0,3})(\d{0,3})(\d{0,2})$/, (match, p1, p2, p3, p4)=>{
231
+ let result = p1;
232
+ if (p2) result += "." + p2;
233
+ if (p3) result += "." + p3;
234
+ if (p4) result += "-" + p4;
235
+ return result;
236
+ });
237
+ }
238
+ static formatar_cnpj(value) {
239
+ const cnpj = value.replace(/\D/g, "");
240
+ if (cnpj.length > 14) {
241
+ return cnpj.slice(0, 14);
242
+ }
243
+ return cnpj.replace(/^(\d{0,2})(\d{0,3})(\d{0,3})(\d{0,4})(\d{0,2})$/, (match, p1, p2, p3, p4, p5)=>{
244
+ let result = p1;
245
+ if (p2) result += "." + p2;
246
+ if (p3) result += "." + p3;
247
+ if (p4) result += "/" + p4;
248
+ if (p5) result += "-" + p5;
249
+ return result;
250
+ });
251
+ }
252
+ static formatar_cep(value) {
253
+ const cep = value.replace(/\D/g, "");
254
+ if (cep.length > 8) {
255
+ return cep.slice(0, 8);
256
+ }
257
+ return cep.replace(/^(\d{0,5})(\d{0,3})$/, (match, p1, p2)=>{
258
+ if (p2) return `${p1}-${p2}`;
259
+ return p1;
260
+ });
261
+ }
262
+ static formatar_telefone_fixo(value) {
263
+ const telefone = value.replace(/\D/g, "");
264
+ if (telefone.length > 10) {
265
+ return telefone.slice(0, 10);
266
+ }
267
+ return telefone.replace(/^(\d{0,2})(\d{0,4})(\d{0,4})$/, (match, p1, p2, p3)=>{
268
+ let result = "";
269
+ if (p1) result += `(${p1}`;
270
+ if (p2) result += `) ${p2}`;
271
+ if (p3) result += `-${p3}`;
272
+ return result;
273
+ });
274
+ }
275
+ static formatar_celular(value) {
276
+ const celular = value.replace(/\D/g, "");
277
+ if (celular.length > 11) {
278
+ return celular.slice(0, 11);
279
+ }
280
+ return celular.replace(/^(\d{0,2})(\d{0,5})(\d{0,4})$/, (match, p1, p2, p3)=>{
281
+ let result = "";
282
+ if (p1) result += `(${p1}`;
283
+ if (p2) result += `) ${p2}`;
284
+ if (p3) result += `-${p3}`;
285
+ return result;
286
+ });
287
+ }
288
+ static formatar_nome(name) {
289
+ const lowercaseWords = [
290
+ "de",
291
+ "da",
292
+ "do",
293
+ "das",
294
+ "dos",
295
+ "e",
296
+ "a",
297
+ "o"
298
+ ];
299
+ const words = name.toLowerCase().split(" ");
300
+ const formattedWords = words.map((word, index)=>{
301
+ if (index === 0) {
302
+ return word.charAt(0).toUpperCase() + word.slice(1);
303
+ }
304
+ if (lowercaseWords.includes(word)) {
305
+ return word;
306
+ }
307
+ return word.charAt(0).toUpperCase() + word.slice(1);
308
+ });
309
+ return formattedWords.join(" ");
310
+ }
311
+ static formatar_reais_br(value) {
312
+ let num = value.replace(/\D/g, "");
313
+ return new Intl.NumberFormat("pt-BR", {
314
+ style: "currency",
315
+ currency: "BRL",
316
+ minimumFractionDigits: 2
317
+ }).format(Number(num) / 100);
318
+ }
319
+ }
320
+ /* export default */ const utils_form = (_form);
321
+
322
+ ;// CONCATENATED MODULE: ./src/utils/_geral.ts
323
+ const geral = class geral {
324
+ static slice_file_name(filename, maxLength = 30) {
325
+ if (!filename || typeof filename !== "string") return "";
326
+ // Encontra a última ocorrência do ponto para identificar a extensão
327
+ const lastDotIndex = filename.lastIndexOf(".");
328
+ // Se não houver extensão, trunca diretamente
329
+ if (lastDotIndex === -1) {
330
+ return filename.length > maxLength ? filename.substring(0, maxLength - 3) + "..." : filename;
331
+ }
332
+ const name = filename.substring(0, lastDotIndex);
333
+ const extension = filename.substring(lastDotIndex);
334
+ // Se o nome + extensão é menor que o máximo, retorna completo
335
+ if (filename.length <= maxLength) return filename;
336
+ // Calcula quanto espaço temos para o nome
337
+ // Considerando: extensão + '...' + 1 caractere do nome
338
+ const availableLength = maxLength - extension.length - 3;
339
+ if (availableLength <= 0) {
340
+ // Se não há espaço suficiente nem para 1 caractere do nome
341
+ return name.substring(0, 1) + "..." + extension;
342
+ }
343
+ // Trunca o nome e mantém a extensão
344
+ return name.substring(0, availableLength) + "..." + extension;
345
+ }
346
+ static extrair_id(array_enviado) {
347
+ const ids = [];
348
+ for(let i = 0; i < array_enviado.length; i++){
349
+ if (array_enviado[i]?._id) ids.push(array_enviado[i]._id);
350
+ }
351
+ return ids;
352
+ }
353
+ static gerar_id = (length = 32)=>{
354
+ // Caracteres permitidos (apenas alfanuméricos)
355
+ const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
356
+ // Timestamp em formato hexadecimal (sem separadores)
357
+ const timestamp = Date.now().toString(16) + performance.now().toString(16).replace(".", "");
358
+ // Inicializa resultado com timestamp para garantir unicidade temporal
359
+ let result = timestamp;
360
+ // Adiciona caracteres aleatórios até atingir o comprimento desejado
361
+ while(result.length < length){
362
+ const randomIndex = Math.floor(Math.random() * chars.length);
363
+ result += chars[randomIndex];
364
+ }
365
+ // Combina com características do navegador para aumentar a unicidade
366
+ const navigatorData = (window.navigator.userAgent + screen.width + screen.height).split("").map((c)=>c.charCodeAt(0)).reduce((a, b)=>a + b, 0).toString(36);
367
+ // Combina os dados e corta para o tamanho correto
368
+ const finalResult = (result + navigatorData).replace(/[^a-zA-Z0-9]/g, "");
369
+ // Garante o comprimento exato
370
+ return finalResult.substring(0, length);
371
+ };
372
+ };
373
+ /* export default */ const _geral = (geral);
374
+
375
+ ;// CONCATENATED MODULE: ./src/utils/_local_storage.ts
376
+ const _local_storage = class _local_storage {
377
+ static adicionar_item_local_storage(chave, novoItem) {
378
+ try {
379
+ const valorAtual = window.localStorage.getItem(chave);
380
+ const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
381
+ const newDataItem = {
382
+ ...listaAtual,
383
+ ...novoItem
384
+ };
385
+ window.localStorage.setItem(chave, JSON.stringify(newDataItem));
386
+ } catch (error) {
387
+ console.log(error);
388
+ }
389
+ }
390
+ static set_local_storage_sem_incremento(chave, novoItem) {
391
+ try {
392
+ window.localStorage.setItem(chave, JSON.stringify(novoItem));
393
+ } catch (error) {
394
+ console.log(error);
395
+ }
396
+ }
397
+ static get_item_local_storage(chave) {
398
+ try {
399
+ if (typeof window !== "undefined") {
400
+ const valorAtual = window.localStorage.getItem(chave);
401
+ return valorAtual ? JSON.parse(valorAtual) : valorAtual;
402
+ }
403
+ return;
404
+ } catch (error) {
405
+ console.log(error);
406
+ }
407
+ }
408
+ static remover_item_local_storage(chave) {
409
+ try {
410
+ window.localStorage.removeItem(chave);
411
+ } catch (error) {
412
+ console.log(error);
413
+ }
414
+ }
415
+ };
416
+ // Para usar a classe, você pode fazer:
417
+ /* export default */ const utils_local_storage = (_local_storage);
418
+
419
+ ;// CONCATENATED MODULE: ./src/utils/_update_context.ts
420
+ const _update_context = class _update_context {
421
+ static set_new_item_end = ({ oldArray = [], newItem = [], key = "_id" })=>{
422
+ try {
423
+ const hasValidIds = Array.isArray(newItem) ? newItem.every((item)=>item?.[key]) : newItem?.[key];
424
+ const newItemArray = hasValidIds ? Array.isArray(newItem) ? newItem : [
425
+ newItem
426
+ ] : oldArray;
427
+ if (oldArray?.length === 0) return newItemArray;
428
+ // Cria uma cópia rasa do array original
429
+ const updatedArray = [
430
+ ...oldArray
431
+ ];
432
+ // Itera sobre os novos itens
433
+ newItemArray.forEach((novoItem)=>{
434
+ const index = updatedArray.findIndex((oldItem)=>oldItem?.[key] === novoItem?.[key]);
435
+ if (index !== -1) {
436
+ // Atualiza o item existente mantendo as propriedades antigas que não estão no novo item
437
+ novoItem.new = false;
438
+ updatedArray[index] = {
439
+ ...updatedArray[index],
440
+ ...novoItem
441
+ };
442
+ } else {
443
+ // Adiciona novo item no FINAL com a propriedade new = true
444
+ novoItem.new = true;
445
+ updatedArray.push(novoItem); // Usa push em vez de unshift
446
+ }
447
+ });
448
+ return updatedArray;
449
+ } catch (error) {
450
+ console.error("Erro ao atualizar array:", error);
451
+ return oldArray; // Retorna o array original em caso de erro
452
+ }
453
+ };
454
+ static update_array_itens = ({ oldArray = [], newItem = [], key = "_id" })=>{
455
+ try {
456
+ const hasValidIds = Array.isArray(newItem) ? newItem.every((item)=>item?.[key]) : newItem?.[key];
457
+ const newItemArray = hasValidIds ? Array.isArray(newItem) ? newItem : [
458
+ newItem
459
+ ] : oldArray;
460
+ if (oldArray?.length === 0) return newItemArray;
461
+ // Cria uma cópia rasa do array original
462
+ const updatedArray = [
463
+ ...oldArray
464
+ ];
465
+ // Itera sobre os novos itens
466
+ newItemArray.forEach((novoItem)=>{
467
+ const index = updatedArray.findIndex((oldItem)=>oldItem?.[key] === novoItem?.[key]);
468
+ if (index !== -1) {
469
+ // Atualiza o item existente mantendo as propriedades antigas que não estão no novo item
470
+ novoItem.new = false;
471
+ updatedArray[index] = {
472
+ ...updatedArray[index],
473
+ ...novoItem
474
+ };
475
+ } else {
476
+ // Adiciona novo item no início com a propriedade new = true
477
+ novoItem.new = true;
478
+ updatedArray.unshift(novoItem);
479
+ }
480
+ });
481
+ return updatedArray;
482
+ } catch (error) {
483
+ console.error("Erro ao atualizar array:", error);
484
+ return oldArray; // Retorna o array original em caso de erro
485
+ }
486
+ };
487
+ static remove_array_items = ({ oldArray = [], itemsToRemove = [], key = "_id" })=>{
488
+ try {
489
+ // Verifica se os argumentos são válidos
490
+ if (!Array.isArray(oldArray) || oldArray.length === 0) return oldArray;
491
+ if (!itemsToRemove) return oldArray;
492
+ // Converte itemsToRemove para array se for um único item
493
+ const itemsArray = Array.isArray(itemsToRemove) ? itemsToRemove : [
494
+ itemsToRemove
495
+ ];
496
+ // Se não houver itens para remover, retorna o array original
497
+ if (itemsArray.length === 0) return oldArray;
498
+ // Cria um Set com os IDs dos itens a serem removidos para busca mais eficiente
499
+ const removeIds = new Set(itemsArray.filter((item)=>item?.[key]).map((item)=>item[key]));
500
+ // Filtra o array original removendo os itens cujos IDs estão no Set
501
+ const updatedArray = oldArray.filter((item)=>!removeIds.has(item?.[key]));
502
+ return updatedArray;
503
+ } catch (error) {
504
+ console.error("Erro ao remover itens do array:", error);
505
+ return oldArray; // Retorna o array original em caso de erro
506
+ }
507
+ };
508
+ static compare_arrays({ arrayAntigo, arrayNovo }) {
509
+ // Cria Sets para performance
510
+ const idsAntigos = new Set(arrayAntigo.map((item)=>item._id));
511
+ const idsNovos = new Set(arrayNovo.map((item)=>item._id));
512
+ // Mantém apenas os itens do array antigo que ainda existem no novo
513
+ const itensMantidos = arrayAntigo.filter((item)=>idsNovos.has(item._id));
514
+ // Adiciona os itens novos que não existiam no array antigo
515
+ const itensNovos = arrayNovo.filter((item)=>!idsAntigos.has(item._id));
516
+ // Combina os arrays
517
+ return [
518
+ ...itensMantidos,
519
+ ...itensNovos
520
+ ];
521
+ }
522
+ };
523
+ /* export default */ const utils_update_context = (_update_context);
524
+
525
+ ;// CONCATENATED MODULE: ./src/utils/_session_storage.ts
526
+ const _session_storage = class _session_storage {
527
+ static adicionar_item_session_storage({ chave, novoItem }) {
528
+ try {
529
+ const valorAtual = window.sessionStorage.getItem(chave);
530
+ const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
531
+ const newDataItem = {
532
+ ...listaAtual,
533
+ ...novoItem
534
+ };
535
+ window.sessionStorage.setItem(chave, JSON.stringify(newDataItem));
536
+ } catch (error) {
537
+ console.error(error);
538
+ }
539
+ }
540
+ static set_session_storage_sem_incremento({ chave, novoItem }) {
541
+ try {
542
+ window.sessionStorage.setItem(chave, JSON.stringify(novoItem));
543
+ } catch (error) {
544
+ console.error(error);
545
+ }
546
+ }
547
+ static get_item_session_storage(chave) {
548
+ try {
549
+ if (typeof window !== "undefined") {
550
+ const valorAtual = window.sessionStorage.getItem(chave);
551
+ return valorAtual ? JSON.parse(valorAtual) : valorAtual;
552
+ }
553
+ return;
554
+ } catch (error) {
555
+ console.error(error);
556
+ }
557
+ }
558
+ static remover_item_session_storage(chave) {
559
+ try {
560
+ window.sessionStorage.removeItem(chave);
561
+ } catch (error) {
562
+ console.error(error);
563
+ }
564
+ }
565
+ };
566
+ /* export default */ const utils_session_storage = (_session_storage);
567
+
568
+ ;// CONCATENATED MODULE: ./src/utils/index.ts
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+ const utils = class utils {
577
+ static api = utils_api;
578
+ static data = utils_data;
579
+ static form = utils_form;
580
+ static geral = _geral;
581
+ static local_storage = utils_local_storage;
582
+ static update_context = utils_update_context;
583
+ static session_sorage = utils_session_storage;
584
+ };
585
+ /* export default */ const src_utils = (utils);
586
+
587
+
588
+ },
589
+
590
+ });
591
+ // The module cache
592
+ var __webpack_module_cache__ = {};
593
+
594
+ // The require function
595
+ function __webpack_require__(moduleId) {
596
+
597
+ // Check if module is in cache
598
+ var cachedModule = __webpack_module_cache__[moduleId];
599
+ if (cachedModule !== undefined) {
600
+ return cachedModule.exports;
601
+ }
602
+ // Create a new module (and put it into the cache)
603
+ var module = (__webpack_module_cache__[moduleId] = {
604
+ exports: {}
605
+ });
606
+ // Execute the module function
607
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
608
+
609
+ // Return the exports of the module
610
+ return module.exports;
611
+
612
+ }
613
+
614
+ // webpack/runtime/compat_get_default_export
615
+ (() => {
616
+ // getDefaultExport function for compatibility with non-ESM modules
617
+ __webpack_require__.n = (module) => {
618
+ var getter = module && module.__esModule ?
619
+ () => (module['default']) :
620
+ () => (module);
621
+ __webpack_require__.d(getter, { a: getter });
622
+ return getter;
623
+ };
624
+
625
+ })();
626
+ // webpack/runtime/define_property_getters
627
+ (() => {
628
+ __webpack_require__.d = (exports, definition) => {
629
+ for(var key in definition) {
630
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
631
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
632
+ }
633
+ }
634
+ };
635
+ })();
636
+ // webpack/runtime/has_own_property
637
+ (() => {
638
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
639
+ })();
640
+ // webpack/runtime/make_namespace_object
641
+ (() => {
642
+ // define __esModule on exports
643
+ __webpack_require__.r = (exports) => {
644
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
645
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
646
+ }
647
+ Object.defineProperty(exports, '__esModule', { value: true });
648
+ };
649
+ })();
650
+ var __webpack_exports__ = {};
651
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
652
+ (() => {
653
+ // ESM COMPAT FLAG
654
+ __webpack_require__.r(__webpack_exports__);
655
+
656
+ // EXPORTS
657
+ __webpack_require__.d(__webpack_exports__, {
658
+ config_env_core: () => (/* reexport */ config_env/* ["default"] */.A),
659
+ TypesCore: () => (/* reexport */ types),
660
+ utils: () => (/* reexport */ utils["default"])
661
+ });
662
+
663
+ // EXTERNAL MODULE: ./src/config_env/index.ts
664
+ var config_env = __webpack_require__("./src/config_env/index.ts");
665
+ ;// CONCATENATED MODULE: external "zod/v4"
666
+ const v4_namespaceObject = require("zod/v4");
667
+ var v4_default = /*#__PURE__*/__webpack_require__.n(v4_namespaceObject);
668
+ ;// CONCATENATED MODULE: ./src/types/_usuario.ts
669
+
670
+ (function(TypeControllerUsuario) {
671
+ TypeControllerUsuario.AppEnum = [
672
+ "service-usuario",
673
+ "service-financeiro",
674
+ "service-pages-ai"
675
+ ];
676
+ TypeControllerUsuario.UsuarioTipoEnum = [
677
+ "padrao"
678
+ ];
679
+ const AppEnumZod = v4_default()["enum"]([
680
+ "service-usuario",
681
+ "service-financeiro",
682
+ "service-pages-ai"
683
+ ]);
684
+ const UsuarioTipoEnumZod = v4_default()["enum"](TypeControllerUsuario.UsuarioTipoEnum);
685
+ })(_usuario_TypeControllerUsuario || (_usuario_TypeControllerUsuario = {}));
686
+ /* export default */ const _usuario = (_usuario_TypeControllerUsuario);
687
+ var _usuario_TypeControllerUsuario;
688
+
689
+ ;// CONCATENATED MODULE: ./src/types/_type_response.ts
690
+
691
+ (function(TypeControllerResponse) {
692
+ const StatusSchema = v4_default().union([
693
+ v4_default().literal(200),
694
+ v4_default().literal(201),
695
+ v4_default().literal(202),
696
+ v4_default().literal(204),
697
+ v4_default().literal(400),
698
+ v4_default().literal(401),
699
+ v4_default().literal(403),
700
+ v4_default().literal(404),
701
+ v4_default().literal(409),
702
+ v4_default().literal(422),
703
+ v4_default().literal(500),
704
+ v4_default().literal(428),
705
+ v4_default().literal(405)
706
+ ]);
707
+ const TypeSchema = v4_default().union([
708
+ v4_default().literal("success"),
709
+ v4_default().literal("warning"),
710
+ v4_default().literal("error")
711
+ ]).default("success");
712
+ const CodeSchema = v4_default().union([
713
+ v4_default().literal("SUCCESS"),
714
+ v4_default().literal("ACTION_REQUIRED"),
715
+ v4_default().literal("CREATED"),
716
+ v4_default().literal("WARNING"),
717
+ v4_default().literal("AUTHORIZATION_ERROR"),
718
+ v4_default().literal("SCHEMA_VALIDATION"),
719
+ v4_default().literal("SERVER_ERROR"),
720
+ v4_default().literal("UNAUTHORIZED"),
721
+ v4_default().literal("INVALID_TOKEN"),
722
+ v4_default().literal("NOT_FOUND"),
723
+ v4_default().literal("SUCCESS_FILE"),
724
+ v4_default().literal("DATABASE_ERROR")
725
+ ]);
726
+ const BaseResponseSchema = v4_default().object({
727
+ status: StatusSchema,
728
+ code: CodeSchema,
729
+ type: TypeSchema,
730
+ message: v4_default().string(),
731
+ results: v4_default().unknown().optional(),
732
+ error: v4_default().unknown().optional()
733
+ });
734
+ (function(C) {
735
+ C.InputSchema = v4_default().object({
736
+ status: StatusSchema,
737
+ code: CodeSchema,
738
+ type: TypeSchema.optional().default("success"),
739
+ message: v4_default().string().optional(),
740
+ results: v4_default().any(),
741
+ c: v4_default().custom()
742
+ });
743
+ const FileResponseParamsSchema = v4_default().object({
744
+ status: StatusSchema,
745
+ message: v4_default().string().optional(),
746
+ file_buffer: v4_default().union([
747
+ v4_default()["instanceof"](Blob),
748
+ v4_default()["instanceof"](ArrayBuffer),
749
+ v4_default()["instanceof"](Uint8Array)
750
+ ]),
751
+ content_type: v4_default().string(),
752
+ filename: v4_default().string().optional(),
753
+ c: v4_default().custom().optional()
754
+ });
755
+ })(TypeControllerResponse.C || (TypeControllerResponse.C = {}));
756
+ (function(Error) {
757
+ Error.InputSchema = v4_default().object({
758
+ message: v4_default().string().optional(),
759
+ results: v4_default().union([
760
+ v4_default().array(v4_default().unknown()),
761
+ v4_default().unknown()
762
+ ]).optional(),
763
+ type: TypeSchema.optional().default("success"),
764
+ code: CodeSchema,
765
+ status: v4_default().number().optional().default(200)
766
+ });
767
+ })(TypeControllerResponse.Error || (TypeControllerResponse.Error = {}));
768
+ })(_type_response_TypeControllerResponse || (_type_response_TypeControllerResponse = {}));
769
+ /* export default */ const _type_response = (_type_response_TypeControllerResponse);
770
+ var _type_response_TypeControllerResponse;
771
+
772
+ ;// CONCATENATED MODULE: ./src/types/index.ts
773
+ // ENTIDADES TIPADAS
774
+
775
+ //GERAL
776
+
777
+ (function(t) {
778
+ (function(Controller) {
779
+ Controller.Usuario = _usuario;
780
+ })(t.Controller || (t.Controller = {}));
781
+ (function(Geral) {
782
+ Geral.Response = _type_response;
783
+ })(t.Geral || (t.Geral = {}));
784
+ })(types_t || (types_t = {}));
785
+ /* export default */ const types = (types_t);
786
+ var types_t;
787
+
788
+ // EXTERNAL MODULE: ./src/utils/index.ts + 8 modules
789
+ var utils = __webpack_require__("./src/utils/index.ts");
790
+ ;// CONCATENATED MODULE: ./src/index.browser.ts
791
+
792
+
793
+
794
+
795
+ })();
796
+
797
+ exports.TypesCore = __webpack_exports__.TypesCore;
798
+ exports.config_env_core = __webpack_exports__.config_env_core;
799
+ exports.utils = __webpack_exports__.utils;
800
+ for(var __rspack_i in __webpack_exports__) {
801
+ if(["TypesCore","config_env_core","utils"].indexOf(__rspack_i) === -1) {
802
+ exports[__rspack_i] = __webpack_exports__[__rspack_i];
803
+ }
804
+ }
805
+ Object.defineProperty(exports, '__esModule', { value: true });