@fencyai/react 0.1.174 → 0.1.176
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/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as y, jsx as o, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import { createStream as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { motion as C, useInView as
|
|
5
|
-
import
|
|
6
|
-
import { Prism as
|
|
7
|
-
import
|
|
8
|
-
import './assets/index.css';const
|
|
2
|
+
import { createStream as ge, isStreamTimeoutEvent as he, isStreamNotFoundEvent as fe, isAgentTaskProgressItemUpdatedEvent as Se, createAgentTask as xe } from "@fencyai/js";
|
|
3
|
+
import { createContext as ke, useState as I, useRef as A, useEffect as F, useCallback as z, useContext as be, useMemo as P } from "react";
|
|
4
|
+
import { motion as C, useInView as ve, AnimatePresence as Te } from "motion/react";
|
|
5
|
+
import we from "react-markdown";
|
|
6
|
+
import { Prism as ce } from "react-syntax-highlighter";
|
|
7
|
+
import Ce from "remark-gfm";
|
|
8
|
+
import './assets/index.css';const de = ke(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
|
-
async function
|
|
11
|
+
async function Ie(e, r) {
|
|
12
12
|
const t = e.getReader();
|
|
13
13
|
let n;
|
|
14
14
|
for (; !(n = await t.read()).done; )
|
|
15
15
|
r(n.value);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Ee(e) {
|
|
18
18
|
let r, t, n, i = !1;
|
|
19
19
|
return function(a) {
|
|
20
|
-
r === void 0 ? (r = a, t = 0, n = -1) : r =
|
|
20
|
+
r === void 0 ? (r = a, t = 0, n = -1) : r = Re(r, a);
|
|
21
21
|
const s = r.length;
|
|
22
22
|
let m = 0;
|
|
23
23
|
for (; t < s; ) {
|
|
@@ -41,12 +41,12 @@ function Te(e) {
|
|
|
41
41
|
m === s ? r = void 0 : m !== 0 && (r = r.subarray(m), t -= m);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let n =
|
|
44
|
+
function Me(e, r, t) {
|
|
45
|
+
let n = Z();
|
|
46
46
|
const i = new TextDecoder();
|
|
47
47
|
return function(a, s) {
|
|
48
48
|
if (a.length === 0)
|
|
49
|
-
t == null || t(n), n =
|
|
49
|
+
t == null || t(n), n = Z();
|
|
50
50
|
else if (s > 0) {
|
|
51
51
|
const m = i.decode(a.subarray(0, s)), p = s + (a[s + 1] === 32 ? 2 : 1), c = i.decode(a.subarray(p));
|
|
52
52
|
switch (m) {
|
|
@@ -68,11 +68,11 @@ function we(e, r, t) {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Re(e, r) {
|
|
72
72
|
const t = new Uint8Array(e.length + r.length);
|
|
73
73
|
return t.set(e), t.set(r, e.length), t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Z() {
|
|
76
76
|
return {
|
|
77
77
|
data: "",
|
|
78
78
|
event: "",
|
|
@@ -80,7 +80,7 @@ function J() {
|
|
|
80
80
|
retry: void 0
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var Fe = function(e, r) {
|
|
84
84
|
var t = {};
|
|
85
85
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
86
86
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -88,32 +88,32 @@ var Ie = function(e, r) {
|
|
|
88
88
|
r.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (t[n[i]] = e[n[i]]);
|
|
89
89
|
return t;
|
|
90
90
|
};
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
var { signal: t, headers: n, onopen: i, onmessage: l, onclose: a, onerror: s, openWhenHidden: m, fetch: p } = r, c =
|
|
91
|
+
const N = "text/event-stream", Ae = 1e3, ee = "last-event-id";
|
|
92
|
+
function Le(e, r) {
|
|
93
|
+
var { signal: t, headers: n, onopen: i, onmessage: l, onclose: a, onerror: s, openWhenHidden: m, fetch: p } = r, c = Fe(r, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
94
|
return new Promise((d, u) => {
|
|
95
95
|
const g = Object.assign({}, n);
|
|
96
|
-
g.accept || (g.accept =
|
|
96
|
+
g.accept || (g.accept = N);
|
|
97
97
|
let h;
|
|
98
98
|
function f() {
|
|
99
99
|
h.abort(), document.hidden || x();
|
|
100
100
|
}
|
|
101
101
|
m || document.addEventListener("visibilitychange", f);
|
|
102
|
-
let k =
|
|
102
|
+
let k = Ae, b = 0;
|
|
103
103
|
function v() {
|
|
104
104
|
document.removeEventListener("visibilitychange", f), window.clearTimeout(b), h.abort();
|
|
105
105
|
}
|
|
106
106
|
t == null || t.addEventListener("abort", () => {
|
|
107
107
|
v(), d();
|
|
108
108
|
});
|
|
109
|
-
const T = p ?? window.fetch, w = i ??
|
|
109
|
+
const T = p ?? window.fetch, w = i ?? Pe;
|
|
110
110
|
async function x() {
|
|
111
111
|
var D;
|
|
112
112
|
h = new AbortController();
|
|
113
113
|
try {
|
|
114
114
|
const W = await T(e, Object.assign(Object.assign({}, c), { headers: g, signal: h.signal }));
|
|
115
|
-
await w(W), await
|
|
116
|
-
R ? g[
|
|
115
|
+
await w(W), await Ie(W.body, Ee(Me((R) => {
|
|
116
|
+
R ? g[ee] = R : delete g[ee];
|
|
117
117
|
}, (R) => {
|
|
118
118
|
k = R;
|
|
119
119
|
}, l))), a == null || a(), v(), d();
|
|
@@ -130,18 +130,18 @@ function Me(e, r) {
|
|
|
130
130
|
x();
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Pe(e) {
|
|
134
134
|
const r = e.headers.get("content-type");
|
|
135
|
-
if (!(r != null && r.startsWith(
|
|
136
|
-
throw new Error(`Expected content-type to be ${
|
|
135
|
+
if (!(r != null && r.startsWith(N)))
|
|
136
|
+
throw new Error(`Expected content-type to be ${N}, Actual: ${r}`);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function re(e) {
|
|
139
139
|
const r = atob(e), t = new Uint8Array(r.length);
|
|
140
140
|
for (let n = 0; n < r.length; n++)
|
|
141
141
|
t[n] = r.charCodeAt(n);
|
|
142
142
|
return new TextDecoder("utf-8").decode(t);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function De() {
|
|
145
145
|
return `
|
|
146
146
|
var connections = new Map();
|
|
147
147
|
|
|
@@ -287,10 +287,10 @@ self.onmessage = function (e) {
|
|
|
287
287
|
};
|
|
288
288
|
`.trim();
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function ne(e) {
|
|
291
291
|
return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown stream error";
|
|
292
292
|
}
|
|
293
|
-
class
|
|
293
|
+
class We {
|
|
294
294
|
constructor(r) {
|
|
295
295
|
this.activeConnections = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.worker = null, this.workerBlobUrl = null, this.workerSupported = !1, this.fency = r, this.tryInitWorker();
|
|
296
296
|
}
|
|
@@ -298,7 +298,7 @@ class Ae {
|
|
|
298
298
|
try {
|
|
299
299
|
if (typeof Worker > "u" || typeof Blob > "u" || typeof URL > "u" || typeof URL.createObjectURL != "function" || typeof ReadableStream > "u")
|
|
300
300
|
return;
|
|
301
|
-
const r =
|
|
301
|
+
const r = De(), t = new Blob([r], { type: "application/javascript" }), n = URL.createObjectURL(t), i = new Worker(n);
|
|
302
302
|
i.onmessage = (l) => {
|
|
303
303
|
this.handleWorkerMessage(l.data);
|
|
304
304
|
}, i.onerror = (l) => {
|
|
@@ -314,7 +314,7 @@ class Ae {
|
|
|
314
314
|
switch (t.type) {
|
|
315
315
|
case "message":
|
|
316
316
|
if (t.data && t.streamId) {
|
|
317
|
-
const n =
|
|
317
|
+
const n = re(t.data);
|
|
318
318
|
this.broadcast(n, t.streamId);
|
|
319
319
|
}
|
|
320
320
|
break;
|
|
@@ -342,7 +342,7 @@ class Ae {
|
|
|
342
342
|
}
|
|
343
343
|
connectStreamInWorker(r) {
|
|
344
344
|
const t = r.stream.id, n = `${this.fency.baseUrl}/sse/streams/${t}`, i = new AbortController(), l = {
|
|
345
|
-
accept:
|
|
345
|
+
accept: N,
|
|
346
346
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
347
347
|
"X-Fency-Stream-Token": r.stream.token
|
|
348
348
|
};
|
|
@@ -385,7 +385,7 @@ class Ae {
|
|
|
385
385
|
);
|
|
386
386
|
} catch (s) {
|
|
387
387
|
if (i.signal.aborted) return;
|
|
388
|
-
a(
|
|
388
|
+
a(ne(s));
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
connectStreamOnMainThread(r) {
|
|
@@ -397,7 +397,7 @@ class Ae {
|
|
|
397
397
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
398
398
|
"X-Fency-Stream-Token": r.stream.token
|
|
399
399
|
};
|
|
400
|
-
|
|
400
|
+
Le(i, {
|
|
401
401
|
headers: l,
|
|
402
402
|
signal: n.signal,
|
|
403
403
|
openWhenHidden: !0,
|
|
@@ -407,12 +407,12 @@ class Ae {
|
|
|
407
407
|
},
|
|
408
408
|
onmessage: (a) => {
|
|
409
409
|
if (a.data) {
|
|
410
|
-
const s =
|
|
410
|
+
const s = re(a.data);
|
|
411
411
|
this.broadcast(s, t);
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
414
|
onerror: (a) => {
|
|
415
|
-
throw console.error("EventSource error for stream", t, ":", a), this.activeConnections.delete(t), this.broadcastError(t,
|
|
415
|
+
throw console.error("EventSource error for stream", t, ":", a), this.activeConnections.delete(t), this.broadcastError(t, ne(a)), a;
|
|
416
416
|
},
|
|
417
417
|
onclose() {
|
|
418
418
|
}
|
|
@@ -451,11 +451,11 @@ class Ae {
|
|
|
451
451
|
this.workerBlobUrl && (URL.revokeObjectURL(this.workerBlobUrl), this.workerBlobUrl = null), this.workerSupported = !1, this.subscribers.clear();
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
const
|
|
454
|
+
const ze = 48e4, Be = 3e5, te = (e) => {
|
|
455
455
|
const r = Date.now();
|
|
456
|
-
return e.filter((t) => r - t.createdAt <
|
|
456
|
+
return e.filter((t) => r - t.createdAt < ze);
|
|
457
457
|
};
|
|
458
|
-
function
|
|
458
|
+
function Vr({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
459
459
|
const [n, i] = I(
|
|
460
460
|
null
|
|
461
461
|
), [l, a] = I(!0), [s, m] = I(null), [p, c] = I([]), d = A(null), u = A(null);
|
|
@@ -466,7 +466,7 @@ function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
|
466
466
|
m(k), a(!1);
|
|
467
467
|
});
|
|
468
468
|
}, [e]), F(() => {
|
|
469
|
-
n && !u.current && (u.current = new
|
|
469
|
+
n && !u.current && (u.current = new We(n));
|
|
470
470
|
}, [n]), F(() => {
|
|
471
471
|
u.current && u.current.updateStreams(p);
|
|
472
472
|
}, [p]), F(() => () => {
|
|
@@ -475,14 +475,14 @@ function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
|
475
475
|
}, []), F(() => {
|
|
476
476
|
const k = setInterval(() => {
|
|
477
477
|
c((b) => {
|
|
478
|
-
const v =
|
|
478
|
+
const v = te(b);
|
|
479
479
|
return v.length !== b.length ? v : b;
|
|
480
480
|
});
|
|
481
481
|
}, 6e4);
|
|
482
482
|
return () => clearInterval(k);
|
|
483
483
|
}, []);
|
|
484
484
|
const g = z(
|
|
485
|
-
async (k =
|
|
485
|
+
async (k = Be) => {
|
|
486
486
|
if (d.current)
|
|
487
487
|
return d.current;
|
|
488
488
|
const b = Date.now(), v = p.length > 0 ? p[p.length - 1] : null;
|
|
@@ -491,7 +491,7 @@ function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
|
491
491
|
const T = (async () => {
|
|
492
492
|
if (!n)
|
|
493
493
|
throw new Error("Fency instance not initialized");
|
|
494
|
-
const w = await r(), x = await
|
|
494
|
+
const w = await r(), x = await ge({
|
|
495
495
|
pk: n.publishableKey,
|
|
496
496
|
baseUrl: n.baseUrl,
|
|
497
497
|
clientToken: (w == null ? void 0 : w.clientToken) ?? ""
|
|
@@ -503,7 +503,7 @@ function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
|
503
503
|
};
|
|
504
504
|
return c((W) => {
|
|
505
505
|
const R = [...W, D];
|
|
506
|
-
return
|
|
506
|
+
return te(R);
|
|
507
507
|
}), d.current = null, x.stream;
|
|
508
508
|
} else
|
|
509
509
|
throw d.current = null, new Error("Failed to create stream");
|
|
@@ -528,30 +528,30 @@ function Ur({ fency: e, fetchCreateStreamClientToken: r, children: t }) {
|
|
|
528
528
|
eventManager: u.current,
|
|
529
529
|
getOrCreateStream: g
|
|
530
530
|
};
|
|
531
|
-
return /* @__PURE__ */ o(
|
|
531
|
+
return /* @__PURE__ */ o(de.Provider, { value: f, children: t });
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const e =
|
|
533
|
+
function ue() {
|
|
534
|
+
const e = be(de);
|
|
535
535
|
if (e === void 0)
|
|
536
536
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
537
537
|
return e;
|
|
538
538
|
}
|
|
539
|
-
const
|
|
539
|
+
const Oe = (e) => {
|
|
540
540
|
try {
|
|
541
541
|
const r = JSON.parse(e);
|
|
542
|
-
return
|
|
542
|
+
return Ne(r);
|
|
543
543
|
} catch (r) {
|
|
544
544
|
return console.error("Error parsing message:", r), null;
|
|
545
545
|
}
|
|
546
|
-
},
|
|
546
|
+
}, Ne = (e) => he(e) ? $e(e) : fe(e) ? He(e) : Se(e) ? Ue(e) : null, $e = (e) => ({
|
|
547
547
|
type: "STREAM_TIMEOUT",
|
|
548
548
|
streamId: e.streamId,
|
|
549
549
|
timestamp: e.timestamp
|
|
550
|
-
}),
|
|
550
|
+
}), He = (e) => ({
|
|
551
551
|
type: "STREAM_NOT_FOUND",
|
|
552
552
|
streamId: e.streamId,
|
|
553
553
|
timestamp: e.timestamp
|
|
554
|
-
}),
|
|
554
|
+
}), Ue = (e) => ({
|
|
555
555
|
type: "AGENT_TASK_PROGRESS_ITEM_UPDATED",
|
|
556
556
|
streamId: e.streamId,
|
|
557
557
|
agentTaskId: e.agentTaskId,
|
|
@@ -559,14 +559,14 @@ const De = (e) => {
|
|
|
559
559
|
timestamp: e.timestamp,
|
|
560
560
|
createdAt: e.createdAt,
|
|
561
561
|
data: JSON.parse(e.data)
|
|
562
|
-
}),
|
|
563
|
-
const r =
|
|
562
|
+
}), _e = (e) => {
|
|
563
|
+
const r = ue(), [t, n] = I(null), i = A(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
564
564
|
return F(() => {
|
|
565
565
|
if (!r.eventManager) return;
|
|
566
566
|
const a = {
|
|
567
567
|
onMessage: (m, p) => {
|
|
568
568
|
var d, u, g;
|
|
569
|
-
const c =
|
|
569
|
+
const c = Oe(m);
|
|
570
570
|
if (c)
|
|
571
571
|
switch (c.type) {
|
|
572
572
|
case "STREAM_TIMEOUT":
|
|
@@ -615,8 +615,8 @@ const De = (e) => {
|
|
|
615
615
|
},
|
|
616
616
|
stream: t
|
|
617
617
|
};
|
|
618
|
-
},
|
|
619
|
-
const r =
|
|
618
|
+
}, Yr = (e) => {
|
|
619
|
+
const r = ue(), [t, n] = I([]), i = A(/* @__PURE__ */ new Set()), l = A(/* @__PURE__ */ new Map()), a = z(
|
|
620
620
|
(c, d) => {
|
|
621
621
|
n((u) => {
|
|
622
622
|
const g = [], h = u.map((f) => {
|
|
@@ -634,7 +634,7 @@ const De = (e) => {
|
|
|
634
634
|
});
|
|
635
635
|
},
|
|
636
636
|
[]
|
|
637
|
-
), { createStream: s } =
|
|
637
|
+
), { createStream: s } = _e({
|
|
638
638
|
onAgentTaskProgressItemUpdated: (c) => {
|
|
639
639
|
var g;
|
|
640
640
|
if (!i.current.has(c.agentTaskId)) return;
|
|
@@ -729,7 +729,7 @@ const De = (e) => {
|
|
|
729
729
|
};
|
|
730
730
|
n((v) => [...v, b]), (f = d == null ? void 0 : d.onTaskRegistered) == null || f.call(d, b);
|
|
731
731
|
try {
|
|
732
|
-
const { clientToken: v } = await g(), T = await
|
|
732
|
+
const { clientToken: v } = await g(), T = await xe({
|
|
733
733
|
pk: r.fency.publishableKey,
|
|
734
734
|
baseUrl: r.fency.baseUrl,
|
|
735
735
|
clientToken: v,
|
|
@@ -885,7 +885,7 @@ const De = (e) => {
|
|
|
885
885
|
latest: p
|
|
886
886
|
};
|
|
887
887
|
};
|
|
888
|
-
function
|
|
888
|
+
function Ge(e) {
|
|
889
889
|
return e.progressItems.map((r, t) => {
|
|
890
890
|
const n = e.progressItems[t + 1], i = n != null;
|
|
891
891
|
let l;
|
|
@@ -901,7 +901,7 @@ function Ne(e) {
|
|
|
901
901
|
};
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
|
-
const
|
|
904
|
+
const me = {
|
|
905
905
|
'code[class*="language-"]': {
|
|
906
906
|
color: "#f8f8f2",
|
|
907
907
|
background: "none",
|
|
@@ -1052,7 +1052,7 @@ const ce = {
|
|
|
1052
1052
|
italic: {
|
|
1053
1053
|
fontStyle: "italic"
|
|
1054
1054
|
}
|
|
1055
|
-
},
|
|
1055
|
+
}, oe = ({
|
|
1056
1056
|
text: e
|
|
1057
1057
|
}) => /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
|
|
1058
1058
|
C.div,
|
|
@@ -1062,22 +1062,22 @@ const ce = {
|
|
|
1062
1062
|
animate: { opacity: 1, y: 0 },
|
|
1063
1063
|
transition: { duration: 0.3, delay: 0 },
|
|
1064
1064
|
children: /* @__PURE__ */ o(
|
|
1065
|
-
|
|
1065
|
+
we,
|
|
1066
1066
|
{
|
|
1067
|
-
remarkPlugins: [
|
|
1067
|
+
remarkPlugins: [Ce],
|
|
1068
1068
|
components: {
|
|
1069
1069
|
code(r) {
|
|
1070
1070
|
const { children: t, className: n, node: i, ref: l, ...a } = r, s = /language-(\w+)/.exec(n || "");
|
|
1071
1071
|
return s ? (
|
|
1072
1072
|
// @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
|
|
1073
1073
|
/* @__PURE__ */ o(
|
|
1074
|
-
|
|
1074
|
+
ce,
|
|
1075
1075
|
{
|
|
1076
1076
|
...a,
|
|
1077
1077
|
PreTag: "div",
|
|
1078
1078
|
children: String(t).replace(/\n$/, ""),
|
|
1079
1079
|
language: s[1],
|
|
1080
|
-
style:
|
|
1080
|
+
style: me
|
|
1081
1081
|
}
|
|
1082
1082
|
)
|
|
1083
1083
|
) : /* @__PURE__ */ o("code", { ...a, className: n, children: String(t) });
|
|
@@ -1087,7 +1087,7 @@ const ce = {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
)
|
|
1089
1089
|
}
|
|
1090
|
-
) }),
|
|
1090
|
+
) }), je = ({ data: e }) => {
|
|
1091
1091
|
const r = JSON.stringify(
|
|
1092
1092
|
JSON.parse(e.response.jsonResponse),
|
|
1093
1093
|
null,
|
|
@@ -1099,10 +1099,10 @@ const ce = {
|
|
|
1099
1099
|
initial: { opacity: 0, y: -10 },
|
|
1100
1100
|
animate: { opacity: 1, y: 0 },
|
|
1101
1101
|
transition: { duration: 0.3, delay: 0 },
|
|
1102
|
-
children: /* @__PURE__ */ o(
|
|
1102
|
+
children: /* @__PURE__ */ o(ce, { language: "json", style: me, PreTag: "div", children: r })
|
|
1103
1103
|
}
|
|
1104
1104
|
) });
|
|
1105
|
-
},
|
|
1105
|
+
}, qe = {
|
|
1106
1106
|
en: {
|
|
1107
1107
|
error: "Error",
|
|
1108
1108
|
streaming: "Streaming...",
|
|
@@ -1248,8 +1248,8 @@ const ce = {
|
|
|
1248
1248
|
scrapeFailedCount: "{n} feilet"
|
|
1249
1249
|
}
|
|
1250
1250
|
};
|
|
1251
|
-
function
|
|
1252
|
-
return
|
|
1251
|
+
function Qe(e) {
|
|
1252
|
+
return qe[e];
|
|
1253
1253
|
}
|
|
1254
1254
|
function S(e, r) {
|
|
1255
1255
|
return Object.entries(r).reduce(
|
|
@@ -1280,7 +1280,7 @@ function M({
|
|
|
1280
1280
|
shimmerColor: d = "#000",
|
|
1281
1281
|
direction: u = "fromBottom"
|
|
1282
1282
|
}) {
|
|
1283
|
-
const g = A(null), h =
|
|
1283
|
+
const g = A(null), h = ve(g, { once: s, margin: m }), f = P(() => e.length * p, [e, p]), k = !a || h, b = u === "fromBottom" ? "100% center" : "-100% center", v = u === "fromBottom" ? "0% center" : "200% center";
|
|
1284
1284
|
return /* @__PURE__ */ o(
|
|
1285
1285
|
C.span,
|
|
1286
1286
|
{
|
|
@@ -1326,8 +1326,8 @@ function M({
|
|
|
1326
1326
|
}
|
|
1327
1327
|
);
|
|
1328
1328
|
}
|
|
1329
|
-
const
|
|
1330
|
-
const [i, l] = I(!1), s = (e.memories ?? []).map((k) => k.memoryTitle), m = s.length > 0, p = m && s.length >
|
|
1329
|
+
const U = 5, Ke = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
1330
|
+
const [i, l] = I(!1), s = (e.memories ?? []).map((k) => k.memoryTitle), m = s.length > 0, p = m && s.length > U, c = p && !i ? s.slice(0, U) : s, d = s.length - U, u = !p || i, g = `${n.searchingFor}'${e.queryDescription}'`, h = m ? `${n.searchingIn}${q(
|
|
1331
1331
|
c,
|
|
1332
1332
|
u ? n.and : void 0
|
|
1333
1333
|
)}` : "", f = m ? `${g}${h}` : `${n.searchingPrefix}${e.queryDescription}`;
|
|
@@ -1420,8 +1420,8 @@ const G = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
)
|
|
1422
1422
|
] });
|
|
1423
|
-
},
|
|
1424
|
-
const [i, l] = I(!1), a = e.titles, s = a.length > 0, m = s && a.length >
|
|
1423
|
+
}, _ = 5, Xe = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
1424
|
+
const [i, l] = I(!1), a = e.titles, s = a.length > 0, m = s && a.length > _, p = m && !i ? a.slice(0, _) : a, c = a.length - _, d = !m || i, u = s ? `${n.findingMemoriesIn}${q(
|
|
1425
1425
|
p,
|
|
1426
1426
|
d ? n.and : void 0
|
|
1427
1427
|
)}` : n.findingMemories;
|
|
@@ -1508,8 +1508,8 @@ const G = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
)
|
|
1510
1510
|
] });
|
|
1511
|
-
},
|
|
1512
|
-
const [t, n] = I(!1), l = e.memories.map((g) => g.memoryTitle), a = l.length > 0, s = a && l.length >
|
|
1511
|
+
}, G = 5, Ve = ({ data: e, t: r }) => {
|
|
1512
|
+
const [t, n] = I(!1), l = e.memories.map((g) => g.memoryTitle), a = l.length > 0, s = a && l.length > G, m = s && !t ? l.slice(0, G) : l, p = l.length - G, c = !s || t, d = l.length === 1 ? r.memoryFound : r.memoriesFoundPrefix, u = a ? `${d}${q(
|
|
1513
1513
|
m,
|
|
1514
1514
|
c ? r.and : void 0
|
|
1515
1515
|
)}` : r.memoriesFound;
|
|
@@ -1571,7 +1571,7 @@ const G = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1571
1571
|
] })
|
|
1572
1572
|
}
|
|
1573
1573
|
) });
|
|
1574
|
-
},
|
|
1574
|
+
}, Ye = ({ isLatest: e = !1, durationSeconds: r, t }) => {
|
|
1575
1575
|
const n = t.addingSources;
|
|
1576
1576
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1577
1577
|
/* @__PURE__ */ o(
|
|
@@ -1612,7 +1612,7 @@ const G = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1612
1612
|
)
|
|
1613
1613
|
] });
|
|
1614
1614
|
};
|
|
1615
|
-
function
|
|
1615
|
+
function Je(e, r) {
|
|
1616
1616
|
if (e.length === 0) return "";
|
|
1617
1617
|
if (e.length === 1)
|
|
1618
1618
|
return S(r.pageSingle, { n: e[0] });
|
|
@@ -1624,7 +1624,7 @@ function Ke(e, r) {
|
|
|
1624
1624
|
const t = e[e.length - 1], n = e.slice(0, -1).join(", ");
|
|
1625
1625
|
return S(r.pageMultiple, { list: n, n: t });
|
|
1626
1626
|
}
|
|
1627
|
-
const
|
|
1627
|
+
const Ze = ({ data: e, onSourceClick: r, t }) => {
|
|
1628
1628
|
const [n, i] = I(null);
|
|
1629
1629
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1630
1630
|
/* @__PURE__ */ o(
|
|
@@ -1645,7 +1645,7 @@ const Ve = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
),
|
|
1647
1647
|
/* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: "#888" }, children: t.noSources }) : e.sources.map((l, a) => /* @__PURE__ */ o(
|
|
1648
|
-
|
|
1648
|
+
er,
|
|
1649
1649
|
{
|
|
1650
1650
|
source: l,
|
|
1651
1651
|
index: a,
|
|
@@ -1657,7 +1657,7 @@ const Ve = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1657
1657
|
l.memoryId
|
|
1658
1658
|
)) })
|
|
1659
1659
|
] });
|
|
1660
|
-
},
|
|
1660
|
+
}, er = ({
|
|
1661
1661
|
source: e,
|
|
1662
1662
|
index: r,
|
|
1663
1663
|
loadingMemoryId: t,
|
|
@@ -1665,7 +1665,7 @@ const Ve = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1665
1665
|
onSourceClick: i,
|
|
1666
1666
|
t: l
|
|
1667
1667
|
}) => {
|
|
1668
|
-
const [a, s] = I(!1), m = !!i, p = t === e.memoryId, c = e.pageNumbers ?? [], d =
|
|
1668
|
+
const [a, s] = I(!1), m = !!i, p = t === e.memoryId, c = e.pageNumbers ?? [], d = Je(c, l);
|
|
1669
1669
|
return /* @__PURE__ */ y(
|
|
1670
1670
|
C.div,
|
|
1671
1671
|
{
|
|
@@ -1749,7 +1749,7 @@ const Ve = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
1751
|
);
|
|
1752
|
-
},
|
|
1752
|
+
}, O = ({
|
|
1753
1753
|
color: e = "#333",
|
|
1754
1754
|
size: r = 32,
|
|
1755
1755
|
lineWidth: t = 2
|
|
@@ -1794,19 +1794,19 @@ const Ve = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
);
|
|
1796
1796
|
};
|
|
1797
|
-
function
|
|
1797
|
+
function rr({
|
|
1798
1798
|
memory: e,
|
|
1799
1799
|
completed: r
|
|
1800
1800
|
}) {
|
|
1801
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
1801
|
+
return e.error != null ? /* @__PURE__ */ o(O, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : r ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
1802
1802
|
}
|
|
1803
|
-
const
|
|
1804
|
-
function
|
|
1803
|
+
const ie = 80;
|
|
1804
|
+
function nr({
|
|
1805
1805
|
memory: e,
|
|
1806
1806
|
completed: r,
|
|
1807
1807
|
t
|
|
1808
1808
|
}) {
|
|
1809
|
-
const [n, i] = I(!1), l = e.result ?? e.error, a = l != null && l.length >
|
|
1809
|
+
const [n, i] = I(!1), l = e.result ?? e.error, a = l != null && l.length > ie, s = l != null ? n || !a ? l : `${l.slice(0, ie)}...` : void 0, m = a, p = e.error != null;
|
|
1810
1810
|
return /* @__PURE__ */ y(
|
|
1811
1811
|
C.div,
|
|
1812
1812
|
{
|
|
@@ -1836,7 +1836,7 @@ function Ye({
|
|
|
1836
1836
|
flexShrink: 0,
|
|
1837
1837
|
width: 32
|
|
1838
1838
|
},
|
|
1839
|
-
children: /* @__PURE__ */ o(
|
|
1839
|
+
children: /* @__PURE__ */ o(rr, { memory: e, completed: r })
|
|
1840
1840
|
}
|
|
1841
1841
|
),
|
|
1842
1842
|
/* @__PURE__ */ y(
|
|
@@ -1886,8 +1886,8 @@ function Ye({
|
|
|
1886
1886
|
}
|
|
1887
1887
|
);
|
|
1888
1888
|
}
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1889
|
+
const tr = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: e.memories.map((n) => /* @__PURE__ */ o(
|
|
1890
|
+
nr,
|
|
1891
1891
|
{
|
|
1892
1892
|
memory: n,
|
|
1893
1893
|
completed: r,
|
|
@@ -1895,13 +1895,13 @@ const Ze = ({ data: e, completed: r, t }) => /* @__PURE__ */ o("div", { style: {
|
|
|
1895
1895
|
},
|
|
1896
1896
|
n.memoryId
|
|
1897
1897
|
)) });
|
|
1898
|
-
function
|
|
1898
|
+
function or(e, r) {
|
|
1899
1899
|
const t = Math.min(e.length, r.length);
|
|
1900
1900
|
for (let n = t; n >= 0; n--)
|
|
1901
1901
|
if (e.slice(-n) === r.slice(0, n)) return n;
|
|
1902
1902
|
return 0;
|
|
1903
1903
|
}
|
|
1904
|
-
const
|
|
1904
|
+
const ir = `
|
|
1905
1905
|
|
|
1906
1906
|
`;
|
|
1907
1907
|
function Q(e) {
|
|
@@ -1915,8 +1915,8 @@ function Q(e) {
|
|
|
1915
1915
|
r = l;
|
|
1916
1916
|
continue;
|
|
1917
1917
|
}
|
|
1918
|
-
const a =
|
|
1919
|
-
a === 0 ? r +=
|
|
1918
|
+
const a = or(r, l);
|
|
1919
|
+
a === 0 ? r += ir + l : r += l.slice(a);
|
|
1920
1920
|
}
|
|
1921
1921
|
return r;
|
|
1922
1922
|
}
|
|
@@ -1937,30 +1937,30 @@ function K(e, r) {
|
|
|
1937
1937
|
n: t
|
|
1938
1938
|
});
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function X(e) {
|
|
1941
1941
|
const r = /* @__PURE__ */ new Set();
|
|
1942
1942
|
for (const t of e)
|
|
1943
1943
|
for (const n of t.pageNumbers) r.add(n);
|
|
1944
1944
|
return [...r].sort((t, n) => t - n);
|
|
1945
1945
|
}
|
|
1946
|
-
function
|
|
1946
|
+
function V(e) {
|
|
1947
1947
|
const r = e.memoryTypeName.trim();
|
|
1948
1948
|
if (r !== "") return r;
|
|
1949
1949
|
if (e.memoryTypeId !== "") return e.memoryTypeId;
|
|
1950
1950
|
}
|
|
1951
|
-
function
|
|
1951
|
+
function pe(e) {
|
|
1952
1952
|
return e.chunks.filter((r) => r.relation === "MATCH").length;
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function ar(e, r) {
|
|
1955
1955
|
let t = 0, n = 0;
|
|
1956
1956
|
for (const a of e)
|
|
1957
|
-
t +=
|
|
1957
|
+
t += pe(a), a.matchingChunkScore > n && (n = a.matchingChunkScore);
|
|
1958
1958
|
const i = t === 1 ? r.chunkFound : S(r.chunksFound, { n: t }), l = S(r.scoreLabel, {
|
|
1959
1959
|
n: n.toFixed(2)
|
|
1960
1960
|
});
|
|
1961
1961
|
return `${i} - ${l}`;
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1963
|
+
function sr(e) {
|
|
1964
1964
|
const r = [], t = /* @__PURE__ */ new Map();
|
|
1965
1965
|
return e.forEach((n, i) => {
|
|
1966
1966
|
let l = t.get(n.memoryId);
|
|
@@ -1976,7 +1976,7 @@ function tr(e) {
|
|
|
1976
1976
|
l.items.push({ item: n, flatIndex: i });
|
|
1977
1977
|
}), r.map((n) => t.get(n));
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function lr({
|
|
1980
1980
|
items: e,
|
|
1981
1981
|
onSearchResultClick: r,
|
|
1982
1982
|
t
|
|
@@ -1994,10 +1994,10 @@ function or({
|
|
|
1994
1994
|
borderTop: "1px solid #f0f0f0"
|
|
1995
1995
|
},
|
|
1996
1996
|
children: e.map((a, s) => {
|
|
1997
|
-
const m =
|
|
1997
|
+
const m = X(
|
|
1998
1998
|
a.chunks
|
|
1999
1999
|
), p = [
|
|
2000
|
-
|
|
2000
|
+
V(a),
|
|
2001
2001
|
S(t.scoreLabel, {
|
|
2002
2002
|
n: a.matchingChunkScore.toFixed(2)
|
|
2003
2003
|
}),
|
|
@@ -2116,7 +2116,7 @@ function or({
|
|
|
2116
2116
|
}
|
|
2117
2117
|
);
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function cr({
|
|
2120
2120
|
group: e,
|
|
2121
2121
|
t: r,
|
|
2122
2122
|
expanded: t,
|
|
@@ -2198,7 +2198,7 @@ function ir({
|
|
|
2198
2198
|
color: "#666",
|
|
2199
2199
|
whiteSpace: "nowrap"
|
|
2200
2200
|
},
|
|
2201
|
-
children:
|
|
2201
|
+
children: ar(l, r)
|
|
2202
2202
|
}
|
|
2203
2203
|
),
|
|
2204
2204
|
a && /* @__PURE__ */ o(
|
|
@@ -2223,7 +2223,7 @@ function ir({
|
|
|
2223
2223
|
}
|
|
2224
2224
|
),
|
|
2225
2225
|
t && a && /* @__PURE__ */ o(
|
|
2226
|
-
|
|
2226
|
+
lr,
|
|
2227
2227
|
{
|
|
2228
2228
|
items: l,
|
|
2229
2229
|
onSearchResultClick: i,
|
|
@@ -2237,25 +2237,25 @@ function ir({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
);
|
|
2239
2239
|
}
|
|
2240
|
-
function
|
|
2240
|
+
function dr(e, r) {
|
|
2241
2241
|
return e === 1 ? r.chunkFound : S(r.chunksFound, { n: e });
|
|
2242
2242
|
}
|
|
2243
|
-
const
|
|
2243
|
+
const ur = ({
|
|
2244
2244
|
data: e,
|
|
2245
2245
|
onSearchResultClick: r,
|
|
2246
2246
|
t
|
|
2247
2247
|
}) => {
|
|
2248
2248
|
const n = e.items, i = n.reduce(
|
|
2249
|
-
(u, g) => u +
|
|
2249
|
+
(u, g) => u + pe(g),
|
|
2250
2250
|
0
|
|
2251
2251
|
), l = new Set(n.map((u) => u.memoryId)).size, [a, s] = I({}), m = z((u) => {
|
|
2252
2252
|
s((g) => ({
|
|
2253
2253
|
...g,
|
|
2254
2254
|
[u]: !g[u]
|
|
2255
2255
|
}));
|
|
2256
|
-
}, []), p = P(() =>
|
|
2256
|
+
}, []), p = P(() => sr(n), [n]), c = l === 1 ? t.memoryChatChunkResultsInOneMemory : S(t.memoryChatChunkResultsInMemories, {
|
|
2257
2257
|
n: l
|
|
2258
|
-
}), d = `${
|
|
2258
|
+
}), d = `${dr(i, t)} ${c}`;
|
|
2259
2259
|
return n.length === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
2260
2260
|
"div",
|
|
2261
2261
|
{
|
|
@@ -2268,7 +2268,7 @@ const sr = ({
|
|
|
2268
2268
|
}
|
|
2269
2269
|
) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2270
2270
|
p.map((u) => /* @__PURE__ */ o(
|
|
2271
|
-
|
|
2271
|
+
cr,
|
|
2272
2272
|
{
|
|
2273
2273
|
group: u,
|
|
2274
2274
|
t,
|
|
@@ -2291,7 +2291,7 @@ const sr = ({
|
|
|
2291
2291
|
}
|
|
2292
2292
|
)
|
|
2293
2293
|
] });
|
|
2294
|
-
},
|
|
2294
|
+
}, mr = ({
|
|
2295
2295
|
data: e,
|
|
2296
2296
|
isLatest: r = !1,
|
|
2297
2297
|
durationSeconds: t,
|
|
@@ -2336,19 +2336,19 @@ const sr = ({
|
|
|
2336
2336
|
}
|
|
2337
2337
|
)
|
|
2338
2338
|
] });
|
|
2339
|
-
},
|
|
2340
|
-
function
|
|
2339
|
+
}, ae = 80;
|
|
2340
|
+
function pr(e) {
|
|
2341
2341
|
try {
|
|
2342
2342
|
return new URL(e).hostname;
|
|
2343
2343
|
} catch {
|
|
2344
2344
|
return e;
|
|
2345
2345
|
}
|
|
2346
2346
|
}
|
|
2347
|
-
function
|
|
2347
|
+
function yr({
|
|
2348
2348
|
item: e,
|
|
2349
2349
|
t: r
|
|
2350
2350
|
}) {
|
|
2351
|
-
const [t, n] = I(!1), i = e.description ?? "", l = i.length >
|
|
2351
|
+
const [t, n] = I(!1), i = e.description ?? "", l = i.length > ae, a = i.length === 0 ? void 0 : t || !l ? i : `${i.slice(0, ae)}...`;
|
|
2352
2352
|
return /* @__PURE__ */ y(
|
|
2353
2353
|
"div",
|
|
2354
2354
|
{
|
|
@@ -2392,7 +2392,7 @@ function dr({
|
|
|
2392
2392
|
children: [
|
|
2393
2393
|
e.rank,
|
|
2394
2394
|
". ",
|
|
2395
|
-
|
|
2395
|
+
pr(e.link)
|
|
2396
2396
|
]
|
|
2397
2397
|
}
|
|
2398
2398
|
),
|
|
@@ -2428,7 +2428,7 @@ function dr({
|
|
|
2428
2428
|
}
|
|
2429
2429
|
);
|
|
2430
2430
|
}
|
|
2431
|
-
const
|
|
2431
|
+
const gr = ({ data: e, t: r }) => {
|
|
2432
2432
|
const [t, n] = I(!1), i = P(
|
|
2433
2433
|
() => [...e.items].sort((s, m) => s.rank - m.rank),
|
|
2434
2434
|
[e.items]
|
|
@@ -2511,14 +2511,14 @@ const ur = ({ data: e, t: r }) => {
|
|
|
2511
2511
|
borderBottom: m < i.length - 1 ? "1px solid #eee" : void 0,
|
|
2512
2512
|
minWidth: 0
|
|
2513
2513
|
},
|
|
2514
|
-
children: /* @__PURE__ */ o(
|
|
2514
|
+
children: /* @__PURE__ */ o(yr, { item: s, t: r })
|
|
2515
2515
|
},
|
|
2516
2516
|
`${s.link}-${s.rank}-${m}`
|
|
2517
2517
|
))
|
|
2518
2518
|
}
|
|
2519
2519
|
)
|
|
2520
2520
|
] });
|
|
2521
|
-
},
|
|
2521
|
+
}, hr = ({
|
|
2522
2522
|
data: e,
|
|
2523
2523
|
isLatest: r = !1,
|
|
2524
2524
|
durationSeconds: t,
|
|
@@ -2558,8 +2558,12 @@ const ur = ({ data: e, t: r }) => {
|
|
|
2558
2558
|
}
|
|
2559
2559
|
)
|
|
2560
2560
|
] });
|
|
2561
|
-
},
|
|
2562
|
-
|
|
2561
|
+
}, se = 80, Y = 12, J = 1.4, fr = Math.ceil(
|
|
2562
|
+
Y * J
|
|
2563
|
+
), Sr = Math.ceil(
|
|
2564
|
+
5 * Y * J
|
|
2565
|
+
);
|
|
2566
|
+
function ye(e, r = 48) {
|
|
2563
2567
|
try {
|
|
2564
2568
|
const t = new URL(e), n = t.pathname.length > r ? `${t.pathname.slice(0, r)}…` : t.pathname, i = n === "/" ? "" : n;
|
|
2565
2569
|
return `${t.hostname}${i}${t.search ? "…" : ""}`;
|
|
@@ -2567,14 +2571,120 @@ function pr(e, r = 48) {
|
|
|
2567
2571
|
return e.length > 64 ? `${e.slice(0, 64)}…` : e;
|
|
2568
2572
|
}
|
|
2569
2573
|
}
|
|
2570
|
-
function
|
|
2571
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
2574
|
+
function xr({ item: e }) {
|
|
2575
|
+
return e.error != null ? /* @__PURE__ */ o(O, { color: "#c62828", size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 });
|
|
2576
|
+
}
|
|
2577
|
+
function kr({ item: e }) {
|
|
2578
|
+
return e.error != null ? /* @__PURE__ */ o(O, { color: "#c62828", size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2579
|
+
}
|
|
2580
|
+
function br({ item: e }) {
|
|
2581
|
+
const r = e.error ?? e.summary ?? "", t = r.length > 0, n = e.error != null, i = A(null), l = e.summary != null && e.summary !== "", a = n || l;
|
|
2582
|
+
return F(() => {
|
|
2583
|
+
const s = i.current;
|
|
2584
|
+
s != null && t && (s.scrollTop = s.scrollHeight);
|
|
2585
|
+
}, [r, t]), /* @__PURE__ */ y(
|
|
2586
|
+
C.div,
|
|
2587
|
+
{
|
|
2588
|
+
initial: { opacity: 0 },
|
|
2589
|
+
animate: { opacity: 1 },
|
|
2590
|
+
transition: { duration: 0.25 },
|
|
2591
|
+
style: {
|
|
2592
|
+
display: "flex",
|
|
2593
|
+
flexDirection: "row",
|
|
2594
|
+
alignItems: a ? "flex-start" : "center",
|
|
2595
|
+
gap: "10px",
|
|
2596
|
+
minWidth: 0
|
|
2597
|
+
},
|
|
2598
|
+
children: [
|
|
2599
|
+
/* @__PURE__ */ o(
|
|
2600
|
+
"div",
|
|
2601
|
+
{
|
|
2602
|
+
style: {
|
|
2603
|
+
display: "flex",
|
|
2604
|
+
alignItems: "center",
|
|
2605
|
+
justifyContent: "center",
|
|
2606
|
+
flexShrink: 0,
|
|
2607
|
+
width: 32,
|
|
2608
|
+
...a ? { paddingTop: 2 } : {}
|
|
2609
|
+
},
|
|
2610
|
+
children: /* @__PURE__ */ o(kr, { item: e })
|
|
2611
|
+
}
|
|
2612
|
+
),
|
|
2613
|
+
/* @__PURE__ */ y(
|
|
2614
|
+
"div",
|
|
2615
|
+
{
|
|
2616
|
+
style: {
|
|
2617
|
+
display: "flex",
|
|
2618
|
+
flexDirection: "column",
|
|
2619
|
+
gap: "8px",
|
|
2620
|
+
minWidth: 0,
|
|
2621
|
+
flex: 1
|
|
2622
|
+
},
|
|
2623
|
+
children: [
|
|
2624
|
+
/* @__PURE__ */ o(
|
|
2625
|
+
"a",
|
|
2626
|
+
{
|
|
2627
|
+
href: e.url,
|
|
2628
|
+
target: "_blank",
|
|
2629
|
+
rel: "noopener noreferrer",
|
|
2630
|
+
style: {
|
|
2631
|
+
fontSize: 13,
|
|
2632
|
+
fontWeight: 500,
|
|
2633
|
+
color: "#2563eb",
|
|
2634
|
+
textDecoration: "none",
|
|
2635
|
+
wordBreak: "break-all"
|
|
2636
|
+
},
|
|
2637
|
+
onMouseEnter: (s) => {
|
|
2638
|
+
s.currentTarget.style.textDecoration = "underline";
|
|
2639
|
+
},
|
|
2640
|
+
onMouseLeave: (s) => {
|
|
2641
|
+
s.currentTarget.style.textDecoration = "none";
|
|
2642
|
+
},
|
|
2643
|
+
children: ye(e.url)
|
|
2644
|
+
}
|
|
2645
|
+
),
|
|
2646
|
+
t && /* @__PURE__ */ o(
|
|
2647
|
+
"div",
|
|
2648
|
+
{
|
|
2649
|
+
style: {
|
|
2650
|
+
backgroundColor: "#f7f7f7",
|
|
2651
|
+
borderRadius: 6,
|
|
2652
|
+
padding: "8px 10px",
|
|
2653
|
+
boxSizing: "border-box"
|
|
2654
|
+
},
|
|
2655
|
+
children: /* @__PURE__ */ o(
|
|
2656
|
+
"div",
|
|
2657
|
+
{
|
|
2658
|
+
ref: i,
|
|
2659
|
+
style: {
|
|
2660
|
+
minHeight: fr,
|
|
2661
|
+
maxHeight: Sr,
|
|
2662
|
+
height: "auto",
|
|
2663
|
+
overflowY: "auto",
|
|
2664
|
+
overflowX: "hidden",
|
|
2665
|
+
fontSize: Y,
|
|
2666
|
+
lineHeight: J,
|
|
2667
|
+
whiteSpace: "pre-wrap",
|
|
2668
|
+
wordBreak: "break-word",
|
|
2669
|
+
color: n ? "#c62828" : "#888"
|
|
2670
|
+
},
|
|
2671
|
+
children: r
|
|
2672
|
+
}
|
|
2673
|
+
)
|
|
2674
|
+
}
|
|
2675
|
+
)
|
|
2676
|
+
]
|
|
2677
|
+
}
|
|
2678
|
+
)
|
|
2679
|
+
]
|
|
2680
|
+
}
|
|
2681
|
+
);
|
|
2572
2682
|
}
|
|
2573
|
-
function
|
|
2683
|
+
function vr({
|
|
2574
2684
|
item: e,
|
|
2575
2685
|
t: r
|
|
2576
2686
|
}) {
|
|
2577
|
-
const [t, n] = I(!1), i = e.error ?? e.summary ?? "", l = e.error != null, a = i.length >
|
|
2687
|
+
const [t, n] = I(!1), i = e.error ?? e.summary ?? "", l = e.error != null, a = i.length > se, s = i.length === 0 ? void 0 : t || !a ? i : `${i.slice(0, se)}...`;
|
|
2578
2688
|
return /* @__PURE__ */ y(
|
|
2579
2689
|
C.div,
|
|
2580
2690
|
{
|
|
@@ -2600,7 +2710,7 @@ function gr({
|
|
|
2600
2710
|
width: 32,
|
|
2601
2711
|
paddingTop: 2
|
|
2602
2712
|
},
|
|
2603
|
-
children: /* @__PURE__ */ o(
|
|
2713
|
+
children: /* @__PURE__ */ o(xr, { item: e })
|
|
2604
2714
|
}
|
|
2605
2715
|
),
|
|
2606
2716
|
/* @__PURE__ */ y(
|
|
@@ -2633,7 +2743,7 @@ function gr({
|
|
|
2633
2743
|
onMouseLeave: (m) => {
|
|
2634
2744
|
m.currentTarget.style.textDecoration = "none";
|
|
2635
2745
|
},
|
|
2636
|
-
children:
|
|
2746
|
+
children: ye(e.url)
|
|
2637
2747
|
}
|
|
2638
2748
|
),
|
|
2639
2749
|
s != null && /* @__PURE__ */ y(E, { children: [
|
|
@@ -2671,17 +2781,46 @@ function gr({
|
|
|
2671
2781
|
}
|
|
2672
2782
|
);
|
|
2673
2783
|
}
|
|
2674
|
-
|
|
2784
|
+
function le(e, r) {
|
|
2785
|
+
return /* @__PURE__ */ o(
|
|
2786
|
+
"div",
|
|
2787
|
+
{
|
|
2788
|
+
style: {
|
|
2789
|
+
display: "flex",
|
|
2790
|
+
flexDirection: "column",
|
|
2791
|
+
gap: 0,
|
|
2792
|
+
marginTop: 8,
|
|
2793
|
+
paddingTop: 8,
|
|
2794
|
+
borderTop: "1px solid #f0f0f0"
|
|
2795
|
+
},
|
|
2796
|
+
children: e.map((t, n) => /* @__PURE__ */ o(
|
|
2797
|
+
"div",
|
|
2798
|
+
{
|
|
2799
|
+
style: {
|
|
2800
|
+
paddingTop: n > 0 ? 12 : 0,
|
|
2801
|
+
paddingBottom: n < e.length - 1 ? 12 : 0,
|
|
2802
|
+
borderBottom: n < e.length - 1 ? "1px solid #eee" : void 0,
|
|
2803
|
+
minWidth: 0
|
|
2804
|
+
},
|
|
2805
|
+
children: r(t, n)
|
|
2806
|
+
},
|
|
2807
|
+
`${t.url}-${n}`
|
|
2808
|
+
))
|
|
2809
|
+
}
|
|
2810
|
+
);
|
|
2811
|
+
}
|
|
2812
|
+
const Tr = ({
|
|
2675
2813
|
data: e,
|
|
2676
|
-
|
|
2814
|
+
isLatest: r = !1,
|
|
2815
|
+
t
|
|
2677
2816
|
}) => {
|
|
2678
|
-
const [
|
|
2679
|
-
let
|
|
2680
|
-
for (const
|
|
2681
|
-
|
|
2682
|
-
return { successCount:
|
|
2683
|
-
}, [
|
|
2684
|
-
return
|
|
2817
|
+
const [n, i] = I(!1), l = e.items, { successCount: a, errorCount: s } = P(() => {
|
|
2818
|
+
let u = 0, g = 0;
|
|
2819
|
+
for (const h of l)
|
|
2820
|
+
h.error != null ? g += 1 : u += 1;
|
|
2821
|
+
return { successCount: u, errorCount: g };
|
|
2822
|
+
}, [l]), m = l.length, p = m === 1 ? t.scrapedPage : S(t.scrapedPages, { n: m }), c = S(t.scrapeOkCount, { n: a }), d = s > 0 ? `${p} - ${c}, ${S(t.scrapeFailedCount, { n: s })}` : `${p} - ${c}`;
|
|
2823
|
+
return m === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
2685
2824
|
"div",
|
|
2686
2825
|
{
|
|
2687
2826
|
style: {
|
|
@@ -2689,9 +2828,37 @@ const hr = ({
|
|
|
2689
2828
|
color: "#94a3b8",
|
|
2690
2829
|
paddingTop: 4
|
|
2691
2830
|
},
|
|
2692
|
-
children:
|
|
2831
|
+
children: t.memorySearchExploreNoResults
|
|
2693
2832
|
}
|
|
2694
|
-
) }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2833
|
+
) }) : r ? /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2834
|
+
/* @__PURE__ */ o(
|
|
2835
|
+
C.div,
|
|
2836
|
+
{
|
|
2837
|
+
initial: { opacity: 0 },
|
|
2838
|
+
animate: { opacity: 1 },
|
|
2839
|
+
transition: { duration: 0.25 },
|
|
2840
|
+
style: {
|
|
2841
|
+
display: "flex",
|
|
2842
|
+
flexDirection: "row",
|
|
2843
|
+
flexWrap: "wrap",
|
|
2844
|
+
alignItems: "baseline",
|
|
2845
|
+
gap: "6px 12px",
|
|
2846
|
+
minWidth: 0
|
|
2847
|
+
},
|
|
2848
|
+
children: /* @__PURE__ */ o(
|
|
2849
|
+
"span",
|
|
2850
|
+
{
|
|
2851
|
+
style: {
|
|
2852
|
+
fontSize: 12,
|
|
2853
|
+
color: "#666"
|
|
2854
|
+
},
|
|
2855
|
+
children: d
|
|
2856
|
+
}
|
|
2857
|
+
)
|
|
2858
|
+
}
|
|
2859
|
+
),
|
|
2860
|
+
le(l, (u) => /* @__PURE__ */ o(br, { item: u }))
|
|
2861
|
+
] }) : /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
2695
2862
|
/* @__PURE__ */ y(
|
|
2696
2863
|
C.div,
|
|
2697
2864
|
{
|
|
@@ -2714,14 +2881,14 @@ const hr = ({
|
|
|
2714
2881
|
fontSize: 12,
|
|
2715
2882
|
color: "#666"
|
|
2716
2883
|
},
|
|
2717
|
-
children:
|
|
2884
|
+
children: d
|
|
2718
2885
|
}
|
|
2719
2886
|
),
|
|
2720
2887
|
/* @__PURE__ */ o(
|
|
2721
2888
|
"button",
|
|
2722
2889
|
{
|
|
2723
2890
|
type: "button",
|
|
2724
|
-
onClick: () =>
|
|
2891
|
+
onClick: () => i((u) => !u),
|
|
2725
2892
|
style: {
|
|
2726
2893
|
border: "none",
|
|
2727
2894
|
background: "none",
|
|
@@ -2732,54 +2899,29 @@ const hr = ({
|
|
|
2732
2899
|
textDecoration: "underline",
|
|
2733
2900
|
fontFamily: "inherit"
|
|
2734
2901
|
},
|
|
2735
|
-
children:
|
|
2902
|
+
children: n ? t.memorySearchHideExploreResults : t.memorySearchViewExploreResults
|
|
2736
2903
|
}
|
|
2737
2904
|
)
|
|
2738
2905
|
]
|
|
2739
2906
|
}
|
|
2740
2907
|
),
|
|
2741
|
-
|
|
2742
|
-
"div",
|
|
2743
|
-
{
|
|
2744
|
-
style: {
|
|
2745
|
-
display: "flex",
|
|
2746
|
-
flexDirection: "column",
|
|
2747
|
-
gap: 0,
|
|
2748
|
-
marginTop: 8,
|
|
2749
|
-
paddingTop: 8,
|
|
2750
|
-
borderTop: "1px solid #f0f0f0"
|
|
2751
|
-
},
|
|
2752
|
-
children: i.map((d, u) => /* @__PURE__ */ o(
|
|
2753
|
-
"div",
|
|
2754
|
-
{
|
|
2755
|
-
style: {
|
|
2756
|
-
paddingTop: u > 0 ? 12 : 0,
|
|
2757
|
-
paddingBottom: u < i.length - 1 ? 12 : 0,
|
|
2758
|
-
borderBottom: u < i.length - 1 ? "1px solid #eee" : void 0,
|
|
2759
|
-
minWidth: 0
|
|
2760
|
-
},
|
|
2761
|
-
children: /* @__PURE__ */ o(gr, { item: d, t: r })
|
|
2762
|
-
},
|
|
2763
|
-
`${d.url}-${u}`
|
|
2764
|
-
))
|
|
2765
|
-
}
|
|
2766
|
-
)
|
|
2908
|
+
n && le(l, (u) => /* @__PURE__ */ o(vr, { item: u, t }))
|
|
2767
2909
|
] });
|
|
2768
2910
|
};
|
|
2769
|
-
function
|
|
2770
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
2911
|
+
function wr({ item: e }) {
|
|
2912
|
+
return e.error != null ? /* @__PURE__ */ o(O, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2771
2913
|
}
|
|
2772
|
-
function
|
|
2914
|
+
function Cr(e, r) {
|
|
2773
2915
|
return S(r.searchingInMemoriesOfType, {
|
|
2774
2916
|
name: e.memoryTypeName
|
|
2775
2917
|
});
|
|
2776
2918
|
}
|
|
2777
|
-
function
|
|
2919
|
+
function Ir({
|
|
2778
2920
|
item: e,
|
|
2779
2921
|
t: r,
|
|
2780
2922
|
showShimmerForPrimary: t
|
|
2781
2923
|
}) {
|
|
2782
|
-
const n = e.result != null, i = e.error != null, l =
|
|
2924
|
+
const n = e.result != null, i = e.error != null, l = Cr(e, r);
|
|
2783
2925
|
return /* @__PURE__ */ y(
|
|
2784
2926
|
C.div,
|
|
2785
2927
|
{
|
|
@@ -2807,7 +2949,7 @@ function xr({
|
|
|
2807
2949
|
flexShrink: 0,
|
|
2808
2950
|
width: 32
|
|
2809
2951
|
},
|
|
2810
|
-
children: /* @__PURE__ */ o(
|
|
2952
|
+
children: /* @__PURE__ */ o(wr, { item: e })
|
|
2811
2953
|
}
|
|
2812
2954
|
),
|
|
2813
2955
|
/* @__PURE__ */ y(
|
|
@@ -2855,7 +2997,7 @@ function xr({
|
|
|
2855
2997
|
}
|
|
2856
2998
|
);
|
|
2857
2999
|
}
|
|
2858
|
-
const
|
|
3000
|
+
const Er = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
2859
3001
|
const i = P(() => {
|
|
2860
3002
|
let l = -1;
|
|
2861
3003
|
return e.memoryTypes.forEach((a, s) => {
|
|
@@ -2873,7 +3015,7 @@ const kr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2873
3015
|
shimmerColor: "#000"
|
|
2874
3016
|
}
|
|
2875
3017
|
) : e.memoryTypes.map((l, a) => /* @__PURE__ */ o(
|
|
2876
|
-
|
|
3018
|
+
Ir,
|
|
2877
3019
|
{
|
|
2878
3020
|
item: l,
|
|
2879
3021
|
t: n,
|
|
@@ -2894,32 +3036,32 @@ const kr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2894
3036
|
}
|
|
2895
3037
|
)
|
|
2896
3038
|
] });
|
|
2897
|
-
}, $ = 12,
|
|
2898
|
-
$ *
|
|
2899
|
-
),
|
|
2900
|
-
5 * $ *
|
|
3039
|
+
}, $ = 12, H = 1.45, Mr = Math.ceil(
|
|
3040
|
+
$ * H
|
|
3041
|
+
), Rr = Math.ceil(
|
|
3042
|
+
5 * $ * H
|
|
2901
3043
|
);
|
|
2902
3044
|
function B(e) {
|
|
2903
3045
|
return e.queries != null && e.queries.length > 0;
|
|
2904
3046
|
}
|
|
2905
|
-
function
|
|
3047
|
+
function Fr(e) {
|
|
2906
3048
|
const r = e.reasoning;
|
|
2907
3049
|
return (r == null || r === "") && !B(e);
|
|
2908
3050
|
}
|
|
2909
|
-
function
|
|
3051
|
+
function Ar(e) {
|
|
2910
3052
|
if (B(e)) return 3;
|
|
2911
3053
|
const r = e.reasoning;
|
|
2912
3054
|
return r == null || r === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
|
|
2913
3055
|
}
|
|
2914
|
-
function
|
|
3056
|
+
function Lr({ phase: e }) {
|
|
2915
3057
|
return e === 3 ? /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2916
3058
|
}
|
|
2917
|
-
function
|
|
3059
|
+
function Pr({
|
|
2918
3060
|
item: e,
|
|
2919
3061
|
t: r,
|
|
2920
3062
|
isActiveRow: t
|
|
2921
3063
|
}) {
|
|
2922
|
-
const n =
|
|
3064
|
+
const n = Fr(e), i = Ar(e), l = e.reasoning, a = l != null && l.length > 0, s = A(null), [m, p] = I(!1), c = n && t, d = i === 2 && t && !B(e);
|
|
2923
3065
|
F(() => {
|
|
2924
3066
|
const h = s.current;
|
|
2925
3067
|
h != null && i === 1 && a && (h.scrollTop = h.scrollHeight);
|
|
@@ -2955,7 +3097,7 @@ function Ir({
|
|
|
2955
3097
|
width: 32,
|
|
2956
3098
|
...g ? { paddingTop: 2 } : {}
|
|
2957
3099
|
},
|
|
2958
|
-
children: /* @__PURE__ */ o(
|
|
3100
|
+
children: /* @__PURE__ */ o(Lr, { phase: n ? 1 : i })
|
|
2959
3101
|
}
|
|
2960
3102
|
),
|
|
2961
3103
|
/* @__PURE__ */ y(
|
|
@@ -3008,13 +3150,13 @@ function Ir({
|
|
|
3008
3150
|
ref: s,
|
|
3009
3151
|
className: "memory-search-generating-reasoning-viewport",
|
|
3010
3152
|
style: {
|
|
3011
|
-
minHeight:
|
|
3012
|
-
maxHeight:
|
|
3153
|
+
minHeight: Mr,
|
|
3154
|
+
maxHeight: Rr,
|
|
3013
3155
|
height: "auto",
|
|
3014
3156
|
overflowY: "auto",
|
|
3015
3157
|
overflowX: "hidden",
|
|
3016
3158
|
fontSize: $,
|
|
3017
|
-
lineHeight:
|
|
3159
|
+
lineHeight: H,
|
|
3018
3160
|
whiteSpace: "pre-wrap",
|
|
3019
3161
|
wordBreak: "break-word",
|
|
3020
3162
|
color: "#888"
|
|
@@ -3098,7 +3240,7 @@ function Ir({
|
|
|
3098
3240
|
{
|
|
3099
3241
|
style: {
|
|
3100
3242
|
fontSize: $,
|
|
3101
|
-
lineHeight:
|
|
3243
|
+
lineHeight: H,
|
|
3102
3244
|
whiteSpace: "pre-wrap",
|
|
3103
3245
|
wordBreak: "break-word",
|
|
3104
3246
|
color: "#888",
|
|
@@ -3118,7 +3260,7 @@ function Ir({
|
|
|
3118
3260
|
}
|
|
3119
3261
|
);
|
|
3120
3262
|
}
|
|
3121
|
-
const
|
|
3263
|
+
const Dr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
3122
3264
|
const i = P(() => {
|
|
3123
3265
|
let l = -1;
|
|
3124
3266
|
return e.memoryTypes.forEach((a, s) => {
|
|
@@ -3136,7 +3278,7 @@ const Er = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
3136
3278
|
shimmerColor: "#000"
|
|
3137
3279
|
}
|
|
3138
3280
|
) : e.memoryTypes.map((l, a) => /* @__PURE__ */ o(
|
|
3139
|
-
|
|
3281
|
+
Pr,
|
|
3140
3282
|
{
|
|
3141
3283
|
item: l,
|
|
3142
3284
|
t: n,
|
|
@@ -3158,10 +3300,10 @@ const Er = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
3158
3300
|
)
|
|
3159
3301
|
] });
|
|
3160
3302
|
};
|
|
3161
|
-
function
|
|
3162
|
-
return e.some((n) => n.result == null && n.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((n) => n.error != null) ? /* @__PURE__ */ o(
|
|
3303
|
+
function Wr(e) {
|
|
3304
|
+
return e.some((n) => n.result == null && n.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((n) => n.error != null) ? /* @__PURE__ */ o(O, { color: "#c62828", size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(L, { color: "#999", size: 15, borderWidth: 2 });
|
|
3163
3305
|
}
|
|
3164
|
-
function
|
|
3306
|
+
function zr(e, r) {
|
|
3165
3307
|
if (e.error != null)
|
|
3166
3308
|
return /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#c62828", whiteSpace: "nowrap" }, children: e.error });
|
|
3167
3309
|
if (e.result == null)
|
|
@@ -3184,7 +3326,7 @@ function Rr(e, r) {
|
|
|
3184
3326
|
i
|
|
3185
3327
|
] });
|
|
3186
3328
|
}
|
|
3187
|
-
function
|
|
3329
|
+
function Br({
|
|
3188
3330
|
items: e,
|
|
3189
3331
|
queryRow: r,
|
|
3190
3332
|
onExploreQueryResultClick: t,
|
|
@@ -3216,10 +3358,10 @@ function Fr({
|
|
|
3216
3358
|
borderTop: "1px solid #f0f0f0"
|
|
3217
3359
|
},
|
|
3218
3360
|
children: e.map((s, m) => {
|
|
3219
|
-
const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c =
|
|
3361
|
+
const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c = X(
|
|
3220
3362
|
s.chunks
|
|
3221
3363
|
), d = [
|
|
3222
|
-
|
|
3364
|
+
V(s),
|
|
3223
3365
|
S(n.scoreLabel, {
|
|
3224
3366
|
n: s.matchingChunkScore.toFixed(2)
|
|
3225
3367
|
}),
|
|
@@ -3352,7 +3494,7 @@ function Fr({
|
|
|
3352
3494
|
}
|
|
3353
3495
|
);
|
|
3354
3496
|
}
|
|
3355
|
-
function
|
|
3497
|
+
function Or(e) {
|
|
3356
3498
|
const r = [], t = /* @__PURE__ */ new Map();
|
|
3357
3499
|
return e.forEach((n, i) => {
|
|
3358
3500
|
let l = t.get(n.memoryTypeId);
|
|
@@ -3363,7 +3505,7 @@ function Ar(e) {
|
|
|
3363
3505
|
}, t.set(n.memoryTypeId, l)), l.items.push({ item: n, flatIndex: i });
|
|
3364
3506
|
}), r.map((n) => t.get(n));
|
|
3365
3507
|
}
|
|
3366
|
-
function
|
|
3508
|
+
function Nr({
|
|
3367
3509
|
group: e,
|
|
3368
3510
|
t: r,
|
|
3369
3511
|
isLatest: t,
|
|
@@ -3402,7 +3544,7 @@ function Lr({
|
|
|
3402
3544
|
width: 32,
|
|
3403
3545
|
...s ? {} : { paddingTop: 2 }
|
|
3404
3546
|
},
|
|
3405
|
-
children:
|
|
3547
|
+
children: Wr(a)
|
|
3406
3548
|
}
|
|
3407
3549
|
),
|
|
3408
3550
|
/* @__PURE__ */ y(
|
|
@@ -3487,7 +3629,7 @@ function Lr({
|
|
|
3487
3629
|
flexShrink: 0
|
|
3488
3630
|
},
|
|
3489
3631
|
children: [
|
|
3490
|
-
|
|
3632
|
+
zr(m, r),
|
|
3491
3633
|
c && /* @__PURE__ */ o(
|
|
3492
3634
|
"button",
|
|
3493
3635
|
{
|
|
@@ -3513,7 +3655,7 @@ function Lr({
|
|
|
3513
3655
|
}
|
|
3514
3656
|
),
|
|
3515
3657
|
c && g && /* @__PURE__ */ o(
|
|
3516
|
-
|
|
3658
|
+
Br,
|
|
3517
3659
|
{
|
|
3518
3660
|
items: h,
|
|
3519
3661
|
queryRow: m,
|
|
@@ -3533,7 +3675,7 @@ function Lr({
|
|
|
3533
3675
|
}
|
|
3534
3676
|
);
|
|
3535
3677
|
}
|
|
3536
|
-
const
|
|
3678
|
+
const $r = ({
|
|
3537
3679
|
data: e,
|
|
3538
3680
|
isLatest: r = !1,
|
|
3539
3681
|
durationSeconds: t,
|
|
@@ -3548,7 +3690,7 @@ const Pr = ({
|
|
|
3548
3690
|
[p]: !c[p]
|
|
3549
3691
|
}));
|
|
3550
3692
|
}, []), m = P(
|
|
3551
|
-
() =>
|
|
3693
|
+
() => Or(e.queries),
|
|
3552
3694
|
[e.queries]
|
|
3553
3695
|
);
|
|
3554
3696
|
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
@@ -3562,7 +3704,7 @@ const Pr = ({
|
|
|
3562
3704
|
shimmerColor: "#000"
|
|
3563
3705
|
}
|
|
3564
3706
|
) : m.map((p) => /* @__PURE__ */ o(
|
|
3565
|
-
|
|
3707
|
+
Nr,
|
|
3566
3708
|
{
|
|
3567
3709
|
group: p,
|
|
3568
3710
|
t: i,
|
|
@@ -3586,7 +3728,7 @@ const Pr = ({
|
|
|
3586
3728
|
}
|
|
3587
3729
|
)
|
|
3588
3730
|
] });
|
|
3589
|
-
},
|
|
3731
|
+
}, Hr = ({ data: e, onSearchResultClick: r, t }) => {
|
|
3590
3732
|
const n = e.response.items, i = !!r, [l, a] = I(null);
|
|
3591
3733
|
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
3592
3734
|
/* @__PURE__ */ o(
|
|
@@ -3613,10 +3755,10 @@ const Pr = ({
|
|
|
3613
3755
|
gap: 0
|
|
3614
3756
|
},
|
|
3615
3757
|
children: n.map((s, m) => {
|
|
3616
|
-
const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c =
|
|
3758
|
+
const p = s.memoryTitle !== "" ? s.memoryTitle : s.memoryId, c = X(
|
|
3617
3759
|
s.chunks
|
|
3618
3760
|
), d = [
|
|
3619
|
-
|
|
3761
|
+
V(s),
|
|
3620
3762
|
S(t.scoreLabel, {
|
|
3621
3763
|
n: s.matchingChunkScore.toFixed(2)
|
|
3622
3764
|
}),
|
|
@@ -3770,7 +3912,7 @@ const Pr = ({
|
|
|
3770
3912
|
}
|
|
3771
3913
|
)
|
|
3772
3914
|
}
|
|
3773
|
-
) }),
|
|
3915
|
+
) }), Ur = ({
|
|
3774
3916
|
progressViewItems: e,
|
|
3775
3917
|
loading: r,
|
|
3776
3918
|
error: t,
|
|
@@ -3787,16 +3929,16 @@ const Pr = ({
|
|
|
3787
3929
|
const p = (d) => {
|
|
3788
3930
|
const u = d.item.data;
|
|
3789
3931
|
if (u.taskType === "StreamingChatCompletion" && u.eventType === "Text")
|
|
3790
|
-
return /* @__PURE__ */ o(
|
|
3932
|
+
return /* @__PURE__ */ o(oe, { text: u.text });
|
|
3791
3933
|
if (u.taskType === "StructuredChatCompletion" && u.eventType === "Completed")
|
|
3792
|
-
return /* @__PURE__ */ o(
|
|
3934
|
+
return /* @__PURE__ */ o(je, { data: u });
|
|
3793
3935
|
if (u.taskType === "MemoryChat")
|
|
3794
3936
|
switch (u.eventType) {
|
|
3795
3937
|
case "Text":
|
|
3796
|
-
return /* @__PURE__ */ o(
|
|
3938
|
+
return /* @__PURE__ */ o(oe, { text: u.text });
|
|
3797
3939
|
case "FindMemories":
|
|
3798
3940
|
return /* @__PURE__ */ o(
|
|
3799
|
-
|
|
3941
|
+
Xe,
|
|
3800
3942
|
{
|
|
3801
3943
|
data: u,
|
|
3802
3944
|
isLatest: d.isLatest,
|
|
@@ -3806,7 +3948,7 @@ const Pr = ({
|
|
|
3806
3948
|
);
|
|
3807
3949
|
case "FindMemoriesResult":
|
|
3808
3950
|
return /* @__PURE__ */ o(
|
|
3809
|
-
|
|
3951
|
+
Ve,
|
|
3810
3952
|
{
|
|
3811
3953
|
data: u,
|
|
3812
3954
|
t: i
|
|
@@ -3814,7 +3956,7 @@ const Pr = ({
|
|
|
3814
3956
|
);
|
|
3815
3957
|
case "Search":
|
|
3816
3958
|
return /* @__PURE__ */ o(
|
|
3817
|
-
|
|
3959
|
+
Ke,
|
|
3818
3960
|
{
|
|
3819
3961
|
data: u,
|
|
3820
3962
|
isLatest: d.isLatest,
|
|
@@ -3824,7 +3966,7 @@ const Pr = ({
|
|
|
3824
3966
|
);
|
|
3825
3967
|
case "FindSources":
|
|
3826
3968
|
return /* @__PURE__ */ o(
|
|
3827
|
-
|
|
3969
|
+
Ye,
|
|
3828
3970
|
{
|
|
3829
3971
|
data: u,
|
|
3830
3972
|
isLatest: d.isLatest,
|
|
@@ -3834,7 +3976,7 @@ const Pr = ({
|
|
|
3834
3976
|
);
|
|
3835
3977
|
case "SourcesResult":
|
|
3836
3978
|
return /* @__PURE__ */ o(
|
|
3837
|
-
|
|
3979
|
+
Ze,
|
|
3838
3980
|
{
|
|
3839
3981
|
data: u,
|
|
3840
3982
|
onSourceClick: l,
|
|
@@ -3843,7 +3985,7 @@ const Pr = ({
|
|
|
3843
3985
|
);
|
|
3844
3986
|
case "ExploreMemories":
|
|
3845
3987
|
return /* @__PURE__ */ o(
|
|
3846
|
-
|
|
3988
|
+
tr,
|
|
3847
3989
|
{
|
|
3848
3990
|
data: u,
|
|
3849
3991
|
completed: d.completed,
|
|
@@ -3853,7 +3995,7 @@ const Pr = ({
|
|
|
3853
3995
|
);
|
|
3854
3996
|
case "ChunkResults":
|
|
3855
3997
|
return /* @__PURE__ */ o(
|
|
3856
|
-
|
|
3998
|
+
ur,
|
|
3857
3999
|
{
|
|
3858
4000
|
data: u,
|
|
3859
4001
|
onSearchResultClick: a,
|
|
@@ -3862,7 +4004,7 @@ const Pr = ({
|
|
|
3862
4004
|
);
|
|
3863
4005
|
case "GoogleSearch":
|
|
3864
4006
|
return /* @__PURE__ */ o(
|
|
3865
|
-
|
|
4007
|
+
mr,
|
|
3866
4008
|
{
|
|
3867
4009
|
data: u,
|
|
3868
4010
|
isLatest: d.isLatest,
|
|
@@ -3871,10 +4013,10 @@ const Pr = ({
|
|
|
3871
4013
|
}
|
|
3872
4014
|
);
|
|
3873
4015
|
case "GoogleSearchResult":
|
|
3874
|
-
return /* @__PURE__ */ o(
|
|
4016
|
+
return /* @__PURE__ */ o(gr, { data: u, t: i });
|
|
3875
4017
|
case "Scrape":
|
|
3876
4018
|
return /* @__PURE__ */ o(
|
|
3877
|
-
|
|
4019
|
+
hr,
|
|
3878
4020
|
{
|
|
3879
4021
|
data: u,
|
|
3880
4022
|
isLatest: d.isLatest,
|
|
@@ -3883,7 +4025,14 @@ const Pr = ({
|
|
|
3883
4025
|
}
|
|
3884
4026
|
);
|
|
3885
4027
|
case "ScrapeResult":
|
|
3886
|
-
return /* @__PURE__ */ o(
|
|
4028
|
+
return /* @__PURE__ */ o(
|
|
4029
|
+
Tr,
|
|
4030
|
+
{
|
|
4031
|
+
data: u,
|
|
4032
|
+
isLatest: d.isLatest,
|
|
4033
|
+
t: i
|
|
4034
|
+
}
|
|
4035
|
+
);
|
|
3887
4036
|
case "Completed":
|
|
3888
4037
|
return null;
|
|
3889
4038
|
}
|
|
@@ -3891,7 +4040,7 @@ const Pr = ({
|
|
|
3891
4040
|
switch (u.eventType) {
|
|
3892
4041
|
case "GeneratingQueries":
|
|
3893
4042
|
return /* @__PURE__ */ o(
|
|
3894
|
-
|
|
4043
|
+
Dr,
|
|
3895
4044
|
{
|
|
3896
4045
|
data: u,
|
|
3897
4046
|
isLatest: d.isLatest,
|
|
@@ -3901,7 +4050,7 @@ const Pr = ({
|
|
|
3901
4050
|
);
|
|
3902
4051
|
case "ExploreQueries":
|
|
3903
4052
|
return /* @__PURE__ */ o(
|
|
3904
|
-
|
|
4053
|
+
$r,
|
|
3905
4054
|
{
|
|
3906
4055
|
data: u,
|
|
3907
4056
|
isLatest: d.isLatest,
|
|
@@ -3912,7 +4061,7 @@ const Pr = ({
|
|
|
3912
4061
|
);
|
|
3913
4062
|
case "SearchMemoryTypes":
|
|
3914
4063
|
return /* @__PURE__ */ o(
|
|
3915
|
-
|
|
4064
|
+
Er,
|
|
3916
4065
|
{
|
|
3917
4066
|
data: u,
|
|
3918
4067
|
isLatest: d.isLatest,
|
|
@@ -3922,7 +4071,7 @@ const Pr = ({
|
|
|
3922
4071
|
);
|
|
3923
4072
|
case "Completed":
|
|
3924
4073
|
return /* @__PURE__ */ o(
|
|
3925
|
-
|
|
4074
|
+
Hr,
|
|
3926
4075
|
{
|
|
3927
4076
|
data: u,
|
|
3928
4077
|
onSearchResultClick: a,
|
|
@@ -3961,7 +4110,7 @@ const Pr = ({
|
|
|
3961
4110
|
) : !0;
|
|
3962
4111
|
});
|
|
3963
4112
|
return /* @__PURE__ */ y("div", { id: "agent-task-progress-verbose", ref: m, children: [
|
|
3964
|
-
/* @__PURE__ */ o(
|
|
4113
|
+
/* @__PURE__ */ o(Te, { children: c.map((d, u) => /* @__PURE__ */ o(
|
|
3965
4114
|
C.div,
|
|
3966
4115
|
{
|
|
3967
4116
|
id: `agent-task-progress-item-${d.item.progressItemId}`,
|
|
@@ -3978,16 +4127,16 @@ const Pr = ({
|
|
|
3978
4127
|
)) }),
|
|
3979
4128
|
t ? /* @__PURE__ */ o("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ o(j, { message: t.message }) }) : null
|
|
3980
4129
|
] });
|
|
3981
|
-
},
|
|
4130
|
+
}, Jr = ({
|
|
3982
4131
|
agentTask: e,
|
|
3983
4132
|
language: r,
|
|
3984
4133
|
onSourceClick: t,
|
|
3985
4134
|
onSearchResultClick: n,
|
|
3986
4135
|
onExploreQueryResultClick: i
|
|
3987
4136
|
}) => {
|
|
3988
|
-
const l =
|
|
4137
|
+
const l = Ge(e), a = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : r ?? "en", s = Qe(a);
|
|
3989
4138
|
return /* @__PURE__ */ o(
|
|
3990
|
-
|
|
4139
|
+
Ur,
|
|
3991
4140
|
{
|
|
3992
4141
|
progressViewItems: l,
|
|
3993
4142
|
loading: e.loading,
|
|
@@ -4001,11 +4150,11 @@ const Pr = ({
|
|
|
4001
4150
|
);
|
|
4002
4151
|
};
|
|
4003
4152
|
export {
|
|
4004
|
-
|
|
4153
|
+
Jr as AgentTaskProgress,
|
|
4005
4154
|
L as Checkmark,
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4155
|
+
Vr as FencyProvider,
|
|
4156
|
+
Hr as MemorySearchCompletedResults,
|
|
4157
|
+
We as StreamEventManager,
|
|
4158
|
+
O as XMark,
|
|
4159
|
+
Yr as useAgentTasks
|
|
4011
4160
|
};
|