@versini/sassysaint 8.105.2 → 8.106.1
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.nlPIWp0N.js → AboutChangelog.C1rKf-fs.js} +2 -2
- package/dist/chunks/{AboutEntry.CphmsD5H.js → AboutEntry.BAR4O6Y4.js} +7 -7
- package/dist/chunks/{App.CIwNk-Ut.js → App.B9tjGMnG.js} +252 -252
- package/dist/chunks/{Chart.Dvl7vluK.js → Chart.BJQmO98B.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.DZ6ok4cT.js → ChatBubbleAssistant.B5Un5WKI.js} +5 -5
- package/dist/chunks/{ChatBubbleUser.CHWKvZg3.js → ChatBubbleUser.DEe4IIdl.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BWpKoQsi.js → ChatHistoryTable.-d8_qx2Z.js} +59 -61
- package/dist/chunks/{HistoryEntry.yoV4fAVr.js → HistoryEntry.BSAHx4eZ.js} +7 -7
- package/dist/chunks/{LoginEntry.QP6-497n.js → LoginEntry.DR0qFvNl.js} +4 -4
- package/dist/chunks/{LogoEntry.hJ_vIJmf.js → LogoEntry.BwA2ssO6.js} +4 -5
- package/dist/chunks/{MemoriesEntry.n0JGBOnn.js → MemoriesEntry.Cz7T3caz.js} +177 -169
- package/dist/chunks/{ProfileEntry.BkF2iOVP.js → ProfileEntry.Cotp19Aj.js} +4 -4
- package/dist/chunks/{SettingsEntry.CUE9-B_Z.js → SettingsEntry.C55bTACC.js} +34 -34
- package/dist/chunks/{Table.B0wueiQh.js → Table.DWGS6ANJ.js} +1 -1
- package/dist/chunks/{UsageEntry.J4oBMVMS.js → UsageEntry.HvLHOBP5.js} +5 -5
- package/dist/chunks/{index.DFl1tPBj.js → index.1CBqWB-9.js} +2 -2
- package/dist/chunks/{index.BC18QJea.js → index.BOLZ9GJH.js} +1 -1
- package/dist/chunks/{index.DTkLpMnR.js → index.BSJ1MGWU.js} +1 -1
- package/dist/chunks/{index.CbtQDjOH.js → index.Ce0LQWUm.js} +1 -1
- package/dist/chunks/{index.ClNxiXVb.js → index.Cik0_Cr1.js} +1 -1
- package/dist/chunks/{index.D8rj890J.js → index.DNRN6B_p.js} +1 -1
- package/dist/chunks/{index.DZAOimM5.js → index.DVCf7tp5.js} +995 -995
- package/dist/chunks/{index.WO0c_AVQ.js → index.Dnj64P2t.js} +3 -3
- package/dist/chunks/{index.C7gau1B5.js → index.j05AJWYD.js} +1 -1
- package/dist/chunks/{index.DsqBt3WJ.js → index.yI7VsMw8.js} +1 -1
- package/dist/chunks/{useMarkdown.CgDrCbrc.js → useMarkdown.Di6pc73q.js} +7 -7
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +2 -2
- package/package.json +3 -3
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { n as Te, LOCAL_STORAGE_PREFIX as ee, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as
|
|
3
|
-
import { L as
|
|
4
|
-
import { Panel as
|
|
5
|
-
import { H as
|
|
2
|
+
import { n as Te, LOCAL_STORAGE_PREFIX as ee, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as we, LOCAL_STORAGE_SORT_MEMORY_COLUMN as ve, useUserMemories as De, useExpiredMemories as Ee, useDeleteMemory as Me, useDeleteAllActiveMemories as be, useDeleteAllExpiredMemories as Re, useUpdateMemory as Ie, useRestoreMemory as Le } from "./index.DVCf7tp5.js";
|
|
3
|
+
import { L as b, j as f, Button as B, e as c, ButtonIcon as L, IconEdit as Oe, IconDelete as te, IconRestore as _e } from "./LogoEntry.BwA2ssO6.js";
|
|
4
|
+
import { Panel as se, Toggle as O, CancelButton as ae, useLocalStorage as re, ConfirmationPanel as ie, ResponsiveTooltip as _ } from "./App.B9tjGMnG.js";
|
|
5
|
+
import { H as oe, F as ne, q as v, O as s, J as z, Y as le, G as ce } from "./Table.DWGS6ANJ.js";
|
|
6
6
|
import C from "clsx";
|
|
7
7
|
import { useState as N, useEffect as ze, useRef as q } from "react";
|
|
8
|
-
import { TextArea as Be } from "./index.
|
|
8
|
+
import { TextArea as Be } from "./index.Cik0_Cr1.js";
|
|
9
9
|
const Pe = ({
|
|
10
|
-
open:
|
|
11
|
-
onOpenChange:
|
|
10
|
+
open: k,
|
|
11
|
+
onOpenChange: D,
|
|
12
12
|
initialText: d,
|
|
13
|
-
metadata:
|
|
14
|
-
onSave:
|
|
15
|
-
isSaving:
|
|
13
|
+
metadata: o,
|
|
14
|
+
onSave: y,
|
|
15
|
+
isSaving: E = !1
|
|
16
16
|
}) => {
|
|
17
|
-
const [l,
|
|
17
|
+
const [l, M] = N(d), [A, p] = N("none");
|
|
18
18
|
ze(() => {
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
if (k) {
|
|
20
|
+
M(d);
|
|
21
|
+
const n = o?.expiration || "none";
|
|
22
|
+
p(n);
|
|
23
23
|
}
|
|
24
|
-
}, [
|
|
24
|
+
}, [k, d, o?.expiration]);
|
|
25
25
|
const P = () => {
|
|
26
26
|
if (l.trim().length >= 3) {
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const n = A === "none" ? null : A;
|
|
28
|
+
y(l.trim(), n);
|
|
29
29
|
}
|
|
30
|
-
}, T = l.trim().length >= 3,
|
|
30
|
+
}, T = l.trim().length >= 3, h = l.trim() !== d.trim() || A !== (o?.expiration || "none");
|
|
31
31
|
return /* @__PURE__ */ e(
|
|
32
|
-
|
|
32
|
+
se,
|
|
33
33
|
{
|
|
34
|
-
open:
|
|
35
|
-
onOpenChange:
|
|
34
|
+
open: k,
|
|
35
|
+
onOpenChange: D,
|
|
36
36
|
title: "Edit Memory",
|
|
37
37
|
animation: !0,
|
|
38
38
|
animationType: "fade",
|
|
39
|
-
footer: /* @__PURE__ */ r(
|
|
40
|
-
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
39
|
+
footer: /* @__PURE__ */ r(b, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
40
|
+
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(ae, { onOpenChange: D, label: "Cancel" }) }),
|
|
41
41
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
42
42
|
B,
|
|
43
43
|
{
|
|
44
44
|
mode: "dark",
|
|
45
45
|
focusMode: "light",
|
|
46
|
-
disabled:
|
|
46
|
+
disabled: E || !T || !h,
|
|
47
47
|
onClick: P,
|
|
48
|
-
children:
|
|
48
|
+
children: E ? "Saving..." : "Save"
|
|
49
49
|
}
|
|
50
50
|
) })
|
|
51
51
|
] }),
|
|
@@ -58,14 +58,14 @@ const Pe = ({
|
|
|
58
58
|
label: "Memory text",
|
|
59
59
|
name: "memoryText",
|
|
60
60
|
value: l,
|
|
61
|
-
onChange: (
|
|
61
|
+
onChange: (n) => M(n.target.value),
|
|
62
62
|
autoFocus: !0,
|
|
63
63
|
helperText: l.trim().length < 3 ? "Memory text must be at least 3 characters" : `${l.length} characters`
|
|
64
64
|
}
|
|
65
65
|
),
|
|
66
|
-
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3 p-4 bg-
|
|
67
|
-
/* @__PURE__ */ e("h3", { className: "text-sm
|
|
68
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-
|
|
66
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3 p-4 bg-surface-darker rounded-md", children: [
|
|
67
|
+
/* @__PURE__ */ e("h3", { className: "text-sm m-0", children: "Memory Expiration" }),
|
|
68
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-copy-medium m-0", children: "Set when this memory should expire and be automatically removed." }),
|
|
69
69
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
|
|
70
70
|
/* @__PURE__ */ e(
|
|
71
71
|
O,
|
|
@@ -76,9 +76,9 @@ const Pe = ({
|
|
|
76
76
|
narrow: !0,
|
|
77
77
|
label: "Never expire",
|
|
78
78
|
name: "expiration-none",
|
|
79
|
-
checked:
|
|
80
|
-
onChange: (
|
|
81
|
-
|
|
79
|
+
checked: A === "none",
|
|
80
|
+
onChange: (n) => {
|
|
81
|
+
n && p("none");
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
),
|
|
@@ -91,9 +91,9 @@ const Pe = ({
|
|
|
91
91
|
narrow: !0,
|
|
92
92
|
label: "Short (1 month)",
|
|
93
93
|
name: "expiration-short",
|
|
94
|
-
checked:
|
|
95
|
-
onChange: (
|
|
96
|
-
|
|
94
|
+
checked: A === "short",
|
|
95
|
+
onChange: (n) => {
|
|
96
|
+
n && p("short");
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
),
|
|
@@ -106,9 +106,9 @@ const Pe = ({
|
|
|
106
106
|
narrow: !0,
|
|
107
107
|
label: "Medium (6 months)",
|
|
108
108
|
name: "expiration-medium",
|
|
109
|
-
checked:
|
|
110
|
-
onChange: (
|
|
111
|
-
|
|
109
|
+
checked: A === "medium",
|
|
110
|
+
onChange: (n) => {
|
|
111
|
+
n && p("medium");
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
),
|
|
@@ -121,57 +121,57 @@ const Pe = ({
|
|
|
121
121
|
narrow: !0,
|
|
122
122
|
label: "Long (1 year)",
|
|
123
123
|
name: "expiration-long",
|
|
124
|
-
checked:
|
|
125
|
-
onChange: (
|
|
126
|
-
|
|
124
|
+
checked: A === "long",
|
|
125
|
+
onChange: (n) => {
|
|
126
|
+
n && p("long");
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
)
|
|
130
130
|
] })
|
|
131
131
|
] }),
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */ e("h3", { className: "text-sm
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-
|
|
136
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children:
|
|
132
|
+
o && /* @__PURE__ */ r("div", { className: "flex flex-col gap-3 p-4 bg-surface-darker rounded-md", children: [
|
|
133
|
+
/* @__PURE__ */ e("h3", { className: "text-sm m-0", children: "Memory Details" }),
|
|
134
|
+
o.categories && o.categories.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
135
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Category" }),
|
|
136
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: o.categories.map((n, u) => /* @__PURE__ */ e(
|
|
137
137
|
"span",
|
|
138
138
|
{
|
|
139
|
-
className: "text-xs px-2 py-1
|
|
140
|
-
children:
|
|
139
|
+
className: "text-xs px-2 py-1 text-copy-light rounded",
|
|
140
|
+
children: n
|
|
141
141
|
},
|
|
142
|
-
`${
|
|
142
|
+
`${n}-${u}`
|
|
143
143
|
)) })
|
|
144
144
|
] }),
|
|
145
145
|
/* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row gap-4", children: [
|
|
146
146
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
|
|
147
|
-
|
|
148
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-
|
|
149
|
-
/* @__PURE__ */ r("span", { className: "text-sm text-
|
|
150
|
-
(
|
|
147
|
+
o.confidence !== void 0 && o.confidence !== null && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
148
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Confidence" }),
|
|
149
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-copy-light", children: [
|
|
150
|
+
(o.confidence * 100).toFixed(0),
|
|
151
151
|
"%"
|
|
152
152
|
] })
|
|
153
153
|
] }),
|
|
154
|
-
|
|
155
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-
|
|
156
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-
|
|
154
|
+
o.status && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
155
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Status" }),
|
|
156
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-copy-light capitalize", children: o.status })
|
|
157
157
|
] }),
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-
|
|
160
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-
|
|
158
|
+
o.sourceType && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
159
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Source Type" }),
|
|
160
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-copy-light capitalize", children: o.sourceType })
|
|
161
161
|
] })
|
|
162
162
|
] }),
|
|
163
163
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-
|
|
166
|
-
/* @__PURE__ */ r("p", { className: "text-sm text-
|
|
164
|
+
o.quote && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
165
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Original Prompt" }),
|
|
166
|
+
/* @__PURE__ */ r("p", { className: "text-sm text-copy-light m-0 italic", children: [
|
|
167
167
|
'"',
|
|
168
|
-
|
|
168
|
+
o.quote,
|
|
169
169
|
'"'
|
|
170
170
|
] })
|
|
171
171
|
] }),
|
|
172
|
-
|
|
173
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-
|
|
174
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-
|
|
172
|
+
o.canonicalText && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
173
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Canonical Text" }),
|
|
174
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-copy-light m-0 font-mono", children: o.canonicalText })
|
|
175
175
|
] })
|
|
176
176
|
] })
|
|
177
177
|
] })
|
|
@@ -179,44 +179,44 @@ const Pe = ({
|
|
|
179
179
|
] })
|
|
180
180
|
}
|
|
181
181
|
);
|
|
182
|
-
}, je = ({ open:
|
|
183
|
-
const
|
|
184
|
-
key: ee +
|
|
185
|
-
initialValue:
|
|
182
|
+
}, je = ({ open: k, onOpenChange: D, user: d }) => {
|
|
183
|
+
const o = q(null), { getAccessToken: y } = Te(), [E] = N(void 0), [l, M] = N("active"), [A, p] = re({
|
|
184
|
+
key: ee + we,
|
|
185
|
+
initialValue: c.DESC
|
|
186
186
|
}), [P, T] = re({
|
|
187
187
|
key: ee + ve,
|
|
188
188
|
initialValue: "createdAt"
|
|
189
|
-
}), [
|
|
189
|
+
}), [h, n] = N(A || c.DESC), [u, R] = N(
|
|
190
190
|
P || "createdAt"
|
|
191
|
-
), { data:
|
|
191
|
+
), { data: w, isLoading: H, isError: $ } = De({
|
|
192
192
|
user: d,
|
|
193
|
-
query:
|
|
194
|
-
getAccessToken:
|
|
195
|
-
enabled:
|
|
193
|
+
query: E,
|
|
194
|
+
getAccessToken: y,
|
|
195
|
+
enabled: k && l === "active"
|
|
196
196
|
}), {
|
|
197
197
|
data: g,
|
|
198
198
|
isLoading: X,
|
|
199
199
|
isError: V
|
|
200
|
-
} =
|
|
200
|
+
} = Ee({
|
|
201
201
|
user: d,
|
|
202
|
-
query:
|
|
203
|
-
getAccessToken:
|
|
204
|
-
enabled:
|
|
205
|
-
}), F =
|
|
206
|
-
S.current = { id: t, text: i, description:
|
|
207
|
-
},
|
|
202
|
+
query: E,
|
|
203
|
+
getAccessToken: y,
|
|
204
|
+
enabled: k && l === "expired"
|
|
205
|
+
}), F = Me({ getAccessToken: y }), j = be({ getAccessToken: y }), Y = Re({ getAccessToken: y }), G = Ie({ getAccessToken: y }), J = Le({ getAccessToken: y }), [de, K] = N(!1), S = q(null), [me, Q] = N(!1), [xe, U] = N(!1), x = q(null), W = (t, i, a, m) => {
|
|
206
|
+
S.current = { id: t, text: i, description: a, createdAt: m }, K(!0);
|
|
207
|
+
}, pe = () => {
|
|
208
208
|
S.current && F.mutate({ user: d, memoryId: S.current.id });
|
|
209
|
-
},
|
|
209
|
+
}, he = (t, i, a, m, ye, Ae, Ce, Ne, ke, Se) => {
|
|
210
210
|
x.current = {
|
|
211
211
|
id: t,
|
|
212
212
|
description: i,
|
|
213
|
-
categories:
|
|
213
|
+
categories: a,
|
|
214
214
|
quote: m,
|
|
215
|
-
canonicalText:
|
|
216
|
-
confidence:
|
|
215
|
+
canonicalText: ye,
|
|
216
|
+
confidence: Ae,
|
|
217
217
|
status: Ce,
|
|
218
218
|
sourceType: Ne,
|
|
219
|
-
expiration:
|
|
219
|
+
expiration: ke,
|
|
220
220
|
expiresAt: Se
|
|
221
221
|
}, U(!0);
|
|
222
222
|
}, ue = (t, i) => {
|
|
@@ -238,8 +238,8 @@ const Pe = ({
|
|
|
238
238
|
}, fe = () => {
|
|
239
239
|
d && (l === "active" ? j.mutate({ user: d }) : Y.mutate({ user: d }));
|
|
240
240
|
}, Z = (t) => {
|
|
241
|
-
const i = `${t.total} memor${t.total === 1 ? "y" : "ies"}`,
|
|
242
|
-
return i +
|
|
241
|
+
const i = `${t.total} memor${t.total === 1 ? "y" : "ies"}`, a = t.totalTokenUsage ? ` (~${t.totalTokenUsage} tokens)` : "";
|
|
242
|
+
return i + a;
|
|
243
243
|
};
|
|
244
244
|
return /* @__PURE__ */ r(I, { children: [
|
|
245
245
|
/* @__PURE__ */ e(
|
|
@@ -267,7 +267,7 @@ const Pe = ({
|
|
|
267
267
|
{
|
|
268
268
|
showConfirmation: de,
|
|
269
269
|
setShowConfirmation: K,
|
|
270
|
-
action:
|
|
270
|
+
action: pe,
|
|
271
271
|
customStrings: {
|
|
272
272
|
title: "Delete memory",
|
|
273
273
|
confirmAction: "Delete",
|
|
@@ -305,22 +305,22 @@ const Pe = ({
|
|
|
305
305
|
}
|
|
306
306
|
),
|
|
307
307
|
/* @__PURE__ */ e(
|
|
308
|
-
|
|
308
|
+
se,
|
|
309
309
|
{
|
|
310
|
-
open:
|
|
311
|
-
onOpenChange: (t) =>
|
|
310
|
+
open: k,
|
|
311
|
+
onOpenChange: (t) => D(t),
|
|
312
312
|
title: "User Memories",
|
|
313
313
|
animation: !0,
|
|
314
314
|
animationType: "fade",
|
|
315
315
|
blurEffect: "large",
|
|
316
|
-
initialFocus:
|
|
317
|
-
footer: /* @__PURE__ */ r(
|
|
316
|
+
initialFocus: o,
|
|
317
|
+
footer: /* @__PURE__ */ r(b, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
|
318
318
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
319
|
-
|
|
319
|
+
ae,
|
|
320
320
|
{
|
|
321
|
-
onOpenChange:
|
|
321
|
+
onOpenChange: D,
|
|
322
322
|
label: "Close",
|
|
323
|
-
ref:
|
|
323
|
+
ref: o
|
|
324
324
|
}
|
|
325
325
|
) }),
|
|
326
326
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
@@ -329,14 +329,14 @@ const Pe = ({
|
|
|
329
329
|
mode: "dark",
|
|
330
330
|
focusMode: "light",
|
|
331
331
|
variant: "danger",
|
|
332
|
-
disabled: (l === "active" ? j.isPending : Y.isPending) || (l === "active" ? (
|
|
332
|
+
disabled: (l === "active" ? j.isPending : Y.isPending) || (l === "active" ? (w?.total ?? 0) === 0 : (g?.total ?? 0) === 0),
|
|
333
333
|
onClick: ge,
|
|
334
334
|
children: "Delete All"
|
|
335
335
|
}
|
|
336
336
|
) })
|
|
337
337
|
] }),
|
|
338
338
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-4 @container/editmemoriespanel", children: [
|
|
339
|
-
/* @__PURE__ */ r(
|
|
339
|
+
/* @__PURE__ */ r(b, { columnGap: 2, alignHorizontal: "center", children: [
|
|
340
340
|
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
|
|
341
341
|
B,
|
|
342
342
|
{
|
|
@@ -344,7 +344,7 @@ const Pe = ({
|
|
|
344
344
|
mode: l === "active" ? "light" : "dark",
|
|
345
345
|
size: "small",
|
|
346
346
|
noBorder: !0,
|
|
347
|
-
onClick: () =>
|
|
347
|
+
onClick: () => M("active"),
|
|
348
348
|
children: "Active Memories"
|
|
349
349
|
}
|
|
350
350
|
) }),
|
|
@@ -355,7 +355,7 @@ const Pe = ({
|
|
|
355
355
|
mode: l === "expired" ? "light" : "dark",
|
|
356
356
|
size: "small",
|
|
357
357
|
noBorder: !0,
|
|
358
|
-
onClick: () =>
|
|
358
|
+
onClick: () => M("expired"),
|
|
359
359
|
children: "Expired Memories"
|
|
360
360
|
}
|
|
361
361
|
) })
|
|
@@ -371,19 +371,19 @@ const Pe = ({
|
|
|
371
371
|
),
|
|
372
372
|
children: l === "active" ? /* @__PURE__ */ r(I, { children: [
|
|
373
373
|
H && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
|
|
374
|
-
$ && /* @__PURE__ */ e("p", { className: "m-0 text-
|
|
375
|
-
!H && !$ && (
|
|
376
|
-
|
|
374
|
+
$ && /* @__PURE__ */ e("p", { className: "m-0 text-copy-error-light", children: "Failed to load memories." }),
|
|
375
|
+
!H && !$ && (w && w.items.length > 0 ? /* @__PURE__ */ r(
|
|
376
|
+
oe,
|
|
377
377
|
{
|
|
378
378
|
stickyHeader: !0,
|
|
379
379
|
stickyFooter: !0,
|
|
380
380
|
compact: !0,
|
|
381
381
|
mode: "alt-system",
|
|
382
|
-
caption: Z(
|
|
382
|
+
caption: Z(w),
|
|
383
383
|
children: [
|
|
384
|
-
/* @__PURE__ */ e(
|
|
385
|
-
/* @__PURE__ */ e(
|
|
386
|
-
/* @__PURE__ */ e(
|
|
384
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r(v, { children: [
|
|
385
|
+
/* @__PURE__ */ e(s, { className: "sr-only", children: "Row" }),
|
|
386
|
+
/* @__PURE__ */ e(s, { children: "Memory" }),
|
|
387
387
|
/* @__PURE__ */ e(
|
|
388
388
|
z,
|
|
389
389
|
{
|
|
@@ -391,12 +391,12 @@ const Pe = ({
|
|
|
391
391
|
buttonClassName: "text-xs sm:text-sm",
|
|
392
392
|
cellId: "createdAt",
|
|
393
393
|
align: "left",
|
|
394
|
-
sortDirection:
|
|
394
|
+
sortDirection: h,
|
|
395
395
|
sortedCell: u,
|
|
396
396
|
onClick: () => {
|
|
397
|
-
R("createdAt"), T("createdAt"),
|
|
398
|
-
const i = t ===
|
|
399
|
-
return
|
|
397
|
+
R("createdAt"), T("createdAt"), n((t) => {
|
|
398
|
+
const i = t === c.ASC ? c.DESC : c.ASC;
|
|
399
|
+
return p(i), i;
|
|
400
400
|
});
|
|
401
401
|
},
|
|
402
402
|
children: "Date"
|
|
@@ -409,36 +409,42 @@ const Pe = ({
|
|
|
409
409
|
buttonClassName: "text-xs sm:text-sm",
|
|
410
410
|
cellId: "expiresAt",
|
|
411
411
|
align: "left",
|
|
412
|
-
sortDirection:
|
|
412
|
+
sortDirection: h,
|
|
413
413
|
sortedCell: u,
|
|
414
414
|
onClick: () => {
|
|
415
|
-
R("expiresAt"), T("expiresAt"),
|
|
416
|
-
const i = t ===
|
|
417
|
-
return
|
|
415
|
+
R("expiresAt"), T("expiresAt"), n((t) => {
|
|
416
|
+
const i = t === c.ASC ? c.DESC : c.ASC;
|
|
417
|
+
return p(i), i;
|
|
418
418
|
});
|
|
419
419
|
},
|
|
420
420
|
children: "Expires"
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
/* @__PURE__ */ e(
|
|
423
|
+
/* @__PURE__ */ e(s, { align: "right", children: "Actions" })
|
|
424
424
|
] }) }),
|
|
425
|
-
/* @__PURE__ */ e(le, { children: [...
|
|
425
|
+
/* @__PURE__ */ e(le, { children: [...w.items].sort((t, i) => {
|
|
426
426
|
if (u === "createdAt") {
|
|
427
|
-
const
|
|
428
|
-
return
|
|
427
|
+
const a = t.createdAt ? new Date(t.createdAt).getTime() : 0, m = i.createdAt ? new Date(i.createdAt).getTime() : 0;
|
|
428
|
+
return h === c.ASC ? a - m : m - a;
|
|
429
429
|
}
|
|
430
430
|
if (u === "expiresAt") {
|
|
431
|
-
const
|
|
432
|
-
return
|
|
431
|
+
const a = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, m = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
432
|
+
return h === c.ASC ? a - m : m - a;
|
|
433
433
|
}
|
|
434
434
|
return 0;
|
|
435
435
|
}).map((t, i) => /* @__PURE__ */ r(v, { children: [
|
|
436
|
-
/* @__PURE__ */ e(a, { className: C("dark:text-gray-400"), children: i + 1 }),
|
|
437
436
|
/* @__PURE__ */ e(
|
|
438
|
-
|
|
437
|
+
s,
|
|
438
|
+
{
|
|
439
|
+
className: C("dark:text-copy-medium"),
|
|
440
|
+
children: i + 1
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
/* @__PURE__ */ e(
|
|
444
|
+
s,
|
|
439
445
|
{
|
|
440
446
|
className: C(
|
|
441
|
-
"dark:text-
|
|
447
|
+
"dark:text-copy-lighter",
|
|
442
448
|
"max-w-25 sm:max-w-100",
|
|
443
449
|
"text-xs sm:text-sm"
|
|
444
450
|
),
|
|
@@ -449,34 +455,32 @@ const Pe = ({
|
|
|
449
455
|
}
|
|
450
456
|
),
|
|
451
457
|
/* @__PURE__ */ e(
|
|
452
|
-
|
|
458
|
+
s,
|
|
453
459
|
{
|
|
454
|
-
component: "th",
|
|
455
|
-
scope: "row",
|
|
456
460
|
className: C(
|
|
457
|
-
"dark:text-
|
|
461
|
+
"dark:text-copy-medium",
|
|
458
462
|
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
459
463
|
),
|
|
460
464
|
children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
|
|
461
465
|
}
|
|
462
466
|
),
|
|
463
467
|
/* @__PURE__ */ e(
|
|
464
|
-
|
|
468
|
+
s,
|
|
465
469
|
{
|
|
466
470
|
className: C(
|
|
467
|
-
"dark:text-
|
|
471
|
+
"dark:text-copy-medium",
|
|
468
472
|
"sm:whitespace-nowrap text-xs sm:text-sm"
|
|
469
473
|
),
|
|
470
474
|
children: t.expiresAt ? new Date(t.expiresAt).toLocaleDateString() : "Never"
|
|
471
475
|
}
|
|
472
476
|
),
|
|
473
477
|
/* @__PURE__ */ e(
|
|
474
|
-
|
|
478
|
+
s,
|
|
475
479
|
{
|
|
476
480
|
className: "align-top border-l border-table-light dark:border-table-dark",
|
|
477
481
|
align: "right",
|
|
478
482
|
children: /* @__PURE__ */ r(
|
|
479
|
-
|
|
483
|
+
b,
|
|
480
484
|
{
|
|
481
485
|
columnGap: 2,
|
|
482
486
|
alignHorizontal: "flex-end",
|
|
@@ -495,7 +499,7 @@ const Pe = ({
|
|
|
495
499
|
label: "Edit memory",
|
|
496
500
|
variant: "primary",
|
|
497
501
|
disabled: G.isPending,
|
|
498
|
-
onClick: () =>
|
|
502
|
+
onClick: () => he(
|
|
499
503
|
t.memoryId,
|
|
500
504
|
t.description || t.text,
|
|
501
505
|
t.categories,
|
|
@@ -525,7 +529,7 @@ const Pe = ({
|
|
|
525
529
|
noBorder: !0,
|
|
526
530
|
label: "Delete memory",
|
|
527
531
|
variant: "primary",
|
|
528
|
-
iconClassName: "text-
|
|
532
|
+
iconClassName: "text-copy-error-dark dark:text-copy-error-light",
|
|
529
533
|
disabled: F.isPending,
|
|
530
534
|
onClick: () => W(
|
|
531
535
|
t.memoryId,
|
|
@@ -544,17 +548,17 @@ const Pe = ({
|
|
|
544
548
|
}
|
|
545
549
|
)
|
|
546
550
|
] }, t.memoryId)) }),
|
|
547
|
-
/* @__PURE__ */ e(
|
|
551
|
+
/* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(s, { colSpan: 5, children: Z(w) }) }) })
|
|
548
552
|
]
|
|
549
553
|
}
|
|
550
554
|
) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
|
|
551
555
|
] }) : /* @__PURE__ */ r(I, { children: [
|
|
552
556
|
X && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading expired memories..." }),
|
|
553
|
-
V && /* @__PURE__ */ e("p", { className: "m-0 text-
|
|
554
|
-
!X && !V && (g && g.items.length > 0 ? /* @__PURE__ */ r(
|
|
555
|
-
/* @__PURE__ */ e(
|
|
556
|
-
/* @__PURE__ */ e(
|
|
557
|
-
/* @__PURE__ */ e(
|
|
557
|
+
V && /* @__PURE__ */ e("p", { className: "m-0 text-copy-error-light", children: "Failed to load expired memories." }),
|
|
558
|
+
!X && !V && (g && g.items.length > 0 ? /* @__PURE__ */ r(oe, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
|
559
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ r(v, { children: [
|
|
560
|
+
/* @__PURE__ */ e(s, { className: "sr-only", children: "Row" }),
|
|
561
|
+
/* @__PURE__ */ e(s, { children: "Memory" }),
|
|
558
562
|
/* @__PURE__ */ e(
|
|
559
563
|
z,
|
|
560
564
|
{
|
|
@@ -562,12 +566,12 @@ const Pe = ({
|
|
|
562
566
|
buttonClassName: "text-xs sm:text-sm",
|
|
563
567
|
cellId: "createdAt",
|
|
564
568
|
align: "left",
|
|
565
|
-
sortDirection:
|
|
569
|
+
sortDirection: h,
|
|
566
570
|
sortedCell: u,
|
|
567
571
|
onClick: () => {
|
|
568
|
-
R("createdAt"), T("createdAt"),
|
|
569
|
-
const i = t ===
|
|
570
|
-
return
|
|
572
|
+
R("createdAt"), T("createdAt"), n((t) => {
|
|
573
|
+
const i = t === c.ASC ? c.DESC : c.ASC;
|
|
574
|
+
return p(i), i;
|
|
571
575
|
});
|
|
572
576
|
},
|
|
573
577
|
children: "Date"
|
|
@@ -580,36 +584,42 @@ const Pe = ({
|
|
|
580
584
|
buttonClassName: "text-xs sm:text-sm",
|
|
581
585
|
cellId: "expiresAt",
|
|
582
586
|
align: "left",
|
|
583
|
-
sortDirection:
|
|
587
|
+
sortDirection: h,
|
|
584
588
|
sortedCell: u,
|
|
585
589
|
onClick: () => {
|
|
586
|
-
R("expiresAt"), T("expiresAt"),
|
|
587
|
-
const i = t ===
|
|
588
|
-
return
|
|
590
|
+
R("expiresAt"), T("expiresAt"), n((t) => {
|
|
591
|
+
const i = t === c.ASC ? c.DESC : c.ASC;
|
|
592
|
+
return p(i), i;
|
|
589
593
|
});
|
|
590
594
|
},
|
|
591
595
|
children: "Expired"
|
|
592
596
|
}
|
|
593
597
|
),
|
|
594
|
-
/* @__PURE__ */ e(
|
|
598
|
+
/* @__PURE__ */ e(s, { align: "right", children: "Actions" })
|
|
595
599
|
] }) }),
|
|
596
600
|
/* @__PURE__ */ e(le, { children: [...g.items].sort((t, i) => {
|
|
597
601
|
if (u === "createdAt") {
|
|
598
|
-
const
|
|
599
|
-
return
|
|
602
|
+
const a = t.createdAt ? new Date(t.createdAt).getTime() : 0, m = i.createdAt ? new Date(i.createdAt).getTime() : 0;
|
|
603
|
+
return h === c.ASC ? a - m : m - a;
|
|
600
604
|
}
|
|
601
605
|
if (u === "expiresAt") {
|
|
602
|
-
const
|
|
603
|
-
return
|
|
606
|
+
const a = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, m = i.expiresAt ? new Date(i.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
607
|
+
return h === c.ASC ? a - m : m - a;
|
|
604
608
|
}
|
|
605
609
|
return 0;
|
|
606
610
|
}).map((t, i) => /* @__PURE__ */ r(v, { children: [
|
|
607
|
-
/* @__PURE__ */ e(a, { className: C("dark:text-gray-400"), children: i + 1 }),
|
|
608
611
|
/* @__PURE__ */ e(
|
|
609
|
-
|
|
612
|
+
s,
|
|
613
|
+
{
|
|
614
|
+
className: C("dark:text-copy-medium"),
|
|
615
|
+
children: i + 1
|
|
616
|
+
}
|
|
617
|
+
),
|
|
618
|
+
/* @__PURE__ */ e(
|
|
619
|
+
s,
|
|
610
620
|
{
|
|
611
621
|
className: C(
|
|
612
|
-
"dark:text-
|
|
622
|
+
"dark:text-copy-lighter",
|
|
613
623
|
"max-w-25 sm:max-w-100",
|
|
614
624
|
"text-xs sm:text-sm"
|
|
615
625
|
),
|
|
@@ -620,34 +630,32 @@ const Pe = ({
|
|
|
620
630
|
}
|
|
621
631
|
),
|
|
622
632
|
/* @__PURE__ */ e(
|
|
623
|
-
|
|
633
|
+
s,
|
|
624
634
|
{
|
|
625
|
-
component: "th",
|
|
626
|
-
scope: "row",
|
|
627
635
|
className: C(
|
|
628
|
-
"dark:text-
|
|
636
|
+
"dark:text-copy-medium",
|
|
629
637
|
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
|
630
638
|
),
|
|
631
639
|
children: t.createdAt ? new Date(t.createdAt).toLocaleDateString() : "-"
|
|
632
640
|
}
|
|
633
641
|
),
|
|
634
642
|
/* @__PURE__ */ e(
|
|
635
|
-
|
|
643
|
+
s,
|
|
636
644
|
{
|
|
637
645
|
className: C(
|
|
638
|
-
"dark:text-
|
|
646
|
+
"dark:text-copy-medium",
|
|
639
647
|
"sm:whitespace-nowrap text-xs sm:text-sm"
|
|
640
648
|
),
|
|
641
649
|
children: t.expiresAt ? new Date(t.expiresAt).toLocaleDateString() : "-"
|
|
642
650
|
}
|
|
643
651
|
),
|
|
644
652
|
/* @__PURE__ */ e(
|
|
645
|
-
|
|
653
|
+
s,
|
|
646
654
|
{
|
|
647
655
|
className: "align-top border-l border-table-light dark:border-table-dark",
|
|
648
656
|
align: "right",
|
|
649
657
|
children: /* @__PURE__ */ r(
|
|
650
|
-
|
|
658
|
+
b,
|
|
651
659
|
{
|
|
652
660
|
columnGap: 2,
|
|
653
661
|
alignHorizontal: "flex-end",
|
|
@@ -690,7 +698,7 @@ const Pe = ({
|
|
|
690
698
|
noBorder: !0,
|
|
691
699
|
label: "Delete memory",
|
|
692
700
|
variant: "primary",
|
|
693
|
-
iconClassName: "text-
|
|
701
|
+
iconClassName: "text-copy-error-dark dark:text-copy-error-light",
|
|
694
702
|
disabled: F.isPending,
|
|
695
703
|
onClick: () => W(
|
|
696
704
|
t.memoryId,
|
|
@@ -709,7 +717,7 @@ const Pe = ({
|
|
|
709
717
|
}
|
|
710
718
|
)
|
|
711
719
|
] }, t.memoryId)) }),
|
|
712
|
-
/* @__PURE__ */ e(
|
|
720
|
+
/* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(v, { children: /* @__PURE__ */ r(s, { colSpan: 5, children: [
|
|
713
721
|
g.total,
|
|
714
722
|
" expired memor",
|
|
715
723
|
g.total === 1 ? "y" : "ies",
|