@versini/sassysaint 8.37.1 → 8.37.3
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.BOHfl_gp.js → AboutChangelog.CRS4WODW.js} +2 -2
- package/dist/chunks/{AboutEntry.m1B_BgQt.js → AboutEntry.BvMxHACv.js} +5 -5
- package/dist/chunks/{App.CtCPYlbl.js → App.DUfwsVPe.js} +391 -384
- package/dist/chunks/{Chart.CuNblT6f.js → Chart.BgfOs48e.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.CkkTrJGZ.js → ChatBubbleAssistant.CJV0ONBQ.js} +3 -3
- package/dist/chunks/{HistoryEntry.DFC6n6w2.js → HistoryEntry.DlmduxI9.js} +182 -184
- package/dist/chunks/{LNWAZHJI.BGdDvBo3.js → LNWAZHJI.RLpJTh2O.js} +1 -1
- package/dist/chunks/{ProfileEntry.WmOglj_-.js → ProfileEntry.qmbeMLG3.js} +2 -2
- package/dist/chunks/{SettingsEntry.BNGEEnTY.js → SettingsEntry.BgSSrErQ.js} +2 -2
- package/dist/chunks/{UsageEntry.D5jzQr21.js → UsageEntry.BtOGGaFe.js} +3 -3
- package/dist/chunks/{index.Dum3WAJo.js → index.B94NeHaW.js} +1 -1
- package/dist/chunks/{index.p9PgXcft.js → index.BBX7Rcwn.js} +1 -1
- package/dist/chunks/{index.CNxyHMTw.js → index.BG8OjDNL.js} +3 -3
- package/dist/chunks/{index.DDwdbGlq.js → index.BcfpTkrB.js} +165 -163
- package/dist/chunks/{index.CH3sna-H.js → index.CpPDFoux.js} +2 -2
- package/dist/chunks/{index.RRpoPN7U.js → index.UsvYCYK4.js} +1 -1
- package/dist/chunks/{useMarkdown.1l3pqCNu.js → useMarkdown.ixE-4PVa.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
@@ -1,21 +1,21 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { I, INFINITE_SCROLL_THRESHOLD as
|
3
|
-
import { De as
|
4
|
-
import { Fragment as
|
5
|
-
const
|
1
|
+
import { jsxs as m, jsx as e, Fragment as Q } from "react/jsx-runtime";
|
2
|
+
import { I, INFINITE_SCROLL_THRESHOLD as V, CARDS as Z, pluralize as ee, ue as w, numberFormatter as te, isProbablyMobile as se, n as B, INFINITE_SCROLL_LIMIT as b, LOCAL_STORAGE_PREFIX as $, LOCAL_STORAGE_SORT as re, APP_CLASSNAME as ae, ACTION_SORT as z, TOAST_CHAT_DELETED as oe, TOAST_PROVIDER_CHANGED as ne, LOCAL_STORAGE_SEARCH as ce, HISTORY_TITLE as ie, pe as le, debounce as de, ACTION_SEARCH as me } from "./index.BcfpTkrB.js";
|
3
|
+
import { De as he, He as ue, qe as O, Ge as pe, Fe as Ce, Pe as u, Ye as L, st as H, Ee as Se, a as Te, p as ge, p$1 as xe, y as fe, a$1 as ye, i$1 as Ee, HistoryContext as F, ChatContext as G, useAiChat as Ae, E as Y, useUserPreferences as Ne, ConfirmationPanel as Re, LazyToastContainerWrapper as ve, mutateCall as P, SERVICE_TYPES as U, showErrorToast as De, setNewProvider as Oe, CHAT_SET_PROVIDER as we, showSuccessToast as Me, CHAT_SET_STATUS as ke, E$1 as N, useChatsHistory as Ie, tt as _e, a$2 as be } from "./App.DUfwsVPe.js";
|
4
|
+
import { Fragment as ze, useRef as M, useState as R, useContext as v, useCallback as Le, useEffect as k } from "react";
|
5
|
+
const He = ({
|
6
6
|
className: c,
|
7
7
|
viewBox: a,
|
8
|
-
title:
|
8
|
+
title: l,
|
9
9
|
monotone: d,
|
10
10
|
...i
|
11
|
-
}) => /* @__PURE__ */
|
11
|
+
}) => /* @__PURE__ */ m(
|
12
12
|
I,
|
13
13
|
{
|
14
14
|
defaultViewBox: "0 0 448 512",
|
15
15
|
size: "size-5",
|
16
16
|
viewBox: a,
|
17
17
|
className: c,
|
18
|
-
title:
|
18
|
+
title: l || "Delete",
|
19
19
|
...i,
|
20
20
|
children: [
|
21
21
|
/* @__PURE__ */ e(
|
@@ -28,20 +28,20 @@ const Pe = ({
|
|
28
28
|
/* @__PURE__ */ e("path", { d: "M163.8 0c-12.1 0-23.2 6.8-28.6 17.7L128 32H32C14.3 32 0 46.3 0 64s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96l-7.2-14.3C307.4 6.8 296.3 0 284.2 0z" })
|
29
29
|
]
|
30
30
|
}
|
31
|
-
),
|
31
|
+
), Pe = ({
|
32
32
|
className: c,
|
33
33
|
viewBox: a,
|
34
|
-
title:
|
34
|
+
title: l,
|
35
35
|
monotone: d,
|
36
36
|
...i
|
37
|
-
}) => /* @__PURE__ */
|
37
|
+
}) => /* @__PURE__ */ m(
|
38
38
|
I,
|
39
39
|
{
|
40
40
|
defaultViewBox: "0 0 512 512",
|
41
41
|
size: "size-5",
|
42
42
|
viewBox: a,
|
43
43
|
className: c,
|
44
|
-
title:
|
44
|
+
title: l || "Restore",
|
45
45
|
...i,
|
46
46
|
children: [
|
47
47
|
/* @__PURE__ */ e(
|
@@ -54,20 +54,20 @@ const Pe = ({
|
|
54
54
|
/* @__PURE__ */ e("path", { d: "M64 128c-35.3 0-64 28.7-64 64v256c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64zm32 64h192c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32" })
|
55
55
|
]
|
56
56
|
}
|
57
|
-
),
|
57
|
+
), Ue = ({
|
58
58
|
className: c,
|
59
59
|
viewBox: a,
|
60
|
-
title:
|
60
|
+
title: l,
|
61
61
|
monotone: d,
|
62
62
|
...i
|
63
|
-
}) => /* @__PURE__ */
|
63
|
+
}) => /* @__PURE__ */ m(
|
64
64
|
I,
|
65
65
|
{
|
66
66
|
defaultViewBox: "0 0 512 512",
|
67
67
|
size: "size-5",
|
68
68
|
viewBox: a,
|
69
69
|
className: c,
|
70
|
-
title:
|
70
|
+
title: l || "Search",
|
71
71
|
...i,
|
72
72
|
children: [
|
73
73
|
/* @__PURE__ */ e(
|
@@ -80,46 +80,45 @@ const Pe = ({
|
|
80
80
|
/* @__PURE__ */ e("path", { d: "m330.7 376 126.7 126.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L376 330.7c-12.7 17.3-28 32.6-45.3 45.3" })
|
81
81
|
]
|
82
82
|
}
|
83
|
-
),
|
84
|
-
[
|
85
|
-
[
|
86
|
-
[
|
87
|
-
},
|
83
|
+
), Ve = {
|
84
|
+
[Ee]: xe,
|
85
|
+
[ye]: ge,
|
86
|
+
[fe]: Te
|
87
|
+
}, r = {
|
88
88
|
ROW: "row",
|
89
89
|
TIMESTAMP: "timestamp",
|
90
90
|
SUMMARY: "summary",
|
91
91
|
PROVIDER: "provider",
|
92
92
|
TOKEN_USAGE: "tokenUsage",
|
93
93
|
ACTIONS: "actions"
|
94
|
-
},
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
], Be = ({
|
94
|
+
}, Be = [
|
95
|
+
r.ROW,
|
96
|
+
r.TIMESTAMP,
|
97
|
+
r.SUMMARY,
|
98
|
+
r.ACTIONS
|
99
|
+
], $e = [
|
100
|
+
r.ROW,
|
101
|
+
r.SUMMARY,
|
102
|
+
r.TIMESTAMP,
|
103
|
+
r.TOKEN_USAGE,
|
104
|
+
r.PROVIDER,
|
105
|
+
r.ACTIONS
|
106
|
+
], Fe = ({
|
108
107
|
filteredHistory: c,
|
109
108
|
historyState: a,
|
110
|
-
lastEntryToLoad:
|
109
|
+
lastEntryToLoad: l,
|
111
110
|
onClickSort: d,
|
112
111
|
onClickRestore: i,
|
113
|
-
onClickDelete:
|
114
|
-
infinityScrollMarkerRef:
|
112
|
+
onClickDelete: g,
|
113
|
+
infinityScrollMarkerRef: x
|
115
114
|
}) => {
|
116
|
-
const
|
115
|
+
const o = se() ? Be : $e, A = (t) => {
|
117
116
|
switch (t) {
|
118
|
-
case
|
119
|
-
return /* @__PURE__ */ e(
|
120
|
-
case
|
117
|
+
case r.ROW:
|
118
|
+
return /* @__PURE__ */ e(u, { className: "sr-only", children: "Row" }, t);
|
119
|
+
case r.TIMESTAMP:
|
121
120
|
return /* @__PURE__ */ e(
|
122
|
-
|
121
|
+
L,
|
123
122
|
{
|
124
123
|
buttonClassName: "text-xs sm:text-sm",
|
125
124
|
cellId: "timestamp",
|
@@ -133,13 +132,13 @@ const Pe = ({
|
|
133
132
|
},
|
134
133
|
t
|
135
134
|
);
|
136
|
-
case
|
137
|
-
return /* @__PURE__ */ e(
|
138
|
-
case
|
139
|
-
return /* @__PURE__ */ e(
|
140
|
-
case
|
141
|
-
return
|
142
|
-
|
135
|
+
case r.SUMMARY:
|
136
|
+
return /* @__PURE__ */ e(u, { className: "text-xs sm:text-sm", children: "Summary" }, t);
|
137
|
+
case r.PROVIDER:
|
138
|
+
return /* @__PURE__ */ e(u, { className: "text-xs sm:text-sm", children: "Provider" }, t);
|
139
|
+
case r.TOKEN_USAGE:
|
140
|
+
return /* @__PURE__ */ e(
|
141
|
+
L,
|
143
142
|
{
|
144
143
|
buttonClassName: "text-xs sm:text-sm",
|
145
144
|
cellId: "tokenUsage",
|
@@ -153,30 +152,30 @@ const Pe = ({
|
|
153
152
|
},
|
154
153
|
t
|
155
154
|
);
|
156
|
-
case
|
157
|
-
return /* @__PURE__ */ e(
|
155
|
+
case r.ACTIONS:
|
156
|
+
return /* @__PURE__ */ e(u, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
|
158
157
|
default:
|
159
158
|
return null;
|
160
159
|
}
|
161
|
-
},
|
160
|
+
}, f = (t, s, T) => {
|
162
161
|
switch (t) {
|
163
|
-
case
|
164
|
-
return /* @__PURE__ */ e(
|
165
|
-
case
|
162
|
+
case r.ROW:
|
163
|
+
return /* @__PURE__ */ e(u, { children: T + 1 }, t);
|
164
|
+
case r.TIMESTAMP:
|
166
165
|
return /* @__PURE__ */ e(
|
167
|
-
|
166
|
+
u,
|
168
167
|
{
|
169
168
|
component: "th",
|
170
169
|
scope: "row",
|
171
170
|
className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
172
|
-
children:
|
171
|
+
children: s.timestamp.split(",")[0]
|
173
172
|
},
|
174
173
|
t
|
175
174
|
);
|
176
|
-
case
|
177
|
-
const C =
|
175
|
+
case r.SUMMARY: {
|
176
|
+
const C = s.summary || (s.messages.length > 0 ? s.messages[0]?.content : "");
|
178
177
|
return /* @__PURE__ */ e(
|
179
|
-
|
178
|
+
u,
|
180
179
|
{
|
181
180
|
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
182
181
|
style: {
|
@@ -187,41 +186,41 @@ const Pe = ({
|
|
187
186
|
t
|
188
187
|
);
|
189
188
|
}
|
190
|
-
case
|
191
|
-
const C =
|
189
|
+
case r.PROVIDER: {
|
190
|
+
const C = s.model ? Se(s.model) : null, y = C ? Ve[C] : null;
|
192
191
|
return /* @__PURE__ */ e(
|
193
|
-
|
192
|
+
u,
|
194
193
|
{
|
195
194
|
component: "th",
|
196
195
|
scope: "row",
|
197
196
|
className: "text-gray-400",
|
198
197
|
align: "center",
|
199
|
-
children:
|
200
|
-
|
198
|
+
children: y ? /* @__PURE__ */ e(
|
199
|
+
y,
|
201
200
|
{
|
202
201
|
size: "size-4 sm:size-5",
|
203
202
|
semantic: !0,
|
204
|
-
title:
|
203
|
+
title: s.model || C
|
205
204
|
}
|
206
205
|
) : null
|
207
206
|
},
|
208
207
|
t
|
209
208
|
);
|
210
209
|
}
|
211
|
-
case
|
212
|
-
return
|
213
|
-
|
210
|
+
case r.TOKEN_USAGE:
|
211
|
+
return /* @__PURE__ */ e(
|
212
|
+
u,
|
214
213
|
{
|
215
214
|
className: "text-gray-400 text-xs sm:text-sm",
|
216
215
|
align: "right",
|
217
|
-
children:
|
216
|
+
children: s.tokenUsage ? te.format(s.tokenUsage) : "0"
|
218
217
|
},
|
219
218
|
t
|
220
219
|
);
|
221
|
-
case
|
222
|
-
return /* @__PURE__ */
|
220
|
+
case r.ACTIONS:
|
221
|
+
return /* @__PURE__ */ e(u, { children: /* @__PURE__ */ m("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
|
223
222
|
/* @__PURE__ */ e(
|
224
|
-
|
223
|
+
H,
|
225
224
|
{
|
226
225
|
label: "Restore chat",
|
227
226
|
mode: "alt-system",
|
@@ -229,22 +228,21 @@ const Pe = ({
|
|
229
228
|
trigger: /* @__PURE__ */ e(
|
230
229
|
w,
|
231
230
|
{
|
232
|
-
className: "mr-2",
|
233
231
|
focusMode: "alt-system",
|
234
232
|
noBorder: !0,
|
235
233
|
label: "Restore chat",
|
236
234
|
variant: "primary",
|
237
235
|
iconClassName: "text-green-800 dark:text-green-500",
|
238
236
|
onClick: async () => {
|
239
|
-
await i(
|
237
|
+
await i(s);
|
240
238
|
},
|
241
|
-
children: /* @__PURE__ */ e(
|
239
|
+
children: /* @__PURE__ */ e(Pe, { size: "size-3", monotone: !0 })
|
242
240
|
}
|
243
241
|
)
|
244
242
|
}
|
245
243
|
),
|
246
244
|
/* @__PURE__ */ e(
|
247
|
-
|
245
|
+
H,
|
248
246
|
{
|
249
247
|
label: "Delete chat",
|
250
248
|
mode: "alt-system",
|
@@ -258,145 +256,145 @@ const Pe = ({
|
|
258
256
|
variant: "primary",
|
259
257
|
iconClassName: "text-red-700 dark:text-red-500",
|
260
258
|
onClick: () => {
|
261
|
-
|
259
|
+
g(s);
|
262
260
|
},
|
263
|
-
children: /* @__PURE__ */ e(
|
261
|
+
children: /* @__PURE__ */ e(He, { size: "size-3", monotone: !0 })
|
264
262
|
}
|
265
263
|
)
|
266
264
|
}
|
267
265
|
)
|
268
|
-
] }, t);
|
266
|
+
] }) }, t);
|
269
267
|
default:
|
270
268
|
return null;
|
271
269
|
}
|
272
270
|
};
|
273
|
-
return /* @__PURE__ */
|
274
|
-
/* @__PURE__ */ e(
|
275
|
-
/* @__PURE__ */ e(
|
276
|
-
|
277
|
-
/* @__PURE__ */ e(O, { children:
|
278
|
-
(
|
271
|
+
return /* @__PURE__ */ m(he, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
|
272
|
+
/* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(O, { children: o.map((t) => A(t)) }) }),
|
273
|
+
/* @__PURE__ */ e(pe, { children: c.slice(0, l).map((t, s) => t?.messages?.length > 0 ? /* @__PURE__ */ m(ze, { children: [
|
274
|
+
s === l - V && /* @__PURE__ */ e("tr", { ref: x }),
|
275
|
+
/* @__PURE__ */ e(O, { children: o.map(
|
276
|
+
(T) => f(T, t, s)
|
279
277
|
) })
|
280
|
-
] }, `${
|
281
|
-
/* @__PURE__ */ e(
|
278
|
+
] }, `${Z.HISTORY.TITLE}-${t.id}-${s}`) : null) }),
|
279
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(u, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: ee(
|
282
280
|
`${c.length} chat`,
|
283
281
|
c.length
|
284
282
|
) }) }) }) })
|
285
283
|
] });
|
286
|
-
},
|
284
|
+
}, Ge = ({
|
287
285
|
filteredHistory: c,
|
288
286
|
dispatch: a,
|
289
|
-
onOpenChange:
|
287
|
+
onOpenChange: l,
|
290
288
|
mutate: d
|
291
289
|
}) => {
|
292
|
-
const { user: i, getAccessToken:
|
290
|
+
const { user: i, getAccessToken: g } = B(), x = M(null), h = M({
|
293
291
|
id: "",
|
294
292
|
timestamp: "",
|
295
293
|
message: ""
|
296
|
-
}), [o,
|
297
|
-
b +
|
298
|
-
), { state:
|
299
|
-
state: { provider:
|
300
|
-
setChatId:
|
301
|
-
setInitialMessages:
|
302
|
-
} =
|
303
|
-
key:
|
304
|
-
initialValue:
|
305
|
-
}), { refetch:
|
294
|
+
}), [o, A] = R(!1), [f, t] = R(
|
295
|
+
b + V
|
296
|
+
), { state: s, dispatch: T } = v(F), {
|
297
|
+
state: { provider: C },
|
298
|
+
setChatId: y,
|
299
|
+
setInitialMessages: D
|
300
|
+
} = v(G), { setInput: _ } = Ae(), [, S] = Y({
|
301
|
+
key: $ + re,
|
302
|
+
initialValue: s.sortDirection
|
303
|
+
}), { refetch: W } = Ne({
|
306
304
|
user: i?.username,
|
307
|
-
getAccessToken:
|
308
|
-
}),
|
309
|
-
switch (
|
310
|
-
case
|
311
|
-
|
305
|
+
getAccessToken: g
|
306
|
+
}), K = (n) => {
|
307
|
+
switch (s.sortDirection) {
|
308
|
+
case N.ASC:
|
309
|
+
S(N.DESC), T({
|
312
310
|
type: z,
|
313
311
|
payload: {
|
314
312
|
sortedCell: n,
|
315
|
-
sortDirection:
|
313
|
+
sortDirection: N.DESC
|
316
314
|
}
|
317
315
|
});
|
318
316
|
break;
|
319
317
|
default:
|
320
|
-
|
318
|
+
S(N.ASC), T({
|
321
319
|
type: z,
|
322
320
|
payload: {
|
323
321
|
sortedCell: n,
|
324
|
-
sortDirection:
|
322
|
+
sortDirection: N.ASC
|
325
323
|
}
|
326
324
|
});
|
327
325
|
break;
|
328
326
|
}
|
329
|
-
},
|
330
|
-
const n =
|
327
|
+
}, j = async () => {
|
328
|
+
const n = h.current;
|
331
329
|
try {
|
332
330
|
await P({
|
333
|
-
accessToken: await
|
331
|
+
accessToken: await g(),
|
334
332
|
type: U.DELETE_CHAT,
|
335
333
|
params: {
|
336
334
|
userId: i?.username || "",
|
337
335
|
id: n.id
|
338
336
|
}
|
339
|
-
}), d(""), await
|
337
|
+
}), d(""), await De(oe, {
|
340
338
|
autoClose: 2e3,
|
341
339
|
containerId: "history-table"
|
342
340
|
});
|
343
341
|
} catch {
|
344
342
|
}
|
345
|
-
},
|
343
|
+
}, q = async (n) => {
|
346
344
|
try {
|
347
|
-
const
|
348
|
-
accessToken:
|
345
|
+
const E = await g(), p = await P({
|
346
|
+
accessToken: E,
|
349
347
|
type: U.GET_CHAT,
|
350
348
|
params: {
|
351
349
|
id: n.id
|
352
350
|
}
|
353
351
|
});
|
354
|
-
|
355
|
-
provider:
|
356
|
-
accessToken:
|
352
|
+
p.status === 200 && (p.data.provider !== C && (await Oe({
|
353
|
+
provider: p.data.provider,
|
354
|
+
accessToken: E,
|
357
355
|
username: i?.username || ""
|
358
356
|
}), a({
|
359
|
-
type:
|
357
|
+
type: we,
|
360
358
|
payload: {
|
361
|
-
provider:
|
359
|
+
provider: p.data.provider
|
362
360
|
}
|
363
|
-
}),
|
364
|
-
`${
|
361
|
+
}), W(), await Me(
|
362
|
+
`${ne} ${p.data.provider}`,
|
365
363
|
{
|
366
364
|
containerId: "toggle-provider"
|
367
365
|
}
|
368
366
|
)), a({
|
369
|
-
type:
|
367
|
+
type: ke,
|
370
368
|
payload: {
|
371
369
|
restoring: !0,
|
372
|
-
restoredModel:
|
373
|
-
restoredUsage:
|
370
|
+
restoredModel: p.data?.model || "",
|
371
|
+
restoredUsage: p.data?.tokenUsage || 0
|
374
372
|
}
|
375
|
-
}), _(""),
|
373
|
+
}), _(""), y(n.id), D(p.data.messages), l(!1));
|
376
374
|
} catch {
|
377
375
|
}
|
378
|
-
},
|
379
|
-
|
376
|
+
}, X = (n) => {
|
377
|
+
h.current = {
|
380
378
|
id: n.id,
|
381
379
|
timestamp: n.timestamp,
|
382
380
|
message: n.messages.length > 0 ? n.messages[0]?.content : ""
|
383
|
-
},
|
384
|
-
},
|
385
|
-
n[0].isIntersecting &&
|
381
|
+
}, A(!o);
|
382
|
+
}, J = Le((n) => {
|
383
|
+
n[0].isIntersecting && t((p) => p + b);
|
386
384
|
}, []);
|
387
385
|
return k(() => {
|
388
386
|
const n = {
|
389
387
|
// root: null,
|
390
388
|
rootMargin: "20px"
|
391
|
-
},
|
392
|
-
|
393
|
-
}), /* @__PURE__ */
|
394
|
-
/* @__PURE__ */
|
395
|
-
|
389
|
+
}, E = new IntersectionObserver(J, n);
|
390
|
+
x.current && E.observe(x.current);
|
391
|
+
}), /* @__PURE__ */ m(Q, { children: [
|
392
|
+
/* @__PURE__ */ m(
|
393
|
+
Re,
|
396
394
|
{
|
397
395
|
showConfirmation: o,
|
398
|
-
setShowConfirmation:
|
399
|
-
action:
|
396
|
+
setShowConfirmation: A,
|
397
|
+
action: j,
|
400
398
|
customStrings: {
|
401
399
|
confirmAction: "Delete",
|
402
400
|
cancelAction: "Cancel",
|
@@ -404,78 +402,78 @@ const Pe = ({
|
|
404
402
|
},
|
405
403
|
children: [
|
406
404
|
/* @__PURE__ */ e("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
407
|
-
/* @__PURE__ */
|
408
|
-
/* @__PURE__ */
|
405
|
+
/* @__PURE__ */ m("ul", { className: "m-0", children: [
|
406
|
+
/* @__PURE__ */ m("li", { children: [
|
409
407
|
"Timestamp:",
|
410
408
|
" ",
|
411
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children:
|
409
|
+
/* @__PURE__ */ e("span", { className: "text-lg", children: h.current && h.current.timestamp })
|
412
410
|
] }),
|
413
|
-
/* @__PURE__ */
|
411
|
+
/* @__PURE__ */ m("li", { children: [
|
414
412
|
"First message:",
|
415
413
|
" ",
|
416
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children:
|
414
|
+
/* @__PURE__ */ e("span", { className: "text-lg", children: h.current?.message })
|
417
415
|
] })
|
418
416
|
] })
|
419
417
|
]
|
420
418
|
}
|
421
419
|
),
|
422
|
-
/* @__PURE__ */ e("div", { className:
|
420
|
+
/* @__PURE__ */ e("div", { className: ae, children: /* @__PURE__ */ e(ve, { containerId: "history-table" }) }),
|
423
421
|
/* @__PURE__ */ e(
|
424
|
-
|
422
|
+
Fe,
|
425
423
|
{
|
426
424
|
filteredHistory: c,
|
427
|
-
historyState:
|
428
|
-
lastEntryToLoad:
|
429
|
-
onClickSort:
|
430
|
-
onClickRestore:
|
431
|
-
onClickDelete:
|
432
|
-
infinityScrollMarkerRef:
|
425
|
+
historyState: s,
|
426
|
+
lastEntryToLoad: f,
|
427
|
+
onClickSort: K,
|
428
|
+
onClickRestore: q,
|
429
|
+
onClickDelete: X,
|
430
|
+
infinityScrollMarkerRef: x
|
433
431
|
}
|
434
432
|
)
|
435
433
|
] });
|
436
|
-
},
|
434
|
+
}, qe = ({
|
437
435
|
open: c,
|
438
436
|
onOpenChange: a
|
439
437
|
}) => {
|
440
|
-
const { getAccessToken:
|
438
|
+
const { getAccessToken: l, user: d } = B(), { dispatch: i } = v(G), [g, x] = R([]), h = M(null), { state: o, dispatch: A } = v(F), [f, t] = R(
|
441
439
|
o.sortDirection
|
442
|
-
), { data:
|
440
|
+
), { data: s, refetch: T } = Ie({
|
443
441
|
enabled: c,
|
444
442
|
user: d?.username || "",
|
445
443
|
searchString: o.searchString,
|
446
|
-
sortDirection:
|
444
|
+
sortDirection: f,
|
447
445
|
sortedCell: o.sortedCell,
|
448
|
-
getAccessToken:
|
449
|
-
}), [,
|
450
|
-
key:
|
446
|
+
getAccessToken: l
|
447
|
+
}), [, C] = Y({
|
448
|
+
key: $ + ce,
|
451
449
|
initialValue: o.searchString
|
452
450
|
});
|
453
451
|
k(() => {
|
454
|
-
o.sortDirection !==
|
455
|
-
}, [o,
|
456
|
-
|
457
|
-
}, [
|
458
|
-
const
|
459
|
-
|
460
|
-
type:
|
461
|
-
payload: { searchString:
|
452
|
+
o.sortDirection !== f && t(o.sortDirection);
|
453
|
+
}, [o, f]), k(() => {
|
454
|
+
s && x(s);
|
455
|
+
}, [s]);
|
456
|
+
const y = async (S) => {
|
457
|
+
C(S), A({
|
458
|
+
type: me,
|
459
|
+
payload: { searchString: S }
|
462
460
|
});
|
463
|
-
},
|
464
|
-
|
461
|
+
}, D = de((S) => {
|
462
|
+
y(S.target.value.trim());
|
465
463
|
}, 500);
|
466
|
-
return /* @__PURE__ */
|
467
|
-
|
464
|
+
return /* @__PURE__ */ m(
|
465
|
+
_e,
|
468
466
|
{
|
469
467
|
open: c,
|
470
468
|
onOpenChange: a,
|
471
|
-
title:
|
469
|
+
title: ie,
|
472
470
|
animation: !0,
|
473
471
|
animationType: "fade",
|
474
472
|
children: [
|
475
|
-
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: async (
|
476
|
-
|
473
|
+
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: async (S) => {
|
474
|
+
S.preventDefault();
|
477
475
|
}, children: /* @__PURE__ */ e(
|
478
|
-
|
476
|
+
le,
|
479
477
|
{
|
480
478
|
placeholder: "Search",
|
481
479
|
labelHidden: !0,
|
@@ -483,13 +481,13 @@ const Pe = ({
|
|
483
481
|
autoCapitalize: "off",
|
484
482
|
autoComplete: "off",
|
485
483
|
autoCorrect: "off",
|
486
|
-
ref:
|
484
|
+
ref: h,
|
487
485
|
defaultValue: o.searchString,
|
488
486
|
focusMode: "light",
|
489
487
|
mode: "light",
|
490
488
|
name: "Search",
|
491
489
|
label: "Search",
|
492
|
-
onChange:
|
490
|
+
onChange: D,
|
493
491
|
className: "my-2",
|
494
492
|
rightElement: /* @__PURE__ */ e("div", { className: "text-copy-dark", children: /* @__PURE__ */ e(
|
495
493
|
w,
|
@@ -499,19 +497,19 @@ const Pe = ({
|
|
499
497
|
label: "Search",
|
500
498
|
size: "small",
|
501
499
|
onClick: () => {
|
502
|
-
|
500
|
+
y(""), h.current?.value && (h.current.value = "", h.current.focus());
|
503
501
|
},
|
504
502
|
disabled: o.searchString === "",
|
505
|
-
children: o.searchString !== "" ? /* @__PURE__ */ e(
|
503
|
+
children: o.searchString !== "" ? /* @__PURE__ */ e(be, { monotone: !0, size: "size-3" }) : /* @__PURE__ */ e(Ue, { monotone: !0, size: "size-3" })
|
506
504
|
}
|
507
505
|
) })
|
508
506
|
}
|
509
507
|
) }),
|
510
508
|
/* @__PURE__ */ e("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh]", children: /* @__PURE__ */ e(
|
511
|
-
|
509
|
+
Ge,
|
512
510
|
{
|
513
|
-
mutate:
|
514
|
-
filteredHistory:
|
511
|
+
mutate: T,
|
512
|
+
filteredHistory: g,
|
515
513
|
dispatch: i,
|
516
514
|
onOpenChange: a
|
517
515
|
}
|
@@ -521,5 +519,5 @@ const Pe = ({
|
|
521
519
|
);
|
522
520
|
};
|
523
521
|
export {
|
524
|
-
|
522
|
+
qe as HistoryPanel
|
525
523
|
};
|