@glodon-aiot/agent-cli-ui 3.8.0-alpha.4 → 3.9.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,253 +1,295 @@
1
- var ut = Object.defineProperty;
2
- var Z = Object.getOwnPropertySymbols;
3
- var Nt = Object.prototype.hasOwnProperty, wt = Object.prototype.propertyIsEnumerable;
4
- var tt = (u, m, e) => m in u ? ut(u, m, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[m] = e, et = (u, m) => {
5
- for (var e in m || (m = {}))
6
- Nt.call(m, e) && tt(u, e, m[e]);
7
- if (Z)
8
- for (var e of Z(m))
9
- wt.call(m, e) && tt(u, e, m[e]);
10
- return u;
1
+ var Pe = Object.defineProperty;
2
+ var he = Object.getOwnPropertySymbols;
3
+ var je = Object.prototype.hasOwnProperty, De = Object.prototype.propertyIsEnumerable;
4
+ var me = (A, u, a) => u in A ? Pe(A, u, { enumerable: !0, configurable: !0, writable: !0, value: a }) : A[u] = a, pe = (A, u) => {
5
+ for (var a in u || (u = {}))
6
+ je.call(u, a) && me(A, a, u[a]);
7
+ if (he)
8
+ for (var a of he(u))
9
+ De.call(u, a) && me(A, a, u[a]);
10
+ return A;
11
11
  };
12
- var _ = (u, m, e) => new Promise((l, b) => {
12
+ var L = (A, u, a) => new Promise((r, O) => {
13
13
  var k = (N) => {
14
14
  try {
15
- O(e.next(N));
16
- } catch (L) {
17
- b(L);
15
+ M(a.next(N));
16
+ } catch (x) {
17
+ O(x);
18
18
  }
19
- }, H = (N) => {
19
+ }, J = (N) => {
20
20
  try {
21
- O(e.throw(N));
22
- } catch (L) {
23
- b(L);
21
+ M(a.throw(N));
22
+ } catch (x) {
23
+ O(x);
24
24
  }
25
- }, O = (N) => N.done ? l(N.value) : Promise.resolve(N.value).then(k, H);
26
- O((e = e.apply(u, m)).next());
25
+ }, M = (N) => N.done ? r(N.value) : Promise.resolve(N.value).then(k, J);
26
+ M((a = a.apply(A, u)).next());
27
27
  });
28
- import { jsx as r, jsxs as M } from "react/jsx-runtime";
29
- import { forwardRef as At, useState as x, useContext as Et, useEffect as C, useImperativeHandle as kt, useMemo as bt } from "react";
30
- import { Button as Ot, Typography as Mt, Space as at, Popconfirm as ot, Input as Lt } from "antd";
28
+ import { jsx as f, jsxs as S } from "react/jsx-runtime";
29
+ import { forwardRef as Ie, useState as b, useContext as Re, useRef as H, useEffect as D, useImperativeHandle as Ye, useMemo as $e } from "react";
30
+ import { Button as Ve, Typography as Ce, Space as ue, Popconfirm as ye, Input as He, Divider as Fe } from "antd";
31
31
  import h from "dayjs";
32
- import _t from "classnames";
33
- import dt from "../../components/Iconfont/index.mjs";
34
- import jt from "../../context.mjs";
35
- /* empty css */import { useMemoizedFn as nt } from "ahooks";
36
- import { MAX_KNOWLEDGES_AND_FILES_COUNT as T, NET_OPEN_STATUS as it } from "../../constant.mjs";
37
- import { useSessionState as xt } from "../../hooks/useSessionState.mjs";
38
- import { calcKnowledgesLeafCount as lt } from "../../utils/index.mjs";
39
- const F = 15, Pt = At((u, m) => {
32
+ import Ke from "classnames";
33
+ import ge from "../../components/Iconfont/index.mjs";
34
+ import ze from "../../context.mjs";
35
+ /* empty css */import { useMemoizedFn as ve } from "ahooks";
36
+ import { MAX_KNOWLEDGES_AND_FILES_COUNT as F, NET_OPEN_STATUS as we } from "../../constant.mjs";
37
+ import { useSessionState as Be } from "../../hooks/useSessionState.mjs";
38
+ import { calcKnowledgesLeafCount as Ae } from "../../utils/index.mjs";
39
+ const q = 15, Ge = Ie((A, u) => {
40
40
  const {
41
- currentSession: e,
42
- setCurrentSession: l,
43
- checkKnowledges: b,
41
+ currentSession: a,
42
+ setCurrentSession: r,
43
+ checkKnowledges: O,
44
44
  application: k,
45
- networkStatus: H,
46
- isShowHeader: O = !0,
45
+ networkStatus: J,
46
+ isShowHeader: M = !0,
47
47
  afterSessionClick: N,
48
- sessionId: L
49
- } = u, [D, Y] = x(), {
50
- agentClient: v,
51
- mode: st,
48
+ sessionId: x
49
+ } = A, [K, z] = b(), {
50
+ agentClient: m,
51
+ mode: Q,
52
52
  features: o
53
- } = Et(jt), [K, B] = x(b), {
54
- sessions: j,
55
- setSessions: P
56
- } = xt(), [R, $] = x(0), [ct, S] = x(""), [rt, G] = x(null), U = nt((t) => {
57
- t.id && P((a) => [...a.map((n) => {
58
- var s;
59
- return ((s = n.data) == null ? void 0 : s.id) === t.id && (n.data = et({}, t)), n;
60
- })].sort((n, s) => {
61
- var E, w;
62
- const g = h((E = n.data) == null ? void 0 : E.createdAt).valueOf();
63
- return h((w = s.data) == null ? void 0 : w.createdAt).valueOf() - g;
53
+ } = Re(ze), [ee, te] = b(O), {
54
+ sessions: T,
55
+ setSessions: _
56
+ } = Be(), [ae, B] = b(0), [Ne, I] = b(""), [Ee, oe] = b(null), P = 30, [G, R] = b(!1), [Y, $] = b(!0), [ke, V] = b(!1), C = H(void 0), j = H(0), U = H(null), X = H(null), ne = (e) => {
57
+ var n, s;
58
+ if (!(e != null && e.length))
59
+ return;
60
+ let t = (s = (n = e[0]) == null ? void 0 : n.data) == null ? void 0 : s.createdAt;
61
+ return e.forEach((d) => {
62
+ var l, p, g, w;
63
+ t ? (p = d.data) != null && p.createdAt && h((g = d.data) == null ? void 0 : g.createdAt).valueOf() < h(t).valueOf() && (t = (w = d.data) == null ? void 0 : w.createdAt) : t = (l = d.data) == null ? void 0 : l.createdAt;
64
+ }), t;
65
+ }, de = ve((e) => {
66
+ e.id && _((t) => [...t.map((d) => {
67
+ var l;
68
+ return ((l = d.data) == null ? void 0 : l.id) === e.id && (d.data = pe({}, e)), d;
69
+ })].sort((d, l) => {
70
+ var w, E;
71
+ const p = h((w = d.data) == null ? void 0 : w.createdAt).valueOf();
72
+ return h((E = l.data) == null ? void 0 : E.createdAt).valueOf() - p;
64
73
  }));
65
74
  });
66
- C(() => {
67
- v == null || v.getSessions().then((t) => _(void 0, null, function* () {
68
- var a;
69
- if (P([...t]), !((a = e == null ? void 0 : e.data) != null && a.id) && (t != null && t.length) && st === "inlay") {
70
- const d = t[0];
71
- L || l == null || l(d);
75
+ D(() => {
76
+ if (Q === "float") {
77
+ a === void 0 && !x && (r == null || r(null));
78
+ return;
79
+ }
80
+ R(!0), C.current = void 0, j.current = 0, m == null || m.getSessions({
81
+ pageSize: P
82
+ }).then((e) => L(void 0, null, function* () {
83
+ var t;
84
+ if (_([...e]), j.current = e.length, C.current = ne(e), $(e.length >= P), V(e.length < P), !((t = a == null ? void 0 : a.data) != null && t.id) && (e != null && e.length) && Q === "inlay") {
85
+ const n = e[0];
86
+ x || r == null || r(n);
72
87
  } else
73
- e === void 0 && (L || l == null || l(null));
74
- }));
75
- }, []), C(() => {
76
- var t;
77
- if (!((t = e == null ? void 0 : e.data) != null && t.id) && b === void 0) {
78
- const a = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || void 0;
79
- if (Array.isArray(a) && a.some((n) => Array.isArray(n.fileIds) && n.fileIds.length === 0))
88
+ a === void 0 && (x || r == null || r(null));
89
+ })).finally(() => R(!1));
90
+ }, []), D(() => {
91
+ var e;
92
+ if (!((e = a == null ? void 0 : a.data) != null && e.id) && O === void 0) {
93
+ const t = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || void 0;
94
+ if (Array.isArray(t) && t.some((d) => Array.isArray(d.fileIds) && d.fileIds.length === 0))
80
95
  throw Error("fileIds cannot be an empty array");
81
- if (lt(a || []) > T)
82
- throw Error(`knowledges and fileIds total count cannot exceed ${T}`);
83
- B(a);
96
+ if (Ae(t || []) > F)
97
+ throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
98
+ te(t);
84
99
  return;
85
100
  }
86
- B(b);
87
- }, [b]), C(() => {
88
- e == null || e.addEventListener("data:updated", U);
89
- }, [e]), kt(m, () => ({
90
- create(t) {
91
- return z(t).then((a) => (l == null || l(a), a));
101
+ te(O);
102
+ }, [O]), D(() => {
103
+ a == null || a.addEventListener("data:updated", de);
104
+ }, [a]), Ye(u, () => ({
105
+ create(e) {
106
+ return re(e).then((t) => (r == null || r(t), t));
92
107
  },
93
- list: () => Promise.resolve(j)
108
+ list: () => Promise.resolve(T)
94
109
  }));
95
- const z = (t) => {
96
- const a = typeof (o == null ? void 0 : o.connectNetwork) == "object" && typeof (o == null ? void 0 : o.connectNetwork.default) == "boolean" ? o.connectNetwork.default : !1;
97
- return new Promise((d) => _(void 0, null, function* () {
98
- var s;
99
- const f = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, n = yield v == null ? void 0 : v.loadSession("", {
100
- name: t == null ? void 0 : t.name,
110
+ const re = (e) => {
111
+ const t = typeof (o == null ? void 0 : o.connectNetwork) == "object" && typeof (o == null ? void 0 : o.connectNetwork.default) == "boolean" ? o.connectNetwork.default : !1;
112
+ return new Promise((n) => L(void 0, null, function* () {
113
+ var l;
114
+ const s = typeof (o == null ? void 0 : o.promptVariables) == "object" ? (o == null ? void 0 : o.promptVariables.default) || [] : void 0, d = yield m == null ? void 0 : m.loadSession("", {
115
+ name: e == null ? void 0 : e.name,
101
116
  // @ts-ignore netOpen入参是number 响应是boolen
102
117
  // 只有对话有联网 其它没有
103
118
  // 不传netOpen会默认取defaultNetOpen
104
- netOpen: (k == null ? void 0 : k.type) === 0 ? t != null && t.netOpen ? t.netOpen : a ? it.OPEN : it.CLOSE : void 0,
105
- knowledges: (s = e == null ? void 0 : e.data) != null && s.id ? t == null ? void 0 : t.knowledges : K,
106
- promptVariables: f
119
+ netOpen: (k == null ? void 0 : k.type) === 0 ? e != null && e.netOpen ? e.netOpen : t ? we.OPEN : we.CLOSE : void 0,
120
+ knowledges: (l = a == null ? void 0 : a.data) != null && l.id ? e == null ? void 0 : e.knowledges : ee,
121
+ promptVariables: s
107
122
  });
108
- n == null || n.addEventListener("data:created", () => _(void 0, null, function* () {
109
- P([n, ...j]), d(n);
123
+ d == null || d.addEventListener("data:created", () => L(void 0, null, function* () {
124
+ _([d, ...T]), n(d);
110
125
  }));
111
126
  }));
112
- }, mt = () => {
113
- z({
114
- knowledges: K
115
- }).then((t) => {
116
- l == null || l(t);
127
+ }, be = () => {
128
+ re({
129
+ knowledges: ee
130
+ }).then((e) => {
131
+ r == null || r(e);
117
132
  });
118
- }, ft = (t) => {
119
- v == null || v.removeSession(t, !0).then(() => _(void 0, null, function* () {
120
- var d, f;
121
- const a = j.filter((n) => {
122
- var s, g;
123
- return ((s = n.data) == null ? void 0 : s.id) !== ((g = t.data) == null ? void 0 : g.id);
133
+ }, Oe = (e) => {
134
+ m == null || m.removeSession(e, !0).then(() => L(void 0, null, function* () {
135
+ var n, s;
136
+ const t = T.filter((d) => {
137
+ var l, p;
138
+ return ((l = d.data) == null ? void 0 : l.id) !== ((p = e.data) == null ? void 0 : p.id);
124
139
  });
125
- ((d = t.data) == null ? void 0 : d.id) === ((f = e == null ? void 0 : e.data) == null ? void 0 : f.id) && (a != null && a.length ? l == null || l(a[0]) : l == null || l(null)), P([...a]);
140
+ ((n = e.data) == null ? void 0 : n.id) === ((s = a == null ? void 0 : a.data) == null ? void 0 : s.id) && (t != null && t.length ? r == null || r(t[0]) : r == null || r(null)), _([...t]);
126
141
  }));
127
- }, pt = (t) => {
128
- var a, d;
129
- Y((a = t.data) == null ? void 0 : a.name), S(""), G(((d = t.data) == null ? void 0 : d.id) || null);
130
- }, ht = (t) => {
131
- const a = W(D || "");
132
- if (a) {
133
- S(a);
142
+ }, Me = () => L(void 0, null, function* () {
143
+ if (!(G || !Y)) {
144
+ R(!0);
145
+ try {
146
+ const e = yield m == null ? void 0 : m.getSessions({
147
+ pageSize: P,
148
+ beforeTime: C.current
149
+ }), t = (e == null ? void 0 : e.length) || 0, n = t - j.current;
150
+ _([...e || []]), C.current = ne(e || []), n <= 0 ? ($(!1), V(!0)) : n < P ? ($(!1), V(!0), j.current = t) : ($(!0), V(!1), j.current = t);
151
+ } finally {
152
+ R(!1);
153
+ }
154
+ }
155
+ });
156
+ D(() => {
157
+ if (!U.current || !X.current)
158
+ return;
159
+ const e = U.current, t = X.current, n = new IntersectionObserver((s) => {
160
+ s[0].isIntersecting && Y && !G && Me();
161
+ }, {
162
+ root: e,
163
+ rootMargin: "0px 0px 200px 0px",
164
+ threshold: 0
165
+ });
166
+ return n.observe(t), () => n.disconnect();
167
+ }, [Y, G]);
168
+ const xe = (e) => {
169
+ var t, n;
170
+ z((t = e.data) == null ? void 0 : t.name), I(""), oe(((n = e.data) == null ? void 0 : n.id) || null);
171
+ }, Le = (e) => {
172
+ const t = le(K || "");
173
+ if (t) {
174
+ I(t);
134
175
  return;
135
176
  }
136
- t.rename(D.trim()), t == null || t.addEventListener("data:updated", U), X();
137
- }, yt = () => {
138
- X();
139
- }, X = () => {
140
- G(null), Y(""), S(""), $((t) => t + 1);
141
- }, W = (t) => !t || t.trim().length === 0 ? "会话名称不能为空" : t.length > F ? `不能超过${F}个字符` : "", vt = (t) => _(void 0, null, function* () {
142
- l == null || l(t), N == null || N(t);
143
- }), gt = (t) => {
144
- const a = t.target.value;
145
- Y(a), S(W(a));
177
+ e.rename(K.trim()), e == null || e.addEventListener("data:updated", de), ie();
178
+ }, Se = () => {
179
+ ie();
180
+ }, ie = () => {
181
+ oe(null), z(""), I(""), B((e) => e + 1);
182
+ }, le = (e) => !e || e.trim().length === 0 ? "会话名称不能为空" : e.length > q ? `不能超过${q}个字符` : "", Te = (e) => L(void 0, null, function* () {
183
+ r == null || r(e), N == null || N(e);
184
+ }), _e = (e) => {
185
+ const t = e.target.value;
186
+ z(t), I(le(t));
146
187
  };
147
- C(() => {
148
- var a, d, f, n;
149
- if (!(e != null && e.id))
188
+ D(() => {
189
+ var t, n, s, d;
190
+ if (!(a != null && a.id))
150
191
  return;
151
- const t = {};
152
- if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((a = o == null ? void 0 : o.knowledges) != null && a.default)) {
153
- if (t.knowledges = (d = o == null ? void 0 : o.knowledges) == null ? void 0 : d.default, Array.isArray(t.knowledges) && t.knowledges.some((A) => Array.isArray(A.fileIds) && A.fileIds.length === 0))
192
+ const e = {};
193
+ if (typeof (o == null ? void 0 : o.knowledges) == "object" && ((t = o == null ? void 0 : o.knowledges) != null && t.default)) {
194
+ if (e.knowledges = (n = o == null ? void 0 : o.knowledges) == null ? void 0 : n.default, Array.isArray(e.knowledges) && e.knowledges.some((g) => Array.isArray(g.fileIds) && g.fileIds.length === 0))
154
195
  throw Error("fileIds cannot be an empty array");
155
- if (lt(t.knowledges) > T)
156
- throw Error(`knowledges and fileIds total count cannot exceed ${T}`);
196
+ if (Ae(e.knowledges) > F)
197
+ throw Error(`knowledges and fileIds total count cannot exceed ${F}`);
157
198
  }
158
- typeof (o == null ? void 0 : o.promptVariables) == "object" && ((f = o == null ? void 0 : o.promptVariables) != null && f.default) && (t.promptVariables = (n = o == null ? void 0 : o.promptVariables) == null ? void 0 : n.default), v == null || v.loadSession(e.id, t);
159
- }, [e]);
160
- const q = nt((t) => {
161
- const a = h().endOf("day"), d = a.subtract(1, "day"), f = a.subtract(7, "day"), n = a.subtract(30, "day"), s = [], g = [], A = [], E = [], w = {};
162
- return t.forEach((c) => {
163
- var y;
164
- const i = h((y = c.data) == null ? void 0 : y.createdAt);
165
- if (i.isAfter(d))
199
+ typeof (o == null ? void 0 : o.promptVariables) == "object" && ((s = o == null ? void 0 : o.promptVariables) != null && s.default) && (e.promptVariables = (d = o == null ? void 0 : o.promptVariables) == null ? void 0 : d.default), m == null || m.loadSession(a.id, e);
200
+ }, [a]);
201
+ const ce = ve((e) => {
202
+ const t = h().endOf("day"), n = t.subtract(1, "day"), s = t.subtract(7, "day"), d = t.subtract(30, "day"), l = [], p = [], g = [], w = [], E = {};
203
+ return e.forEach((c) => {
204
+ var v;
205
+ const i = h((v = c.data) == null ? void 0 : v.createdAt);
206
+ if (i.isAfter(n))
207
+ p.push(c);
208
+ else if (i.isAfter(s))
166
209
  g.push(c);
167
- else if (i.isAfter(f))
168
- A.push(c);
169
- else if (i.isAfter(n))
170
- E.push(c);
210
+ else if (i.isAfter(d))
211
+ w.push(c);
171
212
  else {
172
- const p = i.format("YYYY-MM");
173
- w[p] || (w[p] = []), w[p].push(c);
213
+ const y = i.format("YYYY-MM");
214
+ E[y] || (E[y] = []), E[y].push(c);
174
215
  }
175
- }), g.length > 0 && s.push({
216
+ }), p.length > 0 && l.push({
176
217
  title: "今天",
177
- sessions: g.sort((c, i) => {
178
- var y, p;
179
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
218
+ sessions: p.sort((c, i) => {
219
+ var v, y;
220
+ return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
180
221
  }),
181
222
  key: "today"
182
- }), A.length > 0 && s.push({
223
+ }), g.length > 0 && l.push({
183
224
  title: "7天内",
184
- sessions: A.sort((c, i) => {
185
- var y, p;
186
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
225
+ sessions: g.sort((c, i) => {
226
+ var v, y;
227
+ return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
187
228
  }),
188
229
  key: "seven-days"
189
- }), E.length > 0 && s.push({
230
+ }), w.length > 0 && l.push({
190
231
  title: "30天内",
191
- sessions: E.sort((c, i) => {
192
- var y, p;
193
- return h((y = i.data) == null ? void 0 : y.createdAt).valueOf() - h((p = c.data) == null ? void 0 : p.createdAt).valueOf();
232
+ sessions: w.sort((c, i) => {
233
+ var v, y;
234
+ return h((v = i.data) == null ? void 0 : v.createdAt).valueOf() - h((y = c.data) == null ? void 0 : y.createdAt).valueOf();
194
235
  }),
195
236
  key: "thirty-days"
196
- }), Object.keys(w).sort((c, i) => i.localeCompare(c)).forEach((c) => {
197
- const i = w[c].sort((y, p) => {
198
- var J, Q;
199
- return h((J = p.data) == null ? void 0 : J.createdAt).valueOf() - h((Q = y.data) == null ? void 0 : Q.createdAt).valueOf();
237
+ }), Object.keys(E).sort((c, i) => i.localeCompare(c)).forEach((c) => {
238
+ const i = E[c].sort((v, y) => {
239
+ var se, fe;
240
+ return h((se = y.data) == null ? void 0 : se.createdAt).valueOf() - h((fe = v.data) == null ? void 0 : fe.createdAt).valueOf();
200
241
  });
201
- s.push({
242
+ l.push({
202
243
  title: h(c).format("YYYY年MM月"),
203
244
  sessions: i,
204
245
  key: `month-${c}`
205
246
  });
206
- }), s;
207
- }), V = bt(() => q(j), [j, q]);
208
- return /* @__PURE__ */ r("div", {
247
+ }), l;
248
+ }), W = $e(() => ce(T), [T, ce]);
249
+ return /* @__PURE__ */ f("div", {
209
250
  className: "bot-session-container",
210
- children: /* @__PURE__ */ M("div", {
251
+ children: /* @__PURE__ */ S("div", {
211
252
  className: "agent-sessions",
212
- children: [O && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ r("div", {
253
+ children: [M && (o == null ? void 0 : o.siderTitle) && /* @__PURE__ */ f("div", {
213
254
  className: "sessions-header",
214
- children: /* @__PURE__ */ r("div", {
255
+ children: /* @__PURE__ */ f("div", {
215
256
  className: "session-header-title",
216
257
  children: (k == null ? void 0 : k.name) || "-"
217
258
  })
218
- }), /* @__PURE__ */ M("div", {
259
+ }), /* @__PURE__ */ S("div", {
219
260
  className: "sessions-main",
220
- children: [O && /* @__PURE__ */ r("div", {
261
+ ref: U,
262
+ children: [M && /* @__PURE__ */ f("div", {
221
263
  className: "session-header-btn-wrapper",
222
- children: /* @__PURE__ */ r(Ot, {
264
+ children: /* @__PURE__ */ f(Ve, {
223
265
  className: "session-header-btn",
224
- onClick: mt,
266
+ onClick: be,
225
267
  type: "primary",
226
268
  children: "+ 新会话"
227
269
  })
228
- }), V == null ? void 0 : V.map((t) => {
229
- var a;
230
- return /* @__PURE__ */ M("div", {
270
+ }), W == null ? void 0 : W.map((e) => {
271
+ var t;
272
+ return /* @__PURE__ */ S("div", {
231
273
  className: "session-group",
232
- children: [/* @__PURE__ */ r("div", {
274
+ children: [/* @__PURE__ */ f("div", {
233
275
  className: "group-header",
234
276
  style: {
235
- top: O ? 48 : 0
277
+ top: M ? 48 : 0
236
278
  },
237
- children: t.title
238
- }), (a = t.sessions) == null ? void 0 : a.map((d) => {
239
- var f, n, s, g, A, E, w, I, c;
240
- return /* @__PURE__ */ r("div", {
241
- className: _t({
279
+ children: e.title
280
+ }), (t = e.sessions) == null ? void 0 : t.map((n) => {
281
+ var s, d, l, p, g, w, E, Z, c;
282
+ return /* @__PURE__ */ f("div", {
283
+ className: Ke({
242
284
  "session-item": !0,
243
- "session-item__active": ((f = d.data) == null ? void 0 : f.id) === ((n = e == null ? void 0 : e.data) == null ? void 0 : n.id)
285
+ "session-item__active": ((s = n.data) == null ? void 0 : s.id) === ((d = a == null ? void 0 : a.data) == null ? void 0 : d.id)
244
286
  }),
245
- onClick: () => vt(d),
246
- children: /* @__PURE__ */ r("div", {
287
+ onClick: () => Te(n),
288
+ children: /* @__PURE__ */ f("div", {
247
289
  className: "session-item-wrapper",
248
- children: /* @__PURE__ */ M("div", {
290
+ children: /* @__PURE__ */ S("div", {
249
291
  className: "session-item-top",
250
- children: [/* @__PURE__ */ r(Mt.Paragraph, {
292
+ children: [/* @__PURE__ */ f(Ce.Paragraph, {
251
293
  className: "item-top-title",
252
294
  style: {
253
295
  margin: 0,
@@ -256,79 +298,90 @@ const F = 15, Pt = At((u, m) => {
256
298
  ellipsis: {
257
299
  rows: 1,
258
300
  tooltip: {
259
- title: ((s = d.data) == null ? void 0 : s.name) || "-",
301
+ title: ((l = n.data) == null ? void 0 : l.name) || "-",
260
302
  placement: "topLeft"
261
303
  }
262
304
  },
263
- children: ((g = d.data) == null ? void 0 : g.name) || "-"
264
- }), /* @__PURE__ */ M(at, {
265
- children: [/* @__PURE__ */ r("span", {
305
+ children: ((p = n.data) == null ? void 0 : p.name) || "-"
306
+ }), /* @__PURE__ */ S(ue, {
307
+ children: [/* @__PURE__ */ f("span", {
266
308
  className: "item-top-time",
267
- children: h((A = d.data) == null ? void 0 : A.createdAt).format("MM/DD HH:mm:ss")
268
- }), /* @__PURE__ */ M("div", {
309
+ children: h((g = n.data) == null ? void 0 : g.createdAt).format("MM/DD HH:mm:ss")
310
+ }), /* @__PURE__ */ S("div", {
269
311
  className: "item-top-action",
270
312
  onClick: (i) => i.stopPropagation(),
271
- children: [/* @__PURE__ */ r(ot, {
272
- open: rt === ((E = d.data) == null ? void 0 : E.id),
313
+ children: [/* @__PURE__ */ f(ye, {
314
+ open: Ee === ((w = n.data) == null ? void 0 : w.id),
273
315
  getPopupContainer: (i) => i.parentNode,
274
316
  icon: !1,
275
- title: /* @__PURE__ */ r(Lt, {
317
+ title: /* @__PURE__ */ f(He, {
276
318
  placeholder: "请输入内容",
277
319
  autoComplete: "off",
278
320
  showCount: !0,
279
- value: D,
280
- onChange: gt,
281
- maxLength: F,
282
- status: ct ? "error" : ""
321
+ value: K,
322
+ onChange: _e,
323
+ maxLength: q,
324
+ status: Ne ? "error" : ""
283
325
  }),
284
- onConfirm: () => ht(d),
285
- onCancel: yt,
286
- children: /* @__PURE__ */ r(dt, {
326
+ onConfirm: () => Le(n),
327
+ onCancel: Se,
328
+ children: /* @__PURE__ */ f(ge, {
287
329
  type: "icon-bianji2",
288
- onClick: () => pt(d),
330
+ onClick: () => xe(n),
289
331
  className: "icon-action",
290
332
  style: {
291
333
  marginRight: "8px"
292
334
  }
293
335
  })
294
- }, `edit-${(w = d.data) == null ? void 0 : w.id}-${R}`), /* @__PURE__ */ r(ot, {
336
+ }, `edit-${(E = n.data) == null ? void 0 : E.id}-${ae}`), /* @__PURE__ */ f(ye, {
295
337
  getPopupContainer: (i) => i.parentNode,
296
338
  icon: !1,
297
- title: /* @__PURE__ */ M(at, {
339
+ title: /* @__PURE__ */ S(ue, {
298
340
  direction: "vertical",
299
- children: [/* @__PURE__ */ r("div", {
341
+ children: [/* @__PURE__ */ f("div", {
300
342
  children: "删除确认?"
301
- }), /* @__PURE__ */ r("div", {
343
+ }), /* @__PURE__ */ f("div", {
302
344
  children: "会话删除后不可恢复,请确认是否删除!"
303
345
  })]
304
346
  }),
305
347
  onConfirm: () => {
306
- ft(d), $((i) => i + 1);
348
+ Oe(n), B((i) => i + 1);
307
349
  },
308
350
  onCancel: () => {
309
- $((i) => i + 1);
351
+ B((i) => i + 1);
310
352
  },
311
- children: /* @__PURE__ */ r(dt, {
353
+ children: /* @__PURE__ */ f(ge, {
312
354
  style: {
313
355
  fontSize: "18px"
314
356
  },
315
357
  className: "icon-action",
316
358
  type: "icon-del"
317
359
  })
318
- }, `delete-${(I = d.data) == null ? void 0 : I.id}-${R}`)]
360
+ }, `delete-${(Z = n.data) == null ? void 0 : Z.id}-${ae}`)]
319
361
  })]
320
362
  })]
321
363
  })
322
364
  })
323
- }, (c = d.data) == null ? void 0 : c.id);
365
+ }, (c = n.data) == null ? void 0 : c.id);
324
366
  })]
325
- }, t.key);
367
+ }, e.key);
368
+ }), !Y && ke && /* @__PURE__ */ f(Fe, {
369
+ style: {
370
+ color: "rgb(199 199 199)"
371
+ },
372
+ plain: !0,
373
+ children: "没有更多数据了"
374
+ }), /* @__PURE__ */ f("div", {
375
+ ref: X,
376
+ style: {
377
+ height: 1
378
+ }
326
379
  })]
327
380
  })]
328
381
  })
329
382
  });
330
383
  });
331
- Pt.displayName = "SessionList";
384
+ Ge.displayName = "SessionList";
332
385
  export {
333
- Pt as default
386
+ Ge as default
334
387
  };