@epam/ai-dial-attachment-canvas 1.2.0-dev.143 → 1.2.0-dev.148

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