@epam/ai-dial-attachment-canvas 1.3.0-dev.246 → 1.3.0-dev.248

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
@@ -1,60 +1,59 @@
1
1
  import { a as e, i as t, n, r, t as i } from "./attachment-canvas-BgwyzrRC.js";
2
- import { i as a, o, t as s } from "./LazyContentBoundary-tNE1ExbI.js";
2
+ import { i as a, o, t as s } from "./LazyContentBoundary-uhIGBROU.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, isSyntaxHighlightingAllowed as g, mergeClasses as _, restrainedSyntaxTheme as v, stripUrlQueryAndFragment as y } from "@epam/ai-dial-chat-shared";
4
4
  import { SidebarOrientation as b, SidebarPanel as x } from "@epam/ai-dial-sidebar";
5
- import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostIconButton as T, LinkButton as E, Spinner as D } from "@epam/ai-dial-ui-kit";
6
- import { IconAlertTriangle as O, IconArrowsMaximize as k, IconCheck as A, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as j, IconLock as re, IconMarkdown as ie, IconRefresh as ae } from "@tabler/icons-react";
7
- import { createContext as M, lazy as N, memo as P, useCallback as F, useContext as oe, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
5
+ import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostIconButton as T, LinkButton as E, LiveRegion as D, Spinner as O } from "@epam/ai-dial-ui-kit";
6
+ import { IconAlertTriangle as k, IconArrowsMaximize as A, IconCheck as j, IconCode as ee, IconCopy as te, IconDownload as M, IconEye as ne, IconLock as re, IconMarkdown as ie, IconRefresh as ae } from "@tabler/icons-react";
7
+ import { createContext as N, lazy as P, memo as F, useCallback as I, useContext as oe, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
8
8
  import { JsonView as se, defaultStyles as ce } from "react-json-view-lite";
9
- import { Fragment as le, jsx as B, jsxs as V } from "react/jsx-runtime";
10
- import { AppBridge as H, AppFrame as ue } from "@mcp-ui/client";
11
- import { McpUiHostContextChangedNotificationSchema as de } from "@modelcontextprotocol/ext-apps/app-bridge";
12
- import { VisualizerConnector as U, VisualizerConnectorEvents as W, VisualizerConnectorRequests as fe } from "@epam/ai-dial-visualizer-connector";
9
+ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
10
+ import { AppBridge as le, AppFrame as ue } from "@mcp-ui/client";
11
+ import { McpUiHostContextChangedNotificationSchema as W } from "@modelcontextprotocol/ext-apps/app-bridge";
12
+ import { VisualizerConnector as G, VisualizerConnectorEvents as de, VisualizerConnectorRequests as fe } from "@epam/ai-dial-visualizer-connector";
13
13
  //#region src/constants/public-class-names.ts
14
- var pe = { panel: "dial-attachment-canvas-panel" }, G = {
14
+ var K = { panel: "dial-attachment-canvas-panel" }, q = {
15
15
  container: "_container_1nhig_1",
16
16
  containerLight: "_containerLight_1nhig_5"
17
- }, K = {
17
+ }, pe = {
18
18
  [l.Dark]: v,
19
19
  [l.Light]: v
20
- }, me = () => N(async () => {
20
+ }, me = () => P(async () => {
21
21
  let { Prism: e } = await import("react-syntax-highlighter");
22
22
  return { default: e };
23
- }), he = P(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
24
- let { text: r, language: i } = e, a = L(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = K[t], u = t === l.Light, [d, f] = z(0), p = L(me, [d]), m = F(() => {
23
+ }), he = F(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
24
+ let { text: r, language: i } = e, a = R(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = pe[t], u = t === l.Light, [d, f] = B(0), p = R(me, [d]), m = I(() => {
25
25
  f((e) => e + 1);
26
- }, []), h = /* @__PURE__ */ B("pre", {
27
- className: "p-4 wrap-break-word whitespace-pre-wrap",
26
+ }, []), h = /* @__PURE__ */ H("pre", {
27
+ className: "dial-code-text p-4 wrap-break-word whitespace-pre-wrap",
28
28
  children: r
29
29
  });
30
- return /* @__PURE__ */ B("div", {
30
+ return /* @__PURE__ */ H("div", {
31
31
  dir: "ltr",
32
- className: _("h-full overflow-auto", G.container, u && G.containerLight),
33
- children: o ? h : /* @__PURE__ */ B(s, {
32
+ className: _("h-full overflow-auto", q.container, u && q.containerLight),
33
+ children: o ? h : /* @__PURE__ */ H(s, {
34
34
  retryKey: d,
35
35
  onRetry: m,
36
36
  pendingContent: h,
37
37
  errorContent: h,
38
38
  labels: n,
39
- children: /* @__PURE__ */ B(p, {
39
+ children: /* @__PURE__ */ H(p, {
40
40
  language: i,
41
41
  style: c,
42
42
  customStyle: {
43
43
  margin: 0,
44
44
  borderRadius: 0,
45
45
  background: "transparent",
46
- fontSize: 14,
47
- lineHeight: 1.5,
48
- padding: "16px",
49
- letterSpacing: 0
46
+ padding: "16px"
50
47
  },
48
+ className: "dial-code-text",
49
+ codeTagProps: { className: "dial-code-text" },
51
50
  wrapLongLines: !0,
52
51
  children: r
53
52
  })
54
53
  })
55
54
  });
56
- }), ge = "dial-html-preview:render", _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = P(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
57
- let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = z(!0), [d, f] = z(!1), [p, m] = z(void 0), [h, g] = z(!1), [v, y] = z(!1), b = R(null), x = R(null), S = R(!1), C = R({
55
+ }), ge = "dial-html-preview:render", _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = F(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
56
+ let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = B(!0), [d, f] = B(!1), [p, m] = B(void 0), [h, g] = B(!1), [v, y] = B(!1), b = z(null), x = z(null), S = z(!1), C = z({
58
57
  content: e,
59
58
  generation: 0
60
59
  });
@@ -63,11 +62,11 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
63
62
  generation: C.current.generation + 1
64
63
  });
65
64
  let w = C.current.generation;
66
- I(() => {
65
+ L(() => {
67
66
  u(!0), f(!1), m(void 0), g(!1), y(!1);
68
67
  }, [e]);
69
- let T = R(n);
70
- T.current !== n && (T.current = n, n && v && y(!1), !n && S.current && (S.current = !1, u(!0))), I(() => {
68
+ let T = z(n);
69
+ T.current !== n && (T.current = n, n && v && y(!1), !n && S.current && (S.current = !1, u(!0))), L(() => {
71
70
  if (!n || e.srcdoc != null || e.resolveSourceText == null || p != null) return;
72
71
  let t = !1, r = e.resolveSourceText;
73
72
  return (async () => {
@@ -88,43 +87,43 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
88
87
  e,
89
88
  p
90
89
  ]);
91
- let O = e.isSameOriginUrl === !0 && e.url != null, k = !O && e.srcdoc != null, A = k ? e.srcdocHostUrl : void 0, ee = e.srcdoc, te = F((e) => {
90
+ let D = e.isSameOriginUrl === !0 && e.url != null, k = !D && e.srcdoc != null, A = k ? e.srcdocHostUrl : void 0, j = e.srcdoc, ee = I((e) => {
92
91
  if (u(!1), A != null) {
93
92
  let e = b.current?.contentWindow;
94
- e != null && e !== x.current && ee != null && (x.current = e, e.postMessage({
93
+ e != null && e !== x.current && j != null && (x.current = e, e.postMessage({
95
94
  type: ge,
96
- html: ee
95
+ html: j
97
96
  }, "*"));
98
- } else if (!(k || O)) try {
97
+ } else if (!(k || D)) try {
99
98
  b.current?.contentDocument ?? f(!0);
100
99
  } catch {
101
100
  f(!0);
102
101
  }
103
102
  }, [
104
103
  k,
105
- O,
104
+ D,
106
105
  A,
107
- ee
108
- ]), ne = F(() => {
106
+ j
107
+ ]), te = I(() => {
109
108
  u(!1), f(!0);
110
- }, []), j = e.srcdoc ?? p, re = e.srcdoc != null || e.resolveSourceText != null, ie = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
111
- if (n && re && (j != null || h || ie)) return S.current = !0, j == null ? /* @__PURE__ */ B("div", {
109
+ }, []), M = e.srcdoc ?? p, ne = e.srcdoc != null || e.resolveSourceText != null, re = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
110
+ if (n && ne && (M != null || h || re)) return S.current = !0, M == null ? /* @__PURE__ */ H("div", {
112
111
  className: "flex h-full items-center justify-center",
113
- children: /* @__PURE__ */ B(D, {})
114
- }) : /* @__PURE__ */ B(he, {
112
+ children: /* @__PURE__ */ H(O, {})
113
+ }) : /* @__PURE__ */ H(he, {
115
114
  content: {
116
115
  type: i.Code,
117
- text: j,
116
+ text: M,
118
117
  language: "html"
119
118
  },
120
119
  codeBlockTheme: a
121
120
  });
122
- if (d) return /* @__PURE__ */ V("div", {
121
+ if (d) return /* @__PURE__ */ U("div", {
123
122
  className: "flex h-full flex-col items-center justify-center gap-3 p-4",
124
- children: [/* @__PURE__ */ B("p", {
123
+ children: [/* @__PURE__ */ H("p", {
125
124
  className: "text-center",
126
125
  children: s
127
- }), e.url != null && /* @__PURE__ */ B(E, {
126
+ }), e.url != null && /* @__PURE__ */ H(E, {
128
127
  href: e.url,
129
128
  target: "_blank",
130
129
  label: c,
@@ -132,21 +131,21 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
132
131
  textClassName: o
133
132
  })]
134
133
  });
135
- let ae = k ? A : e.url, M = k && A == null ? e.srcdoc : void 0;
136
- return /* @__PURE__ */ V("div", {
134
+ let ie = k ? A : e.url, ae = k && A == null ? e.srcdoc : void 0;
135
+ return /* @__PURE__ */ U("div", {
137
136
  className: "relative h-full",
138
- children: [l && /* @__PURE__ */ B("div", {
137
+ children: [l && /* @__PURE__ */ H("div", {
139
138
  className: "absolute inset-0 flex items-center justify-center",
140
- children: /* @__PURE__ */ B(D, {})
141
- }), /* @__PURE__ */ B("iframe", {
139
+ children: /* @__PURE__ */ H(O, {})
140
+ }), /* @__PURE__ */ H("iframe", {
142
141
  ref: b,
143
142
  title: r,
144
- src: ae,
145
- srcDoc: M,
146
- sandbox: k || O ? "allow-scripts" : "allow-scripts allow-same-origin",
143
+ src: ie,
144
+ srcDoc: ae,
145
+ sandbox: k || D ? "allow-scripts" : "allow-scripts allow-same-origin",
147
146
  className: _("h-full w-full border-none", l ? "invisible" : ""),
148
- onLoad: te,
149
- onError: ne
147
+ onLoad: ee,
148
+ onError: te
150
149
  }, w)]
151
150
  });
152
151
  }), ye = {
@@ -174,12 +173,12 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
174
173
  let r = t;
175
174
  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`));
176
175
  }, Ce = (e, t, n) => {
177
- let r = R(e);
178
- I(() => {
176
+ let r = z(e);
177
+ L(() => {
179
178
  r.current = e;
180
179
  });
181
- let [i, a] = z(null), [o, s] = z(!1);
182
- return I(() => {
180
+ let [i, a] = B(null), [o, s] = B(!1);
181
+ return L(() => {
183
182
  let e = null;
184
183
  try {
185
184
  let n = t.current?.getBoundingClientRect(), i = n != null && n.width > 0 && n.height > 0 ? {
@@ -189,13 +188,13 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
189
188
  height: Math.round(n.height)
190
189
  }
191
190
  } : r.current.hostContext;
192
- e = new H(null, r.current.hostInfo ?? ye, be, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
191
+ e = new le(null, r.current.hostInfo ?? ye, be, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
193
192
  let t = r.current.onOpenLink;
194
193
  return (t == null ? xe(e) : t(e)) === !1 ? { isError: !0 } : {};
195
194
  }, e.onrequestdisplaymode = async ({ mode: e }) => {
196
195
  let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
197
196
  return { mode: t?.(e) ?? n };
198
- }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(de, ({ params: e }) => {
197
+ }, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(W, ({ params: e }) => {
199
198
  let n = t.current?.querySelector("iframe");
200
199
  n != null && Se(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
201
200
  }), a(e);
@@ -205,13 +204,13 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
205
204
  return () => {
206
205
  e?.close().catch((e) => console.error("[useMcpAppBridge] Error closing AppBridge:", e));
207
206
  };
208
- }, [t]), I(() => {
207
+ }, [t]), L(() => {
209
208
  i != null && i.transport != null && n != null && i.setHostContext(n);
210
209
  }, [i, n]), {
211
210
  appBridge: i,
212
211
  hasFailed: o
213
212
  };
214
- }, q = {
213
+ }, J = {
215
214
  loadingOverlay: "_loadingOverlay_sqrel_2",
216
215
  fullscreenFrame: "_fullscreenFrame_sqrel_21",
217
216
  loadingFrame: "_loadingFrame_sqrel_29",
@@ -219,8 +218,8 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
219
218
  statusDetail: "_statusDetail_sqrel_38",
220
219
  errorIcon: "_errorIcon_sqrel_42"
221
220
  }, we = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
222
- let [r, i] = z("loading"), [a, o] = z(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = L(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = R(null), [h, g] = z();
223
- I(() => {
221
+ let [r, i] = B("loading"), [a, o] = B(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = R(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = z(null), [h, g] = B();
222
+ L(() => {
224
223
  let e = m.current;
225
224
  if (!e) return;
226
225
  let t = new ResizeObserver(([e]) => {
@@ -233,15 +232,15 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
233
232
  });
234
233
  return t.observe(e), () => t.disconnect();
235
234
  }, []);
236
- let { appBridge: v, hasFailed: y } = Ce(e, m, L(() => d == null || h == null ? d : {
235
+ let { appBridge: v, hasFailed: y } = Ce(e, m, R(() => d == null || h == null ? d : {
237
236
  ...d,
238
237
  containerDimensions: h
239
238
  }, [d, h])), b = y || r === "error";
240
- return /* @__PURE__ */ V("div", {
239
+ return /* @__PURE__ */ U("div", {
241
240
  ref: m,
242
- className: _("relative h-full w-full", b ? "min-h-[160px]" : "min-h-[100px]", p && q.fullscreenFrame, !p && r === "loading" && q.loadingFrame),
241
+ className: _("relative h-full w-full", b ? "min-h-[160px]" : "min-h-[100px]", p && J.fullscreenFrame, !p && r === "loading" && J.loadingFrame),
243
242
  children: [
244
- v != null && !b && /* @__PURE__ */ B(ue, {
243
+ v != null && !b && /* @__PURE__ */ H(ue, {
245
244
  html: s,
246
245
  sandbox: f,
247
246
  appBridge: v,
@@ -255,29 +254,29 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
255
254
  o(e.message), i("error");
256
255
  }
257
256
  }),
258
- !b && r === "loading" && /* @__PURE__ */ B("div", {
259
- className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", q.loadingOverlay),
260
- children: /* @__PURE__ */ B(D, {})
257
+ !b && r === "loading" && /* @__PURE__ */ H("div", {
258
+ className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", J.loadingOverlay),
259
+ children: /* @__PURE__ */ H(O, {})
261
260
  }),
262
- b && /* @__PURE__ */ V("div", {
261
+ b && /* @__PURE__ */ U("div", {
263
262
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
264
- children: [/* @__PURE__ */ B(O, {
263
+ children: [/* @__PURE__ */ H(k, {
265
264
  size: 60,
266
265
  stroke: C,
267
266
  "aria-hidden": !0,
268
- className: q.errorIcon
269
- }), /* @__PURE__ */ V("p", {
270
- role: "alert",
271
- className: _("text-center", q.statusLabel),
272
- children: [t, a && /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B("br", {}), /* @__PURE__ */ B("span", {
273
- className: q.statusDetail,
267
+ className: J.errorIcon
268
+ }), /* @__PURE__ */ U("p", {
269
+ role: "status",
270
+ className: _("text-center", J.statusLabel),
271
+ children: [t, a && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("br", {}), /* @__PURE__ */ H("span", {
272
+ className: J.statusDetail,
274
273
  children: a
275
274
  })] })]
276
275
  })]
277
276
  })
278
277
  ]
279
278
  });
280
- }, J = {
279
+ }, Y = {
281
280
  viewer: "_viewer_sdlt9_2",
282
281
  spreadsheetCanvas: "_spreadsheetCanvas_sdlt9_6",
283
282
  formulaPanel: "_formulaPanel_sdlt9_12",
@@ -285,13 +284,13 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
285
284
  statusOverlay: "_statusOverlay_sdlt9_24",
286
285
  errorIcon: "_errorIcon_sdlt9_29",
287
286
  highlight: "_highlight_sdlt9_37"
288
- }, Y = (e) => {
287
+ }, Te = (e) => {
289
288
  if (e?.kind !== "range") return "";
290
289
  let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
291
290
  if (n == null) return "";
292
291
  let r = n.formula;
293
292
  return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
294
- }, Te = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
293
+ }, Ee = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
295
294
  switch (t) {
296
295
  case r.Docx: {
297
296
  let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
@@ -313,7 +312,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
313
312
  }
314
313
  case r.Csv: {
315
314
  let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
316
- r.className = J.spreadsheetCanvas, e.replaceChildren(r);
315
+ r.className = Y.spreadsheetCanvas, e.replaceChildren(r);
317
316
  let i = new t(r, {
318
317
  showScrollbars: !0,
319
318
  onError: n
@@ -337,7 +336,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
337
336
  });
338
337
  }
339
338
  }
340
- }, Ee = async (e, t, n, i) => {
339
+ }, De = async (e, t, n, i) => {
341
340
  let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
342
341
  switch (t.format) {
343
342
  case r.Docx: {
@@ -346,7 +345,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
346
345
  import("@silurus/ooxml/chart-ex"),
347
346
  import("./ooxml-highlight-surfaces-C18JJb0P.js")
348
347
  ]), l = await n.load(t.url, { chartEx: o });
349
- if (i()) throw l.destroy(), new De();
348
+ if (i()) throw l.destroy(), new Oe();
350
349
  let u = r.fromDocument(e, l, {
351
350
  enableTextSelection: !0,
352
351
  refitOnResize: !0,
@@ -366,7 +365,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
366
365
  import("@silurus/ooxml/chart-ex"),
367
366
  import("./ooxml-highlight-surfaces-C18JJb0P.js")
368
367
  ]), l = await n.load(t.url, { chartEx: o });
369
- if (i()) throw l.destroy(), new De();
368
+ if (i()) throw l.destroy(), new Oe();
370
369
  let u = r.fromPresentation(e, l, {
371
370
  enableTextSelection: !0,
372
371
  refitOnResize: !0,
@@ -400,82 +399,82 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
400
399
  };
401
400
  }
402
401
  case r.Csv: {
403
- let r = await Te(e, t.format, n);
402
+ let r = await Ee(e, t.format, n);
404
403
  return await r.load(t.url), { viewer: r };
405
404
  }
406
405
  }
407
- }, 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" }) => {
408
- let l = R(null), [u, d] = z(!0), [f, p] = z(!1), [m, h] = z(""), [g, v] = z([]), [y, b] = z(!1), { highlights: x, selectedHighlightId: S } = t, w = x != null && x.length > 0, T = R(void 0), E = R(x);
409
- E.current = x;
410
- let k = R(void 0);
411
- return I(() => {
412
- let e = l.current;
406
+ }, Oe = class extends Error {}, ke = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, formulaValueClassName: s, highlightsLabel: c = "Cited locations", highlightNavigatedLabel: l = "Scrolled to the cited location" }) => {
407
+ let u = z(null), [d, f] = B(!0), [p, m] = B(!1), [h, g] = B(""), [v, y] = B([]), [b, x] = B(!1), { highlights: S, selectedHighlightId: w } = t, T = S != null && S.length > 0, E = z(void 0), A = z(S);
408
+ A.current = S;
409
+ let j = z(void 0);
410
+ return L(() => {
411
+ let e = u.current;
413
412
  if (e == null) return;
414
413
  let n, r, i = !1, a, o = () => i;
415
- d(!0), p(!1), h(""), v([]), b(!1);
414
+ f(!0), m(!1), g(""), y([]), x(!1);
416
415
  let s = () => {
417
416
  i || a != null || (a = requestAnimationFrame(() => {
418
417
  a = void 0, c();
419
418
  }));
420
419
  }, c = async () => {
421
- let e = n?.highlights, t = E.current;
420
+ let e = n?.highlights, t = A.current;
422
421
  if (!(i || e == null || t == null)) try {
423
422
  let n = await e.measure(t);
424
- i || v(n);
423
+ i || y(n);
425
424
  } catch {
426
- i || v([]);
425
+ i || y([]);
427
426
  }
428
- }, u = {
427
+ }, l = {
429
428
  onError: () => {
430
- i || (d(!1), p(!0));
429
+ i || (f(!1), m(!0));
431
430
  },
432
431
  onXlsxSelectionContextChange: (e) => {
433
- i || h(Y(e));
432
+ i || g(Te(e));
434
433
  },
435
434
  onGeometryInvalidated: s
436
- }, f = () => {
435
+ }, d = () => {
437
436
  i || (r = new ResizeObserver(() => {
438
437
  n?.viewer.resize?.(), s();
439
438
  }), r.observe(e));
440
439
  };
441
- return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
440
+ return e.addEventListener("scroll", s, !0), j.current = s, (async () => {
442
441
  try {
443
- if (w) {
444
- let r = await Ee(e, t, u, o);
442
+ if (T) {
443
+ let r = await De(e, t, l, o);
445
444
  if (i) {
446
445
  r.viewer.destroy(), r.engine?.destroy();
447
446
  return;
448
447
  }
449
- n = r, T.current = r.highlights, f();
448
+ n = r, E.current = r.highlights, d();
450
449
  } else {
451
- let r = await Te(e, t.format, u);
450
+ let r = await Ee(e, t.format, l);
452
451
  if (i) {
453
452
  r.destroy();
454
453
  return;
455
454
  }
456
- if (n = { viewer: r }, T.current = void 0, await r.load(t.url), i) return;
457
- f();
455
+ if (n = { viewer: r }, E.current = void 0, await r.load(t.url), i) return;
456
+ d();
458
457
  }
459
458
  if (i) return;
460
- d(!1), await c();
459
+ f(!1), await c();
461
460
  } catch (t) {
462
- if (t instanceof De || i) return;
463
- n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
461
+ if (t instanceof Oe || i) return;
462
+ n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, E.current = void 0, e.replaceChildren(), f(!1), m(!0);
464
463
  }
465
464
  })(), () => {
466
- i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), k.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), T.current = void 0, e.replaceChildren();
465
+ i = !0, e.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), j.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), E.current = void 0, e.replaceChildren();
467
466
  };
468
467
  }, [
469
468
  t.format,
470
469
  t.url,
471
- w
472
- ]), I(() => {
473
- k.current?.();
474
- }, [x]), I(() => {
475
- b(!1);
476
- let t = T.current;
477
- if (t == null || u) return;
478
- let n = (E.current?.find(({ id: e }) => e === S))?.locations.at(0);
470
+ T
471
+ ]), L(() => {
472
+ j.current?.();
473
+ }, [S]), L(() => {
474
+ x(!1);
475
+ let t = E.current;
476
+ if (t == null || d) return;
477
+ let n = (A.current?.find(({ id: e }) => e === w))?.locations.at(0);
479
478
  if (n == null) return;
480
479
  let r = !1;
481
480
  return (async () => {
@@ -485,42 +484,42 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
485
484
  } catch {
486
485
  return;
487
486
  }
488
- r || i !== e.Navigated || b(!0);
487
+ r || i !== e.Navigated || x(!0);
489
488
  })(), () => {
490
489
  r = !0;
491
490
  };
492
- }, [S, u]), /* @__PURE__ */ V("div", {
491
+ }, [w, d]), /* @__PURE__ */ U("div", {
493
492
  className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
494
493
  children: [
495
- t.format === r.Xlsx && /* @__PURE__ */ V("div", {
494
+ t.format === r.Xlsx && /* @__PURE__ */ U("div", {
496
495
  role: "region",
497
496
  "aria-label": a,
498
- className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", J.formulaPanel),
499
- children: [/* @__PURE__ */ B("span", {
497
+ className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", Y.formulaPanel),
498
+ children: [/* @__PURE__ */ H("span", {
500
499
  "aria-hidden": "true",
501
500
  className: _("shrink-0", o),
502
501
  children: "fx"
503
- }), /* @__PURE__ */ B("code", {
502
+ }), /* @__PURE__ */ H("code", {
504
503
  dir: "ltr",
505
504
  tabIndex: 0,
506
505
  "aria-live": "polite",
507
- className: _("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 text-sm whitespace-nowrap focus-visible:outline focus-visible:outline-focus", J.formulaValue),
508
- children: m
506
+ className: _("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline focus-visible:outline-focus", Y.formulaValue, s),
507
+ children: h
509
508
  })]
510
509
  }),
511
- /* @__PURE__ */ V("div", {
510
+ /* @__PURE__ */ U("div", {
512
511
  className: "relative min-h-0 w-full flex-1",
513
- children: [/* @__PURE__ */ B("div", {
514
- ref: l,
512
+ children: [/* @__PURE__ */ H("div", {
513
+ ref: u,
515
514
  role: "document",
516
515
  "aria-label": n,
517
- "aria-busy": u,
518
- className: _("h-full w-full overflow-hidden", J.viewer)
519
- }), g.length > 0 && /* @__PURE__ */ B("div", {
516
+ "aria-busy": d,
517
+ className: _("h-full w-full overflow-hidden", Y.viewer)
518
+ }), v.length > 0 && /* @__PURE__ */ H("div", {
520
519
  role: "region",
521
- "aria-label": s,
520
+ "aria-label": c,
522
521
  className: "pointer-events-none absolute inset-0 overflow-hidden",
523
- children: g.map((e, t) => /* @__PURE__ */ B("div", {
522
+ children: v.map((e, t) => /* @__PURE__ */ H("div", {
524
523
  "aria-hidden": "true",
525
524
  style: {
526
525
  left: `${e.left}px`,
@@ -528,30 +527,28 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
528
527
  width: `${e.width}px`,
529
528
  height: `${e.height}px`
530
529
  },
531
- "data-selected": e.highlightId === S,
530
+ "data-selected": e.highlightId === w,
532
531
  "data-clipped": e.isClippedAtEnd === !0,
533
- className: _("absolute", J.highlight)
532
+ className: _("absolute", Y.highlight)
534
533
  }, `${e.highlightId}-${t}`))
535
534
  })]
536
535
  }),
537
- /* @__PURE__ */ B("div", {
538
- role: "status",
539
- "aria-live": "polite",
540
- className: "sr-only",
541
- children: y ? c : ""
536
+ /* @__PURE__ */ H(D, {
537
+ visuallyHidden: !0,
538
+ children: b ? l : ""
542
539
  }),
543
- (u || f) && /* @__PURE__ */ B("div", {
544
- role: f ? "alert" : void 0,
540
+ (d || p) && /* @__PURE__ */ H("div", {
541
+ role: p ? "alert" : void 0,
545
542
  "aria-live": "polite",
546
- className: _("absolute inset-0 flex items-center justify-center", J.statusOverlay),
547
- children: u ? /* @__PURE__ */ B(D, { size: 48 }) : /* @__PURE__ */ V("div", {
543
+ className: _("absolute inset-0 flex items-center justify-center", Y.statusOverlay),
544
+ children: d ? /* @__PURE__ */ H(O, { size: 48 }) : /* @__PURE__ */ U("div", {
548
545
  className: "flex flex-col items-center gap-2",
549
- children: [/* @__PURE__ */ B(O, {
546
+ children: [/* @__PURE__ */ H(k, {
550
547
  "aria-hidden": "true",
551
548
  size: 60,
552
549
  stroke: C,
553
- className: J.errorIcon
554
- }), /* @__PURE__ */ B("p", {
550
+ className: Y.errorIcon
551
+ }), /* @__PURE__ */ H("p", {
555
552
  className: "text-center",
556
553
  children: i
557
554
  })]
@@ -559,12 +556,12 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
559
556
  })
560
557
  ]
561
558
  });
562
- }, ke = (e, t) => {
559
+ }, Ae = (e, t) => {
563
560
  let n = e.toLowerCase();
564
561
  return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
565
- }, Ae = (e, t) => {
562
+ }, je = (e, t) => {
566
563
  if (e != null && e !== "") return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
567
- }, je = (e) => `${e}:grouped-visualizer`, Me = (e, t) => {
564
+ }, Me = (e) => `${e}:grouped-visualizer`, Ne = (e, t) => {
568
565
  let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
569
566
  return e.forEach((e) => {
570
567
  e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase())) ? r.push(e) : i.push(e);
@@ -572,28 +569,28 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
572
569
  claimed: r,
573
570
  unclaimed: i
574
571
  };
575
- }, Ne = (e) => {
572
+ }, Pe = (e) => {
576
573
  if (typeof e != "object" || !e || !Object.prototype.hasOwnProperty.call(e, "message")) return;
577
574
  let { message: t } = e;
578
575
  return typeof t == "string" && t.trim() !== "" ? t : void 0;
579
- }, Pe = {
576
+ }, Fe = {
580
577
  loadingOverlay: "_loadingOverlay_12637_1",
581
578
  statusLabel: "_statusLabel_12637_5",
582
579
  errorIcon: "_errorIcon_12637_9"
583
- }, Fe = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
584
- let s = R(null), [c, l] = z("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = R(e);
580
+ }, Ie = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a, onSendMessage: o }) => {
581
+ let s = z(null), [c, l] = B("loading"), { url: u, visualizerName: d, requestTimeout: f } = e, p = z(e);
585
582
  p.current = e;
586
- let h = R(o);
587
- return h.current = o, I(() => {
583
+ let h = z(o);
584
+ return h.current = o, L(() => {
588
585
  let e = s.current;
589
586
  if (!e) return;
590
587
  l("loading");
591
- let t = new U(e, {
588
+ let t = new G(e, {
592
589
  domain: u,
593
590
  visualizerName: d,
594
591
  requestTimeout: f
595
- }), n = !0, r = t.subscribe(`${d}/${W.SendMessage}`, (e) => {
596
- let t = Ne(e);
592
+ }), n = !0, r = t.subscribe(`${d}/${de.SendMessage}`, (e) => {
593
+ let t = Pe(e);
597
594
  t != null && h.current?.(t);
598
595
  });
599
596
  return (async () => {
@@ -623,7 +620,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
623
620
  u,
624
621
  d,
625
622
  f
626
- ]), I(() => {
623
+ ]), L(() => {
627
624
  let e = r ?? d.trim();
628
625
  e !== "" && s.current?.querySelector("iframe")?.setAttribute("title", e);
629
626
  }, [
@@ -631,7 +628,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
631
628
  d,
632
629
  u,
633
630
  f
634
- ]), /* @__PURE__ */ V("div", {
631
+ ]), /* @__PURE__ */ U("div", {
635
632
  className: "relative h-full w-full",
636
633
  style: m({
637
634
  "--vs-loading-bg": a?.loadingBackground,
@@ -639,114 +636,114 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
639
636
  "--vs-error-icon": a?.errorIcon
640
637
  }),
641
638
  children: [
642
- /* @__PURE__ */ B("div", {
639
+ /* @__PURE__ */ H("div", {
643
640
  ref: s,
644
641
  className: "h-full w-full"
645
642
  }),
646
- c === "loading" && /* @__PURE__ */ V("div", {
647
- className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Pe.loadingOverlay),
648
- children: [/* @__PURE__ */ B(D, {}), t && /* @__PURE__ */ B("p", {
649
- className: _("text-center", Pe.statusLabel),
643
+ c === "loading" && /* @__PURE__ */ U("div", {
644
+ className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Fe.loadingOverlay),
645
+ children: [/* @__PURE__ */ H(O, {}), t && /* @__PURE__ */ H("p", {
646
+ className: _("text-center", Fe.statusLabel),
650
647
  children: t
651
648
  })]
652
649
  }),
653
- c === "error" && /* @__PURE__ */ V("div", {
650
+ c === "error" && /* @__PURE__ */ U("div", {
654
651
  className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
655
- children: [/* @__PURE__ */ B(O, {
652
+ children: [/* @__PURE__ */ H(k, {
656
653
  size: 60,
657
654
  stroke: C,
658
655
  "aria-hidden": !0,
659
- className: Pe.errorIcon
660
- }), /* @__PURE__ */ B("p", {
661
- role: "alert",
662
- className: _("text-center", Pe.statusLabel),
656
+ className: Fe.errorIcon
657
+ }), /* @__PURE__ */ H("p", {
658
+ role: "status",
659
+ className: _("text-center", Fe.statusLabel),
663
660
  children: n
664
661
  })]
665
662
  })
666
663
  ]
667
664
  });
668
665
  }, X = {
669
- body: "_body_13ogb_4",
670
- statusLabel: "_statusLabel_13ogb_13",
671
- errorIcon: "_errorIcon_13ogb_17",
672
- jsonWrapper: "_jsonWrapper_13ogb_21",
673
- jsonLabel: "_jsonLabel_13ogb_26",
674
- jsonClickableLabel: "_jsonClickableLabel_13ogb_30",
675
- jsonPunctuation: "_jsonPunctuation_13ogb_34",
676
- jsonStringValue: "_jsonStringValue_13ogb_38",
677
- jsonNumberValue: "_jsonNumberValue_13ogb_42",
678
- jsonBooleanValue: "_jsonBooleanValue_13ogb_46",
679
- jsonNullValue: "_jsonNullValue_13ogb_50",
680
- jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
681
- jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
682
- jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
683
- }, Ie = () => N(async () => ({ default: (await import("./PdfContent-Dp13pnPj.js")).PdfContent })), Le = ({ url: e, fileName: t, loadErrorLabel: n }) => {
684
- let [r, i] = z(!1);
685
- return I(() => {
666
+ body: "_body_fvnln_4",
667
+ statusLabel: "_statusLabel_fvnln_13",
668
+ errorIcon: "_errorIcon_fvnln_17",
669
+ jsonWrapper: "_jsonWrapper_fvnln_21",
670
+ jsonLabel: "_jsonLabel_fvnln_26",
671
+ jsonClickableLabel: "_jsonClickableLabel_fvnln_30",
672
+ jsonPunctuation: "_jsonPunctuation_fvnln_34",
673
+ jsonStringValue: "_jsonStringValue_fvnln_38",
674
+ jsonNumberValue: "_jsonNumberValue_fvnln_42",
675
+ jsonBooleanValue: "_jsonBooleanValue_fvnln_46",
676
+ jsonNullValue: "_jsonNullValue_fvnln_50",
677
+ jsonExpandIcon: "_jsonExpandIcon_fvnln_54",
678
+ jsonCollapseIcon: "_jsonCollapseIcon_fvnln_67",
679
+ jsonCollapsedContent: "_jsonCollapsedContent_fvnln_84"
680
+ }, Le = () => P(async () => ({ default: (await import("./PdfContent-CNj7_lpl.js")).PdfContent })), Re = ({ url: e, fileName: t, loadErrorLabel: n }) => {
681
+ let [r, i] = B(!1);
682
+ return L(() => {
686
683
  i(!1);
687
- }, [e]), r ? /* @__PURE__ */ V("div", {
684
+ }, [e]), r ? /* @__PURE__ */ U("div", {
688
685
  className: "flex flex-col items-center gap-2",
689
- children: [/* @__PURE__ */ B(O, {
686
+ children: [/* @__PURE__ */ H(k, {
690
687
  size: 60,
691
688
  stroke: C,
692
689
  className: X.errorIcon
693
- }), /* @__PURE__ */ B("p", {
690
+ }), /* @__PURE__ */ H("p", {
694
691
  className: _("text-center", X.statusLabel),
695
692
  children: n
696
693
  })]
697
- }) : /* @__PURE__ */ B("img", {
694
+ }) : /* @__PURE__ */ H("img", {
698
695
  src: e,
699
696
  alt: t ?? "",
700
697
  className: "max-h-full max-w-full object-contain",
701
698
  onError: () => i(!0)
702
699
  });
703
- }, Re = /* @__PURE__ */ new Set([
700
+ }, ze = /* @__PURE__ */ new Set([
704
701
  i.PlainText,
705
702
  i.Code,
706
703
  i.Ooxml
707
- ]), ze = P(({ 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: g, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: S, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: E, codeContentErrorLabel: k, codeContentRetryLabel: A, tableCopyLabel: ee, tableCopiedLabel: te, tableDownloadCsvLabel: ne, codeBlockCopyLabel: j, codeBlockCopiedLabel: ie, codeBlockDownloadLabel: ae, tableScrollRegionAriaLabel: M, mathScrollRegionAriaLabel: N, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: oe } = {}, styles: le, codeBlockTheme: H, tableDownloadFilename: ue, loadPdf: de, hidePdfToolbar: U = !1, configurePdfWorker: W, onAppInfo: fe, onVisualizerSendMessage: pe }) => {
708
- let { colors: G, typography: K, bodyClassName: me, cssVars: ge } = le ?? {}, [_e, ye] = z(0), be = L(Ie, [_e]), xe = F(() => {
709
- ye((e) => e + 1);
710
- }, []), Se = R(void 0), [Ce, q] = z(0), J = F((e) => {
711
- Se.current = e;
704
+ ]), Be = F(({ 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: g, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: S, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: E, codeContentErrorLabel: D, codeContentRetryLabel: A, tableCopyLabel: j, tableCopiedLabel: ee, tableDownloadCsvLabel: te, codeBlockCopyLabel: M, codeBlockCopiedLabel: ne, codeBlockDownloadLabel: ie, tableScrollRegionAriaLabel: ae, mathScrollRegionAriaLabel: N, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: F } = {}, styles: oe, codeBlockTheme: V, tableDownloadFilename: le, loadPdf: ue, hidePdfToolbar: W = !1, configurePdfWorker: G, onAppInfo: de, onVisualizerSendMessage: fe }) => {
705
+ let { colors: K, typography: q, bodyClassName: pe, cssVars: me } = oe ?? {}, [ge, _e] = B(0), ye = R(Le, [ge]), be = I(() => {
706
+ _e((e) => e + 1);
707
+ }, []), xe = z(void 0), [Se, Ce] = B(0), J = I((e) => {
708
+ xe.current = e;
712
709
  }, []);
713
- I(() => {
714
- let t = Se.current;
715
- t != null && (Se.current = void 0, e.type === i.Pdf && e.url === t && q((e) => e + 1));
710
+ L(() => {
711
+ let t = xe.current;
712
+ t != null && (xe.current = void 0, e.type === i.Pdf && e.url === t && Ce((e) => e + 1));
716
713
  }, [e]);
717
- let Y = K?.fontClassName != null, Te = L(() => ({
714
+ let Y = q?.fontClassName != null, Te = R(() => ({
718
715
  ...m({
719
- "--ac-text": G?.text,
720
- "--ac-status-text": G?.statusText,
721
- "--ac-error-icon": G?.errorIcon,
722
- "--ac-open-in-new-tab-text": G?.openInNewTabText,
723
- "--ac-json-border": G?.jsonBorder,
724
- "--ac-json-bg": G?.jsonBackground,
725
- "--ac-json-label": G?.jsonLabel,
726
- "--ac-json-clickable-label": G?.jsonClickableLabel,
727
- "--ac-json-punctuation": G?.jsonPunctuation,
728
- "--ac-json-string": G?.jsonString,
729
- "--ac-json-number": G?.jsonNumber,
730
- "--ac-json-boolean": G?.jsonBoolean,
731
- "--ac-json-null": G?.jsonNull,
732
- "--ac-json-toggle-icon": G?.jsonToggleIcon,
733
- "--ac-json-toggle-icon-hover": G?.jsonToggleIconHover,
734
- "--ac-ooxml-bg": G?.ooxmlBackground,
735
- "--ac-ooxml-formula-border": G?.ooxmlFormulaBorder,
736
- "--ac-ooxml-formula-bg": G?.ooxmlFormulaBackground,
737
- "--ac-ooxml-formula-text": G?.ooxmlFormulaText,
738
- "--ac-ooxml-highlight-border": G?.ooxmlHighlightBorder,
739
- "--ac-ooxml-highlight-bg": G?.ooxmlHighlightBackground,
740
- "--ac-json-collapsed-text": G?.jsonCollapsedText,
741
- "--ac-json-collapsed-bg": G?.jsonCollapsedBackground,
742
- "--ac-font-family": Y ? void 0 : K?.fontFamily,
743
- "--ac-font-size": Y ? void 0 : K?.fontSize,
744
- "--ac-font-weight": Y ? void 0 : K?.fontWeight,
745
- "--ac-line-height": Y ? void 0 : K?.lineHeight,
746
- "--ac-letter-spacing": Y ? void 0 : K?.letterSpacing
716
+ "--ac-text": K?.text,
717
+ "--ac-status-text": K?.statusText,
718
+ "--ac-error-icon": K?.errorIcon,
719
+ "--ac-open-in-new-tab-text": K?.openInNewTabText,
720
+ "--ac-json-border": K?.jsonBorder,
721
+ "--ac-json-bg": K?.jsonBackground,
722
+ "--ac-json-label": K?.jsonLabel,
723
+ "--ac-json-clickable-label": K?.jsonClickableLabel,
724
+ "--ac-json-punctuation": K?.jsonPunctuation,
725
+ "--ac-json-string": K?.jsonString,
726
+ "--ac-json-number": K?.jsonNumber,
727
+ "--ac-json-boolean": K?.jsonBoolean,
728
+ "--ac-json-null": K?.jsonNull,
729
+ "--ac-json-toggle-icon": K?.jsonToggleIcon,
730
+ "--ac-json-toggle-icon-hover": K?.jsonToggleIconHover,
731
+ "--ac-ooxml-bg": K?.ooxmlBackground,
732
+ "--ac-ooxml-formula-border": K?.ooxmlFormulaBorder,
733
+ "--ac-ooxml-formula-bg": K?.ooxmlFormulaBackground,
734
+ "--ac-ooxml-formula-text": K?.ooxmlFormulaText,
735
+ "--ac-ooxml-highlight-border": K?.ooxmlHighlightBorder,
736
+ "--ac-ooxml-highlight-bg": K?.ooxmlHighlightBackground,
737
+ "--ac-json-collapsed-text": K?.jsonCollapsedText,
738
+ "--ac-json-collapsed-bg": K?.jsonCollapsedBackground,
739
+ "--ac-font-family": Y ? void 0 : q?.fontFamily,
740
+ "--ac-font-size": Y ? void 0 : q?.fontSize,
741
+ "--ac-font-weight": Y ? void 0 : q?.fontWeight,
742
+ "--ac-line-height": Y ? void 0 : q?.lineHeight,
743
+ "--ac-letter-spacing": Y ? void 0 : q?.letterSpacing
747
744
  }),
748
- ...ge
749
- }), [le]), Ee = L(() => {
745
+ ...me
746
+ }), [oe]), Ee = R(() => {
750
747
  switch (e.type) {
751
748
  case i.Image:
752
749
  case i.Audio:
@@ -764,51 +761,51 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
764
761
  case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
765
762
  default: return "h-full overflow-auto p-4";
766
763
  }
767
- }, [e.type]), De = L(() => {
764
+ }, [e.type]), De = R(() => {
768
765
  switch (e.type) {
769
- case i.PlainText: return /* @__PURE__ */ B("pre", {
770
- className: _("break-words whitespace-pre-wrap", X.body, K?.fontClassName),
766
+ case i.PlainText: return /* @__PURE__ */ H("pre", {
767
+ className: _("break-words whitespace-pre-wrap", X.body, q?.fontClassName),
771
768
  children: e.text
772
769
  });
773
- case i.Image: return /* @__PURE__ */ B(Le, {
770
+ case i.Image: return /* @__PURE__ */ H(Re, {
774
771
  url: e.url,
775
772
  fileName: r,
776
773
  loadErrorLabel: c
777
774
  });
778
- case i.Audio: return /* @__PURE__ */ B("audio", {
775
+ case i.Audio: return /* @__PURE__ */ H("audio", {
779
776
  controls: !0,
780
777
  controlsList: "nodownload",
781
778
  src: e.url,
782
779
  "aria-label": r ?? "Audio attachment",
783
780
  className: "w-full max-w-sm",
784
781
  preload: "metadata",
785
- children: e.mimeType && /* @__PURE__ */ B("source", {
782
+ children: e.mimeType && /* @__PURE__ */ H("source", {
786
783
  src: e.url,
787
784
  type: e.mimeType
788
785
  })
789
786
  });
790
- case i.Markdown: return /* @__PURE__ */ B("div", {
787
+ case i.Markdown: return /* @__PURE__ */ H("div", {
791
788
  className: "p-4",
792
- children: /* @__PURE__ */ B(p, {
789
+ children: /* @__PURE__ */ H(p, {
793
790
  content: e.text,
794
791
  isStreaming: !1,
795
- codeBlockTheme: H,
796
- codeBlockCopyLabel: j,
797
- codeBlockCopiedLabel: ie,
798
- codeBlockDownloadLabel: ae,
799
- tableScrollRegionAriaLabel: M,
792
+ codeBlockTheme: V,
793
+ codeBlockCopyLabel: M,
794
+ codeBlockCopiedLabel: ne,
795
+ codeBlockDownloadLabel: ie,
796
+ tableScrollRegionAriaLabel: ae,
800
797
  mathScrollRegionAriaLabel: N,
801
798
  classNames: u
802
799
  })
803
800
  });
804
- case i.MarkdownTable: return /* @__PURE__ */ B(p, {
801
+ case i.MarkdownTable: return /* @__PURE__ */ H(p, {
805
802
  content: e.text,
806
803
  isStreaming: !1,
807
- codeBlockTheme: H,
808
- codeBlockCopyLabel: j,
809
- codeBlockCopiedLabel: ie,
810
- codeBlockDownloadLabel: ae,
811
- tableScrollRegionAriaLabel: M,
804
+ codeBlockTheme: V,
805
+ codeBlockCopyLabel: M,
806
+ codeBlockCopiedLabel: ne,
807
+ codeBlockDownloadLabel: ie,
808
+ tableScrollRegionAriaLabel: ae,
812
809
  mathScrollRegionAriaLabel: N,
813
810
  containerClassName: "flex h-full min-h-0 flex-col",
814
811
  classNames: {
@@ -817,49 +814,52 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
817
814
  tableScrollContainer: "max-h-full"
818
815
  },
819
816
  tableActionLabels: {
820
- copyLabel: ee,
821
- copiedLabel: te,
822
- downloadCsvLabel: ne
817
+ copyLabel: j,
818
+ copiedLabel: ee,
819
+ downloadCsvLabel: te
823
820
  },
824
- tableDownloadFilename: ue
821
+ tableDownloadFilename: le
825
822
  });
826
- case i.Json: return /* @__PURE__ */ B("div", {
827
- dir: "ltr",
828
- className: "h-full overflow-auto",
829
- children: /* @__PURE__ */ B("div", {
830
- className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
831
- children: /* @__PURE__ */ B(se, {
832
- data: e.value,
833
- style: {
834
- container: _("whitespace-pre-wrap break-words p-2", K?.jsonClassName ?? "dial-code-text"),
835
- basicChildStyle: ce.basicChildStyle,
836
- childFieldsContainer: "m-0 ps-3",
837
- label: _("me-1 font-semibold", X.jsonLabel),
838
- clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline", X.jsonClickableLabel),
839
- nullValue: _("italic", X.jsonNullValue),
840
- undefinedValue: _("italic", X.jsonNullValue),
841
- stringValue: X.jsonStringValue,
842
- booleanValue: X.jsonBooleanValue,
843
- numberValue: X.jsonNumberValue,
844
- otherValue: _("italic", X.jsonNullValue),
845
- punctuation: _("me-1", X.jsonPunctuation),
846
- collapseIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonCollapseIcon),
847
- expandIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonExpandIcon),
848
- collapsedContent: _("me-1 cursor-pointer rounded px-1", X.jsonCollapsedContent)
849
- }
823
+ case i.Json: {
824
+ let t = q?.jsonLabelClassName ?? (q?.jsonClassName ? void 0 : "dial-code-semi-text");
825
+ return /* @__PURE__ */ H("div", {
826
+ dir: "ltr",
827
+ className: "h-full overflow-auto",
828
+ children: /* @__PURE__ */ H("div", {
829
+ className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
830
+ children: /* @__PURE__ */ H(se, {
831
+ data: e.value,
832
+ style: {
833
+ container: _("whitespace-pre-wrap break-words p-2", q?.jsonClassName ?? "dial-code-text"),
834
+ basicChildStyle: ce.basicChildStyle,
835
+ childFieldsContainer: "m-0 ps-3",
836
+ label: _("me-1", t, X.jsonLabel),
837
+ clickableLabel: _("me-1 cursor-pointer hover:underline", t, X.jsonClickableLabel),
838
+ nullValue: _("italic", X.jsonNullValue),
839
+ undefinedValue: _("italic", X.jsonNullValue),
840
+ stringValue: X.jsonStringValue,
841
+ booleanValue: X.jsonBooleanValue,
842
+ numberValue: X.jsonNumberValue,
843
+ otherValue: _("italic", X.jsonNullValue),
844
+ punctuation: _("me-1", X.jsonPunctuation),
845
+ collapseIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonCollapseIcon),
846
+ expandIcon: _("me-1 cursor-pointer select-none transition-colors", X.jsonExpandIcon),
847
+ collapsedContent: _("dial-caption-text me-1 cursor-pointer rounded px-1", X.jsonCollapsedContent)
848
+ }
849
+ })
850
850
  })
851
- })
852
- });
853
- case i.Code: return /* @__PURE__ */ B(he, {
851
+ });
852
+ }
853
+ case i.Code: return /* @__PURE__ */ H(he, {
854
854
  content: e,
855
- codeBlockTheme: H,
855
+ codeBlockTheme: V,
856
856
  labels: {
857
857
  loadingLabel: E,
858
- errorLabel: k,
858
+ errorLabel: D,
859
859
  retryLabel: A
860
860
  }
861
861
  });
862
- case i.Html: return /* @__PURE__ */ B(ve, {
862
+ case i.Html: return /* @__PURE__ */ H(ve, {
863
863
  content: e,
864
864
  labels: {
865
865
  htmlFrameBlockedLabel: f,
@@ -867,26 +867,26 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
867
867
  },
868
868
  isSourceView: a,
869
869
  title: r,
870
- codeBlockTheme: H
870
+ codeBlockTheme: V
871
871
  });
872
- case i.Pdf: return /* @__PURE__ */ B(s, {
873
- retryKey: _e,
874
- onRetry: xe,
872
+ case i.Pdf: return /* @__PURE__ */ H(s, {
873
+ retryKey: ge,
874
+ onRetry: be,
875
875
  labels: {
876
876
  loadingLabel: x,
877
877
  errorLabel: S,
878
878
  retryLabel: w
879
879
  },
880
- children: /* @__PURE__ */ B(be, {
880
+ children: /* @__PURE__ */ H(ye, {
881
881
  fileName: r,
882
882
  url: e.url,
883
883
  highlights: e.highlights ?? [],
884
884
  selectedHighlightId: e.selectedHighlightId,
885
885
  selectedPageNumber: e.page,
886
- loadPdf: de,
886
+ loadPdf: ue,
887
887
  onLoadError: J,
888
- hideHeader: U,
889
- configurePdfWorker: W,
888
+ hideHeader: W,
889
+ configurePdfWorker: G,
890
890
  labels: {
891
891
  thumbnailsLabel: g,
892
892
  showThumbnailsLabel: v,
@@ -897,39 +897,40 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
897
897
  retryLabel: w
898
898
  }
899
899
  })
900
- }, `${e.url}#${Ce}`);
901
- case i.Ooxml: return /* @__PURE__ */ B(Oe, {
900
+ }, `${e.url}#${Se}`);
901
+ case i.Ooxml: return /* @__PURE__ */ H(ke, {
902
902
  content: e,
903
903
  fileName: r,
904
904
  loadErrorLabel: c,
905
905
  formulaLabel: T,
906
- formulaLabelClassName: K?.xlsxFormulaLabelClassName ?? "dial-italic-text",
906
+ formulaLabelClassName: q?.xlsxFormulaLabelClassName ?? "dial-italic-text",
907
+ formulaValueClassName: q?.xlsxFormulaValueClassName ?? "dial-code-text",
907
908
  highlightsLabel: P,
908
- highlightNavigatedLabel: oe
909
+ highlightNavigatedLabel: F
909
910
  });
910
911
  case i.Visualizer:
911
- case i.GroupedVisualizer: return /* @__PURE__ */ B(Fe, {
912
+ case i.GroupedVisualizer: return /* @__PURE__ */ H(Ie, {
912
913
  content: e,
913
914
  errorLabel: d,
914
- onSendMessage: pe
915
+ onSendMessage: fe
915
916
  });
916
- case i.McpApp: return /* @__PURE__ */ B(we, {
917
+ case i.McpApp: return /* @__PURE__ */ H(we, {
917
918
  content: e,
918
- onAppInfo: fe
919
+ onAppInfo: de
919
920
  });
920
- case i.Unsupported: return /* @__PURE__ */ B("p", {
921
+ case i.Unsupported: return /* @__PURE__ */ H("p", {
921
922
  className: _("text-center", X.statusLabel),
922
923
  children: o
923
924
  });
924
925
  case i.Error: {
925
926
  let t = e.errorType === n.Forbidden;
926
- return /* @__PURE__ */ V("div", {
927
+ return /* @__PURE__ */ U("div", {
927
928
  className: "flex flex-col items-center gap-2",
928
- children: [B(t ? re : O, {
929
+ children: [H(t ? re : k, {
929
930
  size: 60,
930
931
  stroke: C,
931
932
  className: X.errorIcon
932
- }), /* @__PURE__ */ B("p", {
933
+ }), /* @__PURE__ */ H("p", {
933
934
  className: _("text-center", X.statusLabel),
934
935
  children: t ? l : c
935
936
  })]
@@ -938,24 +939,26 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
938
939
  }
939
940
  }, [
940
941
  e,
941
- K?.fontClassName,
942
- K?.jsonClassName,
943
- K?.xlsxFormulaLabelClassName,
942
+ q?.fontClassName,
943
+ q?.jsonClassName,
944
+ q?.jsonLabelClassName,
945
+ q?.xlsxFormulaLabelClassName,
946
+ q?.xlsxFormulaValueClassName,
944
947
  r,
945
- H,
948
+ V,
946
949
  o,
947
950
  c,
948
951
  l,
949
952
  d,
950
- pe,
953
+ fe,
951
954
  f,
952
955
  h,
953
956
  a,
957
+ le,
954
958
  ue,
955
- de,
956
- U,
957
959
  W,
958
- fe,
960
+ G,
961
+ de,
959
962
  g,
960
963
  v,
961
964
  y,
@@ -965,68 +968,68 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
965
968
  w,
966
969
  T,
967
970
  E,
968
- k,
971
+ D,
969
972
  A,
973
+ ye,
974
+ ge,
970
975
  be,
971
- _e,
972
- xe,
973
- Ce,
976
+ Se,
974
977
  J,
978
+ j,
975
979
  ee,
976
980
  te,
981
+ M,
977
982
  ne,
978
- j,
979
983
  ie,
980
984
  ae,
981
- M,
982
985
  N,
983
986
  P,
984
- oe
987
+ F
985
988
  ]);
986
- return /* @__PURE__ */ B("div", {
987
- style: !t && Re.has(e.type) ? Te : void 0,
988
- className: _(t ? "flex h-full items-center justify-center" : Ee, me),
989
- children: t ? /* @__PURE__ */ B(D, {}) : De
989
+ return /* @__PURE__ */ H("div", {
990
+ style: !t && ze.has(e.type) ? Te : void 0,
991
+ className: _(t ? "flex h-full items-center justify-center" : Ee, pe),
992
+ children: t ? /* @__PURE__ */ H(O, {}) : De
990
993
  });
991
- }), Be = {
994
+ }), Ve = {
992
995
  mcpAppDivider: "_mcpAppDivider_1jh5p_1",
993
996
  mcpAppVersion: "_mcpAppVersion_1jh5p_5"
994
- }, Ve = 2e3, He = P(({ 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: g = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: y = "Copied!", visualizerErrorLabel: w, 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: k = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: re = "Open in new tab", htmlViewSourceLabel: M = "View source", htmlViewRenderedLabel: N = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: oe, pdfShowThumbnailsLabel: se, pdfHideThumbnailsLabel: ce, pdfPageNumberLabel: H, pdfContentLoadingLabel: ue, pdfContentErrorLabel: de, pdfContentRetryLabel: U, xlsxFormulaLabel: W, codeContentLoadingLabel: fe, codeContentErrorLabel: G, codeContentRetryLabel: K, tableCopyLabel: me, tableCopiedLabel: he, tableDownloadCsvLabel: ge, codeBlockCopyLabel: _e, codeBlockCopiedLabel: ve, codeBlockDownloadLabel: ye, tableScrollRegionAriaLabel: be, mathScrollRegionAriaLabel: xe, ooxmlHighlightsLabel: Se, ooxmlHighlightNavigatedLabel: Ce }, onDownload: q, onCopyText: we, onCopyMarkdown: J, onCopyJson: Y, tableDownloadFilename: Te, isMobile: Ee = !1, defaultWidth: De, minWidth: Oe = 600, maxWidth: ke = 1500, onResizeStop: Ae, styles: je, codeBlockTheme: Me, loadPdf: Ne, configurePdfWorker: Pe, onVisualizerSendMessage: Fe }) => {
995
- let [X, Ie] = z(!1), [Le, Re] = z(!1), [He, Ue] = z(!1), [Z, We] = z(!1), [Ge, Ke] = z(void 0), qe = R(null), Q = R(null), Je = R(null), Ye = F(() => {
996
- we?.(), qe.current != null && clearTimeout(qe.current), Ie(!0), qe.current = setTimeout(() => Ie(!1), Ve);
997
- }, [we]), Xe = F(() => {
998
- J?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), Ve);
999
- }, [J]), Ze = F(() => {
1000
- Y?.(), Je.current != null && clearTimeout(Je.current), Ue(!0), Je.current = setTimeout(() => Ue(!1), Ve);
997
+ }, He = 2e3, Ue = F(({ 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: g = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: y = "Copied!", visualizerErrorLabel: w, 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: k = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: A = "Open in new tab", htmlViewSourceLabel: re = "View source", htmlViewRenderedLabel: N = "View rendered", mcpAppReloadLabel: P = "Reload", pdfThumbnailsLabel: F, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: ce, pdfContentLoadingLabel: le, pdfContentErrorLabel: ue, pdfContentRetryLabel: W, xlsxFormulaLabel: G, codeContentLoadingLabel: de, codeContentErrorLabel: fe, codeContentRetryLabel: q, tableCopyLabel: pe, tableCopiedLabel: me, tableDownloadCsvLabel: he, codeBlockCopyLabel: ge, codeBlockCopiedLabel: _e, codeBlockDownloadLabel: ve, tableScrollRegionAriaLabel: ye, mathScrollRegionAriaLabel: be, ooxmlHighlightsLabel: xe, ooxmlHighlightNavigatedLabel: Se }, onDownload: Ce, onCopyText: J, onCopyMarkdown: we, onCopyJson: Y, tableDownloadFilename: Te, isMobile: Ee = !1, defaultWidth: De, minWidth: Oe = 600, maxWidth: ke = 1500, onResizeStop: Ae, styles: je, codeBlockTheme: Me, loadPdf: Ne, configurePdfWorker: Pe, onVisualizerSendMessage: Fe }) => {
998
+ let [Ie, X] = B(!1), [Le, Re] = B(!1), [ze, Ue] = B(!1), [We, Z] = B(!1), [Ge, Ke] = B(void 0), qe = z(null), Je = z(null), Q = z(null), Ye = I(() => {
999
+ J?.(), qe.current != null && clearTimeout(qe.current), X(!0), qe.current = setTimeout(() => X(!1), He);
1000
+ }, [J]), Xe = I(() => {
1001
+ we?.(), Je.current != null && clearTimeout(Je.current), Re(!0), Je.current = setTimeout(() => Re(!1), He);
1002
+ }, [we]), Ze = I(() => {
1003
+ Y?.(), Q.current != null && clearTimeout(Q.current), Ue(!0), Q.current = setTimeout(() => Ue(!1), He);
1001
1004
  }, [Y]);
1002
- I(() => () => {
1003
- qe.current != null && clearTimeout(qe.current), Q.current != null && clearTimeout(Q.current), Je.current != null && clearTimeout(Je.current);
1005
+ L(() => () => {
1006
+ qe.current != null && clearTimeout(qe.current), Je.current != null && clearTimeout(Je.current), Q.current != null && clearTimeout(Q.current);
1004
1007
  }, []);
1005
- let Qe = F(() => {
1006
- We((e) => !e);
1008
+ let Qe = I(() => {
1009
+ Z((e) => !e);
1007
1010
  }, []);
1008
- I(() => {
1009
- We(!1), Ke(void 0);
1011
+ L(() => {
1012
+ Z(!1), Ke(void 0);
1010
1013
  }, [r]);
1011
- let { className: $e, panelStyles: $, ...et } = je ?? {}, { colors: tt, typography: nt } = et, rt = L(() => m({
1014
+ let { className: $e, panelStyles: et, ...$ } = je ?? {}, { colors: tt, typography: nt } = $, rt = R(() => m({
1012
1015
  "--ac-mcp-app-divider": tt?.mcpAppDividerColor,
1013
1016
  "--ac-mcp-app-version": tt?.mcpAppVersionColor
1014
- }), [tt?.mcpAppDividerColor, tt?.mcpAppVersionColor]), it = r.type === i.McpApp && Ge != null ? /* @__PURE__ */ V("span", {
1017
+ }), [tt?.mcpAppDividerColor, tt?.mcpAppVersionColor]), it = r.type === i.McpApp && Ge != null ? /* @__PURE__ */ U("span", {
1015
1018
  style: rt,
1016
1019
  children: [
1017
- /* @__PURE__ */ B("span", { children: a }),
1018
- /* @__PURE__ */ B("span", {
1020
+ /* @__PURE__ */ H("span", { children: a }),
1021
+ /* @__PURE__ */ H("span", {
1019
1022
  "aria-hidden": !0,
1020
- className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Be.mcpAppDivider)
1023
+ className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Ve.mcpAppDivider)
1021
1024
  }),
1022
- /* @__PURE__ */ B("span", { children: Ge.name }),
1023
- Ge.version && /* @__PURE__ */ B("span", {
1024
- className: _("ms-2", nt?.mcpAppVersionClassName ?? "dial-caption-text", Be.mcpAppVersion),
1025
+ /* @__PURE__ */ H("span", { children: Ge.name }),
1026
+ Ge.version && /* @__PURE__ */ H("span", {
1027
+ className: _("ms-2", nt?.mcpAppVersionClassName ?? "dial-caption-text", Ve.mcpAppVersion),
1025
1028
  children: Ge.version
1026
1029
  })
1027
1030
  ]
1028
- }) : a, at = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), ot = !t && we != null && (r.type === i.PlainText || r.type === i.Code), st = !t && J != null && r.type === i.Markdown, ct = !t && Y != null && r.type === i.Json, lt = !t && q != null && o(r), ut = !t && r.type === i.McpApp && r.onReload != null;
1029
- return /* @__PURE__ */ B(x, {
1031
+ }) : a, at = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), ot = !t && J != null && (r.type === i.PlainText || r.type === i.Code), st = !t && we != null && r.type === i.Markdown, ct = !t && Y != null && r.type === i.Json, lt = !t && Ce != null && o(r), ut = !t && r.type === i.McpApp && r.onReload != null;
1032
+ return /* @__PURE__ */ H(x, {
1030
1033
  isOpen: e,
1031
1034
  orientation: b.Right,
1032
1035
  title: it,
@@ -1042,15 +1045,15 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1042
1045
  maxWidth: ke,
1043
1046
  onResizeStop: Ae,
1044
1047
  styles: {
1045
- ...$,
1046
- titleClassName: $?.titleClassName ?? "dial-h3-text",
1047
- headerClassName: _("border-b border-tertiary", $?.headerClassName),
1048
- className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $e, $?.className, pe.panel)
1048
+ ...et,
1049
+ titleClassName: et?.titleClassName ?? "dial-h3-text",
1050
+ headerClassName: _("border-b border-tertiary", et?.headerClassName),
1051
+ className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $e, et?.className, K.panel)
1049
1052
  },
1050
1053
  leftActions: s,
1051
- rightActions: at || ot || st || ct || lt || ut ? /* @__PURE__ */ V(le, { children: [
1052
- ut && /* @__PURE__ */ B(T, {
1053
- icon: /* @__PURE__ */ B(ae, {
1054
+ rightActions: at || ot || st || ct || lt || ut ? /* @__PURE__ */ U(V, { children: [
1055
+ ut && /* @__PURE__ */ H(T, {
1056
+ icon: /* @__PURE__ */ H(ae, {
1054
1057
  size: S.LG,
1055
1058
  stroke: C,
1056
1059
  "aria-hidden": !0
@@ -1059,29 +1062,29 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1059
1062
  tooltipProps: { tooltip: P },
1060
1063
  onClick: r.type === i.McpApp ? r.onReload : void 0
1061
1064
  }),
1062
- at && /* @__PURE__ */ B(T, {
1063
- icon: B(Z ? j : ee, {
1065
+ at && /* @__PURE__ */ H(T, {
1066
+ icon: H(We ? ne : ee, {
1064
1067
  size: S.LG,
1065
1068
  stroke: C,
1066
1069
  "aria-hidden": !0
1067
1070
  }),
1068
- "aria-label": Z ? N : M,
1069
- "aria-pressed": Z,
1070
- tooltipProps: { tooltip: Z ? N : M },
1071
+ "aria-label": We ? N : re,
1072
+ "aria-pressed": We,
1073
+ tooltipProps: { tooltip: We ? N : re },
1071
1074
  onClick: Qe
1072
1075
  }),
1073
- ot && /* @__PURE__ */ B(T, {
1074
- icon: B(X ? A : te, {
1076
+ ot && /* @__PURE__ */ H(T, {
1077
+ icon: H(Ie ? j : te, {
1075
1078
  size: S.LG,
1076
1079
  stroke: C,
1077
1080
  "aria-hidden": !0
1078
1081
  }),
1079
- "aria-label": X ? p : f,
1080
- tooltipProps: { tooltip: X ? p : f },
1082
+ "aria-label": Ie ? p : f,
1083
+ tooltipProps: { tooltip: Ie ? p : f },
1081
1084
  onClick: Ye
1082
1085
  }),
1083
- st && /* @__PURE__ */ B(T, {
1084
- icon: B(Le ? A : ie, {
1086
+ st && /* @__PURE__ */ H(T, {
1087
+ icon: H(Le ? j : ie, {
1085
1088
  size: S.LG,
1086
1089
  stroke: C,
1087
1090
  "aria-hidden": !0
@@ -1090,31 +1093,31 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1090
1093
  tooltipProps: { tooltip: Le ? g : h },
1091
1094
  onClick: Xe
1092
1095
  }),
1093
- ct && /* @__PURE__ */ B(T, {
1094
- icon: B(He ? A : te, {
1096
+ ct && /* @__PURE__ */ H(T, {
1097
+ icon: H(ze ? j : te, {
1095
1098
  size: S.LG,
1096
1099
  stroke: C,
1097
1100
  "aria-hidden": !0
1098
1101
  }),
1099
- "aria-label": He ? y : v,
1100
- tooltipProps: { tooltip: He ? y : v },
1102
+ "aria-label": ze ? y : v,
1103
+ tooltipProps: { tooltip: ze ? y : v },
1101
1104
  onClick: Ze
1102
1105
  }),
1103
- lt && /* @__PURE__ */ B(T, {
1104
- icon: /* @__PURE__ */ B(ne, {
1106
+ lt && /* @__PURE__ */ H(T, {
1107
+ icon: /* @__PURE__ */ H(M, {
1105
1108
  size: S.LG,
1106
1109
  stroke: C
1107
1110
  }),
1108
1111
  "aria-label": d,
1109
1112
  tooltipProps: { tooltip: d },
1110
- onClick: q
1113
+ onClick: Ce
1111
1114
  })
1112
1115
  ] }) : null,
1113
- children: /* @__PURE__ */ B(ze, {
1116
+ children: /* @__PURE__ */ H(Be, {
1114
1117
  content: r,
1115
1118
  isLoading: t,
1116
1119
  fileName: a,
1117
- isHtmlSourceView: Z,
1120
+ isHtmlSourceView: We,
1118
1121
  onAppInfo: r.type === i.McpApp ? Ke : void 0,
1119
1122
  labels: {
1120
1123
  unsupportedLabel: E,
@@ -1122,30 +1125,30 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1122
1125
  forbiddenErrorLabel: O,
1123
1126
  visualizerErrorLabel: w,
1124
1127
  htmlFrameBlockedLabel: k,
1125
- htmlOpenInNewTabLabel: re,
1126
- pdfThumbnailsLabel: oe,
1127
- pdfShowThumbnailsLabel: se,
1128
- pdfHideThumbnailsLabel: ce,
1129
- pdfPageNumberLabel: H,
1130
- pdfContentLoadingLabel: ue,
1131
- pdfContentErrorLabel: de,
1132
- pdfContentRetryLabel: U,
1133
- xlsxFormulaLabel: W,
1134
- codeContentLoadingLabel: fe,
1135
- codeContentErrorLabel: G,
1136
- codeContentRetryLabel: K,
1137
- tableCopyLabel: me,
1138
- tableCopiedLabel: he,
1139
- tableDownloadCsvLabel: ge,
1140
- codeBlockCopyLabel: _e,
1141
- codeBlockCopiedLabel: ve,
1142
- codeBlockDownloadLabel: ye,
1143
- tableScrollRegionAriaLabel: be,
1144
- mathScrollRegionAriaLabel: xe,
1145
- ooxmlHighlightsLabel: Se,
1146
- ooxmlHighlightNavigatedLabel: Ce
1128
+ htmlOpenInNewTabLabel: A,
1129
+ pdfThumbnailsLabel: F,
1130
+ pdfShowThumbnailsLabel: oe,
1131
+ pdfHideThumbnailsLabel: se,
1132
+ pdfPageNumberLabel: ce,
1133
+ pdfContentLoadingLabel: le,
1134
+ pdfContentErrorLabel: ue,
1135
+ pdfContentRetryLabel: W,
1136
+ xlsxFormulaLabel: G,
1137
+ codeContentLoadingLabel: de,
1138
+ codeContentErrorLabel: fe,
1139
+ codeContentRetryLabel: q,
1140
+ tableCopyLabel: pe,
1141
+ tableCopiedLabel: me,
1142
+ tableDownloadCsvLabel: he,
1143
+ codeBlockCopyLabel: ge,
1144
+ codeBlockCopiedLabel: _e,
1145
+ codeBlockDownloadLabel: ve,
1146
+ tableScrollRegionAriaLabel: ye,
1147
+ mathScrollRegionAriaLabel: be,
1148
+ ooxmlHighlightsLabel: xe,
1149
+ ooxmlHighlightNavigatedLabel: Se
1147
1150
  },
1148
- styles: et,
1151
+ styles: $,
1149
1152
  codeBlockTheme: Me,
1150
1153
  tableDownloadFilename: Te,
1151
1154
  loadPdf: Ne,
@@ -1153,21 +1156,21 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1153
1156
  onVisualizerSendMessage: Fe
1154
1157
  })
1155
1158
  });
1156
- }), Ue = /* @__PURE__ */ new Set(["html", "htm"]), Z = {
1159
+ }), We = /* @__PURE__ */ new Set(["html", "htm"]), Z = {
1157
1160
  docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1158
1161
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1159
1162
  pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
1160
- }, We = /* @__PURE__ */ 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(".")), Ge = {
1163
+ }, Ge = /* @__PURE__ */ 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(".")), Ke = {
1161
1164
  docx: r.Docx,
1162
1165
  xlsx: r.Xlsx,
1163
1166
  pptx: r.Pptx,
1164
1167
  csv: r.Csv
1165
- }, Ke = {
1168
+ }, qe = {
1166
1169
  [Z.docx]: r.Docx,
1167
1170
  [Z.xlsx]: r.Xlsx,
1168
1171
  [Z.pptx]: r.Pptx,
1169
1172
  [f.CSV]: r.Csv
1170
- }, qe = {
1173
+ }, Je = {
1171
1174
  [r.Docx]: Z.docx,
1172
1175
  [r.Xlsx]: Z.xlsx,
1173
1176
  [r.Pptx]: Z.pptx,
@@ -1175,21 +1178,21 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1175
1178
  }, Q = (e, t) => {
1176
1179
  let n = t?.split(";", 1)[0].trim().toLowerCase();
1177
1180
  if (n != null) {
1178
- let e = Ke[n];
1181
+ let e = qe[n];
1179
1182
  if (e != null) return e;
1180
1183
  }
1181
1184
  let r = e.lastIndexOf(".");
1182
- if (r !== -1) return Ge[e.slice(r + 1).toLowerCase()];
1183
- }, Je = (e, t) => Q(e, t) != null, Ye = (e, t) => {
1185
+ if (r !== -1) return Ke[e.slice(r + 1).toLowerCase()];
1186
+ }, Ye = (e, t) => Q(e, t) != null, Xe = (e, t) => {
1184
1187
  let n = Q(e, t);
1185
- return n == null ? void 0 : qe[n];
1186
- }, Xe = (e) => {
1187
- let t = e.lastIndexOf(".");
1188
- return t !== -1 && We.has(e.slice(t + 1).toLowerCase());
1188
+ return n == null ? void 0 : Je[n];
1189
1189
  }, Ze = (e) => {
1190
1190
  let t = e.lastIndexOf(".");
1191
- return t !== -1 && Ue.has(e.slice(t + 1).toLowerCase());
1192
- }, Qe = {
1191
+ return t !== -1 && Ge.has(e.slice(t + 1).toLowerCase());
1192
+ }, Qe = (e) => {
1193
+ let t = e.lastIndexOf(".");
1194
+ return t !== -1 && We.has(e.slice(t + 1).toLowerCase());
1195
+ }, $e = {
1193
1196
  xml: "xml",
1194
1197
  csv: "plaintext",
1195
1198
  tsv: "plaintext",
@@ -1237,47 +1240,47 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
1237
1240
  gitignore: "plaintext",
1238
1241
  dockerfile: "plaintext",
1239
1242
  makefile: "plaintext"
1240
- }, $e = (e) => Qe[e], $ = (e) => ({
1243
+ }, et = (e) => $e[e], $ = (e) => ({
1241
1244
  type: i.Unsupported,
1242
1245
  ...e != null && { url: e }
1243
- }), et = (e) => ({
1246
+ }), tt = (e) => ({
1244
1247
  type: i.Error,
1245
1248
  errorType: n.LoadFailed,
1246
1249
  ...e != null && { url: e }
1247
- }), tt = (e) => ({
1250
+ }), nt = (e) => ({
1248
1251
  type: i.Error,
1249
1252
  errorType: n.Forbidden,
1250
1253
  ...e != null && { url: e }
1251
- }), nt = (e) => {
1254
+ }), rt = (e) => {
1252
1255
  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;
1253
- }, rt = (e) => {
1254
- let t = nt(e);
1256
+ }, it = (e) => {
1257
+ let t = rt(e);
1255
1258
  t != null && URL.revokeObjectURL(t);
1256
- }, it = {
1259
+ }, at = {
1257
1260
  type: i.PlainText,
1258
1261
  text: ""
1259
- }, at = M(void 0);
1260
- at.displayName = "AttachmentCanvasContext";
1261
- var ot = M(void 0), st = ({ children: e }) => {
1262
- let t = R(0), n = F(() => {
1262
+ }, ot = N(void 0);
1263
+ ot.displayName = "AttachmentCanvasContext";
1264
+ var st = N(void 0), ct = ({ children: e }) => {
1265
+ let t = z(0), n = I(() => {
1263
1266
  let e = ++t.current;
1264
1267
  return () => e === t.current;
1265
1268
  }, []);
1266
- I(() => () => {
1269
+ L(() => () => {
1267
1270
  t.current += 1;
1268
1271
  }, []);
1269
- let [r, i] = z(!1), [a, o] = z(!1), [s, c] = z(it), [l, u] = z(void 0), [d, f] = z(void 0), p = F((e, t) => {
1272
+ let [r, i] = B(!1), [a, o] = B(!1), [s, c] = B(at), [l, u] = B(void 0), [d, f] = B(void 0), p = I((e, t) => {
1270
1273
  u(e), f(t), o(!0), i(!0);
1271
- }, []), m = F((e, t, n) => {
1274
+ }, []), m = I((e, t, n) => {
1272
1275
  c(e), u(t), f(n), o(!1), i(!0);
1273
- }, []), h = F(() => {
1274
- c(it), i(!1), o(!1), f(void 0);
1276
+ }, []), h = I(() => {
1277
+ c(at), i(!1), o(!1), f(void 0);
1275
1278
  }, []);
1276
- return I(() => () => {
1277
- let e = nt(s);
1279
+ return L(() => () => {
1280
+ let e = rt(s);
1278
1281
  e != null && URL.revokeObjectURL(e);
1279
- }, [s]), /* @__PURE__ */ B(at.Provider, {
1280
- value: L(() => ({
1282
+ }, [s]), /* @__PURE__ */ H(ot.Provider, {
1283
+ value: R(() => ({
1281
1284
  isOpen: r,
1282
1285
  isLoading: a,
1283
1286
  content: s,
@@ -1296,41 +1299,41 @@ var ot = M(void 0), st = ({ children: e }) => {
1296
1299
  m,
1297
1300
  h
1298
1301
  ]),
1299
- children: /* @__PURE__ */ B(ot.Provider, {
1302
+ children: /* @__PURE__ */ H(st.Provider, {
1300
1303
  value: n,
1301
1304
  children: e
1302
1305
  })
1303
1306
  });
1304
- }, ct = () => {
1305
- let e = oe(at);
1306
- if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1307
- return e;
1308
1307
  }, lt = () => {
1309
1308
  let e = oe(ot);
1309
+ if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
1310
+ return e;
1311
+ }, ut = () => {
1312
+ let e = oe(st);
1310
1313
  if (!e) throw Error("useLatestCanvasRequest must be used within an AttachmentCanvasProvider");
1311
- let t = R(void 0);
1312
- return I(() => (t.current = {}, () => {
1314
+ let t = z(void 0);
1315
+ return L(() => (t.current = {}, () => {
1313
1316
  t.current = void 0;
1314
- }), []), F(() => {
1317
+ }), []), I(() => {
1315
1318
  let n = t.current, r = e();
1316
1319
  return () => n !== void 0 && t.current === n && r();
1317
1320
  }, [e]);
1318
- }, ut = P(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, minWidth: o, maxWidth: s, codeBlockTheme: c, tableDownloadFilename: l, loadPdf: u, configurePdfWorker: d, onVisualizerSendMessage: f }) => {
1319
- let { ariaLabel: p = "Attachment preview", closeLabel: m = "Close", downloadLabel: g = "Download", unsupportedLabel: _ = "Preview is not supported for this file", loadErrorLabel: v = "Failed to load file", forbiddenErrorLabel: y = "You don't have permission to access this file", copyTextLabel: b, copiedTextLabel: x, copyMarkdownLabel: S, copiedMarkdownLabel: C, copyJsonLabel: w, copiedJsonLabel: T, htmlFrameBlockedLabel: E, htmlOpenInNewTabLabel: D, htmlViewSourceLabel: O, htmlViewRenderedLabel: k, pdfThumbnailsLabel: A, pdfShowThumbnailsLabel: ee, pdfHideThumbnailsLabel: te, pdfPageNumberLabel: ne, pdfContentLoadingLabel: j, pdfContentErrorLabel: re, pdfContentRetryLabel: ie, xlsxFormulaLabel: ae, codeContentLoadingLabel: M, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: oe, tableCopiedLabel: I, tableDownloadCsvLabel: L, codeBlockCopyLabel: R, codeBlockCopiedLabel: z, codeBlockDownloadLabel: se, tableScrollRegionAriaLabel: ce, mathScrollRegionAriaLabel: le, ooxmlHighlightsLabel: V, ooxmlHighlightNavigatedLabel: H } = e ?? {}, { isOpen: ue, isLoading: de, content: U, fileName: W, closeCanvas: fe } = ct(), pe = F(() => {
1320
- a(U, W);
1321
- }, [U, W]), G = F(() => {
1322
- (U.type === i.PlainText || U.type === i.Code) && h(U.text);
1323
- }, [U]), K = F(() => {
1324
- U.type === i.Markdown && h(U.text);
1325
- }, [U]), me = F(() => {
1326
- U.type === i.Json && h(JSON.stringify(U.value, null, 2));
1327
- }, [U]);
1328
- return /* @__PURE__ */ B(He, {
1329
- isOpen: ue,
1330
- isLoading: de,
1331
- onClose: fe,
1332
- content: U,
1333
- fileName: W,
1321
+ }, dt = F(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, minWidth: o, maxWidth: s, codeBlockTheme: c, tableDownloadFilename: l, loadPdf: u, configurePdfWorker: d, onVisualizerSendMessage: f }) => {
1322
+ let { ariaLabel: p = "Attachment preview", closeLabel: m = "Close", downloadLabel: g = "Download", unsupportedLabel: _ = "Preview is not supported for this file", loadErrorLabel: v = "Failed to load file", forbiddenErrorLabel: y = "You don't have permission to access this file", copyTextLabel: b, copiedTextLabel: x, copyMarkdownLabel: S, copiedMarkdownLabel: C, copyJsonLabel: w, copiedJsonLabel: T, htmlFrameBlockedLabel: E, htmlOpenInNewTabLabel: D, htmlViewSourceLabel: O, htmlViewRenderedLabel: k, pdfThumbnailsLabel: A, pdfShowThumbnailsLabel: j, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: M, pdfContentErrorLabel: ne, pdfContentRetryLabel: re, xlsxFormulaLabel: ie, codeContentLoadingLabel: ae, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: F, tableCopiedLabel: oe, tableDownloadCsvLabel: L, codeBlockCopyLabel: R, codeBlockCopiedLabel: z, codeBlockDownloadLabel: B, tableScrollRegionAriaLabel: se, mathScrollRegionAriaLabel: ce, ooxmlHighlightsLabel: V, ooxmlHighlightNavigatedLabel: U } = e ?? {}, { isOpen: le, isLoading: ue, content: W, fileName: G, closeCanvas: de } = lt(), fe = I(() => {
1323
+ a(W, G);
1324
+ }, [W, G]), K = I(() => {
1325
+ (W.type === i.PlainText || W.type === i.Code) && h(W.text);
1326
+ }, [W]), q = I(() => {
1327
+ W.type === i.Markdown && h(W.text);
1328
+ }, [W]), pe = I(() => {
1329
+ W.type === i.Json && h(JSON.stringify(W.value, null, 2));
1330
+ }, [W]);
1331
+ return /* @__PURE__ */ H(Ue, {
1332
+ isOpen: le,
1333
+ isLoading: ue,
1334
+ onClose: de,
1335
+ content: W,
1336
+ fileName: G,
1334
1337
  leftActions: t,
1335
1338
  labels: {
1336
1339
  ariaLabel: p,
@@ -1350,31 +1353,31 @@ var ot = M(void 0), st = ({ children: e }) => {
1350
1353
  htmlViewSourceLabel: O,
1351
1354
  htmlViewRenderedLabel: k,
1352
1355
  pdfThumbnailsLabel: A,
1353
- pdfShowThumbnailsLabel: ee,
1354
- pdfHideThumbnailsLabel: te,
1355
- pdfPageNumberLabel: ne,
1356
- pdfContentLoadingLabel: j,
1357
- pdfContentErrorLabel: re,
1358
- pdfContentRetryLabel: ie,
1359
- xlsxFormulaLabel: ae,
1360
- codeContentLoadingLabel: M,
1356
+ pdfShowThumbnailsLabel: j,
1357
+ pdfHideThumbnailsLabel: ee,
1358
+ pdfPageNumberLabel: te,
1359
+ pdfContentLoadingLabel: M,
1360
+ pdfContentErrorLabel: ne,
1361
+ pdfContentRetryLabel: re,
1362
+ xlsxFormulaLabel: ie,
1363
+ codeContentLoadingLabel: ae,
1361
1364
  codeContentErrorLabel: N,
1362
1365
  codeContentRetryLabel: P,
1363
- tableCopyLabel: oe,
1364
- tableCopiedLabel: I,
1366
+ tableCopyLabel: F,
1367
+ tableCopiedLabel: oe,
1365
1368
  tableDownloadCsvLabel: L,
1366
1369
  codeBlockCopyLabel: R,
1367
1370
  codeBlockCopiedLabel: z,
1368
- codeBlockDownloadLabel: se,
1369
- tableScrollRegionAriaLabel: ce,
1370
- mathScrollRegionAriaLabel: le,
1371
+ codeBlockDownloadLabel: B,
1372
+ tableScrollRegionAriaLabel: se,
1373
+ mathScrollRegionAriaLabel: ce,
1371
1374
  ooxmlHighlightsLabel: V,
1372
- ooxmlHighlightNavigatedLabel: H
1375
+ ooxmlHighlightNavigatedLabel: U
1373
1376
  },
1374
- onDownload: pe,
1375
- onCopyText: U.type === i.PlainText || U.type === i.Code ? G : void 0,
1376
- onCopyMarkdown: U.type === i.Markdown ? K : void 0,
1377
- onCopyJson: U.type === i.Json ? me : void 0,
1377
+ onDownload: fe,
1378
+ onCopyText: W.type === i.PlainText || W.type === i.Code ? K : void 0,
1379
+ onCopyMarkdown: W.type === i.Markdown ? q : void 0,
1380
+ onCopyJson: W.type === i.Json ? pe : void 0,
1378
1381
  tableDownloadFilename: l,
1379
1382
  isMobile: n,
1380
1383
  defaultWidth: r,
@@ -1385,30 +1388,30 @@ var ot = M(void 0), st = ({ children: e }) => {
1385
1388
  loadPdf: u,
1386
1389
  onVisualizerSendMessage: f
1387
1390
  });
1388
- }), dt = {
1391
+ }), ft = {
1389
1392
  frame: "_frame_1ys0b_1",
1390
1393
  header: "_header_1ys0b_6",
1391
1394
  title: "_title_1ys0b_10"
1392
- }, ft = P(({ 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, onVisualizerSendMessage: f }) => {
1395
+ }, pt = F(({ 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, onVisualizerSendMessage: f }) => {
1393
1396
  let p = e.visualizerName.trim(), h = !u && p !== "";
1394
- return /* @__PURE__ */ V("div", {
1395
- className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", dt.frame]),
1397
+ return /* @__PURE__ */ U("div", {
1398
+ className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", ft.frame]),
1396
1399
  style: m({
1397
1400
  "--igv-bg": d?.background,
1398
1401
  "--igv-border": d?.border,
1399
1402
  "--igv-title-text": d?.titleText
1400
1403
  }),
1401
- children: [/* @__PURE__ */ V("div", {
1402
- className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", dt.header]),
1403
- children: [h && /* @__PURE__ */ B("span", {
1404
- className: _("min-w-0 truncate", c, dt.title),
1404
+ children: [/* @__PURE__ */ U("div", {
1405
+ className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", ft.header]),
1406
+ children: [h && /* @__PURE__ */ H("span", {
1407
+ className: _("min-w-0 truncate", c, ft.title),
1405
1408
  children: p
1406
- }), /* @__PURE__ */ B("div", {
1409
+ }), /* @__PURE__ */ H("div", {
1407
1410
  role: "toolbar",
1408
1411
  "aria-label": i,
1409
1412
  className: "flex items-center gap-1",
1410
- children: /* @__PURE__ */ B(T, {
1411
- icon: /* @__PURE__ */ B(k, {
1413
+ children: /* @__PURE__ */ H(T, {
1414
+ icon: /* @__PURE__ */ H(A, {
1412
1415
  size: S.SM,
1413
1416
  stroke: C,
1414
1417
  "aria-hidden": !0
@@ -1418,10 +1421,10 @@ var ot = M(void 0), st = ({ children: e }) => {
1418
1421
  onClick: n
1419
1422
  })
1420
1423
  })]
1421
- }), /* @__PURE__ */ B("div", {
1424
+ }), /* @__PURE__ */ H("div", {
1422
1425
  className: "w-full",
1423
1426
  style: { height: `${t}px` },
1424
- children: /* @__PURE__ */ B(Fe, {
1427
+ children: /* @__PURE__ */ H(Ie, {
1425
1428
  content: e,
1426
1429
  loadingLabel: o,
1427
1430
  errorLabel: s,
@@ -1430,7 +1433,7 @@ var ot = M(void 0), st = ({ children: e }) => {
1430
1433
  })
1431
1434
  })]
1432
1435
  });
1433
- }), pt = (e) => {
1436
+ }), mt = (e) => {
1434
1437
  let t;
1435
1438
  try {
1436
1439
  t = new URL(e).pathname;
@@ -1443,13 +1446,13 @@ var ot = M(void 0), st = ({ children: e }) => {
1443
1446
  } catch {
1444
1447
  return n;
1445
1448
  }
1446
- }, mt = (e, t) => {
1447
- let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = ct(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = F(async (t, n, r) => {
1449
+ }, ht = (e, t) => {
1450
+ let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = lt(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = I(async (t, n, r) => {
1448
1451
  if (t.url == null && t.referenceUrl != null) {
1449
1452
  let i = e.resolveReferencePdfContent(t);
1450
1453
  if (i != null) return r(i, t.name, n);
1451
1454
  }
1452
- let a = t.contentType.toLowerCase(), c = ke(a, o);
1455
+ let a = t.contentType.toLowerCase(), c = Ae(a, o);
1453
1456
  if (c != null) {
1454
1457
  let i = await e.resolveVisualizerContent(t, c, s);
1455
1458
  if (i != null) return r(i, t.name, n);
@@ -1482,8 +1485,8 @@ var ot = M(void 0), st = ({ children: e }) => {
1482
1485
  return i != null && r(i, t.name, n);
1483
1486
  }
1484
1487
  }
1485
- let g = t.name != null && Ze(t.name) || t.url != null && Ze(pt(t.url));
1486
- if (t.name != null && !Xe(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1488
+ let g = t.name != null && Qe(t.name) || t.url != null && Qe(mt(t.url));
1489
+ if (t.name != null && !Ze(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
1487
1490
  if (g) {
1488
1491
  let a = await e.resolveHtmlContent(t);
1489
1492
  return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
@@ -1491,15 +1494,15 @@ var ot = M(void 0), st = ({ children: e }) => {
1491
1494
  url: t.url
1492
1495
  }, t.name, n) : r(a, t.name, n);
1493
1496
  }
1494
- let _ = await e.resolveCodeContent(t, $e(m));
1497
+ let _ = await e.resolveCodeContent(t, et(m));
1495
1498
  return _ != null && r(_, t.name, n);
1496
1499
  }, [
1497
1500
  o,
1498
1501
  s,
1499
1502
  e
1500
1503
  ]);
1501
- return { openAttachmentCanvas: F(async (t, o = t.id, s) => {
1502
- let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (rt(e), !1);
1504
+ return { openAttachmentCanvas: I(async (t, o = t.id, s) => {
1505
+ let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (it(e), !1);
1503
1506
  switch (t.type) {
1504
1507
  case c.Image: {
1505
1508
  let r = e.resolveImageContent(t);
@@ -1536,4 +1539,4 @@ var ot = M(void 0), st = ({ children: e }) => {
1536
1539
  ]) };
1537
1540
  };
1538
1541
  //#endregion
1539
- export { pe as ATTACHMENT_CANVAS_CLASS, He as AttachmentCanvas, ze as AttachmentCanvasBody, ut as AttachmentCanvasContainer, st as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, ge as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ft as InlineGroupedVisualizer, we as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, tt as createForbiddenCanvasContent, et as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, $e as extensionToLanguage, Ae as findVisualizerForApplication, ke as findVisualizerForMime, Q as getOoxmlFileType, Ye as getOoxmlMimeType, je as groupedVisualizerCanvasKey, o as isDownloadable, Ze as isHtmlPreviewable, Je as isOoxmlPreviewable, Xe as isTextPreviewable, Me as partitionAttachmentsForApplicationVisualizer, ct as useAttachmentCanvas, lt as useLatestCanvasRequest, mt as useOpenAttachmentCanvas };
1542
+ export { K as ATTACHMENT_CANVAS_CLASS, Ue as AttachmentCanvas, Be as AttachmentCanvasBody, dt as AttachmentCanvasContainer, ct as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, ge as HTML_PREVIEW_FRAME_RENDER_MESSAGE, pt as InlineGroupedVisualizer, we as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, nt as createForbiddenCanvasContent, tt as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, et as extensionToLanguage, je as findVisualizerForApplication, Ae as findVisualizerForMime, Q as getOoxmlFileType, Xe as getOoxmlMimeType, Me as groupedVisualizerCanvasKey, o as isDownloadable, Qe as isHtmlPreviewable, Ye as isOoxmlPreviewable, Ze as isTextPreviewable, Ne as partitionAttachmentsForApplicationVisualizer, lt as useAttachmentCanvas, ut as useLatestCanvasRequest, ht as useOpenAttachmentCanvas };