@versini/sassysaint 8.57.0 → 8.58.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.DzmH2Ft2.js → AboutChangelog.CB0dcRCM.js} +2 -2
- package/dist/chunks/{AboutEntry.DD3TTwq6.js → AboutEntry.DC6pIWQs.js} +7 -7
- package/dist/chunks/{App.D-eIGXB_.js → App.B8ehtPCy.js} +404 -401
- package/dist/chunks/{Chart.BYV6EqEz.js → Chart.D-VIQysU.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.Cos_gf6Y.js → ChatBubbleAssistant.CyJgR8J8.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.Bk0Fip7I.js → ChatBubbleUser.tWOit_f_.js} +3 -3
- package/dist/chunks/ChatHistoryTable.2v_Tv5Xj.js +317 -0
- package/dist/chunks/HistoryEntry.Dh5bLuYX.js +332 -0
- package/dist/chunks/{ProfileEntry.Mao95CEE.js → ProfileEntry.Dno0c0_1.js} +2 -2
- package/dist/chunks/{SettingsEntry.BCzuEKBT.js → SettingsEntry.IGOE-6JU.js} +3 -3
- package/dist/chunks/{Table.D8oP0Hfr.js → Table.CAzmyLPU.js} +2 -2
- package/dist/chunks/{UsageEntry.DsM00cbQ.js → UsageEntry.BStP6ETh.js} +3 -3
- package/dist/chunks/{UserMemoriesPanel.ByHUtoql.js → UserMemoriesPanel.w335l_3o.js} +3 -3
- package/dist/chunks/{index.Dhmu-uQg.js → index.Bm2rN-Q4.js} +1 -1
- package/dist/chunks/{index.CjLTtni3.js → index.BmuSGkDt.js} +1 -1
- package/dist/chunks/{index.C2glMPDi.js → index.Br-5S8Zv.js} +2 -2
- package/dist/chunks/{index.CQfod5uZ.js → index.CRS7yOjI.js} +1 -1
- package/dist/chunks/{index.M7cagQ1Z.js → index.CVdabB4A.js} +1 -1
- package/dist/chunks/{index.BAwdeYEk.js → index.CYzjDPpw.js} +3 -3
- package/dist/chunks/{index.C5_-KbC2.js → index.D3golFwx.js} +210 -194
- package/dist/chunks/{useMarkdown.B-G3RHi6.js → useMarkdown.B9WkUC07.js} +6 -6
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +2 -2
- package/package.json +5 -5
- package/dist/chunks/ChatHistoryTable.D26AKQqJ.js +0 -236
- package/dist/chunks/HistoryEntry.CrQhebc8.js +0 -291
@@ -1,236 +0,0 @@
|
|
1
|
-
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { I as A, de as p, Oe as u, INFINITE_SCROLL_THRESHOLD as w, CARDS as y, pluralize as f, te as g, numberFormatter as v, ue as D, isProbablyMobile as U, y as b, i$1 as I, E as k } from "./index.C5_-KbC2.js";
|
3
|
-
import { st as O, p$1 as z, z as P, p$2 as V } from "./App.D-eIGXB_.js";
|
4
|
-
import { Fragment as _ } from "react";
|
5
|
-
import { j as $, D as B, G as x, H, U as L, M as a, F as R, l as Y } from "./Table.D8oP0Hfr.js";
|
6
|
-
const F = ({
|
7
|
-
className: l,
|
8
|
-
viewBox: n,
|
9
|
-
title: o,
|
10
|
-
monotone: i,
|
11
|
-
...h
|
12
|
-
}) => /* @__PURE__ */ m(
|
13
|
-
A,
|
14
|
-
{
|
15
|
-
defaultViewBox: "0 0 512 512",
|
16
|
-
size: "size-5",
|
17
|
-
viewBox: n,
|
18
|
-
className: l,
|
19
|
-
title: o || "Restore",
|
20
|
-
...h,
|
21
|
-
children: [
|
22
|
-
/* @__PURE__ */ e(
|
23
|
-
"path",
|
24
|
-
{
|
25
|
-
d: "M128 80v16h64V80c0-8.8 7.2-16 16-16h224c8.8 0 16 7.2 16 16v224c0 8.8-7.2 16-16 16h-16v64h16c44.2 0 80-35.8 80-80V80c0-44.2-35.8-80-80-80H208c-44.2 0-80 35.8-80 80",
|
26
|
-
opacity: i ? "1" : "0.4"
|
27
|
-
}
|
28
|
-
),
|
29
|
-
/* @__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" })
|
30
|
-
]
|
31
|
-
}
|
32
|
-
), G = {
|
33
|
-
[k]: V,
|
34
|
-
[I]: P,
|
35
|
-
[b]: z
|
36
|
-
}, t = {
|
37
|
-
ROW: "row",
|
38
|
-
TIMESTAMP: p,
|
39
|
-
SUMMARY: "summary",
|
40
|
-
PROVIDER: "provider",
|
41
|
-
TOKEN_USAGE: u,
|
42
|
-
ACTIONS: "actions"
|
43
|
-
}, K = [
|
44
|
-
t.ROW,
|
45
|
-
t.TIMESTAMP,
|
46
|
-
t.SUMMARY,
|
47
|
-
t.ACTIONS
|
48
|
-
], W = [
|
49
|
-
t.ROW,
|
50
|
-
t.SUMMARY,
|
51
|
-
t.TIMESTAMP,
|
52
|
-
t.TOKEN_USAGE,
|
53
|
-
t.PROVIDER,
|
54
|
-
t.ACTIONS
|
55
|
-
], ee = ({
|
56
|
-
filteredHistory: l,
|
57
|
-
historyState: n,
|
58
|
-
lastEntryToLoad: o,
|
59
|
-
onClickSort: i,
|
60
|
-
onClickRestore: h,
|
61
|
-
onClickDelete: T,
|
62
|
-
infinityScrollMarkerRef: C
|
63
|
-
}) => {
|
64
|
-
const M = U() ? K : W, S = (s) => {
|
65
|
-
switch (s) {
|
66
|
-
case t.ROW:
|
67
|
-
return /* @__PURE__ */ e(a, { className: "sr-only", children: "Row" }, s);
|
68
|
-
case t.TIMESTAMP:
|
69
|
-
return /* @__PURE__ */ e(
|
70
|
-
R,
|
71
|
-
{
|
72
|
-
buttonClassName: "text-xs sm:text-sm",
|
73
|
-
cellId: p,
|
74
|
-
align: "left",
|
75
|
-
sortDirection: n.sortDirection,
|
76
|
-
sortedCell: n.sortedCell,
|
77
|
-
onClick: () => {
|
78
|
-
i(p);
|
79
|
-
},
|
80
|
-
children: "Date"
|
81
|
-
},
|
82
|
-
s
|
83
|
-
);
|
84
|
-
case t.SUMMARY:
|
85
|
-
return /* @__PURE__ */ e(a, { className: "text-xs sm:text-sm", children: "Summary" }, s);
|
86
|
-
case t.PROVIDER:
|
87
|
-
return /* @__PURE__ */ e(a, { className: "text-xs sm:text-sm", children: "Provider" }, s);
|
88
|
-
case t.TOKEN_USAGE:
|
89
|
-
return /* @__PURE__ */ e(
|
90
|
-
R,
|
91
|
-
{
|
92
|
-
buttonClassName: "text-xs sm:text-sm",
|
93
|
-
cellId: u,
|
94
|
-
align: "right",
|
95
|
-
sortDirection: n.sortDirection,
|
96
|
-
sortedCell: n.sortedCell,
|
97
|
-
onClick: () => {
|
98
|
-
i(u);
|
99
|
-
},
|
100
|
-
children: "Tokens"
|
101
|
-
},
|
102
|
-
s
|
103
|
-
);
|
104
|
-
case t.ACTIONS:
|
105
|
-
return /* @__PURE__ */ e(a, { className: "text-xs sm:text-sm text-right", children: "Actions" }, s);
|
106
|
-
default:
|
107
|
-
return null;
|
108
|
-
}
|
109
|
-
}, E = (s, r, d) => {
|
110
|
-
switch (s) {
|
111
|
-
case t.ROW:
|
112
|
-
return /* @__PURE__ */ e(a, { children: d + 1 }, s);
|
113
|
-
case t.TIMESTAMP:
|
114
|
-
return /* @__PURE__ */ e(
|
115
|
-
a,
|
116
|
-
{
|
117
|
-
component: "th",
|
118
|
-
scope: "row",
|
119
|
-
className: "text-gray-400 sm:whitespace-nowrap text-xs sm:text-sm max-w-20 sm:max-w-none",
|
120
|
-
children: r.timestamp.split(",")[0]
|
121
|
-
},
|
122
|
-
s
|
123
|
-
);
|
124
|
-
case t.SUMMARY: {
|
125
|
-
const c = r.summary || (r.messages.length > 0 ? r.messages[0]?.content : "");
|
126
|
-
return /* @__PURE__ */ e(
|
127
|
-
a,
|
128
|
-
{
|
129
|
-
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
130
|
-
style: {
|
131
|
-
wordBreak: "break-word"
|
132
|
-
},
|
133
|
-
children: c
|
134
|
-
},
|
135
|
-
s
|
136
|
-
);
|
137
|
-
}
|
138
|
-
case t.PROVIDER: {
|
139
|
-
const c = r.model ? D(r.model) : null, N = c ? G[c] : null;
|
140
|
-
return /* @__PURE__ */ e(
|
141
|
-
a,
|
142
|
-
{
|
143
|
-
component: "th",
|
144
|
-
scope: "row",
|
145
|
-
className: "text-gray-400",
|
146
|
-
align: "center",
|
147
|
-
children: N ? /* @__PURE__ */ e(
|
148
|
-
N,
|
149
|
-
{
|
150
|
-
size: "size-4 sm:size-5",
|
151
|
-
semantic: !0,
|
152
|
-
title: r.model || c
|
153
|
-
}
|
154
|
-
) : null
|
155
|
-
},
|
156
|
-
s
|
157
|
-
);
|
158
|
-
}
|
159
|
-
case t.TOKEN_USAGE:
|
160
|
-
return /* @__PURE__ */ e(
|
161
|
-
a,
|
162
|
-
{
|
163
|
-
className: "text-gray-400 text-xs sm:text-sm",
|
164
|
-
align: "right",
|
165
|
-
children: r.tokenUsage ? v.format(r.tokenUsage) : "0"
|
166
|
-
},
|
167
|
-
s
|
168
|
-
);
|
169
|
-
case t.ACTIONS:
|
170
|
-
return /* @__PURE__ */ e(a, { children: /* @__PURE__ */ m("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
|
171
|
-
/* @__PURE__ */ e(
|
172
|
-
O,
|
173
|
-
{
|
174
|
-
label: "Restore chat",
|
175
|
-
mode: "alt-system",
|
176
|
-
placement: "top",
|
177
|
-
trigger: /* @__PURE__ */ e(
|
178
|
-
g,
|
179
|
-
{
|
180
|
-
focusMode: "alt-system",
|
181
|
-
noBorder: !0,
|
182
|
-
label: "Restore chat",
|
183
|
-
variant: "primary",
|
184
|
-
iconClassName: "text-green-800 dark:text-green-500",
|
185
|
-
onClick: async () => {
|
186
|
-
await h(r);
|
187
|
-
},
|
188
|
-
children: /* @__PURE__ */ e(F, { size: "size-3", monotone: !0 })
|
189
|
-
}
|
190
|
-
)
|
191
|
-
}
|
192
|
-
),
|
193
|
-
/* @__PURE__ */ e(
|
194
|
-
O,
|
195
|
-
{
|
196
|
-
label: "Delete chat",
|
197
|
-
mode: "alt-system",
|
198
|
-
placement: "top",
|
199
|
-
trigger: /* @__PURE__ */ e(
|
200
|
-
g,
|
201
|
-
{
|
202
|
-
focusMode: "alt-system",
|
203
|
-
noBorder: !0,
|
204
|
-
label: "Delete chat",
|
205
|
-
variant: "primary",
|
206
|
-
iconClassName: "text-red-700 dark:text-red-500",
|
207
|
-
onClick: () => {
|
208
|
-
T(r);
|
209
|
-
},
|
210
|
-
children: /* @__PURE__ */ e(Y, { size: "size-3", monotone: !0 })
|
211
|
-
}
|
212
|
-
)
|
213
|
-
}
|
214
|
-
)
|
215
|
-
] }) }, s);
|
216
|
-
default:
|
217
|
-
return null;
|
218
|
-
}
|
219
|
-
};
|
220
|
-
return /* @__PURE__ */ m($, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
|
221
|
-
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(x, { children: M.map((s) => S(s)) }) }),
|
222
|
-
/* @__PURE__ */ e(H, { children: l.slice(0, o).map((s, r) => s?.messages?.length > 0 ? /* @__PURE__ */ m(_, { children: [
|
223
|
-
r === o - w && /* @__PURE__ */ e("tr", { ref: C }),
|
224
|
-
/* @__PURE__ */ e(x, { children: M.map(
|
225
|
-
(d) => E(d, s, r)
|
226
|
-
) })
|
227
|
-
] }, `${y.HISTORY.TITLE}-${s.id}-${r}`) : null) }),
|
228
|
-
/* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(a, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: f(
|
229
|
-
`${l.length} chat`,
|
230
|
-
l.length
|
231
|
-
) }) }) }) })
|
232
|
-
] });
|
233
|
-
};
|
234
|
-
export {
|
235
|
-
ee as ChatHistoryTable
|
236
|
-
};
|
@@ -1,291 +0,0 @@
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as J } from "react/jsx-runtime";
|
2
|
-
import { I as Q, n as P, INFINITE_SCROLL_LIMIT as x, INFINITE_SCROLL_THRESHOLD as Z, LOCAL_STORAGE_PREFIX as A, LOCAL_STORAGE_SORT_TIMESTAMP as ee, LOCAL_STORAGE_SORT_TOKEN_USAGE as te, LOCAL_STORAGE_SORT as ae, de as D, useUserPreferences as re, APP_CLASSNAME as se, mutateCall as z, SERVICE_TYPES as M, setNewProvider as oe, ACTION_SORT as ie, Oe as ne, 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.C5_-KbC2.js";
|
3
|
-
import { HistoryContext as V, ChatContext as G, useAiChat as Te, E as _, e as m, ConfirmationPanel as fe, LazyToastContainerWrapper as ye, showErrorToast as ge, CHAT_SET_PROVIDER as Ee, showSuccessToast as Ae, CHAT_SET_STATUS as De, se as _e, a as Le } from "./App.D-eIGXB_.js";
|
4
|
-
import { useRef as v, useState as k, useContext as L, useCallback as Oe, useEffect as F, Suspense as Ie, lazy as Re } from "react";
|
5
|
-
const ve = ({
|
6
|
-
className: n,
|
7
|
-
viewBox: d,
|
8
|
-
title: u,
|
9
|
-
monotone: S,
|
10
|
-
...h
|
11
|
-
}) => /* @__PURE__ */ l(
|
12
|
-
Q,
|
13
|
-
{
|
14
|
-
defaultViewBox: "0 0 512 512",
|
15
|
-
size: "size-5",
|
16
|
-
viewBox: d,
|
17
|
-
className: n,
|
18
|
-
title: u || "Search",
|
19
|
-
...h,
|
20
|
-
children: [
|
21
|
-
/* @__PURE__ */ e(
|
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__ */ 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" })
|
29
|
-
]
|
30
|
-
}
|
31
|
-
), ke = Re(
|
32
|
-
() => import(
|
33
|
-
/* webpackChunkName: "history-table" */
|
34
|
-
"./ChatHistoryTable.D26AKQqJ.js"
|
35
|
-
).then((n) => ({ default: n.ChatHistoryTable }))
|
36
|
-
), be = ({
|
37
|
-
filteredHistory: n,
|
38
|
-
dispatch: d,
|
39
|
-
onOpenChange: u,
|
40
|
-
mutate: S
|
41
|
-
}) => {
|
42
|
-
const { user: h, getAccessToken: C } = P(), p = v(null), s = v({
|
43
|
-
id: "",
|
44
|
-
timestamp: "",
|
45
|
-
message: ""
|
46
|
-
}), [o, f] = k(!1), [T, O] = k(
|
47
|
-
x + Z
|
48
|
-
), { state: i, dispatch: y } = L(V), I = {
|
49
|
-
searchString: i.searchString || "",
|
50
|
-
sortDirection: i.sortDirection || m.DESC,
|
51
|
-
sortedCell: i.sortedCell || D
|
52
|
-
}, {
|
53
|
-
state: { provider: g },
|
54
|
-
setChatId: R,
|
55
|
-
setInitialMessages: b
|
56
|
-
} = L(G), { setInput: c } = Te(), [N, w] = _({
|
57
|
-
key: A + ee,
|
58
|
-
initialValue: m.DESC
|
59
|
-
}), [U, B] = _({
|
60
|
-
key: A + te,
|
61
|
-
initialValue: m.ASC
|
62
|
-
}), [, Y] = _({
|
63
|
-
key: A + ae,
|
64
|
-
initialValue: D
|
65
|
-
}), { refetch: $ } = re({
|
66
|
-
user: h?.username,
|
67
|
-
getAccessToken: C
|
68
|
-
}), j = (t) => {
|
69
|
-
const r = i.sortedCell === t;
|
70
|
-
let a, E;
|
71
|
-
switch (t) {
|
72
|
-
case D:
|
73
|
-
E = w, a = r ? i.sortDirection : N;
|
74
|
-
break;
|
75
|
-
case ne:
|
76
|
-
E = B, a = r ? i.sortDirection : U;
|
77
|
-
break;
|
78
|
-
default:
|
79
|
-
E = w, a = r ? i.sortDirection : N;
|
80
|
-
break;
|
81
|
-
}
|
82
|
-
const H = a === m.ASC ? m.DESC : m.ASC;
|
83
|
-
E(H), Y(t), y({
|
84
|
-
type: ie,
|
85
|
-
payload: {
|
86
|
-
sortedCell: t,
|
87
|
-
sortDirection: H
|
88
|
-
}
|
89
|
-
});
|
90
|
-
}, K = async () => {
|
91
|
-
const t = s.current;
|
92
|
-
try {
|
93
|
-
await z({
|
94
|
-
accessToken: await C(),
|
95
|
-
type: M.DELETE_CHAT,
|
96
|
-
params: {
|
97
|
-
userId: h?.username || "",
|
98
|
-
id: t.id
|
99
|
-
}
|
100
|
-
}), S(""), await ge(ce, {
|
101
|
-
autoClose: 2e3,
|
102
|
-
containerId: "history-table"
|
103
|
-
});
|
104
|
-
} catch {
|
105
|
-
}
|
106
|
-
}, W = async (t) => {
|
107
|
-
try {
|
108
|
-
const r = await C(), a = await z({
|
109
|
-
accessToken: r,
|
110
|
-
type: M.GET_CHAT,
|
111
|
-
params: {
|
112
|
-
id: t.id
|
113
|
-
}
|
114
|
-
});
|
115
|
-
a.status === 200 && (a.data.provider !== g && (await oe({
|
116
|
-
provider: a.data.provider,
|
117
|
-
accessToken: r,
|
118
|
-
username: h?.username || ""
|
119
|
-
}), d({
|
120
|
-
type: Ee,
|
121
|
-
payload: {
|
122
|
-
provider: a.data.provider
|
123
|
-
}
|
124
|
-
}), $(), await Ae(
|
125
|
-
`${le} ${a.data.provider}`,
|
126
|
-
{
|
127
|
-
containerId: "toggle-provider"
|
128
|
-
}
|
129
|
-
)), d({
|
130
|
-
type: De,
|
131
|
-
payload: {
|
132
|
-
restoring: !0,
|
133
|
-
restoredModel: a.data?.model || "",
|
134
|
-
restoredUsage: a.data?.tokenUsage || 0
|
135
|
-
}
|
136
|
-
}), c(""), R(t.id), b(a.data.messages), u(!1));
|
137
|
-
} catch {
|
138
|
-
}
|
139
|
-
}, X = (t) => {
|
140
|
-
s.current = {
|
141
|
-
id: t.id,
|
142
|
-
timestamp: t.timestamp,
|
143
|
-
message: t.messages.length > 0 ? t.messages[0]?.content : ""
|
144
|
-
}, f(!o);
|
145
|
-
}, q = Oe((t) => {
|
146
|
-
t[0].isIntersecting && O((a) => a + x);
|
147
|
-
}, []);
|
148
|
-
return F(() => {
|
149
|
-
const t = {
|
150
|
-
// root: null,
|
151
|
-
rootMargin: "20px"
|
152
|
-
}, r = new IntersectionObserver(q, t);
|
153
|
-
p.current && r.observe(p.current);
|
154
|
-
}), /* @__PURE__ */ l(J, { children: [
|
155
|
-
/* @__PURE__ */ l(
|
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__ */ e("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
168
|
-
/* @__PURE__ */ l("ul", { className: "m-0", children: [
|
169
|
-
/* @__PURE__ */ l("li", { children: [
|
170
|
-
"Timestamp:",
|
171
|
-
" ",
|
172
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children: s.current && s.current.timestamp })
|
173
|
-
] }),
|
174
|
-
/* @__PURE__ */ l("li", { children: [
|
175
|
-
"First message:",
|
176
|
-
" ",
|
177
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children: s.current?.message })
|
178
|
-
] })
|
179
|
-
] })
|
180
|
-
]
|
181
|
-
}
|
182
|
-
),
|
183
|
-
/* @__PURE__ */ e("div", { className: se, children: /* @__PURE__ */ e(ye, { containerId: "history-table" }) }),
|
184
|
-
/* @__PURE__ */ e(Ie, { fallback: /* @__PURE__ */ e("div", {}), children: /* @__PURE__ */ e(
|
185
|
-
ke,
|
186
|
-
{
|
187
|
-
filteredHistory: n,
|
188
|
-
historyState: I,
|
189
|
-
lastEntryToLoad: T,
|
190
|
-
onClickSort: j,
|
191
|
-
onClickRestore: W,
|
192
|
-
onClickDelete: X,
|
193
|
-
infinityScrollMarkerRef: p
|
194
|
-
}
|
195
|
-
) })
|
196
|
-
] });
|
197
|
-
}, ze = ({
|
198
|
-
open: n,
|
199
|
-
onOpenChange: d
|
200
|
-
}) => {
|
201
|
-
const { getAccessToken: u, user: S } = P(), { dispatch: h } = L(G), [C, p] = k([]), s = v(null), { state: o, dispatch: f } = L(V), {
|
202
|
-
data: T,
|
203
|
-
refetch: O,
|
204
|
-
isLoading: i,
|
205
|
-
isError: y
|
206
|
-
} = de({
|
207
|
-
enabled: n,
|
208
|
-
user: S?.username || "",
|
209
|
-
searchString: o.searchString || "",
|
210
|
-
sortDirection: o.sortDirection || m.DESC,
|
211
|
-
sortedCell: o.sortedCell || D,
|
212
|
-
getAccessToken: u
|
213
|
-
}), [, I] = _({
|
214
|
-
key: A + he,
|
215
|
-
initialValue: o.searchString
|
216
|
-
});
|
217
|
-
F(() => {
|
218
|
-
T && p(T);
|
219
|
-
}, [T]);
|
220
|
-
const g = async (c) => {
|
221
|
-
I(c), f({
|
222
|
-
type: pe,
|
223
|
-
payload: { searchString: c }
|
224
|
-
});
|
225
|
-
}, R = Se((c) => {
|
226
|
-
g(c.target.value.trim());
|
227
|
-
}, 500);
|
228
|
-
return /* @__PURE__ */ l(
|
229
|
-
_e,
|
230
|
-
{
|
231
|
-
open: n,
|
232
|
-
onOpenChange: d,
|
233
|
-
title: me,
|
234
|
-
animation: !0,
|
235
|
-
animationType: "fade",
|
236
|
-
children: [
|
237
|
-
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: async (c) => {
|
238
|
-
c.preventDefault();
|
239
|
-
}, children: /* @__PURE__ */ e(
|
240
|
-
ue,
|
241
|
-
{
|
242
|
-
placeholder: "Search",
|
243
|
-
labelHidden: !0,
|
244
|
-
noBorder: !0,
|
245
|
-
autoCapitalize: "off",
|
246
|
-
autoComplete: "off",
|
247
|
-
autoCorrect: "off",
|
248
|
-
ref: s,
|
249
|
-
defaultValue: o.searchString,
|
250
|
-
focusMode: "light",
|
251
|
-
mode: "light",
|
252
|
-
name: "Search",
|
253
|
-
label: "Search",
|
254
|
-
onChange: R,
|
255
|
-
className: "my-2",
|
256
|
-
rightElement: /* @__PURE__ */ e("div", { className: "text-copy-dark", children: /* @__PURE__ */ e(
|
257
|
-
Ce,
|
258
|
-
{
|
259
|
-
mode: "dark",
|
260
|
-
focusMode: "dark",
|
261
|
-
label: "Search",
|
262
|
-
size: "small",
|
263
|
-
onClick: () => {
|
264
|
-
g(""), s.current?.value && (s.current.value = "", s.current.focus());
|
265
|
-
},
|
266
|
-
disabled: o.searchString === "",
|
267
|
-
children: o.searchString !== "" ? /* @__PURE__ */ e(Le, { monotone: !0, size: "size-3" }) : /* @__PURE__ */ e(ve, { monotone: !0, size: "size-3" })
|
268
|
-
}
|
269
|
-
) })
|
270
|
-
}
|
271
|
-
) }),
|
272
|
-
/* @__PURE__ */ l("div", { className: "flex flex-col sm:flex-row max-h-[75vh] min-h-[60vh]", children: [
|
273
|
-
i && /* @__PURE__ */ e("p", { className: "m-0", children: "Loading..." }),
|
274
|
-
y && /* @__PURE__ */ e("p", { className: "m-0 text-red-500", children: "Failed to load history." }),
|
275
|
-
!i && !y && /* @__PURE__ */ e(
|
276
|
-
be,
|
277
|
-
{
|
278
|
-
mutate: O,
|
279
|
-
filteredHistory: C,
|
280
|
-
dispatch: h,
|
281
|
-
onOpenChange: d
|
282
|
-
}
|
283
|
-
)
|
284
|
-
] })
|
285
|
-
]
|
286
|
-
}
|
287
|
-
);
|
288
|
-
};
|
289
|
-
export {
|
290
|
-
ze as HistoryPanel
|
291
|
-
};
|