arxatec-ui 0.1.58 → 0.1.59

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.
@@ -15,6 +15,7 @@ export * from './components/mime_router';
15
15
  export { FILE_VIEW_KIND, resolveFileViewKind, resolveOfficeFileExtension, OFFICE_MIME_TYPES, } from './utilities/resolve_file_view_kind';
16
16
  export type { FileViewKind } from './utilities/resolve_file_view_kind';
17
17
  export * from './components/transcription_viewer';
18
+ export { TRANSCRIPTION_PAGE_BREAK, splitTranscriptionPages, toPlainTranscription, } from './utilities/transcription_pages';
18
19
  export * from './components/summary_viewer';
19
20
  export * from './components/unknown_viewer';
20
21
  export * from './components/office_viewer';
@@ -5,3 +5,4 @@ export * from './get_extension_from_url';
5
5
  export * from './get_source_language_from_file';
6
6
  export * from './infer_mime_from_file_name';
7
7
  export * from './resolve_file_view_kind';
8
+ export * from './transcription_pages';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Contrato de paginación de las transcripciones.
3
+ *
4
+ * El backend guarda la transcripción como texto plano con las páginas
5
+ * separadas por U+000C (form feed), la misma convención que emite
6
+ * `pdftotext`. Los formatos sin paginación real (audio, Word, imágenes) y las
7
+ * transcripciones antiguas llegan como una única página.
8
+ */
9
+ export declare const TRANSCRIPTION_PAGE_BREAK = "\f";
10
+ /** Devuelve siempre al menos una página. */
11
+ export declare const splitTranscriptionPages: (content: string) => string[];
12
+ /** Texto sin marcas de página, listo para copiar al portapapeles. */
13
+ export declare const toPlainTranscription: (content: string) => string;
package/dist/file-view.js CHANGED
@@ -4269,49 +4269,82 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4269
4269
  case $.UNKNOWN:
4270
4270
  default: return u ?? null;
4271
4271
  }
4272
- }, Ui = ({ content: e, isLoading: t = !1, isProcessing: n = !1, isFetching: r = !1, isError: i = !1, onCopy: a }) => t ? /* @__PURE__ */ U("div", {
4273
- className: "p-4 max-w-2xl mx-auto",
4274
- children: /* @__PURE__ */ U(F, { className: "w-full h-96" })
4275
- }) : n ? /* @__PURE__ */ W("div", {
4276
- className: "p-4 h-full flex flex-col items-center justify-center gap-3",
4277
- children: [/* @__PURE__ */ U(ke, { className: "size-8 animate-spin text-muted-foreground" }), /* @__PURE__ */ W("p", {
4278
- className: "text-sm text-muted-foreground text-center",
4279
- children: ["Procesando transcripción", r ? "..." : ". Actualizando automáticamente..."]
4280
- })]
4281
- }) : i ? /* @__PURE__ */ U("div", {
4282
- className: "p-4 h-full",
4283
- children: /* @__PURE__ */ U(v, {
4284
- title: "Transcripción no disponible",
4285
- description: "Este archivo aún no tiene una transcripción o sucedió un error al cargarla.",
4286
- icon: Se,
4287
- classNameCard: "w-full h-full flex-col items-center justify-center",
4288
- classNameIconCard: "mx-auto",
4289
- classNameDescription: "text-center w-full max-w-sm",
4290
- classNameTitle: "text-center w-full",
4291
- color: "white"
4292
- })
4293
- }) : /* @__PURE__ */ W("div", {
4294
- className: "flex flex-col h-full bg-background overflow-hidden",
4295
- children: [/* @__PURE__ */ W("div", {
4296
- className: "flex justify-between items-center px-6 py-4 border-b bg-muted/30",
4297
- children: [/* @__PURE__ */ U("span", {
4298
- className: "text-sm font-medium text-muted-foreground uppercase tracking-tight",
4299
- children: "TRANSCRIPCIÓN"
4300
- }), a ? /* @__PURE__ */ W(k, {
4301
- variant: "ghost",
4302
- size: "sm",
4303
- onClick: a,
4304
- className: "h-8 gap-2",
4305
- children: [/* @__PURE__ */ U(_e, { className: "size-3.5" }), "Copiar"]
4306
- }) : null]
4307
- }), /* @__PURE__ */ U("div", {
4308
- className: "flex-1 overflow-auto p-8 prose prose-sm dark:prose-invert max-w-full min-w-full w-full mx-auto",
4309
- children: /* @__PURE__ */ U("pre", {
4310
- className: "whitespace-pre-wrap font-sans text-foreground text-sm leading-relaxed max-w-2xl mx-auto",
4311
- children: e
4272
+ }, Ui = "\f", Wi = (e) => e.split("\f"), Gi = (e) => Wi(e).map((e) => e.trim()).filter((e) => e.length > 0).join("\n\n"), Ki = ({ content: e, isLoading: t = !1, isProcessing: n = !1, isFetching: r = !1, isError: i = !1, onCopy: a }) => {
4273
+ let o = B(() => Wi(e ?? ""), [e]);
4274
+ if (t) return /* @__PURE__ */ U("div", {
4275
+ className: "p-4 max-w-2xl mx-auto",
4276
+ children: /* @__PURE__ */ U(F, { className: "w-full h-96" })
4277
+ });
4278
+ if (n) return /* @__PURE__ */ W("div", {
4279
+ className: "p-4 h-full flex flex-col items-center justify-center gap-3",
4280
+ children: [/* @__PURE__ */ U(ke, { className: "size-8 animate-spin text-muted-foreground" }), /* @__PURE__ */ W("p", {
4281
+ className: "text-sm text-muted-foreground text-center",
4282
+ children: ["Procesando transcripción", r ? "..." : ". Actualizando automáticamente..."]
4283
+ })]
4284
+ });
4285
+ if (i) return /* @__PURE__ */ U("div", {
4286
+ className: "p-4 h-full",
4287
+ children: /* @__PURE__ */ U(v, {
4288
+ title: "Transcripción no disponible",
4289
+ description: "Este archivo aún no tiene una transcripción o sucedió un error al cargarla.",
4290
+ icon: Se,
4291
+ classNameCard: "w-full h-full flex-col items-center justify-center",
4292
+ classNameIconCard: "mx-auto",
4293
+ classNameDescription: "text-center w-full max-w-sm",
4294
+ classNameTitle: "text-center w-full",
4295
+ color: "white"
4312
4296
  })
4313
- })]
4314
- }), Wi = ({ content: e, isLoading: t = !1, isProcessing: n = !1, isFetching: r = !1, isError: i = !1, isUnsupported: a = !1, onCopy: o, onRetry: s }) => t ? /* @__PURE__ */ U("div", {
4297
+ });
4298
+ let s = o.length > 1;
4299
+ return /* @__PURE__ */ W("div", {
4300
+ className: "flex flex-col h-full bg-background overflow-hidden",
4301
+ children: [/* @__PURE__ */ W("div", {
4302
+ className: "flex justify-between items-center px-6 py-4 border-b bg-muted/30",
4303
+ children: [/* @__PURE__ */ W("div", {
4304
+ className: "flex items-baseline gap-2",
4305
+ children: [/* @__PURE__ */ U("span", {
4306
+ className: "text-sm font-medium text-muted-foreground uppercase tracking-tight",
4307
+ children: "TRANSCRIPCIÓN"
4308
+ }), s ? /* @__PURE__ */ W("span", {
4309
+ className: "text-sm text-muted-foreground",
4310
+ children: [o.length, " páginas"]
4311
+ }) : null]
4312
+ }), a ? /* @__PURE__ */ W(k, {
4313
+ variant: "ghost",
4314
+ size: "sm",
4315
+ onClick: a,
4316
+ className: "h-8 gap-2",
4317
+ children: [/* @__PURE__ */ U(_e, { className: "size-3.5" }), "Copiar"]
4318
+ }) : null]
4319
+ }), /* @__PURE__ */ U("div", {
4320
+ className: "flex-1 overflow-auto p-8",
4321
+ children: /* @__PURE__ */ U("div", {
4322
+ className: "mx-auto flex max-w-2xl flex-col gap-6",
4323
+ children: o.map((e, t) => /* @__PURE__ */ W("article", {
4324
+ className: "overflow-hidden rounded-lg border bg-card shadow-sm",
4325
+ children: [s ? /* @__PURE__ */ U("header", {
4326
+ className: "flex items-center justify-between border-b bg-muted/20 px-6 py-2",
4327
+ children: /* @__PURE__ */ W("span", {
4328
+ className: "text-sm text-muted-foreground",
4329
+ children: [
4330
+ "Página ",
4331
+ t + 1,
4332
+ " de ",
4333
+ o.length
4334
+ ]
4335
+ })
4336
+ }) : null, e.trim().length > 0 ? /* @__PURE__ */ U("pre", {
4337
+ className: "whitespace-pre-wrap break-words px-6 py-5 font-sans text-sm leading-relaxed text-foreground",
4338
+ children: e
4339
+ }) : /* @__PURE__ */ U("p", {
4340
+ className: "px-6 py-5 text-sm text-muted-foreground italic",
4341
+ children: "Esta página no contiene texto."
4342
+ })]
4343
+ }, t))
4344
+ })
4345
+ })]
4346
+ });
4347
+ }, qi = ({ content: e, isLoading: t = !1, isProcessing: n = !1, isFetching: r = !1, isError: i = !1, isUnsupported: a = !1, onCopy: o, onRetry: s }) => t ? /* @__PURE__ */ U("div", {
4315
4348
  className: "p-4 max-w-2xl mx-auto",
4316
4349
  children: /* @__PURE__ */ U(F, { className: "w-full h-96" })
4317
4350
  }) : a ? /* @__PURE__ */ U("div", {
@@ -4370,7 +4403,7 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4370
4403
  children: e
4371
4404
  })
4372
4405
  })]
4373
- }), Gi = ({ fileName: e, isPending: t = !1, isError: n = !1, onDownload: r }) => t ? /* @__PURE__ */ U("div", {
4406
+ }), Ji = ({ fileName: e, isPending: t = !1, isError: n = !1, onDownload: r }) => t ? /* @__PURE__ */ U("div", {
4374
4407
  className: "p-6 w-full h-full",
4375
4408
  children: /* @__PURE__ */ U(F, { className: "w-full h-full rounded-md" })
4376
4409
  }) : n ? /* @__PURE__ */ U("div", {
@@ -4408,7 +4441,7 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4408
4441
  children: [/* @__PURE__ */ U(K, { className: "size-4" }), /* @__PURE__ */ U("p", { children: "Descargar archivo" })]
4409
4442
  }) : null
4410
4443
  ]
4411
- }), Ki = ({ onDownload: e }) => e ? /* @__PURE__ */ U(St, {
4444
+ }), Yi = ({ onDownload: e }) => e ? /* @__PURE__ */ U(St, {
4412
4445
  ariaLabel: "Controles del visor de documento",
4413
4446
  children: /* @__PURE__ */ W(N, { children: [/* @__PURE__ */ U(j, {
4414
4447
  asChild: !0,
@@ -4422,7 +4455,7 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4422
4455
  children: /* @__PURE__ */ U(K, { className: "size-4" })
4423
4456
  })
4424
4457
  }), /* @__PURE__ */ U(I, { children: "Descargar archivo" })] })
4425
- }) : null, qi = ({ url: e, fileName: t, mimeType: n, onDownload: r }) => /* @__PURE__ */ W("div", {
4458
+ }) : null, Xi = ({ url: e, fileName: t, mimeType: n, onDownload: r }) => /* @__PURE__ */ W("div", {
4426
4459
  className: "relative flex flex-col h-full w-full bg-background",
4427
4460
  children: [/* @__PURE__ */ U("div", {
4428
4461
  className: "flex-1 overflow-hidden h-full",
@@ -4459,16 +4492,16 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4459
4492
  height: "100%"
4460
4493
  }
4461
4494
  })
4462
- }), /* @__PURE__ */ U(Ki, { onDownload: r })]
4463
- }), Ji = ({ url: e, fileName: t, mimeType: n, isPending: r = !1, isError: i = !1, onDownload: a }) => r ? /* @__PURE__ */ U("div", {
4495
+ }), /* @__PURE__ */ U(Yi, { onDownload: r })]
4496
+ }), Zi = ({ url: e, fileName: t, mimeType: n, isPending: r = !1, isError: i = !1, onDownload: a }) => r ? /* @__PURE__ */ U("div", {
4464
4497
  className: "flex h-full w-full items-center justify-center",
4465
4498
  children: /* @__PURE__ */ U(vt, {})
4466
- }) : i || !e ? /* @__PURE__ */ U(yt, {}) : /* @__PURE__ */ U(qi, {
4499
+ }) : i || !e ? /* @__PURE__ */ U(yt, {}) : /* @__PURE__ */ U(Xi, {
4467
4500
  url: e,
4468
4501
  fileName: t,
4469
4502
  mimeType: n,
4470
4503
  onDownload: a
4471
- }, e), Yi = ({ open: e, onOpenChange: t, exportType: n, exportName: r, onExportNameChange: i, onConfirm: s }) => /* @__PURE__ */ U(o, {
4504
+ }, e), Qi = ({ open: e, onOpenChange: t, exportType: n, exportName: r, onExportNameChange: i, onConfirm: s }) => /* @__PURE__ */ U(o, {
4472
4505
  open: e,
4473
4506
  onOpenChange: t,
4474
4507
  children: /* @__PURE__ */ W(a, {
@@ -4505,23 +4538,23 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4505
4538
  })
4506
4539
  ]
4507
4540
  })
4508
- }), Xi = oe(void 0), Zi = ({ open: e, children: t }) => {
4541
+ }), $i = oe(void 0), ea = ({ open: e, children: t }) => {
4509
4542
  let [n, r] = H(() => e ? !1 : null), i = {
4510
4543
  assistant: n,
4511
4544
  setAssistant: r
4512
4545
  };
4513
- return /* @__PURE__ */ U(Xi.Provider, {
4546
+ return /* @__PURE__ */ U($i.Provider, {
4514
4547
  value: i,
4515
4548
  children: t
4516
4549
  });
4517
- }, Qi = ({ children: e, open: t, fileId: n }) => /* @__PURE__ */ U(Zi, {
4550
+ }, ta = ({ children: e, open: t, fileId: n }) => /* @__PURE__ */ U(ea, {
4518
4551
  open: t,
4519
4552
  children: e
4520
- }, `${t}:${n}`), $i = () => {
4521
- let e = ce(Xi);
4553
+ }, `${t}:${n}`), na = () => {
4554
+ let e = ce($i);
4522
4555
  if (!e) throw Error("useFilePreviewAssistantContext should be used within FilePreviewAssistantProvider");
4523
4556
  return e;
4524
- }, ea = ({ url: e, fileName: t }) => /* @__PURE__ */ W("div", {
4557
+ }, ra = ({ url: e, fileName: t }) => /* @__PURE__ */ W("div", {
4525
4558
  className: "flex flex-col items-center justify-center h-full p-4 mx-auto max-w-md text-center",
4526
4559
  children: [/* @__PURE__ */ U("div", {
4527
4560
  className: "p-4 rounded-md bg-status-card-background-icon-empty text-foreground",
@@ -4553,12 +4586,12 @@ var Hi = ({ mimeType: e, fileName: t, nativeDocumentMimeType: n, renderNativeDoc
4553
4586
  });
4554
4587
  //#endregion
4555
4588
  //#region src/components/file_view/utilities/file_preview_key.ts
4556
- function ta(e) {
4589
+ function ia(e) {
4557
4590
  return `${e.name}-${e.size}-${e.lastModified}`;
4558
4591
  }
4559
4592
  //#endregion
4560
4593
  //#region src/components/file_view/components/docx_preview_viewer/components/toolbar/index.tsx
4561
- var na = ({ scale: e, onZoomIn: t, onZoomOut: n, onDownload: r, disabled: i = !1 }) => /* @__PURE__ */ W(St, {
4594
+ var aa = ({ scale: e, onZoomIn: t, onZoomOut: n, onDownload: r, disabled: i = !1 }) => /* @__PURE__ */ W(St, {
4562
4595
  ariaLabel: "Controles del visor de documento",
4563
4596
  children: [
4564
4597
  /* @__PURE__ */ W(N, { children: [/* @__PURE__ */ U(j, {
@@ -4606,7 +4639,7 @@ var na = ({ scale: e, onZoomIn: t, onZoomOut: n, onDownload: r, disabled: i = !1
4606
4639
  })
4607
4640
  }), /* @__PURE__ */ U(I, { children: "Descargar documento" })] })
4608
4641
  ]
4609
- }), ra = ({ file: e }) => {
4642
+ }), oa = ({ file: e }) => {
4610
4643
  let t = V(null), [n, r] = H(!0), [i, a] = H(null), [o, s] = H(1), c = R(() => s((e) => Math.min(e + .2, 3)), []), l = R(() => s((e) => Math.max(e - .2, .5)), []), u = R(() => {
4611
4644
  try {
4612
4645
  let t = window.URL.createObjectURL(e), n = document.createElement("a");
@@ -4664,7 +4697,7 @@ var na = ({ scale: e, onZoomIn: t, onZoomOut: n, onDownload: r, disabled: i = !1
4664
4697
  }
4665
4698
  })
4666
4699
  ]
4667
- }), !i && /* @__PURE__ */ U(na, {
4700
+ }), !i && /* @__PURE__ */ U(aa, {
4668
4701
  scale: o,
4669
4702
  onZoomIn: c,
4670
4703
  onZoomOut: l,
@@ -4672,7 +4705,7 @@ var na = ({ scale: e, onZoomIn: t, onZoomOut: n, onDownload: r, disabled: i = !1
4672
4705
  disabled: n
4673
4706
  })]
4674
4707
  });
4675
- }, ia = ({ file: e }) => /* @__PURE__ */ U(ra, { file: e }, ta(e)), aa = {
4708
+ }, sa = ({ file: e }) => /* @__PURE__ */ U(oa, { file: e }, ia(e)), ca = {
4676
4709
  pdf: "application/pdf",
4677
4710
  doc: "application/msword",
4678
4711
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
@@ -4719,19 +4752,19 @@ var na = ({ scale: e, onZoomIn: t, onZoomOut: n, onDownload: r, disabled: i = !1
4719
4752
  sql: "text/x-sql",
4720
4753
  sh: "application/x-sh"
4721
4754
  };
4722
- function oa(e) {
4755
+ function la(e) {
4723
4756
  let t = e.split(".").pop()?.toLowerCase();
4724
- return t ? aa[t] ?? null : null;
4757
+ return t ? ca[t] ?? null : null;
4725
4758
  }
4726
4759
  //#endregion
4727
4760
  //#region src/components/file_view/utilities/effective_mime_from_file.ts
4728
- function sa(e) {
4761
+ function ua(e) {
4729
4762
  let t = e.type.trim().toLowerCase();
4730
- return t && t !== "application/octet-stream" && t !== "binary/octet-stream" ? t : oa(e.name) ?? t;
4763
+ return t && t !== "application/octet-stream" && t !== "binary/octet-stream" ? t : la(e.name) ?? t;
4731
4764
  }
4732
4765
  //#endregion
4733
4766
  //#region src/components/file_view/components/file_source_file_viewer/index.tsx
4734
- var ca = ({ file: e }) => {
4767
+ var da = ({ file: e }) => {
4735
4768
  let [t, n] = H(null), [r, i] = H(!0), [a, o] = H(!1);
4736
4769
  return z(() => {
4737
4770
  let t = !1;
@@ -4744,15 +4777,15 @@ var ca = ({ file: e }) => {
4744
4777
  };
4745
4778
  }, [e]), /* @__PURE__ */ U(hn, {
4746
4779
  content: t,
4747
- mimeType: sa(e),
4780
+ mimeType: ua(e),
4748
4781
  fileName: e.name,
4749
4782
  isPending: r,
4750
4783
  isError: a
4751
4784
  });
4752
- }, la = ({ file: e }) => /* @__PURE__ */ U(ca, { file: e }, ta(e)), ua = () => /* @__PURE__ */ U("div", {
4785
+ }, fa = ({ file: e }) => /* @__PURE__ */ U(da, { file: e }, ia(e)), pa = () => /* @__PURE__ */ U("div", {
4753
4786
  className: "p-4 h-full w-full",
4754
4787
  children: /* @__PURE__ */ U(F, { className: "w-full h-full" })
4755
- }), da = ({ file: e }) => {
4788
+ }), ma = ({ file: e }) => {
4756
4789
  let [t, r] = H([]), [i, a] = H(0), [o, s] = H(!0), [c, l] = H(null);
4757
4790
  if (z(() => {
4758
4791
  let t = !1;
@@ -4773,7 +4806,7 @@ var ca = ({ file: e }) => {
4773
4806
  }), () => {
4774
4807
  t = !0;
4775
4808
  };
4776
- }, [e]), o) return /* @__PURE__ */ U(ua, {});
4809
+ }, [e]), o) return /* @__PURE__ */ U(pa, {});
4777
4810
  if (c) return /* @__PURE__ */ U("div", {
4778
4811
  className: "p-4 h-full w-full",
4779
4812
  children: /* @__PURE__ */ U(v, {
@@ -4851,10 +4884,10 @@ var ca = ({ file: e }) => {
4851
4884
  })
4852
4885
  ]
4853
4886
  });
4854
- }, fa = ({ file: e }) => /* @__PURE__ */ U(da, { file: e }, ta(e));
4887
+ }, ha = ({ file: e }) => /* @__PURE__ */ U(ma, { file: e }, ia(e));
4855
4888
  //#endregion
4856
4889
  //#region src/components/file_view/utilities/download_from_url.ts
4857
- async function pa(e, t) {
4890
+ async function ga(e, t) {
4858
4891
  if (e.startsWith("blob:")) {
4859
4892
  let n = document.createElement("a");
4860
4893
  n.href = e, n.download = t || "archivo", document.body.appendChild(n), n.click(), document.body.removeChild(n);
@@ -4864,18 +4897,18 @@ async function pa(e, t) {
4864
4897
  }
4865
4898
  //#endregion
4866
4899
  //#region src/components/file_view/components/file_simple_preview_render/index.tsx
4867
- var ma = [
4900
+ var _a = [
4868
4901
  "text/",
4869
4902
  "application/javascript",
4870
4903
  "application/json",
4871
4904
  "application/xml",
4872
4905
  "application/typescript"
4873
- ], ha = /\.(js|jsx|ts|tsx|py|java|c|cpp|cs|rb|go|rs|php|sql|sh|bash|md|json|yml|yaml|html|css)$/i, ga = [
4906
+ ], va = /\.(js|jsx|ts|tsx|py|java|c|cpp|cs|rb|go|rs|php|sql|sh|bash|md|json|yml|yaml|html|css)$/i, ya = [
4874
4907
  "application/msword",
4875
4908
  "application/vnd.ms-powerpoint",
4876
4909
  "application/vnd.openxmlformats-officedocument.presentationml.presentation"
4877
- ], _a = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", va = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ya = "application/vnd.ms-excel", ba = ({ file: e, url: t }) => {
4878
- let n = sa(e), r = () => pa(t, e.name);
4910
+ ], ba = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", xa = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Sa = "application/vnd.ms-excel", Ca = ({ file: e, url: t }) => {
4911
+ let n = ua(e), r = () => ga(t, e.name);
4879
4912
  return n === "application/pdf" ? /* @__PURE__ */ U(kt, {
4880
4913
  url: t,
4881
4914
  fileName: e.name,
@@ -4894,14 +4927,14 @@ var ma = [
4894
4927
  url: t,
4895
4928
  fileName: e.name,
4896
4929
  onDownload: r
4897
- }) : ma.some((e) => n.startsWith(e)) || ha.test(e.name) ? /* @__PURE__ */ U(la, { file: e }) : n === _a ? /* @__PURE__ */ U(ia, { file: e }) : n === va || n === ya ? /* @__PURE__ */ U(fa, { file: e }) : ga.includes(n) ? /* @__PURE__ */ U(ea, {
4930
+ }) : _a.some((e) => n.startsWith(e)) || va.test(e.name) ? /* @__PURE__ */ U(fa, { file: e }) : n === ba ? /* @__PURE__ */ U(sa, { file: e }) : n === xa || n === Sa ? /* @__PURE__ */ U(ha, { file: e }) : ya.includes(n) ? /* @__PURE__ */ U(ra, {
4898
4931
  url: t,
4899
4932
  fileName: e.name
4900
- }) : /* @__PURE__ */ U(Gi, {
4933
+ }) : /* @__PURE__ */ U(Ji, {
4901
4934
  fileName: e.name,
4902
4935
  onDownload: r
4903
4936
  });
4904
- }, xa = ({ open: e, onOpenChange: t, file: n }) => {
4937
+ }, wa = ({ open: e, onOpenChange: t, file: n }) => {
4905
4938
  let r = B(() => n ? URL.createObjectURL(n) : null, [n]);
4906
4939
  return z(() => () => {
4907
4940
  r && URL.revokeObjectURL(r);
@@ -4920,7 +4953,7 @@ var ma = [
4920
4953
  className: "flex-1 relative min-h-0 bg-background",
4921
4954
  children: n && r && /* @__PURE__ */ U("div", {
4922
4955
  className: "absolute inset-0 overflow-hidden min-w-0",
4923
- children: /* @__PURE__ */ U(ba, {
4956
+ children: /* @__PURE__ */ U(Ca, {
4924
4957
  file: n,
4925
4958
  url: r
4926
4959
  })
@@ -4931,14 +4964,14 @@ var ma = [
4931
4964
  };
4932
4965
  //#endregion
4933
4966
  //#region src/components/file_view/utilities/get_extension_from_url.ts
4934
- function Sa(e) {
4967
+ function Ta(e) {
4935
4968
  try {
4936
4969
  return new URL(e).pathname.split(".").pop()?.toLowerCase() ?? "";
4937
4970
  } catch {
4938
4971
  return e.split("?")[0].split(".").pop()?.toLowerCase() ?? "";
4939
4972
  }
4940
4973
  }
4941
- function Ca(e) {
4974
+ function Ea(e) {
4942
4975
  try {
4943
4976
  return new URL(e).pathname.split("/").pop() ?? "Vista previa";
4944
4977
  } catch {
@@ -4947,14 +4980,14 @@ function Ca(e) {
4947
4980
  }
4948
4981
  //#endregion
4949
4982
  //#region src/components/file_view/components/file_url_preview_render/index.tsx
4950
- var wa = [
4983
+ var Da = [
4951
4984
  "doc",
4952
4985
  "docx",
4953
4986
  "ppt",
4954
4987
  "pptx",
4955
4988
  "xls",
4956
4989
  "xlsx"
4957
- ], Ta = [
4990
+ ], Oa = [
4958
4991
  "jpg",
4959
4992
  "jpeg",
4960
4993
  "png",
@@ -4965,29 +4998,29 @@ var wa = [
4965
4998
  "ico",
4966
4999
  "heic",
4967
5000
  "heif"
4968
- ], Ea = ({ url: e, fileName: t }) => {
4969
- let n = Sa(e), r = () => pa(e, t);
5001
+ ], ka = ({ url: e, fileName: t }) => {
5002
+ let n = Ta(e), r = () => ga(e, t);
4970
5003
  return n === "pdf" ? /* @__PURE__ */ U(kt, {
4971
5004
  url: e,
4972
5005
  fileName: t,
4973
5006
  onDownload: r
4974
- }) : Ta.includes(n) ? /* @__PURE__ */ U(qt, {
5007
+ }) : Oa.includes(n) ? /* @__PURE__ */ U(qt, {
4975
5008
  url: e,
4976
- mimeType: oa(t) ?? void 0,
5009
+ mimeType: la(t) ?? void 0,
4977
5010
  fileName: t,
4978
5011
  fileId: e,
4979
5012
  onDownload: r
4980
- }) : wa.includes(n) ? /* @__PURE__ */ U(Ji, {
5013
+ }) : Da.includes(n) ? /* @__PURE__ */ U(Zi, {
4981
5014
  url: e,
4982
5015
  fileName: t,
4983
- mimeType: oa(t) ?? void 0,
5016
+ mimeType: la(t) ?? void 0,
4984
5017
  onDownload: r
4985
- }) : /* @__PURE__ */ U(Gi, {
5018
+ }) : /* @__PURE__ */ U(Ji, {
4986
5019
  fileName: t,
4987
5020
  onDownload: r
4988
5021
  });
4989
- }, Da = ({ open: e, onOpenChange: t, url: n, fileName: r, isPending: i = !1, isError: a = !1 }) => {
4990
- let o = r ?? (n ? Ca(n) : "Vista previa");
5022
+ }, Aa = ({ open: e, onOpenChange: t, url: n, fileName: r, isPending: i = !1, isError: a = !1 }) => {
5023
+ let o = r ?? (n ? Ea(n) : "Vista previa");
4991
5024
  return /* @__PURE__ */ U(ae, {
4992
5025
  open: e,
4993
5026
  onOpenChange: t,
@@ -5017,7 +5050,7 @@ var wa = [
5017
5050
  icon: Ce
5018
5051
  })
5019
5052
  }),
5020
- !i && !a && n && /* @__PURE__ */ U(Ea, {
5053
+ !i && !a && n && /* @__PURE__ */ U(ka, {
5021
5054
  url: n,
5022
5055
  fileName: o
5023
5056
  })
@@ -5027,6 +5060,6 @@ var wa = [
5027
5060
  });
5028
5061
  };
5029
5062
  //#endregion
5030
- export { Vr as DOCX_MIME, $ as FILE_VIEW_KIND, _n as FILE_VIEW_SHEET_TAB, dn as FileAudioPlayer, ea as FileBlobOfficeUnavailable, Yi as FileDocumentExportDialog, ia as FileDocxPreviewViewer, gn as FileEditViewer, qt as FileImageViewer, Hi as FileMimeRouter, Ji as FileOfficeViewer, Ki as FileOfficeViewerToolbar, kt as FilePdfViewer, Qi as FilePreviewAssistantProvider, ba as FileSimplePreviewRender, xa as FileSimplePreviewSheet, la as FileSourceFileViewer, hn as FileSourceViewer, Wi as FileSummaryViewer, Pi as FileTemplateViewer, Mi as FileTemplateViewerContent, Ui as FileTranscriptionViewer, Gi as FileUnknownViewer, Ea as FileUrlPreviewRender, Da as FileUrlPreviewSheet, cn as FileVideoPlayer, yt as FileViewErrorState, yt as PdfViewerErrorState, vt as FileViewLoadingState, vt as PdfContentLoadingState, vt as PdfViewerLoadingState, bn as FileViewSheet, xn as FileViewUnsavedChangesDialog, fa as FileXlsxPreviewViewer, jt as ImageViewerErrorState, Mt as ImageViewerLoadingState, At as ImageViewerToolbar, Li as OFFICE_MIME_TYPES, Et as PdfViewerContent, Dt as PdfViewerErrorBoundary, wt as PdfViewerToolbar, J as TEMPLATE_ANNOTATION_TYPES, Fi as TemplateViewer, on as VideoPlayerErrorState, an as VideoPlayerLoadingState, mn as getSourceLanguageFromFile, Tn as isEllipseAnnotation, En as isImageAnnotation, Cn as isLineAnnotation, wn as isRectAnnotation, Sn as isTextAnnotation, Br as normalizeMimeBase, Bi as resolveFileViewKind, Vi as resolveOfficeFileExtension, Hr as resolveTemplateFileKind, Wt as useContainerSize, Gt as useFileImageViewer, $i as useFilePreviewAssistantContext, Ft as useHeicConversion, Ut as useImageDrag, It as useImageLoadingState, Ht as useImageTransforms, Jt as useVideoPlayer };
5063
+ export { Vr as DOCX_MIME, $ as FILE_VIEW_KIND, _n as FILE_VIEW_SHEET_TAB, dn as FileAudioPlayer, ra as FileBlobOfficeUnavailable, Qi as FileDocumentExportDialog, sa as FileDocxPreviewViewer, gn as FileEditViewer, qt as FileImageViewer, Hi as FileMimeRouter, Zi as FileOfficeViewer, Yi as FileOfficeViewerToolbar, kt as FilePdfViewer, ta as FilePreviewAssistantProvider, Ca as FileSimplePreviewRender, wa as FileSimplePreviewSheet, fa as FileSourceFileViewer, hn as FileSourceViewer, qi as FileSummaryViewer, Pi as FileTemplateViewer, Mi as FileTemplateViewerContent, Ki as FileTranscriptionViewer, Ji as FileUnknownViewer, ka as FileUrlPreviewRender, Aa as FileUrlPreviewSheet, cn as FileVideoPlayer, yt as FileViewErrorState, yt as PdfViewerErrorState, vt as FileViewLoadingState, vt as PdfContentLoadingState, vt as PdfViewerLoadingState, bn as FileViewSheet, xn as FileViewUnsavedChangesDialog, ha as FileXlsxPreviewViewer, jt as ImageViewerErrorState, Mt as ImageViewerLoadingState, At as ImageViewerToolbar, Li as OFFICE_MIME_TYPES, Et as PdfViewerContent, Dt as PdfViewerErrorBoundary, wt as PdfViewerToolbar, J as TEMPLATE_ANNOTATION_TYPES, Ui as TRANSCRIPTION_PAGE_BREAK, Fi as TemplateViewer, on as VideoPlayerErrorState, an as VideoPlayerLoadingState, mn as getSourceLanguageFromFile, Tn as isEllipseAnnotation, En as isImageAnnotation, Cn as isLineAnnotation, wn as isRectAnnotation, Sn as isTextAnnotation, Br as normalizeMimeBase, Bi as resolveFileViewKind, Vi as resolveOfficeFileExtension, Hr as resolveTemplateFileKind, Wi as splitTranscriptionPages, Gi as toPlainTranscription, Wt as useContainerSize, Gt as useFileImageViewer, na as useFilePreviewAssistantContext, Ft as useHeicConversion, Ut as useImageDrag, It as useImageLoadingState, Ht as useImageTransforms, Jt as useVideoPlayer };
5031
5064
 
5032
5065
  //# sourceMappingURL=file-view.js.map