@versini/sassysaint 8.73.1 → 8.73.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.2b2DI_SN.js → AboutChangelog.661DKCgk.js} +2 -2
- package/dist/chunks/{AboutEntry.BHq7KBa1.js → AboutEntry.DiCPTiLj.js} +5 -5
- package/dist/chunks/{App.DcQF9Hq9.js → App.5gxvd-4-.js} +699 -681
- package/dist/chunks/{Chart.DAdepX81.js → Chart.DTAX5Zd_.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.BF3Bj7JJ.js → ChatBubbleAssistant.C-aLHVG0.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.B5uyfOKG.js → ChatBubbleUser.Cb2OzGt2.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BwjPu3FF.js → ChatHistoryTable.DodhSBf9.js} +63 -62
- package/dist/chunks/HistoryEntry.BHKiSJYf.js +333 -0
- package/dist/chunks/{ProfileEntry.Ce801i2m.js → ProfileEntry.A_AoGwYv.js} +2 -2
- package/dist/chunks/{SettingsEntry.fNHoX42W.js → SettingsEntry.D4RhlncR.js} +3 -3
- package/dist/chunks/{Table.J1RcsDNn.js → Table.Uvq7uGxR.js} +2 -2
- package/dist/chunks/{UsageEntry.k-Ljpdg9.js → UsageEntry.DrVVPYLQ.js} +3 -3
- package/dist/chunks/{UserMemoriesPanel.C0BI-Pbv.js → UserMemoriesPanel.kh9_pfi_.js} +4 -4
- package/dist/chunks/{index.C_OZL-ky.js → index.B6va7ILw.js} +1 -1
- package/dist/chunks/{index.CauWbyr8.js → index.CCW8q5W5.js} +3 -3
- package/dist/chunks/{index.RnO-M1tm.js → index.CJZ4xgED.js} +2 -2
- package/dist/chunks/{index.uzB9FupG.js → index.DB7deAkb.js} +10 -5
- package/dist/chunks/{index.FbsVqChk.js → index.Dfe22wCV.js} +1 -1
- package/dist/chunks/{index.nSgn5ZFo.js → index.Dq4WBOGA.js} +1 -1
- package/dist/chunks/{index.CmXD-yP7.js → index.DtuEQYZN.js} +1 -1
- package/dist/chunks/{index.BqnKf1sr.js → index.O2zfzZcM.js} +1 -1
- package/dist/chunks/{useMarkdown.rLeRHXfb.js → useMarkdown.DpoGjOrf.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/HistoryEntry.Cj5Hwpkx.js +0 -327
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as X } from "react/jsx-runtime";
|
|
2
|
-
import { I as Z, n as P, INFINITE_SCROLL_LIMIT as F, INFINITE_SCROLL_THRESHOLD as ee, LOCAL_STORAGE_PREFIX as T, LOCAL_STORAGE_SORT_TIMESTAMP as te, LOCAL_STORAGE_SORT_TOKEN_USAGE as re, LOCAL_STORAGE_SORT as ae, J as L, useUserPreferences as se, useDeleteChat as oe, useToggleFavoriteChat as ie, APP_CLASSNAME as ne, TOAST_CHAT_DELETED as ce, graphQLRequest as le, SERVICE_TYPES as de, setNewProvider as he, ACTION_SORT as me, Q as ue, TOAST_PROVIDER_CHANGED as Ce, useChatsHistory as Se, LOCAL_STORAGE_SEARCH as pe, LOCAL_STORAGE_FAVORITES_ONLY as ye, HISTORY_TITLE as fe, S as Te, Y as ge, debounce as Ae, C as Ee, ACTION_SEARCH as ve } from "./index.uzB9FupG.js";
|
|
3
|
-
import { HistoryContext as V, ChatContext as z, useAiChat as _e, E as g, e as m, ConfirmationPanel as De, LazyToastContainerWrapper as Oe, showErrorToast as Le, CHAT_SET_PROVIDER as Re, showSuccessToast as Ie, CHAT_SET_STATUS as ke, oe as Ne, G as be } from "./App.DcQF9Hq9.js";
|
|
4
|
-
import { useRef as w, useState as x, useContext as R, useCallback as we, useEffect as G, Suspense as xe, lazy as He } from "react";
|
|
5
|
-
const Fe = ({
|
|
6
|
-
className: l,
|
|
7
|
-
viewBox: h,
|
|
8
|
-
title: y,
|
|
9
|
-
monotone: u,
|
|
10
|
-
...d
|
|
11
|
-
}) => /* @__PURE__ */ n(
|
|
12
|
-
Z,
|
|
13
|
-
{
|
|
14
|
-
defaultViewBox: "0 0 512 512",
|
|
15
|
-
size: "size-5",
|
|
16
|
-
viewBox: h,
|
|
17
|
-
className: l,
|
|
18
|
-
title: y || "Search",
|
|
19
|
-
...d,
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ t(
|
|
22
|
-
"path",
|
|
23
|
-
{
|
|
24
|
-
d: "M0 208a208 208 0 1 0 416 0 208 208 0 1 0-416 0m352 0a144 144 0 1 1-288 0 144 144 0 1 1 288 0",
|
|
25
|
-
opacity: u ? "1" : "0.4"
|
|
26
|
-
}
|
|
27
|
-
),
|
|
28
|
-
/* @__PURE__ */ t("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" })
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
), Pe = He(
|
|
32
|
-
() => import(
|
|
33
|
-
/* webpackChunkName: "history-table" */
|
|
34
|
-
"./ChatHistoryTable.BwjPu3FF.js"
|
|
35
|
-
).then((l) => ({ default: l.ChatHistoryTable }))
|
|
36
|
-
), Ve = ({
|
|
37
|
-
filteredHistory: l,
|
|
38
|
-
dispatch: h,
|
|
39
|
-
onOpenChange: y,
|
|
40
|
-
mutate: u
|
|
41
|
-
}) => {
|
|
42
|
-
const { user: d, getAccessToken: C } = P(), S = w(null), o = w({
|
|
43
|
-
id: "",
|
|
44
|
-
timestamp: "",
|
|
45
|
-
message: ""
|
|
46
|
-
}), [c, A] = x(!1), [p, I] = x(
|
|
47
|
-
F + ee
|
|
48
|
-
), { state: i, dispatch: E } = R(V), k = {
|
|
49
|
-
searchString: i.searchString || "",
|
|
50
|
-
sortDirection: i.sortDirection || m.DESC,
|
|
51
|
-
sortedCell: i.sortedCell || L
|
|
52
|
-
}, {
|
|
53
|
-
state: { provider: f },
|
|
54
|
-
setChatId: N,
|
|
55
|
-
setInitialMessages: v
|
|
56
|
-
} = R(z), { setInput: b } = _e(), [_, D] = g({
|
|
57
|
-
key: T + te,
|
|
58
|
-
initialValue: m.DESC
|
|
59
|
-
}), [a, M] = g({
|
|
60
|
-
key: T + re,
|
|
61
|
-
initialValue: m.ASC
|
|
62
|
-
}), [, U] = g({
|
|
63
|
-
key: T + ae,
|
|
64
|
-
initialValue: L
|
|
65
|
-
}), { refetch: B } = se({
|
|
66
|
-
user: d?.username,
|
|
67
|
-
getAccessToken: C
|
|
68
|
-
}), { mutateAsync: Y } = oe({ getAccessToken: C }), { mutateAsync: j } = ie({
|
|
69
|
-
getAccessToken: C
|
|
70
|
-
}), $ = (e) => {
|
|
71
|
-
const s = i.sortedCell === e;
|
|
72
|
-
let r, O;
|
|
73
|
-
switch (e) {
|
|
74
|
-
case L:
|
|
75
|
-
O = D, r = s ? i.sortDirection : _;
|
|
76
|
-
break;
|
|
77
|
-
case ue:
|
|
78
|
-
O = M, r = s ? i.sortDirection : a;
|
|
79
|
-
break;
|
|
80
|
-
default:
|
|
81
|
-
O = D, r = s ? i.sortDirection : _;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
const H = r === m.ASC ? m.DESC : m.ASC;
|
|
85
|
-
O(H), U(e), E({
|
|
86
|
-
type: me,
|
|
87
|
-
payload: {
|
|
88
|
-
sortedCell: e,
|
|
89
|
-
sortDirection: H
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}, Q = async () => {
|
|
93
|
-
const e = o.current;
|
|
94
|
-
try {
|
|
95
|
-
await Y({
|
|
96
|
-
userId: d?.username || "",
|
|
97
|
-
id: e.id
|
|
98
|
-
}), u(""), await Le(ce, {
|
|
99
|
-
autoClose: 2e3,
|
|
100
|
-
containerId: "history-table"
|
|
101
|
-
});
|
|
102
|
-
} catch {
|
|
103
|
-
}
|
|
104
|
-
}, q = async (e) => {
|
|
105
|
-
try {
|
|
106
|
-
const s = await C(), r = await le({
|
|
107
|
-
accessToken: s,
|
|
108
|
-
type: de.GET_CHAT,
|
|
109
|
-
params: {
|
|
110
|
-
id: e.id
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
r.data.provider !== f && (await he({
|
|
114
|
-
provider: r.data.provider,
|
|
115
|
-
model: r.data.model,
|
|
116
|
-
accessToken: s,
|
|
117
|
-
username: d?.username || ""
|
|
118
|
-
}), h({
|
|
119
|
-
type: Re,
|
|
120
|
-
payload: {
|
|
121
|
-
provider: r.data.provider
|
|
122
|
-
}
|
|
123
|
-
}), B(), await Ie(
|
|
124
|
-
`${Ce} ${r.data.provider}`,
|
|
125
|
-
{
|
|
126
|
-
containerId: "toggle-provider"
|
|
127
|
-
}
|
|
128
|
-
)), h({
|
|
129
|
-
type: ke,
|
|
130
|
-
payload: {
|
|
131
|
-
restoring: !0,
|
|
132
|
-
restoredModel: r.data?.model || "",
|
|
133
|
-
restoredUsage: r.data?.tokenUsage || 0
|
|
134
|
-
}
|
|
135
|
-
}), b(""), N(e.id), v(r.data.messages), y(!1);
|
|
136
|
-
} catch {
|
|
137
|
-
}
|
|
138
|
-
}, J = (e) => {
|
|
139
|
-
o.current = {
|
|
140
|
-
id: e.id,
|
|
141
|
-
timestamp: e.timestamp,
|
|
142
|
-
message: e.messages.length > 0 ? e.messages[0]?.content : ""
|
|
143
|
-
}, A(!c);
|
|
144
|
-
}, K = async (e) => {
|
|
145
|
-
try {
|
|
146
|
-
await j({
|
|
147
|
-
userId: d?.username || "",
|
|
148
|
-
id: e.id
|
|
149
|
-
}), u("");
|
|
150
|
-
} catch {
|
|
151
|
-
}
|
|
152
|
-
}, W = we((e) => {
|
|
153
|
-
e[0].isIntersecting && I((r) => r + F);
|
|
154
|
-
}, []);
|
|
155
|
-
return G(() => {
|
|
156
|
-
const e = {
|
|
157
|
-
// root: null,
|
|
158
|
-
rootMargin: "20px"
|
|
159
|
-
}, s = new IntersectionObserver(W, e);
|
|
160
|
-
S.current && s.observe(S.current);
|
|
161
|
-
}), /* @__PURE__ */ n(X, { children: [
|
|
162
|
-
/* @__PURE__ */ n(
|
|
163
|
-
De,
|
|
164
|
-
{
|
|
165
|
-
showConfirmation: c,
|
|
166
|
-
setShowConfirmation: A,
|
|
167
|
-
action: Q,
|
|
168
|
-
customStrings: {
|
|
169
|
-
confirmAction: "Delete",
|
|
170
|
-
cancelAction: "Cancel",
|
|
171
|
-
title: "Delete chat"
|
|
172
|
-
},
|
|
173
|
-
children: [
|
|
174
|
-
/* @__PURE__ */ t("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
|
175
|
-
/* @__PURE__ */ n("ul", { className: "m-0", children: [
|
|
176
|
-
/* @__PURE__ */ n("li", { children: [
|
|
177
|
-
"Timestamp:",
|
|
178
|
-
" ",
|
|
179
|
-
/* @__PURE__ */ t("span", { className: "text-lg", children: o.current && o.current.timestamp })
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ n("li", { children: [
|
|
182
|
-
"First message:",
|
|
183
|
-
" ",
|
|
184
|
-
/* @__PURE__ */ t("span", { className: "text-lg", children: o.current?.message })
|
|
185
|
-
] })
|
|
186
|
-
] })
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
/* @__PURE__ */ t("div", { className: ne, children: /* @__PURE__ */ t(Oe, { containerId: "history-table" }) }),
|
|
191
|
-
/* @__PURE__ */ t(xe, { fallback: /* @__PURE__ */ t("div", {}), children: /* @__PURE__ */ t(
|
|
192
|
-
Pe,
|
|
193
|
-
{
|
|
194
|
-
filteredHistory: l,
|
|
195
|
-
historyState: k,
|
|
196
|
-
lastEntryToLoad: p,
|
|
197
|
-
onClickSort: $,
|
|
198
|
-
onClickRestore: q,
|
|
199
|
-
onClickDelete: J,
|
|
200
|
-
onClickFavorite: K,
|
|
201
|
-
infinityScrollMarkerRef: S
|
|
202
|
-
}
|
|
203
|
-
) })
|
|
204
|
-
] });
|
|
205
|
-
}, Be = ({
|
|
206
|
-
open: l,
|
|
207
|
-
onOpenChange: h
|
|
208
|
-
}) => {
|
|
209
|
-
const { getAccessToken: y, user: u } = P(), { dispatch: d } = R(z), [C, S] = x([]), o = w(null), { state: c, dispatch: A } = R(V), {
|
|
210
|
-
data: p,
|
|
211
|
-
refetch: I,
|
|
212
|
-
isLoading: i,
|
|
213
|
-
isError: E
|
|
214
|
-
} = Se({
|
|
215
|
-
enabled: l,
|
|
216
|
-
user: u?.username || "",
|
|
217
|
-
searchString: c.searchString || "",
|
|
218
|
-
sortDirection: c.sortDirection || m.DESC,
|
|
219
|
-
sortedCell: c.sortedCell || L,
|
|
220
|
-
getAccessToken: y
|
|
221
|
-
}), [, k] = g({
|
|
222
|
-
key: T + pe,
|
|
223
|
-
initialValue: c.searchString
|
|
224
|
-
}), [f, N] = g({
|
|
225
|
-
key: T + ye,
|
|
226
|
-
initialValue: !1
|
|
227
|
-
});
|
|
228
|
-
G(() => {
|
|
229
|
-
p && S(
|
|
230
|
-
f ? p.filter((a) => a.favoriteChat === !0) : p
|
|
231
|
-
);
|
|
232
|
-
}, [p, f]);
|
|
233
|
-
const v = async (a) => {
|
|
234
|
-
k(a), A({
|
|
235
|
-
type: ve,
|
|
236
|
-
payload: { searchString: a }
|
|
237
|
-
});
|
|
238
|
-
}, b = Ae((a) => {
|
|
239
|
-
v(a.target.value.trim());
|
|
240
|
-
}, 500), _ = async (a) => {
|
|
241
|
-
a.preventDefault();
|
|
242
|
-
}, D = (a) => {
|
|
243
|
-
N(a);
|
|
244
|
-
};
|
|
245
|
-
return /* @__PURE__ */ n(
|
|
246
|
-
Ne,
|
|
247
|
-
{
|
|
248
|
-
open: l,
|
|
249
|
-
onOpenChange: h,
|
|
250
|
-
title: fe,
|
|
251
|
-
animation: !0,
|
|
252
|
-
animationType: "fade",
|
|
253
|
-
children: [
|
|
254
|
-
/* @__PURE__ */ t(
|
|
255
|
-
Te,
|
|
256
|
-
{
|
|
257
|
-
header: "Filters",
|
|
258
|
-
className: "prose-dark dark:prose-lighter mb-4",
|
|
259
|
-
noBorder: !0,
|
|
260
|
-
compact: !0,
|
|
261
|
-
children: /* @__PURE__ */ n("form", { autoComplete: "off", onSubmit: _, children: [
|
|
262
|
-
/* @__PURE__ */ t(
|
|
263
|
-
ge,
|
|
264
|
-
{
|
|
265
|
-
placeholder: "Search",
|
|
266
|
-
labelHidden: !0,
|
|
267
|
-
noBorder: !0,
|
|
268
|
-
autoCapitalize: "off",
|
|
269
|
-
autoComplete: "off",
|
|
270
|
-
autoCorrect: "off",
|
|
271
|
-
ref: o,
|
|
272
|
-
defaultValue: c.searchString,
|
|
273
|
-
mode: "alt-system",
|
|
274
|
-
name: "Search",
|
|
275
|
-
label: "Search",
|
|
276
|
-
onChange: b,
|
|
277
|
-
className: "my-2",
|
|
278
|
-
rightElement: /* @__PURE__ */ t("div", { className: "dark:text-copy-dark text-copy-light", children: /* @__PURE__ */ t(Fe, { monotone: !0, size: "size-3" }) })
|
|
279
|
-
}
|
|
280
|
-
),
|
|
281
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col justify-between sm:flex-row gap-2 sm:mb-0 mb-1", children: [
|
|
282
|
-
/* @__PURE__ */ t("div", { className: "order-1 sm:order-0", children: /* @__PURE__ */ t(
|
|
283
|
-
be,
|
|
284
|
-
{
|
|
285
|
-
name: "favorites-only",
|
|
286
|
-
checked: f,
|
|
287
|
-
onChange: D,
|
|
288
|
-
label: "Show favorites only",
|
|
289
|
-
narrow: !0,
|
|
290
|
-
noBorder: !0
|
|
291
|
-
}
|
|
292
|
-
) }),
|
|
293
|
-
/* @__PURE__ */ t(
|
|
294
|
-
Ee,
|
|
295
|
-
{
|
|
296
|
-
size: "small",
|
|
297
|
-
disabled: c.searchString === "",
|
|
298
|
-
onClick: () => {
|
|
299
|
-
v(""), o.current?.value && (o.current.value = "", o.current.focus());
|
|
300
|
-
},
|
|
301
|
-
children: "Reset Search"
|
|
302
|
-
}
|
|
303
|
-
)
|
|
304
|
-
] })
|
|
305
|
-
] })
|
|
306
|
-
}
|
|
307
|
-
),
|
|
308
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col sm:flex-row max-h-[65vh] sm:max-h-[75vh] min-h-[60vh]", children: [
|
|
309
|
-
i && /* @__PURE__ */ t("p", { className: "m-0", children: "Loading..." }),
|
|
310
|
-
E && /* @__PURE__ */ t("p", { className: "m-0 text-red-500", children: "Failed to load history." }),
|
|
311
|
-
!i && !E && /* @__PURE__ */ t(
|
|
312
|
-
Ve,
|
|
313
|
-
{
|
|
314
|
-
mutate: I,
|
|
315
|
-
filteredHistory: C,
|
|
316
|
-
dispatch: d,
|
|
317
|
-
onOpenChange: h
|
|
318
|
-
}
|
|
319
|
-
)
|
|
320
|
-
] })
|
|
321
|
-
]
|
|
322
|
-
}
|
|
323
|
-
);
|
|
324
|
-
};
|
|
325
|
-
export {
|
|
326
|
-
Be as HistoryPanel
|
|
327
|
-
};
|