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