@glodon-aiot/agent-cli-ui 3.4.1-beta.1 → 3.4.1-beta.2
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/es/AgentClientUI.mjs +41 -38
- package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +17 -23
- package/dist/es/Dialog/AgentChat/index.mjs +120 -122
- package/dist/es/Dialog/SessionList/index.mjs +94 -94
- package/dist/es/Dialog/index.mjs +107 -102
- package/dist/es/context/SessionContext.mjs +26 -0
- package/dist/es/hooks/useSessionState.mjs +6 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style10.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.js +36 -36
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +0 -2
- package/dist/src/Dialog/AgentChat/index.d.ts +0 -2
- package/dist/src/Dialog/SessionList/index.d.ts +0 -2
- package/dist/src/context/SessionContext.d.ts +15 -0
- package/dist/src/hooks/useSessionState.d.ts +7 -0
- package/package.json +3 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var rn = Object.defineProperty, an = Object.defineProperties;
|
|
2
|
+
var ln = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ct = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var Ee = (x, k, o) => k in x ?
|
|
4
|
+
var dn = Object.prototype.hasOwnProperty, cn = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ee = (x, k, o) => k in x ? rn(x, k, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[k] = o, ft = (x, k) => {
|
|
6
6
|
for (var o in k || (k = {}))
|
|
7
|
-
|
|
7
|
+
dn.call(k, o) && Ee(x, o, k[o]);
|
|
8
8
|
if (ct)
|
|
9
9
|
for (var o of ct(k))
|
|
10
|
-
|
|
10
|
+
cn.call(k, o) && Ee(x, o, k[o]);
|
|
11
11
|
return x;
|
|
12
|
-
}, gt = (x, k) =>
|
|
12
|
+
}, gt = (x, k) => an(x, ln(k));
|
|
13
13
|
var D = (x, k, o) => (Ee(x, typeof k != "symbol" ? k + "" : k, o), o);
|
|
14
14
|
var j = (x, k, o) => new Promise((Y, e) => {
|
|
15
15
|
var L = (E) => {
|
|
@@ -27,36 +27,37 @@ var j = (x, k, o) => new Promise((Y, e) => {
|
|
|
27
27
|
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, pe);
|
|
28
28
|
p((o = o.apply(x, k)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as c, jsxs as z, Fragment as
|
|
31
|
-
import { memo as
|
|
32
|
-
/* empty css */import { Spin as ut, Divider as
|
|
30
|
+
import { jsx as c, jsxs as z, Fragment as fn } from "react/jsx-runtime";
|
|
31
|
+
import { memo as gn, forwardRef as un, useState as h, useRef as K, useContext as hn, useEffect as C, useMemo as mn, useImperativeHandle as yn } from "react";
|
|
32
|
+
/* empty css */import { Spin as ut, Divider as pn, Button as W, Space as he, Upload as vn, Tooltip as kn, Popover as wn, notification as me, message as u } from "antd";
|
|
33
33
|
import ne from "../../components/Iconfont/index.mjs";
|
|
34
34
|
import { IHistoryRole as J, ChatMessageRole as ht, PromptVariableType as ye } from "@glodon-aiot/apis";
|
|
35
35
|
import pt from "./HistoryItem/index.mjs";
|
|
36
36
|
import vt from "dayjs";
|
|
37
37
|
import { v4 as Te } from "uuid";
|
|
38
|
-
import
|
|
39
|
-
import { configuration as
|
|
40
|
-
import { NET_OPEN_STATUS as $, MB as
|
|
41
|
-
import
|
|
42
|
-
import { getImageExtension as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import { CameraOutlined as
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
38
|
+
import bn from "../../context.mjs";
|
|
39
|
+
import { configuration as xn } from "@glodon-aiot/bot-client-sdk";
|
|
40
|
+
import { NET_OPEN_STATUS as $, MB as In } from "../../constant.mjs";
|
|
41
|
+
import Nn from "../../components/FilePreview/index.mjs";
|
|
42
|
+
import { getImageExtension as Cn } from "../../utils/index.mjs";
|
|
43
|
+
import Ln from "../../QuillEditor/index.mjs";
|
|
44
|
+
import En from "../../components/Recommend/index.mjs";
|
|
45
|
+
import Pn from "../../components/Greeting/index.mjs";
|
|
46
|
+
import Tn from "../../Footer/index.mjs";
|
|
47
|
+
import { CameraOutlined as Fn, PlusOutlined as On } from "@ant-design/icons";
|
|
48
|
+
import Hn from "./Tools/UploadKnowledgeFiles/index.mjs";
|
|
49
|
+
import Rn from "../UploadingPrompt/index.mjs";
|
|
50
|
+
import Dn from "./PromptSetting/index.mjs";
|
|
51
51
|
import { useMemoizedFn as Pe } from "ahooks";
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
import Un from "./Tools/SessionListDrawer/index.mjs";
|
|
53
|
+
import Mn from "./Tools/SessionHistoryDrawer/index.mjs";
|
|
54
|
+
import jn from "react-infinite-scroll-component";
|
|
55
|
+
import zn from "./Tools/ConnectToNetwork/index.mjs";
|
|
56
|
+
import Vn from "./Tools/PromptManager/index.mjs";
|
|
57
|
+
import { useSessionState as An } from "../../hooks/useSessionState.mjs";
|
|
58
|
+
import qn from "../../assets/icon.svg.mjs";
|
|
59
|
+
const Bn = gn(pt), mt = {
|
|
60
|
+
icon: qn,
|
|
60
61
|
text: "今天我能帮你什么?"
|
|
61
62
|
};
|
|
62
63
|
class ie {
|
|
@@ -75,7 +76,7 @@ class ie {
|
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
const yt = 10, wi =
|
|
79
|
+
const yt = 10, wi = un((x, k) => {
|
|
79
80
|
var Se, et, tt, nt, it, ot, st, rt, at, lt, dt;
|
|
80
81
|
const {
|
|
81
82
|
application: o,
|
|
@@ -85,37 +86,36 @@ const yt = 10, wi = mn((x, k) => {
|
|
|
85
86
|
embeddingService: pe,
|
|
86
87
|
setCurrentSession: p,
|
|
87
88
|
networkStatus: E,
|
|
88
|
-
setNetworkStatus: P
|
|
89
|
-
|
|
90
|
-
// 👈 新增
|
|
91
|
-
setSessions: wt
|
|
92
|
-
// 👈 新增
|
|
93
|
-
} = x, [v, I] = h([]), [bt, oe] = h(), [ve, Fe] = h(), H = K(null), {
|
|
89
|
+
setNetworkStatus: P
|
|
90
|
+
} = x, [v, I] = h([]), [kt, oe] = h(), [ve, Fe] = h(), H = K(null), {
|
|
94
91
|
service: T,
|
|
95
92
|
agentClient: N,
|
|
96
|
-
depId:
|
|
97
|
-
footer:
|
|
93
|
+
depId: wt,
|
|
94
|
+
footer: bt,
|
|
98
95
|
transform: g,
|
|
99
96
|
defaultInput: ke,
|
|
100
97
|
onMessage: se,
|
|
101
98
|
onHistoryLoad: Oe,
|
|
102
99
|
beforeMessageSend: V,
|
|
103
|
-
bodyStyle:
|
|
100
|
+
bodyStyle: xt,
|
|
104
101
|
disabled: R,
|
|
105
102
|
features: s,
|
|
106
103
|
popupContainer: f,
|
|
107
|
-
icon:
|
|
108
|
-
sider:
|
|
109
|
-
mode:
|
|
110
|
-
} =
|
|
104
|
+
icon: It,
|
|
105
|
+
sider: Nt,
|
|
106
|
+
mode: Ct
|
|
107
|
+
} = hn(bn), [He, we] = h(!1), m = K(v), Re = K(void 0), [Lt, Et] = h(0), [S, Q] = h(), [_, re] = h(""), [De, be] = h(!1), ae = K(null), [Ue, Pt] = h([]), [Me, G] = h(!1), [je, Tt] = h(!1), [Ft, Ot] = h(""), [Ht, X] = h(), [le, de] = h({}), ce = K(null), ze = K(null), xe = K(null), [Ve, Rt] = h(!1), [Dt, Ut] = h([]), [Mt, fe] = h(!0), [jt, zt] = h(!0), [Ae, U] = h(!1), [Ie, A] = h(!1), [qe, Vt] = h(!1), [O, ge] = h(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [At, qt] = h(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Be, M] = h(!1), [$e, ee] = h(!1), [Bt, Z] = h(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [Ye, ue] = h(!1), [$t, q] = h(!1), [Yt, Kt] = h(null), [Ke, We] = h(!1), {
|
|
108
|
+
isSwitchingToExistingSession: Wt,
|
|
109
|
+
setIsSwitchingToExistingSession: Ne
|
|
110
|
+
} = An();
|
|
111
111
|
C(() => {
|
|
112
|
-
if (
|
|
112
|
+
if (Kt(e), e === null)
|
|
113
113
|
q(!1);
|
|
114
114
|
else if (e === void 0)
|
|
115
115
|
q(!0);
|
|
116
116
|
else {
|
|
117
|
-
if (
|
|
118
|
-
if (
|
|
117
|
+
if (Yt === null) {
|
|
118
|
+
if (Wt) {
|
|
119
119
|
q(!0), Ne(!1);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
@@ -150,7 +150,7 @@ const yt = 10, wi = mn((x, k) => {
|
|
|
150
150
|
}, [e]), C(() => {
|
|
151
151
|
const t = () => {
|
|
152
152
|
var n;
|
|
153
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges &&
|
|
153
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges && qt(e.knowledges), P(e.netOpen));
|
|
154
154
|
};
|
|
155
155
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
156
156
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -173,7 +173,7 @@ const yt = 10, wi = mn((x, k) => {
|
|
|
173
173
|
e == null || e.removeEventListener("error", t);
|
|
174
174
|
};
|
|
175
175
|
}, [e]);
|
|
176
|
-
const
|
|
176
|
+
const Qt = () => {
|
|
177
177
|
var a;
|
|
178
178
|
if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(o != null && o.id))
|
|
179
179
|
return;
|
|
@@ -193,9 +193,9 @@ const yt = 10, wi = mn((x, k) => {
|
|
|
193
193
|
};
|
|
194
194
|
C(() => {
|
|
195
195
|
o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
|
|
196
|
-
|
|
196
|
+
Pt(t);
|
|
197
197
|
}));
|
|
198
|
-
}, [
|
|
198
|
+
}, [wt, o]);
|
|
199
199
|
const Qe = (t) => j(void 0, null, function* () {
|
|
200
200
|
var y, F;
|
|
201
201
|
if (R) {
|
|
@@ -206,7 +206,7 @@ const yt = 10, wi = mn((x, k) => {
|
|
|
206
206
|
});
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
const n = t ||
|
|
209
|
+
const n = t || kt;
|
|
210
210
|
if (!(n != null && n.trim())) {
|
|
211
211
|
u.config({
|
|
212
212
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -241,7 +241,7 @@ const yt = 10, wi = mn((x, k) => {
|
|
|
241
241
|
});
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
if (!
|
|
244
|
+
if (!Mt) {
|
|
245
245
|
u.config({
|
|
246
246
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
247
247
|
}), u.error("正在解析文件"), u.config({
|
|
@@ -291,7 +291,7 @@ ${n}` : n;
|
|
|
291
291
|
if (ue(!1), r === !1)
|
|
292
292
|
return;
|
|
293
293
|
let d = n;
|
|
294
|
-
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ?
|
|
294
|
+
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ? _t(d) : Ce(d));
|
|
295
295
|
}), _e = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
296
296
|
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ye.User || d.type === void 0) && d.key === "query") && !((d.type === ye.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
297
297
|
var y;
|
|
@@ -305,7 +305,7 @@ ${n}` : n;
|
|
|
305
305
|
getContainer: void 0
|
|
306
306
|
});
|
|
307
307
|
}), n();
|
|
308
|
-
})),
|
|
308
|
+
})), _t = (t) => {
|
|
309
309
|
var r, d, b;
|
|
310
310
|
if (fe(!1), !((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
|
|
311
311
|
return;
|
|
@@ -367,7 +367,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
367
367
|
const r = new ie("", a, J.System);
|
|
368
368
|
r.isWaiting = !0, m.current = [r, ...m.current], I(m.current);
|
|
369
369
|
const d = (n == null ? void 0 : n.map((w) => w.id)) || [], b = {
|
|
370
|
-
stream:
|
|
370
|
+
stream: xn.stream,
|
|
371
371
|
referenceFirst: !1
|
|
372
372
|
};
|
|
373
373
|
if (g != null && g.promptVariables) {
|
|
@@ -375,7 +375,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
375
375
|
b.formatValues = w;
|
|
376
376
|
}
|
|
377
377
|
if (g != null && g.knowledges) {
|
|
378
|
-
const w =
|
|
378
|
+
const w = At;
|
|
379
379
|
b.knowledges = w;
|
|
380
380
|
}
|
|
381
381
|
yield e.send({
|
|
@@ -425,22 +425,22 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
425
425
|
if (!N)
|
|
426
426
|
return;
|
|
427
427
|
const t = N.questionContextMaxLength || 4e3;
|
|
428
|
-
|
|
428
|
+
Et(t);
|
|
429
429
|
}, [N, T]), C(() => {
|
|
430
430
|
ke && X(ke.text);
|
|
431
431
|
}, [ke]);
|
|
432
|
-
const
|
|
432
|
+
const Gt = (t) => {
|
|
433
433
|
const n = t.size;
|
|
434
434
|
return n <= 0 ? (u.config({
|
|
435
435
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
436
436
|
}), u.error("该文件为空,请重新上传"), u.config({
|
|
437
437
|
getContainer: void 0
|
|
438
|
-
}), !1) : n > 20 *
|
|
438
|
+
}), !1) : n > 20 * In ? (u.config({
|
|
439
439
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
440
440
|
}), u.error("图片须小于20M"), u.config({
|
|
441
441
|
getContainer: void 0
|
|
442
442
|
}), !1) : (Q(t), !1);
|
|
443
|
-
},
|
|
443
|
+
}, Xt = (t) => j(void 0, null, function* () {
|
|
444
444
|
var n;
|
|
445
445
|
return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ge(e, t) : new Promise((a) => {
|
|
446
446
|
M(!0), L == null || L({
|
|
@@ -451,7 +451,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
451
451
|
});
|
|
452
452
|
});
|
|
453
453
|
}), Ge = (t, n) => {
|
|
454
|
-
const a =
|
|
454
|
+
const a = Cn(n.name);
|
|
455
455
|
return new Promise((i) => {
|
|
456
456
|
var r;
|
|
457
457
|
const l = {
|
|
@@ -491,10 +491,10 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
491
491
|
var l;
|
|
492
492
|
(l = ce.current) == null || l.update().finally(a);
|
|
493
493
|
});
|
|
494
|
-
}),
|
|
494
|
+
}), Zt = () => {
|
|
495
495
|
var t;
|
|
496
496
|
(t = e == null ? void 0 : e.data) != null && t.id && (U(!1), e.suspend());
|
|
497
|
-
},
|
|
497
|
+
}, Jt = (t) => {
|
|
498
498
|
const n = H.current;
|
|
499
499
|
n && setTimeout(() => {
|
|
500
500
|
n.scrollTo({
|
|
@@ -502,17 +502,17 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
502
502
|
behavior: t == null ? void 0 : t.behavior
|
|
503
503
|
});
|
|
504
504
|
}, t == null ? void 0 : t.ms);
|
|
505
|
-
},
|
|
505
|
+
}, St = () => {
|
|
506
506
|
if (!H.current)
|
|
507
507
|
return;
|
|
508
508
|
const t = H.current.scrollTop <= -80;
|
|
509
|
-
|
|
510
|
-
},
|
|
509
|
+
Vt(t);
|
|
510
|
+
}, en = Pe((t) => {
|
|
511
511
|
var n, a;
|
|
512
512
|
(n = ae.current) == null || n.update(t), (a = ae.current) == null || a.focus();
|
|
513
|
-
}),
|
|
513
|
+
}), tn = Pe((t) => {
|
|
514
514
|
Qe(t);
|
|
515
|
-
}),
|
|
515
|
+
}), nn = Pe(() => {
|
|
516
516
|
var n;
|
|
517
517
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
518
518
|
return;
|
|
@@ -524,7 +524,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
524
524
|
var t, n;
|
|
525
525
|
Re.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Be && ((n = xe.current) == null || n.clear());
|
|
526
526
|
}, [e]);
|
|
527
|
-
const
|
|
527
|
+
const on = () => {
|
|
528
528
|
var a;
|
|
529
529
|
if (!((a = e == null ? void 0 : e.data) != null && a.id))
|
|
530
530
|
return;
|
|
@@ -540,7 +540,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
540
540
|
}
|
|
541
541
|
l.length < 10 ? ee(!1) : ee(!0), I([...v, ...l.reverse()]);
|
|
542
542
|
});
|
|
543
|
-
},
|
|
543
|
+
}, sn = (t) => j(void 0, null, function* () {
|
|
544
544
|
var n, a;
|
|
545
545
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
546
546
|
P(t);
|
|
@@ -602,7 +602,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
602
602
|
}).then((t) => {
|
|
603
603
|
var n, a;
|
|
604
604
|
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)), _e(t), t;
|
|
605
|
-
}), Je =
|
|
605
|
+
}), Je = mn(() => {
|
|
606
606
|
var t;
|
|
607
607
|
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(pt, {
|
|
608
608
|
application: o,
|
|
@@ -622,18 +622,18 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
622
622
|
markdown: s == null ? void 0 : s.markdown
|
|
623
623
|
}) : null;
|
|
624
624
|
}, [o == null ? void 0 : o.arrange, v]);
|
|
625
|
-
return
|
|
625
|
+
return yn(k, () => ({
|
|
626
626
|
getCurrentInputText: () => {
|
|
627
627
|
var t;
|
|
628
628
|
return (t = ae.current) == null ? void 0 : t.getCurrentText();
|
|
629
629
|
}
|
|
630
630
|
})), /* @__PURE__ */ z("div", {
|
|
631
631
|
className: "agent-chat",
|
|
632
|
-
children: [
|
|
632
|
+
children: [$t ? /* @__PURE__ */ c("div", {
|
|
633
633
|
className: "session-loading",
|
|
634
634
|
children: /* @__PURE__ */ c(ut, {})
|
|
635
|
-
}) : /* @__PURE__ */ z(
|
|
636
|
-
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(
|
|
635
|
+
}) : /* @__PURE__ */ z(fn, {
|
|
636
|
+
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Dn, {
|
|
637
637
|
ref: ze,
|
|
638
638
|
appId: o.id,
|
|
639
639
|
currentSession: e,
|
|
@@ -643,7 +643,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
643
643
|
}), /* @__PURE__ */ z("div", {
|
|
644
644
|
className: "chat-main",
|
|
645
645
|
id: "chat-main",
|
|
646
|
-
style:
|
|
646
|
+
style: xt,
|
|
647
647
|
children: [/* @__PURE__ */ c("div", {
|
|
648
648
|
className: "chat-main-wrapper",
|
|
649
649
|
id: "scrollableDiv",
|
|
@@ -654,10 +654,10 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
654
654
|
flexDirection: "column-reverse"
|
|
655
655
|
},
|
|
656
656
|
ref: H,
|
|
657
|
-
onScroll:
|
|
658
|
-
children: (Se = e == null ? void 0 : e.data) != null && Se.id && (v != null && v.length) ? /* @__PURE__ */ z(
|
|
657
|
+
onScroll: St,
|
|
658
|
+
children: (Se = e == null ? void 0 : e.data) != null && Se.id && (v != null && v.length) ? /* @__PURE__ */ z(jn, {
|
|
659
659
|
dataLength: v.length,
|
|
660
|
-
next:
|
|
660
|
+
next: on,
|
|
661
661
|
style: {
|
|
662
662
|
display: "flex",
|
|
663
663
|
flexDirection: "column-reverse",
|
|
@@ -665,7 +665,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
665
665
|
},
|
|
666
666
|
inverse: !0,
|
|
667
667
|
endMessage: v.length > yt && // 少于一页不展示这个提示
|
|
668
|
-
((et = H.current) != null && et.scrollTop) && ((tt = H.current) == null ? void 0 : tt.scrollTop) < -10 ? /* @__PURE__ */ c(
|
|
668
|
+
((et = H.current) != null && et.scrollTop) && ((tt = H.current) == null ? void 0 : tt.scrollTop) < -10 ? /* @__PURE__ */ c(pn, {
|
|
669
669
|
plain: !0,
|
|
670
670
|
children: "没有更多数据了"
|
|
671
671
|
}) : null,
|
|
@@ -679,23 +679,23 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
679
679
|
children: /* @__PURE__ */ c(ut, {})
|
|
680
680
|
}),
|
|
681
681
|
scrollableTarget: "scrollableDiv",
|
|
682
|
-
children: [v.map((t, n) => /* @__PURE__ */ c(
|
|
682
|
+
children: [v.map((t, n) => /* @__PURE__ */ c(Bn, {
|
|
683
683
|
application: o,
|
|
684
684
|
currentSession: e,
|
|
685
685
|
history: t,
|
|
686
686
|
docViewerUrl: Y,
|
|
687
687
|
isLastHistory: n === 0,
|
|
688
|
-
onRelatedClick:
|
|
689
|
-
onAgainClick:
|
|
690
|
-
onEditClick:
|
|
688
|
+
onRelatedClick: tn,
|
|
689
|
+
onAgainClick: nn,
|
|
690
|
+
onEditClick: en,
|
|
691
691
|
markdown: s == null ? void 0 : s.markdown
|
|
692
692
|
}, t.messageId + n)), !$e && Je]
|
|
693
693
|
}) : /* @__PURE__ */ z("div", {
|
|
694
694
|
className: "main-empty",
|
|
695
|
-
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(
|
|
695
|
+
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Pn, {
|
|
696
696
|
text: s === void 0 || s.greeting === !0 || ((nt = s.greeting) == null ? void 0 : nt.text) === void 0 ? mt.text : s.greeting.text,
|
|
697
|
-
icon: s === void 0 || s.greeting === !0 || ((it = s.greeting) == null ? void 0 : it.icon) === void 0 ?
|
|
698
|
-
children: !!Ue.length && (((s == null ? void 0 : s.greeting) === void 0 || (s == null ? void 0 : s.greeting)) === !0 || typeof (s == null ? void 0 : s.greeting) == "object" && s.greeting.questions !== !1) && /* @__PURE__ */ c(
|
|
697
|
+
icon: s === void 0 || s.greeting === !0 || ((it = s.greeting) == null ? void 0 : it.icon) === void 0 ? It || mt.icon : s.greeting.icon,
|
|
698
|
+
children: !!Ue.length && (((s == null ? void 0 : s.greeting) === void 0 || (s == null ? void 0 : s.greeting)) === !0 || typeof (s == null ? void 0 : s.greeting) == "object" && s.greeting.questions !== !1) && /* @__PURE__ */ c(En, {
|
|
699
699
|
ref: xe,
|
|
700
700
|
sid: (ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id,
|
|
701
701
|
isRecommendClearing: Me,
|
|
@@ -737,14 +737,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
737
737
|
fontSize: 16
|
|
738
738
|
}
|
|
739
739
|
}),
|
|
740
|
-
onClick: () =>
|
|
740
|
+
onClick: () => Zt(),
|
|
741
741
|
children: "停止回答"
|
|
742
742
|
})
|
|
743
743
|
}), qe && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
|
|
744
744
|
className: "back-bottom",
|
|
745
745
|
children: /* @__PURE__ */ c(W, {
|
|
746
746
|
size: "small",
|
|
747
|
-
onClick: () =>
|
|
747
|
+
onClick: () => Jt({
|
|
748
748
|
behavior: "smooth"
|
|
749
749
|
}),
|
|
750
750
|
type: "link",
|
|
@@ -762,10 +762,10 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
762
762
|
className: "chat-footer-input",
|
|
763
763
|
children: [S && /* @__PURE__ */ c("div", {
|
|
764
764
|
className: "input-files",
|
|
765
|
-
children: /* @__PURE__ */ c(
|
|
765
|
+
children: /* @__PURE__ */ c(Nn, {
|
|
766
766
|
file: S,
|
|
767
767
|
actions: {
|
|
768
|
-
upload:
|
|
768
|
+
upload: Xt,
|
|
769
769
|
remove: () => {
|
|
770
770
|
Q(void 0);
|
|
771
771
|
}
|
|
@@ -776,11 +776,11 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
776
776
|
className: "footer-upload-action",
|
|
777
777
|
onClick: (t) => t.preventDefault(),
|
|
778
778
|
children: [/* @__PURE__ */ z(he, {
|
|
779
|
-
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(
|
|
779
|
+
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(vn, {
|
|
780
780
|
disabled: !!S || R,
|
|
781
781
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
782
782
|
listType: "picture-card",
|
|
783
|
-
beforeUpload:
|
|
783
|
+
beforeUpload: Gt,
|
|
784
784
|
className: "footer-upload-picture",
|
|
785
785
|
showUploadList: !1,
|
|
786
786
|
children: S ? /* @__PURE__ */ c(W, {
|
|
@@ -792,13 +792,13 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
792
792
|
bottom: "-2px"
|
|
793
793
|
},
|
|
794
794
|
disabled: !!S || R,
|
|
795
|
-
icon: /* @__PURE__ */ c(
|
|
795
|
+
icon: /* @__PURE__ */ c(Fn, {
|
|
796
796
|
className: "icon-tianjia",
|
|
797
797
|
style: {
|
|
798
798
|
fontSize: "22px"
|
|
799
799
|
}
|
|
800
800
|
})
|
|
801
|
-
}) : /* @__PURE__ */ c(
|
|
801
|
+
}) : /* @__PURE__ */ c(kn, {
|
|
802
802
|
placement: "topLeft",
|
|
803
803
|
overlayClassName: "footer-upload-tooltip",
|
|
804
804
|
title: /* @__PURE__ */ c("div", {
|
|
@@ -821,7 +821,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
821
821
|
})
|
|
822
822
|
})
|
|
823
823
|
})
|
|
824
|
-
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(
|
|
824
|
+
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Hn, {
|
|
825
825
|
appId: o == null ? void 0 : o.id,
|
|
826
826
|
ref: ce,
|
|
827
827
|
isFirstSession: Be,
|
|
@@ -860,9 +860,9 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
860
860
|
});
|
|
861
861
|
},
|
|
862
862
|
onFileListChange: (t) => {
|
|
863
|
-
|
|
863
|
+
Ut(t);
|
|
864
864
|
},
|
|
865
|
-
shouldContinue:
|
|
865
|
+
shouldContinue: jt,
|
|
866
866
|
afterFilesClear: () => {
|
|
867
867
|
var n;
|
|
868
868
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
@@ -870,33 +870,33 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
870
870
|
[t]: []
|
|
871
871
|
}), Le());
|
|
872
872
|
}
|
|
873
|
-
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(
|
|
873
|
+
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(Vn, {
|
|
874
874
|
appId: o.id,
|
|
875
875
|
list: [],
|
|
876
|
-
search: je ?
|
|
876
|
+
search: je ? Ft : "",
|
|
877
877
|
onPromptSelect: (t) => {
|
|
878
878
|
X(t.context), oe(t.context);
|
|
879
879
|
},
|
|
880
880
|
disabled: R
|
|
881
881
|
})]
|
|
882
882
|
}), /* @__PURE__ */ z(he, {
|
|
883
|
-
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((rt = o.arrange) == null ? void 0 : rt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(
|
|
883
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((rt = o.arrange) == null ? void 0 : rt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(zn, {
|
|
884
884
|
sessionId: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
885
885
|
netStatus: E,
|
|
886
|
-
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) :
|
|
886
|
+
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : Bt,
|
|
887
887
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
888
888
|
onNetStatusChange: (t) => {
|
|
889
|
-
|
|
889
|
+
sn(t);
|
|
890
890
|
}
|
|
891
|
-
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(
|
|
891
|
+
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(Un, {
|
|
892
892
|
currentSessionId: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
|
|
893
893
|
onSessionChange: (t, n) => {
|
|
894
894
|
X(void 0), Ne(!0), p == null || p(n);
|
|
895
895
|
},
|
|
896
896
|
disabled: R
|
|
897
|
-
}),
|
|
897
|
+
}), Nt && Ct === "float" && /* @__PURE__ */ c("div", {
|
|
898
898
|
className: "session-history-drawer-component",
|
|
899
|
-
children: /* @__PURE__ */ c(
|
|
899
|
+
children: /* @__PURE__ */ c(wn, {
|
|
900
900
|
placement: "topRight",
|
|
901
901
|
showArrow: !1,
|
|
902
902
|
overlayClassName: "session-history-overlay",
|
|
@@ -919,7 +919,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
919
919
|
})
|
|
920
920
|
})
|
|
921
921
|
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(W, {
|
|
922
|
-
icon: /* @__PURE__ */ c(
|
|
922
|
+
icon: /* @__PURE__ */ c(On, {}),
|
|
923
923
|
className: "add-btn",
|
|
924
924
|
type: "primary",
|
|
925
925
|
disabled: Ae || !e || !v.length || R,
|
|
@@ -932,10 +932,10 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
932
932
|
})]
|
|
933
933
|
}), /* @__PURE__ */ c("div", {
|
|
934
934
|
className: "footer-textarea",
|
|
935
|
-
children: /* @__PURE__ */ c(
|
|
935
|
+
children: /* @__PURE__ */ c(Ln, {
|
|
936
936
|
ref: ae,
|
|
937
|
-
maxLength:
|
|
938
|
-
text:
|
|
937
|
+
maxLength: Lt,
|
|
938
|
+
text: Ht,
|
|
939
939
|
networkStatus: !1,
|
|
940
940
|
loading: Ye,
|
|
941
941
|
disabled: He || De || R || Ye,
|
|
@@ -943,7 +943,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
943
943
|
onChange: (t, n) => {
|
|
944
944
|
X(t);
|
|
945
945
|
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
946
|
-
oe(a),
|
|
946
|
+
oe(a), Ot(a), je || Tt(!0);
|
|
947
947
|
},
|
|
948
948
|
clearAction: /* @__PURE__ */ c(he, {
|
|
949
949
|
size: 0,
|
|
@@ -957,29 +957,27 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
957
957
|
},
|
|
958
958
|
type: "icon-qingchujiyi"
|
|
959
959
|
}),
|
|
960
|
-
onClick: () =>
|
|
960
|
+
onClick: () => Qt()
|
|
961
961
|
})
|
|
962
962
|
})
|
|
963
963
|
})
|
|
964
964
|
})]
|
|
965
965
|
})
|
|
966
|
-
}), /* @__PURE__ */ c(
|
|
967
|
-
tips:
|
|
968
|
-
}), Ve && /* @__PURE__ */ c(
|
|
966
|
+
}), /* @__PURE__ */ c(Tn, {
|
|
967
|
+
tips: bt
|
|
968
|
+
}), Ve && /* @__PURE__ */ c(Rn, {
|
|
969
969
|
isvisible: Ve,
|
|
970
|
-
files:
|
|
970
|
+
files: Dt,
|
|
971
971
|
sessionId: (dt = e == null ? void 0 : e.data) == null ? void 0 : dt.id,
|
|
972
972
|
onClose: (t) => {
|
|
973
|
-
|
|
973
|
+
Rt(!1), zt(!1);
|
|
974
974
|
}
|
|
975
975
|
})]
|
|
976
|
-
}), Ke && /* @__PURE__ */ c(
|
|
976
|
+
}), Ke && /* @__PURE__ */ c(Mn, {
|
|
977
977
|
currentSession: e,
|
|
978
978
|
application: o,
|
|
979
979
|
networkStatus: E,
|
|
980
980
|
setCurrentSession: p,
|
|
981
|
-
sessions: kt,
|
|
982
|
-
setSessions: wt,
|
|
983
981
|
disabled: R,
|
|
984
982
|
isSessionHistoryVisible: Ke,
|
|
985
983
|
setIsSessionHistoryVisible: We,
|