@epam/ai-dial-attachment-canvas 1.1.0-dev.400 → 1.1.0-dev.402

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.
Files changed (46) hide show
  1. package/{LazyContentBoundary-CqvIcNMp.js → LazyContentBoundary-DkAcpR4S.js} +3 -2
  2. package/{PdfContent-CU1Q5IV6.js → PdfContent-BBUc0_SC.js} +1 -1
  3. package/{renderer-module-contract-BNGz8HvO-BmSLiM0k.js → bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js} +2448 -8979
  4. package/chart-ex-B0DgG3Dt.js +1009 -0
  5. package/comment-occurrence-CqejEuts-7SeKCBXk.js +6 -0
  6. package/comment-ui-runtime-DEtgcmj7-B1G7PH4z.js +170 -0
  7. package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +2 -0
  8. package/comment-ui-runtime-lXwVOgjW-Be4RALsI.js +112 -0
  9. package/comments-CAn2A_Xh-CdgNAj0h.js +282 -0
  10. package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
  11. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
  12. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
  13. package/components/OoxmlContent/OoxmlContent.d.ts +7 -3
  14. package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -1
  15. package/delimited-text-worker-host-DcHj_JZt-DWJmaPag.js +25 -0
  16. package/docx-B9qBTEkj.js +29822 -0
  17. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +1 -1
  18. package/index.css +1 -1
  19. package/index.js +383 -325
  20. package/line-distribute-IsUGfHXm-DeITjLzJ.js +1234 -0
  21. package/line-metrics-CBbw80Ko-DoOuwYxZ.js +60 -0
  22. package/models/attachment-canvas.d.ts +15 -5
  23. package/models/attachment-canvas.d.ts.map +1 -1
  24. package/package.json +5 -5
  25. package/pptx-dkJw0-Vx.js +9179 -0
  26. package/read-only-comment-decoration-BTnWEeo5-BNhbteYc.js +94 -0
  27. package/read-only-comment-margin-plStyGfE-mggNAMB_.js +189 -0
  28. package/render-worker-host-BEfLZvSL-COy91Rd8.js +7 -0
  29. package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +7 -0
  30. package/render-worker-host-C3xwtHnv-BBGHFdo9.js +7 -0
  31. package/renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js +10063 -0
  32. package/types/attachment-canvas.d.ts +3 -2
  33. package/types/attachment-canvas.d.ts.map +1 -1
  34. package/utils/content.d.ts +3 -3
  35. package/utils/content.d.ts.map +1 -1
  36. package/utils/download.d.ts.map +1 -1
  37. package/visible-index-DPoQYSDt-9lRc-2Ik.js +162 -0
  38. package/xlsx-BAXMTJTG.js +8585 -0
  39. package/docx-TK1kGI6t.js +0 -27179
  40. package/highlight-rect-BuX5rWP4-BMOCuZYw.js +0 -1037
  41. package/pptx-DfVqSUxc.js +0 -7410
  42. package/render-worker-host-Br7ZDyGE-ByESfBjH.js +0 -7
  43. package/render-worker-host-CM1JXVqg-DGwZpsUd.js +0 -7
  44. package/render-worker-host-DFtd9Z-J-DU7fugLI.js +0 -7
  45. package/visible-index-BjesVGhg-DvGeguMs.js +0 -133
  46. package/xlsx-44AZTEry.js +0 -7800
package/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { c as e, i as t, l as n, o as r, s as i, t as a } from "./LazyContentBoundary-CqvIcNMp.js";
1
+ import { c as e, i as t, l as n, o as r, s as i, t as a } from "./LazyContentBoundary-DkAcpR4S.js";
2
2
  import { AttachmentType as o, CodeBlockTheme as s, DEFAULT_MARKDOWN_CLASS_NAMES as c, FileExtension as l, MIMEType as u, MarkdownRenderer as d, buildCssVars as f, copyToClipboard as p, mergeClasses as m, restrainedSyntaxTheme as h, stripUrlQueryAndFragment as g } from "@epam/ai-dial-chat-shared";
3
- import { SidebarOrientation as _, SidebarPanel as ee } from "@epam/ai-dial-sidebar";
4
- import { DIAL_ICON_SIZE as v, DIAL_KIT_ICON_STROKE as y, GhostIconButton as b, LinkButton as x, Spinner as S } from "@epam/ai-dial-ui-kit";
5
- import { IconAlertTriangle as C, IconCheck as w, IconCode as T, IconCopy as E, IconDownload as te, IconEye as ne, IconLock as re, IconMarkdown as ie } from "@tabler/icons-react";
6
- import { createContext as D, lazy as O, memo as k, useCallback as A, useContext as j, useEffect as M, useMemo as N, useRef as P, useState as F } from "react";
7
- import { JsonView as ae, defaultStyles as oe } from "react-json-view-lite";
8
- import { Fragment as se, jsx as I, jsxs as L } from "react/jsx-runtime";
3
+ import { SidebarOrientation as _, SidebarPanel as v } from "@epam/ai-dial-sidebar";
4
+ import { DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, GhostIconButton as x, LinkButton as S, Spinner as C } from "@epam/ai-dial-ui-kit";
5
+ import { IconAlertTriangle as w, IconCheck as T, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae } from "@tabler/icons-react";
6
+ import { createContext as E, lazy as D, memo as O, useCallback as k, useContext as A, useEffect as j, useMemo as M, useRef as N, useState as P } from "react";
7
+ import { JsonView as oe, defaultStyles as se } from "react-json-view-lite";
8
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
9
9
  import { AppRenderer as ce } from "@mcp-ui/client";
10
- import { VisualizerConnectorRequests as R } from "@epam/ai-dial-shared";
11
- import { VisualizerConnector as le } from "@epam/ai-dial-visualizer-connector";
12
- var z = {
10
+ import { VisualizerConnectorRequests as le } from "@epam/ai-dial-shared";
11
+ import { VisualizerConnector as R } from "@epam/ai-dial-visualizer-connector";
12
+ var ue = {
13
13
  container: "_container_1nhig_1",
14
14
  containerLight: "_containerLight_1nhig_5"
15
- }, ue = {
15
+ }, de = {
16
16
  [s.Dark]: h,
17
17
  [s.Light]: h
18
- }, B = () => O(async () => {
18
+ }, fe = () => D(async () => {
19
19
  let { Prism: e } = await import("react-syntax-highlighter");
20
20
  return { default: e };
21
- }), de = k(({ content: e, codeBlockTheme: t = s.Light, labels: n }) => {
22
- let { text: r, language: i } = e, o = i == null || i === "plaintext", c = ue[t], l = t === s.Light, [u, d] = F(0), f = N(B, [u]), p = A(() => {
21
+ }), pe = O(({ content: e, codeBlockTheme: t = s.Light, labels: n }) => {
22
+ let { text: r, language: i } = e, o = i == null || i === "plaintext", c = de[t], l = t === s.Light, [u, d] = P(0), f = M(fe, [u]), p = k(() => {
23
23
  d((e) => e + 1);
24
24
  }, []), h = /* @__PURE__ */ I("pre", {
25
25
  className: "whitespace-pre-wrap break-words p-4",
@@ -27,7 +27,7 @@ var z = {
27
27
  });
28
28
  return /* @__PURE__ */ I("div", {
29
29
  dir: "ltr",
30
- className: m("h-full overflow-auto", z.container, l && z.containerLight),
30
+ className: m("h-full overflow-auto", ue.container, l && ue.containerLight),
31
31
  children: o ? h : /* @__PURE__ */ I(a, {
32
32
  retryKey: u,
33
33
  onRetry: p,
@@ -51,21 +51,21 @@ var z = {
51
51
  })
52
52
  })
53
53
  });
54
- }), fe = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, pe = k(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
55
- let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = F(!0), [d, f] = F(!1), p = P(null);
56
- M(() => {
54
+ }), z = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, me = O(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
55
+ let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = P(!0), [d, f] = P(!1), p = N(null);
56
+ j(() => {
57
57
  u(!0), f(!1);
58
58
  }, [e]);
59
- let h = A((t) => {
59
+ let h = k((t) => {
60
60
  if (u(!1), e.srcdoc == null) try {
61
61
  p.current?.contentDocument ?? f(!0);
62
62
  } catch {
63
63
  f(!0);
64
64
  }
65
- }, [e.srcdoc]), g = A(() => {
65
+ }, [e.srcdoc]), g = k(() => {
66
66
  u(!1), f(!0);
67
67
  }, []);
68
- if (n && e.srcdoc != null) return /* @__PURE__ */ I(de, {
68
+ if (n && e.srcdoc != null) return /* @__PURE__ */ I(pe, {
69
69
  content: {
70
70
  type: i.Code,
71
71
  text: e.srcdoc,
@@ -78,37 +78,37 @@ var z = {
78
78
  children: [/* @__PURE__ */ I("p", {
79
79
  className: "text-center",
80
80
  children: s
81
- }), e.url != null && /* @__PURE__ */ I(x, {
81
+ }), e.url != null && /* @__PURE__ */ I(S, {
82
82
  href: e.url,
83
83
  target: "_blank",
84
84
  label: c,
85
- className: fe.openInNewTabButton,
85
+ className: z.openInNewTabButton,
86
86
  textClassName: o
87
87
  })]
88
88
  });
89
- let _ = e.srcdoc != null, ee = _ ? void 0 : e.url, v = _ ? e.srcdoc : void 0;
89
+ let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
90
90
  return /* @__PURE__ */ L("div", {
91
91
  className: "relative h-full",
92
92
  children: [l && /* @__PURE__ */ I("div", {
93
93
  className: "absolute inset-0 flex items-center justify-center",
94
- children: /* @__PURE__ */ I(S, {})
94
+ children: /* @__PURE__ */ I(C, {})
95
95
  }), /* @__PURE__ */ I("iframe", {
96
96
  ref: p,
97
97
  title: r,
98
- src: ee,
99
- srcDoc: v,
98
+ src: v,
99
+ srcDoc: y,
100
100
  sandbox: _ ? "allow-scripts" : "allow-scripts allow-same-origin",
101
101
  className: m("h-full w-full border-none", l ? "invisible" : ""),
102
102
  onLoad: h,
103
103
  onError: g
104
104
  })]
105
105
  });
106
- }), V = {
106
+ }), B = {
107
107
  loadingOverlay: "_loadingOverlay_t3d2v_1",
108
108
  statusLabel: "_statusLabel_t3d2v_5",
109
109
  errorIcon: "_errorIcon_t3d2v_9"
110
- }, me = ({ content: e, errorLabel: t = "Failed to load app" }) => {
111
- let [n, r] = F("loading"), { html: i, sandboxUrl: a, toolName: o, toolInput: s, toolResult: c, hostContext: l, onToolCall: u } = e;
110
+ }, he = ({ content: e, errorLabel: t = "Failed to load app" }) => {
111
+ let [n, r] = P("loading"), { html: i, sandboxUrl: a, toolName: o, toolInput: s, toolResult: c, hostContext: l, onToolCall: u } = e;
112
112
  return /* @__PURE__ */ L("div", {
113
113
  className: "relative h-full w-full",
114
114
  children: [
@@ -124,113 +124,159 @@ var z = {
124
124
  onError: () => r("error")
125
125
  }),
126
126
  n === "loading" && /* @__PURE__ */ I("div", {
127
- className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", V.loadingOverlay),
128
- children: /* @__PURE__ */ I(S, {})
127
+ className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", B.loadingOverlay),
128
+ children: /* @__PURE__ */ I(C, {})
129
129
  }),
130
130
  n === "error" && /* @__PURE__ */ L("div", {
131
131
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
132
- children: [/* @__PURE__ */ I(C, {
132
+ children: [/* @__PURE__ */ I(w, {
133
133
  size: 60,
134
- stroke: y,
134
+ stroke: b,
135
135
  "aria-hidden": !0,
136
- className: V.errorIcon
136
+ className: B.errorIcon
137
137
  }), /* @__PURE__ */ I("p", {
138
138
  role: "alert",
139
- className: m("text-center", V.statusLabel),
139
+ className: m("text-center", B.statusLabel),
140
140
  children: t
141
141
  })]
142
142
  })
143
143
  ]
144
144
  });
145
- }, H = {
146
- viewer: "_viewer_1d8a3_1",
147
- statusOverlay: "_statusOverlay_1d8a3_5",
148
- errorIcon: "_errorIcon_1d8a3_10"
149
- }, he = async (e, t, r) => {
145
+ }, V = {
146
+ viewer: "_viewer_1npwu_1",
147
+ spreadsheetCanvas: "_spreadsheetCanvas_1npwu_5",
148
+ formulaPanel: "_formulaPanel_1npwu_11",
149
+ formulaValue: "_formulaValue_1npwu_17",
150
+ statusOverlay: "_statusOverlay_1npwu_23",
151
+ errorIcon: "_errorIcon_1npwu_28"
152
+ }, ge = (e) => {
153
+ if (e?.kind !== "range") return "";
154
+ let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
155
+ if (n == null) return "";
156
+ let r = n.formula;
157
+ return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
158
+ }, _e = async (e, t, r, i) => {
150
159
  switch (t) {
151
160
  case n.Docx: {
152
- let { DocxScrollViewer: t } = await import("./docx-TK1kGI6t.js");
161
+ let [{ DocxScrollViewer: t }, { chartEx: n }] = await Promise.all([import("./docx-B9qBTEkj.js"), import("./chart-ex-B0DgG3Dt.js")]);
153
162
  return new t(e, {
154
163
  enableTextSelection: !0,
155
164
  refitOnResize: !0,
165
+ chartEx: n,
156
166
  onError: r
157
167
  });
158
168
  }
159
169
  case n.Xlsx: {
160
- let { XlsxViewer: t } = await import("./xlsx-44AZTEry.js");
170
+ let [{ XlsxViewer: t }, { chartEx: n }] = await Promise.all([import("./xlsx-BAXMTJTG.js"), import("./chart-ex-B0DgG3Dt.js")]);
161
171
  return new t(e, {
162
172
  showZoomSlider: !0,
173
+ chartEx: n,
174
+ onError: r,
175
+ onSelectionContextChange: i
176
+ });
177
+ }
178
+ case n.Csv: {
179
+ let { XlsxSheetViewer: t } = await import("./xlsx-BAXMTJTG.js"), n = document.createElement("canvas");
180
+ n.className = V.spreadsheetCanvas, e.replaceChildren(n);
181
+ let i = new t(n, {
182
+ showScrollbars: !0,
163
183
  onError: r
164
184
  });
185
+ return {
186
+ load: (e) => i.load(e, { format: "csv" }),
187
+ destroy: () => i.destroy()
188
+ };
165
189
  }
166
190
  case n.Pptx: {
167
- let { PptxScrollViewer: t } = await import("./pptx-DfVqSUxc.js");
191
+ let [{ PptxScrollViewer: t }, { chartEx: n }] = await Promise.all([import("./pptx-dkJw0-Vx.js"), import("./chart-ex-B0DgG3Dt.js")]);
168
192
  return new t(e, {
169
193
  enableTextSelection: !0,
170
194
  refitOnResize: !0,
195
+ chartEx: n,
171
196
  onError: r
172
197
  });
173
198
  }
174
199
  }
175
- }, ge = ({ content: e, fileName: t, loadErrorLabel: n }) => {
176
- let r = P(null), [i, a] = F(!0), [o, s] = F(!1);
177
- return M(() => {
178
- let t = r.current;
200
+ }, ve = ({ content: e, fileName: t, loadErrorLabel: r, formulaLabel: i, formulaLabelClassName: a }) => {
201
+ let o = N(null), [s, c] = P(!0), [l, u] = P(!1), [d, f] = P("");
202
+ return j(() => {
203
+ let t = o.current;
179
204
  if (t == null) return;
180
- let n, i = !1;
181
- return a(!0), s(!1), (async () => {
205
+ let n, r = !1;
206
+ return c(!0), u(!1), f(""), (async () => {
182
207
  try {
183
- let r = await he(t, e.format, () => {
184
- i || (a(!1), s(!0));
208
+ let i = await _e(t, e.format, () => {
209
+ r || (c(!1), u(!0));
210
+ }, (e) => {
211
+ r || f(ge(e));
185
212
  });
186
- if (i) {
187
- r.destroy();
213
+ if (r) {
214
+ i.destroy();
188
215
  return;
189
216
  }
190
- n = r, await n.load(e.url), i || a(!1);
217
+ n = i, await n.load(e.url), r || c(!1);
191
218
  } catch {
192
- i || (n?.destroy(), n = void 0, t.replaceChildren(), a(!1), s(!0));
219
+ r || (n?.destroy(), n = void 0, t.replaceChildren(), c(!1), u(!0));
193
220
  }
194
221
  })(), () => {
195
- i = !0, n?.destroy(), t.replaceChildren();
222
+ r = !0, n?.destroy(), t.replaceChildren();
196
223
  };
197
224
  }, [e.format, e.url]), /* @__PURE__ */ L("div", {
198
- className: "relative h-full w-full overflow-hidden",
199
- children: [/* @__PURE__ */ I("div", {
200
- ref: r,
201
- role: "document",
202
- "aria-label": t,
203
- "aria-busy": i,
204
- className: m("h-full w-full overflow-hidden", H.viewer)
205
- }), (i || o) && /* @__PURE__ */ I("div", {
206
- role: o ? "alert" : void 0,
207
- "aria-live": "polite",
208
- className: m("absolute inset-0 flex items-center justify-center", H.statusOverlay),
209
- children: i ? /* @__PURE__ */ I(S, { size: 48 }) : /* @__PURE__ */ L("div", {
210
- className: "flex flex-col items-center gap-2",
211
- children: [/* @__PURE__ */ I(C, {
225
+ className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
226
+ children: [
227
+ e.format === n.Xlsx && /* @__PURE__ */ L("div", {
228
+ role: "region",
229
+ "aria-label": i,
230
+ className: m("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", V.formulaPanel),
231
+ children: [/* @__PURE__ */ I("span", {
212
232
  "aria-hidden": "true",
213
- size: 60,
214
- stroke: y,
215
- className: H.errorIcon
216
- }), /* @__PURE__ */ I("p", {
217
- className: "text-center",
218
- children: n
233
+ className: m("shrink-0", a),
234
+ children: "fx"
235
+ }), /* @__PURE__ */ I("code", {
236
+ dir: "ltr",
237
+ tabIndex: 0,
238
+ "aria-live": "polite",
239
+ className: m("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", V.formulaValue),
240
+ children: d
219
241
  })]
242
+ }),
243
+ /* @__PURE__ */ I("div", {
244
+ ref: o,
245
+ role: "document",
246
+ "aria-label": t,
247
+ "aria-busy": s,
248
+ className: m("min-h-0 w-full flex-1 overflow-hidden", V.viewer)
249
+ }),
250
+ (s || l) && /* @__PURE__ */ I("div", {
251
+ role: l ? "alert" : void 0,
252
+ "aria-live": "polite",
253
+ className: m("absolute inset-0 flex items-center justify-center", V.statusOverlay),
254
+ children: s ? /* @__PURE__ */ I(C, { size: 48 }) : /* @__PURE__ */ L("div", {
255
+ className: "flex flex-col items-center gap-2",
256
+ children: [/* @__PURE__ */ I(w, {
257
+ "aria-hidden": "true",
258
+ size: 60,
259
+ stroke: b,
260
+ className: V.errorIcon
261
+ }), /* @__PURE__ */ I("p", {
262
+ className: "text-center",
263
+ children: r
264
+ })]
265
+ })
220
266
  })
221
- })]
267
+ ]
222
268
  });
223
- }, U = {
269
+ }, H = {
224
270
  loadingOverlay: "_loadingOverlay_12637_1",
225
271
  statusLabel: "_statusLabel_12637_5",
226
272
  errorIcon: "_errorIcon_12637_9"
227
- }, _e = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", colors: r }) => {
228
- let i = P(null), [a, o] = F("loading"), { url: s, visualizerName: c, requestTimeout: l } = e, u = P(e);
229
- return u.current = e, M(() => {
273
+ }, ye = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", colors: r }) => {
274
+ let i = N(null), [a, o] = P("loading"), { url: s, visualizerName: c, requestTimeout: l } = e, u = N(e);
275
+ return u.current = e, j(() => {
230
276
  let e = i.current;
231
277
  if (!e) return;
232
278
  o("loading");
233
- let t = new le(e, {
279
+ let t = new R(e, {
234
280
  domain: s,
235
281
  hostDomain: window.location.origin,
236
282
  visualizerName: c,
@@ -242,7 +288,7 @@ var z = {
242
288
  layout: r,
243
289
  ...typeof i == "object" && i ? i : {}
244
290
  };
245
- await t.send(R.sendVisualizeData, {
291
+ await t.send(le.sendVisualizeData, {
246
292
  mimeType: e,
247
293
  visualizerData: a
248
294
  }), n && o("ready");
@@ -268,28 +314,28 @@ var z = {
268
314
  className: "h-full w-full"
269
315
  }),
270
316
  a === "loading" && /* @__PURE__ */ L("div", {
271
- className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", U.loadingOverlay),
272
- children: [/* @__PURE__ */ I(S, {}), t && /* @__PURE__ */ I("p", {
273
- className: m("text-center", U.statusLabel),
317
+ className: m("absolute inset-0 flex flex-col items-center justify-center gap-2", H.loadingOverlay),
318
+ children: [/* @__PURE__ */ I(C, {}), t && /* @__PURE__ */ I("p", {
319
+ className: m("text-center", H.statusLabel),
274
320
  children: t
275
321
  })]
276
322
  }),
277
323
  a === "error" && /* @__PURE__ */ L("div", {
278
324
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
279
- children: [/* @__PURE__ */ I(C, {
325
+ children: [/* @__PURE__ */ I(w, {
280
326
  size: 60,
281
- stroke: y,
327
+ stroke: b,
282
328
  "aria-hidden": !0,
283
- className: U.errorIcon
329
+ className: H.errorIcon
284
330
  }), /* @__PURE__ */ I("p", {
285
331
  role: "alert",
286
- className: m("text-center", U.statusLabel),
332
+ className: m("text-center", H.statusLabel),
287
333
  children: n
288
334
  })]
289
335
  })
290
336
  ]
291
337
  });
292
- }, W = {
338
+ }, U = {
293
339
  body: "_body_13ogb_4",
294
340
  statusLabel: "_statusLabel_13ogb_13",
295
341
  errorIcon: "_errorIcon_13ogb_17",
@@ -304,18 +350,18 @@ var z = {
304
350
  jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
305
351
  jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
306
352
  jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
307
- }, ve = () => O(async () => ({ default: (await import("./PdfContent-CU1Q5IV6.js")).PdfContent })), ye = ({ url: e, fileName: t, loadErrorLabel: n }) => {
308
- let [r, i] = F(!1);
309
- return M(() => {
353
+ }, be = () => D(async () => ({ default: (await import("./PdfContent-BBUc0_SC.js")).PdfContent })), xe = ({ url: e, fileName: t, loadErrorLabel: n }) => {
354
+ let [r, i] = P(!1);
355
+ return j(() => {
310
356
  i(!1);
311
357
  }, [e]), r ? /* @__PURE__ */ L("div", {
312
358
  className: "flex flex-col items-center gap-2",
313
- children: [/* @__PURE__ */ I(C, {
359
+ children: [/* @__PURE__ */ I(w, {
314
360
  size: 60,
315
- stroke: y,
316
- className: W.errorIcon
361
+ stroke: b,
362
+ className: U.errorIcon
317
363
  }), /* @__PURE__ */ I("p", {
318
- className: m("text-center", W.statusLabel),
364
+ className: m("text-center", U.statusLabel),
319
365
  children: n
320
366
  })]
321
367
  }) : /* @__PURE__ */ I("img", {
@@ -324,41 +370,44 @@ var z = {
324
370
  className: "max-h-full max-w-full object-contain",
325
371
  onError: () => i(!0)
326
372
  });
327
- }, be = new Set([
373
+ }, Se = new Set([
328
374
  i.PlainText,
329
375
  i.Code,
330
376
  i.Ooxml
331
- ]), xe = k(({ content: t, isLoading: n = !1, fileName: r, isHtmlSourceView: o = !1, labels: { unsupportedLabel: s = "Preview is not supported for this file", loadErrorLabel: l = "Failed to load file", forbiddenErrorLabel: u = "You don't have permission to access this file", visualizerErrorLabel: p, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: ee, pdfHideThumbnailsLabel: v, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: w, pdfContentRetryLabel: T, codeContentLoadingLabel: E, codeContentErrorLabel: te, codeContentRetryLabel: ne } = {}, styles: ie, codeBlockTheme: D, loadPdf: O, hidePdfToolbar: k = !1, configurePdfWorker: j }) => {
332
- let { colors: M, typography: P, bodyClassName: se, cssVars: ce } = ie ?? {}, [R, le] = F(0), z = N(ve, [R]), ue = A(() => {
333
- le((e) => e + 1);
334
- }, []), B = P?.fontClassName != null, fe = N(() => ({
377
+ ]), Ce = O(({ content: t, isLoading: n = !1, fileName: r, isHtmlSourceView: o = !1, labels: { unsupportedLabel: s = "Preview is not supported for this file", loadErrorLabel: l = "Failed to load file", forbiddenErrorLabel: u = "You don't have permission to access this file", visualizerErrorLabel: p, htmlFrameBlockedLabel: h = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: g = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: x, pdfContentLoadingLabel: S, pdfContentErrorLabel: T, pdfContentRetryLabel: ee, xlsxFormulaLabel: te = "Formula", codeContentLoadingLabel: ne, codeContentErrorLabel: re, codeContentRetryLabel: ae } = {}, styles: E, codeBlockTheme: D, loadPdf: O, hidePdfToolbar: A = !1, configurePdfWorker: j }) => {
378
+ let { colors: N, typography: F, bodyClassName: ce, cssVars: le } = E ?? {}, [R, ue] = P(0), de = M(be, [R]), fe = k(() => {
379
+ ue((e) => e + 1);
380
+ }, []), z = F?.fontClassName != null, B = M(() => ({
335
381
  ...f({
336
- "--ac-text": M?.text,
337
- "--ac-status-text": M?.statusText,
338
- "--ac-error-icon": M?.errorIcon,
339
- "--ac-open-in-new-tab-text": M?.openInNewTabText,
340
- "--ac-json-border": M?.jsonBorder,
341
- "--ac-json-bg": M?.jsonBackground,
342
- "--ac-json-label": M?.jsonLabel,
343
- "--ac-json-clickable-label": M?.jsonClickableLabel,
344
- "--ac-json-punctuation": M?.jsonPunctuation,
345
- "--ac-json-string": M?.jsonString,
346
- "--ac-json-number": M?.jsonNumber,
347
- "--ac-json-boolean": M?.jsonBoolean,
348
- "--ac-json-null": M?.jsonNull,
349
- "--ac-json-toggle-icon": M?.jsonToggleIcon,
350
- "--ac-json-toggle-icon-hover": M?.jsonToggleIconHover,
351
- "--ac-ooxml-bg": M?.ooxmlBackground,
352
- "--ac-json-collapsed-text": M?.jsonCollapsedText,
353
- "--ac-json-collapsed-bg": M?.jsonCollapsedBackground,
354
- "--ac-font-family": B ? void 0 : P?.fontFamily,
355
- "--ac-font-size": B ? void 0 : P?.fontSize,
356
- "--ac-font-weight": B ? void 0 : P?.fontWeight,
357
- "--ac-line-height": B ? void 0 : P?.lineHeight,
358
- "--ac-letter-spacing": B ? void 0 : P?.letterSpacing
382
+ "--ac-text": N?.text,
383
+ "--ac-status-text": N?.statusText,
384
+ "--ac-error-icon": N?.errorIcon,
385
+ "--ac-open-in-new-tab-text": N?.openInNewTabText,
386
+ "--ac-json-border": N?.jsonBorder,
387
+ "--ac-json-bg": N?.jsonBackground,
388
+ "--ac-json-label": N?.jsonLabel,
389
+ "--ac-json-clickable-label": N?.jsonClickableLabel,
390
+ "--ac-json-punctuation": N?.jsonPunctuation,
391
+ "--ac-json-string": N?.jsonString,
392
+ "--ac-json-number": N?.jsonNumber,
393
+ "--ac-json-boolean": N?.jsonBoolean,
394
+ "--ac-json-null": N?.jsonNull,
395
+ "--ac-json-toggle-icon": N?.jsonToggleIcon,
396
+ "--ac-json-toggle-icon-hover": N?.jsonToggleIconHover,
397
+ "--ac-ooxml-bg": N?.ooxmlBackground,
398
+ "--ac-ooxml-formula-border": N?.ooxmlFormulaBorder,
399
+ "--ac-ooxml-formula-bg": N?.ooxmlFormulaBackground,
400
+ "--ac-ooxml-formula-text": N?.ooxmlFormulaText,
401
+ "--ac-json-collapsed-text": N?.jsonCollapsedText,
402
+ "--ac-json-collapsed-bg": N?.jsonCollapsedBackground,
403
+ "--ac-font-family": z ? void 0 : F?.fontFamily,
404
+ "--ac-font-size": z ? void 0 : F?.fontSize,
405
+ "--ac-font-weight": z ? void 0 : F?.fontWeight,
406
+ "--ac-line-height": z ? void 0 : F?.lineHeight,
407
+ "--ac-letter-spacing": z ? void 0 : F?.letterSpacing
359
408
  }),
360
- ...ce
361
- }), [ie]), V = N(() => {
409
+ ...le
410
+ }), [E]), V = M(() => {
362
411
  switch (t.type) {
363
412
  case i.Image:
364
413
  case i.Audio:
@@ -373,13 +422,13 @@ var z = {
373
422
  case i.Html: return "h-full overflow-hidden";
374
423
  default: return "h-full overflow-auto p-4";
375
424
  }
376
- }, [t.type]), H = N(() => {
425
+ }, [t.type]), ge = M(() => {
377
426
  switch (t.type) {
378
427
  case i.PlainText: return /* @__PURE__ */ I("pre", {
379
- className: m("whitespace-pre-wrap break-words", W.body, P?.fontClassName),
428
+ className: m("whitespace-pre-wrap break-words", U.body, F?.fontClassName),
380
429
  children: t.text
381
430
  });
382
- case i.Image: return /* @__PURE__ */ I(ye, {
431
+ case i.Image: return /* @__PURE__ */ I(xe, {
383
432
  url: t.url,
384
433
  fileName: r,
385
434
  loadErrorLabel: l
@@ -405,39 +454,39 @@ var z = {
405
454
  dir: "ltr",
406
455
  className: "h-full overflow-auto",
407
456
  children: /* @__PURE__ */ I("div", {
408
- className: m("m-3 overflow-auto rounded-md border", W.jsonWrapper),
409
- children: /* @__PURE__ */ I(ae, {
457
+ className: m("m-3 overflow-auto rounded-md border", U.jsonWrapper),
458
+ children: /* @__PURE__ */ I(oe, {
410
459
  data: t.value,
411
460
  style: {
412
- container: m("whitespace-pre-wrap break-words p-2", P?.jsonClassName ?? "dial-code-text"),
413
- basicChildStyle: oe.basicChildStyle,
461
+ container: m("whitespace-pre-wrap break-words p-2", F?.jsonClassName ?? "dial-code-text"),
462
+ basicChildStyle: se.basicChildStyle,
414
463
  childFieldsContainer: "m-0 ps-3",
415
- label: m("me-1 font-semibold", W.jsonLabel),
416
- clickableLabel: m("me-1 cursor-pointer font-semibold hover:underline", W.jsonClickableLabel),
417
- nullValue: m("italic", W.jsonNullValue),
418
- undefinedValue: m("italic", W.jsonNullValue),
419
- stringValue: W.jsonStringValue,
420
- booleanValue: W.jsonBooleanValue,
421
- numberValue: W.jsonNumberValue,
422
- otherValue: m("italic", W.jsonNullValue),
423
- punctuation: m("me-1", W.jsonPunctuation),
424
- collapseIcon: m("me-1 cursor-pointer select-none transition-colors", W.jsonCollapseIcon),
425
- expandIcon: m("me-1 cursor-pointer select-none transition-colors", W.jsonExpandIcon),
426
- collapsedContent: m("me-1 cursor-pointer rounded px-1", W.jsonCollapsedContent)
464
+ label: m("me-1 font-semibold", U.jsonLabel),
465
+ clickableLabel: m("me-1 cursor-pointer font-semibold hover:underline", U.jsonClickableLabel),
466
+ nullValue: m("italic", U.jsonNullValue),
467
+ undefinedValue: m("italic", U.jsonNullValue),
468
+ stringValue: U.jsonStringValue,
469
+ booleanValue: U.jsonBooleanValue,
470
+ numberValue: U.jsonNumberValue,
471
+ otherValue: m("italic", U.jsonNullValue),
472
+ punctuation: m("me-1", U.jsonPunctuation),
473
+ collapseIcon: m("me-1 cursor-pointer select-none transition-colors", U.jsonCollapseIcon),
474
+ expandIcon: m("me-1 cursor-pointer select-none transition-colors", U.jsonExpandIcon),
475
+ collapsedContent: m("me-1 cursor-pointer rounded px-1", U.jsonCollapsedContent)
427
476
  }
428
477
  })
429
478
  })
430
479
  });
431
- case i.Code: return /* @__PURE__ */ I(de, {
480
+ case i.Code: return /* @__PURE__ */ I(pe, {
432
481
  content: t,
433
482
  codeBlockTheme: D,
434
483
  labels: {
435
- loadingLabel: E,
436
- errorLabel: te,
437
- retryLabel: ne
484
+ loadingLabel: ne,
485
+ errorLabel: re,
486
+ retryLabel: ae
438
487
  }
439
488
  });
440
- case i.Html: return /* @__PURE__ */ I(pe, {
489
+ case i.Html: return /* @__PURE__ */ I(me, {
441
490
  content: t,
442
491
  labels: {
443
492
  htmlFrameBlockedLabel: h,
@@ -449,55 +498,57 @@ var z = {
449
498
  });
450
499
  case i.Pdf: return /* @__PURE__ */ I(a, {
451
500
  retryKey: R,
452
- onRetry: ue,
501
+ onRetry: fe,
453
502
  labels: {
454
- loadingLabel: x,
455
- errorLabel: w,
456
- retryLabel: T
503
+ loadingLabel: S,
504
+ errorLabel: T,
505
+ retryLabel: ee
457
506
  },
458
- children: /* @__PURE__ */ I(z, {
507
+ children: /* @__PURE__ */ I(de, {
459
508
  fileName: r,
460
509
  url: t.url,
461
510
  highlights: t.highlights ?? [],
462
511
  selectedHighlightId: t.selectedHighlightId,
463
512
  loadPdf: O,
464
- hideHeader: k,
513
+ hideHeader: A,
465
514
  configurePdfWorker: j,
466
515
  labels: {
467
516
  thumbnailsLabel: _,
468
- showThumbnailsLabel: ee,
469
- hideThumbnailsLabel: v,
470
- pageNumberLabel: b,
471
- loadingLabel: x,
472
- errorLabel: w,
473
- retryLabel: T
517
+ showThumbnailsLabel: v,
518
+ hideThumbnailsLabel: y,
519
+ pageNumberLabel: x,
520
+ loadingLabel: S,
521
+ errorLabel: T,
522
+ retryLabel: ee
474
523
  }
475
524
  })
476
525
  }, t.url);
477
- case i.Ooxml: return /* @__PURE__ */ I(ge, {
526
+ case i.Ooxml: return /* @__PURE__ */ I(ve, {
478
527
  content: t,
479
528
  fileName: r,
480
- loadErrorLabel: l
529
+ loadErrorLabel: l,
530
+ formulaLabel: te,
531
+ formulaLabelClassName: F?.xlsxFormulaLabelClassName ?? "dial-italic-text"
481
532
  });
482
- case i.Visualizer: return /* @__PURE__ */ I(_e, {
533
+ case i.Visualizer: return /* @__PURE__ */ I(ye, {
483
534
  content: t,
484
535
  errorLabel: p
485
536
  });
486
- case i.McpApp: return /* @__PURE__ */ I(me, { content: t });
537
+ case i.McpApp: return /* @__PURE__ */ I(he, { content: t });
487
538
  case i.Unsupported: return /* @__PURE__ */ I("p", {
488
- className: m("text-center", W.statusLabel),
539
+ className: m("text-center", U.statusLabel),
489
540
  children: s
490
541
  });
491
542
  case i.Error: {
492
543
  let n = t.errorType === e.Forbidden;
493
544
  return /* @__PURE__ */ L("div", {
494
545
  className: "flex flex-col items-center gap-2",
495
- children: [I(n ? re : C, {
546
+ children: [I(n ? ie : w, {
496
547
  size: 60,
497
- stroke: y,
498
- className: W.errorIcon
548
+ stroke: b,
549
+ className: U.errorIcon
499
550
  }), /* @__PURE__ */ I("p", {
500
- className: m("text-center", W.statusLabel),
551
+ className: m("text-center", U.statusLabel),
501
552
  children: n ? u : l
502
553
  })]
503
554
  });
@@ -505,8 +556,9 @@ var z = {
505
556
  }
506
557
  }, [
507
558
  t,
508
- P?.fontClassName,
509
- P?.jsonClassName,
559
+ F?.fontClassName,
560
+ F?.jsonClassName,
561
+ F?.xlsxFormulaLabelClassName,
510
562
  r,
511
563
  D,
512
564
  s,
@@ -517,46 +569,47 @@ var z = {
517
569
  g,
518
570
  o,
519
571
  O,
520
- k,
572
+ A,
521
573
  j,
522
574
  _,
523
- ee,
524
575
  v,
525
- b,
576
+ y,
526
577
  x,
527
- w,
578
+ S,
528
579
  T,
529
- E,
580
+ ee,
530
581
  te,
531
582
  ne,
532
- z,
583
+ re,
584
+ ae,
585
+ de,
533
586
  R,
534
- ue
587
+ fe
535
588
  ]);
536
589
  return /* @__PURE__ */ I("div", {
537
- style: !n && be.has(t.type) ? fe : void 0,
538
- className: m(n ? "flex h-full items-center justify-center" : V, se),
539
- children: n ? /* @__PURE__ */ I(S, {}) : H
590
+ style: !n && Se.has(t.type) ? B : void 0,
591
+ className: m(n ? "flex h-full items-center justify-center" : V, ce),
592
+ children: n ? /* @__PURE__ */ I(C, {}) : ge
540
593
  });
541
- }), Se = 2e3, G = k(({ isOpen: e, isLoading: t = !1, onClose: n, content: a, fileName: o, labels: { ariaLabel: s, closeLabel: c = "Close", downloadLabel: l = "Download", copyTextLabel: u = "Copy text", copiedTextLabel: d = "Copied!", copyMarkdownLabel: f = "Copy as Markdown", copiedMarkdownLabel: p = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: g = "Copied!", visualizerErrorLabel: x, unsupportedLabel: S = "Preview is not supported for this file", loadErrorLabel: C = "Failed to load file", forbiddenErrorLabel: re = "You don't have permission to access this file", htmlFrameBlockedLabel: D = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: O = "Open in new tab", htmlViewSourceLabel: k = "View source", htmlViewRenderedLabel: j = "View rendered", pdfThumbnailsLabel: N, pdfShowThumbnailsLabel: ae, pdfHideThumbnailsLabel: oe, pdfPageNumberLabel: ce, pdfContentLoadingLabel: R, pdfContentErrorLabel: le, pdfContentRetryLabel: z, codeContentLoadingLabel: ue, codeContentErrorLabel: B, codeContentRetryLabel: de }, onDownload: fe, onCopyText: pe, onCopyMarkdown: V, onCopyJson: me, isMobile: H = !1, defaultWidth: he, minWidth: ge = 600, maxWidth: U = 1500, onResizeStop: _e, styles: W, codeBlockTheme: ve, loadPdf: ye, configurePdfWorker: be }) => {
542
- let [G, Ce] = F(!1), [we, K] = F(!1), [Te, Ee] = F(!1), [q, De] = F(!1), J = P(null), Y = P(null), X = P(null), Oe = A(() => {
543
- pe?.(), J.current != null && clearTimeout(J.current), Ce(!0), J.current = setTimeout(() => Ce(!1), Se);
544
- }, [pe]), ke = A(() => {
545
- V?.(), Y.current != null && clearTimeout(Y.current), K(!0), Y.current = setTimeout(() => K(!1), Se);
546
- }, [V]), Z = A(() => {
547
- me?.(), X.current != null && clearTimeout(X.current), Ee(!0), X.current = setTimeout(() => Ee(!1), Se);
548
- }, [me]);
549
- M(() => () => {
594
+ }), we = 2e3, W = O(({ isOpen: e, isLoading: t = !1, onClose: n, content: a, fileName: o, labels: { ariaLabel: s, closeLabel: c = "Close", downloadLabel: l = "Download", copyTextLabel: u = "Copy text", copiedTextLabel: d = "Copied!", copyMarkdownLabel: f = "Copy as Markdown", copiedMarkdownLabel: p = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: g = "Copied!", visualizerErrorLabel: S, unsupportedLabel: C = "Preview is not supported for this file", loadErrorLabel: w = "Failed to load file", forbiddenErrorLabel: ie = "You don't have permission to access this file", htmlFrameBlockedLabel: E = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: D = "Open in new tab", htmlViewSourceLabel: O = "View source", htmlViewRenderedLabel: A = "View rendered", pdfThumbnailsLabel: M, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: ce, pdfContentLoadingLabel: le, pdfContentErrorLabel: R, pdfContentRetryLabel: ue, xlsxFormulaLabel: de, codeContentLoadingLabel: fe, codeContentErrorLabel: pe, codeContentRetryLabel: z }, onDownload: me, onCopyText: B, onCopyMarkdown: he, onCopyJson: V, isMobile: ge = !1, defaultWidth: _e, minWidth: ve = 600, maxWidth: H = 1500, onResizeStop: ye, styles: U, codeBlockTheme: be, loadPdf: xe, configurePdfWorker: Se }) => {
595
+ let [W, Te] = P(!1), [Ee, G] = P(!1), [De, K] = P(!1), [q, Oe] = P(!1), J = N(null), Y = N(null), X = N(null), ke = k(() => {
596
+ B?.(), J.current != null && clearTimeout(J.current), Te(!0), J.current = setTimeout(() => Te(!1), we);
597
+ }, [B]), Ae = k(() => {
598
+ he?.(), Y.current != null && clearTimeout(Y.current), G(!0), Y.current = setTimeout(() => G(!1), we);
599
+ }, [he]), Z = k(() => {
600
+ V?.(), X.current != null && clearTimeout(X.current), K(!0), X.current = setTimeout(() => K(!1), we);
601
+ }, [V]);
602
+ j(() => () => {
550
603
  J.current != null && clearTimeout(J.current), Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current);
551
604
  }, []);
552
- let Ae = A(() => {
553
- De((e) => !e);
605
+ let je = k(() => {
606
+ Oe((e) => !e);
554
607
  }, []);
555
- M(() => {
556
- De(!1);
608
+ j(() => {
609
+ Oe(!1);
557
610
  }, [a]);
558
- let { className: je, panelStyles: Q, ...Me } = W ?? {}, Ne = !t && a.type === i.Html && a.srcdoc != null, Pe = !t && pe != null && (a.type === i.PlainText || a.type === i.Code), $ = !t && V != null && a.type === i.Markdown, Fe = !t && me != null && a.type === i.Json, Ie = !t && fe != null && r(a);
559
- return /* @__PURE__ */ I(ee, {
611
+ let { className: Me, panelStyles: Q, ...Ne } = U ?? {}, Pe = !t && a.type === i.Html && a.srcdoc != null, Fe = !t && B != null && (a.type === i.PlainText || a.type === i.Code), $ = !t && he != null && a.type === i.Markdown, Ie = !t && V != null && a.type === i.Json, Le = !t && me != null && r(a);
612
+ return /* @__PURE__ */ I(v, {
560
613
  isOpen: e,
561
614
  orientation: _.Right,
562
615
  title: o,
@@ -565,118 +618,119 @@ var z = {
565
618
  closeLabel: c
566
619
  },
567
620
  onClose: n,
568
- resizable: !H,
569
- defaultWidth: he,
570
- minWidth: ge,
571
- maxWidth: U,
572
- onResizeStop: _e,
621
+ resizable: !ge,
622
+ defaultWidth: _e,
623
+ minWidth: ve,
624
+ maxWidth: H,
625
+ onResizeStop: ye,
573
626
  styles: {
574
627
  ...Q,
575
628
  titleClassName: Q?.titleClassName ?? "dial-h3-text",
576
629
  headerClassName: m("border-b border-tertiary", Q?.headerClassName),
577
- className: m(e ? "mobile:w-full mobile:max-w-full" : "w-0", je, Q?.className)
630
+ className: m(e ? "mobile:w-full mobile:max-w-full" : "w-0", Me, Q?.className)
578
631
  },
579
- rightActions: Ne || Pe || $ || Fe || Ie ? /* @__PURE__ */ L(se, { children: [
580
- Ne && /* @__PURE__ */ I(b, {
581
- icon: I(q ? ne : T, {
582
- size: v.LG,
583
- stroke: y,
632
+ rightActions: Pe || Fe || $ || Ie || Le ? /* @__PURE__ */ L(F, { children: [
633
+ Pe && /* @__PURE__ */ I(x, {
634
+ icon: I(q ? re : ee, {
635
+ size: y.LG,
636
+ stroke: b,
584
637
  "aria-hidden": !0
585
638
  }),
586
- "aria-label": q ? j : k,
639
+ "aria-label": q ? A : O,
587
640
  "aria-pressed": q,
588
- tooltipProps: { tooltip: q ? j : k },
589
- onClick: Ae
641
+ tooltipProps: { tooltip: q ? A : O },
642
+ onClick: je
590
643
  }),
591
- Pe && /* @__PURE__ */ I(b, {
592
- icon: I(G ? w : E, {
593
- size: v.LG,
594
- stroke: y,
644
+ Fe && /* @__PURE__ */ I(x, {
645
+ icon: I(W ? T : te, {
646
+ size: y.LG,
647
+ stroke: b,
595
648
  "aria-hidden": !0
596
649
  }),
597
- "aria-label": G ? d : u,
598
- tooltipProps: { tooltip: G ? d : u },
599
- onClick: Oe
650
+ "aria-label": W ? d : u,
651
+ tooltipProps: { tooltip: W ? d : u },
652
+ onClick: ke
600
653
  }),
601
- $ && /* @__PURE__ */ I(b, {
602
- icon: I(we ? w : ie, {
603
- size: v.LG,
604
- stroke: y,
654
+ $ && /* @__PURE__ */ I(x, {
655
+ icon: I(Ee ? T : ae, {
656
+ size: y.LG,
657
+ stroke: b,
605
658
  "aria-hidden": !0
606
659
  }),
607
- "aria-label": we ? p : f,
608
- tooltipProps: { tooltip: we ? p : f },
609
- onClick: ke
660
+ "aria-label": Ee ? p : f,
661
+ tooltipProps: { tooltip: Ee ? p : f },
662
+ onClick: Ae
610
663
  }),
611
- Fe && /* @__PURE__ */ I(b, {
612
- icon: I(Te ? w : E, {
613
- size: v.LG,
614
- stroke: y,
664
+ Ie && /* @__PURE__ */ I(x, {
665
+ icon: I(De ? T : te, {
666
+ size: y.LG,
667
+ stroke: b,
615
668
  "aria-hidden": !0
616
669
  }),
617
- "aria-label": Te ? g : h,
618
- tooltipProps: { tooltip: Te ? g : h },
670
+ "aria-label": De ? g : h,
671
+ tooltipProps: { tooltip: De ? g : h },
619
672
  onClick: Z
620
673
  }),
621
- Ie && /* @__PURE__ */ I(b, {
622
- icon: /* @__PURE__ */ I(te, {
623
- size: v.LG,
624
- stroke: y
674
+ Le && /* @__PURE__ */ I(x, {
675
+ icon: /* @__PURE__ */ I(ne, {
676
+ size: y.LG,
677
+ stroke: b
625
678
  }),
626
679
  "aria-label": l,
627
680
  tooltipProps: { tooltip: l },
628
- onClick: fe
681
+ onClick: me
629
682
  })
630
683
  ] }) : null,
631
- children: /* @__PURE__ */ I(xe, {
684
+ children: /* @__PURE__ */ I(Ce, {
632
685
  content: a,
633
686
  isLoading: t,
634
687
  fileName: o,
635
688
  isHtmlSourceView: q,
636
689
  labels: {
637
- unsupportedLabel: S,
638
- loadErrorLabel: C,
639
- forbiddenErrorLabel: re,
640
- visualizerErrorLabel: x,
641
- htmlFrameBlockedLabel: D,
642
- htmlOpenInNewTabLabel: O,
643
- pdfThumbnailsLabel: N,
644
- pdfShowThumbnailsLabel: ae,
645
- pdfHideThumbnailsLabel: oe,
690
+ unsupportedLabel: C,
691
+ loadErrorLabel: w,
692
+ forbiddenErrorLabel: ie,
693
+ visualizerErrorLabel: S,
694
+ htmlFrameBlockedLabel: E,
695
+ htmlOpenInNewTabLabel: D,
696
+ pdfThumbnailsLabel: M,
697
+ pdfShowThumbnailsLabel: oe,
698
+ pdfHideThumbnailsLabel: se,
646
699
  pdfPageNumberLabel: ce,
647
- pdfContentLoadingLabel: R,
648
- pdfContentErrorLabel: le,
649
- pdfContentRetryLabel: z,
650
- codeContentLoadingLabel: ue,
651
- codeContentErrorLabel: B,
652
- codeContentRetryLabel: de
700
+ pdfContentLoadingLabel: le,
701
+ pdfContentErrorLabel: R,
702
+ pdfContentRetryLabel: ue,
703
+ xlsxFormulaLabel: de,
704
+ codeContentLoadingLabel: fe,
705
+ codeContentErrorLabel: pe,
706
+ codeContentRetryLabel: z
653
707
  },
654
- styles: Me,
655
- codeBlockTheme: ve,
656
- loadPdf: ye,
657
- configurePdfWorker: be
708
+ styles: Ne,
709
+ codeBlockTheme: be,
710
+ loadPdf: xe,
711
+ configurePdfWorker: Se
658
712
  })
659
713
  });
660
- }), Ce = {
714
+ }), Te = {
661
715
  type: i.PlainText,
662
716
  text: ""
663
- }, we = (e) => {
717
+ }, Ee = (e) => {
664
718
  if (!(e.type !== i.Image && e.type !== i.Audio && e.type !== i.Pdf && e.type !== i.Ooxml)) return e.url.startsWith("blob:") ? e.url : void 0;
665
- }, K = D(void 0);
666
- K.displayName = "AttachmentCanvasContext";
667
- var Te = ({ children: e }) => {
668
- let [t, n] = F(!1), [r, i] = F(!1), [a, o] = F(Ce), [s, c] = F(void 0), [l, u] = F(void 0), d = A((e, t) => {
719
+ }, G = E(void 0);
720
+ G.displayName = "AttachmentCanvasContext";
721
+ var De = ({ children: e }) => {
722
+ let [t, n] = P(!1), [r, i] = P(!1), [a, o] = P(Te), [s, c] = P(void 0), [l, u] = P(void 0), d = k((e, t) => {
669
723
  c(e), u(t), i(!0), n(!0);
670
- }, []), f = A((e, t, r) => {
724
+ }, []), f = k((e, t, r) => {
671
725
  o(e), c(t), u(r), i(!1), n(!0);
672
- }, []), p = A(() => {
673
- o(Ce), n(!1), i(!1), u(void 0);
726
+ }, []), p = k(() => {
727
+ o(Te), n(!1), i(!1), u(void 0);
674
728
  }, []);
675
- return M(() => () => {
676
- let e = we(a);
729
+ return j(() => () => {
730
+ let e = Ee(a);
677
731
  e != null && URL.revokeObjectURL(e);
678
- }, [a]), /* @__PURE__ */ I(K.Provider, {
679
- value: N(() => ({
732
+ }, [a]), /* @__PURE__ */ I(G.Provider, {
733
+ value: M(() => ({
680
734
  isOpen: t,
681
735
  isLoading: r,
682
736
  content: a,
@@ -697,24 +751,24 @@ var Te = ({ children: e }) => {
697
751
  ]),
698
752
  children: e
699
753
  });
700
- }, Ee = () => {
701
- let e = j(K);
754
+ }, K = () => {
755
+ let e = A(G);
702
756
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
703
757
  return e;
704
- }, q = k(({ labels: e, isMobile: n = !1, defaultWidth: r, maxWidth: a, codeBlockTheme: o, configurePdfWorker: s }) => {
705
- let { ariaLabel: c = "Attachment preview", closeLabel: l = "Close", downloadLabel: u = "Download", unsupportedLabel: d = "Preview is not supported for this file", loadErrorLabel: f = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: h, copiedTextLabel: g, copyMarkdownLabel: _, copiedMarkdownLabel: ee, copyJsonLabel: v, copiedJsonLabel: y, htmlFrameBlockedLabel: b, htmlOpenInNewTabLabel: x, htmlViewSourceLabel: S, htmlViewRenderedLabel: C, pdfThumbnailsLabel: w, pdfShowThumbnailsLabel: T, pdfHideThumbnailsLabel: E, pdfPageNumberLabel: te, pdfContentLoadingLabel: ne, pdfContentErrorLabel: re, pdfContentRetryLabel: ie, codeContentLoadingLabel: D, codeContentErrorLabel: O, codeContentRetryLabel: k } = e ?? {}, { isOpen: j, isLoading: M, content: N, fileName: P, closeCanvas: F } = Ee(), ae = A(() => {
758
+ }, q = O(({ labels: e, isMobile: n = !1, defaultWidth: r, maxWidth: a, codeBlockTheme: o, configurePdfWorker: s }) => {
759
+ let { ariaLabel: c = "Attachment preview", closeLabel: l = "Close", downloadLabel: u = "Download", unsupportedLabel: d = "Preview is not supported for this file", loadErrorLabel: f = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: h, copiedTextLabel: g, copyMarkdownLabel: _, copiedMarkdownLabel: v, copyJsonLabel: y, copiedJsonLabel: b, htmlFrameBlockedLabel: x, htmlOpenInNewTabLabel: S, htmlViewSourceLabel: C, htmlViewRenderedLabel: w, pdfThumbnailsLabel: T, pdfShowThumbnailsLabel: ee, pdfHideThumbnailsLabel: te, pdfPageNumberLabel: ne, pdfContentLoadingLabel: re, pdfContentErrorLabel: ie, pdfContentRetryLabel: ae, xlsxFormulaLabel: E, codeContentLoadingLabel: D, codeContentErrorLabel: O, codeContentRetryLabel: A } = e ?? {}, { isOpen: j, isLoading: M, content: N, fileName: P, closeCanvas: oe } = K(), se = k(() => {
706
760
  t(N, P);
707
- }, [N, P]), oe = A(() => {
761
+ }, [N, P]), F = k(() => {
708
762
  (N.type === i.PlainText || N.type === i.Code) && p(N.text);
709
- }, [N]), se = A(() => {
763
+ }, [N]), L = k(() => {
710
764
  N.type === i.Markdown && p(N.text);
711
- }, [N]), L = A(() => {
765
+ }, [N]), ce = k(() => {
712
766
  N.type === i.Json && p(JSON.stringify(N.value, null, 2));
713
767
  }, [N]);
714
- return /* @__PURE__ */ I(G, {
768
+ return /* @__PURE__ */ I(W, {
715
769
  isOpen: j,
716
770
  isLoading: M,
717
- onClose: F,
771
+ onClose: oe,
718
772
  content: N,
719
773
  fileName: P,
720
774
  labels: {
@@ -724,71 +778,75 @@ var Te = ({ children: e }) => {
724
778
  copyTextLabel: h,
725
779
  copiedTextLabel: g,
726
780
  copyMarkdownLabel: _,
727
- copiedMarkdownLabel: ee,
728
- copyJsonLabel: v,
729
- copiedJsonLabel: y,
781
+ copiedMarkdownLabel: v,
782
+ copyJsonLabel: y,
783
+ copiedJsonLabel: b,
730
784
  unsupportedLabel: d,
731
785
  loadErrorLabel: f,
732
786
  forbiddenErrorLabel: m,
733
- htmlFrameBlockedLabel: b,
734
- htmlOpenInNewTabLabel: x,
735
- htmlViewSourceLabel: S,
736
- htmlViewRenderedLabel: C,
737
- pdfThumbnailsLabel: w,
738
- pdfShowThumbnailsLabel: T,
739
- pdfHideThumbnailsLabel: E,
740
- pdfPageNumberLabel: te,
741
- pdfContentLoadingLabel: ne,
742
- pdfContentErrorLabel: re,
743
- pdfContentRetryLabel: ie,
787
+ htmlFrameBlockedLabel: x,
788
+ htmlOpenInNewTabLabel: S,
789
+ htmlViewSourceLabel: C,
790
+ htmlViewRenderedLabel: w,
791
+ pdfThumbnailsLabel: T,
792
+ pdfShowThumbnailsLabel: ee,
793
+ pdfHideThumbnailsLabel: te,
794
+ pdfPageNumberLabel: ne,
795
+ pdfContentLoadingLabel: re,
796
+ pdfContentErrorLabel: ie,
797
+ pdfContentRetryLabel: ae,
798
+ xlsxFormulaLabel: E,
744
799
  codeContentLoadingLabel: D,
745
800
  codeContentErrorLabel: O,
746
- codeContentRetryLabel: k
801
+ codeContentRetryLabel: A
747
802
  },
748
- onDownload: ae,
749
- onCopyText: N.type === i.PlainText || N.type === i.Code ? oe : void 0,
750
- onCopyMarkdown: N.type === i.Markdown ? se : void 0,
751
- onCopyJson: N.type === i.Json ? L : void 0,
803
+ onDownload: se,
804
+ onCopyText: N.type === i.PlainText || N.type === i.Code ? F : void 0,
805
+ onCopyMarkdown: N.type === i.Markdown ? L : void 0,
806
+ onCopyJson: N.type === i.Json ? ce : void 0,
752
807
  isMobile: n,
753
808
  defaultWidth: r,
754
809
  maxWidth: a,
755
810
  codeBlockTheme: o,
756
811
  configurePdfWorker: s
757
812
  });
758
- }), De = new Set(["html", "htm"]), J = {
813
+ }), Oe = new Set(["html", "htm"]), J = {
759
814
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
760
815
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
761
816
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
762
817
  }, Y = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), X = {
763
818
  docx: n.Docx,
764
819
  xlsx: n.Xlsx,
765
- pptx: n.Pptx
766
- }, Oe = {
820
+ pptx: n.Pptx,
821
+ csv: n.Csv
822
+ }, ke = {
767
823
  [J.docx]: n.Docx,
768
824
  [J.xlsx]: n.Xlsx,
769
- [J.pptx]: n.Pptx
770
- }, ke = {
825
+ [J.pptx]: n.Pptx,
826
+ [u.CSV]: n.Csv
827
+ }, Ae = {
771
828
  [n.Docx]: J.docx,
772
829
  [n.Xlsx]: J.xlsx,
773
- [n.Pptx]: J.pptx
830
+ [n.Pptx]: J.pptx,
831
+ [n.Csv]: u.CSV
774
832
  }, Z = (e, t) => {
775
833
  let n = t?.split(";", 1)[0].trim().toLowerCase();
776
834
  if (n != null) {
777
- let e = Oe[n];
835
+ let e = ke[n];
778
836
  if (e != null) return e;
779
837
  }
780
838
  let r = e.lastIndexOf(".");
781
839
  if (r !== -1) return X[e.slice(r + 1).toLowerCase()];
782
- }, Ae = (e, t) => Z(e, t) != null, je = (e, t) => {
840
+ }, je = (e, t) => Z(e, t) != null, Me = (e, t) => {
783
841
  let n = Z(e, t);
784
- return n == null ? void 0 : ke[n];
842
+ return n == null ? void 0 : Ae[n];
785
843
  }, Q = (e) => {
786
844
  let t = e.lastIndexOf(".");
787
845
  return t === -1 ? !1 : Y.has(e.slice(t + 1).toLowerCase());
788
- }, Me = (e) => {
846
+ }, Ne = (e) => {
789
847
  let t = e.lastIndexOf(".");
790
- return t === -1 ? !1 : De.has(e.slice(t + 1).toLowerCase());
791
- }, Ne = {
848
+ return t === -1 ? !1 : Oe.has(e.slice(t + 1).toLowerCase());
849
+ }, Pe = {
792
850
  xml: "xml",
793
851
  csv: "plaintext",
794
852
  tsv: "plaintext",
@@ -836,21 +894,21 @@ var Te = ({ children: e }) => {
836
894
  gitignore: "plaintext",
837
895
  dockerfile: "plaintext",
838
896
  makefile: "plaintext"
839
- }, Pe = (e) => Ne[e], $ = (e) => ({
897
+ }, Fe = (e) => Pe[e], $ = (e) => ({
840
898
  type: i.Unsupported,
841
899
  ...e != null && { url: e }
842
- }), Fe = (t) => ({
900
+ }), Ie = (t) => ({
843
901
  type: i.Error,
844
902
  errorType: e.LoadFailed,
845
903
  ...t != null && { url: t }
846
- }), Ie = (t) => ({
904
+ }), Le = (t) => ({
847
905
  type: i.Error,
848
906
  errorType: e.Forbidden,
849
907
  ...t != null && { url: t }
850
- }), Le = (e, t) => {
908
+ }), Re = (e, t) => {
851
909
  let n = e.toLowerCase();
852
910
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
853
- }, Re = (e) => {
911
+ }, ze = (e) => {
854
912
  let t;
855
913
  try {
856
914
  t = new URL(e).pathname;
@@ -863,13 +921,13 @@ var Te = ({ children: e }) => {
863
921
  } catch {
864
922
  return n;
865
923
  }
866
- }, ze = (e, t) => {
867
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = Ee(), { customVisualizers: s, themeId: c, onBeforeOpen: d } = t, f = A(async (t, r) => {
924
+ }, Be = (e, t) => {
925
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = K(), { customVisualizers: s, themeId: c, onBeforeOpen: d } = t, f = k(async (t, r) => {
868
926
  if (t.url == null && t.referenceUrl != null) {
869
927
  let i = e.resolveReferencePdfContent(t);
870
928
  if (i != null) return n(i, t.name, r), !0;
871
929
  }
872
- let a = t.contentType.toLowerCase(), o = Le(a, s);
930
+ let a = t.contentType.toLowerCase(), o = Re(a, s);
873
931
  if (o != null) {
874
932
  let i = await e.resolveVisualizerContent(t, o, c);
875
933
  if (i != null) return n(i, t.name, r), !0;
@@ -902,7 +960,7 @@ var Te = ({ children: e }) => {
902
960
  return i == null ? !1 : (n(i, t.name, r), !0);
903
961
  }
904
962
  }
905
- let g = t.name != null && Me(t.name) || t.url != null && Me(Re(t.url));
963
+ let g = t.name != null && Ne(t.name) || t.url != null && Ne(ze(t.url));
906
964
  if (t.name != null && !Q(t.name) && !g) return n($(e.resolveContentUrl(t)), t.name, r), !0;
907
965
  if (g) {
908
966
  let a = await e.resolveHtmlContent(t);
@@ -911,7 +969,7 @@ var Te = ({ children: e }) => {
911
969
  url: t.url
912
970
  }, t.name, r), !0) : (n(a, t.name, r), !0);
913
971
  }
914
- let _ = await e.resolveCodeContent(t, Pe(m));
972
+ let _ = await e.resolveCodeContent(t, Fe(m));
915
973
  return _ == null ? !1 : (n(_, t.name, r), !0);
916
974
  }, [
917
975
  n,
@@ -919,7 +977,7 @@ var Te = ({ children: e }) => {
919
977
  c,
920
978
  e
921
979
  ]);
922
- return { openAttachmentCanvas: A(async (t, s = t.id) => {
980
+ return { openAttachmentCanvas: k(async (t, s = t.id) => {
923
981
  switch (t.type) {
924
982
  case o.Image: {
925
983
  let r = e.resolveImageContent(t);
@@ -956,4 +1014,4 @@ var Te = ({ children: e }) => {
956
1014
  ]) };
957
1015
  };
958
1016
  //#endregion
959
- export { G as AttachmentCanvas, xe as AttachmentCanvasBody, q as AttachmentCanvasContainer, Te as AttachmentCanvasProvider, i as AttachmentContentType, e as AttachmentErrorType, de as CodeContent, n as OoxmlFileType, Ie as createForbiddenCanvasContent, Fe as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, t as downloadAttachmentContent, Pe as extensionToLanguage, Le as findVisualizerForMime, Z as getOoxmlFileType, je as getOoxmlMimeType, r as isDownloadable, Me as isHtmlPreviewable, Ae as isOoxmlPreviewable, Q as isTextPreviewable, Ee as useAttachmentCanvas, ze as useOpenAttachmentCanvas };
1017
+ export { W as AttachmentCanvas, Ce as AttachmentCanvasBody, q as AttachmentCanvasContainer, De as AttachmentCanvasProvider, i as AttachmentContentType, e as AttachmentErrorType, pe as CodeContent, n as OoxmlFileType, Le as createForbiddenCanvasContent, Ie as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, t as downloadAttachmentContent, Fe as extensionToLanguage, Re as findVisualizerForMime, Z as getOoxmlFileType, Me as getOoxmlMimeType, r as isDownloadable, Ne as isHtmlPreviewable, je as isOoxmlPreviewable, Q as isTextPreviewable, K as useAttachmentCanvas, Be as useOpenAttachmentCanvas };