@shane_donnelly/dsi-internal-react-utils 1.2.0 → 1.3.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/dist/BotMessage-9XyyKf52.js +242 -0
- package/dist/{MarkdownRenderer-vU2aoyaG.js → MarkdownRenderer-DsCX-ARI.js} +1 -1
- package/dist/{SessionContainer-DfTD7hX3.js → SessionContainer-k652tx2b.js} +2 -2
- package/dist/{SessionHistory-BUYwbZjE.js → SessionHistory-Ix5_68Dt.js} +2 -2
- package/dist/{UserMessage-CkrDUpkQ.js → UserMessage-iwSKfrPo.js} +1 -1
- package/dist/{bs-CmZftXMO.js → bs-BGOTKj78.js} +20 -2
- package/dist/chatbot/BotMessage/ImageElement.d.ts +21 -0
- package/dist/chatbot/BotMessage/ImageElement.js +68 -0
- package/dist/chatbot/BotMessage/IsolatedHtmlElement.d.ts +26 -0
- package/dist/chatbot/BotMessage/IsolatedHtmlElement.js +35 -0
- package/dist/chatbot/BotMessage/PlotlyChartElement.d.ts +23 -0
- package/dist/chatbot/BotMessage/PlotlyChartElement.js +30 -0
- package/dist/chatbot/BotMessage/VegaChartElement.d.ts +21 -0
- package/dist/chatbot/BotMessage/VegaChartElement.js +17 -0
- package/dist/chatbot/BotMessage/index.d.ts +6 -16
- package/dist/chatbot/BotMessage/index.js +1 -1
- package/dist/chatbot/BotMessage/types.d.ts +16 -0
- package/dist/chatbot/BotMessage/types.js +0 -0
- package/dist/chatbot/InputBar/index.js +1 -1
- package/dist/chatbot/MarkdownRenderer/index.js +1 -1
- package/dist/chatbot/SessionContainer/index.js +1 -1
- package/dist/chatbot/SessionHistory/index.js +1 -1
- package/dist/chatbot/UserMessage/index.js +1 -1
- package/dist/chatbot/index.d.ts +1 -1
- package/dist/chatbot/index.js +6 -6
- package/dist/chatbot/theme/types.js +2 -2
- package/dist/keycloak/core/client.d.ts +1 -1
- package/dist/keycloak/core/client.js +6 -3
- package/dist/keycloak/react/KeycloakProvider/index.js +16 -6
- package/dist/main.d.ts +1 -1
- package/dist/main.js +6 -6
- package/dist/style.css +1 -1
- package/dist/styles.module-DTfCO5TA.js +34 -0
- package/package.json +9 -5
- package/dist/BotMessage-DegH8sM-.js +0 -255
- /package/dist/{InputBar-CVy2_QtC.js → InputBar-DOkn2T-l.js} +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { t as e } from "./MarkdownRenderer-DsCX-ARI.js";
|
|
2
|
+
import { useTheme as t } from "./chatbot/theme/useTheme.js";
|
|
3
|
+
import { t as n } from "./iconBase-CDbPVA4E.js";
|
|
4
|
+
import { n as r, t as i } from "./bs-BGOTKj78.js";
|
|
5
|
+
import { t as a } from "./styles.module-DTfCO5TA.js";
|
|
6
|
+
import { ImageElement as o } from "./chatbot/BotMessage/ImageElement.js";
|
|
7
|
+
import { IsolatedHtmlElement as s } from "./chatbot/BotMessage/IsolatedHtmlElement.js";
|
|
8
|
+
import { VegaChartElement as c } from "./chatbot/BotMessage/VegaChartElement.js";
|
|
9
|
+
import { PlotlyChartElement as l } from "./chatbot/BotMessage/PlotlyChartElement.js";
|
|
10
|
+
import { useEffect as u, useState as d } from "react";
|
|
11
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
//#region node_modules/react-icons/tb/index.mjs
|
|
13
|
+
function h(e) {
|
|
14
|
+
return n({
|
|
15
|
+
tag: "svg",
|
|
16
|
+
attr: {
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
fill: "none",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "2",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
},
|
|
24
|
+
child: [
|
|
25
|
+
{
|
|
26
|
+
tag: "path",
|
|
27
|
+
attr: { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" },
|
|
28
|
+
child: []
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
tag: "path",
|
|
32
|
+
attr: { d: "M3.6 9h16.8" },
|
|
33
|
+
child: []
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
tag: "path",
|
|
37
|
+
attr: { d: "M3.6 15h16.8" },
|
|
38
|
+
child: []
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
tag: "path",
|
|
42
|
+
attr: { d: "M11.5 3a17 17 0 0 0 0 18" },
|
|
43
|
+
child: []
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
tag: "path",
|
|
47
|
+
attr: { d: "M12.5 3a17 17 0 0 1 0 18" },
|
|
48
|
+
child: []
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
})(e);
|
|
52
|
+
}
|
|
53
|
+
function g(e) {
|
|
54
|
+
return n({
|
|
55
|
+
tag: "svg",
|
|
56
|
+
attr: {
|
|
57
|
+
viewBox: "0 0 24 24",
|
|
58
|
+
fill: "none",
|
|
59
|
+
stroke: "currentColor",
|
|
60
|
+
strokeWidth: "2",
|
|
61
|
+
strokeLinecap: "round",
|
|
62
|
+
strokeLinejoin: "round"
|
|
63
|
+
},
|
|
64
|
+
child: [{
|
|
65
|
+
tag: "path",
|
|
66
|
+
attr: { d: "M6 9l6 6l6 -6" },
|
|
67
|
+
child: []
|
|
68
|
+
}]
|
|
69
|
+
})(e);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region lib/chatbot/BotMessage/index.tsx
|
|
73
|
+
function _({ markdownText: t }) {
|
|
74
|
+
return t ? /* @__PURE__ */ p(e, { text: t }) : null;
|
|
75
|
+
}
|
|
76
|
+
function v() {
|
|
77
|
+
return /* @__PURE__ */ p("svg", {
|
|
78
|
+
className: a["dsi-bot-loading-dot"],
|
|
79
|
+
width: "10",
|
|
80
|
+
height: "10",
|
|
81
|
+
viewBox: "0 0 10 10",
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
children: /* @__PURE__ */ p("circle", {
|
|
84
|
+
cx: "5",
|
|
85
|
+
cy: "5",
|
|
86
|
+
r: "4",
|
|
87
|
+
fill: "currentColor"
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function y({ text: e }) {
|
|
92
|
+
let [t, n] = d(!1);
|
|
93
|
+
return /* @__PURE__ */ p("button", {
|
|
94
|
+
className: a["dsi-bot-copy-btn"],
|
|
95
|
+
onClick: () => {
|
|
96
|
+
navigator.clipboard.writeText(e).then(() => {
|
|
97
|
+
n(!0), setTimeout(() => n(!1), 2e3);
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
"aria-label": "Copier le message",
|
|
101
|
+
type: "button",
|
|
102
|
+
children: p(t ? i : r, {})
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function b({ defaultOpen: e, closeWhen: t = !1, header: n, content: r, className: i, style: o }) {
|
|
106
|
+
let [s, c] = d(e);
|
|
107
|
+
return u(() => {
|
|
108
|
+
t && c(!1);
|
|
109
|
+
}, [t]), /* @__PURE__ */ m("div", {
|
|
110
|
+
className: i,
|
|
111
|
+
style: o,
|
|
112
|
+
children: [/* @__PURE__ */ m("div", {
|
|
113
|
+
className: a["dsi-bot-collapsible-header"],
|
|
114
|
+
onClick: () => c((e) => !e),
|
|
115
|
+
role: "button",
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
onKeyDown: (e) => {
|
|
118
|
+
(e.key === "Enter" || e.key === " ") && c((e) => !e);
|
|
119
|
+
},
|
|
120
|
+
"aria-expanded": s,
|
|
121
|
+
children: [/* @__PURE__ */ p("div", {
|
|
122
|
+
className: a["dsi-bot-collapsible-header-inner"],
|
|
123
|
+
children: n
|
|
124
|
+
}), /* @__PURE__ */ p(g, {
|
|
125
|
+
className: a["dsi-bot-collapse-chevron"],
|
|
126
|
+
style: { transform: s ? "rotate(0deg)" : "rotate(-90deg)" },
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
})]
|
|
129
|
+
}), s && r && /* @__PURE__ */ p("div", {
|
|
130
|
+
className: a["dsi-bot-collapsible-body"],
|
|
131
|
+
children: r
|
|
132
|
+
})]
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function x({ title: e, content: n, isLoading: r = !1, _isLastElement: i = !1 }) {
|
|
136
|
+
let o = t();
|
|
137
|
+
return /* @__PURE__ */ p(b, {
|
|
138
|
+
defaultOpen: r || i,
|
|
139
|
+
closeWhen: !r && !i,
|
|
140
|
+
className: a["dsi-bot-reasoning"],
|
|
141
|
+
style: {
|
|
142
|
+
"--dsi-reasoning-border": o.reasoningBorder,
|
|
143
|
+
"--dsi-reasoning-text": o.reasoningText
|
|
144
|
+
},
|
|
145
|
+
header: /* @__PURE__ */ p("span", {
|
|
146
|
+
className: a["dsi-bot-element-title"],
|
|
147
|
+
children: e || "Raisonnement"
|
|
148
|
+
}),
|
|
149
|
+
content: n ? /* @__PURE__ */ p("p", {
|
|
150
|
+
className: a["dsi-bot-collapsible-content"],
|
|
151
|
+
children: n
|
|
152
|
+
}) : null
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function S({ title: e, content: n, isLoading: r = !1, _isLastElement: i = !1 }) {
|
|
156
|
+
let o = t();
|
|
157
|
+
return /* @__PURE__ */ p(b, {
|
|
158
|
+
defaultOpen: r || i,
|
|
159
|
+
closeWhen: !r && !i,
|
|
160
|
+
className: a["dsi-bot-tool"],
|
|
161
|
+
style: {
|
|
162
|
+
"--dsi-tool-border": o.toolBorder,
|
|
163
|
+
"--dsi-text-secondary": o.textSecondary,
|
|
164
|
+
"--dsi-text-primary": o.textPrimary
|
|
165
|
+
},
|
|
166
|
+
header: /* @__PURE__ */ m(f, { children: [r && /* @__PURE__ */ p("span", { className: a["dsi-bot-spinner"] }), /* @__PURE__ */ p("span", {
|
|
167
|
+
className: a["dsi-bot-element-title"],
|
|
168
|
+
children: e || "Outil"
|
|
169
|
+
})] }),
|
|
170
|
+
content: n ? /* @__PURE__ */ p("p", {
|
|
171
|
+
className: a["dsi-bot-collapsible-content"],
|
|
172
|
+
children: n
|
|
173
|
+
}) : null
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function C({ title: e, content: n, isLoading: r = !1, _isLastElement: i = !1 }) {
|
|
177
|
+
let o = t();
|
|
178
|
+
return /* @__PURE__ */ p(b, {
|
|
179
|
+
defaultOpen: r || i,
|
|
180
|
+
closeWhen: !r && !i,
|
|
181
|
+
className: a["dsi-bot-search"],
|
|
182
|
+
style: {
|
|
183
|
+
"--dsi-tool-border": o.toolBorder,
|
|
184
|
+
"--dsi-text-secondary": o.textSecondary,
|
|
185
|
+
"--dsi-text-primary": o.textPrimary
|
|
186
|
+
},
|
|
187
|
+
header: /* @__PURE__ */ m(f, { children: [
|
|
188
|
+
/* @__PURE__ */ p(h, { className: a["dsi-bot-search-icon"] }),
|
|
189
|
+
r && /* @__PURE__ */ p("span", { className: a["dsi-bot-spinner"] }),
|
|
190
|
+
/* @__PURE__ */ p("span", {
|
|
191
|
+
className: a["dsi-bot-element-title"],
|
|
192
|
+
children: e || "Recherche"
|
|
193
|
+
})
|
|
194
|
+
] }),
|
|
195
|
+
content: n ? /* @__PURE__ */ p("p", {
|
|
196
|
+
className: a["dsi-bot-collapsible-content"],
|
|
197
|
+
children: n
|
|
198
|
+
}) : null
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
var w = {
|
|
202
|
+
text: _,
|
|
203
|
+
reasoning: x,
|
|
204
|
+
tool: S,
|
|
205
|
+
search: C,
|
|
206
|
+
image: o,
|
|
207
|
+
isolatedHtml: s,
|
|
208
|
+
vegaChart: c,
|
|
209
|
+
plotlyChart: l
|
|
210
|
+
};
|
|
211
|
+
function T({ message: e, registry: n = w }) {
|
|
212
|
+
let r = t(), i = [...e.elements].sort((e, t) => e.index - t.index), o = [...i].reverse().find((e) => e.type === "text")?.markdownText ?? "";
|
|
213
|
+
return /* @__PURE__ */ m("div", {
|
|
214
|
+
className: a["dsi-bot-msg"],
|
|
215
|
+
style: {
|
|
216
|
+
"--dsi-text-primary": r.textPrimary,
|
|
217
|
+
"--dsi-text-secondary": r.textSecondary,
|
|
218
|
+
"--dsi-border": r.border
|
|
219
|
+
},
|
|
220
|
+
children: [
|
|
221
|
+
e.isLoading && /* @__PURE__ */ p(v, {}),
|
|
222
|
+
i.map((e, t) => {
|
|
223
|
+
let r = n[e.type];
|
|
224
|
+
if (!r) return null;
|
|
225
|
+
let a = t === i.length - 1;
|
|
226
|
+
return /* @__PURE__ */ p(r, {
|
|
227
|
+
...e,
|
|
228
|
+
_isLastElement: a
|
|
229
|
+
}, `${e.type}-${e.index}-${t}`);
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ m("div", {
|
|
232
|
+
className: a["dsi-bot-msg-footer"],
|
|
233
|
+
children: [!e.isLoading && /* @__PURE__ */ p(y, { text: o }), !e.isLoading && e.timeOrDateToDisplay && /* @__PURE__ */ p("span", {
|
|
234
|
+
className: a["dsi-bot-msg-time"],
|
|
235
|
+
children: e.timeOrDateToDisplay
|
|
236
|
+
})]
|
|
237
|
+
})
|
|
238
|
+
]
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
export { w as n, T as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTheme as e } from "./chatbot/theme/useTheme.js";
|
|
2
|
-
import { n as t, t as n } from "./bs-
|
|
2
|
+
import { n as t, t as n } from "./bs-BGOTKj78.js";
|
|
3
3
|
import { useRef as r, useState as i } from "react";
|
|
4
4
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTheme as e } from "./chatbot/theme/useTheme.js";
|
|
2
|
-
import { t } from "./SessionHistory-
|
|
3
|
-
import { t as n } from "./InputBar-
|
|
2
|
+
import { t } from "./SessionHistory-Ix5_68Dt.js";
|
|
3
|
+
import { t as n } from "./InputBar-DOkn2T-l.js";
|
|
4
4
|
import { useEffect as r, useMemo as i, useRef as a } from "react";
|
|
5
5
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
//#region lib/chatbot/SessionContainer/styles.module.css
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./UserMessage-
|
|
2
|
-
import { n as t, t as n } from "./BotMessage-
|
|
1
|
+
import { t as e } from "./UserMessage-iwSKfrPo.js";
|
|
2
|
+
import { n as t, t as n } from "./BotMessage-9XyyKf52.js";
|
|
3
3
|
import { useEffect as r, useRef as i } from "react";
|
|
4
4
|
import { jsx as a } from "react/jsx-runtime";
|
|
5
5
|
//#region lib/chatbot/SessionHistory/styles.module.css
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTheme as e } from "./chatbot/theme/useTheme.js";
|
|
2
|
-
import { n as t, t as n } from "./bs-
|
|
2
|
+
import { n as t, t as n } from "./bs-BGOTKj78.js";
|
|
3
3
|
import r from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region lib/chatbot/UserMessage/styles.module.css
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { t as e } from "./iconBase-CDbPVA4E.js";
|
|
2
2
|
//#region node_modules/react-icons/bs/index.mjs
|
|
3
3
|
function t(t) {
|
|
4
|
+
return e({
|
|
5
|
+
tag: "svg",
|
|
6
|
+
attr: {
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
viewBox: "0 0 16 16"
|
|
9
|
+
},
|
|
10
|
+
child: [{
|
|
11
|
+
tag: "path",
|
|
12
|
+
attr: { d: "M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5" },
|
|
13
|
+
child: []
|
|
14
|
+
}, {
|
|
15
|
+
tag: "path",
|
|
16
|
+
attr: { d: "M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708z" },
|
|
17
|
+
child: []
|
|
18
|
+
}]
|
|
19
|
+
})(t);
|
|
20
|
+
}
|
|
21
|
+
function n(t) {
|
|
4
22
|
return e({
|
|
5
23
|
tag: "svg",
|
|
6
24
|
attr: {
|
|
@@ -17,7 +35,7 @@ function t(t) {
|
|
|
17
35
|
}]
|
|
18
36
|
})(t);
|
|
19
37
|
}
|
|
20
|
-
function
|
|
38
|
+
function r(t) {
|
|
21
39
|
return e({
|
|
22
40
|
tag: "svg",
|
|
23
41
|
attr: {
|
|
@@ -32,4 +50,4 @@ function n(t) {
|
|
|
32
50
|
})(t);
|
|
33
51
|
}
|
|
34
52
|
//#endregion
|
|
35
|
-
export { t as
|
|
53
|
+
export { n, t as r, r as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Élément image — affichage d'une image avec spinner pendant le chargement
|
|
4
|
+
* et état d'erreur si le chargement échoue.
|
|
5
|
+
*
|
|
6
|
+
* ```python
|
|
7
|
+
* # Pydantic (Python)
|
|
8
|
+
* class ImageElementData(ElementData):
|
|
9
|
+
* type: Literal["image"] = "image"
|
|
10
|
+
* src: str
|
|
11
|
+
* alt: Optional[str] = "Image Not Found"
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export interface ImageElementData extends ElementData {
|
|
15
|
+
type: "image";
|
|
16
|
+
/** URL ou base64 de l'image */
|
|
17
|
+
src: string;
|
|
18
|
+
/** Texte alternatif (défaut : "Image Not Found") */
|
|
19
|
+
alt?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function ImageElement({ src, alt }: ImageElementData): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "../../bs-BGOTKj78.js";
|
|
2
|
+
import { t as r } from "../../styles.module-DTfCO5TA.js";
|
|
3
|
+
import { useState as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region lib/chatbot/BotMessage/ImageElement.tsx
|
|
6
|
+
function s({ src: s, alt: c = "Image Not Found" }) {
|
|
7
|
+
let [l, u] = i("loading"), [d, f] = i(!1);
|
|
8
|
+
return /* @__PURE__ */ o("div", {
|
|
9
|
+
className: r["dsi-bot-image-wrap"],
|
|
10
|
+
children: [
|
|
11
|
+
l === "loading" && /* @__PURE__ */ a("div", {
|
|
12
|
+
className: r["dsi-bot-image-placeholder"],
|
|
13
|
+
children: /* @__PURE__ */ a("span", {
|
|
14
|
+
className: r["dsi-bot-image-spinner"],
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
})
|
|
17
|
+
}),
|
|
18
|
+
l === "error" && /* @__PURE__ */ a("div", {
|
|
19
|
+
className: r["dsi-bot-image-placeholder"],
|
|
20
|
+
children: /* @__PURE__ */ a("span", {
|
|
21
|
+
className: r["dsi-bot-image-error"],
|
|
22
|
+
children: c
|
|
23
|
+
})
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ a("img", {
|
|
26
|
+
src: s,
|
|
27
|
+
alt: c,
|
|
28
|
+
className: r["dsi-bot-image"],
|
|
29
|
+
style: { display: l === "loaded" ? "block" : "none" },
|
|
30
|
+
onLoad: () => u("loaded"),
|
|
31
|
+
onError: () => u("error")
|
|
32
|
+
}),
|
|
33
|
+
l === "loaded" && /* @__PURE__ */ o("div", {
|
|
34
|
+
className: r["dsi-bot-image-actions"],
|
|
35
|
+
children: [/* @__PURE__ */ a("button", {
|
|
36
|
+
className: r["dsi-bot-image-btn"],
|
|
37
|
+
onClick: async () => {
|
|
38
|
+
try {
|
|
39
|
+
let e = await (await fetch(s)).blob();
|
|
40
|
+
await navigator.clipboard.write([new ClipboardItem({ [e.type]: e })]);
|
|
41
|
+
} catch {
|
|
42
|
+
await navigator.clipboard.writeText(s);
|
|
43
|
+
}
|
|
44
|
+
f(!0), setTimeout(() => f(!1), 2e3);
|
|
45
|
+
},
|
|
46
|
+
"aria-label": "Copier l'image",
|
|
47
|
+
type: "button",
|
|
48
|
+
children: a(d ? n : e, {})
|
|
49
|
+
}), /* @__PURE__ */ a("button", {
|
|
50
|
+
className: r["dsi-bot-image-btn"],
|
|
51
|
+
onClick: async () => {
|
|
52
|
+
try {
|
|
53
|
+
let e = await (await fetch(s)).blob(), t = URL.createObjectURL(e), n = s.startsWith("data:") ? `image.${e.type.split("/")[1] || "png"}` : s.split("/").pop()?.split("?")[0] || "image", r = document.createElement("a");
|
|
54
|
+
r.href = t, r.download = n, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(t);
|
|
55
|
+
} catch {
|
|
56
|
+
window.open(s, "_blank", "noopener,noreferrer");
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"aria-label": "Télécharger l'image",
|
|
60
|
+
type: "button",
|
|
61
|
+
children: /* @__PURE__ */ a(t, {})
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { s as ImageElement };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ElementData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Élément affichant du contenu HTML de façon isolée et sécurisée
|
|
4
|
+
* (iframe sandboxée).
|
|
5
|
+
*
|
|
6
|
+
* La hauteur de l'iframe est ajustée automatiquement au contenu via
|
|
7
|
+
* `onLoad` + lecture de `scrollHeight` (accessible grâce à `allow-same-origin`).
|
|
8
|
+
* Le CSS du document parent ne fuit pas dans l'iframe — l'isolation visuelle
|
|
9
|
+
* est garantie par le document séparé de l'iframe.
|
|
10
|
+
*
|
|
11
|
+
* ```python
|
|
12
|
+
* # Pydantic (Python)
|
|
13
|
+
* class IsolatedHtmlElementData(ElementData):
|
|
14
|
+
* type: Literal["isolatedHtml"] = "isolatedHtml"
|
|
15
|
+
* htmlContent: str
|
|
16
|
+
* sandbox: Optional[str] = "allow-scripts allow-same-origin allow-forms"
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export interface IsolatedHtmlElementData extends ElementData {
|
|
20
|
+
type: "isolatedHtml";
|
|
21
|
+
/** Contenu HTML à afficher dans l'iframe */
|
|
22
|
+
htmlContent: string;
|
|
23
|
+
/** Options de sandbox (défaut : "allow-scripts allow-same-origin allow-forms") */
|
|
24
|
+
sandbox?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function IsolatedHtmlElement({ htmlContent, sandbox, }: IsolatedHtmlElementData): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as e, t } from "../../bs-BGOTKj78.js";
|
|
2
|
+
import { t as n } from "../../styles.module-DTfCO5TA.js";
|
|
3
|
+
import { useRef as r, useState as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region lib/chatbot/BotMessage/IsolatedHtmlElement.tsx
|
|
6
|
+
function s({ htmlContent: s, sandbox: c = "allow-scripts allow-same-origin allow-forms" }) {
|
|
7
|
+
let [l, u] = i(!1), [d, f] = i(void 0), p = r(null);
|
|
8
|
+
return /* @__PURE__ */ o("div", {
|
|
9
|
+
className: n["dsi-bot-iframe-wrap"],
|
|
10
|
+
children: [/* @__PURE__ */ a("iframe", {
|
|
11
|
+
ref: p,
|
|
12
|
+
srcDoc: s,
|
|
13
|
+
sandbox: c,
|
|
14
|
+
className: n["dsi-bot-iframe"],
|
|
15
|
+
style: d === void 0 ? void 0 : { height: `${d}px` },
|
|
16
|
+
onLoad: () => {
|
|
17
|
+
let e = p.current?.contentWindow?.document;
|
|
18
|
+
e && f(e.documentElement.scrollHeight);
|
|
19
|
+
},
|
|
20
|
+
title: "isolated-html"
|
|
21
|
+
}), /* @__PURE__ */ a("button", {
|
|
22
|
+
className: n["dsi-bot-iframe-copy"],
|
|
23
|
+
onClick: () => {
|
|
24
|
+
navigator.clipboard.writeText(s).then(() => {
|
|
25
|
+
u(!0), setTimeout(() => u(!1), 2e3);
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
"aria-label": "Copier le HTML",
|
|
29
|
+
type: "button",
|
|
30
|
+
children: a(l ? t : e, {})
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { s as IsolatedHtmlElement };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementData } from './types';
|
|
2
|
+
type AnyData = any[];
|
|
3
|
+
type AnyLayout = any;
|
|
4
|
+
/**
|
|
5
|
+
* Élément affichant un graphique Plotly.
|
|
6
|
+
*
|
|
7
|
+
* ```python
|
|
8
|
+
* # Pydantic (Python)
|
|
9
|
+
* class PlotlyChartElementData(ElementData):
|
|
10
|
+
* type: Literal["plotlyChart"] = "plotlyChart"
|
|
11
|
+
* data: list[dict]
|
|
12
|
+
* layout: Optional[dict] = None
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export interface PlotlyChartElementData extends ElementData {
|
|
16
|
+
type: "plotlyChart";
|
|
17
|
+
/** Liste des traces Plotly (voir https://plot.ly/javascript/reference/) */
|
|
18
|
+
data: AnyData;
|
|
19
|
+
/** Layout Plotly (voir https://plot.ly/javascript/reference/#layout) */
|
|
20
|
+
layout?: AnyLayout;
|
|
21
|
+
}
|
|
22
|
+
export declare function PlotlyChartElement({ data, layout }: PlotlyChartElementData): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as e } from "../../styles.module-DTfCO5TA.js";
|
|
2
|
+
import { Suspense as t, lazy as n, useEffect as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
//#region lib/chatbot/BotMessage/PlotlyChartElement.tsx
|
|
5
|
+
var o = n(async () => {
|
|
6
|
+
let e = await import("react-plotly.js"), t = typeof e == "function" ? e : typeof e?.default == "function" ? e.default : typeof e?.default?.default == "function" ? e.default.default : null;
|
|
7
|
+
if (!t) throw Error("[dsi-react-utils] react-plotly.js loaded but no component export found");
|
|
8
|
+
return { default: t };
|
|
9
|
+
});
|
|
10
|
+
function s({ data: n, layout: s }) {
|
|
11
|
+
let [c, l] = i(!1);
|
|
12
|
+
return r(() => l(!0), []), c ? /* @__PURE__ */ a("div", {
|
|
13
|
+
className: e["dsi-bot-chart-wrap"],
|
|
14
|
+
children: /* @__PURE__ */ a(t, {
|
|
15
|
+
fallback: /* @__PURE__ */ a("div", {}),
|
|
16
|
+
children: /* @__PURE__ */ a(o, {
|
|
17
|
+
data: n,
|
|
18
|
+
layout: s,
|
|
19
|
+
config: {
|
|
20
|
+
displaylogo: !1,
|
|
21
|
+
responsive: !0
|
|
22
|
+
},
|
|
23
|
+
useResizeHandler: !0,
|
|
24
|
+
style: { maxWidth: "100%" }
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
}) : /* @__PURE__ */ a("div", { className: e["dsi-bot-chart-wrap"] });
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { s as PlotlyChartElement };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementData } from './types';
|
|
2
|
+
type AnySpec = any;
|
|
3
|
+
/**
|
|
4
|
+
* Élément affichant un graphique Vega / Vega-Lite.
|
|
5
|
+
* Wrapper léger autour de `react-vega` (importé dynamiquement pour rester
|
|
6
|
+
* compatible SSR).
|
|
7
|
+
*
|
|
8
|
+
* ```python
|
|
9
|
+
* # Pydantic (Python)
|
|
10
|
+
* class VegaChartElementData(ElementData):
|
|
11
|
+
* type: Literal["vegaChart"] = "vegaChart"
|
|
12
|
+
* chartSpec: dict # spec Vega ou Vega-Lite, data incluse
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export interface VegaChartElementData extends ElementData {
|
|
16
|
+
type: "vegaChart";
|
|
17
|
+
/** Spécification Vega ou Vega-Lite (data incluse) */
|
|
18
|
+
chartSpec: AnySpec;
|
|
19
|
+
}
|
|
20
|
+
export declare function VegaChartElement({ chartSpec }: VegaChartElementData): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as e } from "../../styles.module-DTfCO5TA.js";
|
|
2
|
+
import { Suspense as t, lazy as n, useEffect as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
//#region lib/chatbot/BotMessage/VegaChartElement.tsx
|
|
5
|
+
var o = n(async () => ({ default: (await import("react-vega")).VegaEmbed }));
|
|
6
|
+
function s({ chartSpec: n }) {
|
|
7
|
+
let [s, c] = i(!1);
|
|
8
|
+
return r(() => c(!0), []), s ? /* @__PURE__ */ a("div", {
|
|
9
|
+
className: e["dsi-bot-chart-wrap"],
|
|
10
|
+
children: /* @__PURE__ */ a(t, {
|
|
11
|
+
fallback: /* @__PURE__ */ a("div", {}),
|
|
12
|
+
children: /* @__PURE__ */ a(o, { spec: n })
|
|
13
|
+
})
|
|
14
|
+
}) : /* @__PURE__ */ a("div", { className: e["dsi-bot-chart-wrap"] });
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { s as VegaChartElement };
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* index: int
|
|
9
|
-
* type: str
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export interface ElementData {
|
|
13
|
-
/** Ordre d'affichage de l'élément dans le message */
|
|
14
|
-
index: number;
|
|
15
|
-
/** Type d'élément — doit correspondre à une clé du registry utilisé */
|
|
16
|
-
type: string;
|
|
17
|
-
}
|
|
2
|
+
import { ElementData } from './types';
|
|
3
|
+
export type { ElementData } from './types';
|
|
4
|
+
export type { ImageElementData } from './ImageElement';
|
|
5
|
+
export type { IsolatedHtmlElementData } from './IsolatedHtmlElement';
|
|
6
|
+
export type { VegaChartElementData } from './VegaChartElement';
|
|
7
|
+
export type { PlotlyChartElementData } from './PlotlyChartElement';
|
|
18
8
|
/**
|
|
19
9
|
* Élément de texte en markdown.
|
|
20
10
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../BotMessage-
|
|
1
|
+
import { n as e, t } from "../../BotMessage-9XyyKf52.js";
|
|
2
2
|
export { t as BotMessage, e as defaultBotMessageRegistry };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Données de base pour tout élément d'un message bot.
|
|
3
|
+
*
|
|
4
|
+
* ```python
|
|
5
|
+
* # Pydantic (Python)
|
|
6
|
+
* class ElementData(BaseModel):
|
|
7
|
+
* index: int
|
|
8
|
+
* type: str
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export interface ElementData {
|
|
12
|
+
/** Ordre d'affichage de l'élément dans le message */
|
|
13
|
+
index: number;
|
|
14
|
+
/** Type d'élément — doit correspondre à une clé du registry utilisé */
|
|
15
|
+
type: string;
|
|
16
|
+
}
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../MarkdownRenderer-
|
|
1
|
+
import { t as e } from "../../MarkdownRenderer-DsCX-ARI.js";
|
|
2
2
|
export { e as MarkdownRenderer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../SessionContainer-
|
|
1
|
+
import { t as e } from "../../SessionContainer-k652tx2b.js";
|
|
2
2
|
export { e as SessionContainer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../SessionHistory-
|
|
1
|
+
import { t as e } from "../../SessionHistory-Ix5_68Dt.js";
|
|
2
2
|
export { e as SessionHistory };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../UserMessage-
|
|
1
|
+
import { t as e } from "../../UserMessage-iwSKfrPo.js";
|
|
2
2
|
export { e as UserMessage };
|
package/dist/chatbot/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { MarkdownRendererProps } from './MarkdownRenderer';
|
|
|
5
5
|
export { UserMessage } from './UserMessage';
|
|
6
6
|
export type { UserMessageData, UserMessageProps } from './UserMessage';
|
|
7
7
|
export { BotMessage, defaultBotMessageRegistry } from './BotMessage';
|
|
8
|
-
export type { ElementData, TextElementData, ReasoningElementData, ToolElementData, SearchElementData, BotMessageData, BotMessageRegistry, BotMessageProps, } from './BotMessage';
|
|
8
|
+
export type { ElementData, TextElementData, ReasoningElementData, ToolElementData, SearchElementData, ImageElementData, IsolatedHtmlElementData, VegaChartElementData, PlotlyChartElementData, BotMessageData, BotMessageRegistry, BotMessageProps, } from './BotMessage';
|
|
9
9
|
export { SessionHistory } from './SessionHistory';
|
|
10
10
|
export type { SessionHistoryProps, SessionUserMessageSlots } from './SessionHistory';
|
|
11
11
|
export { InputBar, usePlusSlot } from './InputBar';
|
package/dist/chatbot/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as e } from "../MarkdownRenderer-
|
|
1
|
+
import { t as e } from "../MarkdownRenderer-DsCX-ARI.js";
|
|
2
2
|
import { getCurrentTheme as t, getTheme as n, setTheme as r } from "./theme/types.js";
|
|
3
3
|
import { useTheme as i } from "./theme/useTheme.js";
|
|
4
4
|
import "./theme/index.js";
|
|
5
|
-
import { t as a } from "../UserMessage-
|
|
6
|
-
import { n as o, t as s } from "../BotMessage-
|
|
7
|
-
import { t as c } from "../SessionHistory-
|
|
8
|
-
import { t as l } from "../InputBar-
|
|
5
|
+
import { t as a } from "../UserMessage-iwSKfrPo.js";
|
|
6
|
+
import { n as o, t as s } from "../BotMessage-9XyyKf52.js";
|
|
7
|
+
import { t as c } from "../SessionHistory-Ix5_68Dt.js";
|
|
8
|
+
import { t as l } from "../InputBar-DOkn2T-l.js";
|
|
9
9
|
import { usePlusSlot as u } from "./InputBar/usePlusSlot.js";
|
|
10
|
-
import { t as d } from "../SessionContainer-
|
|
10
|
+
import { t as d } from "../SessionContainer-k652tx2b.js";
|
|
11
11
|
export { s as BotMessage, l as InputBar, e as MarkdownRenderer, d as SessionContainer, c as SessionHistory, a as UserMessage, o as defaultBotMessageRegistry, t as getCurrentTheme, n as getTheme, r as setTheme, u as usePlusSlot, i as useTheme };
|
|
@@ -23,8 +23,8 @@ var e = {
|
|
|
23
23
|
actionButtonHoverBg: "#333333",
|
|
24
24
|
actionButtonIcon: "#ffffff"
|
|
25
25
|
}, t = {
|
|
26
|
-
background: "#
|
|
27
|
-
backgroundSecondary: "#
|
|
26
|
+
background: "#1d1d1d",
|
|
27
|
+
backgroundSecondary: "#333333",
|
|
28
28
|
userBubbleBg: "#303030",
|
|
29
29
|
userBubbleText: "#ececec",
|
|
30
30
|
textPrimary: "#ececec",
|
|
@@ -5,7 +5,7 @@ import { KeycloakConfig, AuthUser } from './types';
|
|
|
5
5
|
* @param config - Configuration du serveur Keycloak
|
|
6
6
|
* @returns Instance Keycloak
|
|
7
7
|
*/
|
|
8
|
-
export declare function createKeycloakInstance(config: KeycloakConfig): Keycloak
|
|
8
|
+
export declare function createKeycloakInstance(config: KeycloakConfig): Promise<Keycloak>;
|
|
9
9
|
/**
|
|
10
10
|
* Initialise une instance Keycloak avec PKCE S256.
|
|
11
11
|
* Traite un éventuel callback d'authentification dans l'URL,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import e from "keycloak-js";
|
|
2
1
|
//#region lib/keycloak/core/client.ts
|
|
3
|
-
function
|
|
4
|
-
|
|
2
|
+
async function e() {
|
|
3
|
+
let e = await import("keycloak-js");
|
|
4
|
+
return e.default ?? e;
|
|
5
|
+
}
|
|
6
|
+
async function t(t) {
|
|
7
|
+
return new (await (e()))({
|
|
5
8
|
url: t.url,
|
|
6
9
|
realm: t.realm,
|
|
7
10
|
clientId: t.clientId
|
|
@@ -34,12 +34,22 @@ function u({ config: r, children: u, idpHint: d, refreshInterval: f = 300, minTo
|
|
|
34
34
|
a(() => {
|
|
35
35
|
if (S.current) return;
|
|
36
36
|
S.current = !0;
|
|
37
|
-
let n =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
let n = !1;
|
|
38
|
+
return (async () => {
|
|
39
|
+
try {
|
|
40
|
+
let i = await e(r);
|
|
41
|
+
if (n) return;
|
|
42
|
+
x.current = i;
|
|
43
|
+
let a = await t(i);
|
|
44
|
+
if (n) return;
|
|
45
|
+
E(i), a || g("unauthenticated");
|
|
46
|
+
} catch (e) {
|
|
47
|
+
if (n) return;
|
|
48
|
+
console.error("[dsi-keycloak] Init error:", e), g("error");
|
|
49
|
+
}
|
|
50
|
+
})(), () => {
|
|
51
|
+
n = !0;
|
|
52
|
+
};
|
|
43
53
|
}, []), a(() => {
|
|
44
54
|
if (h !== "authenticated") return;
|
|
45
55
|
let e = window.setInterval(() => {
|
package/dist/main.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { KeycloakProvider, useKeycloakAuth, logoutKeycloak, refreshTokenKeycloak, } from './keycloak';
|
|
2
2
|
export type { KeycloakProviderProps, KeycloakConfig, KeycloakAuthOptions, AuthStatus, AuthUser, AuthContextValue, LoginOptions, LogoutOptions, } from './keycloak';
|
|
3
3
|
export { setTheme, getTheme, getCurrentTheme, useTheme, MarkdownRenderer, UserMessage, BotMessage, defaultBotMessageRegistry, SessionHistory, InputBar, SessionContainer, usePlusSlot, } from './chatbot';
|
|
4
|
-
export type { ColorPalette, Theme, MarkdownRendererProps, UserMessageData, UserMessageProps, ElementData, TextElementData, ReasoningElementData, ToolElementData, SearchElementData, BotMessageData, BotMessageRegistry, BotMessageProps, SessionHistoryProps, SessionUserMessageSlots, InputBarProps, ActionButtonType, SessionContainerProps, } from './chatbot';
|
|
4
|
+
export type { ColorPalette, Theme, MarkdownRendererProps, UserMessageData, UserMessageProps, ElementData, TextElementData, ReasoningElementData, ToolElementData, SearchElementData, ImageElementData, IsolatedHtmlElementData, VegaChartElementData, PlotlyChartElementData, BotMessageData, BotMessageRegistry, BotMessageProps, SessionHistoryProps, SessionUserMessageSlots, InputBarProps, ActionButtonType, SessionContainerProps, } from './chatbot';
|
package/dist/main.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as e } from "./MarkdownRenderer-
|
|
1
|
+
import { t as e } from "./MarkdownRenderer-DsCX-ARI.js";
|
|
2
2
|
import { logoutKeycloak as t, refreshTokenKeycloak as n } from "./keycloak/core/client.js";
|
|
3
3
|
import { KeycloakProvider as r } from "./keycloak/react/KeycloakProvider/index.js";
|
|
4
4
|
import { useKeycloakAuth as i } from "./keycloak/react/hooks/useKeycloakAuth.js";
|
|
5
5
|
import "./keycloak/index.js";
|
|
6
6
|
import { getCurrentTheme as a, getTheme as o, setTheme as s } from "./chatbot/theme/types.js";
|
|
7
7
|
import { useTheme as c } from "./chatbot/theme/useTheme.js";
|
|
8
|
-
import { t as l } from "./UserMessage-
|
|
9
|
-
import { n as u, t as d } from "./BotMessage-
|
|
10
|
-
import { t as f } from "./SessionHistory-
|
|
11
|
-
import { t as p } from "./InputBar-
|
|
8
|
+
import { t as l } from "./UserMessage-iwSKfrPo.js";
|
|
9
|
+
import { n as u, t as d } from "./BotMessage-9XyyKf52.js";
|
|
10
|
+
import { t as f } from "./SessionHistory-Ix5_68Dt.js";
|
|
11
|
+
import { t as p } from "./InputBar-DOkn2T-l.js";
|
|
12
12
|
import { usePlusSlot as m } from "./chatbot/InputBar/usePlusSlot.js";
|
|
13
|
-
import { t as h } from "./SessionContainer-
|
|
13
|
+
import { t as h } from "./SessionContainer-k652tx2b.js";
|
|
14
14
|
import "./chatbot/index.js";
|
|
15
15
|
export { d as BotMessage, p as InputBar, r as KeycloakProvider, e as MarkdownRenderer, h as SessionContainer, f as SessionHistory, l as UserMessage, u as defaultBotMessageRegistry, a as getCurrentTheme, o as getTheme, t as logoutKeycloak, n as refreshTokenKeycloak, s as setTheme, i as useKeycloakAuth, m as usePlusSlot, c as useTheme };
|
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
._dsi-markdown_23cwi_1{color:inherit;word-break:break-word;font-family:inherit;font-size:1rem;line-height:1.7}._dsi-markdown_23cwi_1 h1,._dsi-markdown_23cwi_1 h2,._dsi-markdown_23cwi_1 h3,._dsi-markdown_23cwi_1 h4,._dsi-markdown_23cwi_1 h5,._dsi-markdown_23cwi_1 h6{margin:1.25em 0 .5em;font-weight:600;line-height:1.3}._dsi-markdown_23cwi_1 h1{font-size:1.6em}._dsi-markdown_23cwi_1 h2{font-size:1.35em}._dsi-markdown_23cwi_1 h3{font-size:1.15em}._dsi-markdown_23cwi_1 h4{font-size:1em}._dsi-markdown_23cwi_1 p{margin:.5em 0}._dsi-markdown_23cwi_1 a{color:var(--dsi-accent,#06c);text-underline-offset:2px;text-decoration:underline}._dsi-markdown_23cwi_1 a:hover{opacity:.8}._dsi-markdown_23cwi_1 ul,._dsi-markdown_23cwi_1 ol{margin:.5em 0;padding-left:1.5em}._dsi-markdown_23cwi_1 li{margin:.2em 0}._dsi-markdown_23cwi_1 li>p{margin:0}._dsi-markdown_23cwi_1 blockquote{border-left:3px solid var(--dsi-border,#e5e5e5);color:var(--dsi-text-secondary,#888);margin:.75em 0;padding:.4em 1em;font-style:italic}._dsi-markdown-table-wrapper_23cwi_64{width:100%;margin:.75em 0;display:inline-block;position:relative}._dsi-markdown-table-wrapper_23cwi_64 table{border-collapse:collapse;width:100%;margin:0;font-size:.9em}._dsi-markdown-table-wrapper_23cwi_64 th,._dsi-markdown-table-wrapper_23cwi_64 td{border:1px solid var(--dsi-border,#e5e5e5);text-align:left;padding:.45em .75em}._dsi-markdown-table-wrapper_23cwi_64 th{background:var(--dsi-bg-secondary,#f7f7f8);font-weight:600}._dsi-markdown-table-copy-btn_23cwi_86{background:var(--dsi-bg-secondary,#f7f7f8);border:1px solid var(--dsi-border,#e5e5e5);cursor:pointer;color:var(--dsi-text-secondary,#888);opacity:0;border-radius:4px;align-items:center;gap:4px;padding:4px 6px;font-family:inherit;font-size:.9em;transition:background .15s,color .15s,opacity .15s;display:flex;position:absolute;bottom:6px;right:6px}._dsi-markdown-table-wrapper_23cwi_64:hover ._dsi-markdown-table-copy-btn_23cwi_86{opacity:1}._dsi-markdown-table-copy-btn_23cwi_86:hover{color:var(--dsi-text-primary,#111);background:#0000000f}._dsi-markdown-table-copy-btn_23cwi_86 svg{font-size:1em}._dsi-markdown_23cwi_1 hr{border:none;border-top:1px solid var(--dsi-border,#e5e5e5);margin:1em 0}._dsi-markdown_23cwi_1 :not(pre)>code{background:var(--dsi-code-bg,#f6f8fa);color:var(--dsi-code-text,#24292e);border-radius:4px;padding:.15em .4em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.875em}._dsi-markdown-code-block_23cwi_133{background:var(--dsi-code-bg,#f6f8fa);border:1px solid var(--dsi-border,#e5e5e5);border-radius:8px;margin:.75em 0;position:relative;overflow:hidden}._dsi-markdown-code-lang_23cwi_142{border-bottom:1px solid var(--dsi-border,#e5e5e5);color:var(--dsi-text-secondary,#888);letter-spacing:.03em;background:#0000000a;justify-content:space-between;align-items:center;padding:.35em .75em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.75em;display:flex}._dsi-markdown-copy-btn_23cwi_155{cursor:pointer;color:var(--dsi-text-secondary,#888);background:0 0;border:none;border-radius:4px;align-items:center;gap:4px;padding:2px 6px;font-family:inherit;font-size:.9em;transition:background .15s,color .15s;display:flex}._dsi-markdown-copy-btn_23cwi_155:hover{color:var(--dsi-text-primary,#111);background:#0000000f}._dsi-markdown-copy-btn_23cwi_155 svg{font-size:.9em}._dsi-markdown-code-block_23cwi_133 pre{color:var(--dsi-code-text,#24292e);background:0 0;margin:0;padding:.9em 1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.875em;line-height:1.6;overflow-x:auto}._dsi-markdown-code-block_23cwi_133 pre code{font-size:inherit;color:inherit;background:0 0;border-radius:0;padding:0}._dsi-markdown_23cwi_1 input[type=checkbox]{accent-color:var(--dsi-accent,#06c);margin-right:.4em}._dsi-markdown_23cwi_1 img{border-radius:4px;max-width:100%}._dsi-markdown_23cwi_1 del{opacity:.7}._dsi-bot-msg_9iqvz_2{width:100%;color:var(--dsi-text-primary,#111);flex-direction:column;gap:.5em;padding-bottom:1.4em;font-size:.95rem;display:flex;position:relative}._dsi-bot-loading-dot_9iqvz_15{color:var(--dsi-text-primary,#111);margin-bottom:.1em;animation:1.4s ease-in-out infinite _dsi-bot-pulse_9iqvz_1;display:block}@keyframes _dsi-bot-pulse_9iqvz_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(1.6)}}._dsi-bot-msg-footer_9iqvz_28{align-items:center;gap:.4em;height:1.2em;display:flex;position:absolute;bottom:0;left:0}._dsi-bot-copy-btn_9iqvz_39{cursor:pointer;color:var(--dsi-text-secondary,#888);background:0 0;border:none;border-radius:3px;align-items:center;gap:3px;padding:0;font-family:inherit;font-size:.85rem;line-height:1;transition:color .15s;display:flex}._dsi-bot-copy-btn_9iqvz_39:hover{color:var(--dsi-text-primary,#111)}._dsi-bot-copy-btn_9iqvz_39 svg{font-size:1em}._dsi-bot-msg-time_9iqvz_62{color:var(--dsi-text-secondary,#888);opacity:0;white-space:nowrap;font-size:.68rem;line-height:1;transition:opacity .15s}._dsi-bot-msg_9iqvz_2:hover ._dsi-bot-msg-time_9iqvz_62{opacity:1}._dsi-bot-reasoning_9iqvz_75,._dsi-bot-tool_9iqvz_76,._dsi-bot-search_9iqvz_77{color:var(--dsi-reasoning-text,#555);font-size:1em;font-style:italic}._dsi-bot-collapsible-header_9iqvz_84{cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;gap:.4em;max-width:30%;padding:.25em 0;display:flex}._dsi-bot-collapsible-header_9iqvz_84:focus-visible{outline:2px solid var(--dsi-accent,#06c);border-radius:3px}._dsi-bot-collapsible-header-inner_9iqvz_99{flex:1;align-items:center;gap:.4em;min-width:0;display:flex;overflow:hidden}._dsi-bot-element-title_9iqvz_108{white-space:nowrap;text-overflow:ellipsis;font-size:.9em;overflow:hidden}._dsi-bot-collapse-chevron_9iqvz_115{opacity:.5;flex-shrink:0;font-size:1em;transition:opacity .15s,transform .2s}._dsi-bot-collapsible-header_9iqvz_84:hover ._dsi-bot-collapse-chevron_9iqvz_115{opacity:.8}._dsi-bot-collapsible-body_9iqvz_126{border-left:2px solid var(--dsi-reasoning-border,var(--dsi-tool-border,#d1d5db));max-width:90%;padding:.4em 0 .25em .75em}._dsi-bot-collapsible-content_9iqvz_132{white-space:pre-wrap;word-break:break-word;margin:0;font-size:.9em}._dsi-bot-search-icon_9iqvz_140{flex-shrink:0;font-size:1em}._dsi-bot-spinner_9iqvz_146{border:1.5px solid #00000026;border-top-color:var(--dsi-text-secondary,#888);border-radius:50%;flex-shrink:0;width:10px;height:10px;animation:.7s linear infinite _dsi-spin_9iqvz_1;display:inline-block}@keyframes _dsi-spin_9iqvz_1{to{transform:rotate(360deg)}}._dsi-inputbar_1ngbl_2{box-sizing:border-box;flex-direction:column;gap:0;width:100%;display:flex;position:relative}._dsi-inputbar-upper-slot_1ngbl_12{border:1px solid var(--dsi-border,#e5e5e5);background:var(--dsi-input-bg,#fff);box-sizing:border-box;border-bottom:none;border-radius:14px 14px 0 0;width:100%;padding:.5em .75em}._dsi-inputbar-plus-slot_1ngbl_23{z-index:100;background:var(--dsi-input-bg,#fff);border:1px solid var(--dsi-border,#e5e5e5);box-sizing:border-box;border-radius:12px;min-width:180px;padding:.4em 0;position:absolute;bottom:calc(100% + 4px);left:0;box-shadow:0 4px 20px #0000001a}._dsi-inputbar-row_1ngbl_38{background:var(--dsi-input-bg,#fff);border:1px solid var(--dsi-border,#e5e5e5);box-sizing:border-box;border-radius:14px;align-items:flex-end;gap:8px;padding:.55em .75em;transition:border-color .15s;display:flex}._dsi-inputbar-row_1ngbl_38:focus-within{border-color:var(--dsi-accent,#06c)}._dsi-inputbar-row--with-upper_1ngbl_55{border-radius:0 0 14px 14px}._dsi-inputbar-textarea_1ngbl_60{resize:none;color:var(--dsi-text-primary,#111);background:0 0;border:none;outline:none;flex:1;min-height:24px;max-height:200px;padding:0;font-family:inherit;font-size:.95rem;line-height:1.5;overflow-y:auto}._dsi-inputbar-textarea_1ngbl_60::placeholder{color:var(--dsi-text-secondary,#888)}._dsi-inputbar-plus-btn_1ngbl_81{border:1px solid var(--dsi-border,#e5e5e5);background:var(--dsi-button-bg,transparent);width:32px;height:32px;color:var(--dsi-text-primary,#111);cursor:pointer;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;font-size:1.1em;transition:background .15s;display:flex}._dsi-inputbar-plus-btn_1ngbl_81:hover,._dsi-inputbar-plus-btn--open_1ngbl_100{background:var(--dsi-button-hover-bg,#f0f0f0)}._dsi-inputbar-action-btn_1ngbl_105{background:var(--dsi-action-btn-bg,#111);width:32px;height:32px;color:var(--dsi-action-btn-icon,#fff);cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;font-size:1em;transition:background .15s,opacity .15s;display:flex}._dsi-inputbar-action-btn_1ngbl_105:hover:not(:disabled){background:var(--dsi-action-btn-hover-bg,#333)}._dsi-inputbar-action-btn_1ngbl_105:disabled{opacity:.35;cursor:not-allowed}._dsi-user-msg-wrapper_e7uu3_1{flex-direction:column;align-items:flex-end;width:100%;padding-bottom:1.4em;display:flex;position:relative}._dsi-user-msg-top-slot_e7uu3_12{justify-content:flex-end;margin-bottom:4px;display:flex}._dsi-user-msg-row_e7uu3_19{align-items:center;gap:8px;max-width:70%;display:flex}._dsi-user-msg-left-slot_e7uu3_26,._dsi-user-msg-right-slot_e7uu3_27{flex-shrink:0;align-items:center;display:flex}._dsi-user-msg-bubble_e7uu3_34{background:var(--dsi-user-bubble-bg,#f0f0f0);color:var(--dsi-user-bubble-text,#111);word-break:break-word;border-radius:18px 18px 4px;min-width:40px;padding:10px 16px;font-size:.95rem;line-height:1.5}._dsi-user-msg-bottom-slot_e7uu3_46{justify-content:flex-end;margin-top:4px;display:flex}._dsi-user-msg-footer_e7uu3_53{opacity:0;align-items:center;gap:.35em;height:1.2em;transition:opacity .15s;display:flex;position:absolute;bottom:0;right:0}._dsi-user-msg-wrapper_e7uu3_1:hover ._dsi-user-msg-footer_e7uu3_53{opacity:1}._dsi-user-msg-copy-btn_e7uu3_69{cursor:pointer;color:var(--dsi-text-secondary,#888);background:0 0;border:none;border-radius:3px;align-items:center;gap:3px;padding:0;font-family:inherit;font-size:.85rem;line-height:1;transition:color .15s;display:flex}._dsi-user-msg-copy-btn_e7uu3_69:hover{color:var(--dsi-user-bubble-text,#111)}._dsi-user-msg-copy-btn_e7uu3_69 svg{font-size:.8em}._dsi-user-msg-time_e7uu3_92{color:var(--dsi-text-secondary,#888);white-space:nowrap;font-size:.68rem;line-height:1}._dsi-session-history_ju41j_1{box-sizing:border-box;flex-direction:column;gap:1.5em;width:100%;padding:1em 0;display:flex;overflow-y:auto}._dsi-session-container_1iida_1{box-sizing:border-box;background:var(--dsi-bg,#fff);flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden}._dsi-session-container-history_1iida_11{box-sizing:border-box;flex:1;padding:0 1.5em;overflow-y:auto}._dsi-session-container-inputbar_1iida_18{box-sizing:border-box;flex-shrink:0;padding:.75em 1.5em 1em}
|
|
1
|
+
._dsi-bot-msg_16idu_2{width:100%;color:var(--dsi-text-primary,#111);flex-direction:column;gap:.5em;padding-bottom:1.4em;font-size:.95rem;display:flex;position:relative}._dsi-bot-loading-dot_16idu_15{color:var(--dsi-text-primary,#111);margin-bottom:.1em;animation:1.4s ease-in-out infinite _dsi-bot-pulse_16idu_1;display:block}@keyframes _dsi-bot-pulse_16idu_1{0%,to{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(1.6)}}._dsi-bot-msg-footer_16idu_28{align-items:center;gap:.4em;height:1.2em;display:flex;position:absolute;bottom:0;left:0}._dsi-bot-copy-btn_16idu_39{cursor:pointer;color:var(--dsi-text-secondary,#888);background:0 0;border:none;border-radius:3px;align-items:center;gap:3px;padding:0;font-family:inherit;font-size:.85rem;line-height:1;transition:color .15s;display:flex}._dsi-bot-copy-btn_16idu_39:hover{color:var(--dsi-text-primary,#111)}._dsi-bot-copy-btn_16idu_39 svg{font-size:1em}._dsi-bot-msg-time_16idu_62{color:var(--dsi-text-secondary,#888);opacity:0;white-space:nowrap;font-size:.68rem;line-height:1;transition:opacity .15s}._dsi-bot-msg_16idu_2:hover ._dsi-bot-msg-time_16idu_62{opacity:1}._dsi-bot-reasoning_16idu_75,._dsi-bot-tool_16idu_76,._dsi-bot-search_16idu_77{color:var(--dsi-reasoning-text,#555);font-size:1em;font-style:italic}._dsi-bot-collapsible-header_16idu_84{cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;gap:.4em;max-width:30%;padding:.25em 0;display:flex}._dsi-bot-collapsible-header_16idu_84:focus-visible{outline:2px solid var(--dsi-accent,#06c);border-radius:3px}._dsi-bot-collapsible-header-inner_16idu_99{flex:1;align-items:center;gap:.4em;min-width:0;display:flex;overflow:hidden}._dsi-bot-element-title_16idu_108{white-space:nowrap;text-overflow:ellipsis;font-size:.9em;overflow:hidden}._dsi-bot-collapse-chevron_16idu_115{opacity:.5;flex-shrink:0;font-size:1em;transition:opacity .15s,transform .2s}._dsi-bot-collapsible-header_16idu_84:hover ._dsi-bot-collapse-chevron_16idu_115{opacity:.8}._dsi-bot-collapsible-body_16idu_126{border-left:2px solid var(--dsi-reasoning-border,var(--dsi-tool-border,#d1d5db));max-width:90%;padding:.4em 0 .25em .75em}._dsi-bot-collapsible-content_16idu_132{white-space:pre-wrap;word-break:break-word;margin:0;font-size:.9em}._dsi-bot-search-icon_16idu_140{flex-shrink:0;font-size:1em}._dsi-bot-spinner_16idu_146{border:1.5px solid #00000026;border-top-color:var(--dsi-text-secondary,#888);border-radius:50%;flex-shrink:0;width:10px;height:10px;animation:.7s linear infinite _dsi-spin_16idu_1;display:inline-block}@keyframes _dsi-spin_16idu_1{to{transform:rotate(360deg)}}._dsi-bot-image-wrap_16idu_162{align-self:flex-start;max-width:100%;display:inline-block;position:relative}._dsi-bot-image_16idu_162{border-radius:8px;max-width:100%;height:auto;display:block}._dsi-bot-image-placeholder_16idu_177{width:200px;height:200px;color:var(--dsi-text-secondary,#888);background:#0000000a;border:1px dashed #0000001f;border-radius:8px;justify-content:center;align-items:center;font-size:.85em;display:flex}._dsi-bot-image-spinner_16idu_190{border:2px solid #00000026;border-top-color:var(--dsi-text-secondary,#888);border-radius:50%;width:18px;height:18px;animation:.7s linear infinite _dsi-spin_16idu_1;display:inline-block}._dsi-bot-image-error_16idu_200{text-align:center;padding:0 .5em}._dsi-bot-image-actions_16idu_206{opacity:0;pointer-events:none;gap:4px;transition:opacity .15s;display:flex;position:absolute;top:6px;right:6px}._dsi-bot-image-wrap_16idu_162:hover ._dsi-bot-image-actions_16idu_206{opacity:1;pointer-events:auto}._dsi-bot-image-btn_16idu_221{cursor:pointer;width:26px;height:26px;color:var(--dsi-text-secondary,#888);background:#ffffffd9;border:1px solid #00000014;border-radius:4px;justify-content:center;align-items:center;padding:0;font-size:.85rem;transition:color .15s,background .15s;display:flex}._dsi-bot-image-btn_16idu_221:hover{color:var(--dsi-text-primary,#111);background:#fff}._dsi-bot-image-btn_16idu_221 svg{font-size:1em}._dsi-bot-iframe-wrap_16idu_245{border:1px solid var(--dsi-border,#00000014);background:var(--dsi-background,transparent);border-radius:8px;align-self:flex-start;max-width:100%;position:relative;overflow:hidden}._dsi-bot-iframe_16idu_245{border:0;width:100%;display:block}._dsi-bot-iframe-copy_16idu_262{cursor:pointer;color:var(--dsi-text-secondary,#888);opacity:0;background:#ffffffd9;border:1px solid #00000014;border-radius:4px;justify-content:center;align-items:center;width:26px;height:26px;font-size:.85rem;transition:color .15s,background .15s;display:flex;position:absolute;top:6px;right:6px}._dsi-bot-iframe-wrap_16idu_245:hover ._dsi-bot-iframe-copy_16idu_262{opacity:1}._dsi-bot-iframe-copy_16idu_262:hover{color:var(--dsi-text-primary,#111);background:#fff}._dsi-bot-iframe-copy_16idu_262 svg{font-size:1em}._dsi-bot-chart-wrap_16idu_292{align-self:flex-start;max-width:100%}._dsi-markdown_23cwi_1{color:inherit;word-break:break-word;font-family:inherit;font-size:1rem;line-height:1.7}._dsi-markdown_23cwi_1 h1,._dsi-markdown_23cwi_1 h2,._dsi-markdown_23cwi_1 h3,._dsi-markdown_23cwi_1 h4,._dsi-markdown_23cwi_1 h5,._dsi-markdown_23cwi_1 h6{margin:1.25em 0 .5em;font-weight:600;line-height:1.3}._dsi-markdown_23cwi_1 h1{font-size:1.6em}._dsi-markdown_23cwi_1 h2{font-size:1.35em}._dsi-markdown_23cwi_1 h3{font-size:1.15em}._dsi-markdown_23cwi_1 h4{font-size:1em}._dsi-markdown_23cwi_1 p{margin:.5em 0}._dsi-markdown_23cwi_1 a{color:var(--dsi-accent,#06c);text-underline-offset:2px;text-decoration:underline}._dsi-markdown_23cwi_1 a:hover{opacity:.8}._dsi-markdown_23cwi_1 ul,._dsi-markdown_23cwi_1 ol{margin:.5em 0;padding-left:1.5em}._dsi-markdown_23cwi_1 li{margin:.2em 0}._dsi-markdown_23cwi_1 li>p{margin:0}._dsi-markdown_23cwi_1 blockquote{border-left:3px solid var(--dsi-border,#e5e5e5);color:var(--dsi-text-secondary,#888);margin:.75em 0;padding:.4em 1em;font-style:italic}._dsi-markdown-table-wrapper_23cwi_64{width:100%;margin:.75em 0;display:inline-block;position:relative}._dsi-markdown-table-wrapper_23cwi_64 table{border-collapse:collapse;width:100%;margin:0;font-size:.9em}._dsi-markdown-table-wrapper_23cwi_64 th,._dsi-markdown-table-wrapper_23cwi_64 td{border:1px solid var(--dsi-border,#e5e5e5);text-align:left;padding:.45em .75em}._dsi-markdown-table-wrapper_23cwi_64 th{background:var(--dsi-bg-secondary,#f7f7f8);font-weight:600}._dsi-markdown-table-copy-btn_23cwi_86{background:var(--dsi-bg-secondary,#f7f7f8);border:1px solid var(--dsi-border,#e5e5e5);cursor:pointer;color:var(--dsi-text-secondary,#888);opacity:0;border-radius:4px;align-items:center;gap:4px;padding:4px 6px;font-family:inherit;font-size:.9em;transition:background .15s,color .15s,opacity .15s;display:flex;position:absolute;bottom:6px;right:6px}._dsi-markdown-table-wrapper_23cwi_64:hover ._dsi-markdown-table-copy-btn_23cwi_86{opacity:1}._dsi-markdown-table-copy-btn_23cwi_86:hover{color:var(--dsi-text-primary,#111);background:#0000000f}._dsi-markdown-table-copy-btn_23cwi_86 svg{font-size:1em}._dsi-markdown_23cwi_1 hr{border:none;border-top:1px solid var(--dsi-border,#e5e5e5);margin:1em 0}._dsi-markdown_23cwi_1 :not(pre)>code{background:var(--dsi-code-bg,#f6f8fa);color:var(--dsi-code-text,#24292e);border-radius:4px;padding:.15em .4em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.875em}._dsi-markdown-code-block_23cwi_133{background:var(--dsi-code-bg,#f6f8fa);border:1px solid var(--dsi-border,#e5e5e5);border-radius:8px;margin:.75em 0;position:relative;overflow:hidden}._dsi-markdown-code-lang_23cwi_142{border-bottom:1px solid var(--dsi-border,#e5e5e5);color:var(--dsi-text-secondary,#888);letter-spacing:.03em;background:#0000000a;justify-content:space-between;align-items:center;padding:.35em .75em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.75em;display:flex}._dsi-markdown-copy-btn_23cwi_155{cursor:pointer;color:var(--dsi-text-secondary,#888);background:0 0;border:none;border-radius:4px;align-items:center;gap:4px;padding:2px 6px;font-family:inherit;font-size:.9em;transition:background .15s,color .15s;display:flex}._dsi-markdown-copy-btn_23cwi_155:hover{color:var(--dsi-text-primary,#111);background:#0000000f}._dsi-markdown-copy-btn_23cwi_155 svg{font-size:.9em}._dsi-markdown-code-block_23cwi_133 pre{color:var(--dsi-code-text,#24292e);background:0 0;margin:0;padding:.9em 1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.875em;line-height:1.6;overflow-x:auto}._dsi-markdown-code-block_23cwi_133 pre code{font-size:inherit;color:inherit;background:0 0;border-radius:0;padding:0}._dsi-markdown_23cwi_1 input[type=checkbox]{accent-color:var(--dsi-accent,#06c);margin-right:.4em}._dsi-markdown_23cwi_1 img{border-radius:4px;max-width:100%}._dsi-markdown_23cwi_1 del{opacity:.7}._dsi-inputbar_1ngbl_2{box-sizing:border-box;flex-direction:column;gap:0;width:100%;display:flex;position:relative}._dsi-inputbar-upper-slot_1ngbl_12{border:1px solid var(--dsi-border,#e5e5e5);background:var(--dsi-input-bg,#fff);box-sizing:border-box;border-bottom:none;border-radius:14px 14px 0 0;width:100%;padding:.5em .75em}._dsi-inputbar-plus-slot_1ngbl_23{z-index:100;background:var(--dsi-input-bg,#fff);border:1px solid var(--dsi-border,#e5e5e5);box-sizing:border-box;border-radius:12px;min-width:180px;padding:.4em 0;position:absolute;bottom:calc(100% + 4px);left:0;box-shadow:0 4px 20px #0000001a}._dsi-inputbar-row_1ngbl_38{background:var(--dsi-input-bg,#fff);border:1px solid var(--dsi-border,#e5e5e5);box-sizing:border-box;border-radius:14px;align-items:flex-end;gap:8px;padding:.55em .75em;transition:border-color .15s;display:flex}._dsi-inputbar-row_1ngbl_38:focus-within{border-color:var(--dsi-accent,#06c)}._dsi-inputbar-row--with-upper_1ngbl_55{border-radius:0 0 14px 14px}._dsi-inputbar-textarea_1ngbl_60{resize:none;color:var(--dsi-text-primary,#111);background:0 0;border:none;outline:none;flex:1;min-height:24px;max-height:200px;padding:0;font-family:inherit;font-size:.95rem;line-height:1.5;overflow-y:auto}._dsi-inputbar-textarea_1ngbl_60::placeholder{color:var(--dsi-text-secondary,#888)}._dsi-inputbar-plus-btn_1ngbl_81{border:1px solid var(--dsi-border,#e5e5e5);background:var(--dsi-button-bg,transparent);width:32px;height:32px;color:var(--dsi-text-primary,#111);cursor:pointer;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;font-size:1.1em;transition:background .15s;display:flex}._dsi-inputbar-plus-btn_1ngbl_81:hover,._dsi-inputbar-plus-btn--open_1ngbl_100{background:var(--dsi-button-hover-bg,#f0f0f0)}._dsi-inputbar-action-btn_1ngbl_105{background:var(--dsi-action-btn-bg,#111);width:32px;height:32px;color:var(--dsi-action-btn-icon,#fff);cursor:pointer;border:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;padding:0;font-size:1em;transition:background .15s,opacity .15s;display:flex}._dsi-inputbar-action-btn_1ngbl_105:hover:not(:disabled){background:var(--dsi-action-btn-hover-bg,#333)}._dsi-inputbar-action-btn_1ngbl_105:disabled{opacity:.35;cursor:not-allowed}._dsi-user-msg-wrapper_e7uu3_1{flex-direction:column;align-items:flex-end;width:100%;padding-bottom:1.4em;display:flex;position:relative}._dsi-user-msg-top-slot_e7uu3_12{justify-content:flex-end;margin-bottom:4px;display:flex}._dsi-user-msg-row_e7uu3_19{align-items:center;gap:8px;max-width:70%;display:flex}._dsi-user-msg-left-slot_e7uu3_26,._dsi-user-msg-right-slot_e7uu3_27{flex-shrink:0;align-items:center;display:flex}._dsi-user-msg-bubble_e7uu3_34{background:var(--dsi-user-bubble-bg,#f0f0f0);color:var(--dsi-user-bubble-text,#111);word-break:break-word;border-radius:18px 18px 4px;min-width:40px;padding:10px 16px;font-size:.95rem;line-height:1.5}._dsi-user-msg-bottom-slot_e7uu3_46{justify-content:flex-end;margin-top:4px;display:flex}._dsi-user-msg-footer_e7uu3_53{opacity:0;align-items:center;gap:.35em;height:1.2em;transition:opacity .15s;display:flex;position:absolute;bottom:0;right:0}._dsi-user-msg-wrapper_e7uu3_1:hover ._dsi-user-msg-footer_e7uu3_53{opacity:1}._dsi-user-msg-copy-btn_e7uu3_69{cursor:pointer;color:var(--dsi-text-secondary,#888);background:0 0;border:none;border-radius:3px;align-items:center;gap:3px;padding:0;font-family:inherit;font-size:.85rem;line-height:1;transition:color .15s;display:flex}._dsi-user-msg-copy-btn_e7uu3_69:hover{color:var(--dsi-user-bubble-text,#111)}._dsi-user-msg-copy-btn_e7uu3_69 svg{font-size:.8em}._dsi-user-msg-time_e7uu3_92{color:var(--dsi-text-secondary,#888);white-space:nowrap;font-size:.68rem;line-height:1}._dsi-session-history_ju41j_1{box-sizing:border-box;flex-direction:column;gap:1.5em;width:100%;padding:1em 0;display:flex;overflow-y:auto}._dsi-session-container_1iida_1{box-sizing:border-box;background:var(--dsi-bg,#fff);flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden}._dsi-session-container-history_1iida_11{box-sizing:border-box;flex:1;padding:0 1.5em;overflow-y:auto}._dsi-session-container-inputbar_1iida_18{box-sizing:border-box;flex-shrink:0;padding:.75em 1.5em 1em}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region lib/chatbot/BotMessage/styles.module.css
|
|
2
|
+
var e = {
|
|
3
|
+
"dsi-bot-msg": "_dsi-bot-msg_16idu_2",
|
|
4
|
+
"dsi-bot-loading-dot": "_dsi-bot-loading-dot_16idu_15",
|
|
5
|
+
"dsi-bot-pulse": "_dsi-bot-pulse_16idu_1",
|
|
6
|
+
"dsi-bot-msg-footer": "_dsi-bot-msg-footer_16idu_28",
|
|
7
|
+
"dsi-bot-copy-btn": "_dsi-bot-copy-btn_16idu_39",
|
|
8
|
+
"dsi-bot-msg-time": "_dsi-bot-msg-time_16idu_62",
|
|
9
|
+
"dsi-bot-reasoning": "_dsi-bot-reasoning_16idu_75",
|
|
10
|
+
"dsi-bot-tool": "_dsi-bot-tool_16idu_76",
|
|
11
|
+
"dsi-bot-search": "_dsi-bot-search_16idu_77",
|
|
12
|
+
"dsi-bot-collapsible-header": "_dsi-bot-collapsible-header_16idu_84",
|
|
13
|
+
"dsi-bot-collapsible-header-inner": "_dsi-bot-collapsible-header-inner_16idu_99",
|
|
14
|
+
"dsi-bot-element-title": "_dsi-bot-element-title_16idu_108",
|
|
15
|
+
"dsi-bot-collapse-chevron": "_dsi-bot-collapse-chevron_16idu_115",
|
|
16
|
+
"dsi-bot-collapsible-body": "_dsi-bot-collapsible-body_16idu_126",
|
|
17
|
+
"dsi-bot-collapsible-content": "_dsi-bot-collapsible-content_16idu_132",
|
|
18
|
+
"dsi-bot-search-icon": "_dsi-bot-search-icon_16idu_140",
|
|
19
|
+
"dsi-bot-spinner": "_dsi-bot-spinner_16idu_146",
|
|
20
|
+
"dsi-spin": "_dsi-spin_16idu_1",
|
|
21
|
+
"dsi-bot-image-wrap": "_dsi-bot-image-wrap_16idu_162",
|
|
22
|
+
"dsi-bot-image": "_dsi-bot-image_16idu_162",
|
|
23
|
+
"dsi-bot-image-placeholder": "_dsi-bot-image-placeholder_16idu_177",
|
|
24
|
+
"dsi-bot-image-spinner": "_dsi-bot-image-spinner_16idu_190",
|
|
25
|
+
"dsi-bot-image-error": "_dsi-bot-image-error_16idu_200",
|
|
26
|
+
"dsi-bot-image-actions": "_dsi-bot-image-actions_16idu_206",
|
|
27
|
+
"dsi-bot-image-btn": "_dsi-bot-image-btn_16idu_221",
|
|
28
|
+
"dsi-bot-iframe-wrap": "_dsi-bot-iframe-wrap_16idu_245",
|
|
29
|
+
"dsi-bot-iframe": "_dsi-bot-iframe_16idu_245",
|
|
30
|
+
"dsi-bot-iframe-copy": "_dsi-bot-iframe-copy_16idu_262",
|
|
31
|
+
"dsi-bot-chart-wrap": "_dsi-bot-chart-wrap_16idu_292"
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { e as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shane_donnelly/dsi-internal-react-utils",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -22,10 +22,9 @@
|
|
|
22
22
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
23
23
|
"glob": "^13.0.6",
|
|
24
24
|
"globals": "^17.4.0",
|
|
25
|
-
"keycloak-js": "^26.0.0",
|
|
26
25
|
"react": "^19.2.4",
|
|
27
26
|
"react-dom": "^19.2.4",
|
|
28
|
-
"typescript": "
|
|
27
|
+
"typescript": "^6.0.2",
|
|
29
28
|
"typescript-eslint": "^8.58.0",
|
|
30
29
|
"vite": "^8.0.4",
|
|
31
30
|
"vite-plugin-dts": "^4.5.4",
|
|
@@ -44,17 +43,22 @@
|
|
|
44
43
|
"dist"
|
|
45
44
|
],
|
|
46
45
|
"peerDependencies": {
|
|
47
|
-
"keycloak-js": ">=25.0.0",
|
|
48
46
|
"react": "^19.2.4",
|
|
49
47
|
"react-dom": "^19.2.4"
|
|
50
48
|
},
|
|
51
49
|
"dependencies": {
|
|
50
|
+
"keycloak-js": "^26.0.0",
|
|
52
51
|
"react-icons": "^5.6.0",
|
|
53
52
|
"react-markdown": "^10.1.0",
|
|
53
|
+
"react-vega": "^8.0.0",
|
|
54
54
|
"rehype-highlight": "^7.0.2",
|
|
55
55
|
"rehype-katex": "^7.0.1",
|
|
56
56
|
"rehype-raw": "^7.0.0",
|
|
57
57
|
"remark-gfm": "^4.0.1",
|
|
58
|
-
"remark-math": "^6.0.0"
|
|
58
|
+
"remark-math": "^6.0.0",
|
|
59
|
+
"vega-embed": "^7.1.0",
|
|
60
|
+
"vega-lite": "^6.4.3",
|
|
61
|
+
"plotly.js": "^3.5.1",
|
|
62
|
+
"react-plotly.js": "^2.6.0"
|
|
59
63
|
}
|
|
60
64
|
}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./MarkdownRenderer-vU2aoyaG.js";
|
|
2
|
-
import { useTheme as t } from "./chatbot/theme/useTheme.js";
|
|
3
|
-
import { t as n } from "./iconBase-CDbPVA4E.js";
|
|
4
|
-
import { n as r, t as i } from "./bs-CmZftXMO.js";
|
|
5
|
-
import { useEffect as a, useState as o } from "react";
|
|
6
|
-
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
-
//#region node_modules/react-icons/tb/index.mjs
|
|
8
|
-
function u(e) {
|
|
9
|
-
return n({
|
|
10
|
-
tag: "svg",
|
|
11
|
-
attr: {
|
|
12
|
-
viewBox: "0 0 24 24",
|
|
13
|
-
fill: "none",
|
|
14
|
-
stroke: "currentColor",
|
|
15
|
-
strokeWidth: "2",
|
|
16
|
-
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round"
|
|
18
|
-
},
|
|
19
|
-
child: [
|
|
20
|
-
{
|
|
21
|
-
tag: "path",
|
|
22
|
-
attr: { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" },
|
|
23
|
-
child: []
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
tag: "path",
|
|
27
|
-
attr: { d: "M3.6 9h16.8" },
|
|
28
|
-
child: []
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
tag: "path",
|
|
32
|
-
attr: { d: "M3.6 15h16.8" },
|
|
33
|
-
child: []
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
tag: "path",
|
|
37
|
-
attr: { d: "M11.5 3a17 17 0 0 0 0 18" },
|
|
38
|
-
child: []
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
tag: "path",
|
|
42
|
-
attr: { d: "M12.5 3a17 17 0 0 1 0 18" },
|
|
43
|
-
child: []
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
})(e);
|
|
47
|
-
}
|
|
48
|
-
function d(e) {
|
|
49
|
-
return n({
|
|
50
|
-
tag: "svg",
|
|
51
|
-
attr: {
|
|
52
|
-
viewBox: "0 0 24 24",
|
|
53
|
-
fill: "none",
|
|
54
|
-
stroke: "currentColor",
|
|
55
|
-
strokeWidth: "2",
|
|
56
|
-
strokeLinecap: "round",
|
|
57
|
-
strokeLinejoin: "round"
|
|
58
|
-
},
|
|
59
|
-
child: [{
|
|
60
|
-
tag: "path",
|
|
61
|
-
attr: { d: "M6 9l6 6l6 -6" },
|
|
62
|
-
child: []
|
|
63
|
-
}]
|
|
64
|
-
})(e);
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region lib/chatbot/BotMessage/styles.module.css
|
|
68
|
-
var f = {
|
|
69
|
-
"dsi-bot-msg": "_dsi-bot-msg_9iqvz_2",
|
|
70
|
-
"dsi-bot-loading-dot": "_dsi-bot-loading-dot_9iqvz_15",
|
|
71
|
-
"dsi-bot-pulse": "_dsi-bot-pulse_9iqvz_1",
|
|
72
|
-
"dsi-bot-msg-footer": "_dsi-bot-msg-footer_9iqvz_28",
|
|
73
|
-
"dsi-bot-copy-btn": "_dsi-bot-copy-btn_9iqvz_39",
|
|
74
|
-
"dsi-bot-msg-time": "_dsi-bot-msg-time_9iqvz_62",
|
|
75
|
-
"dsi-bot-reasoning": "_dsi-bot-reasoning_9iqvz_75",
|
|
76
|
-
"dsi-bot-tool": "_dsi-bot-tool_9iqvz_76",
|
|
77
|
-
"dsi-bot-search": "_dsi-bot-search_9iqvz_77",
|
|
78
|
-
"dsi-bot-collapsible-header": "_dsi-bot-collapsible-header_9iqvz_84",
|
|
79
|
-
"dsi-bot-collapsible-header-inner": "_dsi-bot-collapsible-header-inner_9iqvz_99",
|
|
80
|
-
"dsi-bot-element-title": "_dsi-bot-element-title_9iqvz_108",
|
|
81
|
-
"dsi-bot-collapse-chevron": "_dsi-bot-collapse-chevron_9iqvz_115",
|
|
82
|
-
"dsi-bot-collapsible-body": "_dsi-bot-collapsible-body_9iqvz_126",
|
|
83
|
-
"dsi-bot-collapsible-content": "_dsi-bot-collapsible-content_9iqvz_132",
|
|
84
|
-
"dsi-bot-search-icon": "_dsi-bot-search-icon_9iqvz_140",
|
|
85
|
-
"dsi-bot-spinner": "_dsi-bot-spinner_9iqvz_146",
|
|
86
|
-
"dsi-spin": "_dsi-spin_9iqvz_1"
|
|
87
|
-
};
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region lib/chatbot/BotMessage/index.tsx
|
|
90
|
-
function p({ markdownText: t }) {
|
|
91
|
-
return t ? /* @__PURE__ */ c(e, { text: t }) : null;
|
|
92
|
-
}
|
|
93
|
-
function m() {
|
|
94
|
-
return /* @__PURE__ */ c("svg", {
|
|
95
|
-
className: f["dsi-bot-loading-dot"],
|
|
96
|
-
width: "10",
|
|
97
|
-
height: "10",
|
|
98
|
-
viewBox: "0 0 10 10",
|
|
99
|
-
"aria-hidden": "true",
|
|
100
|
-
children: /* @__PURE__ */ c("circle", {
|
|
101
|
-
cx: "5",
|
|
102
|
-
cy: "5",
|
|
103
|
-
r: "4",
|
|
104
|
-
fill: "currentColor"
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
function h({ text: e }) {
|
|
109
|
-
let [t, n] = o(!1);
|
|
110
|
-
return /* @__PURE__ */ c("button", {
|
|
111
|
-
className: f["dsi-bot-copy-btn"],
|
|
112
|
-
onClick: () => {
|
|
113
|
-
navigator.clipboard.writeText(e).then(() => {
|
|
114
|
-
n(!0), setTimeout(() => n(!1), 2e3);
|
|
115
|
-
});
|
|
116
|
-
},
|
|
117
|
-
"aria-label": "Copier le message",
|
|
118
|
-
type: "button",
|
|
119
|
-
children: c(t ? i : r, {})
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function g({ defaultOpen: e, closeWhen: t = !1, header: n, content: r, className: i, style: s }) {
|
|
123
|
-
let [u, p] = o(e);
|
|
124
|
-
return a(() => {
|
|
125
|
-
t && p(!1);
|
|
126
|
-
}, [t]), /* @__PURE__ */ l("div", {
|
|
127
|
-
className: i,
|
|
128
|
-
style: s,
|
|
129
|
-
children: [/* @__PURE__ */ l("div", {
|
|
130
|
-
className: f["dsi-bot-collapsible-header"],
|
|
131
|
-
onClick: () => p((e) => !e),
|
|
132
|
-
role: "button",
|
|
133
|
-
tabIndex: 0,
|
|
134
|
-
onKeyDown: (e) => {
|
|
135
|
-
(e.key === "Enter" || e.key === " ") && p((e) => !e);
|
|
136
|
-
},
|
|
137
|
-
"aria-expanded": u,
|
|
138
|
-
children: [/* @__PURE__ */ c("div", {
|
|
139
|
-
className: f["dsi-bot-collapsible-header-inner"],
|
|
140
|
-
children: n
|
|
141
|
-
}), /* @__PURE__ */ c(d, {
|
|
142
|
-
className: f["dsi-bot-collapse-chevron"],
|
|
143
|
-
style: { transform: u ? "rotate(0deg)" : "rotate(-90deg)" },
|
|
144
|
-
"aria-hidden": "true"
|
|
145
|
-
})]
|
|
146
|
-
}), u && r && /* @__PURE__ */ c("div", {
|
|
147
|
-
className: f["dsi-bot-collapsible-body"],
|
|
148
|
-
children: r
|
|
149
|
-
})]
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
function _({ title: e, content: n, isLoading: r = !1, _isLastElement: i = !1 }) {
|
|
153
|
-
let a = t();
|
|
154
|
-
return /* @__PURE__ */ c(g, {
|
|
155
|
-
defaultOpen: r || i,
|
|
156
|
-
closeWhen: !r && !i,
|
|
157
|
-
className: f["dsi-bot-reasoning"],
|
|
158
|
-
style: {
|
|
159
|
-
"--dsi-reasoning-border": a.reasoningBorder,
|
|
160
|
-
"--dsi-reasoning-text": a.reasoningText
|
|
161
|
-
},
|
|
162
|
-
header: /* @__PURE__ */ c("span", {
|
|
163
|
-
className: f["dsi-bot-element-title"],
|
|
164
|
-
children: e || "Raisonnement"
|
|
165
|
-
}),
|
|
166
|
-
content: n ? /* @__PURE__ */ c("p", {
|
|
167
|
-
className: f["dsi-bot-collapsible-content"],
|
|
168
|
-
children: n
|
|
169
|
-
}) : null
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
function v({ title: e, content: n, isLoading: r = !1, _isLastElement: i = !1 }) {
|
|
173
|
-
let a = t();
|
|
174
|
-
return /* @__PURE__ */ c(g, {
|
|
175
|
-
defaultOpen: r || i,
|
|
176
|
-
closeWhen: !r && !i,
|
|
177
|
-
className: f["dsi-bot-tool"],
|
|
178
|
-
style: {
|
|
179
|
-
"--dsi-tool-border": a.toolBorder,
|
|
180
|
-
"--dsi-text-secondary": a.textSecondary,
|
|
181
|
-
"--dsi-text-primary": a.textPrimary
|
|
182
|
-
},
|
|
183
|
-
header: /* @__PURE__ */ l(s, { children: [r && /* @__PURE__ */ c("span", { className: f["dsi-bot-spinner"] }), /* @__PURE__ */ c("span", {
|
|
184
|
-
className: f["dsi-bot-element-title"],
|
|
185
|
-
children: e || "Outil"
|
|
186
|
-
})] }),
|
|
187
|
-
content: n ? /* @__PURE__ */ c("p", {
|
|
188
|
-
className: f["dsi-bot-collapsible-content"],
|
|
189
|
-
children: n
|
|
190
|
-
}) : null
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function y({ title: e, content: n, isLoading: r = !1, _isLastElement: i = !1 }) {
|
|
194
|
-
let a = t();
|
|
195
|
-
return /* @__PURE__ */ c(g, {
|
|
196
|
-
defaultOpen: r || i,
|
|
197
|
-
closeWhen: !r && !i,
|
|
198
|
-
className: f["dsi-bot-search"],
|
|
199
|
-
style: {
|
|
200
|
-
"--dsi-tool-border": a.toolBorder,
|
|
201
|
-
"--dsi-text-secondary": a.textSecondary,
|
|
202
|
-
"--dsi-text-primary": a.textPrimary
|
|
203
|
-
},
|
|
204
|
-
header: /* @__PURE__ */ l(s, { children: [
|
|
205
|
-
/* @__PURE__ */ c(u, { className: f["dsi-bot-search-icon"] }),
|
|
206
|
-
r && /* @__PURE__ */ c("span", { className: f["dsi-bot-spinner"] }),
|
|
207
|
-
/* @__PURE__ */ c("span", {
|
|
208
|
-
className: f["dsi-bot-element-title"],
|
|
209
|
-
children: e || "Recherche"
|
|
210
|
-
})
|
|
211
|
-
] }),
|
|
212
|
-
content: n ? /* @__PURE__ */ c("p", {
|
|
213
|
-
className: f["dsi-bot-collapsible-content"],
|
|
214
|
-
children: n
|
|
215
|
-
}) : null
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
var b = {
|
|
219
|
-
text: p,
|
|
220
|
-
reasoning: _,
|
|
221
|
-
tool: v,
|
|
222
|
-
search: y
|
|
223
|
-
};
|
|
224
|
-
function x({ message: e, registry: n = b }) {
|
|
225
|
-
let r = t(), i = [...e.elements].sort((e, t) => e.index - t.index), a = [...i].reverse().find((e) => e.type === "text")?.markdownText ?? "";
|
|
226
|
-
return /* @__PURE__ */ l("div", {
|
|
227
|
-
className: f["dsi-bot-msg"],
|
|
228
|
-
style: {
|
|
229
|
-
"--dsi-text-primary": r.textPrimary,
|
|
230
|
-
"--dsi-text-secondary": r.textSecondary,
|
|
231
|
-
"--dsi-border": r.border
|
|
232
|
-
},
|
|
233
|
-
children: [
|
|
234
|
-
e.isLoading && /* @__PURE__ */ c(m, {}),
|
|
235
|
-
i.map((e, t) => {
|
|
236
|
-
let r = n[e.type];
|
|
237
|
-
if (!r) return null;
|
|
238
|
-
let a = t === i.length - 1;
|
|
239
|
-
return /* @__PURE__ */ c(r, {
|
|
240
|
-
...e,
|
|
241
|
-
_isLastElement: a
|
|
242
|
-
}, `${e.type}-${e.index}-${t}`);
|
|
243
|
-
}),
|
|
244
|
-
/* @__PURE__ */ l("div", {
|
|
245
|
-
className: f["dsi-bot-msg-footer"],
|
|
246
|
-
children: [!e.isLoading && /* @__PURE__ */ c(h, { text: a }), !e.isLoading && e.timeOrDateToDisplay && /* @__PURE__ */ c("span", {
|
|
247
|
-
className: f["dsi-bot-msg-time"],
|
|
248
|
-
children: e.timeOrDateToDisplay
|
|
249
|
-
})]
|
|
250
|
-
})
|
|
251
|
-
]
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
//#endregion
|
|
255
|
-
export { b as n, x as t };
|
|
File without changes
|