@versini/sassysaint 8.110.0 → 8.110.2
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.BfOWMaYg.js → AboutChangelog.DEj7-6K6.js} +2 -2
- package/dist/chunks/AboutEntry.BSWdup9R.js +77 -0
- package/dist/chunks/{App.BD0e8HgV.js → App.Hqmg5y2Y.js} +2435 -2452
- package/dist/chunks/{Bubble.fxUgvZMG.js → Bubble.DJc-QO-3.js} +1 -1
- package/dist/chunks/ButtonIconDelete.D4aZDe7F.js +335 -0
- package/dist/chunks/{Chart.C-EqsPgy.js → Chart.CPv5Bfk9.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.hM8owVIk.js → ChatBubbleAssistant.DqUdvWwl.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.CnsuEhxO.js → ChatBubbleUser.Cs4LFprm.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.WRplbgo4.js → ChatHistoryTable.CkVMdj9x.js} +73 -73
- package/dist/chunks/{HistoryEntry.BgO_PD7Q.js → HistoryEntry.DM331KtZ.js} +72 -80
- package/dist/chunks/LoginEntry.Cvod0kbl.js +118 -0
- package/dist/chunks/{LogoEntry.CucXks5G.js → LogoEntry.DohsYXa0.js} +642 -746
- package/dist/chunks/MemoriesEntry.DJEsuqmV.js +649 -0
- package/dist/chunks/ProfileEntry.DHOE716m.js +205 -0
- package/dist/chunks/{SettingsEntry.ByPtC4lj.js → SettingsEntry.6_BWb1qD.js} +114 -122
- package/dist/chunks/UsageEntry.CtQKtTac.js +230 -0
- package/dist/chunks/{_baseUniq.DJhemj5B.js → _baseUniq.DdHdSR90.js} +1 -1
- package/dist/chunks/{arc.ClK0mYh2.js → arc.D4_xOXXj.js} +1 -1
- package/dist/chunks/{architecture-U656AL7Q.DGORleeb.js → architecture-U656AL7Q.s3rGBRgV.js} +1 -1
- package/dist/chunks/{architectureDiagram-VXUJARFQ.HR_eet_T.js → architectureDiagram-VXUJARFQ.CdCO91E5.js} +4 -4
- package/dist/chunks/{blockDiagram-VD42YOAC.CWrnXf_B.js → blockDiagram-VD42YOAC.CCDa9IbF.js} +5 -5
- package/dist/chunks/{browser.5ieI9QUP.js → browser.G7msF8GI.js} +1 -1
- package/dist/chunks/{c4Diagram-YG6GDRKO.CaA0SaMc.js → c4Diagram-YG6GDRKO.BYwrdrnm.js} +2 -2
- package/dist/chunks/{channel.BI8KZVUl.js → channel.Bhd_WAGN.js} +1 -1
- package/dist/chunks/{chunk-4BX2VUAB.CTzK9jPw.js → chunk-4BX2VUAB.CAsx7lRR.js} +1 -1
- package/dist/chunks/{chunk-55IACEB6.DMb8Reca.js → chunk-55IACEB6.ChwKLiO_.js} +1 -1
- package/dist/chunks/{chunk-B4BG7PRW.BHBa3N2V.js → chunk-B4BG7PRW.0XXdIUvB.js} +4 -4
- package/dist/chunks/{chunk-DI55MBZ5.Bqwg_jpX.js → chunk-DI55MBZ5.PoYuLfqT.js} +3 -3
- package/dist/chunks/{chunk-FMBD7UC4.p8OpoFJE.js → chunk-FMBD7UC4.ClQPaEEe.js} +1 -1
- package/dist/chunks/{chunk-QN33PNHL._xYLGQNv.js → chunk-QN33PNHL.BNHDFW8q.js} +1 -1
- package/dist/chunks/{chunk-QZHKN3VN.Bt1FHb64.js → chunk-QZHKN3VN.YjxD8GE7.js} +1 -1
- package/dist/chunks/{chunk-TZMSLE5B.hFsU0iJf.js → chunk-TZMSLE5B.CTNar1je.js} +1 -1
- package/dist/chunks/{classDiagram-2ON5EDUG.DiSJfiEu.js → classDiagram-2ON5EDUG.Ccr_Z8SZ.js} +2 -2
- package/dist/chunks/{classDiagram-v2-WZHVMYZB.DiSJfiEu.js → classDiagram-v2-WZHVMYZB.Ccr_Z8SZ.js} +2 -2
- package/dist/chunks/{clone.NcwizCyH.js → clone.BX8gciZV.js} +1 -1
- package/dist/chunks/{cose-bilkent-S5V4N54A.DogEbzcD.js → cose-bilkent-S5V4N54A.CJs1QiYn.js} +2 -2
- package/dist/chunks/{dagre-6UL2VRFP.Cy_GltZx.js → dagre-6UL2VRFP.DL9dVBGy.js} +5 -5
- package/dist/chunks/{diagram-PSM6KHXK.CazeYJ2F.js → diagram-PSM6KHXK.BlxCy0Sy.js} +4 -4
- package/dist/chunks/{diagram-QEK2KX5R.ByhZHDpm.js → diagram-QEK2KX5R.BWDu5W6C.js} +3 -3
- package/dist/chunks/{diagram-S2PKOQOG.D49-fpQd.js → diagram-S2PKOQOG.Ri3EElHD.js} +3 -3
- package/dist/chunks/{erDiagram-Q2GNP2WA.nce3gDBb.js → erDiagram-Q2GNP2WA.DEiFjTBB.js} +4 -4
- package/dist/chunks/{flowDiagram-NV44I4VS.DDUGMSKf.js → flowDiagram-NV44I4VS.BW00PHx7.js} +5 -5
- package/dist/chunks/{ganttDiagram-JELNMOA3.NGXzLkaH.js → ganttDiagram-JELNMOA3.ema0-IHx.js} +2 -2
- package/dist/chunks/{gitGraph-F6HP7TQM.BzKXexyv.js → gitGraph-F6HP7TQM.D7K-i_h_.js} +1 -1
- package/dist/chunks/{gitGraphDiagram-NY62KEGX.C3cn9f8o.js → gitGraphDiagram-NY62KEGX.D4HvM8U6.js} +4 -4
- package/dist/chunks/{graph.CURTRirk.js → graph.WmSD_kIW.js} +2 -2
- package/dist/chunks/{index.DAuo-OH1.js → index.5YcMrbtG.js} +1 -1
- package/dist/chunks/{index.BYDZbdMZ.js → index.BDdSIqNw.js} +1 -1
- package/dist/chunks/{index.CBEv2y_C.js → index.BRIbdI1P.js} +2 -2
- package/dist/chunks/{index.BinkIORG.js → index.CUKXvrUy.js} +1 -1
- package/dist/chunks/{index.gy41K1EE.js → index.CspNN5N2.js} +3 -3
- package/dist/chunks/{index.uUNtrS04.js → index.Damzobcg.js} +3 -3
- package/dist/chunks/{index.BqIARWUR.js → index.HEruAaRk.js} +1 -1
- package/dist/chunks/{index.CkajM1v0.js → index.OMR8Uuyn.js} +1 -1
- package/dist/chunks/{index.CURM9PiU.js → index.fRQVHuxk.js} +1 -1
- package/dist/chunks/{info-NVLQJR56.CHnZmbT7.js → info-NVLQJR56.jYI0Duob.js} +1 -1
- package/dist/chunks/{infoDiagram-WHAUD3N6.DCZfKYU8.js → infoDiagram-WHAUD3N6.BqOPFyGl.js} +2 -2
- package/dist/chunks/{journeyDiagram-XKPGCS4Q.B-0JNmK_.js → journeyDiagram-XKPGCS4Q.B1bd5wZT.js} +4 -4
- package/dist/chunks/{kanban-definition-3W4ZIXB7.C7aI8iBJ.js → kanban-definition-3W4ZIXB7.CXydmjo0.js} +2 -2
- package/dist/chunks/{layout.Bmgsrc8X.js → layout.D0fWXkiy.js} +4 -4
- package/dist/chunks/{mermaid-parser.core.BZIZyjyF.js → mermaid-parser.core.7OYqXvcF.js} +10 -10
- package/dist/chunks/{min.CtR4qhyM.js → min.DULzPnFA.js} +2 -2
- package/dist/chunks/{mindmap-definition-VGOIOE7T.DCsxzuhI.js → mindmap-definition-VGOIOE7T.BUC8Tuhp.js} +3 -3
- package/dist/chunks/{packet-BFZMPI3H.CQ2Sbdms.js → packet-BFZMPI3H.D_-dNPlf.js} +1 -1
- package/dist/chunks/{pie-7BOR55EZ.BYs1omMd.js → pie-7BOR55EZ.C5wUCEk_.js} +1 -1
- package/dist/chunks/{pieDiagram-ADFJNKIX.DqkDHdMo.js → pieDiagram-ADFJNKIX.DOCTIr8o.js} +4 -4
- package/dist/chunks/{quadrantDiagram-AYHSOK5B.Cx-eq1uu.js → quadrantDiagram-AYHSOK5B.DbasmgIr.js} +1 -1
- package/dist/chunks/{radar-NHE76QYJ.CIqwL1Hw.js → radar-NHE76QYJ.D-zD079S.js} +1 -1
- package/dist/chunks/{rehype-mermaid.LJaY9ylI.js → rehype-mermaid.C6-wTJWi.js} +33 -33
- package/dist/chunks/{requirementDiagram-UZGBJVZJ.C-YKp79x.js → requirementDiagram-UZGBJVZJ.CnuUJN5O.js} +3 -3
- package/dist/chunks/{sankeyDiagram-TZEHDZUN.BbfUzvVS.js → sankeyDiagram-TZEHDZUN.R_1cgZZg.js} +1 -1
- package/dist/chunks/{sequenceDiagram-WL72ISMW.D5wDvZwT.js → sequenceDiagram-WL72ISMW.sCa2kzuv.js} +3 -3
- package/dist/chunks/{stateDiagram-FKZM4ZOC.-65PQCxm.js → stateDiagram-FKZM4ZOC.DczjcrsN.js} +4 -4
- package/dist/chunks/{stateDiagram-v2-4FDKWEC3.BXy_3BUS.js → stateDiagram-v2-4FDKWEC3.DwOAdSSj.js} +2 -2
- package/dist/chunks/{timeline-definition-IT6M3QCI.B2tmtGDZ.js → timeline-definition-IT6M3QCI.Qx0o1egT.js} +2 -2
- package/dist/chunks/{treemap-KMMF4GRG.Dm_alnmO.js → treemap-KMMF4GRG.CwfQGJx8.js} +1 -1
- package/dist/chunks/{useMarkdown.BWJCktGN.js → useMarkdown.CZvYSQuE.js} +8 -8
- package/dist/chunks/{xychartDiagram-PRI3JC2R.XQCHu3eO.js → xychartDiagram-PRI3JC2R.CFOiW2rk.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/chunks/AboutEntry.B7fBRGac.js +0 -85
- package/dist/chunks/ButtonIconDelete.Bw7zU6Rb.js +0 -456
- package/dist/chunks/LoginEntry.DvDNWT7T.js +0 -118
- package/dist/chunks/MemoriesEntry.OQ1K4KNa.js +0 -743
- package/dist/chunks/ProfileEntry.CbZLIK8x.js +0 -213
- package/dist/chunks/UsageEntry.CSkPteMr.js +0 -238
|
@@ -0,0 +1,649 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { n as pe, LOCAL_STORAGE_PREFIX as H, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as he, LOCAL_STORAGE_SORT_MEMORY_COLUMN as fe, useUserMemories as ge, useExpiredMemories as ye, useDeleteMemory as be, useDeleteAllActiveMemories as Ne, useDeleteAllExpiredMemories as ve, useUpdateMemory as Ce, useRestoreMemory as Ae } from "./index.BRIbdI1P.js";
|
|
3
|
+
import { Button as D, TableCellSortDirections as N, ButtonIcon as O, IconEdit as Te, IconRestore as Se, IconDelete as we } from "./LogoEntry.DohsYXa0.js";
|
|
4
|
+
import { Panel as K, Toggle as E, ButtonCancel as Q, ResponsiveTooltip as P, useLocalStorage as X, ConfirmationPanel as Y } from "./App.Hqmg5y2Y.js";
|
|
5
|
+
import S from "clsx";
|
|
6
|
+
import { useState as h, useEffect as Ee, useRef as B } from "react";
|
|
7
|
+
import { TextArea as De } from "./index.5YcMrbtG.js";
|
|
8
|
+
import { TableHead as ke, TableRow as _, TableCell as f, TableCellSort as J, ButtonIconDelete as Me, Table as Re, TableBody as Ie, TableFooter as Le } from "./ButtonIconDelete.D4aZDe7F.js";
|
|
9
|
+
const Oe = ({
|
|
10
|
+
open: r,
|
|
11
|
+
onOpenChange: s,
|
|
12
|
+
initialText: i,
|
|
13
|
+
metadata: t,
|
|
14
|
+
onSave: l,
|
|
15
|
+
isSaving: c = !1
|
|
16
|
+
}) => {
|
|
17
|
+
const [o, p] = h(i), [d, u] = h("none");
|
|
18
|
+
Ee(() => {
|
|
19
|
+
if (r) {
|
|
20
|
+
p(i);
|
|
21
|
+
const a = t?.expiration || "none";
|
|
22
|
+
u(a);
|
|
23
|
+
}
|
|
24
|
+
}, [r, i, t?.expiration]);
|
|
25
|
+
const g = () => {
|
|
26
|
+
if (o.trim().length >= 3) {
|
|
27
|
+
const a = d === "none" ? null : d;
|
|
28
|
+
l(o.trim(), a);
|
|
29
|
+
}
|
|
30
|
+
}, y = o.trim().length >= 3, v = o.trim() !== i.trim() || d !== (t?.expiration || "none");
|
|
31
|
+
return /* @__PURE__ */ e(
|
|
32
|
+
K,
|
|
33
|
+
{
|
|
34
|
+
open: r,
|
|
35
|
+
onOpenChange: s,
|
|
36
|
+
title: "Edit Memory",
|
|
37
|
+
animation: !0,
|
|
38
|
+
animationType: "fade",
|
|
39
|
+
footer: /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-x-2", children: [
|
|
40
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(Q, { onOpenChange: s, label: "Cancel" }) }),
|
|
41
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
42
|
+
D,
|
|
43
|
+
{
|
|
44
|
+
mode: "dark",
|
|
45
|
+
focusMode: "light",
|
|
46
|
+
disabled: c || !y || !v,
|
|
47
|
+
onClick: g,
|
|
48
|
+
children: c ? "Saving..." : "Save"
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] }),
|
|
52
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col pt-2 gap-4", children: [
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
De,
|
|
55
|
+
{
|
|
56
|
+
mode: "dark",
|
|
57
|
+
focusMode: "light",
|
|
58
|
+
label: "Memory text",
|
|
59
|
+
name: "memoryText",
|
|
60
|
+
value: o,
|
|
61
|
+
onChange: (a) => p(a.target.value),
|
|
62
|
+
autoFocus: !0,
|
|
63
|
+
helperText: o.trim().length < 3 ? "Memory text must be at least 3 characters" : `${o.length} characters`
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ n("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
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: [
|
|
70
|
+
/* @__PURE__ */ e(
|
|
71
|
+
E,
|
|
72
|
+
{
|
|
73
|
+
mode: "dark",
|
|
74
|
+
focusMode: "light",
|
|
75
|
+
noBorder: !0,
|
|
76
|
+
narrow: !0,
|
|
77
|
+
label: "Never expire",
|
|
78
|
+
name: "expiration-none",
|
|
79
|
+
checked: d === "none",
|
|
80
|
+
onChange: (a) => {
|
|
81
|
+
a && u("none");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ e(
|
|
86
|
+
E,
|
|
87
|
+
{
|
|
88
|
+
mode: "dark",
|
|
89
|
+
focusMode: "light",
|
|
90
|
+
noBorder: !0,
|
|
91
|
+
narrow: !0,
|
|
92
|
+
label: "Short (1 month)",
|
|
93
|
+
name: "expiration-short",
|
|
94
|
+
checked: d === "short",
|
|
95
|
+
onChange: (a) => {
|
|
96
|
+
a && u("short");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ e(
|
|
101
|
+
E,
|
|
102
|
+
{
|
|
103
|
+
mode: "dark",
|
|
104
|
+
focusMode: "light",
|
|
105
|
+
noBorder: !0,
|
|
106
|
+
narrow: !0,
|
|
107
|
+
label: "Medium (6 months)",
|
|
108
|
+
name: "expiration-medium",
|
|
109
|
+
checked: d === "medium",
|
|
110
|
+
onChange: (a) => {
|
|
111
|
+
a && u("medium");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ e(
|
|
116
|
+
E,
|
|
117
|
+
{
|
|
118
|
+
mode: "dark",
|
|
119
|
+
focusMode: "light",
|
|
120
|
+
noBorder: !0,
|
|
121
|
+
narrow: !0,
|
|
122
|
+
label: "Long (1 year)",
|
|
123
|
+
name: "expiration-long",
|
|
124
|
+
checked: d === "long",
|
|
125
|
+
onChange: (a) => {
|
|
126
|
+
a && u("long");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] })
|
|
131
|
+
] }),
|
|
132
|
+
t && /* @__PURE__ */ n("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
|
+
t.categories && t.categories.length > 0 && /* @__PURE__ */ n("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: t.categories.map((a, C) => /* @__PURE__ */ e(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
className: "text-xs px-2 py-1 text-copy-light rounded",
|
|
140
|
+
children: a
|
|
141
|
+
},
|
|
142
|
+
`${a}-${C}`
|
|
143
|
+
)) })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col sm:flex-row gap-4", children: [
|
|
146
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
|
|
147
|
+
t.confidence !== void 0 && t.confidence !== null && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
148
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Confidence" }),
|
|
149
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-copy-light", children: [
|
|
150
|
+
(t.confidence * 100).toFixed(0),
|
|
151
|
+
"%"
|
|
152
|
+
] })
|
|
153
|
+
] }),
|
|
154
|
+
t.status && /* @__PURE__ */ n("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: t.status })
|
|
157
|
+
] }),
|
|
158
|
+
t.sourceType && /* @__PURE__ */ n("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: t.sourceType })
|
|
161
|
+
] })
|
|
162
|
+
] }),
|
|
163
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3 sm:flex-1", children: [
|
|
164
|
+
t.quote && /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
|
|
165
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-copy-medium uppercase", children: "Original Prompt" }),
|
|
166
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-copy-light m-0 italic", children: [
|
|
167
|
+
'"',
|
|
168
|
+
t.quote,
|
|
169
|
+
'"'
|
|
170
|
+
] })
|
|
171
|
+
] }),
|
|
172
|
+
t.canonicalText && /* @__PURE__ */ n("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: t.canonicalText })
|
|
175
|
+
] })
|
|
176
|
+
] })
|
|
177
|
+
] })
|
|
178
|
+
] })
|
|
179
|
+
] })
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
function Pe({
|
|
184
|
+
isLoading: r,
|
|
185
|
+
isError: s,
|
|
186
|
+
viewMode: i
|
|
187
|
+
}) {
|
|
188
|
+
const t = i === "expired" ? "expired memories" : "memories";
|
|
189
|
+
return r ? /* @__PURE__ */ n("p", { className: "m-0", children: [
|
|
190
|
+
"Loading ",
|
|
191
|
+
t,
|
|
192
|
+
"..."
|
|
193
|
+
] }) : s ? /* @__PURE__ */ n("p", { className: "m-0 text-copy-error-light", children: [
|
|
194
|
+
"Failed to load ",
|
|
195
|
+
t,
|
|
196
|
+
"."
|
|
197
|
+
] }) : null;
|
|
198
|
+
}
|
|
199
|
+
function Be({ viewMode: r }) {
|
|
200
|
+
return /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: r === "expired" ? "No expired memories." : "No memories stored." });
|
|
201
|
+
}
|
|
202
|
+
function _e({
|
|
203
|
+
sortDirection: r,
|
|
204
|
+
sortedCell: s,
|
|
205
|
+
viewMode: i,
|
|
206
|
+
onSortChange: t
|
|
207
|
+
}) {
|
|
208
|
+
const l = (c) => {
|
|
209
|
+
t(c);
|
|
210
|
+
};
|
|
211
|
+
return /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ n(_, { children: [
|
|
212
|
+
/* @__PURE__ */ e(f, { className: "sr-only", children: "Row" }),
|
|
213
|
+
/* @__PURE__ */ e(f, { children: "Memory" }),
|
|
214
|
+
/* @__PURE__ */ e(
|
|
215
|
+
J,
|
|
216
|
+
{
|
|
217
|
+
focusMode: "system",
|
|
218
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
219
|
+
cellId: "createdAt",
|
|
220
|
+
align: "left",
|
|
221
|
+
sortDirection: r,
|
|
222
|
+
sortedCell: s,
|
|
223
|
+
onClick: () => l("createdAt"),
|
|
224
|
+
children: "Date"
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ e(
|
|
228
|
+
J,
|
|
229
|
+
{
|
|
230
|
+
focusMode: "system",
|
|
231
|
+
buttonClassName: "text-xs sm:text-sm",
|
|
232
|
+
cellId: "expiresAt",
|
|
233
|
+
align: "left",
|
|
234
|
+
sortDirection: r,
|
|
235
|
+
sortedCell: s,
|
|
236
|
+
onClick: () => l("expiresAt"),
|
|
237
|
+
children: i === "active" ? "Expires" : "Expired"
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ e(f, { align: "right", children: "Actions" })
|
|
241
|
+
] }) });
|
|
242
|
+
}
|
|
243
|
+
function ze(r, s, i) {
|
|
244
|
+
return [...r].sort((t, l) => {
|
|
245
|
+
if (s === "createdAt") {
|
|
246
|
+
const c = t.createdAt ? new Date(t.createdAt).getTime() : 0, o = l.createdAt ? new Date(l.createdAt).getTime() : 0;
|
|
247
|
+
return i === N.ASC ? c - o : o - c;
|
|
248
|
+
}
|
|
249
|
+
if (s === "expiresAt") {
|
|
250
|
+
const c = t.expiresAt ? new Date(t.expiresAt).getTime() : Number.MAX_SAFE_INTEGER, o = l.expiresAt ? new Date(l.expiresAt).getTime() : Number.MAX_SAFE_INTEGER;
|
|
251
|
+
return i === N.ASC ? c - o : o - c;
|
|
252
|
+
}
|
|
253
|
+
return 0;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function Fe(r, s) {
|
|
257
|
+
const i = `${r} memor${r === 1 ? "y" : "ies"}`, t = s ? ` (~${s} tokens)` : "";
|
|
258
|
+
return i + t;
|
|
259
|
+
}
|
|
260
|
+
const T = {
|
|
261
|
+
rowNumber: "dark:text-copy-medium",
|
|
262
|
+
memoryText: "dark:text-copy-lighter max-w-25 sm:max-w-100 text-xs sm:text-sm",
|
|
263
|
+
date: "dark:text-copy-medium sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
|
264
|
+
dateCompact: "dark:text-copy-medium sm:whitespace-nowrap text-xs sm:text-sm",
|
|
265
|
+
actions: "align-top border-l border-table-light dark:border-table-dark"
|
|
266
|
+
};
|
|
267
|
+
function qe({
|
|
268
|
+
memory: r,
|
|
269
|
+
index: s,
|
|
270
|
+
viewMode: i,
|
|
271
|
+
isEditPending: t = !1,
|
|
272
|
+
isDeletePending: l = !1,
|
|
273
|
+
isRestorePending: c = !1,
|
|
274
|
+
onEdit: o,
|
|
275
|
+
onDelete: p,
|
|
276
|
+
onRestore: d
|
|
277
|
+
}) {
|
|
278
|
+
const u = r.description || r.text, g = r.createdAt ? new Date(r.createdAt).toLocaleDateString() : "-", y = r.expiresAt ? new Date(r.expiresAt).toLocaleDateString() : i === "active" ? "Never" : "-";
|
|
279
|
+
return /* @__PURE__ */ n(_, { children: [
|
|
280
|
+
/* @__PURE__ */ e(f, { className: S(T.rowNumber), children: s + 1 }),
|
|
281
|
+
/* @__PURE__ */ e(
|
|
282
|
+
f,
|
|
283
|
+
{
|
|
284
|
+
className: S(T.memoryText),
|
|
285
|
+
style: { wordBreak: "break-word" },
|
|
286
|
+
children: u
|
|
287
|
+
}
|
|
288
|
+
),
|
|
289
|
+
/* @__PURE__ */ e(f, { className: S(T.date), children: g }),
|
|
290
|
+
/* @__PURE__ */ e(f, { className: S(T.dateCompact), children: y }),
|
|
291
|
+
/* @__PURE__ */ e(f, { className: T.actions, align: "right", children: /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-x-2", children: [
|
|
292
|
+
i === "active" && o && /* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
293
|
+
P,
|
|
294
|
+
{
|
|
295
|
+
label: "Edit memory",
|
|
296
|
+
mode: "system",
|
|
297
|
+
placement: "top",
|
|
298
|
+
trigger: /* @__PURE__ */ e(
|
|
299
|
+
O,
|
|
300
|
+
{
|
|
301
|
+
focusMode: "system",
|
|
302
|
+
noBorder: !0,
|
|
303
|
+
label: "Edit memory",
|
|
304
|
+
variant: "primary",
|
|
305
|
+
disabled: t,
|
|
306
|
+
onClick: () => o(r),
|
|
307
|
+
children: /* @__PURE__ */ e(Te, { size: "size-3", monotone: !0 })
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
) }),
|
|
312
|
+
i === "expired" && d && /* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
313
|
+
P,
|
|
314
|
+
{
|
|
315
|
+
label: "Restore memory",
|
|
316
|
+
mode: "system",
|
|
317
|
+
placement: "top",
|
|
318
|
+
trigger: /* @__PURE__ */ e(
|
|
319
|
+
O,
|
|
320
|
+
{
|
|
321
|
+
focusMode: "system",
|
|
322
|
+
noBorder: !0,
|
|
323
|
+
label: "Restore memory",
|
|
324
|
+
variant: "primary",
|
|
325
|
+
disabled: c,
|
|
326
|
+
onClick: () => d(r.memoryId),
|
|
327
|
+
children: /* @__PURE__ */ e(Se, { size: "size-3", monotone: !0 })
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
) }),
|
|
332
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: i === "active" ? /* @__PURE__ */ e(
|
|
333
|
+
Me,
|
|
334
|
+
{
|
|
335
|
+
label: "Delete memory",
|
|
336
|
+
disabled: l,
|
|
337
|
+
onClick: () => p(r)
|
|
338
|
+
}
|
|
339
|
+
) : /* @__PURE__ */ e(
|
|
340
|
+
P,
|
|
341
|
+
{
|
|
342
|
+
label: "Delete memory",
|
|
343
|
+
mode: "system",
|
|
344
|
+
placement: "top",
|
|
345
|
+
trigger: /* @__PURE__ */ e(
|
|
346
|
+
O,
|
|
347
|
+
{
|
|
348
|
+
focusMode: "system",
|
|
349
|
+
noBorder: !0,
|
|
350
|
+
label: "Delete memory",
|
|
351
|
+
variant: "primary",
|
|
352
|
+
iconClassName: "text-copy-error-dark dark:text-copy-error-light",
|
|
353
|
+
disabled: l,
|
|
354
|
+
onClick: () => p(r),
|
|
355
|
+
children: /* @__PURE__ */ e(we, { size: "size-3", monotone: !0 })
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
}
|
|
359
|
+
) })
|
|
360
|
+
] }) })
|
|
361
|
+
] }, r.memoryId);
|
|
362
|
+
}
|
|
363
|
+
function je({
|
|
364
|
+
data: r,
|
|
365
|
+
isLoading: s,
|
|
366
|
+
isError: i,
|
|
367
|
+
viewMode: t,
|
|
368
|
+
sortDirection: l,
|
|
369
|
+
sortedCell: c,
|
|
370
|
+
isEditPending: o = !1,
|
|
371
|
+
isDeletePending: p = !1,
|
|
372
|
+
isRestorePending: d = !1,
|
|
373
|
+
onSortChange: u,
|
|
374
|
+
onEdit: g,
|
|
375
|
+
onDelete: y,
|
|
376
|
+
onRestore: v
|
|
377
|
+
}) {
|
|
378
|
+
const a = /* @__PURE__ */ e(
|
|
379
|
+
Pe,
|
|
380
|
+
{
|
|
381
|
+
isLoading: s,
|
|
382
|
+
isError: i,
|
|
383
|
+
viewMode: t
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
if (s || i)
|
|
387
|
+
return a;
|
|
388
|
+
if (!r || r.items.length === 0)
|
|
389
|
+
return /* @__PURE__ */ e(Be, { viewMode: t });
|
|
390
|
+
const C = ze(r.items, c, l), w = Fe(r.total, r.totalTokenUsage);
|
|
391
|
+
return /* @__PURE__ */ n(
|
|
392
|
+
Re,
|
|
393
|
+
{
|
|
394
|
+
stickyHeader: !0,
|
|
395
|
+
stickyFooter: !0,
|
|
396
|
+
compact: !0,
|
|
397
|
+
mode: "alt-system",
|
|
398
|
+
caption: t === "active" ? w : void 0,
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ e(
|
|
401
|
+
_e,
|
|
402
|
+
{
|
|
403
|
+
sortDirection: l,
|
|
404
|
+
sortedCell: c,
|
|
405
|
+
viewMode: t,
|
|
406
|
+
onSortChange: u
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
/* @__PURE__ */ e(Ie, { children: C.map((A, k) => /* @__PURE__ */ e(
|
|
410
|
+
qe,
|
|
411
|
+
{
|
|
412
|
+
memory: A,
|
|
413
|
+
index: k,
|
|
414
|
+
viewMode: t,
|
|
415
|
+
isEditPending: o,
|
|
416
|
+
isDeletePending: p,
|
|
417
|
+
isRestorePending: d,
|
|
418
|
+
onEdit: g,
|
|
419
|
+
onDelete: y,
|
|
420
|
+
onRestore: v
|
|
421
|
+
},
|
|
422
|
+
A.memoryId
|
|
423
|
+
)) }),
|
|
424
|
+
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(f, { colSpan: 5, children: w }) }) })
|
|
425
|
+
]
|
|
426
|
+
}
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
const Qe = ({ open: r, onOpenChange: s, user: i }) => {
|
|
430
|
+
const t = B(null), { getAccessToken: l } = pe(), [c] = h(void 0), [o, p] = h("active"), [d, u] = X({
|
|
431
|
+
key: H + he,
|
|
432
|
+
initialValue: N.DESC
|
|
433
|
+
}), [g, y] = X({
|
|
434
|
+
key: H + fe,
|
|
435
|
+
initialValue: "createdAt"
|
|
436
|
+
}), [v, a] = h(
|
|
437
|
+
d || N.DESC
|
|
438
|
+
), [C, w] = h(
|
|
439
|
+
g || "createdAt"
|
|
440
|
+
), { data: A, isLoading: k, isError: W } = ge({
|
|
441
|
+
user: i,
|
|
442
|
+
query: c,
|
|
443
|
+
getAccessToken: l,
|
|
444
|
+
enabled: r && o === "active"
|
|
445
|
+
}), {
|
|
446
|
+
data: z,
|
|
447
|
+
isLoading: Z,
|
|
448
|
+
isError: ee
|
|
449
|
+
} = ye({
|
|
450
|
+
user: i,
|
|
451
|
+
query: c,
|
|
452
|
+
getAccessToken: l,
|
|
453
|
+
enabled: r && o === "expired"
|
|
454
|
+
}), F = be({ getAccessToken: l }), q = Ne({ getAccessToken: l }), j = ve({ getAccessToken: l }), M = Ce({ getAccessToken: l }), $ = Ae({ getAccessToken: l }), [te, G] = h(!1), b = B(null), [re, U] = h(!1), [ie, R] = h(!1), m = B(null), oe = (x) => {
|
|
455
|
+
w(x), y(x), a((I) => {
|
|
456
|
+
const V = I === N.ASC ? N.DESC : N.ASC;
|
|
457
|
+
return u(V), V;
|
|
458
|
+
});
|
|
459
|
+
}, ne = (x) => {
|
|
460
|
+
b.current = x, G(!0);
|
|
461
|
+
}, le = () => {
|
|
462
|
+
b.current && i && F.mutate({ user: i, memoryId: b.current.memoryId });
|
|
463
|
+
}, se = (x) => {
|
|
464
|
+
m.current = x, R(!0);
|
|
465
|
+
}, ae = (x, I) => {
|
|
466
|
+
m.current && i && M.mutate(
|
|
467
|
+
{
|
|
468
|
+
user: i,
|
|
469
|
+
memoryId: m.current.memoryId,
|
|
470
|
+
description: x,
|
|
471
|
+
expiration: I || void 0
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
onSuccess: () => {
|
|
475
|
+
R(!1);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}, ce = (x) => {
|
|
480
|
+
i && $.mutate({ user: i, memoryId: x });
|
|
481
|
+
}, de = () => {
|
|
482
|
+
i && U(!0);
|
|
483
|
+
}, me = () => {
|
|
484
|
+
i && (o === "active" ? q.mutate({ user: i }) : j.mutate({ user: i }));
|
|
485
|
+
}, xe = o === "active" ? A : z, ue = (o === "active" ? q.isPending : j.isPending) || (xe?.total ?? 0) === 0;
|
|
486
|
+
return /* @__PURE__ */ n(L, { children: [
|
|
487
|
+
/* @__PURE__ */ e(
|
|
488
|
+
Oe,
|
|
489
|
+
{
|
|
490
|
+
open: ie,
|
|
491
|
+
onOpenChange: R,
|
|
492
|
+
initialText: m.current?.description || "",
|
|
493
|
+
metadata: m.current ? {
|
|
494
|
+
categories: m.current.categories,
|
|
495
|
+
quote: m.current.quote,
|
|
496
|
+
canonicalText: m.current.canonicalText,
|
|
497
|
+
confidence: m.current.confidence,
|
|
498
|
+
status: m.current.status,
|
|
499
|
+
sourceType: m.current.sourceType,
|
|
500
|
+
expiration: m.current.expiration,
|
|
501
|
+
expiresAt: m.current.expiresAt
|
|
502
|
+
} : void 0,
|
|
503
|
+
onSave: ae,
|
|
504
|
+
isSaving: M.isPending
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ n(
|
|
508
|
+
Y,
|
|
509
|
+
{
|
|
510
|
+
showConfirmation: te,
|
|
511
|
+
setShowConfirmation: G,
|
|
512
|
+
action: le,
|
|
513
|
+
customStrings: {
|
|
514
|
+
title: "Delete memory",
|
|
515
|
+
confirmAction: "Delete",
|
|
516
|
+
cancelAction: "Cancel"
|
|
517
|
+
},
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
|
|
520
|
+
/* @__PURE__ */ n("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
|
|
521
|
+
/* @__PURE__ */ n("li", { children: [
|
|
522
|
+
"Excerpt:",
|
|
523
|
+
" ",
|
|
524
|
+
(b.current?.description || b.current?.text || "").slice(0, 80)
|
|
525
|
+
] }),
|
|
526
|
+
/* @__PURE__ */ n("li", { children: [
|
|
527
|
+
"Created:",
|
|
528
|
+
" ",
|
|
529
|
+
b.current?.createdAt ? new Date(b.current.createdAt).toLocaleString() : "-"
|
|
530
|
+
] })
|
|
531
|
+
] })
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
),
|
|
535
|
+
/* @__PURE__ */ e(
|
|
536
|
+
Y,
|
|
537
|
+
{
|
|
538
|
+
showConfirmation: re,
|
|
539
|
+
setShowConfirmation: U,
|
|
540
|
+
action: me,
|
|
541
|
+
customStrings: {
|
|
542
|
+
title: "Delete memories",
|
|
543
|
+
confirmAction: "Delete all",
|
|
544
|
+
cancelAction: "Cancel"
|
|
545
|
+
},
|
|
546
|
+
children: /* @__PURE__ */ e("p", { className: "m-0", children: o === "active" ? /* @__PURE__ */ n(L, { children: [
|
|
547
|
+
"This will permanently delete all ",
|
|
548
|
+
/* @__PURE__ */ e("em", { children: "active memories" }),
|
|
549
|
+
" for this user. This action cannot be undone."
|
|
550
|
+
] }) : /* @__PURE__ */ n(L, { children: [
|
|
551
|
+
"This will permanently delete all ",
|
|
552
|
+
/* @__PURE__ */ e("em", { children: "expired memories" }),
|
|
553
|
+
" for this user. This action cannot be undone."
|
|
554
|
+
] }) })
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
/* @__PURE__ */ e(
|
|
558
|
+
K,
|
|
559
|
+
{
|
|
560
|
+
open: r,
|
|
561
|
+
onOpenChange: (x) => s(x),
|
|
562
|
+
title: "User Memories",
|
|
563
|
+
animation: !0,
|
|
564
|
+
animationType: "fade",
|
|
565
|
+
blurEffect: "large",
|
|
566
|
+
initialFocus: t,
|
|
567
|
+
footer: /* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-x-2", children: [
|
|
568
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
569
|
+
Q,
|
|
570
|
+
{
|
|
571
|
+
onOpenChange: s,
|
|
572
|
+
label: "Close",
|
|
573
|
+
ref: t
|
|
574
|
+
}
|
|
575
|
+
) }),
|
|
576
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
577
|
+
D,
|
|
578
|
+
{
|
|
579
|
+
mode: "dark",
|
|
580
|
+
focusMode: "light",
|
|
581
|
+
variant: "danger",
|
|
582
|
+
disabled: ue,
|
|
583
|
+
onClick: de,
|
|
584
|
+
children: "Delete All"
|
|
585
|
+
}
|
|
586
|
+
) })
|
|
587
|
+
] }),
|
|
588
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-4 @container/editmemoriespanel", children: [
|
|
589
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap justify-center gap-x-2", children: [
|
|
590
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
591
|
+
D,
|
|
592
|
+
{
|
|
593
|
+
focusMode: "light",
|
|
594
|
+
mode: o === "active" ? "light" : "dark",
|
|
595
|
+
size: "small",
|
|
596
|
+
noBorder: !0,
|
|
597
|
+
onClick: () => p("active"),
|
|
598
|
+
children: "Active Memories"
|
|
599
|
+
}
|
|
600
|
+
) }),
|
|
601
|
+
/* @__PURE__ */ e("div", { className: "box-border max-w-full basis-auto", children: /* @__PURE__ */ e(
|
|
602
|
+
D,
|
|
603
|
+
{
|
|
604
|
+
focusMode: "light",
|
|
605
|
+
mode: o === "expired" ? "light" : "dark",
|
|
606
|
+
size: "small",
|
|
607
|
+
noBorder: !0,
|
|
608
|
+
onClick: () => p("expired"),
|
|
609
|
+
children: "Expired Memories"
|
|
610
|
+
}
|
|
611
|
+
) })
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ e(
|
|
614
|
+
"div",
|
|
615
|
+
{
|
|
616
|
+
className: S(
|
|
617
|
+
"flex flex-col sm:flex-row",
|
|
618
|
+
"max-h-[75vh]",
|
|
619
|
+
"sm:max-h-[75vh]",
|
|
620
|
+
"min-h-[70vh]"
|
|
621
|
+
),
|
|
622
|
+
children: /* @__PURE__ */ e(
|
|
623
|
+
je,
|
|
624
|
+
{
|
|
625
|
+
data: o === "active" ? A : z,
|
|
626
|
+
isLoading: o === "active" ? k : Z,
|
|
627
|
+
isError: o === "active" ? W : ee,
|
|
628
|
+
viewMode: o,
|
|
629
|
+
sortDirection: v,
|
|
630
|
+
sortedCell: C,
|
|
631
|
+
isEditPending: M.isPending,
|
|
632
|
+
isDeletePending: F.isPending,
|
|
633
|
+
isRestorePending: $.isPending,
|
|
634
|
+
onSortChange: oe,
|
|
635
|
+
onEdit: o === "active" ? se : void 0,
|
|
636
|
+
onDelete: ne,
|
|
637
|
+
onRestore: o === "expired" ? ce : void 0
|
|
638
|
+
}
|
|
639
|
+
)
|
|
640
|
+
}
|
|
641
|
+
)
|
|
642
|
+
] })
|
|
643
|
+
}
|
|
644
|
+
)
|
|
645
|
+
] });
|
|
646
|
+
};
|
|
647
|
+
export {
|
|
648
|
+
Qe as default
|
|
649
|
+
};
|