@glodon-aiot/agent-cli-ui 3.17.0-alpha.4 → 3.17.0-beta.6

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.
@@ -2,36 +2,36 @@ var An = Object.defineProperty, jn = Object.defineProperties;
2
2
  var $n = Object.getOwnPropertyDescriptors;
3
3
  var At = Object.getOwnPropertySymbols;
4
4
  var zn = Object.prototype.hasOwnProperty, Vn = Object.prototype.propertyIsEnumerable;
5
- var Ae = (k, u, i) => u in k ? An(k, u, { enumerable: !0, configurable: !0, writable: !0, value: i }) : k[u] = i, je = (k, u) => {
5
+ var Ae = (w, u, i) => u in w ? An(w, u, { enumerable: !0, configurable: !0, writable: !0, value: i }) : w[u] = i, je = (w, u) => {
6
6
  for (var i in u || (u = {}))
7
- zn.call(u, i) && Ae(k, i, u[i]);
7
+ zn.call(u, i) && Ae(w, i, u[i]);
8
8
  if (At)
9
9
  for (var i of At(u))
10
- Vn.call(u, i) && Ae(k, i, u[i]);
11
- return k;
12
- }, $e = (k, u) => jn(k, $n(u));
13
- var A = (k, u, i) => (Ae(k, typeof u != "symbol" ? u + "" : u, i), i);
14
- var j = (k, u, i) => new Promise((R, e) => {
10
+ Vn.call(u, i) && Ae(w, i, u[i]);
11
+ return w;
12
+ }, $e = (w, u) => jn(w, $n(u));
13
+ var j = (w, u, i) => (Ae(w, typeof u != "symbol" ? u + "" : u, i), i);
14
+ var $ = (w, u, i) => new Promise((U, e) => {
15
15
  var x = (P) => {
16
16
  try {
17
- w(i.next(P));
17
+ k(i.next(P));
18
18
  } catch (T) {
19
19
  e(T);
20
20
  }
21
21
  }, V = (P) => {
22
22
  try {
23
- w(i.throw(P));
23
+ k(i.throw(P));
24
24
  } catch (T) {
25
25
  e(T);
26
26
  }
27
- }, w = (P) => P.done ? R(P.value) : Promise.resolve(P.value).then(x, V);
28
- w((i = i.apply(k, u)).next());
27
+ }, k = (P) => P.done ? U(P.value) : Promise.resolve(P.value).then(x, V);
28
+ k((i = i.apply(w, u)).next());
29
29
  });
30
- import { jsx as f, jsxs as $, Fragment as Bn } from "react/jsx-runtime";
30
+ import { jsx as f, jsxs as R, Fragment as Bn } from "react/jsx-runtime";
31
31
  import { memo as _n, forwardRef as qn, useState as g, useRef as Y, useContext as Wn, useEffect as C, useMemo as Kn, useImperativeHandle as Yn } from "react";
32
- /* empty css */import { message as jt, Spin as $t, Divider as Qn, Button as G, Space as Ee, Upload as Sn, Tooltip as Xn, Popover as Gn, notification as se } from "antd";
32
+ /* empty css */import { message as jt, Spin as $t, Divider as Qn, Button as G, Space as Ne, Upload as Sn, Tooltip as Xn, Popover as Gn, notification as se } from "antd";
33
33
  import re from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as ae, ApplicationTypes as Q, ChatMessageRole as zt, PromptVariableType as Ne } from "@glodon-aiot/apis";
34
+ import { IHistoryRole as ae, ApplicationTypes as Q, ChatMessageRole as zt, PromptVariableType as Ee } from "@glodon-aiot/apis";
35
35
  import Wt from "./HistoryItem/index.mjs";
36
36
  import Kt from "dayjs";
37
37
  import { v4 as _e } from "uuid";
@@ -56,31 +56,31 @@ import hi from "./Tools/ConnectToNetwork/index.mjs";
56
56
  import mi from "./Tools/PromptManager/index.mjs";
57
57
  import { useSessionState as yi } from "../../hooks/useSessionState.mjs";
58
58
  import vi from "../../assets/icon.svg.mjs";
59
- const ki = _n(Wt), _t = {
59
+ const wi = _n(Wt), _t = {
60
60
  icon: vi,
61
61
  text: "今天我能帮你什么?"
62
62
  };
63
63
  class he {
64
- constructor(u, i, R, e, x) {
65
- A(this, "messageTime");
66
- A(this, "isWaiting");
67
- A(this, "messageId");
68
- A(this, "isContext");
69
- A(this, "actions");
70
- A(this, "reference");
71
- A(this, "isSensitive");
72
- A(this, "isSuspend");
73
- A(this, "imageContent");
64
+ constructor(u, i, U, e, x) {
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, "imageContent");
74
74
  // 新增:支持对话型应用的图片内容
75
- A(this, "comment");
76
- this.content = u, this.sessionId = i, this.role = R, this.files = e, this.content = u, this.role = R, this.sessionId = i, this.files = e, this.imageContent = x, this.messageTime = Kt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = _e(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
75
+ j(this, "comment");
76
+ this.content = u, this.sessionId = i, this.role = U, this.files = e, this.content = u, this.role = U, this.sessionId = i, this.files = e, this.imageContent = x, this.messageTime = Kt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = _e(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
77
77
  isAgree: 0
78
78
  };
79
79
  }
80
80
  }
81
- const qt = 10, Z = 5, Ve = 20, Be = (k, u, i, R) => {
82
- let e = k;
83
- if (R === Q.Agent) {
81
+ const qt = 10, Z = 5, Ve = 20, Be = (w, u, i, U) => {
82
+ let e = w;
83
+ if (U === Q.Agent) {
84
84
  if (i && i.length > 0) {
85
85
  const x = i.map((V) => `[${V.name.replace(/\.[^/.]+$/, "")}](${V.url})`).join(`
86
86
  `);
@@ -95,23 +95,23 @@ ${e}` : e;
95
95
  }
96
96
  }
97
97
  return e;
98
- }, wi = (k) => {
99
- const u = Math.floor(k / 3600), i = Math.floor(k % 3600 / 60), R = k % 60, e = (x) => String(x).padStart(2, "0");
100
- return `${e(u)}:${e(i)}:${e(R)}`;
101
- }, Ji = qn((k, u) => {
102
- var wt, bt, xt, Ct, It, Et, Nt, Lt, Pt, Tt, Dt, Ot, Rt, Ut;
98
+ }, ki = (w) => {
99
+ const u = Math.floor(w / 3600), i = Math.floor(w % 3600 / 60), U = w % 60, e = (x) => String(x).padStart(2, "0");
100
+ return `${e(u)}:${e(i)}:${e(U)}`;
101
+ }, Ji = qn((w, u) => {
102
+ var kt, bt, xt, Ct, It, Nt, Et, Lt, Pt, Tt, Dt, Ot, Rt, Ut;
103
103
  const {
104
104
  application: i,
105
- docViewerUrl: R = "",
105
+ docViewerUrl: U = "",
106
106
  currentSession: e,
107
107
  onCreateSession: x,
108
108
  embeddingService: V,
109
- setCurrentSession: w,
109
+ setCurrentSession: k,
110
110
  networkStatus: P,
111
111
  setNetworkStatus: T
112
- } = k, [y, E] = g([]), [Yt, me] = g(), [Le, qe] = g(), U = Y(null), {
113
- service: F,
114
- agentClient: N,
112
+ } = w, [y, N] = g([]), [Yt, me] = g(), [Le, qe] = g(), F = Y(null), {
113
+ service: M,
114
+ agentClient: E,
115
115
  depId: Qt,
116
116
  footer: St,
117
117
  transform: c,
@@ -127,11 +127,11 @@ ${e}` : e;
127
127
  sider: Zt,
128
128
  mode: Jt,
129
129
  silencedSeconds: Te
130
- } = Wn(Zn), [Ke, De] = g(!1), m = Y(y), Ye = Y(void 0), [en, tn] = g(0), [ce, ve] = g([]), [J, ke] = g([]), [Qe, Se] = g(0), [Xe, nn] = g(!1);
130
+ } = Wn(Zn), [Ke, De] = g(!1), m = Y(y), Ye = Y(void 0), [en, tn] = g(0), [ce, ve] = g([]), [J, we] = g([]), [Qe, Se] = g(0), [Xe, nn] = g(!1);
131
131
  C(() => {
132
132
  nn(Qe > 0);
133
133
  }, [Qe]);
134
- const we = Y(null), [Ge, on] = g([]), [Ze, ee] = g(!1), [Je, sn] = g(!1), [rn, an] = g(""), [ln, te] = g(), [ne, de] = g({}), fe = Y(null), et = Y(null), Oe = Y(null), [tt, cn] = g(!1), [dn, fn] = g([]), [gn, be] = g(!0), [un, pn] = g(!0), [nt, B] = g(!1), [Re, W] = g(!1), [it, hn] = g(!1), [M, ge] = g(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [mn, yn] = g(() => {
134
+ const ke = Y(null), [Ge, on] = g([]), [Ze, ee] = g(!1), [Je, sn] = g(!1), [rn, an] = g(""), [ln, te] = g(), [ne, de] = g({}), fe = Y(null), et = Y(null), Oe = Y(null), [tt, cn] = g(!1), [dn, fn] = g([]), [gn, be] = g(!0), [un, pn] = g(!0), [nt, B] = g(!1), [Re, W] = g(!1), [it, hn] = g(!1), [H, ge] = g(typeof (l == null ? void 0 : l.promptVariables) == "object" ? l.promptVariables.default || [] : []), [mn, yn] = g(() => {
135
135
  const t = typeof (l == null ? void 0 : l.knowledges) == "object" && l.knowledges.default || void 0;
136
136
  if (t) {
137
137
  if (Array.isArray(t) && t.some((a) => Array.isArray(a.fileIds) && a.fileIds.length === 0))
@@ -140,14 +140,14 @@ ${e}` : e;
140
140
  throw Error(`knowledges and fileIds total count cannot exceed ${Vt}`);
141
141
  }
142
142
  return t;
143
- }), [ot, S] = g(!1), [st, ue] = g(!1), [vn, pe] = g(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [rt, xe] = g(!1), [kn, K] = g(!1), [wn, bn] = g(null), [Ce, X] = g(!1), [at, lt] = g(!1), {
143
+ }), [ot, S] = g(!1), [st, ue] = g(!1), [vn, pe] = g(typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1), [rt, xe] = g(!1), [wn, K] = g(!1), [kn, bn] = g(null), [Ce, X] = g(!1), [at, lt] = g(!1), {
144
144
  isSwitchingToExistingSession: ct,
145
145
  setIsSwitchingToExistingSession: Ie
146
146
  } = yi(), ie = Y(null), [Ue, xn] = g("");
147
147
  C(() => {
148
148
  if (!Te)
149
149
  return;
150
- let t = wi(Te);
150
+ let t = ki(Te);
151
151
  xn(t);
152
152
  }, [Te]), C(() => {
153
153
  if (bn(e), e === null)
@@ -155,7 +155,7 @@ ${e}` : e;
155
155
  else if (e === void 0)
156
156
  K(!0);
157
157
  else {
158
- if (wn === null) {
158
+ if (kn === null) {
159
159
  if (ct) {
160
160
  K(!0), Ie(!1);
161
161
  return;
@@ -167,26 +167,26 @@ ${e}` : e;
167
167
  }
168
168
  }, [e, e == null ? void 0 : e.ready, ct]), C(() => {
169
169
  var s, a;
170
- e && (m.current = []), E([]);
171
- const t = U.current;
170
+ e && (m.current = []), N([]);
171
+ const t = F.current;
172
172
  if (t && t.scrollTo({
173
173
  top: 0
174
174
  }), !((s = e == null ? void 0 : e.data) != null && s.id))
175
175
  return;
176
176
  if (W(!1), B(!1), (a = e.messages) != null && a.length) {
177
177
  const d = [...e.messages.filter((r) => r == null ? void 0 : r.messageId)].reverse();
178
- m.current = [...d], E([...d]), K(!1);
178
+ m.current = [...d], N([...d]), K(!1);
179
179
  }
180
180
  const n = (o) => {
181
181
  var d;
182
- (d = e == null ? void 0 : e.data) != null && d.id && (m.current = [...o].reverse(), E([...o].reverse()), !o || o.length < 10 ? ue(!1) : ue(!0), K(!1), We && We({
182
+ (d = e == null ? void 0 : e.data) != null && d.id && (m.current = [...o].reverse(), N([...o].reverse()), !o || o.length < 10 ? ue(!1) : ue(!0), K(!1), We && We({
183
183
  applicationId: i.id,
184
184
  sessionId: e.data.id,
185
185
  histories: o
186
186
  }));
187
187
  };
188
188
  return e.addEventListener("history:loaded", n), () => {
189
- m.current = [], E([]), e == null || e.removeEventListener("history:loaded", n);
189
+ m.current = [], N([]), e == null || e.removeEventListener("history:loaded", n);
190
190
  };
191
191
  }, [e]), C(() => {
192
192
  const t = () => {
@@ -227,16 +227,16 @@ ${e}` : e;
227
227
  } else
228
228
  e.clear().then(() => {
229
229
  const a = new he("", t, ae.System);
230
- a.isContext = !0, E([a, ...y]);
230
+ a.isContext = !0, N([a, ...y]);
231
231
  });
232
232
  };
233
233
  C(() => {
234
- i != null && i.id && (F == null || F.getRecommendQues(i.id).then((t) => {
234
+ i != null && i.id && (M == null || M.getRecommendQues(i.id).then((t) => {
235
235
  on(t);
236
236
  }));
237
237
  }, [Qt, i]);
238
- const dt = (t) => j(void 0, null, function* () {
239
- var H, D;
238
+ const dt = (t) => $(void 0, null, function* () {
239
+ var A, D;
240
240
  if (O) {
241
241
  L("error", "发送功能被禁用");
242
242
  return;
@@ -246,12 +246,12 @@ ${e}` : e;
246
246
  L("error", "请输入你想问的");
247
247
  return;
248
248
  }
249
- if (!(M == null ? void 0 : M.every((b) => !!(b != null && b.value))))
249
+ if (!(H == null ? void 0 : H.every((b) => !!(b != null && b.value))))
250
250
  if (c != null && c.promptVariables) {
251
251
  L("error", "变量值不能为空");
252
252
  return;
253
253
  } else
254
- console.error("变量值不能为空", M == null ? void 0 : M.map((b) => !!(b != null && b.value)));
254
+ console.error("变量值不能为空", H == null ? void 0 : H.map((b) => !!(b != null && b.value)));
255
255
  if (Re) {
256
256
  L("error", "正在回复中");
257
257
  return;
@@ -268,8 +268,8 @@ ${e}` : e;
268
268
  L("error", "正在上传图片");
269
269
  return;
270
270
  }
271
- ve([]), ke([]);
272
- const a = (H = e == null ? void 0 : e.data) == null ? void 0 : H.id;
271
+ ve([]), we([]);
272
+ const a = (A = e == null ? void 0 : e.data) == null ? void 0 : A.id;
273
273
  if (!a) {
274
274
  if (Ce)
275
275
  return;
@@ -278,7 +278,7 @@ ${e}` : e;
278
278
  }).then((b) => {
279
279
  var p, _;
280
280
  S(!0), T(!!((p = b.data) != null && p.netOpen)), pe(!!((_ = b.data) != null && _.enableNetOpen)), Fe(b).then(() => {
281
- w == null || w(b), S(!1), qe(n);
281
+ k == null || k(b), S(!1), qe(n);
282
282
  });
283
283
  }).catch((b) => {
284
284
  X(!1);
@@ -318,10 +318,10 @@ ${e}` : e;
318
318
  return;
319
319
  }
320
320
  ((D = ne[a]) == null ? void 0 : D.length) > 0 ? In(r) : Me(r);
321
- }), Fe = (t) => new Promise((n, s) => j(void 0, null, function* () {
322
- const d = (t == null ? void 0 : t.promptVariables).filter((r) => r.type ? !((r.type === Ne.User || r.type === void 0) && r.key === "query") && !((r.type === Ne.System || r.type === void 0) && r.key === "datetime") : r.key !== "query").map((r) => {
321
+ }), Fe = (t) => new Promise((n, s) => $(void 0, null, function* () {
322
+ const d = (t == null ? void 0 : t.promptVariables).filter((r) => r.type ? !((r.type === Ee.User || r.type === void 0) && r.key === "query") && !((r.type === Ee.System || r.type === void 0) && r.key === "datetime") : r.key !== "query").map((r) => {
323
323
  var v;
324
- const h = (v = M.find((I) => I.key === r.key && I.type === r.type)) == null ? void 0 : v.value;
324
+ const h = (v = H.find((I) => I.key === r.key && I.type === r.type)) == null ? void 0 : v.value;
325
325
  return r.value = h || "", r;
326
326
  });
327
327
  ge(d.sort((r, h) => r.key.localeCompare(h.key))), yield t == null ? void 0 : t.setPromptVariables(d).catch((r) => {
@@ -340,7 +340,7 @@ ${e}` : e;
340
340
  C(() => {
341
341
  if (!Le || !e)
342
342
  return;
343
- const t = Le, n = () => j(void 0, null, function* () {
343
+ const t = Le, n = () => $(void 0, null, function* () {
344
344
  xe(!0);
345
345
  const s = Be(t, J, ne[e.id], (i == null ? void 0 : i.type) || 0);
346
346
  let a;
@@ -368,9 +368,9 @@ ${e}` : e;
368
368
  e == null || e.removeEventListener("ready", n);
369
369
  };
370
370
  }, [Le, e]);
371
- const Me = (t, n) => j(void 0, null, function* () {
372
- var H, D, b;
373
- const s = (H = e == null ? void 0 : e.data) == null ? void 0 : H.id;
371
+ const Me = (t, n) => $(void 0, null, function* () {
372
+ var A, D, b;
373
+ const s = (A = e == null ? void 0 : e.data) == null ? void 0 : A.id;
374
374
  if (!s)
375
375
  return;
376
376
  W(!0), B(!0);
@@ -391,19 +391,19 @@ ${e}` : e;
391
391
  o
392
392
  // 新增:传入图片内容
393
393
  );
394
- me(void 0), te(void 0), m.current = [d, ...y], E(m.current), i.id && ye && ye({
394
+ me(void 0), te(void 0), m.current = [d, ...y], N(m.current), i.id && ye && ye({
395
395
  applicationId: i.id,
396
396
  sessionId: s,
397
397
  message: d
398
398
  });
399
399
  const r = new he("", s, ae.System);
400
- r.isWaiting = !0, m.current = [r, ...m.current], E(m.current);
400
+ r.isWaiting = !0, m.current = [r, ...m.current], N(m.current);
401
401
  const h = (n == null ? void 0 : n.map((p) => p.id)) || [], v = {
402
402
  stream: Jn.stream,
403
403
  referenceFirst: !1
404
404
  };
405
405
  if (c != null && c.promptVariables) {
406
- const p = M == null ? void 0 : M.reduce((_, oe) => (_[oe.key] = oe.value, _), {});
406
+ const p = H == null ? void 0 : H.reduce((_, oe) => (_[oe.key] = oe.value, _), {});
407
407
  v.formatValues = p;
408
408
  }
409
409
  if (c != null && c.knowledges) {
@@ -417,7 +417,7 @@ ${e}` : e;
417
417
  };
418
418
  o && o.length > 0 && (I.imageContent = o), yield e.send(I, v), de({
419
419
  [s]: []
420
- }), (b = fe.current) == null || b.update(), ve([]), ke([]), X(!1);
420
+ }), (b = fe.current) == null || b.update(), ve([]), we([]), X(!1);
421
421
  });
422
422
  C(() => {
423
423
  var a;
@@ -427,7 +427,7 @@ ${e}` : e;
427
427
  const n = (o) => {
428
428
  if (!o.sessionId || o.sessionId && o.sessionId !== Ye.current || o.role === ae.User)
429
429
  return;
430
- if (o.index === -1 && o.code !== 200 && o.code !== 11915 && (B(!1), W(!1), m.current = m.current.filter((h) => !h.isWaiting), E([...m.current]), m.current = [...m.current], o.content)) {
430
+ if (o.index === -1 && o.code !== 200 && o.code !== 11915 && (B(!1), W(!1), m.current = m.current.filter((h) => !h.isWaiting), N([...m.current]), m.current = [...m.current], o.content)) {
431
431
  se.config({
432
432
  getContainer: () => (z == null ? void 0 : z.current) || document.body,
433
433
  prefixCls: "gbot-notification"
@@ -440,11 +440,11 @@ ${e}` : e;
440
440
  return;
441
441
  }
442
442
  const d = o.actions || [], r = new he(o.content, t, ae.Robot);
443
- r.messageId = o.messageId || _e(), r.reasoningContent = o.reasoningContent, r.searchReference = o.searchReference, r.thinkingSecs = o.thinkingSecs, r.thinkingStatus = o.thinkingStatus, r.actions = d, r.isLoading = !0, r.searchingStatus = o.searchingStatus, m.current = m.current.filter((h) => !h.isWaiting).filter((h) => !h.isReplying), o.index === void 0 && E([r, ...m.current]), o.code === 11915 && (B(!1), W(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, E([r, ...m.current])), o.index === -2 && (B(!1), W(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, E([r, ...m.current])), o.index === -1 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, E([r, ...m.current]), i.id && ye && ye({
443
+ r.messageId = o.messageId || _e(), r.reasoningContent = o.reasoningContent, r.searchReference = o.searchReference, r.thinkingSecs = o.thinkingSecs, r.thinkingStatus = o.thinkingStatus, r.actions = d, r.isLoading = !0, r.searchingStatus = o.searchingStatus, m.current = m.current.filter((h) => !h.isWaiting).filter((h) => !h.isReplying), o.index === void 0 && N([r, ...m.current]), o.code === 11915 && (B(!1), W(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, N([r, ...m.current])), o.index === -2 && (B(!1), W(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, N([r, ...m.current])), o.index === -1 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, N([r, ...m.current]), i.id && ye && ye({
444
444
  applicationId: i.id,
445
445
  sessionId: t,
446
446
  message: r
447
- })), o.index === -3 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, r.relatedQuesion = o.relatedQuesion, E([r, ...m.current]));
447
+ })), o.index === -3 && (B(!1), W(!1), r.isLoading = !1, r.reference = o.reference, r.relatedQuesion = o.relatedQuesion, N([r, ...m.current]));
448
448
  }, s = () => {
449
449
  e.addEventListener("message:updated", n);
450
450
  };
@@ -463,11 +463,11 @@ ${e}` : e;
463
463
  e == null || e.removeEventListener("frozen", t);
464
464
  };
465
465
  }, [e]), C(() => {
466
- if (!N)
466
+ if (!E)
467
467
  return;
468
- const t = N.questionContextMaxLength || 4e3;
468
+ const t = E.questionContextMaxLength || 4e3;
469
469
  tn(t);
470
- }, [N, F]), C(() => {
470
+ }, [E, M]), C(() => {
471
471
  Pe && te(Pe.text);
472
472
  }, [Pe]), C(() => {
473
473
  jt.config({
@@ -485,15 +485,15 @@ ${e}` : e;
485
485
  }, ft = (t) => {
486
486
  const n = t.size;
487
487
  return n <= 0 ? (L("error", "该文件为空,请重新上传"), !1) : n > Ve * ei ? (L("error", `图片须小于${Ve}M`), !1) : (ve((s) => s.length >= Z ? (L("warning", `图片最多上传${Z}张`), s) : [...s, t]), !1);
488
- }, En = () => {
488
+ }, Nn = () => {
489
489
  var t;
490
490
  return (i.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || i.type === Q.Dialog && ((t = i.arrange) == null ? void 0 : t.length) && !!i.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && !O;
491
- }, Nn = () => !!V && (c == null ? void 0 : c.fileUpload) && (i == null ? void 0 : i.id) && !O, gt = (t) => {
491
+ }, En = () => !!V && (c == null ? void 0 : c.fileUpload) && (i == null ? void 0 : i.id) && !O, gt = (t) => {
492
492
  var D, b;
493
493
  const n = Array.from(t || []).filter(Boolean);
494
494
  if (!n.length)
495
495
  return;
496
- const s = En(), a = Nn(), o = [], d = [];
496
+ const s = Nn(), a = En(), o = [], d = [];
497
497
  let r = 0, h = 0, v = 0;
498
498
  n.forEach((p) => {
499
499
  var Ft, Mt, Ht;
@@ -508,9 +508,9 @@ ${e}` : e;
508
508
  }
509
509
  v++;
510
510
  });
511
- const I = [], H = r + h + v;
511
+ const I = [], A = r + h + v;
512
512
  if (!a && !s)
513
- H && I.push(`当前不支持上传文件/图片,已忽略${H}个文件`);
513
+ A && I.push(`当前不支持上传文件/图片,已忽略${A}个文件`);
514
514
  else if (a && !s) {
515
515
  const p = r + v;
516
516
  p && I.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${p}个其他类型文件`);
@@ -535,19 +535,19 @@ ${e}` : e;
535
535
  t.preventDefault(), t.stopPropagation();
536
536
  const n = (s = t.dataTransfer) == null ? void 0 : s.files;
537
537
  n && n.length && gt(n);
538
- }, mt = () => j(void 0, null, function* () {
538
+ }, mt = () => $(void 0, null, function* () {
539
539
  var t;
540
540
  return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ie.current || (ie.current = new Promise((n, s) => {
541
541
  S(!0), x == null || x({
542
542
  netOpen: P ? le.OPEN : le.CLOSE
543
543
  }).then((a) => {
544
544
  var o, d;
545
- w == null || w(a), S(!1), T(!!((o = a.data) != null && o.netOpen)), pe(!!((d = a.data) != null && d.enableNetOpen)), Fe(a), n(a);
545
+ k == null || k(a), S(!1), T(!!((o = a.data) != null && o.netOpen)), pe(!!((d = a.data) != null && d.enableNetOpen)), Fe(a), n(a);
546
546
  }).catch((a) => {
547
547
  ie.current = null, s(a);
548
548
  });
549
549
  })), ie.current);
550
- }), Ln = (t) => j(void 0, null, function* () {
550
+ }), Ln = (t) => $(void 0, null, function* () {
551
551
  const n = yield mt();
552
552
  return Pn(n, t);
553
553
  }), Pn = (t, n) => {
@@ -560,10 +560,10 @@ ${e}` : e;
560
560
  knowledgeId: ((d = t.data) == null ? void 0 : d.id) || "",
561
561
  type: 1
562
562
  };
563
- F == null || F.postTicket(o).then((r) => {
564
- F.uploadMinioFile(r.minio, n).then(() => {
565
- var H, D;
566
- const h = (H = r.minio.endpoints) == null ? void 0 : H[0], v = r.minio.bucket, I = (D = r.minio.fileKeys) == null ? void 0 : D[0];
563
+ M == null || M.postTicket(o).then((r) => {
564
+ M.uploadMinioFile(r.minio, n).then(() => {
565
+ var A, D;
566
+ const h = (A = r.minio.endpoints) == null ? void 0 : A[0], v = r.minio.bucket, I = (D = r.minio.fileKeys) == null ? void 0 : D[0];
567
567
  a(`${r.minio.useSSL ? "https:" : location.protocol}//${h}/${v}/${I}`);
568
568
  }).catch(() => {
569
569
  });
@@ -572,7 +572,7 @@ ${e}` : e;
572
572
  });
573
573
  };
574
574
  C(() => {
575
- const t = U.current;
575
+ const t = F.current;
576
576
  t && !it && t.scrollTo({
577
577
  top: t.scrollHeight
578
578
  });
@@ -583,7 +583,7 @@ ${e}` : e;
583
583
  const a = $e(je({}, n.file), {
584
584
  type: 1
585
585
  });
586
- F == null || F.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, a).finally(() => {
586
+ M == null || M.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, a).finally(() => {
587
587
  var o;
588
588
  (o = fe.current) == null || o.update().finally(s);
589
589
  });
@@ -591,7 +591,7 @@ ${e}` : e;
591
591
  var t;
592
592
  (t = e == null ? void 0 : e.data) != null && t.id && (B(!1), e.suspend());
593
593
  }, Dn = (t) => {
594
- const n = U.current;
594
+ const n = F.current;
595
595
  n && setTimeout(() => {
596
596
  n.scrollTo({
597
597
  top: n.scrollHeight,
@@ -599,22 +599,22 @@ ${e}` : e;
599
599
  });
600
600
  }, t == null ? void 0 : t.ms);
601
601
  }, On = () => {
602
- if (!U.current)
602
+ if (!F.current)
603
603
  return;
604
- const t = U.current.scrollTop <= -80;
604
+ const t = F.current.scrollTop <= -80;
605
605
  hn(t);
606
606
  }, Rn = ze((t) => {
607
607
  var n, s;
608
- (n = we.current) == null || n.update(t), (s = we.current) == null || s.focus();
608
+ (n = ke.current) == null || n.update(t), (s = ke.current) == null || s.focus();
609
609
  }), Un = ze((t) => {
610
610
  dt(t);
611
611
  }), Fn = ze(() => {
612
612
  var n;
613
613
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
614
614
  return;
615
- m.current = [...y.slice(1, y.length)], E(m.current);
615
+ m.current = [...y.slice(1, y.length)], N(m.current);
616
616
  const t = new he("", e.data.id, ae.System);
617
- t.isWaiting = !0, m.current = [t, ...m.current], E(m.current), W(!0), B(!0), e.answerAgain();
617
+ t.isWaiting = !0, m.current = [t, ...m.current], N(m.current), W(!0), B(!0), e.answerAgain();
618
618
  });
619
619
  C(() => {
620
620
  var t, n;
@@ -634,9 +634,9 @@ ${e}` : e;
634
634
  ue(!1);
635
635
  return;
636
636
  }
637
- o.length < 10 ? ue(!1) : ue(!0), E([...y, ...o.reverse()]);
637
+ o.length < 10 ? ue(!1) : ue(!0), N([...y, ...o.reverse()]);
638
638
  });
639
- }, Hn = (t) => j(void 0, null, function* () {
639
+ }, Hn = (t) => $(void 0, null, function* () {
640
640
  var n, s;
641
641
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
642
642
  T(t);
@@ -645,7 +645,7 @@ ${e}` : e;
645
645
  return;
646
646
  T(t);
647
647
  }
648
- }), He = () => j(void 0, null, function* () {
648
+ }), He = () => $(void 0, null, function* () {
649
649
  e ? e.fetchData().then((t) => {
650
650
  var n;
651
651
  (n = e == null ? void 0 : e.data) != null && n.id && (T(t.netOpen), pe(t.enableNetOpen));
@@ -656,8 +656,8 @@ ${e}` : e;
656
656
  }, [e]), C(() => {
657
657
  requestAnimationFrame(() => {
658
658
  var n, s;
659
- if (U.current) {
660
- const a = document.getElementById("chat-main"), o = (n = U.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), d = (s = U.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
659
+ if (F.current) {
660
+ const a = document.getElementById("chat-main"), o = (n = F.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), d = (s = F.current) == null ? void 0 : s.querySelector(".infinite-scroll-component");
661
661
  if (!o || !d || !a)
662
662
  return;
663
663
  const r = a.offsetHeight;
@@ -676,7 +676,7 @@ ${e}` : e;
676
676
  if (e)
677
677
  return;
678
678
  const t = () => {
679
- const a = ((N == null ? void 0 : N.promptVariables) || []).filter((o) => o.type ? !(o.type === Ne.User && o.key === "query") && !(o.type === Ne.System && o.key === "datetime") && o.status === 1 : o.key !== "query" && o.status === 1).map((o, d) => {
679
+ const a = ((E == null ? void 0 : E.promptVariables) || []).filter((o) => o.type ? !(o.type === Ee.User && o.key === "query") && !(o.type === Ee.System && o.key === "datetime") && o.status === 1 : o.key !== "query" && o.status === 1).map((o, d) => {
680
680
  var h, v;
681
681
  let r = "";
682
682
  return typeof (l == null ? void 0 : l.promptVariables) == "object" && (r = ((v = (h = l.promptVariables.default) == null ? void 0 : h.find((I) => I.key === o.key && I.type === o.type)) == null ? void 0 : v.value) || ""), {
@@ -689,16 +689,16 @@ ${e}` : e;
689
689
  });
690
690
  ge([...a].sort((o, d) => o.key.localeCompare(d.key)));
691
691
  };
692
- return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
693
- N == null || N.removeEventListener("ready", t);
692
+ return E != null && E.ready ? t() : E == null || E.addEventListener("ready", t), () => {
693
+ E == null || E.removeEventListener("ready", t);
694
694
  };
695
- }, [e, N, l == null ? void 0 : l.promptVariables]);
695
+ }, [e, E, l == null ? void 0 : l.promptVariables]);
696
696
  const vt = () => x == null ? void 0 : x({
697
697
  netOpen: P ? le.OPEN : le.CLOSE
698
698
  }).then((t) => {
699
699
  var n, s;
700
- return w == null || w(t), S(!1), T(!!((n = t.data) != null && n.netOpen)), pe(!!((s = t.data) != null && s.enableNetOpen)), Fe(t), t;
701
- }), kt = Kn(() => {
700
+ return k == null || k(t), S(!1), T(!!((n = t.data) != null && n.netOpen)), pe(!!((s = t.data) != null && s.enableNetOpen)), Fe(t), t;
701
+ }), wt = Kn(() => {
702
702
  var t;
703
703
  return i.arrange && ((t = i.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ f(Wt, {
704
704
  application: i,
@@ -721,7 +721,7 @@ ${e}` : e;
721
721
  return Yn(u, () => ({
722
722
  getCurrentInputText: () => {
723
723
  var t;
724
- return (t = we.current) == null ? void 0 : t.getCurrentText();
724
+ return (t = ke.current) == null ? void 0 : t.getCurrentText();
725
725
  }
726
726
  })), C(() => {
727
727
  var n;
@@ -729,20 +729,20 @@ ${e}` : e;
729
729
  t && de((s) => $e(je({}, s), {
730
730
  [t]: []
731
731
  }));
732
- }, [(wt = e == null ? void 0 : e.data) == null ? void 0 : wt.id]), /* @__PURE__ */ $("div", {
732
+ }, [(kt = e == null ? void 0 : e.data) == null ? void 0 : kt.id]), /* @__PURE__ */ R("div", {
733
733
  className: "agent-chat",
734
- children: [kn ? /* @__PURE__ */ f("div", {
734
+ children: [wn ? /* @__PURE__ */ f("div", {
735
735
  className: "session-loading",
736
736
  children: /* @__PURE__ */ f($t, {})
737
- }) : /* @__PURE__ */ $(Bn, {
737
+ }) : /* @__PURE__ */ R(Bn, {
738
738
  children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ f(fi, {
739
739
  ref: et,
740
740
  appId: i.id,
741
741
  currentSession: e,
742
- promptVariables: M,
742
+ promptVariables: H,
743
743
  setPromptVariables: ge,
744
- setCurrentSession: w
745
- }), /* @__PURE__ */ $("div", {
744
+ setCurrentSession: k
745
+ }), /* @__PURE__ */ R("div", {
746
746
  className: "chat-main",
747
747
  id: "chat-main",
748
748
  style: Xt,
@@ -755,9 +755,9 @@ ${e}` : e;
755
755
  display: "flex",
756
756
  flexDirection: "column-reverse"
757
757
  },
758
- ref: U,
758
+ ref: F,
759
759
  onScroll: On,
760
- children: (bt = e == null ? void 0 : e.data) != null && bt.id && (y != null && y.length) ? /* @__PURE__ */ $(pi, {
760
+ children: (bt = e == null ? void 0 : e.data) != null && bt.id && (y != null && y.length) ? /* @__PURE__ */ R(pi, {
761
761
  dataLength: y.length,
762
762
  next: Mn,
763
763
  style: {
@@ -767,7 +767,7 @@ ${e}` : e;
767
767
  },
768
768
  inverse: !0,
769
769
  endMessage: y.length > qt && // 少于一页不展示这个提示
770
- ((xt = U.current) != null && xt.scrollTop) && ((Ct = U.current) == null ? void 0 : Ct.scrollTop) < -10 ? /* @__PURE__ */ f(Qn, {
770
+ ((xt = F.current) != null && xt.scrollTop) && ((Ct = F.current) == null ? void 0 : Ct.scrollTop) < -10 ? /* @__PURE__ */ f(Qn, {
771
771
  plain: !0,
772
772
  children: "没有更多数据了"
773
773
  }) : null,
@@ -781,31 +781,31 @@ ${e}` : e;
781
781
  children: /* @__PURE__ */ f($t, {})
782
782
  }),
783
783
  scrollableTarget: "scrollableDiv",
784
- children: [y.map((t, n) => /* @__PURE__ */ f(ki, {
784
+ children: [y.map((t, n) => /* @__PURE__ */ f(wi, {
785
785
  application: i,
786
786
  currentSession: e,
787
787
  history: t,
788
- docViewerUrl: R,
788
+ docViewerUrl: U,
789
789
  isLastHistory: n === 0,
790
790
  onRelatedClick: Un,
791
791
  onAgainClick: Fn,
792
792
  onEditClick: Rn,
793
793
  markdown: l == null ? void 0 : l.markdown
794
- }, t.messageId + n)), !st && kt]
795
- }) : /* @__PURE__ */ $("div", {
794
+ }, t.messageId + n)), !st && wt]
795
+ }) : /* @__PURE__ */ R("div", {
796
796
  className: "main-empty",
797
797
  children: [(l == null ? void 0 : l.greeting) !== !1 && /* @__PURE__ */ f(ri, {
798
798
  text: (
799
799
  // 第一优先级:features配置
800
800
  l != null && l.greeting && typeof l.greeting == "object" && l.greeting.text !== void 0 ? l.greeting.text : (
801
801
  // 第二优先级:application.arrange[0].greetings
802
- (It = i.arrange) != null && It.length && ((Et = i.arrange[0]) != null && Et.greetings) ? i.arrange[0].greetings : (
802
+ (It = i.arrange) != null && It.length && ((Nt = i.arrange[0]) != null && Nt.greetings) ? i.arrange[0].greetings : (
803
803
  // 第三优先级:默认文本
804
804
  _t.text
805
805
  )
806
806
  )
807
807
  ),
808
- icon: l === void 0 || l.greeting === !0 || ((Nt = l.greeting) == null ? void 0 : Nt.icon) === void 0 ? Gt || _t.icon : l.greeting.icon,
808
+ icon: l === void 0 || l.greeting === !0 || ((Et = l.greeting) == null ? void 0 : Et.icon) === void 0 ? Gt || _t.icon : l.greeting.icon,
809
809
  children: !!Ge.length && (((l == null ? void 0 : l.greeting) === void 0 || (l == null ? void 0 : l.greeting)) === !0 || typeof (l == null ? void 0 : l.greeting) == "object" && l.greeting.questions !== !1) && /* @__PURE__ */ f(si, {
810
810
  ref: Oe,
811
811
  sid: (Lt = e == null ? void 0 : e.data) == null ? void 0 : Lt.id,
@@ -831,7 +831,7 @@ ${e}` : e;
831
831
  }) : n ? ee(!1) : (ee(!1), S(!0), vt());
832
832
  }
833
833
  })
834
- }), kt]
834
+ }), wt]
835
835
  })
836
836
  }), nt && /* @__PURE__ */ f("div", {
837
837
  className: "session-stop",
@@ -869,7 +869,7 @@ ${e}` : e;
869
869
  })]
870
870
  }), /* @__PURE__ */ f("div", {
871
871
  className: "chat-footer",
872
- children: /* @__PURE__ */ $("div", {
872
+ children: /* @__PURE__ */ R("div", {
873
873
  className: "chat-footer-input",
874
874
  children: [ce.length > 0 && /* @__PURE__ */ f("div", {
875
875
  className: "input-files",
@@ -877,7 +877,7 @@ ${e}` : e;
877
877
  className: "thumb-40",
878
878
  file: t,
879
879
  actions: {
880
- upload: (s) => j(void 0, null, function* () {
880
+ upload: (s) => $(void 0, null, function* () {
881
881
  Se((a) => a + 1);
882
882
  try {
883
883
  return yield Ln(s);
@@ -886,36 +886,54 @@ ${e}` : e;
886
886
  }
887
887
  }),
888
888
  remove: () => {
889
- ve((s) => s.filter((a, o) => o !== n)), ke((s) => s.filter((a, o) => o !== n));
889
+ ve((s) => s.filter((a, o) => o !== n)), we((s) => s.filter((a, o) => o !== n));
890
890
  }
891
891
  },
892
892
  onUrlChange: (s) => {
893
- ke((a) => {
893
+ we((a) => {
894
894
  const o = [...a];
895
895
  return o[n] = s, o;
896
896
  });
897
897
  }
898
898
  }, n))
899
- }), /* @__PURE__ */ $(Ee, {
900
- className: "footer-upload-action",
901
- onClick: (t) => t.preventDefault(),
902
- children: [/* @__PURE__ */ $(Ee, {
903
- children: [(i.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || i.type === Q.Dialog && ((Pt = i.arrange) == null ? void 0 : Pt.length) && !!i.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && /* @__PURE__ */ f(Sn, {
904
- multiple: !0,
905
- disabled: ce.length >= Z || O,
906
- accept: ".jpg, .png, .jpeg,.bmp",
907
- listType: "picture-card",
908
- beforeUpload: ft,
909
- className: "footer-upload-picture",
910
- showUploadList: !1,
911
- children: ce.length < Z ? /* @__PURE__ */ f(Xn, {
912
- placement: "topLeft",
913
- overlayClassName: "footer-upload-tooltip",
914
- title: /* @__PURE__ */ f("div", {
915
- children: `支持上传.jpg .png .jpeg
899
+ }), /* @__PURE__ */ R("div", {
900
+ className: "footer-upload-action-wrapper",
901
+ children: [/* @__PURE__ */ R(Ne, {
902
+ className: "footer-upload-action",
903
+ onClick: (t) => t.preventDefault(),
904
+ children: [/* @__PURE__ */ R(Ne, {
905
+ children: [(i.type === Q.Agent && (c == null ? void 0 : c.imageUpload) || i.type === Q.Dialog && ((Pt = i.arrange) == null ? void 0 : Pt.length) && !!i.arrange[0].visionOpen && (c == null ? void 0 : c.imageUpload)) && /* @__PURE__ */ f(Sn, {
906
+ multiple: !0,
907
+ disabled: ce.length >= Z || O,
908
+ accept: ".jpg, .png, .jpeg,.bmp",
909
+ listType: "picture-card",
910
+ beforeUpload: ft,
911
+ className: "footer-upload-picture",
912
+ showUploadList: !1,
913
+ children: ce.length < Z ? /* @__PURE__ */ f(Xn, {
914
+ placement: "topLeft",
915
+ overlayClassName: "footer-upload-tooltip",
916
+ title: /* @__PURE__ */ f("div", {
917
+ children: `支持上传.jpg .png .jpeg
916
918
  .bmp格式的图片数据,单文件最大${Ve}M,最多${Z}张`
917
- }),
918
- children: /* @__PURE__ */ f(G, {
919
+ }),
920
+ children: /* @__PURE__ */ f(G, {
921
+ type: "text",
922
+ className: "camera-out-btn",
923
+ style: {
924
+ width: "22px",
925
+ position: "relative",
926
+ bottom: "-2px"
927
+ },
928
+ icon: /* @__PURE__ */ f(re, {
929
+ type: "icon-shangchuantupian",
930
+ className: "icon-tianjia",
931
+ style: {
932
+ fontSize: "22px"
933
+ }
934
+ })
935
+ })
936
+ }) : /* @__PURE__ */ f(G, {
919
937
  type: "text",
920
938
  className: "camera-out-btn",
921
939
  style: {
@@ -923,6 +941,7 @@ ${e}` : e;
923
941
  position: "relative",
924
942
  bottom: "-2px"
925
943
  },
944
+ disabled: !0,
926
945
  icon: /* @__PURE__ */ f(re, {
927
946
  type: "icon-shangchuantupian",
928
947
  className: "icon-tianjia",
@@ -931,129 +950,113 @@ ${e}` : e;
931
950
  }
932
951
  })
933
952
  })
934
- }) : /* @__PURE__ */ f(G, {
935
- type: "text",
936
- className: "camera-out-btn",
937
- style: {
938
- width: "22px",
939
- position: "relative",
940
- bottom: "-2px"
953
+ }), V && (c != null && c.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ f(ci, {
954
+ appId: i == null ? void 0 : i.id,
955
+ ref: fe,
956
+ isFirstSession: ot,
957
+ docViewerUrl: U,
958
+ onStatusChange: (t) => $(void 0, null, function* () {
959
+ t !== "process" ? (be(!0), He()) : be(!1);
960
+ }),
961
+ createSession: () => mt().then((t) => {
962
+ var s;
963
+ return ((s = t.data) == null ? void 0 : s.id) || "";
964
+ }),
965
+ sid: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
966
+ disabled: Re || O,
967
+ afterFileAdd: (t, n) => {
968
+ n && de((s) => {
969
+ const a = s[n] || [];
970
+ return {
971
+ [n]: [...a, t]
972
+ };
973
+ });
941
974
  },
942
- disabled: !0,
943
- icon: /* @__PURE__ */ f(re, {
944
- type: "icon-shangchuantupian",
945
- className: "icon-tianjia",
946
- style: {
947
- fontSize: "22px"
948
- }
949
- })
950
- })
951
- }), V && (c != null && c.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ f(ci, {
952
- appId: i == null ? void 0 : i.id,
953
- ref: fe,
954
- isFirstSession: ot,
955
- docViewerUrl: R,
956
- onStatusChange: (t) => j(void 0, null, function* () {
957
- t !== "process" ? (be(!0), He()) : be(!1);
958
- }),
959
- createSession: () => mt().then((t) => {
960
- var s;
961
- return ((s = t.data) == null ? void 0 : s.id) || "";
962
- }),
963
- sid: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
964
- disabled: Re || O,
965
- afterFileAdd: (t, n) => {
966
- n && de((s) => {
967
- const a = s[n] || [];
968
- return {
969
- [n]: [...a, t]
970
- };
971
- });
972
- },
973
- afterFileDelete: (t) => {
974
- var s;
975
- const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
976
- n && de((a) => {
977
- const o = a[n] || [];
978
- return {
979
- [n]: o.filter((d) => d.id !== t)
980
- };
981
- });
982
- },
983
- onFileListChange: (t) => {
984
- fn(t);
985
- },
986
- shouldContinue: un,
987
- afterFilesClear: () => {
988
- var n;
989
- const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
990
- t && (de({
991
- [t]: []
992
- }), He());
993
- }
994
- }) : null, (c == null ? void 0 : c.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ f(mi, {
995
- appId: i.id,
996
- list: [],
997
- search: Je ? rn : "",
998
- onPromptSelect: (t) => {
999
- te(t.context), me(t.context);
1000
- },
1001
- disabled: O
1002
- })]
1003
- }), /* @__PURE__ */ $(Ee, {
1004
- children: [(c == null ? void 0 : c.connectNetwork) && i.type === Q.Dialog && ((Dt = i.arrange) == null ? void 0 : Dt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ f(hi, {
1005
- sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
1006
- netStatus: P,
1007
- enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : vn,
1008
- disabledTip: e ? void 0 : "网络访问已被禁用",
1009
- onNetStatusChange: (t) => {
1010
- Hn(t);
1011
- }
1012
- }), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ f(gi, {
1013
- currentSessionId: (Rt = e == null ? void 0 : e.data) == null ? void 0 : Rt.id,
1014
- onSessionChange: (t, n) => {
1015
- te(void 0), Ie(!0), w == null || w(n);
1016
- },
1017
- disabled: O
1018
- }), Zt && Jt === "float" && /* @__PURE__ */ f("div", {
1019
- className: "session-history-drawer-component",
1020
- children: /* @__PURE__ */ f(Gn, {
1021
- placement: "topRight",
1022
- showArrow: !1,
1023
- overlayClassName: "session-history-overlay",
1024
- overlayStyle: {
1025
- padding: "4px"
975
+ afterFileDelete: (t) => {
976
+ var s;
977
+ const n = (s = e == null ? void 0 : e.data) == null ? void 0 : s.id;
978
+ n && de((a) => {
979
+ const o = a[n] || [];
980
+ return {
981
+ [n]: o.filter((d) => d.id !== t)
982
+ };
983
+ });
1026
984
  },
1027
- getPopupContainer: (t) => t.parentNode,
1028
- content: "会话历史记录",
1029
- children: /* @__PURE__ */ f(G, {
1030
- className: "history-overlay-action",
1031
- disabled: O,
1032
- type: "text",
1033
- icon: /* @__PURE__ */ f(re, {
1034
- type: "icon-lishijilu",
1035
- style: {
1036
- fontSize: 24
1037
- }
1038
- }),
1039
- onClick: () => lt(!0)
985
+ onFileListChange: (t) => {
986
+ fn(t);
987
+ },
988
+ shouldContinue: un,
989
+ afterFilesClear: () => {
990
+ var n;
991
+ const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
992
+ t && (de({
993
+ [t]: []
994
+ }), He());
995
+ }
996
+ }) : null, (c == null ? void 0 : c.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ f(mi, {
997
+ appId: i.id,
998
+ list: [],
999
+ search: Je ? rn : "",
1000
+ onPromptSelect: (t) => {
1001
+ te(t.context), me(t.context);
1002
+ },
1003
+ disabled: O
1004
+ })]
1005
+ }), /* @__PURE__ */ R(Ne, {
1006
+ children: [(c == null ? void 0 : c.connectNetwork) && i.type === Q.Dialog && ((Dt = i.arrange) == null ? void 0 : Dt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ f(hi, {
1007
+ sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
1008
+ netStatus: P,
1009
+ enable: typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.diabled) == "boolean" ? !(l != null && l.connectNetwork.diabled) : vn,
1010
+ disabledTip: e ? void 0 : "网络访问已被禁用",
1011
+ onNetStatusChange: (t) => {
1012
+ Hn(t);
1013
+ }
1014
+ }), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ f(gi, {
1015
+ currentSessionId: (Rt = e == null ? void 0 : e.data) == null ? void 0 : Rt.id,
1016
+ onSessionChange: (t, n) => {
1017
+ te(void 0), Ie(!0), k == null || k(n);
1018
+ },
1019
+ disabled: O
1020
+ }), Zt && Jt === "float" && /* @__PURE__ */ f("div", {
1021
+ className: "session-history-drawer-component",
1022
+ children: /* @__PURE__ */ f(Gn, {
1023
+ placement: "topRight",
1024
+ showArrow: !1,
1025
+ overlayClassName: "session-history-overlay",
1026
+ overlayStyle: {
1027
+ padding: "4px"
1028
+ },
1029
+ getPopupContainer: (t) => t.parentNode,
1030
+ content: "会话历史记录",
1031
+ children: /* @__PURE__ */ f(G, {
1032
+ className: "history-overlay-action",
1033
+ disabled: O,
1034
+ type: "text",
1035
+ icon: /* @__PURE__ */ f(re, {
1036
+ type: "icon-lishijilu",
1037
+ style: {
1038
+ fontSize: 24
1039
+ }
1040
+ }),
1041
+ onClick: () => lt(!0)
1042
+ })
1040
1043
  })
1041
- })
1042
- }), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ f(G, {
1043
- icon: /* @__PURE__ */ f(li, {}),
1044
- className: "add-btn",
1045
- type: "primary",
1046
- disabled: nt || !e || !y.length || O,
1047
- onClick: () => {
1048
- var t, n;
1049
- Ie(!1), w == null || w(null), ie.current = null, T(!1), (t = et.current) == null || t.clear(), (n = Oe.current) == null || n.clear();
1050
- },
1051
- children: "新会话"
1044
+ }), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ f(G, {
1045
+ icon: /* @__PURE__ */ f(li, {}),
1046
+ className: "add-btn",
1047
+ type: "primary",
1048
+ disabled: nt || !e || !y.length || O,
1049
+ onClick: () => {
1050
+ var t, n;
1051
+ Ie(!1), k == null || k(null), ie.current = null, T(!1), (t = et.current) == null || t.clear(), (n = Oe.current) == null || n.clear();
1052
+ },
1053
+ children: "新会话"
1054
+ })]
1052
1055
  })]
1053
1056
  }), !!Ue && /* @__PURE__ */ f("div", {
1054
1057
  className: "remainingSeconds-mark"
1055
1058
  })]
1056
- }), /* @__PURE__ */ $("div", {
1059
+ }), /* @__PURE__ */ R("div", {
1057
1060
  className: "footer-textarea",
1058
1061
  onPaste: ut,
1059
1062
  onPasteCapture: ut,
@@ -1062,7 +1065,7 @@ ${e}` : e;
1062
1065
  onDragOver: pt,
1063
1066
  onDragOverCapture: pt,
1064
1067
  children: [/* @__PURE__ */ f(oi, {
1065
- ref: we,
1068
+ ref: ke,
1066
1069
  maxLength: en,
1067
1070
  text: ln,
1068
1071
  networkStatus: !1,
@@ -1074,7 +1077,7 @@ ${e}` : e;
1074
1077
  const s = n.getText().replace(/[\n\s]+$/, "");
1075
1078
  me(s), an(s), Je || sn(!0);
1076
1079
  },
1077
- clearAction: /* @__PURE__ */ f(Ee, {
1080
+ clearAction: /* @__PURE__ */ f(Ne, {
1078
1081
  size: 0,
1079
1082
  children: /* @__PURE__ */ f(G, {
1080
1083
  type: "link",
@@ -1089,7 +1092,7 @@ ${e}` : e;
1089
1092
  onClick: () => Cn()
1090
1093
  })
1091
1094
  })
1092
- }), !!Ue && /* @__PURE__ */ $("div", {
1095
+ }), !!Ue && /* @__PURE__ */ R("div", {
1093
1096
  className: "remainingSeconds-time",
1094
1097
  children: ["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长", Ue]
1095
1098
  })]
@@ -1109,7 +1112,7 @@ ${e}` : e;
1109
1112
  currentSession: e,
1110
1113
  application: i,
1111
1114
  networkStatus: P,
1112
- setCurrentSession: w,
1115
+ setCurrentSession: k,
1113
1116
  disabled: O,
1114
1117
  isSessionHistoryVisible: at,
1115
1118
  setIsSessionHistoryVisible: lt,