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