@aspprev/versi-ds 0.4.2 → 0.4.4

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,6 +1,6 @@
1
1
  // src/components/barcode/barcode.tsx
2
2
  import JsBarcode from "jsbarcode";
3
- import { useEffect, useRef } from "react";
3
+ import { useEffect, useRef, useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  var linhaDigitavelParaCodigoBarras = (linha) => {
6
6
  const d = linha.replace(/\D/g, "");
@@ -14,10 +14,19 @@ var linhaDigitavelParaCodigoBarras = (linha) => {
14
14
  const valor = d.substring(37, 47);
15
15
  return banco + moeda + digitoGeral + vencimento + valor + campo1 + campo2 + campo3;
16
16
  };
17
- function BoletoBarCode({ linhaDigitavel }) {
17
+ function BoletoBarCode({
18
+ linhaDigitavel,
19
+ width = 2,
20
+ height = 80,
21
+ quietZone = 0,
22
+ error,
23
+ onError
24
+ }) {
18
25
  const svgRef = useRef(null);
26
+ const [generationError, setGenerationError] = useState(null);
19
27
  useEffect(() => {
20
28
  if (!svgRef.current) return;
29
+ setGenerationError(null);
21
30
  try {
22
31
  const codigoBarras = linhaDigitavelParaCodigoBarras(linhaDigitavel);
23
32
  JsBarcode(svgRef.current, codigoBarras, {
@@ -25,16 +34,19 @@ function BoletoBarCode({ linhaDigitavel }) {
25
34
  lineColor: "#000000",
26
35
  background: "#FFFFFF",
27
36
  displayValue: false,
28
- width: 2,
29
- height: 80,
30
- margin: 0
37
+ width,
38
+ height,
39
+ margin: quietZone
31
40
  });
32
- } catch (error) {
33
- console.error("Erro ao gerar c\xF3digo de barras:", error);
41
+ } catch (cause) {
42
+ const nextError = cause instanceof Error ? cause : new Error("N\xE3o foi poss\xEDvel gerar o c\xF3digo de barras.");
43
+ setGenerationError(nextError);
44
+ onError?.(nextError);
34
45
  }
35
- }, [linhaDigitavel]);
46
+ }, [height, linhaDigitavel, onError, quietZone, width]);
47
+ const displayError = error ?? generationError?.message;
36
48
  return /* @__PURE__ */ jsxs("div", { className: "w-full space-y-3 bg-surface-card", children: [
37
- /* @__PURE__ */ jsx("svg", { ref: svgRef, className: "w-full" }),
49
+ displayError ? /* @__PURE__ */ jsx("p", { role: "alert", className: "text-sm text-field-assistive-error", children: displayError }) : /* @__PURE__ */ jsx("svg", { ref: svgRef, className: "w-full" }),
38
50
  /* @__PURE__ */ jsx("p", { className: "text-center font-mono text-sm tracking-widest text-content-primary", children: linhaDigitavel })
39
51
  ] });
40
52
  }
@@ -43,14 +55,27 @@ function BoletoBarCode({ linhaDigitavel }) {
43
55
  function acceptsFile(file, accept) {
44
56
  if (!accept?.trim()) return true;
45
57
  return accept.split(",").map((item) => item.trim().toLowerCase()).some((rule) => {
46
- if (rule.endsWith("/*")) return file.type.toLowerCase().startsWith(rule.slice(0, -1));
47
- if (rule.startsWith(".")) return file.name.toLowerCase().endsWith(rule);
58
+ if (rule.endsWith("/*")) {
59
+ return file.type.toLowerCase().startsWith(rule.slice(0, -1));
60
+ }
61
+ if (rule.startsWith(".")) {
62
+ return file.name.toLowerCase().endsWith(rule);
63
+ }
48
64
  return file.type.toLowerCase() === rule;
49
65
  });
50
66
  }
51
- function rejectionMessage(reason) {
67
+ function getExtension(fileName) {
68
+ const extension = fileName.split(".").pop()?.trim().toLowerCase();
69
+ return extension && extension !== fileName.toLowerCase() ? extension : "";
70
+ }
71
+ function rejectionMessage(reason, context, messages) {
72
+ const customMessage = messages?.[reason];
73
+ if (typeof customMessage === "function") return customMessage(context);
74
+ if (typeof customMessage === "string") return customMessage;
52
75
  if (reason === "type") return "Tipo de arquivo n\xE3o permitido.";
53
76
  if (reason === "size") return "O arquivo excede o tamanho m\xE1ximo permitido.";
77
+ if (reason === "empty") return "O arquivo est\xE1 vazio.";
78
+ if (reason === "invalid") return "O arquivo n\xE3o \xE9 v\xE1lido.";
54
79
  return "Quantidade m\xE1xima de arquivos excedida.";
55
80
  }
56
81
  function normalizeMaxFiles(options) {
@@ -71,9 +96,24 @@ function validateFiles(files, options = {}) {
71
96
  const accepted = [];
72
97
  const rejected = [];
73
98
  selected.forEach((file, index) => {
74
- const reason = !acceptsFile(file, options.accept) ? "type" : maxSize !== void 0 && file.size > maxSize ? "size" : index >= maxFiles ? "count" : void 0;
99
+ const isInvalid = !file || typeof file.name !== "string" || !file.name.trim() || typeof file.size !== "number" || !Number.isFinite(file.size) || file.size < 0;
100
+ const reason = isInvalid ? "invalid" : file.size === 0 ? "empty" : !acceptsFile(file, options.accept) ? "type" : maxSize !== void 0 && file.size > maxSize ? "size" : index >= maxFiles ? "count" : void 0;
75
101
  if (reason) {
76
- rejected.push({ file, reason, message: rejectionMessage(reason) });
102
+ const fileName = typeof file?.name === "string" ? file.name : "";
103
+ const size = typeof file?.size === "number" && Number.isFinite(file.size) ? file.size : 0;
104
+ const context = {
105
+ code: reason,
106
+ fileName,
107
+ extension: getExtension(fileName),
108
+ size,
109
+ maxSize
110
+ };
111
+ rejected.push({
112
+ file,
113
+ ...context,
114
+ reason,
115
+ message: rejectionMessage(reason, context, options.messages)
116
+ });
77
117
  } else {
78
118
  accepted.push(file);
79
119
  }
@@ -83,7 +123,7 @@ function validateFiles(files, options = {}) {
83
123
 
84
124
  // src/components/file-upload/FileDropzone.tsx
85
125
  import classNames from "classnames";
86
- import { useId, useRef as useRef2, useState } from "react";
126
+ import { useId, useRef as useRef2, useState as useState2 } from "react";
87
127
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
88
128
  function FileDropzone({
89
129
  accept,
@@ -97,6 +137,8 @@ function FileDropzone({
97
137
  label = "Selecionar arquivos",
98
138
  hint = "Arraste e solte os arquivos aqui ou use o teclado para selecionar.",
99
139
  error,
140
+ messages,
141
+ actions,
100
142
  className,
101
143
  onFilesAccepted,
102
144
  onFilesRejected
@@ -105,15 +147,16 @@ function FileDropzone({
105
147
  const inputId = id ?? generatedInputId;
106
148
  const messageId = `${inputId}-message`;
107
149
  const inputRef = useRef2(null);
108
- const [isDragging, setIsDragging] = useState(false);
109
- const [rejectionMessage2, setRejectionMessage] = useState();
150
+ const [isDragging, setIsDragging] = useState2(false);
151
+ const [rejectionMessage2, setRejectionMessage] = useState2();
110
152
  const processFiles = (fileList) => {
111
153
  if (disabled) return;
112
154
  const { accepted, rejected } = validateFiles(fileList, {
113
155
  accept,
114
156
  maxFiles,
115
157
  maxSize,
116
- multiple
158
+ multiple,
159
+ messages
117
160
  });
118
161
  setRejectionMessage(rejected.length ? rejected.map((item) => item.message).join(" ") : void 0);
119
162
  if (accepted.length) onFilesAccepted?.(accepted);
@@ -170,7 +213,8 @@ function FileDropzone({
170
213
  }
171
214
  )
172
215
  ] }),
173
- message && /* @__PURE__ */ jsx2("span", { id: messageId, role: hasError ? "alert" : void 0, className: classNames("mt-1 text-sm", hasError ? "text-field-assistive-error" : "text-content-secondary"), children: message })
216
+ message && /* @__PURE__ */ jsx2("span", { id: messageId, role: hasError ? "alert" : void 0, className: classNames("mt-1 text-sm", hasError ? "text-field-assistive-error" : "text-content-secondary"), children: message }),
217
+ actions && /* @__PURE__ */ jsx2("div", { className: "mt-3 flex flex-wrap justify-center gap-2", children: actions })
174
218
  ]
175
219
  }
176
220
  );
@@ -233,7 +277,7 @@ var statusDescription = (status) => {
233
277
  if (status === "error") return "Erro no envio";
234
278
  return "Aguardando envio";
235
279
  };
236
- function FileList({ files, accessibleName = "Arquivos selecionados", onRemove, onRetry, className }) {
280
+ function FileList({ files, accessibleName = "Arquivos selecionados", onRemove, onRetry, actions, className }) {
237
281
  return /* @__PURE__ */ jsx4("ul", { "aria-label": accessibleName, className: classNames3("w-full space-y-2", className), children: files.map((item, index) => {
238
282
  const status = item.status ?? "pending";
239
283
  const progressStatus = status === "pending" ? "idle" : status;
@@ -252,6 +296,7 @@ function FileList({ files, accessibleName = "Arquivos selecionados", onRemove, o
252
296
  item.error && /* @__PURE__ */ jsx4("p", { role: "alert", className: "mt-1 text-sm text-field-assistive-error", children: item.error })
253
297
  ] }),
254
298
  /* @__PURE__ */ jsxs4("div", { className: "flex shrink-0 items-center gap-1", children: [
299
+ actions?.(item, index),
255
300
  status === "error" && onRetry && /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => onRetry(item, index), "aria-label": `Tentar novamente ${item.file.name}`, className: "flex h-11 w-11 items-center justify-center rounded-sm text-content-secondary hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus-ring", children: /* @__PURE__ */ jsx4(MdRefresh, { "aria-hidden": "true", className: "h-5 w-5" }) }),
256
301
  onRemove && /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => onRemove(item, index), "aria-label": `Remover ${item.file.name}`, className: "flex h-11 w-11 items-center justify-center rounded-sm text-content-secondary hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus-ring", children: /* @__PURE__ */ jsx4(MdClose, { "aria-hidden": "true", className: "h-5 w-5" }) })
257
302
  ] })
@@ -262,7 +307,7 @@ var FileList_default = FileList;
262
307
 
263
308
  // src/components/file-upload/FileViewer.tsx
264
309
  import classNames4 from "classnames";
265
- import { useEffect as useEffect2, useRef as useRef3, useState as useState2 } from "react";
310
+ import { useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
266
311
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
267
312
  var extensionType = (fileName) => {
268
313
  const extension = fileName?.split(".").pop()?.toLowerCase();
@@ -284,18 +329,49 @@ function FileViewer({
284
329
  onLoad,
285
330
  onError,
286
331
  onDownload,
332
+ actions,
287
333
  fallback,
288
334
  title = fileName ?? "Visualiza\xE7\xE3o do arquivo",
289
335
  className
290
336
  }) {
291
- const [objectUrl, setObjectUrl] = useState2();
292
- const [textContent, setTextContent] = useState2();
293
- const [readError, setReadError] = useState2(null);
337
+ const [objectUrl, setObjectUrl] = useState3();
338
+ const [textContent, setTextContent] = useState3();
339
+ const [readError, setReadError] = useState3(null);
340
+ const [asyncSource, setAsyncSource] = useState3();
341
+ const [sourceLoading, setSourceLoading] = useState3(false);
294
342
  const onLoadRef = useRef3(onLoad);
295
343
  const onErrorRef = useRef3(onError);
296
- const resolved = typeof source === "object" && source !== null && !(source instanceof Blob) ? source : void 0;
297
- const blob = source instanceof Blob ? source : resolved?.blob;
298
- const url = typeof source === "string" ? source : resolved?.url;
344
+ const isAsyncSource = Boolean(
345
+ source && typeof source === "object" && "then" in source && typeof source.then === "function"
346
+ );
347
+ useEffect2(() => {
348
+ if (!isAsyncSource) {
349
+ setAsyncSource(void 0);
350
+ setSourceLoading(false);
351
+ return;
352
+ }
353
+ let active = true;
354
+ setSourceLoading(true);
355
+ setReadError(null);
356
+ Promise.resolve(source).then((nextSource) => {
357
+ if (!active) return;
358
+ setAsyncSource(nextSource ?? void 0);
359
+ setSourceLoading(false);
360
+ }).catch((cause) => {
361
+ if (!active) return;
362
+ const nextError = toError(cause);
363
+ setReadError(nextError);
364
+ setSourceLoading(false);
365
+ onErrorRef.current?.(nextError);
366
+ });
367
+ return () => {
368
+ active = false;
369
+ };
370
+ }, [isAsyncSource, source]);
371
+ const resolvedSource = isAsyncSource ? asyncSource : source;
372
+ const resolved = typeof resolvedSource === "object" && resolvedSource !== null && !(resolvedSource instanceof Blob) ? resolvedSource : void 0;
373
+ const blob = resolvedSource instanceof Blob ? resolvedSource : resolved?.blob;
374
+ const url = typeof resolvedSource === "string" ? resolvedSource : resolved?.url;
299
375
  const resolvedName = fileName ?? resolved?.fileName;
300
376
  const rawType = contentType?.trim() || resolved?.contentType || blob?.type || extensionType(resolvedName);
301
377
  const resolvedType = normalizeContentType(rawType);
@@ -352,7 +428,7 @@ function FileViewer({
352
428
  onErrorRef.current?.(nextError);
353
429
  };
354
430
  const handleLoad = () => onLoadRef.current?.();
355
- if (loading) {
431
+ if (loading || sourceLoading) {
356
432
  return /* @__PURE__ */ jsx5(
357
433
  "div",
358
434
  {
@@ -391,7 +467,10 @@ function FileViewer({
391
467
  resolvedType === "application/pdf" && displayUrl && /* @__PURE__ */ jsx5("iframe", { src: displayUrl, title, onLoad: handleLoad, onError: handleMediaError, sandbox: "", className: "min-h-[32rem] w-full border-0" }),
392
468
  isText && (textContent !== void 0 ? /* @__PURE__ */ jsx5("pre", { className: "max-h-[70vh] overflow-auto whitespace-pre-wrap break-words text-sm text-content-primary", children: textContent }) : displayUrl && /* @__PURE__ */ jsx5("iframe", { src: displayUrl, title, onLoad: handleLoad, onError: handleMediaError, sandbox: "", className: "min-h-64 w-full border-0" })),
393
469
  !resolvedType.startsWith("image/") && resolvedType !== "application/pdf" && !isText && (fallback ?? /* @__PURE__ */ jsx5("p", { className: "text-content-secondary", children: "Este tipo de arquivo n\xE3o possui visualiza\xE7\xE3o dispon\xEDvel." })),
394
- download && /* @__PURE__ */ jsx5("div", { className: "flex justify-end", children: download })
470
+ (download || actions) && /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap justify-end gap-2", children: [
471
+ actions,
472
+ download
473
+ ] })
395
474
  ]
396
475
  }
397
476
  );
@@ -400,7 +479,7 @@ var FileViewer_default = FileViewer;
400
479
 
401
480
  // src/components/qr-code/QRCode.tsx
402
481
  import QRCodeGenerator from "qrcode";
403
- import { useEffect as useEffect3, useId as useId2, useMemo, useRef as useRef4, useState as useState3 } from "react";
482
+ import { useEffect as useEffect3, useId as useId2, useMemo, useRef as useRef4, useState as useState4 } from "react";
404
483
  import classNames5 from "classnames";
405
484
  import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
406
485
  function getRelativeLuminance(color) {
@@ -436,8 +515,8 @@ function QRCode({
436
515
  className,
437
516
  ...rest
438
517
  }) {
439
- const [dataUrl, setDataUrl] = useState3(null);
440
- const [generationError, setGenerationError] = useState3(null);
518
+ const [dataUrl, setDataUrl] = useState4(null);
519
+ const [generationError, setGenerationError] = useState4(null);
441
520
  const onErrorRef = useRef4(onError);
442
521
  const generatedId = useId2();
443
522
  const resolvedSize = Math.max(1, Number.isFinite(size) ? Math.floor(size) : 192);
@@ -516,4 +595,4 @@ export {
516
595
  FileViewer_default,
517
596
  QRCode_default
518
597
  };
519
- //# sourceMappingURL=chunk-YIUITJ4V.js.map
598
+ //# sourceMappingURL=chunk-CVTBM4I6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/barcode/barcode.tsx","../src/components/file-upload/validation.ts","../src/components/file-upload/FileDropzone.tsx","../src/components/file-upload/FileUploadProgress.tsx","../src/components/file-upload/FileList.tsx","../src/components/file-upload/FileViewer.tsx","../src/components/qr-code/QRCode.tsx"],"sourcesContent":["\"use client\";\n\nimport JsBarcode from \"jsbarcode\";\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\n\nconst linhaDigitavelParaCodigoBarras = (linha: string): string => {\n const d = linha.replace(/\\D/g, \"\");\n\n const banco = d.substring(0, 3);\n const moeda = d.substring(3, 4);\n const campo1 = d.substring(4, 9);\n const campo2 = d.substring(10, 20);\n const campo3 = d.substring(21, 31);\n const digitoGeral = d.substring(32, 33);\n const vencimento = d.substring(33, 37);\n const valor = d.substring(37, 47);\n\n return banco + moeda + digitoGeral + vencimento + valor + campo1 + campo2 + campo3;\n};\n\nexport interface BoletoBarCodeProps {\n linhaDigitavel: string;\n /** Bar width passed to JsBarcode. */\n width?: number;\n /** Bar height in pixels. */\n height?: number;\n /** Quiet zone/margin in pixels. */\n quietZone?: number;\n error?: ReactNode;\n onError?: (error: Error) => void;\n}\n\nexport function BoletoBarCode({\n linhaDigitavel,\n width = 2,\n height = 80,\n quietZone = 0,\n error,\n onError,\n}: BoletoBarCodeProps) {\n const svgRef = useRef<SVGSVGElement>(null);\n const [generationError, setGenerationError] = useState<Error | null>(null);\n\n useEffect(() => {\n if (!svgRef.current) return;\n setGenerationError(null);\n\n try {\n const codigoBarras = linhaDigitavelParaCodigoBarras(linhaDigitavel);\n\n JsBarcode(svgRef.current, codigoBarras, {\n format: \"ITF\",\n lineColor: \"#000000\",\n background: \"#FFFFFF\",\n displayValue: false,\n width,\n height,\n margin: quietZone,\n });\n } catch (cause: unknown) {\n const nextError = cause instanceof Error\n ? cause\n : new Error(\"Não foi possível gerar o código de barras.\");\n setGenerationError(nextError);\n onError?.(nextError);\n }\n }, [height, linhaDigitavel, onError, quietZone, width]);\n\n const displayError = error ?? generationError?.message;\n\n return (\n <div className=\"w-full space-y-3 bg-surface-card\">\n {displayError ? (\n <p role=\"alert\" className=\"text-sm text-field-assistive-error\">\n {displayError}\n </p>\n ) : (\n <svg ref={svgRef} className=\"w-full\" />\n )}\n <p className=\"text-center font-mono text-sm tracking-widest text-content-primary\">\n {linhaDigitavel}\n </p>\n </div>\n );\n}\n","export type FileValidationReason =\n | \"type\"\n | \"size\"\n | \"count\"\n | \"empty\"\n | \"invalid\";\n\nexport interface FileRejectionContext {\n code: FileValidationReason;\n fileName: string;\n extension: string;\n size: number;\n maxSize?: number;\n}\n\nexport type FileValidationMessage =\n | string\n | ((context: FileRejectionContext) => string);\n\nexport interface FileRejection {\n file: File;\n code: FileValidationReason;\n reason: FileValidationReason;\n fileName: string;\n extension: string;\n size: number;\n maxSize?: number;\n message: string;\n}\n\nexport interface FileValidationOptions {\n accept?: string;\n multiple?: boolean;\n maxFiles?: number;\n maxSize?: number;\n messages?: Partial<Record<FileValidationReason, FileValidationMessage>>;\n}\n\nexport interface FileValidationResult {\n accepted: File[];\n rejected: FileRejection[];\n}\n\nfunction acceptsFile(file: File, accept?: string) {\n if (!accept?.trim()) return true;\n\n return accept\n .split(\",\")\n .map((item) => item.trim().toLowerCase())\n .some((rule) => {\n if (rule.endsWith(\"/*\")) {\n return file.type.toLowerCase().startsWith(rule.slice(0, -1));\n }\n if (rule.startsWith(\".\")) {\n return file.name.toLowerCase().endsWith(rule);\n }\n return file.type.toLowerCase() === rule;\n });\n}\n\nfunction getExtension(fileName: string) {\n const extension = fileName.split(\".\").pop()?.trim().toLowerCase();\n return extension && extension !== fileName.toLowerCase() ? extension : \"\";\n}\n\nfunction rejectionMessage(\n reason: FileValidationReason,\n context: FileRejectionContext,\n messages?: FileValidationOptions[\"messages\"],\n) {\n const customMessage = messages?.[reason];\n if (typeof customMessage === \"function\") return customMessage(context);\n if (typeof customMessage === \"string\") return customMessage;\n if (reason === \"type\") return \"Tipo de arquivo não permitido.\";\n if (reason === \"size\") return \"O arquivo excede o tamanho máximo permitido.\";\n if (reason === \"empty\") return \"O arquivo está vazio.\";\n if (reason === \"invalid\") return \"O arquivo não é válido.\";\n return \"Quantidade máxima de arquivos excedida.\";\n}\n\nfunction normalizeMaxFiles(options: FileValidationOptions) {\n if (options.multiple === false) return 1;\n if (options.maxFiles === undefined || !Number.isFinite(options.maxFiles)) {\n return Number.POSITIVE_INFINITY;\n }\n return Math.max(1, Math.floor(options.maxFiles));\n}\n\nfunction normalizeMaxSize(maxSize?: number) {\n if (maxSize === undefined || !Number.isFinite(maxSize)) return undefined;\n return Math.max(0, maxSize);\n}\n\nexport function validateFiles(\n files: readonly File[] | FileList,\n options: FileValidationOptions = {},\n): FileValidationResult {\n const selected = Array.from(files);\n const maxFiles = normalizeMaxFiles(options);\n const maxSize = normalizeMaxSize(options.maxSize);\n const accepted: File[] = [];\n const rejected: FileRejection[] = [];\n\n selected.forEach((file, index) => {\n const isInvalid =\n !file ||\n typeof file.name !== \"string\" ||\n !file.name.trim() ||\n typeof file.size !== \"number\" ||\n !Number.isFinite(file.size) ||\n file.size < 0;\n const reason: FileValidationReason | undefined = isInvalid\n ? \"invalid\"\n : file.size === 0\n ? \"empty\"\n : !acceptsFile(file, options.accept)\n ? \"type\"\n : maxSize !== undefined && file.size > maxSize\n ? \"size\"\n : index >= maxFiles\n ? \"count\"\n : undefined;\n\n if (reason) {\n const fileName = typeof file?.name === \"string\" ? file.name : \"\";\n const size = typeof file?.size === \"number\" && Number.isFinite(file.size)\n ? file.size\n : 0;\n const context: FileRejectionContext = {\n code: reason,\n fileName,\n extension: getExtension(fileName),\n size,\n maxSize,\n };\n rejected.push({\n file,\n ...context,\n reason,\n message: rejectionMessage(reason, context, options.messages),\n });\n } else {\n accepted.push(file);\n }\n });\n\n return { accepted, rejected };\n}\n","\"use client\";\n\nimport classNames from \"classnames\";\nimport { useId, useRef, useState, type ChangeEvent, type DragEvent, type ReactNode } from \"react\";\nimport { validateFiles, type FileRejection, type FileValidationMessage } from \"./validation\";\n\nexport type { FileRejection } from \"./validation\";\n\nexport interface FileDropzoneProps {\n accept?: string;\n multiple?: boolean;\n maxFiles?: number;\n maxSize?: number;\n disabled?: boolean;\n id?: string;\n name?: string;\n required?: boolean;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n messages?: Partial<Record<\"type\" | \"size\" | \"count\" | \"empty\" | \"invalid\", FileValidationMessage>>;\n actions?: ReactNode;\n className?: string;\n onFilesAccepted?: (files: File[]) => void;\n onFilesRejected?: (rejections: FileRejection[]) => void;\n}\n\nexport function FileDropzone({\n accept,\n multiple = false,\n maxFiles = multiple ? Number.POSITIVE_INFINITY : 1,\n maxSize,\n disabled = false,\n id,\n name,\n required = false,\n label = \"Selecionar arquivos\",\n hint = \"Arraste e solte os arquivos aqui ou use o teclado para selecionar.\",\n error,\n messages,\n actions,\n className,\n onFilesAccepted,\n onFilesRejected,\n}: FileDropzoneProps) {\n const generatedInputId = useId();\n const inputId = id ?? generatedInputId;\n const messageId = `${inputId}-message`;\n const inputRef = useRef<HTMLInputElement>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [rejectionMessage, setRejectionMessage] = useState<string>();\n\n const processFiles = (fileList: FileList | File[]) => {\n if (disabled) return;\n const { accepted, rejected } = validateFiles(fileList, {\n accept,\n maxFiles,\n maxSize,\n multiple,\n messages,\n });\n setRejectionMessage(rejected.length ? rejected.map((item) => item.message).join(\" \") : undefined);\n if (accepted.length) onFilesAccepted?.(accepted);\n if (rejected.length) onFilesRejected?.(rejected);\n };\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (event.target.files) processFiles(event.target.files);\n event.target.value = \"\";\n };\n const handleDrop = (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n setIsDragging(false);\n processFiles(event.dataTransfer.files);\n };\n const hasError = Boolean(error || rejectionMessage);\n const message = error || rejectionMessage || hint;\n\n return (\n <div\n onDragEnter={(event) => { event.preventDefault(); if (!disabled) setIsDragging(true); }}\n onDragOver={(event) => event.preventDefault()}\n onDragLeave={(event) => { if (event.currentTarget === event.target) setIsDragging(false); }}\n onDrop={handleDrop}\n className={classNames(\n \"flex min-h-32 w-full cursor-pointer flex-col items-center justify-center rounded-sm border-2 border-dashed p-6 text-center transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\",\n isDragging ? \"border-action-primary bg-primary-1/10\" : \"border-border-default bg-surface-card hover:border-border-strong\",\n disabled && \"cursor-not-allowed opacity-60\",\n hasError && \"border-field-border-error\",\n className,\n )}\n >\n <label htmlFor={inputId} className=\"flex cursor-pointer flex-col items-center focus-within:outline focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-focus-ring\">\n <span className=\"font-semibold text-content-primary\">{label}</span>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n name={name}\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n required={required}\n onChange={handleInputChange}\n aria-describedby={message ? messageId : undefined}\n aria-invalid={hasError ? true : undefined}\n className=\"sr-only\"\n />\n </label>\n {message && <span id={messageId} role={hasError ? \"alert\" : undefined} className={classNames(\"mt-1 text-sm\", hasError ? \"text-field-assistive-error\" : \"text-content-secondary\")}>{message}</span>}\n {actions && <div className=\"mt-3 flex flex-wrap justify-center gap-2\">{actions}</div>}\n </div>\n );\n}\n\nexport default FileDropzone;\n","\"use client\";\n\nimport classNames from \"classnames\";\n\nexport type FileUploadProgressStatus = \"idle\" | \"uploading\" | \"success\" | \"error\";\n\nexport interface FileUploadProgressProps {\n value?: number | null;\n label?: string;\n status?: FileUploadProgressStatus;\n showValue?: boolean;\n className?: string;\n}\n\nexport function FileUploadProgress({\n value,\n label = \"Progresso do upload\",\n status = \"uploading\",\n showValue = true,\n className,\n}: FileUploadProgressProps) {\n const resolvedValue = typeof value === \"number\"\n ? Math.min(100, Math.max(0, value))\n : undefined;\n const statusText = status === \"success\"\n ? \"Concluído\"\n : status === \"error\"\n ? \"Erro\"\n : resolvedValue === undefined\n ? \"Em andamento\"\n : `${Math.round(resolvedValue)}%`;\n\n return (\n <div className={classNames(\"w-full\", className)}>\n <div className=\"mb-1 flex items-center justify-between gap-2 text-xs text-content-secondary\">\n <span>{label}</span>\n {showValue && <span aria-hidden=\"true\">{statusText}</span>}\n </div>\n <div\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={resolvedValue === undefined ? undefined : 0}\n aria-valuemax={resolvedValue === undefined ? undefined : 100}\n aria-valuenow={resolvedValue}\n aria-valuetext={statusText}\n className=\"h-2 w-full overflow-hidden rounded-full bg-surface-muted\"\n >\n <div\n className={classNames(\n \"h-full rounded-full transition-[width] duration-200\",\n status === \"error\" ? \"bg-feedback-danger-strong\" : \"bg-action-primary\",\n resolvedValue === undefined ? \"w-1/2 animate-pulse\" : undefined,\n )}\n style={resolvedValue === undefined ? undefined : { width: `${resolvedValue}%` }}\n />\n </div>\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">{statusText}</span>\n </div>\n );\n}\n\nexport default FileUploadProgress;\n","\"use client\";\n\nimport classNames from \"classnames\";\nimport { MdClose, MdRefresh } from \"react-icons/md\";\nimport type { ReactNode } from \"react\";\nimport FileUploadProgress, { type FileUploadProgressStatus } from \"./FileUploadProgress\";\n\nexport type FileUploadItemStatus = FileUploadProgressStatus | \"pending\";\n\nexport interface FileUploadItem {\n id?: string;\n file: File;\n progress?: number | null;\n status?: FileUploadItemStatus;\n error?: string;\n}\n\nexport interface FileListProps {\n files: FileUploadItem[];\n accessibleName?: string;\n onRemove?: (item: FileUploadItem, index: number) => void;\n onRetry?: (item: FileUploadItem, index: number) => void;\n actions?: (item: FileUploadItem, index: number) => ReactNode;\n className?: string;\n}\n\nconst fileId = (item: FileUploadItem, index: number) => item.id ?? `${item.file.name}-${item.file.size}-${item.file.lastModified}-${index}`;\n\nconst statusDescription = (status: FileUploadItemStatus) => {\n if (status === \"uploading\") return \"Enviando\";\n if (status === \"success\") return \"Enviado\";\n if (status === \"error\") return \"Erro no envio\";\n return \"Aguardando envio\";\n};\n\nexport function FileList({ files, accessibleName = \"Arquivos selecionados\", onRemove, onRetry, actions, className }: FileListProps) {\n return (\n <ul aria-label={accessibleName} className={classNames(\"w-full space-y-2\", className)}>\n {files.map((item, index) => {\n const status = item.status ?? \"pending\";\n const progressStatus: FileUploadProgressStatus = status === \"pending\" ? \"idle\" : status;\n return (\n <li key={fileId(item, index)} aria-busy={status === \"uploading\" || undefined} className=\"flex min-w-0 flex-wrap items-center gap-3 rounded-sm border border-border-default bg-surface-card p-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate font-semibold text-content-primary\" title={item.file.name}>{item.file.name}</p>\n <p className=\"text-xs text-content-secondary\">{Math.ceil(item.file.size / 1024)} KB</p>\n <span className=\"sr-only\">Status: {statusDescription(status)}</span>\n {(status === \"uploading\" || status === \"success\" || status === \"error\") && (\n <FileUploadProgress value={item.progress} status={progressStatus} label={`Progresso de ${item.file.name}`} />\n )}\n {item.error && <p role=\"alert\" className=\"mt-1 text-sm text-field-assistive-error\">{item.error}</p>}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {actions?.(item, index)}\n {status === \"error\" && onRetry && <button type=\"button\" onClick={() => onRetry(item, index)} aria-label={`Tentar novamente ${item.file.name}`} className=\"flex h-11 w-11 items-center justify-center rounded-sm text-content-secondary hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus-ring\"><MdRefresh aria-hidden=\"true\" className=\"h-5 w-5\" /></button>}\n {onRemove && <button type=\"button\" onClick={() => onRemove(item, index)} aria-label={`Remover ${item.file.name}`} className=\"flex h-11 w-11 items-center justify-center rounded-sm text-content-secondary hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus-ring\"><MdClose aria-hidden=\"true\" className=\"h-5 w-5\" /></button>}\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport default FileList;\n","\"use client\";\n\nimport classNames from \"classnames\";\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\n\nexport type FileViewerSource = string | Blob | {\n url?: string;\n blob?: Blob;\n contentType?: string;\n fileName?: string;\n};\n\nexport type FileViewerSourceInput =\n | FileViewerSource\n | Promise<FileViewerSource | null | undefined>;\n\nexport interface FileViewerProps {\n source?: FileViewerSourceInput;\n fileName?: string;\n contentType?: string;\n loading?: boolean;\n error?: ReactNode;\n onLoad?: () => void;\n onError?: (error: Error) => void;\n onDownload?: () => void;\n /** Consumer-owned actions such as retry, share or remove. */\n actions?: ReactNode;\n fallback?: ReactNode;\n title?: string;\n className?: string;\n}\n\nconst extensionType = (fileName?: string) => {\n const extension = fileName?.split(\".\").pop()?.toLowerCase();\n if (extension === \"pdf\") return \"application/pdf\";\n if ([\"png\", \"jpg\", \"jpeg\", \"gif\", \"webp\", \"svg\"].includes(extension ?? \"\")) {\n return `image/${extension === \"jpg\" ? \"jpeg\" : extension}`;\n }\n if ([\"txt\", \"csv\", \"json\", \"xml\", \"md\"].includes(extension ?? \"\")) return \"text/plain\";\n return \"application/octet-stream\";\n};\n\nconst normalizeContentType = (contentType: string) => contentType.split(\";\", 1)[0].trim().toLowerCase();\n\nconst toError = (cause: unknown) => (\n cause instanceof Error ? cause : new Error(\"Não foi possível ler o arquivo.\")\n);\n\nexport function FileViewer({\n source,\n fileName,\n contentType,\n loading = false,\n error,\n onLoad,\n onError,\n onDownload,\n actions,\n fallback,\n title = fileName ?? \"Visualização do arquivo\",\n className,\n}: FileViewerProps) {\n const [objectUrl, setObjectUrl] = useState<string>();\n const [textContent, setTextContent] = useState<string>();\n const [readError, setReadError] = useState<Error | null>(null);\n const [asyncSource, setAsyncSource] = useState<FileViewerSource>();\n const [sourceLoading, setSourceLoading] = useState(false);\n const onLoadRef = useRef(onLoad);\n const onErrorRef = useRef(onError);\n const isAsyncSource = Boolean(\n source &&\n typeof source === \"object\" &&\n \"then\" in source &&\n typeof source.then === \"function\",\n );\n\n useEffect(() => {\n if (!isAsyncSource) {\n setAsyncSource(undefined);\n setSourceLoading(false);\n return;\n }\n\n let active = true;\n setSourceLoading(true);\n setReadError(null);\n\n Promise.resolve(source as Promise<FileViewerSource | null | undefined>)\n .then((nextSource) => {\n if (!active) return;\n setAsyncSource(nextSource ?? undefined);\n setSourceLoading(false);\n })\n .catch((cause: unknown) => {\n if (!active) return;\n const nextError = toError(cause);\n setReadError(nextError);\n setSourceLoading(false);\n onErrorRef.current?.(nextError);\n });\n\n return () => {\n active = false;\n };\n }, [isAsyncSource, source]);\n\n const resolvedSource: FileViewerSource | undefined = isAsyncSource\n ? asyncSource\n : (source as FileViewerSource | undefined);\n const resolved = typeof resolvedSource === \"object\" && resolvedSource !== null && !(resolvedSource instanceof Blob) ? resolvedSource : undefined;\n const blob = resolvedSource instanceof Blob ? resolvedSource : resolved?.blob;\n const url = typeof resolvedSource === \"string\" ? resolvedSource : resolved?.url;\n const resolvedName = fileName ?? resolved?.fileName;\n const rawType = contentType?.trim() || resolved?.contentType || blob?.type || extensionType(resolvedName);\n const resolvedType = normalizeContentType(rawType);\n const isText = resolvedType.startsWith(\"text/\") || resolvedType === \"application/json\";\n const displayError = error ?? readError?.message;\n\n useEffect(() => {\n onLoadRef.current = onLoad;\n }, [onLoad]);\n\n useEffect(() => {\n onErrorRef.current = onError;\n }, [onError]);\n\n useEffect(() => {\n let active = true;\n setReadError(null);\n setTextContent(undefined);\n\n if (!blob) {\n setObjectUrl(undefined);\n return () => { active = false; };\n }\n\n let nextUrl: string;\n try {\n nextUrl = URL.createObjectURL(blob);\n setObjectUrl(nextUrl);\n } catch (cause) {\n const nextError = toError(cause);\n setReadError(nextError);\n onErrorRef.current?.(nextError);\n return () => { active = false; };\n }\n\n if (isText) {\n blob.text()\n .then((text: string) => {\n if (!active) return;\n setTextContent(text);\n onLoadRef.current?.();\n })\n .catch((cause: unknown) => {\n if (!active) return;\n const nextError = toError(cause);\n setReadError(nextError);\n onErrorRef.current?.(nextError);\n });\n }\n\n return () => {\n active = false;\n URL.revokeObjectURL(nextUrl);\n };\n }, [blob, isText]);\n\n const handleMediaError = () => {\n const nextError = new Error(\"Não foi possível carregar a visualização do arquivo.\");\n setReadError(nextError);\n onErrorRef.current?.(nextError);\n };\n const handleLoad = () => onLoadRef.current?.();\n\n if (loading || sourceLoading) {\n return (\n <div\n className={classNames(\"flex min-h-32 items-center justify-center rounded-sm border border-border-default bg-surface-card p-6 text-content-secondary\", className)}\n role=\"status\"\n aria-busy=\"true\"\n aria-live=\"polite\"\n >\n Carregando arquivo…\n </div>\n );\n }\n\n if (displayError) {\n return (\n <div className={classNames(\"rounded-sm border border-field-border-error bg-surface-card p-4 text-field-assistive-error\", className)} role=\"alert\">\n {displayError}\n </div>\n );\n }\n\n const displayUrl = objectUrl ?? url;\n if (!displayUrl && !textContent) {\n return (\n <div\n className={classNames(\"rounded-sm border border-border-default bg-surface-card p-4 text-content-secondary\", className)}\n role=\"region\"\n aria-label={title}\n >\n {fallback ?? \"Arquivo indisponível.\"}\n </div>\n );\n }\n\n const download = onDownload\n ? <button type=\"button\" onClick={onDownload} className=\"min-h-11 rounded-sm border border-border-default px-3 text-sm font-semibold text-content-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\">Baixar arquivo</button>\n : displayUrl\n ? <a href={displayUrl} download={resolvedName} className=\"inline-flex min-h-11 items-center rounded-sm border border-border-default px-3 text-sm font-semibold text-content-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\">Baixar arquivo</a>\n : null;\n\n return (\n <div\n className={classNames(\"flex min-w-0 flex-col gap-3 rounded-sm border border-border-default bg-surface-card p-3\", className)}\n role=\"region\"\n aria-label={title}\n >\n {resolvedType.startsWith(\"image/\") && displayUrl && (\n <img src={displayUrl} alt={title} onLoad={handleLoad} onError={handleMediaError} className=\"max-h-[70vh] max-w-full object-contain\" />\n )}\n {resolvedType === \"application/pdf\" && displayUrl && (\n <iframe src={displayUrl} title={title} onLoad={handleLoad} onError={handleMediaError} sandbox=\"\" className=\"min-h-[32rem] w-full border-0\" />\n )}\n {isText && (textContent !== undefined\n ? <pre className=\"max-h-[70vh] overflow-auto whitespace-pre-wrap break-words text-sm text-content-primary\">{textContent}</pre>\n : displayUrl && <iframe src={displayUrl} title={title} onLoad={handleLoad} onError={handleMediaError} sandbox=\"\" className=\"min-h-64 w-full border-0\" />)}\n {!resolvedType.startsWith(\"image/\") && resolvedType !== \"application/pdf\" && !isText && (\n fallback ?? <p className=\"text-content-secondary\">Este tipo de arquivo não possui visualização disponível.</p>\n )}\n {(download || actions) && (\n <div className=\"flex flex-wrap justify-end gap-2\">\n {actions}\n {download}\n </div>\n )}\n </div>\n );\n}\n\nexport default FileViewer;\n","\"use client\";\n\nimport QRCodeGenerator from \"qrcode\";\nimport { useEffect, useId, useMemo, useRef, useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport classNames from \"classnames\";\n\nexport type QRCodeErrorCorrectionLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QRCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, \"color\" | \"onError\"> {\n value: string;\n size?: number;\n level?: QRCodeErrorCorrectionLevel;\n includeMargin?: boolean;\n fgColor?: string;\n bgColor?: string;\n ariaLabel?: string;\n description?: string;\n loading?: boolean;\n error?: ReactNode;\n onError?: (error: Error) => void;\n}\n\nfunction getRelativeLuminance(color: string) {\n const match = color.trim().match(/^#([\\da-f]{6})$/i);\n if (!match) return null;\n\n const channels = [0, 2, 4].map((offset) => Number.parseInt(match[1].slice(offset, offset + 2), 16) / 255);\n const linear = channels.map((channel) => (\n channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4\n ));\n\n return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2];\n}\n\nfunction resolveAccessibleColors(fgColor: string, bgColor: string) {\n const foregroundLuminance = getRelativeLuminance(fgColor);\n const backgroundLuminance = getRelativeLuminance(bgColor);\n\n if (foregroundLuminance === null || backgroundLuminance === null) {\n return { dark: fgColor, light: bgColor };\n }\n\n const lighter = Math.max(foregroundLuminance, backgroundLuminance);\n const darker = Math.min(foregroundLuminance, backgroundLuminance);\n const contrastRatio = (lighter + 0.05) / (darker + 0.05);\n\n return contrastRatio >= 3\n ? { dark: fgColor, light: bgColor }\n : { dark: \"#000000\", light: \"#FFFFFF\" };\n}\n\nexport function QRCode({\n value,\n size = 192,\n level = \"M\",\n includeMargin = true,\n fgColor = \"#000000\",\n bgColor = \"#FFFFFF\",\n ariaLabel = \"Código QR\",\n description,\n loading = false,\n error,\n onError,\n className,\n ...rest\n}: QRCodeProps) {\n const [dataUrl, setDataUrl] = useState<string | null>(null);\n const [generationError, setGenerationError] = useState<Error | null>(null);\n const onErrorRef = useRef(onError);\n const generatedId = useId();\n const resolvedSize = Math.max(1, Number.isFinite(size) ? Math.floor(size) : 192);\n const descriptionId = description\n ? `${rest.id ?? generatedId}-description`\n : undefined;\n const colors = useMemo(\n () => resolveAccessibleColors(fgColor, bgColor),\n [bgColor, fgColor],\n );\n const describedBy = [rest[\"aria-describedby\"], descriptionId].filter(Boolean).join(\" \") || undefined;\n const displayError = error ?? generationError?.message;\n const isLoading = loading || (!dataUrl && !displayError);\n\n useEffect(() => {\n onErrorRef.current = onError;\n }, [onError]);\n\n useEffect(() => {\n let active = true;\n if (error) {\n setDataUrl(null);\n setGenerationError(null);\n return () => { active = false; };\n }\n setDataUrl(null);\n setGenerationError(null);\n QRCodeGenerator.toDataURL(value, {\n width: resolvedSize,\n margin: includeMargin ? 4 : 0,\n errorCorrectionLevel: level,\n color: colors,\n })\n .then((url) => { if (active) setDataUrl(url); })\n .catch((cause: unknown) => {\n if (!active) return;\n const nextError = cause instanceof Error\n ? cause\n : new Error(\"Não foi possível gerar o código QR.\");\n setDataUrl(null);\n setGenerationError(nextError);\n onErrorRef.current?.(nextError);\n });\n return () => { active = false; };\n }, [colors, error, includeMargin, level, resolvedSize, value]);\n\n return (\n <div\n {...rest}\n role=\"img\"\n aria-label={ariaLabel}\n aria-describedby={describedBy}\n aria-busy={isLoading || undefined}\n aria-invalid={displayError ? true : undefined}\n className={classNames(\"inline-flex max-w-full flex-col items-center gap-2\", className)}\n >\n {displayError ? (\n <span role=\"alert\" className=\"rounded-sm border border-field-border-error p-3 text-sm text-field-assistive-error\">\n {displayError}\n </span>\n ) : dataUrl ? (\n <img src={dataUrl} alt=\"\" width={resolvedSize} height={resolvedSize} className=\"h-auto max-w-full\" />\n ) : (\n <span\n aria-hidden=\"true\"\n className=\"inline-block animate-pulse rounded-sm bg-surface-muted\"\n style={{ width: resolvedSize, height: resolvedSize, maxWidth: \"100%\" }}\n />\n )}\n {description && <span id={descriptionId} className=\"sr-only\">{description}</span>}\n </div>\n );\n}\n\nexport default QRCode;\n"],"mappings":";AAEA,OAAO,eAAe;AACtB,SAAS,WAAW,QAAQ,gBAAgC;AAoExD,SAEI,KAFJ;AAlEJ,IAAM,iCAAiC,CAAC,UAA0B;AAChE,QAAM,IAAI,MAAM,QAAQ,OAAO,EAAE;AAEjC,QAAM,QAAQ,EAAE,UAAU,GAAG,CAAC;AAC9B,QAAM,QAAQ,EAAE,UAAU,GAAG,CAAC;AAC9B,QAAM,SAAS,EAAE,UAAU,GAAG,CAAC;AAC/B,QAAM,SAAS,EAAE,UAAU,IAAI,EAAE;AACjC,QAAM,SAAS,EAAE,UAAU,IAAI,EAAE;AACjC,QAAM,cAAc,EAAE,UAAU,IAAI,EAAE;AACtC,QAAM,aAAa,EAAE,UAAU,IAAI,EAAE;AACrC,QAAM,QAAQ,EAAE,UAAU,IAAI,EAAE;AAEhC,SAAO,QAAQ,QAAQ,cAAc,aAAa,QAAQ,SAAS,SAAS;AAC9E;AAcO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,QAAQ;AAAA,EACR,SAAS;AAAA,EAC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ACZ,oBAAkB;AAAA,MAClB,aAAW,aAAa;AAAA,MACxB,gBAAc,eAAe,OAAO;AAAA,MACpC,WAAWF,YAAW,sDAAsD,SAAS;AAAA,MAEpF;AAAA,uBACC,gBAAAC,KAAC,UAAK,MAAK,SAAQ,WAAU,sFAC1B,wBACH,IACE,UACF,gBAAAA,KAAC,SAAI,KAAK,SAAS,KAAI,IAAG,OAAO,cAAc,QAAQ,cAAc,WAAU,qBAAoB,IAEnG,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAU;AAAA,YACV,OAAO,EAAE,OAAO,cAAc,QAAQ,cAAc,UAAU,OAAO;AAAA;AAAA,QACvE;AAAA,QAED,eAAe,gBAAAA,KAAC,UAAK,IAAI,eAAe,WAAU,WAAW,uBAAY;AAAA;AAAA;AAAA,EAC5E;AAEJ;AAEA,IAAO,iBAAQ;","names":["useRef","useState","jsx","jsxs","useRef","useState","rejectionMessage","classNames","jsx","jsxs","classNames","jsx","jsxs","classNames","classNames","useEffect","useRef","useState","jsx","jsxs","useEffect","useId","useRef","useState","classNames","jsx","jsxs"]}