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

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