@epam/ai-dial-attachment-canvas 1.2.0-dev.213 → 1.2.0-dev.218

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.
package/index.js CHANGED
@@ -3,41 +3,41 @@ import { i as a, o, t as s } from "./LazyContentBoundary-tNE1ExbI.js";
3
3
  import { AttachmentType as c, CodeBlockTheme as l, DEFAULT_MARKDOWN_CLASS_NAMES as u, FileExtension as d, MIMEType as f, MarkdownRenderer as p, buildCssVars as m, copyToClipboard as h, mergeClasses as g, restrainedSyntaxTheme as _, stripUrlQueryAndFragment as v } from "@epam/ai-dial-chat-shared";
4
4
  import { SidebarOrientation as y, SidebarPanel as b } from "@epam/ai-dial-sidebar";
5
5
  import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, GhostIconButton as w, LinkButton as T, Spinner as E } from "@epam/ai-dial-ui-kit";
6
- import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
7
- import { createContext as se, lazy as A, memo as j, useCallback as M, useContext as N, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
8
- import { JsonView as ce, defaultStyles as R } from "react-json-view-lite";
9
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
10
- import { AppBridge as H, AppFrame as U } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as le } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnectorRequests as ue } from "@epam/ai-dial-shared";
13
- import { VisualizerConnector as de } from "@epam/ai-dial-visualizer-connector";
6
+ import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as A, IconDownload as te, IconEye as ne, IconLock as re, IconMarkdown as ie, IconRefresh as ae } from "@tabler/icons-react";
7
+ import { createContext as oe, lazy as j, memo as M, useCallback as N, useContext as P, useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
8
+ import { JsonView as se, defaultStyles as z } from "react-json-view-lite";
9
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
10
+ import { AppBridge as U, AppFrame as W } from "@mcp-ui/client";
11
+ import { McpUiHostContextChangedNotificationSchema as ce } from "@modelcontextprotocol/ext-apps/app-bridge";
12
+ import { VisualizerConnectorRequests as le } from "@epam/ai-dial-shared";
13
+ import { VisualizerConnector as ue } from "@epam/ai-dial-visualizer-connector";
14
14
  //#region src/constants/public-class-names.ts
15
- var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
15
+ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
16
16
  container: "_container_1nhig_1",
17
17
  containerLight: "_containerLight_1nhig_5"
18
- }, me = {
18
+ }, pe = {
19
19
  [l.Dark]: _,
20
20
  [l.Light]: _
21
- }, W = () => A(async () => {
21
+ }, G = () => j(async () => {
22
22
  let { Prism: e } = await import("react-syntax-highlighter");
23
23
  return { default: e };
24
- }), he = j(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
- let { text: r, language: i } = e, a = i == null || i === "plaintext", o = me[t], c = t === l.Light, [u, d] = L(0), f = F(W, [u]), p = M(() => {
24
+ }), me = M(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
25
+ let { text: r, language: i } = e, a = i == null || i === "plaintext", o = pe[t], c = t === l.Light, [u, d] = R(0), f = I(G, [u]), p = N(() => {
26
26
  d((e) => e + 1);
27
- }, []), m = /* @__PURE__ */ B("pre", {
27
+ }, []), m = /* @__PURE__ */ V("pre", {
28
28
  className: "whitespace-pre-wrap break-words p-4",
29
29
  children: r
30
30
  });
31
- return /* @__PURE__ */ B("div", {
31
+ return /* @__PURE__ */ V("div", {
32
32
  dir: "ltr",
33
- className: g("h-full overflow-auto", pe.container, c && pe.containerLight),
34
- children: a ? m : /* @__PURE__ */ B(s, {
33
+ className: g("h-full overflow-auto", fe.container, c && fe.containerLight),
34
+ children: a ? m : /* @__PURE__ */ V(s, {
35
35
  retryKey: u,
36
36
  onRetry: p,
37
37
  pendingContent: m,
38
38
  errorContent: m,
39
39
  labels: n,
40
- children: /* @__PURE__ */ B(f, {
40
+ children: /* @__PURE__ */ V(f, {
41
41
  language: i,
42
42
  style: o,
43
43
  customStyle: {
@@ -54,62 +54,87 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
54
54
  })
55
55
  })
56
56
  });
57
- }), ge = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, _e = j(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
58
- let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = L(!0), [d, f] = L(!1), p = I(null);
59
- P(() => {
60
- u(!0), f(!1);
57
+ }), he = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ge = M(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
58
+ let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = R(!0), [d, f] = R(!1), [p, m] = R(void 0), [h, _] = R(!1), [v, y] = R(!1), b = L(null);
59
+ F(() => {
60
+ u(!0), f(!1), m(void 0), _(!1), y(!1);
61
61
  }, [e]);
62
- let m = M((t) => {
63
- if (u(!1), e.srcdoc == null) try {
64
- p.current?.contentDocument ?? f(!0);
62
+ let x = L(n);
63
+ x.current !== n && (x.current = n, n && v && y(!1)), F(() => {
64
+ if (!n || e.srcdoc != null || e.resolveSourceText == null || p != null) return;
65
+ let t = !1, r = e.resolveSourceText;
66
+ return (async () => {
67
+ _(!0);
68
+ try {
69
+ let e = await r();
70
+ t || m(e);
71
+ } catch {
72
+ t || y(!0);
73
+ } finally {
74
+ t || _(!1);
75
+ }
76
+ })(), () => {
77
+ t = !0;
78
+ };
79
+ }, [
80
+ n,
81
+ e,
82
+ p
83
+ ]);
84
+ let S = e.isSameOriginUrl === !0 && e.url != null, C = !S && e.srcdoc != null, w = N((e) => {
85
+ if (u(!1), !(C || S)) try {
86
+ b.current?.contentDocument ?? f(!0);
65
87
  } catch {
66
88
  f(!0);
67
89
  }
68
- }, [e.srcdoc]), h = M(() => {
90
+ }, [C, S]), D = N(() => {
69
91
  u(!1), f(!0);
70
- }, []);
71
- if (n && e.srcdoc != null) return /* @__PURE__ */ B(he, {
92
+ }, []), O = e.srcdoc ?? p, k = e.srcdoc != null || e.resolveSourceText != null, ee = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
93
+ if (n && k && (O != null || h || ee)) return O == null ? /* @__PURE__ */ V("div", {
94
+ className: "flex h-full items-center justify-center",
95
+ children: /* @__PURE__ */ V(E, {})
96
+ }) : /* @__PURE__ */ V(me, {
72
97
  content: {
73
98
  type: i.Code,
74
- text: e.srcdoc,
99
+ text: O,
75
100
  language: "html"
76
101
  },
77
102
  codeBlockTheme: a
78
103
  });
79
- if (d) return /* @__PURE__ */ V("div", {
104
+ if (d) return /* @__PURE__ */ H("div", {
80
105
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
81
- children: [/* @__PURE__ */ B("p", {
106
+ children: [/* @__PURE__ */ V("p", {
82
107
  className: "text-center",
83
108
  children: s
84
- }), e.url != null && /* @__PURE__ */ B(T, {
109
+ }), e.url != null && /* @__PURE__ */ V(T, {
85
110
  href: e.url,
86
111
  target: "_blank",
87
112
  label: c,
88
- className: ge.openInNewTabButton,
113
+ className: he.openInNewTabButton,
89
114
  textClassName: o
90
115
  })]
91
116
  });
92
- let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
93
- return /* @__PURE__ */ V("div", {
117
+ let A = C ? void 0 : e.url, te = C ? e.srcdoc : void 0;
118
+ return /* @__PURE__ */ H("div", {
94
119
  className: "relative h-full",
95
- children: [l && /* @__PURE__ */ B("div", {
120
+ children: [l && /* @__PURE__ */ V("div", {
96
121
  className: "absolute inset-0 flex items-center justify-center",
97
- children: /* @__PURE__ */ B(E, {})
98
- }), /* @__PURE__ */ B("iframe", {
99
- ref: p,
122
+ children: /* @__PURE__ */ V(E, {})
123
+ }), /* @__PURE__ */ V("iframe", {
124
+ ref: b,
100
125
  title: r,
101
- src: v,
102
- srcDoc: y,
103
- sandbox: _ ? "allow-scripts" : "allow-scripts allow-same-origin",
126
+ src: A,
127
+ srcDoc: te,
128
+ sandbox: C || S ? "allow-scripts" : "allow-scripts allow-same-origin",
104
129
  className: g("h-full w-full border-none", l ? "invisible" : ""),
105
- onLoad: m,
106
- onError: h
130
+ onLoad: w,
131
+ onError: D
107
132
  })]
108
133
  });
109
- }), ve = {
134
+ }), _e = {
110
135
  name: "MCP-UI Host",
111
136
  version: "1.0.0"
112
- }, ye = { openLinks: {} }, be = (e) => {
137
+ }, ve = { openLinks: {} }, ye = (e) => {
113
138
  let t;
114
139
  try {
115
140
  t = new URL(e);
@@ -123,20 +148,20 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
123
148
  return !1;
124
149
  }
125
150
  return !0;
126
- }, xe = (e, t, n) => {
151
+ }, be = (e, t, n) => {
127
152
  if (n) {
128
153
  e.style.maxWidth = "", e.style.maxHeight = "";
129
154
  return;
130
155
  }
131
156
  let r = t;
132
157
  r != null && (r.width != null && (e.style.width = `${r.width}px`), r.maxWidth != null && (e.style.maxWidth = `${r.maxWidth}px`), r.height != null && (e.style.height = `${r.height}px`), r.maxHeight != null && (e.style.maxHeight = `${r.maxHeight}px`));
133
- }, Se = (e, t, n) => {
134
- let r = I(e);
135
- P(() => {
158
+ }, xe = (e, t, n) => {
159
+ let r = L(e);
160
+ F(() => {
136
161
  r.current = e;
137
162
  });
138
- let [i, a] = L(null), [o, s] = L(!1);
139
- return P(() => {
163
+ let [i, a] = R(null), [o, s] = R(!1);
164
+ return F(() => {
140
165
  let e = null;
141
166
  try {
142
167
  let n = t.current?.getBoundingClientRect(), i = n != null && n.width > 0 && n.height > 0 ? {
@@ -146,15 +171,15 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
146
171
  height: Math.round(n.height)
147
172
  }
148
173
  } : r.current.hostContext;
149
- e = new H(null, r.current.hostInfo ?? ve, ye, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
174
+ e = new U(null, r.current.hostInfo ?? _e, ve, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
150
175
  let t = r.current.onOpenLink;
151
- return (t == null ? be(e) : t(e)) === !1 ? { isError: !0 } : {};
176
+ return (t == null ? ye(e) : t(e)) === !1 ? { isError: !0 } : {};
152
177
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
153
178
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
154
179
  return { mode: t?.(e) ?? n };
155
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(le, ({ params: e }) => {
180
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(ce, ({ params: e }) => {
156
181
  let n = t.current?.querySelector("iframe");
157
- n != null && xe(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
182
+ n != null && be(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
158
183
  }), a(e);
159
184
  } catch (e) {
160
185
  console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
@@ -162,22 +187,22 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
162
187
  return () => {
163
188
  e?.close().catch((e) => console.error("[useMcpAppBridge] Error closing AppBridge:", e));
164
189
  };
165
- }, [t]), P(() => {
190
+ }, [t]), F(() => {
166
191
  i != null && i.transport != null && n != null && i.setHostContext(n);
167
192
  }, [i, n]), {
168
193
  appBridge: i,
169
194
  hasFailed: o
170
195
  };
171
- }, G = {
196
+ }, K = {
172
197
  loadingOverlay: "_loadingOverlay_iea4a_2",
173
198
  fullscreenFrame: "_fullscreenFrame_iea4a_21",
174
199
  loadingFrame: "_loadingFrame_iea4a_29",
175
200
  statusLabel: "_statusLabel_iea4a_33",
176
201
  statusDetail: "_statusDetail_iea4a_38",
177
202
  errorIcon: "_errorIcon_iea4a_42"
178
- }, Ce = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
179
- let [r, i] = L("loading"), [a, o] = L(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = F(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = I(null), [h, _] = L();
180
- P(() => {
203
+ }, Se = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
204
+ let [r, i] = R("loading"), [a, o] = R(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = I(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = L(null), [h, _] = R();
205
+ F(() => {
181
206
  let e = m.current;
182
207
  if (!e) return;
183
208
  let t = new ResizeObserver(([e]) => {
@@ -190,15 +215,15 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
190
215
  });
191
216
  return t.observe(e), () => t.disconnect();
192
217
  }, []);
193
- let { appBridge: v, hasFailed: y } = Se(e, m, F(() => d == null || h == null ? d : {
218
+ let { appBridge: v, hasFailed: y } = xe(e, m, I(() => d == null || h == null ? d : {
194
219
  ...d,
195
220
  containerDimensions: h
196
221
  }, [d, h])), b = y || r === "error";
197
- return /* @__PURE__ */ V("div", {
222
+ return /* @__PURE__ */ H("div", {
198
223
  ref: m,
199
- className: g("relative h-full min-h-[200px] w-full", p && G.fullscreenFrame, !p && r === "loading" && G.loadingFrame),
224
+ className: g("relative h-full min-h-[200px] w-full", p && K.fullscreenFrame, !p && r === "loading" && K.loadingFrame),
200
225
  children: [
201
- v != null && !b && /* @__PURE__ */ B(U, {
226
+ v != null && !b && /* @__PURE__ */ V(W, {
202
227
  html: s,
203
228
  sandbox: f,
204
229
  appBridge: v,
@@ -212,29 +237,29 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
212
237
  o(e.message), i("error");
213
238
  }
214
239
  }),
215
- !b && r === "loading" && /* @__PURE__ */ B("div", {
216
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", G.loadingOverlay),
217
- children: /* @__PURE__ */ B(E, {})
240
+ !b && r === "loading" && /* @__PURE__ */ V("div", {
241
+ className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", K.loadingOverlay),
242
+ children: /* @__PURE__ */ V(E, {})
218
243
  }),
219
- b && /* @__PURE__ */ V("div", {
244
+ b && /* @__PURE__ */ H("div", {
220
245
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
221
- children: [/* @__PURE__ */ B(D, {
246
+ children: [/* @__PURE__ */ V(D, {
222
247
  size: 60,
223
248
  stroke: S,
224
249
  "aria-hidden": !0,
225
- className: G.errorIcon
226
- }), /* @__PURE__ */ V("p", {
250
+ className: K.errorIcon
251
+ }), /* @__PURE__ */ H("p", {
227
252
  role: "alert",
228
- className: g("text-center", G.statusLabel),
229
- children: [t, a && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("br", {}), /* @__PURE__ */ B("span", {
230
- className: G.statusDetail,
253
+ className: g("text-center", K.statusLabel),
254
+ children: [t, a && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("br", {}), /* @__PURE__ */ V("span", {
255
+ className: K.statusDetail,
231
256
  children: a
232
257
  })] })]
233
258
  })]
234
259
  })
235
260
  ]
236
261
  });
237
- }, K = {
262
+ }, q = {
238
263
  viewer: "_viewer_1w97n_2",
239
264
  spreadsheetCanvas: "_spreadsheetCanvas_1w97n_6",
240
265
  formulaPanel: "_formulaPanel_1w97n_12",
@@ -242,13 +267,13 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
242
267
  statusOverlay: "_statusOverlay_1w97n_24",
243
268
  errorIcon: "_errorIcon_1w97n_29",
244
269
  highlight: "_highlight_1w97n_37"
245
- }, we = (e) => {
270
+ }, Ce = (e) => {
246
271
  if (e?.kind !== "range") return "";
247
272
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
248
273
  if (n == null) return "";
249
274
  let r = n.formula;
250
275
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
251
- }, Te = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
276
+ }, we = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
252
277
  switch (t) {
253
278
  case r.Docx: {
254
279
  let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
@@ -270,7 +295,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
270
295
  }
271
296
  case r.Csv: {
272
297
  let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
273
- r.className = K.spreadsheetCanvas, e.replaceChildren(r);
298
+ r.className = q.spreadsheetCanvas, e.replaceChildren(r);
274
299
  let i = new t(r, {
275
300
  showScrollbars: !0,
276
301
  onError: n
@@ -294,7 +319,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
294
319
  });
295
320
  }
296
321
  }
297
- }, Ee = async (e, t, n, i) => {
322
+ }, Te = async (e, t, n, i) => {
298
323
  let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
299
324
  switch (t.format) {
300
325
  case r.Docx: {
@@ -303,7 +328,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
303
328
  import("@silurus/ooxml/chart-ex"),
304
329
  import("./ooxml-highlight-surfaces-BzgOKpBV.js")
305
330
  ]), l = await n.load(t.url, { chartEx: o });
306
- if (i()) throw l.destroy(), new De();
331
+ if (i()) throw l.destroy(), new Ee();
307
332
  let u = r.fromDocument(e, l, {
308
333
  enableTextSelection: !0,
309
334
  refitOnResize: !0,
@@ -323,7 +348,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
323
348
  import("@silurus/ooxml/chart-ex"),
324
349
  import("./ooxml-highlight-surfaces-BzgOKpBV.js")
325
350
  ]), l = await n.load(t.url, { chartEx: o });
326
- if (i()) throw l.destroy(), new De();
351
+ if (i()) throw l.destroy(), new Ee();
327
352
  let u = r.fromPresentation(e, l, {
328
353
  enableTextSelection: !0,
329
354
  refitOnResize: !0,
@@ -357,15 +382,15 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
357
382
  };
358
383
  }
359
384
  case r.Csv: {
360
- let r = await Te(e, t.format, n);
385
+ let r = await we(e, t.format, n);
361
386
  return await r.load(t.url), { viewer: r };
362
387
  }
363
388
  }
364
- }, De = class extends Error {}, Oe = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
365
- let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = I(void 0), O = I(x);
389
+ }, Ee = class extends Error {}, De = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
390
+ let l = L(null), [u, d] = R(!0), [f, p] = R(!1), [m, h] = R(""), [_, v] = R([]), [y, b] = R(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = L(void 0), O = L(x);
366
391
  O.current = x;
367
- let k = I(void 0);
368
- return P(() => {
392
+ let k = L(void 0);
393
+ return F(() => {
369
394
  let e = l.current;
370
395
  if (e == null) return;
371
396
  let n, r, i = !1, a, o = () => i;
@@ -387,7 +412,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
387
412
  i || (d(!1), p(!0));
388
413
  },
389
414
  onXlsxSelectionContextChange: (e) => {
390
- i || h(we(e));
415
+ i || h(Ce(e));
391
416
  },
392
417
  onGeometryInvalidated: s
393
418
  }, f = () => {
@@ -398,14 +423,14 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
398
423
  return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
399
424
  try {
400
425
  if (w) {
401
- let r = await Ee(e, t, u, o);
426
+ let r = await Te(e, t, u, o);
402
427
  if (i) {
403
428
  r.viewer.destroy(), r.engine?.destroy();
404
429
  return;
405
430
  }
406
431
  n = r, T.current = r.highlights, f();
407
432
  } else {
408
- let r = await Te(e, t.format, u);
433
+ let r = await we(e, t.format, u);
409
434
  if (i) {
410
435
  r.destroy();
411
436
  return;
@@ -416,7 +441,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
416
441
  if (i) return;
417
442
  d(!1), await c();
418
443
  } catch (t) {
419
- if (t instanceof De || i) return;
444
+ if (t instanceof Ee || i) return;
420
445
  n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
421
446
  }
422
447
  })(), () => {
@@ -426,9 +451,9 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
426
451
  t.format,
427
452
  t.url,
428
453
  w
429
- ]), P(() => {
454
+ ]), F(() => {
430
455
  k.current?.();
431
- }, [x]), P(() => {
456
+ }, [x]), F(() => {
432
457
  b(!1);
433
458
  let t = T.current;
434
459
  if (t == null || u) return;
@@ -446,38 +471,38 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
446
471
  })(), () => {
447
472
  r = !0;
448
473
  };
449
- }, [C, u]), /* @__PURE__ */ V("div", {
474
+ }, [C, u]), /* @__PURE__ */ H("div", {
450
475
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
451
476
  children: [
452
- t.format === r.Xlsx && /* @__PURE__ */ V("div", {
477
+ t.format === r.Xlsx && /* @__PURE__ */ H("div", {
453
478
  role: "region",
454
479
  "aria-label": a,
455
- className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", K.formulaPanel),
456
- children: [/* @__PURE__ */ B("span", {
480
+ className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", q.formulaPanel),
481
+ children: [/* @__PURE__ */ V("span", {
457
482
  "aria-hidden": "true",
458
483
  className: g("shrink-0", o),
459
484
  children: "fx"
460
- }), /* @__PURE__ */ B("code", {
485
+ }), /* @__PURE__ */ V("code", {
461
486
  dir: "ltr",
462
487
  tabIndex: 0,
463
488
  "aria-live": "polite",
464
- className: g("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", K.formulaValue),
489
+ className: g("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", q.formulaValue),
465
490
  children: m
466
491
  })]
467
492
  }),
468
- /* @__PURE__ */ V("div", {
493
+ /* @__PURE__ */ H("div", {
469
494
  className: "relative min-h-0 w-full flex-1",
470
- children: [/* @__PURE__ */ B("div", {
495
+ children: [/* @__PURE__ */ V("div", {
471
496
  ref: l,
472
497
  role: "document",
473
498
  "aria-label": n,
474
499
  "aria-busy": u,
475
- className: g("h-full w-full overflow-hidden", K.viewer)
476
- }), _.length > 0 && /* @__PURE__ */ B("div", {
500
+ className: g("h-full w-full overflow-hidden", q.viewer)
501
+ }), _.length > 0 && /* @__PURE__ */ V("div", {
477
502
  role: "region",
478
503
  "aria-label": s,
479
504
  className: "pointer-events-none absolute inset-0 overflow-hidden",
480
- children: _.map((e, t) => /* @__PURE__ */ B("div", {
505
+ children: _.map((e, t) => /* @__PURE__ */ V("div", {
481
506
  "aria-hidden": "true",
482
507
  style: {
483
508
  left: `${e.left}px`,
@@ -487,28 +512,28 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
487
512
  },
488
513
  "data-selected": e.highlightId === C,
489
514
  "data-clipped": e.isClippedAtEnd === !0,
490
- className: g("absolute", K.highlight)
515
+ className: g("absolute", q.highlight)
491
516
  }, `${e.highlightId}-${t}`))
492
517
  })]
493
518
  }),
494
- /* @__PURE__ */ B("div", {
519
+ /* @__PURE__ */ V("div", {
495
520
  role: "status",
496
521
  "aria-live": "polite",
497
522
  className: "sr-only",
498
523
  children: y ? c : ""
499
524
  }),
500
- (u || f) && /* @__PURE__ */ B("div", {
525
+ (u || f) && /* @__PURE__ */ V("div", {
501
526
  role: f ? "alert" : void 0,
502
527
  "aria-live": "polite",
503
- className: g("absolute inset-0 flex items-center justify-center", K.statusOverlay),
504
- children: u ? /* @__PURE__ */ B(E, { size: 48 }) : /* @__PURE__ */ V("div", {
528
+ className: g("absolute inset-0 flex items-center justify-center", q.statusOverlay),
529
+ children: u ? /* @__PURE__ */ V(E, { size: 48 }) : /* @__PURE__ */ H("div", {
505
530
  className: "flex flex-col items-center gap-2",
506
- children: [/* @__PURE__ */ B(D, {
531
+ children: [/* @__PURE__ */ V(D, {
507
532
  "aria-hidden": "true",
508
533
  size: 60,
509
534
  stroke: S,
510
- className: K.errorIcon
511
- }), /* @__PURE__ */ B("p", {
535
+ className: q.errorIcon
536
+ }), /* @__PURE__ */ V("p", {
512
537
  className: "text-center",
513
538
  children: i
514
539
  })]
@@ -516,17 +541,17 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
516
541
  })
517
542
  ]
518
543
  });
519
- }, ke = {
544
+ }, Oe = {
520
545
  loadingOverlay: "_loadingOverlay_12637_1",
521
546
  statusLabel: "_statusLabel_12637_5",
522
547
  errorIcon: "_errorIcon_12637_9"
523
- }, Ae = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
524
- let o = I(null), [s, c] = L("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = I(e);
525
- return f.current = e, P(() => {
548
+ }, ke = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
549
+ let o = L(null), [s, c] = R("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = L(e);
550
+ return f.current = e, F(() => {
526
551
  let e = o.current;
527
552
  if (!e) return;
528
553
  c("loading");
529
- let t = new de(e, {
554
+ let t = new ue(e, {
530
555
  domain: l,
531
556
  hostDomain: window.location.origin,
532
557
  visualizerName: u,
@@ -535,7 +560,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
535
560
  return (async () => {
536
561
  if (await t.ready(), !n) return;
537
562
  let e = f.current;
538
- if (e.type === i.GroupedVisualizer) await t.send(ue.sendGroupedVisualizeData, {
563
+ if (e.type === i.GroupedVisualizer) await t.send(le.sendGroupedVisualizeData, {
539
564
  attachments: e.attachments,
540
565
  layout: e.layout
541
566
  });
@@ -544,7 +569,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
544
569
  layout: r,
545
570
  ...typeof i == "object" && i ? i : {}
546
571
  };
547
- await t.send(ue.sendVisualizeData, {
572
+ await t.send(le.sendVisualizeData, {
548
573
  mimeType: n,
549
574
  visualizerData: a
550
575
  });
@@ -559,7 +584,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
559
584
  l,
560
585
  u,
561
586
  d
562
- ]), P(() => {
587
+ ]), F(() => {
563
588
  let e = r ?? u.trim();
564
589
  e !== "" && o.current?.querySelector("iframe")?.setAttribute("title", e);
565
590
  }, [
@@ -567,7 +592,7 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
567
592
  u,
568
593
  l,
569
594
  d
570
- ]), /* @__PURE__ */ V("div", {
595
+ ]), /* @__PURE__ */ H("div", {
571
596
  className: "relative h-full w-full",
572
597
  style: m({
573
598
  "--vs-loading-bg": a?.loadingBackground,
@@ -575,33 +600,33 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
575
600
  "--vs-error-icon": a?.errorIcon
576
601
  }),
577
602
  children: [
578
- /* @__PURE__ */ B("div", {
603
+ /* @__PURE__ */ V("div", {
579
604
  ref: o,
580
605
  className: "h-full w-full"
581
606
  }),
582
- s === "loading" && /* @__PURE__ */ V("div", {
583
- className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", ke.loadingOverlay),
584
- children: [/* @__PURE__ */ B(E, {}), t && /* @__PURE__ */ B("p", {
585
- className: g("text-center", ke.statusLabel),
607
+ s === "loading" && /* @__PURE__ */ H("div", {
608
+ className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", Oe.loadingOverlay),
609
+ children: [/* @__PURE__ */ V(E, {}), t && /* @__PURE__ */ V("p", {
610
+ className: g("text-center", Oe.statusLabel),
586
611
  children: t
587
612
  })]
588
613
  }),
589
- s === "error" && /* @__PURE__ */ V("div", {
614
+ s === "error" && /* @__PURE__ */ H("div", {
590
615
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
591
- children: [/* @__PURE__ */ B(D, {
616
+ children: [/* @__PURE__ */ V(D, {
592
617
  size: 60,
593
618
  stroke: S,
594
619
  "aria-hidden": !0,
595
- className: ke.errorIcon
596
- }), /* @__PURE__ */ B("p", {
620
+ className: Oe.errorIcon
621
+ }), /* @__PURE__ */ V("p", {
597
622
  role: "alert",
598
- className: g("text-center", ke.statusLabel),
623
+ className: g("text-center", Oe.statusLabel),
599
624
  children: n
600
625
  })]
601
626
  })
602
627
  ]
603
628
  });
604
- }, q = {
629
+ }, J = {
605
630
  body: "_body_13ogb_4",
606
631
  statusLabel: "_statusLabel_13ogb_13",
607
632
  errorIcon: "_errorIcon_13ogb_17",
@@ -616,66 +641,66 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
616
641
  jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
617
642
  jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
618
643
  jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
619
- }, je = () => A(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Me = ({ url: e, fileName: t, loadErrorLabel: n }) => {
620
- let [r, i] = L(!1);
621
- return P(() => {
644
+ }, Ae = () => j(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), je = ({ url: e, fileName: t, loadErrorLabel: n }) => {
645
+ let [r, i] = R(!1);
646
+ return F(() => {
622
647
  i(!1);
623
- }, [e]), r ? /* @__PURE__ */ V("div", {
648
+ }, [e]), r ? /* @__PURE__ */ H("div", {
624
649
  className: "flex flex-col items-center gap-2",
625
- children: [/* @__PURE__ */ B(D, {
650
+ children: [/* @__PURE__ */ V(D, {
626
651
  size: 60,
627
652
  stroke: S,
628
- className: q.errorIcon
629
- }), /* @__PURE__ */ B("p", {
630
- className: g("text-center", q.statusLabel),
653
+ className: J.errorIcon
654
+ }), /* @__PURE__ */ V("p", {
655
+ className: g("text-center", J.statusLabel),
631
656
  children: n
632
657
  })]
633
- }) : /* @__PURE__ */ B("img", {
658
+ }) : /* @__PURE__ */ V("img", {
634
659
  src: e,
635
660
  alt: t ?? "",
636
661
  className: "max-h-full max-w-full object-contain",
637
662
  onError: () => i(!0)
638
663
  });
639
- }, Ne = new Set([
664
+ }, Me = new Set([
640
665
  i.PlainText,
641
666
  i.Code,
642
667
  i.Ooxml
643
- ]), Pe = j(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: te, tableCopiedLabel: ne, tableDownloadCsvLabel: re, ooxmlHighlightsLabel: ae, ooxmlHighlightNavigatedLabel: oe } = {}, styles: se, codeBlockTheme: A, tableDownloadFilename: j, loadPdf: N, hidePdfToolbar: P = !1, configurePdfWorker: I, onAppInfo: z }) => {
644
- let { colors: H, typography: U, bodyClassName: le, cssVars: ue } = se ?? {}, [de, fe] = L(0), pe = F(je, [de]), me = M(() => {
645
- fe((e) => e + 1);
646
- }, []), W = U?.fontClassName != null, ge = F(() => ({
668
+ ]), Ne = M(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: A, tableCopiedLabel: te, tableDownloadCsvLabel: ne, ooxmlHighlightsLabel: ie, ooxmlHighlightNavigatedLabel: ae } = {}, styles: oe, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: P, hidePdfToolbar: F = !1, configurePdfWorker: L, onAppInfo: B }) => {
669
+ let { colors: U, typography: W, bodyClassName: ce, cssVars: le } = oe ?? {}, [ue, de] = R(0), fe = I(Ae, [ue]), pe = N(() => {
670
+ de((e) => e + 1);
671
+ }, []), G = W?.fontClassName != null, he = I(() => ({
647
672
  ...m({
648
- "--ac-text": H?.text,
649
- "--ac-status-text": H?.statusText,
650
- "--ac-error-icon": H?.errorIcon,
651
- "--ac-open-in-new-tab-text": H?.openInNewTabText,
652
- "--ac-json-border": H?.jsonBorder,
653
- "--ac-json-bg": H?.jsonBackground,
654
- "--ac-json-label": H?.jsonLabel,
655
- "--ac-json-clickable-label": H?.jsonClickableLabel,
656
- "--ac-json-punctuation": H?.jsonPunctuation,
657
- "--ac-json-string": H?.jsonString,
658
- "--ac-json-number": H?.jsonNumber,
659
- "--ac-json-boolean": H?.jsonBoolean,
660
- "--ac-json-null": H?.jsonNull,
661
- "--ac-json-toggle-icon": H?.jsonToggleIcon,
662
- "--ac-json-toggle-icon-hover": H?.jsonToggleIconHover,
663
- "--ac-ooxml-bg": H?.ooxmlBackground,
664
- "--ac-ooxml-formula-border": H?.ooxmlFormulaBorder,
665
- "--ac-ooxml-formula-bg": H?.ooxmlFormulaBackground,
666
- "--ac-ooxml-formula-text": H?.ooxmlFormulaText,
667
- "--ac-ooxml-highlight-border": H?.ooxmlHighlightBorder,
668
- "--ac-ooxml-highlight-bg": H?.ooxmlHighlightBackground,
669
- "--ac-json-collapsed-text": H?.jsonCollapsedText,
670
- "--ac-json-collapsed-bg": H?.jsonCollapsedBackground,
671
- "--ac-font-family": W ? void 0 : U?.fontFamily,
672
- "--ac-font-size": W ? void 0 : U?.fontSize,
673
- "--ac-font-weight": W ? void 0 : U?.fontWeight,
674
- "--ac-line-height": W ? void 0 : U?.lineHeight,
675
- "--ac-letter-spacing": W ? void 0 : U?.letterSpacing
673
+ "--ac-text": U?.text,
674
+ "--ac-status-text": U?.statusText,
675
+ "--ac-error-icon": U?.errorIcon,
676
+ "--ac-open-in-new-tab-text": U?.openInNewTabText,
677
+ "--ac-json-border": U?.jsonBorder,
678
+ "--ac-json-bg": U?.jsonBackground,
679
+ "--ac-json-label": U?.jsonLabel,
680
+ "--ac-json-clickable-label": U?.jsonClickableLabel,
681
+ "--ac-json-punctuation": U?.jsonPunctuation,
682
+ "--ac-json-string": U?.jsonString,
683
+ "--ac-json-number": U?.jsonNumber,
684
+ "--ac-json-boolean": U?.jsonBoolean,
685
+ "--ac-json-null": U?.jsonNull,
686
+ "--ac-json-toggle-icon": U?.jsonToggleIcon,
687
+ "--ac-json-toggle-icon-hover": U?.jsonToggleIconHover,
688
+ "--ac-ooxml-bg": U?.ooxmlBackground,
689
+ "--ac-ooxml-formula-border": U?.ooxmlFormulaBorder,
690
+ "--ac-ooxml-formula-bg": U?.ooxmlFormulaBackground,
691
+ "--ac-ooxml-formula-text": U?.ooxmlFormulaText,
692
+ "--ac-ooxml-highlight-border": U?.ooxmlHighlightBorder,
693
+ "--ac-ooxml-highlight-bg": U?.ooxmlHighlightBackground,
694
+ "--ac-json-collapsed-text": U?.jsonCollapsedText,
695
+ "--ac-json-collapsed-bg": U?.jsonCollapsedBackground,
696
+ "--ac-font-family": G ? void 0 : W?.fontFamily,
697
+ "--ac-font-size": G ? void 0 : W?.fontSize,
698
+ "--ac-font-weight": G ? void 0 : W?.fontWeight,
699
+ "--ac-line-height": G ? void 0 : W?.lineHeight,
700
+ "--ac-letter-spacing": G ? void 0 : W?.letterSpacing
676
701
  }),
677
- ...ue
678
- }), [se]), ve = F(() => {
702
+ ...le
703
+ }), [oe]), _e = I(() => {
679
704
  switch (e.type) {
680
705
  case i.Image:
681
706
  case i.Audio:
@@ -693,38 +718,38 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
693
718
  case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
694
719
  default: return "h-full overflow-auto p-4";
695
720
  }
696
- }, [e.type]), ye = F(() => {
721
+ }, [e.type]), ve = I(() => {
697
722
  switch (e.type) {
698
- case i.PlainText: return /* @__PURE__ */ B("pre", {
699
- className: g("whitespace-pre-wrap break-words", q.body, U?.fontClassName),
723
+ case i.PlainText: return /* @__PURE__ */ V("pre", {
724
+ className: g("whitespace-pre-wrap break-words", J.body, W?.fontClassName),
700
725
  children: e.text
701
726
  });
702
- case i.Image: return /* @__PURE__ */ B(Me, {
727
+ case i.Image: return /* @__PURE__ */ V(je, {
703
728
  url: e.url,
704
729
  fileName: r,
705
730
  loadErrorLabel: c
706
731
  });
707
- case i.Audio: return /* @__PURE__ */ B("audio", {
732
+ case i.Audio: return /* @__PURE__ */ V("audio", {
708
733
  controls: !0,
709
734
  src: e.url,
710
735
  "aria-label": r ?? "Audio attachment",
711
736
  className: "w-full max-w-sm",
712
737
  preload: "metadata",
713
- children: e.mimeType && /* @__PURE__ */ B("source", {
738
+ children: e.mimeType && /* @__PURE__ */ V("source", {
714
739
  src: e.url,
715
740
  type: e.mimeType
716
741
  })
717
742
  });
718
- case i.Markdown: return /* @__PURE__ */ B(p, {
743
+ case i.Markdown: return /* @__PURE__ */ V(p, {
719
744
  content: e.text,
720
745
  isStreaming: !1,
721
- codeBlockTheme: A,
746
+ codeBlockTheme: j,
722
747
  classNames: u
723
748
  });
724
- case i.MarkdownTable: return /* @__PURE__ */ B(p, {
749
+ case i.MarkdownTable: return /* @__PURE__ */ V(p, {
725
750
  content: e.text,
726
751
  isStreaming: !1,
727
- codeBlockTheme: A,
752
+ codeBlockTheme: j,
728
753
  containerClassName: "flex h-full min-h-0 flex-col",
729
754
  classNames: {
730
755
  ...u,
@@ -732,49 +757,49 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
732
757
  tableScrollContainer: "max-h-full"
733
758
  },
734
759
  tableActionLabels: {
735
- copyLabel: te,
736
- copiedLabel: ne,
737
- downloadCsvLabel: re
760
+ copyLabel: A,
761
+ copiedLabel: te,
762
+ downloadCsvLabel: ne
738
763
  },
739
- tableDownloadFilename: j
764
+ tableDownloadFilename: M
740
765
  });
741
- case i.Json: return /* @__PURE__ */ B("div", {
766
+ case i.Json: return /* @__PURE__ */ V("div", {
742
767
  dir: "ltr",
743
768
  className: "h-full overflow-auto",
744
- children: /* @__PURE__ */ B("div", {
745
- className: g("m-3 overflow-auto rounded-md border", q.jsonWrapper),
746
- children: /* @__PURE__ */ B(ce, {
769
+ children: /* @__PURE__ */ V("div", {
770
+ className: g("m-3 overflow-auto rounded-md border", J.jsonWrapper),
771
+ children: /* @__PURE__ */ V(se, {
747
772
  data: e.value,
748
773
  style: {
749
- container: g("whitespace-pre-wrap break-words p-2", U?.jsonClassName ?? "dial-code-text"),
750
- basicChildStyle: R.basicChildStyle,
774
+ container: g("whitespace-pre-wrap break-words p-2", W?.jsonClassName ?? "dial-code-text"),
775
+ basicChildStyle: z.basicChildStyle,
751
776
  childFieldsContainer: "m-0 ps-3",
752
- label: g("me-1 font-semibold", q.jsonLabel),
753
- clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", q.jsonClickableLabel),
754
- nullValue: g("italic", q.jsonNullValue),
755
- undefinedValue: g("italic", q.jsonNullValue),
756
- stringValue: q.jsonStringValue,
757
- booleanValue: q.jsonBooleanValue,
758
- numberValue: q.jsonNumberValue,
759
- otherValue: g("italic", q.jsonNullValue),
760
- punctuation: g("me-1", q.jsonPunctuation),
761
- collapseIcon: g("me-1 cursor-pointer select-none transition-colors", q.jsonCollapseIcon),
762
- expandIcon: g("me-1 cursor-pointer select-none transition-colors", q.jsonExpandIcon),
763
- collapsedContent: g("me-1 cursor-pointer rounded px-1", q.jsonCollapsedContent)
777
+ label: g("me-1 font-semibold", J.jsonLabel),
778
+ clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", J.jsonClickableLabel),
779
+ nullValue: g("italic", J.jsonNullValue),
780
+ undefinedValue: g("italic", J.jsonNullValue),
781
+ stringValue: J.jsonStringValue,
782
+ booleanValue: J.jsonBooleanValue,
783
+ numberValue: J.jsonNumberValue,
784
+ otherValue: g("italic", J.jsonNullValue),
785
+ punctuation: g("me-1", J.jsonPunctuation),
786
+ collapseIcon: g("me-1 cursor-pointer select-none transition-colors", J.jsonCollapseIcon),
787
+ expandIcon: g("me-1 cursor-pointer select-none transition-colors", J.jsonExpandIcon),
788
+ collapsedContent: g("me-1 cursor-pointer rounded px-1", J.jsonCollapsedContent)
764
789
  }
765
790
  })
766
791
  })
767
792
  });
768
- case i.Code: return /* @__PURE__ */ B(he, {
793
+ case i.Code: return /* @__PURE__ */ V(me, {
769
794
  content: e,
770
- codeBlockTheme: A,
795
+ codeBlockTheme: j,
771
796
  labels: {
772
797
  loadingLabel: O,
773
798
  errorLabel: k,
774
799
  retryLabel: ee
775
800
  }
776
801
  });
777
- case i.Html: return /* @__PURE__ */ B(_e, {
802
+ case i.Html: return /* @__PURE__ */ V(ge, {
778
803
  content: e,
779
804
  labels: {
780
805
  htmlFrameBlockedLabel: f,
@@ -782,25 +807,25 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
782
807
  },
783
808
  isSourceView: a,
784
809
  title: r,
785
- codeBlockTheme: A
810
+ codeBlockTheme: j
786
811
  });
787
- case i.Pdf: return /* @__PURE__ */ B(s, {
788
- retryKey: de,
789
- onRetry: me,
812
+ case i.Pdf: return /* @__PURE__ */ V(s, {
813
+ retryKey: ue,
814
+ onRetry: pe,
790
815
  labels: {
791
816
  loadingLabel: x,
792
817
  errorLabel: C,
793
818
  retryLabel: w
794
819
  },
795
- children: /* @__PURE__ */ B(pe, {
820
+ children: /* @__PURE__ */ V(fe, {
796
821
  fileName: r,
797
822
  url: e.url,
798
823
  highlights: e.highlights ?? [],
799
824
  selectedHighlightId: e.selectedHighlightId,
800
825
  selectedPageNumber: e.page,
801
- loadPdf: N,
802
- hideHeader: P,
803
- configurePdfWorker: I,
826
+ loadPdf: P,
827
+ hideHeader: F,
828
+ configurePdfWorker: L,
804
829
  labels: {
805
830
  thumbnailsLabel: _,
806
831
  showThumbnailsLabel: v,
@@ -812,38 +837,38 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
812
837
  }
813
838
  })
814
839
  }, e.url);
815
- case i.Ooxml: return /* @__PURE__ */ B(Oe, {
840
+ case i.Ooxml: return /* @__PURE__ */ V(De, {
816
841
  content: e,
817
842
  fileName: r,
818
843
  loadErrorLabel: c,
819
844
  formulaLabel: T,
820
- formulaLabelClassName: U?.xlsxFormulaLabelClassName ?? "dial-italic-text",
821
- highlightsLabel: ae,
822
- highlightNavigatedLabel: oe
845
+ formulaLabelClassName: W?.xlsxFormulaLabelClassName ?? "dial-italic-text",
846
+ highlightsLabel: ie,
847
+ highlightNavigatedLabel: ae
823
848
  });
824
849
  case i.Visualizer:
825
- case i.GroupedVisualizer: return /* @__PURE__ */ B(Ae, {
850
+ case i.GroupedVisualizer: return /* @__PURE__ */ V(ke, {
826
851
  content: e,
827
852
  errorLabel: d
828
853
  });
829
- case i.McpApp: return /* @__PURE__ */ B(Ce, {
854
+ case i.McpApp: return /* @__PURE__ */ V(Se, {
830
855
  content: e,
831
- onAppInfo: z
856
+ onAppInfo: B
832
857
  });
833
- case i.Unsupported: return /* @__PURE__ */ B("p", {
834
- className: g("text-center", q.statusLabel),
858
+ case i.Unsupported: return /* @__PURE__ */ V("p", {
859
+ className: g("text-center", J.statusLabel),
835
860
  children: o
836
861
  });
837
862
  case i.Error: {
838
863
  let t = e.errorType === n.Forbidden;
839
- return /* @__PURE__ */ V("div", {
864
+ return /* @__PURE__ */ H("div", {
840
865
  className: "flex flex-col items-center gap-2",
841
- children: [B(t ? ie : D, {
866
+ children: [V(t ? re : D, {
842
867
  size: 60,
843
868
  stroke: S,
844
- className: q.errorIcon
845
- }), /* @__PURE__ */ B("p", {
846
- className: g("text-center", q.statusLabel),
869
+ className: J.errorIcon
870
+ }), /* @__PURE__ */ V("p", {
871
+ className: g("text-center", J.statusLabel),
847
872
  children: t ? l : c
848
873
  })]
849
874
  });
@@ -851,11 +876,11 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
851
876
  }
852
877
  }, [
853
878
  e,
854
- U?.fontClassName,
855
- U?.jsonClassName,
856
- U?.xlsxFormulaLabelClassName,
879
+ W?.fontClassName,
880
+ W?.jsonClassName,
881
+ W?.xlsxFormulaLabelClassName,
857
882
  r,
858
- A,
883
+ j,
859
884
  o,
860
885
  c,
861
886
  l,
@@ -863,11 +888,11 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
863
888
  f,
864
889
  h,
865
890
  a,
866
- j,
867
- N,
891
+ M,
868
892
  P,
869
- I,
870
- z,
893
+ F,
894
+ L,
895
+ B,
871
896
  _,
872
897
  v,
873
898
  y,
@@ -879,59 +904,59 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
879
904
  O,
880
905
  k,
881
906
  ee,
907
+ fe,
908
+ ue,
882
909
  pe,
883
- de,
884
- me,
910
+ A,
885
911
  te,
886
912
  ne,
887
- re,
888
- ae,
889
- oe
913
+ ie,
914
+ ae
890
915
  ]);
891
- return /* @__PURE__ */ B("div", {
892
- style: !t && Ne.has(e.type) ? ge : void 0,
893
- className: g(t ? "flex h-full items-center justify-center" : ve, le),
894
- children: t ? /* @__PURE__ */ B(E, {}) : ye
916
+ return /* @__PURE__ */ V("div", {
917
+ style: !t && Me.has(e.type) ? he : void 0,
918
+ className: g(t ? "flex h-full items-center justify-center" : _e, ce),
919
+ children: t ? /* @__PURE__ */ V(E, {}) : ve
895
920
  });
896
- }), Fe = {
921
+ }), Pe = {
897
922
  mcpAppDivider: "_mcpAppDivider_1jh5p_1",
898
923
  mcpAppVersion: "_mcpAppVersion_1jh5p_5"
899
- }, Ie = 2e3, Le = j(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, leftActions: s, labels: { ariaLabel: c, closeLabel: l = "Close", resizeLabel: u = "Resize panel", downloadLabel: d = "Download", copyTextLabel: f = "Copy text", copiedTextLabel: p = "Copied!", copyMarkdownLabel: h = "Copy as Markdown", copiedMarkdownLabel: _ = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: C = "Copied!", visualizerErrorLabel: T, unsupportedLabel: E = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", forbiddenErrorLabel: O = "You don't have permission to access this file", htmlFrameBlockedLabel: ie = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: se = "Open in new tab", htmlViewSourceLabel: A = "View source", htmlViewRenderedLabel: j = "View rendered", mcpAppReloadLabel: N = "Reload", pdfThumbnailsLabel: ce, pdfShowThumbnailsLabel: R, pdfHideThumbnailsLabel: H, pdfPageNumberLabel: U, pdfContentLoadingLabel: le, pdfContentErrorLabel: ue, pdfContentRetryLabel: de, xlsxFormulaLabel: pe, codeContentLoadingLabel: me, codeContentErrorLabel: W, codeContentRetryLabel: he, tableCopyLabel: ge, tableCopiedLabel: _e, tableDownloadCsvLabel: ve, ooxmlHighlightsLabel: ye, ooxmlHighlightNavigatedLabel: be }, onDownload: xe, onCopyText: Se, onCopyMarkdown: G, onCopyJson: Ce, tableDownloadFilename: K, isMobile: we = !1, defaultWidth: Te, minWidth: Ee = 600, maxWidth: De = 1500, onResizeStop: Oe, styles: ke, codeBlockTheme: Ae, loadPdf: q, configurePdfWorker: je }) => {
900
- let [Me, Ne] = L(!1), [Le, Re] = L(!1), [J, ze] = L(!1), [Y, Be] = L(!1), [Ve, X] = L(void 0), Z = I(null), He = I(null), Q = I(null), Ue = M(() => {
901
- Se?.(), Z.current != null && clearTimeout(Z.current), Ne(!0), Z.current = setTimeout(() => Ne(!1), Ie);
902
- }, [Se]), We = M(() => {
903
- G?.(), He.current != null && clearTimeout(He.current), Re(!0), He.current = setTimeout(() => Re(!1), Ie);
904
- }, [G]), Ge = M(() => {
905
- Ce?.(), Q.current != null && clearTimeout(Q.current), ze(!0), Q.current = setTimeout(() => ze(!1), Ie);
906
- }, [Ce]);
907
- P(() => () => {
908
- Z.current != null && clearTimeout(Z.current), He.current != null && clearTimeout(He.current), Q.current != null && clearTimeout(Q.current);
924
+ }, Fe = 2e3, Ie = M(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, leftActions: s, labels: { ariaLabel: c, closeLabel: l = "Close", resizeLabel: u = "Resize panel", downloadLabel: d = "Download", copyTextLabel: f = "Copy text", copiedTextLabel: p = "Copied!", copyMarkdownLabel: h = "Copy as Markdown", copiedMarkdownLabel: _ = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: C = "Copied!", visualizerErrorLabel: T, unsupportedLabel: E = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", forbiddenErrorLabel: O = "You don't have permission to access this file", htmlFrameBlockedLabel: re = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: oe = "Open in new tab", htmlViewSourceLabel: j = "View source", htmlViewRenderedLabel: M = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: se, pdfShowThumbnailsLabel: z, pdfHideThumbnailsLabel: U, pdfPageNumberLabel: W, pdfContentLoadingLabel: ce, pdfContentErrorLabel: le, pdfContentRetryLabel: ue, xlsxFormulaLabel: fe, codeContentLoadingLabel: pe, codeContentErrorLabel: G, codeContentRetryLabel: me, tableCopyLabel: he, tableCopiedLabel: ge, tableDownloadCsvLabel: _e, ooxmlHighlightsLabel: ve, ooxmlHighlightNavigatedLabel: ye }, onDownload: be, onCopyText: xe, onCopyMarkdown: K, onCopyJson: Se, tableDownloadFilename: q, isMobile: Ce = !1, defaultWidth: we, minWidth: Te = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: ke, loadPdf: J, configurePdfWorker: Ae }) => {
925
+ let [je, Me] = R(!1), [Ie, Le] = R(!1), [Y, Re] = R(!1), [X, ze] = R(!1), [Be, Z] = R(void 0), Ve = L(null), He = L(null), Q = L(null), Ue = N(() => {
926
+ xe?.(), Ve.current != null && clearTimeout(Ve.current), Me(!0), Ve.current = setTimeout(() => Me(!1), Fe);
927
+ }, [xe]), We = N(() => {
928
+ K?.(), He.current != null && clearTimeout(He.current), Le(!0), He.current = setTimeout(() => Le(!1), Fe);
929
+ }, [K]), Ge = N(() => {
930
+ Se?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), Fe);
931
+ }, [Se]);
932
+ F(() => () => {
933
+ Ve.current != null && clearTimeout(Ve.current), He.current != null && clearTimeout(He.current), Q.current != null && clearTimeout(Q.current);
909
934
  }, []);
910
- let $ = M(() => {
911
- Be((e) => !e);
935
+ let $ = N(() => {
936
+ ze((e) => !e);
912
937
  }, []);
913
- P(() => {
914
- Be(!1), X(void 0);
938
+ F(() => {
939
+ ze(!1), Z(void 0);
915
940
  }, [r]);
916
- let { className: Ke, panelStyles: qe, ...Je } = ke ?? {}, { colors: Ye, typography: Xe } = Je, Ze = F(() => m({
941
+ let { className: Ke, panelStyles: qe, ...Je } = Oe ?? {}, { colors: Ye, typography: Xe } = Je, Ze = I(() => m({
917
942
  "--ac-mcp-app-divider": Ye?.mcpAppDividerColor,
918
943
  "--ac-mcp-app-version": Ye?.mcpAppVersionColor
919
- }), [Ye?.mcpAppDividerColor, Ye?.mcpAppVersionColor]), Qe = r.type === i.McpApp && Ve != null ? /* @__PURE__ */ V("span", {
944
+ }), [Ye?.mcpAppDividerColor, Ye?.mcpAppVersionColor]), Qe = r.type === i.McpApp && Be != null ? /* @__PURE__ */ H("span", {
920
945
  style: Ze,
921
946
  children: [
922
- /* @__PURE__ */ B("span", { children: a }),
923
- /* @__PURE__ */ B("span", {
947
+ /* @__PURE__ */ V("span", { children: a }),
948
+ /* @__PURE__ */ V("span", {
924
949
  "aria-hidden": !0,
925
- className: g("mx-1.5 inline-block h-3 w-0 border-s align-middle", Fe.mcpAppDivider)
950
+ className: g("mx-1.5 inline-block h-3 w-0 border-s align-middle", Pe.mcpAppDivider)
926
951
  }),
927
- /* @__PURE__ */ B("span", { children: Ve.name }),
928
- Ve.version && /* @__PURE__ */ B("span", {
929
- className: g("ms-2", Xe?.mcpAppVersionClassName ?? "dial-caption-text", Fe.mcpAppVersion),
930
- children: Ve.version
952
+ /* @__PURE__ */ V("span", { children: Be.name }),
953
+ Be.version && /* @__PURE__ */ V("span", {
954
+ className: g("ms-2", Xe?.mcpAppVersionClassName ?? "dial-caption-text", Pe.mcpAppVersion),
955
+ children: Be.version
931
956
  })
932
957
  ]
933
- }) : a, $e = !t && r.type === i.Html && r.srcdoc != null, et = !t && Se != null && (r.type === i.PlainText || r.type === i.Code), tt = !t && G != null && r.type === i.Markdown, nt = !t && Ce != null && r.type === i.Json, rt = !t && xe != null && o(r), it = !t && r.type === i.McpApp && r.onReload != null;
934
- return /* @__PURE__ */ B(b, {
958
+ }) : a, $e = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), et = !t && xe != null && (r.type === i.PlainText || r.type === i.Code), tt = !t && K != null && r.type === i.Markdown, nt = !t && Se != null && r.type === i.Json, rt = !t && be != null && o(r), it = !t && r.type === i.McpApp && r.onReload != null;
959
+ return /* @__PURE__ */ V(b, {
935
960
  isOpen: e,
936
961
  orientation: y.Right,
937
962
  title: Qe,
@@ -941,153 +966,153 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
941
966
  resizeLabel: u
942
967
  },
943
968
  onClose: n,
944
- resizable: !we,
945
- defaultWidth: Te,
946
- minWidth: Ee,
947
- maxWidth: De,
948
- onResizeStop: Oe,
969
+ resizable: !Ce,
970
+ defaultWidth: we,
971
+ minWidth: Te,
972
+ maxWidth: Ee,
973
+ onResizeStop: De,
949
974
  styles: {
950
975
  ...qe,
951
976
  titleClassName: qe?.titleClassName ?? "dial-h3-text",
952
977
  headerClassName: g("border-b border-tertiary", qe?.headerClassName),
953
- className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ke, qe?.className, fe.panel)
978
+ className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ke, qe?.className, de.panel)
954
979
  },
955
980
  leftActions: s,
956
- rightActions: $e || et || tt || nt || rt || it ? /* @__PURE__ */ V(z, { children: [
957
- it && /* @__PURE__ */ B(w, {
958
- icon: /* @__PURE__ */ B(oe, {
981
+ rightActions: $e || et || tt || nt || rt || it ? /* @__PURE__ */ H(B, { children: [
982
+ it && /* @__PURE__ */ V(w, {
983
+ icon: /* @__PURE__ */ V(ae, {
959
984
  size: x.LG,
960
985
  stroke: S,
961
986
  "aria-hidden": !0
962
987
  }),
963
- "aria-label": N,
964
- tooltipProps: { tooltip: N },
988
+ "aria-label": P,
989
+ tooltipProps: { tooltip: P },
965
990
  onClick: r.type === i.McpApp ? r.onReload : void 0
966
991
  }),
967
- $e && /* @__PURE__ */ B(w, {
968
- icon: B(Y ? re : ee, {
992
+ $e && /* @__PURE__ */ V(w, {
993
+ icon: V(X ? ne : ee, {
969
994
  size: x.LG,
970
995
  stroke: S,
971
996
  "aria-hidden": !0
972
997
  }),
973
- "aria-label": Y ? j : A,
974
- "aria-pressed": Y,
975
- tooltipProps: { tooltip: Y ? j : A },
998
+ "aria-label": X ? M : j,
999
+ "aria-pressed": X,
1000
+ tooltipProps: { tooltip: X ? M : j },
976
1001
  onClick: $
977
1002
  }),
978
- et && /* @__PURE__ */ B(w, {
979
- icon: B(Me ? k : te, {
1003
+ et && /* @__PURE__ */ V(w, {
1004
+ icon: V(je ? k : A, {
980
1005
  size: x.LG,
981
1006
  stroke: S,
982
1007
  "aria-hidden": !0
983
1008
  }),
984
- "aria-label": Me ? p : f,
985
- tooltipProps: { tooltip: Me ? p : f },
1009
+ "aria-label": je ? p : f,
1010
+ tooltipProps: { tooltip: je ? p : f },
986
1011
  onClick: Ue
987
1012
  }),
988
- tt && /* @__PURE__ */ B(w, {
989
- icon: B(Le ? k : ae, {
1013
+ tt && /* @__PURE__ */ V(w, {
1014
+ icon: V(Ie ? k : ie, {
990
1015
  size: x.LG,
991
1016
  stroke: S,
992
1017
  "aria-hidden": !0
993
1018
  }),
994
- "aria-label": Le ? _ : h,
995
- tooltipProps: { tooltip: Le ? _ : h },
1019
+ "aria-label": Ie ? _ : h,
1020
+ tooltipProps: { tooltip: Ie ? _ : h },
996
1021
  onClick: We
997
1022
  }),
998
- nt && /* @__PURE__ */ B(w, {
999
- icon: B(J ? k : te, {
1023
+ nt && /* @__PURE__ */ V(w, {
1024
+ icon: V(Y ? k : A, {
1000
1025
  size: x.LG,
1001
1026
  stroke: S,
1002
1027
  "aria-hidden": !0
1003
1028
  }),
1004
- "aria-label": J ? C : v,
1005
- tooltipProps: { tooltip: J ? C : v },
1029
+ "aria-label": Y ? C : v,
1030
+ tooltipProps: { tooltip: Y ? C : v },
1006
1031
  onClick: Ge
1007
1032
  }),
1008
- rt && /* @__PURE__ */ B(w, {
1009
- icon: /* @__PURE__ */ B(ne, {
1033
+ rt && /* @__PURE__ */ V(w, {
1034
+ icon: /* @__PURE__ */ V(te, {
1010
1035
  size: x.LG,
1011
1036
  stroke: S
1012
1037
  }),
1013
1038
  "aria-label": d,
1014
1039
  tooltipProps: { tooltip: d },
1015
- onClick: xe
1040
+ onClick: be
1016
1041
  })
1017
1042
  ] }) : null,
1018
- children: /* @__PURE__ */ B(Pe, {
1043
+ children: /* @__PURE__ */ V(Ne, {
1019
1044
  content: r,
1020
1045
  isLoading: t,
1021
1046
  fileName: a,
1022
- isHtmlSourceView: Y,
1023
- onAppInfo: r.type === i.McpApp ? X : void 0,
1047
+ isHtmlSourceView: X,
1048
+ onAppInfo: r.type === i.McpApp ? Z : void 0,
1024
1049
  labels: {
1025
1050
  unsupportedLabel: E,
1026
1051
  loadErrorLabel: D,
1027
1052
  forbiddenErrorLabel: O,
1028
1053
  visualizerErrorLabel: T,
1029
- htmlFrameBlockedLabel: ie,
1030
- htmlOpenInNewTabLabel: se,
1031
- pdfThumbnailsLabel: ce,
1032
- pdfShowThumbnailsLabel: R,
1033
- pdfHideThumbnailsLabel: H,
1034
- pdfPageNumberLabel: U,
1035
- pdfContentLoadingLabel: le,
1036
- pdfContentErrorLabel: ue,
1037
- pdfContentRetryLabel: de,
1038
- xlsxFormulaLabel: pe,
1039
- codeContentLoadingLabel: me,
1040
- codeContentErrorLabel: W,
1041
- codeContentRetryLabel: he,
1042
- tableCopyLabel: ge,
1043
- tableCopiedLabel: _e,
1044
- tableDownloadCsvLabel: ve,
1045
- ooxmlHighlightsLabel: ye,
1046
- ooxmlHighlightNavigatedLabel: be
1054
+ htmlFrameBlockedLabel: re,
1055
+ htmlOpenInNewTabLabel: oe,
1056
+ pdfThumbnailsLabel: se,
1057
+ pdfShowThumbnailsLabel: z,
1058
+ pdfHideThumbnailsLabel: U,
1059
+ pdfPageNumberLabel: W,
1060
+ pdfContentLoadingLabel: ce,
1061
+ pdfContentErrorLabel: le,
1062
+ pdfContentRetryLabel: ue,
1063
+ xlsxFormulaLabel: fe,
1064
+ codeContentLoadingLabel: pe,
1065
+ codeContentErrorLabel: G,
1066
+ codeContentRetryLabel: me,
1067
+ tableCopyLabel: he,
1068
+ tableCopiedLabel: ge,
1069
+ tableDownloadCsvLabel: _e,
1070
+ ooxmlHighlightsLabel: ve,
1071
+ ooxmlHighlightNavigatedLabel: ye
1047
1072
  },
1048
1073
  styles: Je,
1049
- codeBlockTheme: Ae,
1050
- tableDownloadFilename: K,
1051
- loadPdf: q,
1052
- configurePdfWorker: je
1074
+ codeBlockTheme: ke,
1075
+ tableDownloadFilename: q,
1076
+ loadPdf: J,
1077
+ configurePdfWorker: Ae
1053
1078
  })
1054
1079
  });
1055
- }), Re = new Set(["html", "htm"]), J = {
1080
+ }), Le = new Set(["html", "htm"]), Y = {
1056
1081
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1057
1082
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1058
1083
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
1059
- }, ze = 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 = {
1084
+ }, Re = 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 = {
1060
1085
  docx: r.Docx,
1061
1086
  xlsx: r.Xlsx,
1062
1087
  pptx: r.Pptx,
1063
1088
  csv: r.Csv
1064
- }, Be = {
1065
- [J.docx]: r.Docx,
1066
- [J.xlsx]: r.Xlsx,
1067
- [J.pptx]: r.Pptx,
1089
+ }, ze = {
1090
+ [Y.docx]: r.Docx,
1091
+ [Y.xlsx]: r.Xlsx,
1092
+ [Y.pptx]: r.Pptx,
1068
1093
  [f.CSV]: r.Csv
1069
- }, Ve = {
1070
- [r.Docx]: J.docx,
1071
- [r.Xlsx]: J.xlsx,
1072
- [r.Pptx]: J.pptx,
1094
+ }, Be = {
1095
+ [r.Docx]: Y.docx,
1096
+ [r.Xlsx]: Y.xlsx,
1097
+ [r.Pptx]: Y.pptx,
1073
1098
  [r.Csv]: f.CSV
1074
- }, X = (e, t) => {
1099
+ }, Z = (e, t) => {
1075
1100
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1076
1101
  if (n != null) {
1077
- let e = Be[n];
1102
+ let e = ze[n];
1078
1103
  if (e != null) return e;
1079
1104
  }
1080
1105
  let r = e.lastIndexOf(".");
1081
- if (r !== -1) return Y[e.slice(r + 1).toLowerCase()];
1082
- }, Z = (e, t) => X(e, t) != null, He = (e, t) => {
1083
- let n = X(e, t);
1084
- return n == null ? void 0 : Ve[n];
1106
+ if (r !== -1) return X[e.slice(r + 1).toLowerCase()];
1107
+ }, Ve = (e, t) => Z(e, t) != null, He = (e, t) => {
1108
+ let n = Z(e, t);
1109
+ return n == null ? void 0 : Be[n];
1085
1110
  }, Q = (e) => {
1086
1111
  let t = e.lastIndexOf(".");
1087
- return t === -1 ? !1 : ze.has(e.slice(t + 1).toLowerCase());
1112
+ return t === -1 ? !1 : Re.has(e.slice(t + 1).toLowerCase());
1088
1113
  }, Ue = (e) => {
1089
1114
  let t = e.lastIndexOf(".");
1090
- return t === -1 ? !1 : Re.has(e.slice(t + 1).toLowerCase());
1115
+ return t === -1 ? !1 : Le.has(e.slice(t + 1).toLowerCase());
1091
1116
  }, We = {
1092
1117
  xml: "xml",
1093
1118
  csv: "plaintext",
@@ -1155,21 +1180,21 @@ var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
1155
1180
  }, Xe = {
1156
1181
  type: i.PlainText,
1157
1182
  text: ""
1158
- }, Ze = se(void 0);
1183
+ }, Ze = oe(void 0);
1159
1184
  Ze.displayName = "AttachmentCanvasContext";
1160
1185
  var Qe = ({ children: e }) => {
1161
- let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Xe), [s, c] = L(void 0), [l, u] = L(void 0), d = M((e, t) => {
1186
+ let [t, n] = R(!1), [r, i] = R(!1), [a, o] = R(Xe), [s, c] = R(void 0), [l, u] = R(void 0), d = N((e, t) => {
1162
1187
  c(e), u(t), i(!0), n(!0);
1163
- }, []), f = M((e, t, r) => {
1188
+ }, []), f = N((e, t, r) => {
1164
1189
  o(e), c(t), u(r), i(!1), n(!0);
1165
- }, []), p = M(() => {
1190
+ }, []), p = N(() => {
1166
1191
  o(Xe), n(!1), i(!1), u(void 0);
1167
1192
  }, []);
1168
- return P(() => () => {
1193
+ return F(() => () => {
1169
1194
  let e = Je(a);
1170
1195
  e != null && URL.revokeObjectURL(e);
1171
- }, [a]), /* @__PURE__ */ B(Ze.Provider, {
1172
- value: F(() => ({
1196
+ }, [a]), /* @__PURE__ */ V(Ze.Provider, {
1197
+ value: I(() => ({
1173
1198
  isOpen: t,
1174
1199
  isLoading: r,
1175
1200
  content: a,
@@ -1191,25 +1216,25 @@ var Qe = ({ children: e }) => {
1191
1216
  children: e
1192
1217
  });
1193
1218
  }, $e = () => {
1194
- let e = N(Ze);
1219
+ let e = P(Ze);
1195
1220
  if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1196
1221
  return e;
1197
- }, et = j(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u }) => {
1198
- let { ariaLabel: d = "Attachment preview", closeLabel: f = "Close", downloadLabel: p = "Download", unsupportedLabel: m = "Preview is not supported for this file", loadErrorLabel: g = "Failed to load file", forbiddenErrorLabel: _ = "You don't have permission to access this file", copyTextLabel: v, copiedTextLabel: y, copyMarkdownLabel: b, copiedMarkdownLabel: x, copyJsonLabel: S, copiedJsonLabel: C, htmlFrameBlockedLabel: w, htmlOpenInNewTabLabel: T, htmlViewSourceLabel: E, htmlViewRenderedLabel: D, pdfThumbnailsLabel: O, pdfShowThumbnailsLabel: k, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: ne, pdfContentErrorLabel: re, pdfContentRetryLabel: ie, xlsxFormulaLabel: ae, codeContentLoadingLabel: oe, codeContentErrorLabel: se, codeContentRetryLabel: A, tableCopyLabel: j, tableCopiedLabel: N, tableDownloadCsvLabel: P, ooxmlHighlightsLabel: F, ooxmlHighlightNavigatedLabel: I } = e ?? {}, { isOpen: L, isLoading: ce, content: R, fileName: z, closeCanvas: V } = $e(), H = M(() => {
1199
- a(R, z);
1200
- }, [R, z]), U = M(() => {
1201
- (R.type === i.PlainText || R.type === i.Code) && h(R.text);
1202
- }, [R]), le = M(() => {
1203
- R.type === i.Markdown && h(R.text);
1204
- }, [R]), ue = M(() => {
1205
- R.type === i.Json && h(JSON.stringify(R.value, null, 2));
1206
- }, [R]);
1207
- return /* @__PURE__ */ B(Le, {
1208
- isOpen: L,
1209
- isLoading: ce,
1210
- onClose: V,
1211
- content: R,
1212
- fileName: z,
1222
+ }, et = M(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u }) => {
1223
+ let { ariaLabel: d = "Attachment preview", closeLabel: f = "Close", downloadLabel: p = "Download", unsupportedLabel: m = "Preview is not supported for this file", loadErrorLabel: g = "Failed to load file", forbiddenErrorLabel: _ = "You don't have permission to access this file", copyTextLabel: v, copiedTextLabel: y, copyMarkdownLabel: b, copiedMarkdownLabel: x, copyJsonLabel: S, copiedJsonLabel: C, htmlFrameBlockedLabel: w, htmlOpenInNewTabLabel: T, htmlViewSourceLabel: E, htmlViewRenderedLabel: D, pdfThumbnailsLabel: O, pdfShowThumbnailsLabel: k, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: A, pdfContentLoadingLabel: te, pdfContentErrorLabel: ne, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: oe, codeContentRetryLabel: j, tableCopyLabel: M, tableCopiedLabel: P, tableDownloadCsvLabel: F, ooxmlHighlightsLabel: I, ooxmlHighlightNavigatedLabel: L } = e ?? {}, { isOpen: R, isLoading: se, content: z, fileName: B, closeCanvas: H } = $e(), U = N(() => {
1224
+ a(z, B);
1225
+ }, [z, B]), W = N(() => {
1226
+ (z.type === i.PlainText || z.type === i.Code) && h(z.text);
1227
+ }, [z]), ce = N(() => {
1228
+ z.type === i.Markdown && h(z.text);
1229
+ }, [z]), le = N(() => {
1230
+ z.type === i.Json && h(JSON.stringify(z.value, null, 2));
1231
+ }, [z]);
1232
+ return /* @__PURE__ */ V(Ie, {
1233
+ isOpen: R,
1234
+ isLoading: se,
1235
+ onClose: H,
1236
+ content: z,
1237
+ fileName: B,
1213
1238
  leftActions: t,
1214
1239
  labels: {
1215
1240
  ariaLabel: d,
@@ -1231,24 +1256,24 @@ var Qe = ({ children: e }) => {
1231
1256
  pdfThumbnailsLabel: O,
1232
1257
  pdfShowThumbnailsLabel: k,
1233
1258
  pdfHideThumbnailsLabel: ee,
1234
- pdfPageNumberLabel: te,
1235
- pdfContentLoadingLabel: ne,
1236
- pdfContentErrorLabel: re,
1237
- pdfContentRetryLabel: ie,
1238
- xlsxFormulaLabel: ae,
1239
- codeContentLoadingLabel: oe,
1240
- codeContentErrorLabel: se,
1241
- codeContentRetryLabel: A,
1242
- tableCopyLabel: j,
1243
- tableCopiedLabel: N,
1244
- tableDownloadCsvLabel: P,
1245
- ooxmlHighlightsLabel: F,
1246
- ooxmlHighlightNavigatedLabel: I
1259
+ pdfPageNumberLabel: A,
1260
+ pdfContentLoadingLabel: te,
1261
+ pdfContentErrorLabel: ne,
1262
+ pdfContentRetryLabel: re,
1263
+ xlsxFormulaLabel: ie,
1264
+ codeContentLoadingLabel: ae,
1265
+ codeContentErrorLabel: oe,
1266
+ codeContentRetryLabel: j,
1267
+ tableCopyLabel: M,
1268
+ tableCopiedLabel: P,
1269
+ tableDownloadCsvLabel: F,
1270
+ ooxmlHighlightsLabel: I,
1271
+ ooxmlHighlightNavigatedLabel: L
1247
1272
  },
1248
- onDownload: H,
1249
- onCopyText: R.type === i.PlainText || R.type === i.Code ? U : void 0,
1250
- onCopyMarkdown: R.type === i.Markdown ? le : void 0,
1251
- onCopyJson: R.type === i.Json ? ue : void 0,
1273
+ onDownload: U,
1274
+ onCopyText: z.type === i.PlainText || z.type === i.Code ? W : void 0,
1275
+ onCopyMarkdown: z.type === i.Markdown ? ce : void 0,
1276
+ onCopyJson: z.type === i.Json ? le : void 0,
1252
1277
  tableDownloadFilename: c,
1253
1278
  isMobile: n,
1254
1279
  defaultWidth: r,
@@ -1261,26 +1286,26 @@ var Qe = ({ children: e }) => {
1261
1286
  frame: "_frame_g47g7_1",
1262
1287
  header: "_header_g47g7_6",
1263
1288
  title: "_title_g47g7_10"
1264
- }, nt = j(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d }) => {
1289
+ }, nt = M(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d }) => {
1265
1290
  let f = e.visualizerName.trim(), p = !u && f !== "";
1266
- return /* @__PURE__ */ V("div", {
1291
+ return /* @__PURE__ */ H("div", {
1267
1292
  className: g("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", tt.frame]),
1268
1293
  style: m({
1269
1294
  "--igv-bg": d?.background,
1270
1295
  "--igv-border": d?.border,
1271
1296
  "--igv-title-text": d?.titleText
1272
1297
  }),
1273
- children: [/* @__PURE__ */ V("div", {
1298
+ children: [/* @__PURE__ */ H("div", {
1274
1299
  className: g("flex min-h-10 items-center gap-2 py-2", p ? "justify-between" : "justify-end", !l && ["border-b px-4", tt.header]),
1275
- children: [p && /* @__PURE__ */ B("span", {
1300
+ children: [p && /* @__PURE__ */ V("span", {
1276
1301
  className: g("min-w-0 truncate", c, tt.title),
1277
1302
  children: f
1278
- }), /* @__PURE__ */ B("div", {
1303
+ }), /* @__PURE__ */ V("div", {
1279
1304
  role: "toolbar",
1280
1305
  "aria-label": i,
1281
1306
  className: "flex items-center gap-1",
1282
- children: /* @__PURE__ */ B(w, {
1283
- icon: /* @__PURE__ */ B(O, {
1307
+ children: /* @__PURE__ */ V(w, {
1308
+ icon: /* @__PURE__ */ V(O, {
1284
1309
  size: x.SM,
1285
1310
  stroke: S,
1286
1311
  "aria-hidden": !0
@@ -1290,10 +1315,10 @@ var Qe = ({ children: e }) => {
1290
1315
  onClick: n
1291
1316
  })
1292
1317
  })]
1293
- }), /* @__PURE__ */ B("div", {
1318
+ }), /* @__PURE__ */ V("div", {
1294
1319
  className: "w-full",
1295
1320
  style: { height: `${t}px` },
1296
- children: /* @__PURE__ */ B(Ae, {
1321
+ children: /* @__PURE__ */ V(ke, {
1297
1322
  content: e,
1298
1323
  loadingLabel: o,
1299
1324
  errorLabel: s,
@@ -1332,7 +1357,7 @@ var Qe = ({ children: e }) => {
1332
1357
  return n;
1333
1358
  }
1334
1359
  }, ct = (e, t) => {
1335
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = $e(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = M(async (t, n, r) => {
1360
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = $e(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = N(async (t, n, r) => {
1336
1361
  if (t.url == null && t.referenceUrl != null) {
1337
1362
  let i = e.resolveReferencePdfContent(t);
1338
1363
  if (i != null) return r(i, t.name, n);
@@ -1346,14 +1371,14 @@ var Qe = ({ children: e }) => {
1346
1371
  let i = await e.resolveTextContent(t);
1347
1372
  if (i != null) return r(i, t.name, n);
1348
1373
  }
1349
- let l = X("", a);
1374
+ let l = Z("", a);
1350
1375
  if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
1351
1376
  switch (a) {
1352
1377
  case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1353
1378
  case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1354
1379
  case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
1355
1380
  }
1356
- let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = X(u);
1381
+ let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Z(u);
1357
1382
  if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
1358
1383
  switch (m) {
1359
1384
  case d.Markdown:
@@ -1386,7 +1411,7 @@ var Qe = ({ children: e }) => {
1386
1411
  s,
1387
1412
  e
1388
1413
  ]);
1389
- return { openAttachmentCanvas: M(async (t, o = t.id, s) => {
1414
+ return { openAttachmentCanvas: N(async (t, o = t.id, s) => {
1390
1415
  let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Ye(e), !1);
1391
1416
  switch (t.type) {
1392
1417
  case c.Image: {
@@ -1424,4 +1449,4 @@ var Qe = ({ children: e }) => {
1424
1449
  ]) };
1425
1450
  };
1426
1451
  //#endregion
1427
- export { fe as ATTACHMENT_CANVAS_CLASS, Le as AttachmentCanvas, Pe as AttachmentCanvasBody, et as AttachmentCanvasContainer, Qe as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, nt as InlineGroupedVisualizer, Ce as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, qe as createForbiddenCanvasContent, Ke as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, Ge as extensionToLanguage, it as findVisualizerForApplication, rt as findVisualizerForMime, X as getOoxmlFileType, He as getOoxmlMimeType, at as groupedVisualizerCanvasKey, o as isDownloadable, Ue as isHtmlPreviewable, Z as isOoxmlPreviewable, Q as isTextPreviewable, ot as partitionAttachmentsForApplicationVisualizer, $e as useAttachmentCanvas, ct as useOpenAttachmentCanvas };
1452
+ export { de as ATTACHMENT_CANVAS_CLASS, Ie as AttachmentCanvas, Ne as AttachmentCanvasBody, et as AttachmentCanvasContainer, Qe as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, me as CodeContent, nt as InlineGroupedVisualizer, Se as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, qe as createForbiddenCanvasContent, Ke as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, Ge as extensionToLanguage, it as findVisualizerForApplication, rt as findVisualizerForMime, Z as getOoxmlFileType, He as getOoxmlMimeType, at as groupedVisualizerCanvasKey, o as isDownloadable, Ue as isHtmlPreviewable, Ve as isOoxmlPreviewable, Q as isTextPreviewable, ot as partitionAttachmentsForApplicationVisualizer, $e as useAttachmentCanvas, ct as useOpenAttachmentCanvas };