@glodon-aiot/agent-cli-ui 3.2.2-beta.2 → 3.2.2-beta.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.
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
var $t = Object.defineProperty, At = Object.defineProperties;
|
|
2
2
|
var Bt = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var Se = Object.getOwnPropertySymbols;
|
|
4
4
|
var qt = Object.prototype.hasOwnProperty, Kt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var ke = (x, o,
|
|
6
|
-
for (var
|
|
7
|
-
qt.call(o,
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
Kt.call(o,
|
|
5
|
+
var ke = (x, o, m) => o in x ? $t(x, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : x[o] = m, we = (x, o) => {
|
|
6
|
+
for (var m in o || (o = {}))
|
|
7
|
+
qt.call(o, m) && ke(x, m, o[m]);
|
|
8
|
+
if (Se)
|
|
9
|
+
for (var m of Se(o))
|
|
10
|
+
Kt.call(o, m) && ke(x, m, o[m]);
|
|
11
11
|
return x;
|
|
12
12
|
}, be = (x, o) => At(x, Bt(o));
|
|
13
|
-
var P = (x, o,
|
|
14
|
-
var U = (x, o,
|
|
15
|
-
var re = (
|
|
13
|
+
var P = (x, o, m) => (ke(x, typeof o != "symbol" ? o + "" : o, m), m);
|
|
14
|
+
var U = (x, o, m) => new Promise((e, w) => {
|
|
15
|
+
var re = (b) => {
|
|
16
16
|
try {
|
|
17
|
-
D(
|
|
17
|
+
D(m.next(b));
|
|
18
18
|
} catch (u) {
|
|
19
|
-
|
|
19
|
+
w(u);
|
|
20
20
|
}
|
|
21
|
-
}, v = (
|
|
21
|
+
}, v = (b) => {
|
|
22
22
|
try {
|
|
23
|
-
D(
|
|
23
|
+
D(m.throw(b));
|
|
24
24
|
} catch (u) {
|
|
25
|
-
|
|
25
|
+
w(u);
|
|
26
26
|
}
|
|
27
|
-
}, D = (
|
|
28
|
-
D((
|
|
27
|
+
}, D = (b) => b.done ? e(b.value) : Promise.resolve(b.value).then(re, v);
|
|
28
|
+
D((m = m.apply(x, o)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as
|
|
30
|
+
import { jsx as d, jsxs as $ } from "../../_virtual/jsx-runtime.mjs";
|
|
31
31
|
import { memo as Yt, useState as p, useRef as A, useContext as Wt, useEffect as N, useMemo as Qt } from "react";
|
|
32
32
|
import "./style.less.mjs";
|
|
33
|
-
import { Divider as _t, Spin as Gt, Button as
|
|
33
|
+
import { Divider as _t, Spin as Gt, Button as Q, Space as ae, Upload as Xt, Tooltip as Zt, message as R, notification as Jt } from "antd";
|
|
34
34
|
import xe from "../../Iconfont/index.mjs";
|
|
35
|
-
import { IHistoryRole as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
35
|
+
import { IHistoryRole as _, ChatMessageRole as et } from "@glodon-aiot/apis";
|
|
36
|
+
import it from "../HistoryItem/index.mjs";
|
|
37
|
+
import ot from "dayjs";
|
|
38
38
|
import St from "../../context.mjs";
|
|
39
39
|
import { MB as en } from "../../constant.mjs";
|
|
40
40
|
import tn from "../FilePreview/index.mjs";
|
|
@@ -44,7 +44,7 @@ import sn from "../Recommend/index.mjs";
|
|
|
44
44
|
import ln from "../Greeting/index.mjs";
|
|
45
45
|
import an from "../PromptManager/index.mjs";
|
|
46
46
|
import rn from "../../Footer/index.mjs";
|
|
47
|
-
import { CameraOutlined as
|
|
47
|
+
import { CameraOutlined as tt, PlusOutlined as dn } from "@ant-design/icons";
|
|
48
48
|
import cn from "../UploadKnowledgeFiles/index.mjs";
|
|
49
49
|
import fn from "../UploadingPrompt/index.mjs";
|
|
50
50
|
import un from "../PromptSetting/index.mjs";
|
|
@@ -53,13 +53,13 @@ import pn from "../SessionListDrawer/index.mjs";
|
|
|
53
53
|
import hn from "../../node_modules/react-infinite-scroll-component/dist/index.es.mjs";
|
|
54
54
|
import gn from "../ConnectToNetwork/index.mjs";
|
|
55
55
|
import mn from "../../assets/icon.svg.mjs";
|
|
56
|
-
import
|
|
57
|
-
const yn = Yt(
|
|
56
|
+
import st from "../../packages/agent-cli-ui/node_modules/uuid/dist/esm-browser/v4.mjs";
|
|
57
|
+
const yn = Yt(it), vn = {
|
|
58
58
|
icon: mn,
|
|
59
59
|
text: "今天我能帮你什么?"
|
|
60
60
|
};
|
|
61
61
|
class Z {
|
|
62
|
-
constructor(o,
|
|
62
|
+
constructor(o, m, e, w) {
|
|
63
63
|
P(this, "messageTime");
|
|
64
64
|
P(this, "isWaiting");
|
|
65
65
|
P(this, "messageId");
|
|
@@ -69,36 +69,36 @@ class Z {
|
|
|
69
69
|
P(this, "isSensitive");
|
|
70
70
|
P(this, "isSuspend");
|
|
71
71
|
P(this, "comment");
|
|
72
|
-
this.content = o, this.sessionId =
|
|
72
|
+
this.content = o, this.sessionId = m, this.role = e, this.files = w, this.content = o, this.role = e, this.sessionId = m, this.files = w, this.messageTime = ot(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = st(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
73
73
|
isAgree: 0
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
var
|
|
77
|
+
const nt = 10, Qn = (x) => {
|
|
78
|
+
var qe, Ke, Ye, We, Qe, _e, Ge, Xe, Ze;
|
|
79
79
|
const {
|
|
80
80
|
application: o,
|
|
81
|
-
docViewerUrl:
|
|
81
|
+
docViewerUrl: m = "",
|
|
82
82
|
currentSession: e,
|
|
83
|
-
onCreateSession:
|
|
83
|
+
onCreateSession: w,
|
|
84
84
|
embeddingService: re,
|
|
85
85
|
setCurrentSession: v,
|
|
86
86
|
networkStatus: D,
|
|
87
|
-
setNetworkStatus:
|
|
88
|
-
} = x, [u, I] = p([]), [
|
|
87
|
+
setNetworkStatus: b
|
|
88
|
+
} = x, [u, I] = p([]), [lt, J] = p(), [de, Le] = p(), E = A(null), {
|
|
89
89
|
service: C,
|
|
90
90
|
agentClient: L,
|
|
91
|
-
depId:
|
|
92
|
-
footer:
|
|
91
|
+
depId: at,
|
|
92
|
+
footer: rt,
|
|
93
93
|
transform: c,
|
|
94
94
|
defaultInput: ce,
|
|
95
95
|
onMessage: S,
|
|
96
96
|
onHistoryLoad: Ce,
|
|
97
97
|
beforeMessageSend: z,
|
|
98
|
-
bodyStyle:
|
|
98
|
+
bodyStyle: dt,
|
|
99
99
|
disabled: H,
|
|
100
100
|
features: f
|
|
101
|
-
} = Wt(St), [Ne, fe] = p(!1), h = A(u), Fe = A(), [
|
|
101
|
+
} = Wt(St), [Ne, fe] = p(!1), h = A(u), Fe = A(), [ct, ft] = p(0), [G, B] = p(), [q, ee] = p(""), [Te, ue] = p(!1), pe = A(null), [Ee, ut] = p([]), [Pe, K] = p(!1), [Re, pt] = p(!1), [ht, gt] = p(""), [mt, Y] = p(), [te, ne] = p({}), ie = A(null), De = A(null), he = A(null), [He, yt] = p(!1), [vt, kt] = p([]), [wt, oe] = p(!0), [bt, xt] = p(!0), [Me, M] = p(!1), [ge, j] = p(!1), [Oe, It] = p(!1), [F, se] = p(typeof (f == null ? void 0 : f.promptVariables) == "object" ? f.promptVariables.default || [] : []), [Lt, Ct] = p(typeof (f == null ? void 0 : f.knowledges) == "object" && f.knowledges.default || void 0), [Ue, O] = p(!1), [ze, X] = p(!1), [Nt, W] = p(typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.default) == "boolean" ? f.connectNetwork.default : !1), [je, le] = p(!1);
|
|
102
102
|
N(() => {
|
|
103
103
|
var l, i;
|
|
104
104
|
e && (h.current = []), I([]);
|
|
@@ -108,7 +108,7 @@ const tt = 10, Qn = (x) => {
|
|
|
108
108
|
}), !((l = e == null ? void 0 : e.data) != null && l.id))
|
|
109
109
|
return;
|
|
110
110
|
if (j(!1), M(!1), (i = e.messages) != null && i.length) {
|
|
111
|
-
const s = [...e.messages.filter((
|
|
111
|
+
const s = [...e.messages.filter((r) => r == null ? void 0 : r.messageId)].reverse();
|
|
112
112
|
h.current = [...s], I([...s]);
|
|
113
113
|
}
|
|
114
114
|
const n = (a) => {
|
|
@@ -125,7 +125,7 @@ const tt = 10, Qn = (x) => {
|
|
|
125
125
|
}, [e]), N(() => {
|
|
126
126
|
const t = () => {
|
|
127
127
|
var n;
|
|
128
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && se(e.promptVariables.sort((l, i) => l.key.localeCompare(i.key))), e.knowledges &&
|
|
128
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && se(e.promptVariables.sort((l, i) => l.key.localeCompare(i.key))), e.knowledges && Ct(e.knowledges), b(e.netOpen));
|
|
129
129
|
};
|
|
130
130
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
131
131
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -141,7 +141,7 @@ const tt = 10, Qn = (x) => {
|
|
|
141
141
|
e == null || e.removeEventListener("error", t);
|
|
142
142
|
};
|
|
143
143
|
}, [e]);
|
|
144
|
-
const
|
|
144
|
+
const Ft = () => {
|
|
145
145
|
var l;
|
|
146
146
|
if (!((l = e == null ? void 0 : e.data) != null && l.id) || !(o != null && o.id))
|
|
147
147
|
return;
|
|
@@ -149,20 +149,20 @@ const tt = 10, Qn = (x) => {
|
|
|
149
149
|
if (n && n.isContext)
|
|
150
150
|
return R.success("已开启新话题");
|
|
151
151
|
e.clear().then(() => {
|
|
152
|
-
const i = new Z("", t,
|
|
152
|
+
const i = new Z("", t, _.System);
|
|
153
153
|
i.isContext = !0, I([i, ...u]);
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
156
|
N(() => {
|
|
157
157
|
o != null && o.id && (C == null || C.getRecommendQues(o.id).then((t) => {
|
|
158
|
-
|
|
158
|
+
ut(t);
|
|
159
159
|
}));
|
|
160
|
-
}, [
|
|
160
|
+
}, [at, o]);
|
|
161
161
|
const Ve = (t) => U(void 0, null, function* () {
|
|
162
|
-
var
|
|
162
|
+
var k, g;
|
|
163
163
|
if (H)
|
|
164
164
|
return R.error("发送功能被禁用");
|
|
165
|
-
const n = t ||
|
|
165
|
+
const n = t || lt;
|
|
166
166
|
if (!(n != null && n.trim()))
|
|
167
167
|
return R.error("请输入你想问的");
|
|
168
168
|
if (!(F == null ? void 0 : F.every((y) => !!(y != null && y.value)))) {
|
|
@@ -174,18 +174,18 @@ const tt = 10, Qn = (x) => {
|
|
|
174
174
|
return R.error("正在回复中");
|
|
175
175
|
if (Ne)
|
|
176
176
|
return R.error("等待初始化");
|
|
177
|
-
if (!
|
|
177
|
+
if (!wt)
|
|
178
178
|
return R.error("正在解析文件");
|
|
179
179
|
if (Te)
|
|
180
180
|
return R.error("正在上传图片");
|
|
181
181
|
B(void 0), ee("");
|
|
182
|
-
const i = (
|
|
182
|
+
const i = (k = e == null ? void 0 : e.data) == null ? void 0 : k.id;
|
|
183
183
|
if (!i) {
|
|
184
|
-
|
|
184
|
+
w == null || w({
|
|
185
185
|
netOpen: D ? 1 : 2
|
|
186
186
|
}).then((y) => {
|
|
187
187
|
var T, V;
|
|
188
|
-
O(!0),
|
|
188
|
+
O(!0), b(!!((T = y.data) != null && T.netOpen)), W(!!((V = y.data) != null && V.enableNetOpen)), Tt(y).then(() => {
|
|
189
189
|
v == null || v(y), O(!1), Le(n);
|
|
190
190
|
});
|
|
191
191
|
});
|
|
@@ -202,7 +202,7 @@ ${n}` : n;
|
|
|
202
202
|
message: {
|
|
203
203
|
content: a,
|
|
204
204
|
sessionId: i,
|
|
205
|
-
role:
|
|
205
|
+
role: et.User,
|
|
206
206
|
files: te[i]
|
|
207
207
|
}
|
|
208
208
|
}) : s = !0;
|
|
@@ -211,31 +211,31 @@ ${n}` : n;
|
|
|
211
211
|
}
|
|
212
212
|
if (le(!1), s === !1)
|
|
213
213
|
return;
|
|
214
|
-
let
|
|
215
|
-
typeof s == "object" && (
|
|
216
|
-
}),
|
|
217
|
-
const s = (t == null ? void 0 : t.promptVariables).filter((
|
|
218
|
-
var
|
|
219
|
-
const
|
|
220
|
-
return
|
|
214
|
+
let r = n;
|
|
215
|
+
typeof s == "object" && (r = s.content || n), ((g = te[i]) == null ? void 0 : g.length) > 0 ? Et(r) : me(r);
|
|
216
|
+
}), Tt = (t) => new Promise((n, l) => U(void 0, null, function* () {
|
|
217
|
+
const s = (t == null ? void 0 : t.promptVariables).filter((r) => r.key !== "query").map((r) => {
|
|
218
|
+
var g;
|
|
219
|
+
const k = (g = F.find((y) => y.key === r.key)) == null ? void 0 : g.value;
|
|
220
|
+
return r.value = k || "", r;
|
|
221
221
|
});
|
|
222
|
-
se(s.sort((
|
|
223
|
-
})),
|
|
224
|
-
var s,
|
|
222
|
+
se(s.sort((r, k) => r.key.localeCompare(k.key))), yield t == null ? void 0 : t.setPromptVariables(s), n();
|
|
223
|
+
})), Et = (t) => {
|
|
224
|
+
var s, r, k;
|
|
225
225
|
if (oe(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
|
|
226
226
|
return;
|
|
227
|
-
const n = ((
|
|
227
|
+
const n = ((r = e.data) == null ? void 0 : r.id) || "", l = [];
|
|
228
228
|
let i = [], a = /* @__PURE__ */ new Set();
|
|
229
|
-
(
|
|
230
|
-
a.has(
|
|
231
|
-
}), Promise.all(i.map((
|
|
229
|
+
(k = te[n]) == null || k.forEach((g) => {
|
|
230
|
+
a.has(g.id) || (i.push(g), a.add(g.id));
|
|
231
|
+
}), Promise.all(i.map((g) => C == null ? void 0 : C.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, g.id, {
|
|
232
232
|
enabled: 1
|
|
233
233
|
}).then((y) => {
|
|
234
|
-
l.push(
|
|
235
|
-
}))).then((
|
|
234
|
+
l.push(g);
|
|
235
|
+
}))).then((g) => {
|
|
236
236
|
oe(!0), me(t, l);
|
|
237
|
-
}).catch((
|
|
238
|
-
throw Error(
|
|
237
|
+
}).catch((g) => {
|
|
238
|
+
throw Error(g);
|
|
239
239
|
});
|
|
240
240
|
};
|
|
241
241
|
N(() => {
|
|
@@ -253,7 +253,7 @@ ${t}` : t;
|
|
|
253
253
|
message: {
|
|
254
254
|
content: l,
|
|
255
255
|
sessionId: e.id,
|
|
256
|
-
role:
|
|
256
|
+
role: et.User,
|
|
257
257
|
files: te[e.id]
|
|
258
258
|
}
|
|
259
259
|
}) : i = !0;
|
|
@@ -267,36 +267,36 @@ ${t}` : t;
|
|
|
267
267
|
};
|
|
268
268
|
}, [de, e]);
|
|
269
269
|
const me = (t, n) => U(void 0, null, function* () {
|
|
270
|
-
var
|
|
271
|
-
const l = (
|
|
270
|
+
var g, y;
|
|
271
|
+
const l = (g = e == null ? void 0 : e.data) == null ? void 0 : g.id;
|
|
272
272
|
if (!l)
|
|
273
273
|
return;
|
|
274
274
|
j(!0), M(!0);
|
|
275
275
|
const i = q ? `
|
|
276
|
-
${t}` : t, a = new Z(i, l,
|
|
277
|
-
J(void 0),
|
|
276
|
+
${t}` : t, a = new Z(i, l, _.User, n);
|
|
277
|
+
J(void 0), Y(void 0), h.current = [a, ...u], I(h.current), o.id && S && S({
|
|
278
278
|
applicationId: o.id,
|
|
279
279
|
sessionId: l,
|
|
280
280
|
message: a
|
|
281
281
|
});
|
|
282
|
-
const s = new Z("", l,
|
|
282
|
+
const s = new Z("", l, _.System);
|
|
283
283
|
s.isWaiting = !0, h.current = [s, ...h.current], I(h.current);
|
|
284
|
-
const
|
|
284
|
+
const r = (n == null ? void 0 : n.map((T) => T.id)) || [], k = {
|
|
285
285
|
stream: !0,
|
|
286
286
|
referenceFirst: !1
|
|
287
287
|
};
|
|
288
288
|
if (c != null && c.promptVariables) {
|
|
289
|
-
const T = F == null ? void 0 : F.reduce((V,
|
|
290
|
-
|
|
289
|
+
const T = F == null ? void 0 : F.reduce((V, Je) => (V[Je.key] = Je.value, V), {});
|
|
290
|
+
k.formatValues = T, e.setPromptVariables(F);
|
|
291
291
|
}
|
|
292
292
|
if (c != null && c.knowledges) {
|
|
293
|
-
const T =
|
|
294
|
-
|
|
293
|
+
const T = Lt;
|
|
294
|
+
k.knowledges = T, e.setKnowledges(T);
|
|
295
295
|
}
|
|
296
296
|
yield e.send({
|
|
297
297
|
text: i,
|
|
298
|
-
fileIds:
|
|
299
|
-
},
|
|
298
|
+
fileIds: r
|
|
299
|
+
}, k), ne({
|
|
300
300
|
[l]: []
|
|
301
301
|
}), (y = ie.current) == null || y.update();
|
|
302
302
|
});
|
|
@@ -306,14 +306,14 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
306
306
|
if (!t)
|
|
307
307
|
return;
|
|
308
308
|
const n = (i) => {
|
|
309
|
-
if (!i.sessionId || i.sessionId && i.sessionId !== Fe.current || i.role ===
|
|
309
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Fe.current || i.role === _.User)
|
|
310
310
|
return;
|
|
311
|
-
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (M(!1), j(!1), h.current = h.current.filter((
|
|
311
|
+
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (M(!1), j(!1), h.current = h.current.filter((r) => !r.isWaiting), I([...h.current]), h.current = [...h.current], i.content))
|
|
312
312
|
return Jt.error({
|
|
313
313
|
message: i.content
|
|
314
314
|
});
|
|
315
|
-
const a = i.actions || [], s = new Z(i.content, t,
|
|
316
|
-
s.messageId = i.messageId, s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = a, s.isLoading = !0, h.current = h.current.filter((
|
|
315
|
+
const a = i.actions || [], s = new Z(i.content, t, _.Robot);
|
|
316
|
+
s.messageId = i.messageId, s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = a, s.isLoading = !0, h.current = h.current.filter((r) => !r.isWaiting).filter((r) => !r.isReplying), i.index === void 0 && I([s, ...h.current]), i.code === 11915 && (M(!1), j(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, I([s, ...h.current])), i.index === -2 && (M(!1), j(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, I([s, ...h.current])), i.index === -1 && (M(!1), j(!1), s.isLoading = !1, s.reference = i.reference, I([s, ...h.current]), o.id && S && S({
|
|
317
317
|
applicationId: o.id,
|
|
318
318
|
sessionId: t,
|
|
319
319
|
message: s
|
|
@@ -339,21 +339,21 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
339
339
|
if (!L)
|
|
340
340
|
return;
|
|
341
341
|
const t = L.questionContextMaxLength || 4e3;
|
|
342
|
-
|
|
342
|
+
ft(t);
|
|
343
343
|
}, [L, C]), N(() => {
|
|
344
|
-
ce &&
|
|
344
|
+
ce && Y(ce.text);
|
|
345
345
|
}, [ce]);
|
|
346
|
-
const
|
|
346
|
+
const Pt = (t) => {
|
|
347
347
|
const n = t.size;
|
|
348
348
|
return n <= 0 ? (R.error("该文件为空,请重新上传"), !1) : n > 20 * en ? (R.error("图片须小于20M"), !1) : (B(t), !1);
|
|
349
|
-
},
|
|
349
|
+
}, Rt = (t) => U(void 0, null, function* () {
|
|
350
350
|
var n;
|
|
351
351
|
return B(t), (n = e == null ? void 0 : e.data) != null && n.id ? $e(e, t) : new Promise((l) => {
|
|
352
|
-
O(!0),
|
|
352
|
+
O(!0), w == null || w({
|
|
353
353
|
netOpen: D ? 1 : 2
|
|
354
354
|
}).then((i) => {
|
|
355
355
|
var a, s;
|
|
356
|
-
v == null || v(i), O(!1),
|
|
356
|
+
v == null || v(i), O(!1), b(!!((a = i.data) != null && a.netOpen)), W(!!((s = i.data) != null && s.enableNetOpen)), l($e(i, t));
|
|
357
357
|
});
|
|
358
358
|
});
|
|
359
359
|
}), $e = (t, n) => {
|
|
@@ -361,16 +361,16 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
361
361
|
return new Promise((i) => {
|
|
362
362
|
var s;
|
|
363
363
|
const a = {
|
|
364
|
-
files: [`${
|
|
364
|
+
files: [`${st()}.${l}`],
|
|
365
365
|
isv: "minio",
|
|
366
366
|
knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
|
|
367
367
|
type: 1
|
|
368
368
|
};
|
|
369
|
-
ue(!0), C == null || C.postTicket(a).then((
|
|
370
|
-
C.uploadMinioFile(
|
|
369
|
+
ue(!0), C == null || C.postTicket(a).then((r) => {
|
|
370
|
+
C.uploadMinioFile(r.minio, n).then(() => {
|
|
371
371
|
var T, V;
|
|
372
|
-
const
|
|
373
|
-
i(`${location.protocol}//${
|
|
372
|
+
const k = (T = r.minio.endpoints) == null ? void 0 : T[0], g = r.minio.bucket, y = (V = r.minio.fileKeys) == null ? void 0 : V[0];
|
|
373
|
+
i(`${location.protocol}//${k}/${g}/${y}`);
|
|
374
374
|
}).catch(() => {
|
|
375
375
|
ee(""), B(void 0);
|
|
376
376
|
}).finally(() => {
|
|
@@ -387,15 +387,15 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
387
387
|
top: t.scrollHeight
|
|
388
388
|
});
|
|
389
389
|
}, [u]);
|
|
390
|
-
const
|
|
390
|
+
const Ae = (t, n) => new Promise((l) => {
|
|
391
391
|
if (!n.file.url || !(o != null && o.id))
|
|
392
392
|
return l();
|
|
393
393
|
const i = be(we({}, n.file), {
|
|
394
394
|
type: 1
|
|
395
395
|
});
|
|
396
|
-
C == null || C.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
396
|
+
console.log("fileParams", i), C == null || C.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
397
397
|
var a;
|
|
398
|
-
(a = ie.current) == null || a.update().finally(l);
|
|
398
|
+
console.log("uploadRef.current?.update"), (a = ie.current) == null || a.update().finally(l);
|
|
399
399
|
});
|
|
400
400
|
}), Dt = () => {
|
|
401
401
|
var t;
|
|
@@ -412,7 +412,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
412
412
|
if (!E.current)
|
|
413
413
|
return;
|
|
414
414
|
const t = E.current.scrollTop <= -80;
|
|
415
|
-
|
|
415
|
+
It(t);
|
|
416
416
|
}, Ot = Ie((t) => {
|
|
417
417
|
var n, l;
|
|
418
418
|
(n = pe.current) == null || n.update(t), (l = pe.current) == null || l.focus();
|
|
@@ -423,7 +423,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
423
423
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
424
424
|
return;
|
|
425
425
|
h.current = [...u.slice(1, u.length)], I(h.current);
|
|
426
|
-
const t = new Z("", e.data.id,
|
|
426
|
+
const t = new Z("", e.data.id, _.System);
|
|
427
427
|
t.isWaiting = !0, h.current = [t, ...h.current], I(h.current), j(!0), M(!0), e.answerAgain();
|
|
428
428
|
});
|
|
429
429
|
N(() => {
|
|
@@ -437,7 +437,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
437
437
|
const n = u[u.length - 1].messageTime;
|
|
438
438
|
e.fetchMessages({
|
|
439
439
|
endTime: n,
|
|
440
|
-
pageSize:
|
|
440
|
+
pageSize: nt
|
|
441
441
|
}).then((i) => {
|
|
442
442
|
const a = i || [];
|
|
443
443
|
if (!a || !(a != null && a.length)) {
|
|
@@ -449,17 +449,17 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
449
449
|
}, Vt = (t) => U(void 0, null, function* () {
|
|
450
450
|
var n, l;
|
|
451
451
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
452
|
-
|
|
452
|
+
b(t);
|
|
453
453
|
else {
|
|
454
454
|
if (yield e.setNetOpen(t), !((l = e.data) != null && l.id))
|
|
455
455
|
return;
|
|
456
|
-
|
|
456
|
+
b(t);
|
|
457
457
|
}
|
|
458
458
|
}), ye = () => U(void 0, null, function* () {
|
|
459
459
|
e ? e.fetchData().then((t) => {
|
|
460
460
|
var n;
|
|
461
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (
|
|
462
|
-
}) : (
|
|
461
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (b(t.netOpen), W(t.enableNetOpen));
|
|
462
|
+
}) : (b(!1), W(o.arrange[0].enableNetOpen));
|
|
463
463
|
});
|
|
464
464
|
N(() => {
|
|
465
465
|
ye();
|
|
@@ -488,13 +488,13 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
488
488
|
(a) => a.key !== "query" && a.status === 1
|
|
489
489
|
// 只要求输入被引用的变量
|
|
490
490
|
).map((a, s) => {
|
|
491
|
-
var
|
|
492
|
-
let
|
|
493
|
-
return typeof (f == null ? void 0 : f.promptVariables) == "object" && (
|
|
491
|
+
var k, g;
|
|
492
|
+
let r = "";
|
|
493
|
+
return typeof (f == null ? void 0 : f.promptVariables) == "object" && (r = ((g = (k = f.promptVariables.default) == null ? void 0 : k.find((y) => y.key === a.key)) == null ? void 0 : g.value) || ""), {
|
|
494
494
|
id: s + "",
|
|
495
495
|
key: a.key,
|
|
496
496
|
name: a.name,
|
|
497
|
-
value:
|
|
497
|
+
value: r
|
|
498
498
|
};
|
|
499
499
|
});
|
|
500
500
|
se([...i].sort((a, s) => a.key.localeCompare(s.key)));
|
|
@@ -503,16 +503,14 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
503
503
|
L == null || L.removeEventListener("ready", t);
|
|
504
504
|
};
|
|
505
505
|
}, [e, L, f == null ? void 0 : f.promptVariables]);
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
});
|
|
513
|
-
}, ve = Qt(() => {
|
|
506
|
+
const Be = () => w == null ? void 0 : w({
|
|
507
|
+
netOpen: D ? 1 : 2
|
|
508
|
+
}).then((t) => {
|
|
509
|
+
var n, l;
|
|
510
|
+
return v == null || v(t), O(!1), b(!!((n = t.data) != null && n.netOpen)), W(!!((l = t.data) != null && l.enableNetOpen)), t;
|
|
511
|
+
}), ve = Qt(() => {
|
|
514
512
|
var t;
|
|
515
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */
|
|
513
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(it, {
|
|
516
514
|
application: o,
|
|
517
515
|
history: {
|
|
518
516
|
role: 1,
|
|
@@ -522,7 +520,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
522
520
|
sessionId: "",
|
|
523
521
|
reference: [],
|
|
524
522
|
searchReference: [],
|
|
525
|
-
messageTime:
|
|
523
|
+
messageTime: ot(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
526
524
|
actions: [],
|
|
527
525
|
isLoading: !1
|
|
528
526
|
},
|
|
@@ -531,7 +529,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
531
529
|
}, [o == null ? void 0 : o.arrange, u]);
|
|
532
530
|
return console.log("openingMessage", ve), /* @__PURE__ */ $("div", {
|
|
533
531
|
className: "agent-chat",
|
|
534
|
-
children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */
|
|
532
|
+
children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ d(un, {
|
|
535
533
|
ref: De,
|
|
536
534
|
appId: o.id,
|
|
537
535
|
currentSession: e,
|
|
@@ -541,8 +539,8 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
541
539
|
}), /* @__PURE__ */ $("div", {
|
|
542
540
|
className: "chat-main",
|
|
543
541
|
id: "chat-main",
|
|
544
|
-
style:
|
|
545
|
-
children: [/* @__PURE__ */
|
|
542
|
+
style: dt,
|
|
543
|
+
children: [/* @__PURE__ */ d("div", {
|
|
546
544
|
className: "chat-main-wrapper",
|
|
547
545
|
id: "scrollableDiv",
|
|
548
546
|
style: {
|
|
@@ -553,7 +551,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
553
551
|
},
|
|
554
552
|
ref: E,
|
|
555
553
|
onScroll: Mt,
|
|
556
|
-
children: (
|
|
554
|
+
children: (qe = e == null ? void 0 : e.data) != null && qe.id && (u != null && u.length) ? /* @__PURE__ */ $(hn, {
|
|
557
555
|
dataLength: u.length,
|
|
558
556
|
next: jt,
|
|
559
557
|
style: {
|
|
@@ -562,26 +560,26 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
562
560
|
overflowX: "hidden"
|
|
563
561
|
},
|
|
564
562
|
inverse: !0,
|
|
565
|
-
endMessage: u.length >
|
|
566
|
-
((
|
|
563
|
+
endMessage: u.length > nt && // 少于一页不展示这个提示
|
|
564
|
+
((Ke = E.current) != null && Ke.scrollTop) && ((Ye = E.current) == null ? void 0 : Ye.scrollTop) < -10 ? /* @__PURE__ */ d(_t, {
|
|
567
565
|
plain: !0,
|
|
568
566
|
children: "没有更多数据了"
|
|
569
567
|
}) : null,
|
|
570
568
|
hasMore: ze,
|
|
571
|
-
loader: /* @__PURE__ */
|
|
569
|
+
loader: /* @__PURE__ */ d("div", {
|
|
572
570
|
style: {
|
|
573
571
|
height: "50px",
|
|
574
572
|
textAlign: "center",
|
|
575
573
|
overflow: "hidden"
|
|
576
574
|
},
|
|
577
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */ d(Gt, {})
|
|
578
576
|
}),
|
|
579
577
|
scrollableTarget: "scrollableDiv",
|
|
580
|
-
children: [u.map((t, n) => /* @__PURE__ */
|
|
578
|
+
children: [u.map((t, n) => /* @__PURE__ */ d(yn, {
|
|
581
579
|
application: o,
|
|
582
580
|
currentSession: e,
|
|
583
581
|
history: t,
|
|
584
|
-
docViewerUrl:
|
|
582
|
+
docViewerUrl: m,
|
|
585
583
|
isLastHistory: n === 0,
|
|
586
584
|
onRelatedClick: Ut,
|
|
587
585
|
onAgainClick: zt,
|
|
@@ -589,38 +587,43 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
589
587
|
}, t.messageId + n)), !ze && ve]
|
|
590
588
|
}) : /* @__PURE__ */ $("div", {
|
|
591
589
|
className: "main-empty",
|
|
592
|
-
children: [/* @__PURE__ */
|
|
593
|
-
children: !!Ee.length && /* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ d(ln, be(we({}, vn), {
|
|
591
|
+
children: !!Ee.length && /* @__PURE__ */ d(sn, {
|
|
594
592
|
ref: he,
|
|
595
|
-
sid: (
|
|
593
|
+
sid: (We = e == null ? void 0 : e.data) == null ? void 0 : We.id,
|
|
596
594
|
isRecommendClearing: Pe,
|
|
597
595
|
data: Ee,
|
|
598
596
|
onItemClick: (t) => {
|
|
599
597
|
var l, i, a;
|
|
600
|
-
if (J(t == null ? void 0 : t.question),
|
|
598
|
+
if (J(t == null ? void 0 : t.question), Y(t == null ? void 0 : t.question), Pe)
|
|
601
599
|
return;
|
|
602
|
-
t != null && t.id &&
|
|
600
|
+
t != null && t.id && K(!0);
|
|
603
601
|
const n = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
|
|
604
602
|
c != null && c.fileUpload ? (a = (i = ie.current) == null ? void 0 : i.clear()) == null || a.then(() => {
|
|
605
|
-
var s;
|
|
606
|
-
t != null && t.id && (n ? (s =
|
|
607
|
-
|
|
608
|
-
}) : (
|
|
609
|
-
|
|
603
|
+
var s, r;
|
|
604
|
+
t != null && t.id && (n ? (s = Ae(n, t)) == null || s.finally(() => {
|
|
605
|
+
K(!1);
|
|
606
|
+
}) : (K(!1), O(!0), (r = Be()) == null || r.then((k) => {
|
|
607
|
+
var g;
|
|
608
|
+
(g = Ae(k.id, t)) == null || g.finally(() => {
|
|
609
|
+
K(!1);
|
|
610
|
+
});
|
|
611
|
+
})));
|
|
612
|
+
}) : n ? K(!1) : (K(!1), O(!0), Be());
|
|
610
613
|
}
|
|
611
614
|
})
|
|
612
615
|
})), ve]
|
|
613
616
|
})
|
|
614
|
-
}), Me && /* @__PURE__ */
|
|
617
|
+
}), Me && /* @__PURE__ */ d("div", {
|
|
615
618
|
className: "session-stop",
|
|
616
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ d(Q, {
|
|
617
620
|
type: "primary",
|
|
618
621
|
style: {
|
|
619
622
|
background: "white"
|
|
620
623
|
},
|
|
621
624
|
ghost: !0,
|
|
622
625
|
size: "small",
|
|
623
|
-
icon: /* @__PURE__ */
|
|
626
|
+
icon: /* @__PURE__ */ d(xe, {
|
|
624
627
|
type: "icon-zantinghuida",
|
|
625
628
|
style: {
|
|
626
629
|
fontSize: 16
|
|
@@ -629,15 +632,15 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
629
632
|
onClick: () => Dt(),
|
|
630
633
|
children: "停止回答"
|
|
631
634
|
})
|
|
632
|
-
}), Oe && (u == null ? void 0 : u.length) > 0 && /* @__PURE__ */
|
|
635
|
+
}), Oe && (u == null ? void 0 : u.length) > 0 && /* @__PURE__ */ d("div", {
|
|
633
636
|
className: "back-bottom",
|
|
634
|
-
children: /* @__PURE__ */
|
|
637
|
+
children: /* @__PURE__ */ d(Q, {
|
|
635
638
|
size: "small",
|
|
636
639
|
onClick: () => Ht({
|
|
637
640
|
behavior: "smooth"
|
|
638
641
|
}),
|
|
639
642
|
type: "link",
|
|
640
|
-
icon: /* @__PURE__ */
|
|
643
|
+
icon: /* @__PURE__ */ d(xe, {
|
|
641
644
|
type: "icon-yijianhuidaodibu",
|
|
642
645
|
style: {
|
|
643
646
|
fontSize: 24
|
|
@@ -645,16 +648,16 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
645
648
|
})
|
|
646
649
|
})
|
|
647
650
|
})]
|
|
648
|
-
}), /* @__PURE__ */
|
|
651
|
+
}), /* @__PURE__ */ d("div", {
|
|
649
652
|
className: "chat-footer",
|
|
650
653
|
children: /* @__PURE__ */ $("div", {
|
|
651
654
|
className: "chat-footer-input",
|
|
652
|
-
children: [
|
|
655
|
+
children: [G && /* @__PURE__ */ d("div", {
|
|
653
656
|
className: "input-files",
|
|
654
|
-
children: /* @__PURE__ */
|
|
655
|
-
file:
|
|
657
|
+
children: /* @__PURE__ */ d(tn, {
|
|
658
|
+
file: G,
|
|
656
659
|
actions: {
|
|
657
|
-
upload:
|
|
660
|
+
upload: Rt,
|
|
658
661
|
remove: () => {
|
|
659
662
|
B(void 0);
|
|
660
663
|
}
|
|
@@ -665,14 +668,14 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
665
668
|
className: "footer-upload-action",
|
|
666
669
|
onClick: (t) => t.preventDefault(),
|
|
667
670
|
children: [/* @__PURE__ */ $(ae, {
|
|
668
|
-
children: [o.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */
|
|
669
|
-
disabled: !!
|
|
671
|
+
children: [o.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */ d(Xt, {
|
|
672
|
+
disabled: !!G || H,
|
|
670
673
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
671
674
|
listType: "picture-card",
|
|
672
|
-
beforeUpload:
|
|
675
|
+
beforeUpload: Pt,
|
|
673
676
|
className: "footer-upload-picture",
|
|
674
677
|
showUploadList: !1,
|
|
675
|
-
children:
|
|
678
|
+
children: G ? /* @__PURE__ */ d(Q, {
|
|
676
679
|
type: "text",
|
|
677
680
|
className: "camera-out-btn",
|
|
678
681
|
style: {
|
|
@@ -680,20 +683,20 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
680
683
|
position: "relative",
|
|
681
684
|
bottom: "-2px"
|
|
682
685
|
},
|
|
683
|
-
disabled: !!
|
|
684
|
-
icon: /* @__PURE__ */
|
|
686
|
+
disabled: !!G || H,
|
|
687
|
+
icon: /* @__PURE__ */ d(tt, {
|
|
685
688
|
className: "icon-tianjia",
|
|
686
689
|
style: {
|
|
687
690
|
fontSize: "22px"
|
|
688
691
|
}
|
|
689
692
|
})
|
|
690
|
-
}) : /* @__PURE__ */
|
|
693
|
+
}) : /* @__PURE__ */ d(Zt, {
|
|
691
694
|
placement: "topLeft",
|
|
692
695
|
overlayClassName: "footer-upload-tooltip",
|
|
693
|
-
title: /* @__PURE__ */
|
|
696
|
+
title: /* @__PURE__ */ d("div", {
|
|
694
697
|
children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
|
|
695
698
|
}),
|
|
696
|
-
children: /* @__PURE__ */
|
|
699
|
+
children: /* @__PURE__ */ d(Q, {
|
|
697
700
|
type: "text",
|
|
698
701
|
className: "camera-out-btn",
|
|
699
702
|
style: {
|
|
@@ -701,7 +704,7 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
701
704
|
position: "relative",
|
|
702
705
|
bottom: "-2px"
|
|
703
706
|
},
|
|
704
|
-
icon: /* @__PURE__ */
|
|
707
|
+
icon: /* @__PURE__ */ d(tt, {
|
|
705
708
|
className: "icon-tianjia",
|
|
706
709
|
style: {
|
|
707
710
|
fontSize: "22px"
|
|
@@ -709,25 +712,25 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
709
712
|
})
|
|
710
713
|
})
|
|
711
714
|
})
|
|
712
|
-
}), re && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */
|
|
715
|
+
}), re && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ d(cn, {
|
|
713
716
|
appId: o == null ? void 0 : o.id,
|
|
714
717
|
ref: ie,
|
|
715
718
|
isFirstSession: Ue,
|
|
716
|
-
docViewerUrl:
|
|
719
|
+
docViewerUrl: m,
|
|
717
720
|
onStatusChange: (t) => U(void 0, null, function* () {
|
|
718
721
|
t !== "process" ? (oe(!0), ye()) : oe(!1);
|
|
719
722
|
}),
|
|
720
723
|
createSession: () => new Promise((t) => {
|
|
721
|
-
O(!0),
|
|
724
|
+
O(!0), w == null || w({
|
|
722
725
|
netOpen: D ? 1 : 2
|
|
723
726
|
}).then((n) => {
|
|
724
727
|
var i, a, s;
|
|
725
|
-
v == null || v(n), O(!1),
|
|
728
|
+
v == null || v(n), O(!1), b(!!((i = n.data) != null && i.netOpen)), W(!!((a = n.data) != null && a.enableNetOpen));
|
|
726
729
|
const l = ((s = n.data) == null ? void 0 : s.id) || "";
|
|
727
730
|
t(l);
|
|
728
731
|
});
|
|
729
732
|
}),
|
|
730
|
-
sid: (
|
|
733
|
+
sid: (Qe = e == null ? void 0 : e.data) == null ? void 0 : Qe.id,
|
|
731
734
|
disabled: ge || H,
|
|
732
735
|
afterFileAdd: (t, n) => {
|
|
733
736
|
n && ne((l) => {
|
|
@@ -748,9 +751,9 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
748
751
|
});
|
|
749
752
|
},
|
|
750
753
|
onFileListChange: (t) => {
|
|
751
|
-
|
|
754
|
+
kt(t);
|
|
752
755
|
},
|
|
753
|
-
shouldContinue:
|
|
756
|
+
shouldContinue: bt,
|
|
754
757
|
afterFilesClear: () => {
|
|
755
758
|
var n;
|
|
756
759
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
@@ -758,83 +761,83 @@ ${t}` : t, a = new Z(i, l, Q.User, n);
|
|
|
758
761
|
[t]: []
|
|
759
762
|
}), ye());
|
|
760
763
|
}
|
|
761
|
-
}) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */
|
|
764
|
+
}) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ d(an, {
|
|
762
765
|
appId: o.id,
|
|
763
766
|
list: [],
|
|
764
|
-
search: Re ?
|
|
767
|
+
search: Re ? ht : "",
|
|
765
768
|
onPromptSelect: (t) => {
|
|
766
|
-
|
|
769
|
+
Y(t.context), J(t.context);
|
|
767
770
|
},
|
|
768
771
|
disabled: H
|
|
769
772
|
})]
|
|
770
773
|
}), /* @__PURE__ */ $(ae, {
|
|
771
|
-
children: [(c == null ? void 0 : c.connectNetwork) && o.type === 0 && ((
|
|
772
|
-
sessionId: (
|
|
774
|
+
children: [(c == null ? void 0 : c.connectNetwork) && o.type === 0 && ((_e = o.arrange) == null ? void 0 : _e.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ d(gn, {
|
|
775
|
+
sessionId: (Ge = e == null ? void 0 : e.data) == null ? void 0 : Ge.id,
|
|
773
776
|
netStatus: D,
|
|
774
|
-
enable: typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.diabled) == "boolean" ? !(f != null && f.connectNetwork.diabled) :
|
|
777
|
+
enable: typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.diabled) == "boolean" ? !(f != null && f.connectNetwork.diabled) : Nt,
|
|
775
778
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
776
779
|
onNetStatusChange: (t) => {
|
|
777
780
|
Vt(t);
|
|
778
781
|
}
|
|
779
|
-
}), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */
|
|
780
|
-
currentSessionId: (
|
|
782
|
+
}), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ d(pn, {
|
|
783
|
+
currentSessionId: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
|
|
781
784
|
onSessionChange: (t, n) => {
|
|
782
|
-
|
|
785
|
+
Y(void 0), v == null || v(n);
|
|
783
786
|
},
|
|
784
787
|
disabled: H
|
|
785
|
-
}), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */
|
|
786
|
-
icon: /* @__PURE__ */
|
|
788
|
+
}), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ d(Q, {
|
|
789
|
+
icon: /* @__PURE__ */ d(dn, {}),
|
|
787
790
|
className: "add-btn",
|
|
788
791
|
type: "primary",
|
|
789
792
|
disabled: Me || !e || !u.length || H,
|
|
790
793
|
onClick: () => {
|
|
791
794
|
var t, n;
|
|
792
|
-
v == null || v(void 0),
|
|
795
|
+
v == null || v(void 0), b(!1), (t = De.current) == null || t.clear(), (n = he.current) == null || n.clear();
|
|
793
796
|
},
|
|
794
797
|
children: "新会话"
|
|
795
798
|
})]
|
|
796
799
|
})]
|
|
797
|
-
}), /* @__PURE__ */
|
|
800
|
+
}), /* @__PURE__ */ d("div", {
|
|
798
801
|
className: "footer-textarea",
|
|
799
|
-
children: /* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ d(on, {
|
|
800
803
|
ref: pe,
|
|
801
|
-
maxLength:
|
|
802
|
-
text:
|
|
804
|
+
maxLength: ct,
|
|
805
|
+
text: mt,
|
|
803
806
|
networkStatus: !1,
|
|
804
807
|
loading: je,
|
|
805
808
|
disabled: Ne || Te || H || je,
|
|
806
809
|
onTextSend: Ve,
|
|
807
810
|
onChange: (t, n) => {
|
|
808
|
-
|
|
811
|
+
Y(t);
|
|
809
812
|
const l = n.getText().replace(/[\n\s]+$/, "");
|
|
810
|
-
J(l),
|
|
813
|
+
J(l), gt(l), Re || pt(!0);
|
|
811
814
|
},
|
|
812
|
-
clearAction: /* @__PURE__ */
|
|
815
|
+
clearAction: /* @__PURE__ */ d(ae, {
|
|
813
816
|
size: 0,
|
|
814
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ d(Q, {
|
|
815
818
|
type: "link",
|
|
816
819
|
disabled: ge || H,
|
|
817
820
|
ghost: !0,
|
|
818
|
-
icon: /* @__PURE__ */
|
|
821
|
+
icon: /* @__PURE__ */ d(xe, {
|
|
819
822
|
style: {
|
|
820
823
|
fontSize: 22
|
|
821
824
|
},
|
|
822
825
|
type: "icon-qingchujiyi"
|
|
823
826
|
}),
|
|
824
|
-
onClick: () =>
|
|
827
|
+
onClick: () => Ft()
|
|
825
828
|
})
|
|
826
829
|
})
|
|
827
830
|
})
|
|
828
831
|
})]
|
|
829
832
|
})
|
|
830
|
-
}), /* @__PURE__ */
|
|
831
|
-
tips:
|
|
832
|
-
}), He && /* @__PURE__ */
|
|
833
|
+
}), /* @__PURE__ */ d(rn, {
|
|
834
|
+
tips: rt
|
|
835
|
+
}), He && /* @__PURE__ */ d(fn, {
|
|
833
836
|
isvisible: He,
|
|
834
|
-
files:
|
|
835
|
-
sessionId: (
|
|
837
|
+
files: vt,
|
|
838
|
+
sessionId: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
|
|
836
839
|
onClose: (t) => {
|
|
837
|
-
|
|
840
|
+
yt(!1), xt(!1);
|
|
838
841
|
}
|
|
839
842
|
})]
|
|
840
843
|
});
|