@versini/sassysaint 8.58.2 → 8.59.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.BJb6evn9.js → AboutChangelog.BFWMcRm4.js} +2 -2
- package/dist/chunks/{AboutEntry.CKS9KQYk.js → AboutEntry.DKwOqNku.js} +9 -9
- package/dist/chunks/{App.Bw24TFS-.js → App.ByGdXRya.js} +1809 -1784
- package/dist/chunks/{Chart.Cddg0IXQ.js → Chart.BlcdPNHb.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.6-hK6qAF.js → ChatBubbleAssistant.CkiLypHj.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.DpUR_1HU.js → ChatBubbleUser.CvmnS21N.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BB5ESpr2.js → ChatHistoryTable.HgQHkuIF.js} +3 -3
- package/dist/chunks/{HistoryEntry.BQlLgB9G.js → HistoryEntry.ChMN73ur.js} +14 -14
- package/dist/chunks/{ProfileEntry.CuUO01aL.js → ProfileEntry.D06LnFW0.js} +2 -2
- package/dist/chunks/SettingsEntry.CNaTt-r6.js +430 -0
- package/dist/chunks/{Table.BLNonpLk.js → Table.Dq6I5nCO.js} +2 -2
- package/dist/chunks/{UsageEntry.CuWrk617.js → UsageEntry.byI1G2V2.js} +3 -3
- package/dist/chunks/UserMemoriesPanel.DZ0k7dfU.js +694 -0
- package/dist/chunks/{index.CQgBz9Dt.js → index.BQJIRbP2.js} +1 -1
- package/dist/chunks/{index.Ds-UToar.js → index.CRhxUc6P.js} +1 -1
- package/dist/chunks/{index.BjpuOtB7.js → index.Ch-d_j4p.js} +616 -584
- package/dist/chunks/{index.Cs8bFhFv.js → index.DUa5g65l.js} +1 -1
- package/dist/chunks/{index.Dgyiis4p.js → index.DoZfvCy9.js} +2 -2
- package/dist/chunks/{index.CcOFJwqN.js → index.fRMGO5xc.js} +1 -1
- package/dist/chunks/{index.YTqgXQdg.js → index.olReGXzd.js} +3 -3
- package/dist/chunks/{useMarkdown.CskeXXFn.js → useMarkdown.CX6ld7dH.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/chunks/SettingsEntry.6T_vvycf.js +0 -781
- package/dist/chunks/UserMemoriesPanel.3ikfhdxH.js +0 -205
@@ -0,0 +1,694 @@
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as we } from "react/jsx-runtime";
|
2
|
+
import { I as ve, o as Ce, h as re, i as Ae, x as Ee, L as $, j as H, C as X, n as Me, LOCAL_STORAGE_PREFIX as oe, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as Te, LOCAL_STORAGE_SORT_MEMORY_COLUMN as De, useUserMemories as Ne, useDeleteMemory as Se, useDeleteAllMemories as _e, useUpdateMemory as Oe, te as ae } from "./index.Ch-d_j4p.js";
|
3
|
+
import { oe as ce, E as le, e as P, ConfirmationPanel as ie, st as ne } from "./App.ByGdXRya.js";
|
4
|
+
import c from "clsx";
|
5
|
+
import Re, { useState as x, useEffect as de, useRef as N, useLayoutEffect as F } from "react";
|
6
|
+
import { j as Le, D as Pe, G as W, M as D, F as He, H as Ie, l as Be, U as ze } from "./Table.Dq6I5nCO.js";
|
7
|
+
function Ve({
|
8
|
+
value: t,
|
9
|
+
defaultValue: l,
|
10
|
+
finalValue: r,
|
11
|
+
onChange: a = () => {
|
12
|
+
},
|
13
|
+
initialControlledDelay: o = 0
|
14
|
+
}) {
|
15
|
+
const [i, d] = x(!1), [u, w] = x(
|
16
|
+
l !== void 0 ? l : r
|
17
|
+
), b = (h) => {
|
18
|
+
w(h), a?.(h);
|
19
|
+
};
|
20
|
+
return de(() => {
|
21
|
+
(async () => t !== void 0 && !i && o > 0 && (await new Promise(
|
22
|
+
(h) => setTimeout(h, o)
|
23
|
+
), d(!0)))();
|
24
|
+
}, [t, o, i]), t !== void 0 ? !i && o > 0 ? ["", a, !0] : [t, a, !0] : [u, b, !1];
|
25
|
+
}
|
26
|
+
const Fe = ({
|
27
|
+
className: t,
|
28
|
+
viewBox: l,
|
29
|
+
title: r,
|
30
|
+
monotone: a,
|
31
|
+
...o
|
32
|
+
}) => /* @__PURE__ */ m(
|
33
|
+
ve,
|
34
|
+
{
|
35
|
+
defaultViewBox: "0 0 512 512",
|
36
|
+
size: "size-5",
|
37
|
+
viewBox: l,
|
38
|
+
className: t,
|
39
|
+
title: r || "Edit",
|
40
|
+
...o,
|
41
|
+
children: [
|
42
|
+
/* @__PURE__ */ e(
|
43
|
+
"path",
|
44
|
+
{
|
45
|
+
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",
|
46
|
+
opacity: a ? "1" : "0.4"
|
47
|
+
}
|
48
|
+
),
|
49
|
+
/* @__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" })
|
50
|
+
]
|
51
|
+
}
|
52
|
+
), me = "av-text-area", je = "av-text-area-wrapper", Z = "av-text-area-helper-text", Ue = "av-text-area__control--right", Ge = "av-text-area__control--left", qe = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Xe = ({ mode: t }) => c({
|
53
|
+
"bg-surface-darker text-copy-lighter caret-copy-light": t === "dark",
|
54
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark": t === "light",
|
55
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": t === "system",
|
56
|
+
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": t === "alt-system"
|
57
|
+
}), Ye = ({
|
58
|
+
focusMode: t
|
59
|
+
}) => c("focus:outline focus:outline-2 focus:outline-offset-2", {
|
60
|
+
"focus:outline-focus-dark": t === "dark",
|
61
|
+
"focus:outline-focus-light": t === "light",
|
62
|
+
"focus:outline-focus-light dark:focus:outline-focus-dark": t === "alt-system",
|
63
|
+
"focus:outline-focus-dark dark:focus:outline-focus-light": t === "system"
|
64
|
+
}), Je = ({
|
65
|
+
noBorder: t,
|
66
|
+
error: l
|
67
|
+
}) => c("border-2", {
|
68
|
+
"border-border-dark": !t && !l,
|
69
|
+
"focus:border-border-dark": !t && l,
|
70
|
+
"border-border-error-dark": !t && l,
|
71
|
+
"border-transparent": t
|
72
|
+
}), Ke = ({
|
73
|
+
disabled: t,
|
74
|
+
raw: l,
|
75
|
+
error: r,
|
76
|
+
mode: a,
|
77
|
+
leftElement: o,
|
78
|
+
rightElement: i
|
79
|
+
}) => {
|
80
|
+
if (l)
|
81
|
+
return "";
|
82
|
+
if (t)
|
83
|
+
return c(
|
84
|
+
"transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
|
85
|
+
{
|
86
|
+
"translate-x-[12px]": i === !0 && !o || !i && !o
|
87
|
+
}
|
88
|
+
);
|
89
|
+
if (!r)
|
90
|
+
return c(
|
91
|
+
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
92
|
+
{
|
93
|
+
"translate-x-[12px]": i === !0 && !o || !i && !o,
|
94
|
+
"text-copy-medium": a === "dark",
|
95
|
+
"text-copy-dark": a === "light",
|
96
|
+
"text-copy-dark dark:text-copy-medium": a === "system",
|
97
|
+
"text-copy-medium dark:text-copy-dark": a === "alt-system"
|
98
|
+
}
|
99
|
+
);
|
100
|
+
if (r)
|
101
|
+
return c(
|
102
|
+
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
103
|
+
{
|
104
|
+
"translate-x-[12px]": i === !0 && !o || !i && !o,
|
105
|
+
"text-copy-medium": a === "dark",
|
106
|
+
"text-copy-error-dark": a === "light",
|
107
|
+
"text-copy-error-dark dark:text-copy-error-light": a === "system",
|
108
|
+
"text-copy-medium dark:text-copy-error-dark": a === "alt-system"
|
109
|
+
}
|
110
|
+
);
|
111
|
+
}, Qe = ({
|
112
|
+
error: t,
|
113
|
+
raw: l,
|
114
|
+
mode: r,
|
115
|
+
disabled: a
|
116
|
+
}) => {
|
117
|
+
if (l)
|
118
|
+
return "";
|
119
|
+
if (a)
|
120
|
+
return c(
|
121
|
+
Z,
|
122
|
+
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
123
|
+
);
|
124
|
+
if (!t)
|
125
|
+
return c(Z, "absolute px-2 font-medium", {
|
126
|
+
"text-copy-medium": r === "dark",
|
127
|
+
"text-copy-dark": r === "light",
|
128
|
+
"text-copy-dark dark:text-copy-medium": r === "system",
|
129
|
+
"text-copy-medium dark:text-copy-dark": r === "alt-system"
|
130
|
+
});
|
131
|
+
if (t)
|
132
|
+
return c(Z, "absolute px-2 font-medium", {
|
133
|
+
"text-copy-error-light": r === "dark",
|
134
|
+
"text-copy-error-dark": r === "light",
|
135
|
+
"text-copy-error-dark dark:text-copy-error-light": r === "system",
|
136
|
+
"dark:text-copy-error-dark text-copy-error-light": r === "alt-system"
|
137
|
+
});
|
138
|
+
}, We = ({
|
139
|
+
className: t,
|
140
|
+
textAreaClassName: l,
|
141
|
+
raw: r,
|
142
|
+
focusMode: a,
|
143
|
+
disabled: o,
|
144
|
+
noBorder: i,
|
145
|
+
error: d,
|
146
|
+
mode: u,
|
147
|
+
leftElement: w,
|
148
|
+
rightElement: b
|
149
|
+
}) => {
|
150
|
+
const h = r ? t : c(
|
151
|
+
"relative flex w-full flex-col justify-center",
|
152
|
+
je,
|
153
|
+
t
|
154
|
+
), O = r ? c(l) : c(
|
155
|
+
me,
|
156
|
+
l,
|
157
|
+
qe(),
|
158
|
+
Xe({ mode: u }),
|
159
|
+
Ye({ focusMode: a }),
|
160
|
+
Je({
|
161
|
+
noBorder: i,
|
162
|
+
error: d
|
163
|
+
}),
|
164
|
+
{
|
165
|
+
"disabled:cursor-not-allowed disabled:opacity-50": o
|
166
|
+
}
|
167
|
+
), I = r ? void 0 : "sr-only", k = Ke({
|
168
|
+
disabled: o,
|
169
|
+
raw: r,
|
170
|
+
error: d,
|
171
|
+
mode: u,
|
172
|
+
rightElement: b,
|
173
|
+
leftElement: w
|
174
|
+
}), f = Qe({
|
175
|
+
error: d,
|
176
|
+
raw: r,
|
177
|
+
mode: u,
|
178
|
+
disabled: o
|
179
|
+
}), A = r ? void 0 : c(Ue, "absolute"), y = r ? void 0 : c(Ge, "absolute");
|
180
|
+
return {
|
181
|
+
wrapper: h,
|
182
|
+
textArea: O,
|
183
|
+
accessibleLabel: I,
|
184
|
+
visibleLabel: k,
|
185
|
+
helperText: f,
|
186
|
+
rightElement: A,
|
187
|
+
leftElement: y
|
188
|
+
};
|
189
|
+
}, Ze = ({
|
190
|
+
scrollHeight: t,
|
191
|
+
currentHeight: l,
|
192
|
+
currentLabelOffset: r = 0,
|
193
|
+
currentHelperTextOffset: a = 0
|
194
|
+
}) => {
|
195
|
+
let o, i;
|
196
|
+
if (t > 0 && t !== l) {
|
197
|
+
const d = t - l, u = Math.abs(d / 24);
|
198
|
+
o = r + -1 * Math.sign(d) * (12 * u), i = a + Math.sign(d) * (12 * u);
|
199
|
+
}
|
200
|
+
return {
|
201
|
+
labelOffset: o,
|
202
|
+
helperTextOffset: i,
|
203
|
+
scrollHeight: t
|
204
|
+
};
|
205
|
+
}, ue = Re.forwardRef(
|
206
|
+
({
|
207
|
+
id: t,
|
208
|
+
name: l,
|
209
|
+
label: r,
|
210
|
+
error: a = !1,
|
211
|
+
raw: o = !1,
|
212
|
+
className: i,
|
213
|
+
textAreaClassName: d,
|
214
|
+
mode: u = "system",
|
215
|
+
focusMode: w = "system",
|
216
|
+
value: b,
|
217
|
+
defaultValue: h,
|
218
|
+
disabled: O = !1,
|
219
|
+
noBorder: I = !1,
|
220
|
+
labelId: k,
|
221
|
+
helperText: f = "",
|
222
|
+
helperTextOnFocus: A = !1,
|
223
|
+
rightElement: y,
|
224
|
+
leftElement: v,
|
225
|
+
onChange: R,
|
226
|
+
onFocus: j,
|
227
|
+
onBlur: B,
|
228
|
+
...E
|
229
|
+
}, Y) => {
|
230
|
+
const p = N(null), J = Ce([Y, p]), [z, C] = re(), [K, M] = re(), V = N(80), U = N(-25), L = N(null), G = N(30), n = N(null), s = Ae({ id: t, prefix: `${me}-` }), [S, q] = x(0), [ee, he] = x(0), [fe, te] = x(
|
231
|
+
!!(!A && f)
|
232
|
+
), pe = `${l} error, ${f}`, _ = We({
|
233
|
+
className: i,
|
234
|
+
textAreaClassName: d,
|
235
|
+
error: a,
|
236
|
+
raw: o,
|
237
|
+
focusMode: w,
|
238
|
+
disabled: O,
|
239
|
+
noBorder: I,
|
240
|
+
mode: u,
|
241
|
+
rightElement: !!y,
|
242
|
+
leftElement: !!v
|
243
|
+
}), [T, xe] = Ve({
|
244
|
+
value: b,
|
245
|
+
initialControlledDelay: 20,
|
246
|
+
defaultValue: h,
|
247
|
+
onChange: (g) => {
|
248
|
+
R && R({
|
249
|
+
target: {
|
250
|
+
value: g
|
251
|
+
}
|
252
|
+
});
|
253
|
+
}
|
254
|
+
}), ye = (g) => {
|
255
|
+
xe(g.target.value);
|
256
|
+
}, ge = (g) => {
|
257
|
+
A && f && te(!0), j && j(g);
|
258
|
+
}, be = (g) => {
|
259
|
+
A && f && !T && te(!1), B && B(g);
|
260
|
+
};
|
261
|
+
return F(() => {
|
262
|
+
C && C.width && q(C.width + 18 + 10);
|
263
|
+
}, [C]), F(() => {
|
264
|
+
M && M.width && he(M.width + 18 + 10);
|
265
|
+
}, [M]), F(() => {
|
266
|
+
o || p && p.current && T !== void 0 && (p.current.style.height = "inherit", p.current.style.height = p.current.scrollHeight + "px");
|
267
|
+
}, [T, o]), F(() => {
|
268
|
+
o || setTimeout(() => {
|
269
|
+
L?.current?.style.setProperty(
|
270
|
+
"--av-text-area-wrapper-transition",
|
271
|
+
T ? "none" : "all 0.2s ease-out"
|
272
|
+
);
|
273
|
+
}, 0);
|
274
|
+
}, [T, o]), F(() => {
|
275
|
+
if (!o && p && p.current && T !== void 0) {
|
276
|
+
const { labelOffset: g, helperTextOffset: Q, scrollHeight: ke } = Ze({
|
277
|
+
scrollHeight: p.current.scrollHeight,
|
278
|
+
currentHeight: V.current,
|
279
|
+
currentLabelOffset: U.current,
|
280
|
+
currentHelperTextOffset: G.current
|
281
|
+
});
|
282
|
+
g && (U.current = g, L?.current?.style.setProperty(
|
283
|
+
"--av-text-area-label",
|
284
|
+
`${g}px`
|
285
|
+
)), Q && (G.current = Q, n?.current?.style.setProperty(
|
286
|
+
"--av-text-area-helper-text",
|
287
|
+
`${Q}px`
|
288
|
+
)), V.current = ke || V.current;
|
289
|
+
}
|
290
|
+
}, [T, o]), M.width > 0 && L?.current?.style.setProperty(
|
291
|
+
"--tw-translate-x",
|
292
|
+
`${12 + M.width + 5}px`
|
293
|
+
), /* @__PURE__ */ m("div", { className: _.wrapper, children: [
|
294
|
+
/* @__PURE__ */ e(
|
295
|
+
"label",
|
296
|
+
{
|
297
|
+
htmlFor: s,
|
298
|
+
id: k,
|
299
|
+
className: _.accessibleLabel,
|
300
|
+
children: r
|
301
|
+
}
|
302
|
+
),
|
303
|
+
v && /* @__PURE__ */ e(
|
304
|
+
"div",
|
305
|
+
{
|
306
|
+
ref: K,
|
307
|
+
className: _.leftElement,
|
308
|
+
children: v
|
309
|
+
}
|
310
|
+
),
|
311
|
+
/* @__PURE__ */ e(
|
312
|
+
"textarea",
|
313
|
+
{
|
314
|
+
ref: J,
|
315
|
+
id: s,
|
316
|
+
name: l,
|
317
|
+
disabled: O,
|
318
|
+
placeholder: o ? void 0 : " ",
|
319
|
+
className: _.textArea,
|
320
|
+
rows: 1,
|
321
|
+
...f && { "aria-describedby": `${s}-helper` },
|
322
|
+
...a && { "aria-invalid": "true" },
|
323
|
+
...y && !v && !o && { style: { paddingRight: S } },
|
324
|
+
...v && !y && !o && { style: { paddingLeft: ee } },
|
325
|
+
...y && v && !o && {
|
326
|
+
style: {
|
327
|
+
paddingRight: S,
|
328
|
+
paddingLeft: ee
|
329
|
+
}
|
330
|
+
},
|
331
|
+
value: T,
|
332
|
+
onChange: ye,
|
333
|
+
onFocus: ge,
|
334
|
+
onBlur: be,
|
335
|
+
...E
|
336
|
+
}
|
337
|
+
),
|
338
|
+
!o && /* @__PURE__ */ e(
|
339
|
+
"label",
|
340
|
+
{
|
341
|
+
ref: L,
|
342
|
+
"aria-hidden": !0,
|
343
|
+
htmlFor: s,
|
344
|
+
className: `${_.visibleLabel}`,
|
345
|
+
children: r
|
346
|
+
}
|
347
|
+
),
|
348
|
+
fe && /* @__PURE__ */ e(
|
349
|
+
"div",
|
350
|
+
{
|
351
|
+
ref: n,
|
352
|
+
id: `${s}-helper`,
|
353
|
+
className: _.helperText,
|
354
|
+
children: f
|
355
|
+
}
|
356
|
+
),
|
357
|
+
y && /* @__PURE__ */ e(
|
358
|
+
"div",
|
359
|
+
{
|
360
|
+
ref: z,
|
361
|
+
className: _.rightElement,
|
362
|
+
children: y
|
363
|
+
}
|
364
|
+
),
|
365
|
+
a && f && /* @__PURE__ */ e(Ee, { politeness: "polite", clearAnnouncementDelay: 500, children: pe })
|
366
|
+
] });
|
367
|
+
}
|
368
|
+
);
|
369
|
+
ue.displayName = "TextArea";
|
370
|
+
/*!
|
371
|
+
@versini/ui-textarea v5.0.1
|
372
|
+
© 2025 gizmette.com
|
373
|
+
*/
|
374
|
+
try {
|
375
|
+
window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
|
376
|
+
version: "5.0.1",
|
377
|
+
buildTime: "09/01/2025 04:01 PM EDT",
|
378
|
+
homepage: "https://github.com/aversini/ui-components",
|
379
|
+
license: "MIT"
|
380
|
+
});
|
381
|
+
} catch {
|
382
|
+
}
|
383
|
+
const $e = ({
|
384
|
+
open: t,
|
385
|
+
onOpenChange: l,
|
386
|
+
initialText: r,
|
387
|
+
onSave: a,
|
388
|
+
isSaving: o = !1
|
389
|
+
}) => {
|
390
|
+
const [i, d] = x(r);
|
391
|
+
de(() => {
|
392
|
+
t && d(r);
|
393
|
+
}, [t, r]);
|
394
|
+
const u = () => {
|
395
|
+
i.trim().length >= 3 && a(i.trim());
|
396
|
+
}, w = i.trim().length >= 3, b = i.trim() !== r.trim();
|
397
|
+
return /* @__PURE__ */ e(
|
398
|
+
ce,
|
399
|
+
{
|
400
|
+
maxHeight: "small",
|
401
|
+
kind: "messagebox",
|
402
|
+
open: t,
|
403
|
+
onOpenChange: l,
|
404
|
+
title: "Edit Memory",
|
405
|
+
animation: !0,
|
406
|
+
animationType: "fade",
|
407
|
+
footer: /* @__PURE__ */ m($, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
408
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
409
|
+
X,
|
410
|
+
{
|
411
|
+
mode: "dark",
|
412
|
+
variant: "secondary",
|
413
|
+
noBorder: !0,
|
414
|
+
focusMode: "light",
|
415
|
+
onClick: () => l(!1),
|
416
|
+
disabled: o,
|
417
|
+
children: "Cancel"
|
418
|
+
}
|
419
|
+
) }),
|
420
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
421
|
+
X,
|
422
|
+
{
|
423
|
+
mode: "dark",
|
424
|
+
focusMode: "light",
|
425
|
+
disabled: o || !w || !b,
|
426
|
+
onClick: u,
|
427
|
+
children: o ? "Saving..." : "Save"
|
428
|
+
}
|
429
|
+
) })
|
430
|
+
] }),
|
431
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-col max-h-[75vh] min-h-[40vh] pt-2", children: /* @__PURE__ */ e(
|
432
|
+
ue,
|
433
|
+
{
|
434
|
+
mode: "dark",
|
435
|
+
focusMode: "light",
|
436
|
+
label: "Memory text",
|
437
|
+
name: "memoryText",
|
438
|
+
value: i,
|
439
|
+
onChange: (h) => d(h.target.value),
|
440
|
+
rows: 2,
|
441
|
+
autoFocus: !0,
|
442
|
+
helperText: i.trim().length < 3 ? "Memory text must be at least 3 characters" : `${i.length} characters`
|
443
|
+
}
|
444
|
+
) })
|
445
|
+
}
|
446
|
+
);
|
447
|
+
}, se = ({
|
448
|
+
open: t,
|
449
|
+
onOpenChange: l,
|
450
|
+
user: r
|
451
|
+
}) => {
|
452
|
+
const { getAccessToken: a } = Me(), [o] = x(void 0), [i, d] = le({
|
453
|
+
key: oe + Te,
|
454
|
+
initialValue: P.DESC
|
455
|
+
}), [u, w] = le({
|
456
|
+
key: oe + De,
|
457
|
+
initialValue: "createdAt"
|
458
|
+
}), [b, h] = x(i || P.DESC), [O, I] = x(
|
459
|
+
u || "createdAt"
|
460
|
+
), { data: k, isLoading: f, isError: A } = Ne({
|
461
|
+
user: r,
|
462
|
+
query: o,
|
463
|
+
getAccessToken: a,
|
464
|
+
enabled: t
|
465
|
+
}), y = Se({ getAccessToken: a }), v = _e({ getAccessToken: a }), R = Oe({ getAccessToken: a }), [j, B] = x(!1), E = N(null), [Y, p] = x(!1), [J, z] = x(!1), C = N(null), K = (n, s, S) => {
|
466
|
+
E.current = { id: n, text: s, createdAt: S }, B(!0);
|
467
|
+
}, M = () => {
|
468
|
+
E.current && y.mutate({ user: r, memoryId: E.current.id });
|
469
|
+
}, V = () => {
|
470
|
+
r && p(!0);
|
471
|
+
}, U = () => {
|
472
|
+
r && v.mutate({ user: r });
|
473
|
+
}, L = (n, s) => {
|
474
|
+
C.current = { id: n, text: s }, z(!0);
|
475
|
+
}, G = (n) => {
|
476
|
+
C.current && r && R.mutate(
|
477
|
+
{
|
478
|
+
user: r,
|
479
|
+
memoryId: C.current.id,
|
480
|
+
text: n
|
481
|
+
},
|
482
|
+
{
|
483
|
+
onSuccess: () => {
|
484
|
+
z(!1);
|
485
|
+
}
|
486
|
+
}
|
487
|
+
);
|
488
|
+
};
|
489
|
+
return /* @__PURE__ */ m(we, { children: [
|
490
|
+
/* @__PURE__ */ m(
|
491
|
+
ie,
|
492
|
+
{
|
493
|
+
showConfirmation: j,
|
494
|
+
setShowConfirmation: B,
|
495
|
+
action: M,
|
496
|
+
customStrings: {
|
497
|
+
title: "Delete memory",
|
498
|
+
confirmAction: "Delete",
|
499
|
+
cancelAction: "Cancel"
|
500
|
+
},
|
501
|
+
children: [
|
502
|
+
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
|
503
|
+
/* @__PURE__ */ m("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
|
504
|
+
/* @__PURE__ */ m("li", { children: [
|
505
|
+
"Excerpt: ",
|
506
|
+
E.current?.text?.slice(0, 80) || ""
|
507
|
+
] }),
|
508
|
+
/* @__PURE__ */ m("li", { children: [
|
509
|
+
"Created:",
|
510
|
+
" ",
|
511
|
+
E.current?.createdAt ? new Date(E.current.createdAt).toLocaleString() : "-"
|
512
|
+
] })
|
513
|
+
] })
|
514
|
+
]
|
515
|
+
}
|
516
|
+
),
|
517
|
+
/* @__PURE__ */ e(
|
518
|
+
ie,
|
519
|
+
{
|
520
|
+
showConfirmation: Y,
|
521
|
+
setShowConfirmation: p,
|
522
|
+
action: U,
|
523
|
+
customStrings: {
|
524
|
+
title: "Delete all memories",
|
525
|
+
confirmAction: "Delete all",
|
526
|
+
cancelAction: "Cancel"
|
527
|
+
},
|
528
|
+
children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
|
529
|
+
}
|
530
|
+
),
|
531
|
+
/* @__PURE__ */ e(
|
532
|
+
$e,
|
533
|
+
{
|
534
|
+
open: J,
|
535
|
+
onOpenChange: z,
|
536
|
+
initialText: C.current?.text || "",
|
537
|
+
onSave: G,
|
538
|
+
isSaving: R.isPending
|
539
|
+
}
|
540
|
+
),
|
541
|
+
/* @__PURE__ */ e(
|
542
|
+
ce,
|
543
|
+
{
|
544
|
+
open: t,
|
545
|
+
onOpenChange: (n) => l(n),
|
546
|
+
title: "User Memories",
|
547
|
+
animation: !0,
|
548
|
+
animationType: "fade",
|
549
|
+
footer: /* @__PURE__ */ m($, { columnGap: 2, alignHorizontal: "flex-end", children: [
|
550
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
551
|
+
X,
|
552
|
+
{
|
553
|
+
mode: "dark",
|
554
|
+
variant: "secondary",
|
555
|
+
noBorder: !0,
|
556
|
+
focusMode: "light",
|
557
|
+
onClick: () => l(!1),
|
558
|
+
children: "Close"
|
559
|
+
}
|
560
|
+
) }),
|
561
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
562
|
+
X,
|
563
|
+
{
|
564
|
+
mode: "dark",
|
565
|
+
focusMode: "light",
|
566
|
+
variant: "danger",
|
567
|
+
disabled: v.isPending || (k?.total ?? 0) === 0,
|
568
|
+
onClick: V,
|
569
|
+
children: "Delete All"
|
570
|
+
}
|
571
|
+
) })
|
572
|
+
] }),
|
573
|
+
children: /* @__PURE__ */ m("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
|
574
|
+
f && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
|
575
|
+
A && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
|
576
|
+
!f && !A && (k && k.items.length > 0 ? /* @__PURE__ */ m(Le, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
|
577
|
+
/* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ m(W, { children: [
|
578
|
+
/* @__PURE__ */ e(D, { className: "sr-only", children: "Row" }),
|
579
|
+
/* @__PURE__ */ e(D, { children: "Memory" }),
|
580
|
+
/* @__PURE__ */ e(
|
581
|
+
He,
|
582
|
+
{
|
583
|
+
focusMode: "system",
|
584
|
+
buttonClassName: "text-xs sm:text-sm",
|
585
|
+
cellId: "createdAt",
|
586
|
+
align: "left",
|
587
|
+
sortDirection: b,
|
588
|
+
sortedCell: O,
|
589
|
+
onClick: () => {
|
590
|
+
I("createdAt"), w("createdAt"), h((n) => {
|
591
|
+
const s = n === P.ASC ? P.DESC : P.ASC;
|
592
|
+
return d(s), s;
|
593
|
+
});
|
594
|
+
},
|
595
|
+
children: "Date"
|
596
|
+
}
|
597
|
+
),
|
598
|
+
/* @__PURE__ */ e(D, { align: "right", children: "Actions" })
|
599
|
+
] }) }),
|
600
|
+
/* @__PURE__ */ e(Ie, { children: [...k.items].sort((n, s) => {
|
601
|
+
const S = n.createdAt ? new Date(n.createdAt).getTime() : 0, q = s.createdAt ? new Date(s.createdAt).getTime() : 0;
|
602
|
+
return b === P.ASC ? S - q : q - S;
|
603
|
+
}).map((n, s) => /* @__PURE__ */ m(W, { children: [
|
604
|
+
/* @__PURE__ */ e(D, { className: c("dark:text-gray-400"), children: s + 1 }),
|
605
|
+
/* @__PURE__ */ e(
|
606
|
+
D,
|
607
|
+
{
|
608
|
+
className: c(
|
609
|
+
"dark:text-white",
|
610
|
+
"max-w-[100px] sm:max-w-[400px]",
|
611
|
+
"text-xs sm:text-sm"
|
612
|
+
),
|
613
|
+
style: {
|
614
|
+
wordBreak: "break-word"
|
615
|
+
},
|
616
|
+
children: n.text
|
617
|
+
}
|
618
|
+
),
|
619
|
+
/* @__PURE__ */ e(
|
620
|
+
D,
|
621
|
+
{
|
622
|
+
component: "th",
|
623
|
+
scope: "row",
|
624
|
+
className: c(
|
625
|
+
"dark:text-gray-400",
|
626
|
+
"sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
|
627
|
+
),
|
628
|
+
children: n.createdAt ? new Date(n.createdAt).toLocaleDateString() : "-"
|
629
|
+
}
|
630
|
+
),
|
631
|
+
/* @__PURE__ */ e(D, { className: "align-top", align: "right", children: /* @__PURE__ */ m($, { columnGap: 1, alignHorizontal: "flex-end", children: [
|
632
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
633
|
+
ne,
|
634
|
+
{
|
635
|
+
label: "Edit memory",
|
636
|
+
mode: "system",
|
637
|
+
placement: "top",
|
638
|
+
trigger: /* @__PURE__ */ e(
|
639
|
+
ae,
|
640
|
+
{
|
641
|
+
focusMode: "system",
|
642
|
+
noBorder: !0,
|
643
|
+
label: "Edit memory",
|
644
|
+
variant: "primary",
|
645
|
+
disabled: R.isPending,
|
646
|
+
onClick: () => L(n.memoryId, n.text),
|
647
|
+
children: /* @__PURE__ */ e(Fe, { size: "size-3", monotone: !0 })
|
648
|
+
}
|
649
|
+
)
|
650
|
+
}
|
651
|
+
) }),
|
652
|
+
/* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
|
653
|
+
ne,
|
654
|
+
{
|
655
|
+
label: "Delete memory",
|
656
|
+
mode: "system",
|
657
|
+
placement: "top",
|
658
|
+
trigger: /* @__PURE__ */ e(
|
659
|
+
ae,
|
660
|
+
{
|
661
|
+
focusMode: "system",
|
662
|
+
noBorder: !0,
|
663
|
+
label: "Delete memory",
|
664
|
+
variant: "primary",
|
665
|
+
iconClassName: "text-red-700 dark:text-red-500",
|
666
|
+
disabled: y.isPending,
|
667
|
+
onClick: () => K(
|
668
|
+
n.memoryId,
|
669
|
+
n.text,
|
670
|
+
n.createdAt
|
671
|
+
),
|
672
|
+
children: /* @__PURE__ */ e(Be, { size: "size-3", monotone: !0 })
|
673
|
+
}
|
674
|
+
)
|
675
|
+
}
|
676
|
+
) })
|
677
|
+
] }) })
|
678
|
+
] }, n.memoryId)) }),
|
679
|
+
/* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ m(D, { colSpan: 4, children: [
|
680
|
+
k.total,
|
681
|
+
" memor",
|
682
|
+
k.total === 1 ? "y" : "ies"
|
683
|
+
] }) }) })
|
684
|
+
] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
|
685
|
+
] })
|
686
|
+
}
|
687
|
+
)
|
688
|
+
] });
|
689
|
+
}, it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, UserMemoriesPanel: se, default: se }, Symbol.toStringTag, { value: "Module" }));
|
690
|
+
export {
|
691
|
+
se as UserMemoriesPanel,
|
692
|
+
it as UserMemoriesPanel$1,
|
693
|
+
ue as me
|
694
|
+
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { convert as se, visitParents as Me, unicodeWhitespace as I, unicodePunctuation as N, normalizeIdentifier as _, classifyCharacter as W, visit as _e, toString as ce, EXIT as Oe, asciiAlphanumeric as Z, asciiAlpha as P, markdownLineEndingOrSpace as A, asciiControl as je, blankLine as Be, factorySpace as S, splice as q, resolveAll as We, markdownLineEnding as R, markdownSpace as T, combineExtensions as $e } from "./useMarkdown.
|
1
|
+
import { convert as se, visitParents as Me, unicodeWhitespace as I, unicodePunctuation as N, normalizeIdentifier as _, classifyCharacter as W, visit as _e, toString as ce, EXIT as Oe, asciiAlphanumeric as Z, asciiAlpha as P, markdownLineEndingOrSpace as A, asciiControl as je, blankLine as Be, factorySpace as S, splice as q, resolveAll as We, markdownLineEnding as R, markdownSpace as T, combineExtensions as $e } from "./useMarkdown.CX6ld7dH.js";
|
2
2
|
import { longestStreak as qe } from "./index.Cyw5OC0t.js";
|
3
3
|
function ne(e, n) {
|
4
4
|
const t = String(e);
|