@epam/ai-dial-attachment-canvas 1.4.0-dev.182 → 1.4.0-dev.187
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/PdfContent-DX6q6wTq.js +277 -0
- package/PdfLoadingSkeleton-tRSHLlMc.js +166 -0
- package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/components/PdfContent/PdfContent.d.ts.map +1 -1
- package/components/PdfLoadingSkeleton/PdfLoadingSkeleton.d.ts +3 -0
- package/components/PdfLoadingSkeleton/PdfLoadingSkeleton.d.ts.map +1 -0
- package/constants/pdf-loading-skeleton.d.ts +7 -0
- package/constants/pdf-loading-skeleton.d.ts.map +1 -0
- package/context/AttachmentCanvasContext.d.ts +5 -2
- package/context/AttachmentCanvasContext.d.ts.map +1 -1
- package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +634 -616
- package/models/attachment-canvas.d.ts +6 -2
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +4 -4
- package/utils/open-routing.d.ts +5 -0
- package/utils/open-routing.d.ts.map +1 -0
- package/LazyContentBoundary-ES0u-Jn7.js +0 -138
- package/PdfContent-BEWJ_9tn.js +0 -274
- /package/{LazyContentBoundary.css → PdfLoadingSkeleton.css} +0 -0
package/index.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import { t as e } from "./McpAppCanvasRenderer-DXUdyMtZ.js";
|
|
2
2
|
import { a as t, i as n, n as r, r as i, t as a } from "./attachment-canvas-BgwyzrRC.js";
|
|
3
|
-
import {
|
|
4
|
-
import { AttachmentType as
|
|
5
|
-
import { SidebarOrientation as
|
|
6
|
-
import { DIAL_ICON_SIZE as
|
|
7
|
-
import { IconAlertTriangle as
|
|
8
|
-
import { createContext as
|
|
9
|
-
import { JsonView as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { VisualizerConnector as me, VisualizerConnectorEvents as
|
|
3
|
+
import { a as o, n as s, s as c, t as l } from "./PdfLoadingSkeleton-tRSHLlMc.js";
|
|
4
|
+
import { AttachmentType as u, CodeBlockTheme as d, DEFAULT_MARKDOWN_CLASS_NAMES as f, FileExtension as p, MIMEType as m, MarkdownRenderer as h, buildCssVars as g, copyToClipboard as _, isSyntaxHighlightingAllowed as v, mergeClasses as y, restrainedSyntaxTheme as b, stripUrlQueryAndFragment as x } from "@epam/ai-dial-chat-shared";
|
|
5
|
+
import { SidebarOrientation as S, SidebarPanel as C } from "@epam/ai-dial-sidebar";
|
|
6
|
+
import { DIAL_ICON_SIZE as w, DIAL_KIT_ICON_STROKE as T, ElementSize as E, GhostButton as D, GhostIconButton as O, LinkButton as ee, LiveRegion as k, LiveRegionPoliteness as A, Spinner as te } from "@epam/ai-dial-ui-kit";
|
|
7
|
+
import { IconAlertTriangle as j, IconArrowsMaximize as ne, IconCheck as re, IconCode as ie, IconCopy as ae, IconDownload as oe, IconEye as se, IconLock as ce, IconMarkdown as le, IconRefresh as ue } from "@tabler/icons-react";
|
|
8
|
+
import { createContext as M, lazy as N, memo as P, useCallback as F, useContext as de, useEffect as I, useMemo as L, useRef as R, useState as z } from "react";
|
|
9
|
+
import { JsonView as fe, defaultStyles as pe } from "react-json-view-lite";
|
|
10
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
11
|
+
import { VisualizerConnector as me, VisualizerConnectorEvents as U, VisualizerConnectorRequests as he } from "@epam/ai-dial-visualizer-connector";
|
|
12
12
|
//#region src/constants/public-class-names.ts
|
|
13
|
-
var
|
|
13
|
+
var W = { panel: "dial-attachment-canvas-panel" }, G = "h-full overflow-auto p-4 flex items-center justify-center", K = "h-full overflow-hidden", ge = {
|
|
14
14
|
[a.PlainText]: "h-full overflow-auto p-4",
|
|
15
|
-
[a.Image]:
|
|
16
|
-
[a.Audio]:
|
|
17
|
-
[a.Unsupported]:
|
|
18
|
-
[a.Error]:
|
|
15
|
+
[a.Image]: G,
|
|
16
|
+
[a.Audio]: G,
|
|
17
|
+
[a.Unsupported]: G,
|
|
18
|
+
[a.Error]: G,
|
|
19
19
|
[a.Json]: "h-full overflow-auto",
|
|
20
|
-
[a.Pdf]:
|
|
21
|
-
[a.Ooxml]:
|
|
22
|
-
[a.Visualizer]:
|
|
23
|
-
[a.GroupedVisualizer]:
|
|
24
|
-
[a.McpApp]:
|
|
25
|
-
[a.Code]:
|
|
26
|
-
[a.Html]:
|
|
20
|
+
[a.Pdf]: K,
|
|
21
|
+
[a.Ooxml]: K,
|
|
22
|
+
[a.Visualizer]: K,
|
|
23
|
+
[a.GroupedVisualizer]: K,
|
|
24
|
+
[a.McpApp]: K,
|
|
25
|
+
[a.Code]: K,
|
|
26
|
+
[a.Html]: K,
|
|
27
27
|
[a.Markdown]: "h-full overflow-auto",
|
|
28
28
|
[a.MarkdownTable]: "flex h-full min-h-0 flex-col overflow-hidden p-4"
|
|
29
|
-
},
|
|
29
|
+
}, _e = {
|
|
30
30
|
container: "_container_k7ib4_1",
|
|
31
31
|
containerLight: "_containerLight_k7ib4_5"
|
|
32
|
-
},
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
},
|
|
32
|
+
}, ve = {
|
|
33
|
+
[d.Dark]: b,
|
|
34
|
+
[d.Light]: b
|
|
35
|
+
}, ye = () => N(async () => {
|
|
36
36
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
37
37
|
return { default: e };
|
|
38
|
-
}), be = P(({ content: e, codeBlockTheme: t =
|
|
39
|
-
let { text: a, language: o } = e,
|
|
38
|
+
}), be = P(({ content: e, codeBlockTheme: t = d.Light, labels: n, codeClassName: r = "dial-code-text", errorLabelClassName: i }) => {
|
|
39
|
+
let { text: a, language: o } = e, c = L(() => v(a), [a]), l = o == null || o === "plaintext" || !c, u = ve[t], f = t === d.Light, [p, m] = z(0), h = L(ye, [p]), g = F(() => {
|
|
40
40
|
m((e) => e + 1);
|
|
41
|
-
}, []),
|
|
42
|
-
className:
|
|
41
|
+
}, []), _ = /* @__PURE__ */ V("pre", {
|
|
42
|
+
className: y(r, "p-4 wrap-break-word whitespace-pre-wrap"),
|
|
43
43
|
children: a
|
|
44
44
|
});
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ V("div", {
|
|
46
46
|
dir: "ltr",
|
|
47
|
-
className:
|
|
48
|
-
children: l ?
|
|
47
|
+
className: y("h-full overflow-auto", _e.container, f && _e.containerLight),
|
|
48
|
+
children: l ? _ : /* @__PURE__ */ V(s, {
|
|
49
49
|
retryKey: p,
|
|
50
50
|
onRetry: g,
|
|
51
|
-
pendingContent:
|
|
52
|
-
errorContent:
|
|
51
|
+
pendingContent: _,
|
|
52
|
+
errorContent: _,
|
|
53
53
|
labels: n,
|
|
54
54
|
errorLabelClassName: i,
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ V(h, {
|
|
56
56
|
language: o,
|
|
57
|
-
style:
|
|
57
|
+
style: u,
|
|
58
58
|
customStyle: {
|
|
59
59
|
margin: 0,
|
|
60
60
|
borderRadius: 0,
|
|
@@ -68,8 +68,8 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
68
68
|
})
|
|
69
69
|
})
|
|
70
70
|
});
|
|
71
|
-
}),
|
|
72
|
-
let { htmlFrameBlockedLabel: c = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: l = "Open in new tab", loadingLabel: u = "Loading…" } = t, [d, f] = z(!0), [p, m] = z(!1), [h, g] = z(void 0), [_,
|
|
71
|
+
}), xe = "dial-html-preview:render", q = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, Se = P(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: i, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text", codeClassName: s }) => {
|
|
72
|
+
let { htmlFrameBlockedLabel: c = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: l = "Open in new tab", loadingLabel: u = "Loading…" } = t, [d, f] = z(!0), [p, m] = z(!1), [h, g] = z(void 0), [_, v] = z(!1), [b, x] = z(!1), S = R(null), C = R(null), w = R(!1), T = R({
|
|
73
73
|
content: e,
|
|
74
74
|
generation: 0
|
|
75
75
|
});
|
|
@@ -77,23 +77,23 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
77
77
|
content: e,
|
|
78
78
|
generation: T.current.generation + 1
|
|
79
79
|
});
|
|
80
|
-
let
|
|
80
|
+
let E = T.current.generation;
|
|
81
81
|
I(() => {
|
|
82
|
-
f(!0), m(!1), g(void 0),
|
|
82
|
+
f(!0), m(!1), g(void 0), v(!1), x(!1);
|
|
83
83
|
}, [e]);
|
|
84
|
-
let
|
|
85
|
-
|
|
84
|
+
let D = R(n);
|
|
85
|
+
D.current !== n && (D.current = n, n && b && x(!1), !n && w.current && (w.current = !1, f(!0))), I(() => {
|
|
86
86
|
if (!n || e.srcdoc != null || e.resolveSourceText == null || h != null) return;
|
|
87
87
|
let t = !1, r = e.resolveSourceText;
|
|
88
88
|
return (async () => {
|
|
89
|
-
|
|
89
|
+
v(!0);
|
|
90
90
|
try {
|
|
91
91
|
let e = await r();
|
|
92
92
|
t || g(e);
|
|
93
93
|
} catch {
|
|
94
94
|
t || x(!0);
|
|
95
95
|
} finally {
|
|
96
|
-
t ||
|
|
96
|
+
t || v(!1);
|
|
97
97
|
}
|
|
98
98
|
})(), () => {
|
|
99
99
|
t = !0;
|
|
@@ -107,7 +107,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
107
107
|
if (f(!1), A != null) {
|
|
108
108
|
let e = S.current?.contentWindow;
|
|
109
109
|
e != null && e !== C.current && j != null && (C.current = e, e.postMessage({
|
|
110
|
-
type:
|
|
110
|
+
type: xe,
|
|
111
111
|
html: j
|
|
112
112
|
}, "*"));
|
|
113
113
|
} else if (!(k || O)) try {
|
|
@@ -122,50 +122,50 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
122
122
|
j
|
|
123
123
|
]), re = F(() => {
|
|
124
124
|
f(!1), m(!0);
|
|
125
|
-
}, []),
|
|
126
|
-
if (n &&
|
|
125
|
+
}, []), ie = e.srcdoc ?? h, ae = e.srcdoc != null || e.resolveSourceText != null, oe = e.srcdoc == null && e.resolveSourceText != null && h == null && !b;
|
|
126
|
+
if (n && ae && (ie != null || _ || oe)) return w.current = !0, ie == null ? /* @__PURE__ */ V("div", {
|
|
127
127
|
className: "flex h-full items-center justify-center",
|
|
128
|
-
children: /* @__PURE__ */
|
|
129
|
-
}) : /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ V(te, { ariaLabel: u })
|
|
129
|
+
}) : /* @__PURE__ */ V(be, {
|
|
130
130
|
content: {
|
|
131
131
|
type: a.Code,
|
|
132
|
-
text:
|
|
132
|
+
text: ie,
|
|
133
133
|
language: "html"
|
|
134
134
|
},
|
|
135
135
|
codeBlockTheme: i,
|
|
136
136
|
codeClassName: s
|
|
137
137
|
});
|
|
138
|
-
if (p) return /* @__PURE__ */
|
|
138
|
+
if (p) return /* @__PURE__ */ H("div", {
|
|
139
139
|
className: "flex h-full flex-col items-center justify-center gap-3 p-4",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ V("p", {
|
|
141
141
|
className: "text-center",
|
|
142
142
|
children: c
|
|
143
|
-
}), e.url != null && /* @__PURE__ */
|
|
143
|
+
}), e.url != null && /* @__PURE__ */ V(ee, {
|
|
144
144
|
href: e.url,
|
|
145
145
|
target: "_blank",
|
|
146
146
|
label: l,
|
|
147
|
-
className:
|
|
147
|
+
className: q.openInNewTabButton,
|
|
148
148
|
textClassName: o
|
|
149
149
|
})]
|
|
150
150
|
});
|
|
151
|
-
let
|
|
152
|
-
return /* @__PURE__ */
|
|
151
|
+
let se = k ? A : e.url, ce = k && A == null ? e.srcdoc : void 0;
|
|
152
|
+
return /* @__PURE__ */ H("div", {
|
|
153
153
|
className: "relative h-full",
|
|
154
|
-
children: [d && /* @__PURE__ */
|
|
154
|
+
children: [d && /* @__PURE__ */ V("div", {
|
|
155
155
|
className: "absolute inset-0 flex items-center justify-center",
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
-
}), /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ V(te, { ariaLabel: u })
|
|
157
|
+
}), /* @__PURE__ */ V("iframe", {
|
|
158
158
|
ref: S,
|
|
159
159
|
title: r,
|
|
160
|
-
src:
|
|
161
|
-
srcDoc:
|
|
160
|
+
src: se,
|
|
161
|
+
srcDoc: ce,
|
|
162
162
|
sandbox: k || O ? "allow-scripts" : "allow-scripts allow-same-origin",
|
|
163
|
-
className:
|
|
163
|
+
className: y("h-full w-full border-none", d ? "invisible" : ""),
|
|
164
164
|
onLoad: ne,
|
|
165
165
|
onError: re
|
|
166
|
-
},
|
|
166
|
+
}, E)]
|
|
167
167
|
});
|
|
168
|
-
}),
|
|
168
|
+
}), J = {
|
|
169
169
|
viewer: "_viewer_gdafg_2",
|
|
170
170
|
spreadsheetCanvas: "_spreadsheetCanvas_gdafg_6",
|
|
171
171
|
formulaPanel: "_formulaPanel_gdafg_12",
|
|
@@ -201,7 +201,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
201
201
|
}
|
|
202
202
|
case i.Csv: {
|
|
203
203
|
let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
|
|
204
|
-
r.className =
|
|
204
|
+
r.className = J.spreadsheetCanvas, e.replaceChildren(r);
|
|
205
205
|
let i = new t(r, {
|
|
206
206
|
showScrollbars: !0,
|
|
207
207
|
onError: n
|
|
@@ -293,9 +293,9 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
}, Ee = class extends Error {}, De = ({ content: e, fileName: n, loadErrorLabel: r, formulaLabel: a, formulaLabelClassName: o, formulaValueClassName: s, highlightsLabel: c = "Cited locations", highlightNavigatedLabel: l = "Scrolled to the cited location", loadingLabel: u = "Loading…" }) => {
|
|
296
|
-
let d = R(null), [f, p] = z(!0), [m, h] = z(!1), [g, _] = z(""), [
|
|
297
|
-
|
|
298
|
-
let
|
|
296
|
+
let d = R(null), [f, p] = z(!0), [m, h] = z(!1), [g, _] = z(""), [v, b] = z([]), [x, S] = z(!1), { highlights: C, selectedHighlightId: w } = e, E = C != null && C.length > 0, D = R(void 0), O = R(C);
|
|
297
|
+
O.current = C;
|
|
298
|
+
let ee = R(void 0);
|
|
299
299
|
return I(() => {
|
|
300
300
|
let t = d.current;
|
|
301
301
|
if (t == null) return;
|
|
@@ -306,7 +306,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
306
306
|
a = void 0, c();
|
|
307
307
|
}));
|
|
308
308
|
}, c = async () => {
|
|
309
|
-
let e = n?.highlights, t =
|
|
309
|
+
let e = n?.highlights, t = O.current;
|
|
310
310
|
if (!(i || e == null || t == null)) try {
|
|
311
311
|
let n = await e.measure(t);
|
|
312
312
|
i || b(n);
|
|
@@ -326,44 +326,44 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
326
326
|
n?.viewer.resize?.(), s();
|
|
327
327
|
}), r.observe(t));
|
|
328
328
|
};
|
|
329
|
-
return t.addEventListener("scroll", s, !0),
|
|
329
|
+
return t.addEventListener("scroll", s, !0), ee.current = s, (async () => {
|
|
330
330
|
try {
|
|
331
|
-
if (
|
|
331
|
+
if (E) {
|
|
332
332
|
let r = await Te(t, e, l, o);
|
|
333
333
|
if (i) {
|
|
334
334
|
r.viewer.destroy(), r.engine?.destroy();
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
|
-
n = r,
|
|
337
|
+
n = r, D.current = r.highlights, u();
|
|
338
338
|
} else {
|
|
339
339
|
let r = await we(t, e.format, l);
|
|
340
340
|
if (i) {
|
|
341
341
|
r.destroy();
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
|
-
if (n = { viewer: r },
|
|
344
|
+
if (n = { viewer: r }, D.current = void 0, await r.load(e.url), i) return;
|
|
345
345
|
u();
|
|
346
346
|
}
|
|
347
347
|
if (i) return;
|
|
348
348
|
p(!1), await c();
|
|
349
349
|
} catch (e) {
|
|
350
350
|
if (e instanceof Ee || i) return;
|
|
351
|
-
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0,
|
|
351
|
+
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, D.current = void 0, t.replaceChildren(), p(!1), h(!0);
|
|
352
352
|
}
|
|
353
353
|
})(), () => {
|
|
354
|
-
i = !0, t.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a),
|
|
354
|
+
i = !0, t.removeEventListener("scroll", s, !0), a != null && cancelAnimationFrame(a), ee.current = void 0, r?.disconnect(), n?.viewer.destroy(), n?.engine?.destroy(), D.current = void 0, t.replaceChildren();
|
|
355
355
|
};
|
|
356
356
|
}, [
|
|
357
357
|
e.format,
|
|
358
358
|
e.url,
|
|
359
|
-
|
|
359
|
+
E
|
|
360
360
|
]), I(() => {
|
|
361
|
-
|
|
361
|
+
ee.current?.();
|
|
362
362
|
}, [C]), I(() => {
|
|
363
363
|
S(!1);
|
|
364
|
-
let e =
|
|
364
|
+
let e = D.current;
|
|
365
365
|
if (e == null || f) return;
|
|
366
|
-
let n = (
|
|
366
|
+
let n = (O.current?.find(({ id: e }) => e === w))?.locations.at(0);
|
|
367
367
|
if (n == null) return;
|
|
368
368
|
let r = !1;
|
|
369
369
|
return (async () => {
|
|
@@ -377,38 +377,38 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
377
377
|
})(), () => {
|
|
378
378
|
r = !0;
|
|
379
379
|
};
|
|
380
|
-
}, [
|
|
380
|
+
}, [w, f]), /* @__PURE__ */ H("div", {
|
|
381
381
|
className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
|
|
382
382
|
children: [
|
|
383
|
-
e.format === i.Xlsx && /* @__PURE__ */
|
|
383
|
+
e.format === i.Xlsx && /* @__PURE__ */ H("div", {
|
|
384
384
|
role: "region",
|
|
385
385
|
"aria-label": a,
|
|
386
|
-
className:
|
|
387
|
-
children: [/* @__PURE__ */
|
|
386
|
+
className: y("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", J.formulaPanel),
|
|
387
|
+
children: [/* @__PURE__ */ V("span", {
|
|
388
388
|
"aria-hidden": "true",
|
|
389
|
-
className:
|
|
389
|
+
className: y("shrink-0", o),
|
|
390
390
|
children: "fx"
|
|
391
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ V("code", {
|
|
392
392
|
dir: "ltr",
|
|
393
393
|
tabIndex: 0,
|
|
394
394
|
"aria-live": "polite",
|
|
395
|
-
className:
|
|
395
|
+
className: y("h-8 min-w-0 flex-1 overflow-x-auto rounded border px-2 py-1 whitespace-nowrap focus-visible:outline", J.formulaValue, s),
|
|
396
396
|
children: g
|
|
397
397
|
})]
|
|
398
398
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ H("div", {
|
|
400
400
|
className: "relative min-h-0 w-full flex-1",
|
|
401
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ V("div", {
|
|
402
402
|
ref: d,
|
|
403
403
|
role: "document",
|
|
404
404
|
"aria-label": n,
|
|
405
405
|
"aria-busy": f,
|
|
406
|
-
className:
|
|
407
|
-
}),
|
|
406
|
+
className: y("h-full w-full overflow-hidden", J.viewer)
|
|
407
|
+
}), v.length > 0 && /* @__PURE__ */ V("div", {
|
|
408
408
|
role: "region",
|
|
409
409
|
"aria-label": c,
|
|
410
410
|
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
411
|
-
children:
|
|
411
|
+
children: v.map((e, t) => /* @__PURE__ */ V("div", {
|
|
412
412
|
"aria-hidden": "true",
|
|
413
413
|
style: {
|
|
414
414
|
left: `${e.left}px`,
|
|
@@ -416,34 +416,34 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
416
416
|
width: `${e.width}px`,
|
|
417
417
|
height: `${e.height}px`
|
|
418
418
|
},
|
|
419
|
-
"data-selected": e.highlightId ===
|
|
419
|
+
"data-selected": e.highlightId === w,
|
|
420
420
|
"data-clipped": e.isClippedAtEnd === !0,
|
|
421
|
-
className:
|
|
421
|
+
className: y("absolute", J.highlight)
|
|
422
422
|
}, `${e.highlightId}-${t}`))
|
|
423
423
|
})]
|
|
424
424
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ V(k, {
|
|
426
426
|
visuallyHidden: !0,
|
|
427
427
|
children: x ? l : ""
|
|
428
428
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
politeness:
|
|
429
|
+
/* @__PURE__ */ V(k, {
|
|
430
|
+
politeness: A.Assertive,
|
|
431
431
|
visuallyHidden: !0,
|
|
432
432
|
children: !f && m ? r : ""
|
|
433
433
|
}),
|
|
434
|
-
(f || m) && /* @__PURE__ */
|
|
435
|
-
className:
|
|
436
|
-
children: f ? /* @__PURE__ */
|
|
434
|
+
(f || m) && /* @__PURE__ */ V("div", {
|
|
435
|
+
className: y("absolute inset-0 flex items-center justify-center", J.statusOverlay),
|
|
436
|
+
children: f ? /* @__PURE__ */ V(te, {
|
|
437
437
|
size: 48,
|
|
438
438
|
ariaLabel: u
|
|
439
|
-
}) : /* @__PURE__ */
|
|
439
|
+
}) : /* @__PURE__ */ H("div", {
|
|
440
440
|
className: "flex flex-col items-center gap-2",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ V(j, {
|
|
442
442
|
"aria-hidden": "true",
|
|
443
443
|
size: 60,
|
|
444
|
-
stroke:
|
|
445
|
-
className:
|
|
446
|
-
}), /* @__PURE__ */
|
|
444
|
+
stroke: T,
|
|
445
|
+
className: J.errorIcon
|
|
446
|
+
}), /* @__PURE__ */ V("p", {
|
|
447
447
|
"aria-hidden": !0,
|
|
448
448
|
className: "text-center",
|
|
449
449
|
children: r
|
|
@@ -452,7 +452,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
452
452
|
})
|
|
453
453
|
]
|
|
454
454
|
});
|
|
455
|
-
},
|
|
455
|
+
}, Y = (e, t) => {
|
|
456
456
|
let n = e.toLowerCase();
|
|
457
457
|
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
458
458
|
}, Oe = (e, t) => {
|
|
@@ -485,14 +485,14 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
485
485
|
domain: u,
|
|
486
486
|
visualizerName: d,
|
|
487
487
|
requestTimeout: f
|
|
488
|
-
}), n = !0, r = t.subscribe(`${d}/${
|
|
488
|
+
}), n = !0, r = t.subscribe(`${d}/${U.SendMessage}`, (e) => {
|
|
489
489
|
let t = je(e);
|
|
490
490
|
t != null && m.current?.(t);
|
|
491
491
|
});
|
|
492
492
|
return (async () => {
|
|
493
493
|
if (await t.ready(), !n) return;
|
|
494
494
|
let e = p.current;
|
|
495
|
-
if (e.type === a.GroupedVisualizer) await t.send(
|
|
495
|
+
if (e.type === a.GroupedVisualizer) await t.send(he.SendGroupedVisualizeData, {
|
|
496
496
|
attachments: e.attachments,
|
|
497
497
|
layout: e.layout
|
|
498
498
|
});
|
|
@@ -501,7 +501,7 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
501
501
|
layout: r,
|
|
502
502
|
...typeof i == "object" && i ? i : {}
|
|
503
503
|
};
|
|
504
|
-
await t.send(
|
|
504
|
+
await t.send(he.SendVisualizeData, {
|
|
505
505
|
mimeType: n,
|
|
506
506
|
visualizerData: a
|
|
507
507
|
});
|
|
@@ -524,46 +524,46 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
524
524
|
d,
|
|
525
525
|
u,
|
|
526
526
|
f
|
|
527
|
-
]), /* @__PURE__ */
|
|
527
|
+
]), /* @__PURE__ */ H("div", {
|
|
528
528
|
className: "relative h-full w-full",
|
|
529
|
-
style:
|
|
529
|
+
style: g({
|
|
530
530
|
"--vs-loading-bg": i?.loadingBackground,
|
|
531
531
|
"--vs-status-text": i?.statusText,
|
|
532
532
|
"--vs-error-icon": i?.errorIcon
|
|
533
533
|
}),
|
|
534
534
|
children: [
|
|
535
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ V("div", {
|
|
536
536
|
ref: s,
|
|
537
537
|
className: "h-full w-full"
|
|
538
538
|
}),
|
|
539
|
-
c === "loading" && /* @__PURE__ */
|
|
540
|
-
className:
|
|
541
|
-
children: [/* @__PURE__ */
|
|
539
|
+
c === "loading" && /* @__PURE__ */ H("div", {
|
|
540
|
+
className: y("absolute inset-0 flex flex-col items-center justify-center gap-2", Me.loadingOverlay),
|
|
541
|
+
children: [/* @__PURE__ */ V(te, { ariaLabel: t }), t && /* @__PURE__ */ V("p", {
|
|
542
542
|
"aria-hidden": !0,
|
|
543
|
-
className:
|
|
543
|
+
className: y("text-center", Me.statusLabel),
|
|
544
544
|
children: t
|
|
545
545
|
})]
|
|
546
546
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ V(k, {
|
|
548
548
|
visuallyHidden: !0,
|
|
549
549
|
children: c === "error" && n
|
|
550
550
|
}),
|
|
551
|
-
c === "error" && /* @__PURE__ */
|
|
551
|
+
c === "error" && /* @__PURE__ */ H("div", {
|
|
552
552
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ V(j, {
|
|
554
554
|
size: 60,
|
|
555
|
-
stroke:
|
|
555
|
+
stroke: T,
|
|
556
556
|
"aria-hidden": !0,
|
|
557
557
|
className: Me.errorIcon
|
|
558
|
-
}), /* @__PURE__ */
|
|
558
|
+
}), /* @__PURE__ */ V("p", {
|
|
559
559
|
"aria-hidden": !0,
|
|
560
|
-
className:
|
|
560
|
+
className: y("text-center", Me.statusLabel),
|
|
561
561
|
children: n
|
|
562
562
|
})]
|
|
563
563
|
})
|
|
564
564
|
]
|
|
565
565
|
});
|
|
566
|
-
},
|
|
566
|
+
}, X = {
|
|
567
567
|
body: "_body_fvnln_4",
|
|
568
568
|
statusLabel: "_statusLabel_fvnln_13",
|
|
569
569
|
errorIcon: "_errorIcon_fvnln_17",
|
|
@@ -578,271 +578,272 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
578
578
|
jsonExpandIcon: "_jsonExpandIcon_fvnln_54",
|
|
579
579
|
jsonCollapseIcon: "_jsonCollapseIcon_fvnln_67",
|
|
580
580
|
jsonCollapsedContent: "_jsonCollapsedContent_fvnln_84"
|
|
581
|
-
}, Pe = () =>
|
|
581
|
+
}, Pe = () => N(async () => ({ default: (await import("./PdfContent-DX6q6wTq.js")).PdfContent })), Fe = () => N(async () => ({ default: (await import("./McpAppCanvasRenderer-DXUdyMtZ.js").then((e) => e.n)).McpAppCanvasRenderer })), Ie = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
582
582
|
let [r, i] = z(!1);
|
|
583
583
|
return I(() => {
|
|
584
584
|
i(!1);
|
|
585
|
-
}, [e]), r ? /* @__PURE__ */
|
|
585
|
+
}, [e]), r ? /* @__PURE__ */ H("div", {
|
|
586
586
|
className: "flex flex-col items-center gap-2",
|
|
587
|
-
children: [/* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ V(j, {
|
|
588
588
|
size: 60,
|
|
589
|
-
stroke:
|
|
590
|
-
className:
|
|
591
|
-
}), /* @__PURE__ */
|
|
592
|
-
className:
|
|
589
|
+
stroke: T,
|
|
590
|
+
className: X.errorIcon
|
|
591
|
+
}), /* @__PURE__ */ V("p", {
|
|
592
|
+
className: y("text-center", X.statusLabel),
|
|
593
593
|
children: n
|
|
594
594
|
})]
|
|
595
|
-
}) : /* @__PURE__ */
|
|
595
|
+
}) : /* @__PURE__ */ V("img", {
|
|
596
596
|
src: e,
|
|
597
597
|
alt: t ?? "",
|
|
598
598
|
className: "max-h-full max-w-full object-contain",
|
|
599
599
|
onError: () => i(!0)
|
|
600
600
|
});
|
|
601
|
-
}, Le = P(({ content: e, isLoading: t = !1,
|
|
602
|
-
let { colors:
|
|
603
|
-
|
|
604
|
-
}, []), [
|
|
605
|
-
|
|
606
|
-
}, []),
|
|
607
|
-
|
|
601
|
+
}, Le = P(({ content: e, isLoading: t = !1, loadingContentType: n, fileName: i, isHtmlSourceView: o = !1, labels: { unsupportedLabel: c = "Preview is not supported for this file", loadErrorLabel: u = "Failed to load file", loadErrorRetryLabel: d = "Retry", forbiddenErrorLabel: p = "You don't have permission to access this file", visualizerErrorLabel: m, htmlFrameBlockedLabel: _ = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: v = "Open in new tab", pdfThumbnailsLabel: b, pdfShowThumbnailsLabel: x, pdfHideThumbnailsLabel: S, pdfPageNumberLabel: C, pdfContentLoadingLabel: w, pdfContentErrorLabel: E, pdfContentRetryLabel: O, xlsxFormulaLabel: ee = "Formula", codeContentLoadingLabel: A, codeContentErrorLabel: ne, codeContentRetryLabel: re, tableCopyLabel: ie, tableCopiedLabel: ae, tableDownloadCsvLabel: oe, codeBlockCopyLabel: se, codeBlockCopiedLabel: le, codeBlockDownloadLabel: ue, tableScrollRegionAriaLabel: M, mathScrollRegionAriaLabel: N, ooxmlHighlightsLabel: P, ooxmlHighlightNavigatedLabel: de, loadingLabel: B = "Loading…" } = {}, styles: me, codeBlockTheme: U, tableDownloadFilename: he, loadPdf: W, hidePdfToolbar: G = !1, configurePdfWorker: K, onAppInfo: _e, onRetry: ve, onVisualizerSendMessage: ye, mcpAppHostContext: xe }) => {
|
|
602
|
+
let { colors: q, typography: J, bodyClassName: Ce, cssVars: we } = me ?? {}, [Te, Ee] = z(0), Y = L(Pe, [Te]), Oe = F(() => {
|
|
603
|
+
Ee((e) => e + 1);
|
|
604
|
+
}, []), [ke, Ae] = z(0), je = L(Fe, [ke]), Me = F(() => {
|
|
605
|
+
Ae((e) => e + 1);
|
|
606
|
+
}, []), Le = R(void 0), [Re, ze] = z(0), Be = F((e) => {
|
|
607
|
+
Le.current = e;
|
|
608
608
|
}, []);
|
|
609
609
|
I(() => {
|
|
610
|
-
let t =
|
|
611
|
-
t != null && (
|
|
610
|
+
let t = Le.current;
|
|
611
|
+
t != null && (Le.current = void 0, e.type === a.Pdf && e.url === t && ze((e) => e + 1));
|
|
612
612
|
}, [e]);
|
|
613
|
-
let
|
|
614
|
-
...
|
|
615
|
-
"--ac-text":
|
|
616
|
-
"--ac-status-text":
|
|
617
|
-
"--ac-error-icon":
|
|
618
|
-
"--ac-open-in-new-tab-text":
|
|
619
|
-
"--ac-json-border":
|
|
620
|
-
"--ac-json-bg":
|
|
621
|
-
"--ac-json-label":
|
|
622
|
-
"--ac-json-clickable-label":
|
|
623
|
-
"--ac-json-punctuation":
|
|
624
|
-
"--ac-json-string":
|
|
625
|
-
"--ac-json-number":
|
|
626
|
-
"--ac-json-boolean":
|
|
627
|
-
"--ac-json-null":
|
|
628
|
-
"--ac-json-toggle-icon":
|
|
629
|
-
"--ac-json-toggle-icon-hover":
|
|
630
|
-
"--ac-ooxml-bg":
|
|
631
|
-
"--ac-ooxml-formula-border":
|
|
632
|
-
"--ac-ooxml-formula-bg":
|
|
633
|
-
"--ac-ooxml-formula-text":
|
|
634
|
-
"--ac-ooxml-highlight-border":
|
|
635
|
-
"--ac-ooxml-highlight-bg":
|
|
636
|
-
"--ac-json-collapsed-text":
|
|
637
|
-
"--ac-json-collapsed-bg":
|
|
638
|
-
"--ac-focus-outline":
|
|
639
|
-
"--ac-code-bg":
|
|
640
|
-
"--ac-mcp-app-loading-bg":
|
|
641
|
-
"--ac-mcp-app-status-text":
|
|
642
|
-
"--ac-font-family":
|
|
643
|
-
"--ac-font-size":
|
|
644
|
-
"--ac-font-weight":
|
|
645
|
-
"--ac-line-height":
|
|
646
|
-
"--ac-letter-spacing":
|
|
613
|
+
let Ve = J?.fontClassName != null, He = L(() => ({
|
|
614
|
+
...g({
|
|
615
|
+
"--ac-text": q?.text,
|
|
616
|
+
"--ac-status-text": q?.statusText,
|
|
617
|
+
"--ac-error-icon": q?.errorIcon,
|
|
618
|
+
"--ac-open-in-new-tab-text": q?.openInNewTabText,
|
|
619
|
+
"--ac-json-border": q?.jsonBorder,
|
|
620
|
+
"--ac-json-bg": q?.jsonBackground,
|
|
621
|
+
"--ac-json-label": q?.jsonLabel,
|
|
622
|
+
"--ac-json-clickable-label": q?.jsonClickableLabel,
|
|
623
|
+
"--ac-json-punctuation": q?.jsonPunctuation,
|
|
624
|
+
"--ac-json-string": q?.jsonString,
|
|
625
|
+
"--ac-json-number": q?.jsonNumber,
|
|
626
|
+
"--ac-json-boolean": q?.jsonBoolean,
|
|
627
|
+
"--ac-json-null": q?.jsonNull,
|
|
628
|
+
"--ac-json-toggle-icon": q?.jsonToggleIcon,
|
|
629
|
+
"--ac-json-toggle-icon-hover": q?.jsonToggleIconHover,
|
|
630
|
+
"--ac-ooxml-bg": q?.ooxmlBackground,
|
|
631
|
+
"--ac-ooxml-formula-border": q?.ooxmlFormulaBorder,
|
|
632
|
+
"--ac-ooxml-formula-bg": q?.ooxmlFormulaBackground,
|
|
633
|
+
"--ac-ooxml-formula-text": q?.ooxmlFormulaText,
|
|
634
|
+
"--ac-ooxml-highlight-border": q?.ooxmlHighlightBorder,
|
|
635
|
+
"--ac-ooxml-highlight-bg": q?.ooxmlHighlightBackground,
|
|
636
|
+
"--ac-json-collapsed-text": q?.jsonCollapsedText,
|
|
637
|
+
"--ac-json-collapsed-bg": q?.jsonCollapsedBackground,
|
|
638
|
+
"--ac-focus-outline": q?.focusOutline,
|
|
639
|
+
"--ac-code-bg": q?.codeBackground,
|
|
640
|
+
"--ac-mcp-app-loading-bg": q?.mcpAppLoadingBackground,
|
|
641
|
+
"--ac-mcp-app-status-text": q?.mcpAppStatusText,
|
|
642
|
+
"--ac-font-family": Ve ? void 0 : J?.fontFamily,
|
|
643
|
+
"--ac-font-size": Ve ? void 0 : J?.fontSize,
|
|
644
|
+
"--ac-font-weight": Ve ? void 0 : J?.fontWeight,
|
|
645
|
+
"--ac-line-height": Ve ? void 0 : J?.lineHeight,
|
|
646
|
+
"--ac-letter-spacing": Ve ? void 0 : J?.letterSpacing
|
|
647
647
|
}),
|
|
648
|
-
...
|
|
649
|
-
}), [
|
|
648
|
+
...we
|
|
649
|
+
}), [me]), Ue = ge[e.type], We = e.type === a.McpApp ? xe : void 0, Ge = L(() => {
|
|
650
650
|
switch (e.type) {
|
|
651
|
-
case a.PlainText: return /* @__PURE__ */
|
|
652
|
-
className:
|
|
651
|
+
case a.PlainText: return /* @__PURE__ */ V("pre", {
|
|
652
|
+
className: y("wrap-break-word whitespace-pre-wrap", X.body, J?.fontClassName),
|
|
653
653
|
children: e.text
|
|
654
654
|
});
|
|
655
|
-
case a.Image: return /* @__PURE__ */
|
|
655
|
+
case a.Image: return /* @__PURE__ */ V(Ie, {
|
|
656
656
|
url: e.url,
|
|
657
|
-
fileName:
|
|
658
|
-
loadErrorLabel:
|
|
657
|
+
fileName: i,
|
|
658
|
+
loadErrorLabel: u
|
|
659
659
|
});
|
|
660
|
-
case a.Audio: return /* @__PURE__ */
|
|
660
|
+
case a.Audio: return /* @__PURE__ */ V("audio", {
|
|
661
661
|
controls: !0,
|
|
662
662
|
controlsList: "nodownload",
|
|
663
663
|
src: e.url,
|
|
664
|
-
"aria-label":
|
|
664
|
+
"aria-label": i ?? "Audio attachment",
|
|
665
665
|
className: "w-full max-w-sm",
|
|
666
666
|
preload: "metadata",
|
|
667
|
-
children: e.mimeType && /* @__PURE__ */
|
|
667
|
+
children: e.mimeType && /* @__PURE__ */ V("source", {
|
|
668
668
|
src: e.url,
|
|
669
669
|
type: e.mimeType
|
|
670
670
|
})
|
|
671
671
|
});
|
|
672
|
-
case a.Markdown: return /* @__PURE__ */
|
|
672
|
+
case a.Markdown: return /* @__PURE__ */ V("div", {
|
|
673
673
|
className: "p-4",
|
|
674
|
-
children: /* @__PURE__ */
|
|
674
|
+
children: /* @__PURE__ */ V(h, {
|
|
675
675
|
content: e.text,
|
|
676
676
|
isStreaming: !1,
|
|
677
|
-
codeBlockTheme:
|
|
678
|
-
codeBlockCopyLabel:
|
|
679
|
-
codeBlockCopiedLabel:
|
|
680
|
-
codeBlockDownloadLabel:
|
|
681
|
-
tableScrollRegionAriaLabel:
|
|
682
|
-
mathScrollRegionAriaLabel:
|
|
683
|
-
classNames:
|
|
677
|
+
codeBlockTheme: U,
|
|
678
|
+
codeBlockCopyLabel: se,
|
|
679
|
+
codeBlockCopiedLabel: le,
|
|
680
|
+
codeBlockDownloadLabel: ue,
|
|
681
|
+
tableScrollRegionAriaLabel: M,
|
|
682
|
+
mathScrollRegionAriaLabel: N,
|
|
683
|
+
classNames: f
|
|
684
684
|
})
|
|
685
685
|
});
|
|
686
|
-
case a.MarkdownTable: return /* @__PURE__ */
|
|
686
|
+
case a.MarkdownTable: return /* @__PURE__ */ V(h, {
|
|
687
687
|
content: e.text,
|
|
688
688
|
isStreaming: !1,
|
|
689
|
-
codeBlockTheme:
|
|
690
|
-
codeBlockCopyLabel:
|
|
691
|
-
codeBlockCopiedLabel:
|
|
692
|
-
codeBlockDownloadLabel:
|
|
693
|
-
tableScrollRegionAriaLabel:
|
|
694
|
-
mathScrollRegionAriaLabel:
|
|
689
|
+
codeBlockTheme: U,
|
|
690
|
+
codeBlockCopyLabel: se,
|
|
691
|
+
codeBlockCopiedLabel: le,
|
|
692
|
+
codeBlockDownloadLabel: ue,
|
|
693
|
+
tableScrollRegionAriaLabel: M,
|
|
694
|
+
mathScrollRegionAriaLabel: N,
|
|
695
695
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
696
696
|
classNames: {
|
|
697
|
-
...
|
|
697
|
+
...f,
|
|
698
698
|
tableWrapper: "my-0 max-h-full",
|
|
699
699
|
tableScrollContainer: "max-h-full"
|
|
700
700
|
},
|
|
701
701
|
tableActionLabels: {
|
|
702
|
-
copyLabel:
|
|
703
|
-
copiedLabel:
|
|
704
|
-
downloadCsvLabel:
|
|
702
|
+
copyLabel: ie,
|
|
703
|
+
copiedLabel: ae,
|
|
704
|
+
downloadCsvLabel: oe
|
|
705
705
|
},
|
|
706
|
-
tableDownloadFilename:
|
|
706
|
+
tableDownloadFilename: he
|
|
707
707
|
});
|
|
708
708
|
case a.Json: {
|
|
709
|
-
let t =
|
|
710
|
-
return /* @__PURE__ */
|
|
709
|
+
let t = J?.jsonLabelClassName ?? (J?.jsonClassName ? void 0 : "dial-code-semi-text");
|
|
710
|
+
return /* @__PURE__ */ V("div", {
|
|
711
711
|
dir: "ltr",
|
|
712
712
|
className: "h-full overflow-auto",
|
|
713
|
-
children: /* @__PURE__ */
|
|
714
|
-
className:
|
|
715
|
-
children: /* @__PURE__ */
|
|
713
|
+
children: /* @__PURE__ */ V("div", {
|
|
714
|
+
className: y("m-3 overflow-auto rounded-md border", X.jsonWrapper),
|
|
715
|
+
children: /* @__PURE__ */ V(fe, {
|
|
716
716
|
data: e.value,
|
|
717
717
|
style: {
|
|
718
|
-
container:
|
|
719
|
-
basicChildStyle:
|
|
718
|
+
container: y("whitespace-pre-wrap wrap-break-word p-2", J?.jsonClassName ?? "dial-code-text"),
|
|
719
|
+
basicChildStyle: pe.basicChildStyle,
|
|
720
720
|
childFieldsContainer: "m-0 ps-3",
|
|
721
|
-
label:
|
|
722
|
-
clickableLabel:
|
|
723
|
-
nullValue:
|
|
724
|
-
undefinedValue:
|
|
725
|
-
stringValue:
|
|
726
|
-
booleanValue:
|
|
727
|
-
numberValue:
|
|
728
|
-
otherValue:
|
|
729
|
-
punctuation:
|
|
730
|
-
collapseIcon:
|
|
731
|
-
expandIcon:
|
|
732
|
-
collapsedContent:
|
|
721
|
+
label: y("me-1", t, X.jsonLabel),
|
|
722
|
+
clickableLabel: y("me-1 cursor-pointer hover:underline", t, X.jsonClickableLabel),
|
|
723
|
+
nullValue: y("italic", X.jsonNullValue),
|
|
724
|
+
undefinedValue: y("italic", X.jsonNullValue),
|
|
725
|
+
stringValue: X.jsonStringValue,
|
|
726
|
+
booleanValue: X.jsonBooleanValue,
|
|
727
|
+
numberValue: X.jsonNumberValue,
|
|
728
|
+
otherValue: y("italic", X.jsonNullValue),
|
|
729
|
+
punctuation: y("me-1", X.jsonPunctuation),
|
|
730
|
+
collapseIcon: y("me-1 cursor-pointer select-none transition-colors", X.jsonCollapseIcon),
|
|
731
|
+
expandIcon: y("me-1 cursor-pointer select-none transition-colors", X.jsonExpandIcon),
|
|
732
|
+
collapsedContent: y(J?.jsonCollapsedClassName ?? "dial-caption-text", "me-1 cursor-pointer rounded px-1", X.jsonCollapsedContent)
|
|
733
733
|
}
|
|
734
734
|
})
|
|
735
735
|
})
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
|
-
case a.Code: return /* @__PURE__ */
|
|
738
|
+
case a.Code: return /* @__PURE__ */ V(be, {
|
|
739
739
|
content: e,
|
|
740
|
-
codeBlockTheme:
|
|
741
|
-
codeClassName:
|
|
742
|
-
errorLabelClassName:
|
|
740
|
+
codeBlockTheme: U,
|
|
741
|
+
codeClassName: J?.codeClassName,
|
|
742
|
+
errorLabelClassName: J?.errorMessageClassName,
|
|
743
743
|
labels: {
|
|
744
|
-
loadingLabel:
|
|
745
|
-
errorLabel:
|
|
746
|
-
retryLabel:
|
|
744
|
+
loadingLabel: A,
|
|
745
|
+
errorLabel: ne,
|
|
746
|
+
retryLabel: re
|
|
747
747
|
}
|
|
748
748
|
});
|
|
749
|
-
case a.Html: return /* @__PURE__ */
|
|
749
|
+
case a.Html: return /* @__PURE__ */ V(Se, {
|
|
750
750
|
content: e,
|
|
751
751
|
labels: {
|
|
752
|
-
htmlFrameBlockedLabel:
|
|
753
|
-
htmlOpenInNewTabLabel:
|
|
754
|
-
loadingLabel:
|
|
752
|
+
htmlFrameBlockedLabel: _,
|
|
753
|
+
htmlOpenInNewTabLabel: v,
|
|
754
|
+
loadingLabel: B
|
|
755
755
|
},
|
|
756
|
-
isSourceView:
|
|
757
|
-
title:
|
|
758
|
-
codeBlockTheme:
|
|
759
|
-
codeClassName:
|
|
756
|
+
isSourceView: o,
|
|
757
|
+
title: i,
|
|
758
|
+
codeBlockTheme: U,
|
|
759
|
+
codeClassName: J?.codeClassName
|
|
760
760
|
});
|
|
761
|
-
case a.Pdf: return /* @__PURE__ */
|
|
762
|
-
retryKey:
|
|
763
|
-
onRetry:
|
|
764
|
-
|
|
761
|
+
case a.Pdf: return /* @__PURE__ */ V(s, {
|
|
762
|
+
retryKey: Te,
|
|
763
|
+
onRetry: Oe,
|
|
764
|
+
pendingContent: /* @__PURE__ */ V(l, {}),
|
|
765
|
+
errorLabelClassName: J?.errorMessageClassName,
|
|
765
766
|
labels: {
|
|
766
|
-
loadingLabel:
|
|
767
|
-
errorLabel:
|
|
768
|
-
retryLabel:
|
|
767
|
+
loadingLabel: w,
|
|
768
|
+
errorLabel: E,
|
|
769
|
+
retryLabel: O
|
|
769
770
|
},
|
|
770
|
-
children: /* @__PURE__ */
|
|
771
|
-
fileName:
|
|
771
|
+
children: /* @__PURE__ */ V(Y, {
|
|
772
|
+
fileName: i,
|
|
772
773
|
url: e.url,
|
|
773
774
|
highlights: e.highlights ?? [],
|
|
774
775
|
selectedHighlightId: e.selectedHighlightId,
|
|
775
776
|
selectedPageNumber: e.page,
|
|
776
|
-
loadPdf:
|
|
777
|
-
onLoadError:
|
|
778
|
-
hideHeader:
|
|
779
|
-
configurePdfWorker:
|
|
780
|
-
errorLabelClassName:
|
|
777
|
+
loadPdf: W,
|
|
778
|
+
onLoadError: Be,
|
|
779
|
+
hideHeader: G,
|
|
780
|
+
configurePdfWorker: K,
|
|
781
|
+
errorLabelClassName: J?.errorMessageClassName,
|
|
781
782
|
labels: {
|
|
782
|
-
thumbnailsLabel:
|
|
783
|
-
showThumbnailsLabel:
|
|
784
|
-
hideThumbnailsLabel:
|
|
785
|
-
pageNumberLabel:
|
|
786
|
-
loadingLabel:
|
|
787
|
-
errorLabel:
|
|
788
|
-
retryLabel:
|
|
783
|
+
thumbnailsLabel: b,
|
|
784
|
+
showThumbnailsLabel: x,
|
|
785
|
+
hideThumbnailsLabel: S,
|
|
786
|
+
pageNumberLabel: C,
|
|
787
|
+
loadingLabel: w,
|
|
788
|
+
errorLabel: E,
|
|
789
|
+
retryLabel: O
|
|
789
790
|
}
|
|
790
791
|
})
|
|
791
|
-
}, `${e.url}#${
|
|
792
|
-
case a.Ooxml: return /* @__PURE__ */
|
|
792
|
+
}, `${e.url}#${Re}`);
|
|
793
|
+
case a.Ooxml: return /* @__PURE__ */ V(De, {
|
|
793
794
|
content: e,
|
|
794
|
-
fileName:
|
|
795
|
-
loadErrorLabel:
|
|
796
|
-
formulaLabel:
|
|
797
|
-
formulaLabelClassName:
|
|
798
|
-
formulaValueClassName:
|
|
799
|
-
highlightsLabel:
|
|
800
|
-
highlightNavigatedLabel:
|
|
801
|
-
loadingLabel:
|
|
795
|
+
fileName: i,
|
|
796
|
+
loadErrorLabel: u,
|
|
797
|
+
formulaLabel: ee,
|
|
798
|
+
formulaLabelClassName: J?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
799
|
+
formulaValueClassName: J?.xlsxFormulaValueClassName ?? "dial-code-text",
|
|
800
|
+
highlightsLabel: P,
|
|
801
|
+
highlightNavigatedLabel: de,
|
|
802
|
+
loadingLabel: B
|
|
802
803
|
});
|
|
803
804
|
case a.Visualizer:
|
|
804
|
-
case a.GroupedVisualizer: return /* @__PURE__ */
|
|
805
|
+
case a.GroupedVisualizer: return /* @__PURE__ */ V(Ne, {
|
|
805
806
|
content: e,
|
|
806
|
-
errorLabel:
|
|
807
|
-
onSendMessage:
|
|
807
|
+
errorLabel: m,
|
|
808
|
+
onSendMessage: ye
|
|
808
809
|
});
|
|
809
|
-
case a.McpApp: return /* @__PURE__ */
|
|
810
|
-
retryKey:
|
|
811
|
-
onRetry:
|
|
812
|
-
errorLabelClassName:
|
|
810
|
+
case a.McpApp: return /* @__PURE__ */ V(s, {
|
|
811
|
+
retryKey: ke,
|
|
812
|
+
onRetry: Me,
|
|
813
|
+
errorLabelClassName: J?.errorMessageClassName,
|
|
813
814
|
labels: {
|
|
814
|
-
loadingLabel:
|
|
815
|
-
errorLabel:
|
|
816
|
-
retryLabel:
|
|
815
|
+
loadingLabel: B,
|
|
816
|
+
errorLabel: u,
|
|
817
|
+
retryLabel: d
|
|
817
818
|
},
|
|
818
|
-
children: /* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ V(je, {
|
|
819
820
|
content: e,
|
|
820
|
-
loadingLabel:
|
|
821
|
-
onAppInfo:
|
|
822
|
-
hostContext:
|
|
821
|
+
loadingLabel: B,
|
|
822
|
+
onAppInfo: _e,
|
|
823
|
+
hostContext: We
|
|
823
824
|
})
|
|
824
825
|
});
|
|
825
|
-
case a.Unsupported: return /* @__PURE__ */
|
|
826
|
-
className:
|
|
827
|
-
children:
|
|
826
|
+
case a.Unsupported: return /* @__PURE__ */ V("p", {
|
|
827
|
+
className: y("text-center", X.statusLabel),
|
|
828
|
+
children: c
|
|
828
829
|
});
|
|
829
830
|
case a.Error: {
|
|
830
831
|
let t = e.errorType === r.Forbidden;
|
|
831
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ H("div", {
|
|
832
833
|
className: "flex flex-col items-center gap-2",
|
|
833
834
|
children: [
|
|
834
|
-
|
|
835
|
+
V(t ? ce : j, {
|
|
835
836
|
size: 60,
|
|
836
|
-
stroke:
|
|
837
|
-
className:
|
|
837
|
+
stroke: T,
|
|
838
|
+
className: X.errorIcon
|
|
838
839
|
}),
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
className:
|
|
841
|
-
children: t ?
|
|
840
|
+
/* @__PURE__ */ V("p", {
|
|
841
|
+
className: y("text-center", X.statusLabel),
|
|
842
|
+
children: t ? p : u
|
|
842
843
|
}),
|
|
843
|
-
!t &&
|
|
844
|
-
label:
|
|
845
|
-
onClick:
|
|
844
|
+
!t && ve != null && /* @__PURE__ */ V(D, {
|
|
845
|
+
label: d,
|
|
846
|
+
onClick: ve
|
|
846
847
|
})
|
|
847
848
|
]
|
|
848
849
|
});
|
|
@@ -850,280 +851,284 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
850
851
|
}
|
|
851
852
|
}, [
|
|
852
853
|
e,
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
s,
|
|
865
|
-
l,
|
|
854
|
+
J?.fontClassName,
|
|
855
|
+
J?.jsonClassName,
|
|
856
|
+
J?.jsonLabelClassName,
|
|
857
|
+
J?.xlsxFormulaLabelClassName,
|
|
858
|
+
J?.xlsxFormulaValueClassName,
|
|
859
|
+
J?.codeClassName,
|
|
860
|
+
J?.jsonCollapsedClassName,
|
|
861
|
+
J?.errorMessageClassName,
|
|
862
|
+
i,
|
|
863
|
+
U,
|
|
864
|
+
c,
|
|
866
865
|
u,
|
|
867
|
-
|
|
868
|
-
ve,
|
|
866
|
+
d,
|
|
869
867
|
p,
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
868
|
+
m,
|
|
869
|
+
ye,
|
|
870
|
+
_,
|
|
871
|
+
v,
|
|
872
|
+
o,
|
|
873
873
|
he,
|
|
874
|
-
ge,
|
|
875
|
-
H,
|
|
876
|
-
U,
|
|
877
|
-
Z,
|
|
878
874
|
W,
|
|
879
|
-
|
|
880
|
-
|
|
875
|
+
G,
|
|
876
|
+
K,
|
|
877
|
+
_e,
|
|
878
|
+
We,
|
|
879
|
+
ve,
|
|
881
880
|
b,
|
|
882
881
|
x,
|
|
883
882
|
S,
|
|
884
883
|
C,
|
|
885
|
-
|
|
884
|
+
w,
|
|
886
885
|
E,
|
|
887
|
-
D,
|
|
888
886
|
O,
|
|
889
|
-
|
|
890
|
-
|
|
887
|
+
ee,
|
|
888
|
+
A,
|
|
889
|
+
ne,
|
|
890
|
+
re,
|
|
891
|
+
Y,
|
|
892
|
+
je,
|
|
891
893
|
ke,
|
|
892
|
-
J,
|
|
893
|
-
Ae,
|
|
894
|
-
Ce,
|
|
895
|
-
Ee,
|
|
896
894
|
Me,
|
|
895
|
+
Te,
|
|
896
|
+
Oe,
|
|
897
897
|
Re,
|
|
898
|
-
|
|
899
|
-
ne,
|
|
900
|
-
re,
|
|
901
|
-
M,
|
|
898
|
+
Be,
|
|
902
899
|
ie,
|
|
903
900
|
ae,
|
|
901
|
+
oe,
|
|
904
902
|
se,
|
|
905
|
-
ce,
|
|
906
|
-
N,
|
|
907
903
|
le,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
904
|
+
ue,
|
|
905
|
+
M,
|
|
906
|
+
N,
|
|
907
|
+
P,
|
|
908
|
+
de,
|
|
909
|
+
B
|
|
910
|
+
]), Ke = t && n === a.Pdf, Z = t ? Ke ? "h-full" : "flex h-full items-center justify-center" : Ue, qe = t ? Ke ? /* @__PURE__ */ V(l, {}) : /* @__PURE__ */ V(te, { ariaLabel: B }) : Ge;
|
|
911
|
+
return /* @__PURE__ */ H("div", {
|
|
912
|
+
style: t ? void 0 : He,
|
|
913
|
+
className: y(Z, Ce),
|
|
914
|
+
children: [qe, /* @__PURE__ */ V(k, {
|
|
915
|
+
visuallyHidden: !0,
|
|
916
|
+
children: Ke ? B : ""
|
|
917
|
+
})]
|
|
914
918
|
});
|
|
915
919
|
}), Re = {
|
|
916
920
|
mcpAppDivider: "_mcpAppDivider_1gxed_1",
|
|
917
921
|
mcpAppVersion: "_mcpAppVersion_1gxed_5",
|
|
918
922
|
panelHeader: "_panelHeader_1gxed_9"
|
|
919
|
-
},
|
|
920
|
-
let [
|
|
921
|
-
De?.(), Q.current != null && clearTimeout(Q.current),
|
|
922
|
-
}, [De]),
|
|
923
|
-
|
|
924
|
-
}, [
|
|
925
|
-
Oe?.(),
|
|
923
|
+
}, ze = 2e3, Be = P(({ isOpen: e, isLoading: t = !1, loadingContentType: n, onClose: r, onRetry: i, content: o, fileName: s, leftActions: l, labels: { ariaLabel: u, closeLabel: d = "Close", resizeLabel: f = "Resize panel", downloadLabel: p = "Download", copyTextLabel: m = "Copy text", copiedTextLabel: h = "Copied!", copyMarkdownLabel: _ = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: b = "Copy as JSON", copiedJsonLabel: x = "Copied!", visualizerErrorLabel: E, unsupportedLabel: D = "Preview is not supported for this file", loadErrorLabel: ee = "Failed to load file", loadErrorRetryLabel: k = "Retry", forbiddenErrorLabel: A = "You don't have permission to access this file", htmlFrameBlockedLabel: te = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: j = "Open in new tab", htmlViewSourceLabel: ne = "View source", htmlViewRenderedLabel: ce = "View rendered", mcpAppReloadLabel: M = "Reload", pdfThumbnailsLabel: N, pdfShowThumbnailsLabel: P, pdfHideThumbnailsLabel: de, pdfPageNumberLabel: fe, pdfContentLoadingLabel: pe, pdfContentErrorLabel: me, pdfContentRetryLabel: U, xlsxFormulaLabel: he, codeContentLoadingLabel: G, codeContentErrorLabel: K, codeContentRetryLabel: ge, tableCopyLabel: _e, tableCopiedLabel: ve, tableDownloadCsvLabel: ye, codeBlockCopyLabel: be, codeBlockCopiedLabel: xe, codeBlockDownloadLabel: q, tableScrollRegionAriaLabel: Se, mathScrollRegionAriaLabel: J, ooxmlHighlightsLabel: Ce, ooxmlHighlightNavigatedLabel: we, loadingLabel: Te }, onDownload: Ee, onCopyText: De, onCopyMarkdown: Y, onCopyJson: Oe, tableDownloadFilename: ke, isMobile: Ae = !1, isBoundedOverlay: je = !1, defaultWidth: Me, minWidth: Ne = 600, maxWidth: X = 1500, onResizeStop: Pe, styles: Fe, codeBlockTheme: Ie, loadPdf: Be, configurePdfWorker: Ve, onVisualizerSendMessage: He, mcpAppHostContext: Ue }) => {
|
|
924
|
+
let [We, Ge] = z(!1), [Ke, Z] = z(!1), [qe, Je] = z(!1), [Ye, Xe] = z(!1), [Ze, Qe] = z(void 0), Q = R(null), $e = R(null), et = R(null), tt = F(() => {
|
|
925
|
+
De?.(), Q.current != null && clearTimeout(Q.current), Ge(!0), Q.current = setTimeout(() => Ge(!1), ze);
|
|
926
|
+
}, [De]), nt = F(() => {
|
|
927
|
+
Y?.(), $e.current != null && clearTimeout($e.current), Z(!0), $e.current = setTimeout(() => Z(!1), ze);
|
|
928
|
+
}, [Y]), rt = F(() => {
|
|
929
|
+
Oe?.(), et.current != null && clearTimeout(et.current), Je(!0), et.current = setTimeout(() => Je(!1), ze);
|
|
926
930
|
}, [Oe]);
|
|
927
931
|
I(() => () => {
|
|
928
|
-
Q.current != null && clearTimeout(Q.current),
|
|
932
|
+
Q.current != null && clearTimeout(Q.current), $e.current != null && clearTimeout($e.current), et.current != null && clearTimeout(et.current);
|
|
929
933
|
}, []);
|
|
930
|
-
let
|
|
931
|
-
|
|
934
|
+
let it = F(() => {
|
|
935
|
+
Xe((e) => !e);
|
|
932
936
|
}, []);
|
|
933
937
|
I(() => {
|
|
934
|
-
|
|
935
|
-
}, [
|
|
936
|
-
let { className:
|
|
937
|
-
"--ac-mcp-app-divider":
|
|
938
|
-
"--ac-mcp-app-version":
|
|
939
|
-
}), [
|
|
940
|
-
style:
|
|
938
|
+
Xe(!1), Qe(void 0);
|
|
939
|
+
}, [o]);
|
|
940
|
+
let { className: at, panelStyles: ot, ...st } = Fe ?? {}, { colors: ct, typography: lt } = st, ut = L(() => g({
|
|
941
|
+
"--ac-mcp-app-divider": ct?.mcpAppDividerColor,
|
|
942
|
+
"--ac-mcp-app-version": ct?.mcpAppVersionColor
|
|
943
|
+
}), [ct?.mcpAppDividerColor, ct?.mcpAppVersionColor]), dt = o.type === a.McpApp && Ze != null ? /* @__PURE__ */ H("span", {
|
|
944
|
+
style: ut,
|
|
941
945
|
children: [
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ V("span", { children: s }),
|
|
947
|
+
/* @__PURE__ */ V("span", {
|
|
944
948
|
"aria-hidden": !0,
|
|
945
|
-
className:
|
|
949
|
+
className: y("mx-1.5 inline-block h-3 w-0 border-s align-middle", Re.mcpAppDivider)
|
|
946
950
|
}),
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
|
|
949
|
-
className:
|
|
950
|
-
children:
|
|
951
|
+
/* @__PURE__ */ V("span", { children: Ze.name }),
|
|
952
|
+
Ze.version && /* @__PURE__ */ V("span", {
|
|
953
|
+
className: y("ms-2", lt?.mcpAppVersionClassName ?? "dial-caption-text", Re.mcpAppVersion),
|
|
954
|
+
children: Ze.version
|
|
951
955
|
})
|
|
952
956
|
]
|
|
953
|
-
}) :
|
|
954
|
-
return /* @__PURE__ */
|
|
957
|
+
}) : s, ft = !t && o.type === a.Html && (o.srcdoc != null || o.resolveSourceText != null), $ = !t && De != null && (o.type === a.PlainText || o.type === a.Code), pt = !t && Y != null && o.type === a.Markdown, mt = !t && Oe != null && o.type === a.Json, ht = !t && Ee != null && c(o), gt = !t && o.type === a.McpApp && o.onReload != null;
|
|
958
|
+
return /* @__PURE__ */ V(C, {
|
|
955
959
|
isOpen: e,
|
|
956
960
|
isBoundedOverlay: je,
|
|
957
|
-
orientation:
|
|
958
|
-
title:
|
|
961
|
+
orientation: S.Right,
|
|
962
|
+
title: dt,
|
|
959
963
|
labels: {
|
|
960
|
-
ariaLabel:
|
|
961
|
-
closeLabel:
|
|
962
|
-
resizeLabel:
|
|
964
|
+
ariaLabel: u,
|
|
965
|
+
closeLabel: d,
|
|
966
|
+
resizeLabel: f
|
|
963
967
|
},
|
|
964
|
-
onClose:
|
|
968
|
+
onClose: r,
|
|
965
969
|
resizable: !Ae || je,
|
|
966
970
|
defaultWidth: Me,
|
|
967
971
|
minWidth: Ne,
|
|
968
|
-
maxWidth:
|
|
972
|
+
maxWidth: X,
|
|
969
973
|
onResizeStop: Pe,
|
|
970
974
|
styles: {
|
|
971
|
-
...
|
|
975
|
+
...ot,
|
|
972
976
|
cssVars: {
|
|
973
|
-
...
|
|
974
|
-
...
|
|
977
|
+
...g({ "--ac-header-border": ct?.headerBorder }),
|
|
978
|
+
...ot?.cssVars
|
|
975
979
|
},
|
|
976
|
-
titleClassName:
|
|
977
|
-
headerClassName:
|
|
978
|
-
className:
|
|
980
|
+
titleClassName: ot?.titleClassName ?? "dial-h3-text",
|
|
981
|
+
headerClassName: y("border-b", Re.panelHeader, ot?.headerClassName),
|
|
982
|
+
className: y(!je && (e ? "mobile:w-full mobile:max-w-full" : "w-0"), at, ot?.className, W.panel)
|
|
979
983
|
},
|
|
980
|
-
leftActions:
|
|
981
|
-
rightActions:
|
|
982
|
-
|
|
983
|
-
icon: /* @__PURE__ */
|
|
984
|
-
size:
|
|
985
|
-
stroke:
|
|
984
|
+
leftActions: l,
|
|
985
|
+
rightActions: ft || $ || pt || mt || ht || gt ? /* @__PURE__ */ H(B, { children: [
|
|
986
|
+
gt && /* @__PURE__ */ V(O, {
|
|
987
|
+
icon: /* @__PURE__ */ V(ue, {
|
|
988
|
+
size: w.LG,
|
|
989
|
+
stroke: T,
|
|
986
990
|
"aria-hidden": !0
|
|
987
991
|
}),
|
|
988
|
-
"aria-label":
|
|
989
|
-
tooltipProps: { tooltip:
|
|
990
|
-
onClick:
|
|
992
|
+
"aria-label": M,
|
|
993
|
+
tooltipProps: { tooltip: M },
|
|
994
|
+
onClick: o.type === a.McpApp ? o.onReload : void 0
|
|
991
995
|
}),
|
|
992
|
-
|
|
993
|
-
icon:
|
|
994
|
-
size:
|
|
995
|
-
stroke:
|
|
996
|
+
ft && /* @__PURE__ */ V(O, {
|
|
997
|
+
icon: V(Ye ? se : ie, {
|
|
998
|
+
size: w.LG,
|
|
999
|
+
stroke: T,
|
|
996
1000
|
"aria-hidden": !0
|
|
997
1001
|
}),
|
|
998
|
-
"aria-label":
|
|
999
|
-
"aria-pressed":
|
|
1000
|
-
tooltipProps: { tooltip:
|
|
1001
|
-
onClick:
|
|
1002
|
+
"aria-label": Ye ? ce : ne,
|
|
1003
|
+
"aria-pressed": Ye,
|
|
1004
|
+
tooltipProps: { tooltip: Ye ? ce : ne },
|
|
1005
|
+
onClick: it
|
|
1002
1006
|
}),
|
|
1003
|
-
$ && /* @__PURE__ */
|
|
1004
|
-
icon:
|
|
1005
|
-
size:
|
|
1006
|
-
stroke:
|
|
1007
|
+
$ && /* @__PURE__ */ V(O, {
|
|
1008
|
+
icon: V(We ? re : ae, {
|
|
1009
|
+
size: w.LG,
|
|
1010
|
+
stroke: T,
|
|
1007
1011
|
"aria-hidden": !0
|
|
1008
1012
|
}),
|
|
1009
|
-
"aria-label":
|
|
1010
|
-
tooltipProps: { tooltip:
|
|
1011
|
-
onClick:
|
|
1013
|
+
"aria-label": We ? h : m,
|
|
1014
|
+
tooltipProps: { tooltip: We ? h : m },
|
|
1015
|
+
onClick: tt
|
|
1012
1016
|
}),
|
|
1013
|
-
|
|
1014
|
-
icon:
|
|
1015
|
-
size:
|
|
1016
|
-
stroke:
|
|
1017
|
+
pt && /* @__PURE__ */ V(O, {
|
|
1018
|
+
icon: V(Ke ? re : le, {
|
|
1019
|
+
size: w.LG,
|
|
1020
|
+
stroke: T,
|
|
1017
1021
|
"aria-hidden": !0
|
|
1018
1022
|
}),
|
|
1019
|
-
"aria-label":
|
|
1020
|
-
tooltipProps: { tooltip:
|
|
1021
|
-
onClick:
|
|
1023
|
+
"aria-label": Ke ? v : _,
|
|
1024
|
+
tooltipProps: { tooltip: Ke ? v : _ },
|
|
1025
|
+
onClick: nt
|
|
1022
1026
|
}),
|
|
1023
|
-
|
|
1024
|
-
icon:
|
|
1025
|
-
size:
|
|
1026
|
-
stroke:
|
|
1027
|
+
mt && /* @__PURE__ */ V(O, {
|
|
1028
|
+
icon: V(qe ? re : ae, {
|
|
1029
|
+
size: w.LG,
|
|
1030
|
+
stroke: T,
|
|
1027
1031
|
"aria-hidden": !0
|
|
1028
1032
|
}),
|
|
1029
|
-
"aria-label":
|
|
1030
|
-
tooltipProps: { tooltip:
|
|
1031
|
-
onClick:
|
|
1033
|
+
"aria-label": qe ? x : b,
|
|
1034
|
+
tooltipProps: { tooltip: qe ? x : b },
|
|
1035
|
+
onClick: rt
|
|
1032
1036
|
}),
|
|
1033
|
-
|
|
1034
|
-
icon: /* @__PURE__ */
|
|
1035
|
-
size:
|
|
1036
|
-
stroke:
|
|
1037
|
+
ht && /* @__PURE__ */ V(O, {
|
|
1038
|
+
icon: /* @__PURE__ */ V(oe, {
|
|
1039
|
+
size: w.LG,
|
|
1040
|
+
stroke: T
|
|
1037
1041
|
}),
|
|
1038
|
-
"aria-label":
|
|
1039
|
-
tooltipProps: { tooltip:
|
|
1042
|
+
"aria-label": p,
|
|
1043
|
+
tooltipProps: { tooltip: p },
|
|
1040
1044
|
onClick: Ee
|
|
1041
1045
|
})
|
|
1042
1046
|
] }) : null,
|
|
1043
|
-
children: /* @__PURE__ */
|
|
1044
|
-
content:
|
|
1047
|
+
children: /* @__PURE__ */ V(Le, {
|
|
1048
|
+
content: o,
|
|
1045
1049
|
isLoading: t,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
+
loadingContentType: n,
|
|
1051
|
+
fileName: s,
|
|
1052
|
+
isHtmlSourceView: Ye,
|
|
1053
|
+
onAppInfo: o.type === a.McpApp ? Qe : void 0,
|
|
1054
|
+
onRetry: i,
|
|
1050
1055
|
labels: {
|
|
1051
|
-
unsupportedLabel:
|
|
1052
|
-
loadErrorLabel:
|
|
1053
|
-
loadErrorRetryLabel:
|
|
1054
|
-
forbiddenErrorLabel:
|
|
1055
|
-
visualizerErrorLabel:
|
|
1056
|
+
unsupportedLabel: D,
|
|
1057
|
+
loadErrorLabel: ee,
|
|
1058
|
+
loadErrorRetryLabel: k,
|
|
1059
|
+
forbiddenErrorLabel: A,
|
|
1060
|
+
visualizerErrorLabel: E,
|
|
1056
1061
|
htmlFrameBlockedLabel: te,
|
|
1057
|
-
htmlOpenInNewTabLabel:
|
|
1058
|
-
pdfThumbnailsLabel:
|
|
1062
|
+
htmlOpenInNewTabLabel: j,
|
|
1063
|
+
pdfThumbnailsLabel: N,
|
|
1059
1064
|
pdfShowThumbnailsLabel: P,
|
|
1060
|
-
pdfHideThumbnailsLabel:
|
|
1061
|
-
pdfPageNumberLabel:
|
|
1062
|
-
pdfContentLoadingLabel:
|
|
1065
|
+
pdfHideThumbnailsLabel: de,
|
|
1066
|
+
pdfPageNumberLabel: fe,
|
|
1067
|
+
pdfContentLoadingLabel: pe,
|
|
1063
1068
|
pdfContentErrorLabel: me,
|
|
1064
|
-
pdfContentRetryLabel:
|
|
1065
|
-
xlsxFormulaLabel:
|
|
1066
|
-
codeContentLoadingLabel:
|
|
1067
|
-
codeContentErrorLabel:
|
|
1068
|
-
codeContentRetryLabel:
|
|
1069
|
-
tableCopyLabel:
|
|
1070
|
-
tableCopiedLabel:
|
|
1071
|
-
tableDownloadCsvLabel:
|
|
1069
|
+
pdfContentRetryLabel: U,
|
|
1070
|
+
xlsxFormulaLabel: he,
|
|
1071
|
+
codeContentLoadingLabel: G,
|
|
1072
|
+
codeContentErrorLabel: K,
|
|
1073
|
+
codeContentRetryLabel: ge,
|
|
1074
|
+
tableCopyLabel: _e,
|
|
1075
|
+
tableCopiedLabel: ve,
|
|
1076
|
+
tableDownloadCsvLabel: ye,
|
|
1072
1077
|
codeBlockCopyLabel: be,
|
|
1073
|
-
codeBlockCopiedLabel:
|
|
1074
|
-
codeBlockDownloadLabel:
|
|
1078
|
+
codeBlockCopiedLabel: xe,
|
|
1079
|
+
codeBlockDownloadLabel: q,
|
|
1075
1080
|
tableScrollRegionAriaLabel: Se,
|
|
1076
|
-
mathScrollRegionAriaLabel:
|
|
1081
|
+
mathScrollRegionAriaLabel: J,
|
|
1077
1082
|
ooxmlHighlightsLabel: Ce,
|
|
1078
1083
|
ooxmlHighlightNavigatedLabel: we,
|
|
1079
1084
|
loadingLabel: Te
|
|
1080
1085
|
},
|
|
1081
|
-
styles:
|
|
1086
|
+
styles: st,
|
|
1082
1087
|
codeBlockTheme: Ie,
|
|
1083
1088
|
tableDownloadFilename: ke,
|
|
1084
|
-
loadPdf:
|
|
1085
|
-
configurePdfWorker:
|
|
1086
|
-
onVisualizerSendMessage:
|
|
1087
|
-
mcpAppHostContext:
|
|
1089
|
+
loadPdf: Be,
|
|
1090
|
+
configurePdfWorker: Ve,
|
|
1091
|
+
onVisualizerSendMessage: He,
|
|
1092
|
+
mcpAppHostContext: Ue
|
|
1088
1093
|
})
|
|
1089
1094
|
});
|
|
1090
|
-
}),
|
|
1091
|
-
docx:
|
|
1092
|
-
xlsx:
|
|
1093
|
-
pptx:
|
|
1094
|
-
},
|
|
1095
|
+
}), Ve = /* @__PURE__ */ new Set(["html", "htm"]), He = {
|
|
1096
|
+
docx: m.DOCX,
|
|
1097
|
+
xlsx: m.XLSX,
|
|
1098
|
+
pptx: m.PPTX
|
|
1099
|
+
}, Ue = /* @__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(".")), We = {
|
|
1095
1100
|
docx: i.Docx,
|
|
1096
1101
|
xlsx: i.Xlsx,
|
|
1097
1102
|
pptx: i.Pptx,
|
|
1098
1103
|
csv: i.Csv
|
|
1099
|
-
},
|
|
1100
|
-
[
|
|
1101
|
-
[
|
|
1102
|
-
[
|
|
1103
|
-
[
|
|
1104
|
-
},
|
|
1105
|
-
[i.Docx]:
|
|
1106
|
-
[i.Xlsx]:
|
|
1107
|
-
[i.Pptx]:
|
|
1108
|
-
[i.Csv]:
|
|
1109
|
-
},
|
|
1104
|
+
}, Ge = {
|
|
1105
|
+
[He.docx]: i.Docx,
|
|
1106
|
+
[He.xlsx]: i.Xlsx,
|
|
1107
|
+
[He.pptx]: i.Pptx,
|
|
1108
|
+
[m.CSV]: i.Csv
|
|
1109
|
+
}, Ke = {
|
|
1110
|
+
[i.Docx]: He.docx,
|
|
1111
|
+
[i.Xlsx]: He.xlsx,
|
|
1112
|
+
[i.Pptx]: He.pptx,
|
|
1113
|
+
[i.Csv]: m.CSV
|
|
1114
|
+
}, Z = (e, t) => {
|
|
1110
1115
|
let n = t?.split(";", 1)[0].trim().toLowerCase();
|
|
1111
1116
|
if (n != null) {
|
|
1112
|
-
let e =
|
|
1117
|
+
let e = Ge[n];
|
|
1113
1118
|
if (e != null) return e;
|
|
1114
1119
|
}
|
|
1115
1120
|
let r = e.lastIndexOf(".");
|
|
1116
|
-
if (r !== -1) return
|
|
1117
|
-
},
|
|
1118
|
-
let n =
|
|
1119
|
-
return n == null ? void 0 :
|
|
1120
|
-
}, Je = (e) => {
|
|
1121
|
-
let t = e.lastIndexOf(".");
|
|
1122
|
-
return t !== -1 && Ve.has(e.slice(t + 1).toLowerCase());
|
|
1121
|
+
if (r !== -1) return We[e.slice(r + 1).toLowerCase()];
|
|
1122
|
+
}, qe = (e, t) => Z(e, t) != null, Je = (e, t) => {
|
|
1123
|
+
let n = Z(e, t);
|
|
1124
|
+
return n == null ? void 0 : Ke[n];
|
|
1123
1125
|
}, Ye = (e) => {
|
|
1124
1126
|
let t = e.lastIndexOf(".");
|
|
1125
|
-
return t !== -1 &&
|
|
1126
|
-
}, Xe = {
|
|
1127
|
+
return t !== -1 && Ue.has(e.slice(t + 1).toLowerCase());
|
|
1128
|
+
}, Xe = (e) => {
|
|
1129
|
+
let t = e.lastIndexOf(".");
|
|
1130
|
+
return t !== -1 && Ve.has(e.slice(t + 1).toLowerCase());
|
|
1131
|
+
}, Ze = {
|
|
1127
1132
|
xml: "xml",
|
|
1128
1133
|
csv: "plaintext",
|
|
1129
1134
|
tsv: "plaintext",
|
|
@@ -1171,28 +1176,28 @@ var H = { panel: "dial-attachment-canvas-panel" }, U = "h-full overflow-auto p-4
|
|
|
1171
1176
|
gitignore: "plaintext",
|
|
1172
1177
|
dockerfile: "plaintext",
|
|
1173
1178
|
makefile: "plaintext"
|
|
1174
|
-
},
|
|
1179
|
+
}, Qe = (e) => Ze[e], Q = (e) => ({
|
|
1175
1180
|
type: a.Unsupported,
|
|
1176
1181
|
...e != null && { url: e }
|
|
1177
|
-
}),
|
|
1182
|
+
}), $e = (e) => ({
|
|
1178
1183
|
type: a.Error,
|
|
1179
1184
|
errorType: r.LoadFailed,
|
|
1180
1185
|
...e != null && { url: e }
|
|
1181
|
-
}),
|
|
1186
|
+
}), et = (e) => ({
|
|
1182
1187
|
type: a.Error,
|
|
1183
1188
|
errorType: r.Forbidden,
|
|
1184
1189
|
...e != null && { url: e }
|
|
1185
|
-
}),
|
|
1190
|
+
}), tt = (e) => {
|
|
1186
1191
|
if (e.type === a.Image || e.type === a.Audio || e.type === a.Pdf || e.type === a.Ooxml) return e.url.startsWith("blob:") ? e.url : void 0;
|
|
1187
|
-
},
|
|
1188
|
-
let t =
|
|
1192
|
+
}, nt = (e) => {
|
|
1193
|
+
let t = tt(e);
|
|
1189
1194
|
t != null && URL.revokeObjectURL(t);
|
|
1190
|
-
},
|
|
1195
|
+
}, rt = {
|
|
1191
1196
|
type: a.PlainText,
|
|
1192
1197
|
text: ""
|
|
1193
|
-
},
|
|
1194
|
-
|
|
1195
|
-
var
|
|
1198
|
+
}, it = M(void 0);
|
|
1199
|
+
it.displayName = "AttachmentCanvasContext";
|
|
1200
|
+
var at = M(void 0), ot = ({ children: e }) => {
|
|
1196
1201
|
let t = R(0), n = F(() => {
|
|
1197
1202
|
let e = ++t.current;
|
|
1198
1203
|
return () => e === t.current;
|
|
@@ -1200,49 +1205,51 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1200
1205
|
I(() => () => {
|
|
1201
1206
|
t.current += 1;
|
|
1202
1207
|
}, []);
|
|
1203
|
-
let [r, i] = z(!1), [a, o] = z(!1), [s, c] = z(
|
|
1204
|
-
|
|
1205
|
-
}, []),
|
|
1206
|
-
|
|
1207
|
-
}, []),
|
|
1208
|
-
|
|
1208
|
+
let [r, i] = z(!1), [a, o] = z(!1), [s, c] = z(void 0), [l, u] = z(rt), [d, f] = z(void 0), [p, m] = z(void 0), [h, g] = z(void 0), _ = F((e, t, n) => {
|
|
1209
|
+
f(e), m(t), c(n), g(void 0), o(!0), i(!0);
|
|
1210
|
+
}, []), v = F((e, t, n, r) => {
|
|
1211
|
+
u(e), f(t), m(n), g(r == null ? void 0 : () => r), o(!1), c(void 0), i(!0);
|
|
1212
|
+
}, []), y = F(() => {
|
|
1213
|
+
u(rt), i(!1), o(!1), c(void 0), m(void 0), g(void 0);
|
|
1209
1214
|
}, []);
|
|
1210
1215
|
return I(() => () => {
|
|
1211
|
-
let e =
|
|
1216
|
+
let e = tt(l);
|
|
1212
1217
|
e != null && URL.revokeObjectURL(e);
|
|
1213
|
-
}, [
|
|
1218
|
+
}, [l]), /* @__PURE__ */ V(it.Provider, {
|
|
1214
1219
|
value: L(() => ({
|
|
1215
1220
|
isOpen: r,
|
|
1216
1221
|
isLoading: a,
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1222
|
+
loadingContentType: s,
|
|
1223
|
+
content: l,
|
|
1224
|
+
fileName: d,
|
|
1225
|
+
attachmentId: p,
|
|
1226
|
+
openCanvasLoading: _,
|
|
1227
|
+
openCanvas: v,
|
|
1228
|
+
closeCanvas: y,
|
|
1229
|
+
retryCanvas: h
|
|
1224
1230
|
}), [
|
|
1225
1231
|
r,
|
|
1226
1232
|
a,
|
|
1227
1233
|
s,
|
|
1228
1234
|
l,
|
|
1229
1235
|
d,
|
|
1230
|
-
|
|
1231
|
-
g,
|
|
1236
|
+
p,
|
|
1232
1237
|
_,
|
|
1233
|
-
|
|
1238
|
+
v,
|
|
1239
|
+
y,
|
|
1240
|
+
h
|
|
1234
1241
|
]),
|
|
1235
|
-
children: /* @__PURE__ */
|
|
1242
|
+
children: /* @__PURE__ */ V(at.Provider, {
|
|
1236
1243
|
value: n,
|
|
1237
1244
|
children: e
|
|
1238
1245
|
})
|
|
1239
1246
|
});
|
|
1240
|
-
},
|
|
1241
|
-
let e =
|
|
1247
|
+
}, st = () => {
|
|
1248
|
+
let e = de(it);
|
|
1242
1249
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1243
1250
|
return e;
|
|
1244
|
-
},
|
|
1245
|
-
let e =
|
|
1251
|
+
}, ct = () => de(at), lt = () => {
|
|
1252
|
+
let e = de(at);
|
|
1246
1253
|
if (!e) throw Error("useLatestCanvasRequest must be used within an AttachmentCanvasProvider");
|
|
1247
1254
|
let t = R(void 0);
|
|
1248
1255
|
return I(() => (t.current = {}, () => {
|
|
@@ -1251,69 +1258,70 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1251
1258
|
let n = t.current, r = e();
|
|
1252
1259
|
return () => n !== void 0 && t.current === n && r();
|
|
1253
1260
|
}, [e]);
|
|
1254
|
-
},
|
|
1255
|
-
let { ariaLabel: h = "Attachment preview", closeLabel:
|
|
1256
|
-
o(
|
|
1257
|
-
}, [
|
|
1258
|
-
(
|
|
1259
|
-
}, [
|
|
1260
|
-
|
|
1261
|
-
}, [
|
|
1262
|
-
|
|
1263
|
-
}, [
|
|
1264
|
-
return /* @__PURE__ */
|
|
1265
|
-
isOpen:
|
|
1266
|
-
isLoading:
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1261
|
+
}, ut = P(({ labels: e, leftActions: t, isMobile: n = !1, isBoundedOverlay: r = !1, defaultWidth: i, minWidth: s, maxWidth: c, codeBlockTheme: l, tableDownloadFilename: u, loadPdf: d, configurePdfWorker: f, onVisualizerSendMessage: p, mcpAppHostContext: m }) => {
|
|
1262
|
+
let { ariaLabel: h = "Attachment preview", closeLabel: g = "Close", downloadLabel: v = "Download", unsupportedLabel: y = "Preview is not supported for this file", loadErrorLabel: b = "Failed to load file", loadErrorRetryLabel: x, forbiddenErrorLabel: S = "You don't have permission to access this file", copyTextLabel: C, copiedTextLabel: w, copyMarkdownLabel: T, copiedMarkdownLabel: E, copyJsonLabel: D, copiedJsonLabel: O, htmlFrameBlockedLabel: ee, htmlOpenInNewTabLabel: k, htmlViewSourceLabel: A, htmlViewRenderedLabel: te, pdfThumbnailsLabel: j, pdfShowThumbnailsLabel: ne, pdfHideThumbnailsLabel: re, pdfPageNumberLabel: ie, pdfContentLoadingLabel: ae, pdfContentErrorLabel: oe, pdfContentRetryLabel: se, xlsxFormulaLabel: ce, codeContentLoadingLabel: le, codeContentErrorLabel: ue, codeContentRetryLabel: M, tableCopyLabel: N, tableCopiedLabel: P, tableDownloadCsvLabel: de, codeBlockCopyLabel: I, codeBlockCopiedLabel: L, codeBlockDownloadLabel: R, tableScrollRegionAriaLabel: z, mathScrollRegionAriaLabel: fe, ooxmlHighlightsLabel: pe, ooxmlHighlightNavigatedLabel: B, loadingLabel: H } = e ?? {}, { isOpen: me, isLoading: U, loadingContentType: he, content: W, fileName: G, closeCanvas: K, retryCanvas: ge } = st(), _e = F(() => {
|
|
1263
|
+
o(W, G);
|
|
1264
|
+
}, [W, G]), ve = F(() => {
|
|
1265
|
+
(W.type === a.PlainText || W.type === a.Code) && _(W.text);
|
|
1266
|
+
}, [W]), ye = F(() => {
|
|
1267
|
+
W.type === a.Markdown && _(W.text);
|
|
1268
|
+
}, [W]), be = F(() => {
|
|
1269
|
+
W.type === a.Json && _(JSON.stringify(W.value, null, 2));
|
|
1270
|
+
}, [W]);
|
|
1271
|
+
return /* @__PURE__ */ V(Be, {
|
|
1272
|
+
isOpen: me,
|
|
1273
|
+
isLoading: U,
|
|
1274
|
+
loadingContentType: he,
|
|
1275
|
+
onClose: K,
|
|
1276
|
+
onRetry: ge,
|
|
1277
|
+
content: W,
|
|
1278
|
+
fileName: G,
|
|
1271
1279
|
leftActions: t,
|
|
1272
1280
|
labels: {
|
|
1273
1281
|
ariaLabel: h,
|
|
1274
|
-
closeLabel:
|
|
1282
|
+
closeLabel: g,
|
|
1275
1283
|
downloadLabel: v,
|
|
1276
1284
|
copyTextLabel: C,
|
|
1277
1285
|
copiedTextLabel: w,
|
|
1278
1286
|
copyMarkdownLabel: T,
|
|
1279
|
-
copiedMarkdownLabel:
|
|
1280
|
-
copyJsonLabel:
|
|
1281
|
-
copiedJsonLabel:
|
|
1287
|
+
copiedMarkdownLabel: E,
|
|
1288
|
+
copyJsonLabel: D,
|
|
1289
|
+
copiedJsonLabel: O,
|
|
1282
1290
|
unsupportedLabel: y,
|
|
1283
1291
|
loadErrorLabel: b,
|
|
1284
1292
|
loadErrorRetryLabel: x,
|
|
1285
1293
|
forbiddenErrorLabel: S,
|
|
1286
|
-
htmlFrameBlockedLabel:
|
|
1294
|
+
htmlFrameBlockedLabel: ee,
|
|
1287
1295
|
htmlOpenInNewTabLabel: k,
|
|
1288
|
-
htmlViewSourceLabel:
|
|
1289
|
-
htmlViewRenderedLabel:
|
|
1296
|
+
htmlViewSourceLabel: A,
|
|
1297
|
+
htmlViewRenderedLabel: te,
|
|
1290
1298
|
pdfThumbnailsLabel: j,
|
|
1291
1299
|
pdfShowThumbnailsLabel: ne,
|
|
1292
1300
|
pdfHideThumbnailsLabel: re,
|
|
1293
|
-
pdfPageNumberLabel:
|
|
1294
|
-
pdfContentLoadingLabel:
|
|
1295
|
-
pdfContentErrorLabel:
|
|
1296
|
-
pdfContentRetryLabel:
|
|
1297
|
-
xlsxFormulaLabel:
|
|
1298
|
-
codeContentLoadingLabel:
|
|
1299
|
-
codeContentErrorLabel:
|
|
1300
|
-
codeContentRetryLabel:
|
|
1301
|
-
tableCopyLabel:
|
|
1302
|
-
tableCopiedLabel:
|
|
1303
|
-
tableDownloadCsvLabel:
|
|
1304
|
-
codeBlockCopyLabel:
|
|
1305
|
-
codeBlockCopiedLabel:
|
|
1306
|
-
codeBlockDownloadLabel:
|
|
1307
|
-
tableScrollRegionAriaLabel:
|
|
1301
|
+
pdfPageNumberLabel: ie,
|
|
1302
|
+
pdfContentLoadingLabel: ae,
|
|
1303
|
+
pdfContentErrorLabel: oe,
|
|
1304
|
+
pdfContentRetryLabel: se,
|
|
1305
|
+
xlsxFormulaLabel: ce,
|
|
1306
|
+
codeContentLoadingLabel: le,
|
|
1307
|
+
codeContentErrorLabel: ue,
|
|
1308
|
+
codeContentRetryLabel: M,
|
|
1309
|
+
tableCopyLabel: N,
|
|
1310
|
+
tableCopiedLabel: P,
|
|
1311
|
+
tableDownloadCsvLabel: de,
|
|
1312
|
+
codeBlockCopyLabel: I,
|
|
1313
|
+
codeBlockCopiedLabel: L,
|
|
1314
|
+
codeBlockDownloadLabel: R,
|
|
1315
|
+
tableScrollRegionAriaLabel: z,
|
|
1308
1316
|
mathScrollRegionAriaLabel: fe,
|
|
1309
1317
|
ooxmlHighlightsLabel: pe,
|
|
1310
|
-
ooxmlHighlightNavigatedLabel:
|
|
1311
|
-
loadingLabel:
|
|
1318
|
+
ooxmlHighlightNavigatedLabel: B,
|
|
1319
|
+
loadingLabel: H
|
|
1312
1320
|
},
|
|
1313
|
-
onDownload:
|
|
1314
|
-
onCopyText:
|
|
1315
|
-
onCopyMarkdown:
|
|
1316
|
-
onCopyJson:
|
|
1321
|
+
onDownload: _e,
|
|
1322
|
+
onCopyText: W.type === a.PlainText || W.type === a.Code ? ve : void 0,
|
|
1323
|
+
onCopyMarkdown: W.type === a.Markdown ? ye : void 0,
|
|
1324
|
+
onCopyJson: W.type === a.Json ? be : void 0,
|
|
1317
1325
|
tableDownloadFilename: u,
|
|
1318
1326
|
isMobile: n,
|
|
1319
1327
|
isBoundedOverlay: r,
|
|
@@ -1326,43 +1334,43 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1326
1334
|
onVisualizerSendMessage: p,
|
|
1327
1335
|
mcpAppHostContext: m
|
|
1328
1336
|
});
|
|
1329
|
-
}),
|
|
1337
|
+
}), dt = {
|
|
1330
1338
|
frame: "_frame_1ys0b_1",
|
|
1331
1339
|
header: "_header_1ys0b_6",
|
|
1332
1340
|
title: "_title_1ys0b_10"
|
|
1333
|
-
},
|
|
1341
|
+
}, 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 }) => {
|
|
1334
1342
|
let p = e.visualizerName.trim(), m = !u && p !== "";
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
className:
|
|
1337
|
-
style:
|
|
1343
|
+
return /* @__PURE__ */ H("div", {
|
|
1344
|
+
className: y("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", dt.frame]),
|
|
1345
|
+
style: g({
|
|
1338
1346
|
"--igv-bg": d?.background,
|
|
1339
1347
|
"--igv-border": d?.border,
|
|
1340
1348
|
"--igv-title-text": d?.titleText
|
|
1341
1349
|
}),
|
|
1342
|
-
children: [/* @__PURE__ */
|
|
1343
|
-
className:
|
|
1344
|
-
children: [m && /* @__PURE__ */
|
|
1345
|
-
className:
|
|
1350
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1351
|
+
className: y("flex min-h-10 items-center gap-2 py-2", m ? "justify-between" : "justify-end", !l && ["border-b px-4", dt.header]),
|
|
1352
|
+
children: [m && /* @__PURE__ */ V("span", {
|
|
1353
|
+
className: y("min-w-0 truncate", c, dt.title),
|
|
1346
1354
|
children: p
|
|
1347
|
-
}), /* @__PURE__ */
|
|
1355
|
+
}), /* @__PURE__ */ V("div", {
|
|
1348
1356
|
role: "toolbar",
|
|
1349
1357
|
"aria-label": i,
|
|
1350
1358
|
className: "flex items-center gap-1",
|
|
1351
|
-
children: /* @__PURE__ */
|
|
1352
|
-
icon: /* @__PURE__ */
|
|
1353
|
-
size:
|
|
1354
|
-
stroke:
|
|
1359
|
+
children: /* @__PURE__ */ V(O, {
|
|
1360
|
+
icon: /* @__PURE__ */ V(ne, {
|
|
1361
|
+
size: w.SM,
|
|
1362
|
+
stroke: T,
|
|
1355
1363
|
"aria-hidden": !0
|
|
1356
1364
|
}),
|
|
1357
1365
|
"aria-label": r,
|
|
1358
|
-
size:
|
|
1366
|
+
size: E.Small,
|
|
1359
1367
|
onClick: n
|
|
1360
1368
|
})
|
|
1361
1369
|
})]
|
|
1362
|
-
}), /* @__PURE__ */
|
|
1370
|
+
}), /* @__PURE__ */ V("div", {
|
|
1363
1371
|
className: "w-full",
|
|
1364
1372
|
style: { height: `${t}px` },
|
|
1365
|
-
children: /* @__PURE__ */
|
|
1373
|
+
children: /* @__PURE__ */ V(Ne, {
|
|
1366
1374
|
content: e,
|
|
1367
1375
|
loadingLabel: o,
|
|
1368
1376
|
errorLabel: s,
|
|
@@ -1373,21 +1381,30 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1373
1381
|
});
|
|
1374
1382
|
}), $ = /* @__PURE__ */ function(e) {
|
|
1375
1383
|
return e.Pdf = "resolvePdfContent", e.Markdown = "resolveMarkdownContent", e.Json = "resolveJsonContent", e;
|
|
1376
|
-
}({}),
|
|
1377
|
-
[
|
|
1384
|
+
}({}), pt = {
|
|
1385
|
+
[m.PDF]: $.Pdf,
|
|
1386
|
+
[m.Markdown]: $.Markdown,
|
|
1387
|
+
[m.JSON]: $.Json
|
|
1388
|
+
}, mt = {
|
|
1378
1389
|
[p.Markdown]: $.Markdown,
|
|
1379
|
-
[p.
|
|
1380
|
-
|
|
1381
|
-
[
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1390
|
+
[p.MarkdownAlt]: $.Markdown,
|
|
1391
|
+
[p.JSON]: $.Json,
|
|
1392
|
+
[p.PDF]: $.Pdf
|
|
1393
|
+
}, ht = (e, t) => {
|
|
1394
|
+
let n = e.contentType.toLowerCase();
|
|
1395
|
+
if (Y(n, t) != null || Z("", n) != null) return;
|
|
1396
|
+
let r = pt[n];
|
|
1397
|
+
if (r != null) return r === $.Pdf ? a.Pdf : void 0;
|
|
1398
|
+
let i = e.name ?? "";
|
|
1399
|
+
if (Z(i) != null) return;
|
|
1400
|
+
let o = i.lastIndexOf(".");
|
|
1401
|
+
return mt[o === -1 ? "" : i.slice(o + 1).toLowerCase()] === $.Pdf ? a.Pdf : void 0;
|
|
1402
|
+
}, gt = (e) => {
|
|
1386
1403
|
let t;
|
|
1387
1404
|
try {
|
|
1388
1405
|
t = new URL(e).pathname;
|
|
1389
1406
|
} catch {
|
|
1390
|
-
t =
|
|
1407
|
+
t = x(e);
|
|
1391
1408
|
}
|
|
1392
1409
|
let n = t.split("/").filter(Boolean).pop() ?? "";
|
|
1393
1410
|
try {
|
|
@@ -1395,13 +1412,13 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1395
1412
|
} catch {
|
|
1396
1413
|
return n;
|
|
1397
1414
|
}
|
|
1398
|
-
},
|
|
1399
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: i } =
|
|
1415
|
+
}, _t = (e, t) => {
|
|
1416
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: i } = st(), o = ct(), { customVisualizers: s, themeId: c, onBeforeOpen: l } = t, d = R(null), f = F(async (t, n, r) => {
|
|
1400
1417
|
if (t.url == null && t.referenceUrl != null) {
|
|
1401
1418
|
let i = e.resolveReferencePdfContent(t);
|
|
1402
1419
|
if (i != null) return r(i, t.name, n);
|
|
1403
1420
|
}
|
|
1404
|
-
let i = t.contentType.toLowerCase(), o =
|
|
1421
|
+
let i = t.contentType.toLowerCase(), o = Y(i, s);
|
|
1405
1422
|
if (o != null) {
|
|
1406
1423
|
let i = await e.resolveVisualizerContent(t, o, c);
|
|
1407
1424
|
if (i != null) return r(i, t.name, n);
|
|
@@ -1410,19 +1427,19 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1410
1427
|
let i = await e.resolveTextContent(t);
|
|
1411
1428
|
if (i != null) return r(i, t.name, n);
|
|
1412
1429
|
}
|
|
1413
|
-
let l =
|
|
1430
|
+
let l = Z("", i);
|
|
1414
1431
|
if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1415
|
-
let u =
|
|
1432
|
+
let u = pt[i];
|
|
1416
1433
|
if (u != null) return r(await e[u](t) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1417
|
-
let d = t.name ?? "", f = d.lastIndexOf("."), p = f === -1 ? "" : d.slice(f + 1).toLowerCase(), m =
|
|
1434
|
+
let d = t.name ?? "", f = d.lastIndexOf("."), p = f === -1 ? "" : d.slice(f + 1).toLowerCase(), m = Z(d);
|
|
1418
1435
|
if (m != null) return r(await e.resolveOoxmlContent(t, m) ?? Q(e.resolveContentUrl(t)), t.name, n);
|
|
1419
|
-
let h =
|
|
1436
|
+
let h = mt[p];
|
|
1420
1437
|
if (h != null) {
|
|
1421
1438
|
let i = await e[h](t);
|
|
1422
1439
|
return i != null && r(i, t.name, n);
|
|
1423
1440
|
}
|
|
1424
|
-
let g = t.name != null &&
|
|
1425
|
-
if (t.name != null && !
|
|
1441
|
+
let g = t.name != null && Xe(t.name) || t.url != null && Xe(gt(t.url));
|
|
1442
|
+
if (t.name != null && !Ye(t.name) && !g) return r(Q(e.resolveContentUrl(t)), t.name, n);
|
|
1426
1443
|
if (g) {
|
|
1427
1444
|
let i = await e.resolveHtmlContent(t);
|
|
1428
1445
|
return i == null ? e.hasTextSource(t) ? r(Q(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
|
|
@@ -1430,40 +1447,40 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1430
1447
|
url: t.url
|
|
1431
1448
|
}, t.name, n) : r(i, t.name, n);
|
|
1432
1449
|
}
|
|
1433
|
-
let _ = await e.resolveCodeContent(t,
|
|
1450
|
+
let _ = await e.resolveCodeContent(t, Qe(p));
|
|
1434
1451
|
return _ != null && r(_, t.name, n);
|
|
1435
1452
|
}, [
|
|
1436
1453
|
s,
|
|
1437
1454
|
c,
|
|
1438
1455
|
e
|
|
1439
|
-
]), p = F(async (t,
|
|
1440
|
-
let
|
|
1456
|
+
]), p = F(async (t, c = t.id, p) => {
|
|
1457
|
+
let m = () => p == null || p(), h = (e, t, r) => m() ? (n(e, t, r), !0) : (nt(e), !1);
|
|
1441
1458
|
switch (t.type) {
|
|
1442
|
-
case
|
|
1459
|
+
case u.Image: {
|
|
1443
1460
|
let r = e.resolveImageContent(t);
|
|
1444
|
-
return r != null && (
|
|
1461
|
+
return r != null && (l?.(), n(r, t.name, c), !0);
|
|
1445
1462
|
}
|
|
1446
|
-
case
|
|
1463
|
+
case u.Audio: {
|
|
1447
1464
|
let e = t.playUrl ?? t.url;
|
|
1448
1465
|
return e != null && (n({
|
|
1449
1466
|
type: a.Audio,
|
|
1450
1467
|
url: e,
|
|
1451
1468
|
mimeType: t.contentType || void 0
|
|
1452
|
-
}, t.name,
|
|
1469
|
+
}, t.name, c), !0);
|
|
1453
1470
|
}
|
|
1454
|
-
case
|
|
1471
|
+
case u.File: {
|
|
1455
1472
|
let e = () => {
|
|
1456
|
-
d.current?.(t,
|
|
1457
|
-
}, a = (t, r, i) =>
|
|
1458
|
-
|
|
1459
|
-
let
|
|
1460
|
-
return !
|
|
1473
|
+
d.current?.(t, c, o?.());
|
|
1474
|
+
}, a = (t, r, i) => m() ? (n(t, r, i, e), !0) : (nt(t), !1);
|
|
1475
|
+
l?.(), r(t.name, c, ht(t, s));
|
|
1476
|
+
let u = await f(t, c, a);
|
|
1477
|
+
return !u && m() && i(), u;
|
|
1461
1478
|
}
|
|
1462
|
-
case
|
|
1463
|
-
case
|
|
1464
|
-
|
|
1479
|
+
case u.Pasted:
|
|
1480
|
+
case u.Prompt: {
|
|
1481
|
+
l?.(), r(t.name, c);
|
|
1465
1482
|
let n = await e.resolveTextContent(t);
|
|
1466
|
-
return n == null ? (
|
|
1483
|
+
return n == null ? (m() && i(), !1) : h(n, t.name, c);
|
|
1467
1484
|
}
|
|
1468
1485
|
default: return !1;
|
|
1469
1486
|
}
|
|
@@ -1471,14 +1488,15 @@ var it = N(void 0), at = ({ children: e }) => {
|
|
|
1471
1488
|
n,
|
|
1472
1489
|
r,
|
|
1473
1490
|
i,
|
|
1474
|
-
|
|
1491
|
+
l,
|
|
1475
1492
|
f,
|
|
1476
1493
|
e,
|
|
1477
|
-
o
|
|
1494
|
+
o,
|
|
1495
|
+
s
|
|
1478
1496
|
]);
|
|
1479
1497
|
return I(() => {
|
|
1480
1498
|
d.current = p;
|
|
1481
1499
|
}, [p]), { openAttachmentCanvas: p };
|
|
1482
1500
|
};
|
|
1483
1501
|
//#endregion
|
|
1484
|
-
export {
|
|
1502
|
+
export { W as ATTACHMENT_CANVAS_CLASS, Be as AttachmentCanvas, Le as AttachmentCanvasBody, ut as AttachmentCanvasContainer, ot as AttachmentCanvasProvider, a as AttachmentContentType, r as AttachmentErrorType, be as CodeContent, xe as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ft as InlineGroupedVisualizer, e as McpAppCanvasRenderer, i as OoxmlFileType, n as OoxmlHighlightKind, et as createForbiddenCanvasContent, $e as createLoadErrorCanvasContent, Q as createUnsupportedCanvasContent, o as downloadAttachmentContent, Qe as extensionToLanguage, Oe as findVisualizerForApplication, Y as findVisualizerForMime, Z as getOoxmlFileType, Je as getOoxmlMimeType, ke as groupedVisualizerCanvasKey, c as isDownloadable, Xe as isHtmlPreviewable, qe as isOoxmlPreviewable, Ye as isTextPreviewable, Ae as partitionAttachmentsForApplicationVisualizer, st as useAttachmentCanvas, lt as useLatestCanvasRequest, _t as useOpenAttachmentCanvas };
|