@glodon-aiot/agent-cli-ui 3.3.6 → 3.4.0-alpha.3
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 +59 -54
- package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +74 -0
- package/dist/es/Dialog/AgentChat/index.mjs +589 -560
- package/dist/es/Dialog/SessionList/index.mjs +255 -173
- package/dist/es/Dialog/index.mjs +117 -103
- package/dist/es/QuillEditor/index.mjs +19 -17
- package/dist/es/components/Sider/index.mjs +24 -0
- package/dist/es/constant.mjs +2 -0
- package/dist/es/index.mjs +100 -99
- 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/style11.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/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style29.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 -0
- package/dist/es/src/style33.css +1 -0
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +57 -57
- package/dist/src/AgentClientUI.d.ts +1 -0
- package/dist/src/Dialog/AgentChat/HistoryItem/FileItem/index.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/HistoryItem/SessionAction/index.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +1 -1
- package/dist/src/Dialog/AgentChat/PromptSetting/index.d.ts +2 -2
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +2 -2
- package/dist/src/Dialog/AgentChat/index.d.ts +8 -3
- package/dist/src/Dialog/SessionList/index.d.ts +9 -5
- package/dist/src/Dialog/index.d.ts +1 -0
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/dist/src/components/KnowledgeList/index.d.ts +1 -1
- package/dist/src/types.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,148 +1,157 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var j = (
|
|
15
|
-
var
|
|
1
|
+
var sn = Object.defineProperty, an = Object.defineProperties;
|
|
2
|
+
var ln = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ct = Object.getOwnPropertySymbols;
|
|
4
|
+
var dn = Object.prototype.hasOwnProperty, cn = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ce = (x, k, o) => k in x ? sn(x, k, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[k] = o, ft = (x, k) => {
|
|
6
|
+
for (var o in k || (k = {}))
|
|
7
|
+
dn.call(k, o) && Ce(x, o, k[o]);
|
|
8
|
+
if (ct)
|
|
9
|
+
for (var o of ct(k))
|
|
10
|
+
cn.call(k, o) && Ce(x, o, k[o]);
|
|
11
|
+
return x;
|
|
12
|
+
}, gt = (x, k) => an(x, ln(k));
|
|
13
|
+
var H = (x, k, o) => (Ce(x, typeof k != "symbol" ? k + "" : k, o), o);
|
|
14
|
+
var j = (x, k, o) => new Promise((q, e) => {
|
|
15
|
+
var C = (E) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
p(o.next(E));
|
|
18
|
+
} catch (P) {
|
|
19
|
+
e(P);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, ye = (E) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
p(o.throw(E));
|
|
24
|
+
} catch (P) {
|
|
25
|
+
e(P);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, p = (E) => E.done ? q(E.value) : Promise.resolve(E.value).then(C, ye);
|
|
28
|
+
p((o = o.apply(x, k)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as c, jsxs as B } from "react/jsx-runtime";
|
|
31
|
-
import { memo as
|
|
32
|
-
/* empty css */import {
|
|
33
|
-
import
|
|
34
|
-
import { IHistoryRole as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import { v4 as
|
|
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
|
|
51
|
-
import { useMemoizedFn as
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
|
|
58
|
-
|
|
30
|
+
import { jsx as c, jsxs as B, Fragment as fn } from "react/jsx-runtime";
|
|
31
|
+
import { memo as gn, forwardRef as un, useState as h, useRef as K, useContext as hn, useMemo as ut, useEffect as L, useImperativeHandle as mn } from "react";
|
|
32
|
+
/* empty css */import { Spin as ht, Divider as yn, Button as X, Space as ge, Upload as pn, Tooltip as vn, notification as ue, message as u } from "antd";
|
|
33
|
+
import he from "../../components/Iconfont/index.mjs";
|
|
34
|
+
import { IHistoryRole as Z, ChatMessageRole as mt, PromptVariableType as me } from "@glodon-aiot/apis";
|
|
35
|
+
import vt from "./HistoryItem/index.mjs";
|
|
36
|
+
import kt from "dayjs";
|
|
37
|
+
import { v4 as Pe } from "uuid";
|
|
38
|
+
import kn from "../../context.mjs";
|
|
39
|
+
import { configuration as bn } from "@glodon-aiot/bot-client-sdk";
|
|
40
|
+
import { NET_OPEN_STATUS as $, MB as wn } from "../../constant.mjs";
|
|
41
|
+
import xn from "../../components/FilePreview/index.mjs";
|
|
42
|
+
import { getImageExtension as In } from "../../utils/index.mjs";
|
|
43
|
+
import Nn from "../../QuillEditor/index.mjs";
|
|
44
|
+
import Ln from "../../components/Recommend/index.mjs";
|
|
45
|
+
import Cn from "../../components/Greeting/index.mjs";
|
|
46
|
+
import En from "../../Footer/index.mjs";
|
|
47
|
+
import { CameraOutlined as Pn, PlusOutlined as Tn } from "@ant-design/icons";
|
|
48
|
+
import On from "./Tools/UploadKnowledgeFiles/index.mjs";
|
|
49
|
+
import Fn from "../UploadingPrompt/index.mjs";
|
|
50
|
+
import Rn from "./PromptSetting/index.mjs";
|
|
51
|
+
import { useMemoizedFn as Ee } from "ahooks";
|
|
52
|
+
import Dn from "./Tools/SessionListDrawer/index.mjs";
|
|
53
|
+
import Hn from "./Tools/SessionHistoryDrawer/index.mjs";
|
|
54
|
+
import Un from "react-infinite-scroll-component";
|
|
55
|
+
import Mn from "./Tools/ConnectToNetwork/index.mjs";
|
|
56
|
+
import jn from "./Tools/PromptManager/index.mjs";
|
|
57
|
+
import zn from "../../assets/icon.svg.mjs";
|
|
58
|
+
const Vn = gn(vt), yt = {
|
|
59
|
+
icon: zn,
|
|
59
60
|
text: "今天我能帮你什么?"
|
|
60
61
|
};
|
|
61
|
-
class
|
|
62
|
-
constructor(o,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.content =
|
|
62
|
+
class ne {
|
|
63
|
+
constructor(k, o, q, e) {
|
|
64
|
+
H(this, "messageTime");
|
|
65
|
+
H(this, "isWaiting");
|
|
66
|
+
H(this, "messageId");
|
|
67
|
+
H(this, "isContext");
|
|
68
|
+
H(this, "actions");
|
|
69
|
+
H(this, "reference");
|
|
70
|
+
H(this, "isSensitive");
|
|
71
|
+
H(this, "isSuspend");
|
|
72
|
+
H(this, "comment");
|
|
73
|
+
this.content = k, this.sessionId = o, this.role = q, this.files = e, this.content = k, this.role = q, this.sessionId = o, this.files = e, this.messageTime = kt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Pe(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
73
74
|
isAgree: 0
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
const
|
|
78
|
-
var
|
|
78
|
+
const pt = 10, yi = un((x, k) => {
|
|
79
|
+
var Ze, Je, Se, et, tt, nt, it, ot, rt, st, at, lt, dt;
|
|
79
80
|
const {
|
|
80
81
|
application: o,
|
|
81
|
-
docViewerUrl:
|
|
82
|
+
docViewerUrl: q = "",
|
|
82
83
|
currentSession: e,
|
|
83
|
-
onCreateSession:
|
|
84
|
-
embeddingService:
|
|
85
|
-
setCurrentSession:
|
|
86
|
-
networkStatus:
|
|
87
|
-
setNetworkStatus:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
onCreateSession: C,
|
|
85
|
+
embeddingService: ye,
|
|
86
|
+
setCurrentSession: p,
|
|
87
|
+
networkStatus: E,
|
|
88
|
+
setNetworkStatus: P,
|
|
89
|
+
sessions: bt,
|
|
90
|
+
// 👈 新增
|
|
91
|
+
setSessions: wt
|
|
92
|
+
// 👈 新增
|
|
93
|
+
} = x, [v, I] = h([]), [xt, J] = h(), [pe, Te] = h(), R = K(null), {
|
|
94
|
+
service: T,
|
|
95
|
+
agentClient: N,
|
|
96
|
+
depId: It,
|
|
97
|
+
footer: Nt,
|
|
93
98
|
transform: g,
|
|
94
|
-
defaultInput:
|
|
95
|
-
onMessage:
|
|
96
|
-
onHistoryLoad:
|
|
99
|
+
defaultInput: ve,
|
|
100
|
+
onMessage: ie,
|
|
101
|
+
onHistoryLoad: Oe,
|
|
97
102
|
beforeMessageSend: z,
|
|
98
|
-
bodyStyle:
|
|
99
|
-
disabled:
|
|
103
|
+
bodyStyle: Lt,
|
|
104
|
+
disabled: D,
|
|
100
105
|
features: r,
|
|
101
106
|
popupContainer: f,
|
|
102
|
-
icon:
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
icon: Ct,
|
|
108
|
+
sider: Et,
|
|
109
|
+
mode: Pt
|
|
110
|
+
} = hn(kn), [Fe, ke] = h(!1), m = K(v), Re = K(void 0), [Tt, Ot] = h(0), [S, W] = h(), [Q, oe] = h(""), [De, be] = h(!1), re = K(null), [He, Ft] = h([]), [Ue, _] = h(!1), [Me, Rt] = h(!1), [Dt, Ht] = h(""), [Ut, Y] = h(), [se, ae] = h({}), le = K(null), je = K(null), we = K(null), [ze, Mt] = h(!1), [jt, zt] = h([]), [Vt, de] = h(!0), [At, Bt] = h(!0), [Ve, U] = h(!1), [xe, V] = h(!1), [Ae, $t] = h(!1), [F, ce] = h(typeof (r == null ? void 0 : r.promptVariables) == "object" ? r.promptVariables.default || [] : []), [qt, Yt] = h(typeof (r == null ? void 0 : r.knowledges) == "object" && r.knowledges.default || void 0), [Be, M] = h(!1), [$e, ee] = h(!1), [Kt, G] = h(typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.default) == "boolean" ? r.connectNetwork.default : !1), [qe, fe] = h(!1), [Wt, Ie] = h(!1), Ye = ut(() => e === null ? !1 : e === void 0 ? !0 : e ? !e.ready : !0, [e, e == null ? void 0 : e.ready, (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id]);
|
|
111
|
+
L(() => {
|
|
112
|
+
Ie(Ye);
|
|
113
|
+
}, [Ye]), L(() => {
|
|
105
114
|
var a, i;
|
|
106
|
-
e && (
|
|
107
|
-
const t =
|
|
115
|
+
e && (m.current = []), I([]);
|
|
116
|
+
const t = R.current;
|
|
108
117
|
if (t && t.scrollTo({
|
|
109
118
|
top: 0
|
|
110
119
|
}), !((a = e == null ? void 0 : e.data) != null && a.id))
|
|
111
120
|
return;
|
|
112
121
|
if (V(!1), U(!1), (i = e.messages) != null && i.length) {
|
|
113
122
|
const s = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
114
|
-
|
|
123
|
+
m.current = [...s], I([...s]), Ie(!1);
|
|
115
124
|
}
|
|
116
125
|
const n = (l) => {
|
|
117
126
|
var s;
|
|
118
|
-
(s = e == null ? void 0 : e.data) != null && s.id && (
|
|
127
|
+
(s = e == null ? void 0 : e.data) != null && s.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? ee(!1) : ee(!0), Ie(!1), Oe && Oe({
|
|
119
128
|
applicationId: o.id,
|
|
120
129
|
sessionId: e.data.id,
|
|
121
130
|
histories: l
|
|
122
131
|
}));
|
|
123
132
|
};
|
|
124
133
|
return e.addEventListener("history:loaded", n), () => {
|
|
125
|
-
|
|
134
|
+
m.current = [], I([]), e == null || e.removeEventListener("history:loaded", n);
|
|
126
135
|
};
|
|
127
|
-
}, [e]),
|
|
136
|
+
}, [e]), L(() => {
|
|
128
137
|
const t = () => {
|
|
129
138
|
var n;
|
|
130
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables &&
|
|
139
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ce(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges && Yt(e.knowledges), P(e.netOpen));
|
|
131
140
|
};
|
|
132
141
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
133
142
|
e == null || e.removeEventListener("data:updated", t);
|
|
134
143
|
};
|
|
135
|
-
}, [e]),
|
|
144
|
+
}, [e]), L(() => {
|
|
136
145
|
var n;
|
|
137
146
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
138
147
|
return;
|
|
139
148
|
const t = (a) => {
|
|
140
149
|
var i;
|
|
141
|
-
console.error(a.message, a.cause, "e.case"),
|
|
150
|
+
console.error(a.message, a.cause, "e.case"), ue.config({
|
|
142
151
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
143
|
-
}),
|
|
152
|
+
}), ue.error({
|
|
144
153
|
message: ((i = a.cause) == null ? void 0 : i.message) || a.message
|
|
145
|
-
}),
|
|
154
|
+
}), ue.config({
|
|
146
155
|
getContainer: void 0
|
|
147
156
|
});
|
|
148
157
|
};
|
|
@@ -150,11 +159,11 @@ const ct = 10, ti = (N) => {
|
|
|
150
159
|
e == null || e.removeEventListener("error", t);
|
|
151
160
|
};
|
|
152
161
|
}, [e]);
|
|
153
|
-
const
|
|
162
|
+
const Qt = () => {
|
|
154
163
|
var a;
|
|
155
164
|
if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(o != null && o.id))
|
|
156
165
|
return;
|
|
157
|
-
const t = e.data.id, n =
|
|
166
|
+
const t = e.data.id, n = v[v.length - 1];
|
|
158
167
|
if (n && n.isContext) {
|
|
159
168
|
u.config({
|
|
160
169
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -164,18 +173,18 @@ const ct = 10, ti = (N) => {
|
|
|
164
173
|
return;
|
|
165
174
|
} else
|
|
166
175
|
e.clear().then(() => {
|
|
167
|
-
const i = new
|
|
168
|
-
i.isContext = !0,
|
|
176
|
+
const i = new ne("", t, Z.System);
|
|
177
|
+
i.isContext = !0, I([i, ...v]);
|
|
169
178
|
});
|
|
170
179
|
};
|
|
171
|
-
|
|
172
|
-
o != null && o.id && (
|
|
173
|
-
|
|
180
|
+
L(() => {
|
|
181
|
+
o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
|
|
182
|
+
Ft(t);
|
|
174
183
|
}));
|
|
175
|
-
}, [
|
|
176
|
-
const
|
|
177
|
-
var
|
|
178
|
-
if (
|
|
184
|
+
}, [It, o]);
|
|
185
|
+
const Ke = (t) => j(void 0, null, function* () {
|
|
186
|
+
var y, O;
|
|
187
|
+
if (D) {
|
|
179
188
|
u.config({
|
|
180
189
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
181
190
|
}), u.error("发送功能被禁用"), u.config({
|
|
@@ -183,7 +192,7 @@ const ct = 10, ti = (N) => {
|
|
|
183
192
|
});
|
|
184
193
|
return;
|
|
185
194
|
}
|
|
186
|
-
const n = t ||
|
|
195
|
+
const n = t || xt;
|
|
187
196
|
if (!(n != null && n.trim())) {
|
|
188
197
|
u.config({
|
|
189
198
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -192,7 +201,7 @@ const ct = 10, ti = (N) => {
|
|
|
192
201
|
});
|
|
193
202
|
return;
|
|
194
203
|
}
|
|
195
|
-
if (!(
|
|
204
|
+
if (!(F == null ? void 0 : F.every((b) => !!(b != null && b.value))))
|
|
196
205
|
if (g != null && g.promptVariables) {
|
|
197
206
|
u.config({
|
|
198
207
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -201,8 +210,8 @@ const ct = 10, ti = (N) => {
|
|
|
201
210
|
});
|
|
202
211
|
return;
|
|
203
212
|
} else
|
|
204
|
-
console.error("变量值不能为空",
|
|
205
|
-
if (
|
|
213
|
+
console.error("变量值不能为空", F == null ? void 0 : F.map((b) => !!(b != null && b.value)));
|
|
214
|
+
if (xe) {
|
|
206
215
|
u.config({
|
|
207
216
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
208
217
|
}), u.error("正在回复中"), u.config({
|
|
@@ -210,7 +219,7 @@ const ct = 10, ti = (N) => {
|
|
|
210
219
|
});
|
|
211
220
|
return;
|
|
212
221
|
}
|
|
213
|
-
if (
|
|
222
|
+
if (Fe) {
|
|
214
223
|
u.config({
|
|
215
224
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
216
225
|
}), u.error("等待初始化"), u.config({
|
|
@@ -218,7 +227,7 @@ const ct = 10, ti = (N) => {
|
|
|
218
227
|
});
|
|
219
228
|
return;
|
|
220
229
|
}
|
|
221
|
-
if (!
|
|
230
|
+
if (!Vt) {
|
|
222
231
|
u.config({
|
|
223
232
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
224
233
|
}), u.error("正在解析文件"), u.config({
|
|
@@ -226,7 +235,7 @@ const ct = 10, ti = (N) => {
|
|
|
226
235
|
});
|
|
227
236
|
return;
|
|
228
237
|
}
|
|
229
|
-
if (
|
|
238
|
+
if (De) {
|
|
230
239
|
u.config({
|
|
231
240
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
232
241
|
}), u.error("正在上传图片"), u.config({
|
|
@@ -234,21 +243,21 @@ const ct = 10, ti = (N) => {
|
|
|
234
243
|
});
|
|
235
244
|
return;
|
|
236
245
|
}
|
|
237
|
-
|
|
238
|
-
const i = (
|
|
246
|
+
W(void 0), oe("");
|
|
247
|
+
const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
239
248
|
if (!i) {
|
|
240
|
-
|
|
241
|
-
netOpen:
|
|
242
|
-
}).then((
|
|
243
|
-
var A,
|
|
244
|
-
M(!0),
|
|
245
|
-
|
|
249
|
+
C == null || C({
|
|
250
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
251
|
+
}).then((b) => {
|
|
252
|
+
var A, te;
|
|
253
|
+
M(!0), P(!!((A = b.data) != null && A.netOpen)), G(!!((te = b.data) != null && te.enableNetOpen)), We(b).then(() => {
|
|
254
|
+
p == null || p(b), M(!1), Te(n);
|
|
246
255
|
});
|
|
247
256
|
});
|
|
248
257
|
return;
|
|
249
258
|
}
|
|
250
|
-
|
|
251
|
-
const l =
|
|
259
|
+
fe(!0);
|
|
260
|
+
const l = Q ? `
|
|
252
261
|
${n}` : n;
|
|
253
262
|
let s;
|
|
254
263
|
try {
|
|
@@ -258,54 +267,54 @@ ${n}` : n;
|
|
|
258
267
|
message: {
|
|
259
268
|
content: l,
|
|
260
269
|
sessionId: i,
|
|
261
|
-
role:
|
|
262
|
-
files:
|
|
270
|
+
role: mt.User,
|
|
271
|
+
files: se[i]
|
|
263
272
|
}
|
|
264
273
|
}) : s = !0;
|
|
265
|
-
} catch (
|
|
274
|
+
} catch (b) {
|
|
266
275
|
s = !1;
|
|
267
276
|
}
|
|
268
|
-
if (
|
|
277
|
+
if (fe(!1), s === !1)
|
|
269
278
|
return;
|
|
270
279
|
let d = n;
|
|
271
|
-
typeof s == "object" && (d = s.content || n), (yield e.setPromptVariables(
|
|
272
|
-
}),
|
|
273
|
-
const s = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type ===
|
|
274
|
-
var
|
|
275
|
-
const
|
|
276
|
-
return d.value =
|
|
280
|
+
typeof s == "object" && (d = s.content || n), (yield e.setPromptVariables(F)) && (((O = se[i]) == null ? void 0 : O.length) > 0 ? _t(d) : Ne(d));
|
|
281
|
+
}), We = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
282
|
+
const s = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === me.User || d.type === void 0) && d.key === "query") && !((d.type === me.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
283
|
+
var y;
|
|
284
|
+
const w = (y = F.find((O) => O.key === d.key && O.type === d.type)) == null ? void 0 : y.value;
|
|
285
|
+
return d.value = w || "", d;
|
|
277
286
|
});
|
|
278
|
-
|
|
287
|
+
ce(s.sort((d, w) => d.key.localeCompare(w.key))), yield t == null ? void 0 : t.setPromptVariables(s).catch((d) => {
|
|
279
288
|
console.error(d), u.config({
|
|
280
289
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
281
290
|
}), u.error(d.message), u.config({
|
|
282
291
|
getContainer: void 0
|
|
283
292
|
});
|
|
284
293
|
}), n();
|
|
285
|
-
})),
|
|
286
|
-
var s, d,
|
|
287
|
-
if (
|
|
294
|
+
})), _t = (t) => {
|
|
295
|
+
var s, d, w;
|
|
296
|
+
if (de(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
|
|
288
297
|
return;
|
|
289
298
|
const n = ((d = e.data) == null ? void 0 : d.id) || "", a = [];
|
|
290
299
|
let i = [], l = /* @__PURE__ */ new Set();
|
|
291
|
-
(
|
|
292
|
-
l.has(
|
|
293
|
-
}), Promise.all(i.map((
|
|
300
|
+
(w = se[n]) == null || w.forEach((y) => {
|
|
301
|
+
l.has(y.id) || (i.push(y), l.add(y.id));
|
|
302
|
+
}), Promise.all(i.map((y) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, y.id, {
|
|
294
303
|
enabled: 1
|
|
295
|
-
}).then((
|
|
296
|
-
a.push(
|
|
297
|
-
}))).then((
|
|
298
|
-
|
|
299
|
-
}).catch((
|
|
300
|
-
throw Error(
|
|
304
|
+
}).then((O) => {
|
|
305
|
+
a.push(y);
|
|
306
|
+
}))).then((y) => {
|
|
307
|
+
de(!0), Ne(t, a);
|
|
308
|
+
}).catch((y) => {
|
|
309
|
+
throw Error(y);
|
|
301
310
|
});
|
|
302
311
|
};
|
|
303
|
-
|
|
304
|
-
if (!
|
|
312
|
+
L(() => {
|
|
313
|
+
if (!pe || !e)
|
|
305
314
|
return;
|
|
306
|
-
const t =
|
|
307
|
-
|
|
308
|
-
const a =
|
|
315
|
+
const t = pe, n = () => j(void 0, null, function* () {
|
|
316
|
+
fe(!0);
|
|
317
|
+
const a = Q ? `
|
|
309
318
|
${t}` : t;
|
|
310
319
|
let i;
|
|
311
320
|
try {
|
|
@@ -315,229 +324,231 @@ ${t}` : t;
|
|
|
315
324
|
message: {
|
|
316
325
|
content: a,
|
|
317
326
|
sessionId: e.id,
|
|
318
|
-
role:
|
|
319
|
-
files:
|
|
327
|
+
role: mt.User,
|
|
328
|
+
files: se[e.id]
|
|
320
329
|
}
|
|
321
330
|
}) : i = !0;
|
|
322
331
|
} catch (l) {
|
|
323
332
|
i = !1;
|
|
324
333
|
}
|
|
325
|
-
|
|
334
|
+
fe(!1), i !== !1 && (Ne(t), Te(void 0));
|
|
326
335
|
});
|
|
327
336
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
328
337
|
e == null || e.removeEventListener("ready", n);
|
|
329
338
|
};
|
|
330
|
-
}, [
|
|
331
|
-
const
|
|
332
|
-
var
|
|
333
|
-
const a = (
|
|
339
|
+
}, [pe, e]);
|
|
340
|
+
const Ne = (t, n) => j(void 0, null, function* () {
|
|
341
|
+
var y, O;
|
|
342
|
+
const a = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
334
343
|
if (!a)
|
|
335
344
|
return;
|
|
336
345
|
V(!0), U(!0);
|
|
337
|
-
const i =
|
|
338
|
-
${t}` : t, l = new
|
|
339
|
-
|
|
346
|
+
const i = Q ? `
|
|
347
|
+
${t}` : t, l = new ne(i, a, Z.User, n);
|
|
348
|
+
J(void 0), Y(void 0), m.current = [l, ...v], I(m.current), o.id && ie && ie({
|
|
340
349
|
applicationId: o.id,
|
|
341
350
|
sessionId: a,
|
|
342
351
|
message: l
|
|
343
352
|
});
|
|
344
|
-
const s = new
|
|
345
|
-
s.isWaiting = !0,
|
|
346
|
-
const d = (n == null ? void 0 : n.map((
|
|
347
|
-
stream:
|
|
353
|
+
const s = new ne("", a, Z.System);
|
|
354
|
+
s.isWaiting = !0, m.current = [s, ...m.current], I(m.current);
|
|
355
|
+
const d = (n == null ? void 0 : n.map((b) => b.id)) || [], w = {
|
|
356
|
+
stream: bn.stream,
|
|
348
357
|
referenceFirst: !1
|
|
349
358
|
};
|
|
350
359
|
if (g != null && g.promptVariables) {
|
|
351
|
-
const
|
|
352
|
-
|
|
360
|
+
const b = F == null ? void 0 : F.reduce((A, te) => (A[te.key] = te.value, A), {});
|
|
361
|
+
w.formatValues = b;
|
|
353
362
|
}
|
|
354
363
|
if (g != null && g.knowledges) {
|
|
355
|
-
const
|
|
356
|
-
|
|
364
|
+
const b = qt;
|
|
365
|
+
w.knowledges = b;
|
|
357
366
|
}
|
|
358
367
|
yield e.send({
|
|
359
368
|
text: i,
|
|
360
369
|
fileIds: d,
|
|
361
370
|
files: n
|
|
362
|
-
},
|
|
371
|
+
}, w), ae({
|
|
363
372
|
[a]: []
|
|
364
|
-
}), (
|
|
373
|
+
}), (O = le.current) == null || O.update();
|
|
365
374
|
});
|
|
366
|
-
|
|
375
|
+
L(() => {
|
|
367
376
|
var a;
|
|
368
377
|
const t = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
369
378
|
if (!t)
|
|
370
379
|
return;
|
|
371
380
|
const n = (i) => {
|
|
372
|
-
if (!i.sessionId || i.sessionId && i.sessionId !==
|
|
381
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Re.current || i.role === Z.User)
|
|
373
382
|
return;
|
|
374
|
-
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), V(!1),
|
|
375
|
-
return
|
|
383
|
+
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), V(!1), m.current = m.current.filter((d) => !d.isWaiting), I([...m.current]), m.current = [...m.current], i.content))
|
|
384
|
+
return ue.error({
|
|
376
385
|
message: i.content
|
|
377
386
|
});
|
|
378
|
-
const l = i.actions || [], s = new
|
|
379
|
-
s.messageId = i.messageId ||
|
|
387
|
+
const l = i.actions || [], s = new ne(i.content, t, Z.Robot);
|
|
388
|
+
s.messageId = i.messageId || Pe(), s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = l, s.isLoading = !0, s.searchingStatus = i.searchingStatus, m.current = m.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && I([s, ...m.current]), i.code === 11915 && (U(!1), V(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, I([s, ...m.current])), i.index === -2 && (U(!1), V(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, I([s, ...m.current])), i.index === -1 && (U(!1), V(!1), s.isLoading = !1, s.reference = i.reference, I([s, ...m.current]), o.id && ie && ie({
|
|
380
389
|
applicationId: o.id,
|
|
381
390
|
sessionId: t,
|
|
382
391
|
message: s
|
|
383
|
-
})), i.index === -3 && (U(!1), V(!1), s.isLoading = !1, s.reference = i.reference, s.relatedQuesion = i.relatedQuesion,
|
|
392
|
+
})), i.index === -3 && (U(!1), V(!1), s.isLoading = !1, s.reference = i.reference, s.relatedQuesion = i.relatedQuesion, I([s, ...m.current]));
|
|
384
393
|
};
|
|
385
394
|
return e.ready ? e.addEventListener("message:updated", n) : e.addEventListener("ready", () => {
|
|
386
395
|
e.addEventListener("message:updated", n);
|
|
387
396
|
}), () => {
|
|
388
397
|
e == null || e.removeEventListener("message:updated", n);
|
|
389
398
|
};
|
|
390
|
-
}, [e]),
|
|
399
|
+
}, [e]), L(() => {
|
|
391
400
|
if (!e) {
|
|
392
|
-
|
|
401
|
+
ke(!1);
|
|
393
402
|
return;
|
|
394
403
|
}
|
|
395
404
|
const t = (n) => {
|
|
396
|
-
|
|
405
|
+
ke(n);
|
|
397
406
|
};
|
|
398
|
-
return
|
|
407
|
+
return ke(e.frozen), e.addEventListener("frozen", t), () => {
|
|
399
408
|
e == null || e.removeEventListener("frozen", t);
|
|
400
409
|
};
|
|
401
|
-
}, [e]),
|
|
402
|
-
|
|
410
|
+
}, [e]), L(() => {
|
|
411
|
+
e && (Y(void 0), J(void 0));
|
|
412
|
+
}, [(Je = e == null ? void 0 : e.data) == null ? void 0 : Je.id]), L(() => {
|
|
413
|
+
if (!N)
|
|
403
414
|
return;
|
|
404
|
-
const t =
|
|
405
|
-
|
|
406
|
-
}, [
|
|
407
|
-
|
|
408
|
-
}, [
|
|
409
|
-
const
|
|
415
|
+
const t = N.questionContextMaxLength || 4e3;
|
|
416
|
+
Ot(t);
|
|
417
|
+
}, [N, T]), L(() => {
|
|
418
|
+
ve && Y(ve.text);
|
|
419
|
+
}, [ve]);
|
|
420
|
+
const Gt = (t) => {
|
|
410
421
|
const n = t.size;
|
|
411
422
|
return n <= 0 ? (u.config({
|
|
412
423
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
413
424
|
}), u.error("该文件为空,请重新上传"), u.config({
|
|
414
425
|
getContainer: void 0
|
|
415
|
-
}), !1) : n > 20 *
|
|
426
|
+
}), !1) : n > 20 * wn ? (u.config({
|
|
416
427
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
417
428
|
}), u.error("图片须小于20M"), u.config({
|
|
418
429
|
getContainer: void 0
|
|
419
|
-
}), !1) : (
|
|
420
|
-
},
|
|
430
|
+
}), !1) : (W(t), !1);
|
|
431
|
+
}, Xt = (t) => j(void 0, null, function* () {
|
|
421
432
|
var n;
|
|
422
|
-
return
|
|
423
|
-
M(!0),
|
|
424
|
-
netOpen:
|
|
433
|
+
return W(t), (n = e == null ? void 0 : e.data) != null && n.id ? Qe(e, t) : new Promise((a) => {
|
|
434
|
+
M(!0), C == null || C({
|
|
435
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
425
436
|
}).then((i) => {
|
|
426
437
|
var l, s;
|
|
427
|
-
|
|
438
|
+
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), G(!!((s = i.data) != null && s.enableNetOpen)), a(Qe(i, t));
|
|
428
439
|
});
|
|
429
440
|
});
|
|
430
|
-
}),
|
|
431
|
-
const a =
|
|
441
|
+
}), Qe = (t, n) => {
|
|
442
|
+
const a = In(n.name);
|
|
432
443
|
return new Promise((i) => {
|
|
433
444
|
var s;
|
|
434
445
|
const l = {
|
|
435
|
-
files: [`${
|
|
446
|
+
files: [`${Pe()}.${a}`],
|
|
436
447
|
isv: "minio",
|
|
437
448
|
knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
|
|
438
449
|
type: 1
|
|
439
450
|
};
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
var
|
|
443
|
-
const
|
|
444
|
-
i(`${location.protocol}//${
|
|
451
|
+
be(!0), T == null || T.postTicket(l).then((d) => {
|
|
452
|
+
T.uploadMinioFile(d.minio, n).then(() => {
|
|
453
|
+
var b, A;
|
|
454
|
+
const w = (b = d.minio.endpoints) == null ? void 0 : b[0], y = d.minio.bucket, O = (A = d.minio.fileKeys) == null ? void 0 : A[0];
|
|
455
|
+
i(`${location.protocol}//${w}/${y}/${O}`);
|
|
445
456
|
}).catch(() => {
|
|
446
|
-
|
|
457
|
+
oe(""), W(void 0);
|
|
447
458
|
}).finally(() => {
|
|
448
|
-
|
|
459
|
+
be(!1);
|
|
449
460
|
});
|
|
450
461
|
}).catch(() => {
|
|
451
|
-
|
|
462
|
+
oe(""), W(void 0), be(!1);
|
|
452
463
|
});
|
|
453
464
|
});
|
|
454
465
|
};
|
|
455
|
-
|
|
456
|
-
const t =
|
|
457
|
-
t && !
|
|
466
|
+
L(() => {
|
|
467
|
+
const t = R.current;
|
|
468
|
+
t && !Ae && t.scrollTo({
|
|
458
469
|
top: t.scrollHeight
|
|
459
470
|
});
|
|
460
|
-
}, [
|
|
461
|
-
const
|
|
471
|
+
}, [v]);
|
|
472
|
+
const _e = (t, n) => new Promise((a) => {
|
|
462
473
|
if (!n.file.url || !(o != null && o.id))
|
|
463
474
|
return a();
|
|
464
|
-
const i =
|
|
475
|
+
const i = gt(ft({}, n.file), {
|
|
465
476
|
type: 1
|
|
466
477
|
});
|
|
467
|
-
|
|
478
|
+
T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
468
479
|
var l;
|
|
469
|
-
(l =
|
|
480
|
+
(l = le.current) == null || l.update().finally(a);
|
|
470
481
|
});
|
|
471
|
-
}),
|
|
482
|
+
}), Zt = () => {
|
|
472
483
|
var t;
|
|
473
484
|
(t = e == null ? void 0 : e.data) != null && t.id && (U(!1), e.suspend());
|
|
474
|
-
},
|
|
475
|
-
const n =
|
|
485
|
+
}, Jt = (t) => {
|
|
486
|
+
const n = R.current;
|
|
476
487
|
n && setTimeout(() => {
|
|
477
488
|
n.scrollTo({
|
|
478
489
|
top: n.scrollHeight,
|
|
479
490
|
behavior: t == null ? void 0 : t.behavior
|
|
480
491
|
});
|
|
481
492
|
}, t == null ? void 0 : t.ms);
|
|
482
|
-
},
|
|
483
|
-
if (!
|
|
493
|
+
}, St = () => {
|
|
494
|
+
if (!R.current)
|
|
484
495
|
return;
|
|
485
|
-
const t =
|
|
486
|
-
|
|
487
|
-
},
|
|
496
|
+
const t = R.current.scrollTop <= -80;
|
|
497
|
+
$t(t);
|
|
498
|
+
}, en = Ee((t) => {
|
|
488
499
|
var n, a;
|
|
489
|
-
(n =
|
|
490
|
-
}),
|
|
491
|
-
|
|
492
|
-
}),
|
|
500
|
+
(n = re.current) == null || n.update(t), (a = re.current) == null || a.focus();
|
|
501
|
+
}), tn = Ee((t) => {
|
|
502
|
+
Ke(t);
|
|
503
|
+
}), nn = Ee(() => {
|
|
493
504
|
var n;
|
|
494
505
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
495
506
|
return;
|
|
496
|
-
|
|
497
|
-
const t = new
|
|
498
|
-
t.isWaiting = !0,
|
|
507
|
+
m.current = [...v.slice(1, v.length)], I(m.current);
|
|
508
|
+
const t = new ne("", e.data.id, Z.System);
|
|
509
|
+
t.isWaiting = !0, m.current = [t, ...m.current], I(m.current), V(!0), U(!0), e.answerAgain();
|
|
499
510
|
});
|
|
500
|
-
|
|
511
|
+
L(() => {
|
|
501
512
|
var t, n;
|
|
502
|
-
|
|
513
|
+
Re.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Be && ((n = we.current) == null || n.clear());
|
|
503
514
|
}, [e]);
|
|
504
|
-
const
|
|
515
|
+
const on = () => {
|
|
505
516
|
var a;
|
|
506
517
|
if (!((a = e == null ? void 0 : e.data) != null && a.id))
|
|
507
518
|
return;
|
|
508
|
-
const n =
|
|
519
|
+
const n = v[v.length - 1].messageTime;
|
|
509
520
|
e.fetchMessages({
|
|
510
521
|
endTime: n,
|
|
511
|
-
pageSize:
|
|
522
|
+
pageSize: pt
|
|
512
523
|
}).then((i) => {
|
|
513
524
|
const l = i || [];
|
|
514
525
|
if (!l || !(l != null && l.length)) {
|
|
515
|
-
|
|
526
|
+
ee(!1);
|
|
516
527
|
return;
|
|
517
528
|
}
|
|
518
|
-
l.length < 10 ?
|
|
529
|
+
l.length < 10 ? ee(!1) : ee(!0), I([...v, ...l.reverse()]);
|
|
519
530
|
});
|
|
520
|
-
},
|
|
531
|
+
}, rn = (t) => j(void 0, null, function* () {
|
|
521
532
|
var n, a;
|
|
522
533
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
523
|
-
|
|
534
|
+
P(t);
|
|
524
535
|
else {
|
|
525
536
|
if (yield e.setNetOpen(t), !((a = e.data) != null && a.id))
|
|
526
537
|
return;
|
|
527
|
-
|
|
538
|
+
P(t);
|
|
528
539
|
}
|
|
529
|
-
}),
|
|
540
|
+
}), Le = () => j(void 0, null, function* () {
|
|
530
541
|
e ? e.fetchData().then((t) => {
|
|
531
542
|
var n;
|
|
532
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (
|
|
533
|
-
}) : (
|
|
543
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), G(t.enableNetOpen));
|
|
544
|
+
}) : (P(typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.default) == "boolean" ? r.connectNetwork.default : !1), G(o.arrange[0].enableNetOpen));
|
|
534
545
|
});
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}, [e]),
|
|
546
|
+
L(() => {
|
|
547
|
+
Le();
|
|
548
|
+
}, [e]), L(() => {
|
|
538
549
|
var t, n;
|
|
539
|
-
if (
|
|
540
|
-
const a = document.getElementById("chat-main"), i = (t =
|
|
550
|
+
if (R.current) {
|
|
551
|
+
const a = document.getElementById("chat-main"), i = (t = R.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), l = (n = R.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
|
|
541
552
|
if (!i || !l || !a)
|
|
542
553
|
return;
|
|
543
554
|
const s = a.offsetHeight;
|
|
@@ -551,14 +562,14 @@ ${t}` : t, l = new ee(i, a, X.User, n);
|
|
|
551
562
|
i.style.height = "auto";
|
|
552
563
|
}
|
|
553
564
|
}
|
|
554
|
-
}, [
|
|
565
|
+
}, [v]), L(() => {
|
|
555
566
|
if (e)
|
|
556
567
|
return;
|
|
557
568
|
const t = () => {
|
|
558
|
-
const i = ((
|
|
559
|
-
var
|
|
569
|
+
const i = ((N == null ? void 0 : N.promptVariables) || []).filter((l) => l.type ? !(l.type === me.User && l.key === "query") && !(l.type === me.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, s) => {
|
|
570
|
+
var w, y;
|
|
560
571
|
let d = "";
|
|
561
|
-
return typeof (r == null ? void 0 : r.promptVariables) == "object" && (d = ((
|
|
572
|
+
return typeof (r == null ? void 0 : r.promptVariables) == "object" && (d = ((y = (w = r.promptVariables.default) == null ? void 0 : w.find((O) => O.key === l.key && O.type === l.type)) == null ? void 0 : y.value) || ""), {
|
|
562
573
|
id: s + "",
|
|
563
574
|
key: l.key,
|
|
564
575
|
name: l.name,
|
|
@@ -566,20 +577,20 @@ ${t}` : t, l = new ee(i, a, X.User, n);
|
|
|
566
577
|
type: l.type
|
|
567
578
|
};
|
|
568
579
|
});
|
|
569
|
-
|
|
580
|
+
ce([...i].sort((l, s) => l.key.localeCompare(s.key)));
|
|
570
581
|
};
|
|
571
|
-
return
|
|
572
|
-
|
|
582
|
+
return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
|
|
583
|
+
N == null || N.removeEventListener("ready", t);
|
|
573
584
|
};
|
|
574
|
-
}, [e,
|
|
575
|
-
const
|
|
576
|
-
netOpen:
|
|
585
|
+
}, [e, N, r == null ? void 0 : r.promptVariables]);
|
|
586
|
+
const Ge = () => C == null ? void 0 : C({
|
|
587
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
577
588
|
}).then((t) => {
|
|
578
589
|
var n, a;
|
|
579
|
-
return
|
|
580
|
-
}),
|
|
590
|
+
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), G(!!((a = t.data) != null && a.enableNetOpen)), We(t), t;
|
|
591
|
+
}), Xe = ut(() => {
|
|
581
592
|
var t;
|
|
582
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(
|
|
593
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(vt, {
|
|
583
594
|
application: o,
|
|
584
595
|
history: {
|
|
585
596
|
role: 1,
|
|
@@ -589,188 +600,176 @@ ${t}` : t, l = new ee(i, a, X.User, n);
|
|
|
589
600
|
sessionId: "",
|
|
590
601
|
reference: [],
|
|
591
602
|
searchReference: [],
|
|
592
|
-
messageTime:
|
|
603
|
+
messageTime: kt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
593
604
|
actions: [],
|
|
594
605
|
isLoading: !1
|
|
595
606
|
},
|
|
596
|
-
actions: !!
|
|
607
|
+
actions: !!v.length,
|
|
597
608
|
markdown: r == null ? void 0 : r.markdown
|
|
598
609
|
}) : null;
|
|
599
|
-
}, [o == null ? void 0 : o.arrange,
|
|
600
|
-
return
|
|
610
|
+
}, [o == null ? void 0 : o.arrange, v]);
|
|
611
|
+
return mn(k, () => ({
|
|
612
|
+
getCurrentInputText: () => {
|
|
613
|
+
var t;
|
|
614
|
+
return (t = re.current) == null ? void 0 : t.getCurrentText();
|
|
615
|
+
}
|
|
616
|
+
})), /* @__PURE__ */ c("div", {
|
|
601
617
|
className: "agent-chat",
|
|
602
|
-
children:
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
className: "chat-main
|
|
615
|
-
id: "
|
|
616
|
-
style:
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
flexDirection: "column-reverse"
|
|
621
|
-
},
|
|
622
|
-
ref: F,
|
|
623
|
-
onScroll: Bt,
|
|
624
|
-
children: (_e = e == null ? void 0 : e.data) != null && _e.id && (h != null && h.length) ? /* @__PURE__ */ B(wn, {
|
|
625
|
-
dataLength: h.length,
|
|
626
|
-
next: Kt,
|
|
618
|
+
children: Wt ? /* @__PURE__ */ c("div", {
|
|
619
|
+
className: "session-loading",
|
|
620
|
+
children: /* @__PURE__ */ c(ht, {})
|
|
621
|
+
}) : /* @__PURE__ */ B(fn, {
|
|
622
|
+
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Rn, {
|
|
623
|
+
ref: je,
|
|
624
|
+
appId: o.id,
|
|
625
|
+
currentSession: e,
|
|
626
|
+
promptVariables: F,
|
|
627
|
+
setPromptVariables: ce,
|
|
628
|
+
setCurrentSession: p
|
|
629
|
+
}), /* @__PURE__ */ B("div", {
|
|
630
|
+
className: "chat-main",
|
|
631
|
+
id: "chat-main",
|
|
632
|
+
style: Lt,
|
|
633
|
+
children: [/* @__PURE__ */ c("div", {
|
|
634
|
+
className: "chat-main-wrapper",
|
|
635
|
+
id: "scrollableDiv",
|
|
627
636
|
style: {
|
|
637
|
+
height: "100%",
|
|
638
|
+
overflowY: "auto",
|
|
628
639
|
display: "flex",
|
|
629
|
-
flexDirection: "column-reverse"
|
|
630
|
-
overflowX: "hidden"
|
|
640
|
+
flexDirection: "column-reverse"
|
|
631
641
|
},
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
}) : null,
|
|
638
|
-
hasMore: Ae,
|
|
639
|
-
loader: /* @__PURE__ */ c("div", {
|
|
642
|
+
ref: R,
|
|
643
|
+
onScroll: St,
|
|
644
|
+
children: (Se = e == null ? void 0 : e.data) != null && Se.id && (v != null && v.length) ? /* @__PURE__ */ B(Un, {
|
|
645
|
+
dataLength: v.length,
|
|
646
|
+
next: on,
|
|
640
647
|
style: {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
648
|
+
display: "flex",
|
|
649
|
+
flexDirection: "column-reverse",
|
|
650
|
+
overflowX: "hidden"
|
|
644
651
|
},
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
})
|
|
709
|
-
}), ze && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ c("div", {
|
|
710
|
-
className: "back-bottom",
|
|
711
|
-
children: /* @__PURE__ */ c(G, {
|
|
712
|
-
size: "small",
|
|
713
|
-
onClick: () => At({
|
|
714
|
-
behavior: "smooth"
|
|
715
|
-
}),
|
|
716
|
-
type: "link",
|
|
717
|
-
icon: /* @__PURE__ */ c(ge, {
|
|
718
|
-
type: "icon-yijianhuidaodibu",
|
|
652
|
+
inverse: !0,
|
|
653
|
+
endMessage: v.length > pt && // 少于一页不展示这个提示
|
|
654
|
+
((et = R.current) != null && et.scrollTop) && ((tt = R.current) == null ? void 0 : tt.scrollTop) < -10 ? /* @__PURE__ */ c(yn, {
|
|
655
|
+
plain: !0,
|
|
656
|
+
children: "没有更多数据了"
|
|
657
|
+
}) : null,
|
|
658
|
+
hasMore: $e,
|
|
659
|
+
loader: /* @__PURE__ */ c("div", {
|
|
660
|
+
style: {
|
|
661
|
+
height: "50px",
|
|
662
|
+
textAlign: "center",
|
|
663
|
+
overflow: "hidden"
|
|
664
|
+
},
|
|
665
|
+
children: /* @__PURE__ */ c(ht, {})
|
|
666
|
+
}),
|
|
667
|
+
scrollableTarget: "scrollableDiv",
|
|
668
|
+
children: [v.map((t, n) => /* @__PURE__ */ c(Vn, {
|
|
669
|
+
application: o,
|
|
670
|
+
currentSession: e,
|
|
671
|
+
history: t,
|
|
672
|
+
docViewerUrl: q,
|
|
673
|
+
isLastHistory: n === 0,
|
|
674
|
+
onRelatedClick: tn,
|
|
675
|
+
onAgainClick: nn,
|
|
676
|
+
onEditClick: en,
|
|
677
|
+
markdown: r == null ? void 0 : r.markdown
|
|
678
|
+
}, t.messageId + n)), !$e && Xe]
|
|
679
|
+
}) : /* @__PURE__ */ B("div", {
|
|
680
|
+
className: "main-empty",
|
|
681
|
+
children: [(r == null ? void 0 : r.greeting) !== !1 && /* @__PURE__ */ c(Cn, {
|
|
682
|
+
text: r === void 0 || r.greeting === !0 || ((nt = r.greeting) == null ? void 0 : nt.text) === void 0 ? yt.text : r.greeting.text,
|
|
683
|
+
icon: r === void 0 || r.greeting === !0 || ((it = r.greeting) == null ? void 0 : it.icon) === void 0 ? Ct || yt.icon : r.greeting.icon,
|
|
684
|
+
children: !!He.length && (((r == null ? void 0 : r.greeting) === void 0 || (r == null ? void 0 : r.greeting)) === !0 || typeof (r == null ? void 0 : r.greeting) == "object" && r.greeting.questions !== !1) && /* @__PURE__ */ c(Ln, {
|
|
685
|
+
ref: we,
|
|
686
|
+
sid: (ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id,
|
|
687
|
+
isRecommendClearing: Ue,
|
|
688
|
+
data: He,
|
|
689
|
+
layoutBreakpoints: typeof (r == null ? void 0 : r.greeting) == "object" ? r.greeting.layoutBreakpoints : void 0,
|
|
690
|
+
onItemClick: (t) => {
|
|
691
|
+
var a, i, l;
|
|
692
|
+
if (J(t == null ? void 0 : t.question), Y(t == null ? void 0 : t.question), Ue)
|
|
693
|
+
return;
|
|
694
|
+
t != null && t.id && _(!0);
|
|
695
|
+
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
696
|
+
g != null && g.fileUpload ? (l = (i = le.current) == null ? void 0 : i.clear()) == null || l.then(() => {
|
|
697
|
+
var s, d;
|
|
698
|
+
t != null && t.id && (n ? (s = _e(n, t)) == null || s.finally(() => {
|
|
699
|
+
_(!1);
|
|
700
|
+
}) : (_(!1), M(!0), (d = Ge()) == null || d.then((w) => {
|
|
701
|
+
var y;
|
|
702
|
+
(y = _e(w.id, t)) == null || y.finally(() => {
|
|
703
|
+
_(!1);
|
|
704
|
+
});
|
|
705
|
+
})));
|
|
706
|
+
}) : n ? _(!1) : (_(!1), M(!0), Ge());
|
|
707
|
+
}
|
|
708
|
+
})
|
|
709
|
+
}), Xe]
|
|
710
|
+
})
|
|
711
|
+
}), Ve && /* @__PURE__ */ c("div", {
|
|
712
|
+
className: "session-stop",
|
|
713
|
+
children: /* @__PURE__ */ c(X, {
|
|
714
|
+
type: "primary",
|
|
719
715
|
style: {
|
|
720
|
-
|
|
721
|
-
}
|
|
716
|
+
background: "white"
|
|
717
|
+
},
|
|
718
|
+
ghost: !0,
|
|
719
|
+
size: "small",
|
|
720
|
+
icon: /* @__PURE__ */ c(he, {
|
|
721
|
+
type: "icon-zantinghuida",
|
|
722
|
+
style: {
|
|
723
|
+
fontSize: 16
|
|
724
|
+
}
|
|
725
|
+
}),
|
|
726
|
+
onClick: () => Zt(),
|
|
727
|
+
children: "停止回答"
|
|
722
728
|
})
|
|
723
|
-
})
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
remove: () => {
|
|
736
|
-
Y(void 0);
|
|
729
|
+
}), Ae && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
|
|
730
|
+
className: "back-bottom",
|
|
731
|
+
children: /* @__PURE__ */ c(X, {
|
|
732
|
+
size: "small",
|
|
733
|
+
onClick: () => Jt({
|
|
734
|
+
behavior: "smooth"
|
|
735
|
+
}),
|
|
736
|
+
type: "link",
|
|
737
|
+
icon: /* @__PURE__ */ c(he, {
|
|
738
|
+
type: "icon-yijianhuidaodibu",
|
|
739
|
+
style: {
|
|
740
|
+
fontSize: 24
|
|
737
741
|
}
|
|
738
|
-
}
|
|
739
|
-
onUrlChange: (t) => ie(t)
|
|
742
|
+
})
|
|
740
743
|
})
|
|
741
|
-
})
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
title: /* @__PURE__ */ c("div", {
|
|
771
|
-
children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
|
|
772
|
-
}),
|
|
773
|
-
children: /* @__PURE__ */ c(G, {
|
|
744
|
+
})]
|
|
745
|
+
}), /* @__PURE__ */ c("div", {
|
|
746
|
+
className: "chat-footer",
|
|
747
|
+
children: /* @__PURE__ */ B("div", {
|
|
748
|
+
className: "chat-footer-input",
|
|
749
|
+
children: [S && /* @__PURE__ */ c("div", {
|
|
750
|
+
className: "input-files",
|
|
751
|
+
children: /* @__PURE__ */ c(xn, {
|
|
752
|
+
file: S,
|
|
753
|
+
actions: {
|
|
754
|
+
upload: Xt,
|
|
755
|
+
remove: () => {
|
|
756
|
+
W(void 0);
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
onUrlChange: (t) => oe(t)
|
|
760
|
+
})
|
|
761
|
+
}), /* @__PURE__ */ B(ge, {
|
|
762
|
+
className: "footer-upload-action",
|
|
763
|
+
onClick: (t) => t.preventDefault(),
|
|
764
|
+
children: [/* @__PURE__ */ B(ge, {
|
|
765
|
+
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(pn, {
|
|
766
|
+
disabled: !!S || D,
|
|
767
|
+
accept: ".jpg, .png, .jpeg,.bmp",
|
|
768
|
+
listType: "picture-card",
|
|
769
|
+
beforeUpload: Gt,
|
|
770
|
+
className: "footer-upload-picture",
|
|
771
|
+
showUploadList: !1,
|
|
772
|
+
children: S ? /* @__PURE__ */ c(X, {
|
|
774
773
|
type: "text",
|
|
775
774
|
className: "camera-out-btn",
|
|
776
775
|
style: {
|
|
@@ -778,145 +777,175 @@ ${t}` : t, l = new ee(i, a, X.User, n);
|
|
|
778
777
|
position: "relative",
|
|
779
778
|
bottom: "-2px"
|
|
780
779
|
},
|
|
781
|
-
|
|
782
|
-
|
|
780
|
+
disabled: !!S || D,
|
|
781
|
+
icon: /* @__PURE__ */ c(Pn, {
|
|
783
782
|
className: "icon-tianjia",
|
|
784
783
|
style: {
|
|
785
784
|
fontSize: "22px"
|
|
786
785
|
}
|
|
787
786
|
})
|
|
787
|
+
}) : /* @__PURE__ */ c(vn, {
|
|
788
|
+
placement: "topLeft",
|
|
789
|
+
overlayClassName: "footer-upload-tooltip",
|
|
790
|
+
title: /* @__PURE__ */ c("div", {
|
|
791
|
+
children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
|
|
792
|
+
}),
|
|
793
|
+
children: /* @__PURE__ */ c(X, {
|
|
794
|
+
type: "text",
|
|
795
|
+
className: "camera-out-btn",
|
|
796
|
+
style: {
|
|
797
|
+
width: "22px",
|
|
798
|
+
position: "relative",
|
|
799
|
+
bottom: "-2px"
|
|
800
|
+
},
|
|
801
|
+
icon: /* @__PURE__ */ c(he, {
|
|
802
|
+
type: "icon-Vector",
|
|
803
|
+
className: "icon-tianjia",
|
|
804
|
+
style: {
|
|
805
|
+
fontSize: "22px"
|
|
806
|
+
}
|
|
807
|
+
})
|
|
808
|
+
})
|
|
788
809
|
})
|
|
789
|
-
})
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
})
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
810
|
+
}), ye && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(On, {
|
|
811
|
+
appId: o == null ? void 0 : o.id,
|
|
812
|
+
ref: le,
|
|
813
|
+
isFirstSession: Be,
|
|
814
|
+
docViewerUrl: q,
|
|
815
|
+
onStatusChange: (t) => j(void 0, null, function* () {
|
|
816
|
+
t !== "process" ? (de(!0), Le()) : de(!1);
|
|
817
|
+
}),
|
|
818
|
+
createSession: () => new Promise((t) => {
|
|
819
|
+
M(!0), C == null || C({
|
|
820
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
821
|
+
}).then((n) => {
|
|
822
|
+
var i, l, s;
|
|
823
|
+
p == null || p(n), M(!1), P(!!((i = n.data) != null && i.netOpen)), G(!!((l = n.data) != null && l.enableNetOpen));
|
|
824
|
+
const a = ((s = n.data) == null ? void 0 : s.id) || "";
|
|
825
|
+
t(a);
|
|
826
|
+
});
|
|
827
|
+
}),
|
|
828
|
+
sid: (rt = e == null ? void 0 : e.data) == null ? void 0 : rt.id,
|
|
829
|
+
disabled: xe || D,
|
|
830
|
+
afterFileAdd: (t, n) => {
|
|
831
|
+
n && ae((a) => {
|
|
832
|
+
const i = a[n] || [];
|
|
833
|
+
return {
|
|
834
|
+
[n]: [...i, t]
|
|
835
|
+
};
|
|
836
|
+
});
|
|
837
|
+
},
|
|
838
|
+
afterFileDelete: (t) => {
|
|
839
|
+
var a;
|
|
840
|
+
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
841
|
+
n && ae((i) => {
|
|
842
|
+
const l = i[n] || [];
|
|
843
|
+
return {
|
|
844
|
+
[n]: l.filter((s) => s.id !== t)
|
|
845
|
+
};
|
|
846
|
+
});
|
|
847
|
+
},
|
|
848
|
+
onFileListChange: (t) => {
|
|
849
|
+
zt(t);
|
|
850
|
+
},
|
|
851
|
+
shouldContinue: At,
|
|
852
|
+
afterFilesClear: () => {
|
|
853
|
+
var n;
|
|
854
|
+
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
855
|
+
t && (ae({
|
|
856
|
+
[t]: []
|
|
857
|
+
}), Le());
|
|
858
|
+
}
|
|
859
|
+
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(jn, {
|
|
860
|
+
appId: o.id,
|
|
861
|
+
list: [],
|
|
862
|
+
search: Me ? Dt : "",
|
|
863
|
+
onPromptSelect: (t) => {
|
|
864
|
+
Y(t.context), J(t.context);
|
|
865
|
+
},
|
|
866
|
+
disabled: D
|
|
867
|
+
})]
|
|
868
|
+
}), /* @__PURE__ */ B(ge, {
|
|
869
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((st = o.arrange) == null ? void 0 : st.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(Mn, {
|
|
870
|
+
sessionId: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
871
|
+
netStatus: E,
|
|
872
|
+
enable: typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.diabled) == "boolean" ? !(r != null && r.connectNetwork.diabled) : Kt,
|
|
873
|
+
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
874
|
+
onNetStatusChange: (t) => {
|
|
875
|
+
rn(t);
|
|
876
|
+
}
|
|
877
|
+
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(Dn, {
|
|
878
|
+
currentSessionId: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
|
|
879
|
+
onSessionChange: (t, n) => {
|
|
880
|
+
Y(void 0), p == null || p(n);
|
|
881
|
+
},
|
|
882
|
+
disabled: D
|
|
883
|
+
}), Et && Pt === "float" && /* @__PURE__ */ c(Hn, {
|
|
884
|
+
currentSession: e,
|
|
885
|
+
application: o,
|
|
886
|
+
networkStatus: E,
|
|
887
|
+
setCurrentSession: p,
|
|
888
|
+
sessions: bt,
|
|
889
|
+
setSessions: wt,
|
|
890
|
+
disabled: D
|
|
891
|
+
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(X, {
|
|
892
|
+
icon: /* @__PURE__ */ c(Tn, {}),
|
|
893
|
+
className: "add-btn",
|
|
894
|
+
type: "primary",
|
|
895
|
+
disabled: Ve || !e || !v.length || D,
|
|
896
|
+
onClick: () => {
|
|
897
|
+
var t, n;
|
|
898
|
+
p == null || p(null), P(!1), (t = je.current) == null || t.clear(), (n = we.current) == null || n.clear();
|
|
899
|
+
},
|
|
900
|
+
children: "新会话"
|
|
901
|
+
})]
|
|
847
902
|
})]
|
|
848
|
-
}), /* @__PURE__ */
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
903
|
+
}), /* @__PURE__ */ c("div", {
|
|
904
|
+
className: "footer-textarea",
|
|
905
|
+
children: /* @__PURE__ */ c(Nn, {
|
|
906
|
+
ref: re,
|
|
907
|
+
maxLength: Tt,
|
|
908
|
+
text: Ut,
|
|
909
|
+
networkStatus: !1,
|
|
910
|
+
loading: qe,
|
|
911
|
+
disabled: Fe || De || D || qe,
|
|
912
|
+
onTextSend: Ke,
|
|
913
|
+
onChange: (t, n) => {
|
|
914
|
+
Y(t);
|
|
915
|
+
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
916
|
+
J(a), Ht(a), Me || Rt(!0);
|
|
861
917
|
},
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
className: "footer-textarea",
|
|
877
|
-
children: /* @__PURE__ */ c(fn, {
|
|
878
|
-
ref: ke,
|
|
879
|
-
maxLength: vt,
|
|
880
|
-
text: Nt,
|
|
881
|
-
networkStatus: !1,
|
|
882
|
-
loading: Be,
|
|
883
|
-
disabled: Te || Fe || H || Be,
|
|
884
|
-
onTextSend: $e,
|
|
885
|
-
onChange: (t, n) => {
|
|
886
|
-
Q(t);
|
|
887
|
-
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
888
|
-
te(a), It(a), He || wt(!0);
|
|
889
|
-
},
|
|
890
|
-
clearAction: /* @__PURE__ */ c(ce, {
|
|
891
|
-
size: 0,
|
|
892
|
-
children: /* @__PURE__ */ c(G, {
|
|
893
|
-
type: "link",
|
|
894
|
-
disabled: we || H,
|
|
895
|
-
ghost: !0,
|
|
896
|
-
icon: /* @__PURE__ */ c(ge, {
|
|
897
|
-
style: {
|
|
898
|
-
fontSize: 22
|
|
899
|
-
},
|
|
900
|
-
type: "icon-qingchujiyi"
|
|
901
|
-
}),
|
|
902
|
-
onClick: () => Ut()
|
|
918
|
+
clearAction: /* @__PURE__ */ c(ge, {
|
|
919
|
+
size: 0,
|
|
920
|
+
children: /* @__PURE__ */ c(X, {
|
|
921
|
+
type: "link",
|
|
922
|
+
disabled: xe || D,
|
|
923
|
+
ghost: !0,
|
|
924
|
+
icon: /* @__PURE__ */ c(he, {
|
|
925
|
+
style: {
|
|
926
|
+
fontSize: 22
|
|
927
|
+
},
|
|
928
|
+
type: "icon-qingchujiyi"
|
|
929
|
+
}),
|
|
930
|
+
onClick: () => Qt()
|
|
931
|
+
})
|
|
903
932
|
})
|
|
904
933
|
})
|
|
905
|
-
})
|
|
906
|
-
})
|
|
907
|
-
})
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
})
|
|
934
|
+
})]
|
|
935
|
+
})
|
|
936
|
+
}), /* @__PURE__ */ c(En, {
|
|
937
|
+
tips: Nt
|
|
938
|
+
}), ze && /* @__PURE__ */ c(Fn, {
|
|
939
|
+
isvisible: ze,
|
|
940
|
+
files: jt,
|
|
941
|
+
sessionId: (dt = e == null ? void 0 : e.data) == null ? void 0 : dt.id,
|
|
942
|
+
onClose: (t) => {
|
|
943
|
+
Mt(!1), Bt(!1);
|
|
944
|
+
}
|
|
945
|
+
})]
|
|
946
|
+
})
|
|
918
947
|
});
|
|
919
|
-
};
|
|
948
|
+
});
|
|
920
949
|
export {
|
|
921
|
-
|
|
950
|
+
yi as default
|
|
922
951
|
};
|