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