@glodon-aiot/agent-cli-ui 3.19.0-alpha.21 → 3.19.0-alpha.22

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,37 +1,37 @@
1
- var Mn = Object.defineProperty, jn = Object.defineProperties;
1
+ var Hn = Object.defineProperty, jn = Object.defineProperties;
2
2
  var $n = Object.getOwnPropertyDescriptors;
3
3
  var jt = Object.getOwnPropertySymbols;
4
4
  var zn = Object.prototype.hasOwnProperty, Vn = Object.prototype.propertyIsEnumerable;
5
- var Me = (k, h, i) => h in k ? Mn(k, h, { enumerable: !0, configurable: !0, writable: !0, value: i }) : k[h] = i, je = (k, h) => {
5
+ var He = (b, h, i) => h in b ? Hn(b, h, { enumerable: !0, configurable: !0, writable: !0, value: i }) : b[h] = i, je = (b, h) => {
6
6
  for (var i in h || (h = {}))
7
- zn.call(h, i) && Me(k, i, h[i]);
7
+ zn.call(h, i) && He(b, i, h[i]);
8
8
  if (jt)
9
9
  for (var i of jt(h))
10
- Vn.call(h, i) && Me(k, i, h[i]);
11
- return k;
12
- }, $e = (k, h) => jn(k, $n(h));
13
- var j = (k, h, i) => (Me(k, typeof h != "symbol" ? h + "" : h, i), i);
14
- var $ = (k, h, i) => new Promise((U, e) => {
15
- var C = (D) => {
10
+ Vn.call(h, i) && He(b, i, h[i]);
11
+ return b;
12
+ }, $e = (b, h) => jn(b, $n(h));
13
+ var j = (b, h, i) => (He(b, typeof h != "symbol" ? h + "" : h, i), i);
14
+ var $ = (b, h, i) => new Promise((A, e) => {
15
+ var I = (T) => {
16
16
  try {
17
- b(i.next(D));
18
- } catch (O) {
19
- e(O);
17
+ x(i.next(T));
18
+ } catch (R) {
19
+ e(R);
20
20
  }
21
- }, z = (D) => {
21
+ }, z = (T) => {
22
22
  try {
23
- b(i.throw(D));
24
- } catch (O) {
25
- e(O);
23
+ x(i.throw(T));
24
+ } catch (R) {
25
+ e(R);
26
26
  }
27
- }, b = (D) => D.done ? U(D.value) : Promise.resolve(D.value).then(C, z);
28
- b((i = i.apply(k, h)).next());
27
+ }, x = (T) => T.done ? A(T.value) : Promise.resolve(T.value).then(I, z);
28
+ x((i = i.apply(b, h)).next());
29
29
  });
30
- import { jsx as g, jsxs as F, Fragment as Bn } from "react/jsx-runtime";
31
- import { memo as _n, forwardRef as qn, useState as p, useRef as K, useContext as Wn, useEffect as E, useMemo as Kn, useImperativeHandle as Yn } from "react";
32
- /* empty css */import { Spin as $t, Divider as Sn, Button as G, Space as Ne, Upload as Qn, Tooltip as Xn, Popover as Gn, notification as se, message as Zn } from "antd";
30
+ import { jsx as g, jsxs as U, Fragment as Bn } from "react/jsx-runtime";
31
+ import { memo as _n, forwardRef as qn, useState as p, useRef as K, useContext as Wn, useEffect as N, useMemo as Kn, useImperativeHandle as Sn } from "react";
32
+ /* empty css */import { Spin as $t, Divider as Yn, Button as G, Space as Ee, Upload as Qn, Tooltip as Xn, Popover as Gn, notification as se, message as Zn } from "antd";
33
33
  import re from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as ae, ApplicationTypes as Y, ChatMessageRole as zt, PromptVariableType as Ee } from "@glodon-aiot/apis";
34
+ import { IHistoryRole as ae, ApplicationTypes as S, ChatMessageRole as zt, PromptVariableType as Ne } 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";
@@ -62,7 +62,7 @@ const bi = _n(Wt), _t = {
62
62
  text: "今天我能帮你什么?"
63
63
  };
64
64
  class he {
65
- constructor(h, i, U, e, C) {
65
+ constructor(h, i, A, e, I) {
66
66
  j(this, "messageTime");
67
67
  j(this, "isWaiting");
68
68
  j(this, "messageId");
@@ -74,46 +74,46 @@ class he {
74
74
  j(this, "imageContent");
75
75
  // 新增:支持对话型应用的图片内容
76
76
  j(this, "comment");
77
- this.content = h, this.sessionId = i, this.role = U, this.files = e, this.content = h, this.role = U, this.sessionId = i, this.files = e, this.imageContent = C, 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
+ this.content = h, this.sessionId = i, this.role = A, this.files = e, this.content = h, this.role = A, this.sessionId = i, this.files = e, this.imageContent = I, 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 = {
78
78
  isAgree: 0
79
79
  };
80
80
  }
81
81
  }
82
- const qt = 10, Z = 5, Ve = 20, Be = (k, h, i, U) => {
83
- let e = k;
84
- if (U === Y.Agent) {
82
+ const qt = 10, Z = 5, Ve = 20, Be = (b, h, i, A) => {
83
+ let e = b;
84
+ if (A === S.Agent) {
85
85
  if (i && i.length > 0) {
86
- const C = i.map((z) => `[${z.name.replace(/\.[^/.]+$/, "")}](${z.url})`).join(`
86
+ const I = i.map((z) => `[${z.name.replace(/\.[^/.]+$/, "")}](${z.url})`).join(`
87
87
  `);
88
- e = C ? `${C}
88
+ e = I ? `${I}
89
89
  ${e}` : e;
90
90
  }
91
91
  if (h && h.length > 0) {
92
- const C = h.filter(Boolean).map((z) => `![](${z})`).join(`
92
+ const I = h.filter(Boolean).map((z) => `![](${z})`).join(`
93
93
  `);
94
- e = C ? `${C}
94
+ e = I ? `${I}
95
95
  ${e}` : e;
96
96
  }
97
97
  }
98
98
  return e;
99
- }, xi = (k) => {
100
- const h = Math.floor(k / 3600), i = Math.floor(k % 3600 / 60), U = k % 60, e = (C) => String(C).padStart(2, "0");
101
- return `${e(h)}:${e(i)}:${e(U)}`;
102
- }, no = qn((k, h) => {
103
- var bt, xt, Ct, It, Nt, Et, Lt, Pt, Tt, Dt, Ot, Rt, Ft, Ut;
99
+ }, xi = (b) => {
100
+ const h = Math.floor(b / 3600), i = Math.floor(b % 3600 / 60), A = b % 60, e = (I) => String(I).padStart(2, "0");
101
+ return `${e(h)}:${e(i)}:${e(A)}`;
102
+ }, no = qn((b, h) => {
103
+ var bt, xt, Ct, It, Et, Nt, Lt, Pt, Dt, Tt, Rt, Ot, Ft, Ut;
104
104
  const {
105
105
  application: i,
106
- docViewerUrl: U = "",
106
+ docViewerUrl: A = "",
107
107
  currentSession: e,
108
- onCreateSession: C,
108
+ onCreateSession: I,
109
109
  embeddingService: z,
110
- setCurrentSession: b,
111
- networkStatus: D,
112
- setNetworkStatus: O
113
- } = k, [w, L] = p([]), [Yt, me] = p(), [Le, qe] = p(), A = K(null), {
114
- service: H,
110
+ setCurrentSession: x,
111
+ networkStatus: T,
112
+ setNetworkStatus: R
113
+ } = b, [w, L] = p([]), [St, me] = p(), [Le, qe] = p(), O = K(null), {
114
+ service: M,
115
115
  agentClient: P,
116
- depId: St,
116
+ depId: Yt,
117
117
  footer: Qt,
118
118
  transform: f,
119
119
  defaultInput: Pe,
@@ -121,18 +121,18 @@ ${e}` : e;
121
121
  onHistoryLoad: We,
122
122
  beforeMessageSend: _,
123
123
  bodyStyle: Xt,
124
- disabled: R,
124
+ disabled: F,
125
125
  features: a,
126
- popupContainer: S,
126
+ popupContainer: Y,
127
127
  icon: Gt,
128
128
  sider: Zt,
129
129
  mode: Jt,
130
- silencedSeconds: Te
131
- } = Wn(Jn), [Ke, De] = p(!1), y = K(w), Ye = K(void 0), [en, tn] = p(0), [ce, ve] = p([]), [J, we] = p([]), [Se, Qe] = p(0), [Xe, nn] = p(!1);
132
- E(() => {
133
- nn(Se > 0);
134
- }, [Se]);
135
- const ke = K(null), [Ge, on] = p([]), [Ze, ee] = p(!1), [Je, sn] = p(!1), [rn, an] = p(""), [ln, te] = p(), [ne, de] = p({}), fe = K(null), et = K(null), Oe = K(null), [tt, cn] = p(!1), [dn, fn] = p([]), [gn, be] = p(!0), [un, pn] = p(!0), [nt, V] = p(!1), [Re, q] = p(!1), [it, hn] = p(!1), [M, ge] = p(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [mn, yn] = p(() => {
130
+ silencedSeconds: De
131
+ } = Wn(Jn), [Ke, Te] = p(!1), y = K(w), Se = K(void 0), [en, tn] = p(0), [ce, ve] = p([]), [J, we] = p([]), [Ye, Qe] = p(0), [Xe, nn] = p(!1);
132
+ N(() => {
133
+ nn(Ye > 0);
134
+ }, [Ye]);
135
+ const ke = K(null), [Ge, on] = p([]), [Ze, ee] = p(!1), [Je, sn] = p(!1), [rn, an] = p(""), [ln, te] = p(), [ne, de] = p({}), fe = K(null), et = K(null), Re = K(null), [tt, cn] = p(!1), [dn, fn] = p([]), [gn, be] = p(!0), [un, pn] = p(!0), [nt, V] = p(!1), [Oe, q] = p(!1), [it, hn] = p(!1), [H, ge] = p(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [mn, yn] = p(() => {
136
136
  const t = typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0;
137
137
  if (t) {
138
138
  if (Array.isArray(t) && t.some((r) => Array.isArray(r.fileIds) && r.fileIds.length === 0))
@@ -145,12 +145,12 @@ ${e}` : e;
145
145
  isSwitchingToExistingSession: ct,
146
146
  setIsSwitchingToExistingSession: Ie
147
147
  } = wi(), ie = K(null), [Fe, xn] = p("");
148
- E(() => {
149
- if (!Te)
148
+ N(() => {
149
+ if (!De)
150
150
  return;
151
- let t = xi(Te);
151
+ let t = xi(De);
152
152
  xn(t);
153
- }, [Te]), E(() => {
153
+ }, [De]), N(() => {
154
154
  if (bn(e), e === null)
155
155
  W(!1);
156
156
  else if (e === void 0)
@@ -166,21 +166,21 @@ ${e}` : e;
166
166
  }
167
167
  e.ready ? W(!1) : W(!0);
168
168
  }
169
- }, [e, e == null ? void 0 : e.ready, ct]), E(() => {
169
+ }, [e, e == null ? void 0 : e.ready, ct]), N(() => {
170
170
  var o, r;
171
171
  e && (y.current = []), L([]);
172
- const t = A.current;
172
+ const t = O.current;
173
173
  if (t && t.scrollTo({
174
174
  top: 0
175
175
  }), !((o = e == null ? void 0 : e.data) != null && o.id))
176
176
  return;
177
177
  if (q(!1), V(!1), (r = e.messages) != null && r.length) {
178
- const d = [...e.messages.filter((l) => l == null ? void 0 : l.messageId)].reverse();
179
- y.current = [...d], L([...d]), W(!1);
178
+ const c = [...e.messages.filter((l) => l == null ? void 0 : l.messageId)].reverse();
179
+ y.current = [...c], L([...c]), W(!1);
180
180
  }
181
181
  const n = (s) => {
182
- var d;
183
- (d = e == null ? void 0 : e.data) != null && d.id && (y.current = [...s].reverse(), L([...s].reverse()), !s || s.length < 10 ? ue(!1) : ue(!0), W(!1), We && We({
182
+ var c;
183
+ (c = e == null ? void 0 : e.data) != null && c.id && (y.current = [...s].reverse(), L([...s].reverse()), !s || s.length < 10 ? ue(!1) : ue(!0), W(!1), We && We({
184
184
  applicationId: i.id,
185
185
  sessionId: e.data.id,
186
186
  histories: s
@@ -189,22 +189,22 @@ ${e}` : e;
189
189
  return e.addEventListener("history:loaded", n), () => {
190
190
  y.current = [], L([]), e == null || e.removeEventListener("history:loaded", n);
191
191
  };
192
- }, [e]), E(() => {
192
+ }, [e]), N(() => {
193
193
  const t = () => {
194
194
  var n;
195
- (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((o, r) => o.key.localeCompare(r.key))), e.knowledges && yn(e.knowledges), O(e.netOpen));
195
+ (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((o, r) => o.key.localeCompare(r.key))), e.knowledges && yn(e.knowledges), R(e.netOpen));
196
196
  };
197
197
  return e == null || e.addEventListener("data:updated", t), () => {
198
198
  e == null || e.removeEventListener("data:updated", t);
199
199
  };
200
- }, [e]), E(() => {
200
+ }, [e]), N(() => {
201
201
  var n;
202
202
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
203
203
  return;
204
204
  const t = (o) => {
205
205
  var r;
206
206
  console.error(o.message, o.cause, "e.case"), se.config({
207
- getContainer: () => (S == null ? void 0 : S.current) || document.body,
207
+ getContainer: () => (Y == null ? void 0 : Y.current) || document.body,
208
208
  prefixCls: "gbot-notification"
209
209
  }), se.error({
210
210
  message: ((r = o.cause) == null ? void 0 : r.message) || o.message
@@ -223,7 +223,7 @@ ${e}` : e;
223
223
  return;
224
224
  const t = e.data.id, n = w[w.length - 1];
225
225
  if (n && n.isContext) {
226
- T("success", "已开启新话题");
226
+ D("success", "已开启新话题");
227
227
  return;
228
228
  } else
229
229
  e.clear().then(() => {
@@ -231,42 +231,42 @@ ${e}` : e;
231
231
  r.isContext = !0, L([r, ...w]);
232
232
  });
233
233
  };
234
- E(() => {
235
- i != null && i.id && (H == null || H.getRecommendQues(i.id).then((t) => {
234
+ N(() => {
235
+ i != null && i.id && (M == null || M.getRecommendQues(i.id).then((t) => {
236
236
  on(t);
237
237
  }));
238
- }, [St, i]);
238
+ }, [Yt, i]);
239
239
  const dt = (t) => $(void 0, null, function* () {
240
- var u, N;
241
- if (R) {
242
- T("error", "发送功能被禁用");
240
+ var u, E;
241
+ if (F) {
242
+ D("error", "发送功能被禁用");
243
243
  return;
244
244
  }
245
- const n = t || Yt;
245
+ const n = t || St;
246
246
  if (!(n != null && n.trim())) {
247
- T("error", "请输入你想问的");
247
+ D("error", "请输入你想问的");
248
248
  return;
249
249
  }
250
- if (!(M == null ? void 0 : M.every((x) => !!(x != null && x.value))))
250
+ if (!(H == null ? void 0 : H.every((C) => !!(C != null && C.value))))
251
251
  if (f != null && f.promptVariables) {
252
- T("error", "变量值不能为空");
252
+ D("error", "变量值不能为空");
253
253
  return;
254
254
  } else
255
- console.error("变量值不能为空", M == null ? void 0 : M.map((x) => !!(x != null && x.value)));
256
- if (Re) {
257
- T("error", "正在回复中");
255
+ console.error("变量值不能为空", H == null ? void 0 : H.map((C) => !!(C != null && C.value)));
256
+ if (Oe) {
257
+ D("error", "正在回复中");
258
258
  return;
259
259
  }
260
260
  if (Ke) {
261
- T("error", "等待初始化");
261
+ D("error", "等待初始化");
262
262
  return;
263
263
  }
264
264
  if (!gn) {
265
- T("error", "正在解析文件");
265
+ D("error", "正在解析文件");
266
266
  return;
267
267
  }
268
268
  if (Xe) {
269
- T("error", "正在上传图片");
269
+ D("error", "正在上传图片");
270
270
  return;
271
271
  }
272
272
  ve([]), we([]);
@@ -274,14 +274,14 @@ ${e}` : e;
274
274
  if (!r) {
275
275
  if (Ce)
276
276
  return;
277
- X(!0), C == null || C({
278
- netOpen: D ? le.OPEN : le.CLOSE
279
- }).then((x) => {
277
+ X(!0), I == null || I({
278
+ netOpen: T ? le.OPEN : le.CLOSE
279
+ }).then((C) => {
280
280
  var m, B;
281
- Q(!0), O(!!((m = x.data) != null && m.netOpen)), pe(!!((B = x.data) != null && B.enableNetOpen)), Ue(x).then(() => {
282
- b == null || b(x), Q(!1), qe(n);
281
+ Q(!0), R(!!((m = C.data) != null && m.netOpen)), pe(!!((B = C.data) != null && B.enableNetOpen)), Ue(C).then(() => {
282
+ x == null || x(C), Q(!1), qe(n);
283
283
  });
284
- }).catch((x) => {
284
+ }).catch((C) => {
285
285
  X(!1);
286
286
  });
287
287
  return;
@@ -290,9 +290,9 @@ ${e}` : e;
290
290
  return;
291
291
  X(!0), xe(!0);
292
292
  const s = Be(n, J, ne[r], (i == null ? void 0 : i.type) || 0);
293
- let d;
293
+ let c;
294
294
  try {
295
- _ ? d = yield _ == null ? void 0 : _({
295
+ _ ? c = yield _ == null ? void 0 : _({
296
296
  applicationId: i.id,
297
297
  sessionId: r,
298
298
  message: {
@@ -301,44 +301,44 @@ ${e}` : e;
301
301
  role: zt.User,
302
302
  files: ne[r]
303
303
  }
304
- }) : d = !0;
305
- } catch (x) {
306
- d = !1;
304
+ }) : c = !0;
305
+ } catch (C) {
306
+ c = !1;
307
307
  }
308
- if (xe(!1), d === !1) {
308
+ if (xe(!1), c === !1) {
309
309
  X(!1);
310
310
  return;
311
311
  }
312
312
  let l = n;
313
- typeof d == "object" && (l = d.content || n);
314
- const c = yield (() => new Promise((x) => {
315
- ge((m) => (x(m), m));
313
+ typeof c == "object" && (l = c.content || n);
314
+ const d = yield (() => new Promise((C) => {
315
+ ge((m) => (C(m), m));
316
316
  }))();
317
- if (!(yield e.setPromptVariables(c))) {
317
+ if (!(yield e.setPromptVariables(d))) {
318
318
  X(!1);
319
319
  return;
320
320
  }
321
- ((N = ne[r]) == null ? void 0 : N.length) > 0 ? In(l) : Ae(l);
321
+ ((E = ne[r]) == null ? void 0 : E.length) > 0 ? In(l) : Ae(l);
322
322
  }), Ue = (t) => new Promise((n, o) => $(void 0, null, function* () {
323
- const d = (t == null ? void 0 : t.promptVariables).filter((l) => l.type ? !((l.type === Ee.User || l.type === void 0) && l.key === "query") && !((l.type === Ee.System || l.type === void 0) && l.key === "datetime") : l.key !== "query").map((l) => {
324
- var c;
325
- const v = (c = M.find((I) => I.key === l.key && I.type === l.type)) == null ? void 0 : c.value;
323
+ const c = (t == null ? void 0 : t.promptVariables).filter((l) => l.type ? !((l.type === Ne.User || l.type === void 0) && l.key === "query") && !((l.type === Ne.System || l.type === void 0) && l.key === "datetime") : l.key !== "query").map((l) => {
324
+ var d;
325
+ const v = (d = H.find((k) => k.key === l.key && k.type === l.type)) == null ? void 0 : d.value;
326
326
  return l.value = v || "", l;
327
327
  });
328
- ge(d.sort((l, v) => l.key.localeCompare(v.key))), yield t == null ? void 0 : t.setPromptVariables(d).catch((l) => {
329
- console.error(l), T("error", l.message);
328
+ ge(c.sort((l, v) => l.key.localeCompare(v.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((l) => {
329
+ console.error(l), D("error", l.message);
330
330
  }), n();
331
331
  })), In = (t) => {
332
- var s, d, l;
332
+ var s, c, l;
333
333
  if (be(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(i != null && i.id))
334
334
  return;
335
- const n = ((d = e.data) == null ? void 0 : d.id) || "";
335
+ const n = ((c = e.data) == null ? void 0 : c.id) || "";
336
336
  let o = [], r = /* @__PURE__ */ new Set();
337
337
  (l = ne[n]) == null || l.forEach((v) => {
338
338
  r.has(v.id) || (o.push(v), r.add(v.id));
339
339
  }), be(!0), Ae(t, o);
340
340
  };
341
- E(() => {
341
+ N(() => {
342
342
  if (!Le || !e)
343
343
  return;
344
344
  const t = Le, n = () => $(void 0, null, function* () {
@@ -370,21 +370,21 @@ ${e}` : e;
370
370
  };
371
371
  }, [Le, e]);
372
372
  const Ae = (t, n) => $(void 0, null, function* () {
373
- var u, N, x;
373
+ var u, E, C;
374
374
  const o = (u = e == null ? void 0 : e.data) == null ? void 0 : u.id;
375
375
  if (!o)
376
376
  return;
377
377
  q(!0), V(!0);
378
378
  const r = Be(t, J, n, (i == null ? void 0 : i.type) || 0);
379
379
  let s;
380
- if (i.type === Y.Agent)
380
+ if (i.type === S.Agent)
381
381
  s = void 0;
382
- else if (i.type === Y.Dialog && ((N = i.arrange) != null && N.length) && i.arrange[0].visionOpen) {
382
+ else if (i.type === S.Dialog && ((E = i.arrange) != null && E.length) && i.arrange[0].visionOpen) {
383
383
  const m = J && J.length ? J.filter(Boolean) : [];
384
384
  s = m.length ? m : void 0;
385
385
  } else
386
386
  s = void 0;
387
- const d = new he(
387
+ const c = new he(
388
388
  r,
389
389
  o,
390
390
  ae.User,
@@ -392,35 +392,35 @@ ${e}` : e;
392
392
  s
393
393
  // 新增:传入图片内容
394
394
  );
395
- me(void 0), te(void 0), y.current = [d, ...w], L(y.current), i.id && ye && ye({
395
+ me(void 0), te(void 0), y.current = [c, ...w], L(y.current), i.id && ye && ye({
396
396
  applicationId: i.id,
397
397
  sessionId: o,
398
- message: d
398
+ message: c
399
399
  });
400
400
  const l = new he("", o, ae.System);
401
401
  l.isWaiting = !0, y.current = [l, ...y.current], L(y.current);
402
- const v = (n == null ? void 0 : n.map((m) => m.id)) || [], c = {
402
+ const v = (n == null ? void 0 : n.map((m) => m.id)) || [], d = {
403
403
  stream: ei.stream,
404
404
  referenceFirst: !1
405
405
  };
406
406
  if (f != null && f.promptVariables) {
407
- const m = M == null ? void 0 : M.reduce((B, oe) => (B[oe.key] = oe.value, B), {});
408
- c.formatValues = m;
407
+ const m = H == null ? void 0 : H.reduce((B, oe) => (B[oe.key] = oe.value, B), {});
408
+ d.formatValues = m;
409
409
  }
410
410
  if (f != null && f.knowledges) {
411
411
  const m = mn;
412
- c.knowledges = m;
412
+ d.knowledges = m;
413
413
  }
414
- const I = {
414
+ const k = {
415
415
  text: r,
416
416
  fileIds: v,
417
417
  files: n
418
418
  };
419
- s && s.length > 0 && (I.imageContent = s), yield e.send(I, c), de({
419
+ s && s.length > 0 && (k.imageContent = s), yield e.send(k, d), de({
420
420
  [o]: []
421
- }), (x = fe.current) == null || x.update(), ve([]), we([]), X(!1);
421
+ }), (C = fe.current) == null || C.update(), ve([]), we([]), X(!1);
422
422
  });
423
- E(() => {
423
+ N(() => {
424
424
  var v;
425
425
  const t = (v = e == null ? void 0 : e.data) == null ? void 0 : v.id;
426
426
  if (!t)
@@ -430,58 +430,58 @@ ${e}` : e;
430
430
  n = null, o && (L([o, ...y.current]), o = null);
431
431
  }, s = () => {
432
432
  n !== null && (cancelAnimationFrame(n), n = null, o = null);
433
- }, d = (c) => {
434
- if (!c.sessionId || c.sessionId && c.sessionId !== Ye.current || c.role === ae.User)
433
+ }, c = (d) => {
434
+ if (!d.sessionId || d.sessionId && d.sessionId !== Se.current || d.role === ae.User)
435
435
  return;
436
- if (c.index === -1 && c.code !== 200 && c.code !== 11915 && (s(), V(!1), q(!1), y.current = y.current.filter((N) => !N.isWaiting), L([...y.current]), y.current = [...y.current], c.content)) {
436
+ if (d.index === -1 && d.code !== 200 && d.code !== 11915 && (s(), V(!1), q(!1), y.current = y.current.filter((E) => !E.isWaiting), L([...y.current]), y.current = [...y.current], d.content)) {
437
437
  se.config({
438
- getContainer: () => (S == null ? void 0 : S.current) || document.body,
438
+ getContainer: () => (Y == null ? void 0 : Y.current) || document.body,
439
439
  prefixCls: "gbot-notification"
440
440
  }), se.error({
441
- message: c.content
441
+ message: d.content
442
442
  }), se.config({
443
443
  getContainer: void 0,
444
444
  prefixCls: "gbot-notification"
445
445
  });
446
446
  return;
447
447
  }
448
- const I = c.actions || [], u = new he(c.content, t, ae.Robot);
449
- if (u.messageId = c.messageId || _e(), u.reasoningContent = c.reasoningContent, u.searchReference = c.searchReference, u.thinkingSecs = c.thinkingSecs, u.thinkingStatus = c.thinkingStatus, u.actions = I, u.isLoading = !0, u.searchingStatus = c.searchingStatus, y.current = y.current.filter((N) => !N.isWaiting).filter((N) => !N.isReplying), c.index === void 0) {
448
+ const k = d.actions || [], u = new he(d.content, t, ae.Robot);
449
+ if (u.messageId = d.messageId || _e(), u.reasoningContent = d.reasoningContent, u.searchReference = d.searchReference, u.thinkingSecs = d.thinkingSecs, u.thinkingStatus = d.thinkingStatus, u.actions = k, u.isLoading = !0, u.searchingStatus = d.searchingStatus, y.current = y.current.filter((E) => !E.isWaiting).filter((E) => !E.isReplying), d.index === void 0) {
450
450
  o = u, n === null && (n = requestAnimationFrame(r));
451
451
  return;
452
452
  }
453
- s(), c.code === 11915 && (V(!1), q(!1), u.isLoading = !1, u.content = "请您换个问题问我吧~", u.isSensitive = !0, L([u, ...y.current])), c.index === -2 && (V(!1), q(!1), u.isLoading = !1, u.content = "回答已中止~", u.isSuspend = !0, L([u, ...y.current])), c.index === -1 && (V(!1), q(!1), u.isLoading = !1, u.reference = c.reference, L([u, ...y.current]), i.id && ye && ye({
453
+ s(), d.code === 11915 && (V(!1), q(!1), u.isLoading = !1, u.content = "请您换个问题问我吧~", u.isSensitive = !0, L([u, ...y.current])), d.index === -2 && (V(!1), q(!1), u.isLoading = !1, u.content = "回答已中止~", u.isSuspend = !0, L([u, ...y.current])), d.index === -1 && (V(!1), q(!1), u.isLoading = !1, u.reference = d.reference, L([u, ...y.current]), i.id && ye && ye({
454
454
  applicationId: i.id,
455
455
  sessionId: t,
456
456
  message: u
457
- })), c.index === -3 && (V(!1), q(!1), u.isLoading = !1, u.reference = c.reference, u.relatedQuesion = c.relatedQuesion, L([u, ...y.current]));
457
+ })), d.index === -3 && (V(!1), q(!1), u.isLoading = !1, u.reference = d.reference, u.relatedQuesion = d.relatedQuesion, L([u, ...y.current]));
458
458
  }, l = () => {
459
- e.addEventListener("message:updated", d);
459
+ e.addEventListener("message:updated", c);
460
460
  };
461
- return e.ready ? e.addEventListener("message:updated", d) : e.addEventListener("ready", l), () => {
462
- s(), e == null || e.removeEventListener("message:updated", d), e == null || e.removeEventListener("ready", l);
461
+ return e.ready ? e.addEventListener("message:updated", c) : e.addEventListener("ready", l), () => {
462
+ s(), e == null || e.removeEventListener("message:updated", c), e == null || e.removeEventListener("ready", l);
463
463
  };
464
- }, [e]), E(() => {
464
+ }, [e]), N(() => {
465
465
  if (!e) {
466
- De(!1);
466
+ Te(!1);
467
467
  return;
468
468
  }
469
469
  const t = (n) => {
470
- De(n);
470
+ Te(n);
471
471
  };
472
- return De(e.frozen), e.addEventListener("frozen", t), () => {
472
+ return Te(e.frozen), e.addEventListener("frozen", t), () => {
473
473
  e == null || e.removeEventListener("frozen", t);
474
474
  };
475
- }, [e]), E(() => {
475
+ }, [e]), N(() => {
476
476
  if (!P)
477
477
  return;
478
478
  const t = P.questionContextMaxLength || 4e3;
479
479
  tn(t);
480
- }, [P, H]), E(() => {
480
+ }, [P, M]), N(() => {
481
481
  Pe && te(Pe.text);
482
482
  }, [Pe]);
483
- const T = (t, n, o) => {
484
- si(S, () => {
483
+ const D = (t, n, o) => {
484
+ si(Y, () => {
485
485
  Zn.open({
486
486
  type: t,
487
487
  content: n,
@@ -490,46 +490,46 @@ ${e}` : e;
490
490
  });
491
491
  }, ft = (t) => {
492
492
  const n = t.size;
493
- return n <= 0 ? (T("error", "该文件为空,请重新上传"), !1) : n > Ve * ti ? (T("error", `图片须小于${Ve}M`), !1) : (ve((o) => o.length >= Z ? (T("warning", `图片最多上传${Z}张`), o) : [...o, t]), !1);
494
- }, Nn = () => {
493
+ return n <= 0 ? (D("error", "该文件为空,请重新上传"), !1) : n > Ve * ti ? (D("error", `图片须小于${Ve}M`), !1) : (ve((o) => o.length >= Z ? (D("warning", `图片最多上传${Z}张`), o) : [...o, t]), !1);
494
+ }, En = () => {
495
495
  var t;
496
- return (i.type === Y.Agent && (f == null ? void 0 : f.imageUpload) || i.type === Y.Dialog && ((t = i.arrange) == null ? void 0 : t.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && !R;
497
- }, En = () => !!z && (f == null ? void 0 : f.fileUpload) && (i == null ? void 0 : i.id) && !R, gt = (t) => {
498
- var N, x;
496
+ return (i.type === S.Agent && (f == null ? void 0 : f.imageUpload) || i.type === S.Dialog && ((t = i.arrange) == null ? void 0 : t.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && !F;
497
+ }, Nn = () => !!z && (f == null ? void 0 : f.fileUpload) && (i == null ? void 0 : i.id) && !F, gt = (t) => {
498
+ var E, C;
499
499
  const n = Array.from(t || []).filter(Boolean);
500
500
  if (!n.length)
501
501
  return;
502
- const o = Nn(), r = En(), s = [], d = [];
503
- let l = 0, v = 0, c = 0;
502
+ const o = En(), r = Nn(), s = [], c = [];
503
+ let l = 0, v = 0, d = 0;
504
504
  n.forEach((m) => {
505
- var At, Ht, Mt;
505
+ var At, Mt, Ht;
506
506
  if (((At = m.type) == null ? void 0 : At.startsWith("image/")) || !!Bt(m.name)) {
507
507
  o ? s.push(m) : l++;
508
508
  return;
509
509
  }
510
- const oe = (Mt = (Ht = m.name) == null ? void 0 : Ht.split(".").pop()) == null ? void 0 : Mt.toLowerCase();
510
+ const oe = (Ht = (Mt = m.name) == null ? void 0 : Mt.split(".").pop()) == null ? void 0 : Ht.toLowerCase();
511
511
  if (oi.includes(m.type) || ["pdf", "doc", "docx"].includes(oe || "")) {
512
- r ? d.push(m) : v++;
512
+ r ? c.push(m) : v++;
513
513
  return;
514
514
  }
515
- c++;
515
+ d++;
516
516
  });
517
- const I = [], u = l + v + c;
517
+ const k = [], u = l + v + d;
518
518
  if (!r && !o)
519
- u && I.push(`当前不支持上传文件/图片,已忽略${u}个文件`);
519
+ u && k.push(`当前不支持上传文件/图片,已忽略${u}个文件`);
520
520
  else if (r && !o) {
521
- const m = l + c;
522
- m && I.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${m}个其他类型文件`);
521
+ const m = l + d;
522
+ m && k.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${m}个其他类型文件`);
523
523
  } else if (!r && o) {
524
- const m = v + c;
525
- m && I.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${m}个其他类型文件`);
524
+ const m = v + d;
525
+ m && k.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${m}个其他类型文件`);
526
526
  } else
527
- c && I.push(`存在不支持的文件类型,已忽略${c}个文件`);
528
- if (I.length && T("warning", I.join(";"), "precheck-warn"), s.length) {
527
+ d && k.push(`存在不支持的文件类型,已忽略${d}个文件`);
528
+ if (k.length && D("warning", k.join(";"), "precheck-warn"), s.length) {
529
529
  const m = Math.max(0, Z - ce.length), B = s.slice(0, m);
530
- B.forEach((oe) => ft(oe)), s.length > B.length && T("warning", `最多上传${Z}张图片`);
530
+ B.forEach((oe) => ft(oe)), s.length > B.length && D("warning", `最多上传${Z}张图片`);
531
531
  }
532
- d.length && ((x = (N = fe.current) == null ? void 0 : N.appendFiles) == null || x.call(N, d));
532
+ c.length && ((C = (E = fe.current) == null ? void 0 : E.appendFiles) == null || C.call(E, c));
533
533
  }, ut = (t) => {
534
534
  var o;
535
535
  const n = (o = t.clipboardData) == null ? void 0 : o.files;
@@ -544,11 +544,11 @@ ${e}` : e;
544
544
  }, mt = () => $(void 0, null, function* () {
545
545
  var t;
546
546
  return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ie.current || (ie.current = new Promise((n, o) => {
547
- Q(!0), C == null || C({
548
- netOpen: D ? le.OPEN : le.CLOSE
547
+ Q(!0), I == null || I({
548
+ netOpen: T ? le.OPEN : le.CLOSE
549
549
  }).then((r) => {
550
- var s, d;
551
- b == null || b(r), Q(!1), O(!!((s = r.data) != null && s.netOpen)), pe(!!((d = r.data) != null && d.enableNetOpen)), Ue(r), n(r);
550
+ var s, c;
551
+ x == null || x(r), Q(!1), R(!!((s = r.data) != null && s.netOpen)), pe(!!((c = r.data) != null && c.enableNetOpen)), Ue(r), n(r);
552
552
  }).catch((r) => {
553
553
  ie.current = null, o(r);
554
554
  });
@@ -559,26 +559,26 @@ ${e}` : e;
559
559
  }), Pn = (t, n) => {
560
560
  const o = Bt(n.name);
561
561
  return new Promise((r) => {
562
- var d;
562
+ var c;
563
563
  const s = {
564
564
  files: [`${_e()}.${o}`],
565
565
  isv: "minio",
566
- knowledgeId: ((d = t.data) == null ? void 0 : d.id) || "",
566
+ knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
567
567
  type: 1
568
568
  };
569
- H == null || H.postTicket(s).then((l) => {
570
- H.uploadMinioFile(l.minio, n).then(() => {
571
- var u, N;
572
- const v = (u = l.minio.endpoints) == null ? void 0 : u[0], c = l.minio.bucket, I = (N = l.minio.fileKeys) == null ? void 0 : N[0];
573
- r(`${l.minio.useSSL ? "https:" : location.protocol}//${v}/${c}/${I}`);
569
+ M == null || M.postTicket(s).then((l) => {
570
+ M.uploadMinioFile(l.minio, n).then(() => {
571
+ var u, E;
572
+ const v = (u = l.minio.endpoints) == null ? void 0 : u[0], d = l.minio.bucket, k = (E = l.minio.fileKeys) == null ? void 0 : E[0];
573
+ r(`${l.minio.useSSL ? "https:" : location.protocol}//${v}/${d}/${k}`);
574
574
  }).catch(() => {
575
575
  });
576
576
  }).catch(() => {
577
577
  });
578
578
  });
579
579
  };
580
- E(() => {
581
- const t = A.current;
580
+ N(() => {
581
+ const t = O.current;
582
582
  t && !it && t.scrollTo({
583
583
  top: t.scrollHeight
584
584
  });
@@ -589,27 +589,27 @@ ${e}` : e;
589
589
  const r = $e(je({}, n.file), {
590
590
  type: 1
591
591
  });
592
- H == null || H.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, r).finally(() => {
592
+ M == null || M.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, r).finally(() => {
593
593
  var s;
594
594
  (s = fe.current) == null || s.update().finally(o);
595
595
  });
596
- }), Tn = () => {
596
+ }), Dn = () => {
597
597
  var t;
598
598
  (t = e == null ? void 0 : e.data) != null && t.id && (V(!1), e.suspend());
599
- }, Dn = (t) => {
600
- const n = A.current;
599
+ }, Tn = (t) => {
600
+ const n = O.current;
601
601
  n && setTimeout(() => {
602
602
  n.scrollTo({
603
603
  top: n.scrollHeight,
604
604
  behavior: t == null ? void 0 : t.behavior
605
605
  });
606
606
  }, t == null ? void 0 : t.ms);
607
- }, On = () => {
608
- if (!A.current)
607
+ }, Rn = () => {
608
+ if (!O.current)
609
609
  return;
610
- const t = A.current.scrollTop <= -80;
610
+ const t = O.current.scrollTop <= -80;
611
611
  hn(t);
612
- }, Rn = ze((t) => {
612
+ }, On = ze((t) => {
613
613
  var n, o;
614
614
  (n = ke.current) == null || n.update(t), (o = ke.current) == null || o.focus();
615
615
  }), Fn = ze((t) => {
@@ -622,9 +622,9 @@ ${e}` : e;
622
622
  const t = new he("", e.data.id, ae.System);
623
623
  t.isWaiting = !0, y.current = [t, ...y.current], L(y.current), q(!0), V(!0), e.answerAgain();
624
624
  });
625
- E(() => {
625
+ N(() => {
626
626
  var t, n;
627
- Ye.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ot && ((n = Oe.current) == null || n.clear());
627
+ Se.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ot && ((n = Re.current) == null || n.clear());
628
628
  }, [e]);
629
629
  const An = () => {
630
630
  var o;
@@ -642,68 +642,82 @@ ${e}` : e;
642
642
  }
643
643
  s.length < 10 ? ue(!1) : ue(!0), L([...w, ...s.reverse()]);
644
644
  });
645
- }, Hn = (t) => $(void 0, null, function* () {
645
+ }, Mn = (t) => $(void 0, null, function* () {
646
646
  var n, o;
647
647
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
648
- O(t);
648
+ R(t);
649
649
  else {
650
650
  if (yield e.setNetOpen(t), !((o = e.data) != null && o.id))
651
651
  return;
652
- O(t);
652
+ R(t);
653
653
  }
654
- }), He = () => $(void 0, null, function* () {
654
+ }), Me = () => $(void 0, null, function* () {
655
655
  e ? e.fetchData().then((t) => {
656
656
  var n;
657
- (n = e == null ? void 0 : e.data) != null && n.id && (O(t.netOpen), pe(t.enableNetOpen));
658
- }) : (O(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), pe(i.arrange[0].enableNetOpen));
657
+ (n = e == null ? void 0 : e.data) != null && n.id && (R(t.netOpen), pe(t.enableNetOpen));
658
+ }) : (R(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), pe(i.arrange[0].enableNetOpen));
659
659
  });
660
- E(() => {
661
- He();
662
- }, [e]), E(() => {
663
- requestAnimationFrame(() => {
664
- var n, o;
665
- if (A.current) {
666
- const r = document.getElementById("chat-main"), s = (n = A.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), d = (o = A.current) == null ? void 0 : o.querySelector(".infinite-scroll-component");
667
- if (!s || !d || !r)
660
+ N(() => {
661
+ Me();
662
+ }, [e]), N(() => {
663
+ let t = null, n = null;
664
+ const o = () => {
665
+ var k, u;
666
+ if (!O.current)
667
+ return;
668
+ const s = document.getElementById("chat-main"), c = (k = O.current) == null ? void 0 : k.querySelector(".infinite-scroll-component__outerdiv"), l = (u = O.current) == null ? void 0 : u.querySelector(".infinite-scroll-component");
669
+ if (!c || !l || !s)
670
+ return;
671
+ const v = s.offsetHeight;
672
+ if (l.offsetHeight <= v) {
673
+ if (c.style.height === "100%")
668
674
  return;
669
- const l = r.offsetHeight;
670
- if (d.offsetHeight <= l) {
671
- if (s.style.height === "100%")
672
- return;
673
- s.style.height = "100%";
674
- } else {
675
- if (s.style.height === "auto")
676
- return;
677
- s.style.height = "auto";
678
- }
675
+ c.style.height = "100%";
676
+ } else {
677
+ if (c.style.height === "auto")
678
+ return;
679
+ c.style.height = "auto";
679
680
  }
680
- });
681
- }, [w]), E(() => {
681
+ }, r = () => {
682
+ var l;
683
+ if (typeof ResizeObserver == "undefined" || !O.current)
684
+ return;
685
+ const s = document.getElementById("chat-main"), c = (l = O.current) == null ? void 0 : l.querySelector(".infinite-scroll-component");
686
+ !c || !s || (n = new ResizeObserver(() => {
687
+ o();
688
+ }), n.observe(c), n.observe(s));
689
+ };
690
+ return t = requestAnimationFrame(() => {
691
+ o(), r();
692
+ }), () => {
693
+ t !== null && cancelAnimationFrame(t), n == null || n.disconnect();
694
+ };
695
+ }, [w]), N(() => {
682
696
  if (e)
683
697
  return;
684
698
  const t = () => {
685
- const r = ((P == null ? void 0 : P.promptVariables) || []).filter((s) => s.type ? !(s.type === Ee.User && s.key === "query") && !(s.type === Ee.System && s.key === "datetime") && s.status === 1 : s.key !== "query" && s.status === 1).map((s, d) => {
686
- var v, c;
699
+ const r = ((P == null ? void 0 : P.promptVariables) || []).filter((s) => s.type ? !(s.type === Ne.User && s.key === "query") && !(s.type === Ne.System && s.key === "datetime") && s.status === 1 : s.key !== "query" && s.status === 1).map((s, c) => {
700
+ var v, d;
687
701
  let l = "";
688
- return typeof (a == null ? void 0 : a.promptVariables) == "object" && (l = ((c = (v = a.promptVariables.default) == null ? void 0 : v.find((I) => I.key === s.key && I.type === s.type)) == null ? void 0 : c.value) || ""), {
689
- id: d + "",
702
+ return typeof (a == null ? void 0 : a.promptVariables) == "object" && (l = ((d = (v = a.promptVariables.default) == null ? void 0 : v.find((k) => k.key === s.key && k.type === s.type)) == null ? void 0 : d.value) || ""), {
703
+ id: c + "",
690
704
  key: s.key,
691
705
  name: s.name,
692
706
  value: l,
693
707
  type: s.type
694
708
  };
695
709
  });
696
- ge([...r].sort((s, d) => s.key.localeCompare(d.key)));
710
+ ge([...r].sort((s, c) => s.key.localeCompare(c.key)));
697
711
  };
698
712
  return P != null && P.ready ? t() : P == null || P.addEventListener("ready", t), () => {
699
713
  P == null || P.removeEventListener("ready", t);
700
714
  };
701
715
  }, [e, P, a == null ? void 0 : a.promptVariables]);
702
- const vt = () => C == null ? void 0 : C({
703
- netOpen: D ? le.OPEN : le.CLOSE
716
+ const vt = () => I == null ? void 0 : I({
717
+ netOpen: T ? le.OPEN : le.CLOSE
704
718
  }).then((t) => {
705
719
  var n, o;
706
- return b == null || b(t), Q(!1), O(!!((n = t.data) != null && n.netOpen)), pe(!!((o = t.data) != null && o.enableNetOpen)), Ue(t), t;
720
+ return x == null || x(t), Q(!1), R(!!((n = t.data) != null && n.netOpen)), pe(!!((o = t.data) != null && o.enableNetOpen)), Ue(t), t;
707
721
  }), wt = !!w.length, kt = Kn(() => {
708
722
  var t;
709
723
  return i.arrange && ((t = i.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ g(Wt, {
@@ -724,31 +738,31 @@ ${e}` : e;
724
738
  markdown: a == null ? void 0 : a.markdown
725
739
  }) : null;
726
740
  }, [i == null ? void 0 : i.arrange, wt]);
727
- return Yn(h, () => ({
741
+ return Sn(h, () => ({
728
742
  getCurrentInputText: () => {
729
743
  var t;
730
744
  return (t = ke.current) == null ? void 0 : t.getCurrentText();
731
745
  }
732
- })), E(() => {
746
+ })), N(() => {
733
747
  var n;
734
748
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
735
749
  t && de((o) => $e(je({}, o), {
736
750
  [t]: []
737
751
  }));
738
- }, [(bt = e == null ? void 0 : e.data) == null ? void 0 : bt.id]), /* @__PURE__ */ F("div", {
752
+ }, [(bt = e == null ? void 0 : e.data) == null ? void 0 : bt.id]), /* @__PURE__ */ U("div", {
739
753
  className: "agent-chat",
740
754
  children: [wn ? /* @__PURE__ */ g("div", {
741
755
  className: "session-loading",
742
756
  children: /* @__PURE__ */ g($t, {})
743
- }) : /* @__PURE__ */ F(Bn, {
757
+ }) : /* @__PURE__ */ U(Bn, {
744
758
  children: [(f == null ? void 0 : f.promptVariables) && /* @__PURE__ */ g(ui, {
745
759
  ref: et,
746
760
  appId: i.id,
747
761
  currentSession: e,
748
- promptVariables: M,
762
+ promptVariables: H,
749
763
  setPromptVariables: ge,
750
- setCurrentSession: b
751
- }), /* @__PURE__ */ F("div", {
764
+ setCurrentSession: x
765
+ }), /* @__PURE__ */ U("div", {
752
766
  className: "chat-main",
753
767
  id: "chat-main",
754
768
  style: Xt,
@@ -761,9 +775,9 @@ ${e}` : e;
761
775
  display: "flex",
762
776
  flexDirection: "column-reverse"
763
777
  },
764
- ref: A,
765
- onScroll: On,
766
- children: (xt = e == null ? void 0 : e.data) != null && xt.id && (w != null && w.length) ? /* @__PURE__ */ F(mi, {
778
+ ref: O,
779
+ onScroll: Rn,
780
+ children: (xt = e == null ? void 0 : e.data) != null && xt.id && (w != null && w.length) ? /* @__PURE__ */ U(mi, {
767
781
  dataLength: w.length,
768
782
  next: An,
769
783
  style: {
@@ -773,7 +787,7 @@ ${e}` : e;
773
787
  },
774
788
  inverse: !0,
775
789
  endMessage: w.length > qt && // 少于一页不展示这个提示
776
- ((Ct = A.current) != null && Ct.scrollTop) && ((It = A.current) == null ? void 0 : It.scrollTop) < -10 ? /* @__PURE__ */ g(Sn, {
790
+ ((Ct = O.current) != null && Ct.scrollTop) && ((It = O.current) == null ? void 0 : It.scrollTop) < -10 ? /* @__PURE__ */ g(Yn, {
777
791
  plain: !0,
778
792
  children: "没有更多数据了"
779
793
  }) : null,
@@ -791,21 +805,21 @@ ${e}` : e;
791
805
  application: i,
792
806
  currentSession: e,
793
807
  history: t,
794
- docViewerUrl: U,
808
+ docViewerUrl: A,
795
809
  isLastHistory: n === 0,
796
810
  onRelatedClick: Fn,
797
811
  onAgainClick: Un,
798
- onEditClick: Rn,
812
+ onEditClick: On,
799
813
  markdown: a == null ? void 0 : a.markdown
800
814
  }, t.messageId + n)), !st && kt]
801
- }) : /* @__PURE__ */ F("div", {
815
+ }) : /* @__PURE__ */ U("div", {
802
816
  className: "main-empty",
803
817
  children: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ g(li, {
804
818
  text: (
805
819
  // 第一优先级:features配置
806
820
  a != null && a.greeting && typeof a.greeting == "object" && a.greeting.text !== void 0 ? a.greeting.text : (
807
821
  // 第二优先级:application.arrange[0].greetings
808
- (Nt = i.arrange) != null && Nt.length && ((Et = i.arrange[0]) != null && Et.greetings) ? i.arrange[0].greetings : (
822
+ (Et = i.arrange) != null && Et.length && ((Nt = i.arrange[0]) != null && Nt.greetings) ? i.arrange[0].greetings : (
809
823
  // 第三优先级:默认文本
810
824
  _t.text
811
825
  )
@@ -813,7 +827,7 @@ ${e}` : e;
813
827
  ),
814
828
  icon: a === void 0 || a.greeting === !0 || ((Lt = a.greeting) == null ? void 0 : Lt.icon) === void 0 ? Gt || _t.icon : a.greeting.icon,
815
829
  children: !!Ge.length && (((a == null ? void 0 : a.greeting) === void 0 || (a == null ? void 0 : a.greeting)) === !0 || typeof (a == null ? void 0 : a.greeting) == "object" && a.greeting.questions !== !1) && /* @__PURE__ */ g(ai, {
816
- ref: Oe,
830
+ ref: Re,
817
831
  sid: (Pt = e == null ? void 0 : e.data) == null ? void 0 : Pt.id,
818
832
  isRecommendClearing: Ze,
819
833
  data: Ge,
@@ -825,12 +839,12 @@ ${e}` : e;
825
839
  t != null && t.id && ee(!0);
826
840
  const n = (o = e == null ? void 0 : e.data) == null ? void 0 : o.id;
827
841
  f != null && f.fileUpload ? (s = (r = fe.current) == null ? void 0 : r.clear()) == null || s.then(() => {
828
- var d, l;
829
- t != null && t.id && (n ? (d = yt(n, t)) == null || d.finally(() => {
842
+ var c, l;
843
+ t != null && t.id && (n ? (c = yt(n, t)) == null || c.finally(() => {
830
844
  ee(!1);
831
845
  }) : (ee(!1), Q(!0), (l = vt()) == null || l.then((v) => {
832
- var c;
833
- (c = yt(v.id, t)) == null || c.finally(() => {
846
+ var d;
847
+ (d = yt(v.id, t)) == null || d.finally(() => {
834
848
  ee(!1);
835
849
  });
836
850
  })));
@@ -854,14 +868,14 @@ ${e}` : e;
854
868
  fontSize: 16
855
869
  }
856
870
  }),
857
- onClick: () => Tn(),
871
+ onClick: () => Dn(),
858
872
  children: "停止回答"
859
873
  })
860
874
  }), it && (w == null ? void 0 : w.length) > 0 && /* @__PURE__ */ g("div", {
861
875
  className: "back-bottom",
862
876
  children: /* @__PURE__ */ g(G, {
863
877
  size: "small",
864
- onClick: () => Dn({
878
+ onClick: () => Tn({
865
879
  behavior: "smooth"
866
880
  }),
867
881
  type: "link",
@@ -875,7 +889,7 @@ ${e}` : e;
875
889
  })]
876
890
  }), /* @__PURE__ */ g("div", {
877
891
  className: "chat-footer",
878
- children: /* @__PURE__ */ F("div", {
892
+ children: /* @__PURE__ */ U("div", {
879
893
  className: "chat-footer-input",
880
894
  children: [ce.length > 0 && /* @__PURE__ */ g("div", {
881
895
  className: "input-files",
@@ -902,15 +916,15 @@ ${e}` : e;
902
916
  });
903
917
  }
904
918
  }, n))
905
- }), /* @__PURE__ */ F("div", {
919
+ }), /* @__PURE__ */ U("div", {
906
920
  className: "footer-upload-action-wrapper",
907
- children: [/* @__PURE__ */ F(Ne, {
921
+ children: [/* @__PURE__ */ U(Ee, {
908
922
  className: "footer-upload-action",
909
923
  onClick: (t) => t.preventDefault(),
910
- children: [/* @__PURE__ */ F(Ne, {
911
- children: [(i.type === Y.Agent && (f == null ? void 0 : f.imageUpload) || i.type === Y.Dialog && ((Tt = i.arrange) == null ? void 0 : Tt.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && /* @__PURE__ */ g(Qn, {
924
+ children: [/* @__PURE__ */ U(Ee, {
925
+ children: [(i.type === S.Agent && (f == null ? void 0 : f.imageUpload) || i.type === S.Dialog && ((Dt = i.arrange) == null ? void 0 : Dt.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && /* @__PURE__ */ g(Qn, {
912
926
  multiple: !0,
913
- disabled: ce.length >= Z || R,
927
+ disabled: ce.length >= Z || F,
914
928
  accept: ".jpg, .png, .jpeg,.bmp",
915
929
  listType: "picture-card",
916
930
  beforeUpload: ft,
@@ -960,16 +974,16 @@ ${e}` : e;
960
974
  appId: i == null ? void 0 : i.id,
961
975
  ref: fe,
962
976
  isFirstSession: ot,
963
- docViewerUrl: U,
977
+ docViewerUrl: A,
964
978
  onStatusChange: (t) => $(void 0, null, function* () {
965
- t !== "process" ? (be(!0), He()) : be(!1);
979
+ t !== "process" ? (be(!0), Me()) : be(!1);
966
980
  }),
967
981
  createSession: () => mt().then((t) => {
968
982
  var o;
969
983
  return ((o = t.data) == null ? void 0 : o.id) || "";
970
984
  }),
971
- sid: (Dt = e == null ? void 0 : e.data) == null ? void 0 : Dt.id,
972
- disabled: Re || R,
985
+ sid: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
986
+ disabled: Oe || F,
973
987
  afterFileAdd: (t, n) => {
974
988
  n && de((o) => {
975
989
  const r = o[n] || [];
@@ -984,7 +998,7 @@ ${e}` : e;
984
998
  n && de((r) => {
985
999
  const s = r[n] || [];
986
1000
  return {
987
- [n]: s.filter((d) => d.id !== t)
1001
+ [n]: s.filter((c) => c.id !== t)
988
1002
  };
989
1003
  });
990
1004
  },
@@ -997,7 +1011,7 @@ ${e}` : e;
997
1011
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
998
1012
  t && (de({
999
1013
  [t]: []
1000
- }), He());
1014
+ }), Me());
1001
1015
  }
1002
1016
  }) : null, (f == null ? void 0 : f.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ g(vi, {
1003
1017
  appId: i.id,
@@ -1006,23 +1020,23 @@ ${e}` : e;
1006
1020
  onPromptSelect: (t) => {
1007
1021
  te(t.context), me(t.context);
1008
1022
  },
1009
- disabled: R
1023
+ disabled: F
1010
1024
  })]
1011
- }), /* @__PURE__ */ F(Ne, {
1012
- children: [(f == null ? void 0 : f.connectNetwork) && i.type === Y.Dialog && ((Ot = i.arrange) == null ? void 0 : Ot.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ g(yi, {
1013
- sessionId: (Rt = e == null ? void 0 : e.data) == null ? void 0 : Rt.id,
1014
- netStatus: D,
1025
+ }), /* @__PURE__ */ U(Ee, {
1026
+ children: [(f == null ? void 0 : f.connectNetwork) && i.type === S.Dialog && ((Rt = i.arrange) == null ? void 0 : Rt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ g(yi, {
1027
+ sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
1028
+ netStatus: T,
1015
1029
  enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : vn,
1016
1030
  disabledTip: e ? void 0 : "网络访问已被禁用",
1017
1031
  onNetStatusChange: (t) => {
1018
- Hn(t);
1032
+ Mn(t);
1019
1033
  }
1020
1034
  }), (f == null ? void 0 : f.sessionList) && /* @__PURE__ */ g(pi, {
1021
1035
  currentSessionId: (Ft = e == null ? void 0 : e.data) == null ? void 0 : Ft.id,
1022
1036
  onSessionChange: (t, n) => {
1023
- te(void 0), Ie(!0), b == null || b(n);
1037
+ te(void 0), Ie(!0), x == null || x(n);
1024
1038
  },
1025
- disabled: R
1039
+ disabled: F
1026
1040
  }), Zt && Jt === "float" && /* @__PURE__ */ g("div", {
1027
1041
  className: "session-history-drawer-component",
1028
1042
  children: /* @__PURE__ */ g(Gn, {
@@ -1036,7 +1050,7 @@ ${e}` : e;
1036
1050
  content: "会话历史记录",
1037
1051
  children: /* @__PURE__ */ g(G, {
1038
1052
  className: "history-overlay-action",
1039
- disabled: R,
1053
+ disabled: F,
1040
1054
  type: "text",
1041
1055
  icon: /* @__PURE__ */ g(re, {
1042
1056
  type: "icon-lishijilu",
@@ -1051,10 +1065,10 @@ ${e}` : e;
1051
1065
  icon: /* @__PURE__ */ g(di, {}),
1052
1066
  className: "add-btn",
1053
1067
  type: "primary",
1054
- disabled: nt || !e || !w.length || R,
1068
+ disabled: nt || !e || !w.length || F,
1055
1069
  onClick: () => {
1056
1070
  var t, n;
1057
- Ie(!1), b == null || b(null), ie.current = null, O(!1), (t = et.current) == null || t.clear(), (n = Oe.current) == null || n.clear();
1071
+ Ie(!1), x == null || x(null), ie.current = null, R(!1), (t = et.current) == null || t.clear(), (n = Re.current) == null || n.clear();
1058
1072
  },
1059
1073
  children: "新会话"
1060
1074
  })]
@@ -1062,7 +1076,7 @@ ${e}` : e;
1062
1076
  }), !!Fe && /* @__PURE__ */ g("div", {
1063
1077
  className: "remainingSeconds-mark"
1064
1078
  })]
1065
- }), /* @__PURE__ */ F("div", {
1079
+ }), /* @__PURE__ */ U("div", {
1066
1080
  className: "footer-textarea",
1067
1081
  onPaste: ut,
1068
1082
  onPasteCapture: ut,
@@ -1076,18 +1090,18 @@ ${e}` : e;
1076
1090
  text: ln,
1077
1091
  networkStatus: !1,
1078
1092
  loading: rt || Ce,
1079
- disabled: Ke || Xe || R || rt || Ce,
1093
+ disabled: Ke || Xe || F || rt || Ce,
1080
1094
  onTextSend: dt,
1081
1095
  onChange: (t, n) => {
1082
1096
  te(t);
1083
1097
  const o = n.getText().replace(/[\n\s]+$/, "");
1084
1098
  me(o), an(o), Je || sn(!0);
1085
1099
  },
1086
- clearAction: /* @__PURE__ */ g(Ne, {
1100
+ clearAction: /* @__PURE__ */ g(Ee, {
1087
1101
  size: 0,
1088
1102
  children: /* @__PURE__ */ g(G, {
1089
1103
  type: "link",
1090
- disabled: Re || R,
1104
+ disabled: Oe || F,
1091
1105
  ghost: !0,
1092
1106
  icon: /* @__PURE__ */ g(re, {
1093
1107
  style: {
@@ -1098,7 +1112,7 @@ ${e}` : e;
1098
1112
  onClick: () => Cn()
1099
1113
  })
1100
1114
  })
1101
- }), !!Fe && /* @__PURE__ */ F("div", {
1115
+ }), !!Fe && /* @__PURE__ */ U("div", {
1102
1116
  className: "remainingSeconds-time",
1103
1117
  children: ["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长", Fe]
1104
1118
  })]
@@ -1117,9 +1131,9 @@ ${e}` : e;
1117
1131
  }), at && /* @__PURE__ */ g(hi, {
1118
1132
  currentSession: e,
1119
1133
  application: i,
1120
- networkStatus: D,
1121
- setCurrentSession: b,
1122
- disabled: R,
1134
+ networkStatus: T,
1135
+ setCurrentSession: x,
1136
+ disabled: F,
1123
1137
  isSessionHistoryVisible: at,
1124
1138
  setIsSessionHistoryVisible: lt,
1125
1139
  onSessionChange: (t) => {