@glodon-aiot/agent-cli-ui 3.2.10-beta.3 → 3.2.10-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- var $t = Object.defineProperty, At = Object.defineProperties;
2
- var Bt = Object.getOwnPropertyDescriptors;
1
+ var Vt = Object.defineProperty, $t = Object.defineProperties;
2
+ var At = Object.getOwnPropertyDescriptors;
3
3
  var Se = Object.getOwnPropertySymbols;
4
- var qt = Object.prototype.hasOwnProperty, Kt = Object.prototype.propertyIsEnumerable;
5
- var ke = (x, o, m) => o in x ? $t(x, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : x[o] = m, we = (x, o) => {
4
+ var Bt = Object.prototype.hasOwnProperty, qt = Object.prototype.propertyIsEnumerable;
5
+ var we = (x, o, m) => o in x ? Vt(x, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : x[o] = m, be = (x, o) => {
6
6
  for (var m in o || (o = {}))
7
- qt.call(o, m) && ke(x, m, o[m]);
7
+ Bt.call(o, m) && we(x, m, o[m]);
8
8
  if (Se)
9
9
  for (var m of Se(o))
10
- Kt.call(o, m) && ke(x, m, o[m]);
10
+ qt.call(o, m) && we(x, m, o[m]);
11
11
  return x;
12
- }, be = (x, o) => At(x, Bt(o));
13
- var P = (x, o, m) => (ke(x, typeof o != "symbol" ? o + "" : o, m), m);
12
+ }, xe = (x, o) => $t(x, At(o));
13
+ var P = (x, o, m) => (we(x, typeof o != "symbol" ? o + "" : o, m), m);
14
14
  var U = (x, o, m) => new Promise((e, w) => {
15
- var re = (b) => {
15
+ var de = (b) => {
16
16
  try {
17
17
  D(m.next(b));
18
18
  } catch (u) {
@@ -24,27 +24,27 @@ var U = (x, o, m) => new Promise((e, w) => {
24
24
  } catch (u) {
25
25
  w(u);
26
26
  }
27
- }, D = (b) => b.done ? e(b.value) : Promise.resolve(b.value).then(re, v);
27
+ }, D = (b) => b.done ? e(b.value) : Promise.resolve(b.value).then(de, v);
28
28
  D((m = m.apply(x, o)).next());
29
29
  });
30
30
  import { jsx as d, jsxs as $ } from "react/jsx-runtime";
31
- import { memo as Yt, useState as p, useRef as A, useContext as Wt, useEffect as N, useMemo as Qt } from "react";
32
- /* empty css */import { Divider as _t, Spin as Gt, Button as Q, Space as ae, Upload as Xt, Tooltip as Zt, message as R, notification as Jt } from "antd";
33
- import xe from "../../Iconfont/index.mjs";
31
+ import { memo as Kt, useState as p, useRef as A, useContext as Yt, useEffect as N, useMemo as Wt } from "react";
32
+ /* empty css */import { Divider as Qt, Spin as _t, Button as Q, Space as ae, Upload as Gt, Tooltip as Xt, message as R, notification as Zt } from "antd";
33
+ import re from "../../Iconfont/index.mjs";
34
34
  import { IHistoryRole as _, ChatMessageRole as et } from "@glodon-aiot/apis";
35
- import it from "../HistoryItem/index.mjs";
36
- import ot from "dayjs";
37
- import { v4 as st } from "uuid";
38
- import St from "../../context.mjs";
39
- import { MB as en } from "../../constant.mjs";
40
- import tn from "../FilePreview/index.mjs";
41
- import { getImageExtension as nn } from "../../utils/index.mjs";
42
- import on from "../../QuillEditor/index.mjs";
43
- import sn from "../Recommend/index.mjs";
44
- import ln from "../Greeting/index.mjs";
45
- import an from "../PromptManager/index.mjs";
46
- import rn from "../../Footer/index.mjs";
47
- import { CameraOutlined as tt, PlusOutlined as dn } from "@ant-design/icons";
35
+ import nt from "../HistoryItem/index.mjs";
36
+ import it from "dayjs";
37
+ import { v4 as ot } from "uuid";
38
+ import Jt from "../../context.mjs";
39
+ import { MB as St } from "../../constant.mjs";
40
+ import en from "../FilePreview/index.mjs";
41
+ import { getImageExtension as tn } from "../../utils/index.mjs";
42
+ import nn from "../../QuillEditor/index.mjs";
43
+ import on from "../Recommend/index.mjs";
44
+ import sn from "../Greeting/index.mjs";
45
+ import ln from "../PromptManager/index.mjs";
46
+ import an from "../../Footer/index.mjs";
47
+ import { CameraOutlined as rn, PlusOutlined as dn } from "@ant-design/icons";
48
48
  import cn from "../UploadKnowledgeFiles/index.mjs";
49
49
  import fn from "../UploadingPrompt/index.mjs";
50
50
  import un from "../PromptSetting/index.mjs";
@@ -53,7 +53,7 @@ import pn from "../SessionListDrawer/index.mjs";
53
53
  import hn from "react-infinite-scroll-component";
54
54
  import gn from "../ConnectToNetwork/index.mjs";
55
55
  import mn from "../../assets/icon.svg.mjs";
56
- const yn = Yt(it), vn = {
56
+ const yn = Kt(nt), vn = {
57
57
  icon: mn,
58
58
  text: "今天我能帮你什么?"
59
59
  };
@@ -68,36 +68,36 @@ class Z {
68
68
  P(this, "isSensitive");
69
69
  P(this, "isSuspend");
70
70
  P(this, "comment");
71
- this.content = o, this.sessionId = m, this.role = e, this.files = w, this.content = o, this.role = e, this.sessionId = m, this.files = w, this.messageTime = ot(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = st(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
71
+ this.content = o, this.sessionId = m, this.role = e, this.files = w, this.content = o, this.role = e, this.sessionId = m, this.files = w, this.messageTime = it(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = ot(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
72
72
  isAgree: 0
73
73
  };
74
74
  }
75
75
  }
76
- const nt = 10, Qn = (x) => {
76
+ const tt = 10, Qn = (x) => {
77
77
  var qe, Ke, Ye, We, Qe, _e, Ge, Xe, Ze;
78
78
  const {
79
79
  application: o,
80
80
  docViewerUrl: m = "",
81
81
  currentSession: e,
82
82
  onCreateSession: w,
83
- embeddingService: re,
83
+ embeddingService: de,
84
84
  setCurrentSession: v,
85
85
  networkStatus: D,
86
86
  setNetworkStatus: b
87
- } = x, [u, I] = p([]), [lt, J] = p(), [de, Le] = p(), E = A(null), {
87
+ } = x, [u, I] = p([]), [st, J] = p(), [ce, Le] = p(), E = A(null), {
88
88
  service: C,
89
89
  agentClient: L,
90
- depId: at,
91
- footer: rt,
90
+ depId: lt,
91
+ footer: at,
92
92
  transform: c,
93
- defaultInput: ce,
93
+ defaultInput: fe,
94
94
  onMessage: S,
95
95
  onHistoryLoad: Ce,
96
96
  beforeMessageSend: z,
97
- bodyStyle: dt,
97
+ bodyStyle: rt,
98
98
  disabled: H,
99
99
  features: f
100
- } = Wt(St), [Ne, fe] = p(!1), h = A(u), Fe = A(), [ct, ft] = p(0), [G, B] = p(), [q, ee] = p(""), [Te, ue] = p(!1), pe = A(null), [Ee, ut] = p([]), [Pe, K] = p(!1), [Re, pt] = p(!1), [ht, gt] = p(""), [mt, Y] = p(), [te, ne] = p({}), ie = A(null), De = A(null), he = A(null), [He, yt] = p(!1), [vt, kt] = p([]), [wt, oe] = p(!0), [bt, xt] = p(!0), [Me, M] = p(!1), [ge, j] = p(!1), [Oe, It] = p(!1), [F, se] = p(typeof (f == null ? void 0 : f.promptVariables) == "object" ? f.promptVariables.default || [] : []), [Lt, Ct] = p(typeof (f == null ? void 0 : f.knowledges) == "object" && f.knowledges.default || void 0), [Ue, O] = p(!1), [ze, X] = p(!1), [Nt, W] = p(typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.default) == "boolean" ? f.connectNetwork.default : !1), [je, le] = p(!1);
100
+ } = Yt(Jt), [Ne, ue] = p(!1), h = A(u), Fe = A(), [dt, ct] = p(0), [G, B] = p(), [q, ee] = p(""), [Te, pe] = p(!1), he = A(null), [Ee, ft] = p([]), [Pe, K] = p(!1), [Re, ut] = p(!1), [pt, ht] = p(""), [gt, Y] = p(), [te, ne] = p({}), ie = A(null), De = A(null), ge = A(null), [He, mt] = p(!1), [yt, vt] = p([]), [kt, oe] = p(!0), [wt, bt] = p(!0), [Me, M] = p(!1), [me, j] = p(!1), [Oe, xt] = p(!1), [F, se] = p(typeof (f == null ? void 0 : f.promptVariables) == "object" ? f.promptVariables.default || [] : []), [It, Lt] = p(typeof (f == null ? void 0 : f.knowledges) == "object" && f.knowledges.default || void 0), [Ue, O] = p(!1), [ze, X] = p(!1), [Ct, W] = p(typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.default) == "boolean" ? f.connectNetwork.default : !1), [je, le] = p(!1);
101
101
  N(() => {
102
102
  var l, i;
103
103
  e && (h.current = []), I([]);
@@ -124,7 +124,7 @@ const nt = 10, Qn = (x) => {
124
124
  }, [e]), N(() => {
125
125
  const t = () => {
126
126
  var n;
127
- (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && se(e.promptVariables.sort((l, i) => l.key.localeCompare(i.key))), e.knowledges && Ct(e.knowledges), b(e.netOpen));
127
+ (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && se(e.promptVariables.sort((l, i) => l.key.localeCompare(i.key))), e.knowledges && Lt(e.knowledges), b(e.netOpen));
128
128
  };
129
129
  return e == null || e.addEventListener("data:updated", t), () => {
130
130
  e == null || e.removeEventListener("data:updated", t);
@@ -140,7 +140,7 @@ const nt = 10, Qn = (x) => {
140
140
  e == null || e.removeEventListener("error", t);
141
141
  };
142
142
  }, [e]);
143
- const Ft = () => {
143
+ const Nt = () => {
144
144
  var l;
145
145
  if (!((l = e == null ? void 0 : e.data) != null && l.id) || !(o != null && o.id))
146
146
  return;
@@ -154,14 +154,14 @@ const nt = 10, Qn = (x) => {
154
154
  };
155
155
  N(() => {
156
156
  o != null && o.id && (C == null || C.getRecommendQues(o.id).then((t) => {
157
- ut(t);
157
+ ft(t);
158
158
  }));
159
- }, [at, o]);
159
+ }, [lt, o]);
160
160
  const Ve = (t) => U(void 0, null, function* () {
161
161
  var k, g;
162
162
  if (H)
163
163
  return R.error("发送功能被禁用");
164
- const n = t || lt;
164
+ const n = t || st;
165
165
  if (!(n != null && n.trim()))
166
166
  return R.error("请输入你想问的");
167
167
  if (!(F == null ? void 0 : F.every((y) => !!(y != null && y.value)))) {
@@ -169,11 +169,11 @@ const nt = 10, Qn = (x) => {
169
169
  return R.error("变量值不能为空");
170
170
  console.error("变量值不能为空", F == null ? void 0 : F.map((y) => !!(y != null && y.value)));
171
171
  }
172
- if (ge)
172
+ if (me)
173
173
  return R.error("正在回复中");
174
174
  if (Ne)
175
175
  return R.error("等待初始化");
176
- if (!wt)
176
+ if (!kt)
177
177
  return R.error("正在解析文件");
178
178
  if (Te)
179
179
  return R.error("正在上传图片");
@@ -184,7 +184,7 @@ const nt = 10, Qn = (x) => {
184
184
  netOpen: D ? 1 : 2
185
185
  }).then((y) => {
186
186
  var T, V;
187
- O(!0), b(!!((T = y.data) != null && T.netOpen)), W(!!((V = y.data) != null && V.enableNetOpen)), Tt(y).then(() => {
187
+ O(!0), b(!!((T = y.data) != null && T.netOpen)), W(!!((V = y.data) != null && V.enableNetOpen)), Ft(y).then(() => {
188
188
  v == null || v(y), O(!1), Le(n);
189
189
  });
190
190
  });
@@ -211,15 +211,15 @@ ${n}` : n;
211
211
  if (le(!1), s === !1)
212
212
  return;
213
213
  let r = n;
214
- typeof s == "object" && (r = s.content || n), ((g = te[i]) == null ? void 0 : g.length) > 0 ? Et(r) : me(r);
215
- }), Tt = (t) => new Promise((n, l) => U(void 0, null, function* () {
214
+ typeof s == "object" && (r = s.content || n), ((g = te[i]) == null ? void 0 : g.length) > 0 ? Tt(r) : ye(r);
215
+ }), Ft = (t) => new Promise((n, l) => U(void 0, null, function* () {
216
216
  const s = (t == null ? void 0 : t.promptVariables).filter((r) => r.key !== "query").map((r) => {
217
217
  var g;
218
218
  const k = (g = F.find((y) => y.key === r.key)) == null ? void 0 : g.value;
219
219
  return r.value = k || "", r;
220
220
  });
221
221
  se(s.sort((r, k) => r.key.localeCompare(k.key))), yield t == null ? void 0 : t.setPromptVariables(s), n();
222
- })), Et = (t) => {
222
+ })), Tt = (t) => {
223
223
  var s, r, k;
224
224
  if (oe(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
225
225
  return;
@@ -232,15 +232,15 @@ ${n}` : n;
232
232
  }).then((y) => {
233
233
  l.push(g);
234
234
  }))).then((g) => {
235
- oe(!0), me(t, l);
235
+ oe(!0), ye(t, l);
236
236
  }).catch((g) => {
237
237
  throw Error(g);
238
238
  });
239
239
  };
240
240
  N(() => {
241
- if (!de || !e)
241
+ if (!ce || !e)
242
242
  return;
243
- const t = de, n = () => U(void 0, null, function* () {
243
+ const t = ce, n = () => U(void 0, null, function* () {
244
244
  le(!0);
245
245
  const l = q ? `![](${q})
246
246
  ${t}` : t;
@@ -259,13 +259,13 @@ ${t}` : t;
259
259
  } catch (a) {
260
260
  i = !1;
261
261
  }
262
- le(!1), i !== !1 && (me(t), Le(void 0));
262
+ le(!1), i !== !1 && (ye(t), Le(void 0));
263
263
  });
264
264
  return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
265
265
  e == null || e.removeEventListener("ready", n);
266
266
  };
267
- }, [de, e]);
268
- const me = (t, n) => U(void 0, null, function* () {
267
+ }, [ce, e]);
268
+ const ye = (t, n) => U(void 0, null, function* () {
269
269
  var g, y;
270
270
  const l = (g = e == null ? void 0 : e.data) == null ? void 0 : g.id;
271
271
  if (!l)
@@ -289,7 +289,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
289
289
  k.formatValues = T, e.setPromptVariables(F);
290
290
  }
291
291
  if (c != null && c.knowledges) {
292
- const T = Lt;
292
+ const T = It;
293
293
  k.knowledges = T, e.setKnowledges(T);
294
294
  }
295
295
  yield e.send({
@@ -308,7 +308,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
308
308
  if (!i.sessionId || i.sessionId && i.sessionId !== Fe.current || i.role === _.User)
309
309
  return;
310
310
  if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (M(!1), j(!1), h.current = h.current.filter((r) => !r.isWaiting), I([...h.current]), h.current = [...h.current], i.content))
311
- return Jt.error({
311
+ return Zt.error({
312
312
  message: i.content
313
313
  });
314
314
  const a = i.actions || [], s = new Z(i.content, t, _.Robot);
@@ -325,27 +325,27 @@ ${t}` : t, a = new Z(i, l, _.User, n);
325
325
  };
326
326
  }, [e]), N(() => {
327
327
  if (!e) {
328
- fe(!1);
328
+ ue(!1);
329
329
  return;
330
330
  }
331
331
  const t = (n) => {
332
- fe(n);
332
+ ue(n);
333
333
  };
334
- return fe(e.frozen), e.addEventListener("frozen", t), () => {
334
+ return ue(e.frozen), e.addEventListener("frozen", t), () => {
335
335
  e == null || e.removeEventListener("frozen", t);
336
336
  };
337
337
  }, [e]), N(() => {
338
338
  if (!L)
339
339
  return;
340
340
  const t = L.questionContextMaxLength || 4e3;
341
- ft(t);
341
+ ct(t);
342
342
  }, [L, C]), N(() => {
343
- ce && Y(ce.text);
344
- }, [ce]);
345
- const Pt = (t) => {
343
+ fe && Y(fe.text);
344
+ }, [fe]);
345
+ const Et = (t) => {
346
346
  const n = t.size;
347
- return n <= 0 ? (R.error("该文件为空,请重新上传"), !1) : n > 20 * en ? (R.error("图片须小于20M"), !1) : (B(t), !1);
348
- }, Rt = (t) => U(void 0, null, function* () {
347
+ return n <= 0 ? (R.error("该文件为空,请重新上传"), !1) : n > 20 * St ? (R.error("图片须小于20M"), !1) : (B(t), !1);
348
+ }, Pt = (t) => U(void 0, null, function* () {
349
349
  var n;
350
350
  return B(t), (n = e == null ? void 0 : e.data) != null && n.id ? $e(e, t) : new Promise((l) => {
351
351
  O(!0), w == null || w({
@@ -356,16 +356,16 @@ ${t}` : t, a = new Z(i, l, _.User, n);
356
356
  });
357
357
  });
358
358
  }), $e = (t, n) => {
359
- const l = nn(n.name);
359
+ const l = tn(n.name);
360
360
  return new Promise((i) => {
361
361
  var s;
362
362
  const a = {
363
- files: [`${st()}.${l}`],
363
+ files: [`${ot()}.${l}`],
364
364
  isv: "minio",
365
365
  knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
366
366
  type: 1
367
367
  };
368
- ue(!0), C == null || C.postTicket(a).then((r) => {
368
+ pe(!0), C == null || C.postTicket(a).then((r) => {
369
369
  C.uploadMinioFile(r.minio, n).then(() => {
370
370
  var T, V;
371
371
  const k = (T = r.minio.endpoints) == null ? void 0 : T[0], g = r.minio.bucket, y = (V = r.minio.fileKeys) == null ? void 0 : V[0];
@@ -373,10 +373,10 @@ ${t}` : t, a = new Z(i, l, _.User, n);
373
373
  }).catch(() => {
374
374
  ee(""), B(void 0);
375
375
  }).finally(() => {
376
- ue(!1);
376
+ pe(!1);
377
377
  });
378
378
  }).catch(() => {
379
- ee(""), B(void 0), ue(!1);
379
+ ee(""), B(void 0), pe(!1);
380
380
  });
381
381
  });
382
382
  };
@@ -389,17 +389,17 @@ ${t}` : t, a = new Z(i, l, _.User, n);
389
389
  const Ae = (t, n) => new Promise((l) => {
390
390
  if (!n.file.url || !(o != null && o.id))
391
391
  return l();
392
- const i = be(we({}, n.file), {
392
+ const i = xe(be({}, n.file), {
393
393
  type: 1
394
394
  });
395
395
  console.log("fileParams", i), C == null || C.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
396
396
  var a;
397
397
  console.log("uploadRef.current?.update"), (a = ie.current) == null || a.update().finally(l);
398
398
  });
399
- }), Dt = () => {
399
+ }), Rt = () => {
400
400
  var t;
401
401
  (t = e == null ? void 0 : e.data) != null && t.id && (M(!1), e.suspend());
402
- }, Ht = (t) => {
402
+ }, Dt = (t) => {
403
403
  const n = E.current;
404
404
  n && setTimeout(() => {
405
405
  n.scrollTo({
@@ -407,17 +407,17 @@ ${t}` : t, a = new Z(i, l, _.User, n);
407
407
  behavior: t == null ? void 0 : t.behavior
408
408
  });
409
409
  }, t == null ? void 0 : t.ms);
410
- }, Mt = () => {
410
+ }, Ht = () => {
411
411
  if (!E.current)
412
412
  return;
413
413
  const t = E.current.scrollTop <= -80;
414
- It(t);
415
- }, Ot = Ie((t) => {
414
+ xt(t);
415
+ }, Mt = Ie((t) => {
416
416
  var n, l;
417
- (n = pe.current) == null || n.update(t), (l = pe.current) == null || l.focus();
418
- }), Ut = Ie((t) => {
417
+ (n = he.current) == null || n.update(t), (l = he.current) == null || l.focus();
418
+ }), Ot = Ie((t) => {
419
419
  Ve(t);
420
- }), zt = Ie(() => {
420
+ }), Ut = Ie(() => {
421
421
  var n;
422
422
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
423
423
  return;
@@ -427,16 +427,16 @@ ${t}` : t, a = new Z(i, l, _.User, n);
427
427
  });
428
428
  N(() => {
429
429
  var t, n;
430
- Fe.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ue && ((n = he.current) == null || n.clear());
430
+ Fe.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ue && ((n = ge.current) == null || n.clear());
431
431
  }, [e]);
432
- const jt = () => {
432
+ const zt = () => {
433
433
  var l;
434
434
  if (!((l = e == null ? void 0 : e.data) != null && l.id))
435
435
  return;
436
436
  const n = u[u.length - 1].messageTime;
437
437
  e.fetchMessages({
438
438
  endTime: n,
439
- pageSize: nt
439
+ pageSize: tt
440
440
  }).then((i) => {
441
441
  const a = i || [];
442
442
  if (!a || !(a != null && a.length)) {
@@ -445,7 +445,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
445
445
  }
446
446
  a.length < 10 ? X(!1) : X(!0), I([...u, ...a.reverse()]);
447
447
  });
448
- }, Vt = (t) => U(void 0, null, function* () {
448
+ }, jt = (t) => U(void 0, null, function* () {
449
449
  var n, l;
450
450
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
451
451
  b(t);
@@ -454,14 +454,14 @@ ${t}` : t, a = new Z(i, l, _.User, n);
454
454
  return;
455
455
  b(t);
456
456
  }
457
- }), ye = () => U(void 0, null, function* () {
457
+ }), ve = () => U(void 0, null, function* () {
458
458
  e ? e.fetchData().then((t) => {
459
459
  var n;
460
460
  (n = e == null ? void 0 : e.data) != null && n.id && (b(t.netOpen), W(t.enableNetOpen));
461
461
  }) : (b(!1), W(o.arrange[0].enableNetOpen));
462
462
  });
463
463
  N(() => {
464
- ye();
464
+ ve();
465
465
  }, [e]), N(() => {
466
466
  var t, n;
467
467
  if (E.current) {
@@ -507,9 +507,9 @@ ${t}` : t, a = new Z(i, l, _.User, n);
507
507
  }).then((t) => {
508
508
  var n, l;
509
509
  return v == null || v(t), O(!1), b(!!((n = t.data) != null && n.netOpen)), W(!!((l = t.data) != null && l.enableNetOpen)), t;
510
- }), ve = Qt(() => {
510
+ }), ke = Wt(() => {
511
511
  var t;
512
- return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(it, {
512
+ return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(nt, {
513
513
  application: o,
514
514
  history: {
515
515
  role: 1,
@@ -519,14 +519,14 @@ ${t}` : t, a = new Z(i, l, _.User, n);
519
519
  sessionId: "",
520
520
  reference: [],
521
521
  searchReference: [],
522
- messageTime: ot(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
522
+ messageTime: it(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
523
523
  actions: [],
524
524
  isLoading: !1
525
525
  },
526
526
  actions: !!u.length
527
527
  }) : null;
528
528
  }, [o == null ? void 0 : o.arrange, u]);
529
- return console.log("openingMessage", ve), /* @__PURE__ */ $("div", {
529
+ return console.log("openingMessage", ke), /* @__PURE__ */ $("div", {
530
530
  className: "agent-chat",
531
531
  children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ d(un, {
532
532
  ref: De,
@@ -538,7 +538,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
538
538
  }), /* @__PURE__ */ $("div", {
539
539
  className: "chat-main",
540
540
  id: "chat-main",
541
- style: dt,
541
+ style: rt,
542
542
  children: [/* @__PURE__ */ d("div", {
543
543
  className: "chat-main-wrapper",
544
544
  id: "scrollableDiv",
@@ -549,18 +549,18 @@ ${t}` : t, a = new Z(i, l, _.User, n);
549
549
  flexDirection: "column-reverse"
550
550
  },
551
551
  ref: E,
552
- onScroll: Mt,
552
+ onScroll: Ht,
553
553
  children: (qe = e == null ? void 0 : e.data) != null && qe.id && (u != null && u.length) ? /* @__PURE__ */ $(hn, {
554
554
  dataLength: u.length,
555
- next: jt,
555
+ next: zt,
556
556
  style: {
557
557
  display: "flex",
558
558
  flexDirection: "column-reverse",
559
559
  overflowX: "hidden"
560
560
  },
561
561
  inverse: !0,
562
- endMessage: u.length > nt && // 少于一页不展示这个提示
563
- ((Ke = E.current) != null && Ke.scrollTop) && ((Ye = E.current) == null ? void 0 : Ye.scrollTop) < -10 ? /* @__PURE__ */ d(_t, {
562
+ endMessage: u.length > tt && // 少于一页不展示这个提示
563
+ ((Ke = E.current) != null && Ke.scrollTop) && ((Ye = E.current) == null ? void 0 : Ye.scrollTop) < -10 ? /* @__PURE__ */ d(Qt, {
564
564
  plain: !0,
565
565
  children: "没有更多数据了"
566
566
  }) : null,
@@ -571,7 +571,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
571
571
  textAlign: "center",
572
572
  overflow: "hidden"
573
573
  },
574
- children: /* @__PURE__ */ d(Gt, {})
574
+ children: /* @__PURE__ */ d(_t, {})
575
575
  }),
576
576
  scrollableTarget: "scrollableDiv",
577
577
  children: [u.map((t, n) => /* @__PURE__ */ d(yn, {
@@ -580,15 +580,15 @@ ${t}` : t, a = new Z(i, l, _.User, n);
580
580
  history: t,
581
581
  docViewerUrl: m,
582
582
  isLastHistory: n === 0,
583
- onRelatedClick: Ut,
584
- onAgainClick: zt,
585
- onEditClick: Ot
586
- }, t.messageId + n)), !ze && ve]
583
+ onRelatedClick: Ot,
584
+ onAgainClick: Ut,
585
+ onEditClick: Mt
586
+ }, t.messageId + n)), !ze && ke]
587
587
  }) : /* @__PURE__ */ $("div", {
588
588
  className: "main-empty",
589
- children: [/* @__PURE__ */ d(ln, be(we({}, vn), {
590
- children: !!Ee.length && /* @__PURE__ */ d(sn, {
591
- ref: he,
589
+ children: [/* @__PURE__ */ d(sn, xe(be({}, vn), {
590
+ children: !!Ee.length && /* @__PURE__ */ d(on, {
591
+ ref: ge,
592
592
  sid: (We = e == null ? void 0 : e.data) == null ? void 0 : We.id,
593
593
  isRecommendClearing: Pe,
594
594
  data: Ee,
@@ -611,7 +611,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
611
611
  }) : n ? K(!1) : (K(!1), O(!0), Be());
612
612
  }
613
613
  })
614
- })), ve]
614
+ })), ke]
615
615
  })
616
616
  }), Me && /* @__PURE__ */ d("div", {
617
617
  className: "session-stop",
@@ -622,24 +622,24 @@ ${t}` : t, a = new Z(i, l, _.User, n);
622
622
  },
623
623
  ghost: !0,
624
624
  size: "small",
625
- icon: /* @__PURE__ */ d(xe, {
625
+ icon: /* @__PURE__ */ d(re, {
626
626
  type: "icon-zantinghuida",
627
627
  style: {
628
628
  fontSize: 16
629
629
  }
630
630
  }),
631
- onClick: () => Dt(),
631
+ onClick: () => Rt(),
632
632
  children: "停止回答"
633
633
  })
634
634
  }), Oe && (u == null ? void 0 : u.length) > 0 && /* @__PURE__ */ d("div", {
635
635
  className: "back-bottom",
636
636
  children: /* @__PURE__ */ d(Q, {
637
637
  size: "small",
638
- onClick: () => Ht({
638
+ onClick: () => Dt({
639
639
  behavior: "smooth"
640
640
  }),
641
641
  type: "link",
642
- icon: /* @__PURE__ */ d(xe, {
642
+ icon: /* @__PURE__ */ d(re, {
643
643
  type: "icon-yijianhuidaodibu",
644
644
  style: {
645
645
  fontSize: 24
@@ -653,10 +653,10 @@ ${t}` : t, a = new Z(i, l, _.User, n);
653
653
  className: "chat-footer-input",
654
654
  children: [G && /* @__PURE__ */ d("div", {
655
655
  className: "input-files",
656
- children: /* @__PURE__ */ d(tn, {
656
+ children: /* @__PURE__ */ d(en, {
657
657
  file: G,
658
658
  actions: {
659
- upload: Rt,
659
+ upload: Pt,
660
660
  remove: () => {
661
661
  B(void 0);
662
662
  }
@@ -667,11 +667,11 @@ ${t}` : t, a = new Z(i, l, _.User, n);
667
667
  className: "footer-upload-action",
668
668
  onClick: (t) => t.preventDefault(),
669
669
  children: [/* @__PURE__ */ $(ae, {
670
- children: [o.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */ d(Xt, {
670
+ children: [o.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */ d(Gt, {
671
671
  disabled: !!G || H,
672
672
  accept: ".jpg, .png, .jpeg,.bmp",
673
673
  listType: "picture-card",
674
- beforeUpload: Pt,
674
+ beforeUpload: Et,
675
675
  className: "footer-upload-picture",
676
676
  showUploadList: !1,
677
677
  children: G ? /* @__PURE__ */ d(Q, {
@@ -683,13 +683,13 @@ ${t}` : t, a = new Z(i, l, _.User, n);
683
683
  bottom: "-2px"
684
684
  },
685
685
  disabled: !!G || H,
686
- icon: /* @__PURE__ */ d(tt, {
686
+ icon: /* @__PURE__ */ d(rn, {
687
687
  className: "icon-tianjia",
688
688
  style: {
689
689
  fontSize: "22px"
690
690
  }
691
691
  })
692
- }) : /* @__PURE__ */ d(Zt, {
692
+ }) : /* @__PURE__ */ d(Xt, {
693
693
  placement: "topLeft",
694
694
  overlayClassName: "footer-upload-tooltip",
695
695
  title: /* @__PURE__ */ d("div", {
@@ -703,7 +703,8 @@ ${t}` : t, a = new Z(i, l, _.User, n);
703
703
  position: "relative",
704
704
  bottom: "-2px"
705
705
  },
706
- icon: /* @__PURE__ */ d(tt, {
706
+ icon: /* @__PURE__ */ d(re, {
707
+ type: "icon-Vector",
707
708
  className: "icon-tianjia",
708
709
  style: {
709
710
  fontSize: "22px"
@@ -711,13 +712,13 @@ ${t}` : t, a = new Z(i, l, _.User, n);
711
712
  })
712
713
  })
713
714
  })
714
- }), re && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ d(cn, {
715
+ }), de && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ d(cn, {
715
716
  appId: o == null ? void 0 : o.id,
716
717
  ref: ie,
717
718
  isFirstSession: Ue,
718
719
  docViewerUrl: m,
719
720
  onStatusChange: (t) => U(void 0, null, function* () {
720
- t !== "process" ? (oe(!0), ye()) : oe(!1);
721
+ t !== "process" ? (oe(!0), ve()) : oe(!1);
721
722
  }),
722
723
  createSession: () => new Promise((t) => {
723
724
  O(!0), w == null || w({
@@ -730,7 +731,7 @@ ${t}` : t, a = new Z(i, l, _.User, n);
730
731
  });
731
732
  }),
732
733
  sid: (Qe = e == null ? void 0 : e.data) == null ? void 0 : Qe.id,
733
- disabled: ge || H,
734
+ disabled: me || H,
734
735
  afterFileAdd: (t, n) => {
735
736
  n && ne((l) => {
736
737
  const i = l[n] || [];
@@ -750,20 +751,20 @@ ${t}` : t, a = new Z(i, l, _.User, n);
750
751
  });
751
752
  },
752
753
  onFileListChange: (t) => {
753
- kt(t);
754
+ vt(t);
754
755
  },
755
- shouldContinue: bt,
756
+ shouldContinue: wt,
756
757
  afterFilesClear: () => {
757
758
  var n;
758
759
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
759
760
  t && (ne({
760
761
  [t]: []
761
- }), ye());
762
+ }), ve());
762
763
  }
763
- }) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ d(an, {
764
+ }) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ d(ln, {
764
765
  appId: o.id,
765
766
  list: [],
766
- search: Re ? ht : "",
767
+ search: Re ? pt : "",
767
768
  onPromptSelect: (t) => {
768
769
  Y(t.context), J(t.context);
769
770
  },
@@ -773,10 +774,10 @@ ${t}` : t, a = new Z(i, l, _.User, n);
773
774
  children: [(c == null ? void 0 : c.connectNetwork) && o.type === 0 && ((_e = o.arrange) == null ? void 0 : _e.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ d(gn, {
774
775
  sessionId: (Ge = e == null ? void 0 : e.data) == null ? void 0 : Ge.id,
775
776
  netStatus: D,
776
- enable: typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.diabled) == "boolean" ? !(f != null && f.connectNetwork.diabled) : Nt,
777
+ enable: typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.diabled) == "boolean" ? !(f != null && f.connectNetwork.diabled) : Ct,
777
778
  disabledTip: e ? void 0 : "网络访问已被禁用",
778
779
  onNetStatusChange: (t) => {
779
- Vt(t);
780
+ jt(t);
780
781
  }
781
782
  }), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ d(pn, {
782
783
  currentSessionId: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
@@ -791,17 +792,17 @@ ${t}` : t, a = new Z(i, l, _.User, n);
791
792
  disabled: Me || !e || !u.length || H,
792
793
  onClick: () => {
793
794
  var t, n;
794
- v == null || v(void 0), b(!1), (t = De.current) == null || t.clear(), (n = he.current) == null || n.clear();
795
+ v == null || v(void 0), b(!1), (t = De.current) == null || t.clear(), (n = ge.current) == null || n.clear();
795
796
  },
796
797
  children: "新会话"
797
798
  })]
798
799
  })]
799
800
  }), /* @__PURE__ */ d("div", {
800
801
  className: "footer-textarea",
801
- children: /* @__PURE__ */ d(on, {
802
- ref: pe,
803
- maxLength: ct,
804
- text: mt,
802
+ children: /* @__PURE__ */ d(nn, {
803
+ ref: he,
804
+ maxLength: dt,
805
+ text: gt,
805
806
  networkStatus: !1,
806
807
  loading: je,
807
808
  disabled: Ne || Te || H || je,
@@ -809,34 +810,34 @@ ${t}` : t, a = new Z(i, l, _.User, n);
809
810
  onChange: (t, n) => {
810
811
  Y(t);
811
812
  const l = n.getText().replace(/[\n\s]+$/, "");
812
- J(l), gt(l), Re || pt(!0);
813
+ J(l), ht(l), Re || ut(!0);
813
814
  },
814
815
  clearAction: /* @__PURE__ */ d(ae, {
815
816
  size: 0,
816
817
  children: /* @__PURE__ */ d(Q, {
817
818
  type: "link",
818
- disabled: ge || H,
819
+ disabled: me || H,
819
820
  ghost: !0,
820
- icon: /* @__PURE__ */ d(xe, {
821
+ icon: /* @__PURE__ */ d(re, {
821
822
  style: {
822
823
  fontSize: 22
823
824
  },
824
825
  type: "icon-qingchujiyi"
825
826
  }),
826
- onClick: () => Ft()
827
+ onClick: () => Nt()
827
828
  })
828
829
  })
829
830
  })
830
831
  })]
831
832
  })
832
- }), /* @__PURE__ */ d(rn, {
833
- tips: rt
833
+ }), /* @__PURE__ */ d(an, {
834
+ tips: at
834
835
  }), He && /* @__PURE__ */ d(fn, {
835
836
  isvisible: He,
836
- files: vt,
837
+ files: yt,
837
838
  sessionId: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
838
839
  onClose: (t) => {
839
- yt(!1), xt(!1);
840
+ mt(!1), bt(!1);
840
841
  }
841
842
  })]
842
843
  });