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