@fencyai/react 0.1.167 → 0.1.169
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/agent-task/AgentTaskProgress.d.ts +1 -6
- package/dist/agent-task/AgentTaskProgress.d.ts.map +1 -1
- package/dist/agent-task/AgentTaskProgressVerbose.d.ts +5 -0
- package/dist/agent-task/AgentTaskProgressVerbose.d.ts.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/hooks/useAgentTasks/index.d.ts.map +1 -1
- package/dist/index.js +1046 -1065
- package/dist/types/CreateAgentTaskParams.d.ts +4 -0
- package/dist/types/CreateAgentTaskParams.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/agent-task/AgentTaskProgressSimple.d.ts +0 -8
- package/dist/agent-task/AgentTaskProgressSimple.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
import { jsxs as p, jsx as o, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { createStream as se, isStreamTimeoutEvent as le, isStreamNotFoundEvent as ce, isAgentTaskProgressItemUpdatedEvent as de, createAgentTask as me } from "@fencyai/js";
|
|
3
|
-
import { createContext as ue, useState as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { createContext as ue, useState as I, useRef as F, useEffect as R, useCallback as N, useContext as ye, useMemo as D } from "react";
|
|
4
|
+
import { motion as w, useInView as ge, AnimatePresence as pe } from "motion/react";
|
|
5
|
+
import he from "react-markdown";
|
|
6
6
|
import { Prism as ne } from "react-syntax-highlighter";
|
|
7
|
-
import
|
|
7
|
+
import fe from "remark-gfm";
|
|
8
8
|
import './assets/index.css';const te = ue(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
|
-
async function
|
|
11
|
+
async function xe(e, n) {
|
|
12
12
|
const t = e.getReader();
|
|
13
|
-
let
|
|
14
|
-
for (; !(
|
|
15
|
-
r
|
|
13
|
+
let r;
|
|
14
|
+
for (; !(r = await t.read()).done; )
|
|
15
|
+
n(r.value);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
return function(
|
|
20
|
-
|
|
21
|
-
const d =
|
|
22
|
-
let
|
|
17
|
+
function Se(e) {
|
|
18
|
+
let n, t, r, s = !1;
|
|
19
|
+
return function(l) {
|
|
20
|
+
n === void 0 ? (n = l, t = 0, r = -1) : n = ke(n, l);
|
|
21
|
+
const d = n.length;
|
|
22
|
+
let y = 0;
|
|
23
23
|
for (; t < d; ) {
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
for (; t < d &&
|
|
27
|
-
switch (
|
|
24
|
+
s && (n[t] === 10 && (y = ++t), s = !1);
|
|
25
|
+
let u = -1;
|
|
26
|
+
for (; t < d && u === -1; ++t)
|
|
27
|
+
switch (n[t]) {
|
|
28
28
|
case 58:
|
|
29
|
-
|
|
29
|
+
r === -1 && (r = t - y);
|
|
30
30
|
break;
|
|
31
31
|
case 13:
|
|
32
|
-
|
|
32
|
+
s = !0;
|
|
33
33
|
case 10:
|
|
34
|
-
|
|
34
|
+
u = t;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (u === -1)
|
|
38
38
|
break;
|
|
39
|
-
e(
|
|
39
|
+
e(n.subarray(y, u), r), y = t, r = -1;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
y === d ? n = void 0 : y !== 0 && (n = n.subarray(y), t -= y);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let
|
|
46
|
-
const
|
|
47
|
-
return function(
|
|
48
|
-
if (
|
|
49
|
-
t == null || t(
|
|
44
|
+
function Te(e, n, t) {
|
|
45
|
+
let r = J();
|
|
46
|
+
const s = new TextDecoder();
|
|
47
|
+
return function(l, d) {
|
|
48
|
+
if (l.length === 0)
|
|
49
|
+
t == null || t(r), r = J();
|
|
50
50
|
else if (d > 0) {
|
|
51
|
-
const
|
|
52
|
-
switch (
|
|
51
|
+
const y = s.decode(l.subarray(0, d)), u = d + (l[d + 1] === 32 ? 2 : 1), i = s.decode(l.subarray(u));
|
|
52
|
+
switch (y) {
|
|
53
53
|
case "data":
|
|
54
|
-
|
|
55
|
-
` +
|
|
54
|
+
r.data = r.data ? r.data + `
|
|
55
|
+
` + i : i;
|
|
56
56
|
break;
|
|
57
57
|
case "event":
|
|
58
|
-
|
|
58
|
+
r.event = i;
|
|
59
59
|
break;
|
|
60
60
|
case "id":
|
|
61
|
-
e(
|
|
61
|
+
e(r.id = i);
|
|
62
62
|
break;
|
|
63
63
|
case "retry":
|
|
64
|
-
const
|
|
65
|
-
isNaN(
|
|
64
|
+
const a = parseInt(i, 10);
|
|
65
|
+
isNaN(a) || n(r.retry = a);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const t = new Uint8Array(e.length +
|
|
73
|
-
return t.set(e), t.set(
|
|
71
|
+
function ke(e, n) {
|
|
72
|
+
const t = new Uint8Array(e.length + n.length);
|
|
73
|
+
return t.set(e), t.set(n, e.length), t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function J() {
|
|
76
76
|
return {
|
|
77
77
|
data: "",
|
|
78
78
|
event: "",
|
|
@@ -80,110 +80,110 @@ function X() {
|
|
|
80
80
|
retry: void 0
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var be = function(e, n) {
|
|
84
84
|
var t = {};
|
|
85
|
-
for (var
|
|
85
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
86
86
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
87
|
-
for (var
|
|
88
|
-
|
|
87
|
+
for (var s = 0, r = Object.getOwnPropertySymbols(e); s < r.length; s++)
|
|
88
|
+
n.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[s]) && (t[r[s]] = e[r[s]]);
|
|
89
89
|
return t;
|
|
90
90
|
};
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
var { signal: t, headers:
|
|
94
|
-
return new Promise((
|
|
95
|
-
const g = Object.assign({},
|
|
96
|
-
g.accept || (g.accept =
|
|
91
|
+
const U = "text/event-stream", ve = 1e3, Y = "last-event-id";
|
|
92
|
+
function Ce(e, n) {
|
|
93
|
+
var { signal: t, headers: r, onopen: s, onmessage: c, onclose: l, onerror: d, openWhenHidden: y, fetch: u } = n, i = be(n, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
|
+
return new Promise((a, m) => {
|
|
95
|
+
const g = Object.assign({}, r);
|
|
96
|
+
g.accept || (g.accept = U);
|
|
97
97
|
let h;
|
|
98
|
-
function
|
|
99
|
-
h.abort(), document.hidden ||
|
|
98
|
+
function f() {
|
|
99
|
+
h.abort(), document.hidden || v();
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
let
|
|
103
|
-
function
|
|
104
|
-
document.removeEventListener("visibilitychange",
|
|
101
|
+
y || document.addEventListener("visibilitychange", f);
|
|
102
|
+
let S = ve, T = 0;
|
|
103
|
+
function k() {
|
|
104
|
+
document.removeEventListener("visibilitychange", f), window.clearTimeout(T), h.abort();
|
|
105
105
|
}
|
|
106
106
|
t == null || t.addEventListener("abort", () => {
|
|
107
|
-
|
|
107
|
+
k(), a();
|
|
108
108
|
});
|
|
109
|
-
const
|
|
110
|
-
async function
|
|
111
|
-
var
|
|
109
|
+
const x = u ?? window.fetch, C = s ?? Ie;
|
|
110
|
+
async function v() {
|
|
111
|
+
var P;
|
|
112
112
|
h = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const
|
|
115
|
-
await
|
|
116
|
-
A ? g[
|
|
114
|
+
const L = await x(e, Object.assign(Object.assign({}, i), { headers: g, signal: h.signal }));
|
|
115
|
+
await C(L), await xe(L.body, Se(Te((A) => {
|
|
116
|
+
A ? g[Y] = A : delete g[Y];
|
|
117
117
|
}, (A) => {
|
|
118
|
-
|
|
119
|
-
}, c))),
|
|
120
|
-
} catch (
|
|
118
|
+
S = A;
|
|
119
|
+
}, c))), l == null || l(), k(), a();
|
|
120
|
+
} catch (L) {
|
|
121
121
|
if (!h.signal.aborted)
|
|
122
122
|
try {
|
|
123
|
-
const A = (
|
|
124
|
-
window.clearTimeout(
|
|
123
|
+
const A = (P = d == null ? void 0 : d(L)) !== null && P !== void 0 ? P : S;
|
|
124
|
+
window.clearTimeout(T), T = window.setTimeout(v, A);
|
|
125
125
|
} catch (A) {
|
|
126
|
-
|
|
126
|
+
k(), m(A);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
v();
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
if (!(
|
|
136
|
-
throw new Error(`Expected content-type to be ${
|
|
133
|
+
function Ie(e) {
|
|
134
|
+
const n = e.headers.get("content-type");
|
|
135
|
+
if (!(n != null && n.startsWith(U)))
|
|
136
|
+
throw new Error(`Expected content-type to be ${U}, Actual: ${n}`);
|
|
137
137
|
}
|
|
138
138
|
function we(e) {
|
|
139
|
-
const
|
|
140
|
-
for (let
|
|
141
|
-
t[
|
|
139
|
+
const n = atob(e), t = new Uint8Array(n.length);
|
|
140
|
+
for (let r = 0; r < n.length; r++)
|
|
141
|
+
t[r] = n.charCodeAt(r);
|
|
142
142
|
return new TextDecoder("utf-8").decode(t);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Ee(e) {
|
|
145
145
|
return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown stream error";
|
|
146
146
|
}
|
|
147
|
-
class
|
|
148
|
-
constructor(
|
|
149
|
-
this.eventSources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.fency =
|
|
147
|
+
class Me {
|
|
148
|
+
constructor(n) {
|
|
149
|
+
this.eventSources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.fency = n;
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
152
|
* Called by FencyProvider when activeStreams changes.
|
|
153
153
|
* Creates new connections and removes old ones.
|
|
154
154
|
*/
|
|
155
|
-
updateStreams(
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
this.eventSources.has(
|
|
155
|
+
updateStreams(n) {
|
|
156
|
+
n.forEach((r) => {
|
|
157
|
+
const s = r.stream.id;
|
|
158
|
+
this.eventSources.has(s) || this.connectStream(r);
|
|
159
159
|
});
|
|
160
|
-
const t = new Set(
|
|
161
|
-
this.eventSources.forEach((
|
|
162
|
-
t.has(
|
|
160
|
+
const t = new Set(n.map((r) => r.stream.id));
|
|
161
|
+
this.eventSources.forEach((r, s) => {
|
|
162
|
+
t.has(s) || (r.abort(), this.eventSources.delete(s));
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
connectStream(
|
|
166
|
-
const t =
|
|
167
|
-
this.eventSources.set(t,
|
|
168
|
-
const
|
|
165
|
+
connectStream(n) {
|
|
166
|
+
const t = n.stream.id, r = new AbortController();
|
|
167
|
+
this.eventSources.set(t, r);
|
|
168
|
+
const s = `${this.fency.baseUrl}/sse/streams/${t}`, c = {
|
|
169
169
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
170
|
-
"X-Fency-Stream-Token":
|
|
170
|
+
"X-Fency-Stream-Token": n.stream.token
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
Ce(s, {
|
|
173
173
|
headers: c,
|
|
174
|
-
signal:
|
|
175
|
-
onopen: async (
|
|
176
|
-
if (!
|
|
177
|
-
throw this.eventSources.delete(t), new Error(`Client error ${
|
|
174
|
+
signal: r.signal,
|
|
175
|
+
onopen: async (l) => {
|
|
176
|
+
if (!l.ok && l.status >= 400 && l.status < 500 && l.status !== 429)
|
|
177
|
+
throw this.eventSources.delete(t), new Error(`Client error ${l.status}`);
|
|
178
178
|
},
|
|
179
|
-
onmessage: (
|
|
180
|
-
if (
|
|
181
|
-
const d = we(
|
|
179
|
+
onmessage: (l) => {
|
|
180
|
+
if (l.data) {
|
|
181
|
+
const d = we(l.data);
|
|
182
182
|
this.broadcast(d, t);
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
|
-
onerror: (
|
|
186
|
-
throw console.error("EventSource error for stream", t, ":",
|
|
185
|
+
onerror: (l) => {
|
|
186
|
+
throw console.error("EventSource error for stream", t, ":", l), this.eventSources.delete(t), this.broadcastError(t, Ee(l)), l;
|
|
187
187
|
},
|
|
188
188
|
onclose() {
|
|
189
189
|
}
|
|
@@ -193,106 +193,106 @@ class Ee {
|
|
|
193
193
|
* Subscribe to events from all active streams.
|
|
194
194
|
* Returns an unsubscribe function.
|
|
195
195
|
*/
|
|
196
|
-
subscribe(
|
|
197
|
-
return this.subscribers.set(
|
|
198
|
-
this.subscribers.delete(
|
|
196
|
+
subscribe(n, t) {
|
|
197
|
+
return this.subscribers.set(n, t), () => {
|
|
198
|
+
this.subscribers.delete(n);
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
|
-
broadcast(
|
|
202
|
-
this.subscribers.forEach((
|
|
203
|
-
|
|
201
|
+
broadcast(n, t) {
|
|
202
|
+
this.subscribers.forEach((r) => {
|
|
203
|
+
r.onMessage(n, t);
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
broadcastError(
|
|
207
|
-
this.subscribers.forEach((
|
|
208
|
-
|
|
206
|
+
broadcastError(n, t) {
|
|
207
|
+
this.subscribers.forEach((r) => {
|
|
208
|
+
r.onError(n, t);
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
212
|
* Cleanup all connections and subscriptions
|
|
213
213
|
*/
|
|
214
214
|
cleanup() {
|
|
215
|
-
this.eventSources.forEach((
|
|
215
|
+
this.eventSources.forEach((n) => n.abort()), this.eventSources.clear(), this.subscribers.clear();
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
return e.filter((t) =>
|
|
218
|
+
const Ae = 48e4, Re = 3e5, Z = (e) => {
|
|
219
|
+
const n = Date.now();
|
|
220
|
+
return e.filter((t) => n - t.createdAt < Ae);
|
|
221
221
|
};
|
|
222
|
-
function
|
|
223
|
-
const [
|
|
222
|
+
function Fr({ fency: e, fetchCreateStreamClientToken: n, children: t }) {
|
|
223
|
+
const [r, s] = I(
|
|
224
224
|
null
|
|
225
|
-
), [c,
|
|
225
|
+
), [c, l] = I(!0), [d, y] = I(null), [u, i] = I([]), a = F(null), m = F(null);
|
|
226
226
|
R(() => {
|
|
227
|
-
e.then((
|
|
228
|
-
|
|
229
|
-
}).catch((
|
|
230
|
-
|
|
227
|
+
e.then((S) => {
|
|
228
|
+
s(S), l(!1);
|
|
229
|
+
}).catch((S) => {
|
|
230
|
+
y(S), l(!1);
|
|
231
231
|
});
|
|
232
232
|
}, [e]), R(() => {
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
|
|
236
|
-
}, [
|
|
237
|
-
var
|
|
238
|
-
(
|
|
233
|
+
r && !m.current && (m.current = new Me(r));
|
|
234
|
+
}, [r]), R(() => {
|
|
235
|
+
m.current && m.current.updateStreams(u);
|
|
236
|
+
}, [u]), R(() => () => {
|
|
237
|
+
var S;
|
|
238
|
+
(S = m.current) == null || S.cleanup();
|
|
239
239
|
}, []), R(() => {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
return
|
|
240
|
+
const S = setInterval(() => {
|
|
241
|
+
i((T) => {
|
|
242
|
+
const k = Z(T);
|
|
243
|
+
return k.length !== T.length ? k : T;
|
|
244
244
|
});
|
|
245
245
|
}, 6e4);
|
|
246
|
-
return () => clearInterval(
|
|
246
|
+
return () => clearInterval(S);
|
|
247
247
|
}, []);
|
|
248
|
-
const g =
|
|
249
|
-
async (
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
254
|
-
return
|
|
255
|
-
const
|
|
256
|
-
if (!
|
|
248
|
+
const g = N(
|
|
249
|
+
async (S = Re) => {
|
|
250
|
+
if (a.current)
|
|
251
|
+
return a.current;
|
|
252
|
+
const T = Date.now(), k = u.length > 0 ? u[u.length - 1] : null;
|
|
253
|
+
if (k && T - k.createdAt < S)
|
|
254
|
+
return k.stream;
|
|
255
|
+
const x = (async () => {
|
|
256
|
+
if (!r)
|
|
257
257
|
throw new Error("Fency instance not initialized");
|
|
258
|
-
const
|
|
259
|
-
pk:
|
|
260
|
-
baseUrl:
|
|
261
|
-
clientToken: (
|
|
258
|
+
const C = await n(), v = await se({
|
|
259
|
+
pk: r.publishableKey,
|
|
260
|
+
baseUrl: r.baseUrl,
|
|
261
|
+
clientToken: (C == null ? void 0 : C.clientToken) ?? ""
|
|
262
262
|
});
|
|
263
|
-
if (
|
|
264
|
-
const
|
|
265
|
-
stream:
|
|
263
|
+
if (v.type === "success") {
|
|
264
|
+
const P = {
|
|
265
|
+
stream: v.stream,
|
|
266
266
|
createdAt: Date.now()
|
|
267
267
|
};
|
|
268
|
-
return
|
|
269
|
-
const A = [...
|
|
270
|
-
return
|
|
271
|
-
}),
|
|
268
|
+
return i((L) => {
|
|
269
|
+
const A = [...L, P];
|
|
270
|
+
return Z(A);
|
|
271
|
+
}), a.current = null, v.stream;
|
|
272
272
|
} else
|
|
273
|
-
throw
|
|
273
|
+
throw a.current = null, new Error("Failed to create stream");
|
|
274
274
|
})();
|
|
275
|
-
return
|
|
275
|
+
return a.current = x, x;
|
|
276
276
|
},
|
|
277
|
-
[
|
|
277
|
+
[r, u]
|
|
278
278
|
);
|
|
279
279
|
if (d)
|
|
280
280
|
return /* @__PURE__ */ p("div", { children: [
|
|
281
281
|
"Fency error: ",
|
|
282
282
|
d.message
|
|
283
283
|
] });
|
|
284
|
-
if (!
|
|
284
|
+
if (!r)
|
|
285
285
|
return null;
|
|
286
|
-
const h =
|
|
287
|
-
fency:
|
|
286
|
+
const h = u.length > 0 ? u[u.length - 1] : null, f = {
|
|
287
|
+
fency: r,
|
|
288
288
|
loading: c,
|
|
289
289
|
error: d,
|
|
290
|
-
activeStreams:
|
|
290
|
+
activeStreams: u,
|
|
291
291
|
latestStream: h,
|
|
292
|
-
eventManager:
|
|
292
|
+
eventManager: m.current,
|
|
293
293
|
getOrCreateStream: g
|
|
294
294
|
};
|
|
295
|
-
return /* @__PURE__ */ o(te.Provider, { value:
|
|
295
|
+
return /* @__PURE__ */ o(te.Provider, { value: f, children: t });
|
|
296
296
|
}
|
|
297
297
|
function oe() {
|
|
298
298
|
const e = ye(te);
|
|
@@ -300,22 +300,22 @@ function oe() {
|
|
|
300
300
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
301
301
|
return e;
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const Fe = (e) => {
|
|
304
304
|
try {
|
|
305
|
-
const
|
|
306
|
-
return
|
|
307
|
-
} catch (
|
|
308
|
-
return console.error("Error parsing message:",
|
|
305
|
+
const n = JSON.parse(e);
|
|
306
|
+
return Pe(n);
|
|
307
|
+
} catch (n) {
|
|
308
|
+
return console.error("Error parsing message:", n), null;
|
|
309
309
|
}
|
|
310
|
-
},
|
|
310
|
+
}, Pe = (e) => le(e) ? De(e) : ce(e) ? Le(e) : de(e) ? ze(e) : null, De = (e) => ({
|
|
311
311
|
type: "STREAM_TIMEOUT",
|
|
312
312
|
streamId: e.streamId,
|
|
313
313
|
timestamp: e.timestamp
|
|
314
|
-
}),
|
|
314
|
+
}), Le = (e) => ({
|
|
315
315
|
type: "STREAM_NOT_FOUND",
|
|
316
316
|
streamId: e.streamId,
|
|
317
317
|
timestamp: e.timestamp
|
|
318
|
-
}),
|
|
318
|
+
}), ze = (e) => ({
|
|
319
319
|
type: "AGENT_TASK_PROGRESS_ITEM_UPDATED",
|
|
320
320
|
streamId: e.streamId,
|
|
321
321
|
agentTaskId: e.agentTaskId,
|
|
@@ -323,140 +323,167 @@ const Re = (e) => {
|
|
|
323
323
|
timestamp: e.timestamp,
|
|
324
324
|
createdAt: e.createdAt,
|
|
325
325
|
data: JSON.parse(e.data)
|
|
326
|
-
}),
|
|
327
|
-
const
|
|
326
|
+
}), Ne = (e) => {
|
|
327
|
+
const n = oe(), [t, r] = I(null), s = F(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
328
328
|
return R(() => {
|
|
329
|
-
if (!
|
|
330
|
-
const
|
|
331
|
-
onMessage: (
|
|
332
|
-
var
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
335
|
-
switch (
|
|
329
|
+
if (!n.eventManager) return;
|
|
330
|
+
const l = {
|
|
331
|
+
onMessage: (y, u) => {
|
|
332
|
+
var a, m, g;
|
|
333
|
+
const i = Fe(y);
|
|
334
|
+
if (i)
|
|
335
|
+
switch (i.type) {
|
|
336
336
|
case "STREAM_TIMEOUT":
|
|
337
|
-
(
|
|
337
|
+
(a = e == null ? void 0 : e.onStreamTimeout) == null || a.call(e, i);
|
|
338
338
|
break;
|
|
339
339
|
case "STREAM_NOT_FOUND":
|
|
340
|
-
(
|
|
340
|
+
(m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, i);
|
|
341
341
|
break;
|
|
342
342
|
case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
|
|
343
|
-
(g = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || g.call(e,
|
|
343
|
+
(g = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || g.call(e, i);
|
|
344
344
|
break;
|
|
345
345
|
}
|
|
346
346
|
},
|
|
347
|
-
onError: (
|
|
348
|
-
var
|
|
349
|
-
(
|
|
350
|
-
streamId:
|
|
347
|
+
onError: (y, u) => {
|
|
348
|
+
var i;
|
|
349
|
+
(i = e == null ? void 0 : e.onStreamError) == null || i.call(e, {
|
|
350
|
+
streamId: y,
|
|
351
351
|
error: {
|
|
352
352
|
code: "UnknownError",
|
|
353
|
-
message:
|
|
353
|
+
message: u ?? "Unknown error in useStream"
|
|
354
354
|
}
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
-
return
|
|
359
|
-
|
|
360
|
-
|
|
358
|
+
return n.eventManager.subscribe(
|
|
359
|
+
s.current,
|
|
360
|
+
l
|
|
361
361
|
);
|
|
362
|
-
}, [
|
|
362
|
+
}, [n.eventManager, e]), {
|
|
363
363
|
createStream: async () => {
|
|
364
364
|
try {
|
|
365
|
-
const
|
|
366
|
-
return
|
|
365
|
+
const l = await n.getOrCreateStream();
|
|
366
|
+
return r(l), {
|
|
367
367
|
type: "success",
|
|
368
|
-
stream:
|
|
368
|
+
stream: l
|
|
369
369
|
};
|
|
370
|
-
} catch (
|
|
370
|
+
} catch (l) {
|
|
371
371
|
return {
|
|
372
372
|
type: "error",
|
|
373
373
|
error: {
|
|
374
374
|
code: "UnknownError",
|
|
375
|
-
message:
|
|
375
|
+
message: l instanceof Error ? l.message : "Failed to create stream"
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
379
|
},
|
|
380
380
|
stream: t
|
|
381
381
|
};
|
|
382
|
-
},
|
|
383
|
-
const
|
|
382
|
+
}, Pr = (e) => {
|
|
383
|
+
const n = oe(), [t, r] = I([]), s = F(/* @__PURE__ */ new Set()), c = F(/* @__PURE__ */ new Map()), l = N(
|
|
384
|
+
(i, a) => {
|
|
385
|
+
r((m) => {
|
|
386
|
+
const g = [], h = m.map((f) => {
|
|
387
|
+
var T;
|
|
388
|
+
if (f.streamId !== i || !f.loading) return f;
|
|
389
|
+
const S = (T = f.confirmedData) == null ? void 0 : T.taskId;
|
|
390
|
+
return S && g.push(S), { ...f, loading: !1, error: a };
|
|
391
|
+
});
|
|
392
|
+
for (const f of g) {
|
|
393
|
+
s.current.delete(f);
|
|
394
|
+
const S = c.current.get(f);
|
|
395
|
+
S && (c.current.delete(f), S({ type: "error", error: a }));
|
|
396
|
+
}
|
|
397
|
+
return h;
|
|
398
|
+
});
|
|
399
|
+
},
|
|
400
|
+
[]
|
|
401
|
+
), { createStream: d } = Ne({
|
|
384
402
|
onAgentTaskProgressItemUpdated: (i) => {
|
|
385
|
-
var
|
|
386
|
-
if (!
|
|
403
|
+
var g;
|
|
404
|
+
if (!s.current.has(i.agentTaskId)) return;
|
|
387
405
|
const a = i.data;
|
|
388
406
|
if (a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed" || a.taskType === "MemoryChat" && a.eventType === "Completed" || a.taskType === "MemorySearch" && a.eventType === "Completed") {
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
var
|
|
393
|
-
if (((
|
|
394
|
-
return
|
|
395
|
-
const
|
|
407
|
+
const h = a.taskType === "MemorySearch" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed";
|
|
408
|
+
r(
|
|
409
|
+
h ? (S) => S.map((T) => {
|
|
410
|
+
var C;
|
|
411
|
+
if (((C = T.confirmedData) == null ? void 0 : C.taskId) !== i.agentTaskId)
|
|
412
|
+
return T;
|
|
413
|
+
const x = T.progressItems.some(
|
|
396
414
|
(v) => v.progressItemId === i.progressItemId
|
|
397
|
-
) ?
|
|
415
|
+
) ? T.progressItems.map(
|
|
398
416
|
(v) => v.progressItemId === i.progressItemId ? i : v
|
|
399
|
-
) : [...
|
|
417
|
+
) : [...T.progressItems, i];
|
|
400
418
|
return {
|
|
401
|
-
...
|
|
402
|
-
progressItems:
|
|
419
|
+
...T,
|
|
420
|
+
progressItems: x,
|
|
403
421
|
loading: !1
|
|
404
422
|
};
|
|
405
|
-
}) : (
|
|
406
|
-
(
|
|
407
|
-
var
|
|
408
|
-
return ((
|
|
423
|
+
}) : (S) => S.map(
|
|
424
|
+
(T) => {
|
|
425
|
+
var k;
|
|
426
|
+
return ((k = T.confirmedData) == null ? void 0 : k.taskId) === i.agentTaskId ? { ...T, loading: !1 } : T;
|
|
409
427
|
}
|
|
410
428
|
)
|
|
411
429
|
);
|
|
412
|
-
const
|
|
430
|
+
const f = c.current.get(
|
|
413
431
|
i.agentTaskId
|
|
414
432
|
);
|
|
415
|
-
|
|
433
|
+
f && (c.current.delete(i.agentTaskId), f({
|
|
434
|
+
type: "success",
|
|
435
|
+
streamId: i.streamId,
|
|
436
|
+
agentTaskId: i.agentTaskId,
|
|
437
|
+
response: a
|
|
438
|
+
}));
|
|
416
439
|
return;
|
|
417
440
|
}
|
|
418
|
-
(
|
|
419
|
-
(
|
|
420
|
-
var
|
|
421
|
-
if (((
|
|
422
|
-
return
|
|
423
|
-
const
|
|
424
|
-
(
|
|
425
|
-
) ?
|
|
426
|
-
(
|
|
427
|
-
) : [...
|
|
428
|
-
return { ...
|
|
441
|
+
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, i), r(
|
|
442
|
+
(h) => h.map((f) => {
|
|
443
|
+
var k;
|
|
444
|
+
if (((k = f.confirmedData) == null ? void 0 : k.taskId) !== i.agentTaskId)
|
|
445
|
+
return f;
|
|
446
|
+
const T = f.progressItems.some(
|
|
447
|
+
(x) => x.progressItemId === i.progressItemId
|
|
448
|
+
) ? f.progressItems.map(
|
|
449
|
+
(x) => x.progressItemId === i.progressItemId ? i : x
|
|
450
|
+
) : [...f.progressItems, i];
|
|
451
|
+
return { ...f, progressItems: T };
|
|
429
452
|
})
|
|
430
453
|
);
|
|
431
454
|
},
|
|
432
455
|
onStreamError: (i) => {
|
|
433
456
|
var a;
|
|
434
|
-
(a = e == null ? void 0 : e.onStreamError) == null || a.call(e, i),
|
|
435
|
-
(u) => u.map((y) => y.streamId !== i.streamId || !y.loading ? y : { ...y, loading: !1, error: i.error })
|
|
436
|
-
);
|
|
457
|
+
(a = e == null ? void 0 : e.onStreamError) == null || a.call(e, i), l(i.streamId, i.error);
|
|
437
458
|
},
|
|
438
459
|
onStreamNotFound: (i) => {
|
|
439
460
|
var a;
|
|
440
|
-
(a = e == null ? void 0 : e.onStreamNotFound) == null || a.call(e, i)
|
|
461
|
+
(a = e == null ? void 0 : e.onStreamNotFound) == null || a.call(e, i), l(i.streamId, {
|
|
462
|
+
code: "StreamNotFound",
|
|
463
|
+
message: "Stream not found"
|
|
464
|
+
});
|
|
441
465
|
},
|
|
442
466
|
onStreamTimeout: (i) => {
|
|
443
467
|
var a;
|
|
444
|
-
(a = e == null ? void 0 : e.onStreamTimeout) == null || a.call(e, i)
|
|
468
|
+
(a = e == null ? void 0 : e.onStreamTimeout) == null || a.call(e, i), l(i.streamId, {
|
|
469
|
+
code: "StreamTimeout",
|
|
470
|
+
message: "Stream timed out"
|
|
471
|
+
});
|
|
445
472
|
}
|
|
446
|
-
}),
|
|
473
|
+
}), y = N(
|
|
447
474
|
async (i, a) => {
|
|
448
|
-
var
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
475
|
+
var f;
|
|
476
|
+
const m = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, g = (a == null ? void 0 : a.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
|
|
477
|
+
if (g === void 0)
|
|
451
478
|
throw new Error(
|
|
452
479
|
"fetchCreateAgentTaskClientToken must be provided either in useAgentTasks props or in createAgentTask options"
|
|
453
480
|
);
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
456
|
-
const
|
|
457
|
-
taskKey:
|
|
458
|
-
streamId:
|
|
459
|
-
triggeredAt:
|
|
481
|
+
const h = await d();
|
|
482
|
+
if (h.type === "success") {
|
|
483
|
+
const S = (/* @__PURE__ */ new Date()).toISOString(), T = {
|
|
484
|
+
taskKey: m,
|
|
485
|
+
streamId: h.stream.id,
|
|
486
|
+
triggeredAt: S,
|
|
460
487
|
confirmedData: null,
|
|
461
488
|
error: null,
|
|
462
489
|
params: i,
|
|
@@ -464,85 +491,88 @@ const Re = (e) => {
|
|
|
464
491
|
loading: !0,
|
|
465
492
|
loadingText: a == null ? void 0 : a.loadingText
|
|
466
493
|
};
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
} :
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
streamId: g.stream.id,
|
|
510
|
-
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
511
|
-
taskId: S.agentTask.id,
|
|
512
|
-
createdAt: S.agentTask.createdAt,
|
|
513
|
-
error: null,
|
|
514
|
-
params: i,
|
|
515
|
-
progressItems: [],
|
|
516
|
-
loading: !0,
|
|
517
|
-
loadingText: a == null ? void 0 : a.loadingText,
|
|
518
|
-
confirmedData: {
|
|
519
|
-
taskId: S.agentTask.id,
|
|
520
|
-
createdAt: S.agentTask.createdAt
|
|
521
|
-
}
|
|
494
|
+
r((k) => [...k, T]), (f = a == null ? void 0 : a.onTaskRegistered) == null || f.call(a, T);
|
|
495
|
+
try {
|
|
496
|
+
const { clientToken: k } = await g(), x = await me({
|
|
497
|
+
pk: n.fency.publishableKey,
|
|
498
|
+
baseUrl: n.fency.baseUrl,
|
|
499
|
+
clientToken: k,
|
|
500
|
+
streamToken: h.stream.token,
|
|
501
|
+
request: {
|
|
502
|
+
streamingChatCompletionTask: i.type === "StreamingChatCompletion" ? {
|
|
503
|
+
messages: i.messages,
|
|
504
|
+
model: i.model,
|
|
505
|
+
...i.temperature !== void 0 ? {
|
|
506
|
+
temperature: i.temperature
|
|
507
|
+
} : {},
|
|
508
|
+
...i.topP !== void 0 ? { topP: i.topP } : {}
|
|
509
|
+
} : void 0,
|
|
510
|
+
structuredChatCompletionTask: i.type === "StructuredChatCompletion" ? {
|
|
511
|
+
messages: i.messages,
|
|
512
|
+
jsonSchema: i.jsonSchema,
|
|
513
|
+
model: i.model,
|
|
514
|
+
...i.temperature !== void 0 ? {
|
|
515
|
+
temperature: i.temperature
|
|
516
|
+
} : {},
|
|
517
|
+
...i.topP !== void 0 ? { topP: i.topP } : {}
|
|
518
|
+
} : void 0,
|
|
519
|
+
memoryChatTask: i.type === "MemoryChat" ? {
|
|
520
|
+
messages: i.messages,
|
|
521
|
+
model: i.model,
|
|
522
|
+
language: i.language ?? "en",
|
|
523
|
+
chunkLimit: i.chunkLimit ?? 10,
|
|
524
|
+
memoryScanLimit: i.memoryScanLimit ?? 3
|
|
525
|
+
} : void 0,
|
|
526
|
+
memorySearchTask: i.type === "MemorySearch" ? {
|
|
527
|
+
query: i.query,
|
|
528
|
+
model: i.model,
|
|
529
|
+
language: i.language ?? "en",
|
|
530
|
+
chunkLimit: i.chunkLimit ?? 10,
|
|
531
|
+
contextExpansion: i.contextExpansion,
|
|
532
|
+
...i.queryExpansion != null ? {
|
|
533
|
+
queryExpansion: i.queryExpansion
|
|
534
|
+
} : {}
|
|
535
|
+
} : void 0
|
|
522
536
|
}
|
|
523
|
-
]);
|
|
524
|
-
const w = await new Promise((v) => {
|
|
525
|
-
c.current.set(
|
|
526
|
-
S.agentTask.id,
|
|
527
|
-
v
|
|
528
|
-
);
|
|
529
537
|
});
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
if (x.type === "success" && x.agentTask)
|
|
539
|
+
return s.current.add(
|
|
540
|
+
x.agentTask.id
|
|
541
|
+
), r((C) => [
|
|
542
|
+
...C.filter((v) => v.taskKey !== m),
|
|
543
|
+
{
|
|
544
|
+
taskKey: m,
|
|
545
|
+
streamId: h.stream.id,
|
|
546
|
+
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
547
|
+
taskId: x.agentTask.id,
|
|
548
|
+
createdAt: x.agentTask.createdAt,
|
|
549
|
+
error: null,
|
|
550
|
+
params: i,
|
|
551
|
+
progressItems: [],
|
|
552
|
+
loading: !0,
|
|
553
|
+
loadingText: a == null ? void 0 : a.loadingText,
|
|
554
|
+
confirmedData: {
|
|
555
|
+
taskId: x.agentTask.id,
|
|
556
|
+
createdAt: x.agentTask.createdAt
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
]), await new Promise(
|
|
560
|
+
(C) => {
|
|
561
|
+
c.current.set(
|
|
562
|
+
x.agentTask.id,
|
|
563
|
+
C
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
);
|
|
567
|
+
if (x.type === "error")
|
|
568
|
+
return r((C) => [
|
|
569
|
+
...C.filter((v) => v.taskKey !== m),
|
|
540
570
|
{
|
|
541
|
-
taskKey:
|
|
571
|
+
taskKey: m,
|
|
542
572
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
543
|
-
streamId:
|
|
573
|
+
streamId: h.stream.id,
|
|
544
574
|
params: i,
|
|
545
|
-
error:
|
|
575
|
+
error: x.error,
|
|
546
576
|
progressItems: [],
|
|
547
577
|
loading: !1,
|
|
548
578
|
loadingText: a == null ? void 0 : a.loadingText,
|
|
@@ -550,20 +580,20 @@ const Re = (e) => {
|
|
|
550
580
|
}
|
|
551
581
|
]), {
|
|
552
582
|
type: "error",
|
|
553
|
-
error:
|
|
583
|
+
error: x.error
|
|
554
584
|
};
|
|
555
585
|
{
|
|
556
|
-
const
|
|
586
|
+
const C = {
|
|
557
587
|
message: "No response received",
|
|
558
588
|
code: "UnknownError"
|
|
559
589
|
};
|
|
560
|
-
return
|
|
561
|
-
...v.filter((
|
|
590
|
+
return r((v) => [
|
|
591
|
+
...v.filter((P) => P.taskKey !== m),
|
|
562
592
|
{
|
|
563
|
-
taskKey:
|
|
593
|
+
taskKey: m,
|
|
564
594
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
565
|
-
streamId:
|
|
566
|
-
error:
|
|
595
|
+
streamId: h.stream.id,
|
|
596
|
+
error: C,
|
|
567
597
|
params: i,
|
|
568
598
|
progressItems: [],
|
|
569
599
|
loading: !1,
|
|
@@ -572,180 +602,70 @@ const Re = (e) => {
|
|
|
572
602
|
}
|
|
573
603
|
]), {
|
|
574
604
|
type: "error",
|
|
575
|
-
error:
|
|
605
|
+
error: C
|
|
576
606
|
};
|
|
577
607
|
}
|
|
608
|
+
} catch (k) {
|
|
609
|
+
const x = {
|
|
610
|
+
code: "UnknownError",
|
|
611
|
+
message: k instanceof Error ? k.message : "Unknown error during agent task creation"
|
|
612
|
+
};
|
|
613
|
+
return r((C) => [
|
|
614
|
+
...C.filter((v) => v.taskKey !== m),
|
|
615
|
+
{
|
|
616
|
+
taskKey: m,
|
|
617
|
+
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
618
|
+
streamId: h.stream.id,
|
|
619
|
+
params: i,
|
|
620
|
+
error: x,
|
|
621
|
+
progressItems: [],
|
|
622
|
+
loading: !1,
|
|
623
|
+
loadingText: a == null ? void 0 : a.loadingText,
|
|
624
|
+
confirmedData: null
|
|
625
|
+
}
|
|
626
|
+
]), {
|
|
627
|
+
type: "error",
|
|
628
|
+
error: x
|
|
629
|
+
};
|
|
578
630
|
}
|
|
579
631
|
} else
|
|
580
|
-
return console.error(
|
|
632
|
+
return console.error(h.error), h;
|
|
581
633
|
},
|
|
582
|
-
[
|
|
583
|
-
|
|
634
|
+
[
|
|
635
|
+
n,
|
|
636
|
+
d,
|
|
637
|
+
e.fetchCreateAgentTaskClientToken,
|
|
638
|
+
l
|
|
639
|
+
]
|
|
640
|
+
), u = D(() => {
|
|
584
641
|
if (t.length !== 0)
|
|
585
642
|
return [...t].sort((i, a) => new Date(a.triggeredAt).getTime() - new Date(i.triggeredAt).getTime())[0];
|
|
586
643
|
}, [t]);
|
|
587
644
|
return R(() => () => {
|
|
588
|
-
|
|
645
|
+
s.current.clear(), c.current.clear();
|
|
589
646
|
}, []), {
|
|
590
647
|
agentTasks: t,
|
|
591
|
-
createAgentTask:
|
|
592
|
-
latest:
|
|
648
|
+
createAgentTask: y,
|
|
649
|
+
latest: u
|
|
593
650
|
};
|
|
594
651
|
};
|
|
595
|
-
function
|
|
596
|
-
return e.progressItems.map((
|
|
597
|
-
const
|
|
652
|
+
function Oe(e) {
|
|
653
|
+
return e.progressItems.map((n, t) => {
|
|
654
|
+
const r = e.progressItems[t + 1], s = r != null;
|
|
598
655
|
let c;
|
|
599
|
-
if (
|
|
600
|
-
const
|
|
601
|
-
c = Math.round((d -
|
|
656
|
+
if (r != null && r.createdAt) {
|
|
657
|
+
const l = new Date(n.createdAt).getTime(), d = new Date(r.createdAt).getTime();
|
|
658
|
+
c = Math.round((d - l) / 1e3);
|
|
602
659
|
}
|
|
603
660
|
return {
|
|
604
|
-
item:
|
|
605
|
-
completed:
|
|
661
|
+
item: n,
|
|
662
|
+
completed: s,
|
|
606
663
|
isLatest: t === e.progressItems.length - 1,
|
|
607
664
|
durationSeconds: c
|
|
608
665
|
};
|
|
609
666
|
});
|
|
610
667
|
}
|
|
611
|
-
|
|
612
|
-
text: e,
|
|
613
|
-
duration: r = 2,
|
|
614
|
-
delay: t = 0,
|
|
615
|
-
repeat: n = !0,
|
|
616
|
-
repeatDelay: l = 0.5,
|
|
617
|
-
className: c,
|
|
618
|
-
startOnView: s = !1,
|
|
619
|
-
once: d = !1,
|
|
620
|
-
inViewMargin: m,
|
|
621
|
-
spread: i = 2,
|
|
622
|
-
color: a = "#999",
|
|
623
|
-
shimmerColor: u = "#000",
|
|
624
|
-
direction: y = "fromBottom"
|
|
625
|
-
}) {
|
|
626
|
-
const g = F(null), h = pe(g, { once: d, margin: m }), k = P(() => e.length * i, [e, i]), f = !s || h, x = y === "fromBottom" ? "100% center" : "-100% center", S = y === "fromBottom" ? "0% center" : "200% center";
|
|
627
|
-
return /* @__PURE__ */ o(
|
|
628
|
-
b.span,
|
|
629
|
-
{
|
|
630
|
-
ref: g,
|
|
631
|
-
className: c,
|
|
632
|
-
style: {
|
|
633
|
-
position: "relative",
|
|
634
|
-
display: "inline-block",
|
|
635
|
-
backgroundSize: "250% 100%, auto",
|
|
636
|
-
backgroundClip: "text",
|
|
637
|
-
WebkitBackgroundClip: "text",
|
|
638
|
-
color: "transparent",
|
|
639
|
-
WebkitTextFillColor: "transparent",
|
|
640
|
-
backgroundRepeat: "no-repeat, padding-box",
|
|
641
|
-
"--spread": `${k}px`,
|
|
642
|
-
"--base-color": a,
|
|
643
|
-
"--shimmer-color": u,
|
|
644
|
-
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
645
|
-
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
646
|
-
},
|
|
647
|
-
initial: {
|
|
648
|
-
backgroundPosition: x,
|
|
649
|
-
opacity: 0
|
|
650
|
-
},
|
|
651
|
-
animate: f ? {
|
|
652
|
-
backgroundPosition: S,
|
|
653
|
-
opacity: 1
|
|
654
|
-
} : {},
|
|
655
|
-
transition: {
|
|
656
|
-
backgroundPosition: {
|
|
657
|
-
repeat: n ? 1 / 0 : 0,
|
|
658
|
-
duration: r,
|
|
659
|
-
delay: t,
|
|
660
|
-
repeatDelay: l,
|
|
661
|
-
ease: "linear"
|
|
662
|
-
},
|
|
663
|
-
opacity: {
|
|
664
|
-
duration: 0.3,
|
|
665
|
-
delay: t
|
|
666
|
-
}
|
|
667
|
-
},
|
|
668
|
-
children: e
|
|
669
|
-
}
|
|
670
|
-
);
|
|
671
|
-
}
|
|
672
|
-
function Oe(e, r) {
|
|
673
|
-
const t = e.item.data;
|
|
674
|
-
if (t.eventType === "Error" && "message" in t)
|
|
675
|
-
return r.error;
|
|
676
|
-
if (t.taskType === "StreamingChatCompletion") {
|
|
677
|
-
if (t.eventType === "Text") return r.streaming;
|
|
678
|
-
if (t.eventType === "Completed") return r.completed;
|
|
679
|
-
}
|
|
680
|
-
if (t.taskType === "StructuredChatCompletion" && t.eventType === "Completed")
|
|
681
|
-
return r.completed;
|
|
682
|
-
if (t.taskType === "MemorySearch")
|
|
683
|
-
switch (t.eventType) {
|
|
684
|
-
case "GeneratingQueries":
|
|
685
|
-
return r.memorySearchGeneratingQueries;
|
|
686
|
-
case "ExploreQueries":
|
|
687
|
-
return r.memorySearchExploringQueries;
|
|
688
|
-
case "SearchMemoryTypes":
|
|
689
|
-
return r.searchingMemoryTypes;
|
|
690
|
-
case "Completed":
|
|
691
|
-
return r.completed;
|
|
692
|
-
}
|
|
693
|
-
if (t.taskType === "MemoryChat")
|
|
694
|
-
switch (t.eventType) {
|
|
695
|
-
case "Text":
|
|
696
|
-
return r.streaming;
|
|
697
|
-
case "Search":
|
|
698
|
-
return r.searching;
|
|
699
|
-
case "FindMemories":
|
|
700
|
-
return e.completed ? r.memoriesFound : r.findingMemories;
|
|
701
|
-
case "FindMemoriesResult":
|
|
702
|
-
return r.memoriesFound;
|
|
703
|
-
case "FindSources":
|
|
704
|
-
return r.addingSources;
|
|
705
|
-
case "SourcesResult":
|
|
706
|
-
return r.sourcesAdded;
|
|
707
|
-
case "ExploreMemories":
|
|
708
|
-
return e.completed ? r.memoriesExplored : r.exploringMemories;
|
|
709
|
-
case "ChunkResults":
|
|
710
|
-
return r.chunksRetrieved;
|
|
711
|
-
case "Completed":
|
|
712
|
-
return r.completed;
|
|
713
|
-
}
|
|
714
|
-
return r.processing;
|
|
715
|
-
}
|
|
716
|
-
const Be = ({ progressViewItems: e, t: r }) => {
|
|
717
|
-
const t = e[e.length - 1];
|
|
718
|
-
if (!t) return null;
|
|
719
|
-
const n = Oe(t, r);
|
|
720
|
-
return /* @__PURE__ */ o("div", { className: "simple-mode-container", children: /* @__PURE__ */ o(re, { mode: "wait", children: /* @__PURE__ */ o(
|
|
721
|
-
b.div,
|
|
722
|
-
{
|
|
723
|
-
initial: { opacity: 0, y: 10 },
|
|
724
|
-
animate: { opacity: 1, y: 0 },
|
|
725
|
-
exit: { opacity: 0, y: -10 },
|
|
726
|
-
transition: { duration: 0.3 },
|
|
727
|
-
children: t.completed ? /* @__PURE__ */ o(
|
|
728
|
-
"div",
|
|
729
|
-
{
|
|
730
|
-
className: "simple-mode-title",
|
|
731
|
-
style: { color: "#666" },
|
|
732
|
-
children: n
|
|
733
|
-
}
|
|
734
|
-
) : /* @__PURE__ */ o(
|
|
735
|
-
I,
|
|
736
|
-
{
|
|
737
|
-
text: n,
|
|
738
|
-
className: "simple-mode-title",
|
|
739
|
-
duration: 2.5,
|
|
740
|
-
repeat: !0,
|
|
741
|
-
color: "#999",
|
|
742
|
-
shimmerColor: "#000"
|
|
743
|
-
}
|
|
744
|
-
)
|
|
745
|
-
},
|
|
746
|
-
t.item.progressItemId
|
|
747
|
-
) }) });
|
|
748
|
-
}, ie = {
|
|
668
|
+
const ie = {
|
|
749
669
|
'code[class*="language-"]': {
|
|
750
670
|
color: "#f8f8f2",
|
|
751
671
|
background: "none",
|
|
@@ -896,57 +816,57 @@ const Be = ({ progressViewItems: e, t: r }) => {
|
|
|
896
816
|
italic: {
|
|
897
817
|
fontStyle: "italic"
|
|
898
818
|
}
|
|
899
|
-
},
|
|
819
|
+
}, ee = ({
|
|
900
820
|
text: e
|
|
901
821
|
}) => /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
|
|
902
|
-
|
|
822
|
+
w.div,
|
|
903
823
|
{
|
|
904
824
|
className: "fency-markdown-body-raw",
|
|
905
825
|
initial: { opacity: 0, y: -10 },
|
|
906
826
|
animate: { opacity: 1, y: 0 },
|
|
907
827
|
transition: { duration: 0.3, delay: 0 },
|
|
908
828
|
children: /* @__PURE__ */ o(
|
|
909
|
-
|
|
829
|
+
he,
|
|
910
830
|
{
|
|
911
|
-
remarkPlugins: [
|
|
831
|
+
remarkPlugins: [fe],
|
|
912
832
|
components: {
|
|
913
|
-
code(
|
|
914
|
-
const { children: t, className:
|
|
833
|
+
code(n) {
|
|
834
|
+
const { children: t, className: r, node: s, ref: c, ...l } = n, d = /language-(\w+)/.exec(r || "");
|
|
915
835
|
return d ? (
|
|
916
836
|
// @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
|
|
917
837
|
/* @__PURE__ */ o(
|
|
918
838
|
ne,
|
|
919
839
|
{
|
|
920
|
-
...
|
|
840
|
+
...l,
|
|
921
841
|
PreTag: "div",
|
|
922
842
|
children: String(t).replace(/\n$/, ""),
|
|
923
843
|
language: d[1],
|
|
924
844
|
style: ie
|
|
925
845
|
}
|
|
926
846
|
)
|
|
927
|
-
) : /* @__PURE__ */ o("code", { ...
|
|
847
|
+
) : /* @__PURE__ */ o("code", { ...l, className: r, children: String(t) });
|
|
928
848
|
}
|
|
929
849
|
},
|
|
930
850
|
children: e
|
|
931
851
|
}
|
|
932
852
|
)
|
|
933
853
|
}
|
|
934
|
-
) }),
|
|
935
|
-
const
|
|
854
|
+
) }), Be = ({ data: e }) => {
|
|
855
|
+
const n = JSON.stringify(
|
|
936
856
|
JSON.parse(e.response.jsonResponse),
|
|
937
857
|
null,
|
|
938
858
|
2
|
|
939
859
|
);
|
|
940
860
|
return /* @__PURE__ */ o("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ o(
|
|
941
|
-
|
|
861
|
+
w.div,
|
|
942
862
|
{
|
|
943
863
|
initial: { opacity: 0, y: -10 },
|
|
944
864
|
animate: { opacity: 1, y: 0 },
|
|
945
865
|
transition: { duration: 0.3, delay: 0 },
|
|
946
|
-
children: /* @__PURE__ */ o(ne, { language: "json", style: ie, PreTag: "div", children:
|
|
866
|
+
children: /* @__PURE__ */ o(ne, { language: "json", style: ie, PreTag: "div", children: n })
|
|
947
867
|
}
|
|
948
868
|
) });
|
|
949
|
-
},
|
|
869
|
+
}, We = {
|
|
950
870
|
en: {
|
|
951
871
|
error: "Error",
|
|
952
872
|
streaming: "Streaming...",
|
|
@@ -1070,56 +990,117 @@ const Be = ({ progressViewItems: e, t: r }) => {
|
|
|
1070
990
|
memoryChatChunkResultsInOneMemory: "i 1 minne"
|
|
1071
991
|
}
|
|
1072
992
|
};
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
993
|
+
function $e(e) {
|
|
994
|
+
return We[e];
|
|
1075
995
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return Object.entries(
|
|
1078
|
-
(t, [
|
|
996
|
+
function b(e, n) {
|
|
997
|
+
return Object.entries(n).reduce(
|
|
998
|
+
(t, [r, s]) => t.replace(`{${r}}`, String(s)),
|
|
1079
999
|
e
|
|
1080
1000
|
);
|
|
1081
1001
|
}
|
|
1082
|
-
function Q(e,
|
|
1083
|
-
const t = e.map((
|
|
1084
|
-
if (
|
|
1085
|
-
const
|
|
1086
|
-
return t.length > 0 ? `${t.join(", ")} ${
|
|
1002
|
+
function Q(e, n) {
|
|
1003
|
+
const t = e.map((r) => `'${r}'`);
|
|
1004
|
+
if (n != null && t.length >= 2) {
|
|
1005
|
+
const r = t.pop();
|
|
1006
|
+
return t.length > 0 ? `${t.join(", ")} ${n} ${r}` : r;
|
|
1087
1007
|
}
|
|
1088
1008
|
return t.join(", ");
|
|
1089
1009
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1010
|
+
function M({
|
|
1011
|
+
text: e,
|
|
1012
|
+
duration: n = 2,
|
|
1013
|
+
delay: t = 0,
|
|
1014
|
+
repeat: r = !0,
|
|
1015
|
+
repeatDelay: s = 0.5,
|
|
1016
|
+
className: c,
|
|
1017
|
+
startOnView: l = !1,
|
|
1018
|
+
once: d = !1,
|
|
1019
|
+
inViewMargin: y,
|
|
1020
|
+
spread: u = 2,
|
|
1021
|
+
color: i = "#999",
|
|
1022
|
+
shimmerColor: a = "#000",
|
|
1023
|
+
direction: m = "fromBottom"
|
|
1024
|
+
}) {
|
|
1025
|
+
const g = F(null), h = ge(g, { once: d, margin: y }), f = D(() => e.length * u, [e, u]), S = !l || h, T = m === "fromBottom" ? "100% center" : "-100% center", k = m === "fromBottom" ? "0% center" : "200% center";
|
|
1026
|
+
return /* @__PURE__ */ o(
|
|
1027
|
+
w.span,
|
|
1028
|
+
{
|
|
1029
|
+
ref: g,
|
|
1030
|
+
className: c,
|
|
1031
|
+
style: {
|
|
1032
|
+
position: "relative",
|
|
1033
|
+
display: "inline-block",
|
|
1034
|
+
backgroundSize: "250% 100%, auto",
|
|
1035
|
+
backgroundClip: "text",
|
|
1036
|
+
WebkitBackgroundClip: "text",
|
|
1037
|
+
color: "transparent",
|
|
1038
|
+
WebkitTextFillColor: "transparent",
|
|
1039
|
+
backgroundRepeat: "no-repeat, padding-box",
|
|
1040
|
+
"--spread": `${f}px`,
|
|
1041
|
+
"--base-color": i,
|
|
1042
|
+
"--shimmer-color": a,
|
|
1043
|
+
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
1044
|
+
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
1045
|
+
},
|
|
1046
|
+
initial: {
|
|
1047
|
+
backgroundPosition: T,
|
|
1048
|
+
opacity: 0
|
|
1049
|
+
},
|
|
1050
|
+
animate: S ? {
|
|
1051
|
+
backgroundPosition: k,
|
|
1052
|
+
opacity: 1
|
|
1053
|
+
} : {},
|
|
1054
|
+
transition: {
|
|
1055
|
+
backgroundPosition: {
|
|
1056
|
+
repeat: r ? 1 / 0 : 0,
|
|
1057
|
+
duration: n,
|
|
1058
|
+
delay: t,
|
|
1059
|
+
repeatDelay: s,
|
|
1060
|
+
ease: "linear"
|
|
1061
|
+
},
|
|
1062
|
+
opacity: {
|
|
1063
|
+
duration: 0.3,
|
|
1064
|
+
delay: t
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
children: e
|
|
1068
|
+
}
|
|
1069
|
+
);
|
|
1070
|
+
}
|
|
1071
|
+
const $ = 5, He = ({ data: e, isLatest: n = !1, durationSeconds: t, t: r }) => {
|
|
1072
|
+
const [s, c] = I(!1), d = (e.memories ?? []).map((S) => S.memoryTitle), y = d.length > 0, u = y && d.length > $, i = u && !s ? d.slice(0, $) : d, a = d.length - $, m = !u || s, g = `${r.searchingFor}'${e.queryDescription}'`, h = y ? `${r.searchingIn}${Q(
|
|
1073
|
+
i,
|
|
1074
|
+
m ? r.and : void 0
|
|
1075
|
+
)}` : "", f = y ? `${g}${h}` : `${r.searchingPrefix}${e.queryDescription}`;
|
|
1095
1076
|
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1096
1077
|
/* @__PURE__ */ o(
|
|
1097
|
-
|
|
1078
|
+
w.div,
|
|
1098
1079
|
{
|
|
1099
1080
|
style: { color: "#666" },
|
|
1100
1081
|
initial: { opacity: 0, y: -10 },
|
|
1101
1082
|
animate: { opacity: 1, y: 0 },
|
|
1102
1083
|
transition: { duration: 0.3, delay: 0 },
|
|
1103
|
-
children:
|
|
1104
|
-
|
|
1084
|
+
children: n && !t && !u ? /* @__PURE__ */ o(
|
|
1085
|
+
M,
|
|
1105
1086
|
{
|
|
1106
|
-
text:
|
|
1087
|
+
text: f,
|
|
1107
1088
|
duration: 2.5,
|
|
1108
1089
|
repeat: !0,
|
|
1109
1090
|
color: "#999",
|
|
1110
1091
|
shimmerColor: "#000"
|
|
1111
1092
|
}
|
|
1112
1093
|
) : /* @__PURE__ */ p(E, { children: [
|
|
1113
|
-
/* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1114
|
-
|
|
1094
|
+
/* @__PURE__ */ o("span", { style: { color: "#666" }, children: y ? /* @__PURE__ */ p(E, { children: [
|
|
1095
|
+
r.searchingFor,
|
|
1115
1096
|
/* @__PURE__ */ p("span", { style: { fontWeight: 600 }, children: [
|
|
1116
1097
|
"'",
|
|
1117
1098
|
e.queryDescription,
|
|
1118
1099
|
"'"
|
|
1119
1100
|
] }),
|
|
1120
1101
|
h
|
|
1121
|
-
] }) : `${
|
|
1122
|
-
|
|
1102
|
+
] }) : `${r.searchingPrefix}${e.queryDescription}` }),
|
|
1103
|
+
u && !s && /* @__PURE__ */ p(E, { children: [
|
|
1123
1104
|
" ",
|
|
1124
1105
|
/* @__PURE__ */ o(
|
|
1125
1106
|
"button",
|
|
@@ -1137,13 +1118,13 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1137
1118
|
textDecoration: "underline",
|
|
1138
1119
|
fontFamily: "inherit"
|
|
1139
1120
|
},
|
|
1140
|
-
children:
|
|
1141
|
-
n:
|
|
1121
|
+
children: b(r.moreMemories, {
|
|
1122
|
+
n: a
|
|
1142
1123
|
})
|
|
1143
1124
|
}
|
|
1144
1125
|
)
|
|
1145
1126
|
] }),
|
|
1146
|
-
|
|
1127
|
+
u && s && /* @__PURE__ */ p(E, { children: [
|
|
1147
1128
|
" ",
|
|
1148
1129
|
/* @__PURE__ */ o(
|
|
1149
1130
|
"button",
|
|
@@ -1161,7 +1142,7 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1161
1142
|
textDecoration: "underline",
|
|
1162
1143
|
fontFamily: "inherit"
|
|
1163
1144
|
},
|
|
1164
|
-
children:
|
|
1145
|
+
children: r.clickToCollapse
|
|
1165
1146
|
}
|
|
1166
1147
|
)
|
|
1167
1148
|
] })
|
|
@@ -1177,18 +1158,18 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1177
1158
|
marginTop: "4px",
|
|
1178
1159
|
fontStyle: "italic"
|
|
1179
1160
|
},
|
|
1180
|
-
children:
|
|
1161
|
+
children: b(r.tookSeconds, { n: t })
|
|
1181
1162
|
}
|
|
1182
1163
|
)
|
|
1183
1164
|
] });
|
|
1184
|
-
}, H = 5,
|
|
1185
|
-
const [
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
)}` :
|
|
1165
|
+
}, H = 5, _e = ({ data: e, isLatest: n = !1, durationSeconds: t, t: r }) => {
|
|
1166
|
+
const [s, c] = I(!1), l = e.titles, d = l.length > 0, y = d && l.length > H, u = y && !s ? l.slice(0, H) : l, i = l.length - H, a = !y || s, m = d ? `${r.findingMemoriesIn}${Q(
|
|
1167
|
+
u,
|
|
1168
|
+
a ? r.and : void 0
|
|
1169
|
+
)}` : r.findingMemories;
|
|
1189
1170
|
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1190
1171
|
/* @__PURE__ */ o(
|
|
1191
|
-
|
|
1172
|
+
w.div,
|
|
1192
1173
|
{
|
|
1193
1174
|
style: {
|
|
1194
1175
|
color: "#666"
|
|
@@ -1196,18 +1177,18 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1196
1177
|
initial: { opacity: 0, y: -10 },
|
|
1197
1178
|
animate: { opacity: 1, y: 0 },
|
|
1198
1179
|
transition: { duration: 0.3, delay: 0 },
|
|
1199
|
-
children:
|
|
1200
|
-
|
|
1180
|
+
children: n && !t && !y ? /* @__PURE__ */ o(
|
|
1181
|
+
M,
|
|
1201
1182
|
{
|
|
1202
|
-
text:
|
|
1183
|
+
text: m,
|
|
1203
1184
|
duration: 2.5,
|
|
1204
1185
|
repeat: !0,
|
|
1205
1186
|
color: "#999",
|
|
1206
1187
|
shimmerColor: "#000"
|
|
1207
1188
|
}
|
|
1208
1189
|
) : /* @__PURE__ */ p(E, { children: [
|
|
1209
|
-
/* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1210
|
-
|
|
1190
|
+
/* @__PURE__ */ o("span", { style: { color: "#666" }, children: m }),
|
|
1191
|
+
y && !s && /* @__PURE__ */ p(E, { children: [
|
|
1211
1192
|
" ",
|
|
1212
1193
|
/* @__PURE__ */ o(
|
|
1213
1194
|
"button",
|
|
@@ -1225,13 +1206,13 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1225
1206
|
textDecoration: "underline",
|
|
1226
1207
|
fontFamily: "inherit"
|
|
1227
1208
|
},
|
|
1228
|
-
children:
|
|
1229
|
-
n:
|
|
1209
|
+
children: b(r.moreMemories, {
|
|
1210
|
+
n: i
|
|
1230
1211
|
})
|
|
1231
1212
|
}
|
|
1232
1213
|
)
|
|
1233
1214
|
] }),
|
|
1234
|
-
|
|
1215
|
+
y && s && /* @__PURE__ */ p(E, { children: [
|
|
1235
1216
|
" ",
|
|
1236
1217
|
/* @__PURE__ */ o(
|
|
1237
1218
|
"button",
|
|
@@ -1249,7 +1230,7 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1249
1230
|
textDecoration: "underline",
|
|
1250
1231
|
fontFamily: "inherit"
|
|
1251
1232
|
},
|
|
1252
|
-
children:
|
|
1233
|
+
children: r.clickToCollapse
|
|
1253
1234
|
}
|
|
1254
1235
|
)
|
|
1255
1236
|
] })
|
|
@@ -1265,31 +1246,31 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1265
1246
|
marginTop: "4px",
|
|
1266
1247
|
fontStyle: "italic"
|
|
1267
1248
|
},
|
|
1268
|
-
children:
|
|
1249
|
+
children: b(r.tookSeconds, { n: t })
|
|
1269
1250
|
}
|
|
1270
1251
|
)
|
|
1271
1252
|
] });
|
|
1272
|
-
}, _ = 5,
|
|
1273
|
-
const [t,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
)}` :
|
|
1253
|
+
}, _ = 5, Ge = ({ data: e, t: n }) => {
|
|
1254
|
+
const [t, r] = I(!1), c = e.memories.map((g) => g.memoryTitle), l = c.length > 0, d = l && c.length > _, y = d && !t ? c.slice(0, _) : c, u = c.length - _, i = !d || t, a = c.length === 1 ? n.memoryFound : n.memoriesFoundPrefix, m = l ? `${a}${Q(
|
|
1255
|
+
y,
|
|
1256
|
+
i ? n.and : void 0
|
|
1257
|
+
)}` : n.memoriesFound;
|
|
1277
1258
|
return /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
|
|
1278
|
-
|
|
1259
|
+
w.div,
|
|
1279
1260
|
{
|
|
1280
1261
|
style: { color: "#666" },
|
|
1281
1262
|
initial: { opacity: 0, y: -10 },
|
|
1282
1263
|
animate: { opacity: 1, y: 0 },
|
|
1283
1264
|
transition: { duration: 0.3, delay: 0 },
|
|
1284
1265
|
children: /* @__PURE__ */ p(E, { children: [
|
|
1285
|
-
/* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1266
|
+
/* @__PURE__ */ o("span", { style: { color: "#666" }, children: m }),
|
|
1286
1267
|
d && !t && /* @__PURE__ */ p(E, { children: [
|
|
1287
1268
|
" ",
|
|
1288
1269
|
/* @__PURE__ */ o(
|
|
1289
1270
|
"button",
|
|
1290
1271
|
{
|
|
1291
1272
|
type: "button",
|
|
1292
|
-
onClick: () =>
|
|
1273
|
+
onClick: () => r(!0),
|
|
1293
1274
|
style: {
|
|
1294
1275
|
background: "none",
|
|
1295
1276
|
border: "none",
|
|
@@ -1301,8 +1282,8 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1301
1282
|
textDecoration: "underline",
|
|
1302
1283
|
fontFamily: "inherit"
|
|
1303
1284
|
},
|
|
1304
|
-
children:
|
|
1305
|
-
n:
|
|
1285
|
+
children: b(n.moreMemories, {
|
|
1286
|
+
n: u
|
|
1306
1287
|
})
|
|
1307
1288
|
}
|
|
1308
1289
|
)
|
|
@@ -1313,7 +1294,7 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1313
1294
|
"button",
|
|
1314
1295
|
{
|
|
1315
1296
|
type: "button",
|
|
1316
|
-
onClick: () =>
|
|
1297
|
+
onClick: () => r(!1),
|
|
1317
1298
|
style: {
|
|
1318
1299
|
background: "none",
|
|
1319
1300
|
border: "none",
|
|
@@ -1325,18 +1306,18 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1325
1306
|
textDecoration: "underline",
|
|
1326
1307
|
fontFamily: "inherit"
|
|
1327
1308
|
},
|
|
1328
|
-
children:
|
|
1309
|
+
children: n.clickToCollapse
|
|
1329
1310
|
}
|
|
1330
1311
|
)
|
|
1331
1312
|
] })
|
|
1332
1313
|
] })
|
|
1333
1314
|
}
|
|
1334
1315
|
) });
|
|
1335
|
-
}, Ue = ({ isLatest: e = !1, durationSeconds:
|
|
1336
|
-
const
|
|
1316
|
+
}, Ue = ({ isLatest: e = !1, durationSeconds: n, t }) => {
|
|
1317
|
+
const r = t.addingSources;
|
|
1337
1318
|
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1338
1319
|
/* @__PURE__ */ o(
|
|
1339
|
-
|
|
1320
|
+
w.div,
|
|
1340
1321
|
{
|
|
1341
1322
|
style: {
|
|
1342
1323
|
display: "flex",
|
|
@@ -1347,19 +1328,19 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1347
1328
|
initial: { opacity: 0, y: -10 },
|
|
1348
1329
|
animate: { opacity: 1, y: 0 },
|
|
1349
1330
|
transition: { duration: 0.3, delay: 0 },
|
|
1350
|
-
children: e && !
|
|
1351
|
-
|
|
1331
|
+
children: e && !n ? /* @__PURE__ */ o(
|
|
1332
|
+
M,
|
|
1352
1333
|
{
|
|
1353
|
-
text:
|
|
1334
|
+
text: r,
|
|
1354
1335
|
duration: 2.5,
|
|
1355
1336
|
repeat: !0,
|
|
1356
1337
|
color: "#999",
|
|
1357
1338
|
shimmerColor: "#000"
|
|
1358
1339
|
}
|
|
1359
|
-
) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children:
|
|
1340
|
+
) : /* @__PURE__ */ o("span", { style: { color: "#666" }, children: r })
|
|
1360
1341
|
}
|
|
1361
1342
|
),
|
|
1362
|
-
|
|
1343
|
+
n !== void 0 && /* @__PURE__ */ o(
|
|
1363
1344
|
"div",
|
|
1364
1345
|
{
|
|
1365
1346
|
style: {
|
|
@@ -1368,28 +1349,28 @@ const $ = 5, _e = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
1368
1349
|
marginTop: "4px",
|
|
1369
1350
|
fontStyle: "italic"
|
|
1370
1351
|
},
|
|
1371
|
-
children:
|
|
1352
|
+
children: b(t.tookSeconds, { n })
|
|
1372
1353
|
}
|
|
1373
1354
|
)
|
|
1374
1355
|
] });
|
|
1375
1356
|
};
|
|
1376
|
-
function
|
|
1357
|
+
function Qe(e, n) {
|
|
1377
1358
|
if (e.length === 0) return "";
|
|
1378
1359
|
if (e.length === 1)
|
|
1379
|
-
return
|
|
1360
|
+
return b(n.pageSingle, { n: e[0] });
|
|
1380
1361
|
if (e.length === 2)
|
|
1381
|
-
return
|
|
1362
|
+
return b(n.pageTwo, {
|
|
1382
1363
|
a: e[0],
|
|
1383
1364
|
b: e[1]
|
|
1384
1365
|
});
|
|
1385
|
-
const t = e[e.length - 1],
|
|
1386
|
-
return
|
|
1366
|
+
const t = e[e.length - 1], r = e.slice(0, -1).join(", ");
|
|
1367
|
+
return b(n.pageMultiple, { list: r, n: t });
|
|
1387
1368
|
}
|
|
1388
|
-
const
|
|
1389
|
-
const [
|
|
1369
|
+
const je = ({ data: e, onSourceClick: n, t }) => {
|
|
1370
|
+
const [r, s] = I(null);
|
|
1390
1371
|
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1391
1372
|
/* @__PURE__ */ o(
|
|
1392
|
-
|
|
1373
|
+
w.div,
|
|
1393
1374
|
{
|
|
1394
1375
|
style: {
|
|
1395
1376
|
marginBottom: "10px",
|
|
@@ -1405,51 +1386,51 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1405
1386
|
children: t.sources
|
|
1406
1387
|
}
|
|
1407
1388
|
),
|
|
1408
|
-
/* @__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((c,
|
|
1409
|
-
|
|
1389
|
+
/* @__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((c, l) => /* @__PURE__ */ o(
|
|
1390
|
+
qe,
|
|
1410
1391
|
{
|
|
1411
1392
|
source: c,
|
|
1412
|
-
index:
|
|
1413
|
-
loadingMemoryId:
|
|
1414
|
-
setLoadingMemoryId:
|
|
1415
|
-
onSourceClick:
|
|
1393
|
+
index: l,
|
|
1394
|
+
loadingMemoryId: r,
|
|
1395
|
+
setLoadingMemoryId: s,
|
|
1396
|
+
onSourceClick: n,
|
|
1416
1397
|
t
|
|
1417
1398
|
},
|
|
1418
1399
|
c.memoryId
|
|
1419
1400
|
)) })
|
|
1420
1401
|
] });
|
|
1421
|
-
},
|
|
1402
|
+
}, qe = ({
|
|
1422
1403
|
source: e,
|
|
1423
|
-
index:
|
|
1404
|
+
index: n,
|
|
1424
1405
|
loadingMemoryId: t,
|
|
1425
|
-
setLoadingMemoryId:
|
|
1426
|
-
onSourceClick:
|
|
1406
|
+
setLoadingMemoryId: r,
|
|
1407
|
+
onSourceClick: s,
|
|
1427
1408
|
t: c
|
|
1428
1409
|
}) => {
|
|
1429
|
-
const [
|
|
1410
|
+
const [l, d] = I(!1), y = !!s, u = t === e.memoryId, i = e.pageNumbers ?? [], a = Qe(i, c);
|
|
1430
1411
|
return /* @__PURE__ */ p(
|
|
1431
|
-
|
|
1412
|
+
w.div,
|
|
1432
1413
|
{
|
|
1433
|
-
"aria-busy":
|
|
1414
|
+
"aria-busy": u,
|
|
1434
1415
|
initial: { opacity: 0, scale: 0.9 },
|
|
1435
1416
|
animate: { opacity: 1, scale: 1 },
|
|
1436
|
-
transition: { duration: 0.25, delay:
|
|
1437
|
-
onClick:
|
|
1438
|
-
|
|
1417
|
+
transition: { duration: 0.25, delay: n * 0.05 },
|
|
1418
|
+
onClick: y && !u ? async () => {
|
|
1419
|
+
r(e.memoryId);
|
|
1439
1420
|
try {
|
|
1440
|
-
await
|
|
1421
|
+
await s({
|
|
1441
1422
|
memoryId: e.memoryId,
|
|
1442
1423
|
memoryTitle: e.memoryTitle,
|
|
1443
1424
|
memoryTypeId: e.memoryTypeId,
|
|
1444
1425
|
memoryTypeName: e.memoryTypeName,
|
|
1445
|
-
pageNumbers: [...
|
|
1426
|
+
pageNumbers: [...i]
|
|
1446
1427
|
});
|
|
1447
1428
|
} finally {
|
|
1448
|
-
|
|
1429
|
+
r(null);
|
|
1449
1430
|
}
|
|
1450
1431
|
} : void 0,
|
|
1451
|
-
onMouseEnter:
|
|
1452
|
-
onMouseLeave:
|
|
1432
|
+
onMouseEnter: y && !u ? () => d(!0) : void 0,
|
|
1433
|
+
onMouseLeave: y && !u ? () => d(!1) : void 0,
|
|
1453
1434
|
style: {
|
|
1454
1435
|
display: "inline-flex",
|
|
1455
1436
|
flexDirection: "column",
|
|
@@ -1457,11 +1438,11 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1457
1438
|
padding: "8px 12px",
|
|
1458
1439
|
borderRadius: "6px",
|
|
1459
1440
|
border: "1px solid #e0e0e0",
|
|
1460
|
-
backgroundColor:
|
|
1461
|
-
cursor:
|
|
1441
|
+
backgroundColor: l ? "#f5f5f5" : "transparent",
|
|
1442
|
+
cursor: y && !u ? "pointer" : u ? "wait" : "default",
|
|
1462
1443
|
transition: "background-color 0.15s ease",
|
|
1463
1444
|
userSelect: "none",
|
|
1464
|
-
pointerEvents:
|
|
1445
|
+
pointerEvents: u ? "none" : void 0
|
|
1465
1446
|
},
|
|
1466
1447
|
children: [
|
|
1467
1448
|
/* @__PURE__ */ p(
|
|
@@ -1476,7 +1457,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1476
1457
|
gap: 8
|
|
1477
1458
|
},
|
|
1478
1459
|
children: [
|
|
1479
|
-
|
|
1460
|
+
u && /* @__PURE__ */ o(
|
|
1480
1461
|
"span",
|
|
1481
1462
|
{
|
|
1482
1463
|
className: "explore-memory-loader explore-memory-loader--callback",
|
|
@@ -1487,40 +1468,40 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1487
1468
|
]
|
|
1488
1469
|
}
|
|
1489
1470
|
),
|
|
1490
|
-
|
|
1471
|
+
a && /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: "#666" }, children: a })
|
|
1491
1472
|
]
|
|
1492
1473
|
}
|
|
1493
1474
|
);
|
|
1494
|
-
},
|
|
1475
|
+
}, z = ({
|
|
1495
1476
|
color: e = "#78b13f",
|
|
1496
|
-
size:
|
|
1477
|
+
size: n = 24,
|
|
1497
1478
|
borderWidth: t = 7
|
|
1498
1479
|
}) => {
|
|
1499
|
-
const
|
|
1480
|
+
const r = n * 0.5;
|
|
1500
1481
|
return /* @__PURE__ */ o(
|
|
1501
1482
|
"span",
|
|
1502
1483
|
{
|
|
1503
1484
|
style: {
|
|
1504
1485
|
display: "inline-block",
|
|
1505
1486
|
transform: "rotate(45deg)",
|
|
1506
|
-
height:
|
|
1507
|
-
width:
|
|
1487
|
+
height: n,
|
|
1488
|
+
width: r,
|
|
1508
1489
|
borderBottom: `${t}px solid ${e}`,
|
|
1509
1490
|
borderRight: `${t}px solid ${e}`
|
|
1510
1491
|
}
|
|
1511
1492
|
}
|
|
1512
1493
|
);
|
|
1513
|
-
},
|
|
1494
|
+
}, j = ({
|
|
1514
1495
|
color: e = "#333",
|
|
1515
|
-
size:
|
|
1496
|
+
size: n = 32,
|
|
1516
1497
|
lineWidth: t = 2
|
|
1517
1498
|
}) => {
|
|
1518
|
-
const
|
|
1499
|
+
const r = n + 1, s = (n - t) / 2, c = (n - r) / 2, l = {
|
|
1519
1500
|
position: "absolute",
|
|
1520
|
-
left:
|
|
1501
|
+
left: s,
|
|
1521
1502
|
top: c,
|
|
1522
1503
|
width: t,
|
|
1523
|
-
height:
|
|
1504
|
+
height: r,
|
|
1524
1505
|
backgroundColor: e
|
|
1525
1506
|
};
|
|
1526
1507
|
return /* @__PURE__ */ p(
|
|
@@ -1529,15 +1510,15 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1529
1510
|
style: {
|
|
1530
1511
|
position: "relative",
|
|
1531
1512
|
display: "inline-block",
|
|
1532
|
-
width:
|
|
1533
|
-
height:
|
|
1513
|
+
width: n,
|
|
1514
|
+
height: n
|
|
1534
1515
|
},
|
|
1535
1516
|
children: [
|
|
1536
1517
|
/* @__PURE__ */ o(
|
|
1537
1518
|
"span",
|
|
1538
1519
|
{
|
|
1539
1520
|
style: {
|
|
1540
|
-
...
|
|
1521
|
+
...l,
|
|
1541
1522
|
transform: "rotate(45deg)"
|
|
1542
1523
|
}
|
|
1543
1524
|
}
|
|
@@ -1546,7 +1527,7 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1546
1527
|
"span",
|
|
1547
1528
|
{
|
|
1548
1529
|
style: {
|
|
1549
|
-
...
|
|
1530
|
+
...l,
|
|
1550
1531
|
transform: "rotate(-45deg)"
|
|
1551
1532
|
}
|
|
1552
1533
|
}
|
|
@@ -1555,26 +1536,26 @@ const qe = ({ data: e, onSourceClick: r, t }) => {
|
|
|
1555
1536
|
}
|
|
1556
1537
|
);
|
|
1557
1538
|
};
|
|
1558
|
-
function
|
|
1539
|
+
function Ke({
|
|
1559
1540
|
memory: e,
|
|
1560
|
-
completed:
|
|
1541
|
+
completed: n
|
|
1561
1542
|
}) {
|
|
1562
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
1543
|
+
return e.error != null ? /* @__PURE__ */ o(j, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(z, { color: "#999", size: 15, borderWidth: 2 }) : n ? /* @__PURE__ */ o(z, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
1563
1544
|
}
|
|
1564
|
-
const
|
|
1565
|
-
function
|
|
1545
|
+
const re = 80;
|
|
1546
|
+
function Ve({
|
|
1566
1547
|
memory: e,
|
|
1567
|
-
completed:
|
|
1548
|
+
completed: n,
|
|
1568
1549
|
t
|
|
1569
1550
|
}) {
|
|
1570
|
-
const [
|
|
1551
|
+
const [r, s] = I(!1), c = e.result ?? e.error, l = c != null && c.length > re, d = c != null ? r || !l ? c : `${c.slice(0, re)}...` : void 0, y = l, u = e.error != null;
|
|
1571
1552
|
return /* @__PURE__ */ p(
|
|
1572
|
-
|
|
1553
|
+
w.div,
|
|
1573
1554
|
{
|
|
1574
1555
|
initial: { opacity: 0 },
|
|
1575
1556
|
animate: { opacity: 1 },
|
|
1576
1557
|
transition: { duration: 0.25 },
|
|
1577
|
-
onClick:
|
|
1558
|
+
onClick: y ? () => s((i) => !i) : void 0,
|
|
1578
1559
|
style: {
|
|
1579
1560
|
paddingTop: "12px",
|
|
1580
1561
|
paddingBottom: "12px",
|
|
@@ -1584,7 +1565,7 @@ function Xe({
|
|
|
1584
1565
|
alignItems: "center",
|
|
1585
1566
|
gap: "10px",
|
|
1586
1567
|
minWidth: 0,
|
|
1587
|
-
cursor:
|
|
1568
|
+
cursor: y ? "pointer" : "default"
|
|
1588
1569
|
},
|
|
1589
1570
|
children: [
|
|
1590
1571
|
/* @__PURE__ */ o(
|
|
@@ -1597,7 +1578,7 @@ function Xe({
|
|
|
1597
1578
|
flexShrink: 0,
|
|
1598
1579
|
width: 32
|
|
1599
1580
|
},
|
|
1600
|
-
children: /* @__PURE__ */ o(
|
|
1581
|
+
children: /* @__PURE__ */ o(Ke, { memory: e, completed: n })
|
|
1601
1582
|
}
|
|
1602
1583
|
),
|
|
1603
1584
|
/* @__PURE__ */ p(
|
|
@@ -1622,14 +1603,14 @@ function Xe({
|
|
|
1622
1603
|
{
|
|
1623
1604
|
style: {
|
|
1624
1605
|
fontSize: 12,
|
|
1625
|
-
color:
|
|
1606
|
+
color: u ? "#c62828" : "#666",
|
|
1626
1607
|
lineHeight: 1.4,
|
|
1627
|
-
whiteSpace:
|
|
1608
|
+
whiteSpace: r ? "pre-wrap" : void 0
|
|
1628
1609
|
},
|
|
1629
1610
|
children: d
|
|
1630
1611
|
}
|
|
1631
1612
|
),
|
|
1632
|
-
|
|
1613
|
+
y && /* @__PURE__ */ o(
|
|
1633
1614
|
"span",
|
|
1634
1615
|
{
|
|
1635
1616
|
style: {
|
|
@@ -1637,7 +1618,7 @@ function Xe({
|
|
|
1637
1618
|
color: "#999",
|
|
1638
1619
|
marginTop: 2
|
|
1639
1620
|
},
|
|
1640
|
-
children:
|
|
1621
|
+
children: r ? t.clickToCollapse : t.clickToExpand
|
|
1641
1622
|
}
|
|
1642
1623
|
)
|
|
1643
1624
|
]
|
|
@@ -1647,102 +1628,102 @@ function Xe({
|
|
|
1647
1628
|
}
|
|
1648
1629
|
);
|
|
1649
1630
|
}
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1631
|
+
const Xe = ({ data: e, completed: n, t }) => /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: e.memories.map((r) => /* @__PURE__ */ o(
|
|
1632
|
+
Ve,
|
|
1652
1633
|
{
|
|
1653
|
-
memory:
|
|
1654
|
-
completed:
|
|
1634
|
+
memory: r,
|
|
1635
|
+
completed: n,
|
|
1655
1636
|
t
|
|
1656
1637
|
},
|
|
1657
|
-
|
|
1638
|
+
r.memoryId
|
|
1658
1639
|
)) });
|
|
1659
|
-
function
|
|
1660
|
-
const t = Math.min(e.length,
|
|
1661
|
-
for (let
|
|
1662
|
-
if (e.slice(-
|
|
1640
|
+
function Je(e, n) {
|
|
1641
|
+
const t = Math.min(e.length, n.length);
|
|
1642
|
+
for (let r = t; r >= 0; r--)
|
|
1643
|
+
if (e.slice(-r) === n.slice(0, r)) return r;
|
|
1663
1644
|
return 0;
|
|
1664
1645
|
}
|
|
1665
|
-
const
|
|
1646
|
+
const Ye = `
|
|
1666
1647
|
|
|
1667
1648
|
`;
|
|
1668
|
-
function
|
|
1669
|
-
var t,
|
|
1649
|
+
function q(e) {
|
|
1650
|
+
var t, r;
|
|
1670
1651
|
if (e.length === 0) return "";
|
|
1671
|
-
let
|
|
1672
|
-
for (let
|
|
1673
|
-
const c = ((
|
|
1652
|
+
let n = ((t = e[0]) == null ? void 0 : t.content) ?? "";
|
|
1653
|
+
for (let s = 1; s < e.length; s++) {
|
|
1654
|
+
const c = ((r = e[s]) == null ? void 0 : r.content) ?? "";
|
|
1674
1655
|
if (c === "") continue;
|
|
1675
|
-
if (
|
|
1676
|
-
|
|
1656
|
+
if (n === "") {
|
|
1657
|
+
n = c;
|
|
1677
1658
|
continue;
|
|
1678
1659
|
}
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1660
|
+
const l = Je(n, c);
|
|
1661
|
+
l === 0 ? n += Ye + c : n += c.slice(l);
|
|
1681
1662
|
}
|
|
1682
|
-
return
|
|
1663
|
+
return n;
|
|
1683
1664
|
}
|
|
1684
|
-
function
|
|
1665
|
+
function K(e, n) {
|
|
1685
1666
|
if (e.length === 0) return "";
|
|
1686
1667
|
if (e.length === 1)
|
|
1687
|
-
return
|
|
1668
|
+
return b(n.memorySearchPagesSingle, {
|
|
1688
1669
|
n: e[0]
|
|
1689
1670
|
});
|
|
1690
1671
|
if (e.length === 2)
|
|
1691
|
-
return
|
|
1672
|
+
return b(n.memorySearchPagesTwo, {
|
|
1692
1673
|
a: e[0],
|
|
1693
1674
|
b: e[1]
|
|
1694
1675
|
});
|
|
1695
|
-
const t = e[e.length - 1],
|
|
1696
|
-
return
|
|
1697
|
-
list:
|
|
1676
|
+
const t = e[e.length - 1], r = e.slice(0, -1).join(", ");
|
|
1677
|
+
return b(n.memorySearchPagesMultiple, {
|
|
1678
|
+
list: r,
|
|
1698
1679
|
n: t
|
|
1699
1680
|
});
|
|
1700
1681
|
}
|
|
1701
|
-
function
|
|
1702
|
-
const
|
|
1682
|
+
function V(e) {
|
|
1683
|
+
const n = /* @__PURE__ */ new Set();
|
|
1703
1684
|
for (const t of e)
|
|
1704
|
-
for (const
|
|
1705
|
-
return [...
|
|
1685
|
+
for (const r of t.pageNumbers) n.add(r);
|
|
1686
|
+
return [...n].sort((t, r) => t - r);
|
|
1706
1687
|
}
|
|
1707
|
-
function
|
|
1708
|
-
const
|
|
1709
|
-
if (
|
|
1688
|
+
function X(e) {
|
|
1689
|
+
const n = e.memoryTypeName.trim();
|
|
1690
|
+
if (n !== "") return n;
|
|
1710
1691
|
if (e.memoryTypeId !== "") return e.memoryTypeId;
|
|
1711
1692
|
}
|
|
1712
1693
|
function ae(e) {
|
|
1713
|
-
return e.chunks.filter((
|
|
1694
|
+
return e.chunks.filter((n) => n.relation === "MATCH").length;
|
|
1714
1695
|
}
|
|
1715
|
-
function
|
|
1716
|
-
let t = 0,
|
|
1717
|
-
for (const
|
|
1718
|
-
t += ae(
|
|
1719
|
-
const
|
|
1720
|
-
n:
|
|
1696
|
+
function Ze(e, n) {
|
|
1697
|
+
let t = 0, r = 0;
|
|
1698
|
+
for (const l of e)
|
|
1699
|
+
t += ae(l), l.matchingChunkScore > r && (r = l.matchingChunkScore);
|
|
1700
|
+
const s = t === 1 ? n.chunkFound : b(n.chunksFound, { n: t }), c = b(n.scoreLabel, {
|
|
1701
|
+
n: r.toFixed(2)
|
|
1721
1702
|
});
|
|
1722
|
-
return `${
|
|
1703
|
+
return `${s} - ${c}`;
|
|
1723
1704
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const
|
|
1726
|
-
return e.forEach((
|
|
1727
|
-
let c = t.get(
|
|
1705
|
+
function er(e) {
|
|
1706
|
+
const n = [], t = /* @__PURE__ */ new Map();
|
|
1707
|
+
return e.forEach((r, s) => {
|
|
1708
|
+
let c = t.get(r.memoryId);
|
|
1728
1709
|
if (c == null) {
|
|
1729
|
-
|
|
1730
|
-
const
|
|
1710
|
+
n.push(r.memoryId);
|
|
1711
|
+
const l = r.memoryTitle !== "" ? r.memoryTitle : r.memoryId;
|
|
1731
1712
|
c = {
|
|
1732
|
-
memoryId:
|
|
1733
|
-
memoryTitle:
|
|
1713
|
+
memoryId: r.memoryId,
|
|
1714
|
+
memoryTitle: l,
|
|
1734
1715
|
items: []
|
|
1735
|
-
}, t.set(
|
|
1716
|
+
}, t.set(r.memoryId, c);
|
|
1736
1717
|
}
|
|
1737
|
-
c.items.push({ item:
|
|
1738
|
-
}),
|
|
1718
|
+
c.items.push({ item: r, flatIndex: s });
|
|
1719
|
+
}), n.map((r) => t.get(r));
|
|
1739
1720
|
}
|
|
1740
|
-
function
|
|
1721
|
+
function rr({
|
|
1741
1722
|
items: e,
|
|
1742
|
-
onSearchResultClick:
|
|
1723
|
+
onSearchResultClick: n,
|
|
1743
1724
|
t
|
|
1744
1725
|
}) {
|
|
1745
|
-
const [
|
|
1726
|
+
const [r, s] = I(null), c = !!n;
|
|
1746
1727
|
return /* @__PURE__ */ o(
|
|
1747
1728
|
"div",
|
|
1748
1729
|
{
|
|
@@ -1754,24 +1735,24 @@ function nr({
|
|
|
1754
1735
|
paddingTop: 8,
|
|
1755
1736
|
borderTop: "1px solid #f0f0f0"
|
|
1756
1737
|
},
|
|
1757
|
-
children: e.map((
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
),
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
n:
|
|
1738
|
+
children: e.map((l, d) => {
|
|
1739
|
+
const y = V(
|
|
1740
|
+
l.chunks
|
|
1741
|
+
), u = [
|
|
1742
|
+
X(l),
|
|
1743
|
+
b(t.scoreLabel, {
|
|
1744
|
+
n: l.matchingChunkScore.toFixed(2)
|
|
1764
1745
|
}),
|
|
1765
|
-
|
|
1746
|
+
y.length > 0 ? K(y, t) : t.pagesNotAvailable
|
|
1766
1747
|
].filter(
|
|
1767
1748
|
(g) => g != null && g !== ""
|
|
1768
|
-
),
|
|
1769
|
-
memoryId:
|
|
1770
|
-
memoryTitle:
|
|
1771
|
-
memoryTypeId:
|
|
1772
|
-
memoryTypeName:
|
|
1773
|
-
pageNumbers:
|
|
1774
|
-
},
|
|
1749
|
+
), i = {
|
|
1750
|
+
memoryId: l.memoryId,
|
|
1751
|
+
memoryTitle: l.memoryTitle,
|
|
1752
|
+
memoryTypeId: l.memoryTypeId,
|
|
1753
|
+
memoryTypeName: l.memoryTypeName,
|
|
1754
|
+
pageNumbers: y
|
|
1755
|
+
}, a = `${l.memoryId}-${d}`, m = r === a;
|
|
1775
1756
|
return /* @__PURE__ */ p(
|
|
1776
1757
|
"div",
|
|
1777
1758
|
{
|
|
@@ -1807,7 +1788,7 @@ function nr({
|
|
|
1807
1788
|
whiteSpace: "pre-wrap",
|
|
1808
1789
|
wordBreak: "break-word"
|
|
1809
1790
|
},
|
|
1810
|
-
children:
|
|
1791
|
+
children: q(l.chunks)
|
|
1811
1792
|
}
|
|
1812
1793
|
),
|
|
1813
1794
|
/* @__PURE__ */ o(
|
|
@@ -1819,7 +1800,7 @@ function nr({
|
|
|
1819
1800
|
color: "#94a3b8",
|
|
1820
1801
|
lineHeight: 1.35
|
|
1821
1802
|
},
|
|
1822
|
-
children:
|
|
1803
|
+
children: u.join(" · ")
|
|
1823
1804
|
}
|
|
1824
1805
|
)
|
|
1825
1806
|
]
|
|
@@ -1829,16 +1810,16 @@ function nr({
|
|
|
1829
1810
|
"button",
|
|
1830
1811
|
{
|
|
1831
1812
|
type: "button",
|
|
1832
|
-
"aria-busy":
|
|
1833
|
-
disabled:
|
|
1813
|
+
"aria-busy": m,
|
|
1814
|
+
disabled: m,
|
|
1834
1815
|
onClick: async () => {
|
|
1835
|
-
|
|
1816
|
+
s(a);
|
|
1836
1817
|
try {
|
|
1837
|
-
await
|
|
1838
|
-
|
|
1818
|
+
await n(
|
|
1819
|
+
i
|
|
1839
1820
|
);
|
|
1840
1821
|
} finally {
|
|
1841
|
-
|
|
1822
|
+
s(null);
|
|
1842
1823
|
}
|
|
1843
1824
|
},
|
|
1844
1825
|
style: {
|
|
@@ -1851,14 +1832,14 @@ function nr({
|
|
|
1851
1832
|
background: "#eff6ff",
|
|
1852
1833
|
border: "1px solid #bfdbfe",
|
|
1853
1834
|
borderRadius: 6,
|
|
1854
|
-
cursor:
|
|
1835
|
+
cursor: m ? "wait" : "pointer",
|
|
1855
1836
|
fontFamily: "inherit",
|
|
1856
1837
|
display: "inline-flex",
|
|
1857
1838
|
alignItems: "center",
|
|
1858
1839
|
gap: 8
|
|
1859
1840
|
},
|
|
1860
1841
|
children: [
|
|
1861
|
-
|
|
1842
|
+
m && /* @__PURE__ */ o(
|
|
1862
1843
|
"span",
|
|
1863
1844
|
{
|
|
1864
1845
|
className: "explore-memory-loader explore-memory-loader--callback",
|
|
@@ -1871,22 +1852,22 @@ function nr({
|
|
|
1871
1852
|
)
|
|
1872
1853
|
]
|
|
1873
1854
|
},
|
|
1874
|
-
|
|
1855
|
+
a
|
|
1875
1856
|
);
|
|
1876
1857
|
})
|
|
1877
1858
|
}
|
|
1878
1859
|
);
|
|
1879
1860
|
}
|
|
1880
|
-
function
|
|
1861
|
+
function nr({
|
|
1881
1862
|
group: e,
|
|
1882
|
-
t:
|
|
1863
|
+
t: n,
|
|
1883
1864
|
expanded: t,
|
|
1884
|
-
onToggle:
|
|
1885
|
-
onSearchResultClick:
|
|
1865
|
+
onToggle: r,
|
|
1866
|
+
onSearchResultClick: s
|
|
1886
1867
|
}) {
|
|
1887
|
-
const c = e.items.map((d) => d.item),
|
|
1868
|
+
const c = e.items.map((d) => d.item), l = c.some((d) => d.chunks.length > 0);
|
|
1888
1869
|
return /* @__PURE__ */ p(
|
|
1889
|
-
|
|
1870
|
+
w.div,
|
|
1890
1871
|
{
|
|
1891
1872
|
initial: { opacity: 0 },
|
|
1892
1873
|
animate: { opacity: 1 },
|
|
@@ -1913,7 +1894,7 @@ function tr({
|
|
|
1913
1894
|
width: 32,
|
|
1914
1895
|
paddingTop: 2
|
|
1915
1896
|
},
|
|
1916
|
-
children: /* @__PURE__ */ o(
|
|
1897
|
+
children: /* @__PURE__ */ o(z, { color: "#999", size: 15, borderWidth: 2 })
|
|
1917
1898
|
}
|
|
1918
1899
|
),
|
|
1919
1900
|
/* @__PURE__ */ p(
|
|
@@ -1959,14 +1940,14 @@ function tr({
|
|
|
1959
1940
|
color: "#666",
|
|
1960
1941
|
whiteSpace: "nowrap"
|
|
1961
1942
|
},
|
|
1962
|
-
children:
|
|
1943
|
+
children: Ze(c, n)
|
|
1963
1944
|
}
|
|
1964
1945
|
),
|
|
1965
|
-
|
|
1946
|
+
l && /* @__PURE__ */ o(
|
|
1966
1947
|
"button",
|
|
1967
1948
|
{
|
|
1968
1949
|
type: "button",
|
|
1969
|
-
onClick:
|
|
1950
|
+
onClick: r,
|
|
1970
1951
|
style: {
|
|
1971
1952
|
border: "none",
|
|
1972
1953
|
background: "none",
|
|
@@ -1977,18 +1958,18 @@ function tr({
|
|
|
1977
1958
|
textDecoration: "underline",
|
|
1978
1959
|
fontFamily: "inherit"
|
|
1979
1960
|
},
|
|
1980
|
-
children: t ?
|
|
1961
|
+
children: t ? n.memorySearchHideExploreResults : n.memorySearchViewExploreResults
|
|
1981
1962
|
}
|
|
1982
1963
|
)
|
|
1983
1964
|
]
|
|
1984
1965
|
}
|
|
1985
1966
|
),
|
|
1986
|
-
t &&
|
|
1987
|
-
|
|
1967
|
+
t && l && /* @__PURE__ */ o(
|
|
1968
|
+
rr,
|
|
1988
1969
|
{
|
|
1989
1970
|
items: c,
|
|
1990
|
-
onSearchResultClick:
|
|
1991
|
-
t:
|
|
1971
|
+
onSearchResultClick: s,
|
|
1972
|
+
t: n
|
|
1992
1973
|
}
|
|
1993
1974
|
)
|
|
1994
1975
|
]
|
|
@@ -1998,26 +1979,26 @@ function tr({
|
|
|
1998
1979
|
}
|
|
1999
1980
|
);
|
|
2000
1981
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return e === 1 ?
|
|
1982
|
+
function tr(e, n) {
|
|
1983
|
+
return e === 1 ? n.chunkFound : b(n.chunksFound, { n: e });
|
|
2003
1984
|
}
|
|
2004
|
-
const
|
|
1985
|
+
const or = ({
|
|
2005
1986
|
data: e,
|
|
2006
|
-
onSearchResultClick:
|
|
1987
|
+
onSearchResultClick: n,
|
|
2007
1988
|
t
|
|
2008
1989
|
}) => {
|
|
2009
|
-
const
|
|
2010
|
-
(
|
|
1990
|
+
const r = e.items, s = r.reduce(
|
|
1991
|
+
(m, g) => m + ae(g),
|
|
2011
1992
|
0
|
|
2012
|
-
), c = new Set(
|
|
1993
|
+
), c = new Set(r.map((m) => m.memoryId)).size, [l, d] = I({}), y = N((m) => {
|
|
2013
1994
|
d((g) => ({
|
|
2014
1995
|
...g,
|
|
2015
|
-
[
|
|
1996
|
+
[m]: !g[m]
|
|
2016
1997
|
}));
|
|
2017
|
-
}, []),
|
|
1998
|
+
}, []), u = D(() => er(r), [r]), i = c === 1 ? t.memoryChatChunkResultsInOneMemory : b(t.memoryChatChunkResultsInMemories, {
|
|
2018
1999
|
n: c
|
|
2019
|
-
}),
|
|
2020
|
-
return
|
|
2000
|
+
}), a = `${tr(s, t)} ${i}`;
|
|
2001
|
+
return r.length === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
2021
2002
|
"div",
|
|
2022
2003
|
{
|
|
2023
2004
|
style: {
|
|
@@ -2028,16 +2009,16 @@ const ir = ({
|
|
|
2028
2009
|
children: t.memorySearchExploreNoResults
|
|
2029
2010
|
}
|
|
2030
2011
|
) }) : /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
2031
|
-
|
|
2032
|
-
|
|
2012
|
+
u.map((m) => /* @__PURE__ */ o(
|
|
2013
|
+
nr,
|
|
2033
2014
|
{
|
|
2034
|
-
group:
|
|
2015
|
+
group: m,
|
|
2035
2016
|
t,
|
|
2036
|
-
expanded:
|
|
2037
|
-
onToggle: () => m
|
|
2038
|
-
onSearchResultClick:
|
|
2017
|
+
expanded: l[m.memoryId] === !0,
|
|
2018
|
+
onToggle: () => y(m.memoryId),
|
|
2019
|
+
onSearchResultClick: n
|
|
2039
2020
|
},
|
|
2040
|
-
|
|
2021
|
+
m.memoryId
|
|
2041
2022
|
)),
|
|
2042
2023
|
/* @__PURE__ */ o(
|
|
2043
2024
|
"div",
|
|
@@ -2048,27 +2029,27 @@ const ir = ({
|
|
|
2048
2029
|
marginTop: "4px",
|
|
2049
2030
|
fontStyle: "italic"
|
|
2050
2031
|
},
|
|
2051
|
-
children:
|
|
2032
|
+
children: a
|
|
2052
2033
|
}
|
|
2053
2034
|
)
|
|
2054
2035
|
] });
|
|
2055
2036
|
};
|
|
2056
|
-
function
|
|
2057
|
-
return e.error != null ? /* @__PURE__ */ o(
|
|
2037
|
+
function ir({ item: e }) {
|
|
2038
|
+
return e.error != null ? /* @__PURE__ */ o(j, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(z, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2058
2039
|
}
|
|
2059
|
-
function
|
|
2060
|
-
return
|
|
2040
|
+
function ar(e, n) {
|
|
2041
|
+
return b(n.searchingInMemoriesOfType, {
|
|
2061
2042
|
name: e.memoryTypeName
|
|
2062
2043
|
});
|
|
2063
2044
|
}
|
|
2064
|
-
function
|
|
2045
|
+
function sr({
|
|
2065
2046
|
item: e,
|
|
2066
|
-
t:
|
|
2047
|
+
t: n,
|
|
2067
2048
|
showShimmerForPrimary: t
|
|
2068
2049
|
}) {
|
|
2069
|
-
const
|
|
2050
|
+
const r = e.result != null, s = e.error != null, c = ar(e, n);
|
|
2070
2051
|
return /* @__PURE__ */ p(
|
|
2071
|
-
|
|
2052
|
+
w.div,
|
|
2072
2053
|
{
|
|
2073
2054
|
initial: { opacity: 0 },
|
|
2074
2055
|
animate: { opacity: 1 },
|
|
@@ -2094,7 +2075,7 @@ function lr({
|
|
|
2094
2075
|
flexShrink: 0,
|
|
2095
2076
|
width: 32
|
|
2096
2077
|
},
|
|
2097
|
-
children: /* @__PURE__ */ o(
|
|
2078
|
+
children: /* @__PURE__ */ o(ir, { item: e })
|
|
2098
2079
|
}
|
|
2099
2080
|
),
|
|
2100
2081
|
/* @__PURE__ */ p(
|
|
@@ -2108,8 +2089,8 @@ function lr({
|
|
|
2108
2089
|
flex: 1
|
|
2109
2090
|
},
|
|
2110
2091
|
children: [
|
|
2111
|
-
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: !
|
|
2112
|
-
|
|
2092
|
+
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: !r && !s && t ? /* @__PURE__ */ o(
|
|
2093
|
+
M,
|
|
2113
2094
|
{
|
|
2114
2095
|
text: c,
|
|
2115
2096
|
duration: 2.5,
|
|
@@ -2118,15 +2099,15 @@ function lr({
|
|
|
2118
2099
|
shimmerColor: "#000"
|
|
2119
2100
|
}
|
|
2120
2101
|
) : c }),
|
|
2121
|
-
|
|
2122
|
-
|
|
2102
|
+
r && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#666" }, children: e.result.numberOfChunks === 1 ? b(
|
|
2103
|
+
n.memorySearchTypeResultSummaryOne,
|
|
2123
2104
|
{
|
|
2124
2105
|
score: e.result.highestChunkScore.toFixed(
|
|
2125
2106
|
2
|
|
2126
2107
|
)
|
|
2127
2108
|
}
|
|
2128
|
-
) :
|
|
2129
|
-
|
|
2109
|
+
) : b(
|
|
2110
|
+
n.memorySearchTypeResultSummary,
|
|
2130
2111
|
{
|
|
2131
2112
|
count: e.result.numberOfChunks,
|
|
2132
2113
|
score: e.result.highestChunkScore.toFixed(
|
|
@@ -2134,7 +2115,7 @@ function lr({
|
|
|
2134
2115
|
)
|
|
2135
2116
|
}
|
|
2136
2117
|
) }),
|
|
2137
|
-
|
|
2118
|
+
s && /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#c62828" }, children: e.error })
|
|
2138
2119
|
]
|
|
2139
2120
|
}
|
|
2140
2121
|
)
|
|
@@ -2142,29 +2123,29 @@ function lr({
|
|
|
2142
2123
|
}
|
|
2143
2124
|
);
|
|
2144
2125
|
}
|
|
2145
|
-
const
|
|
2146
|
-
const
|
|
2126
|
+
const lr = ({ data: e, isLatest: n = !1, durationSeconds: t, t: r }) => {
|
|
2127
|
+
const s = D(() => {
|
|
2147
2128
|
let c = -1;
|
|
2148
|
-
return e.memoryTypes.forEach((
|
|
2149
|
-
|
|
2129
|
+
return e.memoryTypes.forEach((l, d) => {
|
|
2130
|
+
l.result == null && l.error == null && (c = d);
|
|
2150
2131
|
}), c;
|
|
2151
2132
|
}, [e.memoryTypes]);
|
|
2152
2133
|
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
2153
|
-
|
|
2154
|
-
|
|
2134
|
+
n && !t && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(
|
|
2135
|
+
M,
|
|
2155
2136
|
{
|
|
2156
|
-
text:
|
|
2137
|
+
text: r.searchingMemoryTypes,
|
|
2157
2138
|
duration: 2.5,
|
|
2158
2139
|
repeat: !0,
|
|
2159
2140
|
color: "#999",
|
|
2160
2141
|
shimmerColor: "#000"
|
|
2161
2142
|
}
|
|
2162
|
-
) : e.memoryTypes.map((c,
|
|
2163
|
-
|
|
2143
|
+
) : e.memoryTypes.map((c, l) => /* @__PURE__ */ o(
|
|
2144
|
+
sr,
|
|
2164
2145
|
{
|
|
2165
2146
|
item: c,
|
|
2166
|
-
t:
|
|
2167
|
-
showShimmerForPrimary:
|
|
2147
|
+
t: r,
|
|
2148
|
+
showShimmerForPrimary: l === s && n
|
|
2168
2149
|
},
|
|
2169
2150
|
c.memoryTypeId
|
|
2170
2151
|
)),
|
|
@@ -2177,45 +2158,45 @@ const cr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2177
2158
|
marginTop: "4px",
|
|
2178
2159
|
fontStyle: "italic"
|
|
2179
2160
|
},
|
|
2180
|
-
children:
|
|
2161
|
+
children: b(r.tookSeconds, { n: t })
|
|
2181
2162
|
}
|
|
2182
2163
|
)
|
|
2183
2164
|
] });
|
|
2184
|
-
},
|
|
2185
|
-
|
|
2186
|
-
),
|
|
2187
|
-
5 *
|
|
2165
|
+
}, B = 12, W = 1.45, cr = Math.ceil(
|
|
2166
|
+
B * W
|
|
2167
|
+
), dr = Math.ceil(
|
|
2168
|
+
5 * B * W
|
|
2188
2169
|
);
|
|
2189
|
-
function
|
|
2170
|
+
function O(e) {
|
|
2190
2171
|
return e.queries != null && e.queries.length > 0;
|
|
2191
2172
|
}
|
|
2192
|
-
function
|
|
2193
|
-
const
|
|
2194
|
-
return (
|
|
2173
|
+
function mr(e) {
|
|
2174
|
+
const n = e.reasoning;
|
|
2175
|
+
return (n == null || n === "") && !O(e);
|
|
2195
2176
|
}
|
|
2196
|
-
function
|
|
2197
|
-
if (
|
|
2198
|
-
const
|
|
2199
|
-
return
|
|
2177
|
+
function ur(e) {
|
|
2178
|
+
if (O(e)) return 3;
|
|
2179
|
+
const n = e.reasoning;
|
|
2180
|
+
return n == null || n === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
|
|
2200
2181
|
}
|
|
2201
|
-
function
|
|
2202
|
-
return e === 3 ? /* @__PURE__ */ o(
|
|
2182
|
+
function yr({ phase: e }) {
|
|
2183
|
+
return e === 3 ? /* @__PURE__ */ o(z, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2203
2184
|
}
|
|
2204
2185
|
function gr({
|
|
2205
2186
|
item: e,
|
|
2206
|
-
t:
|
|
2187
|
+
t: n,
|
|
2207
2188
|
isActiveRow: t
|
|
2208
2189
|
}) {
|
|
2209
|
-
const
|
|
2190
|
+
const r = mr(e), s = ur(e), c = e.reasoning, l = c != null && c.length > 0, d = F(null), [y, u] = I(!1), i = r && t, a = s === 2 && t && !O(e);
|
|
2210
2191
|
R(() => {
|
|
2211
2192
|
const h = d.current;
|
|
2212
|
-
h != null &&
|
|
2213
|
-
}, [c,
|
|
2214
|
-
const
|
|
2193
|
+
h != null && s === 1 && l && (h.scrollTop = h.scrollHeight);
|
|
2194
|
+
}, [c, s, l]);
|
|
2195
|
+
const m = b(n.searchingInMemoriesOfType, {
|
|
2215
2196
|
name: e.memoryTypeName
|
|
2216
|
-
}), g = !
|
|
2197
|
+
}), g = !r && s === 3;
|
|
2217
2198
|
return /* @__PURE__ */ p(
|
|
2218
|
-
|
|
2199
|
+
w.div,
|
|
2219
2200
|
{
|
|
2220
2201
|
initial: { opacity: 0 },
|
|
2221
2202
|
animate: { opacity: 1 },
|
|
@@ -2242,7 +2223,7 @@ function gr({
|
|
|
2242
2223
|
width: 32,
|
|
2243
2224
|
...g ? { paddingTop: 2 } : {}
|
|
2244
2225
|
},
|
|
2245
|
-
children: /* @__PURE__ */ o(
|
|
2226
|
+
children: /* @__PURE__ */ o(yr, { phase: r ? 1 : s })
|
|
2246
2227
|
}
|
|
2247
2228
|
),
|
|
2248
2229
|
/* @__PURE__ */ p(
|
|
@@ -2256,17 +2237,17 @@ function gr({
|
|
|
2256
2237
|
flex: 1
|
|
2257
2238
|
},
|
|
2258
2239
|
children: [
|
|
2259
|
-
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children:
|
|
2260
|
-
|
|
2240
|
+
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: i ? /* @__PURE__ */ o(
|
|
2241
|
+
M,
|
|
2261
2242
|
{
|
|
2262
|
-
text:
|
|
2243
|
+
text: m,
|
|
2263
2244
|
duration: 2.5,
|
|
2264
2245
|
repeat: !0,
|
|
2265
2246
|
color: "#999",
|
|
2266
2247
|
shimmerColor: "#000"
|
|
2267
2248
|
}
|
|
2268
2249
|
) : e.memoryTypeName }),
|
|
2269
|
-
|
|
2250
|
+
s === 1 && l && !O(e) && /* @__PURE__ */ p("div", { style: { minWidth: 0 }, children: [
|
|
2270
2251
|
/* @__PURE__ */ o(
|
|
2271
2252
|
"span",
|
|
2272
2253
|
{
|
|
@@ -2277,7 +2258,7 @@ function gr({
|
|
|
2277
2258
|
marginBottom: 4,
|
|
2278
2259
|
fontWeight: 500
|
|
2279
2260
|
},
|
|
2280
|
-
children:
|
|
2261
|
+
children: n.memorySearchQueryReasoningLabel
|
|
2281
2262
|
}
|
|
2282
2263
|
),
|
|
2283
2264
|
/* @__PURE__ */ o(
|
|
@@ -2295,13 +2276,13 @@ function gr({
|
|
|
2295
2276
|
ref: d,
|
|
2296
2277
|
className: "memory-search-generating-reasoning-viewport",
|
|
2297
2278
|
style: {
|
|
2298
|
-
minHeight:
|
|
2299
|
-
maxHeight:
|
|
2279
|
+
minHeight: cr,
|
|
2280
|
+
maxHeight: dr,
|
|
2300
2281
|
height: "auto",
|
|
2301
2282
|
overflowY: "auto",
|
|
2302
2283
|
overflowX: "hidden",
|
|
2303
|
-
fontSize:
|
|
2304
|
-
lineHeight:
|
|
2284
|
+
fontSize: B,
|
|
2285
|
+
lineHeight: W,
|
|
2305
2286
|
whiteSpace: "pre-wrap",
|
|
2306
2287
|
wordBreak: "break-word",
|
|
2307
2288
|
color: "#888"
|
|
@@ -2312,17 +2293,17 @@ function gr({
|
|
|
2312
2293
|
}
|
|
2313
2294
|
)
|
|
2314
2295
|
] }),
|
|
2315
|
-
|
|
2316
|
-
|
|
2296
|
+
s === 2 && a && /* @__PURE__ */ o("div", { style: { fontSize: 12 }, children: /* @__PURE__ */ o(
|
|
2297
|
+
M,
|
|
2317
2298
|
{
|
|
2318
|
-
text:
|
|
2299
|
+
text: n.memorySearchGeneratingQueriesPending,
|
|
2319
2300
|
duration: 2.5,
|
|
2320
2301
|
repeat: !0,
|
|
2321
2302
|
color: "#999",
|
|
2322
2303
|
shimmerColor: "#000"
|
|
2323
2304
|
}
|
|
2324
2305
|
) }),
|
|
2325
|
-
|
|
2306
|
+
s === 3 && /* @__PURE__ */ p(E, { children: [
|
|
2326
2307
|
/* @__PURE__ */ p("div", { style: { minWidth: 0 }, children: [
|
|
2327
2308
|
/* @__PURE__ */ o(
|
|
2328
2309
|
"span",
|
|
@@ -2334,7 +2315,7 @@ function gr({
|
|
|
2334
2315
|
marginBottom: 6,
|
|
2335
2316
|
fontWeight: 500
|
|
2336
2317
|
},
|
|
2337
|
-
children:
|
|
2318
|
+
children: n.memorySearchGeneratedQueriesHeading
|
|
2338
2319
|
}
|
|
2339
2320
|
),
|
|
2340
2321
|
/* @__PURE__ */ o(
|
|
@@ -2345,7 +2326,7 @@ function gr({
|
|
|
2345
2326
|
flexDirection: "column",
|
|
2346
2327
|
gap: 6
|
|
2347
2328
|
},
|
|
2348
|
-
children: e.queries.map((h,
|
|
2329
|
+
children: e.queries.map((h, f) => /* @__PURE__ */ o(
|
|
2349
2330
|
"div",
|
|
2350
2331
|
{
|
|
2351
2332
|
style: {
|
|
@@ -2356,17 +2337,17 @@ function gr({
|
|
|
2356
2337
|
},
|
|
2357
2338
|
children: h.query
|
|
2358
2339
|
},
|
|
2359
|
-
|
|
2340
|
+
f
|
|
2360
2341
|
))
|
|
2361
2342
|
}
|
|
2362
2343
|
)
|
|
2363
2344
|
] }),
|
|
2364
|
-
|
|
2345
|
+
l && /* @__PURE__ */ p(E, { children: [
|
|
2365
2346
|
/* @__PURE__ */ o(
|
|
2366
2347
|
"button",
|
|
2367
2348
|
{
|
|
2368
2349
|
type: "button",
|
|
2369
|
-
onClick: () =>
|
|
2350
|
+
onClick: () => u((h) => !h),
|
|
2370
2351
|
style: {
|
|
2371
2352
|
alignSelf: "flex-start",
|
|
2372
2353
|
border: "none",
|
|
@@ -2377,15 +2358,15 @@ function gr({
|
|
|
2377
2358
|
color: "#666",
|
|
2378
2359
|
textDecoration: "underline"
|
|
2379
2360
|
},
|
|
2380
|
-
children:
|
|
2361
|
+
children: y ? n.memorySearchHideReasoning : n.memorySearchViewReasoning
|
|
2381
2362
|
}
|
|
2382
2363
|
),
|
|
2383
|
-
|
|
2364
|
+
y && /* @__PURE__ */ o(
|
|
2384
2365
|
"div",
|
|
2385
2366
|
{
|
|
2386
2367
|
style: {
|
|
2387
|
-
fontSize:
|
|
2388
|
-
lineHeight:
|
|
2368
|
+
fontSize: B,
|
|
2369
|
+
lineHeight: W,
|
|
2389
2370
|
whiteSpace: "pre-wrap",
|
|
2390
2371
|
wordBreak: "break-word",
|
|
2391
2372
|
color: "#888",
|
|
@@ -2405,29 +2386,29 @@ function gr({
|
|
|
2405
2386
|
}
|
|
2406
2387
|
);
|
|
2407
2388
|
}
|
|
2408
|
-
const
|
|
2409
|
-
const
|
|
2389
|
+
const pr = ({ data: e, isLatest: n = !1, durationSeconds: t, t: r }) => {
|
|
2390
|
+
const s = D(() => {
|
|
2410
2391
|
let c = -1;
|
|
2411
|
-
return e.memoryTypes.forEach((
|
|
2412
|
-
|
|
2392
|
+
return e.memoryTypes.forEach((l, d) => {
|
|
2393
|
+
O(l) || (c = d);
|
|
2413
2394
|
}), c;
|
|
2414
2395
|
}, [e.memoryTypes]);
|
|
2415
2396
|
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
2416
|
-
|
|
2417
|
-
|
|
2397
|
+
n && !t && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(
|
|
2398
|
+
M,
|
|
2418
2399
|
{
|
|
2419
|
-
text:
|
|
2400
|
+
text: r.memorySearchGeneratingQueries,
|
|
2420
2401
|
duration: 2.5,
|
|
2421
2402
|
repeat: !0,
|
|
2422
2403
|
color: "#999",
|
|
2423
2404
|
shimmerColor: "#000"
|
|
2424
2405
|
}
|
|
2425
|
-
) : e.memoryTypes.map((c,
|
|
2406
|
+
) : e.memoryTypes.map((c, l) => /* @__PURE__ */ o(
|
|
2426
2407
|
gr,
|
|
2427
2408
|
{
|
|
2428
2409
|
item: c,
|
|
2429
|
-
t:
|
|
2430
|
-
isActiveRow:
|
|
2410
|
+
t: r,
|
|
2411
|
+
isActiveRow: l === s && n
|
|
2431
2412
|
},
|
|
2432
2413
|
c.memoryTypeId
|
|
2433
2414
|
)),
|
|
@@ -2440,44 +2421,44 @@ const hr = ({ data: e, isLatest: r = !1, durationSeconds: t, t: n }) => {
|
|
|
2440
2421
|
marginTop: "4px",
|
|
2441
2422
|
fontStyle: "italic"
|
|
2442
2423
|
},
|
|
2443
|
-
children:
|
|
2424
|
+
children: b(r.tookSeconds, { n: t })
|
|
2444
2425
|
}
|
|
2445
2426
|
)
|
|
2446
2427
|
] });
|
|
2447
2428
|
};
|
|
2448
|
-
function
|
|
2449
|
-
return e.some((
|
|
2429
|
+
function hr(e) {
|
|
2430
|
+
return e.some((r) => r.result == null && r.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((r) => r.error != null) ? /* @__PURE__ */ o(j, { color: "#c62828", size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(z, { color: "#999", size: 15, borderWidth: 2 });
|
|
2450
2431
|
}
|
|
2451
|
-
function
|
|
2432
|
+
function fr(e, n) {
|
|
2452
2433
|
if (e.error != null)
|
|
2453
2434
|
return /* @__PURE__ */ o("span", { style: { fontSize: 12, color: "#c62828", whiteSpace: "nowrap" }, children: e.error });
|
|
2454
2435
|
if (e.result == null)
|
|
2455
2436
|
return /* @__PURE__ */ o("span", { style: { flexShrink: 0, fontSize: 12 }, children: /* @__PURE__ */ o(
|
|
2456
|
-
|
|
2437
|
+
M,
|
|
2457
2438
|
{
|
|
2458
|
-
text:
|
|
2439
|
+
text: n.searching,
|
|
2459
2440
|
duration: 2.5,
|
|
2460
2441
|
repeat: !0,
|
|
2461
2442
|
color: "#999",
|
|
2462
2443
|
shimmerColor: "#000"
|
|
2463
2444
|
}
|
|
2464
2445
|
) });
|
|
2465
|
-
const t = e.result,
|
|
2446
|
+
const t = e.result, r = t.numberOfChunks === 1 ? n.chunkFound : b(n.chunksFound, { n: t.numberOfChunks }), s = b(n.scoreLabel, {
|
|
2466
2447
|
n: t.highestChunkScore.toFixed(2)
|
|
2467
2448
|
});
|
|
2468
2449
|
return /* @__PURE__ */ p("span", { style: { fontSize: 12, color: "#666", whiteSpace: "nowrap" }, children: [
|
|
2469
|
-
|
|
2450
|
+
r,
|
|
2470
2451
|
" · ",
|
|
2471
|
-
|
|
2452
|
+
s
|
|
2472
2453
|
] });
|
|
2473
2454
|
}
|
|
2474
|
-
function
|
|
2455
|
+
function xr({
|
|
2475
2456
|
items: e,
|
|
2476
|
-
queryRow:
|
|
2457
|
+
queryRow: n,
|
|
2477
2458
|
onExploreQueryResultClick: t,
|
|
2478
|
-
t:
|
|
2459
|
+
t: r
|
|
2479
2460
|
}) {
|
|
2480
|
-
const [
|
|
2461
|
+
const [s, c] = I(null);
|
|
2481
2462
|
if (e.length === 0)
|
|
2482
2463
|
return /* @__PURE__ */ o(
|
|
2483
2464
|
"div",
|
|
@@ -2487,10 +2468,10 @@ function Sr({
|
|
|
2487
2468
|
color: "#94a3b8",
|
|
2488
2469
|
paddingTop: 4
|
|
2489
2470
|
},
|
|
2490
|
-
children:
|
|
2471
|
+
children: r.memorySearchExploreNoResults
|
|
2491
2472
|
}
|
|
2492
2473
|
);
|
|
2493
|
-
const
|
|
2474
|
+
const l = !!t;
|
|
2494
2475
|
return /* @__PURE__ */ o(
|
|
2495
2476
|
"div",
|
|
2496
2477
|
{
|
|
@@ -2502,25 +2483,25 @@ function Sr({
|
|
|
2502
2483
|
paddingTop: 8,
|
|
2503
2484
|
borderTop: "1px solid #f0f0f0"
|
|
2504
2485
|
},
|
|
2505
|
-
children: e.map((d,
|
|
2506
|
-
const
|
|
2486
|
+
children: e.map((d, y) => {
|
|
2487
|
+
const u = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, i = V(
|
|
2507
2488
|
d.chunks
|
|
2508
|
-
),
|
|
2509
|
-
|
|
2510
|
-
|
|
2489
|
+
), a = [
|
|
2490
|
+
X(d),
|
|
2491
|
+
b(r.scoreLabel, {
|
|
2511
2492
|
n: d.matchingChunkScore.toFixed(2)
|
|
2512
2493
|
}),
|
|
2513
|
-
|
|
2494
|
+
i.length > 0 ? K(i, r) : r.pagesNotAvailable
|
|
2514
2495
|
].filter(
|
|
2515
|
-
(
|
|
2516
|
-
),
|
|
2496
|
+
(f) => f != null && f !== ""
|
|
2497
|
+
), m = {
|
|
2517
2498
|
memoryId: d.memoryId,
|
|
2518
2499
|
memoryTitle: d.memoryTitle,
|
|
2519
|
-
pageNumbers:
|
|
2520
|
-
memoryTypeId:
|
|
2521
|
-
memoryTypeName:
|
|
2522
|
-
query:
|
|
2523
|
-
}, g = `${
|
|
2500
|
+
pageNumbers: i,
|
|
2501
|
+
memoryTypeId: n.memoryTypeId,
|
|
2502
|
+
memoryTypeName: n.memoryTypeName,
|
|
2503
|
+
query: n.query
|
|
2504
|
+
}, g = `${n.query}::${d.memoryId}::${y}`, h = s === g;
|
|
2524
2505
|
return /* @__PURE__ */ p(
|
|
2525
2506
|
"div",
|
|
2526
2507
|
{
|
|
@@ -2529,9 +2510,9 @@ function Sr({
|
|
|
2529
2510
|
flexDirection: "row",
|
|
2530
2511
|
alignItems: "flex-start",
|
|
2531
2512
|
gap: "12px",
|
|
2532
|
-
paddingTop:
|
|
2533
|
-
paddingBottom:
|
|
2534
|
-
borderBottom:
|
|
2513
|
+
paddingTop: y > 0 ? 12 : 0,
|
|
2514
|
+
paddingBottom: y < e.length - 1 ? 12 : 0,
|
|
2515
|
+
borderBottom: y < e.length - 1 ? "1px solid #eee" : void 0,
|
|
2535
2516
|
minWidth: 0
|
|
2536
2517
|
},
|
|
2537
2518
|
children: [
|
|
@@ -2554,7 +2535,7 @@ function Sr({
|
|
|
2554
2535
|
fontWeight: 600,
|
|
2555
2536
|
color: "#333"
|
|
2556
2537
|
},
|
|
2557
|
-
children:
|
|
2538
|
+
children: u
|
|
2558
2539
|
}
|
|
2559
2540
|
),
|
|
2560
2541
|
/* @__PURE__ */ o(
|
|
@@ -2567,7 +2548,7 @@ function Sr({
|
|
|
2567
2548
|
whiteSpace: "pre-wrap",
|
|
2568
2549
|
wordBreak: "break-word"
|
|
2569
2550
|
},
|
|
2570
|
-
children:
|
|
2551
|
+
children: q(
|
|
2571
2552
|
d.chunks
|
|
2572
2553
|
)
|
|
2573
2554
|
}
|
|
@@ -2581,13 +2562,13 @@ function Sr({
|
|
|
2581
2562
|
color: "#94a3b8",
|
|
2582
2563
|
lineHeight: 1.35
|
|
2583
2564
|
},
|
|
2584
|
-
children:
|
|
2565
|
+
children: a.join(" · ")
|
|
2585
2566
|
}
|
|
2586
2567
|
)
|
|
2587
2568
|
]
|
|
2588
2569
|
}
|
|
2589
2570
|
),
|
|
2590
|
-
|
|
2571
|
+
l && /* @__PURE__ */ p(
|
|
2591
2572
|
"button",
|
|
2592
2573
|
{
|
|
2593
2574
|
type: "button",
|
|
@@ -2597,7 +2578,7 @@ function Sr({
|
|
|
2597
2578
|
c(g);
|
|
2598
2579
|
try {
|
|
2599
2580
|
await t(
|
|
2600
|
-
|
|
2581
|
+
m
|
|
2601
2582
|
);
|
|
2602
2583
|
} finally {
|
|
2603
2584
|
c(null);
|
|
@@ -2627,43 +2608,43 @@ function Sr({
|
|
|
2627
2608
|
"aria-hidden": !0
|
|
2628
2609
|
}
|
|
2629
2610
|
),
|
|
2630
|
-
|
|
2611
|
+
r.viewButton
|
|
2631
2612
|
]
|
|
2632
2613
|
}
|
|
2633
2614
|
)
|
|
2634
2615
|
]
|
|
2635
2616
|
},
|
|
2636
|
-
`${d.memoryId}-${
|
|
2617
|
+
`${d.memoryId}-${y}`
|
|
2637
2618
|
);
|
|
2638
2619
|
})
|
|
2639
2620
|
}
|
|
2640
2621
|
);
|
|
2641
2622
|
}
|
|
2642
|
-
function
|
|
2643
|
-
const
|
|
2644
|
-
return e.forEach((
|
|
2645
|
-
let c = t.get(
|
|
2646
|
-
c == null && (
|
|
2647
|
-
memoryTypeId:
|
|
2648
|
-
memoryTypeName:
|
|
2623
|
+
function Sr(e) {
|
|
2624
|
+
const n = [], t = /* @__PURE__ */ new Map();
|
|
2625
|
+
return e.forEach((r, s) => {
|
|
2626
|
+
let c = t.get(r.memoryTypeId);
|
|
2627
|
+
c == null && (n.push(r.memoryTypeId), c = {
|
|
2628
|
+
memoryTypeId: r.memoryTypeId,
|
|
2629
|
+
memoryTypeName: r.memoryTypeName,
|
|
2649
2630
|
items: []
|
|
2650
|
-
}, t.set(
|
|
2651
|
-
}),
|
|
2631
|
+
}, t.set(r.memoryTypeId, c)), c.items.push({ item: r, flatIndex: s });
|
|
2632
|
+
}), n.map((r) => t.get(r));
|
|
2652
2633
|
}
|
|
2653
|
-
function
|
|
2634
|
+
function Tr({
|
|
2654
2635
|
group: e,
|
|
2655
|
-
t:
|
|
2636
|
+
t: n,
|
|
2656
2637
|
lastInFlightIndex: t,
|
|
2657
|
-
isLatest:
|
|
2658
|
-
expandedRows:
|
|
2638
|
+
isLatest: r,
|
|
2639
|
+
expandedRows: s,
|
|
2659
2640
|
toggleExpanded: c,
|
|
2660
|
-
onExploreQueryResultClick:
|
|
2641
|
+
onExploreQueryResultClick: l
|
|
2661
2642
|
}) {
|
|
2662
|
-
const d = e.items.map((
|
|
2663
|
-
(
|
|
2643
|
+
const d = e.items.map((u) => u.item), y = d.some(
|
|
2644
|
+
(u) => u.result == null && u.error == null
|
|
2664
2645
|
);
|
|
2665
2646
|
return /* @__PURE__ */ p(
|
|
2666
|
-
|
|
2647
|
+
w.div,
|
|
2667
2648
|
{
|
|
2668
2649
|
initial: { opacity: 0 },
|
|
2669
2650
|
animate: { opacity: 1 },
|
|
@@ -2674,7 +2655,7 @@ function kr({
|
|
|
2674
2655
|
borderBottom: "1px solid #eee",
|
|
2675
2656
|
display: "flex",
|
|
2676
2657
|
flexDirection: "row",
|
|
2677
|
-
alignItems:
|
|
2658
|
+
alignItems: y ? "center" : "flex-start",
|
|
2678
2659
|
gap: "10px",
|
|
2679
2660
|
minWidth: 0
|
|
2680
2661
|
},
|
|
@@ -2688,9 +2669,9 @@ function kr({
|
|
|
2688
2669
|
justifyContent: "center",
|
|
2689
2670
|
flexShrink: 0,
|
|
2690
2671
|
width: 32,
|
|
2691
|
-
...
|
|
2672
|
+
...y ? {} : { paddingTop: 2 }
|
|
2692
2673
|
},
|
|
2693
|
-
children:
|
|
2674
|
+
children: hr(d)
|
|
2694
2675
|
}
|
|
2695
2676
|
),
|
|
2696
2677
|
/* @__PURE__ */ p(
|
|
@@ -2711,14 +2692,14 @@ function kr({
|
|
|
2711
2692
|
fontSize: 12,
|
|
2712
2693
|
color: "#888"
|
|
2713
2694
|
},
|
|
2714
|
-
children:
|
|
2695
|
+
children: b(n.memorySearchExploreQueryTypeLabel, {
|
|
2715
2696
|
name: e.memoryTypeName
|
|
2716
2697
|
})
|
|
2717
2698
|
}
|
|
2718
2699
|
),
|
|
2719
|
-
e.items.map(({ item:
|
|
2720
|
-
var
|
|
2721
|
-
const
|
|
2700
|
+
e.items.map(({ item: u, flatIndex: i }) => {
|
|
2701
|
+
var S;
|
|
2702
|
+
const a = u.result != null, m = u.error != null, g = i === t && r && !a && !m, h = s[i] === !0, f = ((S = u.result) == null ? void 0 : S.items) ?? [];
|
|
2722
2703
|
return /* @__PURE__ */ p(
|
|
2723
2704
|
"div",
|
|
2724
2705
|
{
|
|
@@ -2753,15 +2734,15 @@ function kr({
|
|
|
2753
2734
|
minWidth: 0
|
|
2754
2735
|
},
|
|
2755
2736
|
children: g ? /* @__PURE__ */ o(
|
|
2756
|
-
|
|
2737
|
+
M,
|
|
2757
2738
|
{
|
|
2758
|
-
text:
|
|
2739
|
+
text: u.query,
|
|
2759
2740
|
duration: 2.5,
|
|
2760
2741
|
repeat: !0,
|
|
2761
2742
|
color: "#999",
|
|
2762
2743
|
shimmerColor: "#000"
|
|
2763
2744
|
}
|
|
2764
|
-
) :
|
|
2745
|
+
) : u.query
|
|
2765
2746
|
}
|
|
2766
2747
|
),
|
|
2767
2748
|
/* @__PURE__ */ p(
|
|
@@ -2775,12 +2756,12 @@ function kr({
|
|
|
2775
2756
|
flexShrink: 0
|
|
2776
2757
|
},
|
|
2777
2758
|
children: [
|
|
2778
|
-
|
|
2779
|
-
|
|
2759
|
+
fr(u, n),
|
|
2760
|
+
a && /* @__PURE__ */ o(
|
|
2780
2761
|
"button",
|
|
2781
2762
|
{
|
|
2782
2763
|
type: "button",
|
|
2783
|
-
onClick: () => c(
|
|
2764
|
+
onClick: () => c(i),
|
|
2784
2765
|
style: {
|
|
2785
2766
|
border: "none",
|
|
2786
2767
|
background: "none",
|
|
@@ -2791,7 +2772,7 @@ function kr({
|
|
|
2791
2772
|
textDecoration: "underline",
|
|
2792
2773
|
fontFamily: "inherit"
|
|
2793
2774
|
},
|
|
2794
|
-
children: h ?
|
|
2775
|
+
children: h ? n.memorySearchHideExploreResults : n.memorySearchViewExploreResults
|
|
2795
2776
|
}
|
|
2796
2777
|
)
|
|
2797
2778
|
]
|
|
@@ -2800,18 +2781,18 @@ function kr({
|
|
|
2800
2781
|
]
|
|
2801
2782
|
}
|
|
2802
2783
|
),
|
|
2803
|
-
|
|
2804
|
-
|
|
2784
|
+
a && h && /* @__PURE__ */ o(
|
|
2785
|
+
xr,
|
|
2805
2786
|
{
|
|
2806
|
-
items:
|
|
2807
|
-
queryRow:
|
|
2808
|
-
onExploreQueryResultClick:
|
|
2809
|
-
t:
|
|
2787
|
+
items: f,
|
|
2788
|
+
queryRow: u,
|
|
2789
|
+
onExploreQueryResultClick: l,
|
|
2790
|
+
t: n
|
|
2810
2791
|
}
|
|
2811
2792
|
)
|
|
2812
2793
|
]
|
|
2813
2794
|
},
|
|
2814
|
-
`${e.memoryTypeId}-${
|
|
2795
|
+
`${e.memoryTypeId}-${i}-${u.query}`
|
|
2815
2796
|
);
|
|
2816
2797
|
})
|
|
2817
2798
|
]
|
|
@@ -2821,51 +2802,51 @@ function kr({
|
|
|
2821
2802
|
}
|
|
2822
2803
|
);
|
|
2823
2804
|
}
|
|
2824
|
-
const
|
|
2805
|
+
const kr = ({
|
|
2825
2806
|
data: e,
|
|
2826
|
-
isLatest:
|
|
2807
|
+
isLatest: n = !1,
|
|
2827
2808
|
durationSeconds: t,
|
|
2828
|
-
onExploreQueryResultClick:
|
|
2829
|
-
t:
|
|
2809
|
+
onExploreQueryResultClick: r,
|
|
2810
|
+
t: s
|
|
2830
2811
|
}) => {
|
|
2831
|
-
const [c,
|
|
2812
|
+
const [c, l] = I(
|
|
2832
2813
|
{}
|
|
2833
|
-
), d =
|
|
2834
|
-
|
|
2835
|
-
...
|
|
2836
|
-
[
|
|
2814
|
+
), d = N((i) => {
|
|
2815
|
+
l((a) => ({
|
|
2816
|
+
...a,
|
|
2817
|
+
[i]: !a[i]
|
|
2837
2818
|
}));
|
|
2838
|
-
}, []),
|
|
2839
|
-
let
|
|
2840
|
-
return e.queries.forEach((
|
|
2841
|
-
|
|
2842
|
-
}),
|
|
2843
|
-
}, [e.queries]),
|
|
2844
|
-
() =>
|
|
2819
|
+
}, []), y = D(() => {
|
|
2820
|
+
let i = -1;
|
|
2821
|
+
return e.queries.forEach((a, m) => {
|
|
2822
|
+
a.result == null && a.error == null && (i = m);
|
|
2823
|
+
}), i;
|
|
2824
|
+
}, [e.queries]), u = D(
|
|
2825
|
+
() => Sr(e.queries),
|
|
2845
2826
|
[e.queries]
|
|
2846
2827
|
);
|
|
2847
2828
|
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
2848
|
-
|
|
2849
|
-
|
|
2829
|
+
n && !t && e.queries.length === 0 ? /* @__PURE__ */ o(
|
|
2830
|
+
M,
|
|
2850
2831
|
{
|
|
2851
|
-
text:
|
|
2832
|
+
text: s.memorySearchExploringQueries,
|
|
2852
2833
|
duration: 2.5,
|
|
2853
2834
|
repeat: !0,
|
|
2854
2835
|
color: "#999",
|
|
2855
2836
|
shimmerColor: "#000"
|
|
2856
2837
|
}
|
|
2857
|
-
) :
|
|
2858
|
-
|
|
2838
|
+
) : u.map((i) => /* @__PURE__ */ o(
|
|
2839
|
+
Tr,
|
|
2859
2840
|
{
|
|
2860
|
-
group:
|
|
2861
|
-
t:
|
|
2862
|
-
lastInFlightIndex:
|
|
2863
|
-
isLatest:
|
|
2841
|
+
group: i,
|
|
2842
|
+
t: s,
|
|
2843
|
+
lastInFlightIndex: y,
|
|
2844
|
+
isLatest: n,
|
|
2864
2845
|
expandedRows: c,
|
|
2865
2846
|
toggleExpanded: d,
|
|
2866
|
-
onExploreQueryResultClick:
|
|
2847
|
+
onExploreQueryResultClick: r
|
|
2867
2848
|
},
|
|
2868
|
-
|
|
2849
|
+
i.memoryTypeId
|
|
2869
2850
|
)),
|
|
2870
2851
|
t !== void 0 && /* @__PURE__ */ o(
|
|
2871
2852
|
"div",
|
|
@@ -2876,15 +2857,15 @@ const br = ({
|
|
|
2876
2857
|
marginTop: "4px",
|
|
2877
2858
|
fontStyle: "italic"
|
|
2878
2859
|
},
|
|
2879
|
-
children:
|
|
2860
|
+
children: b(s.tookSeconds, { n: t })
|
|
2880
2861
|
}
|
|
2881
2862
|
)
|
|
2882
2863
|
] });
|
|
2883
|
-
},
|
|
2884
|
-
const
|
|
2864
|
+
}, br = ({ data: e, onSearchResultClick: n, t }) => {
|
|
2865
|
+
const r = e.response.items, s = !!n, [c, l] = I(null);
|
|
2885
2866
|
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
2886
2867
|
/* @__PURE__ */ o(
|
|
2887
|
-
|
|
2868
|
+
w.div,
|
|
2888
2869
|
{
|
|
2889
2870
|
style: {
|
|
2890
2871
|
marginBottom: "12px",
|
|
@@ -2906,30 +2887,30 @@ const br = ({
|
|
|
2906
2887
|
flexDirection: "column",
|
|
2907
2888
|
gap: 0
|
|
2908
2889
|
},
|
|
2909
|
-
children:
|
|
2910
|
-
const
|
|
2890
|
+
children: r.map((d, y) => {
|
|
2891
|
+
const u = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, i = V(
|
|
2911
2892
|
d.chunks
|
|
2912
|
-
),
|
|
2913
|
-
|
|
2914
|
-
|
|
2893
|
+
), a = [
|
|
2894
|
+
X(d),
|
|
2895
|
+
b(t.scoreLabel, {
|
|
2915
2896
|
n: d.matchingChunkScore.toFixed(2)
|
|
2916
2897
|
}),
|
|
2917
|
-
|
|
2898
|
+
i.length > 0 ? K(i, t) : t.pagesNotAvailable
|
|
2918
2899
|
].filter(
|
|
2919
|
-
(
|
|
2920
|
-
),
|
|
2900
|
+
(f) => f != null && f !== ""
|
|
2901
|
+
), m = {
|
|
2921
2902
|
memoryId: d.memoryId,
|
|
2922
2903
|
memoryTitle: d.memoryTitle,
|
|
2923
2904
|
memoryTypeId: d.memoryTypeId,
|
|
2924
2905
|
memoryTypeName: d.memoryTypeName,
|
|
2925
|
-
pageNumbers:
|
|
2926
|
-
}, g = `${d.memoryId}-${
|
|
2906
|
+
pageNumbers: i
|
|
2907
|
+
}, g = `${d.memoryId}-${y}`, h = c === g;
|
|
2927
2908
|
return /* @__PURE__ */ p(
|
|
2928
|
-
|
|
2909
|
+
w.div,
|
|
2929
2910
|
{
|
|
2930
2911
|
initial: { opacity: 0 },
|
|
2931
2912
|
animate: { opacity: 1 },
|
|
2932
|
-
transition: { duration: 0.2, delay:
|
|
2913
|
+
transition: { duration: 0.2, delay: y * 0.04 },
|
|
2933
2914
|
style: {
|
|
2934
2915
|
display: "flex",
|
|
2935
2916
|
flexDirection: "row",
|
|
@@ -2937,7 +2918,7 @@ const br = ({
|
|
|
2937
2918
|
gap: "12px",
|
|
2938
2919
|
paddingTop: "12px",
|
|
2939
2920
|
paddingBottom: "12px",
|
|
2940
|
-
borderBottom:
|
|
2921
|
+
borderBottom: y < r.length - 1 ? "1px solid #eee" : void 0,
|
|
2941
2922
|
minWidth: 0
|
|
2942
2923
|
},
|
|
2943
2924
|
children: [
|
|
@@ -2960,7 +2941,7 @@ const br = ({
|
|
|
2960
2941
|
fontWeight: 600,
|
|
2961
2942
|
color: "#333"
|
|
2962
2943
|
},
|
|
2963
|
-
children:
|
|
2944
|
+
children: u
|
|
2964
2945
|
}
|
|
2965
2946
|
),
|
|
2966
2947
|
/* @__PURE__ */ o(
|
|
@@ -2973,7 +2954,7 @@ const br = ({
|
|
|
2973
2954
|
whiteSpace: "pre-wrap",
|
|
2974
2955
|
wordBreak: "break-word"
|
|
2975
2956
|
},
|
|
2976
|
-
children:
|
|
2957
|
+
children: q(d.chunks)
|
|
2977
2958
|
}
|
|
2978
2959
|
),
|
|
2979
2960
|
/* @__PURE__ */ o(
|
|
@@ -2985,24 +2966,24 @@ const br = ({
|
|
|
2985
2966
|
color: "#94a3b8",
|
|
2986
2967
|
lineHeight: 1.35
|
|
2987
2968
|
},
|
|
2988
|
-
children:
|
|
2969
|
+
children: a.join(" · ")
|
|
2989
2970
|
}
|
|
2990
2971
|
)
|
|
2991
2972
|
]
|
|
2992
2973
|
}
|
|
2993
2974
|
),
|
|
2994
|
-
|
|
2975
|
+
s && /* @__PURE__ */ p(
|
|
2995
2976
|
"button",
|
|
2996
2977
|
{
|
|
2997
2978
|
type: "button",
|
|
2998
2979
|
"aria-busy": h,
|
|
2999
2980
|
disabled: h,
|
|
3000
2981
|
onClick: async () => {
|
|
3001
|
-
|
|
2982
|
+
l(g);
|
|
3002
2983
|
try {
|
|
3003
|
-
await
|
|
2984
|
+
await n(m);
|
|
3004
2985
|
} finally {
|
|
3005
|
-
|
|
2986
|
+
l(null);
|
|
3006
2987
|
}
|
|
3007
2988
|
},
|
|
3008
2989
|
style: {
|
|
@@ -3035,14 +3016,14 @@ const br = ({
|
|
|
3035
3016
|
)
|
|
3036
3017
|
]
|
|
3037
3018
|
},
|
|
3038
|
-
`${d.memoryId}-${
|
|
3019
|
+
`${d.memoryId}-${y}`
|
|
3039
3020
|
);
|
|
3040
3021
|
})
|
|
3041
3022
|
}
|
|
3042
3023
|
)
|
|
3043
3024
|
] });
|
|
3044
|
-
},
|
|
3045
|
-
|
|
3025
|
+
}, G = ({ message: e }) => /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
|
|
3026
|
+
w.div,
|
|
3046
3027
|
{
|
|
3047
3028
|
initial: { opacity: 0, y: -10 },
|
|
3048
3029
|
animate: { opacity: 1, y: 0 },
|
|
@@ -3064,214 +3045,214 @@ const br = ({
|
|
|
3064
3045
|
}
|
|
3065
3046
|
)
|
|
3066
3047
|
}
|
|
3067
|
-
) }),
|
|
3048
|
+
) }), vr = ({
|
|
3068
3049
|
progressViewItems: e,
|
|
3050
|
+
loading: n,
|
|
3051
|
+
error: t,
|
|
3069
3052
|
loadingText: r,
|
|
3070
|
-
t,
|
|
3071
|
-
onSourceClick:
|
|
3053
|
+
t: s,
|
|
3054
|
+
onSourceClick: c,
|
|
3072
3055
|
onSearchResultClick: l,
|
|
3073
|
-
onExploreQueryResultClick:
|
|
3056
|
+
onExploreQueryResultClick: d
|
|
3074
3057
|
}) => {
|
|
3075
|
-
const
|
|
3058
|
+
const y = F(null);
|
|
3076
3059
|
R(() => {
|
|
3077
|
-
|
|
3060
|
+
y.current && (y.current.scrollTop = y.current.scrollHeight);
|
|
3078
3061
|
}, [e.length]);
|
|
3079
|
-
const
|
|
3080
|
-
const
|
|
3081
|
-
if (
|
|
3082
|
-
return /* @__PURE__ */ o(
|
|
3083
|
-
if (
|
|
3084
|
-
return /* @__PURE__ */ o(
|
|
3085
|
-
if (
|
|
3086
|
-
switch (
|
|
3062
|
+
const u = (a) => {
|
|
3063
|
+
const m = a.item.data;
|
|
3064
|
+
if (m.taskType === "StreamingChatCompletion" && m.eventType === "Text")
|
|
3065
|
+
return /* @__PURE__ */ o(ee, { text: m.text });
|
|
3066
|
+
if (m.taskType === "StructuredChatCompletion" && m.eventType === "Completed")
|
|
3067
|
+
return /* @__PURE__ */ o(Be, { data: m });
|
|
3068
|
+
if (m.taskType === "MemoryChat")
|
|
3069
|
+
switch (m.eventType) {
|
|
3087
3070
|
case "Text":
|
|
3088
|
-
return /* @__PURE__ */ o(
|
|
3071
|
+
return /* @__PURE__ */ o(ee, { text: m.text });
|
|
3089
3072
|
case "FindMemories":
|
|
3090
3073
|
return /* @__PURE__ */ o(
|
|
3091
|
-
|
|
3074
|
+
_e,
|
|
3092
3075
|
{
|
|
3093
|
-
data:
|
|
3094
|
-
isLatest:
|
|
3095
|
-
durationSeconds:
|
|
3096
|
-
t
|
|
3076
|
+
data: m,
|
|
3077
|
+
isLatest: a.isLatest,
|
|
3078
|
+
durationSeconds: a.durationSeconds,
|
|
3079
|
+
t: s
|
|
3097
3080
|
}
|
|
3098
3081
|
);
|
|
3099
3082
|
case "FindMemoriesResult":
|
|
3100
3083
|
return /* @__PURE__ */ o(
|
|
3101
|
-
|
|
3084
|
+
Ge,
|
|
3102
3085
|
{
|
|
3103
|
-
data:
|
|
3104
|
-
t
|
|
3086
|
+
data: m,
|
|
3087
|
+
t: s
|
|
3105
3088
|
}
|
|
3106
3089
|
);
|
|
3107
3090
|
case "Search":
|
|
3108
3091
|
return /* @__PURE__ */ o(
|
|
3109
|
-
|
|
3092
|
+
He,
|
|
3110
3093
|
{
|
|
3111
|
-
data:
|
|
3112
|
-
isLatest:
|
|
3113
|
-
durationSeconds:
|
|
3114
|
-
t
|
|
3094
|
+
data: m,
|
|
3095
|
+
isLatest: a.isLatest,
|
|
3096
|
+
durationSeconds: a.durationSeconds,
|
|
3097
|
+
t: s
|
|
3115
3098
|
}
|
|
3116
3099
|
);
|
|
3117
3100
|
case "FindSources":
|
|
3118
3101
|
return /* @__PURE__ */ o(
|
|
3119
3102
|
Ue,
|
|
3120
3103
|
{
|
|
3121
|
-
data:
|
|
3122
|
-
isLatest:
|
|
3123
|
-
durationSeconds:
|
|
3124
|
-
t
|
|
3104
|
+
data: m,
|
|
3105
|
+
isLatest: a.isLatest,
|
|
3106
|
+
durationSeconds: a.durationSeconds,
|
|
3107
|
+
t: s
|
|
3125
3108
|
}
|
|
3126
3109
|
);
|
|
3127
3110
|
case "SourcesResult":
|
|
3128
3111
|
return /* @__PURE__ */ o(
|
|
3129
|
-
|
|
3112
|
+
je,
|
|
3130
3113
|
{
|
|
3131
|
-
data:
|
|
3132
|
-
onSourceClick:
|
|
3133
|
-
t
|
|
3114
|
+
data: m,
|
|
3115
|
+
onSourceClick: c,
|
|
3116
|
+
t: s
|
|
3134
3117
|
}
|
|
3135
3118
|
);
|
|
3136
3119
|
case "ExploreMemories":
|
|
3137
3120
|
return /* @__PURE__ */ o(
|
|
3138
|
-
|
|
3121
|
+
Xe,
|
|
3139
3122
|
{
|
|
3140
|
-
data:
|
|
3141
|
-
completed:
|
|
3142
|
-
isLatest:
|
|
3143
|
-
t
|
|
3123
|
+
data: m,
|
|
3124
|
+
completed: a.completed,
|
|
3125
|
+
isLatest: a.isLatest,
|
|
3126
|
+
t: s
|
|
3144
3127
|
}
|
|
3145
3128
|
);
|
|
3146
3129
|
case "ChunkResults":
|
|
3147
3130
|
return /* @__PURE__ */ o(
|
|
3148
|
-
|
|
3131
|
+
or,
|
|
3149
3132
|
{
|
|
3150
|
-
data:
|
|
3133
|
+
data: m,
|
|
3151
3134
|
onSearchResultClick: l,
|
|
3152
|
-
t
|
|
3135
|
+
t: s
|
|
3153
3136
|
}
|
|
3154
3137
|
);
|
|
3155
3138
|
case "Completed":
|
|
3156
3139
|
return null;
|
|
3157
3140
|
}
|
|
3158
|
-
if (
|
|
3159
|
-
switch (
|
|
3141
|
+
if (m.taskType === "MemorySearch")
|
|
3142
|
+
switch (m.eventType) {
|
|
3160
3143
|
case "GeneratingQueries":
|
|
3161
3144
|
return /* @__PURE__ */ o(
|
|
3162
|
-
|
|
3145
|
+
pr,
|
|
3163
3146
|
{
|
|
3164
|
-
data:
|
|
3165
|
-
isLatest:
|
|
3166
|
-
durationSeconds:
|
|
3167
|
-
t
|
|
3147
|
+
data: m,
|
|
3148
|
+
isLatest: a.isLatest,
|
|
3149
|
+
durationSeconds: a.durationSeconds,
|
|
3150
|
+
t: s
|
|
3168
3151
|
}
|
|
3169
3152
|
);
|
|
3170
3153
|
case "ExploreQueries":
|
|
3171
3154
|
return /* @__PURE__ */ o(
|
|
3172
|
-
|
|
3155
|
+
kr,
|
|
3173
3156
|
{
|
|
3174
|
-
data:
|
|
3175
|
-
isLatest:
|
|
3176
|
-
durationSeconds:
|
|
3177
|
-
onExploreQueryResultClick:
|
|
3178
|
-
t
|
|
3157
|
+
data: m,
|
|
3158
|
+
isLatest: a.isLatest,
|
|
3159
|
+
durationSeconds: a.durationSeconds,
|
|
3160
|
+
onExploreQueryResultClick: d,
|
|
3161
|
+
t: s
|
|
3179
3162
|
}
|
|
3180
3163
|
);
|
|
3181
3164
|
case "SearchMemoryTypes":
|
|
3182
3165
|
return /* @__PURE__ */ o(
|
|
3183
|
-
|
|
3166
|
+
lr,
|
|
3184
3167
|
{
|
|
3185
|
-
data:
|
|
3186
|
-
isLatest:
|
|
3187
|
-
durationSeconds:
|
|
3188
|
-
t
|
|
3168
|
+
data: m,
|
|
3169
|
+
isLatest: a.isLatest,
|
|
3170
|
+
durationSeconds: a.durationSeconds,
|
|
3171
|
+
t: s
|
|
3189
3172
|
}
|
|
3190
3173
|
);
|
|
3191
3174
|
case "Completed":
|
|
3192
3175
|
return /* @__PURE__ */ o(
|
|
3193
|
-
|
|
3176
|
+
br,
|
|
3194
3177
|
{
|
|
3195
|
-
data:
|
|
3178
|
+
data: m,
|
|
3196
3179
|
onSearchResultClick: l,
|
|
3197
|
-
t
|
|
3180
|
+
t: s
|
|
3198
3181
|
}
|
|
3199
3182
|
);
|
|
3200
3183
|
}
|
|
3201
|
-
return
|
|
3184
|
+
return m.taskType === "StreamingChatCompletion" && m.eventType === "Completed" ? null : m.eventType === "Error" && "message" in m ? /* @__PURE__ */ o(G, { message: m.message }) : null;
|
|
3202
3185
|
};
|
|
3203
3186
|
if (e.length === 0)
|
|
3204
|
-
return /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(
|
|
3205
|
-
|
|
3187
|
+
return t ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(G, { message: t.message }) }) : n ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(
|
|
3188
|
+
M,
|
|
3206
3189
|
{
|
|
3207
|
-
text: r ??
|
|
3190
|
+
text: r ?? s.processingYourTask,
|
|
3208
3191
|
duration: 1.5,
|
|
3209
3192
|
repeat: !0,
|
|
3210
3193
|
repeatDelay: 0,
|
|
3211
3194
|
color: "#999",
|
|
3212
3195
|
shimmerColor: "#000"
|
|
3213
3196
|
}
|
|
3214
|
-
) });
|
|
3215
|
-
const
|
|
3216
|
-
const
|
|
3217
|
-
return
|
|
3197
|
+
) }) : null;
|
|
3198
|
+
const i = e.filter((a, m) => {
|
|
3199
|
+
const g = a.item.data;
|
|
3200
|
+
return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(m + 1).some(
|
|
3218
3201
|
(x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "ExploreMemories"
|
|
3219
|
-
) :
|
|
3202
|
+
) : g.taskType === "MemorySearch" && g.eventType === "GeneratingQueries" ? !e.slice(m + 1).some(
|
|
3220
3203
|
(x) => x.item.data.taskType === "MemorySearch" && x.item.data.eventType === "GeneratingQueries"
|
|
3221
|
-
) :
|
|
3204
|
+
) : g.taskType === "MemorySearch" && g.eventType === "ExploreQueries" ? !e.slice(m + 1).some(
|
|
3222
3205
|
(x) => x.item.data.taskType === "MemorySearch" && x.item.data.eventType === "ExploreQueries"
|
|
3223
|
-
) :
|
|
3206
|
+
) : g.taskType === "MemoryChat" && g.eventType === "ChunkResults" ? !e.slice(m + 1).some(
|
|
3224
3207
|
(x) => x.item.data.taskType === "MemoryChat" && x.item.data.eventType === "ChunkResults"
|
|
3225
3208
|
) : !0;
|
|
3226
3209
|
});
|
|
3227
|
-
return /* @__PURE__ */
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3210
|
+
return /* @__PURE__ */ p("div", { id: "agent-task-progress-verbose", ref: y, children: [
|
|
3211
|
+
/* @__PURE__ */ o(pe, { children: i.map((a, m) => /* @__PURE__ */ o(
|
|
3212
|
+
w.div,
|
|
3213
|
+
{
|
|
3214
|
+
id: `agent-task-progress-item-${a.item.progressItemId}`,
|
|
3215
|
+
initial: { opacity: 0, y: -20 },
|
|
3216
|
+
animate: { opacity: 1, y: 0 },
|
|
3217
|
+
transition: {
|
|
3218
|
+
duration: 0.4,
|
|
3219
|
+
delay: m * 0.1,
|
|
3220
|
+
ease: "easeOut"
|
|
3221
|
+
},
|
|
3222
|
+
children: u(a)
|
|
3237
3223
|
},
|
|
3238
|
-
|
|
3239
|
-
},
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
},
|
|
3224
|
+
a.item.progressItemId
|
|
3225
|
+
)) }),
|
|
3226
|
+
t ? /* @__PURE__ */ o("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ o(G, { message: t.message }) }) : null
|
|
3227
|
+
] });
|
|
3228
|
+
}, Dr = ({
|
|
3243
3229
|
agentTask: e,
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
onExploreQueryResultClick: c
|
|
3230
|
+
language: n,
|
|
3231
|
+
onSourceClick: t,
|
|
3232
|
+
onSearchResultClick: r,
|
|
3233
|
+
onExploreQueryResultClick: s
|
|
3249
3234
|
}) => {
|
|
3250
|
-
const
|
|
3251
|
-
return
|
|
3252
|
-
|
|
3253
|
-
{
|
|
3254
|
-
progressViewItems: s,
|
|
3255
|
-
t: m
|
|
3256
|
-
}
|
|
3257
|
-
) : /* @__PURE__ */ o(
|
|
3258
|
-
wr,
|
|
3235
|
+
const c = Oe(e), l = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : n ?? "en", d = $e(l);
|
|
3236
|
+
return /* @__PURE__ */ o(
|
|
3237
|
+
vr,
|
|
3259
3238
|
{
|
|
3260
|
-
progressViewItems:
|
|
3239
|
+
progressViewItems: c,
|
|
3240
|
+
loading: e.loading,
|
|
3241
|
+
error: e.error,
|
|
3261
3242
|
loadingText: e.loadingText,
|
|
3262
|
-
t:
|
|
3263
|
-
onSourceClick:
|
|
3264
|
-
onSearchResultClick:
|
|
3265
|
-
onExploreQueryResultClick:
|
|
3243
|
+
t: d,
|
|
3244
|
+
onSourceClick: t,
|
|
3245
|
+
onSearchResultClick: r,
|
|
3246
|
+
onExploreQueryResultClick: s
|
|
3266
3247
|
}
|
|
3267
3248
|
);
|
|
3268
3249
|
};
|
|
3269
3250
|
export {
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3251
|
+
Dr as AgentTaskProgress,
|
|
3252
|
+
z as Checkmark,
|
|
3253
|
+
Fr as FencyProvider,
|
|
3254
|
+
br as MemorySearchCompletedResults,
|
|
3255
|
+
Me as StreamEventManager,
|
|
3256
|
+
j as XMark,
|
|
3257
|
+
Pr as useAgentTasks
|
|
3277
3258
|
};
|