@versini/sassysaint 7.1.7 → 7.2.1
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.Dy701JAx.js → App.BO2S2PYc.js} +2224 -2160
- package/dist/chunks/{ChatBubbleAssistant.rvXLFo_B.js → ChatBubbleAssistant.Cwd8d9jB.js} +1002 -1050
- package/dist/chunks/{HeaderEntry.AcZmU5Vm.js → HeaderEntry.BJM1a_zl.js} +614 -615
- package/dist/chunks/{MarkdownWithExtra.0R-faVRz.js → MarkdownWithExtra.DKsimQRg.js} +2 -2
- package/dist/chunks/{index.DAXcx2b2.js → index.DxtRERJQ.js} +85 -85
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
|
@@ -1,260 +1,259 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { f as
|
|
3
|
-
import { i as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as d, jsx as t, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { f as $, un as V, R as P, CARDS as k, renderDataAsList as ne, pluralize as pe, ABOUT_TITLE as Xe, INFINITE_SCROLL_LIMIT as Se, INFINITE_SCROLL_THRESHOLD as Ne, LOCAL_STORAGE_PREFIX as ge, LOCAL_STORAGE_SORT as qe, re as J, ACTION_SORT as we, LOCAL_STORAGE_SEARCH as Qe, HISTORY_TITLE as Ze, fe as me, C as K, ACTION_SEARCH as Je, debounce as et, M as tt, isElectron as rt, L as W, j as M, l as ve, durationFormatter as at, PROFILE_TITLE as nt, PROMPTS_DESCRIPTION as ot, LOCAL_STORAGE_CHAT_DETAILS as st, SETTINGS_TITLE as lt, APP_NAME as ct, getCurrentGeoLocation as it, LOG_OUT as Ae } from "./index.DxtRERJQ.js";
|
|
3
|
+
import { i as oe, useServerCapabilities as dt, Ze as re, HistoryContext as Re, ChatContext as Le, E as ye, ConfirmationPanel as Pe, Ue as ut, je as mt, Fe as de, Le as L, De as ht, $e as ft, p as pt, z as gt, We as yt, serviceCall as ee, SERVICE_TYPES as te, setNewProvider as bt, CHAT_RESTORE as xt, B as q, useChatsHistory as kt, useUserChatStats as Ct, useUserPreferences as Me, m as Tt, _e as Et, me as St, R as Q, P as Nt } from "./App.BO2S2PYc.js";
|
|
4
|
+
import wt, { useRef as v, useState as C, useContext as se, useCallback as Oe, useEffect as F, Fragment as vt, useLayoutEffect as Z, useMemo as ze, useId as At, useReducer as It } from "react";
|
|
5
5
|
import g from "clsx";
|
|
6
|
-
const
|
|
7
|
-
className:
|
|
6
|
+
const _t = ({
|
|
7
|
+
className: e,
|
|
8
8
|
viewBox: o,
|
|
9
9
|
title: n,
|
|
10
10
|
monotone: a,
|
|
11
11
|
...r
|
|
12
|
-
}) => /* @__PURE__ */
|
|
13
|
-
|
|
12
|
+
}) => /* @__PURE__ */ d(
|
|
13
|
+
$,
|
|
14
14
|
{
|
|
15
15
|
defaultViewBox: "0 0 512 512",
|
|
16
16
|
size: "size-5",
|
|
17
17
|
viewBox: o,
|
|
18
|
-
className:
|
|
18
|
+
className: e,
|
|
19
19
|
title: n || "Back",
|
|
20
20
|
...r,
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ t(
|
|
23
23
|
"path",
|
|
24
24
|
{
|
|
25
25
|
d: "M66.6 320c0 1.8.1 3.5.4 5.3C84.9 431.3 177 512 288 512c123.7 0 224-100.3 224-224 0-111-80.7-203.1-186.7-220.9-1.8-.3-3.6-.4-5.3-.4-15.3 0-28.9 11.1-31.5 26.7-2.9 17.4 8.8 33.9 26.3 36.9C390.4 142.9 448 208.8 448 288c0 88.4-71.6 160-160 160-79.2 0-145.1-57.6-157.8-133.3-2.9-17.4-19.4-29.2-36.9-26.3-15.6 2.6-26.7 16.2-26.7 31.5z",
|
|
26
26
|
opacity: a ? "1" : "0.4"
|
|
27
27
|
}
|
|
28
28
|
),
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ t("path", { d: "M32 0h160c17.7 0 32 14.3 32 32s-14.3 32-32 32h-82.7l233.3 233.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 32S0 209.7 0 192V32C0 14.3 14.3 0 32 0" })
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
|
-
),
|
|
33
|
-
className:
|
|
32
|
+
), Rt = ({
|
|
33
|
+
className: e,
|
|
34
34
|
viewBox: o,
|
|
35
35
|
title: n,
|
|
36
36
|
monotone: a,
|
|
37
37
|
...r
|
|
38
|
-
}) => /* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
}) => /* @__PURE__ */ d(
|
|
39
|
+
$,
|
|
40
40
|
{
|
|
41
41
|
defaultViewBox: "0 0 448 512",
|
|
42
42
|
size: "size-5",
|
|
43
43
|
viewBox: o,
|
|
44
|
-
className:
|
|
44
|
+
className: e,
|
|
45
45
|
title: n || "Delete",
|
|
46
46
|
...r,
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ t(
|
|
49
49
|
"path",
|
|
50
50
|
{
|
|
51
51
|
d: "M32 96v352c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V96zm80 80c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16z",
|
|
52
52
|
opacity: a ? "1" : "0.4"
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ t("path", { d: "M163.8 0c-12.1 0-23.2 6.8-28.6 17.7L128 32H32C14.3 32 0 46.3 0 64s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96l-7.2-14.3C307.4 6.8 296.3 0 284.2 0z" })
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
|
-
),
|
|
59
|
-
className:
|
|
58
|
+
), Lt = ({
|
|
59
|
+
className: e,
|
|
60
60
|
viewBox: o,
|
|
61
61
|
title: n,
|
|
62
62
|
monotone: a,
|
|
63
63
|
...r
|
|
64
|
-
}) => /* @__PURE__ */
|
|
65
|
-
|
|
64
|
+
}) => /* @__PURE__ */ d(
|
|
65
|
+
$,
|
|
66
66
|
{
|
|
67
67
|
defaultViewBox: "0 0 512 512",
|
|
68
68
|
size: "size-5",
|
|
69
69
|
viewBox: o,
|
|
70
|
-
className:
|
|
70
|
+
className: e,
|
|
71
71
|
title: n || "History",
|
|
72
72
|
...r,
|
|
73
73
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ t(
|
|
75
75
|
"path",
|
|
76
76
|
{
|
|
77
77
|
d: "M0 57.9V168c0 13.3 10.7 24 24 24h110.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75L41 41C25.9 25.9 0 36.6 0 57.9",
|
|
78
78
|
opacity: a ? "1" : "0.4"
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ t("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" })
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
|
-
),
|
|
85
|
-
className:
|
|
84
|
+
), Pt = ({
|
|
85
|
+
className: e,
|
|
86
86
|
viewBox: o,
|
|
87
87
|
title: n,
|
|
88
88
|
monotone: a,
|
|
89
89
|
...r
|
|
90
|
-
}) => /* @__PURE__ */
|
|
91
|
-
|
|
90
|
+
}) => /* @__PURE__ */ d(
|
|
91
|
+
$,
|
|
92
92
|
{
|
|
93
93
|
defaultViewBox: "0 0 512 512",
|
|
94
94
|
size: "size-5",
|
|
95
95
|
viewBox: o,
|
|
96
|
-
className:
|
|
96
|
+
className: e,
|
|
97
97
|
title: n || "Info",
|
|
98
98
|
...r,
|
|
99
99
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ t(
|
|
101
101
|
"path",
|
|
102
102
|
{
|
|
103
103
|
d: "M0 256a256 256 0 1 0 512 0 256 256 0 1 0-512 0m192-8c0-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 24h-80c-13.3 0-24-10.7-24-24s10.7-24 24-24h24v-64h-24c-13.3 0-24-10.7-24-24m96-88a32 32 0 1 1-64 0 32 32 0 1 1 64 0",
|
|
104
104
|
opacity: ".4"
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ t("path", { d: "M256 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64m-64 120c0-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 24h-80c-13.3 0-24-10.7-24-24s10.7-24 24-24h24v-64h-24c-13.3 0-24-10.7-24-24" })
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
|
-
),
|
|
111
|
-
className:
|
|
110
|
+
), Mt = ({
|
|
111
|
+
className: e,
|
|
112
112
|
viewBox: o,
|
|
113
113
|
title: n,
|
|
114
114
|
monotone: a,
|
|
115
115
|
...r
|
|
116
|
-
}) => /* @__PURE__ */
|
|
117
|
-
|
|
116
|
+
}) => /* @__PURE__ */ d(
|
|
117
|
+
$,
|
|
118
118
|
{
|
|
119
119
|
defaultViewBox: "0 0 576 512",
|
|
120
120
|
size: "size-5",
|
|
121
121
|
viewBox: o,
|
|
122
|
-
className:
|
|
122
|
+
className: e,
|
|
123
123
|
title: n || "Profile",
|
|
124
124
|
...r,
|
|
125
125
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ t(
|
|
127
127
|
"path",
|
|
128
128
|
{
|
|
129
129
|
d: "M0 96v320c0 35.3 28.7 64 64 64h448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96m64 272c0-44.2 35.8-80 80-80h64c44.2 0 80 35.8 80 80 0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16m176-176a64 64 0 1 1-128 0 64 64 0 1 1 128 0m112-16c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16m0 64c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16m0 64c0-8.8 7.2-16 16-16h128c8.8 0 16 7.2 16 16s-7.2 16-16 16H368c-8.8 0-16-7.2-16-16",
|
|
130
130
|
opacity: ".4"
|
|
131
131
|
}
|
|
132
132
|
),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ t("path", { d: "M176 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128m-32 32c-44.2 0-80 35.8-80 80 0 8.8 7.2 16 16 16h192c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80z" })
|
|
134
134
|
]
|
|
135
135
|
}
|
|
136
|
-
),
|
|
137
|
-
className:
|
|
136
|
+
), Ot = ({
|
|
137
|
+
className: e,
|
|
138
138
|
viewBox: o,
|
|
139
139
|
title: n,
|
|
140
140
|
monotone: a,
|
|
141
141
|
...r
|
|
142
|
-
}) => /* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
}) => /* @__PURE__ */ d(
|
|
143
|
+
$,
|
|
144
144
|
{
|
|
145
145
|
defaultViewBox: "0 0 512 512",
|
|
146
146
|
size: "size-5",
|
|
147
147
|
viewBox: o,
|
|
148
|
-
className:
|
|
148
|
+
className: e,
|
|
149
149
|
title: n || "Restore",
|
|
150
150
|
...r,
|
|
151
151
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ t(
|
|
153
153
|
"path",
|
|
154
154
|
{
|
|
155
155
|
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",
|
|
156
156
|
opacity: a ? "1" : "0.4"
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ t("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" })
|
|
160
160
|
]
|
|
161
161
|
}
|
|
162
|
-
),
|
|
163
|
-
className:
|
|
162
|
+
), zt = ({
|
|
163
|
+
className: e,
|
|
164
164
|
viewBox: o,
|
|
165
165
|
title: n,
|
|
166
166
|
monotone: a,
|
|
167
167
|
...r
|
|
168
|
-
}) => /* @__PURE__ */
|
|
169
|
-
|
|
168
|
+
}) => /* @__PURE__ */ t(
|
|
169
|
+
$,
|
|
170
170
|
{
|
|
171
171
|
defaultViewBox: "0 0 448 512",
|
|
172
172
|
size: "size-5",
|
|
173
173
|
viewBox: o,
|
|
174
|
-
className:
|
|
174
|
+
className: e,
|
|
175
175
|
title: n || "Settings",
|
|
176
176
|
...r,
|
|
177
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ t("path", { d: "M432 256a48 48 0 1 1-96 0 48 48 0 1 1 96 0m-160 0a48 48 0 1 1-96 0 48 48 0 1 1 96 0M64 304a48 48 0 1 1 0-96 48 48 0 1 1 0 96" })
|
|
178
178
|
}
|
|
179
|
-
),
|
|
180
|
-
className:
|
|
179
|
+
), Ht = ({
|
|
180
|
+
className: e,
|
|
181
181
|
viewBox: o,
|
|
182
182
|
title: n,
|
|
183
183
|
monotone: a,
|
|
184
184
|
...r
|
|
185
|
-
}) => /* @__PURE__ */
|
|
186
|
-
|
|
185
|
+
}) => /* @__PURE__ */ d(
|
|
186
|
+
$,
|
|
187
187
|
{
|
|
188
188
|
defaultViewBox: "0 0 512 512",
|
|
189
189
|
size: "size-5",
|
|
190
190
|
viewBox: o,
|
|
191
|
-
className:
|
|
191
|
+
className: e,
|
|
192
192
|
title: n || "Sliders",
|
|
193
193
|
...r,
|
|
194
194
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ t(
|
|
196
196
|
"path",
|
|
197
197
|
{
|
|
198
198
|
d: "M0 96c0-17.7 14.3-32 32-32h86.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m0 160c0-17.7 14.3-32 32-32h246.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m0 160c0-17.7 14.3-32 32-32h54.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m233.3-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H233.3c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32zm32-320H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H265.3c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32zm160 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32h-54.7c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32z",
|
|
199
199
|
opacity: a ? "1" : "0.4"
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ t("path", { d: "M128 416a32 32 0 1 1 64 0 32 32 0 1 1-64 0m112 0a80 80 0 1 0-160 0 80 80 0 1 0 160 0m80-160a32 32 0 1 1 64 0 32 32 0 1 1-64 0m112 0a80 80 0 1 0-160 0 80 80 0 1 0 160 0M192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64m0-112a80 80 0 1 0 0 160 80 80 0 1 0 0-160" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
|
-
),
|
|
206
|
-
const { getAccessToken:
|
|
205
|
+
), Bt = () => {
|
|
206
|
+
const { getAccessToken: e } = V(), o = oe(), n = oe(), {
|
|
207
207
|
data: a,
|
|
208
208
|
error: r,
|
|
209
209
|
isLoading: c
|
|
210
|
-
} =
|
|
211
|
-
getAccessToken:
|
|
212
|
-
}), s = (a == null ? void 0 : a.
|
|
213
|
-
return /* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
210
|
+
} = dt({
|
|
211
|
+
getAccessToken: e
|
|
212
|
+
}), s = (a == null ? void 0 : a.version) || "", i = (a == null ? void 0 : a.models) || [];
|
|
213
|
+
return /* @__PURE__ */ d(D, { children: [
|
|
214
|
+
/* @__PURE__ */ t("div", { className: "mb-4", children: /* @__PURE__ */ t(
|
|
215
215
|
P,
|
|
216
216
|
{
|
|
217
|
-
header:
|
|
217
|
+
header: k.ABOUT.TITLE_CLIENT,
|
|
218
218
|
className: "prose-dark dark:prose-lighter",
|
|
219
|
-
children:
|
|
220
|
-
[
|
|
221
|
-
[
|
|
219
|
+
children: ne(o, {
|
|
220
|
+
[k.ABOUT.VERSION]: "7.2.1",
|
|
221
|
+
[k.ABOUT.BUILD_TIMESTAMP]: "02/15/2025 07:42 PM EST"
|
|
222
222
|
})
|
|
223
223
|
}
|
|
224
224
|
) }),
|
|
225
|
-
r || c ? null : /* @__PURE__ */
|
|
225
|
+
r || c ? null : /* @__PURE__ */ t(
|
|
226
226
|
P,
|
|
227
227
|
{
|
|
228
|
-
header:
|
|
228
|
+
header: k.ABOUT.TITLE_SERVER,
|
|
229
229
|
className: "prose-dark dark:prose-lighter",
|
|
230
|
-
children:
|
|
231
|
-
[
|
|
232
|
-
[
|
|
233
|
-
[le(x.ABOUT.PLUGIN, s.length)]: /* @__PURE__ */ e(H, { children: s.map((h) => /* @__PURE__ */ e("div", { className: "text-right", children: h }, h)) })
|
|
230
|
+
children: ne(n, {
|
|
231
|
+
[k.ABOUT.VERSION]: s,
|
|
232
|
+
[pe(k.ABOUT.PROVIDER, i.length)]: /* @__PURE__ */ t(D, { children: i.map((m) => /* @__PURE__ */ t("div", { className: "text-right", children: m }, m)) })
|
|
234
233
|
})
|
|
235
234
|
}
|
|
236
235
|
)
|
|
237
236
|
] });
|
|
238
|
-
},
|
|
239
|
-
open:
|
|
237
|
+
}, Dt = ({
|
|
238
|
+
open: e,
|
|
240
239
|
onOpenChange: o
|
|
241
|
-
}) => /* @__PURE__ */
|
|
240
|
+
}) => /* @__PURE__ */ t(re, { open: e, onOpenChange: o, title: Xe, children: /* @__PURE__ */ t(Bt, {}) }), $t = async (e, o, n, a, r, c) => {
|
|
242
241
|
try {
|
|
243
|
-
const s = await
|
|
242
|
+
const s = await ee({
|
|
244
243
|
accessToken: a,
|
|
245
|
-
type:
|
|
244
|
+
type: te.GET_CHAT,
|
|
246
245
|
params: {
|
|
247
|
-
id:
|
|
246
|
+
id: e.id
|
|
248
247
|
}
|
|
249
248
|
});
|
|
250
|
-
s.status === 200 && (s.data.provider !== c && await
|
|
249
|
+
s.status === 200 && (s.data.provider !== c && await bt({
|
|
251
250
|
provider: s.data.provider,
|
|
252
251
|
accessToken: a,
|
|
253
252
|
username: r
|
|
254
253
|
}), o({
|
|
255
|
-
type:
|
|
254
|
+
type: xt,
|
|
256
255
|
payload: {
|
|
257
|
-
id:
|
|
256
|
+
id: e.id,
|
|
258
257
|
model: s.data.model,
|
|
259
258
|
provider: s.data.provider,
|
|
260
259
|
usage: s.data.usage,
|
|
@@ -263,51 +262,51 @@ const Rt = ({
|
|
|
263
262
|
}), n(!1));
|
|
264
263
|
} catch {
|
|
265
264
|
}
|
|
266
|
-
},
|
|
267
|
-
filteredHistory:
|
|
265
|
+
}, Vt = ({
|
|
266
|
+
filteredHistory: e,
|
|
268
267
|
dispatch: o,
|
|
269
268
|
onOpenChange: n,
|
|
270
269
|
mutate: a
|
|
271
270
|
}) => {
|
|
272
271
|
var I;
|
|
273
|
-
const { user: r, getAccessToken: c } =
|
|
272
|
+
const { user: r, getAccessToken: c } = V(), s = v(null), i = v({
|
|
274
273
|
id: 0,
|
|
275
274
|
timestamp: "",
|
|
276
275
|
message: ""
|
|
277
|
-
}), [m,
|
|
278
|
-
|
|
279
|
-
), { state:
|
|
280
|
-
state: { provider:
|
|
281
|
-
} =
|
|
282
|
-
key:
|
|
283
|
-
initialValue:
|
|
284
|
-
}),
|
|
285
|
-
switch (
|
|
286
|
-
case
|
|
287
|
-
|
|
276
|
+
}), [m, p] = C(!1), [h, y] = C(
|
|
277
|
+
Se + Ne
|
|
278
|
+
), { state: x, dispatch: l } = se(Re), {
|
|
279
|
+
state: { provider: f }
|
|
280
|
+
} = se(Le), [, T] = ye({
|
|
281
|
+
key: ge + qe,
|
|
282
|
+
initialValue: x.sortDirection
|
|
283
|
+
}), S = (u) => {
|
|
284
|
+
switch (x.sortDirection) {
|
|
285
|
+
case q.ASC:
|
|
286
|
+
T(q.DESC), l({
|
|
288
287
|
type: we,
|
|
289
288
|
payload: {
|
|
290
289
|
sortedCell: u,
|
|
291
|
-
sortDirection:
|
|
290
|
+
sortDirection: q.DESC
|
|
292
291
|
}
|
|
293
292
|
});
|
|
294
293
|
break;
|
|
295
294
|
default:
|
|
296
|
-
|
|
295
|
+
T(q.ASC), l({
|
|
297
296
|
type: we,
|
|
298
297
|
payload: {
|
|
299
298
|
sortedCell: u,
|
|
300
|
-
sortDirection:
|
|
299
|
+
sortDirection: q.ASC
|
|
301
300
|
}
|
|
302
301
|
});
|
|
303
302
|
break;
|
|
304
303
|
}
|
|
305
304
|
}, b = async () => {
|
|
306
|
-
const u =
|
|
305
|
+
const u = i.current;
|
|
307
306
|
try {
|
|
308
|
-
await
|
|
307
|
+
await ee({
|
|
309
308
|
accessToken: await c(),
|
|
310
|
-
type:
|
|
309
|
+
type: te.DELETE_CHAT,
|
|
311
310
|
params: {
|
|
312
311
|
userId: (r == null ? void 0 : r.username) || "",
|
|
313
312
|
id: u.id
|
|
@@ -316,7 +315,7 @@ const Rt = ({
|
|
|
316
315
|
} catch {
|
|
317
316
|
}
|
|
318
317
|
}, _ = Oe((u) => {
|
|
319
|
-
u[0].isIntersecting && y((
|
|
318
|
+
u[0].isIntersecting && y((R) => R + Se);
|
|
320
319
|
}, []);
|
|
321
320
|
return F(() => {
|
|
322
321
|
const u = {
|
|
@@ -324,12 +323,12 @@ const Rt = ({
|
|
|
324
323
|
rootMargin: "20px"
|
|
325
324
|
}, w = new IntersectionObserver(_, u);
|
|
326
325
|
s.current && w.observe(s.current);
|
|
327
|
-
}), /* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ d(D, { children: [
|
|
327
|
+
/* @__PURE__ */ d(
|
|
329
328
|
Pe,
|
|
330
329
|
{
|
|
331
330
|
showConfirmation: m,
|
|
332
|
-
setShowConfirmation:
|
|
331
|
+
setShowConfirmation: p,
|
|
333
332
|
action: b,
|
|
334
333
|
customStrings: {
|
|
335
334
|
confirmAction: "Delete",
|
|
@@ -337,51 +336,51 @@ const Rt = ({
|
|
|
337
336
|
title: "Delete chat"
|
|
338
337
|
},
|
|
339
338
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ t("p", { className: "m-0", children: "Are you sure you want to delete the following chat:" }),
|
|
340
|
+
/* @__PURE__ */ d("ul", { className: "m-0", children: [
|
|
341
|
+
/* @__PURE__ */ d("li", { children: [
|
|
343
342
|
"Timestamp:",
|
|
344
343
|
" ",
|
|
345
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ t("span", { className: "text-lg", children: i.current && i.current.timestamp })
|
|
346
345
|
] }),
|
|
347
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ d("li", { children: [
|
|
348
347
|
"First message:",
|
|
349
348
|
" ",
|
|
350
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ t("span", { className: "text-lg", children: (I = i.current) == null ? void 0 : I.message })
|
|
351
350
|
] })
|
|
352
351
|
] })
|
|
353
352
|
]
|
|
354
353
|
}
|
|
355
354
|
),
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
|
|
355
|
+
/* @__PURE__ */ d(ut, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
|
|
356
|
+
/* @__PURE__ */ t(mt, { children: /* @__PURE__ */ d(de, { children: [
|
|
357
|
+
/* @__PURE__ */ t(L, { className: "sr-only", children: "Row" }),
|
|
358
|
+
/* @__PURE__ */ t(
|
|
359
|
+
ht,
|
|
361
360
|
{
|
|
362
361
|
buttonClassName: "text-xs sm:text-sm",
|
|
363
362
|
cellId: "timestamp",
|
|
364
363
|
align: "left",
|
|
365
|
-
sortDirection:
|
|
366
|
-
sortedCell:
|
|
364
|
+
sortDirection: x.sortDirection,
|
|
365
|
+
sortedCell: x.sortedCell,
|
|
367
366
|
onClick: () => {
|
|
368
|
-
|
|
367
|
+
S("timestamp");
|
|
369
368
|
},
|
|
370
369
|
children: "Date"
|
|
371
370
|
}
|
|
372
371
|
),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ t(L, { className: "text-xs sm:text-sm", children: "Summary" }),
|
|
373
|
+
/* @__PURE__ */ t(L, { className: "text-xs sm:text-sm", children: "Provider" }),
|
|
374
|
+
/* @__PURE__ */ t(L, { className: "text-xs sm:text-sm text-right", children: "Actions" })
|
|
376
375
|
] }) }),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
var
|
|
379
|
-
const
|
|
380
|
-
return ((
|
|
381
|
-
w ===
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ t(ft, { children: e.slice(0, h).map((u, w) => {
|
|
377
|
+
var E, N;
|
|
378
|
+
const R = u.summary || (u.messages.length > 0 ? (E = u.messages[0]) == null ? void 0 : E.content : "");
|
|
379
|
+
return ((N = u == null ? void 0 : u.messages) == null ? void 0 : N.length) > 0 ? /* @__PURE__ */ d(vt, { children: [
|
|
380
|
+
w === h - Ne && /* @__PURE__ */ t("tr", { ref: s }),
|
|
381
|
+
/* @__PURE__ */ d(de, { children: [
|
|
382
|
+
/* @__PURE__ */ t(L, { children: w + 1 }),
|
|
383
|
+
/* @__PURE__ */ t(
|
|
385
384
|
L,
|
|
386
385
|
{
|
|
387
386
|
component: "th",
|
|
@@ -390,17 +389,17 @@ const Rt = ({
|
|
|
390
389
|
children: u.timestamp.split(",")[0]
|
|
391
390
|
}
|
|
392
391
|
),
|
|
393
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ t(
|
|
394
393
|
L,
|
|
395
394
|
{
|
|
396
395
|
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
|
397
396
|
style: {
|
|
398
397
|
wordBreak: "break-word"
|
|
399
398
|
},
|
|
400
|
-
children:
|
|
399
|
+
children: R
|
|
401
400
|
}
|
|
402
401
|
),
|
|
403
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ d(
|
|
404
403
|
L,
|
|
405
404
|
{
|
|
406
405
|
component: "th",
|
|
@@ -408,68 +407,68 @@ const Rt = ({
|
|
|
408
407
|
className: "text-gray-400",
|
|
409
408
|
align: "center",
|
|
410
409
|
children: [
|
|
411
|
-
u.model && u.model.startsWith("claude") && /* @__PURE__ */
|
|
412
|
-
u.model && u.model.startsWith("gpt") && /* @__PURE__ */
|
|
410
|
+
u.model && u.model.startsWith("claude") && /* @__PURE__ */ t(pt, { size: "size-4 sm:size-5" }),
|
|
411
|
+
u.model && u.model.startsWith("gpt") && /* @__PURE__ */ t(gt, { size: "size-4 sm:size-5" })
|
|
413
412
|
]
|
|
414
413
|
}
|
|
415
414
|
),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
|
|
415
|
+
/* @__PURE__ */ d(L, { align: "right", children: [
|
|
416
|
+
/* @__PURE__ */ t(
|
|
417
|
+
J,
|
|
419
418
|
{
|
|
420
419
|
className: "mr-2",
|
|
421
420
|
focusMode: "alt-system",
|
|
422
421
|
noBorder: !0,
|
|
423
422
|
label: "Restore chat",
|
|
424
423
|
onClick: async () => {
|
|
425
|
-
const
|
|
424
|
+
const O = await c();
|
|
426
425
|
$t(
|
|
427
426
|
u,
|
|
428
427
|
o,
|
|
429
428
|
n,
|
|
430
|
-
|
|
429
|
+
O,
|
|
431
430
|
(r == null ? void 0 : r.username) || "",
|
|
432
|
-
|
|
431
|
+
f
|
|
433
432
|
);
|
|
434
433
|
},
|
|
435
|
-
children: /* @__PURE__ */
|
|
434
|
+
children: /* @__PURE__ */ t(Ot, { size: "size-3", monotone: !0 })
|
|
436
435
|
}
|
|
437
436
|
),
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
|
|
437
|
+
/* @__PURE__ */ t(
|
|
438
|
+
J,
|
|
440
439
|
{
|
|
441
440
|
focusMode: "alt-system",
|
|
442
441
|
noBorder: !0,
|
|
443
442
|
label: "Delete chat",
|
|
444
443
|
onClick: () => {
|
|
445
|
-
var
|
|
446
|
-
|
|
444
|
+
var O;
|
|
445
|
+
i.current = {
|
|
447
446
|
id: u.id,
|
|
448
447
|
timestamp: u.timestamp,
|
|
449
|
-
message: u.messages.length > 0 ? (
|
|
450
|
-
},
|
|
448
|
+
message: u.messages.length > 0 ? (O = u.messages[0]) == null ? void 0 : O.content : ""
|
|
449
|
+
}, p(!m);
|
|
451
450
|
},
|
|
452
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ t("div", { className: "text-red-400", children: /* @__PURE__ */ t(Rt, { size: "size-3", monotone: !0 }) })
|
|
453
452
|
}
|
|
454
453
|
)
|
|
455
454
|
] })
|
|
456
455
|
] })
|
|
457
|
-
] }, `${
|
|
456
|
+
] }, `${k.HISTORY.TITLE}-${u.id}-${w}`) : null;
|
|
458
457
|
}) }),
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
`${
|
|
461
|
-
|
|
458
|
+
/* @__PURE__ */ t(yt, { children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ t(L, { colSpan: 1e3, children: /* @__PURE__ */ t("div", { children: pe(
|
|
459
|
+
`${e.length} chat`,
|
|
460
|
+
e.length
|
|
462
461
|
) }) }) }) })
|
|
463
462
|
] })
|
|
464
463
|
] });
|
|
465
|
-
},
|
|
466
|
-
open:
|
|
464
|
+
}, Ft = ({
|
|
465
|
+
open: e,
|
|
467
466
|
onOpenChange: o
|
|
468
467
|
}) => {
|
|
469
|
-
const { getAccessToken: n, user: a } =
|
|
468
|
+
const { getAccessToken: n, user: a } = V(), {
|
|
470
469
|
state: { lastTriggeredTimestamp: r },
|
|
471
470
|
dispatch: c
|
|
472
|
-
} =
|
|
471
|
+
} = se(Le), { state: s, dispatch: i } = se(Re), { data: m, mutate: p } = kt({
|
|
473
472
|
keys: [
|
|
474
473
|
a == null ? void 0 : a.username,
|
|
475
474
|
s.searchString,
|
|
@@ -477,41 +476,41 @@ const Rt = ({
|
|
|
477
476
|
r || 0
|
|
478
477
|
],
|
|
479
478
|
getAccessToken: n
|
|
480
|
-
}),
|
|
481
|
-
key:
|
|
479
|
+
}), h = v(null), [, y] = ye({
|
|
480
|
+
key: ge + Qe,
|
|
482
481
|
initialValue: s.searchString
|
|
483
|
-
}), [
|
|
482
|
+
}), [x, l] = C([]);
|
|
484
483
|
F(() => {
|
|
485
484
|
m && l(m);
|
|
486
485
|
}, [m]);
|
|
487
|
-
const
|
|
488
|
-
y(b),
|
|
486
|
+
const f = async (b) => {
|
|
487
|
+
y(b), i({
|
|
489
488
|
type: Je,
|
|
490
489
|
payload: { searchString: b }
|
|
491
490
|
});
|
|
492
|
-
},
|
|
493
|
-
|
|
491
|
+
}, T = et((b) => {
|
|
492
|
+
f(b.target.value.trim());
|
|
494
493
|
}, 500);
|
|
495
|
-
return /* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
494
|
+
return /* @__PURE__ */ t(re, { open: e, onOpenChange: o, title: Ze, children: /* @__PURE__ */ d(D, { children: [
|
|
495
|
+
/* @__PURE__ */ t("form", { autoComplete: "off", onSubmit: async (b) => {
|
|
497
496
|
b.preventDefault();
|
|
498
|
-
}, children: /* @__PURE__ */
|
|
499
|
-
|
|
497
|
+
}, children: /* @__PURE__ */ t(
|
|
498
|
+
me,
|
|
500
499
|
{
|
|
501
500
|
autoCapitalize: "off",
|
|
502
501
|
autoComplete: "off",
|
|
503
502
|
autoCorrect: "off",
|
|
504
|
-
ref:
|
|
503
|
+
ref: h,
|
|
505
504
|
defaultValue: s.searchString,
|
|
506
505
|
focusMode: "light",
|
|
507
506
|
mode: "dark",
|
|
508
507
|
name: "Search",
|
|
509
508
|
label: "Search",
|
|
510
|
-
onChange:
|
|
509
|
+
onChange: T,
|
|
511
510
|
className: "mt-2 mb-2",
|
|
512
511
|
...s.searchString && {
|
|
513
|
-
rightElement: /* @__PURE__ */
|
|
514
|
-
|
|
512
|
+
rightElement: /* @__PURE__ */ t(
|
|
513
|
+
K,
|
|
515
514
|
{
|
|
516
515
|
type: "button",
|
|
517
516
|
disabled: !s.searchString,
|
|
@@ -521,7 +520,7 @@ const Rt = ({
|
|
|
521
520
|
size: "small",
|
|
522
521
|
onClick: () => {
|
|
523
522
|
var b;
|
|
524
|
-
|
|
523
|
+
f(""), (b = h.current) != null && b.value && (h.current.value = "", h.current.focus());
|
|
525
524
|
},
|
|
526
525
|
children: "Reset"
|
|
527
526
|
}
|
|
@@ -529,80 +528,80 @@ const Rt = ({
|
|
|
529
528
|
}
|
|
530
529
|
}
|
|
531
530
|
) }),
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
|
|
531
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-2 sm:flex-row max-h-[60vh] min-h-[60vh]", children: /* @__PURE__ */ t(
|
|
532
|
+
Vt,
|
|
534
533
|
{
|
|
535
|
-
mutate:
|
|
536
|
-
filteredHistory:
|
|
534
|
+
mutate: p,
|
|
535
|
+
filteredHistory: x,
|
|
537
536
|
dispatch: c,
|
|
538
537
|
onOpenChange: o
|
|
539
538
|
}
|
|
540
539
|
) })
|
|
541
540
|
] }) });
|
|
542
|
-
},
|
|
543
|
-
const { isAuthenticated: o, user: n, registeringForPasskey: a, authenticationType: r } =
|
|
544
|
-
return o &&
|
|
545
|
-
/* @__PURE__ */
|
|
541
|
+
}, Ut = ({ stats: e }) => {
|
|
542
|
+
const { isAuthenticated: o, user: n, registeringForPasskey: a, authenticationType: r } = V(), c = oe(), s = oe(), i = (n == null ? void 0 : n.username) || "";
|
|
543
|
+
return o && i ? /* @__PURE__ */ d(D, { children: [
|
|
544
|
+
/* @__PURE__ */ t(
|
|
546
545
|
P,
|
|
547
546
|
{
|
|
548
|
-
header:
|
|
547
|
+
header: k.PREFERENCES.TITLE,
|
|
549
548
|
className: "prose-dark dark:prose-lighter",
|
|
550
|
-
children:
|
|
551
|
-
[
|
|
552
|
-
[
|
|
549
|
+
children: ne(c, {
|
|
550
|
+
[k.PREFERENCES.NAME]: i,
|
|
551
|
+
[k.PREFERENCES.EMAIL]: (n == null ? void 0 : n.email) || ""
|
|
553
552
|
})
|
|
554
553
|
}
|
|
555
554
|
),
|
|
556
|
-
r !== tt.PASSKEY && !rt() && /* @__PURE__ */
|
|
555
|
+
r !== tt.PASSKEY && !rt() && /* @__PURE__ */ d(
|
|
557
556
|
P,
|
|
558
557
|
{
|
|
559
558
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
560
|
-
header: /* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
559
|
+
header: /* @__PURE__ */ t("h2", { className: "m-0", children: /* @__PURE__ */ d(W, { columnGap: 3, alignVertical: "center", children: [
|
|
560
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(ve, { size: "size-8" }) }),
|
|
561
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t("div", { children: k.PREFERENCES.PASSKEY_TITLE }) })
|
|
563
562
|
] }) }),
|
|
564
563
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
|
|
564
|
+
/* @__PURE__ */ t("p", { children: k.PREFERENCES.PASSKEY_INSTRUCTIONS }),
|
|
565
|
+
/* @__PURE__ */ t(
|
|
566
|
+
J,
|
|
568
567
|
{
|
|
569
568
|
size: "small",
|
|
570
569
|
className: "mt-2",
|
|
571
570
|
onClick: a,
|
|
572
|
-
labelLeft:
|
|
573
|
-
children: /* @__PURE__ */
|
|
571
|
+
labelLeft: k.PREFERENCES.PASSKEY_BUTTON,
|
|
572
|
+
children: /* @__PURE__ */ t(ve, { size: "size-5", monotone: !0 })
|
|
574
573
|
}
|
|
575
574
|
)
|
|
576
575
|
]
|
|
577
576
|
}
|
|
578
577
|
),
|
|
579
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ t(
|
|
580
579
|
P,
|
|
581
580
|
{
|
|
582
|
-
header:
|
|
581
|
+
header: k.MAIN_STATISTICS.TITLE,
|
|
583
582
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
584
|
-
children:
|
|
585
|
-
[
|
|
586
|
-
[
|
|
587
|
-
|
|
583
|
+
children: ne(s, {
|
|
584
|
+
[pe(k.MAIN_STATISTICS.TOTAL, e.totalChats)]: e.totalChats,
|
|
585
|
+
[k.MAIN_STATISTICS.PROCESSING_TIME]: at(
|
|
586
|
+
e.averageProcessingTimes
|
|
588
587
|
)
|
|
589
588
|
})
|
|
590
589
|
}
|
|
591
590
|
)
|
|
592
591
|
] }) : null;
|
|
593
|
-
},
|
|
594
|
-
open:
|
|
592
|
+
}, Gt = ({
|
|
593
|
+
open: e,
|
|
595
594
|
onOpenChange: o
|
|
596
595
|
}) => {
|
|
597
|
-
const { getAccessToken: n, user: a } =
|
|
596
|
+
const { getAccessToken: n, user: a } = V(), {
|
|
598
597
|
data: r,
|
|
599
598
|
error: c,
|
|
600
599
|
isLoading: s
|
|
601
|
-
} =
|
|
600
|
+
} = Ct({
|
|
602
601
|
keys: [a == null ? void 0 : a.username],
|
|
603
602
|
getAccessToken: n
|
|
604
603
|
});
|
|
605
|
-
return c || s ? null : /* @__PURE__ */
|
|
604
|
+
return c || s ? null : /* @__PURE__ */ t(re, { open: e, onOpenChange: o, title: nt, children: /* @__PURE__ */ t(Ut, { stats: r }) });
|
|
606
605
|
};
|
|
607
606
|
/*!
|
|
608
607
|
@versini/ui-textarea v3.0.13
|
|
@@ -617,22 +616,22 @@ try {
|
|
|
617
616
|
});
|
|
618
617
|
} catch {
|
|
619
618
|
}
|
|
620
|
-
const He = "av-text-area",
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
return F(() => (
|
|
624
|
-
|
|
625
|
-
}), []), Oe(() =>
|
|
619
|
+
const He = "av-text-area", Yt = "av-text-area-wrapper", ue = "av-text-area-helper-text", jt = "av-text-area__control--right", Kt = "av-text-area__control--left";
|
|
620
|
+
function Wt() {
|
|
621
|
+
const e = v(!1);
|
|
622
|
+
return F(() => (e.current = !0, () => {
|
|
623
|
+
e.current = !1;
|
|
624
|
+
}), []), Oe(() => e.current, []);
|
|
626
625
|
}
|
|
627
|
-
function
|
|
628
|
-
return ze(() =>
|
|
626
|
+
function Xt(e) {
|
|
627
|
+
return ze(() => e.every((o) => o == null) ? () => {
|
|
629
628
|
} : (o) => {
|
|
630
|
-
|
|
629
|
+
e.forEach((n) => {
|
|
631
630
|
typeof n == "function" ? n(o) : n != null && (n.current = o);
|
|
632
631
|
});
|
|
633
|
-
},
|
|
632
|
+
}, e);
|
|
634
633
|
}
|
|
635
|
-
const
|
|
634
|
+
const qt = {
|
|
636
635
|
x: 0,
|
|
637
636
|
y: 0,
|
|
638
637
|
width: 0,
|
|
@@ -642,48 +641,48 @@ const Qt = {
|
|
|
642
641
|
bottom: 0,
|
|
643
642
|
right: 0
|
|
644
643
|
};
|
|
645
|
-
function Ie(
|
|
646
|
-
const o =
|
|
647
|
-
const m =
|
|
644
|
+
function Ie(e) {
|
|
645
|
+
const o = Wt(), n = v(0), a = v(null), [r, c] = C(qt), s = ze(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
|
|
646
|
+
const m = i[0];
|
|
648
647
|
m && (cancelAnimationFrame(n.current), n.current = requestAnimationFrame(() => {
|
|
649
648
|
a.current && o() && c(m.contentRect);
|
|
650
649
|
}));
|
|
651
650
|
}), [o]);
|
|
652
|
-
return F(() => (a.current && (s == null || s.observe(a.current,
|
|
651
|
+
return F(() => (a.current && (s == null || s.observe(a.current, e)), () => {
|
|
653
652
|
s == null || s.disconnect(), n.current && cancelAnimationFrame(n.current);
|
|
654
|
-
}), [s,
|
|
653
|
+
}), [s, e]), [a, r];
|
|
655
654
|
}
|
|
656
|
-
function
|
|
657
|
-
value:
|
|
655
|
+
function Qt({
|
|
656
|
+
value: e,
|
|
658
657
|
defaultValue: o,
|
|
659
658
|
finalValue: n,
|
|
660
659
|
onChange: a = () => {
|
|
661
660
|
},
|
|
662
661
|
initialControlledDelay: r = 0
|
|
663
662
|
}) {
|
|
664
|
-
const [c, s] =
|
|
663
|
+
const [c, s] = C(!1), [i, m] = C(
|
|
665
664
|
o !== void 0 ? o : n
|
|
666
|
-
),
|
|
667
|
-
m(
|
|
665
|
+
), p = (h) => {
|
|
666
|
+
m(h), a == null || a(h);
|
|
668
667
|
};
|
|
669
668
|
return F(() => {
|
|
670
|
-
(async () =>
|
|
671
|
-
(
|
|
669
|
+
(async () => e !== void 0 && !c && r > 0 && (await new Promise(
|
|
670
|
+
(h) => setTimeout(h, r)
|
|
672
671
|
), s(!0)))();
|
|
673
|
-
}, [
|
|
672
|
+
}, [e, r, c]), e !== void 0 ? !c && r > 0 ? ["", a, !0] : [e, a, !0] : [i, p, !1];
|
|
674
673
|
}
|
|
675
|
-
function
|
|
676
|
-
const o =
|
|
677
|
-
if (!
|
|
674
|
+
function Zt(e) {
|
|
675
|
+
const o = At();
|
|
676
|
+
if (!e)
|
|
678
677
|
return o;
|
|
679
|
-
if (typeof
|
|
680
|
-
return `${
|
|
681
|
-
if (typeof
|
|
682
|
-
const { id: n, prefix: a = "" } =
|
|
678
|
+
if (typeof e == "number" || typeof e == "string")
|
|
679
|
+
return `${e}${o}`;
|
|
680
|
+
if (typeof e == "object") {
|
|
681
|
+
const { id: n, prefix: a = "" } = e;
|
|
683
682
|
return typeof n == "number" || typeof n == "string" ? `${a}${n}` : `${a}${o}`;
|
|
684
683
|
}
|
|
685
684
|
}
|
|
686
|
-
const Be = "SET_ANNOUNCEMENT", De = "CLEAR_ANNOUNCEMENT",
|
|
685
|
+
const Be = "SET_ANNOUNCEMENT", De = "CLEAR_ANNOUNCEMENT", Jt = {
|
|
687
686
|
alert: null,
|
|
688
687
|
alertdialog: null,
|
|
689
688
|
log: "polite",
|
|
@@ -691,47 +690,47 @@ const Be = "SET_ANNOUNCEMENT", De = "CLEAR_ANNOUNCEMENT", er = {
|
|
|
691
690
|
progressbar: null,
|
|
692
691
|
status: "polite",
|
|
693
692
|
timer: "assertive"
|
|
694
|
-
},
|
|
693
|
+
}, er = (e, o) => {
|
|
695
694
|
switch (o == null ? void 0 : o.type) {
|
|
696
695
|
case Be:
|
|
697
696
|
return {
|
|
698
|
-
...
|
|
697
|
+
...e,
|
|
699
698
|
announcement: o.payload
|
|
700
699
|
};
|
|
701
700
|
case De:
|
|
702
701
|
return {
|
|
703
|
-
...
|
|
702
|
+
...e,
|
|
704
703
|
announcement: null
|
|
705
704
|
};
|
|
706
705
|
default:
|
|
707
|
-
return
|
|
706
|
+
return e;
|
|
708
707
|
}
|
|
709
|
-
},
|
|
710
|
-
onAnnouncementClear:
|
|
708
|
+
}, tr = ({
|
|
709
|
+
onAnnouncementClear: e,
|
|
711
710
|
dispatch: o
|
|
712
711
|
}) => {
|
|
713
712
|
o({
|
|
714
713
|
type: De
|
|
715
|
-
}), typeof
|
|
714
|
+
}), typeof e == "function" && e();
|
|
716
715
|
}, _e = ({
|
|
717
|
-
children:
|
|
716
|
+
children: e,
|
|
718
717
|
clearAnnouncementDelay: o,
|
|
719
718
|
clearAnnouncementTimeoutRef: n,
|
|
720
719
|
onAnnouncementClear: a,
|
|
721
720
|
dispatch: r
|
|
722
721
|
}) => {
|
|
723
|
-
clearTimeout(n.current),
|
|
722
|
+
clearTimeout(n.current), e !== null && r({
|
|
724
723
|
type: Be,
|
|
725
|
-
payload:
|
|
724
|
+
payload: e
|
|
726
725
|
}), o && (n.current = setTimeout(
|
|
727
|
-
() =>
|
|
726
|
+
() => tr({
|
|
728
727
|
onAnnouncementClear: a,
|
|
729
728
|
dispatch: r
|
|
730
729
|
}),
|
|
731
730
|
o
|
|
732
731
|
));
|
|
733
|
-
},
|
|
734
|
-
children:
|
|
732
|
+
}, rr = ({
|
|
733
|
+
children: e,
|
|
735
734
|
announcementTimeoutRef: o,
|
|
736
735
|
announcementDelay: n,
|
|
737
736
|
clearAnnouncementDelay: a,
|
|
@@ -740,59 +739,59 @@ const Be = "SET_ANNOUNCEMENT", De = "CLEAR_ANNOUNCEMENT", er = {
|
|
|
740
739
|
dispatch: s
|
|
741
740
|
}) => {
|
|
742
741
|
clearTimeout(o.current), n ? o.current = setTimeout(_e, n, {
|
|
743
|
-
children:
|
|
742
|
+
children: e,
|
|
744
743
|
clearAnnouncementDelay: a,
|
|
745
744
|
clearAnnouncementTimeoutRef: r,
|
|
746
745
|
onAnnouncementClear: c,
|
|
747
746
|
dispatch: s
|
|
748
747
|
}) : _e({
|
|
749
|
-
children:
|
|
748
|
+
children: e,
|
|
750
749
|
clearAnnouncementDelay: a,
|
|
751
750
|
clearAnnouncementTimeoutRef: r,
|
|
752
751
|
onAnnouncementClear: c,
|
|
753
752
|
dispatch: s
|
|
754
753
|
});
|
|
755
754
|
};
|
|
756
|
-
function
|
|
757
|
-
children:
|
|
755
|
+
function ar({
|
|
756
|
+
children: e,
|
|
758
757
|
className: o,
|
|
759
758
|
politeness: n,
|
|
760
759
|
role: a = null,
|
|
761
760
|
announcementDelay: r,
|
|
762
761
|
clearAnnouncementDelay: c,
|
|
763
762
|
onAnnouncementClear: s,
|
|
764
|
-
visible:
|
|
763
|
+
visible: i,
|
|
765
764
|
...m
|
|
766
765
|
}) {
|
|
767
|
-
const
|
|
766
|
+
const p = v(null), h = v(null), [y, x] = It(er, {
|
|
768
767
|
announcement: null
|
|
769
768
|
});
|
|
770
769
|
let l = n;
|
|
771
|
-
typeof l > "u" && (l = a ?
|
|
772
|
-
|
|
773
|
-
announcementTimeoutRef:
|
|
770
|
+
typeof l > "u" && (l = a ? Jt[a] : "assertive"), F(() => {
|
|
771
|
+
rr({
|
|
772
|
+
announcementTimeoutRef: p,
|
|
774
773
|
announcementDelay: r,
|
|
775
|
-
children:
|
|
774
|
+
children: e,
|
|
776
775
|
clearAnnouncementDelay: c,
|
|
777
|
-
clearAnnouncementTimeoutRef:
|
|
776
|
+
clearAnnouncementTimeoutRef: h,
|
|
778
777
|
onAnnouncementClear: s,
|
|
779
|
-
dispatch:
|
|
778
|
+
dispatch: x
|
|
780
779
|
});
|
|
781
780
|
}, [
|
|
782
|
-
|
|
781
|
+
e,
|
|
783
782
|
r,
|
|
784
783
|
c,
|
|
785
784
|
s
|
|
786
785
|
]);
|
|
787
|
-
const
|
|
788
|
-
"sr-only": !
|
|
786
|
+
const f = g(o, {
|
|
787
|
+
"sr-only": !i
|
|
789
788
|
});
|
|
790
|
-
return /* @__PURE__ */
|
|
789
|
+
return /* @__PURE__ */ t(
|
|
791
790
|
"div",
|
|
792
791
|
{
|
|
793
792
|
"aria-live": l,
|
|
794
793
|
...a && { role: a },
|
|
795
|
-
className:
|
|
794
|
+
className: f,
|
|
796
795
|
...m,
|
|
797
796
|
children: y.announcement
|
|
798
797
|
}
|
|
@@ -811,28 +810,28 @@ try {
|
|
|
811
810
|
});
|
|
812
811
|
} catch {
|
|
813
812
|
}
|
|
814
|
-
const
|
|
815
|
-
"bg-surface-darker text-copy-lighter caret-copy-light":
|
|
816
|
-
"bg-surface-lighter text-copy-dark caret-copy-dark":
|
|
817
|
-
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light":
|
|
818
|
-
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark":
|
|
819
|
-
}),
|
|
820
|
-
focusMode:
|
|
813
|
+
const nr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", or = ({ mode: e }) => g({
|
|
814
|
+
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
815
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
816
|
+
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
817
|
+
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
818
|
+
}), sr = ({
|
|
819
|
+
focusMode: e
|
|
821
820
|
}) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
822
|
-
"focus:outline-focus-dark":
|
|
823
|
-
"focus:outline-focus-light":
|
|
824
|
-
"focus:outline-focus-light dark:focus:outline-focus-dark":
|
|
825
|
-
"focus:outline-focus-dark dark:focus:outline-focus-light":
|
|
826
|
-
}),
|
|
827
|
-
noBorder:
|
|
821
|
+
"focus:outline-focus-dark": e === "dark",
|
|
822
|
+
"focus:outline-focus-light": e === "light",
|
|
823
|
+
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
824
|
+
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
825
|
+
}), lr = ({
|
|
826
|
+
noBorder: e,
|
|
828
827
|
error: o
|
|
829
828
|
}) => g("border-2", {
|
|
830
|
-
"border-border-dark": !
|
|
831
|
-
"focus:border-border-dark": !
|
|
832
|
-
"border-border-error-dark": !
|
|
833
|
-
"border-transparent":
|
|
834
|
-
}),
|
|
835
|
-
disabled:
|
|
829
|
+
"border-border-dark": !e && !o,
|
|
830
|
+
"focus:border-border-dark": !e && o,
|
|
831
|
+
"border-border-error-dark": !e && o,
|
|
832
|
+
"border-transparent": e
|
|
833
|
+
}), cr = ({
|
|
834
|
+
disabled: e,
|
|
836
835
|
raw: o,
|
|
837
836
|
error: n,
|
|
838
837
|
mode: a,
|
|
@@ -841,7 +840,7 @@ const or = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
841
840
|
}) => {
|
|
842
841
|
if (o)
|
|
843
842
|
return "";
|
|
844
|
-
if (
|
|
843
|
+
if (e)
|
|
845
844
|
return g(
|
|
846
845
|
"transform translate-y-0 scale-100 absolute px-2 cursor-not-allowed opacity-50 font-medium",
|
|
847
846
|
{
|
|
@@ -870,8 +869,8 @@ const or = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
870
869
|
"text-copy-medium dark:text-copy-error-dark": a === "alt-system"
|
|
871
870
|
}
|
|
872
871
|
);
|
|
873
|
-
},
|
|
874
|
-
error:
|
|
872
|
+
}, ir = ({
|
|
873
|
+
error: e,
|
|
875
874
|
raw: o,
|
|
876
875
|
mode: n,
|
|
877
876
|
disabled: a
|
|
@@ -880,133 +879,133 @@ const or = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
880
879
|
return "";
|
|
881
880
|
if (a)
|
|
882
881
|
return g(
|
|
883
|
-
|
|
882
|
+
ue,
|
|
884
883
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
885
884
|
);
|
|
886
|
-
if (!
|
|
887
|
-
return g(
|
|
885
|
+
if (!e)
|
|
886
|
+
return g(ue, "absolute px-2 font-medium", {
|
|
888
887
|
"text-copy-medium": n === "dark",
|
|
889
888
|
"text-copy-dark": n === "light",
|
|
890
889
|
"text-copy-dark dark:text-copy-medium": n === "system",
|
|
891
890
|
"text-copy-medium dark:text-copy-dark": n === "alt-system"
|
|
892
891
|
});
|
|
893
|
-
if (
|
|
894
|
-
return g(
|
|
892
|
+
if (e)
|
|
893
|
+
return g(ue, "absolute px-2 font-medium", {
|
|
895
894
|
"text-copy-error-light": n === "dark",
|
|
896
895
|
"text-copy-error-dark": n === "light",
|
|
897
896
|
"text-copy-error-dark dark:text-copy-error-light": n === "system",
|
|
898
897
|
"dark:text-copy-error-dark text-copy-error-light": n === "alt-system"
|
|
899
898
|
});
|
|
900
|
-
},
|
|
901
|
-
className:
|
|
899
|
+
}, dr = ({
|
|
900
|
+
className: e,
|
|
902
901
|
textAreaClassName: o,
|
|
903
902
|
raw: n,
|
|
904
903
|
focusMode: a,
|
|
905
904
|
disabled: r,
|
|
906
905
|
noBorder: c,
|
|
907
906
|
error: s,
|
|
908
|
-
mode:
|
|
907
|
+
mode: i,
|
|
909
908
|
leftElement: m,
|
|
910
|
-
rightElement:
|
|
909
|
+
rightElement: p
|
|
911
910
|
}) => {
|
|
912
|
-
const
|
|
911
|
+
const h = n ? e : g(
|
|
913
912
|
"relative flex w-full flex-col justify-center",
|
|
914
|
-
|
|
915
|
-
|
|
913
|
+
Yt,
|
|
914
|
+
e
|
|
916
915
|
), y = n ? g(o) : g(
|
|
917
916
|
He,
|
|
918
917
|
o,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
918
|
+
nr(),
|
|
919
|
+
or({ mode: i }),
|
|
920
|
+
sr({ focusMode: a }),
|
|
921
|
+
lr({
|
|
923
922
|
noBorder: c,
|
|
924
923
|
error: s
|
|
925
924
|
}),
|
|
926
925
|
{
|
|
927
926
|
"disabled:cursor-not-allowed disabled:opacity-50": r
|
|
928
927
|
}
|
|
929
|
-
),
|
|
928
|
+
), x = n ? void 0 : "sr-only", l = cr({
|
|
930
929
|
disabled: r,
|
|
931
930
|
raw: n,
|
|
932
931
|
error: s,
|
|
933
|
-
mode:
|
|
934
|
-
rightElement:
|
|
932
|
+
mode: i,
|
|
933
|
+
rightElement: p,
|
|
935
934
|
leftElement: m
|
|
936
|
-
}),
|
|
935
|
+
}), f = ir({
|
|
937
936
|
error: s,
|
|
938
937
|
raw: n,
|
|
939
|
-
mode:
|
|
938
|
+
mode: i,
|
|
940
939
|
disabled: r
|
|
941
|
-
}),
|
|
940
|
+
}), T = n ? void 0 : g(jt, "absolute"), S = n ? void 0 : g(Kt, "absolute");
|
|
942
941
|
return {
|
|
943
|
-
wrapper:
|
|
942
|
+
wrapper: h,
|
|
944
943
|
textArea: y,
|
|
945
|
-
accessibleLabel:
|
|
944
|
+
accessibleLabel: x,
|
|
946
945
|
visibleLabel: l,
|
|
947
|
-
helperText:
|
|
948
|
-
rightElement:
|
|
949
|
-
leftElement:
|
|
946
|
+
helperText: f,
|
|
947
|
+
rightElement: T,
|
|
948
|
+
leftElement: S
|
|
950
949
|
};
|
|
951
|
-
},
|
|
952
|
-
scrollHeight:
|
|
950
|
+
}, ur = ({
|
|
951
|
+
scrollHeight: e,
|
|
953
952
|
currentHeight: o,
|
|
954
953
|
currentLabelOffset: n = 0,
|
|
955
954
|
currentHelperTextOffset: a = 0
|
|
956
955
|
}) => {
|
|
957
956
|
let r, c;
|
|
958
|
-
if (
|
|
959
|
-
const s =
|
|
960
|
-
r = n + -1 * Math.sign(s) * (12 *
|
|
957
|
+
if (e > 0 && e !== o) {
|
|
958
|
+
const s = e - o, i = Math.abs(s / 24);
|
|
959
|
+
r = n + -1 * Math.sign(s) * (12 * i), c = a + Math.sign(s) * (12 * i);
|
|
961
960
|
}
|
|
962
961
|
return {
|
|
963
962
|
labelOffset: r,
|
|
964
963
|
helperTextOffset: c,
|
|
965
|
-
scrollHeight:
|
|
964
|
+
scrollHeight: e
|
|
966
965
|
};
|
|
967
|
-
},
|
|
966
|
+
}, he = wt.forwardRef(
|
|
968
967
|
({
|
|
969
|
-
id:
|
|
968
|
+
id: e,
|
|
970
969
|
name: o,
|
|
971
970
|
label: n,
|
|
972
971
|
error: a = !1,
|
|
973
972
|
raw: r = !1,
|
|
974
973
|
className: c,
|
|
975
974
|
textAreaClassName: s,
|
|
976
|
-
mode:
|
|
975
|
+
mode: i = "system",
|
|
977
976
|
focusMode: m = "system",
|
|
978
|
-
value:
|
|
979
|
-
defaultValue:
|
|
977
|
+
value: p,
|
|
978
|
+
defaultValue: h,
|
|
980
979
|
disabled: y = !1,
|
|
981
|
-
noBorder:
|
|
980
|
+
noBorder: x = !1,
|
|
982
981
|
labelId: l,
|
|
983
|
-
helperText:
|
|
984
|
-
helperTextOnFocus:
|
|
985
|
-
rightElement:
|
|
982
|
+
helperText: f = "",
|
|
983
|
+
helperTextOnFocus: T = !1,
|
|
984
|
+
rightElement: S,
|
|
986
985
|
leftElement: b,
|
|
987
986
|
onChange: _,
|
|
988
987
|
onFocus: I,
|
|
989
988
|
onBlur: u,
|
|
990
989
|
...w
|
|
991
|
-
},
|
|
992
|
-
var
|
|
993
|
-
const
|
|
994
|
-
!!(!
|
|
995
|
-
), Ue = `${o} error, ${
|
|
990
|
+
}, R) => {
|
|
991
|
+
var E;
|
|
992
|
+
const N = v(null), O = Xt([R, N]), [be, U] = Ie(), [Y, z] = Ie(), j = v(80), ae = v(-25), H = v(null), xe = v(30), le = v(null), X = Zt({ id: e, prefix: `${He}-` }), [ke, $e] = C(0), [Ce, Ve] = C(0), [Fe, Te] = C(
|
|
993
|
+
!!(!T && f)
|
|
994
|
+
), Ue = `${o} error, ${f}`, G = dr({
|
|
996
995
|
className: c,
|
|
997
996
|
textAreaClassName: s,
|
|
998
997
|
error: a,
|
|
999
998
|
raw: r,
|
|
1000
999
|
focusMode: m,
|
|
1001
1000
|
disabled: y,
|
|
1002
|
-
noBorder:
|
|
1003
|
-
mode:
|
|
1004
|
-
rightElement: !!
|
|
1001
|
+
noBorder: x,
|
|
1002
|
+
mode: i,
|
|
1003
|
+
rightElement: !!S,
|
|
1005
1004
|
leftElement: !!b
|
|
1006
|
-
}), [
|
|
1007
|
-
value:
|
|
1005
|
+
}), [B, Ge] = Qt({
|
|
1006
|
+
value: p,
|
|
1008
1007
|
initialControlledDelay: 20,
|
|
1009
|
-
defaultValue:
|
|
1008
|
+
defaultValue: h,
|
|
1010
1009
|
onChange: (A) => {
|
|
1011
1010
|
_ && _({
|
|
1012
1011
|
target: {
|
|
@@ -1017,121 +1016,121 @@ const or = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
1017
1016
|
}), Ye = (A) => {
|
|
1018
1017
|
Ge(A.target.value);
|
|
1019
1018
|
}, je = (A) => {
|
|
1020
|
-
|
|
1019
|
+
T && f && Te(!0), I && I(A);
|
|
1021
1020
|
}, Ke = (A) => {
|
|
1022
|
-
|
|
1021
|
+
T && f && !B && Te(!1), u && u(A);
|
|
1023
1022
|
};
|
|
1024
|
-
return
|
|
1025
|
-
|
|
1026
|
-
}, [
|
|
1027
|
-
z && z.width &&
|
|
1028
|
-
}, [z]),
|
|
1029
|
-
r ||
|
|
1030
|
-
}, [
|
|
1023
|
+
return Z(() => {
|
|
1024
|
+
U && U.width && $e(U.width + 18 + 10);
|
|
1025
|
+
}, [U]), Z(() => {
|
|
1026
|
+
z && z.width && Ve(z.width + 18 + 10);
|
|
1027
|
+
}, [z]), Z(() => {
|
|
1028
|
+
r || N && N.current && B !== void 0 && (N.current.style.height = "inherit", N.current.style.height = N.current.scrollHeight + "px");
|
|
1029
|
+
}, [B, r]), Z(() => {
|
|
1031
1030
|
r || setTimeout(() => {
|
|
1032
1031
|
var A;
|
|
1033
|
-
(A =
|
|
1032
|
+
(A = H == null ? void 0 : H.current) == null || A.style.setProperty(
|
|
1034
1033
|
"--av-text-area-wrapper-transition",
|
|
1035
|
-
|
|
1034
|
+
B ? "none" : "all 0.2s ease-out"
|
|
1036
1035
|
);
|
|
1037
1036
|
}, 0);
|
|
1038
|
-
}, [
|
|
1037
|
+
}, [B, r]), Z(() => {
|
|
1039
1038
|
var A, Ee;
|
|
1040
|
-
if (!r &&
|
|
1041
|
-
const { labelOffset:
|
|
1042
|
-
scrollHeight:
|
|
1043
|
-
currentHeight:
|
|
1044
|
-
currentLabelOffset:
|
|
1045
|
-
currentHelperTextOffset:
|
|
1039
|
+
if (!r && N && N.current && B !== void 0) {
|
|
1040
|
+
const { labelOffset: ce, helperTextOffset: ie, scrollHeight: We } = ur({
|
|
1041
|
+
scrollHeight: N.current.scrollHeight,
|
|
1042
|
+
currentHeight: j.current,
|
|
1043
|
+
currentLabelOffset: ae.current,
|
|
1044
|
+
currentHelperTextOffset: xe.current
|
|
1046
1045
|
});
|
|
1047
|
-
|
|
1046
|
+
ce && (ae.current = ce, (A = H == null ? void 0 : H.current) == null || A.style.setProperty(
|
|
1048
1047
|
"--av-text-area-label",
|
|
1049
|
-
`${
|
|
1050
|
-
)),
|
|
1048
|
+
`${ce}px`
|
|
1049
|
+
)), ie && (xe.current = ie, (Ee = le == null ? void 0 : le.current) == null || Ee.style.setProperty(
|
|
1051
1050
|
"--av-text-area-helper-text",
|
|
1052
|
-
`${
|
|
1053
|
-
)),
|
|
1051
|
+
`${ie}px`
|
|
1052
|
+
)), j.current = We || j.current;
|
|
1054
1053
|
}
|
|
1055
|
-
}, [
|
|
1054
|
+
}, [B, r]), z.width > 0 && ((E = H == null ? void 0 : H.current) == null || E.style.setProperty(
|
|
1056
1055
|
"--tw-translate-x",
|
|
1057
1056
|
`${12 + z.width + 5}px`
|
|
1058
|
-
)), /* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1057
|
+
)), /* @__PURE__ */ d("div", { className: G.wrapper, children: [
|
|
1058
|
+
/* @__PURE__ */ t(
|
|
1060
1059
|
"label",
|
|
1061
1060
|
{
|
|
1062
|
-
htmlFor:
|
|
1061
|
+
htmlFor: X,
|
|
1063
1062
|
id: l,
|
|
1064
|
-
className:
|
|
1063
|
+
className: G.accessibleLabel,
|
|
1065
1064
|
children: n
|
|
1066
1065
|
}
|
|
1067
1066
|
),
|
|
1068
|
-
b && /* @__PURE__ */
|
|
1067
|
+
b && /* @__PURE__ */ t(
|
|
1069
1068
|
"div",
|
|
1070
1069
|
{
|
|
1071
|
-
ref:
|
|
1072
|
-
className:
|
|
1070
|
+
ref: Y,
|
|
1071
|
+
className: G.leftElement,
|
|
1073
1072
|
children: b
|
|
1074
1073
|
}
|
|
1075
1074
|
),
|
|
1076
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ t(
|
|
1077
1076
|
"textarea",
|
|
1078
1077
|
{
|
|
1079
|
-
ref:
|
|
1080
|
-
id:
|
|
1078
|
+
ref: O,
|
|
1079
|
+
id: X,
|
|
1081
1080
|
name: o,
|
|
1082
1081
|
disabled: y,
|
|
1083
1082
|
placeholder: r ? void 0 : " ",
|
|
1084
|
-
className:
|
|
1083
|
+
className: G.textArea,
|
|
1085
1084
|
rows: 1,
|
|
1086
|
-
...
|
|
1085
|
+
...f && { "aria-describedby": `${X}-helper` },
|
|
1087
1086
|
...a && { "aria-invalid": "true" },
|
|
1088
|
-
...
|
|
1089
|
-
...b && !
|
|
1090
|
-
...
|
|
1087
|
+
...S && !b && !r && { style: { paddingRight: ke } },
|
|
1088
|
+
...b && !S && !r && { style: { paddingLeft: Ce } },
|
|
1089
|
+
...S && b && !r && {
|
|
1091
1090
|
style: {
|
|
1092
1091
|
paddingRight: ke,
|
|
1093
1092
|
paddingLeft: Ce
|
|
1094
1093
|
}
|
|
1095
1094
|
},
|
|
1096
|
-
value:
|
|
1095
|
+
value: B,
|
|
1097
1096
|
onChange: Ye,
|
|
1098
1097
|
onFocus: je,
|
|
1099
1098
|
onBlur: Ke,
|
|
1100
1099
|
...w
|
|
1101
1100
|
}
|
|
1102
1101
|
),
|
|
1103
|
-
!r && /* @__PURE__ */
|
|
1102
|
+
!r && /* @__PURE__ */ t(
|
|
1104
1103
|
"label",
|
|
1105
1104
|
{
|
|
1106
|
-
ref:
|
|
1105
|
+
ref: H,
|
|
1107
1106
|
"aria-hidden": !0,
|
|
1108
|
-
htmlFor:
|
|
1109
|
-
className: `${
|
|
1107
|
+
htmlFor: X,
|
|
1108
|
+
className: `${G.visibleLabel}`,
|
|
1110
1109
|
children: n
|
|
1111
1110
|
}
|
|
1112
1111
|
),
|
|
1113
|
-
Fe && /* @__PURE__ */
|
|
1112
|
+
Fe && /* @__PURE__ */ t(
|
|
1114
1113
|
"div",
|
|
1115
1114
|
{
|
|
1116
|
-
ref:
|
|
1117
|
-
id: `${
|
|
1118
|
-
className:
|
|
1119
|
-
children:
|
|
1115
|
+
ref: le,
|
|
1116
|
+
id: `${X}-helper`,
|
|
1117
|
+
className: G.helperText,
|
|
1118
|
+
children: f
|
|
1120
1119
|
}
|
|
1121
1120
|
),
|
|
1122
|
-
|
|
1121
|
+
S && /* @__PURE__ */ t(
|
|
1123
1122
|
"div",
|
|
1124
1123
|
{
|
|
1125
|
-
ref:
|
|
1126
|
-
className:
|
|
1127
|
-
children:
|
|
1124
|
+
ref: be,
|
|
1125
|
+
className: G.rightElement,
|
|
1126
|
+
children: S
|
|
1128
1127
|
}
|
|
1129
1128
|
),
|
|
1130
|
-
a &&
|
|
1129
|
+
a && f && /* @__PURE__ */ t(ar, { politeness: "polite", clearAnnouncementDelay: 500, children: Ue })
|
|
1131
1130
|
] });
|
|
1132
1131
|
}
|
|
1133
1132
|
);
|
|
1134
|
-
|
|
1133
|
+
he.displayName = "TextArea";
|
|
1135
1134
|
/*!
|
|
1136
1135
|
@versini/ui-toggle v3.0.9
|
|
1137
1136
|
© 2025 gizmette.com
|
|
@@ -1145,26 +1144,26 @@ try {
|
|
|
1145
1144
|
});
|
|
1146
1145
|
} catch {
|
|
1147
1146
|
}
|
|
1148
|
-
const
|
|
1149
|
-
focusMode:
|
|
1147
|
+
const mr = "av-toggle", hr = () => g("peer", "h-6", "w-11", "rounded-full"), fr = ({
|
|
1148
|
+
focusMode: e
|
|
1150
1149
|
}) => g(
|
|
1151
1150
|
"peer-focus:outline",
|
|
1152
1151
|
"peer-focus:outline-2",
|
|
1153
1152
|
"peer-focus:outline-offset-2",
|
|
1154
1153
|
{
|
|
1155
|
-
"peer-focus:outline-focus-dark":
|
|
1156
|
-
"peer-focus:outline-focus-light":
|
|
1157
|
-
"peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark":
|
|
1158
|
-
"peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light":
|
|
1154
|
+
"peer-focus:outline-focus-dark": e === "dark",
|
|
1155
|
+
"peer-focus:outline-focus-light": e === "light",
|
|
1156
|
+
"peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": e === "alt-system",
|
|
1157
|
+
"peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": e === "system"
|
|
1159
1158
|
}
|
|
1160
|
-
),
|
|
1159
|
+
), pr = () => g(
|
|
1161
1160
|
"peer-checked:after:translate-x-full",
|
|
1162
1161
|
// background color when checked
|
|
1163
1162
|
"peer-checked:bg-violet-500",
|
|
1164
1163
|
// knob circle and border color when checked
|
|
1165
1164
|
"peer-checked:after:bg-white",
|
|
1166
1165
|
"peer-checked:after:border-white"
|
|
1167
|
-
),
|
|
1166
|
+
), gr = () => g(
|
|
1168
1167
|
"after:left-[2px]",
|
|
1169
1168
|
"after:top-[2px]",
|
|
1170
1169
|
"after:border",
|
|
@@ -1176,108 +1175,108 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1176
1175
|
"after:rounded-full",
|
|
1177
1176
|
"after:transition-all",
|
|
1178
1177
|
"after:content-['']"
|
|
1179
|
-
),
|
|
1180
|
-
mode:
|
|
1178
|
+
), yr = ({
|
|
1179
|
+
mode: e,
|
|
1181
1180
|
noBorder: o
|
|
1182
1181
|
}) => g({
|
|
1183
1182
|
border: !o,
|
|
1184
|
-
"border-border-dark bg-surface-medium":
|
|
1185
|
-
"border-border-light bg-surface-darker":
|
|
1186
|
-
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium":
|
|
1187
|
-
"border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker":
|
|
1188
|
-
}),
|
|
1189
|
-
mode:
|
|
1183
|
+
"border-border-dark bg-surface-medium": e === "light",
|
|
1184
|
+
"border-border-light bg-surface-darker": e === "dark",
|
|
1185
|
+
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": e === "alt-system",
|
|
1186
|
+
"border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": e === "system"
|
|
1187
|
+
}), br = ({
|
|
1188
|
+
mode: e,
|
|
1190
1189
|
labelHidden: o
|
|
1191
1190
|
}) => o ? "sr-only" : g("ml-2 text-sm", {
|
|
1192
|
-
"text-copy-dark":
|
|
1193
|
-
"text-copy-lighter":
|
|
1194
|
-
"text-copy-lighter dark:text-copy-dark":
|
|
1195
|
-
"text-copy-dark dark:text-copy-lighter":
|
|
1196
|
-
}),
|
|
1197
|
-
|
|
1191
|
+
"text-copy-dark": e === "light",
|
|
1192
|
+
"text-copy-lighter": e === "dark",
|
|
1193
|
+
"text-copy-lighter dark:text-copy-dark": e === "alt-system",
|
|
1194
|
+
"text-copy-dark dark:text-copy-lighter": e === "system"
|
|
1195
|
+
}), xr = ({ className: e }) => g(
|
|
1196
|
+
mr,
|
|
1198
1197
|
"relative flex cursor-pointer items-center",
|
|
1199
|
-
|
|
1200
|
-
),
|
|
1201
|
-
mode:
|
|
1198
|
+
e
|
|
1199
|
+
), kr = ({
|
|
1200
|
+
mode: e,
|
|
1202
1201
|
focusMode: o,
|
|
1203
1202
|
labelHidden: n,
|
|
1204
1203
|
className: a,
|
|
1205
1204
|
noBorder: r
|
|
1206
1205
|
}) => ({
|
|
1207
1206
|
toggle: g(
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1207
|
+
hr(),
|
|
1208
|
+
yr({ mode: e, noBorder: r }),
|
|
1209
|
+
fr({ focusMode: o }),
|
|
1210
|
+
gr(),
|
|
1211
|
+
pr()
|
|
1213
1212
|
),
|
|
1214
|
-
label:
|
|
1213
|
+
label: br({ mode: e, labelHidden: n }),
|
|
1215
1214
|
input: "peer sr-only",
|
|
1216
|
-
wrapper:
|
|
1217
|
-
}),
|
|
1218
|
-
checked:
|
|
1215
|
+
wrapper: xr({ className: a })
|
|
1216
|
+
}), fe = ({
|
|
1217
|
+
checked: e = !1,
|
|
1219
1218
|
onChange: o,
|
|
1220
1219
|
label: n,
|
|
1221
1220
|
labelHidden: a = !1,
|
|
1222
1221
|
name: r,
|
|
1223
1222
|
mode: c = "system",
|
|
1224
1223
|
focusMode: s = "system",
|
|
1225
|
-
className:
|
|
1224
|
+
className: i,
|
|
1226
1225
|
noBorder: m = !1
|
|
1227
1226
|
}) => {
|
|
1228
|
-
const
|
|
1227
|
+
const p = kr({
|
|
1229
1228
|
mode: c,
|
|
1230
1229
|
focusMode: s,
|
|
1231
1230
|
labelHidden: a,
|
|
1232
|
-
className:
|
|
1231
|
+
className: i,
|
|
1233
1232
|
noBorder: m
|
|
1234
|
-
}),
|
|
1233
|
+
}), h = (y) => {
|
|
1235
1234
|
o == null || o(y.target.checked);
|
|
1236
1235
|
};
|
|
1237
|
-
return /* @__PURE__ */
|
|
1238
|
-
/* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ d("label", { className: p.wrapper, children: [
|
|
1237
|
+
/* @__PURE__ */ t(
|
|
1239
1238
|
"input",
|
|
1240
1239
|
{
|
|
1241
1240
|
name: r,
|
|
1242
|
-
checked:
|
|
1241
|
+
checked: e,
|
|
1243
1242
|
type: "checkbox",
|
|
1244
|
-
className:
|
|
1245
|
-
onChange:
|
|
1243
|
+
className: p.input,
|
|
1244
|
+
onChange: h
|
|
1246
1245
|
}
|
|
1247
1246
|
),
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ t("div", { className: p.toggle }),
|
|
1248
|
+
/* @__PURE__ */ t("span", { className: p.label, children: n })
|
|
1250
1249
|
] });
|
|
1251
|
-
},
|
|
1252
|
-
open:
|
|
1250
|
+
}, Cr = ({
|
|
1251
|
+
open: e,
|
|
1253
1252
|
onOpenChange: o
|
|
1254
1253
|
}) => {
|
|
1255
|
-
const { getAccessToken: n, user: a } =
|
|
1254
|
+
const { getAccessToken: n, user: a } = V(), {
|
|
1256
1255
|
data: r,
|
|
1257
1256
|
error: c,
|
|
1258
1257
|
isLoading: s,
|
|
1259
|
-
mutate:
|
|
1258
|
+
mutate: i
|
|
1260
1259
|
} = Me({
|
|
1261
1260
|
keys: [a == null ? void 0 : a.username],
|
|
1262
1261
|
getAccessToken: n,
|
|
1263
1262
|
isPaused: !0
|
|
1264
|
-
}), [m,
|
|
1263
|
+
}), [m, p] = C({
|
|
1265
1264
|
prompts: []
|
|
1266
|
-
}),
|
|
1265
|
+
}), h = ({
|
|
1267
1266
|
slot: l,
|
|
1268
|
-
checked:
|
|
1269
|
-
label:
|
|
1270
|
-
content:
|
|
1267
|
+
checked: f,
|
|
1268
|
+
label: T,
|
|
1269
|
+
content: S,
|
|
1271
1270
|
privateChat: b = !1
|
|
1272
1271
|
}) => {
|
|
1273
|
-
|
|
1272
|
+
p((_) => {
|
|
1274
1273
|
const I = _.prompts, u = {
|
|
1275
1274
|
slot: l,
|
|
1276
|
-
label:
|
|
1277
|
-
content:
|
|
1278
|
-
enabled:
|
|
1275
|
+
label: T,
|
|
1276
|
+
content: S,
|
|
1277
|
+
enabled: f,
|
|
1279
1278
|
privateChat: b
|
|
1280
|
-
}, w = I.findIndex((
|
|
1279
|
+
}, w = I.findIndex((R) => R.slot === l);
|
|
1281
1280
|
return w === -1 ? {
|
|
1282
1281
|
..._,
|
|
1283
1282
|
prompts: [...I, { ...u, slot: l }]
|
|
@@ -1289,9 +1288,9 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1289
1288
|
}, y = async (l) => {
|
|
1290
1289
|
l.preventDefault();
|
|
1291
1290
|
try {
|
|
1292
|
-
await
|
|
1291
|
+
await ee({
|
|
1293
1292
|
accessToken: await n(),
|
|
1294
|
-
type:
|
|
1293
|
+
type: te.SET_USER_PREFERENCES,
|
|
1295
1294
|
params: {
|
|
1296
1295
|
user: a == null ? void 0 : a.username,
|
|
1297
1296
|
tags: m.prompts
|
|
@@ -1299,36 +1298,36 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1299
1298
|
});
|
|
1300
1299
|
} catch {
|
|
1301
1300
|
}
|
|
1302
|
-
},
|
|
1303
|
-
|
|
1301
|
+
}, x = () => {
|
|
1302
|
+
i({ ...r }), o(!1);
|
|
1304
1303
|
};
|
|
1305
1304
|
return F(() => {
|
|
1306
|
-
r != null && r.tags &&
|
|
1307
|
-
}, [r]), c || s ? null : /* @__PURE__ */
|
|
1308
|
-
|
|
1305
|
+
r != null && r.tags && p({ prompts: r.tags });
|
|
1306
|
+
}, [r]), c || s ? null : /* @__PURE__ */ d(
|
|
1307
|
+
re,
|
|
1309
1308
|
{
|
|
1310
|
-
open:
|
|
1311
|
-
onOpenChange:
|
|
1309
|
+
open: e,
|
|
1310
|
+
onOpenChange: x,
|
|
1312
1311
|
title: "Prompts",
|
|
1313
|
-
footer: /* @__PURE__ */
|
|
1314
|
-
|
|
1312
|
+
footer: /* @__PURE__ */ d(
|
|
1313
|
+
W,
|
|
1315
1314
|
{
|
|
1316
1315
|
columnGap: 2,
|
|
1317
1316
|
alignHorizontal: "flex-end",
|
|
1318
1317
|
className: "pb-8 sm:pb-0",
|
|
1319
1318
|
children: [
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
|
|
1319
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
|
1320
|
+
K,
|
|
1322
1321
|
{
|
|
1323
1322
|
mode: "dark",
|
|
1324
1323
|
variant: "secondary",
|
|
1325
1324
|
focusMode: "light",
|
|
1326
|
-
onClick:
|
|
1325
|
+
onClick: x,
|
|
1327
1326
|
children: "Cancel"
|
|
1328
1327
|
}
|
|
1329
1328
|
) }),
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
|
|
1329
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
|
1330
|
+
K,
|
|
1332
1331
|
{
|
|
1333
1332
|
mode: "dark",
|
|
1334
1333
|
variant: "danger",
|
|
@@ -1343,58 +1342,58 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1343
1342
|
}
|
|
1344
1343
|
),
|
|
1345
1344
|
children: [
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
m.prompts && m.prompts.map((l) => /* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ t("p", { children: ot }),
|
|
1346
|
+
m.prompts && m.prompts.map((l) => /* @__PURE__ */ d(
|
|
1348
1347
|
P,
|
|
1349
1348
|
{
|
|
1350
1349
|
header: `Prompt ${l.slot + 1}`,
|
|
1351
1350
|
className: "prose-dark dark:prose-lighter mb-2",
|
|
1352
1351
|
children: [
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
|
|
1352
|
+
/* @__PURE__ */ d(W, { className: "mt-8 mb-6", columnGap: 2, rowGap: 6, children: [
|
|
1353
|
+
/* @__PURE__ */ t(M, { span: 12, children: /* @__PURE__ */ t(
|
|
1354
|
+
me,
|
|
1356
1355
|
{
|
|
1357
1356
|
label: "Label",
|
|
1358
1357
|
name: `prompt${l.slot}-label`,
|
|
1359
1358
|
value: l.label,
|
|
1360
|
-
onChange: (
|
|
1361
|
-
|
|
1359
|
+
onChange: (f) => {
|
|
1360
|
+
h({
|
|
1362
1361
|
slot: l.slot,
|
|
1363
1362
|
checked: l.enabled,
|
|
1364
|
-
label:
|
|
1363
|
+
label: f.target.value,
|
|
1365
1364
|
content: l.content
|
|
1366
1365
|
});
|
|
1367
1366
|
}
|
|
1368
1367
|
}
|
|
1369
1368
|
) }),
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
|
|
1369
|
+
/* @__PURE__ */ t(M, { span: 12, children: /* @__PURE__ */ t(
|
|
1370
|
+
me,
|
|
1372
1371
|
{
|
|
1373
1372
|
label: "Content",
|
|
1374
1373
|
name: `prompt${l.slot}-content`,
|
|
1375
1374
|
value: l.content,
|
|
1376
|
-
onChange: (
|
|
1377
|
-
|
|
1375
|
+
onChange: (f) => {
|
|
1376
|
+
h({
|
|
1378
1377
|
slot: l.slot,
|
|
1379
1378
|
checked: l.enabled,
|
|
1380
1379
|
label: l.label,
|
|
1381
|
-
content:
|
|
1380
|
+
content: f.target.value
|
|
1382
1381
|
});
|
|
1383
1382
|
}
|
|
1384
1383
|
}
|
|
1385
1384
|
) })
|
|
1386
1385
|
] }),
|
|
1387
|
-
/* @__PURE__ */
|
|
1388
|
-
|
|
1386
|
+
/* @__PURE__ */ t(
|
|
1387
|
+
fe,
|
|
1389
1388
|
{
|
|
1390
1389
|
className: "mt-2",
|
|
1391
1390
|
noBorder: !0,
|
|
1392
1391
|
label: "Enabled",
|
|
1393
1392
|
name: l.slot.toString(),
|
|
1394
|
-
onChange: (
|
|
1395
|
-
|
|
1393
|
+
onChange: (f) => {
|
|
1394
|
+
h({
|
|
1396
1395
|
slot: l.slot,
|
|
1397
|
-
checked:
|
|
1396
|
+
checked: f,
|
|
1398
1397
|
label: l.label,
|
|
1399
1398
|
content: l.content
|
|
1400
1399
|
});
|
|
@@ -1402,20 +1401,20 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1402
1401
|
checked: l.enabled
|
|
1403
1402
|
}
|
|
1404
1403
|
),
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
|
|
1404
|
+
/* @__PURE__ */ t(
|
|
1405
|
+
fe,
|
|
1407
1406
|
{
|
|
1408
1407
|
className: "mt-2",
|
|
1409
1408
|
noBorder: !0,
|
|
1410
1409
|
label: "Temporary Chat",
|
|
1411
1410
|
name: `private-${l.slot.toString()}`,
|
|
1412
|
-
onChange: (
|
|
1413
|
-
|
|
1411
|
+
onChange: (f) => {
|
|
1412
|
+
h({
|
|
1414
1413
|
slot: l.slot,
|
|
1415
1414
|
checked: l.enabled,
|
|
1416
1415
|
label: l.label,
|
|
1417
1416
|
content: l.content,
|
|
1418
|
-
privateChat:
|
|
1417
|
+
privateChat: f
|
|
1419
1418
|
});
|
|
1420
1419
|
},
|
|
1421
1420
|
checked: l.privateChat
|
|
@@ -1428,104 +1427,104 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1428
1427
|
]
|
|
1429
1428
|
}
|
|
1430
1429
|
);
|
|
1431
|
-
},
|
|
1432
|
-
open:
|
|
1430
|
+
}, Tr = ({
|
|
1431
|
+
open: e,
|
|
1433
1432
|
onOpenChange: o
|
|
1434
1433
|
}) => {
|
|
1435
|
-
const { getAccessToken: n, user: a } =
|
|
1434
|
+
const { getAccessToken: n, user: a } = V(), {
|
|
1436
1435
|
data: r,
|
|
1437
1436
|
error: c,
|
|
1438
1437
|
isLoading: s,
|
|
1439
|
-
mutate:
|
|
1438
|
+
mutate: i
|
|
1440
1439
|
} = Me({
|
|
1441
1440
|
keys: [a == null ? void 0 : a.username],
|
|
1442
1441
|
getAccessToken: n
|
|
1443
|
-
}), [m,
|
|
1442
|
+
}), [m, p] = C(!1), [h, y] = C({
|
|
1444
1443
|
loadingLocation: !1
|
|
1445
|
-
}), [
|
|
1446
|
-
key:
|
|
1444
|
+
}), [x, l] = C(""), [f, T] = C(""), [S, b] = ye({
|
|
1445
|
+
key: ge + st,
|
|
1447
1446
|
initialValue: !1
|
|
1448
|
-
}),
|
|
1449
|
-
|
|
1450
|
-
},
|
|
1451
|
-
|
|
1447
|
+
}), _ = (E) => {
|
|
1448
|
+
b(E);
|
|
1449
|
+
}, I = async (E) => {
|
|
1450
|
+
E.preventDefault();
|
|
1452
1451
|
try {
|
|
1453
|
-
await
|
|
1452
|
+
await ee({
|
|
1454
1453
|
accessToken: await n(),
|
|
1455
|
-
type:
|
|
1454
|
+
type: te.SET_USER_PREFERENCES,
|
|
1456
1455
|
params: {
|
|
1457
1456
|
user: a == null ? void 0 : a.username,
|
|
1458
|
-
instructions:
|
|
1459
|
-
location:
|
|
1460
|
-
provider:
|
|
1457
|
+
instructions: x,
|
|
1458
|
+
location: f,
|
|
1459
|
+
provider: r.provider
|
|
1461
1460
|
}
|
|
1462
|
-
}),
|
|
1461
|
+
}), i(), y({
|
|
1463
1462
|
loadingLocation: !1
|
|
1464
1463
|
});
|
|
1465
1464
|
} catch {
|
|
1466
1465
|
}
|
|
1467
|
-
},
|
|
1466
|
+
}, u = async () => {
|
|
1468
1467
|
y({
|
|
1469
1468
|
loadingLocation: !0
|
|
1470
|
-
}),
|
|
1469
|
+
}), T("...");
|
|
1471
1470
|
try {
|
|
1472
|
-
const
|
|
1471
|
+
const E = Date.now(), N = await it(), O = await ee({
|
|
1473
1472
|
accessToken: await n(),
|
|
1474
|
-
type:
|
|
1473
|
+
type: te.GET_LOCATION,
|
|
1475
1474
|
params: {
|
|
1476
|
-
latitude:
|
|
1477
|
-
longitude:
|
|
1475
|
+
latitude: N.latitude,
|
|
1476
|
+
longitude: N.longitude
|
|
1478
1477
|
}
|
|
1479
|
-
}),
|
|
1480
|
-
if (
|
|
1481
|
-
const { city:
|
|
1478
|
+
}), U = Date.now() - E;
|
|
1479
|
+
if (U < 2e3 && await new Promise((Y) => setTimeout(Y, 2e3 - U)), O.status === 200) {
|
|
1480
|
+
const { city: Y, state: z, country: j, displayName: ae } = O.data, H = Y && z && j ? `${Y}, ${z}, ${j}` : ae;
|
|
1482
1481
|
y({
|
|
1483
1482
|
loadingLocation: !1
|
|
1484
|
-
}),
|
|
1483
|
+
}), T(H);
|
|
1485
1484
|
} else
|
|
1486
1485
|
y({
|
|
1487
1486
|
loadingLocation: !1
|
|
1488
1487
|
});
|
|
1489
1488
|
} catch {
|
|
1490
1489
|
}
|
|
1491
|
-
},
|
|
1492
|
-
|
|
1493
|
-
},
|
|
1494
|
-
|
|
1490
|
+
}, w = () => {
|
|
1491
|
+
p(!m);
|
|
1492
|
+
}, R = () => {
|
|
1493
|
+
i({ ...r }), o(!1);
|
|
1495
1494
|
};
|
|
1496
1495
|
return F(() => {
|
|
1497
|
-
r != null && r.instructions && l(r.instructions), r != null && r.location &&
|
|
1498
|
-
}, [r]), c || s ? null : /* @__PURE__ */
|
|
1499
|
-
|
|
1496
|
+
r != null && r.instructions && l(r.instructions), r != null && r.location && T(r.location);
|
|
1497
|
+
}, [r]), c || s ? null : /* @__PURE__ */ t(
|
|
1498
|
+
re,
|
|
1500
1499
|
{
|
|
1501
|
-
open:
|
|
1502
|
-
onOpenChange:
|
|
1503
|
-
title:
|
|
1504
|
-
footer: /* @__PURE__ */
|
|
1505
|
-
|
|
1500
|
+
open: e,
|
|
1501
|
+
onOpenChange: R,
|
|
1502
|
+
title: lt,
|
|
1503
|
+
footer: /* @__PURE__ */ d(
|
|
1504
|
+
W,
|
|
1506
1505
|
{
|
|
1507
1506
|
columnGap: 2,
|
|
1508
1507
|
alignHorizontal: "flex-end",
|
|
1509
1508
|
className: "pb-8 sm:pb-0",
|
|
1510
1509
|
children: [
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
|
|
1510
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
|
1511
|
+
K,
|
|
1513
1512
|
{
|
|
1514
1513
|
mode: "dark",
|
|
1515
1514
|
variant: "secondary",
|
|
1516
1515
|
focusMode: "light",
|
|
1517
|
-
onClick:
|
|
1516
|
+
onClick: R,
|
|
1518
1517
|
children: "Cancel"
|
|
1519
1518
|
}
|
|
1520
1519
|
) }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
|
|
1520
|
+
/* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
|
1521
|
+
K,
|
|
1523
1522
|
{
|
|
1524
1523
|
mode: "dark",
|
|
1525
1524
|
variant: "danger",
|
|
1526
1525
|
focusMode: "light",
|
|
1527
|
-
onClick: async (
|
|
1528
|
-
o(!1), await
|
|
1526
|
+
onClick: async (E) => {
|
|
1527
|
+
o(!1), await I(E);
|
|
1529
1528
|
},
|
|
1530
1529
|
children: "Save"
|
|
1531
1530
|
}
|
|
@@ -1533,59 +1532,59 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1533
1532
|
]
|
|
1534
1533
|
}
|
|
1535
1534
|
),
|
|
1536
|
-
children: /* @__PURE__ */
|
|
1537
|
-
m && /* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1535
|
+
children: /* @__PURE__ */ d(D, { children: [
|
|
1536
|
+
m && /* @__PURE__ */ t(Cr, { open: m, onOpenChange: p }),
|
|
1537
|
+
/* @__PURE__ */ d(
|
|
1539
1538
|
P,
|
|
1540
1539
|
{
|
|
1541
|
-
header:
|
|
1540
|
+
header: k.SETTINGS_DETAILS.TITLE,
|
|
1542
1541
|
className: "prose-dark dark:prose-lighter",
|
|
1543
1542
|
children: [
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
|
|
1543
|
+
/* @__PURE__ */ t("p", { className: "text-sm", children: k.SETTINGS_DETAILS.INSTRUCTION }),
|
|
1544
|
+
/* @__PURE__ */ t(
|
|
1545
|
+
fe,
|
|
1547
1546
|
{
|
|
1548
1547
|
className: "mt-2",
|
|
1549
1548
|
noBorder: !0,
|
|
1550
1549
|
label: "Show Message Statistics",
|
|
1551
1550
|
name: "show-message-statistics",
|
|
1552
|
-
onChange:
|
|
1553
|
-
checked:
|
|
1551
|
+
onChange: _,
|
|
1552
|
+
checked: S
|
|
1554
1553
|
}
|
|
1555
1554
|
)
|
|
1556
1555
|
]
|
|
1557
1556
|
}
|
|
1558
1557
|
),
|
|
1559
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ t(
|
|
1560
1559
|
P,
|
|
1561
1560
|
{
|
|
1562
|
-
header:
|
|
1561
|
+
header: k.SETTINGS_PROMPTS.TITLE,
|
|
1563
1562
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
1564
|
-
children: /* @__PURE__ */
|
|
1565
|
-
|
|
1563
|
+
children: /* @__PURE__ */ t(
|
|
1564
|
+
J,
|
|
1566
1565
|
{
|
|
1567
1566
|
className: "mt-2",
|
|
1568
1567
|
size: "small",
|
|
1569
|
-
onClick:
|
|
1568
|
+
onClick: w,
|
|
1570
1569
|
labelLeft: "Edit Custom Prompts",
|
|
1571
|
-
children: /* @__PURE__ */
|
|
1570
|
+
children: /* @__PURE__ */ t(Tt, { size: "size-3", monotone: !0 })
|
|
1572
1571
|
}
|
|
1573
1572
|
)
|
|
1574
1573
|
}
|
|
1575
1574
|
),
|
|
1576
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ d(
|
|
1577
1576
|
P,
|
|
1578
1577
|
{
|
|
1579
1578
|
header: "Custom Instructions",
|
|
1580
1579
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
1581
1580
|
children: [
|
|
1582
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ d("p", { className: "text-sm", children: [
|
|
1583
1582
|
"What would you like ",
|
|
1584
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ t("em", { children: ct }),
|
|
1585
1584
|
" to know about you to provide better responses?"
|
|
1586
1585
|
] }),
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
|
|
1586
|
+
/* @__PURE__ */ t(
|
|
1587
|
+
he,
|
|
1589
1588
|
{
|
|
1590
1589
|
mode: "alt-system",
|
|
1591
1590
|
autoCapitalize: "off",
|
|
@@ -1593,9 +1592,9 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1593
1592
|
autoCorrect: "off",
|
|
1594
1593
|
name: "customInstructions",
|
|
1595
1594
|
label: "Custom Instructions",
|
|
1596
|
-
value:
|
|
1597
|
-
onChange: (
|
|
1598
|
-
l(
|
|
1595
|
+
value: x,
|
|
1596
|
+
onChange: (E) => {
|
|
1597
|
+
l(E.target.value);
|
|
1599
1598
|
},
|
|
1600
1599
|
helperText: "Press ENTER to add a new line."
|
|
1601
1600
|
}
|
|
@@ -1603,35 +1602,35 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1603
1602
|
]
|
|
1604
1603
|
}
|
|
1605
1604
|
),
|
|
1606
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ d(
|
|
1607
1606
|
P,
|
|
1608
1607
|
{
|
|
1609
1608
|
header: "Location",
|
|
1610
1609
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
1611
1610
|
children: [
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
|
|
1611
|
+
/* @__PURE__ */ t("p", { className: "text-sm", children: "You can share your location to receive customized responses based on your area." }),
|
|
1612
|
+
/* @__PURE__ */ t(
|
|
1613
|
+
he,
|
|
1615
1614
|
{
|
|
1616
1615
|
mode: "alt-system",
|
|
1617
1616
|
name: "location",
|
|
1618
1617
|
label: "Location",
|
|
1619
|
-
value:
|
|
1620
|
-
onChange: (
|
|
1621
|
-
E
|
|
1618
|
+
value: f,
|
|
1619
|
+
onChange: (E) => {
|
|
1620
|
+
T(E.target.value);
|
|
1622
1621
|
},
|
|
1623
1622
|
helperText: "Enter your location or press auto-detect."
|
|
1624
1623
|
}
|
|
1625
1624
|
),
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
|
|
1625
|
+
/* @__PURE__ */ t(
|
|
1626
|
+
K,
|
|
1628
1627
|
{
|
|
1629
1628
|
className: "mt-2",
|
|
1630
1629
|
size: "small",
|
|
1631
1630
|
noBorder: !0,
|
|
1632
|
-
disabled:
|
|
1633
|
-
onClick:
|
|
1634
|
-
children:
|
|
1631
|
+
disabled: h.loadingLocation,
|
|
1632
|
+
onClick: u,
|
|
1633
|
+
children: h.loadingLocation ? "Detecting..." : "Auto-detect"
|
|
1635
1634
|
}
|
|
1636
1635
|
)
|
|
1637
1636
|
]
|
|
@@ -1640,13 +1639,13 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1640
1639
|
] })
|
|
1641
1640
|
}
|
|
1642
1641
|
);
|
|
1643
|
-
},
|
|
1644
|
-
const { logout: o } =
|
|
1645
|
-
return /* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1642
|
+
}, Ar = ({ isComponent: e = !1 }) => {
|
|
1643
|
+
const { logout: o } = V(), [n, a] = C(!1), [r, c] = C(!1), [s, i] = C(!1), [m, p] = C(!1), [h, y] = C(!1);
|
|
1644
|
+
return /* @__PURE__ */ d(D, { children: [
|
|
1645
|
+
/* @__PURE__ */ t(
|
|
1647
1646
|
Pe,
|
|
1648
1647
|
{
|
|
1649
|
-
showConfirmation:
|
|
1648
|
+
showConfirmation: h,
|
|
1650
1649
|
setShowConfirmation: y,
|
|
1651
1650
|
action: o,
|
|
1652
1651
|
customStrings: {
|
|
@@ -1654,77 +1653,77 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1654
1653
|
cancelAction: "Cancel",
|
|
1655
1654
|
title: Ae
|
|
1656
1655
|
},
|
|
1657
|
-
children: /* @__PURE__ */
|
|
1656
|
+
children: /* @__PURE__ */ t("p", { children: "Are you sure you want to log out?" })
|
|
1658
1657
|
}
|
|
1659
1658
|
),
|
|
1660
|
-
/* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
s && /* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
|
|
1659
|
+
/* @__PURE__ */ t(Gt, { open: n, onOpenChange: a }),
|
|
1660
|
+
/* @__PURE__ */ t(Tr, { open: r, onOpenChange: c }),
|
|
1661
|
+
s && /* @__PURE__ */ t(Ft, { open: s, onOpenChange: i }),
|
|
1662
|
+
/* @__PURE__ */ t(Dt, { open: m, onOpenChange: p }),
|
|
1663
|
+
/* @__PURE__ */ t("div", { className: "bg-slate-900 py-4 px-4 rounded-t-md", children: /* @__PURE__ */ t(W, { alignHorizontal: "flex-end", alignVertical: "center", children: /* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
|
1664
|
+
Et,
|
|
1666
1665
|
{
|
|
1667
1666
|
label: "Profile, Settings, etc.",
|
|
1668
1667
|
mode: "light",
|
|
1669
1668
|
placement: "left",
|
|
1670
|
-
trigger: /* @__PURE__ */
|
|
1669
|
+
trigger: /* @__PURE__ */ d(
|
|
1671
1670
|
St,
|
|
1672
1671
|
{
|
|
1673
1672
|
mode: "dark",
|
|
1674
1673
|
focusMode: "light",
|
|
1675
|
-
trigger: /* @__PURE__ */
|
|
1674
|
+
trigger: /* @__PURE__ */ t(J, { label: "Settings", children: /* @__PURE__ */ t(zt, {}) }),
|
|
1676
1675
|
defaultPlacement: "bottom-end",
|
|
1677
1676
|
children: [
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
|
|
1677
|
+
/* @__PURE__ */ t(
|
|
1678
|
+
Q,
|
|
1680
1679
|
{
|
|
1681
1680
|
label: "Profile",
|
|
1682
1681
|
onClick: () => {
|
|
1683
1682
|
a(!n);
|
|
1684
1683
|
},
|
|
1685
|
-
icon: /* @__PURE__ */
|
|
1684
|
+
icon: /* @__PURE__ */ t(Mt, {})
|
|
1686
1685
|
}
|
|
1687
1686
|
),
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
|
|
1687
|
+
/* @__PURE__ */ t(
|
|
1688
|
+
Q,
|
|
1690
1689
|
{
|
|
1691
1690
|
label: "Settings",
|
|
1692
1691
|
onClick: () => {
|
|
1693
1692
|
c(!r);
|
|
1694
1693
|
},
|
|
1695
|
-
icon: /* @__PURE__ */
|
|
1694
|
+
icon: /* @__PURE__ */ t(Ht, {})
|
|
1696
1695
|
}
|
|
1697
1696
|
),
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
|
|
1697
|
+
/* @__PURE__ */ t(
|
|
1698
|
+
Q,
|
|
1700
1699
|
{
|
|
1701
1700
|
label: "History",
|
|
1702
1701
|
onClick: () => {
|
|
1703
|
-
|
|
1702
|
+
i(!s);
|
|
1704
1703
|
},
|
|
1705
|
-
icon: /* @__PURE__ */
|
|
1704
|
+
icon: /* @__PURE__ */ t(Lt, {})
|
|
1706
1705
|
}
|
|
1707
1706
|
),
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
|
|
1707
|
+
/* @__PURE__ */ t(
|
|
1708
|
+
Q,
|
|
1710
1709
|
{
|
|
1711
1710
|
label: "About",
|
|
1712
1711
|
onClick: () => {
|
|
1713
|
-
|
|
1712
|
+
p(!m);
|
|
1714
1713
|
},
|
|
1715
|
-
icon: /* @__PURE__ */
|
|
1714
|
+
icon: /* @__PURE__ */ t(Pt, {})
|
|
1716
1715
|
}
|
|
1717
1716
|
),
|
|
1718
|
-
!
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
|
|
1717
|
+
!e && /* @__PURE__ */ d(D, { children: [
|
|
1718
|
+
/* @__PURE__ */ t(Nt, {}),
|
|
1719
|
+
/* @__PURE__ */ t(
|
|
1720
|
+
Q,
|
|
1722
1721
|
{
|
|
1723
1722
|
label: "Log out",
|
|
1724
1723
|
onClick: () => {
|
|
1725
|
-
y(!
|
|
1724
|
+
y(!h);
|
|
1726
1725
|
},
|
|
1727
|
-
icon: /* @__PURE__ */
|
|
1726
|
+
icon: /* @__PURE__ */ t("div", { className: "text-red-700", children: /* @__PURE__ */ t(_t, { monotone: !0 }) })
|
|
1728
1727
|
}
|
|
1729
1728
|
)
|
|
1730
1729
|
] })
|
|
@@ -1736,5 +1735,5 @@ const hr = "av-toggle", fr = () => g("peer", "h-6", "w-11", "rounded-full"), pr
|
|
|
1736
1735
|
] });
|
|
1737
1736
|
};
|
|
1738
1737
|
export {
|
|
1739
|
-
|
|
1738
|
+
Ar as default
|
|
1740
1739
|
};
|