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