@glodon-aiot/agent-cli-ui 3.0.9 → 3.0.11-alpha.0
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.
- package/dist/es/Dialog/AgentChat/index.mjs +67 -67
- package/dist/es/Dialog/HistoryItem/index.mjs +1 -1
- package/dist/es/Dialog/SearchReference/index.mjs +63 -52
- package/dist/es/index.mjs +2 -2
- package/dist/lib/index.js +30 -30
- package/package.json +3 -3
- /package/dist/es/{Dialog/HistoryItem → assets}/think.svg.mjs +0 -0
|
@@ -2,16 +2,16 @@ var Mt = Object.defineProperty, jt = Object.defineProperties;
|
|
|
2
2
|
var Vt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Xe = Object.getOwnPropertySymbols;
|
|
4
4
|
var $t = Object.prototype.hasOwnProperty, At = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var ve = (x,
|
|
6
|
-
for (var g in
|
|
7
|
-
$t.call(
|
|
5
|
+
var ve = (x, s, g) => s in x ? Mt(x, s, { enumerable: !0, configurable: !0, writable: !0, value: g }) : x[s] = g, ke = (x, s) => {
|
|
6
|
+
for (var g in s || (s = {}))
|
|
7
|
+
$t.call(s, g) && ve(x, g, s[g]);
|
|
8
8
|
if (Xe)
|
|
9
|
-
for (var g of Xe(
|
|
10
|
-
At.call(
|
|
9
|
+
for (var g of Xe(s))
|
|
10
|
+
At.call(s, g) && ve(x, g, s[g]);
|
|
11
11
|
return x;
|
|
12
|
-
}, we = (x,
|
|
13
|
-
var P = (x,
|
|
14
|
-
var z = (x,
|
|
12
|
+
}, we = (x, s) => jt(x, Vt(s));
|
|
13
|
+
var P = (x, s, g) => (ve(x, typeof s != "symbol" ? s + "" : s, g), g);
|
|
14
|
+
var z = (x, s, g) => new Promise((e, k) => {
|
|
15
15
|
var ae = (w) => {
|
|
16
16
|
try {
|
|
17
17
|
O(g.next(w));
|
|
@@ -25,7 +25,7 @@ var z = (x, o, g) => new Promise((e, k) => {
|
|
|
25
25
|
k(p);
|
|
26
26
|
}
|
|
27
27
|
}, O = (w) => w.done ? e(w.value) : Promise.resolve(w.value).then(ae, v);
|
|
28
|
-
O((g = g.apply(x,
|
|
28
|
+
O((g = g.apply(x, s)).next());
|
|
29
29
|
});
|
|
30
30
|
import { jsxs as W, jsx as a } from "../../_virtual/jsx-runtime.mjs";
|
|
31
31
|
import { memo as Bt, useState as u, useRef as $, useContext as qt, useEffect as C } from "react";
|
|
@@ -59,7 +59,7 @@ const hi = Bt(Gt), gi = {
|
|
|
59
59
|
text: "今天我能帮你什么?"
|
|
60
60
|
};
|
|
61
61
|
class Z {
|
|
62
|
-
constructor(
|
|
62
|
+
constructor(s, g, e, k) {
|
|
63
63
|
P(this, "messageTime");
|
|
64
64
|
P(this, "isWaiting");
|
|
65
65
|
P(this, "messageId");
|
|
@@ -69,7 +69,7 @@ class Z {
|
|
|
69
69
|
P(this, "isSensitive");
|
|
70
70
|
P(this, "isSuspend");
|
|
71
71
|
P(this, "comment");
|
|
72
|
-
this.content =
|
|
72
|
+
this.content = s, this.sessionId = g, this.role = e, this.files = k, this.content = s, this.role = e, this.sessionId = g, this.files = k, this.messageTime = Xt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = et(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
73
73
|
isAgree: 0
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -77,7 +77,7 @@ class Z {
|
|
|
77
77
|
const Se = 10, Ki = (x) => {
|
|
78
78
|
var $e, Ae, Be, qe, Ke, We, Qe, Ye, _e;
|
|
79
79
|
const {
|
|
80
|
-
application:
|
|
80
|
+
application: s,
|
|
81
81
|
docViewerUrl: g = "",
|
|
82
82
|
currentSession: e,
|
|
83
83
|
onCreateSession: k,
|
|
@@ -108,13 +108,13 @@ const Se = 10, Ki = (x) => {
|
|
|
108
108
|
}), !((l = e == null ? void 0 : e.data) != null && l.id))
|
|
109
109
|
return;
|
|
110
110
|
if (j(!1), H(!1), (n = e.messages) != null && n.length) {
|
|
111
|
-
const
|
|
112
|
-
h.current = [...
|
|
111
|
+
const o = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
112
|
+
h.current = [...o], I([...o]);
|
|
113
113
|
}
|
|
114
114
|
const i = (r) => {
|
|
115
|
-
var
|
|
116
|
-
(
|
|
117
|
-
applicationId:
|
|
115
|
+
var o;
|
|
116
|
+
(o = e == null ? void 0 : e.data) != null && o.id && (h.current = [...r].reverse(), I([...r].reverse()), !r || r.length < 10 ? X(!1) : X(!0), Le && Le({
|
|
117
|
+
applicationId: s.id,
|
|
118
118
|
sessionId: e.data.id,
|
|
119
119
|
histories: r
|
|
120
120
|
}));
|
|
@@ -143,7 +143,7 @@ const Se = 10, Ki = (x) => {
|
|
|
143
143
|
}, [e]);
|
|
144
144
|
const It = () => {
|
|
145
145
|
var l;
|
|
146
|
-
if (!((l = e == null ? void 0 : e.data) != null && l.id) || !(
|
|
146
|
+
if (!((l = e == null ? void 0 : e.data) != null && l.id) || !(s != null && s.id))
|
|
147
147
|
return;
|
|
148
148
|
const t = e.data.id, i = p[p.length - 1];
|
|
149
149
|
if (i && i.isContext)
|
|
@@ -154,10 +154,10 @@ const Se = 10, Ki = (x) => {
|
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
156
|
C(() => {
|
|
157
|
-
|
|
157
|
+
s != null && s.id && (N == null || N.getRecommendQues(s.id).then((t) => {
|
|
158
158
|
rt(t);
|
|
159
159
|
}));
|
|
160
|
-
}, [it,
|
|
160
|
+
}, [it, s]);
|
|
161
161
|
const Me = (t) => z(void 0, null, function* () {
|
|
162
162
|
var b, m;
|
|
163
163
|
if (D)
|
|
@@ -194,10 +194,10 @@ const Se = 10, Ki = (x) => {
|
|
|
194
194
|
le(!0);
|
|
195
195
|
const r = B ? `
|
|
196
196
|
${i}` : i;
|
|
197
|
-
let
|
|
197
|
+
let o;
|
|
198
198
|
try {
|
|
199
|
-
M ?
|
|
200
|
-
applicationId:
|
|
199
|
+
M ? o = yield M == null ? void 0 : M({
|
|
200
|
+
applicationId: s.id,
|
|
201
201
|
sessionId: n,
|
|
202
202
|
message: {
|
|
203
203
|
content: r,
|
|
@@ -205,30 +205,30 @@ ${i}` : i;
|
|
|
205
205
|
role: Ze.User,
|
|
206
206
|
files: te[n]
|
|
207
207
|
}
|
|
208
|
-
}) :
|
|
208
|
+
}) : o = !0;
|
|
209
209
|
} catch (y) {
|
|
210
|
-
|
|
210
|
+
o = !1;
|
|
211
211
|
}
|
|
212
|
-
if (le(!1),
|
|
212
|
+
if (le(!1), o === !1)
|
|
213
213
|
return;
|
|
214
214
|
let d = i;
|
|
215
|
-
typeof
|
|
215
|
+
typeof o == "object" && (d = o.content || i), ((m = te[n]) == null ? void 0 : m.length) > 0 ? Nt(d) : me(d);
|
|
216
216
|
}), Lt = (t) => new Promise((i, l) => z(void 0, null, function* () {
|
|
217
|
-
const
|
|
217
|
+
const o = (t == null ? void 0 : t.promptVariables).filter((d) => d.key !== "query").map((d) => {
|
|
218
218
|
var m;
|
|
219
219
|
const b = (m = F.find((y) => y.key === d.key)) == null ? void 0 : m.value;
|
|
220
220
|
return d.value = b || "", d;
|
|
221
221
|
});
|
|
222
|
-
se(
|
|
222
|
+
se(o.sort((d, b) => d.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(o), i();
|
|
223
223
|
})), Nt = (t) => {
|
|
224
|
-
var
|
|
225
|
-
if (oe(!1), !((
|
|
224
|
+
var o, d, b;
|
|
225
|
+
if (oe(!1), !((o = e == null ? void 0 : e.data) != null && o.id) || !(s != null && s.id))
|
|
226
226
|
return;
|
|
227
227
|
const i = ((d = e.data) == null ? void 0 : d.id) || "", l = [];
|
|
228
228
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
229
229
|
(b = te[i]) == null || b.forEach((m) => {
|
|
230
230
|
r.has(m.id) || (n.push(m), r.add(m.id));
|
|
231
|
-
}), Promise.all(n.map((m) => N == null ? void 0 : N.patchApplicationIdKnowledgeIdFileId(
|
|
231
|
+
}), Promise.all(n.map((m) => N == null ? void 0 : N.patchApplicationIdKnowledgeIdFileId(s == null ? void 0 : s.id, i, m.id, {
|
|
232
232
|
enabled: 1
|
|
233
233
|
}).then((y) => {
|
|
234
234
|
l.push(m);
|
|
@@ -248,7 +248,7 @@ ${t}` : t;
|
|
|
248
248
|
let n;
|
|
249
249
|
try {
|
|
250
250
|
M ? n = yield M == null ? void 0 : M({
|
|
251
|
-
applicationId:
|
|
251
|
+
applicationId: s.id,
|
|
252
252
|
sessionId: e.id,
|
|
253
253
|
message: {
|
|
254
254
|
content: l,
|
|
@@ -274,13 +274,13 @@ ${t}` : t;
|
|
|
274
274
|
j(!0), H(!0);
|
|
275
275
|
const n = B ? `
|
|
276
276
|
${t}` : t, r = new Z(n, l, Y.User, i);
|
|
277
|
-
J(void 0), q(void 0), h.current = [r, ...p], I(h.current),
|
|
278
|
-
applicationId:
|
|
277
|
+
J(void 0), q(void 0), h.current = [r, ...p], I(h.current), s.id && S && S({
|
|
278
|
+
applicationId: s.id,
|
|
279
279
|
sessionId: l,
|
|
280
280
|
message: r
|
|
281
281
|
});
|
|
282
|
-
const
|
|
283
|
-
|
|
282
|
+
const o = new Z("", l, Y.System);
|
|
283
|
+
o.isWaiting = !0, h.current = [o, ...h.current], I(h.current);
|
|
284
284
|
const d = (i == null ? void 0 : i.map((E) => E.id)) || [], b = {
|
|
285
285
|
stream: !0,
|
|
286
286
|
referenceFirst: !1
|
|
@@ -312,12 +312,12 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
312
312
|
return _t.error({
|
|
313
313
|
message: n.content
|
|
314
314
|
});
|
|
315
|
-
const r = n.actions || [],
|
|
316
|
-
|
|
317
|
-
applicationId:
|
|
315
|
+
const r = n.actions || [], o = new Z(n.content, t, Y.Robot);
|
|
316
|
+
o.messageId = n.messageId, o.reasoningContent = n.reasoningContent, o.searchReference = n.searchReference, o.thinkingSecs = n.thinkingSecs, o.thinkingStatus = n.thinkingStatus, o.actions = r, o.isLoading = !0, o.searchingStatus = n.searchingStatus, h.current = h.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), n.index === void 0 && I([o, ...h.current]), n.code === 11915 && (H(!1), j(!1), o.isLoading = !1, o.content = "请您换个问题问我吧~", o.isSensitive = !0, I([o, ...h.current])), n.index === -2 && (H(!1), j(!1), o.isLoading = !1, o.content = "回答已中止~", o.isSuspend = !0, I([o, ...h.current])), n.index === -1 && (H(!1), j(!1), o.isLoading = !1, o.reference = n.reference, I([o, ...h.current]), s.id && S && S({
|
|
317
|
+
applicationId: s.id,
|
|
318
318
|
sessionId: t,
|
|
319
|
-
message:
|
|
320
|
-
})), n.index === -3 && (H(!1), j(!1),
|
|
319
|
+
message: o
|
|
320
|
+
})), n.index === -3 && (H(!1), j(!1), o.isLoading = !1, o.reference = n.reference, o.relatedQuesion = n.relatedQuesion, I([o, ...h.current]));
|
|
321
321
|
};
|
|
322
322
|
return e.ready ? e.addEventListener("message:updated", i) : e.addEventListener("ready", () => {
|
|
323
323
|
e.addEventListener("message:updated", i);
|
|
@@ -352,18 +352,18 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
352
352
|
U(!0), k == null || k({
|
|
353
353
|
netOpen: O ? 1 : 2
|
|
354
354
|
}).then((n) => {
|
|
355
|
-
var r,
|
|
356
|
-
v == null || v(n), U(!1), w(!!((r = n.data) != null && r.netOpen)), K(!!((
|
|
355
|
+
var r, o;
|
|
356
|
+
v == null || v(n), U(!1), w(!!((r = n.data) != null && r.netOpen)), K(!!((o = n.data) != null && o.enableNetOpen)), l(je(n, t));
|
|
357
357
|
});
|
|
358
358
|
});
|
|
359
359
|
}), je = (t, i) => {
|
|
360
360
|
const l = ei(i.name);
|
|
361
361
|
return new Promise((n) => {
|
|
362
|
-
var
|
|
362
|
+
var o;
|
|
363
363
|
const r = {
|
|
364
364
|
files: [`${et()}.${l}`],
|
|
365
365
|
isv: "minio",
|
|
366
|
-
knowledgeId: ((
|
|
366
|
+
knowledgeId: ((o = t.data) == null ? void 0 : o.id) || "",
|
|
367
367
|
type: 1
|
|
368
368
|
};
|
|
369
369
|
ue(!0), N == null || N.postTicket(r).then((d) => {
|
|
@@ -388,12 +388,12 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
388
388
|
});
|
|
389
389
|
}, [p]);
|
|
390
390
|
const Et = (t, i) => new Promise((l) => {
|
|
391
|
-
if (!i.file.url || !(
|
|
391
|
+
if (!i.file.url || !(s != null && s.id))
|
|
392
392
|
return l();
|
|
393
393
|
const n = we(ke({}, i.file), {
|
|
394
394
|
type: 1
|
|
395
395
|
});
|
|
396
|
-
N == null || N.postApplicationIdSessionKnowledgeSessionFile(
|
|
396
|
+
N == null || N.postApplicationIdSessionKnowledgeSessionFile(s == null ? void 0 : s.id, t, n).finally(() => {
|
|
397
397
|
var r;
|
|
398
398
|
(r = ne.current) == null || r.update().finally(l);
|
|
399
399
|
});
|
|
@@ -459,7 +459,7 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
459
459
|
e ? e.fetchData().then((t) => {
|
|
460
460
|
var i;
|
|
461
461
|
(i = e == null ? void 0 : e.data) != null && i.id && (w(t.netOpen), K(t.enableNetOpen));
|
|
462
|
-
}) : (w(!1), K(
|
|
462
|
+
}) : (w(!1), K(s.arrange[0].enableNetOpen));
|
|
463
463
|
});
|
|
464
464
|
C(() => {
|
|
465
465
|
ye();
|
|
@@ -469,8 +469,8 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
469
469
|
const l = document.getElementById("chat-main"), n = (t = T.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), r = (i = T.current) == null ? void 0 : i.querySelector(".infinite-scroll-component");
|
|
470
470
|
if (!n || !r || !l)
|
|
471
471
|
return;
|
|
472
|
-
const
|
|
473
|
-
if (r.offsetHeight <=
|
|
472
|
+
const o = l.offsetHeight;
|
|
473
|
+
if (r.offsetHeight <= o) {
|
|
474
474
|
if (n.style.height === "100%")
|
|
475
475
|
return;
|
|
476
476
|
n.style.height = "100%";
|
|
@@ -487,17 +487,17 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
487
487
|
const n = ((L == null ? void 0 : L.promptVariables) || []).filter(
|
|
488
488
|
(r) => r.key !== "query" && r.status === 1
|
|
489
489
|
// 只要求输入被引用的变量
|
|
490
|
-
).map((r,
|
|
490
|
+
).map((r, o) => {
|
|
491
491
|
var b, m;
|
|
492
492
|
let d = "";
|
|
493
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) || ""), {
|
|
494
|
-
id:
|
|
494
|
+
id: o + "",
|
|
495
495
|
key: r.key,
|
|
496
496
|
name: r.name,
|
|
497
497
|
value: d
|
|
498
498
|
};
|
|
499
499
|
});
|
|
500
|
-
se([...n].sort((r,
|
|
500
|
+
se([...n].sort((r, o) => r.key.localeCompare(o.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);
|
|
@@ -515,7 +515,7 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
515
515
|
className: "agent-chat",
|
|
516
516
|
children: [(c == null ? void 0 : c.promptVariables) && /* @__PURE__ */ a(di, {
|
|
517
517
|
ref: Re,
|
|
518
|
-
appId:
|
|
518
|
+
appId: s.id,
|
|
519
519
|
currentSession: e,
|
|
520
520
|
promptVariables: F,
|
|
521
521
|
setPromptVariables: se,
|
|
@@ -560,7 +560,7 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
560
560
|
}),
|
|
561
561
|
scrollableTarget: "scrollableDiv",
|
|
562
562
|
children: p.map((t, i) => /* @__PURE__ */ a(hi, {
|
|
563
|
-
application:
|
|
563
|
+
application: s,
|
|
564
564
|
currentSession: e,
|
|
565
565
|
history: t,
|
|
566
566
|
docViewerUrl: g,
|
|
@@ -584,8 +584,8 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
584
584
|
t != null && t.id && G(!0);
|
|
585
585
|
const i = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
|
|
586
586
|
c != null && c.fileUpload ? (r = (n = ne.current) == null ? void 0 : n.clear()) == null || r.then(() => {
|
|
587
|
-
var
|
|
588
|
-
t != null && t.id && (i ? (
|
|
587
|
+
var o;
|
|
588
|
+
t != null && t.id && (i ? (o = Et(i, t)) == null || o.finally(() => {
|
|
589
589
|
G(!1);
|
|
590
590
|
}) : (G(!1), U(!0), Ve()));
|
|
591
591
|
}) : i ? G(!1) : (G(!1), U(!0), Ve());
|
|
@@ -647,7 +647,7 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
647
647
|
className: "footer-upload-action",
|
|
648
648
|
onClick: (t) => t.preventDefault(),
|
|
649
649
|
children: [/* @__PURE__ */ W(re, {
|
|
650
|
-
children: [
|
|
650
|
+
children: [s.type === 2 && (c == null ? void 0 : c.imageUpload) && /* @__PURE__ */ a(Qt, {
|
|
651
651
|
disabled: !!_ || D,
|
|
652
652
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
653
653
|
listType: "picture-card",
|
|
@@ -691,8 +691,8 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
691
691
|
})
|
|
692
692
|
})
|
|
693
693
|
})
|
|
694
|
-
}), ae && (c != null && c.fileUpload) && (
|
|
695
|
-
appId:
|
|
694
|
+
}), ae && (c != null && c.fileUpload) && (s != null && s.id) ? /* @__PURE__ */ a(ri, {
|
|
695
|
+
appId: s == null ? void 0 : s.id,
|
|
696
696
|
ref: ne,
|
|
697
697
|
isFirstSession: Ue,
|
|
698
698
|
docViewerUrl: g,
|
|
@@ -703,9 +703,9 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
703
703
|
U(!0), k == null || k({
|
|
704
704
|
netOpen: O ? 1 : 2
|
|
705
705
|
}).then((i) => {
|
|
706
|
-
var n, r,
|
|
706
|
+
var n, r, o;
|
|
707
707
|
v == null || v(i), U(!1), w(!!((n = i.data) != null && n.netOpen)), K(!!((r = i.data) != null && r.enableNetOpen));
|
|
708
|
-
const l = ((
|
|
708
|
+
const l = ((o = i.data) == null ? void 0 : o.id) || "";
|
|
709
709
|
t(l);
|
|
710
710
|
});
|
|
711
711
|
}),
|
|
@@ -725,7 +725,7 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
725
725
|
i && ie((n) => {
|
|
726
726
|
const r = n[i] || [];
|
|
727
727
|
return {
|
|
728
|
-
[i]: r.filter((
|
|
728
|
+
[i]: r.filter((o) => o.id !== t)
|
|
729
729
|
};
|
|
730
730
|
});
|
|
731
731
|
},
|
|
@@ -740,8 +740,8 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
740
740
|
[t]: []
|
|
741
741
|
}), ye());
|
|
742
742
|
}
|
|
743
|
-
}) : null, (c == null ? void 0 : c.prompt) && (
|
|
744
|
-
appId:
|
|
743
|
+
}) : null, (c == null ? void 0 : c.prompt) && (s == null ? void 0 : s.id) && /* @__PURE__ */ a(oi, {
|
|
744
|
+
appId: s.id,
|
|
745
745
|
list: [],
|
|
746
746
|
search: Pe ? dt : "",
|
|
747
747
|
onPromptSelect: (t) => {
|
|
@@ -750,7 +750,7 @@ ${t}` : t, r = new Z(n, l, Y.User, i);
|
|
|
750
750
|
disabled: D
|
|
751
751
|
})]
|
|
752
752
|
}), /* @__PURE__ */ W(re, {
|
|
753
|
-
children: [(c == null ? void 0 : c.connectNetwork) &&
|
|
753
|
+
children: [(c == null ? void 0 : c.connectNetwork) && s.type === 0 && ((We = s.arrange) == null ? void 0 : We.length) && !!s.arrange[0].enableNetOpen && /* @__PURE__ */ a(ui, {
|
|
754
754
|
sessionId: (Qe = e == null ? void 0 : e.data) == null ? void 0 : Qe.id,
|
|
755
755
|
netStatus: O,
|
|
756
756
|
enable: typeof (f == null ? void 0 : f.connectNetwork) == "object" && typeof (f == null ? void 0 : f.connectNetwork.diabled) == "boolean" ? !(f != null && f.connectNetwork.diabled) : xt,
|
|
@@ -18,7 +18,7 @@ import ye from "../../context.mjs";
|
|
|
18
18
|
import Ce from "../SessionRelated/index.mjs";
|
|
19
19
|
import Le from "../ReferCollapse/index.mjs";
|
|
20
20
|
import ve from "../../node_modules/copy-to-clipboard/index.mjs";
|
|
21
|
-
import Re from "
|
|
21
|
+
import Re from "../../assets/think.svg.mjs";
|
|
22
22
|
import { escapeSlash as Se } from "../../utils/index.mjs";
|
|
23
23
|
const be = (o) => {
|
|
24
24
|
if (!o)
|
|
@@ -1,64 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import o from "../../Iconfont/index.mjs";
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as p } from "../../_virtual/jsx-runtime.mjs";
|
|
3
2
|
import { useState as m } from "react";
|
|
3
|
+
import u from "../../assets/think.svg.mjs";
|
|
4
4
|
import "./style.less.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { CheckOutlined as g, CloseOutlined as f } from "@ant-design/icons";
|
|
6
|
+
import { Collapse as i, Space as N } from "antd";
|
|
7
|
+
const {
|
|
8
|
+
Panel: R
|
|
9
|
+
} = i, S = (o) => {
|
|
10
|
+
var r, a;
|
|
7
11
|
const {
|
|
8
12
|
history: n
|
|
9
|
-
} =
|
|
10
|
-
return /* @__PURE__ */ e("div", {
|
|
13
|
+
} = o, [h, d] = m(!1), s = n.searchingStatus || ((r = n.searchReference) != null && r.length ? "end" : "");
|
|
14
|
+
return s ? /* @__PURE__ */ e("div", {
|
|
11
15
|
className: "search-reference",
|
|
12
|
-
children:
|
|
13
|
-
className: "bot-
|
|
16
|
+
children: /* @__PURE__ */ t("div", {
|
|
17
|
+
className: "item-bot-plugin",
|
|
14
18
|
onClick: () => {
|
|
15
|
-
d(!
|
|
19
|
+
d(!h);
|
|
16
20
|
},
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
children: ["
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
style: {
|
|
24
|
-
fontSize: 16
|
|
25
|
-
}
|
|
26
|
-
}) : /* @__PURE__ */ s(o, {
|
|
27
|
-
type: "icon-shouqi",
|
|
28
|
-
style: {
|
|
29
|
-
fontSize: 16
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
})]
|
|
33
|
-
}) : null, t && ((c = n.searchReference) == null ? void 0 : c.length) > 0 && /* @__PURE__ */ e("div", {
|
|
34
|
-
className: "bot-net-main",
|
|
35
|
-
children: [/* @__PURE__ */ s("div", {
|
|
36
|
-
className: "text",
|
|
37
|
-
children: "正在尝试为您在互联网搜索相关资料..."
|
|
38
|
-
}), /* @__PURE__ */ s("div", {
|
|
39
|
-
className: "text",
|
|
40
|
-
children: "开始获取资料..."
|
|
41
|
-
}), (i = n.searchReference) == null ? void 0 : i.map((l, r) => /* @__PURE__ */ e("div", {
|
|
42
|
-
className: "text",
|
|
43
|
-
children: [/* @__PURE__ */ e("span", {
|
|
44
|
-
children: ["找到了第 ", r + 1, " 篇资料:"]
|
|
45
|
-
}), /* @__PURE__ */ s("span", {
|
|
46
|
-
className: "link",
|
|
47
|
-
onClick: () => {
|
|
48
|
-
window.open(l.link);
|
|
49
|
-
},
|
|
50
|
-
children: l.title
|
|
21
|
+
children: [s === "start" && /* @__PURE__ */ t(p, {
|
|
22
|
+
children: [/* @__PURE__ */ e("img", {
|
|
23
|
+
src: u,
|
|
24
|
+
alt: ""
|
|
25
|
+
}), /* @__PURE__ */ e("span", {
|
|
26
|
+
children: "正在搜索…"
|
|
51
27
|
})]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
}), s === "end" && /* @__PURE__ */ e(i, {
|
|
29
|
+
ghost: !0,
|
|
30
|
+
expandIconPosition: "right",
|
|
31
|
+
children: /* @__PURE__ */ e(R, {
|
|
32
|
+
collapsible: "icon",
|
|
33
|
+
showArrow: !!(s === "end" && n.searchReference.length),
|
|
34
|
+
header: /* @__PURE__ */ t(N, {
|
|
35
|
+
size: 8,
|
|
36
|
+
style: {
|
|
37
|
+
width: "100%"
|
|
38
|
+
},
|
|
39
|
+
children: [/* @__PURE__ */ t("span", {
|
|
40
|
+
className: "bot-plugin-status",
|
|
41
|
+
children: [s === "end" && n.searchReference.length > 0 && /* @__PURE__ */ e("span", {
|
|
42
|
+
className: "plugin-status-success",
|
|
43
|
+
children: /* @__PURE__ */ e(g, {})
|
|
44
|
+
}), s === "end" && !n.searchReference.length && /* @__PURE__ */ e("span", {
|
|
45
|
+
className: "plugin-status-error",
|
|
46
|
+
children: /* @__PURE__ */ e(f, {})
|
|
47
|
+
})]
|
|
48
|
+
}), s === "end" && /* @__PURE__ */ e("span", {
|
|
49
|
+
className: "bot-plugin-title",
|
|
50
|
+
children: n.searchReference.length ? `已搜索到${n.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
|
|
51
|
+
})]
|
|
52
|
+
}),
|
|
53
|
+
children: /* @__PURE__ */ e("div", {
|
|
54
|
+
className: "bot-net-main",
|
|
55
|
+
children: (a = n.searchReference) == null ? void 0 : a.map((c, l) => /* @__PURE__ */ t("div", {
|
|
56
|
+
className: "text",
|
|
57
|
+
children: [/* @__PURE__ */ t("span", {
|
|
58
|
+
children: [l + 1, ". "]
|
|
59
|
+
}), /* @__PURE__ */ e("span", {
|
|
60
|
+
className: "link",
|
|
61
|
+
onClick: () => {
|
|
62
|
+
window.open(c.link);
|
|
63
|
+
},
|
|
64
|
+
children: c.title
|
|
65
|
+
})]
|
|
66
|
+
}, l))
|
|
67
|
+
})
|
|
68
|
+
}, "")
|
|
58
69
|
})]
|
|
59
|
-
})
|
|
60
|
-
});
|
|
70
|
+
})
|
|
71
|
+
}) : null;
|
|
61
72
|
};
|
|
62
73
|
export {
|
|
63
|
-
|
|
74
|
+
S as default
|
|
64
75
|
};
|