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