@glodon-aiot/agent-cli-ui 3.2.2-beta.1 → 3.2.2-beta.3

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,40 +1,40 @@
1
1
  var $t = Object.defineProperty, At = Object.defineProperties;
2
2
  var Bt = Object.getOwnPropertyDescriptors;
3
- var Je = Object.getOwnPropertySymbols;
3
+ var Se = Object.getOwnPropertySymbols;
4
4
  var qt = Object.prototype.hasOwnProperty, Kt = Object.prototype.propertyIsEnumerable;
5
- var ke = (x, o, g) => o in x ? $t(x, o, { enumerable: !0, configurable: !0, writable: !0, value: g }) : x[o] = g, we = (x, o) => {
6
- for (var g in o || (o = {}))
7
- qt.call(o, g) && ke(x, g, o[g]);
8
- if (Je)
9
- for (var g of Je(o))
10
- Kt.call(o, g) && ke(x, g, o[g]);
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) => {
6
+ for (var m in o || (o = {}))
7
+ qt.call(o, m) && ke(x, m, o[m]);
8
+ if (Se)
9
+ for (var m of Se(o))
10
+ Kt.call(o, m) && ke(x, m, o[m]);
11
11
  return x;
12
12
  }, be = (x, o) => At(x, Bt(o));
13
- var P = (x, o, g) => (ke(x, typeof o != "symbol" ? o + "" : o, g), g);
14
- var U = (x, o, g) => new Promise((e, k) => {
15
- var ae = (w) => {
13
+ var P = (x, o, m) => (ke(x, typeof o != "symbol" ? o + "" : o, m), m);
14
+ var U = (x, o, m) => new Promise((e, w) => {
15
+ var re = (b) => {
16
16
  try {
17
- D(g.next(w));
17
+ D(m.next(b));
18
18
  } catch (u) {
19
- k(u);
19
+ w(u);
20
20
  }
21
- }, v = (w) => {
21
+ }, v = (b) => {
22
22
  try {
23
- D(g.throw(w));
23
+ D(m.throw(b));
24
24
  } catch (u) {
25
- k(u);
25
+ w(u);
26
26
  }
27
- }, D = (w) => w.done ? e(w.value) : Promise.resolve(w.value).then(ae, v);
28
- D((g = g.apply(x, o)).next());
27
+ }, D = (b) => b.done ? e(b.value) : Promise.resolve(b.value).then(re, v);
28
+ D((m = m.apply(x, o)).next());
29
29
  });
30
- import { jsx as a, jsxs as $ } from "../../_virtual/jsx-runtime.mjs";
30
+ import { jsx as d, jsxs as $ } from "../../_virtual/jsx-runtime.mjs";
31
31
  import { memo as Yt, useState as p, useRef as A, useContext as Wt, useEffect as N, useMemo as Qt } from "react";
32
32
  import "./style.less.mjs";
33
- import { Divider as _t, Spin as Gt, Button as W, Space as re, Upload as Xt, Tooltip as Zt, message as R, notification as Jt } from "antd";
33
+ 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";
34
34
  import xe from "../../Iconfont/index.mjs";
35
- import { IHistoryRole as Q, ChatMessageRole as Se } from "@glodon-aiot/apis";
36
- import nt from "../HistoryItem/index.mjs";
37
- import it from "dayjs";
35
+ import { IHistoryRole as _, ChatMessageRole as et } from "@glodon-aiot/apis";
36
+ import it from "../HistoryItem/index.mjs";
37
+ import ot from "dayjs";
38
38
  import St from "../../context.mjs";
39
39
  import { MB as en } from "../../constant.mjs";
40
40
  import tn from "../FilePreview/index.mjs";
@@ -42,9 +42,9 @@ import { getImageExtension as nn } from "../../utils/index.mjs";
42
42
  import on from "../../QuillEditor/index.mjs";
43
43
  import sn from "../Recommend/index.mjs";
44
44
  import ln from "../Greeting/index.mjs";
45
- import rn from "../PromptManager/index.mjs";
46
- import an from "../../Footer/index.mjs";
47
- import { CameraOutlined as et, PlusOutlined as dn } from "@ant-design/icons";
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";
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,13 +53,13 @@ import pn from "../SessionListDrawer/index.mjs";
53
53
  import hn from "../../node_modules/react-infinite-scroll-component/dist/index.es.mjs";
54
54
  import gn from "../ConnectToNetwork/index.mjs";
55
55
  import mn from "../../assets/icon.svg.mjs";
56
- import ot from "../../packages/agent-cli-ui/node_modules/uuid/dist/esm-browser/v4.mjs";
57
- const yn = Yt(nt), vn = {
56
+ import st from "../../packages/agent-cli-ui/node_modules/uuid/dist/esm-browser/v4.mjs";
57
+ const yn = Yt(it), vn = {
58
58
  icon: mn,
59
59
  text: "今天我能帮你什么?"
60
60
  };
61
61
  class Z {
62
- constructor(o, g, e, k) {
62
+ constructor(o, m, e, w) {
63
63
  P(this, "messageTime");
64
64
  P(this, "isWaiting");
65
65
  P(this, "messageId");
@@ -69,36 +69,36 @@ class Z {
69
69
  P(this, "isSensitive");
70
70
  P(this, "isSuspend");
71
71
  P(this, "comment");
72
- this.content = o, this.sessionId = g, this.role = e, this.files = k, this.content = o, this.role = e, this.sessionId = g, this.files = k, 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
+ 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 = {
73
73
  isAgree: 0
74
74
  };
75
75
  }
76
76
  }
77
- const tt = 10, Qn = (x) => {
78
- var Be, qe, Ke, Ye, We, Qe, _e, Ge, Xe;
77
+ const nt = 10, Qn = (x) => {
78
+ var qe, Ke, Ye, We, Qe, _e, Ge, Xe, Ze;
79
79
  const {
80
80
  application: o,
81
- docViewerUrl: g = "",
81
+ docViewerUrl: m = "",
82
82
  currentSession: e,
83
- onCreateSession: k,
84
- embeddingService: ae,
83
+ onCreateSession: w,
84
+ embeddingService: re,
85
85
  setCurrentSession: v,
86
86
  networkStatus: D,
87
- setNetworkStatus: w
88
- } = x, [u, I] = p([]), [st, J] = p(), [de, Le] = p(), E = A(null), {
87
+ setNetworkStatus: b
88
+ } = x, [u, I] = p([]), [lt, J] = p(), [de, Le] = p(), E = A(null), {
89
89
  service: C,
90
90
  agentClient: L,
91
- depId: lt,
91
+ depId: at,
92
92
  footer: rt,
93
93
  transform: c,
94
94
  defaultInput: ce,
95
95
  onMessage: S,
96
96
  onHistoryLoad: Ce,
97
97
  beforeMessageSend: z,
98
- bodyStyle: at,
98
+ bodyStyle: dt,
99
99
  disabled: H,
100
100
  features: f
101
- } = Wt(St), [Ne, fe] = p(!1), h = A(u), Fe = A(), [dt, ct] = p(0), [_, B] = p(), [q, ee] = p(""), [Te, ue] = p(!1), pe = A(null), [Ee, ft] = p([]), [Pe, G] = p(!1), [Re, ut] = p(!1), [pt, ht] = p(""), [gt, K] = p(), [te, ne] = p({}), ie = A(null), De = A(null), he = A(null), [He, mt] = p(!1), [yt, vt] = p([]), [kt, oe] = p(!0), [wt, bt] = p(!0), [Me, M] = p(!1), [ge, 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(!0), [Ct, Y] = 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
+ } = 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);
102
102
  N(() => {
103
103
  var l, i;
104
104
  e && (h.current = []), I([]);
@@ -108,15 +108,15 @@ const tt = 10, Qn = (x) => {
108
108
  }), !((l = e == null ? void 0 : e.data) != null && l.id))
109
109
  return;
110
110
  if (j(!1), M(!1), (i = e.messages) != null && i.length) {
111
- const s = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
111
+ const s = [...e.messages.filter((r) => r == null ? void 0 : r.messageId)].reverse();
112
112
  h.current = [...s], I([...s]);
113
113
  }
114
- const n = (r) => {
114
+ const n = (a) => {
115
115
  var s;
116
- (s = e == null ? void 0 : e.data) != null && s.id && (h.current = [...r].reverse(), I([...r].reverse()), !r || r.length < 10 ? X(!1) : X(!0), Ce && Ce({
116
+ (s = e == null ? void 0 : e.data) != null && s.id && (h.current = [...a].reverse(), I([...a].reverse()), !a || a.length < 10 ? X(!1) : X(!0), Ce && Ce({
117
117
  applicationId: o.id,
118
118
  sessionId: e.data.id,
119
- histories: r
119
+ histories: a
120
120
  }));
121
121
  };
122
122
  return e.addEventListener("history:loaded", n), () => {
@@ -125,7 +125,7 @@ const tt = 10, Qn = (x) => {
125
125
  }, [e]), N(() => {
126
126
  const t = () => {
127
127
  var n;
128
- (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), w(e.netOpen));
128
+ (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));
129
129
  };
130
130
  return e == null || e.addEventListener("data:updated", t), () => {
131
131
  e == null || e.removeEventListener("data:updated", t);
@@ -141,7 +141,7 @@ const tt = 10, Qn = (x) => {
141
141
  e == null || e.removeEventListener("error", t);
142
142
  };
143
143
  }, [e]);
144
- const Nt = () => {
144
+ const Ft = () => {
145
145
  var l;
146
146
  if (!((l = e == null ? void 0 : e.data) != null && l.id) || !(o != null && o.id))
147
147
  return;
@@ -149,20 +149,20 @@ const tt = 10, Qn = (x) => {
149
149
  if (n && n.isContext)
150
150
  return R.success("已开启新话题");
151
151
  e.clear().then(() => {
152
- const i = new Z("", t, Q.System);
152
+ const i = new Z("", t, _.System);
153
153
  i.isContext = !0, I([i, ...u]);
154
154
  });
155
155
  };
156
156
  N(() => {
157
157
  o != null && o.id && (C == null || C.getRecommendQues(o.id).then((t) => {
158
- ft(t);
158
+ ut(t);
159
159
  }));
160
- }, [lt, o]);
160
+ }, [at, o]);
161
161
  const Ve = (t) => U(void 0, null, function* () {
162
- var b, m;
162
+ var k, g;
163
163
  if (H)
164
164
  return R.error("发送功能被禁用");
165
- const n = t || st;
165
+ const n = t || lt;
166
166
  if (!(n != null && n.trim()))
167
167
  return R.error("请输入你想问的");
168
168
  if (!(F == null ? void 0 : F.every((y) => !!(y != null && y.value)))) {
@@ -174,25 +174,25 @@ const tt = 10, Qn = (x) => {
174
174
  return R.error("正在回复中");
175
175
  if (Ne)
176
176
  return R.error("等待初始化");
177
- if (!kt)
177
+ if (!wt)
178
178
  return R.error("正在解析文件");
179
179
  if (Te)
180
180
  return R.error("正在上传图片");
181
181
  B(void 0), ee("");
182
- const i = (b = e == null ? void 0 : e.data) == null ? void 0 : b.id;
182
+ const i = (k = e == null ? void 0 : e.data) == null ? void 0 : k.id;
183
183
  if (!i) {
184
- k == null || k({
184
+ w == null || w({
185
185
  netOpen: D ? 1 : 2
186
186
  }).then((y) => {
187
187
  var T, V;
188
- O(!0), w(!!((T = y.data) != null && T.netOpen)), Y(!!((V = y.data) != null && V.enableNetOpen)), Ft(y).then(() => {
188
+ O(!0), b(!!((T = y.data) != null && T.netOpen)), W(!!((V = y.data) != null && V.enableNetOpen)), Tt(y).then(() => {
189
189
  v == null || v(y), O(!1), Le(n);
190
190
  });
191
191
  });
192
192
  return;
193
193
  }
194
194
  le(!0);
195
- const r = q ? `![](${q})
195
+ const a = q ? `![](${q})
196
196
  ${n}` : n;
197
197
  let s;
198
198
  try {
@@ -200,9 +200,9 @@ ${n}` : n;
200
200
  applicationId: o.id,
201
201
  sessionId: i,
202
202
  message: {
203
- content: r,
203
+ content: a,
204
204
  sessionId: i,
205
- role: Se.User,
205
+ role: et.User,
206
206
  files: te[i]
207
207
  }
208
208
  }) : s = !0;
@@ -211,31 +211,31 @@ ${n}` : n;
211
211
  }
212
212
  if (le(!1), s === !1)
213
213
  return;
214
- let d = n;
215
- typeof s == "object" && (d = s.content || n), ((m = te[i]) == null ? void 0 : m.length) > 0 ? Tt(d) : me(d);
216
- }), Ft = (t) => new Promise((n, l) => U(void 0, null, function* () {
217
- const s = (t == null ? void 0 : t.promptVariables).filter((d) => d.key !== "query").map((d) => {
218
- var m;
219
- const b = (m = F.find((y) => y.key === d.key)) == null ? void 0 : m.value;
220
- return d.value = b || "", d;
214
+ let r = n;
215
+ typeof s == "object" && (r = s.content || n), ((g = te[i]) == null ? void 0 : g.length) > 0 ? Et(r) : me(r);
216
+ }), Tt = (t) => new Promise((n, l) => U(void 0, null, function* () {
217
+ const s = (t == null ? void 0 : t.promptVariables).filter((r) => r.key !== "query").map((r) => {
218
+ var g;
219
+ const k = (g = F.find((y) => y.key === r.key)) == null ? void 0 : g.value;
220
+ return r.value = k || "", r;
221
221
  });
222
- se(s.sort((d, b) => d.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(s), n();
223
- })), Tt = (t) => {
224
- var s, d, b;
222
+ se(s.sort((r, k) => r.key.localeCompare(k.key))), yield t == null ? void 0 : t.setPromptVariables(s), n();
223
+ })), Et = (t) => {
224
+ var s, r, k;
225
225
  if (oe(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
226
226
  return;
227
- const n = ((d = e.data) == null ? void 0 : d.id) || "", l = [];
228
- let i = [], r = /* @__PURE__ */ new Set();
229
- (b = te[n]) == null || b.forEach((m) => {
230
- r.has(m.id) || (i.push(m), r.add(m.id));
231
- }), Promise.all(i.map((m) => C == null ? void 0 : C.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, m.id, {
227
+ const n = ((r = e.data) == null ? void 0 : r.id) || "", l = [];
228
+ let i = [], a = /* @__PURE__ */ new Set();
229
+ (k = te[n]) == null || k.forEach((g) => {
230
+ a.has(g.id) || (i.push(g), a.add(g.id));
231
+ }), Promise.all(i.map((g) => C == null ? void 0 : C.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, g.id, {
232
232
  enabled: 1
233
233
  }).then((y) => {
234
- l.push(m);
235
- }))).then((m) => {
234
+ l.push(g);
235
+ }))).then((g) => {
236
236
  oe(!0), me(t, l);
237
- }).catch((m) => {
238
- throw Error(m);
237
+ }).catch((g) => {
238
+ throw Error(g);
239
239
  });
240
240
  };
241
241
  N(() => {
@@ -253,11 +253,11 @@ ${t}` : t;
253
253
  message: {
254
254
  content: l,
255
255
  sessionId: e.id,
256
- role: Se.User,
256
+ role: et.User,
257
257
  files: te[e.id]
258
258
  }
259
259
  }) : i = !0;
260
- } catch (r) {
260
+ } catch (a) {
261
261
  i = !1;
262
262
  }
263
263
  le(!1), i !== !1 && (me(t), Le(void 0));
@@ -267,36 +267,36 @@ ${t}` : t;
267
267
  };
268
268
  }, [de, e]);
269
269
  const me = (t, n) => U(void 0, null, function* () {
270
- var m, y;
271
- const l = (m = e == null ? void 0 : e.data) == null ? void 0 : m.id;
270
+ var g, y;
271
+ const l = (g = e == null ? void 0 : e.data) == null ? void 0 : g.id;
272
272
  if (!l)
273
273
  return;
274
274
  j(!0), M(!0);
275
275
  const i = q ? `![](${q})
276
- ${t}` : t, r = new Z(i, l, Q.User, n);
277
- J(void 0), K(void 0), h.current = [r, ...u], I(h.current), o.id && S && S({
276
+ ${t}` : t, a = new Z(i, l, _.User, n);
277
+ J(void 0), Y(void 0), h.current = [a, ...u], I(h.current), o.id && S && S({
278
278
  applicationId: o.id,
279
279
  sessionId: l,
280
- message: r
280
+ message: a
281
281
  });
282
- const s = new Z("", l, Q.System);
282
+ const s = new Z("", l, _.System);
283
283
  s.isWaiting = !0, h.current = [s, ...h.current], I(h.current);
284
- const d = (n == null ? void 0 : n.map((T) => T.id)) || [], b = {
284
+ const r = (n == null ? void 0 : n.map((T) => T.id)) || [], k = {
285
285
  stream: !0,
286
286
  referenceFirst: !1
287
287
  };
288
288
  if (c != null && c.promptVariables) {
289
- const T = F == null ? void 0 : F.reduce((V, Ze) => (V[Ze.key] = Ze.value, V), {});
290
- b.formatValues = T, e.setPromptVariables(F);
289
+ const T = F == null ? void 0 : F.reduce((V, Je) => (V[Je.key] = Je.value, V), {});
290
+ k.formatValues = T, e.setPromptVariables(F);
291
291
  }
292
292
  if (c != null && c.knowledges) {
293
- const T = It;
294
- b.knowledges = T, e.setKnowledges(T);
293
+ const T = Lt;
294
+ k.knowledges = T, e.setKnowledges(T);
295
295
  }
296
296
  yield e.send({
297
297
  text: i,
298
- fileIds: d
299
- }, b), ne({
298
+ fileIds: r
299
+ }, k), ne({
300
300
  [l]: []
301
301
  }), (y = ie.current) == null || y.update();
302
302
  });
@@ -306,14 +306,14 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
306
306
  if (!t)
307
307
  return;
308
308
  const n = (i) => {
309
- if (!i.sessionId || i.sessionId && i.sessionId !== Fe.current || i.role === Q.User)
309
+ if (!i.sessionId || i.sessionId && i.sessionId !== Fe.current || i.role === _.User)
310
310
  return;
311
- if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (M(!1), j(!1), h.current = h.current.filter((d) => !d.isWaiting), I([...h.current]), h.current = [...h.current], i.content))
311
+ 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))
312
312
  return Jt.error({
313
313
  message: i.content
314
314
  });
315
- const r = i.actions || [], s = new Z(i.content, t, Q.Robot);
316
- s.messageId = i.messageId, s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = r, s.isLoading = !0, h.current = h.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && I([s, ...h.current]), i.code === 11915 && (M(!1), j(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, I([s, ...h.current])), i.index === -2 && (M(!1), j(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, I([s, ...h.current])), i.index === -1 && (M(!1), j(!1), s.isLoading = !1, s.reference = i.reference, I([s, ...h.current]), o.id && S && S({
315
+ const a = i.actions || [], s = new Z(i.content, t, _.Robot);
316
+ s.messageId = i.messageId, s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = a, s.isLoading = !0, h.current = h.current.filter((r) => !r.isWaiting).filter((r) => !r.isReplying), i.index === void 0 && I([s, ...h.current]), i.code === 11915 && (M(!1), j(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, I([s, ...h.current])), i.index === -2 && (M(!1), j(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, I([s, ...h.current])), i.index === -1 && (M(!1), j(!1), s.isLoading = !1, s.reference = i.reference, I([s, ...h.current]), o.id && S && S({
317
317
  applicationId: o.id,
318
318
  sessionId: t,
319
319
  message: s
@@ -339,38 +339,38 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
339
339
  if (!L)
340
340
  return;
341
341
  const t = L.questionContextMaxLength || 4e3;
342
- ct(t);
342
+ ft(t);
343
343
  }, [L, C]), N(() => {
344
- ce && K(ce.text);
344
+ ce && Y(ce.text);
345
345
  }, [ce]);
346
- const Et = (t) => {
346
+ const Pt = (t) => {
347
347
  const n = t.size;
348
348
  return n <= 0 ? (R.error("该文件为空,请重新上传"), !1) : n > 20 * en ? (R.error("图片须小于20M"), !1) : (B(t), !1);
349
- }, Pt = (t) => U(void 0, null, function* () {
349
+ }, Rt = (t) => U(void 0, null, function* () {
350
350
  var n;
351
351
  return B(t), (n = e == null ? void 0 : e.data) != null && n.id ? $e(e, t) : new Promise((l) => {
352
- O(!0), k == null || k({
352
+ O(!0), w == null || w({
353
353
  netOpen: D ? 1 : 2
354
354
  }).then((i) => {
355
- var r, s;
356
- v == null || v(i), O(!1), w(!!((r = i.data) != null && r.netOpen)), Y(!!((s = i.data) != null && s.enableNetOpen)), l($e(i, t));
355
+ var a, s;
356
+ v == null || v(i), O(!1), b(!!((a = i.data) != null && a.netOpen)), W(!!((s = i.data) != null && s.enableNetOpen)), l($e(i, t));
357
357
  });
358
358
  });
359
359
  }), $e = (t, n) => {
360
360
  const l = nn(n.name);
361
361
  return new Promise((i) => {
362
362
  var s;
363
- const r = {
364
- files: [`${ot()}.${l}`],
363
+ const a = {
364
+ files: [`${st()}.${l}`],
365
365
  isv: "minio",
366
366
  knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
367
367
  type: 1
368
368
  };
369
- ue(!0), C == null || C.postTicket(r).then((d) => {
370
- C.uploadMinioFile(d.minio, n).then(() => {
369
+ ue(!0), C == null || C.postTicket(a).then((r) => {
370
+ C.uploadMinioFile(r.minio, n).then(() => {
371
371
  var T, V;
372
- const b = (T = d.minio.endpoints) == null ? void 0 : T[0], m = d.minio.bucket, y = (V = d.minio.fileKeys) == null ? void 0 : V[0];
373
- i(`${location.protocol}//${b}/${m}/${y}`);
372
+ 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
+ i(`${location.protocol}//${k}/${g}/${y}`);
374
374
  }).catch(() => {
375
375
  ee(""), B(void 0);
376
376
  }).finally(() => {
@@ -387,15 +387,15 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
387
387
  top: t.scrollHeight
388
388
  });
389
389
  }, [u]);
390
- const Rt = (t, n) => new Promise((l) => {
390
+ const Ae = (t, n) => new Promise((l) => {
391
391
  if (!n.file.url || !(o != null && o.id))
392
392
  return l();
393
393
  const i = be(we({}, n.file), {
394
394
  type: 1
395
395
  });
396
- C == null || C.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
397
- var r;
398
- (r = ie.current) == null || r.update().finally(l);
396
+ console.log("fileParams", i), C == null || C.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
397
+ var a;
398
+ console.log("uploadRef.current?.update"), (a = ie.current) == null || a.update().finally(l);
399
399
  });
400
400
  }), Dt = () => {
401
401
  var t;
@@ -412,7 +412,7 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
412
412
  if (!E.current)
413
413
  return;
414
414
  const t = E.current.scrollTop <= -80;
415
- xt(t);
415
+ It(t);
416
416
  }, Ot = Ie((t) => {
417
417
  var n, l;
418
418
  (n = pe.current) == null || n.update(t), (l = pe.current) == null || l.focus();
@@ -423,7 +423,7 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
423
423
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
424
424
  return;
425
425
  h.current = [...u.slice(1, u.length)], I(h.current);
426
- const t = new Z("", e.data.id, Q.System);
426
+ const t = new Z("", e.data.id, _.System);
427
427
  t.isWaiting = !0, h.current = [t, ...h.current], I(h.current), j(!0), M(!0), e.answerAgain();
428
428
  });
429
429
  N(() => {
@@ -437,40 +437,40 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
437
437
  const n = u[u.length - 1].messageTime;
438
438
  e.fetchMessages({
439
439
  endTime: n,
440
- pageSize: tt
440
+ pageSize: nt
441
441
  }).then((i) => {
442
- const r = i || [];
443
- if (!r || !(r != null && r.length)) {
442
+ const a = i || [];
443
+ if (!a || !(a != null && a.length)) {
444
444
  X(!1);
445
445
  return;
446
446
  }
447
- r.length < 10 ? X(!1) : X(!0), I([...u, ...r.reverse()]);
447
+ a.length < 10 ? X(!1) : X(!0), I([...u, ...a.reverse()]);
448
448
  });
449
449
  }, Vt = (t) => U(void 0, null, function* () {
450
450
  var n, l;
451
451
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
452
- w(t);
452
+ b(t);
453
453
  else {
454
454
  if (yield e.setNetOpen(t), !((l = e.data) != null && l.id))
455
455
  return;
456
- w(t);
456
+ b(t);
457
457
  }
458
458
  }), ye = () => U(void 0, null, function* () {
459
459
  e ? e.fetchData().then((t) => {
460
460
  var n;
461
- (n = e == null ? void 0 : e.data) != null && n.id && (w(t.netOpen), Y(t.enableNetOpen));
462
- }) : (w(!1), Y(o.arrange[0].enableNetOpen));
461
+ (n = e == null ? void 0 : e.data) != null && n.id && (b(t.netOpen), W(t.enableNetOpen));
462
+ }) : (b(!1), W(o.arrange[0].enableNetOpen));
463
463
  });
464
464
  N(() => {
465
465
  ye();
466
466
  }, [e]), N(() => {
467
467
  var t, n;
468
468
  if (E.current) {
469
- const l = document.getElementById("chat-main"), i = (t = E.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), r = (n = E.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
470
- if (!i || !r || !l)
469
+ const l = document.getElementById("chat-main"), i = (t = E.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), a = (n = E.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
470
+ if (!i || !a || !l)
471
471
  return;
472
472
  const s = l.offsetHeight;
473
- if (r.offsetHeight <= s) {
473
+ if (a.offsetHeight <= s) {
474
474
  if (i.style.height === "100%")
475
475
  return;
476
476
  i.style.height = "100%";
@@ -485,34 +485,32 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
485
485
  return;
486
486
  const t = () => {
487
487
  const i = ((L == null ? void 0 : L.promptVariables) || []).filter(
488
- (r) => r.key !== "query" && r.status === 1
488
+ (a) => a.key !== "query" && a.status === 1
489
489
  // 只要求输入被引用的变量
490
- ).map((r, s) => {
491
- var b, m;
492
- let d = "";
493
- return typeof (f == null ? void 0 : f.promptVariables) == "object" && (d = ((m = (b = f.promptVariables.default) == null ? void 0 : b.find((y) => y.key === r.key)) == null ? void 0 : m.value) || ""), {
490
+ ).map((a, s) => {
491
+ var k, g;
492
+ let r = "";
493
+ return typeof (f == null ? void 0 : f.promptVariables) == "object" && (r = ((g = (k = f.promptVariables.default) == null ? void 0 : k.find((y) => y.key === a.key)) == null ? void 0 : g.value) || ""), {
494
494
  id: s + "",
495
- key: r.key,
496
- name: r.name,
497
- value: d
495
+ key: a.key,
496
+ name: a.name,
497
+ value: r
498
498
  };
499
499
  });
500
- se([...i].sort((r, s) => r.key.localeCompare(s.key)));
500
+ se([...i].sort((a, s) => a.key.localeCompare(s.key)));
501
501
  };
502
502
  return L != null && L.ready ? t() : L == null || L.addEventListener("ready", t), () => {
503
503
  L == null || L.removeEventListener("ready", t);
504
504
  };
505
505
  }, [e, L, f == null ? void 0 : f.promptVariables]);
506
- const Ae = () => {
507
- k == null || k({
508
- netOpen: D ? 1 : 2
509
- }).then((t) => {
510
- var n, l;
511
- v == null || v(t), O(!1), w(!!((n = t.data) != null && n.netOpen)), Y(!!((l = t.data) != null && l.enableNetOpen));
512
- });
513
- }, ve = Qt(() => {
506
+ const Be = () => w == null ? void 0 : w({
507
+ netOpen: D ? 1 : 2
508
+ }).then((t) => {
509
+ var n, l;
510
+ return v == null || v(t), O(!1), b(!!((n = t.data) != null && n.netOpen)), W(!!((l = t.data) != null && l.enableNetOpen)), t;
511
+ }), ve = Qt(() => {
514
512
  var t;
515
- return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ a(nt, {
513
+ return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(it, {
516
514
  application: o,
517
515
  history: {
518
516
  role: 1,
@@ -522,7 +520,7 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
522
520
  sessionId: "",
523
521
  reference: [],
524
522
  searchReference: [],
525
- messageTime: it(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
523
+ messageTime: ot(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
526
524
  actions: [],
527
525
  isLoading: !1
528
526
  },
@@ -531,7 +529,7 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
531
529
  }, [o == null ? void 0 : o.arrange, u]);
532
530
  return console.log("openingMessage", ve), /* @__PURE__ */ $("div", {
533
531
  className: "agent-chat",
534
- children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ a(un, {
532
+ children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ d(un, {
535
533
  ref: De,
536
534
  appId: o.id,
537
535
  currentSession: e,
@@ -541,8 +539,8 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
541
539
  }), /* @__PURE__ */ $("div", {
542
540
  className: "chat-main",
543
541
  id: "chat-main",
544
- style: at,
545
- children: [/* @__PURE__ */ a("div", {
542
+ style: dt,
543
+ children: [/* @__PURE__ */ d("div", {
546
544
  className: "chat-main-wrapper",
547
545
  id: "scrollableDiv",
548
546
  style: {
@@ -553,7 +551,7 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
553
551
  },
554
552
  ref: E,
555
553
  onScroll: Mt,
556
- children: (Be = e == null ? void 0 : e.data) != null && Be.id && (u != null && u.length) ? /* @__PURE__ */ $(hn, {
554
+ children: (qe = e == null ? void 0 : e.data) != null && qe.id && (u != null && u.length) ? /* @__PURE__ */ $(hn, {
557
555
  dataLength: u.length,
558
556
  next: jt,
559
557
  style: {
@@ -562,26 +560,26 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
562
560
  overflowX: "hidden"
563
561
  },
564
562
  inverse: !0,
565
- endMessage: u.length > tt && // 少于一页不展示这个提示
566
- ((qe = E.current) != null && qe.scrollTop) && ((Ke = E.current) == null ? void 0 : Ke.scrollTop) < -10 ? /* @__PURE__ */ a(_t, {
563
+ endMessage: u.length > nt && // 少于一页不展示这个提示
564
+ ((Ke = E.current) != null && Ke.scrollTop) && ((Ye = E.current) == null ? void 0 : Ye.scrollTop) < -10 ? /* @__PURE__ */ d(_t, {
567
565
  plain: !0,
568
566
  children: "没有更多数据了"
569
567
  }) : null,
570
568
  hasMore: ze,
571
- loader: /* @__PURE__ */ a("div", {
569
+ loader: /* @__PURE__ */ d("div", {
572
570
  style: {
573
571
  height: "50px",
574
572
  textAlign: "center",
575
573
  overflow: "hidden"
576
574
  },
577
- children: /* @__PURE__ */ a(Gt, {})
575
+ children: /* @__PURE__ */ d(Gt, {})
578
576
  }),
579
577
  scrollableTarget: "scrollableDiv",
580
- children: [u.map((t, n) => /* @__PURE__ */ a(yn, {
578
+ children: [u.map((t, n) => /* @__PURE__ */ d(yn, {
581
579
  application: o,
582
580
  currentSession: e,
583
581
  history: t,
584
- docViewerUrl: g,
582
+ docViewerUrl: m,
585
583
  isLastHistory: n === 0,
586
584
  onRelatedClick: Ut,
587
585
  onAgainClick: zt,
@@ -589,38 +587,43 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
589
587
  }, t.messageId + n)), !ze && ve]
590
588
  }) : /* @__PURE__ */ $("div", {
591
589
  className: "main-empty",
592
- children: [/* @__PURE__ */ a(ln, be(we({}, vn), {
593
- children: !!Ee.length && /* @__PURE__ */ a(sn, {
590
+ children: [/* @__PURE__ */ d(ln, be(we({}, vn), {
591
+ children: !!Ee.length && /* @__PURE__ */ d(sn, {
594
592
  ref: he,
595
- sid: (Ye = e == null ? void 0 : e.data) == null ? void 0 : Ye.id,
593
+ sid: (We = e == null ? void 0 : e.data) == null ? void 0 : We.id,
596
594
  isRecommendClearing: Pe,
597
595
  data: Ee,
598
596
  onItemClick: (t) => {
599
- var l, i, r;
600
- if (J(t == null ? void 0 : t.question), K(t == null ? void 0 : t.question), Pe)
597
+ var l, i, a;
598
+ if (J(t == null ? void 0 : t.question), Y(t == null ? void 0 : t.question), Pe)
601
599
  return;
602
- t != null && t.id && G(!0);
600
+ t != null && t.id && K(!0);
603
601
  const n = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
604
- c != null && c.fileUpload ? (r = (i = ie.current) == null ? void 0 : i.clear()) == null || r.then(() => {
605
- var s;
606
- t != null && t.id && (n ? (s = Rt(n, t)) == null || s.finally(() => {
607
- G(!1);
608
- }) : (G(!1), O(!0), Ae()));
609
- }) : n ? G(!1) : (G(!1), O(!0), Ae());
602
+ c != null && c.fileUpload ? (a = (i = ie.current) == null ? void 0 : i.clear()) == null || a.then(() => {
603
+ var s, r;
604
+ t != null && t.id && (n ? (s = Ae(n, t)) == null || s.finally(() => {
605
+ K(!1);
606
+ }) : (K(!1), O(!0), (r = Be()) == null || r.then((k) => {
607
+ var g;
608
+ (g = Ae(k.id, t)) == null || g.finally(() => {
609
+ K(!1);
610
+ });
611
+ })));
612
+ }) : n ? K(!1) : (K(!1), O(!0), Be());
610
613
  }
611
614
  })
612
615
  })), ve]
613
616
  })
614
- }), Me && /* @__PURE__ */ a("div", {
617
+ }), Me && /* @__PURE__ */ d("div", {
615
618
  className: "session-stop",
616
- children: /* @__PURE__ */ a(W, {
619
+ children: /* @__PURE__ */ d(Q, {
617
620
  type: "primary",
618
621
  style: {
619
622
  background: "white"
620
623
  },
621
624
  ghost: !0,
622
625
  size: "small",
623
- icon: /* @__PURE__ */ a(xe, {
626
+ icon: /* @__PURE__ */ d(xe, {
624
627
  type: "icon-zantinghuida",
625
628
  style: {
626
629
  fontSize: 16
@@ -629,15 +632,15 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
629
632
  onClick: () => Dt(),
630
633
  children: "停止回答"
631
634
  })
632
- }), Oe && (u == null ? void 0 : u.length) > 0 && /* @__PURE__ */ a("div", {
635
+ }), Oe && (u == null ? void 0 : u.length) > 0 && /* @__PURE__ */ d("div", {
633
636
  className: "back-bottom",
634
- children: /* @__PURE__ */ a(W, {
637
+ children: /* @__PURE__ */ d(Q, {
635
638
  size: "small",
636
639
  onClick: () => Ht({
637
640
  behavior: "smooth"
638
641
  }),
639
642
  type: "link",
640
- icon: /* @__PURE__ */ a(xe, {
643
+ icon: /* @__PURE__ */ d(xe, {
641
644
  type: "icon-yijianhuidaodibu",
642
645
  style: {
643
646
  fontSize: 24
@@ -645,34 +648,34 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
645
648
  })
646
649
  })
647
650
  })]
648
- }), /* @__PURE__ */ a("div", {
651
+ }), /* @__PURE__ */ d("div", {
649
652
  className: "chat-footer",
650
653
  children: /* @__PURE__ */ $("div", {
651
654
  className: "chat-footer-input",
652
- children: [_ && /* @__PURE__ */ a("div", {
655
+ children: [G && /* @__PURE__ */ d("div", {
653
656
  className: "input-files",
654
- children: /* @__PURE__ */ a(tn, {
655
- file: _,
657
+ children: /* @__PURE__ */ d(tn, {
658
+ file: G,
656
659
  actions: {
657
- upload: Pt,
660
+ upload: Rt,
658
661
  remove: () => {
659
662
  B(void 0);
660
663
  }
661
664
  },
662
665
  onUrlChange: (t) => ee(t)
663
666
  })
664
- }), /* @__PURE__ */ $(re, {
667
+ }), /* @__PURE__ */ $(ae, {
665
668
  className: "footer-upload-action",
666
669
  onClick: (t) => t.preventDefault(),
667
- children: [/* @__PURE__ */ $(re, {
668
- children: [o.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */ a(Xt, {
669
- disabled: !!_ || H,
670
+ children: [/* @__PURE__ */ $(ae, {
671
+ children: [o.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */ d(Xt, {
672
+ disabled: !!G || H,
670
673
  accept: ".jpg, .png, .jpeg,.bmp",
671
674
  listType: "picture-card",
672
- beforeUpload: Et,
675
+ beforeUpload: Pt,
673
676
  className: "footer-upload-picture",
674
677
  showUploadList: !1,
675
- children: _ ? /* @__PURE__ */ a(W, {
678
+ children: G ? /* @__PURE__ */ d(Q, {
676
679
  type: "text",
677
680
  className: "camera-out-btn",
678
681
  style: {
@@ -680,20 +683,20 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
680
683
  position: "relative",
681
684
  bottom: "-2px"
682
685
  },
683
- disabled: !!_ || H,
684
- icon: /* @__PURE__ */ a(et, {
686
+ disabled: !!G || H,
687
+ icon: /* @__PURE__ */ d(tt, {
685
688
  className: "icon-tianjia",
686
689
  style: {
687
690
  fontSize: "22px"
688
691
  }
689
692
  })
690
- }) : /* @__PURE__ */ a(Zt, {
693
+ }) : /* @__PURE__ */ d(Zt, {
691
694
  placement: "topLeft",
692
695
  overlayClassName: "footer-upload-tooltip",
693
- title: /* @__PURE__ */ a("div", {
696
+ title: /* @__PURE__ */ d("div", {
694
697
  children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
695
698
  }),
696
- children: /* @__PURE__ */ a(W, {
699
+ children: /* @__PURE__ */ d(Q, {
697
700
  type: "text",
698
701
  className: "camera-out-btn",
699
702
  style: {
@@ -701,7 +704,7 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
701
704
  position: "relative",
702
705
  bottom: "-2px"
703
706
  },
704
- icon: /* @__PURE__ */ a(et, {
707
+ icon: /* @__PURE__ */ d(tt, {
705
708
  className: "icon-tianjia",
706
709
  style: {
707
710
  fontSize: "22px"
@@ -709,25 +712,25 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
709
712
  })
710
713
  })
711
714
  })
712
- }), ae && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ a(cn, {
715
+ }), re && (c != null && c.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ d(cn, {
713
716
  appId: o == null ? void 0 : o.id,
714
717
  ref: ie,
715
718
  isFirstSession: Ue,
716
- docViewerUrl: g,
719
+ docViewerUrl: m,
717
720
  onStatusChange: (t) => U(void 0, null, function* () {
718
721
  t !== "process" ? (oe(!0), ye()) : oe(!1);
719
722
  }),
720
723
  createSession: () => new Promise((t) => {
721
- O(!0), k == null || k({
724
+ O(!0), w == null || w({
722
725
  netOpen: D ? 1 : 2
723
726
  }).then((n) => {
724
- var i, r, s;
725
- v == null || v(n), O(!1), w(!!((i = n.data) != null && i.netOpen)), Y(!!((r = n.data) != null && r.enableNetOpen));
727
+ var i, a, s;
728
+ v == null || v(n), O(!1), b(!!((i = n.data) != null && i.netOpen)), W(!!((a = n.data) != null && a.enableNetOpen));
726
729
  const l = ((s = n.data) == null ? void 0 : s.id) || "";
727
730
  t(l);
728
731
  });
729
732
  }),
730
- sid: (We = e == null ? void 0 : e.data) == null ? void 0 : We.id,
733
+ sid: (Qe = e == null ? void 0 : e.data) == null ? void 0 : Qe.id,
731
734
  disabled: ge || H,
732
735
  afterFileAdd: (t, n) => {
733
736
  n && ne((l) => {
@@ -741,16 +744,16 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
741
744
  var l;
742
745
  const n = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
743
746
  n && ne((i) => {
744
- const r = i[n] || [];
747
+ const a = i[n] || [];
745
748
  return {
746
- [n]: r.filter((s) => s.id !== t)
749
+ [n]: a.filter((s) => s.id !== t)
747
750
  };
748
751
  });
749
752
  },
750
753
  onFileListChange: (t) => {
751
- vt(t);
754
+ kt(t);
752
755
  },
753
- shouldContinue: wt,
756
+ shouldContinue: bt,
754
757
  afterFilesClear: () => {
755
758
  var n;
756
759
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
@@ -758,83 +761,83 @@ ${t}` : t, r = new Z(i, l, Q.User, n);
758
761
  [t]: []
759
762
  }), ye());
760
763
  }
761
- }) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ a(rn, {
764
+ }) : null, (c == null ? void 0 : c.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ d(an, {
762
765
  appId: o.id,
763
766
  list: [],
764
- search: Re ? pt : "",
767
+ search: Re ? ht : "",
765
768
  onPromptSelect: (t) => {
766
- K(t.context), J(t.context);
769
+ Y(t.context), J(t.context);
767
770
  },
768
771
  disabled: H
769
772
  })]
770
- }), /* @__PURE__ */ $(re, {
771
- children: [(c == null ? void 0 : c.connectNetwork) && o.type === 0 && ((Qe = o.arrange) == null ? void 0 : Qe.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ a(gn, {
772
- sessionId: (_e = e == null ? void 0 : e.data) == null ? void 0 : _e.id,
773
+ }), /* @__PURE__ */ $(ae, {
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, {
775
+ sessionId: (Ge = e == null ? void 0 : e.data) == null ? void 0 : Ge.id,
773
776
  netStatus: D,
774
- 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
+ enable: typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.diabled) == "boolean" ? !(f != null && f.connectNetwork.diabled) : Nt,
775
778
  disabledTip: e ? void 0 : "网络访问已被禁用",
776
779
  onNetStatusChange: (t) => {
777
780
  Vt(t);
778
781
  }
779
- }), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ a(pn, {
780
- currentSessionId: (Ge = e == null ? void 0 : e.data) == null ? void 0 : Ge.id,
782
+ }), (c == null ? void 0 : c.sessionList) && /* @__PURE__ */ d(pn, {
783
+ currentSessionId: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
781
784
  onSessionChange: (t, n) => {
782
- K(void 0), v == null || v(n);
785
+ Y(void 0), v == null || v(n);
783
786
  },
784
787
  disabled: H
785
- }), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ a(W, {
786
- icon: /* @__PURE__ */ a(dn, {}),
788
+ }), (c == null ? void 0 : c.sessionOpen) && /* @__PURE__ */ d(Q, {
789
+ icon: /* @__PURE__ */ d(dn, {}),
787
790
  className: "add-btn",
788
791
  type: "primary",
789
792
  disabled: Me || !e || !u.length || H,
790
793
  onClick: () => {
791
794
  var t, n;
792
- v == null || v(void 0), w(!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 = he.current) == null || n.clear();
793
796
  },
794
797
  children: "新会话"
795
798
  })]
796
799
  })]
797
- }), /* @__PURE__ */ a("div", {
800
+ }), /* @__PURE__ */ d("div", {
798
801
  className: "footer-textarea",
799
- children: /* @__PURE__ */ a(on, {
802
+ children: /* @__PURE__ */ d(on, {
800
803
  ref: pe,
801
- maxLength: dt,
802
- text: gt,
804
+ maxLength: ct,
805
+ text: mt,
803
806
  networkStatus: !1,
804
807
  loading: je,
805
808
  disabled: Ne || Te || H || je,
806
809
  onTextSend: Ve,
807
810
  onChange: (t, n) => {
808
- K(t);
811
+ Y(t);
809
812
  const l = n.getText().replace(/[\n\s]+$/, "");
810
- J(l), ht(l), Re || ut(!0);
813
+ J(l), gt(l), Re || pt(!0);
811
814
  },
812
- clearAction: /* @__PURE__ */ a(re, {
815
+ clearAction: /* @__PURE__ */ d(ae, {
813
816
  size: 0,
814
- children: /* @__PURE__ */ a(W, {
817
+ children: /* @__PURE__ */ d(Q, {
815
818
  type: "link",
816
819
  disabled: ge || H,
817
820
  ghost: !0,
818
- icon: /* @__PURE__ */ a(xe, {
821
+ icon: /* @__PURE__ */ d(xe, {
819
822
  style: {
820
823
  fontSize: 22
821
824
  },
822
825
  type: "icon-qingchujiyi"
823
826
  }),
824
- onClick: () => Nt()
827
+ onClick: () => Ft()
825
828
  })
826
829
  })
827
830
  })
828
831
  })]
829
832
  })
830
- }), /* @__PURE__ */ a(an, {
833
+ }), /* @__PURE__ */ d(rn, {
831
834
  tips: rt
832
- }), He && /* @__PURE__ */ a(fn, {
835
+ }), He && /* @__PURE__ */ d(fn, {
833
836
  isvisible: He,
834
- files: yt,
835
- sessionId: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
837
+ files: vt,
838
+ sessionId: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
836
839
  onClose: (t) => {
837
- mt(!1), bt(!1);
840
+ yt(!1), xt(!1);
838
841
  }
839
842
  })]
840
843
  });