@praxisui/files-upload 10.0.0-rc.8 → 10.0.0-rc.81

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, signal, InjectionToken, Inject, Component, Optional, EventEmitter, ViewChild, Output, Input, ChangeDetectionStrategy, ENVIRONMENT_INITIALIZER } from '@angular/core';
2
+ import { Optional, Injectable, inject, signal, InjectionToken, Inject, Component, EventEmitter, ViewChild, Output, Input, ChangeDetectionStrategy, ENVIRONMENT_INITIALIZER } from '@angular/core';
3
3
  import { ActivatedRoute } from '@angular/router';
4
4
  import * as i18 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
@@ -21,19 +21,19 @@ import * as i7 from '@angular/material/select';
21
21
  import { MatSelectModule } from '@angular/material/select';
22
22
  import * as i1 from '@angular/common/http';
23
23
  import { HttpHeaders, HttpEventType, HttpResponse, HttpErrorResponse } from '@angular/common/http';
24
- import * as i1$2 from '@praxisui/core';
25
- import { providePraxisI18n, PraxisI18nService, PraxisIconButtonComponent, ComponentKeyService, ASYNC_CONFIG_STORAGE, PraxisIconDirective, ComponentMetadataRegistry } from '@praxisui/core';
24
+ import * as i2 from '@praxisui/core';
25
+ import { isPraxisContextualHeaderName, providePraxisI18n, PraxisI18nService, PraxisIconButtonComponent, isSafePraxisFileId, buildHeaders, API_URL, ComponentKeyService, ASYNC_CONFIG_STORAGE, PraxisIconDirective, normalizePraxisStoredFileMetadata, resolvePraxisFileOperationOptions, buildApiUrl, PRAXIS_FILE_UPLOAD_PORT, ComponentMetadataRegistry } from '@praxisui/core';
26
26
  import * as i3 from '@angular/material/tabs';
27
27
  import { MatTabsModule } from '@angular/material/tabs';
28
28
  import * as i6 from '@angular/material/checkbox';
29
29
  import { MatCheckboxModule } from '@angular/material/checkbox';
30
30
  import * as i9 from '@angular/material/tooltip';
31
31
  import { MatTooltipModule } from '@angular/material/tooltip';
32
- import * as i2 from '@angular/material/snack-bar';
32
+ import * as i2$1 from '@angular/material/snack-bar';
33
33
  import { MatSnackBarModule } from '@angular/material/snack-bar';
34
34
  import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
35
- import { of, throwError, BehaviorSubject, map as map$1, startWith, retry, debounceTime, from, Subscription } from 'rxjs';
36
- import * as i1$3 from '@praxisui/settings-panel';
35
+ import { of, throwError, BehaviorSubject, map as map$1, startWith, combineLatest, retry, timer, debounceTime, from, EMPTY, Subscription } from 'rxjs';
36
+ import * as i1$2 from '@praxisui/settings-panel';
37
37
  import { SETTINGS_PANEL_DATA } from '@praxisui/settings-panel';
38
38
  import { map, catchError, take, concatMap, toArray, tap, filter, defaultIfEmpty } from 'rxjs/operators';
39
39
  import { TemplatePortal } from '@angular/cdk/portal';
@@ -52,16 +52,13 @@ function getPrimaryErrorItem(error) {
52
52
  if (!error) {
53
53
  return undefined;
54
54
  }
55
- if (isStructuredErrorItem(error) && !isErrorEnvelope(error)) {
56
- return error;
57
- }
58
- if (!isErrorEnvelope(error)) {
59
- return undefined;
60
- }
61
- const structured = error.errors?.[0];
55
+ const structured = isErrorEnvelope(error) ? error.errors?.[0] : undefined;
62
56
  if (structured) {
63
57
  return structured;
64
58
  }
59
+ if (isStructuredErrorItem(error)) {
60
+ return error;
61
+ }
65
62
  return undefined;
66
63
  }
67
64
 
@@ -92,6 +89,8 @@ var ScanStatus;
92
89
  ScanStatus["CLEAN"] = "CLEAN";
93
90
  ScanStatus["INFECTED"] = "INFECTED";
94
91
  ScanStatus["FAILED"] = "FAILED";
92
+ ScanStatus["UNAVAILABLE"] = "UNAVAILABLE";
93
+ ScanStatus["SKIPPED"] = "SKIPPED";
95
94
  })(ScanStatus || (ScanStatus = {}));
96
95
 
97
96
  /** Result status for each file in a bulk upload operation. */
@@ -107,13 +106,17 @@ var BulkUploadResultStatus;
107
106
  */
108
107
  class ConfigService {
109
108
  http;
109
+ runtimeContext;
110
110
  cache = new Map();
111
- constructor(http) {
111
+ constructor(http, runtimeContext) {
112
112
  this.http = http;
113
+ this.runtimeContext = runtimeContext;
113
114
  }
114
115
  buildCacheKey(baseUrl, headers) {
115
- const headerKey = JSON.stringify(headers);
116
- return `${baseUrl}|${headerKey}`;
116
+ const normalizedEntries = Array.from(headers.entries())
117
+ .sort(([a], [b]) => a.localeCompare(b))
118
+ .map(([lowerKey, entry]) => [lowerKey, entry.value]);
119
+ return `${baseUrl}|${JSON.stringify(normalizedEntries)}`;
117
120
  }
118
121
  /**
119
122
  * Fetches the effective configuration from the server.
@@ -121,22 +124,52 @@ class ConfigService {
121
124
  * @param headersProvider Optional callback providing additional headers such as tenant/user.
122
125
  */
123
126
  getEffectiveConfig(baseUrl = '/api/files', headersProvider) {
127
+ const cleanBase = (baseUrl ?? '').trim().replace(/\/+$/, '') || '/api/files';
124
128
  const now = Date.now();
125
- const headersObj = headersProvider ? headersProvider() : {};
126
- const key = this.buildCacheKey(baseUrl, headersObj);
129
+ const hasEnterpriseContext = Boolean(this.runtimeContext
130
+ && (this.runtimeContext.effectiveContext
131
+ || this.runtimeContext.snapshot
132
+ || this.runtimeContext.isSwitching
133
+ || this.runtimeContext.lifecycleState() !== 'idle'));
134
+ const headerEntries = new Map();
135
+ const applySource = (source, excludeContextual) => {
136
+ if (!source) {
137
+ return;
138
+ }
139
+ for (const [name, raw] of Object.entries(source)) {
140
+ if (excludeContextual && isPraxisContextualHeaderName(name)) {
141
+ continue;
142
+ }
143
+ if (typeof raw === 'string' && raw.trim()) {
144
+ headerEntries.set(name.toLowerCase(), { name, value: raw.trim() });
145
+ }
146
+ }
147
+ };
148
+ if (hasEnterpriseContext && this.runtimeContext?.effectiveRequestHeaders) {
149
+ applySource(this.runtimeContext.effectiveRequestHeaders(), false);
150
+ }
151
+ applySource(headersProvider ? headersProvider() : undefined, hasEnterpriseContext);
152
+ const key = this.buildCacheKey(cleanBase, headerEntries);
127
153
  const entry = this.cache.get(key);
128
154
  if (entry && now - entry.timestamp < 60_000) {
129
155
  return of(entry.data);
130
156
  }
131
- const url = `${baseUrl}/config`;
157
+ const url = `${cleanBase}/config`;
158
+ let headers = new HttpHeaders();
159
+ for (const item of headerEntries.values()) {
160
+ headers = headers.set(item.name, item.value);
161
+ }
132
162
  if (entry?.etag) {
133
- headersObj['If-None-Match'] = entry.etag;
163
+ headers = headers.set('If-None-Match', entry.etag);
164
+ }
165
+ if (this.runtimeContext) {
166
+ headers = this.runtimeContext.applyHeaders(headers);
134
167
  }
135
- const headers = new HttpHeaders(headersObj);
136
168
  return this.http
137
169
  .get(url, {
138
170
  observe: 'response',
139
171
  headers,
172
+ withCredentials: true,
140
173
  })
141
174
  .pipe(map((resp) => {
142
175
  const etag = resp.headers.get('ETag') || undefined;
@@ -158,13 +191,15 @@ class ConfigService {
158
191
  return throwError(() => err);
159
192
  }));
160
193
  }
161
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ConfigService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
194
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ConfigService, deps: [{ token: i1.HttpClient }, { token: i2.EnterpriseRuntimeContextService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
162
195
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ConfigService, providedIn: 'root' });
163
196
  }
164
197
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ConfigService, decorators: [{
165
198
  type: Injectable,
166
199
  args: [{ providedIn: 'root' }]
167
- }], ctorParameters: () => [{ type: i1.HttpClient }] });
200
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.EnterpriseRuntimeContextService, decorators: [{
201
+ type: Optional
202
+ }] }] });
168
203
 
169
204
  /**
170
205
  * Angular composable that retrieves the effective upload configuration
@@ -210,56 +245,75 @@ function useEffectiveUploadConfig(baseUrl, headersProvider) {
210
245
  const DEFAULT_CATALOG = {
211
246
  [ErrorCode.FILE_TOO_LARGE]: {
212
247
  title: 'Arquivo muito grande',
248
+ titleEn: 'File too large',
213
249
  category: 'validacao',
214
250
  phase: 'pre-upload',
215
251
  severity: 'error',
252
+ retriable: false,
216
253
  userAction: 'Reduza o tamanho ou aumente o limite permitido.',
254
+ userActionEn: 'Reduce the file size or choose a smaller file within the allowed limit.',
217
255
  },
218
256
  [ErrorCode.INVALID_FILE_TYPE]: {
219
257
  title: 'Tipo de arquivo inválido',
258
+ titleEn: 'Invalid file type',
220
259
  category: 'validacao',
221
260
  phase: 'pre-upload',
222
261
  severity: 'error',
262
+ retriable: false,
223
263
  userAction: 'Ajuste a extensão/MIME conforme a política.',
264
+ userActionEn: 'Choose a file whose extension and MIME type match the active policy.',
224
265
  },
225
266
  [ErrorCode.FMT_UNSUPPORTED]: {
226
267
  title: 'Formato não suportado',
268
+ titleEn: 'Unsupported format',
227
269
  category: 'validacao',
228
270
  phase: 'analise',
229
271
  severity: 'error',
272
+ retriable: false,
230
273
  },
231
274
  [ErrorCode.FMT_MAGIC_MISMATCH]: {
232
275
  title: 'Conteúdo incompatível',
276
+ titleEn: 'Incompatible content',
233
277
  category: 'validacao',
234
278
  phase: 'analise',
235
279
  severity: 'error',
280
+ retriable: false,
236
281
  },
237
282
  [ErrorCode.FMT_CORRUPTED]: {
238
283
  title: 'Arquivo corrompido',
284
+ titleEn: 'Corrupted file',
239
285
  category: 'validacao',
240
286
  phase: 'analise',
241
287
  severity: 'error',
288
+ retriable: false,
242
289
  },
243
290
  [ErrorCode.SEC_DANGEROUS_TYPE]: {
244
291
  title: 'Tipo perigoso bloqueado',
292
+ titleEn: 'Dangerous file type blocked',
245
293
  category: 'seguranca',
246
294
  phase: 'pre-upload',
247
295
  severity: 'error',
296
+ retriable: false,
248
297
  },
249
298
  [ErrorCode.SEC_VIRUS_DETECTED]: {
250
299
  title: 'Vírus detectado',
300
+ titleEn: 'Virus detected',
251
301
  category: 'seguranca',
252
302
  phase: 'analise',
253
303
  severity: 'error',
304
+ retriable: false,
254
305
  },
255
306
  [ErrorCode.SEC_MALICIOUS_CONTENT]: {
256
307
  title: 'Malware detectado',
308
+ titleEn: 'Malware detected',
257
309
  category: 'seguranca',
258
310
  phase: 'analise',
259
311
  severity: 'error',
312
+ retriable: false,
260
313
  },
261
314
  [ErrorCode.SYS_STORAGE_ERROR]: {
262
315
  title: 'Erro de armazenamento',
316
+ titleEn: 'Storage error',
263
317
  category: 'armazenamento',
264
318
  phase: 'armazenamento',
265
319
  severity: 'error',
@@ -267,6 +321,7 @@ const DEFAULT_CATALOG = {
267
321
  },
268
322
  [ErrorCode.RATE_LIMIT_EXCEEDED]: {
269
323
  title: 'Limite de taxa excedido',
324
+ titleEn: 'Rate limit exceeded',
270
325
  category: 'limites',
271
326
  phase: 'operacional',
272
327
  severity: 'warn',
@@ -274,6 +329,7 @@ const DEFAULT_CATALOG = {
274
329
  },
275
330
  [ErrorCode.SYS_RATE_LIMIT]: {
276
331
  title: 'Limite de requisições excedido',
332
+ titleEn: 'Request limit exceeded',
277
333
  category: 'limites',
278
334
  phase: 'operacional',
279
335
  severity: 'warn',
@@ -281,12 +337,15 @@ const DEFAULT_CATALOG = {
281
337
  },
282
338
  [ErrorCode.QUOTA_EXCEEDED]: {
283
339
  title: 'Cota excedida',
340
+ titleEn: 'Quota exceeded',
284
341
  category: 'limites',
285
342
  phase: 'operacional',
286
343
  severity: 'warn',
344
+ retriable: false,
287
345
  },
288
346
  [ErrorCode.INTERNAL_ERROR]: {
289
347
  title: 'Erro interno',
348
+ titleEn: 'Internal error',
290
349
  category: 'operacional',
291
350
  phase: 'operacional',
292
351
  severity: 'error',
@@ -294,103 +353,195 @@ const DEFAULT_CATALOG = {
294
353
  },
295
354
  [ErrorCode.UNAUTHORIZED]: {
296
355
  title: 'Não autorizado',
356
+ titleEn: 'Unauthorized',
297
357
  category: 'operacional',
298
358
  phase: 'operacional',
299
359
  severity: 'error',
360
+ retriable: false,
300
361
  },
301
362
  [ErrorCode.NOT_FOUND]: {
302
363
  title: 'Não encontrado',
364
+ titleEn: 'Not found',
303
365
  category: 'operacional',
304
366
  phase: 'operacional',
305
367
  severity: 'warn',
368
+ retriable: false,
306
369
  },
307
370
  // Alias de mensagens de config (strings do backend fora do enum)
308
- INVALID_TYPE: { title: 'Tipo de arquivo inválido', category: 'validacao', phase: 'pre-upload', severity: 'error' },
309
- UNSUPPORTED_FILE_TYPE: { title: 'Tipo não suportado', category: 'validacao', phase: 'analise', severity: 'error' },
310
- MAGIC_NUMBER_MISMATCH: { title: 'Assinatura incompatível', category: 'validacao', phase: 'analise', severity: 'error' },
311
- CORRUPTED_FILE: { title: 'Arquivo corrompido', category: 'validacao', phase: 'analise', severity: 'error' },
312
- DANGEROUS_FILE_TYPE: { title: 'Tipo perigoso bloqueado', category: 'seguranca', phase: 'pre-upload', severity: 'error' },
313
- DANGEROUS_EXECUTABLE: { title: 'Executável bloqueado', category: 'seguranca', phase: 'analise', severity: 'error' },
314
- MALWARE_DETECTED: { title: 'Malware detectado', category: 'seguranca', phase: 'analise', severity: 'error' },
315
- VIRUS_DETECTED: { title: 'Vírus detectado', category: 'seguranca', phase: 'analise', severity: 'error' },
316
- FILE_STORE_ERROR: { title: 'Erro ao armazenar arquivo', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
317
- FILE_STORAGE_FAILED: { title: 'Falha ao armazenar arquivo', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
318
- VIRUS_SCAN_ERROR: { title: 'Erro no antivírus', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
319
- VIRUS_SCAN_FAILED: { title: 'Antivírus falhou', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
320
- VIRUS_SCAN_UNAVAILABLE: { title: 'Antivírus indisponível', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
321
- IO_ERROR: { title: 'Erro de entrada/saída', category: 'rede', phase: 'operacional', severity: 'error', retriable: true },
322
- UPLOAD_TIMEOUT: { title: 'Tempo esgotado no upload', category: 'operacional', phase: 'operacional', severity: 'warn', retriable: true },
323
- BULK_UPLOAD_TIMEOUT: { title: 'Tempo esgotado no upload em lote', category: 'operacional', phase: 'lote', severity: 'warn', retriable: true },
324
- BULK_UPLOAD_CANCELLED: { title: 'Upload em lote cancelado', category: 'operacional', phase: 'lote', severity: 'warn' },
325
- MIME_TYPE_MISMATCH: { title: 'MIME não corresponde', category: 'validacao', phase: 'analise', severity: 'error' },
326
- FILE_STRUCTURE_ERROR: { title: 'Estrutura inválida', category: 'validacao', phase: 'analise', severity: 'error' },
327
- STRUCTURE_VALIDATION_FAILED: { title: 'Validação de estrutura falhou', category: 'validacao', phase: 'analise', severity: 'error' },
328
- EMPTY_FILE: { title: 'Arquivo vazio', category: 'validacao', phase: 'pre-upload', severity: 'error' },
329
- INVALID_JSON_OPTIONS: { title: 'JSON de opções inválido', category: 'config', phase: 'operacional', severity: 'error' },
330
- OPCOES_JSON_INVALIDAS: { title: 'JSON de opções inválido', category: 'config', phase: 'operacional', severity: 'error', userAction: 'Corrija a sintaxe do JSON enviado no campo options.' },
331
- EMPTY_FILENAME: { title: 'Nome do arquivo obrigatório', category: 'validacao', phase: 'pre-upload', severity: 'error' },
332
- FILE_ANALYSIS_ERROR: { title: 'Erro na análise do arquivo', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
333
- CONFIGURATION_ERROR: { title: 'Erro de configuração', category: 'config', phase: 'operacional', severity: 'error' },
334
- SECURITY_VIOLATION: { title: 'Violação de segurança', category: 'seguranca', phase: 'pre-upload', severity: 'error' },
335
- CONFLICT_POLICY_ERROR: { title: 'Erro de política de conflito', category: 'conflito', phase: 'operacional', severity: 'error' },
336
- CONFLICT_POLICY_SKIP: { title: 'Arquivo ignorado por política', category: 'conflito', phase: 'operacional', severity: 'info' },
337
- FILE_EXISTS: { title: 'Arquivo já existe', category: 'conflito', phase: 'operacional', severity: 'warn' },
338
- PATH_TRAVERSAL: { title: 'Path traversal detectado', category: 'seguranca', phase: 'pre-upload', severity: 'error' },
339
- INSUFFICIENT_STORAGE: { title: 'Sem espaço em disco', category: 'armazenamento', phase: 'armazenamento', severity: 'error' },
340
- SIGNATURE_MISMATCH: { title: 'Assinatura não corresponde', category: 'validacao', phase: 'analise', severity: 'error' },
341
- SUSPICIOUS_STRUCTURE: { title: 'Estrutura suspeita', category: 'seguranca', phase: 'analise', severity: 'warn' },
342
- INVALID_FILE_SIZE_CONFIG: { title: 'Configuração de tamanho inválida', category: 'config', phase: 'operacional', severity: 'error' },
343
- USER_CANCELLED: { title: 'Upload cancelado pelo usuário', category: 'operacional', phase: 'operacional', severity: 'info' },
344
- SYSTEM_POLICY_BLOCKED: { title: 'Bloqueado por política do sistema', category: 'operacional', phase: 'operacional', severity: 'error' },
345
- SUSPICIOUS_EXTENSION_BLOCKED: { title: 'Extensão suspeita bloqueada', category: 'seguranca', phase: 'pre-upload', severity: 'warn' },
346
- DANGEROUS_SCRIPT: { title: 'Script perigoso detectado', category: 'seguranca', phase: 'analise', severity: 'error' },
347
- BATCH_SIZE_EXCEEDED: { title: 'Quantidade por lote excedida', category: 'validacao', phase: 'pre-upload', severity: 'error' },
348
- EMBEDDED_EXECUTABLE: { title: 'Executável incorporado', category: 'seguranca', phase: 'analise', severity: 'warn' },
349
- INVALID_PATH: { title: 'Caminho inválido', category: 'validacao', phase: 'pre-upload', severity: 'error' },
350
- FAILED_TO_ANALYZE: { title: 'Falha ao analisar', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
351
- ZIP_BOMB_DETECTED: { title: 'Possível zip bomb', category: 'seguranca', phase: 'analise', severity: 'error' },
352
- UNKNOWN_ERROR: { title: 'Erro desconhecido', category: 'operacional', phase: 'operacional', severity: 'error', retriable: true },
371
+ INVALID_TYPE: { title: 'Tipo de arquivo inválido', titleEn: 'Invalid file type', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
372
+ UNSUPPORTED_FILE_TYPE: { title: 'Tipo não suportado', titleEn: 'Unsupported file type', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
373
+ MAGIC_NUMBER_MISMATCH: { title: 'Assinatura incompatível', titleEn: 'Incompatible signature', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
374
+ CORRUPTED_FILE: { title: 'Arquivo corrompido', titleEn: 'Corrupted file', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
375
+ DANGEROUS_FILE_TYPE: { title: 'Tipo perigoso bloqueado', titleEn: 'Dangerous file type blocked', category: 'seguranca', phase: 'pre-upload', severity: 'error', retriable: false },
376
+ DANGEROUS_EXECUTABLE: { title: 'Executável bloqueado', titleEn: 'Executable blocked', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
377
+ MALWARE_DETECTED: { title: 'Malware detectado', titleEn: 'Malware detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
378
+ VIRUS_DETECTED: { title: 'Vírus detectado', titleEn: 'Virus detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
379
+ FILE_STORE_ERROR: { title: 'Erro ao armazenar arquivo', titleEn: 'Error storing file', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
380
+ FILE_STORAGE_FAILED: { title: 'Falha ao armazenar arquivo', titleEn: 'Failed to store file', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
381
+ VIRUS_SCAN_ERROR: { title: 'Erro no antivírus', titleEn: 'Antivirus error', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
382
+ VIRUS_SCAN_FAILED: { title: 'Antivírus falhou', titleEn: 'Antivirus scan failed', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
383
+ VIRUS_SCAN_UNAVAILABLE: { title: 'Antivírus indisponível', titleEn: 'Antivirus unavailable', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
384
+ IO_ERROR: { title: 'Erro de entrada/saída', titleEn: 'Input/output error', category: 'rede', phase: 'operacional', severity: 'error', retriable: true },
385
+ UPLOAD_TIMEOUT: { title: 'Tempo esgotado no upload', titleEn: 'Upload timed out', category: 'operacional', phase: 'operacional', severity: 'warn', retriable: true },
386
+ BULK_UPLOAD_TIMEOUT: { title: 'Tempo esgotado no upload em lote', titleEn: 'Bulk upload timed out', category: 'operacional', phase: 'lote', severity: 'warn', retriable: true },
387
+ BULK_UPLOAD_CANCELLED: { title: 'Upload em lote cancelado', titleEn: 'Bulk upload cancelled', category: 'operacional', phase: 'lote', severity: 'warn', retriable: false },
388
+ MIME_TYPE_MISMATCH: { title: 'MIME não corresponde', titleEn: 'MIME mismatch', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
389
+ FILE_STRUCTURE_ERROR: { title: 'Estrutura inválida', titleEn: 'Invalid file structure', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
390
+ STRUCTURE_VALIDATION_FAILED: { title: 'Validação de estrutura falhou', titleEn: 'Structure validation failed', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
391
+ EMPTY_FILE: { title: 'Arquivo vazio', titleEn: 'Empty file', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
392
+ INVALID_JSON_OPTIONS: { title: 'JSON de opções inválido', titleEn: 'Invalid JSON options', category: 'config', phase: 'operacional', severity: 'error', retriable: false },
393
+ OPCOES_JSON_INVALIDAS: {
394
+ title: 'JSON de opções inválido',
395
+ titleEn: 'Invalid JSON options',
396
+ category: 'config',
397
+ phase: 'operacional',
398
+ severity: 'error',
399
+ retriable: false,
400
+ userAction: 'Corrija a sintaxe do JSON enviado no campo options.',
401
+ userActionEn: 'Fix the JSON syntax provided in the options field.',
402
+ },
403
+ CAMPO_OBRIGATORIO_AUSENTE: { title: 'Campo obrigatório ausente', titleEn: 'Required field missing', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
404
+ ARGUMENTO_INVALIDO: { title: 'Argumento inválido', titleEn: 'Invalid argument', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
405
+ EMPTY_FILENAME: { title: 'Nome do arquivo obrigatório', titleEn: 'File name required', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
406
+ FILE_ANALYSIS_ERROR: { title: 'Erro na análise do arquivo', titleEn: 'File analysis error', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
407
+ CONFIGURATION_ERROR: { title: 'Erro de configuração', titleEn: 'Configuration error', category: 'config', phase: 'operacional', severity: 'error', retriable: false },
408
+ SECURITY_VIOLATION: { title: 'Violação de segurança', titleEn: 'Security violation', category: 'seguranca', phase: 'pre-upload', severity: 'error', retriable: false },
409
+ CONFLICT_POLICY_ERROR: { title: 'Erro de política de conflito', titleEn: 'Conflict policy error', category: 'conflito', phase: 'operacional', severity: 'error', retriable: false },
410
+ CONFLICT_POLICY_SKIP: { title: 'Arquivo ignorado por política', titleEn: 'File skipped by conflict policy', category: 'conflito', phase: 'operacional', severity: 'info', retriable: false },
411
+ FILE_EXISTS: { title: 'Arquivo já existe', titleEn: 'File already exists', category: 'conflito', phase: 'operacional', severity: 'warn', retriable: false },
412
+ PATH_TRAVERSAL: { title: 'Path traversal detectado', titleEn: 'Path traversal detected', category: 'seguranca', phase: 'pre-upload', severity: 'error', retriable: false },
413
+ INSUFFICIENT_STORAGE: { title: 'Sem espaço em disco', titleEn: 'Insufficient storage', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: false },
414
+ SIGNATURE_MISMATCH: { title: 'Assinatura não corresponde', titleEn: 'Signature mismatch', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
415
+ SUSPICIOUS_STRUCTURE: { title: 'Estrutura suspeita', titleEn: 'Suspicious structure', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: false },
416
+ INVALID_FILE_SIZE_CONFIG: { title: 'Configuração de tamanho inválida', titleEn: 'Invalid size configuration', category: 'config', phase: 'operacional', severity: 'error', retriable: false },
417
+ USER_CANCELLED: { title: 'Upload cancelado pelo usuário', titleEn: 'Upload cancelled by user', category: 'operacional', phase: 'operacional', severity: 'info', retriable: false },
418
+ SYSTEM_POLICY_BLOCKED: { title: 'Bloqueado por política do sistema', titleEn: 'Blocked by system policy', category: 'operacional', phase: 'operacional', severity: 'error', retriable: false },
419
+ SUSPICIOUS_EXTENSION_BLOCKED: { title: 'Extensão suspeita bloqueada', titleEn: 'Suspicious extension blocked', category: 'seguranca', phase: 'pre-upload', severity: 'warn', retriable: false },
420
+ DANGEROUS_SCRIPT: { title: 'Script perigoso detectado', titleEn: 'Dangerous script detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
421
+ BATCH_SIZE_EXCEEDED: { title: 'Quantidade por lote excedida', titleEn: 'Batch limit exceeded', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
422
+ EMBEDDED_EXECUTABLE: { title: 'Executável incorporado', titleEn: 'Embedded executable detected', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: false },
423
+ INVALID_PATH: { title: 'Caminho inválido', titleEn: 'Invalid path', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
424
+ FAILED_TO_ANALYZE: { title: 'Falha ao analisar', titleEn: 'Analysis failed', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
425
+ ZIP_BOMB_DETECTED: { title: 'Possível zip bomb', titleEn: 'Zip bomb detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
426
+ UNKNOWN_ERROR: { title: 'Erro desconhecido', titleEn: 'Unknown error', category: 'operacional', phase: 'operacional', severity: 'error', retriable: true },
353
427
  // Aliases PT-BR adicionais para os códigos específicos do backend
354
- ARQUIVO_VAZIO: { title: 'Arquivo vazio', category: 'validacao', phase: 'pre-upload', severity: 'error' },
355
- ASSINATURA_INVALIDA: { title: 'Assinatura não corresponde', category: 'validacao', phase: 'analise', severity: 'error' },
356
- ARQUIVO_EXECUTAVEL_PERIGOSO: { title: 'Executável bloqueado', category: 'seguranca', phase: 'analise', severity: 'error' },
357
- SCRIPT_PERIGOSO: { title: 'Script perigoso detectado', category: 'seguranca', phase: 'analise', severity: 'error' },
358
- ARQUIVO_CORROMPIDO: { title: 'Arquivo corrompido', category: 'validacao', phase: 'analise', severity: 'error' },
359
- ESTRUTURA_SUSPEITA: { title: 'Estrutura suspeita', category: 'seguranca', phase: 'analise', severity: 'warn' },
360
- MAGIC_NUMBER_INCOMPATIVEL: { title: 'Assinatura incompatível', category: 'validacao', phase: 'analise', severity: 'error' },
361
- TIPO_ARQUIVO_PERIGOSO: { title: 'Tipo perigoso bloqueado', category: 'seguranca', phase: 'pre-upload', severity: 'error' },
362
- SCANNER_VIRUS_INDISPONIVEL: { title: 'Antivírus indisponível', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
363
- EXTENSAO_SUSPEITA_BLOQUEADA: { title: 'Extensão suspeita bloqueada', category: 'seguranca', phase: 'pre-upload', severity: 'warn' },
364
- TIPO_NAO_SUPORTADO: { title: 'Tipo não suportado', category: 'validacao', phase: 'analise', severity: 'error' },
365
- NOME_ARQUIVO_INVALIDO: { title: 'Nome de arquivo inválido', category: 'validacao', phase: 'pre-upload', severity: 'error' },
366
- TEMPO_ESGOTADO_UPLOAD: { title: 'Tempo esgotado no upload', category: 'operacional', phase: 'operacional', severity: 'warn', retriable: true },
367
- TEMPO_ESGOTADO_UPLOAD_LOTE: { title: 'Tempo esgotado no upload em lote', category: 'operacional', phase: 'lote', severity: 'warn', retriable: true },
368
- ERRO_IO: { title: 'Erro de entrada/saída', category: 'rede', phase: 'operacional', severity: 'error', retriable: true },
369
- ESPAÇO_INSUFICIENTE: { title: 'Sem espaço em disco', category: 'armazenamento', phase: 'armazenamento', severity: 'error' },
370
- UPLOAD_LOTE_CANCELADO: { title: 'Upload em lote cancelado', category: 'operacional', phase: 'lote', severity: 'warn' },
371
- UPLOAD_CANCELADO_USUARIO: { title: 'Upload cancelado pelo usuário', category: 'operacional', phase: 'operacional', severity: 'info' },
372
- TAMANHO_LOTE_EXCEDIDO: { title: 'Quantidade por lote excedida', category: 'validacao', phase: 'pre-upload', severity: 'error' },
373
- TIPO_MIME_INCOMPATIVEL: { title: 'MIME não corresponde', category: 'validacao', phase: 'analise', severity: 'error' },
374
- VIOLACAO_SEGURANCA: { title: 'Violação de segurança', category: 'seguranca', phase: 'pre-upload', severity: 'error' },
375
- ERRO_DESCONHECIDO: { title: 'Erro interno do sistema', category: 'operacional', phase: 'operacional', severity: 'error' },
376
- BLOQUEADO_POLITICA_SISTEMA: { title: 'Bloqueado por política do sistema', category: 'operacional', phase: 'operacional', severity: 'error' },
377
- FALHA_ESCANEAMENTO_VIRUS: { title: 'Antivírus falhou', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
378
- FALHA_VALIDACAO_ESTRUTURA: { title: 'Validação de estrutura falhou', category: 'validacao', phase: 'analise', severity: 'error' },
379
- CONFIGURACAO_TAMANHO_INVALIDA: { title: 'Configuração de tamanho inválida', category: 'config', phase: 'operacional', severity: 'error' },
380
- FALHA_ARMAZENAMENTO: { title: 'Falha ao armazenar arquivo', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
381
- ERRO_ARMAZENAMENTO_ARQUIVO: { title: 'Erro ao armazenar arquivo', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
382
- NOME_ARQUIVO_VAZIO: { title: 'Nome do arquivo obrigatório', category: 'validacao', phase: 'pre-upload', severity: 'error' },
383
- ERRO_ANALISE_ARQUIVO: { title: 'Erro na análise do arquivo', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
384
- ERRO_ESTRUTURA_ARQUIVO: { title: 'Erro na estrutura do arquivo', category: 'validacao', phase: 'analise', severity: 'error' },
385
- CAMINHO_INVALIDO: { title: 'Caminho inválido', category: 'validacao', phase: 'pre-upload', severity: 'error' },
386
- ERRO_CONFIGURACAO: { title: 'Erro de configuração', category: 'config', phase: 'operacional', severity: 'error' },
387
- ERRO_ESCANEAMENTO_VIRUS: { title: 'Erro no antivírus', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
388
- FALHA_ANALISE_ARQUIVO: { title: 'Falha ao analisar', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
389
- ERRO_POLITICA_CONFLITO: { title: 'Erro de política de conflito', category: 'conflito', phase: 'operacional', severity: 'error' },
390
- POLITICA_CONFLITO_IGNORAR: { title: 'Arquivo ignorado por política', category: 'conflito', phase: 'operacional', severity: 'info' },
428
+ ARQUIVO_VAZIO: { title: 'Arquivo vazio', titleEn: 'Empty file', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
429
+ ASSINATURA_INVALIDA: { title: 'Assinatura não corresponde', titleEn: 'Signature mismatch', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
430
+ ARQUIVO_EXECUTAVEL_PERIGOSO: { title: 'Executável bloqueado', titleEn: 'Executable blocked', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
431
+ SCRIPT_PERIGOSO: { title: 'Script perigoso detectado', titleEn: 'Dangerous script detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
432
+ ARQUIVO_CORROMPIDO: { title: 'Arquivo corrompido', titleEn: 'Corrupted file', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
433
+ ESTRUTURA_SUSPEITA: { title: 'Estrutura suspeita', titleEn: 'Suspicious structure', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: false },
434
+ ZIP_BOMB_DETECTADO: { title: 'Possível zip bomb', titleEn: 'Zip bomb detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
435
+ EXECUTAVEL_INCORPORADO: { title: 'Executável incorporado', titleEn: 'Embedded executable detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
436
+ MALWARE_DETECTADO: { title: 'Malware detectado', titleEn: 'Malware detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
437
+ VIRUS_DETECTADO: { title: 'Vírus detectado', titleEn: 'Virus detected', category: 'seguranca', phase: 'analise', severity: 'error', retriable: false },
438
+ MAGIC_NUMBER_INCOMPATIVEL: { title: 'Assinatura incompatível', titleEn: 'Incompatible signature', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
439
+ TIPO_ARQUIVO_PERIGOSO: { title: 'Tipo perigoso bloqueado', titleEn: 'Dangerous file type blocked', category: 'seguranca', phase: 'pre-upload', severity: 'error', retriable: false },
440
+ SCANNER_VIRUS_INDISPONIVEL: { title: 'Antivírus indisponível', titleEn: 'Antivirus unavailable', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
441
+ EXTENSAO_SUSPEITA_BLOQUEADA: { title: 'Extensão suspeita bloqueada', titleEn: 'Suspicious extension blocked', category: 'seguranca', phase: 'pre-upload', severity: 'warn', retriable: false },
442
+ TIPO_NAO_SUPORTADO: { title: 'Tipo não suportado', titleEn: 'Unsupported file type', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
443
+ NOME_ARQUIVO_INVALIDO: { title: 'Nome de arquivo inválido', titleEn: 'Invalid file name', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
444
+ TEMPO_ESGOTADO_UPLOAD: { title: 'Tempo esgotado no upload', titleEn: 'Upload timed out', category: 'operacional', phase: 'operacional', severity: 'warn', retriable: true },
445
+ TEMPO_ESGOTADO_UPLOAD_LOTE: { title: 'Tempo esgotado no upload em lote', titleEn: 'Bulk upload timed out', category: 'operacional', phase: 'lote', severity: 'warn', retriable: true },
446
+ ERRO_IO: { title: 'Erro de entrada/saída', titleEn: 'Input/output error', category: 'rede', phase: 'operacional', severity: 'error', retriable: true },
447
+ ESPAÇO_INSUFICIENTE: { title: 'Sem espaço em disco', titleEn: 'Insufficient storage', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: false },
448
+ ESPACO_INSUFICIENTE: { title: 'Sem espaço em disco', titleEn: 'Insufficient storage', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: false },
449
+ UPLOAD_LOTE_CANCELADO: { title: 'Upload em lote cancelado', titleEn: 'Bulk upload cancelled', category: 'operacional', phase: 'lote', severity: 'warn', retriable: false },
450
+ UPLOAD_CANCELADO_USUARIO: { title: 'Upload cancelado pelo usuário', titleEn: 'Upload cancelled by user', category: 'operacional', phase: 'operacional', severity: 'info', retriable: false },
451
+ TAMANHO_LOTE_EXCEDIDO: { title: 'Quantidade por lote excedida', titleEn: 'Batch limit exceeded', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
452
+ TIPO_MIME_INCOMPATIVEL: { title: 'MIME não corresponde', titleEn: 'MIME mismatch', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
453
+ VIOLACAO_SEGURANCA: { title: 'Violação de segurança', titleEn: 'Security violation', category: 'seguranca', phase: 'pre-upload', severity: 'error', retriable: false },
454
+ LIMITE_TAXA_EXCEDIDO: { title: 'Limite de taxa excedido', titleEn: 'Rate limit exceeded', category: 'limites', phase: 'operacional', severity: 'warn', retriable: true },
455
+ COTA_EXCEDIDA: { title: 'Cota excedida', titleEn: 'Quota exceeded', category: 'limites', phase: 'operacional', severity: 'warn', retriable: false },
456
+ ARQUIVO_NAO_ENCONTRADO: { title: 'Arquivo não encontrado', titleEn: 'File not found', category: 'operacional', phase: 'operacional', severity: 'warn', retriable: false },
457
+ ACESSO_NEGADO: { title: 'Acesso negado', titleEn: 'Access denied', category: 'seguranca', phase: 'operacional', severity: 'error', retriable: false },
458
+ ERRO_DESCONHECIDO: { title: 'Erro interno do sistema', titleEn: 'Internal system error', category: 'operacional', phase: 'operacional', severity: 'error', retriable: true },
459
+ BLOQUEADO_POLITICA_SISTEMA: { title: 'Bloqueado por política do sistema', titleEn: 'Blocked by system policy', category: 'operacional', phase: 'operacional', severity: 'error', retriable: false },
460
+ FALHA_ESCANEAMENTO_VIRUS: { title: 'Antivírus falhou', titleEn: 'Antivirus scan failed', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
461
+ FALHA_VALIDACAO_ESTRUTURA: { title: 'Validação de estrutura falhou', titleEn: 'Structure validation failed', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
462
+ CONFIGURACAO_TAMANHO_INVALIDA: { title: 'Configuração de tamanho inválida', titleEn: 'Invalid size configuration', category: 'config', phase: 'operacional', severity: 'error', retriable: false },
463
+ FALHA_ARMAZENAMENTO: { title: 'Falha ao armazenar arquivo', titleEn: 'Failed to store file', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
464
+ ERRO_ARMAZENAMENTO_ARQUIVO: { title: 'Erro ao armazenar arquivo', titleEn: 'Error storing file', category: 'armazenamento', phase: 'armazenamento', severity: 'error', retriable: true },
465
+ NOME_ARQUIVO_VAZIO: { title: 'Nome do arquivo obrigatório', titleEn: 'File name required', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
466
+ ERRO_ANALISE_ARQUIVO: { title: 'Erro na análise do arquivo', titleEn: 'File analysis error', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
467
+ ERRO_ESTRUTURA_ARQUIVO: { title: 'Erro na estrutura do arquivo', titleEn: 'Invalid file structure', category: 'validacao', phase: 'analise', severity: 'error', retriable: false },
468
+ CAMINHO_INVALIDO: { title: 'Caminho inválido', titleEn: 'Invalid path', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
469
+ ERRO_CONFIGURACAO: { title: 'Erro de configuração', titleEn: 'Configuration error', category: 'config', phase: 'operacional', severity: 'error', retriable: false },
470
+ ERRO_ESCANEAMENTO_VIRUS: { title: 'Erro no antivírus', titleEn: 'Antivirus error', category: 'seguranca', phase: 'analise', severity: 'warn', retriable: true },
471
+ FALHA_ANALISE_ARQUIVO: { title: 'Falha ao analisar', titleEn: 'Analysis failed', category: 'operacional', phase: 'analise', severity: 'error', retriable: true },
472
+ ERRO_POLITICA_CONFLITO: { title: 'Erro de política de conflito', titleEn: 'Conflict policy error', category: 'conflito', phase: 'operacional', severity: 'error', retriable: false },
473
+ POLITICA_CONFLITO_IGNORAR: { title: 'Arquivo ignorado por política', titleEn: 'File skipped by conflict policy', category: 'conflito', phase: 'operacional', severity: 'info', retriable: false },
474
+ ARQUIVO_MUITO_GRANDE: { title: 'Arquivo muito grande', titleEn: 'File too large', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
475
+ ARQUIVO_JA_EXISTE: { title: 'Arquivo já existe', titleEn: 'File already exists', category: 'conflito', phase: 'operacional', severity: 'warn', retriable: false },
476
+ TIPO_ARQUIVO_INVALIDO: { title: 'Tipo de arquivo inválido', titleEn: 'Invalid file type', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
477
+ TIPO_MIDIA_NAO_SUPORTADO: { title: 'Tipo de mídia não suportado', titleEn: 'Unsupported media type', category: 'validacao', phase: 'pre-upload', severity: 'error', retriable: false },
478
+ NAO_AUTORIZADO: { title: 'Autenticação necessária', titleEn: 'Authentication required', category: 'operacional', phase: 'operacional', severity: 'error', retriable: false },
479
+ ERRO_INTERNO: { title: 'Erro interno do servidor', titleEn: 'Internal server error', category: 'operacional', phase: 'operacional', severity: 'error', retriable: true },
480
+ ARQUIVO_SOB_RETENCAO: {
481
+ title: 'Arquivo sob retenção',
482
+ titleEn: 'File under retention hold',
483
+ category: 'conflito',
484
+ phase: 'operacional',
485
+ severity: 'warn',
486
+ retriable: false,
487
+ userAction: 'Aguarde a liberação da retenção ou conclusão da aprovação antes de excluir.',
488
+ userActionEn: 'Wait for the retention hold or pending approval to be released before deleting.',
489
+ },
490
+ CONFLITO_ESTADO: {
491
+ title: 'Conflito de estado do arquivo',
492
+ titleEn: 'File lifecycle conflict',
493
+ category: 'conflito',
494
+ phase: 'operacional',
495
+ severity: 'warn',
496
+ retriable: false,
497
+ userAction: 'Atualize os metadados do arquivo antes de tentar outra transição.',
498
+ userActionEn: 'Refresh the file metadata before attempting another lifecycle transition.',
499
+ },
500
+ EXCLUSAO_ATIVO_BLOQUEADA: {
501
+ title: 'Exclusão de arquivo confirmado bloqueada',
502
+ titleEn: 'Active file deletion blocked',
503
+ category: 'seguranca',
504
+ phase: 'operacional',
505
+ severity: 'error',
506
+ retriable: false,
507
+ userAction: 'Arquivos confirmados não podem ser excluídos pela política vigente.',
508
+ userActionEn: 'Confirmed files cannot be deleted under the current server policy.',
509
+ },
510
+ NO_FILES_PROVIDED: {
511
+ title: 'Nenhum arquivo enviado',
512
+ titleEn: 'No files provided',
513
+ category: 'validacao',
514
+ phase: 'pre-upload',
515
+ severity: 'error',
516
+ retriable: false,
517
+ userAction: 'Selecione ao menos um arquivo antes de enviar.',
518
+ userActionEn: 'Select at least one file before submitting.',
519
+ },
520
+ INVALID_OPTIONS_FORMAT: {
521
+ title: 'Formato de opções inválido',
522
+ titleEn: 'Invalid options format',
523
+ category: 'config',
524
+ phase: 'operacional',
525
+ severity: 'error',
526
+ retriable: false,
527
+ userAction: 'Verifique a formatação JSON do parâmetro options.',
528
+ userActionEn: 'Check the JSON format of the options parameter.',
529
+ },
391
530
  };
392
- function getErrorMeta(code) {
393
- return DEFAULT_CATALOG[code] ?? { title: code };
531
+ function getErrorMeta(code, locale) {
532
+ const entry = DEFAULT_CATALOG[code];
533
+ if (!entry) {
534
+ return { title: code };
535
+ }
536
+ const isEnglish = (locale ?? '').trim().toLowerCase().startsWith('en');
537
+ if (!isEnglish) {
538
+ return entry;
539
+ }
540
+ return {
541
+ ...entry,
542
+ title: entry.titleEn || entry.title,
543
+ ...(entry.userActionEn ? { userAction: entry.userActionEn } : {}),
544
+ };
394
545
  }
395
546
 
396
547
  const FILES_UPLOAD_EN_US = {
@@ -667,6 +818,84 @@ const FILES_UPLOAD_EN_US = {
667
818
  'praxis.filesUpload.errors.LIMITE_TAXA_EXCEDIDO': 'Rate limit exceeded.',
668
819
  'praxis.filesUpload.errors.COTA_EXCEDIDA': 'Quota exceeded.',
669
820
  'praxis.filesUpload.errors.ARQUIVO_JA_EXISTE': 'File already exists.',
821
+ 'praxis.filesUpload.errors.SCANNER_VIRUS_INDISPONIVEL': 'Antivirus scanner is currently unavailable. Please retry shortly.',
822
+ 'praxis.filesUpload.errors.MALWARE_DETECTADO': 'Malware detected in file.',
823
+ 'praxis.filesUpload.errors.VIRUS_DETECTADO': 'Virus detected in file.',
824
+ 'praxis.filesUpload.errors.ESTRUTURA_SUSPEITA': 'Suspicious document structure detected.',
825
+ 'praxis.filesUpload.errors.ARQUIVO_CORROMPIDO': 'Corrupted or unreadable file.',
826
+ 'praxis.filesUpload.errors.ZIP_BOMB_DETECTADO': 'Compressed archive exceeds safe extraction limits.',
827
+ 'praxis.filesUpload.errors.EXECUTAVEL_INCORPORADO': 'Embedded executable content detected.',
828
+ 'praxis.filesUpload.errors.TIPO_MIME_INCOMPATIVEL': 'File MIME type does not match its content.',
829
+ 'praxis.filesUpload.errors.ASSINATURA_INVALIDA': 'File signature does not match declared format.',
830
+ 'praxis.filesUpload.errors.MAGIC_NUMBER_INCOMPATIVEL': 'Binary content does not match declared extension.',
831
+ 'praxis.filesUpload.errors.ARQUIVO_VAZIO': 'Uploaded file is empty.',
832
+ 'praxis.filesUpload.errors.TIPO_NAO_SUPORTADO': 'Unsupported file type.',
833
+ 'praxis.filesUpload.errors.CAMINHO_INVALIDO': 'Invalid file path.',
834
+ 'praxis.filesUpload.errors.NOME_ARQUIVO_INVALIDO': 'Invalid file name.',
835
+ 'praxis.filesUpload.errors.ARQUIVO_EXECUTAVEL_PERIGOSO': 'Executable file blocked by security policy.',
836
+ 'praxis.filesUpload.errors.SCRIPT_PERIGOSO': 'Potentially dangerous script detected in file.',
837
+ 'praxis.filesUpload.errors.TIPO_ARQUIVO_PERIGOSO': 'Dangerous file type blocked by security policy.',
838
+ 'praxis.filesUpload.errors.EXTENSAO_SUSPEITA_BLOQUEADA': 'Suspicious file extension blocked by security policy.',
839
+ 'praxis.filesUpload.errors.VIOLACAO_SEGURANCA': 'File blocked due to security policy violation.',
840
+ 'praxis.filesUpload.errors.TEMPO_ESGOTADO_UPLOAD': 'File upload timed out.',
841
+ 'praxis.filesUpload.errors.TEMPO_ESGOTADO_UPLOAD_LOTE': 'Batch upload timed out.',
842
+ 'praxis.filesUpload.errors.ERRO_IO': 'Input/output error during upload.',
843
+ 'praxis.filesUpload.errors.ESPAÇO_INSUFICIENTE': 'Insufficient server storage.',
844
+ 'praxis.filesUpload.errors.ESPACO_INSUFICIENTE': 'Insufficient server storage.',
845
+ 'praxis.filesUpload.errors.ARQUIVO_NAO_ENCONTRADO': 'File not found.',
846
+ 'praxis.filesUpload.errors.ACESSO_NEGADO': 'You do not have permission to access or modify this file.',
847
+ 'praxis.filesUpload.errors.INVALID_TYPE': 'Invalid file type.',
848
+ 'praxis.filesUpload.errors.UNSUPPORTED_FILE_TYPE': 'Unsupported file type.',
849
+ 'praxis.filesUpload.errors.MAGIC_NUMBER_MISMATCH': 'File signature does not match extension.',
850
+ 'praxis.filesUpload.errors.CORRUPTED_FILE': 'Corrupted or unreadable file.',
851
+ 'praxis.filesUpload.errors.DANGEROUS_FILE_TYPE': 'Dangerous file type blocked by policy.',
852
+ 'praxis.filesUpload.errors.DANGEROUS_EXECUTABLE': 'Executable file blocked by security policy.',
853
+ 'praxis.filesUpload.errors.MALWARE_DETECTED': 'Malware detected in file.',
854
+ 'praxis.filesUpload.errors.VIRUS_DETECTED': 'Virus detected in file.',
855
+ 'praxis.filesUpload.errors.FILE_STORE_ERROR': 'Error storing file.',
856
+ 'praxis.filesUpload.errors.FILE_STORAGE_FAILED': 'Failed to store file.',
857
+ 'praxis.filesUpload.errors.VIRUS_SCAN_ERROR': 'Antivirus scanner error.',
858
+ 'praxis.filesUpload.errors.VIRUS_SCAN_FAILED': 'Antivirus scan failed.',
859
+ 'praxis.filesUpload.errors.VIRUS_SCAN_UNAVAILABLE': 'Antivirus scanner is currently unavailable.',
860
+ 'praxis.filesUpload.errors.IO_ERROR': 'Input/output error during upload.',
861
+ 'praxis.filesUpload.errors.MIME_TYPE_MISMATCH': 'File MIME type does not match content.',
862
+ 'praxis.filesUpload.errors.FILE_STRUCTURE_ERROR': 'Invalid file structure.',
863
+ 'praxis.filesUpload.errors.STRUCTURE_VALIDATION_FAILED': 'File structure validation failed.',
864
+ 'praxis.filesUpload.errors.EMPTY_FILE': 'Uploaded file is empty.',
865
+ 'praxis.filesUpload.errors.FILE_ANALYSIS_ERROR': 'Error analyzing uploaded file.',
866
+ 'praxis.filesUpload.errors.CONFIGURATION_ERROR': 'Upload configuration error.',
867
+ 'praxis.filesUpload.errors.SECURITY_VIOLATION': 'Blocked due to security policy violation.',
868
+ 'praxis.filesUpload.errors.CONFLICT_POLICY_ERROR': 'Conflict policy error.',
869
+ 'praxis.filesUpload.errors.CONFLICT_POLICY_SKIP': 'File skipped by conflict policy.',
870
+ 'praxis.filesUpload.errors.INVALID_FILE_SIZE_CONFIG': 'Invalid file size configuration.',
871
+ 'praxis.filesUpload.errors.SYSTEM_POLICY_BLOCKED': 'Blocked by system policy.',
872
+ 'praxis.filesUpload.errors.SUSPICIOUS_EXTENSION_BLOCKED': 'Suspicious extension blocked by policy.',
873
+ 'praxis.filesUpload.errors.DANGEROUS_SCRIPT': 'Dangerous script detected in file.',
874
+ 'praxis.filesUpload.errors.BATCH_SIZE_EXCEEDED': 'Batch file count limit exceeded.',
875
+ 'praxis.filesUpload.errors.EMBEDDED_EXECUTABLE': 'Embedded executable content detected.',
876
+ 'praxis.filesUpload.errors.INVALID_PATH': 'Invalid file path.',
877
+ 'praxis.filesUpload.errors.FAILED_TO_ANALYZE': 'Failed to analyze file.',
878
+ 'praxis.filesUpload.errors.ZIP_BOMB_DETECTED': 'Compressed archive exceeds safe extraction limits.',
879
+ 'praxis.filesUpload.errors.SIGNATURE_MISMATCH': 'File signature does not match content.',
880
+ 'praxis.filesUpload.errors.SUSPICIOUS_STRUCTURE': 'Suspicious file structure detected.',
881
+ 'praxis.filesUpload.errors.BLOQUEADO_POLITICA_SISTEMA': 'Blocked by system policy.',
882
+ 'praxis.filesUpload.errors.FALHA_ESCANEAMENTO_VIRUS': 'Antivirus scan failed.',
883
+ 'praxis.filesUpload.errors.FALHA_VALIDACAO_ESTRUTURA': 'File structure validation failed.',
884
+ 'praxis.filesUpload.errors.CONFIGURACAO_TAMANHO_INVALIDA': 'Invalid size configuration.',
885
+ 'praxis.filesUpload.errors.FALHA_ARMAZENAMENTO': 'Failed to store file.',
886
+ 'praxis.filesUpload.errors.ERRO_ARMAZENAMENTO_ARQUIVO': 'Error storing file.',
887
+ 'praxis.filesUpload.errors.NOME_ARQUIVO_VAZIO': 'File name is required.',
888
+ 'praxis.filesUpload.errors.ERRO_ANALISE_ARQUIVO': 'Error analyzing file.',
889
+ 'praxis.filesUpload.errors.ERRO_ESTRUTURA_ARQUIVO': 'Invalid file structure.',
890
+ 'praxis.filesUpload.errors.ERRO_CONFIGURACAO': 'Configuration error.',
891
+ 'praxis.filesUpload.errors.ERRO_ESCANEAMENTO_VIRUS': 'Antivirus scanner error.',
892
+ 'praxis.filesUpload.errors.FALHA_ANALISE_ARQUIVO': 'Failed to analyze file.',
893
+ 'praxis.filesUpload.errors.ERRO_POLITICA_CONFLITO': 'Conflict policy error.',
894
+ 'praxis.filesUpload.errors.POLITICA_CONFLITO_IGNORAR': 'File skipped by conflict policy.',
895
+ 'praxis.filesUpload.errors.ERRO_DESCONHECIDO': 'Unknown internal error.',
896
+ 'praxis.filesUpload.errors.UPLOAD_LOTE_CANCELADO': 'Batch upload cancelled.',
897
+ 'praxis.filesUpload.errors.UPLOAD_CANCELADO_USUARIO': 'Upload cancelled by user.',
898
+ 'praxis.filesUpload.errors.TAMANHO_LOTE_EXCEDIDO': 'Batch file count limit exceeded.',
670
899
  'praxis.filesUpload.errors.INVALID_JSON_OPTIONS': 'Invalid JSON options.',
671
900
  'praxis.filesUpload.errors.EMPTY_FILENAME': 'File name is required.',
672
901
  'praxis.filesUpload.errors.FILE_EXISTS': 'File already exists.',
@@ -677,6 +906,11 @@ const FILES_UPLOAD_EN_US = {
677
906
  'praxis.filesUpload.errors.BULK_UPLOAD_CANCELLED': 'Bulk upload cancelled.',
678
907
  'praxis.filesUpload.errors.USER_CANCELLED': 'Upload cancelled by user.',
679
908
  'praxis.filesUpload.errors.UNKNOWN_ERROR': 'Unknown error.',
909
+ 'praxis.filesUpload.errors.ARQUIVO_SOB_RETENCAO': 'This file is protected by a retention hold or pending approval policy.',
910
+ 'praxis.filesUpload.errors.CONFLITO_ESTADO': 'The current file lifecycle status does not allow this operation.',
911
+ 'praxis.filesUpload.errors.EXCLUSAO_ATIVO_BLOQUEADA': 'The configured server policy forbids deleting confirmed files.',
912
+ 'praxis.filesUpload.errors.NO_FILES_PROVIDED': 'No files were provided for upload.',
913
+ 'praxis.filesUpload.errors.INVALID_OPTIONS_FORMAT': 'Invalid format in the options parameter.',
680
914
  'praxis.filesUpload.fieldPendingSummary': 'Files ready to upload',
681
915
  'praxis.filesUpload.fieldSelectedSummary': 'Selected file',
682
916
  'praxis.filesUpload.fieldSelectedPlural': 'files attached',
@@ -984,7 +1218,85 @@ const FILES_UPLOAD_PT_BR = {
984
1218
  'praxis.filesUpload.errors.LIMITE_TAXA_EXCEDIDO': 'Limite de taxa excedido.',
985
1219
  'praxis.filesUpload.errors.COTA_EXCEDIDA': 'Cota excedida.',
986
1220
  'praxis.filesUpload.errors.ARQUIVO_JA_EXISTE': 'Arquivo já existe.',
1221
+ 'praxis.filesUpload.errors.SCANNER_VIRUS_INDISPONIVEL': 'Scanner antivírus indisponível no momento. Tente novamente em instantes.',
1222
+ 'praxis.filesUpload.errors.MALWARE_DETECTADO': 'Malware detectado no arquivo.',
1223
+ 'praxis.filesUpload.errors.VIRUS_DETECTADO': 'Vírus detectado no arquivo.',
1224
+ 'praxis.filesUpload.errors.ESTRUTURA_SUSPEITA': 'Estrutura suspeita detectada no documento.',
1225
+ 'praxis.filesUpload.errors.ARQUIVO_CORROMPIDO': 'Arquivo corrompido ou ilegível.',
1226
+ 'praxis.filesUpload.errors.ZIP_BOMB_DETECTADO': 'Arquivo compactado excede limites seguros de extração.',
1227
+ 'praxis.filesUpload.errors.EXECUTAVEL_INCORPORADO': 'Conteúdo executável incorporado detectado.',
1228
+ 'praxis.filesUpload.errors.TIPO_MIME_INCOMPATIVEL': 'Tipo MIME incompatível com o conteúdo do arquivo.',
1229
+ 'praxis.filesUpload.errors.ASSINATURA_INVALIDA': 'Assinatura do arquivo incompatível com o formato declarado.',
1230
+ 'praxis.filesUpload.errors.MAGIC_NUMBER_INCOMPATIVEL': 'Conteúdo binário incompatível com a extensão declarada.',
1231
+ 'praxis.filesUpload.errors.ARQUIVO_VAZIO': 'O arquivo enviado está vazio.',
1232
+ 'praxis.filesUpload.errors.TIPO_NAO_SUPORTADO': 'Tipo de arquivo não suportado.',
1233
+ 'praxis.filesUpload.errors.CAMINHO_INVALIDO': 'Caminho do arquivo inválido.',
1234
+ 'praxis.filesUpload.errors.NOME_ARQUIVO_INVALIDO': 'Nome do arquivo inválido.',
1235
+ 'praxis.filesUpload.errors.ARQUIVO_EXECUTAVEL_PERIGOSO': 'Arquivo executável bloqueado pela política de segurança.',
1236
+ 'praxis.filesUpload.errors.SCRIPT_PERIGOSO': 'Script potencialmente perigoso detectado no arquivo.',
1237
+ 'praxis.filesUpload.errors.TIPO_ARQUIVO_PERIGOSO': 'Tipo de arquivo bloqueado pela política de segurança.',
1238
+ 'praxis.filesUpload.errors.EXTENSAO_SUSPEITA_BLOQUEADA': 'Extensão suspeita bloqueada pela política de segurança.',
1239
+ 'praxis.filesUpload.errors.VIOLACAO_SEGURANCA': 'Arquivo bloqueado por violação de segurança.',
1240
+ 'praxis.filesUpload.errors.TEMPO_ESGOTADO_UPLOAD': 'Tempo esgotado durante o envio do arquivo.',
1241
+ 'praxis.filesUpload.errors.TEMPO_ESGOTADO_UPLOAD_LOTE': 'Tempo esgotado durante o envio em lote.',
1242
+ 'praxis.filesUpload.errors.ERRO_IO': 'Falha de entrada/saída durante o envio.',
1243
+ 'praxis.filesUpload.errors.ESPAÇO_INSUFICIENTE': 'Espaço insuficiente no servidor.',
1244
+ 'praxis.filesUpload.errors.ESPACO_INSUFICIENTE': 'Espaço insuficiente no servidor.',
1245
+ 'praxis.filesUpload.errors.ARQUIVO_NAO_ENCONTRADO': 'Arquivo não encontrado.',
1246
+ 'praxis.filesUpload.errors.ACESSO_NEGADO': 'Sem permissão para acessar ou modificar este arquivo.',
987
1247
  // Outros possíveis códigos mapeados no catálogo
1248
+ 'praxis.filesUpload.errors.INVALID_TYPE': 'Tipo de arquivo inválido.',
1249
+ 'praxis.filesUpload.errors.UNSUPPORTED_FILE_TYPE': 'Tipo de arquivo não suportado.',
1250
+ 'praxis.filesUpload.errors.MAGIC_NUMBER_MISMATCH': 'Assinatura incompatível com a extensão declarada.',
1251
+ 'praxis.filesUpload.errors.CORRUPTED_FILE': 'Arquivo corrompido.',
1252
+ 'praxis.filesUpload.errors.DANGEROUS_FILE_TYPE': 'Tipo perigoso bloqueado.',
1253
+ 'praxis.filesUpload.errors.DANGEROUS_EXECUTABLE': 'Executável bloqueado pela política de segurança.',
1254
+ 'praxis.filesUpload.errors.MALWARE_DETECTED': 'Malware detectado no arquivo.',
1255
+ 'praxis.filesUpload.errors.VIRUS_DETECTED': 'Vírus detectado no arquivo.',
1256
+ 'praxis.filesUpload.errors.FILE_STORE_ERROR': 'Erro ao armazenar arquivo.',
1257
+ 'praxis.filesUpload.errors.FILE_STORAGE_FAILED': 'Falha ao armazenar arquivo.',
1258
+ 'praxis.filesUpload.errors.VIRUS_SCAN_ERROR': 'Erro no scanner antivírus.',
1259
+ 'praxis.filesUpload.errors.VIRUS_SCAN_FAILED': 'Falha na verificação antivírus.',
1260
+ 'praxis.filesUpload.errors.VIRUS_SCAN_UNAVAILABLE': 'Scanner antivírus indisponível no momento.',
1261
+ 'praxis.filesUpload.errors.IO_ERROR': 'Erro de leitura/escrita durante o envio.',
1262
+ 'praxis.filesUpload.errors.MIME_TYPE_MISMATCH': 'Tipo MIME incompatível com o conteúdo.',
1263
+ 'praxis.filesUpload.errors.FILE_STRUCTURE_ERROR': 'Estrutura de arquivo inválida.',
1264
+ 'praxis.filesUpload.errors.STRUCTURE_VALIDATION_FAILED': 'Validação de estrutura falhou.',
1265
+ 'praxis.filesUpload.errors.EMPTY_FILE': 'O arquivo enviado está vazio.',
1266
+ 'praxis.filesUpload.errors.FILE_ANALYSIS_ERROR': 'Erro na análise do arquivo.',
1267
+ 'praxis.filesUpload.errors.CONFIGURATION_ERROR': 'Erro de configuração.',
1268
+ 'praxis.filesUpload.errors.SECURITY_VIOLATION': 'Arquivo bloqueado por violação de segurança.',
1269
+ 'praxis.filesUpload.errors.CONFLICT_POLICY_ERROR': 'Erro de política de conflito.',
1270
+ 'praxis.filesUpload.errors.CONFLICT_POLICY_SKIP': 'Arquivo ignorado pela política de conflito.',
1271
+ 'praxis.filesUpload.errors.INVALID_FILE_SIZE_CONFIG': 'Configuração de tamanho inválida.',
1272
+ 'praxis.filesUpload.errors.SYSTEM_POLICY_BLOCKED': 'Bloqueado por política do sistema.',
1273
+ 'praxis.filesUpload.errors.SUSPICIOUS_EXTENSION_BLOCKED': 'Extensão suspeita bloqueada.',
1274
+ 'praxis.filesUpload.errors.DANGEROUS_SCRIPT': 'Script perigoso detectado.',
1275
+ 'praxis.filesUpload.errors.BATCH_SIZE_EXCEEDED': 'Quantidade por lote excedida.',
1276
+ 'praxis.filesUpload.errors.EMBEDDED_EXECUTABLE': 'Executável incorporado detectado.',
1277
+ 'praxis.filesUpload.errors.INVALID_PATH': 'Caminho inválido.',
1278
+ 'praxis.filesUpload.errors.FAILED_TO_ANALYZE': 'Falha ao analisar arquivo.',
1279
+ 'praxis.filesUpload.errors.ZIP_BOMB_DETECTED': 'Arquivo compactado excede limites seguros.',
1280
+ 'praxis.filesUpload.errors.SIGNATURE_MISMATCH': 'Assinatura incompatível.',
1281
+ 'praxis.filesUpload.errors.SUSPICIOUS_STRUCTURE': 'Estrutura suspeita detectada.',
1282
+ 'praxis.filesUpload.errors.BLOQUEADO_POLITICA_SISTEMA': 'Bloqueado por política do sistema.',
1283
+ 'praxis.filesUpload.errors.FALHA_ESCANEAMENTO_VIRUS': 'Falha no escaneamento antivírus.',
1284
+ 'praxis.filesUpload.errors.FALHA_VALIDACAO_ESTRUTURA': 'Validação de estrutura falhou.',
1285
+ 'praxis.filesUpload.errors.CONFIGURACAO_TAMANHO_INVALIDA': 'Configuração de tamanho inválida.',
1286
+ 'praxis.filesUpload.errors.FALHA_ARMAZENAMENTO': 'Falha ao armazenar arquivo.',
1287
+ 'praxis.filesUpload.errors.ERRO_ARMAZENAMENTO_ARQUIVO': 'Erro ao armazenar arquivo.',
1288
+ 'praxis.filesUpload.errors.NOME_ARQUIVO_VAZIO': 'Nome do arquivo obrigatório.',
1289
+ 'praxis.filesUpload.errors.ERRO_ANALISE_ARQUIVO': 'Erro na análise do arquivo.',
1290
+ 'praxis.filesUpload.errors.ERRO_ESTRUTURA_ARQUIVO': 'Erro na estrutura do arquivo.',
1291
+ 'praxis.filesUpload.errors.ERRO_CONFIGURACAO': 'Erro de configuração.',
1292
+ 'praxis.filesUpload.errors.ERRO_ESCANEAMENTO_VIRUS': 'Erro no antivírus.',
1293
+ 'praxis.filesUpload.errors.FALHA_ANALISE_ARQUIVO': 'Falha ao analisar arquivo.',
1294
+ 'praxis.filesUpload.errors.ERRO_POLITICA_CONFLITO': 'Erro de política de conflito.',
1295
+ 'praxis.filesUpload.errors.POLITICA_CONFLITO_IGNORAR': 'Arquivo ignorado pela política de conflito.',
1296
+ 'praxis.filesUpload.errors.ERRO_DESCONHECIDO': 'Erro desconhecido no servidor.',
1297
+ 'praxis.filesUpload.errors.UPLOAD_LOTE_CANCELADO': 'Upload em lote cancelado.',
1298
+ 'praxis.filesUpload.errors.UPLOAD_CANCELADO_USUARIO': 'Upload cancelado pelo usuário.',
1299
+ 'praxis.filesUpload.errors.TAMANHO_LOTE_EXCEDIDO': 'Quantidade por lote excedida.',
988
1300
  'praxis.filesUpload.errors.INVALID_JSON_OPTIONS': 'JSON de opções inválido.',
989
1301
  'praxis.filesUpload.errors.EMPTY_FILENAME': 'Nome do arquivo obrigatório.',
990
1302
  'praxis.filesUpload.errors.FILE_EXISTS': 'Arquivo já existe.',
@@ -995,6 +1307,11 @@ const FILES_UPLOAD_PT_BR = {
995
1307
  'praxis.filesUpload.errors.BULK_UPLOAD_CANCELLED': 'Upload em lote cancelado.',
996
1308
  'praxis.filesUpload.errors.USER_CANCELLED': 'Upload cancelado pelo usuário.',
997
1309
  'praxis.filesUpload.errors.UNKNOWN_ERROR': 'Erro desconhecido.',
1310
+ 'praxis.filesUpload.errors.ARQUIVO_SOB_RETENCAO': 'O arquivo está protegido por política de retenção ou aprovação pendente.',
1311
+ 'praxis.filesUpload.errors.CONFLITO_ESTADO': 'O estado atual do arquivo não permite esta operação.',
1312
+ 'praxis.filesUpload.errors.EXCLUSAO_ATIVO_BLOQUEADA': 'A política configurada não permite excluir arquivos confirmados.',
1313
+ 'praxis.filesUpload.errors.NO_FILES_PROVIDED': 'Nenhum arquivo foi selecionado para envio.',
1314
+ 'praxis.filesUpload.errors.INVALID_OPTIONS_FORMAT': 'Formato inválido no campo de opções.',
998
1315
  'praxis.filesUpload.fieldPendingSummary': 'Arquivos prontos para envio',
999
1316
  'praxis.filesUpload.fieldSelectedSummary': 'Arquivo selecionado',
1000
1317
  'praxis.filesUpload.fieldSelectedPlural': 'arquivos vinculados',
@@ -1146,6 +1463,7 @@ class PraxisFilesUploadConfigEditor {
1146
1463
  errorCodes = Object.values(ErrorCode);
1147
1464
  errorEntries = [];
1148
1465
  isDirty$ = new BehaviorSubject(false);
1466
+ jsonValid$ = new BehaviorSubject(true);
1149
1467
  isValid$;
1150
1468
  isBusy$ = new BehaviorSubject(false);
1151
1469
  jsonError = null;
@@ -1156,6 +1474,51 @@ class PraxisFilesUploadConfigEditor {
1156
1474
  const normalized = String(code);
1157
1475
  return this.tx(`editor.errors.${normalized}`, normalized);
1158
1476
  }
1477
+ toCsvString(val) {
1478
+ if (Array.isArray(val)) {
1479
+ return val.map((item) => String(item ?? '').trim()).filter(Boolean).join(',');
1480
+ }
1481
+ return typeof val === 'string' ? val : '';
1482
+ }
1483
+ toStringArray(val) {
1484
+ if (Array.isArray(val)) {
1485
+ return val.map((item) => String(item ?? '').trim()).filter(Boolean);
1486
+ }
1487
+ if (typeof val === 'string') {
1488
+ return val
1489
+ .split(',')
1490
+ .map((s) => s.trim())
1491
+ .filter(Boolean);
1492
+ }
1493
+ return [];
1494
+ }
1495
+ normalizeIncomingPatch(raw) {
1496
+ if (!raw || typeof raw !== 'object')
1497
+ return raw;
1498
+ const patch = { ...raw };
1499
+ if (patch.ui && typeof patch.ui === 'object') {
1500
+ patch.ui = { ...patch.ui };
1501
+ if (patch.ui.accept !== undefined) {
1502
+ patch.ui.accept = this.toCsvString(patch.ui.accept);
1503
+ }
1504
+ if (patch.ui.list && typeof patch.ui.list === 'object') {
1505
+ patch.ui.list = { ...patch.ui.list };
1506
+ if (patch.ui.list.detailsFields !== undefined) {
1507
+ patch.ui.list.detailsFields = this.toCsvString(patch.ui.list.detailsFields);
1508
+ }
1509
+ }
1510
+ }
1511
+ if (patch.options && typeof patch.options === 'object') {
1512
+ patch.options = { ...patch.options };
1513
+ if (patch.options.allowedExtensions !== undefined) {
1514
+ patch.options.allowedExtensions = this.toCsvString(patch.options.allowedExtensions);
1515
+ }
1516
+ if (patch.options.acceptMimeTypes !== undefined) {
1517
+ patch.options.acceptMimeTypes = this.toCsvString(patch.options.acceptMimeTypes);
1518
+ }
1519
+ }
1520
+ return patch;
1521
+ }
1159
1522
  constructor(fb, panelData, snackBar, destroyRef) {
1160
1523
  this.fb = fb;
1161
1524
  this.panelData = panelData;
@@ -1239,7 +1602,8 @@ class PraxisFilesUploadConfigEditor {
1239
1602
  this.errorCodes.forEach((code) => {
1240
1603
  errorsGroup.addControl(code, this.fb.control(''));
1241
1604
  });
1242
- this.isValid$ = this.form.statusChanges.pipe(map$1((s) => s === 'VALID'), startWith(this.form.valid));
1605
+ const formValid$ = this.form.statusChanges.pipe(map$1((s) => s === 'VALID'), startWith(this.form.valid));
1606
+ this.isValid$ = combineLatest([formValid$, this.jsonValid$]).pipe(map$1(([formValid, jsonValid]) => formValid && jsonValid));
1243
1607
  // Definir baseUrl e inicializar hook em contexto de injeção
1244
1608
  this.baseUrl = this.panelData?.baseUrl ?? this.panelData?.__baseUrl;
1245
1609
  this.state = useEffectiveUploadConfig(this.baseUrl ?? '/api/files', () => this.getHeadersForFetch());
@@ -1252,39 +1616,19 @@ class PraxisFilesUploadConfigEditor {
1252
1616
  // baseUrl opcional vinda do componente pai (Settings Panel inputs)
1253
1617
  // (já definida no construtor)
1254
1618
  if (this.panelData) {
1255
- const patch = { ...this.panelData };
1256
- if (patch.ui?.accept) {
1257
- patch.ui = { ...patch.ui, accept: patch.ui.accept.join(',') };
1258
- }
1259
- // Normalizar lista de detalhes para CSV
1260
- if (patch.ui?.list?.detailsFields) {
1261
- patch.ui = {
1262
- ...patch.ui,
1263
- list: {
1264
- ...patch.ui.list,
1265
- detailsFields: patch.ui.list.detailsFields.join(','),
1266
- },
1267
- };
1268
- }
1269
- if (patch.options?.allowedExtensions) {
1270
- patch.options = {
1271
- ...patch.options,
1272
- allowedExtensions: patch.options.allowedExtensions.join(','),
1273
- };
1274
- }
1275
- if (patch.options?.acceptMimeTypes) {
1276
- patch.options = {
1277
- ...patch.options,
1278
- acceptMimeTypes: patch.options.acceptMimeTypes.join(','),
1279
- };
1280
- }
1281
- this.form.patchValue(patch);
1619
+ this.form.patchValue(this.normalizeIncomingPatch(this.panelData));
1282
1620
  }
1283
1621
  // Sempre que cabeçalhos mudarem, atualiza contexto da consulta (e refaz fetch)
1284
1622
  this.headersGroup.valueChanges.subscribe(() => {
1285
1623
  this.state.refetch();
1286
1624
  });
1287
- this.form.valueChanges.subscribe(() => this.isDirty$.next(true));
1625
+ this.form.valueChanges.subscribe(() => {
1626
+ this.isDirty$.next(true);
1627
+ if (this.jsonError) {
1628
+ this.jsonError = null;
1629
+ this.jsonValid$.next(true);
1630
+ }
1631
+ });
1288
1632
  }
1289
1633
  applyServerConfig(cfg) {
1290
1634
  if (!cfg)
@@ -1371,10 +1715,7 @@ class PraxisFilesUploadConfigEditor {
1371
1715
  const accept = this.uiGroup.get('accept')?.value;
1372
1716
  if (accept !== undefined) {
1373
1717
  value.ui = value.ui ?? {};
1374
- value.ui.accept = accept
1375
- .split(',')
1376
- .map((s) => s.trim())
1377
- .filter((s) => !!s);
1718
+ value.ui.accept = this.toStringArray(accept);
1378
1719
  }
1379
1720
  // NOVO: detailsFields (UI)
1380
1721
  const df = this.uiGroup.get('list')?.get('detailsFields')
@@ -1382,29 +1723,19 @@ class PraxisFilesUploadConfigEditor {
1382
1723
  if (df !== undefined) {
1383
1724
  value.ui = value.ui ?? {};
1384
1725
  value.ui.list = value.ui.list ?? {};
1385
- value.ui.list.detailsFields = df
1386
- .split(',')
1387
- .map((s) => s.trim())
1388
- .filter((s) => !!s);
1726
+ value.ui.list.detailsFields = this.toStringArray(df);
1389
1727
  }
1390
1728
  // options.allowedExtensions
1391
- const allowedExt = this.optionsGroup.get('allowedExtensions')
1392
- ?.value;
1729
+ const allowedExt = this.optionsGroup.get('allowedExtensions')?.value;
1393
1730
  if (allowedExt !== undefined) {
1394
1731
  value.options = value.options ?? {};
1395
- value.options.allowedExtensions = allowedExt
1396
- .split(',')
1397
- .map((s) => s.trim())
1398
- .filter((s) => !!s);
1732
+ value.options.allowedExtensions = this.toStringArray(allowedExt);
1399
1733
  }
1400
1734
  // options.acceptMimeTypes
1401
1735
  const mime = this.optionsGroup.get('acceptMimeTypes')?.value;
1402
1736
  if (mime !== undefined) {
1403
1737
  value.options = value.options ?? {};
1404
- value.options.acceptMimeTypes = mime
1405
- .split(',')
1406
- .map((s) => s.trim())
1407
- .filter((s) => !!s);
1738
+ value.options.acceptMimeTypes = this.toStringArray(mime);
1408
1739
  }
1409
1740
  return value;
1410
1741
  }
@@ -1424,11 +1755,13 @@ class PraxisFilesUploadConfigEditor {
1424
1755
  onJsonChange(json) {
1425
1756
  try {
1426
1757
  const parsed = JSON.parse(json);
1427
- this.form.patchValue(parsed);
1758
+ this.form.patchValue(this.normalizeIncomingPatch(parsed));
1428
1759
  this.jsonError = null;
1760
+ this.jsonValid$.next(true);
1429
1761
  }
1430
1762
  catch {
1431
1763
  this.jsonError = this.tx('editor.json.invalid', 'Invalid JSON: check the syntax.');
1764
+ this.jsonValid$.next(false);
1432
1765
  this.snackBar.open(this.tx('editor.snackbar.invalidJson', 'Invalid JSON'), undefined, { duration: 2000 });
1433
1766
  }
1434
1767
  }
@@ -1554,7 +1887,7 @@ class PraxisFilesUploadConfigEditor {
1554
1887
  }
1555
1888
  return risks;
1556
1889
  }
1557
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisFilesUploadConfigEditor, deps: [{ token: i1$1.FormBuilder }, { token: SETTINGS_PANEL_DATA }, { token: i2.MatSnackBar }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
1890
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisFilesUploadConfigEditor, deps: [{ token: i1$1.FormBuilder }, { token: SETTINGS_PANEL_DATA }, { token: i2$1.MatSnackBar }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
1558
1891
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisFilesUploadConfigEditor, isStandalone: true, selector: "praxis-files-upload-config-editor", providers: [providePraxisFilesUploadI18n()], ngImport: i0, template: `
1559
1892
  <div class="editor-layout">
1560
1893
  <aside class="summary-panel" [attr.aria-label]="tx('editor.summary.ariaLabel', 'Executive summary for the current configuration')">
@@ -1625,7 +1958,7 @@ class PraxisFilesUploadConfigEditor {
1625
1958
  </section>
1626
1959
  <section class="config-section">
1627
1960
  <form [formGroup]="form">
1628
- <mat-form-field appearance="fill">
1961
+ <mat-form-field appearance="outline">
1629
1962
  <mat-label>{{ tx('editor.behavior.strategy.label', 'Upload strategy') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1630
1963
  <mat-select formControlName="strategy">
1631
1964
  <mat-option value="direct">{{ tx('editor.behavior.strategy.direct', 'Direct (standard HTTP)') }}</mat-option>
@@ -1656,7 +1989,7 @@ class PraxisFilesUploadConfigEditor {
1656
1989
  <p class="section-note">
1657
1990
  {{ tx('editor.behavior.bulk.note', 'Use parallelism and retries in moderation. In enterprise environments these controls affect throughput, perceived experience and backend load.') }}
1658
1991
  </p>
1659
- <mat-form-field appearance="fill">
1992
+ <mat-form-field appearance="outline">
1660
1993
  <mat-label>{{ tx('editor.behavior.bulk.parallel', 'Parallel uploads') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1661
1994
  <input matInput type="number" formControlName="parallelUploads" />
1662
1995
  <button
@@ -1670,7 +2003,7 @@ class PraxisFilesUploadConfigEditor {
1670
2003
  >
1671
2004
  </button>
1672
2005
  </mat-form-field>
1673
- <mat-form-field appearance="fill">
2006
+ <mat-form-field appearance="outline">
1674
2007
  <mat-label>{{ tx('editor.behavior.bulk.retryCount', 'Retry count') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1675
2008
  <input matInput type="number" formControlName="retryCount" />
1676
2009
  <button
@@ -1684,7 +2017,7 @@ class PraxisFilesUploadConfigEditor {
1684
2017
  >
1685
2018
  </button>
1686
2019
  </mat-form-field>
1687
- <mat-form-field appearance="fill">
2020
+ <mat-form-field appearance="outline">
1688
2021
  <mat-label>{{ tx('editor.behavior.bulk.retryBackoff', 'Retry interval (ms)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1689
2022
  <input matInput type="number" formControlName="retryBackoffMs" />
1690
2023
  <button
@@ -1731,7 +2064,7 @@ class PraxisFilesUploadConfigEditor {
1731
2064
  <mat-checkbox formControlName="manualUpload"
1732
2065
  >{{ tx('editor.interface.manualUpload', 'Require clicking "Upload" (manual mode)') }}</mat-checkbox>
1733
2066
  <mat-checkbox formControlName="dense">{{ tx('editor.interface.dense', 'Compact layout') }}</mat-checkbox>
1734
- <mat-form-field appearance="fill">
2067
+ <mat-form-field appearance="outline">
1735
2068
  <mat-label>{{ tx('editor.interface.accept', 'Allowed types (accept)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1736
2069
  <input
1737
2070
  matInput
@@ -1762,22 +2095,22 @@ class PraxisFilesUploadConfigEditor {
1762
2095
  <mat-checkbox formControlName="expandOnDragProximity">
1763
2096
  {{ tx('editor.interface.dropzone.expandOnProximity', 'Expand when a file gets close during drag') }}
1764
2097
  </mat-checkbox>
1765
- <mat-form-field appearance="fill">
2098
+ <mat-form-field appearance="outline">
1766
2099
  <mat-label>{{ tx('editor.interface.dropzone.proximity', 'Proximity radius (px)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1767
2100
  <input matInput type="number" formControlName="proximityPx" />
1768
2101
  </mat-form-field>
1769
- <mat-form-field appearance="fill">
2102
+ <mat-form-field appearance="outline">
1770
2103
  <mat-label>{{ tx('editor.interface.dropzone.mode', 'Expansion mode') }}</mat-label>
1771
2104
  <mat-select formControlName="expandMode">
1772
2105
  <mat-option value="overlay">{{ tx('editor.interface.dropzone.mode.overlay', 'Overlay (recommended)') }}</mat-option>
1773
2106
  <mat-option value="inline">{{ tx('editor.interface.dropzone.mode.inline', 'Inline') }}</mat-option>
1774
2107
  </mat-select>
1775
2108
  </mat-form-field>
1776
- <mat-form-field appearance="fill">
2109
+ <mat-form-field appearance="outline">
1777
2110
  <mat-label>{{ tx('editor.interface.dropzone.height', 'Overlay height (px)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1778
2111
  <input matInput type="number" formControlName="expandHeight" />
1779
2112
  </mat-form-field>
1780
- <mat-form-field appearance="fill">
2113
+ <mat-form-field appearance="outline">
1781
2114
  <mat-label>{{ tx('editor.interface.dropzone.debounce', 'Drag debounce (ms)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1782
2115
  <input matInput type="number" formControlName="expandDebounceMs" />
1783
2116
  </mat-form-field>
@@ -1789,11 +2122,11 @@ class PraxisFilesUploadConfigEditor {
1789
2122
  <mat-icon aria-hidden="true">view_list</mat-icon>
1790
2123
  {{ tx('editor.interface.list.title', 'List and details') }}
1791
2124
  </legend>
1792
- <mat-form-field appearance="fill">
2125
+ <mat-form-field appearance="outline">
1793
2126
  <mat-label>{{ tx('editor.interface.list.collapseAfter', 'Collapse after (items)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1794
2127
  <input matInput type="number" formControlName="collapseAfter" />
1795
2128
  </mat-form-field>
1796
- <mat-form-field appearance="fill">
2129
+ <mat-form-field appearance="outline">
1797
2130
  <mat-label>{{ tx('editor.interface.list.detailsMode', 'Details mode') }}</mat-label>
1798
2131
  <mat-select formControlName="detailsMode">
1799
2132
  <mat-option value="auto">{{ tx('editor.interface.list.detailsMode.auto', 'Automatic') }}</mat-option>
@@ -1801,14 +2134,14 @@ class PraxisFilesUploadConfigEditor {
1801
2134
  <mat-option value="sidesheet">{{ tx('editor.interface.list.detailsMode.sidesheet', 'Side-sheet') }}</mat-option>
1802
2135
  </mat-select>
1803
2136
  </mat-form-field>
1804
- <mat-form-field appearance="fill">
2137
+ <mat-form-field appearance="outline">
1805
2138
  <mat-label>{{ tx('editor.interface.list.detailsWidth', 'Maximum card width (px)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1806
2139
  <input matInput type="number" formControlName="detailsMaxWidth" />
1807
2140
  </mat-form-field>
1808
2141
  <mat-checkbox formControlName="detailsShowTechnical">
1809
2142
  {{ tx('editor.interface.list.showTechnical', 'Show technical details by default') }}
1810
2143
  </mat-checkbox>
1811
- <mat-form-field appearance="fill">
2144
+ <mat-form-field appearance="outline">
1812
2145
  <mat-label>{{ tx('editor.interface.list.detailsFields', 'Metadata fields (whitelist)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1813
2146
  <input matInput formControlName="detailsFields" [placeholder]="tx('editor.placeholders.detailsFields', 'e.g.: id,fileName,contentType')" />
1814
2147
  <button
@@ -1822,7 +2155,7 @@ class PraxisFilesUploadConfigEditor {
1822
2155
  >
1823
2156
  </button>
1824
2157
  </mat-form-field>
1825
- <mat-form-field appearance="fill">
2158
+ <mat-form-field appearance="outline">
1826
2159
  <mat-label>{{ tx('editor.interface.list.anchor', 'Overlay anchor') }}</mat-label>
1827
2160
  <mat-select formControlName="detailsAnchor">
1828
2161
  <mat-option value="item">{{ tx('editor.interface.list.anchor.item', 'Item') }}</mat-option>
@@ -1851,7 +2184,7 @@ class PraxisFilesUploadConfigEditor {
1851
2184
  <p class="section-note">
1852
2185
  {{ tx('editor.validation.local.note', 'Local limits improve immediate feedback, but do not replace the effective server policy.') }}
1853
2186
  </p>
1854
- <mat-form-field appearance="fill">
2187
+ <mat-form-field appearance="outline">
1855
2188
  <mat-label>{{ tx('editor.validation.local.maxFileSize', 'Maximum file size (bytes)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1856
2189
  <input matInput type="number" formControlName="maxFileSizeBytes" />
1857
2190
  <button
@@ -1865,11 +2198,11 @@ class PraxisFilesUploadConfigEditor {
1865
2198
  >
1866
2199
  </button>
1867
2200
  </mat-form-field>
1868
- <mat-form-field appearance="fill">
2201
+ <mat-form-field appearance="outline">
1869
2202
  <mat-label>{{ tx('editor.validation.local.maxFilesPerBulk', 'Max files per batch') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1870
2203
  <input matInput type="number" formControlName="maxFilesPerBulk" />
1871
2204
  </mat-form-field>
1872
- <mat-form-field appearance="fill">
2205
+ <mat-form-field appearance="outline">
1873
2206
  <mat-label>{{ tx('editor.validation.local.maxBulkSize', 'Maximum batch size (bytes)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1874
2207
  <input matInput type="number" formControlName="maxBulkSizeBytes" />
1875
2208
  </mat-form-field>
@@ -1884,7 +2217,7 @@ class PraxisFilesUploadConfigEditor {
1884
2217
  <p class="section-note">
1885
2218
  {{ tx('editor.validation.backend.note', 'These options directly impact the server contract and operational governance. Treat changes here as policy decisions, not only UI changes.') }}
1886
2219
  </p>
1887
- <mat-form-field appearance="fill">
2220
+ <mat-form-field appearance="outline">
1888
2221
  <mat-label>{{ tx('editor.validation.backend.conflictPolicy', 'Conflict policy (default)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1889
2222
  <mat-select formControlName="defaultConflictPolicy">
1890
2223
  <mat-option value="RENAME">{{ tx('editor.validation.backend.conflictPolicy.rename', 'Rename automatically') }}</mat-option>
@@ -1903,18 +2236,18 @@ class PraxisFilesUploadConfigEditor {
1903
2236
  matTooltipPosition="above"
1904
2237
  >
1905
2238
  </button>
1906
- @if (optionsGroup.get('defaultConflictPolicy')?.value === 'OVERWRITE') {
1907
- <div class="warn">
1908
- <mat-icon color="warn" aria-hidden="true">warning</mat-icon>
1909
- {{ tx('editor.validation.backend.overwriteWarn', 'Warning: OVERWRITE may replace existing files.') }}
1910
- </div>
1911
- }
1912
2239
  </mat-form-field>
2240
+ @if (optionsGroup.get('defaultConflictPolicy')?.value === 'OVERWRITE') {
2241
+ <div class="warn">
2242
+ <mat-icon color="warn" aria-hidden="true">warning</mat-icon>
2243
+ {{ tx('editor.validation.backend.overwriteWarn', 'Warning: OVERWRITE may replace existing files.') }}
2244
+ </div>
2245
+ }
1913
2246
  <mat-checkbox formControlName="strictValidation"
1914
2247
  >{{ tx('editor.validation.backend.strictValidation', 'Strict validation (backend)') }}</mat-checkbox
1915
2248
  >
1916
- <mat-form-field appearance="fill">
1917
- <mat-label>{{ tx('editor.validation.backend.maxUploadSizeMb', 'Maximum size per file (MB)') }} <span class="req-tag">mandatório</span></mat-label>
2249
+ <mat-form-field appearance="outline">
2250
+ <mat-label>{{ tx('editor.validation.backend.maxUploadSizeMb', 'Maximum size per file (MB)') }} <span class="req-tag">{{ tx('editor.shared.requiredTag', 'mandatório') }}</span></mat-label>
1918
2251
  <input matInput type="number" formControlName="maxUploadSizeMb" required />
1919
2252
  <button
1920
2253
  praxisIconButton="help_outline"
@@ -1927,7 +2260,7 @@ class PraxisFilesUploadConfigEditor {
1927
2260
  >
1928
2261
  </button>
1929
2262
  </mat-form-field>
1930
- <mat-form-field appearance="fill">
2263
+ <mat-form-field appearance="outline">
1931
2264
  <mat-label>{{ tx('editor.validation.backend.allowedExtensions', 'Allowed extensions') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1932
2265
  <input
1933
2266
  matInput
@@ -1945,7 +2278,7 @@ class PraxisFilesUploadConfigEditor {
1945
2278
  >
1946
2279
  </button>
1947
2280
  </mat-form-field>
1948
- <mat-form-field appearance="fill">
2281
+ <mat-form-field appearance="outline">
1949
2282
  <mat-label>{{ tx('editor.validation.backend.acceptMimeTypes', 'Accepted MIME types') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1950
2283
  <input
1951
2284
  matInput
@@ -1963,7 +2296,7 @@ class PraxisFilesUploadConfigEditor {
1963
2296
  >
1964
2297
  </button>
1965
2298
  </mat-form-field>
1966
- <mat-form-field appearance="fill">
2299
+ <mat-form-field appearance="outline">
1967
2300
  <mat-label>{{ tx('editor.validation.backend.targetDirectory', 'Target directory') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
1968
2301
  <input
1969
2302
  matInput
@@ -2011,11 +2344,11 @@ class PraxisFilesUploadConfigEditor {
2011
2344
  <mat-checkbox formControlName="autoRetryOn429"
2012
2345
  >{{ tx('editor.validation.rateLimit.autoRetry', 'Retry automatically') }}</mat-checkbox
2013
2346
  >
2014
- <mat-form-field appearance="fill">
2347
+ <mat-form-field appearance="outline">
2015
2348
  <mat-label>{{ tx('editor.validation.rateLimit.maxAutoRetry', 'Maximum automatic retries') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2016
2349
  <input matInput type="number" formControlName="maxAutoRetry" />
2017
2350
  </mat-form-field>
2018
- <mat-form-field appearance="fill">
2351
+ <mat-form-field appearance="outline">
2019
2352
  <mat-label>{{ tx('editor.validation.rateLimit.baseBackoff', 'Base retry interval (ms)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2020
2353
  <input matInput type="number" formControlName="baseBackoffMs" />
2021
2354
  </mat-form-field>
@@ -2051,7 +2384,7 @@ class PraxisFilesUploadConfigEditor {
2051
2384
  <p class="section-note">
2052
2385
  {{ tx('editor.messages.section.note', 'Short and objective messages work better in high-frequency contexts. Use this group to adapt the interface voice to your environment.') }}
2053
2386
  </p>
2054
- <mat-form-field appearance="fill">
2387
+ <mat-form-field appearance="outline">
2055
2388
  <mat-label>{{ tx('editor.messages.successSingle', 'Success (single)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2056
2389
  <input
2057
2390
  matInput
@@ -2059,7 +2392,7 @@ class PraxisFilesUploadConfigEditor {
2059
2392
  [placeholder]="tx('editor.placeholders.successSingle', 'e.g.: File uploaded successfully')"
2060
2393
  />
2061
2394
  </mat-form-field>
2062
- <mat-form-field appearance="fill">
2395
+ <mat-form-field appearance="outline">
2063
2396
  <mat-label>{{ tx('editor.messages.successBulk', 'Success (batch)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2064
2397
  <input
2065
2398
  matInput
@@ -2068,8 +2401,8 @@ class PraxisFilesUploadConfigEditor {
2068
2401
  />
2069
2402
  </mat-form-field>
2070
2403
  <div [formGroup]="errorsGroup">
2071
- @for (e of errorEntries; track e) {
2072
- <mat-form-field appearance="fill">
2404
+ @for (e of errorEntries; track e.code) {
2405
+ <mat-form-field appearance="outline">
2073
2406
  <mat-label>{{ e.label }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2074
2407
  <input matInput [formControlName]="e.code" />
2075
2408
  <mat-hint class="code-hint">{{ e.code }}</mat-hint>
@@ -2094,7 +2427,7 @@ class PraxisFilesUploadConfigEditor {
2094
2427
  <mat-icon aria-hidden="true">edit</mat-icon>
2095
2428
  {{ tx('editor.headers.section.title', 'Configurable options — Headers (query)') }}
2096
2429
  </h4>
2097
- <mat-form-field appearance="fill">
2430
+ <mat-form-field appearance="outline">
2098
2431
  <mat-label>{{ tx('editor.headers.tenantHeader', 'Tenant header') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2099
2432
  <input
2100
2433
  matInput
@@ -2102,7 +2435,7 @@ class PraxisFilesUploadConfigEditor {
2102
2435
  placeholder="X-Tenant-Id"
2103
2436
  />
2104
2437
  </mat-form-field>
2105
- <mat-form-field appearance="fill">
2438
+ <mat-form-field appearance="outline">
2106
2439
  <mat-label>{{ tx('editor.headers.tenantValue', 'Tenant value') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2107
2440
  <input
2108
2441
  matInput
@@ -2110,7 +2443,7 @@ class PraxisFilesUploadConfigEditor {
2110
2443
  [placeholder]="tx('editor.placeholders.tenantValue', 'e.g.: demo-tenant')"
2111
2444
  />
2112
2445
  </mat-form-field>
2113
- <mat-form-field appearance="fill">
2446
+ <mat-form-field appearance="outline">
2114
2447
  <mat-label>{{ tx('editor.headers.userHeader', 'User header') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2115
2448
  <input
2116
2449
  matInput
@@ -2118,7 +2451,7 @@ class PraxisFilesUploadConfigEditor {
2118
2451
  placeholder="X-User-Id"
2119
2452
  />
2120
2453
  </mat-form-field>
2121
- <mat-form-field appearance="fill">
2454
+ <mat-form-field appearance="outline">
2122
2455
  <mat-label>{{ tx('editor.headers.userValue', 'User value') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2123
2456
  <input matInput formControlName="userValue" [placeholder]="tx('editor.placeholders.userValue', 'e.g.: 42')" />
2124
2457
  </mat-form-field>
@@ -2152,7 +2485,7 @@ class PraxisFilesUploadConfigEditor {
2152
2485
  }
2153
2486
  </div>
2154
2487
  @if (serverLoading()) {
2155
- <div>
2488
+ <div class="server-loading-status" role="status">
2156
2489
  {{ tx('editor.server.loading', 'Loading server configuration...') }}
2157
2490
  </div>
2158
2491
  } @else {
@@ -2256,7 +2589,7 @@ class PraxisFilesUploadConfigEditor {
2256
2589
  </mat-tab-group>
2257
2590
  </div>
2258
2591
  </div>
2259
- `, isInline: true, styles: [".editor-layout{display:grid;grid-template-columns:minmax(260px,320px) minmax(0,1fr);gap:16px;align-items:start}.summary-panel{position:sticky;top:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--pfx-surface-border, #d8d8d8);border-radius:16px;background:linear-gradient(180deg,#fafbfc,#fff)}.summary-panel h3{margin:0;font-size:1rem;font-weight:600}.summary-panel .summary-intro{margin:0;color:#000000a6;line-height:1.4;font-size:.88rem}.summary-grid{display:grid;gap:10px}.summary-card{padding:12px;border-radius:12px;background:#fff;border:1px solid #e7e9ee}.summary-card .eyebrow{display:block;margin-bottom:4px;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#5f6b7a}.summary-card strong{display:block;margin-bottom:4px;font-size:.95rem}.summary-card p{margin:0;font-size:.85rem;line-height:1.45;color:#000000b8}.risk-panel{padding:12px;border-radius:12px;background:#fff8e8;border:1px solid #f0d29a}.risk-panel.safe{background:#f4fbf6;border-color:#b8ddc1}.risk-panel h4{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:.92rem}.risk-list{display:grid;gap:8px}.risk-item{padding:10px;border-radius:10px;background:#ffffffb8}.risk-item strong{display:block;margin-bottom:2px;font-size:.84rem}.risk-item p,.risk-panel .safe-copy{margin:0;font-size:.82rem;line-height:1.4;color:#000000b8}.editor-main{min-width:0}.tab-panel{display:grid;gap:16px;padding-top:8px}.tab-intro{padding:16px 18px;border:1px solid #e5e8ef;border-radius:16px;background:linear-gradient(180deg,#fff,#f7f9fc)}.tab-intro h3{margin:0 0 6px;font-size:1rem;font-weight:600}.tab-intro p{margin:0;font-size:.9rem;line-height:1.5;color:#000000b8}.config-section{padding:18px;border:1px solid #e5e8ef;border-radius:16px;background:#fff}.config-section+.config-section{margin-top:0}.section-note{margin:0 0 16px;color:#000000b3;font-size:.88rem;line-height:1.45}.advanced-note{padding:14px 16px;border-radius:14px;border:1px solid #f0d29a;background:#fff8e8;color:#000000c7;font-size:.88rem;line-height:1.45}.json-textarea{width:100%;min-height:280px;padding:14px 16px;border-radius:14px;border:1px solid #d7dce5;background:#0f172a;color:#e5eefc;font:500 .84rem/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}.server-tab{display:grid;gap:16px}.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.summary{display:grid;gap:8px;padding-left:18px}.summary li{line-height:1.45}details{margin-top:12px;padding:14px 16px;border:1px solid #e5e8ef;border-radius:14px;background:#fbfcfe}details pre{white-space:pre-wrap;word-break:break-word}@media(max-width:1100px){.editor-layout{grid-template-columns:1fr}.summary-panel{position:static}}.mat-mdc-form-field-icon-suffix{align-self:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i3.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i9.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "pipe", type: i18.JsonPipe, name: "json" }] });
2592
+ `, isInline: true, styles: [":host{display:block;min-width:0;container-type:inline-size;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.editor-layout{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:16px;align-items:start}.summary-panel{position:sticky;top:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:16px;background:var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.summary-panel h3{margin:0;font-size:1rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.summary-panel .summary-intro{margin:0;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant));line-height:1.4;font-size:.88rem}.summary-grid{display:grid;gap:10px}.summary-card{padding:12px;border-radius:12px;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container));border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant))}.summary-card .eyebrow{display:block;margin-bottom:4px;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.summary-card strong{display:block;margin-bottom:4px;font-size:.95rem;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.summary-card p{margin:0;font-size:.85rem;line-height:1.45;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.risk-panel{padding:12px;border-radius:12px;background:color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 12%,var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low)));border:1px solid color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 38%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)))}.risk-panel.safe{background:color-mix(in srgb,var(--pfx-settings-panel-primary, var(--md-sys-color-primary)) 10%,var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low)));border-color:color-mix(in srgb,var(--pfx-settings-panel-primary, var(--md-sys-color-primary)) 32%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)))}.risk-panel h4{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:.92rem;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.risk-list{display:grid;gap:8px}.risk-item{padding:10px;border-radius:10px;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container));border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant))}.risk-item strong{display:block;margin-bottom:2px;font-size:.84rem;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.risk-item p,.risk-panel .safe-copy{margin:0;font-size:.82rem;line-height:1.4;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.editor-main{min-width:0}.tab-panel{display:grid;gap:16px;padding-top:8px}.tab-intro{padding:14px 16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:14px;background:var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low))}.tab-intro h3{margin:0 0 6px;font-size:1rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.tab-intro p{margin:0;font-size:.9rem;line-height:1.5;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.config-section{padding:16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:14px;background:var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low));display:grid;gap:12px}.config-section form{display:grid;gap:12px}.config-section+.config-section{margin-top:0}.section-subtitle{display:flex;align-items:center;gap:8px;margin:0;font-size:.95rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.section-note{margin:0 0 4px;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant));font-size:.86rem;line-height:1.45}.subgroup{margin:8px 0 0;padding:14px 0 0;border:0;border-top:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:0;background:transparent;display:grid;gap:12px}.subgroup legend{display:inline-flex;align-items:center;gap:6px;padding:0 8px 0 0;font-size:.88rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.opt-tag,.req-tag{font-size:.72rem;font-weight:500;margin-left:4px;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.req-tag{color:var(--pfx-settings-panel-primary, var(--md-sys-color-primary));font-weight:600}.warn{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:10px;font-size:.84rem;line-height:1.4;background:color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 14%,var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container)));border:1px solid color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 38%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.error{padding:10px 12px;border-radius:10px;font-size:.84rem;background:color-mix(in srgb,var(--pfx-settings-panel-error, var(--md-sys-color-error)) 14%,transparent);border:1px solid var(--pfx-settings-panel-error, var(--md-sys-color-error));color:var(--pfx-settings-panel-error, var(--md-sys-color-error))}.server-loading-status{display:inline-block;padding:6px 0;font-size:.88rem;font-weight:600;background-image:var( --pdx-text-shimmer-gradient, linear-gradient( 105deg, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 0%, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 28%, var(--pfx-settings-panel-primary, var(--md-sys-color-primary)) 44%, var(--md-sys-color-tertiary, #7c3aed) 56%, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 72%, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 100% ) );background-size:260% 100%;background-position:200% 50%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:praxis-files-upload-server-shimmer var(--pdx-text-shimmer-duration, 2.4s) linear infinite}@keyframes praxis-files-upload-server-shimmer{0%{background-position:200% 50%}to{background-position:-60% 50%}}@media(prefers-reduced-motion:reduce),(forced-colors:active),print{.server-loading-status{animation:none;background-image:none;color:var( --pdx-text-shimmer-fallback-color, var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface)) );-webkit-text-fill-color:currentColor}}@media(forced-colors:active){.server-loading-status{color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}}.badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:.72rem;font-weight:600;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container-high));color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.hint,.note{font-size:.84rem;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.advanced-note{padding:14px 16px;border-radius:14px;border:1px solid color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 38%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)));background:color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 12%,var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low)));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface));font-size:.88rem;line-height:1.45}.json-textarea{box-sizing:border-box;width:100%;min-height:280px;padding:14px 16px;border-radius:14px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container-highest));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface));font:500 .84rem/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}.server-tab{display:grid;gap:16px}.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.summary{display:grid;gap:8px;padding-left:18px}.summary li{line-height:1.45}details{margin-top:12px;padding:14px 16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:14px;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container))}details pre{white-space:pre-wrap;word-break:break-word}@container (max-width: 820px){.editor-layout{grid-template-columns:1fr}.summary-panel{position:static}}@media(max-width:960px){.editor-layout{grid-template-columns:1fr}.summary-panel{position:static}}.mat-mdc-form-field-icon-suffix{align-self:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i3.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i7.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i9.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatSnackBarModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "pipe", type: i18.JsonPipe, name: "json" }] });
2260
2593
  }
2261
2594
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisFilesUploadConfigEditor, decorators: [{
2262
2595
  type: Component,
@@ -2344,7 +2677,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2344
2677
  </section>
2345
2678
  <section class="config-section">
2346
2679
  <form [formGroup]="form">
2347
- <mat-form-field appearance="fill">
2680
+ <mat-form-field appearance="outline">
2348
2681
  <mat-label>{{ tx('editor.behavior.strategy.label', 'Upload strategy') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2349
2682
  <mat-select formControlName="strategy">
2350
2683
  <mat-option value="direct">{{ tx('editor.behavior.strategy.direct', 'Direct (standard HTTP)') }}</mat-option>
@@ -2375,7 +2708,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2375
2708
  <p class="section-note">
2376
2709
  {{ tx('editor.behavior.bulk.note', 'Use parallelism and retries in moderation. In enterprise environments these controls affect throughput, perceived experience and backend load.') }}
2377
2710
  </p>
2378
- <mat-form-field appearance="fill">
2711
+ <mat-form-field appearance="outline">
2379
2712
  <mat-label>{{ tx('editor.behavior.bulk.parallel', 'Parallel uploads') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2380
2713
  <input matInput type="number" formControlName="parallelUploads" />
2381
2714
  <button
@@ -2389,7 +2722,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2389
2722
  >
2390
2723
  </button>
2391
2724
  </mat-form-field>
2392
- <mat-form-field appearance="fill">
2725
+ <mat-form-field appearance="outline">
2393
2726
  <mat-label>{{ tx('editor.behavior.bulk.retryCount', 'Retry count') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2394
2727
  <input matInput type="number" formControlName="retryCount" />
2395
2728
  <button
@@ -2403,7 +2736,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2403
2736
  >
2404
2737
  </button>
2405
2738
  </mat-form-field>
2406
- <mat-form-field appearance="fill">
2739
+ <mat-form-field appearance="outline">
2407
2740
  <mat-label>{{ tx('editor.behavior.bulk.retryBackoff', 'Retry interval (ms)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2408
2741
  <input matInput type="number" formControlName="retryBackoffMs" />
2409
2742
  <button
@@ -2450,7 +2783,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2450
2783
  <mat-checkbox formControlName="manualUpload"
2451
2784
  >{{ tx('editor.interface.manualUpload', 'Require clicking "Upload" (manual mode)') }}</mat-checkbox>
2452
2785
  <mat-checkbox formControlName="dense">{{ tx('editor.interface.dense', 'Compact layout') }}</mat-checkbox>
2453
- <mat-form-field appearance="fill">
2786
+ <mat-form-field appearance="outline">
2454
2787
  <mat-label>{{ tx('editor.interface.accept', 'Allowed types (accept)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2455
2788
  <input
2456
2789
  matInput
@@ -2481,22 +2814,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2481
2814
  <mat-checkbox formControlName="expandOnDragProximity">
2482
2815
  {{ tx('editor.interface.dropzone.expandOnProximity', 'Expand when a file gets close during drag') }}
2483
2816
  </mat-checkbox>
2484
- <mat-form-field appearance="fill">
2817
+ <mat-form-field appearance="outline">
2485
2818
  <mat-label>{{ tx('editor.interface.dropzone.proximity', 'Proximity radius (px)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2486
2819
  <input matInput type="number" formControlName="proximityPx" />
2487
2820
  </mat-form-field>
2488
- <mat-form-field appearance="fill">
2821
+ <mat-form-field appearance="outline">
2489
2822
  <mat-label>{{ tx('editor.interface.dropzone.mode', 'Expansion mode') }}</mat-label>
2490
2823
  <mat-select formControlName="expandMode">
2491
2824
  <mat-option value="overlay">{{ tx('editor.interface.dropzone.mode.overlay', 'Overlay (recommended)') }}</mat-option>
2492
2825
  <mat-option value="inline">{{ tx('editor.interface.dropzone.mode.inline', 'Inline') }}</mat-option>
2493
2826
  </mat-select>
2494
2827
  </mat-form-field>
2495
- <mat-form-field appearance="fill">
2828
+ <mat-form-field appearance="outline">
2496
2829
  <mat-label>{{ tx('editor.interface.dropzone.height', 'Overlay height (px)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2497
2830
  <input matInput type="number" formControlName="expandHeight" />
2498
2831
  </mat-form-field>
2499
- <mat-form-field appearance="fill">
2832
+ <mat-form-field appearance="outline">
2500
2833
  <mat-label>{{ tx('editor.interface.dropzone.debounce', 'Drag debounce (ms)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2501
2834
  <input matInput type="number" formControlName="expandDebounceMs" />
2502
2835
  </mat-form-field>
@@ -2508,11 +2841,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2508
2841
  <mat-icon aria-hidden="true">view_list</mat-icon>
2509
2842
  {{ tx('editor.interface.list.title', 'List and details') }}
2510
2843
  </legend>
2511
- <mat-form-field appearance="fill">
2844
+ <mat-form-field appearance="outline">
2512
2845
  <mat-label>{{ tx('editor.interface.list.collapseAfter', 'Collapse after (items)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2513
2846
  <input matInput type="number" formControlName="collapseAfter" />
2514
2847
  </mat-form-field>
2515
- <mat-form-field appearance="fill">
2848
+ <mat-form-field appearance="outline">
2516
2849
  <mat-label>{{ tx('editor.interface.list.detailsMode', 'Details mode') }}</mat-label>
2517
2850
  <mat-select formControlName="detailsMode">
2518
2851
  <mat-option value="auto">{{ tx('editor.interface.list.detailsMode.auto', 'Automatic') }}</mat-option>
@@ -2520,14 +2853,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2520
2853
  <mat-option value="sidesheet">{{ tx('editor.interface.list.detailsMode.sidesheet', 'Side-sheet') }}</mat-option>
2521
2854
  </mat-select>
2522
2855
  </mat-form-field>
2523
- <mat-form-field appearance="fill">
2856
+ <mat-form-field appearance="outline">
2524
2857
  <mat-label>{{ tx('editor.interface.list.detailsWidth', 'Maximum card width (px)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2525
2858
  <input matInput type="number" formControlName="detailsMaxWidth" />
2526
2859
  </mat-form-field>
2527
2860
  <mat-checkbox formControlName="detailsShowTechnical">
2528
2861
  {{ tx('editor.interface.list.showTechnical', 'Show technical details by default') }}
2529
2862
  </mat-checkbox>
2530
- <mat-form-field appearance="fill">
2863
+ <mat-form-field appearance="outline">
2531
2864
  <mat-label>{{ tx('editor.interface.list.detailsFields', 'Metadata fields (whitelist)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2532
2865
  <input matInput formControlName="detailsFields" [placeholder]="tx('editor.placeholders.detailsFields', 'e.g.: id,fileName,contentType')" />
2533
2866
  <button
@@ -2541,7 +2874,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2541
2874
  >
2542
2875
  </button>
2543
2876
  </mat-form-field>
2544
- <mat-form-field appearance="fill">
2877
+ <mat-form-field appearance="outline">
2545
2878
  <mat-label>{{ tx('editor.interface.list.anchor', 'Overlay anchor') }}</mat-label>
2546
2879
  <mat-select formControlName="detailsAnchor">
2547
2880
  <mat-option value="item">{{ tx('editor.interface.list.anchor.item', 'Item') }}</mat-option>
@@ -2570,7 +2903,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2570
2903
  <p class="section-note">
2571
2904
  {{ tx('editor.validation.local.note', 'Local limits improve immediate feedback, but do not replace the effective server policy.') }}
2572
2905
  </p>
2573
- <mat-form-field appearance="fill">
2906
+ <mat-form-field appearance="outline">
2574
2907
  <mat-label>{{ tx('editor.validation.local.maxFileSize', 'Maximum file size (bytes)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2575
2908
  <input matInput type="number" formControlName="maxFileSizeBytes" />
2576
2909
  <button
@@ -2584,11 +2917,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2584
2917
  >
2585
2918
  </button>
2586
2919
  </mat-form-field>
2587
- <mat-form-field appearance="fill">
2920
+ <mat-form-field appearance="outline">
2588
2921
  <mat-label>{{ tx('editor.validation.local.maxFilesPerBulk', 'Max files per batch') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2589
2922
  <input matInput type="number" formControlName="maxFilesPerBulk" />
2590
2923
  </mat-form-field>
2591
- <mat-form-field appearance="fill">
2924
+ <mat-form-field appearance="outline">
2592
2925
  <mat-label>{{ tx('editor.validation.local.maxBulkSize', 'Maximum batch size (bytes)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2593
2926
  <input matInput type="number" formControlName="maxBulkSizeBytes" />
2594
2927
  </mat-form-field>
@@ -2603,7 +2936,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2603
2936
  <p class="section-note">
2604
2937
  {{ tx('editor.validation.backend.note', 'These options directly impact the server contract and operational governance. Treat changes here as policy decisions, not only UI changes.') }}
2605
2938
  </p>
2606
- <mat-form-field appearance="fill">
2939
+ <mat-form-field appearance="outline">
2607
2940
  <mat-label>{{ tx('editor.validation.backend.conflictPolicy', 'Conflict policy (default)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2608
2941
  <mat-select formControlName="defaultConflictPolicy">
2609
2942
  <mat-option value="RENAME">{{ tx('editor.validation.backend.conflictPolicy.rename', 'Rename automatically') }}</mat-option>
@@ -2622,18 +2955,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2622
2955
  matTooltipPosition="above"
2623
2956
  >
2624
2957
  </button>
2625
- @if (optionsGroup.get('defaultConflictPolicy')?.value === 'OVERWRITE') {
2626
- <div class="warn">
2627
- <mat-icon color="warn" aria-hidden="true">warning</mat-icon>
2628
- {{ tx('editor.validation.backend.overwriteWarn', 'Warning: OVERWRITE may replace existing files.') }}
2629
- </div>
2630
- }
2631
2958
  </mat-form-field>
2959
+ @if (optionsGroup.get('defaultConflictPolicy')?.value === 'OVERWRITE') {
2960
+ <div class="warn">
2961
+ <mat-icon color="warn" aria-hidden="true">warning</mat-icon>
2962
+ {{ tx('editor.validation.backend.overwriteWarn', 'Warning: OVERWRITE may replace existing files.') }}
2963
+ </div>
2964
+ }
2632
2965
  <mat-checkbox formControlName="strictValidation"
2633
2966
  >{{ tx('editor.validation.backend.strictValidation', 'Strict validation (backend)') }}</mat-checkbox
2634
2967
  >
2635
- <mat-form-field appearance="fill">
2636
- <mat-label>{{ tx('editor.validation.backend.maxUploadSizeMb', 'Maximum size per file (MB)') }} <span class="req-tag">mandatório</span></mat-label>
2968
+ <mat-form-field appearance="outline">
2969
+ <mat-label>{{ tx('editor.validation.backend.maxUploadSizeMb', 'Maximum size per file (MB)') }} <span class="req-tag">{{ tx('editor.shared.requiredTag', 'mandatório') }}</span></mat-label>
2637
2970
  <input matInput type="number" formControlName="maxUploadSizeMb" required />
2638
2971
  <button
2639
2972
  praxisIconButton="help_outline"
@@ -2646,7 +2979,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2646
2979
  >
2647
2980
  </button>
2648
2981
  </mat-form-field>
2649
- <mat-form-field appearance="fill">
2982
+ <mat-form-field appearance="outline">
2650
2983
  <mat-label>{{ tx('editor.validation.backend.allowedExtensions', 'Allowed extensions') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2651
2984
  <input
2652
2985
  matInput
@@ -2664,7 +2997,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2664
2997
  >
2665
2998
  </button>
2666
2999
  </mat-form-field>
2667
- <mat-form-field appearance="fill">
3000
+ <mat-form-field appearance="outline">
2668
3001
  <mat-label>{{ tx('editor.validation.backend.acceptMimeTypes', 'Accepted MIME types') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2669
3002
  <input
2670
3003
  matInput
@@ -2682,7 +3015,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2682
3015
  >
2683
3016
  </button>
2684
3017
  </mat-form-field>
2685
- <mat-form-field appearance="fill">
3018
+ <mat-form-field appearance="outline">
2686
3019
  <mat-label>{{ tx('editor.validation.backend.targetDirectory', 'Target directory') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2687
3020
  <input
2688
3021
  matInput
@@ -2730,11 +3063,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2730
3063
  <mat-checkbox formControlName="autoRetryOn429"
2731
3064
  >{{ tx('editor.validation.rateLimit.autoRetry', 'Retry automatically') }}</mat-checkbox
2732
3065
  >
2733
- <mat-form-field appearance="fill">
3066
+ <mat-form-field appearance="outline">
2734
3067
  <mat-label>{{ tx('editor.validation.rateLimit.maxAutoRetry', 'Maximum automatic retries') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2735
3068
  <input matInput type="number" formControlName="maxAutoRetry" />
2736
3069
  </mat-form-field>
2737
- <mat-form-field appearance="fill">
3070
+ <mat-form-field appearance="outline">
2738
3071
  <mat-label>{{ tx('editor.validation.rateLimit.baseBackoff', 'Base retry interval (ms)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2739
3072
  <input matInput type="number" formControlName="baseBackoffMs" />
2740
3073
  </mat-form-field>
@@ -2770,7 +3103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2770
3103
  <p class="section-note">
2771
3104
  {{ tx('editor.messages.section.note', 'Short and objective messages work better in high-frequency contexts. Use this group to adapt the interface voice to your environment.') }}
2772
3105
  </p>
2773
- <mat-form-field appearance="fill">
3106
+ <mat-form-field appearance="outline">
2774
3107
  <mat-label>{{ tx('editor.messages.successSingle', 'Success (single)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2775
3108
  <input
2776
3109
  matInput
@@ -2778,7 +3111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2778
3111
  [placeholder]="tx('editor.placeholders.successSingle', 'e.g.: File uploaded successfully')"
2779
3112
  />
2780
3113
  </mat-form-field>
2781
- <mat-form-field appearance="fill">
3114
+ <mat-form-field appearance="outline">
2782
3115
  <mat-label>{{ tx('editor.messages.successBulk', 'Success (batch)') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2783
3116
  <input
2784
3117
  matInput
@@ -2787,8 +3120,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2787
3120
  />
2788
3121
  </mat-form-field>
2789
3122
  <div [formGroup]="errorsGroup">
2790
- @for (e of errorEntries; track e) {
2791
- <mat-form-field appearance="fill">
3123
+ @for (e of errorEntries; track e.code) {
3124
+ <mat-form-field appearance="outline">
2792
3125
  <mat-label>{{ e.label }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2793
3126
  <input matInput [formControlName]="e.code" />
2794
3127
  <mat-hint class="code-hint">{{ e.code }}</mat-hint>
@@ -2813,7 +3146,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2813
3146
  <mat-icon aria-hidden="true">edit</mat-icon>
2814
3147
  {{ tx('editor.headers.section.title', 'Configurable options — Headers (query)') }}
2815
3148
  </h4>
2816
- <mat-form-field appearance="fill">
3149
+ <mat-form-field appearance="outline">
2817
3150
  <mat-label>{{ tx('editor.headers.tenantHeader', 'Tenant header') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2818
3151
  <input
2819
3152
  matInput
@@ -2821,7 +3154,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2821
3154
  placeholder="X-Tenant-Id"
2822
3155
  />
2823
3156
  </mat-form-field>
2824
- <mat-form-field appearance="fill">
3157
+ <mat-form-field appearance="outline">
2825
3158
  <mat-label>{{ tx('editor.headers.tenantValue', 'Tenant value') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2826
3159
  <input
2827
3160
  matInput
@@ -2829,7 +3162,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2829
3162
  [placeholder]="tx('editor.placeholders.tenantValue', 'e.g.: demo-tenant')"
2830
3163
  />
2831
3164
  </mat-form-field>
2832
- <mat-form-field appearance="fill">
3165
+ <mat-form-field appearance="outline">
2833
3166
  <mat-label>{{ tx('editor.headers.userHeader', 'User header') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2834
3167
  <input
2835
3168
  matInput
@@ -2837,7 +3170,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2837
3170
  placeholder="X-User-Id"
2838
3171
  />
2839
3172
  </mat-form-field>
2840
- <mat-form-field appearance="fill">
3173
+ <mat-form-field appearance="outline">
2841
3174
  <mat-label>{{ tx('editor.headers.userValue', 'User value') }} <span class="opt-tag">{{ tx('editor.shared.optionalTag', 'optional') }}</span></mat-label>
2842
3175
  <input matInput formControlName="userValue" [placeholder]="tx('editor.placeholders.userValue', 'e.g.: 42')" />
2843
3176
  </mat-form-field>
@@ -2871,7 +3204,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2871
3204
  }
2872
3205
  </div>
2873
3206
  @if (serverLoading()) {
2874
- <div>
3207
+ <div class="server-loading-status" role="status">
2875
3208
  {{ tx('editor.server.loading', 'Loading server configuration...') }}
2876
3209
  </div>
2877
3210
  } @else {
@@ -2975,11 +3308,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2975
3308
  </mat-tab-group>
2976
3309
  </div>
2977
3310
  </div>
2978
- `, styles: [".editor-layout{display:grid;grid-template-columns:minmax(260px,320px) minmax(0,1fr);gap:16px;align-items:start}.summary-panel{position:sticky;top:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--pfx-surface-border, #d8d8d8);border-radius:16px;background:linear-gradient(180deg,#fafbfc,#fff)}.summary-panel h3{margin:0;font-size:1rem;font-weight:600}.summary-panel .summary-intro{margin:0;color:#000000a6;line-height:1.4;font-size:.88rem}.summary-grid{display:grid;gap:10px}.summary-card{padding:12px;border-radius:12px;background:#fff;border:1px solid #e7e9ee}.summary-card .eyebrow{display:block;margin-bottom:4px;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#5f6b7a}.summary-card strong{display:block;margin-bottom:4px;font-size:.95rem}.summary-card p{margin:0;font-size:.85rem;line-height:1.45;color:#000000b8}.risk-panel{padding:12px;border-radius:12px;background:#fff8e8;border:1px solid #f0d29a}.risk-panel.safe{background:#f4fbf6;border-color:#b8ddc1}.risk-panel h4{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:.92rem}.risk-list{display:grid;gap:8px}.risk-item{padding:10px;border-radius:10px;background:#ffffffb8}.risk-item strong{display:block;margin-bottom:2px;font-size:.84rem}.risk-item p,.risk-panel .safe-copy{margin:0;font-size:.82rem;line-height:1.4;color:#000000b8}.editor-main{min-width:0}.tab-panel{display:grid;gap:16px;padding-top:8px}.tab-intro{padding:16px 18px;border:1px solid #e5e8ef;border-radius:16px;background:linear-gradient(180deg,#fff,#f7f9fc)}.tab-intro h3{margin:0 0 6px;font-size:1rem;font-weight:600}.tab-intro p{margin:0;font-size:.9rem;line-height:1.5;color:#000000b8}.config-section{padding:18px;border:1px solid #e5e8ef;border-radius:16px;background:#fff}.config-section+.config-section{margin-top:0}.section-note{margin:0 0 16px;color:#000000b3;font-size:.88rem;line-height:1.45}.advanced-note{padding:14px 16px;border-radius:14px;border:1px solid #f0d29a;background:#fff8e8;color:#000000c7;font-size:.88rem;line-height:1.45}.json-textarea{width:100%;min-height:280px;padding:14px 16px;border-radius:14px;border:1px solid #d7dce5;background:#0f172a;color:#e5eefc;font:500 .84rem/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}.server-tab{display:grid;gap:16px}.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.summary{display:grid;gap:8px;padding-left:18px}.summary li{line-height:1.45}details{margin-top:12px;padding:14px 16px;border:1px solid #e5e8ef;border-radius:14px;background:#fbfcfe}details pre{white-space:pre-wrap;word-break:break-word}@media(max-width:1100px){.editor-layout{grid-template-columns:1fr}.summary-panel{position:static}}.mat-mdc-form-field-icon-suffix{align-self:center}\n"] }]
3311
+ `, styles: [":host{display:block;min-width:0;container-type:inline-size;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.editor-layout{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:16px;align-items:start}.summary-panel{position:sticky;top:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:16px;background:var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.summary-panel h3{margin:0;font-size:1rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.summary-panel .summary-intro{margin:0;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant));line-height:1.4;font-size:.88rem}.summary-grid{display:grid;gap:10px}.summary-card{padding:12px;border-radius:12px;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container));border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant))}.summary-card .eyebrow{display:block;margin-bottom:4px;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.summary-card strong{display:block;margin-bottom:4px;font-size:.95rem;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.summary-card p{margin:0;font-size:.85rem;line-height:1.45;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.risk-panel{padding:12px;border-radius:12px;background:color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 12%,var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low)));border:1px solid color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 38%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)))}.risk-panel.safe{background:color-mix(in srgb,var(--pfx-settings-panel-primary, var(--md-sys-color-primary)) 10%,var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low)));border-color:color-mix(in srgb,var(--pfx-settings-panel-primary, var(--md-sys-color-primary)) 32%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)))}.risk-panel h4{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:.92rem;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.risk-list{display:grid;gap:8px}.risk-item{padding:10px;border-radius:10px;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container));border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant))}.risk-item strong{display:block;margin-bottom:2px;font-size:.84rem;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.risk-item p,.risk-panel .safe-copy{margin:0;font-size:.82rem;line-height:1.4;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.editor-main{min-width:0}.tab-panel{display:grid;gap:16px;padding-top:8px}.tab-intro{padding:14px 16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:14px;background:var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low))}.tab-intro h3{margin:0 0 6px;font-size:1rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.tab-intro p{margin:0;font-size:.9rem;line-height:1.5;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.config-section{padding:16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:14px;background:var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low));display:grid;gap:12px}.config-section form{display:grid;gap:12px}.config-section+.config-section{margin-top:0}.section-subtitle{display:flex;align-items:center;gap:8px;margin:0;font-size:.95rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.section-note{margin:0 0 4px;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant));font-size:.86rem;line-height:1.45}.subgroup{margin:8px 0 0;padding:14px 0 0;border:0;border-top:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:0;background:transparent;display:grid;gap:12px}.subgroup legend{display:inline-flex;align-items:center;gap:6px;padding:0 8px 0 0;font-size:.88rem;font-weight:600;color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.opt-tag,.req-tag{font-size:.72rem;font-weight:500;margin-left:4px;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.req-tag{color:var(--pfx-settings-panel-primary, var(--md-sys-color-primary));font-weight:600}.warn{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:10px;font-size:.84rem;line-height:1.4;background:color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 14%,var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container)));border:1px solid color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 38%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface))}.error{padding:10px 12px;border-radius:10px;font-size:.84rem;background:color-mix(in srgb,var(--pfx-settings-panel-error, var(--md-sys-color-error)) 14%,transparent);border:1px solid var(--pfx-settings-panel-error, var(--md-sys-color-error));color:var(--pfx-settings-panel-error, var(--md-sys-color-error))}.server-loading-status{display:inline-block;padding:6px 0;font-size:.88rem;font-weight:600;background-image:var( --pdx-text-shimmer-gradient, linear-gradient( 105deg, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 0%, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 28%, var(--pfx-settings-panel-primary, var(--md-sys-color-primary)) 44%, var(--md-sys-color-tertiary, #7c3aed) 56%, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 72%, var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant)) 100% ) );background-size:260% 100%;background-position:200% 50%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:praxis-files-upload-server-shimmer var(--pdx-text-shimmer-duration, 2.4s) linear infinite}@keyframes praxis-files-upload-server-shimmer{0%{background-position:200% 50%}to{background-position:-60% 50%}}@media(prefers-reduced-motion:reduce),(forced-colors:active),print{.server-loading-status{animation:none;background-image:none;color:var( --pdx-text-shimmer-fallback-color, var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface)) );-webkit-text-fill-color:currentColor}}@media(forced-colors:active){.server-loading-status{color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}}.badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:.72rem;font-weight:600;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container-high));color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.hint,.note{font-size:.84rem;color:var(--pfx-settings-panel-on-surface-variant, var(--md-sys-color-on-surface-variant))}.advanced-note{padding:14px 16px;border-radius:14px;border:1px solid color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 38%,var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant)));background:color-mix(in srgb,var(--md-sys-color-tertiary, #f59e0b) 12%,var(--pfx-settings-panel-surface-container-low, var(--md-sys-color-surface-container-low)));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface));font-size:.88rem;line-height:1.45}.json-textarea{box-sizing:border-box;width:100%;min-height:280px;padding:14px 16px;border-radius:14px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container-highest));color:var(--pfx-settings-panel-on-surface, var(--md-sys-color-on-surface));font:500 .84rem/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}.server-tab{display:grid;gap:16px}.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.summary{display:grid;gap:8px;padding-left:18px}.summary li{line-height:1.45}details{margin-top:12px;padding:14px 16px;border:1px solid var(--pfx-settings-panel-outline-variant, var(--md-sys-color-outline-variant));border-radius:14px;background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface-container))}details pre{white-space:pre-wrap;word-break:break-word}@container (max-width: 820px){.editor-layout{grid-template-columns:1fr}.summary-panel{position:static}}@media(max-width:960px){.editor-layout{grid-template-columns:1fr}.summary-panel{position:static}}.mat-mdc-form-field-icon-suffix{align-self:center}\n"] }]
2979
3312
  }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: undefined, decorators: [{
2980
3313
  type: Inject,
2981
3314
  args: [SETTINGS_PANEL_DATA]
2982
- }] }, { type: i2.MatSnackBar }, { type: i0.DestroyRef }] });
3315
+ }] }, { type: i2$1.MatSnackBar }, { type: i0.DestroyRef }] });
2983
3316
 
2984
3317
  function toError(key, info) {
2985
3318
  return { [key]: info };
@@ -3113,8 +3446,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
3113
3446
 
3114
3447
  class FilesApiClient {
3115
3448
  http;
3116
- constructor(http) {
3449
+ runtimeContext;
3450
+ apiUrlConfig;
3451
+ constructor(http, runtimeContext, apiUrlConfig = null) {
3117
3452
  this.http = http;
3453
+ this.runtimeContext = runtimeContext;
3454
+ this.apiUrlConfig = apiUrlConfig;
3455
+ }
3456
+ /** Consulta configuração efetiva de upload do backend. */
3457
+ getConfig(baseUrl, withCredentials = true, requestOptions) {
3458
+ return this.http.get(`${this.normalizeBaseUrl(baseUrl)}/config`, {
3459
+ headers: this.buildHeaders(requestOptions),
3460
+ withCredentials,
3461
+ });
3118
3462
  }
3119
3463
  /** Upload de um único arquivo com metadata/conflictPolicy e options JSON. */
3120
3464
  upload(baseUrl, file, options = {}) {
@@ -3127,11 +3471,72 @@ class FilesApiClient {
3127
3471
  if (options.conflictPolicy)
3128
3472
  formData.append('conflictPolicy', options.conflictPolicy);
3129
3473
  return this.http
3130
- .post(`${baseUrl}/upload`, formData, {
3474
+ .post(`${this.normalizeBaseUrl(baseUrl)}/upload`, formData, {
3475
+ headers: this.stripContentTypeHeader(this.buildHeaders(options)),
3131
3476
  reportProgress: true,
3132
3477
  observe: 'events',
3478
+ withCredentials: options.withCredentials ?? true,
3133
3479
  })
3134
- .pipe(retry(options.retryCount ?? 0));
3480
+ .pipe(retry({
3481
+ count: options.retryCount ?? 0,
3482
+ delay: (error, retryCount) => isTransientUploadHttpError(error)
3483
+ ? timer(computeUploadRetryDelayMs(error, retryCount))
3484
+ : throwError(() => error),
3485
+ }));
3486
+ }
3487
+ /** Consulta metadados públicos de um arquivo enviado. */
3488
+ getMetadata(baseUrl, fileId, withCredentials = true, requestOptions) {
3489
+ if (!isSafePraxisFileId(fileId)) {
3490
+ return throwError(() => new Error('Invalid fileId.'));
3491
+ }
3492
+ return this.http.get(`${this.normalizeBaseUrl(baseUrl)}/${encodeURIComponent(fileId.trim())}`, {
3493
+ headers: this.buildHeaders(requestOptions),
3494
+ withCredentials,
3495
+ });
3496
+ }
3497
+ /** Confirma ciclo de vida do arquivo (`STAGED` -> `ACTIVE`). */
3498
+ confirm(baseUrl, fileId, withCredentials = true, requestOptions) {
3499
+ if (!isSafePraxisFileId(fileId)) {
3500
+ return throwError(() => new Error('Invalid fileId.'));
3501
+ }
3502
+ return this.http.post(`${this.normalizeBaseUrl(baseUrl)}/${encodeURIComponent(fileId.trim())}/confirm`, null, {
3503
+ headers: this.buildHeaders(requestOptions),
3504
+ withCredentials,
3505
+ });
3506
+ }
3507
+ /** Remove arquivo e marca metadados como `DELETED`. */
3508
+ delete(baseUrl, fileId, withCredentials = true, requestOptions) {
3509
+ if (!isSafePraxisFileId(fileId)) {
3510
+ return throwError(() => new Error('Invalid fileId.'));
3511
+ }
3512
+ return this.http.delete(`${this.normalizeBaseUrl(baseUrl)}/${encodeURIComponent(fileId.trim())}`, {
3513
+ headers: this.buildHeaders(requestOptions),
3514
+ withCredentials,
3515
+ });
3516
+ }
3517
+ /** Retorna URL segura para download ou visualização inline (`/content`). */
3518
+ getContentUrl(baseUrl, fileId, disposition = 'attachment') {
3519
+ if (!isSafePraxisFileId(fileId)) {
3520
+ return '';
3521
+ }
3522
+ const safeDisposition = disposition === 'inline' ? 'inline' : 'attachment';
3523
+ return `${this.normalizeBaseUrl(baseUrl)}/${encodeURIComponent(fileId.trim())}/content?disposition=${safeDisposition}`;
3524
+ }
3525
+ /** Baixa conteúdo binário do arquivo (`/content`). */
3526
+ getContent(baseUrl, fileId, disposition = 'attachment', withCredentials = true, requestOptions) {
3527
+ const url = this.getContentUrl(baseUrl, fileId, disposition);
3528
+ if (!url) {
3529
+ return throwError(() => new Error('Invalid fileId.'));
3530
+ }
3531
+ return this.http.get(url, {
3532
+ headers: this.buildHeaders(requestOptions),
3533
+ responseType: 'blob',
3534
+ withCredentials,
3535
+ });
3536
+ }
3537
+ /** Baixa conteúdo binário autenticado (`/content`) para preview seguro via Blob. */
3538
+ fetchContentBlob(baseUrl, fileId, disposition = 'inline', withCredentials = true, requestOptions) {
3539
+ return this.getContent(baseUrl, fileId, disposition, withCredentials, requestOptions);
3135
3540
  }
3136
3541
  /** Upload múltiplo com arrays de metadata/conflictPolicy e options JSON. */
3137
3542
  bulkUpload(baseUrl, files, options = {}) {
@@ -3154,24 +3559,187 @@ class FilesApiClient {
3154
3559
  formData.append('conflictPolicy', JSON.stringify(policies));
3155
3560
  }
3156
3561
  return this.http
3157
- .post(`${baseUrl}/bulk`, formData, {
3562
+ .post(`${this.normalizeBaseUrl(baseUrl)}/bulk`, formData, {
3563
+ headers: this.stripContentTypeHeader(this.buildHeaders(options)),
3158
3564
  reportProgress: true,
3159
3565
  observe: 'events',
3566
+ withCredentials: options.withCredentials ?? true,
3160
3567
  })
3161
- .pipe(retry(options.retryCount ?? 0));
3568
+ .pipe(retry({
3569
+ count: options.retryCount ?? 0,
3570
+ delay: (error, retryCount) => isTransientUploadHttpError(error)
3571
+ ? timer(computeUploadRetryDelayMs(error, retryCount))
3572
+ : throwError(() => error),
3573
+ }));
3162
3574
  }
3163
- presign(baseUrl, fileName) {
3575
+ presign(baseUrl, fileName, withCredentials = true, requestOptions) {
3164
3576
  // Backend: POST /upload/presign?filename=...
3165
- const url = `${baseUrl}/upload/presign?filename=${encodeURIComponent(fileName)}`;
3166
- return this.http.post(url, null, { observe: 'body' });
3577
+ const url = `${this.normalizeBaseUrl(baseUrl)}/upload/presign?filename=${encodeURIComponent(fileName)}`;
3578
+ return this.http.post(url, null, {
3579
+ headers: this.buildHeaders(requestOptions),
3580
+ observe: 'body',
3581
+ withCredentials,
3582
+ });
3583
+ }
3584
+ normalizeBaseUrl(baseUrl) {
3585
+ const trimmed = (baseUrl ?? '').trim().replace(/\/+$/, '');
3586
+ return trimmed || '/api/files';
3587
+ }
3588
+ buildHeaders(requestOptions) {
3589
+ const headerEntries = new Map();
3590
+ const apiKey = requestOptions?.apiUrlKey?.trim();
3591
+ const entry = (apiKey ? this.apiUrlConfig?.[apiKey] : undefined)
3592
+ || this.apiUrlConfig?.['files']
3593
+ || this.apiUrlConfig?.['default'];
3594
+ if (requestOptions?.preserveExplicitContextHeaders) {
3595
+ this.applyRecordToMap(headerEntries, this.readBaseHeaders(), true);
3596
+ this.applyHttpHeadersToMap(headerEntries, buildHeaders(entry || {}), true);
3597
+ this.applyRecordToMap(headerEntries, requestOptions.headers, false);
3598
+ return this.toHttpHeaders(headerEntries);
3599
+ }
3600
+ this.applyRecordToMap(headerEntries, this.readBaseHeaders(), false);
3601
+ this.applyHttpHeadersToMap(headerEntries, buildHeaders(entry || {}), false);
3602
+ this.applyRecordToMap(headerEntries, requestOptions?.headers, false);
3603
+ let headers = this.toHttpHeaders(headerEntries) ?? new HttpHeaders();
3604
+ if (this.runtimeContext) {
3605
+ headers = this.runtimeContext.applyHeaders(headers);
3606
+ }
3607
+ return headers.keys().length > 0 ? headers : undefined;
3608
+ }
3609
+ stripContentTypeHeader(headers) {
3610
+ if (!headers) {
3611
+ return undefined;
3612
+ }
3613
+ let next = headers;
3614
+ for (const key of headers.keys()) {
3615
+ if (key.toLowerCase() === 'content-type') {
3616
+ next = next.delete(key);
3617
+ }
3618
+ }
3619
+ return next.keys().length > 0 ? next : undefined;
3620
+ }
3621
+ readBaseHeaders() {
3622
+ const shouldUseEnterpriseContext = Boolean(this.runtimeContext
3623
+ && (this.runtimeContext.effectiveContext
3624
+ || this.runtimeContext.snapshot
3625
+ || this.runtimeContext.isSwitching
3626
+ || this.runtimeContext.lifecycleState() !== 'idle'));
3627
+ if (shouldUseEnterpriseContext && this.runtimeContext?.effectiveRequestHeaders) {
3628
+ return this.runtimeContext.effectiveRequestHeaders();
3629
+ }
3630
+ try {
3631
+ const factory = globalThis
3632
+ .PAX_FETCH_HEADERS;
3633
+ const result = factory?.();
3634
+ return result && typeof result === 'object' ? result : undefined;
3635
+ }
3636
+ catch {
3637
+ return undefined;
3638
+ }
3639
+ }
3640
+ applyHttpHeadersToMap(target, source, excludeContextual) {
3641
+ if (!source) {
3642
+ return;
3643
+ }
3644
+ for (const key of source.keys()) {
3645
+ if (excludeContextual && isPraxisContextualHeaderName(key)) {
3646
+ continue;
3647
+ }
3648
+ const values = source.getAll(key);
3649
+ if (values && values.length > 0) {
3650
+ target.set(key.toLowerCase(), {
3651
+ name: key,
3652
+ value: values.length === 1 ? values[0] : values,
3653
+ });
3654
+ }
3655
+ }
3167
3656
  }
3168
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiClient, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3657
+ applyRecordToMap(target, source, excludeContextual) {
3658
+ if (!source) {
3659
+ return;
3660
+ }
3661
+ for (const [name, raw] of Object.entries(source)) {
3662
+ if (excludeContextual && isPraxisContextualHeaderName(name)) {
3663
+ continue;
3664
+ }
3665
+ if (typeof raw === 'string' && raw.trim()) {
3666
+ target.set(name.toLowerCase(), { name, value: raw });
3667
+ }
3668
+ }
3669
+ }
3670
+ toHttpHeaders(entries) {
3671
+ if (entries.size === 0) {
3672
+ return undefined;
3673
+ }
3674
+ let headers = new HttpHeaders();
3675
+ for (const entry of entries.values()) {
3676
+ headers = headers.set(entry.name, entry.value);
3677
+ }
3678
+ return headers;
3679
+ }
3680
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiClient, deps: [{ token: i1.HttpClient }, { token: i2.EnterpriseRuntimeContextService, optional: true }, { token: API_URL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
3169
3681
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiClient, providedIn: 'root' });
3170
3682
  }
3171
3683
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiClient, decorators: [{
3172
3684
  type: Injectable,
3173
3685
  args: [{ providedIn: 'root' }]
3174
- }], ctorParameters: () => [{ type: i1.HttpClient }] });
3686
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.EnterpriseRuntimeContextService, decorators: [{
3687
+ type: Optional
3688
+ }] }, { type: undefined, decorators: [{
3689
+ type: Optional
3690
+ }, {
3691
+ type: Inject,
3692
+ args: [API_URL]
3693
+ }] }] });
3694
+ function isTransientUploadHttpError(error) {
3695
+ const status = error?.status;
3696
+ if (typeof status !== 'number') {
3697
+ return false;
3698
+ }
3699
+ if (status === 429) {
3700
+ const code = extractUploadErrorCode(error);
3701
+ if (code === 'COTA_EXCEDIDA' || code === 'QUOTA_EXCEEDED') {
3702
+ return false;
3703
+ }
3704
+ return true;
3705
+ }
3706
+ return status === 0 || status === 408 || status >= 500;
3707
+ }
3708
+ function extractUploadErrorCode(error) {
3709
+ const body = error?.error;
3710
+ if (!body || typeof body !== 'object' || Array.isArray(body)) {
3711
+ return '';
3712
+ }
3713
+ const record = body;
3714
+ const errors = record['errors'];
3715
+ if (Array.isArray(errors) && errors.length > 0 && errors[0] && typeof errors[0] === 'object') {
3716
+ const firstCode = errors[0]['code'];
3717
+ if (typeof firstCode === 'string' && firstCode.trim()) {
3718
+ return firstCode.trim().toUpperCase();
3719
+ }
3720
+ }
3721
+ const direct = record['code'] ?? record['errorCode'];
3722
+ return typeof direct === 'string' ? direct.trim().toUpperCase() : '';
3723
+ }
3724
+ function computeUploadRetryDelayMs(error, retryAttempt) {
3725
+ const headers = error?.headers;
3726
+ const rawRetryAfter = headers?.get?.('Retry-After')?.trim();
3727
+ if (rawRetryAfter) {
3728
+ if (/^\d+$/.test(rawRetryAfter)) {
3729
+ const secs = Number(rawRetryAfter);
3730
+ if (Number.isFinite(secs) && secs >= 0) {
3731
+ return Math.min(60_000, Math.max(500, secs * 1000));
3732
+ }
3733
+ }
3734
+ const parsedMs = Date.parse(rawRetryAfter);
3735
+ if (Number.isFinite(parsedMs)) {
3736
+ const deltaMs = Math.max(0, parsedMs - Date.now());
3737
+ return Math.min(60_000, Math.max(500, deltaMs));
3738
+ }
3739
+ }
3740
+ const attempt = Number.isFinite(retryAttempt) && retryAttempt > 0 ? retryAttempt : 1;
3741
+ return Math.min(60_000, 500 * attempt);
3742
+ }
3175
3743
 
3176
3744
  class PresignedUploaderService {
3177
3745
  http;
@@ -3250,6 +3818,33 @@ const DEFAULT_MESSAGES = {
3250
3818
  ARQUIVO_MUITO_GRANDE: 'Arquivo muito grande.',
3251
3819
  TIPO_ARQUIVO_INVALIDO: 'Tipo de arquivo inválido.',
3252
3820
  TIPO_MIDIA_NAO_SUPORTADO: 'Tipo de mídia não suportado.',
3821
+ TIPO_NAO_SUPORTADO: 'Tipo de arquivo não suportado.',
3822
+ TIPO_MIME_INCOMPATIVEL: 'O tipo MIME do conteúdo não corresponde ao arquivo enviado.',
3823
+ ASSINATURA_INVALIDA: 'Assinatura do arquivo incompatível com o formato declarado.',
3824
+ MAGIC_NUMBER_INCOMPATIVEL: 'Conteúdo binário incompatível com a extensão declarada.',
3825
+ ESTRUTURA_SUSPEITA: 'Estrutura suspeita detectada no documento.',
3826
+ ARQUIVO_CORROMPIDO: 'Arquivo corrompido ou ilegível.',
3827
+ ZIP_BOMB_DETECTADO: 'Arquivo compactado excede limites seguros de extração.',
3828
+ EXECUTAVEL_INCORPORADO: 'Conteúdo executável incorporado detectado.',
3829
+ PATH_TRAVERSAL: 'Caminho de arquivo inválido detectado.',
3830
+ ARQUIVO_VAZIO: 'O arquivo enviado está vazio.',
3831
+ CAMINHO_INVALIDO: 'Caminho do arquivo inválido.',
3832
+ NOME_ARQUIVO_INVALIDO: 'Nome do arquivo inválido.',
3833
+ ARQUIVO_EXECUTAVEL_PERIGOSO: 'Arquivo executável bloqueado pela política de segurança.',
3834
+ SCRIPT_PERIGOSO: 'Script potencialmente perigoso detectado no arquivo.',
3835
+ TIPO_ARQUIVO_PERIGOSO: 'Tipo de arquivo bloqueado pela política de segurança.',
3836
+ EXTENSAO_SUSPEITA_BLOQUEADA: 'Extensão suspeita bloqueada pela política de segurança.',
3837
+ VIOLACAO_SEGURANCA: 'Arquivo bloqueado por violação de segurança.',
3838
+ SCANNER_VIRUS_INDISPONIVEL: 'Scanner antivírus indisponível no momento. Tente novamente em instantes.',
3839
+ MALWARE_DETECTADO: 'Malware detectado no arquivo.',
3840
+ VIRUS_DETECTADO: 'Vírus detectado no arquivo.',
3841
+ TEMPO_ESGOTADO_UPLOAD: 'Tempo esgotado durante o envio do arquivo.',
3842
+ TEMPO_ESGOTADO_UPLOAD_LOTE: 'Tempo esgotado durante o envio em lote.',
3843
+ ERRO_IO: 'Falha de leitura/escrita durante o envio do arquivo.',
3844
+ ESPAÇO_INSUFICIENTE: 'Armazenamento temporário insuficiente no servidor.',
3845
+ ESPACO_INSUFICIENTE: 'Armazenamento temporário insuficiente no servidor.',
3846
+ ARQUIVO_NAO_ENCONTRADO: 'Arquivo não encontrado.',
3847
+ ACESSO_NEGADO: 'Sem permissão para acessar ou modificar este arquivo.',
3253
3848
  CAMPO_OBRIGATORIO_AUSENTE: 'Campo obrigatório ausente.',
3254
3849
  OPCOES_JSON_INVALIDAS: 'JSON de opções inválido.',
3255
3850
  ARGUMENTO_INVALIDO: 'Argumento inválido.',
@@ -3258,6 +3853,11 @@ const DEFAULT_MESSAGES = {
3258
3853
  LIMITE_TAXA_EXCEDIDO: 'Limite de taxa excedido.',
3259
3854
  COTA_EXCEDIDA: 'Cota excedida.',
3260
3855
  ARQUIVO_JA_EXISTE: 'Arquivo já existe.',
3856
+ ARQUIVO_SOB_RETENCAO: 'O arquivo está protegido por política de retenção ou aprovação pendente.',
3857
+ CONFLITO_ESTADO: 'O estado atual do arquivo não permite esta operação.',
3858
+ EXCLUSAO_ATIVO_BLOQUEADA: 'A política configurada não permite excluir arquivos confirmados.',
3859
+ NO_FILES_PROVIDED: 'Nenhum arquivo foi selecionado para envio.',
3860
+ INVALID_OPTIONS_FORMAT: 'Formato inválido no campo de opções.',
3261
3861
  };
3262
3862
  class ErrorMapperService {
3263
3863
  i18n;
@@ -3271,46 +3871,64 @@ class ErrorMapperService {
3271
3871
  map(error, headers) {
3272
3872
  const primary = getPrimaryErrorItem(error);
3273
3873
  const code = String(primary?.code || 'UNKNOWN_ERROR');
3874
+ const locale = this.i18n?.getLocale?.() ?? 'pt-BR';
3875
+ const isEnglish = locale.trim().toLowerCase().startsWith('en');
3274
3876
  const translatedMessage = resolvePraxisFilesUploadText(this.i18n, `errors.${code}`, '', undefined, this.legacyTranslate);
3275
- const defaultMessage = DEFAULT_MESSAGES[code] ??
3276
- primary?.message ??
3277
- (isErrorEnvelope(error) ? error.message : undefined) ??
3278
- 'Erro desconhecido.';
3877
+ const catalogDictionary = (isEnglish ? FILES_UPLOAD_EN_US : FILES_UPLOAD_PT_BR);
3878
+ const dictionaryMessage = catalogDictionary[`praxis.filesUpload.errors.${code}`];
3879
+ const primaryMessage = primary?.message?.trim() ? primary.message : undefined;
3880
+ const envelopeMessage = isErrorEnvelope(error) && error.message?.trim() ? error.message : undefined;
3881
+ const defaultMessage = (isEnglish ? dictionaryMessage : DEFAULT_MESSAGES[code] ?? dictionaryMessage) ??
3882
+ primaryMessage ??
3883
+ envelopeMessage ??
3884
+ (isEnglish ? 'Unknown error.' : 'Erro desconhecido.');
3279
3885
  const configuredMessage = this.customMessages?.[code];
3280
3886
  const message = configuredMessage ??
3281
3887
  (translatedMessage || defaultMessage);
3282
3888
  // metadados do catálogo
3283
- const meta = getErrorMeta(code);
3889
+ const meta = getErrorMeta(code, locale);
3890
+ const resolvedTitle = resolvePraxisFilesUploadText(this.i18n, `errorTitles.${code}`, meta.title, undefined, this.legacyTranslate);
3891
+ const resolvedUserAction = meta.userAction
3892
+ ? resolvePraxisFilesUploadText(this.i18n, `errorActions.${code}`, meta.userAction, undefined, this.legacyTranslate)
3893
+ : undefined;
3284
3894
  const mapped = {
3285
3895
  message,
3286
- title: meta.title,
3896
+ title: resolvedTitle,
3287
3897
  severity: meta.severity,
3288
3898
  category: meta.category,
3289
3899
  phase: meta.phase,
3290
- userAction: meta.userAction,
3900
+ userAction: resolvedUserAction,
3901
+ ...(meta.retriable !== undefined ? { retriable: meta.retriable } : {}),
3291
3902
  };
3903
+ const retryAfterSeconds = parseRetryAfterHeader(headers?.get('Retry-After'));
3904
+ if (retryAfterSeconds !== undefined) {
3905
+ mapped.retryAfterSeconds = retryAfterSeconds;
3906
+ }
3292
3907
  const isRateLimit = code === 'LIMITE_TAXA_EXCEDIDO' ||
3293
3908
  code === 'RATE_LIMIT_EXCEEDED' ||
3294
3909
  code === 'SYS_RATE_LIMIT';
3295
3910
  if (isRateLimit) {
3296
- const limit = Number(headers?.get('X-RateLimit-Limit'));
3297
- const remaining = Number(headers?.get('X-RateLimit-Remaining'));
3298
- const resetEpochSeconds = Number(headers?.get('X-RateLimit-Reset'));
3299
- if (!Number.isNaN(limit) &&
3300
- !Number.isNaN(remaining) &&
3301
- !Number.isNaN(resetEpochSeconds)) {
3302
- mapped.rateLimit = { limit, remaining, resetEpochSeconds };
3911
+ const limit = parseFiniteHeaderNumber(headers?.get('X-RateLimit-Limit'));
3912
+ const remaining = parseFiniteHeaderNumber(headers?.get('X-RateLimit-Remaining'));
3913
+ const rawReset = parseFiniteHeaderNumber(headers?.get('X-RateLimit-Reset'));
3914
+ if (limit !== undefined && remaining !== undefined && rawReset !== undefined) {
3915
+ mapped.rateLimit = {
3916
+ limit,
3917
+ remaining,
3918
+ resetEpochSeconds: normalizeResetEpochSeconds(rawReset),
3919
+ ...(retryAfterSeconds !== undefined ? { retryAfterSeconds } : {}),
3920
+ };
3303
3921
  }
3304
3922
  }
3305
3923
  return mapped;
3306
3924
  }
3307
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ErrorMapperService, deps: [{ token: i1$2.PraxisI18nService }, { token: FILES_UPLOAD_ERROR_MESSAGES, optional: true }, { token: TRANSLATE_LIKE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
3925
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ErrorMapperService, deps: [{ token: i2.PraxisI18nService }, { token: FILES_UPLOAD_ERROR_MESSAGES, optional: true }, { token: TRANSLATE_LIKE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
3308
3926
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ErrorMapperService, providedIn: 'root' });
3309
3927
  }
3310
3928
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: ErrorMapperService, decorators: [{
3311
3929
  type: Injectable,
3312
3930
  args: [{ providedIn: 'root' }]
3313
- }], ctorParameters: () => [{ type: i1$2.PraxisI18nService }, { type: undefined, decorators: [{
3931
+ }], ctorParameters: () => [{ type: i2.PraxisI18nService }, { type: undefined, decorators: [{
3314
3932
  type: Optional
3315
3933
  }, {
3316
3934
  type: Inject,
@@ -3321,6 +3939,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
3321
3939
  type: Inject,
3322
3940
  args: [TRANSLATE_LIKE]
3323
3941
  }] }] });
3942
+ function parseRetryAfterHeader(raw) {
3943
+ const trimmed = raw?.trim();
3944
+ if (!trimmed) {
3945
+ return undefined;
3946
+ }
3947
+ if (/^\d+$/.test(trimmed)) {
3948
+ const num = Number(trimmed);
3949
+ return Number.isFinite(num) && num >= 0 ? num : undefined;
3950
+ }
3951
+ const parsedDateMs = Date.parse(trimmed);
3952
+ if (Number.isFinite(parsedDateMs)) {
3953
+ return Math.max(0, Math.ceil((parsedDateMs - Date.now()) / 1000));
3954
+ }
3955
+ return undefined;
3956
+ }
3957
+ function parseFiniteHeaderNumber(raw) {
3958
+ const trimmed = raw?.trim();
3959
+ if (!trimmed) {
3960
+ return undefined;
3961
+ }
3962
+ const num = Number(trimmed);
3963
+ return Number.isFinite(num) && num >= 0 ? num : undefined;
3964
+ }
3965
+ function normalizeResetEpochSeconds(rawReset) {
3966
+ if (rawReset > 1e12) {
3967
+ return Math.floor(rawReset / 1000);
3968
+ }
3969
+ if (rawReset < 1e9) {
3970
+ return Math.floor(Date.now() / 1000) + Math.max(0, Math.floor(rawReset));
3971
+ }
3972
+ return Math.floor(rawReset);
3973
+ }
3324
3974
 
3325
3975
  let nextPraxisFilesUploadA11yId = 0;
3326
3976
  class PraxisFilesUpload {
@@ -4109,6 +4759,10 @@ class PraxisFilesUpload {
4109
4759
  if (event.type === HttpEventType.Response) {
4110
4760
  const resp = event.body;
4111
4761
  const meta = this.mapUploadResponseToFileMetadata(resp);
4762
+ if (!meta || !meta.id) {
4763
+ this.handleError(new Error('Upload response missing a valid fileId.'));
4764
+ return;
4765
+ }
4112
4766
  this.finishUpload(true, meta);
4113
4767
  }
4114
4768
  else {
@@ -4373,6 +5027,7 @@ class PraxisFilesUpload {
4373
5027
  loaded: event.loaded,
4374
5028
  total: event.total,
4375
5029
  });
5030
+ this.cdr.markForCheck();
4376
5031
  }
4377
5032
  }
4378
5033
  handleError(err) {
@@ -4406,6 +5061,7 @@ class PraxisFilesUpload {
4406
5061
  this.errorMessage = normalizedError.message;
4407
5062
  this.error.emit(normalizedError);
4408
5063
  }
5064
+ this.cdr.markForCheck();
4409
5065
  }
4410
5066
  finishUpload(success, meta, results) {
4411
5067
  this.uploading = false;
@@ -4457,14 +5113,47 @@ class PraxisFilesUpload {
4457
5113
  if (!payload) {
4458
5114
  return undefined;
4459
5115
  }
5116
+ const nestedMeta = payload.metadata;
5117
+ const rawStatusValue = payload.status
5118
+ ?? (typeof nestedMeta?.['status'] === 'string' ? nestedMeta['status'] : undefined);
5119
+ const rawStatus = typeof rawStatusValue === 'string' ? rawStatusValue.trim().toUpperCase() : '';
5120
+ const normalizedStatus = rawStatus === 'STAGED'
5121
+ || rawStatus === 'PENDING_APPROVAL'
5122
+ || rawStatus === 'ACTIVE'
5123
+ || rawStatus === 'DELETED'
5124
+ ? rawStatus
5125
+ : undefined;
5126
+ const rawScanStatusValue = payload.scanStatus
5127
+ ?? (typeof nestedMeta?.['scanStatus'] === 'string' ? nestedMeta['scanStatus'] : undefined);
5128
+ const rawScanUpper = typeof rawScanStatusValue === 'string' ? rawScanStatusValue.trim().toUpperCase() : '';
5129
+ const scanStatus = !rawScanUpper
5130
+ ? ScanStatus.PENDING
5131
+ : rawScanUpper === 'ERROR'
5132
+ ? ScanStatus.FAILED
5133
+ : rawScanUpper === ScanStatus.CLEAN
5134
+ || rawScanUpper === ScanStatus.SCANNING
5135
+ || rawScanUpper === ScanStatus.INFECTED
5136
+ || rawScanUpper === ScanStatus.FAILED
5137
+ || rawScanUpper === ScanStatus.UNAVAILABLE
5138
+ || rawScanUpper === ScanStatus.SKIPPED
5139
+ || rawScanUpper === ScanStatus.PENDING
5140
+ ? rawScanUpper
5141
+ : ScanStatus.UNAVAILABLE;
5142
+ const tenantId = payload.tenantId
5143
+ ?? (typeof nestedMeta?.['tenantId'] === 'string' ? nestedMeta['tenantId'] : '');
5144
+ const safeId = isSafePraxisFileId(payload.fileId) ? payload.fileId.trim() : '';
4460
5145
  return {
4461
- id: payload.fileId || '',
5146
+ id: safeId,
4462
5147
  fileName: payload.originalFilename,
5148
+ ...(payload.serverFilename !== undefined ? { serverFilename: payload.serverFilename } : {}),
4463
5149
  contentType: payload.mimeType || '',
4464
5150
  fileSize: payload.fileSize,
5151
+ ...(payload.checksumSha256 !== undefined ? { checksumSha256: payload.checksumSha256 } : {}),
4465
5152
  uploadedAt: payload.uploadTimestamp,
4466
- tenantId: '',
4467
- scanStatus: ScanStatus.PENDING,
5153
+ tenantId,
5154
+ ...(normalizedStatus ? { status: normalizedStatus } : {}),
5155
+ scanStatus,
5156
+ ...(nestedMeta ? { metadata: nestedMeta } : {}),
4468
5157
  };
4469
5158
  }
4470
5159
  primaryErrorCode(error) {
@@ -4617,7 +5306,7 @@ class PraxisFilesUpload {
4617
5306
  return acc[key];
4618
5307
  }, context);
4619
5308
  }
4620
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisFilesUpload, deps: [{ token: i1$3.SettingsPanelService }, { token: DragProximityService }, { token: i3$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: ASYNC_CONFIG_STORAGE }, { token: i1$2.PraxisI18nService }, { token: FILES_UPLOAD_TEXTS, optional: true }, { token: TRANSLATE_LIKE, optional: true }, { token: ConfigService, optional: true }, { token: FilesApiClient, optional: true }, { token: PresignedUploaderService, optional: true }, { token: ErrorMapperService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
5309
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisFilesUpload, deps: [{ token: i1$2.SettingsPanelService }, { token: DragProximityService }, { token: i3$1.Overlay }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: ASYNC_CONFIG_STORAGE }, { token: i2.PraxisI18nService }, { token: FILES_UPLOAD_TEXTS, optional: true }, { token: TRANSLATE_LIKE, optional: true }, { token: ConfigService, optional: true }, { token: FilesApiClient, optional: true }, { token: PresignedUploaderService, optional: true }, { token: ErrorMapperService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
4621
5310
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisFilesUpload, isStandalone: true, selector: "praxis-files-upload", inputs: { config: "config", filesUploadId: "filesUploadId", componentInstanceId: "componentInstanceId", baseUrl: "baseUrl", displayMode: "displayMode", context: "context", enableCustomization: "enableCustomization" }, outputs: { uploadSuccess: "uploadSuccess", bulkComplete: "bulkComplete", error: "error", rateLimited: "rateLimited", uploadStart: "uploadStart", uploadProgress: "uploadProgress", retry: "retry", download: "download", copyLink: "copyLink", detailsOpened: "detailsOpened", detailsClosed: "detailsClosed", pendingStateChange: "pendingStateChange", proximityChange: "proximityChange", readinessChange: "readinessChange" }, providers: [providePraxisFilesUploadI18n()], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "hostRef", first: true, predicate: ["host"], descendants: true, static: true }, { propertyName: "overlayTmpl", first: true, predicate: ["proximityOverlayTmpl"], descendants: true }, { propertyName: "selectedOverlayTmpl", first: true, predicate: ["selectedOverlayTmpl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
4622
5311
  <div
4623
5312
  class="praxis-files-upload"
@@ -4676,7 +5365,7 @@ class PraxisFilesUpload {
4676
5365
  </button>
4677
5366
  </header>
4678
5367
  <ul class="sel-list">
4679
- @for (f of pendingFiles; track f) {
5368
+ @for (f of pendingFiles; track $index) {
4680
5369
  <li class="sel-item">
4681
5370
  <mat-icon class="file-icon" aria-hidden="true"
4682
5371
  >insert_drive_file</mat-icon
@@ -4923,7 +5612,7 @@ class PraxisFilesUpload {
4923
5612
 
4924
5613
  @if (hasUploadedFiles) {
4925
5614
  <ul class="file-feedback">
4926
- @for (f of uploadedFiles; track f) {
5615
+ @for (f of uploadedFiles; track $index) {
4927
5616
  <li>
4928
5617
  {{ f.fileName }} -
4929
5618
  {{
@@ -4955,7 +5644,7 @@ class PraxisFilesUpload {
4955
5644
  </header>
4956
5645
  }
4957
5646
  <ul class="results-list">
4958
- @for (r of visibleResults; track r) {
5647
+ @for (r of visibleResults; track $index) {
4959
5648
  <li
4960
5649
  class="result-item"
4961
5650
  [class.ok]="r.status === BulkUploadResultStatus.SUCCESS"
@@ -5194,7 +5883,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5194
5883
  </button>
5195
5884
  </header>
5196
5885
  <ul class="sel-list">
5197
- @for (f of pendingFiles; track f) {
5886
+ @for (f of pendingFiles; track $index) {
5198
5887
  <li class="sel-item">
5199
5888
  <mat-icon class="file-icon" aria-hidden="true"
5200
5889
  >insert_drive_file</mat-icon
@@ -5441,7 +6130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5441
6130
 
5442
6131
  @if (hasUploadedFiles) {
5443
6132
  <ul class="file-feedback">
5444
- @for (f of uploadedFiles; track f) {
6133
+ @for (f of uploadedFiles; track $index) {
5445
6134
  <li>
5446
6135
  {{ f.fileName }} -
5447
6136
  {{
@@ -5473,7 +6162,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5473
6162
  </header>
5474
6163
  }
5475
6164
  <ul class="results-list">
5476
- @for (r of visibleResults; track r) {
6165
+ @for (r of visibleResults; track $index) {
5477
6166
  <li
5478
6167
  class="result-item"
5479
6168
  [class.ok]="r.status === BulkUploadResultStatus.SUCCESS"
@@ -5638,10 +6327,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5638
6327
  <ng-content></ng-content>
5639
6328
  </div>
5640
6329
  `, styles: ["@charset \"UTF-8\";.praxis-files-upload{position:relative;container-type:inline-size}.praxis-files-upload .settings-btn{position:absolute;top:.5rem;right:.5rem}.praxis-files-upload .rate-limit-banner,.praxis-files-upload .quota-banner,.praxis-files-upload .error{margin:.5rem 0;padding:.5rem 1rem;border-radius:var(--md-sys-shape-corner-small, 4px)}.praxis-files-upload .rate-limit-banner{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}.praxis-files-upload .quota-banner{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}.praxis-files-upload .dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem;border:2px dashed var(--md-sys-color-outline);border-radius:var(--md-sys-shape-corner-medium, 4px);background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface);text-align:center;transition:background-color .2s;width:100%;min-height:160px;margin:.5rem 0;gap:.5rem;position:relative}.praxis-files-upload .dropzone:hover{outline:none;background:var(--md-sys-color-surface-container-high);border-color:var(--md-sys-color-primary)}.praxis-files-upload .dropzone.dragover{background:var(--md-sys-color-surface-container-high);border-color:var(--md-sys-color-primary)}.praxis-files-upload .dropzone.disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.praxis-files-upload .dropzone p{margin:0 0 .5rem}.praxis-files-upload .dropzone .dz-icon{font-size:40px;color:var(--md-sys-color-primary);margin-bottom:.25rem}.praxis-files-upload .dropzone .dz-title{font-weight:600}.praxis-files-upload .dropzone .dz-hint{margin:0;opacity:.8;font-size:.9rem}.praxis-files-upload .dropzone .field-actions{position:absolute;top:.25rem;right:.25rem;display:flex;gap:.25rem;pointer-events:auto}.praxis-files-upload .progress{margin-top:1rem}.praxis-files-upload .upload-policy-fields{display:grid;grid-template-columns:minmax(12rem,.8fr) minmax(16rem,1.2fr);align-items:start;gap:.75rem;margin-top:1rem}.praxis-files-upload .conflict-policy,.praxis-files-upload .metadata{width:100%;min-width:0}.praxis-files-upload .metadata textarea{resize:vertical}.praxis-files-upload .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.praxis-files-upload .bulk-results{margin-top:1rem}.praxis-files-upload .bulk-results .bulk-summary{display:flex;gap:1rem;align-items:center;margin-bottom:.5rem}.praxis-files-upload .bulk-results .bulk-summary .stat{display:flex;align-items:center;gap:.35rem;padding:.25rem .5rem;border-radius:6px;background:var(--md-sys-color-surface-container-low)}.praxis-files-upload .bulk-results .bulk-summary .stat.success{color:var(--md-sys-color-on-primary-container);background:var(--md-sys-color-primary-container)}.praxis-files-upload .bulk-results .bulk-summary .stat.failed{color:var(--md-sys-color-on-error-container);background:var(--md-sys-color-error-container)}.praxis-files-upload .bulk-results .bulk-summary .stat .label{opacity:.9}.praxis-files-upload .bulk-results .bulk-summary .stat .value{font-weight:600}.praxis-files-upload .bulk-results .results-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.5rem}.praxis-files-upload .bulk-results .result-item{display:flex;gap:.75rem;padding:.5rem .75rem;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;background:var(--md-sys-color-surface-container-lowest)}.praxis-files-upload .bulk-results .result-item.ok{border-color:var(--md-sys-color-primary)}.praxis-files-upload .bulk-results .result-item.err{border-color:var(--md-sys-color-error)}.praxis-files-upload .bulk-results .result-item .status-icon{align-self:flex-start;color:currentColor}.praxis-files-upload .bulk-results .result-item .main{flex:1;min-width:0}.praxis-files-upload .bulk-results .result-item .title{display:flex;align-items:center;gap:.5rem}.praxis-files-upload .bulk-results .result-item .name{font-weight:600}.praxis-files-upload .bulk-results .result-item .badge{font-size:.75rem;padding:.1rem .4rem;border-radius:999px;background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}.praxis-files-upload .bulk-results .result-item .badge.err{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}.praxis-files-upload .bulk-results .result-item .meta,.praxis-files-upload .bulk-results .result-item .error{display:flex;flex-wrap:wrap;gap:.5rem 1rem;margin-top:.25rem}.praxis-files-upload .bulk-results .result-item .error .code{font-weight:600}.praxis-files-upload .bulk-results .result-item .extra{margin-top:.25rem}.praxis-files-upload .bulk-results .result-item .item-actions{display:flex;align-items:center;gap:.25rem}.praxis-files-upload .bulk-results .list-footer{margin-top:.5rem;display:flex;justify-content:center}.praxis-files-upload .proximity-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;border:2px dashed var(--md-sys-color-outline);border-radius:var(--md-sys-shape-corner-medium, 4px);background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface);text-align:center;z-index:2;pointer-events:none}.praxis-files-upload .proximity-overlay .dz-icon{font-size:40px;color:var(--md-sys-color-primary)}.praxis-files-upload .proximity-overlay .dz-title{font-weight:600}.praxis-files-upload .proximity-overlay .dz-hint{opacity:.85}.praxis-files-upload .selected-overlay{background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface);border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;box-shadow:var(--md-sys-elevation-level2, 0 2px 6px rgba(0, 0, 0, .15));max-height:260px;overflow:auto;padding:.5rem}.praxis-files-upload .selected-overlay .sel-header{position:sticky;top:0;z-index:1;background:var(--md-sys-color-surface);display:flex;align-items:center;gap:.5rem;padding-bottom:.25rem;margin-bottom:.25rem}.praxis-files-upload .selected-overlay .sel-header .title{font-weight:600}.praxis-files-upload .selected-overlay .sel-header .spacer{flex:1}.praxis-files-upload .selected-overlay .sel-list{list-style:none;margin:0;padding:0}.praxis-files-upload .selected-overlay .sel-list .sel-item{display:flex;align-items:center;gap:.75rem;padding:.5rem .75rem;border-bottom:1px solid var(--md-sys-color-outline-variant, #ccc);transition:background-color .12s ease}.praxis-files-upload .selected-overlay .sel-list .sel-item .file-icon{opacity:.9;color:var(--md-sys-color-primary, #1976d2)}.praxis-files-upload .selected-overlay .sel-list .sel-item .info{flex:1;min-width:0}.praxis-files-upload .selected-overlay .sel-list .sel-item .info .name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.praxis-files-upload .selected-overlay .sel-list .sel-item .info .meta{font-size:.8rem;opacity:.7}.praxis-files-upload .selected-overlay .sel-list .sel-item .remove-btn{color:var(--md-sys-color-error, #b00020)}.praxis-files-upload .selected-overlay .sel-list .sel-item .more-btn{margin-left:.25rem}.praxis-files-upload .selected-overlay .sel-list .sel-item:hover{background:var(--md-sys-color-surface-container-low)}@container (max-width: 640px){.praxis-files-upload .upload-policy-fields{grid-template-columns:minmax(0,1fr)}}@media(max-width:640px){.praxis-files-upload .upload-policy-fields{grid-template-columns:minmax(0,1fr)}}:host ::ng-deep .praxis-files-upload-overlay-panel{pointer-events:none}:host ::ng-deep .praxis-files-selected-overlay-panel{pointer-events:auto;z-index:3}\n"] }]
5641
- }], ctorParameters: () => [{ type: i1$3.SettingsPanelService }, { type: DragProximityService }, { type: i3$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
6330
+ }], ctorParameters: () => [{ type: i1$2.SettingsPanelService }, { type: DragProximityService }, { type: i3$1.Overlay }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
5642
6331
  type: Inject,
5643
6332
  args: [ASYNC_CONFIG_STORAGE]
5644
- }] }, { type: i1$2.PraxisI18nService }, { type: undefined, decorators: [{
6333
+ }] }, { type: i2.PraxisI18nService }, { type: undefined, decorators: [{
5645
6334
  type: Optional
5646
6335
  }, {
5647
6336
  type: Inject,
@@ -6113,7 +6802,7 @@ class PdxFilesUploadFieldComponent extends SimpleBaseInputComponent {
6113
6802
  [attr.aria-label]="t('fieldPendingSummary','Arquivos prontos para envio')"
6114
6803
  (keydown)="onPendingPanelKeydown($event)"
6115
6804
  >
6116
- @for (file of pendingFiles; track file) {
6805
+ @for (file of pendingFiles; track $index) {
6117
6806
  <div
6118
6807
  class="pending-file-item"
6119
6808
  role="listitem"
@@ -6300,7 +6989,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
6300
6989
  [attr.aria-label]="t('fieldPendingSummary','Arquivos prontos para envio')"
6301
6990
  (keydown)="onPendingPanelKeydown($event)"
6302
6991
  >
6303
- @for (file of pendingFiles; track file) {
6992
+ @for (file of pendingFiles; track $index) {
6304
6993
  <div
6305
6994
  class="pending-file-item"
6306
6995
  role="listitem"
@@ -6429,6 +7118,264 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
6429
7118
  args: ['pendingPanel']
6430
7119
  }] } });
6431
7120
 
7121
+ const PRAXIS_FILES_API_UPLOAD_PORT_OPTIONS = new InjectionToken('PRAXIS_FILES_API_UPLOAD_PORT_OPTIONS', {
7122
+ providedIn: 'root',
7123
+ factory: () => ({}),
7124
+ });
7125
+ class FilesApiUploadPortAdapter {
7126
+ client;
7127
+ apiUrlConfig;
7128
+ options;
7129
+ constructor(client, apiUrlConfig = null, options = null) {
7130
+ this.client = client;
7131
+ this.apiUrlConfig = apiUrlConfig;
7132
+ this.options = options;
7133
+ }
7134
+ upload(request) {
7135
+ const baseUrl = this.resolveBaseUrl(request.baseUrl);
7136
+ const mergedHeaders = this.mergeHeaders(this.options?.headers, request.headers, Boolean(request.preserveExplicitContextHeaders));
7137
+ return this.client
7138
+ .upload(baseUrl, request.file, {
7139
+ optionsJson: request.optionsJson,
7140
+ metadata: request.metadata ? { ...request.metadata } : undefined,
7141
+ conflictPolicy: request.conflictPolicy,
7142
+ withCredentials: this.withCredentials(),
7143
+ ...(mergedHeaders ? { headers: mergedHeaders } : {}),
7144
+ ...(request.preserveExplicitContextHeaders ? { preserveExplicitContextHeaders: true } : {}),
7145
+ ...(this.options?.apiUrlKey?.trim() ? { apiUrlKey: this.options.apiUrlKey.trim() } : {}),
7146
+ })
7147
+ .pipe(concatMap((event) => {
7148
+ if (event.type === HttpEventType.UploadProgress) {
7149
+ const total = typeof event.total === 'number' && event.total > 0 ? event.total : undefined;
7150
+ const percent = total !== undefined
7151
+ ? Math.min(100, Math.round((event.loaded / total) * 100))
7152
+ : undefined;
7153
+ return of({
7154
+ type: 'progress',
7155
+ loaded: event.loaded,
7156
+ ...(total !== undefined ? { total } : {}),
7157
+ ...(percent !== undefined ? { percent } : {}),
7158
+ });
7159
+ }
7160
+ if (event.type === HttpEventType.Response) {
7161
+ const normalized = normalizePraxisStoredFileMetadata(event.body);
7162
+ if (!isSafePraxisFileId(normalized.fileId)) {
7163
+ return throwError(() => new Error('Upload response missing a valid fileId.'));
7164
+ }
7165
+ return of({
7166
+ type: 'completed',
7167
+ file: normalized,
7168
+ });
7169
+ }
7170
+ return EMPTY;
7171
+ }));
7172
+ }
7173
+ getMetadata(fileId, baseUrlOrOptions) {
7174
+ const op = resolvePraxisFileOperationOptions(baseUrlOrOptions);
7175
+ return this.client
7176
+ .getMetadata(this.resolveBaseUrl(op.baseUrl), fileId, this.withCredentials(), this.toClientRequestOptions(op))
7177
+ .pipe(map((response) => {
7178
+ const normalized = normalizePraxisStoredFileMetadata(response);
7179
+ if (!isSafePraxisFileId(normalized.fileId)) {
7180
+ throw new Error('Metadata response missing a valid fileId.');
7181
+ }
7182
+ return normalized;
7183
+ }));
7184
+ }
7185
+ confirm(fileId, baseUrlOrOptions) {
7186
+ const op = resolvePraxisFileOperationOptions(baseUrlOrOptions);
7187
+ return this.client
7188
+ .confirm(this.resolveBaseUrl(op.baseUrl), fileId, this.withCredentials(), this.toClientRequestOptions(op))
7189
+ .pipe(map((response) => {
7190
+ const normalized = normalizePraxisStoredFileMetadata(response);
7191
+ if (!isSafePraxisFileId(normalized.fileId)) {
7192
+ throw new Error('Confirm response missing a valid fileId.');
7193
+ }
7194
+ return normalized;
7195
+ }));
7196
+ }
7197
+ delete(fileId, baseUrlOrOptions) {
7198
+ if (!isSafePraxisFileId(fileId)) {
7199
+ return throwError(() => new Error('Invalid fileId.'));
7200
+ }
7201
+ const op = resolvePraxisFileOperationOptions(baseUrlOrOptions);
7202
+ const normalizedId = fileId.trim();
7203
+ return this.client
7204
+ .delete(this.resolveBaseUrl(op.baseUrl), fileId, this.withCredentials(), this.toClientRequestOptions(op))
7205
+ .pipe(map((response) => {
7206
+ if (response === null || response === undefined) {
7207
+ return {
7208
+ fileId: normalizedId,
7209
+ originalFilename: '',
7210
+ mimeType: '',
7211
+ fileSize: 0,
7212
+ status: 'DELETED',
7213
+ scanStatus: 'SKIPPED',
7214
+ };
7215
+ }
7216
+ const normalized = normalizePraxisStoredFileMetadata(response);
7217
+ return normalized.fileId
7218
+ ? normalized
7219
+ : { ...normalized, fileId: normalizedId, status: 'DELETED' };
7220
+ }));
7221
+ }
7222
+ getContentUrl(fileId, disposition = 'attachment', baseUrl) {
7223
+ return this.client.getContentUrl(this.resolveBaseUrl(baseUrl), fileId, disposition);
7224
+ }
7225
+ fetchContentBlob(fileId, disposition = 'inline', baseUrlOrOptions) {
7226
+ const op = resolvePraxisFileOperationOptions(baseUrlOrOptions);
7227
+ return this.client.fetchContentBlob(this.resolveBaseUrl(op.baseUrl), fileId, disposition, this.withCredentials(), this.toClientRequestOptions(op));
7228
+ }
7229
+ getConfig(baseUrlOrOptions) {
7230
+ const op = resolvePraxisFileOperationOptions(baseUrlOrOptions);
7231
+ return this.client
7232
+ .getConfig(this.resolveBaseUrl(op.baseUrl), this.withCredentials(), this.toClientRequestOptions(op))
7233
+ .pipe(map((response) => {
7234
+ const record = response;
7235
+ const data = record?.['data'] && typeof record['data'] === 'object' && !Array.isArray(record['data'])
7236
+ ? record['data']
7237
+ : record && typeof record === 'object' && !Array.isArray(record)
7238
+ ? record
7239
+ : {};
7240
+ const opts = data['options'] && typeof data['options'] === 'object' && !Array.isArray(data['options'])
7241
+ ? data['options']
7242
+ : {};
7243
+ return {
7244
+ allowedExtensions: Array.isArray(opts['allowedExtensions'])
7245
+ ? opts['allowedExtensions'].filter((item) => typeof item === 'string')
7246
+ : undefined,
7247
+ acceptMimeTypes: Array.isArray(opts['acceptMimeTypes'])
7248
+ ? opts['acceptMimeTypes'].filter((item) => typeof item === 'string')
7249
+ : undefined,
7250
+ maxUploadSizeMb: typeof opts['maxUploadSizeMb'] === 'number' ? opts['maxUploadSizeMb'] : null,
7251
+ enableVirusScanning: typeof opts['enableVirusScanning'] === 'boolean'
7252
+ ? opts['enableVirusScanning']
7253
+ : undefined,
7254
+ };
7255
+ }));
7256
+ }
7257
+ resolveBaseUrl(requestBaseUrl) {
7258
+ const rawRequest = requestBaseUrl?.trim();
7259
+ if (rawRequest === '/') {
7260
+ return '/api/files';
7261
+ }
7262
+ const explicitRequest = rawRequest?.replace(/\/+$/, '');
7263
+ if (explicitRequest) {
7264
+ return explicitRequest;
7265
+ }
7266
+ const rawOption = this.options?.baseUrl?.trim();
7267
+ if (rawOption === '/') {
7268
+ return '/api/files';
7269
+ }
7270
+ const explicitOption = rawOption?.replace(/\/+$/, '');
7271
+ if (explicitOption) {
7272
+ return explicitOption;
7273
+ }
7274
+ const key = this.options?.apiUrlKey?.trim();
7275
+ if (key && this.apiUrlConfig?.[key]) {
7276
+ const configured = buildApiUrl(this.apiUrlConfig[key]).replace(/\/+$/, '');
7277
+ if (configured) {
7278
+ return appendFilesSegmentForConfiguredEntry(configured);
7279
+ }
7280
+ }
7281
+ if (this.apiUrlConfig?.['files']) {
7282
+ const filesUrl = buildApiUrl(this.apiUrlConfig['files']).replace(/\/+$/, '');
7283
+ if (filesUrl) {
7284
+ return appendFilesSegmentForConfiguredEntry(filesUrl);
7285
+ }
7286
+ }
7287
+ if (this.apiUrlConfig?.['default']) {
7288
+ const defaultUrl = buildApiUrl(this.apiUrlConfig['default']).replace(/\/+$/, '');
7289
+ if (defaultUrl) {
7290
+ if (/^https?:\/\/[^/]+$/i.test(defaultUrl)) {
7291
+ return `${defaultUrl}/api/files`;
7292
+ }
7293
+ return defaultUrl.endsWith('/files') ? defaultUrl : `${defaultUrl}/files`;
7294
+ }
7295
+ }
7296
+ return '/api/files';
7297
+ }
7298
+ withCredentials() {
7299
+ return this.options?.withCredentials ?? true;
7300
+ }
7301
+ toClientRequestOptions(op) {
7302
+ const mergedHeaders = this.mergeHeaders(this.options?.headers, op.headers, Boolean(op.preserveExplicitContextHeaders));
7303
+ return {
7304
+ ...(mergedHeaders ? { headers: mergedHeaders } : {}),
7305
+ ...(op.preserveExplicitContextHeaders ? { preserveExplicitContextHeaders: true } : {}),
7306
+ ...(this.options?.apiUrlKey?.trim() ? { apiUrlKey: this.options.apiUrlKey.trim() } : {}),
7307
+ };
7308
+ }
7309
+ mergeHeaders(base, override, excludeBaseContextual = false) {
7310
+ if (!base && !override) {
7311
+ return undefined;
7312
+ }
7313
+ const entries = new Map();
7314
+ if (base) {
7315
+ for (const [key, value] of Object.entries(base)) {
7316
+ if (excludeBaseContextual && isPraxisContextualHeaderName(key)) {
7317
+ continue;
7318
+ }
7319
+ if (typeof value === 'string' && value.trim()) {
7320
+ entries.set(key.toLowerCase(), { name: key, value: value.trim() });
7321
+ }
7322
+ }
7323
+ }
7324
+ if (override) {
7325
+ for (const [key, value] of Object.entries(override)) {
7326
+ if (typeof value === 'string' && value.trim()) {
7327
+ entries.set(key.toLowerCase(), { name: key, value: value.trim() });
7328
+ }
7329
+ }
7330
+ }
7331
+ if (entries.size === 0) {
7332
+ return undefined;
7333
+ }
7334
+ const merged = {};
7335
+ for (const entry of entries.values()) {
7336
+ merged[entry.name] = entry.value;
7337
+ }
7338
+ return merged;
7339
+ }
7340
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiUploadPortAdapter, deps: [{ token: FilesApiClient }, { token: API_URL, optional: true }, { token: PRAXIS_FILES_API_UPLOAD_PORT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
7341
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiUploadPortAdapter });
7342
+ }
7343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: FilesApiUploadPortAdapter, decorators: [{
7344
+ type: Injectable
7345
+ }], ctorParameters: () => [{ type: FilesApiClient }, { type: undefined, decorators: [{
7346
+ type: Optional
7347
+ }, {
7348
+ type: Inject,
7349
+ args: [API_URL]
7350
+ }] }, { type: undefined, decorators: [{
7351
+ type: Optional
7352
+ }, {
7353
+ type: Inject,
7354
+ args: [PRAXIS_FILES_API_UPLOAD_PORT_OPTIONS]
7355
+ }] }] });
7356
+ function appendFilesSegmentForConfiguredEntry(url) {
7357
+ if (url.endsWith('/files')) {
7358
+ return url;
7359
+ }
7360
+ if (/^https?:\/\/[^/]+$/i.test(url)) {
7361
+ return `${url}/api/files`;
7362
+ }
7363
+ if (url === '/api' || url.endsWith('/api')) {
7364
+ return `${url}/files`;
7365
+ }
7366
+ return url;
7367
+ }
7368
+ function providePraxisFilesApiUploadPort(options = {}) {
7369
+ return [
7370
+ { provide: PRAXIS_FILES_API_UPLOAD_PORT_OPTIONS, useValue: options },
7371
+ FilesApiUploadPortAdapter,
7372
+ {
7373
+ provide: PRAXIS_FILE_UPLOAD_PORT,
7374
+ useExisting: FilesApiUploadPortAdapter,
7375
+ },
7376
+ ];
7377
+ }
7378
+
6432
7379
  class PraxisFilesUploadWidgetConfigEditor {
6433
7380
  inputs = null;
6434
7381
  widgetKey;
@@ -6878,6 +7825,41 @@ const FILES_UPLOAD_AI_CAPABILITIES = {
6878
7825
  ],
6879
7826
  };
6880
7827
 
7828
+ const filesAcceptedTypesResolutionSpec = {
7829
+ strategy: 'root-path',
7830
+ paths: ['ui.accept', 'options.allowedExtensions', 'options.acceptMimeTypes', 'ui', 'options'],
7831
+ allowIndex: false,
7832
+ };
7833
+ const filesSizeLimitResolutionSpec = {
7834
+ strategy: 'root-path',
7835
+ paths: ['limits.maxFileSizeBytes', 'options.maxUploadSizeMb', 'limits', 'options'],
7836
+ allowIndex: false,
7837
+ };
7838
+ const filesCountLimitResolutionSpec = {
7839
+ strategy: 'root-path',
7840
+ paths: ['limits.maxFilesPerBulk', 'limits.maxBulkSizeBytes', 'limits'],
7841
+ allowIndex: false,
7842
+ };
7843
+ const filesEndpointResolutionSpec = {
7844
+ strategy: 'root-path',
7845
+ paths: ['baseUrl', 'strategy', ''],
7846
+ allowIndex: false,
7847
+ };
7848
+ const filesSecurityPolicyResolutionSpec = {
7849
+ strategy: 'root-path',
7850
+ paths: ['options', 'quotas', 'rateLimit', 'headers', ''],
7851
+ allowIndex: false,
7852
+ };
7853
+ const filesErrorMessagesResolutionSpec = {
7854
+ strategy: 'root-path',
7855
+ paths: ['messages.errors', 'messages'],
7856
+ allowIndex: false,
7857
+ };
7858
+ const filesDisplayResolutionSpec = {
7859
+ strategy: 'root-path',
7860
+ paths: ['displayMode', 'ui', ''],
7861
+ allowIndex: false,
7862
+ };
6881
7863
  const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
6882
7864
  schemaVersion: '1.0.0',
6883
7865
  componentId: 'praxis-files-upload',
@@ -6894,14 +7876,14 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
6894
7876
  { name: 'enableCustomization', type: 'boolean', description: 'Enables the Settings Panel configuration editor.' },
6895
7877
  ],
6896
7878
  editableTargets: [
6897
- { kind: 'acceptedTypes', resolver: 'files-accept-list', description: 'Allowed file extensions and MIME types projected to ui.accept, options.allowedExtensions and options.acceptMimeTypes.' },
6898
- { kind: 'sizeLimit', resolver: 'max-file-size-policy', description: 'Maximum single-file size in limits.maxFileSizeBytes and backend-facing options.maxUploadSizeMb.' },
6899
- { kind: 'fileCountLimit', resolver: 'max-files-per-bulk-policy', description: 'Maximum number of files accepted in a bulk selection.' },
6900
- { kind: 'presignEndpoint', resolver: 'files-api-base-url-presign-contract', description: 'Presign operation endpoint derived from baseUrl + /upload/presign; arbitrary per-operation URLs are not accepted.' },
6901
- { kind: 'uploadEndpoint', resolver: 'files-api-base-url-upload-contract', description: 'Direct and bulk upload endpoints derived from baseUrl + /upload and /bulk.' },
6902
- { kind: 'securityPolicy', resolver: 'upload-security-policy', description: 'Strict validation, virus scanning, conflict policy, target directory, quotas, rate limit and contextual headers.' },
6903
- { kind: 'errorMessages', resolver: 'upload-error-code-message', description: 'Host-provided message overrides under messages.errors keyed by backend error code.' },
6904
- { kind: 'display', resolver: 'files-upload-display-mode-and-ui', description: 'Runtime displayMode plus non-backend visual UI flags.' },
7879
+ { kind: 'acceptedTypes', resolver: 'files-accept-list', resolutionSpec: filesAcceptedTypesResolutionSpec, description: 'Allowed file extensions and MIME types projected to ui.accept, options.allowedExtensions and options.acceptMimeTypes.' },
7880
+ { kind: 'sizeLimit', resolver: 'max-file-size-policy', resolutionSpec: filesSizeLimitResolutionSpec, description: 'Maximum single-file size in limits.maxFileSizeBytes and backend-facing options.maxUploadSizeMb.' },
7881
+ { kind: 'fileCountLimit', resolver: 'max-files-per-bulk-policy', resolutionSpec: filesCountLimitResolutionSpec, description: 'Maximum number of files accepted in a bulk selection.' },
7882
+ { kind: 'presignEndpoint', resolver: 'files-api-base-url-presign-contract', resolutionSpec: filesEndpointResolutionSpec, description: 'Presign operation endpoint derived from baseUrl + /upload/presign; arbitrary per-operation URLs are not accepted.' },
7883
+ { kind: 'uploadEndpoint', resolver: 'files-api-base-url-upload-contract', resolutionSpec: filesEndpointResolutionSpec, description: 'Direct and bulk upload endpoints derived from baseUrl + /upload and /bulk.' },
7884
+ { kind: 'securityPolicy', resolver: 'upload-security-policy', resolutionSpec: filesSecurityPolicyResolutionSpec, description: 'Strict validation, virus scanning, conflict policy, target directory, quotas, rate limit and contextual headers.' },
7885
+ { kind: 'errorMessages', resolver: 'upload-error-code-message', resolutionSpec: filesErrorMessagesResolutionSpec, description: 'Host-provided message overrides under messages.errors keyed by backend error code.' },
7886
+ { kind: 'display', resolver: 'files-upload-display-mode-and-ui', resolutionSpec: filesDisplayResolutionSpec, description: 'Runtime displayMode plus non-backend visual UI flags.' },
6905
7887
  ],
6906
7888
  operations: [
6907
7889
  {
@@ -6909,7 +7891,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
6909
7891
  title: 'Set accepted file types',
6910
7892
  scope: 'global',
6911
7893
  targetKind: 'acceptedTypes',
6912
- target: { kind: 'acceptedTypes', resolver: 'files-accept-list', ambiguityPolicy: 'fail', required: false },
7894
+ target: { kind: 'acceptedTypes', resolver: 'files-accept-list', resolutionSpec: filesAcceptedTypesResolutionSpec, ambiguityPolicy: 'fail', required: false },
6913
7895
  inputSchema: {
6914
7896
  type: 'object',
6915
7897
  required: ['accept'],
@@ -6936,7 +7918,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
6936
7918
  title: 'Set max file size',
6937
7919
  scope: 'global',
6938
7920
  targetKind: 'sizeLimit',
6939
- target: { kind: 'sizeLimit', resolver: 'max-file-size-policy', ambiguityPolicy: 'fail', required: false },
7921
+ target: { kind: 'sizeLimit', resolver: 'max-file-size-policy', resolutionSpec: filesSizeLimitResolutionSpec, ambiguityPolicy: 'fail', required: false },
6940
7922
  inputSchema: {
6941
7923
  type: 'object',
6942
7924
  required: ['maxFileSizeBytes'],
@@ -6961,7 +7943,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
6961
7943
  title: 'Set max file count',
6962
7944
  scope: 'global',
6963
7945
  targetKind: 'fileCountLimit',
6964
- target: { kind: 'fileCountLimit', resolver: 'max-files-per-bulk-policy', ambiguityPolicy: 'fail', required: false },
7946
+ target: { kind: 'fileCountLimit', resolver: 'max-files-per-bulk-policy', resolutionSpec: filesCountLimitResolutionSpec, ambiguityPolicy: 'fail', required: false },
6965
7947
  inputSchema: {
6966
7948
  type: 'object',
6967
7949
  required: ['maxFilesPerBulk'],
@@ -6986,7 +7968,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
6986
7968
  title: 'Set presign endpoint',
6987
7969
  scope: 'global',
6988
7970
  targetKind: 'presignEndpoint',
6989
- target: { kind: 'presignEndpoint', resolver: 'files-api-base-url-presign-contract', ambiguityPolicy: 'fail', required: false },
7971
+ target: { kind: 'presignEndpoint', resolver: 'files-api-base-url-presign-contract', resolutionSpec: filesEndpointResolutionSpec, ambiguityPolicy: 'fail', required: false },
6990
7972
  inputSchema: {
6991
7973
  type: 'object',
6992
7974
  required: ['baseUrl'],
@@ -7028,7 +8010,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
7028
8010
  title: 'Set upload endpoint',
7029
8011
  scope: 'global',
7030
8012
  targetKind: 'uploadEndpoint',
7031
- target: { kind: 'uploadEndpoint', resolver: 'files-api-base-url-upload-contract', ambiguityPolicy: 'fail', required: false },
8013
+ target: { kind: 'uploadEndpoint', resolver: 'files-api-base-url-upload-contract', resolutionSpec: filesEndpointResolutionSpec, ambiguityPolicy: 'fail', required: false },
7032
8014
  inputSchema: {
7033
8015
  type: 'object',
7034
8016
  required: ['baseUrl'],
@@ -7070,7 +8052,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
7070
8052
  title: 'Set upload security policy',
7071
8053
  scope: 'global',
7072
8054
  targetKind: 'securityPolicy',
7073
- target: { kind: 'securityPolicy', resolver: 'upload-security-policy', ambiguityPolicy: 'fail', required: false },
8055
+ target: { kind: 'securityPolicy', resolver: 'upload-security-policy', resolutionSpec: filesSecurityPolicyResolutionSpec, ambiguityPolicy: 'fail', required: false },
7074
8056
  inputSchema: {
7075
8057
  type: 'object',
7076
8058
  properties: {
@@ -7106,7 +8088,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
7106
8088
  title: 'Set error message override',
7107
8089
  scope: 'global',
7108
8090
  targetKind: 'errorMessages',
7109
- target: { kind: 'errorMessages', resolver: 'upload-error-code-message', ambiguityPolicy: 'fail', required: false },
8091
+ target: { kind: 'errorMessages', resolver: 'upload-error-code-message', resolutionSpec: filesErrorMessagesResolutionSpec, ambiguityPolicy: 'fail', required: false },
7110
8092
  inputSchema: {
7111
8093
  type: 'object',
7112
8094
  required: ['code', 'message'],
@@ -7128,7 +8110,7 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
7128
8110
  title: 'Set display mode',
7129
8111
  scope: 'global',
7130
8112
  targetKind: 'display',
7131
- target: { kind: 'display', resolver: 'files-upload-display-mode-and-ui', ambiguityPolicy: 'fail', required: false },
8113
+ target: { kind: 'display', resolver: 'files-upload-display-mode-and-ui', resolutionSpec: filesDisplayResolutionSpec, ambiguityPolicy: 'fail', required: false },
7132
8114
  inputSchema: {
7133
8115
  type: 'object',
7134
8116
  properties: {
@@ -7209,4 +8191,4 @@ const PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST = {
7209
8191
  * Generated bundle index. Do not edit.
7210
8192
  */
7211
8193
 
7212
- export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_EN_US, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PraxisFilesUploadWidgetConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, createPraxisFilesUploadI18nConfig, getPrimaryErrorItem, isErrorEnvelope, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesUploadI18n, providePraxisFilesUploadMetadata, resolvePraxisFilesUploadText };
8194
+ export { BulkUploadResultStatus, ErrorCode, ErrorMapperService, FILES_UPLOAD_AI_CAPABILITIES, FILES_UPLOAD_EN_US, FILES_UPLOAD_ERROR_MESSAGES, FILES_UPLOAD_PT_BR, FILES_UPLOAD_TEXTS, FilesApiClient, FilesApiUploadPortAdapter, PRAXIS_FILES_API_UPLOAD_PORT_OPTIONS, PRAXIS_FILES_UPLOAD_AUTHORING_MANIFEST, PRAXIS_FILES_UPLOAD_COMPONENT_METADATA, PdxFilesUploadFieldComponent, PraxisFilesUpload, PraxisFilesUploadConfigEditor, PraxisFilesUploadWidgetConfigEditor, PresignedUploaderService, ScanStatus, TRANSLATE_LIKE, acceptValidator, createPraxisFilesUploadI18nConfig, getPrimaryErrorItem, isErrorEnvelope, maxBulkSizeValidator, maxFileSizeValidator, maxFilesPerBulkValidator, providePraxisFilesApiUploadPort, providePraxisFilesUploadI18n, providePraxisFilesUploadMetadata, resolvePraxisFilesUploadText };