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