@versini/sassysaint 8.76.0 → 8.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AboutChangelog.0kKcS_nT.js → AboutChangelog.tVLL6MtY.js} +10 -9
- package/dist/chunks/{AboutEntry.pKgicvGA.js → AboutEntry.D9MonPwL.js} +11 -11
- package/dist/chunks/App.CusyBC2e.js +9011 -0
- package/dist/chunks/{Chart.DD1RkG8X.js → Chart.bKur3H71.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.K55U7Bno.js → ChatBubbleAssistant.CEZZn7AD.js} +25 -23
- package/dist/chunks/ChatBubbleUser.BYLIgaHX.js +131 -0
- package/dist/chunks/ChatHistoryTable.D9mUtUwJ.js +237 -0
- package/dist/chunks/HistoryEntry.DarYFRIp.js +316 -0
- package/dist/chunks/{ProfileEntry.Bb-kLfDX.js → ProfileEntry.C_Y--pVY.js} +26 -26
- package/dist/chunks/{SettingsEntry.DrmBVh-w.js → SettingsEntry.DffchAfB.js} +39 -39
- package/dist/chunks/Table.DBfFG7qO.js +359 -0
- package/dist/chunks/{UsageEntry.O3YdUF30.js → UsageEntry.C73mIvmD.js} +19 -19
- package/dist/chunks/{UserMemoriesPanel.Dl5GlyBr.js → UserMemoriesPanel.DXx_9ifJ.js} +184 -210
- package/dist/chunks/index.AVBqcs3f.js +266 -0
- package/dist/chunks/{index.DUl-LwyU.js → index.B4-jvDi6.js} +1 -1
- package/dist/chunks/{index.DEKgWsou.js → index.BVMzTtBw.js} +1 -1
- package/dist/chunks/index.BcYESdDV.js +7894 -0
- package/dist/chunks/{index.DGkW9g6n.js → index.ClJfV5zs.js} +3 -3
- package/dist/chunks/{index.BeIiCAAq.js → index.Hv_qeE7S.js} +2 -2
- package/dist/chunks/{index.B9mUNJfd.js → index.Ly8CrT48.js} +1 -1
- package/dist/chunks/index.bx7cnejn.js +153 -0
- package/dist/chunks/{useMarkdown.Bf7wGKkC.js → useMarkdown.KipSXqDZ.js} +2004 -2130
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +2 -2
- package/package.json +5 -5
- package/dist/chunks/App.CtFpHv2O.js +0 -10007
- package/dist/chunks/ChatBubbleUser.DsX56Kxx.js +0 -128
- package/dist/chunks/ChatHistoryTable.BvEUTjiq.js +0 -288
- package/dist/chunks/HistoryEntry.BSOPWYO2.js +0 -333
- package/dist/chunks/Table.BbIvEnBz.js +0 -456
- package/dist/chunks/index.BNusLsEn.js +0 -357
- package/dist/chunks/index.Czv_1MTM.js +0 -7203
- package/dist/chunks/index.icjUE8II.js +0 -249
|
@@ -1,100 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
monotone: n,
|
|
13
|
-
...S
|
|
14
|
-
}) => /* @__PURE__ */ r(
|
|
15
|
-
Ne,
|
|
16
|
-
{
|
|
17
|
-
defaultViewBox: "0 0 512 512",
|
|
18
|
-
size: "size-5",
|
|
19
|
-
viewBox: w,
|
|
20
|
-
className: A,
|
|
21
|
-
title: l || "Edit",
|
|
22
|
-
...S,
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
-
"path",
|
|
26
|
-
{
|
|
27
|
-
d: "M0 160c0-53 43-96 96-96h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32 14.3-32 32v256c0 17.7 14.3 32 32 32h256c17.7 0 32-14.3 32-32v-96c0-17.7 14.3-32 32-32s32 14.3 32 32v96c0 53-43 96-96 96H96c-53 0-96-43-96-96z",
|
|
28
|
-
opacity: n ? "1" : "0.4"
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ e("path", { d: "m392.4 21.7-30.1 30 97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2l-18.7-18.6c-21.9-21.9-57.3-21.9-79.2 0m-52.7 52.6L172.4 241.7c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5l167.3-167.4z" })
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
), _e = ({
|
|
35
|
-
open: A,
|
|
36
|
-
onOpenChange: w,
|
|
37
|
-
initialText: l,
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { L as R, j as A, Button as M, n as Ne, useLocalStorage as K, LOCAL_STORAGE_PREFIX as Q, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as we, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ke, useUserMemories as Se, useExpiredMemories as Te, useDeleteMemory as ve, useDeleteAllActiveMemories as De, useDeleteAllExpiredMemories as Me, useUpdateMemory as Ee, useRestoreMemory as be, ButtonIcon as O, IconEdit as Re, IconDelete as Z, IconRestore as Ie } from "./index.BcYESdDV.js";
|
|
3
|
+
import { Panel as le, Toggle as _, e as l, ConfirmationPanel as ee, Tooltip as z } from "./App.CusyBC2e.js";
|
|
4
|
+
import y from "clsx";
|
|
5
|
+
import { useState as C, useEffect as Le, useRef as te } from "react";
|
|
6
|
+
import { TextArea as Oe } from "./index.AVBqcs3f.js";
|
|
7
|
+
import { W as re, j as ie, G as D, M as s, F as B, H as ne, D as oe } from "./Table.DBfFG7qO.js";
|
|
8
|
+
const _e = ({
|
|
9
|
+
open: N,
|
|
10
|
+
onOpenChange: E,
|
|
11
|
+
initialText: a,
|
|
38
12
|
metadata: n,
|
|
39
|
-
onSave:
|
|
13
|
+
onSave: I,
|
|
40
14
|
isSaving: m = !1
|
|
41
15
|
}) => {
|
|
42
|
-
const [p,
|
|
16
|
+
const [p, L] = C(a), [h, w] = C("none");
|
|
43
17
|
Le(() => {
|
|
44
|
-
if (
|
|
45
|
-
|
|
18
|
+
if (N) {
|
|
19
|
+
L(a);
|
|
46
20
|
const o = n?.expiration || "none";
|
|
47
|
-
|
|
21
|
+
w(o);
|
|
48
22
|
}
|
|
49
|
-
}, [
|
|
50
|
-
const
|
|
23
|
+
}, [N, a, n?.expiration]);
|
|
24
|
+
const S = () => {
|
|
51
25
|
if (p.trim().length >= 3) {
|
|
52
26
|
const o = h === "none" ? null : h;
|
|
53
|
-
|
|
27
|
+
I(p.trim(), o);
|
|
54
28
|
}
|
|
55
|
-
}, u = p.trim().length >= 3,
|
|
29
|
+
}, u = p.trim().length >= 3, T = p.trim() !== a.trim() || h !== (n?.expiration || "none");
|
|
56
30
|
return /* @__PURE__ */ e(
|
|
57
31
|
le,
|
|
58
32
|
{
|
|
59
|
-
open:
|
|
60
|
-
onOpenChange:
|
|
33
|
+
open: N,
|
|
34
|
+
onOpenChange: E,
|
|
61
35
|
title: "Edit Memory",
|
|
62
36
|
animation: !0,
|
|
63
37
|
animationType: "fade",
|
|
64
|
-
footer: /* @__PURE__ */ r(
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
|
|
38
|
+
footer: /* @__PURE__ */ r(R, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
39
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
40
|
+
M,
|
|
67
41
|
{
|
|
68
42
|
mode: "dark",
|
|
69
43
|
variant: "secondary",
|
|
70
44
|
noBorder: !0,
|
|
71
45
|
focusMode: "light",
|
|
72
|
-
onClick: () =>
|
|
46
|
+
onClick: () => E(!1),
|
|
73
47
|
disabled: m,
|
|
74
48
|
children: "Cancel"
|
|
75
49
|
}
|
|
76
50
|
) }),
|
|
77
|
-
/* @__PURE__ */ e(
|
|
78
|
-
|
|
51
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
52
|
+
M,
|
|
79
53
|
{
|
|
80
54
|
mode: "dark",
|
|
81
55
|
focusMode: "light",
|
|
82
|
-
disabled: m || !u || !
|
|
83
|
-
onClick:
|
|
56
|
+
disabled: m || !u || !T,
|
|
57
|
+
onClick: S,
|
|
84
58
|
children: m ? "Saving..." : "Save"
|
|
85
59
|
}
|
|
86
60
|
) })
|
|
87
61
|
] }),
|
|
88
62
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col pt-2 gap-4", children: [
|
|
89
63
|
/* @__PURE__ */ e(
|
|
90
|
-
|
|
64
|
+
Oe,
|
|
91
65
|
{
|
|
92
66
|
mode: "dark",
|
|
93
67
|
focusMode: "light",
|
|
94
68
|
label: "Memory text",
|
|
95
69
|
name: "memoryText",
|
|
96
70
|
value: p,
|
|
97
|
-
onChange: (o) =>
|
|
71
|
+
onChange: (o) => L(o.target.value),
|
|
98
72
|
autoFocus: !0,
|
|
99
73
|
helperText: p.trim().length < 3 ? "Memory text must be at least 3 characters" : `${p.length} characters`
|
|
100
74
|
}
|
|
@@ -104,7 +78,7 @@ const Oe = ({
|
|
|
104
78
|
/* @__PURE__ */ e("p", { className: "text-xs text-slate-400 m-0", children: "Set when this memory should expire and be automatically removed." }),
|
|
105
79
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
|
|
106
80
|
/* @__PURE__ */ e(
|
|
107
|
-
|
|
81
|
+
_,
|
|
108
82
|
{
|
|
109
83
|
mode: "dark",
|
|
110
84
|
focusMode: "light",
|
|
@@ -114,12 +88,12 @@ const Oe = ({
|
|
|
114
88
|
name: "expiration-none",
|
|
115
89
|
checked: h === "none",
|
|
116
90
|
onChange: (o) => {
|
|
117
|
-
o &&
|
|
91
|
+
o && w("none");
|
|
118
92
|
}
|
|
119
93
|
}
|
|
120
94
|
),
|
|
121
95
|
/* @__PURE__ */ e(
|
|
122
|
-
|
|
96
|
+
_,
|
|
123
97
|
{
|
|
124
98
|
mode: "dark",
|
|
125
99
|
focusMode: "light",
|
|
@@ -129,12 +103,12 @@ const Oe = ({
|
|
|
129
103
|
name: "expiration-short",
|
|
130
104
|
checked: h === "short",
|
|
131
105
|
onChange: (o) => {
|
|
132
|
-
o &&
|
|
106
|
+
o && w("short");
|
|
133
107
|
}
|
|
134
108
|
}
|
|
135
109
|
),
|
|
136
110
|
/* @__PURE__ */ e(
|
|
137
|
-
|
|
111
|
+
_,
|
|
138
112
|
{
|
|
139
113
|
mode: "dark",
|
|
140
114
|
focusMode: "light",
|
|
@@ -144,12 +118,12 @@ const Oe = ({
|
|
|
144
118
|
name: "expiration-medium",
|
|
145
119
|
checked: h === "medium",
|
|
146
120
|
onChange: (o) => {
|
|
147
|
-
o &&
|
|
121
|
+
o && w("medium");
|
|
148
122
|
}
|
|
149
123
|
}
|
|
150
124
|
),
|
|
151
125
|
/* @__PURE__ */ e(
|
|
152
|
-
|
|
126
|
+
_,
|
|
153
127
|
{
|
|
154
128
|
mode: "dark",
|
|
155
129
|
focusMode: "light",
|
|
@@ -159,7 +133,7 @@ const Oe = ({
|
|
|
159
133
|
name: "expiration-long",
|
|
160
134
|
checked: h === "long",
|
|
161
135
|
onChange: (o) => {
|
|
162
|
-
o &&
|
|
136
|
+
o && w("long");
|
|
163
137
|
}
|
|
164
138
|
}
|
|
165
139
|
)
|
|
@@ -169,13 +143,13 @@ const Oe = ({
|
|
|
169
143
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-slate-300 m-0", children: "Memory Details" }),
|
|
170
144
|
n.categories && n.categories.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
171
145
|
/* @__PURE__ */ e("span", { className: "text-xs text-slate-400 uppercase", children: "Category" }),
|
|
172
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: n.categories.map((o,
|
|
146
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: n.categories.map((o, v) => /* @__PURE__ */ e(
|
|
173
147
|
"span",
|
|
174
148
|
{
|
|
175
149
|
className: "text-xs px-2 py-1 bg-slate-700/50 text-slate-200 rounded",
|
|
176
150
|
children: o
|
|
177
151
|
},
|
|
178
|
-
`${o}-${
|
|
152
|
+
`${o}-${v}`
|
|
179
153
|
)) })
|
|
180
154
|
] }),
|
|
181
155
|
/* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row gap-4", children: [
|
|
@@ -215,75 +189,75 @@ const Oe = ({
|
|
|
215
189
|
] })
|
|
216
190
|
}
|
|
217
191
|
);
|
|
218
|
-
},
|
|
219
|
-
open:
|
|
220
|
-
onOpenChange:
|
|
221
|
-
user:
|
|
192
|
+
}, He = ({
|
|
193
|
+
open: N,
|
|
194
|
+
onOpenChange: E,
|
|
195
|
+
user: a
|
|
222
196
|
}) => {
|
|
223
|
-
const { getAccessToken: n } =
|
|
224
|
-
key:
|
|
225
|
-
initialValue:
|
|
226
|
-
}), [
|
|
227
|
-
key:
|
|
197
|
+
const { getAccessToken: n } = Ne(), [I] = C(void 0), [m, p] = C("active"), [L, h] = K({
|
|
198
|
+
key: Q + we,
|
|
199
|
+
initialValue: l.DESC
|
|
200
|
+
}), [w, S] = K({
|
|
201
|
+
key: Q + ke,
|
|
228
202
|
initialValue: "createdAt"
|
|
229
|
-
}), [u,
|
|
230
|
-
|
|
231
|
-
), { data:
|
|
232
|
-
user:
|
|
233
|
-
query:
|
|
203
|
+
}), [u, T] = C(L || l.DESC), [o, v] = C(
|
|
204
|
+
w || "createdAt"
|
|
205
|
+
), { data: g, isLoading: U, isError: q } = Se({
|
|
206
|
+
user: a,
|
|
207
|
+
query: I,
|
|
234
208
|
getAccessToken: n,
|
|
235
|
-
enabled:
|
|
209
|
+
enabled: N && m === "active"
|
|
236
210
|
}), {
|
|
237
|
-
data:
|
|
238
|
-
isLoading:
|
|
211
|
+
data: f,
|
|
212
|
+
isLoading: H,
|
|
239
213
|
isError: j
|
|
240
214
|
} = Te({
|
|
241
|
-
user:
|
|
242
|
-
query:
|
|
215
|
+
user: a,
|
|
216
|
+
query: I,
|
|
243
217
|
getAccessToken: n,
|
|
244
|
-
enabled:
|
|
245
|
-
}),
|
|
246
|
-
k.current = { id: t, text: i, description: c, createdAt: d },
|
|
218
|
+
enabled: N && m === "expired"
|
|
219
|
+
}), P = ve({ getAccessToken: n }), X = De({ getAccessToken: n }), V = Me({ getAccessToken: n }), F = Ee({ getAccessToken: n }), $ = be({ getAccessToken: n }), [se, Y] = C(!1), k = te(null), [ae, W] = C(!1), [ce, G] = C(!1), x = te(null), J = (t, i, c, d) => {
|
|
220
|
+
k.current = { id: t, text: i, description: c, createdAt: d }, Y(!0);
|
|
247
221
|
}, de = () => {
|
|
248
|
-
k.current &&
|
|
249
|
-
}, me = (t, i, c, d, ue, fe,
|
|
222
|
+
k.current && P.mutate({ user: a, memoryId: k.current.id });
|
|
223
|
+
}, me = (t, i, c, d, ue, ge, fe, Ae, ye, Ce) => {
|
|
250
224
|
x.current = {
|
|
251
225
|
id: t,
|
|
252
226
|
description: i,
|
|
253
227
|
categories: c,
|
|
254
228
|
quote: d,
|
|
255
229
|
canonicalText: ue,
|
|
256
|
-
confidence:
|
|
257
|
-
status:
|
|
258
|
-
sourceType:
|
|
259
|
-
expiration:
|
|
230
|
+
confidence: ge,
|
|
231
|
+
status: fe,
|
|
232
|
+
sourceType: Ae,
|
|
233
|
+
expiration: ye,
|
|
260
234
|
expiresAt: Ce
|
|
261
|
-
},
|
|
235
|
+
}, G(!0);
|
|
262
236
|
}, xe = (t, i) => {
|
|
263
|
-
x.current &&
|
|
237
|
+
x.current && a && F.mutate(
|
|
264
238
|
{
|
|
265
|
-
user:
|
|
239
|
+
user: a,
|
|
266
240
|
memoryId: x.current.id,
|
|
267
241
|
description: t,
|
|
268
242
|
expiration: i || void 0
|
|
269
243
|
},
|
|
270
244
|
{
|
|
271
245
|
onSuccess: () => {
|
|
272
|
-
|
|
246
|
+
G(!1);
|
|
273
247
|
}
|
|
274
248
|
}
|
|
275
249
|
);
|
|
276
250
|
}, he = () => {
|
|
277
|
-
|
|
251
|
+
a && W(!0);
|
|
278
252
|
}, pe = () => {
|
|
279
|
-
|
|
253
|
+
a && (m === "active" ? X.mutate({ user: a }) : V.mutate({ user: a }));
|
|
280
254
|
};
|
|
281
|
-
return /* @__PURE__ */ r(
|
|
255
|
+
return /* @__PURE__ */ r(b, { children: [
|
|
282
256
|
/* @__PURE__ */ e(
|
|
283
257
|
_e,
|
|
284
258
|
{
|
|
285
259
|
open: ce,
|
|
286
|
-
onOpenChange:
|
|
260
|
+
onOpenChange: G,
|
|
287
261
|
initialText: x.current?.description || "",
|
|
288
262
|
metadata: x.current ? {
|
|
289
263
|
categories: x.current.categories,
|
|
@@ -296,14 +270,14 @@ const Oe = ({
|
|
|
296
270
|
expiresAt: x.current.expiresAt
|
|
297
271
|
} : void 0,
|
|
298
272
|
onSave: xe,
|
|
299
|
-
isSaving:
|
|
273
|
+
isSaving: F.isPending
|
|
300
274
|
}
|
|
301
275
|
),
|
|
302
276
|
/* @__PURE__ */ r(
|
|
303
|
-
|
|
277
|
+
ee,
|
|
304
278
|
{
|
|
305
279
|
showConfirmation: se,
|
|
306
|
-
setShowConfirmation:
|
|
280
|
+
setShowConfirmation: Y,
|
|
307
281
|
action: de,
|
|
308
282
|
customStrings: {
|
|
309
283
|
title: "Delete memory",
|
|
@@ -328,10 +302,10 @@ const Oe = ({
|
|
|
328
302
|
}
|
|
329
303
|
),
|
|
330
304
|
/* @__PURE__ */ e(
|
|
331
|
-
|
|
305
|
+
ee,
|
|
332
306
|
{
|
|
333
307
|
showConfirmation: ae,
|
|
334
|
-
setShowConfirmation:
|
|
308
|
+
setShowConfirmation: W,
|
|
335
309
|
action: pe,
|
|
336
310
|
customStrings: {
|
|
337
311
|
title: m === "active" ? "Delete all active memories" : "Delete all expired memories",
|
|
@@ -344,39 +318,39 @@ const Oe = ({
|
|
|
344
318
|
/* @__PURE__ */ e(
|
|
345
319
|
le,
|
|
346
320
|
{
|
|
347
|
-
open:
|
|
348
|
-
onOpenChange: (t) =>
|
|
321
|
+
open: N,
|
|
322
|
+
onOpenChange: (t) => E(t),
|
|
349
323
|
title: "User Memories",
|
|
350
324
|
animation: !0,
|
|
351
325
|
animationType: "fade",
|
|
352
|
-
footer: /* @__PURE__ */ r(
|
|
353
|
-
/* @__PURE__ */ e(
|
|
354
|
-
|
|
326
|
+
footer: /* @__PURE__ */ r(R, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
327
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
328
|
+
M,
|
|
355
329
|
{
|
|
356
330
|
mode: "dark",
|
|
357
331
|
variant: "secondary",
|
|
358
332
|
noBorder: !0,
|
|
359
333
|
focusMode: "light",
|
|
360
|
-
onClick: () =>
|
|
334
|
+
onClick: () => E(!1),
|
|
361
335
|
children: "Close"
|
|
362
336
|
}
|
|
363
337
|
) }),
|
|
364
|
-
/* @__PURE__ */ e(
|
|
365
|
-
|
|
338
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
339
|
+
M,
|
|
366
340
|
{
|
|
367
341
|
mode: "dark",
|
|
368
342
|
focusMode: "light",
|
|
369
343
|
variant: "danger",
|
|
370
|
-
disabled: (m === "active" ?
|
|
344
|
+
disabled: (m === "active" ? X.isPending : V.isPending) || (m === "active" ? (g?.total ?? 0) === 0 : (f?.total ?? 0) === 0),
|
|
371
345
|
onClick: he,
|
|
372
346
|
children: "Delete All"
|
|
373
347
|
}
|
|
374
348
|
) })
|
|
375
349
|
] }),
|
|
376
350
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-4 @container/editmemoriespanel", children: [
|
|
377
|
-
/* @__PURE__ */ r(
|
|
378
|
-
/* @__PURE__ */ e(
|
|
379
|
-
|
|
351
|
+
/* @__PURE__ */ r(R, { columnGap: 2, alignHorizontal: "center", children: [
|
|
352
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
353
|
+
M,
|
|
380
354
|
{
|
|
381
355
|
focusMode: "light",
|
|
382
356
|
mode: m === "active" ? "dark" : "light",
|
|
@@ -386,8 +360,8 @@ const Oe = ({
|
|
|
386
360
|
children: "Active Memories"
|
|
387
361
|
}
|
|
388
362
|
) }),
|
|
389
|
-
/* @__PURE__ */ e(
|
|
390
|
-
|
|
363
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
364
|
+
M,
|
|
391
365
|
{
|
|
392
366
|
focusMode: "light",
|
|
393
367
|
mode: m === "expired" ? "dark" : "light",
|
|
@@ -401,17 +375,17 @@ const Oe = ({
|
|
|
401
375
|
/* @__PURE__ */ e(
|
|
402
376
|
"div",
|
|
403
377
|
{
|
|
404
|
-
className:
|
|
378
|
+
className: y(
|
|
405
379
|
"flex flex-col sm:flex-row",
|
|
406
380
|
"sm:max-h-[50vh] sm:min-h-[50vh]"
|
|
407
381
|
),
|
|
408
|
-
children: m === "active" ? /* @__PURE__ */ r(
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
!
|
|
412
|
-
/* @__PURE__ */ e(
|
|
413
|
-
/* @__PURE__ */ e(
|
|
414
|
-
/* @__PURE__ */ e(
|
|
382
|
+
children: m === "active" ? /* @__PURE__ */ r(b, { children: [
|
|
383
|
+
U && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
|
|
384
|
+
q && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
|
|
385
|
+
!U && !q && (g && g.items.length > 0 ? /* @__PURE__ */ r(re, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
|
386
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ r(D, { children: [
|
|
387
|
+
/* @__PURE__ */ e(s, { className: "sr-only", children: "Row" }),
|
|
388
|
+
/* @__PURE__ */ e(s, { children: "Memory" }),
|
|
415
389
|
/* @__PURE__ */ e(
|
|
416
390
|
B,
|
|
417
391
|
{
|
|
@@ -422,8 +396,8 @@ const Oe = ({
|
|
|
422
396
|
sortDirection: u,
|
|
423
397
|
sortedCell: o,
|
|
424
398
|
onClick: () => {
|
|
425
|
-
|
|
426
|
-
const i = t ===
|
|
399
|
+
v("createdAt"), S("createdAt"), T((t) => {
|
|
400
|
+
const i = t === l.ASC ? l.DESC : l.ASC;
|
|
427
401
|
return h(i), i;
|
|
428
402
|
});
|
|
429
403
|
},
|
|
@@ -440,32 +414,32 @@ const Oe = ({
|
|
|
440
414
|
sortDirection: u,
|
|
441
415
|
sortedCell: o,
|
|
442
416
|
onClick: () => {
|
|
443
|
-
|
|
444
|
-
const i = t ===
|
|
417
|
+
v("expiresAt"), S("expiresAt"), T((t) => {
|
|
418
|
+
const i = t === l.ASC ? l.DESC : l.ASC;
|
|
445
419
|
return h(i), i;
|
|
446
420
|
});
|
|
447
421
|
},
|
|
448
422
|
children: "Expires"
|
|
449
423
|
}
|
|
450
424
|
),
|
|
451
|
-
/* @__PURE__ */ e(
|
|
425
|
+
/* @__PURE__ */ e(s, { align: "right", children: "Actions" })
|
|
452
426
|
] }) }),
|
|
453
|
-
/* @__PURE__ */ e(
|
|
427
|
+
/* @__PURE__ */ e(ne, { children: [...g.items].sort((t, i) => {
|
|
454
428
|
if (o === "createdAt") {
|
|
455
429
|
const c = t.createdAt ? new Date(t.createdAt).getTime() : 0, d = i.createdAt ? new Date(i.createdAt).getTime() : 0;
|
|
456
|
-
return u ===
|
|
430
|
+
return u === l.ASC ? c - d : d - c;
|
|
457
431
|
}
|
|
458
432
|
if (o === "expiresAt") {
|
|
459
433
|
const c = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, d = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
460
|
-
return u ===
|
|
434
|
+
return u === l.ASC ? c - d : d - c;
|
|
461
435
|
}
|
|
462
436
|
return 0;
|
|
463
|
-
}).map((t, i) => /* @__PURE__ */ r(
|
|
464
|
-
/* @__PURE__ */ e(
|
|
437
|
+
}).map((t, i) => /* @__PURE__ */ r(D, { children: [
|
|
438
|
+
/* @__PURE__ */ e(s, { className: y("dark:text-gray-400"), children: i + 1 }),
|
|
465
439
|
/* @__PURE__ */ e(
|
|
466
|
-
|
|
440
|
+
s,
|
|
467
441
|
{
|
|
468
|
-
className:
|
|
442
|
+
className: y(
|
|
469
443
|
"dark:text-white",
|
|
470
444
|
"max-w-[100px] sm:max-w-[400px]",
|
|
471
445
|
"text-xs sm:text-sm"
|
|
@@ -477,11 +451,11 @@ const Oe = ({
|
|
|
477
451
|
}
|
|
478
452
|
),
|
|
479
453
|
/* @__PURE__ */ e(
|
|
480
|
-
|
|
454
|
+
s,
|
|
481
455
|
{
|
|
482
456
|
component: "th",
|
|
483
457
|
scope: "row",
|
|
484
|
-
className:
|
|
458
|
+
className: y(
|
|
485
459
|
"dark:text-gray-400",
|
|
486
460
|
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
487
461
|
),
|
|
@@ -489,35 +463,35 @@ const Oe = ({
|
|
|
489
463
|
}
|
|
490
464
|
),
|
|
491
465
|
/* @__PURE__ */ e(
|
|
492
|
-
|
|
466
|
+
s,
|
|
493
467
|
{
|
|
494
|
-
className:
|
|
468
|
+
className: y(
|
|
495
469
|
"dark:text-gray-400",
|
|
496
470
|
"sm:whitespace-nowrap text-xs sm:text-sm"
|
|
497
471
|
),
|
|
498
472
|
children: t.expiresAt ? new Date(t.expiresAt).toLocaleDateString() : "Never"
|
|
499
473
|
}
|
|
500
474
|
),
|
|
501
|
-
/* @__PURE__ */ e(
|
|
502
|
-
|
|
475
|
+
/* @__PURE__ */ e(s, { className: "align-top", align: "right", children: /* @__PURE__ */ r(
|
|
476
|
+
R,
|
|
503
477
|
{
|
|
504
478
|
columnGap: 2,
|
|
505
479
|
alignHorizontal: "flex-end",
|
|
506
480
|
children: [
|
|
507
|
-
/* @__PURE__ */ e(
|
|
508
|
-
|
|
481
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
482
|
+
z,
|
|
509
483
|
{
|
|
510
484
|
label: "Edit memory",
|
|
511
485
|
mode: "system",
|
|
512
486
|
placement: "top",
|
|
513
487
|
trigger: /* @__PURE__ */ e(
|
|
514
|
-
|
|
488
|
+
O,
|
|
515
489
|
{
|
|
516
490
|
focusMode: "system",
|
|
517
491
|
noBorder: !0,
|
|
518
492
|
label: "Edit memory",
|
|
519
493
|
variant: "primary",
|
|
520
|
-
disabled:
|
|
494
|
+
disabled: F.isPending,
|
|
521
495
|
onClick: () => me(
|
|
522
496
|
t.memoryId,
|
|
523
497
|
t.description || t.text,
|
|
@@ -530,33 +504,33 @@ const Oe = ({
|
|
|
530
504
|
t.expiration,
|
|
531
505
|
t.expiresAt
|
|
532
506
|
),
|
|
533
|
-
children: /* @__PURE__ */ e(
|
|
507
|
+
children: /* @__PURE__ */ e(Re, { size: "size-3", monotone: !0 })
|
|
534
508
|
}
|
|
535
509
|
)
|
|
536
510
|
}
|
|
537
511
|
) }),
|
|
538
|
-
/* @__PURE__ */ e(
|
|
539
|
-
|
|
512
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
513
|
+
z,
|
|
540
514
|
{
|
|
541
515
|
label: "Delete memory",
|
|
542
516
|
mode: "system",
|
|
543
517
|
placement: "top",
|
|
544
518
|
trigger: /* @__PURE__ */ e(
|
|
545
|
-
|
|
519
|
+
O,
|
|
546
520
|
{
|
|
547
521
|
focusMode: "system",
|
|
548
522
|
noBorder: !0,
|
|
549
523
|
label: "Delete memory",
|
|
550
524
|
variant: "primary",
|
|
551
525
|
iconClassName: "text-red-700 dark:text-red-500",
|
|
552
|
-
disabled:
|
|
553
|
-
onClick: () =>
|
|
526
|
+
disabled: P.isPending,
|
|
527
|
+
onClick: () => J(
|
|
554
528
|
t.memoryId,
|
|
555
529
|
t.text,
|
|
556
530
|
t.description,
|
|
557
531
|
t.createdAt
|
|
558
532
|
),
|
|
559
|
-
children: /* @__PURE__ */ e(
|
|
533
|
+
children: /* @__PURE__ */ e(Z, { size: "size-3", monotone: !0 })
|
|
560
534
|
}
|
|
561
535
|
)
|
|
562
536
|
}
|
|
@@ -565,31 +539,31 @@ const Oe = ({
|
|
|
565
539
|
}
|
|
566
540
|
) })
|
|
567
541
|
] }, t.memoryId)) }),
|
|
568
|
-
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
|
|
569
|
-
|
|
542
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(D, { children: /* @__PURE__ */ r(s, { colSpan: 5, children: [
|
|
543
|
+
g.total,
|
|
570
544
|
" memor",
|
|
571
|
-
|
|
572
|
-
|
|
545
|
+
g.total === 1 ? "y" : "ies",
|
|
546
|
+
g.totalTokenUsage !== void 0 && g.totalTokenUsage > 0 && /* @__PURE__ */ r(b, { children: [
|
|
573
547
|
" ",
|
|
574
548
|
"(approximately",
|
|
575
549
|
" ",
|
|
576
550
|
Math.round(
|
|
577
|
-
|
|
551
|
+
g.totalTokenUsage
|
|
578
552
|
).toLocaleString(),
|
|
579
553
|
" ",
|
|
580
554
|
"token",
|
|
581
|
-
Math.round(
|
|
555
|
+
Math.round(g.totalTokenUsage) === 1 ? "" : "s",
|
|
582
556
|
")"
|
|
583
557
|
] })
|
|
584
558
|
] }) }) })
|
|
585
559
|
] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
|
|
586
|
-
] }) : /* @__PURE__ */ r(
|
|
587
|
-
|
|
560
|
+
] }) : /* @__PURE__ */ r(b, { children: [
|
|
561
|
+
H && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading expired memories..." }),
|
|
588
562
|
j && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load expired memories." }),
|
|
589
|
-
!
|
|
590
|
-
/* @__PURE__ */ e(
|
|
591
|
-
/* @__PURE__ */ e(
|
|
592
|
-
/* @__PURE__ */ e(
|
|
563
|
+
!H && !j && (f && f.items.length > 0 ? /* @__PURE__ */ r(re, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
|
564
|
+
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ r(D, { children: [
|
|
565
|
+
/* @__PURE__ */ e(s, { className: "sr-only", children: "Row" }),
|
|
566
|
+
/* @__PURE__ */ e(s, { children: "Memory" }),
|
|
593
567
|
/* @__PURE__ */ e(
|
|
594
568
|
B,
|
|
595
569
|
{
|
|
@@ -600,8 +574,8 @@ const Oe = ({
|
|
|
600
574
|
sortDirection: u,
|
|
601
575
|
sortedCell: o,
|
|
602
576
|
onClick: () => {
|
|
603
|
-
|
|
604
|
-
const i = t ===
|
|
577
|
+
v("createdAt"), S("createdAt"), T((t) => {
|
|
578
|
+
const i = t === l.ASC ? l.DESC : l.ASC;
|
|
605
579
|
return h(i), i;
|
|
606
580
|
});
|
|
607
581
|
},
|
|
@@ -618,32 +592,32 @@ const Oe = ({
|
|
|
618
592
|
sortDirection: u,
|
|
619
593
|
sortedCell: o,
|
|
620
594
|
onClick: () => {
|
|
621
|
-
|
|
622
|
-
const i = t ===
|
|
595
|
+
v("expiresAt"), S("expiresAt"), T((t) => {
|
|
596
|
+
const i = t === l.ASC ? l.DESC : l.ASC;
|
|
623
597
|
return h(i), i;
|
|
624
598
|
});
|
|
625
599
|
},
|
|
626
600
|
children: "Expired"
|
|
627
601
|
}
|
|
628
602
|
),
|
|
629
|
-
/* @__PURE__ */ e(
|
|
603
|
+
/* @__PURE__ */ e(s, { align: "right", children: "Actions" })
|
|
630
604
|
] }) }),
|
|
631
|
-
/* @__PURE__ */ e(
|
|
605
|
+
/* @__PURE__ */ e(ne, { children: [...f.items].sort((t, i) => {
|
|
632
606
|
if (o === "createdAt") {
|
|
633
607
|
const c = t.createdAt ? new Date(t.createdAt).getTime() : 0, d = i.createdAt ? new Date(i.createdAt).getTime() : 0;
|
|
634
|
-
return u ===
|
|
608
|
+
return u === l.ASC ? c - d : d - c;
|
|
635
609
|
}
|
|
636
610
|
if (o === "expiresAt") {
|
|
637
611
|
const c = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, d = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
638
|
-
return u ===
|
|
612
|
+
return u === l.ASC ? c - d : d - c;
|
|
639
613
|
}
|
|
640
614
|
return 0;
|
|
641
|
-
}).map((t, i) => /* @__PURE__ */ r(
|
|
642
|
-
/* @__PURE__ */ e(
|
|
615
|
+
}).map((t, i) => /* @__PURE__ */ r(D, { children: [
|
|
616
|
+
/* @__PURE__ */ e(s, { className: y("dark:text-gray-400"), children: i + 1 }),
|
|
643
617
|
/* @__PURE__ */ e(
|
|
644
|
-
|
|
618
|
+
s,
|
|
645
619
|
{
|
|
646
|
-
className:
|
|
620
|
+
className: y(
|
|
647
621
|
"dark:text-white",
|
|
648
622
|
"max-w-[100px] sm:max-w-[400px]",
|
|
649
623
|
"text-xs sm:text-sm"
|
|
@@ -655,11 +629,11 @@ const Oe = ({
|
|
|
655
629
|
}
|
|
656
630
|
),
|
|
657
631
|
/* @__PURE__ */ e(
|
|
658
|
-
|
|
632
|
+
s,
|
|
659
633
|
{
|
|
660
634
|
component: "th",
|
|
661
635
|
scope: "row",
|
|
662
|
-
className:
|
|
636
|
+
className: y(
|
|
663
637
|
"dark:text-gray-400",
|
|
664
638
|
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
665
639
|
),
|
|
@@ -667,38 +641,38 @@ const Oe = ({
|
|
|
667
641
|
}
|
|
668
642
|
),
|
|
669
643
|
/* @__PURE__ */ e(
|
|
670
|
-
|
|
644
|
+
s,
|
|
671
645
|
{
|
|
672
|
-
className:
|
|
646
|
+
className: y(
|
|
673
647
|
"dark:text-gray-400",
|
|
674
648
|
"sm:whitespace-nowrap text-xs sm:text-sm"
|
|
675
649
|
),
|
|
676
650
|
children: t.expiresAt ? new Date(t.expiresAt).toLocaleDateString() : "-"
|
|
677
651
|
}
|
|
678
652
|
),
|
|
679
|
-
/* @__PURE__ */ e(
|
|
680
|
-
|
|
653
|
+
/* @__PURE__ */ e(s, { className: "align-top", align: "right", children: /* @__PURE__ */ r(
|
|
654
|
+
R,
|
|
681
655
|
{
|
|
682
656
|
columnGap: 2,
|
|
683
657
|
alignHorizontal: "flex-end",
|
|
684
658
|
children: [
|
|
685
|
-
/* @__PURE__ */ e(
|
|
686
|
-
|
|
659
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
660
|
+
z,
|
|
687
661
|
{
|
|
688
662
|
label: "Restore memory",
|
|
689
663
|
mode: "system",
|
|
690
664
|
placement: "top",
|
|
691
665
|
trigger: /* @__PURE__ */ e(
|
|
692
|
-
|
|
666
|
+
O,
|
|
693
667
|
{
|
|
694
668
|
focusMode: "system",
|
|
695
669
|
noBorder: !0,
|
|
696
670
|
label: "Restore memory",
|
|
697
671
|
variant: "primary",
|
|
698
|
-
disabled:
|
|
672
|
+
disabled: $.isPending,
|
|
699
673
|
onClick: () => {
|
|
700
|
-
|
|
701
|
-
user:
|
|
674
|
+
a && $.mutate({
|
|
675
|
+
user: a,
|
|
702
676
|
memoryId: t.memoryId
|
|
703
677
|
});
|
|
704
678
|
},
|
|
@@ -707,28 +681,28 @@ const Oe = ({
|
|
|
707
681
|
)
|
|
708
682
|
}
|
|
709
683
|
) }),
|
|
710
|
-
/* @__PURE__ */ e(
|
|
711
|
-
|
|
684
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
685
|
+
z,
|
|
712
686
|
{
|
|
713
687
|
label: "Delete memory",
|
|
714
688
|
mode: "system",
|
|
715
689
|
placement: "top",
|
|
716
690
|
trigger: /* @__PURE__ */ e(
|
|
717
|
-
|
|
691
|
+
O,
|
|
718
692
|
{
|
|
719
693
|
focusMode: "system",
|
|
720
694
|
noBorder: !0,
|
|
721
695
|
label: "Delete memory",
|
|
722
696
|
variant: "primary",
|
|
723
697
|
iconClassName: "text-red-700 dark:text-red-500",
|
|
724
|
-
disabled:
|
|
725
|
-
onClick: () =>
|
|
698
|
+
disabled: P.isPending,
|
|
699
|
+
onClick: () => J(
|
|
726
700
|
t.memoryId,
|
|
727
701
|
t.text,
|
|
728
702
|
t.description,
|
|
729
703
|
t.createdAt
|
|
730
704
|
),
|
|
731
|
-
children: /* @__PURE__ */ e(
|
|
705
|
+
children: /* @__PURE__ */ e(Z, { size: "size-3", monotone: !0 })
|
|
732
706
|
}
|
|
733
707
|
)
|
|
734
708
|
}
|
|
@@ -737,20 +711,20 @@ const Oe = ({
|
|
|
737
711
|
}
|
|
738
712
|
) })
|
|
739
713
|
] }, t.memoryId)) }),
|
|
740
|
-
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
|
|
741
|
-
|
|
714
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(D, { children: /* @__PURE__ */ r(s, { colSpan: 5, children: [
|
|
715
|
+
f.total,
|
|
742
716
|
" expired memor",
|
|
743
|
-
|
|
744
|
-
|
|
717
|
+
f.total === 1 ? "y" : "ies",
|
|
718
|
+
f.totalTokenUsage !== void 0 && f.totalTokenUsage > 0 && /* @__PURE__ */ r(b, { children: [
|
|
745
719
|
" ",
|
|
746
720
|
"(approximately",
|
|
747
721
|
" ",
|
|
748
722
|
Math.round(
|
|
749
|
-
|
|
723
|
+
f.totalTokenUsage
|
|
750
724
|
).toLocaleString(),
|
|
751
725
|
" ",
|
|
752
726
|
"token",
|
|
753
|
-
Math.round(
|
|
727
|
+
Math.round(f.totalTokenUsage) === 1 ? "" : "s",
|
|
754
728
|
")"
|
|
755
729
|
] })
|
|
756
730
|
] }) }) })
|
|
@@ -764,6 +738,6 @@ const Oe = ({
|
|
|
764
738
|
] });
|
|
765
739
|
};
|
|
766
740
|
export {
|
|
767
|
-
|
|
768
|
-
|
|
741
|
+
He as UserMemoriesPanel,
|
|
742
|
+
He as default
|
|
769
743
|
};
|