@versini/sassysaint 8.59.3 → 8.60.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.
Files changed (26) hide show
  1. package/dist/chunks/{AboutChangelog.Dox-NMAe.js → AboutChangelog.D7rARJQu.js} +2 -2
  2. package/dist/chunks/{AboutEntry.CVFfQ1yk.js → AboutEntry.2nf0TV4n.js} +5 -5
  3. package/dist/chunks/{App.BI1AgnoF.js → App.Ch8FU2zW.js} +17 -17
  4. package/dist/chunks/{Chart.DHXouvK2.js → Chart.Iz1BoL-_.js} +2 -2
  5. package/dist/chunks/{ChatBubbleAssistant.DDzr5AUP.js → ChatBubbleAssistant.M4WRDuaw.js} +4 -4
  6. package/dist/chunks/{ChatBubbleUser.Dg11mYO3.js → ChatBubbleUser.CJHFRmMF.js} +3 -3
  7. package/dist/chunks/{ChatHistoryTable.82jyjrx0.js → ChatHistoryTable.B2mRc_wV.js} +9 -9
  8. package/dist/chunks/{HistoryEntry.muPSI9qn.js → HistoryEntry.71E6Pz_O.js} +3 -3
  9. package/dist/chunks/{ProfileEntry.Bov4_Y_K.js → ProfileEntry.BWsYCeof.js} +2 -2
  10. package/dist/chunks/SettingsEntry.Qi5gQD0-.js +781 -0
  11. package/dist/chunks/{Table.BkWkQP0Y.js → Table.SHD8KKEE.js} +2 -2
  12. package/dist/chunks/{UsageEntry.CRs1WXat.js → UsageEntry.DPhNHm9B.js} +3 -3
  13. package/dist/chunks/UserMemoriesPanel.CT_7TJ_Z.js +208 -0
  14. package/dist/chunks/{index.BGpoRXQk.js → index.BBAApLM_.js} +1 -1
  15. package/dist/chunks/{index.CZQODsrP.js → index.BJqzFaBo.js} +2 -2
  16. package/dist/chunks/{index.eMp9_gI5.js → index.CEgF3L_6.js} +3 -3
  17. package/dist/chunks/{index.DCZKUmgB.js → index.CqKtw4TJ.js} +1 -1
  18. package/dist/chunks/{index.DDJOJ-SM.js → index.DG2NgWZ6.js} +1 -1
  19. package/dist/chunks/{index.D97kQsNo.js → index.DnHjiSVh.js} +604 -637
  20. package/dist/chunks/{index.dN-7mPvm.js → index.HkxzuofI.js} +1 -1
  21. package/dist/chunks/{useMarkdown.wJ9LWx_X.js → useMarkdown.BBFa2GkT.js} +6 -6
  22. package/dist/components/SassySaint/SassySaint.js +1 -1
  23. package/dist/index.js +4 -4
  24. package/package.json +3 -3
  25. package/dist/chunks/SettingsEntry.BnCkBWa0.js +0 -430
  26. package/dist/chunks/UserMemoriesPanel.CoNs_q02.js +0 -693
@@ -1,693 +0,0 @@
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, isProbablyiPhone as Me, n as Te, LOCAL_STORAGE_PREFIX as oe, LOCAL_STORAGE_SORT_MEMORY_DIRECTION as De, LOCAL_STORAGE_SORT_MEMORY_COLUMN as Ne, useUserMemories as Se, useDeleteMemory as _e, useDeleteAllMemories as Oe, useUpdateMemory as Re, te as ae } from "./index.D97kQsNo.js";
3
- import { oe as ce, E as le, e as P, ConfirmationPanel as ie, st as ne } from "./App.BI1AgnoF.js";
4
- import c from "clsx";
5
- import Le, { useState as x, useEffect as de, useRef as N, useLayoutEffect as F } from "react";
6
- import { j as Pe, D as He, G as W, M as D, F as Ie, H as Be, l as ze, U as Ve } from "./Table.BkWkQP0Y.js";
7
- function Fe({
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 je = ({
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", Ue = "av-text-area-wrapper", Z = "av-text-area-helper-text", Ge = "av-text-area__control--right", qe = "av-text-area__control--left", Xe = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", Ye = ({ 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
- }), Je = ({
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
- }), Ke = ({
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
- }), Qe = ({
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
- }, We = ({
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
- }, Ze = ({
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
- Ue,
153
- t
154
- ), O = r ? c(l) : c(
155
- me,
156
- l,
157
- Xe(),
158
- Ye({ mode: u }),
159
- Je({ focusMode: a }),
160
- Ke({
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 = Qe({
168
- disabled: o,
169
- raw: r,
170
- error: d,
171
- mode: u,
172
- rightElement: b,
173
- leftElement: w
174
- }), f = We({
175
- error: d,
176
- raw: r,
177
- mode: u,
178
- disabled: o
179
- }), A = r ? void 0 : c(Ge, "absolute"), y = r ? void 0 : c(qe, "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
- }, $e = ({
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 = Le.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}`, _ = Ze({
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] = Fe({
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 } = $e({
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 et = ({
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
- kind: Me() ? "panel" : "messagebox",
401
- open: t,
402
- onOpenChange: l,
403
- title: "Edit Memory",
404
- animation: !0,
405
- animationType: "fade",
406
- footer: /* @__PURE__ */ m($, { columnGap: 2, alignHorizontal: "flex-end", children: [
407
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
408
- X,
409
- {
410
- mode: "dark",
411
- variant: "secondary",
412
- noBorder: !0,
413
- focusMode: "light",
414
- onClick: () => l(!1),
415
- disabled: o,
416
- children: "Cancel"
417
- }
418
- ) }),
419
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
420
- X,
421
- {
422
- mode: "dark",
423
- focusMode: "light",
424
- disabled: o || !w || !b,
425
- onClick: u,
426
- children: o ? "Saving..." : "Save"
427
- }
428
- ) })
429
- ] }),
430
- children: /* @__PURE__ */ e("div", { className: "flex flex-col pt-2", children: /* @__PURE__ */ e(
431
- ue,
432
- {
433
- mode: "dark",
434
- focusMode: "light",
435
- label: "Memory text",
436
- name: "memoryText",
437
- value: i,
438
- onChange: (h) => d(h.target.value),
439
- rows: 2,
440
- autoFocus: !0,
441
- helperText: i.trim().length < 3 ? "Memory text must be at least 3 characters" : `${i.length} characters`
442
- }
443
- ) })
444
- }
445
- );
446
- }, se = ({
447
- open: t,
448
- onOpenChange: l,
449
- user: r
450
- }) => {
451
- const { getAccessToken: a } = Te(), [o] = x(void 0), [i, d] = le({
452
- key: oe + De,
453
- initialValue: P.DESC
454
- }), [u, w] = le({
455
- key: oe + Ne,
456
- initialValue: "createdAt"
457
- }), [b, h] = x(i || P.DESC), [O, I] = x(
458
- u || "createdAt"
459
- ), { data: k, isLoading: f, isError: A } = Se({
460
- user: r,
461
- query: o,
462
- getAccessToken: a,
463
- enabled: t
464
- }), y = _e({ getAccessToken: a }), v = Oe({ getAccessToken: a }), R = Re({ getAccessToken: a }), [j, B] = x(!1), E = N(null), [Y, p] = x(!1), [J, z] = x(!1), C = N(null), K = (n, s, S) => {
465
- E.current = { id: n, text: s, createdAt: S }, B(!0);
466
- }, M = () => {
467
- E.current && y.mutate({ user: r, memoryId: E.current.id });
468
- }, V = () => {
469
- r && p(!0);
470
- }, U = () => {
471
- r && v.mutate({ user: r });
472
- }, L = (n, s) => {
473
- C.current = { id: n, text: s }, z(!0);
474
- }, G = (n) => {
475
- C.current && r && R.mutate(
476
- {
477
- user: r,
478
- memoryId: C.current.id,
479
- text: n
480
- },
481
- {
482
- onSuccess: () => {
483
- z(!1);
484
- }
485
- }
486
- );
487
- };
488
- return /* @__PURE__ */ m(we, { children: [
489
- /* @__PURE__ */ m(
490
- ie,
491
- {
492
- showConfirmation: j,
493
- setShowConfirmation: B,
494
- action: M,
495
- customStrings: {
496
- title: "Delete memory",
497
- confirmAction: "Delete",
498
- cancelAction: "Cancel"
499
- },
500
- children: [
501
- /* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete this memory?" }),
502
- /* @__PURE__ */ m("ul", { className: "m-0 mt-2 list-disc list-inside text-xs opacity-80", children: [
503
- /* @__PURE__ */ m("li", { children: [
504
- "Excerpt: ",
505
- E.current?.text?.slice(0, 80) || ""
506
- ] }),
507
- /* @__PURE__ */ m("li", { children: [
508
- "Created:",
509
- " ",
510
- E.current?.createdAt ? new Date(E.current.createdAt).toLocaleString() : "-"
511
- ] })
512
- ] })
513
- ]
514
- }
515
- ),
516
- /* @__PURE__ */ e(
517
- ie,
518
- {
519
- showConfirmation: Y,
520
- setShowConfirmation: p,
521
- action: U,
522
- customStrings: {
523
- title: "Delete all memories",
524
- confirmAction: "Delete all",
525
- cancelAction: "Cancel"
526
- },
527
- children: /* @__PURE__ */ e("p", { className: "m-0", children: "This will permanently delete all memories for this user. This action cannot be undone." })
528
- }
529
- ),
530
- /* @__PURE__ */ e(
531
- et,
532
- {
533
- open: J,
534
- onOpenChange: z,
535
- initialText: C.current?.text || "",
536
- onSave: G,
537
- isSaving: R.isPending
538
- }
539
- ),
540
- /* @__PURE__ */ e(
541
- ce,
542
- {
543
- open: t,
544
- onOpenChange: (n) => l(n),
545
- title: "User Memories",
546
- animation: !0,
547
- animationType: "fade",
548
- footer: /* @__PURE__ */ m($, { columnGap: 2, alignHorizontal: "flex-end", children: [
549
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
550
- X,
551
- {
552
- mode: "dark",
553
- variant: "secondary",
554
- noBorder: !0,
555
- focusMode: "light",
556
- onClick: () => l(!1),
557
- children: "Close"
558
- }
559
- ) }),
560
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
561
- X,
562
- {
563
- mode: "dark",
564
- focusMode: "light",
565
- variant: "danger",
566
- disabled: v.isPending || (k?.total ?? 0) === 0,
567
- onClick: V,
568
- children: "Delete All"
569
- }
570
- ) })
571
- ] }),
572
- children: /* @__PURE__ */ m("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh] pt-2", children: [
573
- f && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading memories..." }),
574
- A && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load memories." }),
575
- !f && !A && (k && k.items.length > 0 ? /* @__PURE__ */ m(Pe, { stickyHeader: !0, stickyFooter: !0, compact: !0, mode: "alt-system", children: [
576
- /* @__PURE__ */ e(He, { children: /* @__PURE__ */ m(W, { children: [
577
- /* @__PURE__ */ e(D, { className: "sr-only", children: "Row" }),
578
- /* @__PURE__ */ e(D, { children: "Memory" }),
579
- /* @__PURE__ */ e(
580
- Ie,
581
- {
582
- focusMode: "system",
583
- buttonClassName: "text-xs sm:text-sm",
584
- cellId: "createdAt",
585
- align: "left",
586
- sortDirection: b,
587
- sortedCell: O,
588
- onClick: () => {
589
- I("createdAt"), w("createdAt"), h((n) => {
590
- const s = n === P.ASC ? P.DESC : P.ASC;
591
- return d(s), s;
592
- });
593
- },
594
- children: "Date"
595
- }
596
- ),
597
- /* @__PURE__ */ e(D, { align: "right", children: "Actions" })
598
- ] }) }),
599
- /* @__PURE__ */ e(Be, { children: [...k.items].sort((n, s) => {
600
- const S = n.createdAt ? new Date(n.createdAt).getTime() : 0, q = s.createdAt ? new Date(s.createdAt).getTime() : 0;
601
- return b === P.ASC ? S - q : q - S;
602
- }).map((n, s) => /* @__PURE__ */ m(W, { children: [
603
- /* @__PURE__ */ e(D, { className: c("dark:text-gray-400"), children: s + 1 }),
604
- /* @__PURE__ */ e(
605
- D,
606
- {
607
- className: c(
608
- "dark:text-white",
609
- "max-w-[100px] sm:max-w-[400px]",
610
- "text-xs sm:text-sm"
611
- ),
612
- style: {
613
- wordBreak: "break-word"
614
- },
615
- children: n.text
616
- }
617
- ),
618
- /* @__PURE__ */ e(
619
- D,
620
- {
621
- component: "th",
622
- scope: "row",
623
- className: c(
624
- "dark:text-gray-400",
625
- "sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none"
626
- ),
627
- children: n.createdAt ? new Date(n.createdAt).toLocaleDateString() : "-"
628
- }
629
- ),
630
- /* @__PURE__ */ e(D, { className: "align-top", align: "right", children: /* @__PURE__ */ m($, { columnGap: 1, alignHorizontal: "flex-end", children: [
631
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
632
- ne,
633
- {
634
- label: "Edit memory",
635
- mode: "system",
636
- placement: "top",
637
- trigger: /* @__PURE__ */ e(
638
- ae,
639
- {
640
- focusMode: "system",
641
- noBorder: !0,
642
- label: "Edit memory",
643
- variant: "primary",
644
- disabled: R.isPending,
645
- onClick: () => L(n.memoryId, n.text),
646
- children: /* @__PURE__ */ e(je, { size: "size-3", monotone: !0 })
647
- }
648
- )
649
- }
650
- ) }),
651
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
652
- ne,
653
- {
654
- label: "Delete memory",
655
- mode: "system",
656
- placement: "top",
657
- trigger: /* @__PURE__ */ e(
658
- ae,
659
- {
660
- focusMode: "system",
661
- noBorder: !0,
662
- label: "Delete memory",
663
- variant: "primary",
664
- iconClassName: "text-red-700 dark:text-red-500",
665
- disabled: y.isPending,
666
- onClick: () => K(
667
- n.memoryId,
668
- n.text,
669
- n.createdAt
670
- ),
671
- children: /* @__PURE__ */ e(ze, { size: "size-3", monotone: !0 })
672
- }
673
- )
674
- }
675
- ) })
676
- ] }) })
677
- ] }, n.memoryId)) }),
678
- /* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ m(D, { colSpan: 4, children: [
679
- k.total,
680
- " memor",
681
- k.total === 1 ? "y" : "ies"
682
- ] }) }) })
683
- ] }) : /* @__PURE__ */ e("p", { className: "m-0 italic opacity-70", children: "No memories stored." }))
684
- ] })
685
- }
686
- )
687
- ] });
688
- }, nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, UserMemoriesPanel: se, default: se }, Symbol.toStringTag, { value: "Module" }));
689
- export {
690
- se as UserMemoriesPanel,
691
- nt as UserMemoriesPanel$1,
692
- ue as me
693
- };