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