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