@versini/sassysaint 8.53.0 → 8.55.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.
- package/dist/chunks/{AboutChangelog.BRYsGtBY.js → AboutChangelog.5VfZIj9p.js} +2 -2
- package/dist/chunks/{AboutEntry.Dbhaf-VP.js → AboutEntry.dO_oMKfh.js} +7 -7
- package/dist/chunks/{App.BQH2Wmtd.js → App.w6_jLyPE.js} +1460 -1404
- package/dist/chunks/{Chart.3fOYewQg.js → Chart.C7nKW8WX.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.BP8YviQp.js → ChatBubbleAssistant.Bk03cDqK.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.DiRFVYRm.js → ChatBubbleUser.CDNqDcYA.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.BEG5lXsw.js → ChatHistoryTable.Xi9Mfvf4.js} +3 -3
- package/dist/chunks/HistoryEntry.1-RwtIjk.js +291 -0
- package/dist/chunks/{ProfileEntry.DCYv91ms.js → ProfileEntry.i8nP_-yc.js} +2 -2
- package/dist/chunks/SettingsEntry.Bl5OwncD.js +777 -0
- package/dist/chunks/{Table.DrJ2gUQm.js → Table.DqF6iZRq.js} +2 -2
- package/dist/chunks/{UsageEntry.Bhzo6gzh.js → UsageEntry.BDiutgbn.js} +3 -3
- package/dist/chunks/UserMemoriesPanel.BXJmOUIb.js +197 -0
- package/dist/chunks/{index.CYSNaM4J.js → index.B4ADsXSu.js} +5 -5
- package/dist/chunks/{index.BB9bYKdy.js → index.BV5DU2jx.js} +2 -2
- package/dist/chunks/{index.7kLmHDKd.js → index.CQCqlvg2.js} +1 -1
- package/dist/chunks/{index.DEmU-2wd.js → index.Czo97DsJ.js} +1 -1
- package/dist/chunks/{index.BJoXUuen.js → index.DCWKShPd.js} +1 -1
- package/dist/chunks/{index.C4W5Hfeo.js → index.Ddic88Dj.js} +1 -1
- package/dist/chunks/{index.B5vAQtga.js → index.Dy81-Yet.js} +3 -3
- package/dist/chunks/{useMarkdown.CMlnPnYz.js → useMarkdown.mJBa7hMR.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/HistoryEntry.D1z7kvRb.js +0 -282
- package/dist/chunks/SettingsEntry.B-O4KsHm.js +0 -964
@@ -1,282 +0,0 @@
|
|
1
|
-
import { jsxs as m, jsx as t, Fragment as J } from "react/jsx-runtime";
|
2
|
-
import { I as Q, n as z, INFINITE_SCROLL_LIMIT as H, INFINITE_SCROLL_THRESHOLD as Z, LOCAL_STORAGE_PREFIX as g, LOCAL_STORAGE_SORT_TIMESTAMP as ee, LOCAL_STORAGE_SORT_TOKEN_USAGE as te, LOCAL_STORAGE_SORT as ae, Ae as A, useUserPreferences as re, APP_CLASSNAME as se, mutateCall as N, SERVICE_TYPES as x, setNewProvider as oe, ACTION_SORT as ne, ue as ie, TOAST_CHAT_DELETED as ce, TOAST_PROVIDER_CHANGED as le, useChatsHistory as de, LOCAL_STORAGE_SEARCH as he, HISTORY_TITLE as me, Y as ue, debounce as Se, te as Ce, ACTION_SEARCH as pe } from "./index.CYSNaM4J.js";
|
3
|
-
import { HistoryContext as M, ChatContext as P, useAiChat as Te, E as D, e as h, ConfirmationPanel as fe, LazyToastContainerWrapper as ye, showErrorToast as Ee, CHAT_SET_PROVIDER as ge, showSuccessToast as Ae, CHAT_SET_STATUS as De, se as _e, a as Ie } from "./App.BQH2Wmtd.js";
|
4
|
-
import { useRef as R, useState as L, useContext as _, useCallback as Oe, useEffect as V, Suspense as Re, lazy as Le } from "react";
|
5
|
-
const ve = ({
|
6
|
-
className: i,
|
7
|
-
viewBox: l,
|
8
|
-
title: u,
|
9
|
-
monotone: S,
|
10
|
-
...d
|
11
|
-
}) => /* @__PURE__ */ m(
|
12
|
-
Q,
|
13
|
-
{
|
14
|
-
defaultViewBox: "0 0 512 512",
|
15
|
-
size: "size-5",
|
16
|
-
viewBox: l,
|
17
|
-
className: i,
|
18
|
-
title: u || "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: S ? "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
|
-
), ke = Le(
|
32
|
-
() => import(
|
33
|
-
/* webpackChunkName: "history-table" */
|
34
|
-
"./ChatHistoryTable.BEG5lXsw.js"
|
35
|
-
).then((i) => ({ default: i.ChatHistoryTable }))
|
36
|
-
), be = ({
|
37
|
-
filteredHistory: i,
|
38
|
-
dispatch: l,
|
39
|
-
onOpenChange: u,
|
40
|
-
mutate: S
|
41
|
-
}) => {
|
42
|
-
const { user: d, getAccessToken: C } = z(), p = R(null), s = R({
|
43
|
-
id: "",
|
44
|
-
timestamp: "",
|
45
|
-
message: ""
|
46
|
-
}), [o, f] = L(!1), [T, I] = L(
|
47
|
-
H + Z
|
48
|
-
), { state: n, dispatch: y } = _(M), O = {
|
49
|
-
searchString: n.searchString || "",
|
50
|
-
sortDirection: n.sortDirection || h.DESC,
|
51
|
-
sortedCell: n.sortedCell || A
|
52
|
-
}, {
|
53
|
-
state: { provider: v },
|
54
|
-
setChatId: c,
|
55
|
-
setInitialMessages: G
|
56
|
-
} = _(P), { setInput: U } = Te(), [k, b] = D({
|
57
|
-
key: g + ee,
|
58
|
-
initialValue: h.DESC
|
59
|
-
}), [F, B] = D({
|
60
|
-
key: g + te,
|
61
|
-
initialValue: h.ASC
|
62
|
-
}), [, Y] = D({
|
63
|
-
key: g + ae,
|
64
|
-
initialValue: A
|
65
|
-
}), { refetch: $ } = re({
|
66
|
-
user: d?.username,
|
67
|
-
getAccessToken: C
|
68
|
-
}), j = (e) => {
|
69
|
-
const r = n.sortedCell === e;
|
70
|
-
let a, E;
|
71
|
-
switch (e) {
|
72
|
-
case A:
|
73
|
-
E = b, a = r ? n.sortDirection : k;
|
74
|
-
break;
|
75
|
-
case ie:
|
76
|
-
E = B, a = r ? n.sortDirection : F;
|
77
|
-
break;
|
78
|
-
default:
|
79
|
-
E = b, a = r ? n.sortDirection : k;
|
80
|
-
break;
|
81
|
-
}
|
82
|
-
const w = a === h.ASC ? h.DESC : h.ASC;
|
83
|
-
E(w), Y(e), y({
|
84
|
-
type: ne,
|
85
|
-
payload: {
|
86
|
-
sortedCell: e,
|
87
|
-
sortDirection: w
|
88
|
-
}
|
89
|
-
});
|
90
|
-
}, K = async () => {
|
91
|
-
const e = s.current;
|
92
|
-
try {
|
93
|
-
await N({
|
94
|
-
accessToken: await C(),
|
95
|
-
type: x.DELETE_CHAT,
|
96
|
-
params: {
|
97
|
-
userId: d?.username || "",
|
98
|
-
id: e.id
|
99
|
-
}
|
100
|
-
}), S(""), await Ee(ce, {
|
101
|
-
autoClose: 2e3,
|
102
|
-
containerId: "history-table"
|
103
|
-
});
|
104
|
-
} catch {
|
105
|
-
}
|
106
|
-
}, W = async (e) => {
|
107
|
-
try {
|
108
|
-
const r = await C(), a = await N({
|
109
|
-
accessToken: r,
|
110
|
-
type: x.GET_CHAT,
|
111
|
-
params: {
|
112
|
-
id: e.id
|
113
|
-
}
|
114
|
-
});
|
115
|
-
a.status === 200 && (a.data.provider !== v && (await oe({
|
116
|
-
provider: a.data.provider,
|
117
|
-
accessToken: r,
|
118
|
-
username: d?.username || ""
|
119
|
-
}), l({
|
120
|
-
type: ge,
|
121
|
-
payload: {
|
122
|
-
provider: a.data.provider
|
123
|
-
}
|
124
|
-
}), $(), await Ae(
|
125
|
-
`${le} ${a.data.provider}`,
|
126
|
-
{
|
127
|
-
containerId: "toggle-provider"
|
128
|
-
}
|
129
|
-
)), l({
|
130
|
-
type: De,
|
131
|
-
payload: {
|
132
|
-
restoring: !0,
|
133
|
-
restoredModel: a.data?.model || "",
|
134
|
-
restoredUsage: a.data?.tokenUsage || 0
|
135
|
-
}
|
136
|
-
}), U(""), c(e.id), G(a.data.messages), u(!1));
|
137
|
-
} catch {
|
138
|
-
}
|
139
|
-
}, X = (e) => {
|
140
|
-
s.current = {
|
141
|
-
id: e.id,
|
142
|
-
timestamp: e.timestamp,
|
143
|
-
message: e.messages.length > 0 ? e.messages[0]?.content : ""
|
144
|
-
}, f(!o);
|
145
|
-
}, q = Oe((e) => {
|
146
|
-
e[0].isIntersecting && I((a) => a + H);
|
147
|
-
}, []);
|
148
|
-
return V(() => {
|
149
|
-
const e = {
|
150
|
-
// root: null,
|
151
|
-
rootMargin: "20px"
|
152
|
-
}, r = new IntersectionObserver(q, e);
|
153
|
-
p.current && r.observe(p.current);
|
154
|
-
}), /* @__PURE__ */ m(J, { children: [
|
155
|
-
/* @__PURE__ */ m(
|
156
|
-
fe,
|
157
|
-
{
|
158
|
-
showConfirmation: o,
|
159
|
-
setShowConfirmation: f,
|
160
|
-
action: K,
|
161
|
-
customStrings: {
|
162
|
-
confirmAction: "Delete",
|
163
|
-
cancelAction: "Cancel",
|
164
|
-
title: "Delete chat"
|
165
|
-
},
|
166
|
-
children: [
|
167
|
-
/* @__PURE__ */ t("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
168
|
-
/* @__PURE__ */ m("ul", { className: "m-0", children: [
|
169
|
-
/* @__PURE__ */ m("li", { children: [
|
170
|
-
"Timestamp:",
|
171
|
-
" ",
|
172
|
-
/* @__PURE__ */ t("span", { className: "text-lg", children: s.current && s.current.timestamp })
|
173
|
-
] }),
|
174
|
-
/* @__PURE__ */ m("li", { children: [
|
175
|
-
"First message:",
|
176
|
-
" ",
|
177
|
-
/* @__PURE__ */ t("span", { className: "text-lg", children: s.current?.message })
|
178
|
-
] })
|
179
|
-
] })
|
180
|
-
]
|
181
|
-
}
|
182
|
-
),
|
183
|
-
/* @__PURE__ */ t("div", { className: se, children: /* @__PURE__ */ t(ye, { containerId: "history-table" }) }),
|
184
|
-
/* @__PURE__ */ t(Re, { fallback: /* @__PURE__ */ t("div", {}), children: /* @__PURE__ */ t(
|
185
|
-
ke,
|
186
|
-
{
|
187
|
-
filteredHistory: i,
|
188
|
-
historyState: O,
|
189
|
-
lastEntryToLoad: T,
|
190
|
-
onClickSort: j,
|
191
|
-
onClickRestore: W,
|
192
|
-
onClickDelete: X,
|
193
|
-
infinityScrollMarkerRef: p
|
194
|
-
}
|
195
|
-
) })
|
196
|
-
] });
|
197
|
-
}, ze = ({
|
198
|
-
open: i,
|
199
|
-
onOpenChange: l
|
200
|
-
}) => {
|
201
|
-
const { getAccessToken: u, user: S } = z(), { dispatch: d } = _(P), [C, p] = L([]), s = R(null), { state: o, dispatch: f } = _(M), { data: T, refetch: I } = de({
|
202
|
-
enabled: i,
|
203
|
-
user: S?.username || "",
|
204
|
-
searchString: o.searchString || "",
|
205
|
-
sortDirection: o.sortDirection || h.DESC,
|
206
|
-
sortedCell: o.sortedCell || A,
|
207
|
-
getAccessToken: u
|
208
|
-
}), [, n] = D({
|
209
|
-
key: g + he,
|
210
|
-
initialValue: o.searchString
|
211
|
-
});
|
212
|
-
V(() => {
|
213
|
-
T && p(T);
|
214
|
-
}, [T]);
|
215
|
-
const y = async (c) => {
|
216
|
-
n(c), f({
|
217
|
-
type: pe,
|
218
|
-
payload: { searchString: c }
|
219
|
-
});
|
220
|
-
}, O = Se((c) => {
|
221
|
-
y(c.target.value.trim());
|
222
|
-
}, 500);
|
223
|
-
return /* @__PURE__ */ m(
|
224
|
-
_e,
|
225
|
-
{
|
226
|
-
open: i,
|
227
|
-
onOpenChange: l,
|
228
|
-
title: me,
|
229
|
-
animation: !0,
|
230
|
-
animationType: "fade",
|
231
|
-
children: [
|
232
|
-
/* @__PURE__ */ t("form", { autoComplete: "off", onSubmit: async (c) => {
|
233
|
-
c.preventDefault();
|
234
|
-
}, children: /* @__PURE__ */ t(
|
235
|
-
ue,
|
236
|
-
{
|
237
|
-
placeholder: "Search",
|
238
|
-
labelHidden: !0,
|
239
|
-
noBorder: !0,
|
240
|
-
autoCapitalize: "off",
|
241
|
-
autoComplete: "off",
|
242
|
-
autoCorrect: "off",
|
243
|
-
ref: s,
|
244
|
-
defaultValue: o.searchString,
|
245
|
-
focusMode: "light",
|
246
|
-
mode: "light",
|
247
|
-
name: "Search",
|
248
|
-
label: "Search",
|
249
|
-
onChange: O,
|
250
|
-
className: "my-2",
|
251
|
-
rightElement: /* @__PURE__ */ t("div", { className: "text-copy-dark", children: /* @__PURE__ */ t(
|
252
|
-
Ce,
|
253
|
-
{
|
254
|
-
mode: "dark",
|
255
|
-
focusMode: "dark",
|
256
|
-
label: "Search",
|
257
|
-
size: "small",
|
258
|
-
onClick: () => {
|
259
|
-
y(""), s.current?.value && (s.current.value = "", s.current.focus());
|
260
|
-
},
|
261
|
-
disabled: o.searchString === "",
|
262
|
-
children: o.searchString !== "" ? /* @__PURE__ */ t(Ie, { monotone: !0, size: "size-3" }) : /* @__PURE__ */ t(ve, { monotone: !0, size: "size-3" })
|
263
|
-
}
|
264
|
-
) })
|
265
|
-
}
|
266
|
-
) }),
|
267
|
-
/* @__PURE__ */ t("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh]", children: /* @__PURE__ */ t(
|
268
|
-
be,
|
269
|
-
{
|
270
|
-
mutate: I,
|
271
|
-
filteredHistory: C,
|
272
|
-
dispatch: d,
|
273
|
-
onOpenChange: l
|
274
|
-
}
|
275
|
-
) })
|
276
|
-
]
|
277
|
-
}
|
278
|
-
);
|
279
|
-
};
|
280
|
-
export {
|
281
|
-
ze as HistoryPanel
|
282
|
-
};
|