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