@glodon-aiot/agent-cli-ui 3.4.1 → 3.4.2-beta.2

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