@versini/sassysaint 4.0.3 → 4.0.5
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/{App.D304Xevg.js → App.Cd080fXs.js} +3 -3
- package/dist/chunks/{LazyHeader.DZqy-k6Q.js → LazyHeader.CG_x94aM.js} +385 -387
- package/dist/chunks/{LazyMarkdownWithExtra.BXbx8ZuU.js → LazyMarkdownWithExtra.HwBaWBbT.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.s7N5AkfQ.js → LazyMessageAssistant.CP6NuHPb.js} +4 -4
- package/dist/chunks/{index.7JJYsiGN.CAXaixDN.js → index.7JJYsiGN.fOXCGsQA.js} +1 -1
- package/dist/chunks/{index.hKY7O9up.js → index.KrqE7k6j.js} +95 -91
- package/dist/chunks/{useLocalStorage.guy7-rXk.js → useLocalStorage.cIA35Dub.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
2
|
-
import { O as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { O as D, i$1 as le, N as de, p as De, o as _e, g as A, N$1 as _, CARDS as g, renderDataAsList as $, pluralize as Z, ABOUT_TITLE as ze, MODEL_GPT4 as Be, numberFormatter as Ve, durationFormatter as Ce, NA as Pe, ROLE_ASSISTANT as Fe, extractAverage as Ge, GPT4_MAX_TOKENS as $e, zr as Y, STATS as Ne, b as F, j as E, x as ee, LOCAL_STORAGE_PREFIX as te, LOCAL_STORAGE_SORT as Ue, ACTION_RESET as je, ACTION_RESTORE as Ye, truncate as Ke, ACTION_SORT as re, LOCAL_STORAGE_SEARCH as We, Y as Xe, ACTION_SEARCH as Je, HISTORY_TITLE as qe, LOCAL_STORAGE_CHAT_DETAILS as Qe, LOCAL_STORAGE_LOCATION as Ze, v as et, ACTION_LOCATION as me, getCurrentGeoLocation as tt, convertLatitudeToDMS as at, convertLongitudeToDMS as nt, PROFILE_TITLE as st, LOG_OUT as ue } from "./index.KrqE7k6j.js";
|
|
3
3
|
import * as ce from "react";
|
|
4
|
-
import rt, { forwardRef as Te, useState as
|
|
5
|
-
import { g as
|
|
4
|
+
import rt, { forwardRef as Te, useState as y, useRef as U, useContext as R, useEffect as L, Suspense as ot, lazy as ct, useId as it, useMemo as lt } from "react";
|
|
5
|
+
import { g as dt, AppContext as K, serviceCall as ne, SERVICE_TYPES as se, HistoryContext as ye, E as ae, k as I, et as mt, at as ut, lt as oe, J as M, ct as ht, st as pt, rt as ft } from "./useLocalStorage.cIA35Dub.js";
|
|
6
6
|
import v from "clsx";
|
|
7
|
-
import { useFloatingTree as be, useFloatingNodeId as
|
|
7
|
+
import { useFloatingTree as be, useFloatingNodeId as gt, useListItem as Se, useFloating as Ct, offset as Nt, flip as Tt, shift as yt, autoUpdate as bt, useClick as St, useRole as wt, useDismiss as kt, useListNavigation as xt, useTypeahead as Et, useInteractions as vt, useMergeRefs as we, FloatingNode as It, FloatingList as At, FloatingPortal as Ht, FloatingFocusManager as Mt, FloatingTree as Rt } from "@floating-ui/react";
|
|
8
8
|
const ie = ce.createContext({
|
|
9
9
|
getItemProps: () => ({}),
|
|
10
10
|
activeIndex: null,
|
|
@@ -29,78 +29,78 @@ const ie = ce.createContext({
|
|
|
29
29
|
({
|
|
30
30
|
trigger: t,
|
|
31
31
|
children: a,
|
|
32
|
-
label:
|
|
33
|
-
defaultPlacement:
|
|
32
|
+
label: n = "Open menu",
|
|
33
|
+
defaultPlacement: s = "bottom-start",
|
|
34
34
|
onOpenChange: r,
|
|
35
35
|
spacing: o,
|
|
36
36
|
mode: i = "system",
|
|
37
|
-
focusMode:
|
|
38
|
-
...
|
|
37
|
+
focusMode: u = "system",
|
|
38
|
+
...p
|
|
39
39
|
}, d) => {
|
|
40
|
-
const [
|
|
41
|
-
nodeId:
|
|
42
|
-
open:
|
|
40
|
+
const [l, C] = y(!1), [b, w] = y(!1), [h, x] = y(null), f = U([]), m = U([]), N = R(ie), T = be(), S = gt(), z = Se(), { floatingStyles: B, refs: J, context: H } = Ct({
|
|
41
|
+
nodeId: S,
|
|
42
|
+
open: l,
|
|
43
43
|
onOpenChange: (P) => {
|
|
44
|
-
|
|
44
|
+
C(P), r == null || r(P);
|
|
45
45
|
},
|
|
46
|
-
placement:
|
|
46
|
+
placement: s,
|
|
47
47
|
strategy: "fixed",
|
|
48
|
-
middleware: [
|
|
49
|
-
whileElementsMounted:
|
|
50
|
-
}), q =
|
|
48
|
+
middleware: [Nt({ mainAxis: 10 }), Tt(), yt()],
|
|
49
|
+
whileElementsMounted: bt
|
|
50
|
+
}), q = St(H, {
|
|
51
51
|
event: "mousedown",
|
|
52
52
|
toggle: !0,
|
|
53
53
|
ignoreMouse: !1
|
|
54
|
-
}), V =
|
|
54
|
+
}), V = wt(H, { role: "menu" }), ve = kt(H, { bubbles: !0 }), Ie = xt(H, {
|
|
55
55
|
listRef: f,
|
|
56
|
-
activeIndex:
|
|
56
|
+
activeIndex: h,
|
|
57
57
|
nested: !1,
|
|
58
|
-
onNavigate:
|
|
58
|
+
onNavigate: x,
|
|
59
59
|
loop: !0
|
|
60
|
-
}), Ae =
|
|
61
|
-
listRef:
|
|
62
|
-
onMatch:
|
|
63
|
-
activeIndex:
|
|
64
|
-
}), { getReferenceProps: He, getFloatingProps: Me, getItemProps: Re } =
|
|
60
|
+
}), Ae = Et(H, {
|
|
61
|
+
listRef: m,
|
|
62
|
+
onMatch: l ? x : void 0,
|
|
63
|
+
activeIndex: h
|
|
64
|
+
}), { getReferenceProps: He, getFloatingProps: Me, getItemProps: Re } = vt([q, V, ve, Ie, Ae]), Le = he(t) === "Button" || he(t) === "ButtonIcon", Oe = rt.cloneElement(t, {
|
|
65
65
|
mode: i,
|
|
66
|
-
focusMode:
|
|
66
|
+
focusMode: u,
|
|
67
67
|
spacing: o,
|
|
68
68
|
noInternalClick: Le,
|
|
69
|
-
"aria-label":
|
|
70
|
-
"data-open":
|
|
71
|
-
"data-focus-inside":
|
|
72
|
-
ref: we([J.setReference,
|
|
69
|
+
"aria-label": n,
|
|
70
|
+
"data-open": l ? "" : void 0,
|
|
71
|
+
"data-focus-inside": b ? "" : void 0,
|
|
72
|
+
ref: we([J.setReference, z.ref, d]),
|
|
73
73
|
...He(
|
|
74
|
-
|
|
75
|
-
...
|
|
74
|
+
N.getItemProps({
|
|
75
|
+
...p
|
|
76
76
|
})
|
|
77
77
|
)
|
|
78
78
|
});
|
|
79
|
-
return
|
|
80
|
-
if (!
|
|
79
|
+
return L(() => {
|
|
80
|
+
if (!T)
|
|
81
81
|
return;
|
|
82
82
|
function P() {
|
|
83
|
-
|
|
83
|
+
C(!1), r == null || r(!1);
|
|
84
84
|
}
|
|
85
|
-
return
|
|
86
|
-
|
|
85
|
+
return T.events.on("click", P), () => {
|
|
86
|
+
T.events.off("click", P);
|
|
87
87
|
};
|
|
88
|
-
}, [
|
|
89
|
-
|
|
90
|
-
}, [
|
|
88
|
+
}, [T, r]), L(() => {
|
|
89
|
+
l && T && T.events.emit("menuopen", { nodeId: S });
|
|
90
|
+
}, [T, l, S]), /* @__PURE__ */ c(It, { id: S, children: [
|
|
91
91
|
Oe,
|
|
92
92
|
/* @__PURE__ */ e(
|
|
93
93
|
ie.Provider,
|
|
94
94
|
{
|
|
95
95
|
value: {
|
|
96
|
-
activeIndex:
|
|
97
|
-
setActiveIndex:
|
|
96
|
+
activeIndex: h,
|
|
97
|
+
setActiveIndex: x,
|
|
98
98
|
getItemProps: Re,
|
|
99
|
-
setHasFocusInside:
|
|
100
|
-
isOpen:
|
|
99
|
+
setHasFocusInside: w,
|
|
100
|
+
isOpen: l
|
|
101
101
|
},
|
|
102
|
-
children: /* @__PURE__ */ e(
|
|
103
|
-
|
|
102
|
+
children: /* @__PURE__ */ e(At, { elementsRef: f, labelsRef: m, children: l && /* @__PURE__ */ e(Ht, { children: /* @__PURE__ */ e(
|
|
103
|
+
Mt,
|
|
104
104
|
{
|
|
105
105
|
context: H,
|
|
106
106
|
modal: !1,
|
|
@@ -122,64 +122,64 @@ const ie = ce.createContext({
|
|
|
122
122
|
)
|
|
123
123
|
] });
|
|
124
124
|
}
|
|
125
|
-
), xe = Te((t, a) => /* @__PURE__ */ e(
|
|
125
|
+
), xe = Te((t, a) => /* @__PURE__ */ e(Rt, { children: /* @__PURE__ */ e(ke, { ...t, ref: a }) }));
|
|
126
126
|
xe.displayName = "Menu";
|
|
127
127
|
ke.displayName = "MenuComponent";
|
|
128
|
-
const
|
|
129
|
-
const o = ce.useContext(ie), i = Se({ label: a ? null : t }),
|
|
128
|
+
const O = ce.forwardRef(({ label: t, disabled: a, icon: n, ...s }, r) => {
|
|
129
|
+
const o = ce.useContext(ie), i = Se({ label: a ? null : t }), u = be();
|
|
130
130
|
return /* @__PURE__ */ c(
|
|
131
131
|
"button",
|
|
132
132
|
{
|
|
133
|
-
...
|
|
133
|
+
...s,
|
|
134
134
|
ref: we([i.ref, r]),
|
|
135
135
|
role: "menuitem",
|
|
136
136
|
className: "m-0 flex w-full rounded-md border border-transparent bg-none px-3 py-2 text-left text-base outline-none focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium sm:py-1",
|
|
137
137
|
tabIndex: 0,
|
|
138
138
|
disabled: a,
|
|
139
139
|
...o.getItemProps({
|
|
140
|
-
onClick(
|
|
140
|
+
onClick(p) {
|
|
141
141
|
var d;
|
|
142
|
-
(d =
|
|
142
|
+
(d = s.onClick) == null || d.call(s, p), u == null || u.events.emit("click");
|
|
143
143
|
},
|
|
144
|
-
onFocus(
|
|
144
|
+
onFocus(p) {
|
|
145
145
|
var d;
|
|
146
|
-
(d =
|
|
146
|
+
(d = s.onFocus) == null || d.call(s, p), o.setHasFocusInside(!0);
|
|
147
147
|
}
|
|
148
148
|
}),
|
|
149
149
|
children: [
|
|
150
|
-
|
|
150
|
+
n,
|
|
151
151
|
t && /* @__PURE__ */ e("span", { className: "pl-2", children: t })
|
|
152
152
|
]
|
|
153
153
|
}
|
|
154
154
|
);
|
|
155
155
|
});
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
return /* @__PURE__ */ e("div", { className:
|
|
160
|
-
},
|
|
156
|
+
O.displayName = "MenuItem";
|
|
157
|
+
const Lt = ({ className: t, ...a }) => {
|
|
158
|
+
const n = v(t, "my-1 border-t border-border-medium");
|
|
159
|
+
return /* @__PURE__ */ e("div", { className: n, ...a });
|
|
160
|
+
}, Ot = ({
|
|
161
161
|
className: t,
|
|
162
162
|
viewBox: a,
|
|
163
|
-
spacing:
|
|
164
|
-
title:
|
|
163
|
+
spacing: n,
|
|
164
|
+
title: s,
|
|
165
165
|
monotone: r,
|
|
166
166
|
...o
|
|
167
167
|
}) => /* @__PURE__ */ e(
|
|
168
|
-
|
|
168
|
+
dt,
|
|
169
169
|
{
|
|
170
170
|
defaultViewBox: "0 0 384 512",
|
|
171
171
|
defaultClassName: "size-5",
|
|
172
172
|
viewBox: a,
|
|
173
173
|
className: t,
|
|
174
|
-
spacing:
|
|
175
|
-
title:
|
|
174
|
+
spacing: n,
|
|
175
|
+
title: s || "Close",
|
|
176
176
|
...o,
|
|
177
177
|
children: /* @__PURE__ */ e("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
|
|
178
178
|
}
|
|
179
|
-
), G = "panel", Q = "messagebox",
|
|
179
|
+
), G = "panel", Q = "messagebox", Dt = ({
|
|
180
180
|
className: t,
|
|
181
181
|
kind: a,
|
|
182
|
-
borderMode:
|
|
182
|
+
borderMode: n
|
|
183
183
|
}) => ({
|
|
184
184
|
main: v("prose prose-lighter flex flex-col bg-surface-medium", {
|
|
185
185
|
[`${le} h-full min-h-[95%] sm:h-auto sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: a === G,
|
|
@@ -187,56 +187,56 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
187
187
|
[`${de} rounded-lg border-2`]: a === Q,
|
|
188
188
|
[`${de} w-[95%] sm:w-[50%] md:max-w-2xl`]: a === Q && !t,
|
|
189
189
|
[`${t}`]: !!t,
|
|
190
|
-
"sm:border-border-dark":
|
|
191
|
-
"sm:border-border-accent":
|
|
192
|
-
"border-border-dark":
|
|
193
|
-
"border-border-accent":
|
|
190
|
+
"sm:border-border-dark": n === "dark" && a === G,
|
|
191
|
+
"sm:border-border-accent": n === "light" && a === G,
|
|
192
|
+
"border-border-dark": n === "dark" && a === Q,
|
|
193
|
+
"border-border-accent": n === "light" && a === Q
|
|
194
194
|
}),
|
|
195
195
|
content: "flex flex-grow flex-col py-2 sm:py-4 px-4",
|
|
196
196
|
footer: "flex flex-grow flex-col p-4",
|
|
197
197
|
header: "p-4 mb-0",
|
|
198
198
|
close: "p-4"
|
|
199
199
|
}), W = (t) => ct(
|
|
200
|
-
() => import("./index.7JJYsiGN.
|
|
200
|
+
() => import("./index.7JJYsiGN.fOXCGsQA.js").then((a) => ({
|
|
201
201
|
default: a[t]
|
|
202
202
|
}))
|
|
203
|
-
),
|
|
203
|
+
), _t = W("Modal"), zt = W("ModalClose"), Bt = W("ModalContent"), Vt = W("ModalDescription"), Pt = W("ModalHeading"), X = ({
|
|
204
204
|
open: t,
|
|
205
205
|
onOpenChange: a,
|
|
206
|
-
title:
|
|
207
|
-
children:
|
|
206
|
+
title: n,
|
|
207
|
+
children: s,
|
|
208
208
|
footer: r,
|
|
209
209
|
borderMode: o = "light",
|
|
210
210
|
kind: i = G,
|
|
211
|
-
className:
|
|
211
|
+
className: u
|
|
212
212
|
}) => {
|
|
213
|
-
const
|
|
214
|
-
return
|
|
215
|
-
t && (document.title =
|
|
216
|
-
}), [
|
|
213
|
+
const p = U(""), d = Dt({ className: u, kind: i, borderMode: o });
|
|
214
|
+
return L(() => (t && (p.current = document.title, document.title = `${n} | ${p.current}`), () => {
|
|
215
|
+
t && (document.title = p.current);
|
|
216
|
+
}), [n, t]), /* @__PURE__ */ e(ot, { fallback: /* @__PURE__ */ e("div", {}), children: t && /* @__PURE__ */ e(_t, { open: t, onOpenChange: a, children: /* @__PURE__ */ c(Bt, { className: d.main, children: [
|
|
217
217
|
/* @__PURE__ */ c("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
|
218
218
|
/* @__PURE__ */ e(
|
|
219
|
-
|
|
219
|
+
zt,
|
|
220
220
|
{
|
|
221
221
|
className: d.close,
|
|
222
222
|
trigger: /* @__PURE__ */ e(
|
|
223
|
-
|
|
223
|
+
D,
|
|
224
224
|
{
|
|
225
225
|
mode: "dark",
|
|
226
226
|
focusMode: "light",
|
|
227
227
|
noBorder: !0,
|
|
228
228
|
label: "Close",
|
|
229
|
-
children: /* @__PURE__ */ e(
|
|
229
|
+
children: /* @__PURE__ */ e(Ot, {})
|
|
230
230
|
}
|
|
231
231
|
)
|
|
232
232
|
}
|
|
233
233
|
),
|
|
234
|
-
/* @__PURE__ */ e(
|
|
234
|
+
/* @__PURE__ */ e(Pt, { className: d.header, children: n })
|
|
235
235
|
] }),
|
|
236
|
-
/* @__PURE__ */ e(
|
|
236
|
+
/* @__PURE__ */ e(Vt, { className: d.content, children: s }),
|
|
237
237
|
r && /* @__PURE__ */ e("div", { className: d.footer, children: r })
|
|
238
238
|
] }) }) });
|
|
239
|
-
},
|
|
239
|
+
}, Ft = () => v("peer", "h-6", "w-11", "rounded-full"), Gt = ({
|
|
240
240
|
focusMode: t
|
|
241
241
|
}) => v(
|
|
242
242
|
"peer-focus:outline",
|
|
@@ -248,14 +248,14 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
248
248
|
"peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": t === "alt-system",
|
|
249
249
|
"peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": t === "system"
|
|
250
250
|
}
|
|
251
|
-
),
|
|
251
|
+
), $t = () => v(
|
|
252
252
|
"peer-checked:after:translate-x-full",
|
|
253
253
|
// background color when checked
|
|
254
254
|
"peer-checked:bg-violet-500",
|
|
255
255
|
// knob circle and border color when checked
|
|
256
256
|
"peer-checked:after:bg-white",
|
|
257
257
|
"peer-checked:after:border-white"
|
|
258
|
-
),
|
|
258
|
+
), Ut = () => v(
|
|
259
259
|
"after:left-[2px]",
|
|
260
260
|
"after:top-[2px]",
|
|
261
261
|
"after:border",
|
|
@@ -267,7 +267,7 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
267
267
|
"after:rounded-full",
|
|
268
268
|
"after:transition-all",
|
|
269
269
|
"after:content-['']"
|
|
270
|
-
),
|
|
270
|
+
), jt = ({
|
|
271
271
|
mode: t,
|
|
272
272
|
noBorder: a
|
|
273
273
|
}) => v({
|
|
@@ -276,7 +276,7 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
276
276
|
"border-border-light bg-surface-darker": t === "dark",
|
|
277
277
|
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": t === "alt-system",
|
|
278
278
|
"border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": t === "system"
|
|
279
|
-
}),
|
|
279
|
+
}), Yt = ({
|
|
280
280
|
mode: t,
|
|
281
281
|
labelHidden: a
|
|
282
282
|
}) => a ? "sr-only" : v("ml-2 text-sm", {
|
|
@@ -284,46 +284,46 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
284
284
|
"text-copy-lighter": t === "dark",
|
|
285
285
|
"text-copy-lighter dark:text-copy-dark": t === "alt-system",
|
|
286
286
|
"text-copy-dark dark:text-copy-lighter": t === "system"
|
|
287
|
-
}),
|
|
287
|
+
}), Kt = ({ spacing: t }) => v(
|
|
288
288
|
De,
|
|
289
289
|
"relative flex cursor-pointer items-center",
|
|
290
290
|
_e(t)
|
|
291
|
-
),
|
|
291
|
+
), Wt = ({
|
|
292
292
|
mode: t,
|
|
293
293
|
focusMode: a,
|
|
294
|
-
labelHidden:
|
|
295
|
-
spacing:
|
|
294
|
+
labelHidden: n,
|
|
295
|
+
spacing: s,
|
|
296
296
|
noBorder: r
|
|
297
297
|
}) => ({
|
|
298
298
|
toggle: v(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
Ft(),
|
|
300
|
+
jt({ mode: t, noBorder: r }),
|
|
301
|
+
Gt({ focusMode: a }),
|
|
302
|
+
Ut(),
|
|
303
|
+
$t()
|
|
304
304
|
),
|
|
305
|
-
label:
|
|
305
|
+
label: Yt({ mode: t, labelHidden: n }),
|
|
306
306
|
input: "peer sr-only",
|
|
307
|
-
wrapper:
|
|
308
|
-
}),
|
|
307
|
+
wrapper: Kt({ spacing: s })
|
|
308
|
+
}), Xt = ({
|
|
309
309
|
checked: t = !1,
|
|
310
310
|
onChange: a,
|
|
311
|
-
label:
|
|
312
|
-
labelHidden:
|
|
311
|
+
label: n,
|
|
312
|
+
labelHidden: s = !1,
|
|
313
313
|
name: r,
|
|
314
314
|
mode: o = "system",
|
|
315
315
|
focusMode: i = "system",
|
|
316
|
-
spacing:
|
|
317
|
-
noBorder:
|
|
316
|
+
spacing: u,
|
|
317
|
+
noBorder: p = !1
|
|
318
318
|
}) => {
|
|
319
|
-
const d =
|
|
319
|
+
const d = Wt({
|
|
320
320
|
mode: o,
|
|
321
321
|
focusMode: i,
|
|
322
|
-
labelHidden:
|
|
323
|
-
spacing:
|
|
324
|
-
noBorder:
|
|
325
|
-
}),
|
|
326
|
-
a == null || a(
|
|
322
|
+
labelHidden: s,
|
|
323
|
+
spacing: u,
|
|
324
|
+
noBorder: p
|
|
325
|
+
}), l = (C) => {
|
|
326
|
+
a == null || a(C.target.checked);
|
|
327
327
|
};
|
|
328
328
|
return /* @__PURE__ */ c("label", { className: d.wrapper, children: [
|
|
329
329
|
/* @__PURE__ */ e(
|
|
@@ -333,17 +333,17 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
333
333
|
checked: t,
|
|
334
334
|
type: "checkbox",
|
|
335
335
|
className: d.input,
|
|
336
|
-
onChange:
|
|
336
|
+
onChange: l
|
|
337
337
|
}
|
|
338
338
|
),
|
|
339
339
|
/* @__PURE__ */ e("div", { className: d.toggle }),
|
|
340
|
-
/* @__PURE__ */ e("span", { className: d.label, children:
|
|
340
|
+
/* @__PURE__ */ e("span", { className: d.label, children: n })
|
|
341
341
|
] });
|
|
342
|
-
},
|
|
342
|
+
}, Jt = ({
|
|
343
343
|
className: t,
|
|
344
344
|
viewBox: a,
|
|
345
|
-
spacing:
|
|
346
|
-
title:
|
|
345
|
+
spacing: n,
|
|
346
|
+
title: s,
|
|
347
347
|
monotone: r,
|
|
348
348
|
...o
|
|
349
349
|
}) => /* @__PURE__ */ c(
|
|
@@ -353,8 +353,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
353
353
|
defaultClassName: "size-5",
|
|
354
354
|
viewBox: a,
|
|
355
355
|
className: t,
|
|
356
|
-
spacing:
|
|
357
|
-
title:
|
|
356
|
+
spacing: n,
|
|
357
|
+
title: s || "Back",
|
|
358
358
|
...o,
|
|
359
359
|
children: [
|
|
360
360
|
/* @__PURE__ */ e(
|
|
@@ -367,11 +367,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
367
367
|
/* @__PURE__ */ e("path", { d: "M32 0H192c17.7 0 32 14.3 32 32s-14.3 32-32 32H109.3L342.6 297.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L64 109.3V192c0 17.7-14.3 32-32 32s-32-14.3-32-32V32C0 14.3 14.3 0 32 0z" })
|
|
368
368
|
]
|
|
369
369
|
}
|
|
370
|
-
),
|
|
370
|
+
), qt = ({
|
|
371
371
|
className: t,
|
|
372
372
|
viewBox: a,
|
|
373
|
-
spacing:
|
|
374
|
-
title:
|
|
373
|
+
spacing: n,
|
|
374
|
+
title: s,
|
|
375
375
|
monotone: r,
|
|
376
376
|
...o
|
|
377
377
|
}) => /* @__PURE__ */ c(
|
|
@@ -381,8 +381,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
381
381
|
defaultClassName: "size-5",
|
|
382
382
|
viewBox: a,
|
|
383
383
|
className: t,
|
|
384
|
-
spacing:
|
|
385
|
-
title:
|
|
384
|
+
spacing: n,
|
|
385
|
+
title: s || "Chart",
|
|
386
386
|
...o,
|
|
387
387
|
children: [
|
|
388
388
|
/* @__PURE__ */ e(
|
|
@@ -395,11 +395,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
395
395
|
/* @__PURE__ */ e("path", { d: "M368 96c-26.5 0-48 21.5-48 48V432c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V144c0-26.5-21.5-48-48-48H368zM48 224c-26.5 0-48 21.5-48 48V432c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48H48z" })
|
|
396
396
|
]
|
|
397
397
|
}
|
|
398
|
-
),
|
|
398
|
+
), Qt = ({
|
|
399
399
|
className: t,
|
|
400
400
|
viewBox: a,
|
|
401
|
-
spacing:
|
|
402
|
-
title:
|
|
401
|
+
spacing: n,
|
|
402
|
+
title: s,
|
|
403
403
|
monotone: r,
|
|
404
404
|
...o
|
|
405
405
|
}) => /* @__PURE__ */ c(
|
|
@@ -409,8 +409,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
409
409
|
defaultClassName: "size-5",
|
|
410
410
|
viewBox: a,
|
|
411
411
|
className: t,
|
|
412
|
-
spacing:
|
|
413
|
-
title:
|
|
412
|
+
spacing: n,
|
|
413
|
+
title: s || "Delete",
|
|
414
414
|
...o,
|
|
415
415
|
children: [
|
|
416
416
|
/* @__PURE__ */ e(
|
|
@@ -423,11 +423,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
423
423
|
/* @__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 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8z" })
|
|
424
424
|
]
|
|
425
425
|
}
|
|
426
|
-
),
|
|
426
|
+
), Zt = ({
|
|
427
427
|
className: t,
|
|
428
428
|
viewBox: a,
|
|
429
|
-
spacing:
|
|
430
|
-
title:
|
|
429
|
+
spacing: n,
|
|
430
|
+
title: s,
|
|
431
431
|
monotone: r,
|
|
432
432
|
...o
|
|
433
433
|
}) => /* @__PURE__ */ c(
|
|
@@ -437,8 +437,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
437
437
|
defaultClassName: "size-5",
|
|
438
438
|
viewBox: a,
|
|
439
439
|
className: t,
|
|
440
|
-
spacing:
|
|
441
|
-
title:
|
|
440
|
+
spacing: n,
|
|
441
|
+
title: s || "History",
|
|
442
442
|
...o,
|
|
443
443
|
children: [
|
|
444
444
|
/* @__PURE__ */ e(
|
|
@@ -451,11 +451,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
451
451
|
/* @__PURE__ */ e("path", { d: "M256 128c13.3 0 24 10.7 24 24v94.1l65 65c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72c-4.5-4.5-7-10.6-7-17V152c0-13.3 10.7-24 24-24z" })
|
|
452
452
|
]
|
|
453
453
|
}
|
|
454
|
-
),
|
|
454
|
+
), ea = ({
|
|
455
455
|
className: t,
|
|
456
456
|
viewBox: a,
|
|
457
|
-
spacing:
|
|
458
|
-
title:
|
|
457
|
+
spacing: n,
|
|
458
|
+
title: s,
|
|
459
459
|
monotone: r,
|
|
460
460
|
...o
|
|
461
461
|
}) => /* @__PURE__ */ c(
|
|
@@ -465,8 +465,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
465
465
|
defaultClassName: "size-5",
|
|
466
466
|
viewBox: a,
|
|
467
467
|
className: t,
|
|
468
|
-
spacing:
|
|
469
|
-
title:
|
|
468
|
+
spacing: n,
|
|
469
|
+
title: s || "Info",
|
|
470
470
|
...o,
|
|
471
471
|
children: [
|
|
472
472
|
/* @__PURE__ */ e(
|
|
@@ -479,11 +479,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
479
479
|
/* @__PURE__ */ e("path", { d: "M256 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM192 248c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h24V272H216c-13.3 0-24-10.7-24-24z" })
|
|
480
480
|
]
|
|
481
481
|
}
|
|
482
|
-
),
|
|
482
|
+
), ta = ({
|
|
483
483
|
className: t,
|
|
484
484
|
viewBox: a,
|
|
485
|
-
spacing:
|
|
486
|
-
title:
|
|
485
|
+
spacing: n,
|
|
486
|
+
title: s,
|
|
487
487
|
monotone: r,
|
|
488
488
|
...o
|
|
489
489
|
}) => /* @__PURE__ */ c(
|
|
@@ -493,8 +493,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
493
493
|
defaultClassName: "size-5",
|
|
494
494
|
viewBox: a,
|
|
495
495
|
className: t,
|
|
496
|
-
spacing:
|
|
497
|
-
title:
|
|
496
|
+
spacing: n,
|
|
497
|
+
title: s || "Profile",
|
|
498
498
|
...o,
|
|
499
499
|
children: [
|
|
500
500
|
/* @__PURE__ */ e(
|
|
@@ -510,8 +510,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
510
510
|
), pe = ({
|
|
511
511
|
className: t,
|
|
512
512
|
viewBox: a,
|
|
513
|
-
spacing:
|
|
514
|
-
title:
|
|
513
|
+
spacing: n,
|
|
514
|
+
title: s,
|
|
515
515
|
monotone: r,
|
|
516
516
|
...o
|
|
517
517
|
}) => /* @__PURE__ */ c(
|
|
@@ -521,8 +521,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
521
521
|
defaultClassName: "size-5",
|
|
522
522
|
viewBox: a,
|
|
523
523
|
className: t,
|
|
524
|
-
spacing:
|
|
525
|
-
title:
|
|
524
|
+
spacing: n,
|
|
525
|
+
title: s || "Refresh",
|
|
526
526
|
...o,
|
|
527
527
|
children: [
|
|
528
528
|
/* @__PURE__ */ e(
|
|
@@ -542,11 +542,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
542
542
|
)
|
|
543
543
|
]
|
|
544
544
|
}
|
|
545
|
-
),
|
|
545
|
+
), aa = ({
|
|
546
546
|
className: t,
|
|
547
547
|
viewBox: a,
|
|
548
|
-
spacing:
|
|
549
|
-
title:
|
|
548
|
+
spacing: n,
|
|
549
|
+
title: s,
|
|
550
550
|
monotone: r,
|
|
551
551
|
...o
|
|
552
552
|
}) => /* @__PURE__ */ c(
|
|
@@ -556,8 +556,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
556
556
|
defaultClassName: "size-5",
|
|
557
557
|
viewBox: a,
|
|
558
558
|
className: t,
|
|
559
|
-
spacing:
|
|
560
|
-
title:
|
|
559
|
+
spacing: n,
|
|
560
|
+
title: s || "Restore",
|
|
561
561
|
...o,
|
|
562
562
|
children: [
|
|
563
563
|
/* @__PURE__ */ e(
|
|
@@ -570,11 +570,11 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
570
570
|
/* @__PURE__ */ e("path", { d: "M64 128c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H64zm32 64H288c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32z" })
|
|
571
571
|
]
|
|
572
572
|
}
|
|
573
|
-
),
|
|
573
|
+
), na = ({
|
|
574
574
|
className: t,
|
|
575
575
|
viewBox: a,
|
|
576
|
-
spacing:
|
|
577
|
-
title:
|
|
576
|
+
spacing: n,
|
|
577
|
+
title: s,
|
|
578
578
|
monotone: r,
|
|
579
579
|
...o
|
|
580
580
|
}) => /* @__PURE__ */ e(
|
|
@@ -584,8 +584,8 @@ const Rt = ({ className: t, ...a }) => {
|
|
|
584
584
|
defaultClassName: "size-5",
|
|
585
585
|
viewBox: a,
|
|
586
586
|
className: t,
|
|
587
|
-
spacing:
|
|
588
|
-
title:
|
|
587
|
+
spacing: n,
|
|
588
|
+
title: s || "Settings",
|
|
589
589
|
...o,
|
|
590
590
|
children: /* @__PURE__ */ e("path", { d: "M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z" })
|
|
591
591
|
}
|
|
@@ -594,112 +594,112 @@ function j(t) {
|
|
|
594
594
|
return it();
|
|
595
595
|
}
|
|
596
596
|
const sa = ({ stats: t }) => {
|
|
597
|
-
const a = (t == null ? void 0 : t.plugins) || [],
|
|
598
|
-
return /* @__PURE__ */ c(
|
|
597
|
+
const a = (t == null ? void 0 : t.plugins) || [], n = (t == null ? void 0 : t.version) || "", s = (t == null ? void 0 : t.models) || [], r = j(), o = j();
|
|
598
|
+
return /* @__PURE__ */ c(k, { children: [
|
|
599
599
|
/* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e(
|
|
600
|
-
|
|
600
|
+
_,
|
|
601
601
|
{
|
|
602
|
-
header:
|
|
602
|
+
header: g.ABOUT.TITLE_CLIENT,
|
|
603
603
|
className: "prose-dark dark:prose-lighter",
|
|
604
604
|
children: $(r, {
|
|
605
|
-
[
|
|
606
|
-
[
|
|
605
|
+
[g.ABOUT.VERSION]: "4.0.5",
|
|
606
|
+
[g.ABOUT.BUILD_TIMESTAMP]: "08/31/2024 06:21 PM EDT"
|
|
607
607
|
})
|
|
608
608
|
}
|
|
609
609
|
) }),
|
|
610
610
|
/* @__PURE__ */ e(
|
|
611
|
-
|
|
611
|
+
_,
|
|
612
612
|
{
|
|
613
|
-
header:
|
|
613
|
+
header: g.ABOUT.TITLE_SERVER,
|
|
614
614
|
className: "prose-dark dark:prose-lighter",
|
|
615
615
|
children: $(o, {
|
|
616
|
-
[
|
|
617
|
-
[Z(
|
|
618
|
-
[Z(
|
|
616
|
+
[g.ABOUT.VERSION]: n,
|
|
617
|
+
[Z(g.ABOUT.ENGINE, s.length)]: /* @__PURE__ */ e(k, { children: s.map((i) => /* @__PURE__ */ e("div", { className: "text-right", children: i }, i)) }),
|
|
618
|
+
[Z(g.ABOUT.PLUGIN, a.length)]: /* @__PURE__ */ e(k, { children: a.map((i) => /* @__PURE__ */ e("div", { className: "text-right", children: i }, i)) })
|
|
619
619
|
})
|
|
620
620
|
}
|
|
621
621
|
)
|
|
622
622
|
] });
|
|
623
|
-
},
|
|
623
|
+
}, ra = ({
|
|
624
624
|
open: t,
|
|
625
625
|
onOpenChange: a
|
|
626
626
|
}) => {
|
|
627
|
-
const { serverStats:
|
|
628
|
-
return /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: ze, children: /* @__PURE__ */ e(sa, { stats:
|
|
629
|
-
},
|
|
627
|
+
const { serverStats: n } = R(K);
|
|
628
|
+
return /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: ze, children: /* @__PURE__ */ e(sa, { stats: n }) });
|
|
629
|
+
}, oa = (t) => Ce(t), ca = (t) => {
|
|
630
630
|
if (!t || t.length === 0)
|
|
631
631
|
return Pe;
|
|
632
632
|
const a = t.filter(
|
|
633
|
-
(
|
|
634
|
-
var
|
|
635
|
-
return ((
|
|
633
|
+
(n) => {
|
|
634
|
+
var s, r;
|
|
635
|
+
return ((s = n == null ? void 0 : n.message) == null ? void 0 : s.role) === Fe && typeof ((r = n == null ? void 0 : n.message) == null ? void 0 : r.processingTime) == "number";
|
|
636
636
|
}
|
|
637
|
-
).map((
|
|
637
|
+
).map((n) => n.message.processingTime);
|
|
638
638
|
return Ge({
|
|
639
639
|
data: a,
|
|
640
|
-
formatter:
|
|
640
|
+
formatter: oa
|
|
641
641
|
});
|
|
642
|
-
},
|
|
642
|
+
}, ia = ({
|
|
643
643
|
isAuthenticated: t,
|
|
644
644
|
stats: a
|
|
645
645
|
}) => {
|
|
646
|
-
const { state:
|
|
647
|
-
return t ? /* @__PURE__ */ c(
|
|
648
|
-
|
|
649
|
-
|
|
646
|
+
const { state: n } = R(K), s = $e - Number(n == null ? void 0 : n.usage), r = j(), o = j();
|
|
647
|
+
return t ? /* @__PURE__ */ c(k, { children: [
|
|
648
|
+
n && n.messages.length > 0 && /* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e(
|
|
649
|
+
_,
|
|
650
650
|
{
|
|
651
|
-
header:
|
|
651
|
+
header: g.CURRENT_STATISTICS.TITLE,
|
|
652
652
|
className: "prose-dark dark:prose-lighter",
|
|
653
653
|
children: $(r, {
|
|
654
|
-
[
|
|
655
|
-
[
|
|
656
|
-
[
|
|
657
|
-
[
|
|
654
|
+
[g.CURRENT_STATISTICS.MODEL_NAME]: (n == null ? void 0 : n.model) || Be,
|
|
655
|
+
[g.CURRENT_STATISTICS.TOKENS_USED]: n == null ? void 0 : n.usage,
|
|
656
|
+
[g.CURRENT_STATISTICS.REMAINING_TOKENS]: Ve.format(s),
|
|
657
|
+
[g.CURRENT_STATISTICS.PROCESSING_TIME]: ca(n == null ? void 0 : n.messages)
|
|
658
658
|
})
|
|
659
659
|
}
|
|
660
660
|
) }),
|
|
661
661
|
/* @__PURE__ */ e(
|
|
662
|
-
|
|
662
|
+
_,
|
|
663
663
|
{
|
|
664
|
-
header:
|
|
664
|
+
header: g.MAIN_STATISTICS.TITLE,
|
|
665
665
|
className: "prose-dark dark:prose-lighter",
|
|
666
666
|
children: $(o, {
|
|
667
|
-
[Z(
|
|
668
|
-
[
|
|
667
|
+
[Z(g.MAIN_STATISTICS.TOTAL, a.totalChats)]: a.totalChats,
|
|
668
|
+
[g.MAIN_STATISTICS.PROCESSING_TIME]: Ce(
|
|
669
669
|
a.averageProcessingTimes
|
|
670
670
|
)
|
|
671
671
|
})
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
674
|
] }) : null;
|
|
675
|
-
},
|
|
675
|
+
}, la = ({
|
|
676
676
|
open: t,
|
|
677
677
|
onOpenChange: a
|
|
678
678
|
}) => {
|
|
679
|
-
const [
|
|
679
|
+
const [n, s] = y({
|
|
680
680
|
averageProcessingTimes: 0,
|
|
681
681
|
totalChats: 0
|
|
682
682
|
}), { isAuthenticated: r, getAccessToken: o, user: i } = Y();
|
|
683
|
-
return
|
|
683
|
+
return L(() => {
|
|
684
684
|
!t || !i || (async () => {
|
|
685
685
|
try {
|
|
686
|
-
const
|
|
686
|
+
const u = await ne({
|
|
687
687
|
accessToken: await o(),
|
|
688
|
-
type:
|
|
688
|
+
type: se.GET_CHATS_STATS,
|
|
689
689
|
params: {
|
|
690
690
|
userId: i.username
|
|
691
691
|
}
|
|
692
692
|
});
|
|
693
|
-
|
|
693
|
+
u.status === 200 && s(u.data);
|
|
694
694
|
} catch {
|
|
695
695
|
}
|
|
696
696
|
})();
|
|
697
|
-
}, [t, o, i]), /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: Ne, children: /* @__PURE__ */ e(
|
|
697
|
+
}, [t, o, i]), /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: Ne, children: /* @__PURE__ */ e(ia, { isAuthenticated: r, stats: n }) });
|
|
698
698
|
}, Ee = ({
|
|
699
699
|
showConfirmation: t,
|
|
700
700
|
setShowConfirmation: a,
|
|
701
|
-
action:
|
|
702
|
-
children:
|
|
701
|
+
action: n,
|
|
702
|
+
children: s,
|
|
703
703
|
customStrings: r
|
|
704
704
|
}) => /* @__PURE__ */ e(
|
|
705
705
|
X,
|
|
@@ -728,33 +728,33 @@ const sa = ({ stats: t }) => {
|
|
|
728
728
|
variant: "danger",
|
|
729
729
|
focusMode: "light",
|
|
730
730
|
onClick: () => {
|
|
731
|
-
a(!1),
|
|
731
|
+
a(!1), n();
|
|
732
732
|
},
|
|
733
733
|
children: r.confirmAction
|
|
734
734
|
}
|
|
735
735
|
) })
|
|
736
736
|
] }),
|
|
737
|
-
children:
|
|
737
|
+
children: s
|
|
738
738
|
}
|
|
739
739
|
);
|
|
740
|
-
var
|
|
741
|
-
return
|
|
742
|
-
},
|
|
743
|
-
var
|
|
744
|
-
return
|
|
745
|
-
var o = !0, i = window.matchMedia(t),
|
|
740
|
+
var da = typeof window < "u", ma = function(t, a) {
|
|
741
|
+
return da ? window.matchMedia(t).matches : (process.env.NODE_ENV !== "production" && console.warn("`useMedia` When server side rendering, defaultState should be defined to prevent a hydration mismatches."), !1);
|
|
742
|
+
}, ua = function(t, a) {
|
|
743
|
+
var n = y(ma(t)), s = n[0], r = n[1];
|
|
744
|
+
return L(function() {
|
|
745
|
+
var o = !0, i = window.matchMedia(t), u = function() {
|
|
746
746
|
o && r(!!i.matches);
|
|
747
747
|
};
|
|
748
|
-
return i.addEventListener("change",
|
|
749
|
-
o = !1, i.removeEventListener("change",
|
|
748
|
+
return i.addEventListener("change", u), r(i.matches), function() {
|
|
749
|
+
o = !1, i.removeEventListener("change", u);
|
|
750
750
|
};
|
|
751
|
-
}, [t]),
|
|
751
|
+
}, [t]), s;
|
|
752
752
|
};
|
|
753
|
-
const
|
|
753
|
+
const ha = async (t, a, n, s) => {
|
|
754
754
|
try {
|
|
755
|
-
const r = await
|
|
756
|
-
accessToken:
|
|
757
|
-
type:
|
|
755
|
+
const r = await ne({
|
|
756
|
+
accessToken: s,
|
|
757
|
+
type: se.GET_CHAT,
|
|
758
758
|
params: {
|
|
759
759
|
id: t.id
|
|
760
760
|
}
|
|
@@ -769,45 +769,44 @@ const ua = async (t, a, s, n) => {
|
|
|
769
769
|
usage: r.data.usage,
|
|
770
770
|
messages: r.data.messages
|
|
771
771
|
}
|
|
772
|
-
}),
|
|
772
|
+
}), n(!1));
|
|
773
773
|
} catch {
|
|
774
774
|
}
|
|
775
775
|
}, fe = (t) => {
|
|
776
776
|
const a = t[0];
|
|
777
777
|
return Ke(a == null ? void 0 : a.content, 100);
|
|
778
|
-
},
|
|
778
|
+
}, pa = ({
|
|
779
779
|
filteredHistory: t,
|
|
780
780
|
setFilteredHistory: a,
|
|
781
|
-
setFullHistory: s,
|
|
782
781
|
dispatch: n,
|
|
783
|
-
onOpenChange:
|
|
782
|
+
onOpenChange: s
|
|
784
783
|
}) => {
|
|
785
|
-
var
|
|
786
|
-
const { user:
|
|
784
|
+
var f;
|
|
785
|
+
const { user: r, getAccessToken: o } = Y(), i = U({
|
|
787
786
|
id: 0,
|
|
788
787
|
timestamp: "",
|
|
789
788
|
message: ""
|
|
790
|
-
}), [
|
|
789
|
+
}), [u, p] = y(!1), d = ua("(min-width: 480px)"), { state: l, dispatch: C } = R(ye), [, b] = ae({
|
|
791
790
|
key: te + Ue,
|
|
792
|
-
initialValue:
|
|
793
|
-
}),
|
|
794
|
-
(m,
|
|
795
|
-
switch (
|
|
791
|
+
initialValue: l.sortDirection
|
|
792
|
+
}), w = t.data.sort(
|
|
793
|
+
(m, N) => {
|
|
794
|
+
switch (l.sortedCell) {
|
|
796
795
|
case "timestamp":
|
|
797
|
-
if (
|
|
798
|
-
return new Date(m[
|
|
799
|
-
if (
|
|
800
|
-
return new Date(
|
|
796
|
+
if (l.sortDirection === I.ASC)
|
|
797
|
+
return new Date(m[l.sortedCell]).getTime() - new Date(N[l.sortedCell]).getTime();
|
|
798
|
+
if (l.sortDirection === I.DESC)
|
|
799
|
+
return new Date(N[l.sortedCell]).getTime() - new Date(m[l.sortedCell]).getTime();
|
|
801
800
|
break;
|
|
802
801
|
default:
|
|
803
802
|
return 0;
|
|
804
803
|
}
|
|
805
804
|
return 0;
|
|
806
805
|
}
|
|
807
|
-
),
|
|
808
|
-
switch (
|
|
806
|
+
), h = (m) => {
|
|
807
|
+
switch (l.sortDirection) {
|
|
809
808
|
case !1:
|
|
810
|
-
|
|
809
|
+
b(I.ASC), C({
|
|
811
810
|
type: re,
|
|
812
811
|
payload: {
|
|
813
812
|
sortedCell: m,
|
|
@@ -816,7 +815,7 @@ const ua = async (t, a, s, n) => {
|
|
|
816
815
|
});
|
|
817
816
|
break;
|
|
818
817
|
case I.ASC:
|
|
819
|
-
|
|
818
|
+
b(I.DESC), C({
|
|
820
819
|
type: re,
|
|
821
820
|
payload: {
|
|
822
821
|
sortedCell: m,
|
|
@@ -825,7 +824,7 @@ const ua = async (t, a, s, n) => {
|
|
|
825
824
|
});
|
|
826
825
|
break;
|
|
827
826
|
default:
|
|
828
|
-
|
|
827
|
+
b(I.ASC), C({
|
|
829
828
|
type: re,
|
|
830
829
|
payload: {
|
|
831
830
|
sortedCell: m,
|
|
@@ -835,24 +834,24 @@ const ua = async (t, a, s, n) => {
|
|
|
835
834
|
break;
|
|
836
835
|
}
|
|
837
836
|
};
|
|
838
|
-
return /* @__PURE__ */ c(
|
|
837
|
+
return /* @__PURE__ */ c(k, { children: [
|
|
839
838
|
/* @__PURE__ */ c(
|
|
840
839
|
Ee,
|
|
841
840
|
{
|
|
842
|
-
showConfirmation:
|
|
843
|
-
setShowConfirmation:
|
|
841
|
+
showConfirmation: u,
|
|
842
|
+
setShowConfirmation: p,
|
|
844
843
|
action: async () => {
|
|
845
|
-
const m =
|
|
844
|
+
const m = i.current;
|
|
846
845
|
try {
|
|
847
|
-
const
|
|
848
|
-
accessToken: await
|
|
849
|
-
type:
|
|
846
|
+
const N = await ne({
|
|
847
|
+
accessToken: await o(),
|
|
848
|
+
type: se.DELETE_CHAT,
|
|
850
849
|
params: {
|
|
851
|
-
userId: (
|
|
850
|
+
userId: (r == null ? void 0 : r.username) || "",
|
|
852
851
|
id: m.id
|
|
853
852
|
}
|
|
854
853
|
});
|
|
855
|
-
|
|
854
|
+
N.status === 200 && a({ data: N.data });
|
|
856
855
|
} catch {
|
|
857
856
|
}
|
|
858
857
|
},
|
|
@@ -867,29 +866,29 @@ const ua = async (t, a, s, n) => {
|
|
|
867
866
|
/* @__PURE__ */ c("li", { children: [
|
|
868
867
|
"Timestamp:",
|
|
869
868
|
" ",
|
|
870
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children:
|
|
869
|
+
/* @__PURE__ */ e("span", { className: "text-lg", children: i.current && i.current.timestamp })
|
|
871
870
|
] }),
|
|
872
871
|
/* @__PURE__ */ c("li", { children: [
|
|
873
872
|
"First message:",
|
|
874
873
|
" ",
|
|
875
|
-
/* @__PURE__ */ e("span", { className: "text-lg", children: (
|
|
874
|
+
/* @__PURE__ */ e("span", { className: "text-lg", children: (f = i.current) == null ? void 0 : f.message })
|
|
876
875
|
] })
|
|
877
876
|
] })
|
|
878
877
|
]
|
|
879
878
|
}
|
|
880
879
|
),
|
|
881
|
-
/* @__PURE__ */ c(
|
|
882
|
-
/* @__PURE__ */ e(
|
|
883
|
-
|
|
880
|
+
/* @__PURE__ */ c(mt, { stickyHeader: !0, stickyFooter: !0, wrapperClassName: "max-h-[60vh]", children: [
|
|
881
|
+
/* @__PURE__ */ e(ut, { children: /* @__PURE__ */ c(oe, { children: [
|
|
882
|
+
d && /* @__PURE__ */ e(M, { className: "sr-only", children: "Row" }),
|
|
884
883
|
/* @__PURE__ */ e(
|
|
885
|
-
|
|
884
|
+
ht,
|
|
886
885
|
{
|
|
887
886
|
cellId: "timestamp",
|
|
888
887
|
align: "left",
|
|
889
|
-
sortDirection:
|
|
890
|
-
sortedCell:
|
|
888
|
+
sortDirection: l.sortDirection,
|
|
889
|
+
sortedCell: l.sortedCell,
|
|
891
890
|
onClick: () => {
|
|
892
|
-
|
|
891
|
+
h("timestamp");
|
|
893
892
|
},
|
|
894
893
|
children: "Date"
|
|
895
894
|
}
|
|
@@ -897,10 +896,10 @@ const ua = async (t, a, s, n) => {
|
|
|
897
896
|
/* @__PURE__ */ e(M, { children: "First message" }),
|
|
898
897
|
/* @__PURE__ */ e(M, { className: "text-right", children: "Actions" })
|
|
899
898
|
] }) }),
|
|
900
|
-
/* @__PURE__ */ e(
|
|
901
|
-
var
|
|
902
|
-
return ((
|
|
903
|
-
|
|
899
|
+
/* @__PURE__ */ e(pt, { children: w.map((m, N) => {
|
|
900
|
+
var T;
|
|
901
|
+
return ((T = m == null ? void 0 : m.messages) == null ? void 0 : T.length) > 0 ? /* @__PURE__ */ c(oe, { children: [
|
|
902
|
+
d && /* @__PURE__ */ e(M, { children: N + 1 }),
|
|
904
903
|
/* @__PURE__ */ e(
|
|
905
904
|
M,
|
|
906
905
|
{
|
|
@@ -913,43 +912,43 @@ const ua = async (t, a, s, n) => {
|
|
|
913
912
|
/* @__PURE__ */ e(M, { className: "max-w-[100px] text-white sm:max-w-full", children: fe(m.messages) }),
|
|
914
913
|
/* @__PURE__ */ e(M, { children: /* @__PURE__ */ c("div", { className: "flex justify-end gap-2", children: [
|
|
915
914
|
/* @__PURE__ */ e(
|
|
916
|
-
|
|
915
|
+
D,
|
|
917
916
|
{
|
|
918
917
|
focusMode: "alt-system",
|
|
919
918
|
noBorder: !0,
|
|
920
919
|
label: "Restore chat",
|
|
921
920
|
onClick: async () => {
|
|
922
|
-
const
|
|
923
|
-
|
|
921
|
+
const S = await o();
|
|
922
|
+
ha(
|
|
924
923
|
m,
|
|
925
924
|
n,
|
|
926
|
-
|
|
927
|
-
|
|
925
|
+
s,
|
|
926
|
+
S
|
|
928
927
|
);
|
|
929
928
|
},
|
|
930
|
-
children: /* @__PURE__ */ e(
|
|
929
|
+
children: /* @__PURE__ */ e(aa, { className: "h-3 w-3", monotone: !0 })
|
|
931
930
|
}
|
|
932
931
|
),
|
|
933
932
|
/* @__PURE__ */ e(
|
|
934
|
-
|
|
933
|
+
D,
|
|
935
934
|
{
|
|
936
935
|
focusMode: "alt-system",
|
|
937
936
|
noBorder: !0,
|
|
938
937
|
label: "Delete chat",
|
|
939
938
|
onClick: () => {
|
|
940
|
-
|
|
939
|
+
i.current = {
|
|
941
940
|
id: m.id,
|
|
942
941
|
timestamp: m.timestamp,
|
|
943
942
|
message: fe(m.messages)
|
|
944
|
-
},
|
|
943
|
+
}, p(!u);
|
|
945
944
|
},
|
|
946
|
-
children: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ e(
|
|
945
|
+
children: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ e(Qt, { className: "h-3 w-3", monotone: !0 }) })
|
|
947
946
|
}
|
|
948
947
|
)
|
|
949
948
|
] }) })
|
|
950
|
-
] }, `${
|
|
949
|
+
] }, `${g.HISTORY.TITLE}-${m.id}-${N}`) : null;
|
|
951
950
|
}) }),
|
|
952
|
-
/* @__PURE__ */ e(
|
|
951
|
+
/* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(M, { colSpan: 4, children: /* @__PURE__ */ e("div", { children: Z(
|
|
953
952
|
`${t.data.length} chat`,
|
|
954
953
|
t.data.length
|
|
955
954
|
) }) }) }) })
|
|
@@ -958,51 +957,51 @@ const ua = async (t, a, s, n) => {
|
|
|
958
957
|
};
|
|
959
958
|
function ge(t, a) {
|
|
960
959
|
return a ? t.filter(
|
|
961
|
-
(
|
|
962
|
-
(
|
|
960
|
+
(n) => n.messages.some(
|
|
961
|
+
(s) => s.content !== null && s.content.toLowerCase().includes(a.toLowerCase())
|
|
963
962
|
)
|
|
964
963
|
) : t;
|
|
965
964
|
}
|
|
966
|
-
const
|
|
965
|
+
const fa = ({
|
|
967
966
|
onOpenChange: t,
|
|
968
967
|
historyData: a
|
|
969
968
|
}) => {
|
|
970
|
-
const { isAuthenticated:
|
|
969
|
+
const { isAuthenticated: n } = Y(), s = U(null), { dispatch: r } = R(K), { state: o, dispatch: i } = R(ye), [, u] = ae({
|
|
971
970
|
key: te + We,
|
|
972
971
|
initialValue: o.searchString
|
|
973
|
-
}),
|
|
974
|
-
data:
|
|
975
|
-
}),
|
|
976
|
-
const
|
|
977
|
-
|
|
978
|
-
data:
|
|
979
|
-
}),
|
|
972
|
+
}), p = lt(() => a, [a]), [d, l] = y({
|
|
973
|
+
data: p
|
|
974
|
+
}), C = (h) => {
|
|
975
|
+
const x = ge(p, h);
|
|
976
|
+
l({
|
|
977
|
+
data: x
|
|
978
|
+
}), u(h), i({
|
|
980
979
|
type: Je,
|
|
981
|
-
payload: { searchString:
|
|
980
|
+
payload: { searchString: h }
|
|
982
981
|
});
|
|
983
|
-
},
|
|
984
|
-
|
|
985
|
-
},
|
|
986
|
-
|
|
982
|
+
}, b = (h) => {
|
|
983
|
+
C(h.target.value);
|
|
984
|
+
}, w = async (h) => {
|
|
985
|
+
h.preventDefault();
|
|
987
986
|
};
|
|
988
|
-
return
|
|
989
|
-
const
|
|
990
|
-
|
|
987
|
+
return L(() => {
|
|
988
|
+
const h = ge(
|
|
989
|
+
a,
|
|
991
990
|
o.searchString
|
|
992
991
|
);
|
|
993
|
-
|
|
994
|
-
data:
|
|
992
|
+
l({
|
|
993
|
+
data: h
|
|
995
994
|
});
|
|
996
|
-
}, [
|
|
997
|
-
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit:
|
|
995
|
+
}, [a, o.searchString]), n ? d && d.data && /* @__PURE__ */ c(k, { children: [
|
|
996
|
+
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: w, children: /* @__PURE__ */ e(
|
|
998
997
|
Xe,
|
|
999
998
|
{
|
|
1000
|
-
ref:
|
|
999
|
+
ref: s,
|
|
1001
1000
|
defaultValue: o.searchString,
|
|
1002
1001
|
focusMode: "light",
|
|
1003
1002
|
name: "Search",
|
|
1004
1003
|
label: "Search",
|
|
1005
|
-
onChange:
|
|
1004
|
+
onChange: b,
|
|
1006
1005
|
spacing: { t: 2, b: 2 },
|
|
1007
1006
|
...o.searchString && {
|
|
1008
1007
|
rightElement: /* @__PURE__ */ e(
|
|
@@ -1013,8 +1012,8 @@ const pa = ({
|
|
|
1013
1012
|
noBorder: !0,
|
|
1014
1013
|
size: "small",
|
|
1015
1014
|
onClick: () => {
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1015
|
+
var h;
|
|
1016
|
+
C(""), (h = s.current) != null && h.value && (s.current.value = "", s.current.focus());
|
|
1018
1017
|
},
|
|
1019
1018
|
children: "Reset"
|
|
1020
1019
|
}
|
|
@@ -1023,31 +1022,30 @@ const pa = ({
|
|
|
1023
1022
|
}
|
|
1024
1023
|
) }),
|
|
1025
1024
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2 sm:flex-row", children: /* @__PURE__ */ e(
|
|
1026
|
-
|
|
1025
|
+
pa,
|
|
1027
1026
|
{
|
|
1028
|
-
filteredHistory:
|
|
1029
|
-
setFilteredHistory:
|
|
1030
|
-
setFullHistory: d,
|
|
1027
|
+
filteredHistory: d,
|
|
1028
|
+
setFilteredHistory: l,
|
|
1031
1029
|
dispatch: r,
|
|
1032
1030
|
onOpenChange: t
|
|
1033
1031
|
}
|
|
1034
1032
|
) })
|
|
1035
1033
|
] }) : null;
|
|
1036
|
-
},
|
|
1034
|
+
}, ga = ({
|
|
1037
1035
|
open: t,
|
|
1038
1036
|
onOpenChange: a,
|
|
1039
|
-
historyData:
|
|
1040
|
-
}) => /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: qe, children: /* @__PURE__ */ e(
|
|
1041
|
-
const { isAuthenticated: t, user: a, registeringForPasskey:
|
|
1037
|
+
historyData: n
|
|
1038
|
+
}) => /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: qe, children: /* @__PURE__ */ e(fa, { onOpenChange: a, historyData: n }) }), Ca = () => {
|
|
1039
|
+
const { isAuthenticated: t, user: a, registeringForPasskey: n } = Y(), [s, r] = ae({
|
|
1042
1040
|
key: te + Qe,
|
|
1043
1041
|
initialValue: !1
|
|
1044
1042
|
}), [, o, i] = ae({
|
|
1045
1043
|
key: te + Ze,
|
|
1046
1044
|
initialValue: { latitude: 0, longitude: 0, accuracy: 0 }
|
|
1047
|
-
}), [
|
|
1045
|
+
}), [u, p] = y(!0), d = j(), { state: l, dispatch: C } = R(K), b = (a == null ? void 0 : a.username) || "", w = (f) => {
|
|
1048
1046
|
r(f);
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1047
|
+
}, h = async () => {
|
|
1048
|
+
p(!1), i(), C({
|
|
1051
1049
|
type: me,
|
|
1052
1050
|
payload: {
|
|
1053
1051
|
location: {
|
|
@@ -1058,131 +1056,131 @@ const pa = ({
|
|
|
1058
1056
|
}
|
|
1059
1057
|
});
|
|
1060
1058
|
const f = await tt();
|
|
1061
|
-
o(f),
|
|
1059
|
+
o(f), C({
|
|
1062
1060
|
type: me,
|
|
1063
1061
|
payload: {
|
|
1064
1062
|
location: f
|
|
1065
1063
|
}
|
|
1066
1064
|
});
|
|
1067
1065
|
};
|
|
1068
|
-
|
|
1066
|
+
L(() => {
|
|
1069
1067
|
let f;
|
|
1070
|
-
return
|
|
1071
|
-
|
|
1068
|
+
return u || (f = window.setTimeout(() => {
|
|
1069
|
+
p(!0);
|
|
1072
1070
|
}, 3e3)), () => {
|
|
1073
1071
|
clearTimeout(f);
|
|
1074
1072
|
};
|
|
1075
|
-
}, [
|
|
1076
|
-
const
|
|
1077
|
-
const { city:
|
|
1078
|
-
if (
|
|
1079
|
-
return /* @__PURE__ */ e(
|
|
1080
|
-
/* @__PURE__ */ e(E, { children:
|
|
1073
|
+
}, [u]);
|
|
1074
|
+
const x = (f) => {
|
|
1075
|
+
const { city: m, state: N, country: T, displayName: S } = f || {};
|
|
1076
|
+
if (m && T && N || S)
|
|
1077
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(F, { alignVertical: "center", columnGap: 4, children: [
|
|
1078
|
+
/* @__PURE__ */ e(E, { children: m && N && T ? /* @__PURE__ */ c("div", { className: "mt-2", children: [
|
|
1081
1079
|
/* @__PURE__ */ c("div", { className: "text-right", children: [
|
|
1082
|
-
|
|
1080
|
+
m,
|
|
1083
1081
|
", ",
|
|
1084
|
-
|
|
1082
|
+
N
|
|
1085
1083
|
] }),
|
|
1086
|
-
/* @__PURE__ */ e("div", { className: "text-right", children:
|
|
1087
|
-
] }) :
|
|
1084
|
+
/* @__PURE__ */ e("div", { className: "text-right", children: T })
|
|
1085
|
+
] }) : S ? /* @__PURE__ */ e("div", { className: "mt-2 text-right", children: S }) : null }),
|
|
1088
1086
|
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
|
|
1089
|
-
|
|
1087
|
+
D,
|
|
1090
1088
|
{
|
|
1091
|
-
disabled: !
|
|
1089
|
+
disabled: !u,
|
|
1092
1090
|
size: "small",
|
|
1093
1091
|
className: "mt-2",
|
|
1094
|
-
onClick:
|
|
1092
|
+
onClick: h,
|
|
1095
1093
|
children: /* @__PURE__ */ e(pe, { className: "size-3", monotone: !0 })
|
|
1096
1094
|
}
|
|
1097
1095
|
) })
|
|
1098
1096
|
] }) });
|
|
1099
|
-
const
|
|
1100
|
-
return /* @__PURE__ */ e(
|
|
1097
|
+
const z = at(f == null ? void 0 : f.latitude), B = nt(f == null ? void 0 : f.longitude);
|
|
1098
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(F, { alignVertical: "center", columnGap: 4, children: [
|
|
1101
1099
|
/* @__PURE__ */ c(E, { children: [
|
|
1102
|
-
/* @__PURE__ */ e("div", { children:
|
|
1100
|
+
/* @__PURE__ */ e("div", { children: z }),
|
|
1103
1101
|
/* @__PURE__ */ e("div", { children: B })
|
|
1104
1102
|
] }),
|
|
1105
|
-
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
|
|
1103
|
+
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(D, { size: "small", onClick: h, children: /* @__PURE__ */ e(pe, { className: "size-3", monotone: !0 }) }) })
|
|
1106
1104
|
] }) });
|
|
1107
1105
|
};
|
|
1108
|
-
return t &&
|
|
1106
|
+
return t && b ? /* @__PURE__ */ c(k, { children: [
|
|
1109
1107
|
/* @__PURE__ */ e(
|
|
1110
|
-
|
|
1108
|
+
_,
|
|
1111
1109
|
{
|
|
1112
|
-
header:
|
|
1110
|
+
header: g.PREFERENCES.TITLE,
|
|
1113
1111
|
className: "prose-dark dark:prose-lighter",
|
|
1114
1112
|
children: $(d, {
|
|
1115
|
-
[
|
|
1116
|
-
[
|
|
1117
|
-
|
|
1113
|
+
[g.PREFERENCES.NAME]: b,
|
|
1114
|
+
[g.PREFERENCES.ENGINE_DETAILS]: /* @__PURE__ */ e(
|
|
1115
|
+
Xt,
|
|
1118
1116
|
{
|
|
1119
1117
|
noBorder: !0,
|
|
1120
1118
|
labelHidden: !0,
|
|
1121
|
-
label:
|
|
1122
|
-
name:
|
|
1123
|
-
onChange:
|
|
1124
|
-
checked:
|
|
1119
|
+
label: g.PREFERENCES.ENGINE_DETAILS,
|
|
1120
|
+
name: g.PREFERENCES.ENGINE_DETAILS,
|
|
1121
|
+
onChange: w,
|
|
1122
|
+
checked: s
|
|
1125
1123
|
}
|
|
1126
1124
|
),
|
|
1127
|
-
[
|
|
1125
|
+
[g.PREFERENCES.LOCATION]: x(l == null ? void 0 : l.location)
|
|
1128
1126
|
})
|
|
1129
1127
|
}
|
|
1130
1128
|
),
|
|
1131
1129
|
/* @__PURE__ */ e(
|
|
1132
|
-
|
|
1130
|
+
_,
|
|
1133
1131
|
{
|
|
1134
1132
|
spacing: { t: 4 },
|
|
1135
1133
|
className: "prose-dark dark:prose-lighter",
|
|
1136
1134
|
header: /* @__PURE__ */ e("h2", { className: "m-0", children: /* @__PURE__ */ c(F, { columnGap: 3, alignVertical: "center", children: [
|
|
1137
|
-
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(et, { className: "size-
|
|
1135
|
+
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(et, { className: "size-8 text-center" }) }),
|
|
1138
1136
|
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e("div", { children: "Passkey" }) })
|
|
1139
1137
|
] }) }),
|
|
1140
1138
|
children: /* @__PURE__ */ c(F, { columnGap: 3, alignVertical: "center", children: [
|
|
1141
1139
|
/* @__PURE__ */ e(E, { children: "Sign in without a password using a passkey (face or fingerprint sign-in)." }),
|
|
1142
|
-
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(ee, { spacing: { t: 2 }, onClick:
|
|
1140
|
+
/* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(ee, { spacing: { t: 2 }, onClick: n, children: "Create a Passkey" }) })
|
|
1143
1141
|
] })
|
|
1144
1142
|
}
|
|
1145
1143
|
)
|
|
1146
1144
|
] }) : null;
|
|
1147
|
-
},
|
|
1145
|
+
}, Na = ({
|
|
1148
1146
|
open: t,
|
|
1149
1147
|
onOpenChange: a
|
|
1150
|
-
}) => /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title:
|
|
1151
|
-
const { state: t } = R(K), [a,
|
|
1148
|
+
}) => /* @__PURE__ */ e(X, { open: t, onOpenChange: a, title: st, children: /* @__PURE__ */ e(Ca, {}) }), xa = () => {
|
|
1149
|
+
const { state: t } = R(K), [a, n] = y(!1), [s, r] = y(!1), [o, i] = y(!1), [u, p] = y(!1), [d, l] = y([]), [C, b] = y(!1), [w, h] = y({
|
|
1152
1150
|
done: !1,
|
|
1153
1151
|
progress: !1,
|
|
1154
1152
|
timestamp: Date.now()
|
|
1155
|
-
}), { logout:
|
|
1156
|
-
|
|
1157
|
-
},
|
|
1158
|
-
r(!
|
|
1159
|
-
},
|
|
1153
|
+
}), { logout: x, getAccessToken: f, user: m } = Y(), N = () => {
|
|
1154
|
+
n(!a);
|
|
1155
|
+
}, T = () => {
|
|
1156
|
+
r(!s);
|
|
1157
|
+
}, S = () => {
|
|
1160
1158
|
i(!o);
|
|
1161
|
-
},
|
|
1162
|
-
|
|
1159
|
+
}, z = () => {
|
|
1160
|
+
p(!u);
|
|
1163
1161
|
}, B = async (H) => {
|
|
1164
1162
|
const q = Date.now();
|
|
1165
|
-
if (H && !(!
|
|
1166
|
-
|
|
1163
|
+
if (H && !(!m || !t || w.progress || w.done === !0 && q - w.timestamp < 5e3)) {
|
|
1164
|
+
h({
|
|
1167
1165
|
done: !0,
|
|
1168
1166
|
progress: !0,
|
|
1169
1167
|
timestamp: q
|
|
1170
1168
|
});
|
|
1171
1169
|
try {
|
|
1172
|
-
const V = await
|
|
1170
|
+
const V = await ne({
|
|
1173
1171
|
accessToken: await f(),
|
|
1174
|
-
type:
|
|
1172
|
+
type: se.GET_CHATS,
|
|
1175
1173
|
params: {
|
|
1176
|
-
userId:
|
|
1174
|
+
userId: m.username
|
|
1177
1175
|
}
|
|
1178
1176
|
});
|
|
1179
|
-
V.status === 200 && (
|
|
1177
|
+
V.status === 200 && (l(V.data), h({
|
|
1180
1178
|
done: !0,
|
|
1181
1179
|
progress: !1,
|
|
1182
1180
|
timestamp: Date.now()
|
|
1183
1181
|
}));
|
|
1184
1182
|
} catch {
|
|
1185
|
-
|
|
1183
|
+
h({
|
|
1186
1184
|
done: !0,
|
|
1187
1185
|
progress: !1,
|
|
1188
1186
|
timestamp: Date.now()
|
|
@@ -1190,15 +1188,15 @@ const pa = ({
|
|
|
1190
1188
|
}
|
|
1191
1189
|
}
|
|
1192
1190
|
}, J = () => {
|
|
1193
|
-
|
|
1191
|
+
b(!C);
|
|
1194
1192
|
};
|
|
1195
|
-
return /* @__PURE__ */ c(
|
|
1193
|
+
return /* @__PURE__ */ c(k, { children: [
|
|
1196
1194
|
/* @__PURE__ */ e(
|
|
1197
1195
|
Ee,
|
|
1198
1196
|
{
|
|
1199
|
-
showConfirmation:
|
|
1200
|
-
setShowConfirmation:
|
|
1201
|
-
action:
|
|
1197
|
+
showConfirmation: C,
|
|
1198
|
+
setShowConfirmation: b,
|
|
1199
|
+
action: x,
|
|
1202
1200
|
customStrings: {
|
|
1203
1201
|
confirmAction: ue,
|
|
1204
1202
|
cancelAction: "Cancel",
|
|
@@ -1207,66 +1205,66 @@ const pa = ({
|
|
|
1207
1205
|
children: /* @__PURE__ */ e("p", { children: "Are you sure you want to log out?" })
|
|
1208
1206
|
}
|
|
1209
1207
|
),
|
|
1210
|
-
/* @__PURE__ */ e(
|
|
1211
|
-
/* @__PURE__ */ e(
|
|
1208
|
+
/* @__PURE__ */ e(Na, { open: a, onOpenChange: n }),
|
|
1209
|
+
/* @__PURE__ */ e(la, { open: s, onOpenChange: r }),
|
|
1212
1210
|
/* @__PURE__ */ e(
|
|
1213
|
-
|
|
1211
|
+
ga,
|
|
1214
1212
|
{
|
|
1215
1213
|
open: o,
|
|
1216
1214
|
onOpenChange: i,
|
|
1217
1215
|
historyData: d
|
|
1218
1216
|
}
|
|
1219
1217
|
),
|
|
1220
|
-
/* @__PURE__ */ e(
|
|
1218
|
+
/* @__PURE__ */ e(ra, { open: u, onOpenChange: p }),
|
|
1221
1219
|
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e("div", { className: "absolute bottom-[-28px] right-[-7px]", children: /* @__PURE__ */ c(
|
|
1222
1220
|
xe,
|
|
1223
1221
|
{
|
|
1224
1222
|
mode: "dark",
|
|
1225
1223
|
focusMode: "light",
|
|
1226
|
-
trigger: /* @__PURE__ */ e(
|
|
1224
|
+
trigger: /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(na, {}) }),
|
|
1227
1225
|
defaultPlacement: "bottom-end",
|
|
1228
1226
|
onOpenChange: B,
|
|
1229
1227
|
children: [
|
|
1230
1228
|
/* @__PURE__ */ e(
|
|
1231
|
-
|
|
1229
|
+
O,
|
|
1232
1230
|
{
|
|
1233
1231
|
label: "Profile",
|
|
1234
|
-
onClick:
|
|
1235
|
-
icon: /* @__PURE__ */ e(
|
|
1232
|
+
onClick: N,
|
|
1233
|
+
icon: /* @__PURE__ */ e(ta, {})
|
|
1236
1234
|
}
|
|
1237
1235
|
),
|
|
1238
1236
|
/* @__PURE__ */ e(
|
|
1239
|
-
|
|
1237
|
+
O,
|
|
1240
1238
|
{
|
|
1241
1239
|
label: Ne,
|
|
1242
|
-
onClick:
|
|
1243
|
-
icon: /* @__PURE__ */ e(
|
|
1240
|
+
onClick: T,
|
|
1241
|
+
icon: /* @__PURE__ */ e(qt, {})
|
|
1244
1242
|
}
|
|
1245
1243
|
),
|
|
1246
1244
|
/* @__PURE__ */ e(
|
|
1247
|
-
|
|
1245
|
+
O,
|
|
1248
1246
|
{
|
|
1249
1247
|
label: "History",
|
|
1250
|
-
onClick:
|
|
1251
|
-
icon: /* @__PURE__ */ e(
|
|
1248
|
+
onClick: S,
|
|
1249
|
+
icon: /* @__PURE__ */ e(Zt, {})
|
|
1252
1250
|
}
|
|
1253
1251
|
),
|
|
1254
1252
|
/* @__PURE__ */ e(
|
|
1255
|
-
|
|
1253
|
+
O,
|
|
1256
1254
|
{
|
|
1257
1255
|
label: "About",
|
|
1258
|
-
onClick:
|
|
1259
|
-
icon: /* @__PURE__ */ e(
|
|
1256
|
+
onClick: z,
|
|
1257
|
+
icon: /* @__PURE__ */ e(ea, {})
|
|
1260
1258
|
}
|
|
1261
1259
|
),
|
|
1262
|
-
t && t.id && !t.isComponent && /* @__PURE__ */ c(
|
|
1263
|
-
/* @__PURE__ */ e(
|
|
1260
|
+
t && t.id && !t.isComponent && /* @__PURE__ */ c(k, { children: [
|
|
1261
|
+
/* @__PURE__ */ e(Lt, {}),
|
|
1264
1262
|
/* @__PURE__ */ e(
|
|
1265
|
-
|
|
1263
|
+
O,
|
|
1266
1264
|
{
|
|
1267
1265
|
label: "Log out",
|
|
1268
1266
|
onClick: J,
|
|
1269
|
-
icon: /* @__PURE__ */ e("div", { className: "text-red-700", children: /* @__PURE__ */ e(
|
|
1267
|
+
icon: /* @__PURE__ */ e("div", { className: "text-red-700", children: /* @__PURE__ */ e(Jt, { monotone: !0 }) })
|
|
1270
1268
|
}
|
|
1271
1269
|
)
|
|
1272
1270
|
] })
|
|
@@ -1276,5 +1274,5 @@ const pa = ({
|
|
|
1276
1274
|
] });
|
|
1277
1275
|
};
|
|
1278
1276
|
export {
|
|
1279
|
-
|
|
1277
|
+
xa as default
|
|
1280
1278
|
};
|