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