@versini/sassysaint 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{App.DKRoa2tE.js → App.DRTN2bgD.js} +429 -393
- package/dist/chunks/{LazyHeader.QLLnRIqL.js → LazyHeader.5TbeOkDb.js} +4 -4
- package/dist/chunks/{LazyMarkdownWithExtra.BtUUOsHs.js → LazyMarkdownWithExtra.BHaS-6A0.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.3aYd1Tzp.js → LazyMessageAssistant.s5h7NaV1.js} +4 -4
- package/dist/chunks/{index.BbfwgIO_.js → index.CKHEQpgF.js} +121 -121
- package/dist/chunks/{index.CGGeNJS3.js → index.Ck-_31wH.js} +4 -4
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +4 -4
|
@@ -1,101 +1,136 @@
|
|
|
1
|
-
import { jsxs as v, Fragment as H, jsx as
|
|
2
|
-
import { AppContext as j, TagsContext as
|
|
3
|
-
import { E as $, restCall as He, we as je, serviceCall as Pe, SERVICE_TYPES as Ge, f as Fe } from "./index.
|
|
1
|
+
import { jsxs as v, Fragment as H, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { AppContext as j, TagsContext as Y, LOCAL_STORAGE_PREFIX as M, b as _e, j as G, R as B, TAG_CONTENT as O, TAGS as C, isLastMessageFromRole as de, CANCEL as Ne, CLEAR as we, ACTION_RESET as le, ACTION_TOGGLE_TAG as ce, ROLE_ASSISTANT as I, ROLE_INTERNAL as q, ROLE_USER as K, rn as Z, ROLE_SYSTEM as Ee, ROLE_HIDDEN as Ce, DEFAULT_AI_ENGINE as z, STATS_SEPARATOR as te, ACTION_MODEL as ge, ACTION_MESSAGE as L, ACTION_RESET_TAGS as ue, TYPE_QUESTION as Ie, SEND as Re, ACTION_STREAMING as me, ERROR_MESSAGE as Se, getMessageContaintWrapperClass as Ae, MessagesContainerHeader as Be, ACTION_SEARCH as Me, ACTION_SORT as Oe, ACTION_RESTORE as Le, ACTION_ENGINE as he, HistoryContext as $e, d as Ue, AppFooter as Ve, LOCAL_STORAGE_SEARCH as ze, LOCAL_STORAGE_SORT as De } from "./index.CKHEQpgF.js";
|
|
3
|
+
import { E as $, restCall as He, we as je, serviceCall as Pe, SERVICE_TYPES as Ge, f as Fe } from "./index.Ck-_31wH.js";
|
|
4
4
|
import S, { useContext as U, useRef as R, useEffect as E, useState as P, lazy as We, Suspense as re, useReducer as F } from "react";
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import d from "clsx";
|
|
6
|
+
function Ke(e) {
|
|
7
|
+
const t = e.toLowerCase().split("+").map((o) => o.trim()), r = {
|
|
8
|
+
alt: t.includes("alt"),
|
|
9
|
+
ctrl: t.includes("ctrl"),
|
|
10
|
+
meta: t.includes("meta"),
|
|
11
|
+
mod: t.includes("mod"),
|
|
12
|
+
shift: t.includes("shift")
|
|
13
|
+
}, a = ["alt", "ctrl", "meta", "shift", "mod"], i = t.find((o) => !a.includes(o));
|
|
14
|
+
return {
|
|
15
|
+
...r,
|
|
16
|
+
key: i
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function Ye(e, t) {
|
|
20
|
+
const { alt: r, ctrl: a, meta: i, mod: o, shift: l, key: s } = e, { altKey: b, ctrlKey: u, metaKey: m, shiftKey: c, key: g } = t;
|
|
21
|
+
if (r !== b)
|
|
22
|
+
return !1;
|
|
23
|
+
if (o) {
|
|
24
|
+
if (!u && !m)
|
|
25
|
+
return !1;
|
|
26
|
+
} else if (a !== u || i !== m)
|
|
27
|
+
return !1;
|
|
28
|
+
return l !== c ? !1 : !!(s && (g.toLowerCase() === s.toLowerCase() || t.code.replace("Key", "").toLowerCase() === s.toLowerCase()));
|
|
29
|
+
}
|
|
30
|
+
function qe(e) {
|
|
31
|
+
return (t) => Ye(Ke(e), t);
|
|
32
|
+
}
|
|
33
|
+
function Ze(e) {
|
|
34
|
+
return (t) => {
|
|
35
|
+
const r = "nativeEvent" in t ? t.nativeEvent : t;
|
|
36
|
+
e.forEach(([a, i, o = { preventDefault: !0 }]) => {
|
|
37
|
+
qe(a)(r) && (o.preventDefault && t.preventDefault(), i(r));
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
var f = [];
|
|
7
42
|
for (var W = 0; W < 256; ++W)
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
return (
|
|
43
|
+
f.push((W + 256).toString(16).slice(1));
|
|
44
|
+
function Je(e, t = 0) {
|
|
45
|
+
return (f[e[t + 0]] + f[e[t + 1]] + f[e[t + 2]] + f[e[t + 3]] + "-" + f[e[t + 4]] + f[e[t + 5]] + "-" + f[e[t + 6]] + f[e[t + 7]] + "-" + f[e[t + 8]] + f[e[t + 9]] + "-" + f[e[t + 10]] + f[e[t + 11]] + f[e[t + 12]] + f[e[t + 13]] + f[e[t + 14]] + f[e[t + 15]]).toLowerCase();
|
|
11
46
|
}
|
|
12
|
-
var V,
|
|
13
|
-
function
|
|
47
|
+
var V, Qe = new Uint8Array(16);
|
|
48
|
+
function Xe() {
|
|
14
49
|
if (!V && (V = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !V))
|
|
15
50
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
16
|
-
return V(
|
|
51
|
+
return V(Qe);
|
|
17
52
|
}
|
|
18
|
-
var
|
|
53
|
+
var et = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
19
54
|
const ae = {
|
|
20
|
-
randomUUID:
|
|
55
|
+
randomUUID: et
|
|
21
56
|
};
|
|
22
|
-
function
|
|
57
|
+
function J(e, t, r) {
|
|
23
58
|
if (ae.randomUUID && !t && !e)
|
|
24
59
|
return ae.randomUUID();
|
|
25
60
|
e = e || {};
|
|
26
|
-
var a = e.random || (e.rng ||
|
|
27
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
61
|
+
var a = e.random || (e.rng || Xe)();
|
|
62
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Je(a);
|
|
28
63
|
}
|
|
29
|
-
const
|
|
30
|
-
const { dispatch: e, state: t } = U(j), { dispatch: r } = U(
|
|
64
|
+
const tt = () => {
|
|
65
|
+
const { dispatch: e, state: t } = U(j), { dispatch: r } = U(Y), a = "mt-2 flex justify-center rounded-md", i = R(null), o = R(!1), [l] = $({
|
|
31
66
|
key: M + "summarize-article",
|
|
32
67
|
initialValue: !1
|
|
33
|
-
}), [
|
|
68
|
+
}), [s] = $({
|
|
34
69
|
key: M + "proofread-content",
|
|
35
70
|
initialValue: !1
|
|
36
71
|
}), [b] = $({
|
|
37
72
|
key: M + "rephrase-content",
|
|
38
73
|
initialValue: !1
|
|
39
|
-
}),
|
|
40
|
-
|
|
74
|
+
}), u = (c) => {
|
|
75
|
+
c.preventDefault(), e({
|
|
41
76
|
type: le
|
|
42
77
|
});
|
|
43
78
|
};
|
|
44
79
|
E(() => {
|
|
45
|
-
(t == null ? void 0 : t.streaming) === !0 && !o.current &&
|
|
80
|
+
(t == null ? void 0 : t.streaming) === !0 && !o.current && i.current && (o.current = !0, i.current.focus()), (t == null ? void 0 : t.streaming) === !1 && (o.current = !1);
|
|
46
81
|
}, [t]);
|
|
47
|
-
const
|
|
48
|
-
|
|
82
|
+
const m = (c, g) => {
|
|
83
|
+
c.preventDefault(), r({
|
|
49
84
|
type: ce,
|
|
50
85
|
payload: {
|
|
51
|
-
tag:
|
|
86
|
+
tag: g
|
|
52
87
|
}
|
|
53
88
|
});
|
|
54
89
|
};
|
|
55
90
|
return /* @__PURE__ */ v(H, { children: [
|
|
56
91
|
/* @__PURE__ */ v(_e, { alignHorizontal: "center", columnGap: 2, children: [
|
|
57
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ n(G, { children: l && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
|
|
58
93
|
B,
|
|
59
94
|
{
|
|
60
95
|
noBorder: !0,
|
|
61
96
|
mode: "dark",
|
|
62
97
|
focusMode: "light",
|
|
63
98
|
size: "small",
|
|
64
|
-
onClick: (
|
|
99
|
+
onClick: (c) => m(c, C.SUMMARIZE_ARTICLE),
|
|
65
100
|
children: O[C.SUMMARIZE_ARTICLE].label
|
|
66
101
|
}
|
|
67
102
|
) }) }),
|
|
68
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ n(G, { children: s && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
|
|
69
104
|
B,
|
|
70
105
|
{
|
|
71
106
|
noBorder: !0,
|
|
72
107
|
mode: "dark",
|
|
73
108
|
focusMode: "light",
|
|
74
109
|
size: "small",
|
|
75
|
-
onClick: (
|
|
110
|
+
onClick: (c) => m(c, C.PROOFREAD_CONTENT),
|
|
76
111
|
children: O[C.PROOFREAD_CONTENT].label
|
|
77
112
|
}
|
|
78
113
|
) }) }),
|
|
79
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ n(G, { children: b && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
|
|
80
115
|
B,
|
|
81
116
|
{
|
|
82
117
|
noBorder: !0,
|
|
83
118
|
mode: "dark",
|
|
84
119
|
focusMode: "light",
|
|
85
120
|
size: "small",
|
|
86
|
-
onClick: (
|
|
121
|
+
onClick: (c) => m(c, C.REPHRASE_CONTENT),
|
|
87
122
|
children: O[C.REPHRASE_CONTENT].label
|
|
88
123
|
}
|
|
89
124
|
) }) })
|
|
90
125
|
] }),
|
|
91
|
-
de(I, t) && /* @__PURE__ */
|
|
126
|
+
de(I, t) && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
|
|
92
127
|
B,
|
|
93
128
|
{
|
|
94
129
|
noBorder: !0,
|
|
95
130
|
mode: "dark",
|
|
96
131
|
focusMode: "light",
|
|
97
|
-
ref:
|
|
98
|
-
onClick:
|
|
132
|
+
ref: i,
|
|
133
|
+
onClick: u,
|
|
99
134
|
children: t != null && t.streaming ? Ne : we
|
|
100
135
|
}
|
|
101
136
|
) })
|
|
@@ -114,7 +149,7 @@ try {
|
|
|
114
149
|
});
|
|
115
150
|
} catch {
|
|
116
151
|
}
|
|
117
|
-
const
|
|
152
|
+
const rt = "av-bubble", oe = "av-button", at = (e) => {
|
|
118
153
|
let t = "";
|
|
119
154
|
if (typeof e == "number" || typeof e == "string")
|
|
120
155
|
t = "m-" + e;
|
|
@@ -123,32 +158,32 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
123
158
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
124
159
|
}
|
|
125
160
|
return t;
|
|
126
|
-
}, Q = "icon",
|
|
161
|
+
}, Q = "icon", ot = "button", it = "link", nt = ({
|
|
127
162
|
type: e,
|
|
128
163
|
size: t,
|
|
129
164
|
labelRight: r,
|
|
130
165
|
labelLeft: a,
|
|
131
|
-
align:
|
|
166
|
+
align: i
|
|
132
167
|
}) => {
|
|
133
|
-
const o = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1",
|
|
168
|
+
const o = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
|
|
134
169
|
switch (e) {
|
|
135
|
-
case
|
|
136
|
-
return
|
|
170
|
+
case ot:
|
|
171
|
+
return d("px-4", {
|
|
137
172
|
[o]: t === "small",
|
|
138
173
|
[l]: t === "medium",
|
|
139
|
-
[
|
|
174
|
+
[s]: t === "large"
|
|
140
175
|
});
|
|
141
|
-
case
|
|
142
|
-
return
|
|
176
|
+
case it:
|
|
177
|
+
return d("px-4 text-center", {
|
|
143
178
|
[o]: t === "small",
|
|
144
179
|
[l]: t === "medium",
|
|
145
|
-
[
|
|
180
|
+
[s]: t === "large"
|
|
146
181
|
});
|
|
147
182
|
case Q:
|
|
148
|
-
return
|
|
149
|
-
"justify-center":
|
|
150
|
-
"justify-start":
|
|
151
|
-
"justify-end":
|
|
183
|
+
return d("inline-flex items-center", {
|
|
184
|
+
"justify-center": i === "center",
|
|
185
|
+
"justify-start": i === "left",
|
|
186
|
+
"justify-end": i === "right",
|
|
152
187
|
"h-6 w-6 p-0": t === "small" && !(r || a),
|
|
153
188
|
"h-6 px-4 text-sm font-medium": t === "small" && (r || a),
|
|
154
189
|
"h-8 w-8 p-1": t === "medium" && !(r || a),
|
|
@@ -157,7 +192,7 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
157
192
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
158
193
|
});
|
|
159
194
|
}
|
|
160
|
-
},
|
|
195
|
+
}, st = ({
|
|
161
196
|
mode: e,
|
|
162
197
|
noBackground: t,
|
|
163
198
|
noTruncate: r,
|
|
@@ -166,7 +201,7 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
166
201
|
if (t)
|
|
167
202
|
return "not-prose rounded-full";
|
|
168
203
|
if (a === "primary")
|
|
169
|
-
return
|
|
204
|
+
return d("not-prose rounded-full", {
|
|
170
205
|
truncate: !r,
|
|
171
206
|
"bg-action-dark text-copy-light": e === "dark",
|
|
172
207
|
"bg-action-light text-copy-lighter": e === "light",
|
|
@@ -174,7 +209,7 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
174
209
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
|
|
175
210
|
});
|
|
176
211
|
if (a === "secondary")
|
|
177
|
-
return
|
|
212
|
+
return d("not-prose rounded-full", {
|
|
178
213
|
truncate: !r,
|
|
179
214
|
"bg-action-dark text-copy-light": e === "light",
|
|
180
215
|
"bg-action-light text-copy-lighter": e === "dark",
|
|
@@ -182,14 +217,14 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
182
217
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
|
|
183
218
|
});
|
|
184
219
|
if (a === "danger")
|
|
185
|
-
return
|
|
220
|
+
return d("not-prose rounded-full", {
|
|
186
221
|
truncate: !r,
|
|
187
222
|
"bg-action-danger-dark text-copy-light": e === "dark",
|
|
188
223
|
"bg-action-danger-light text-copy-lighter": e === "light",
|
|
189
224
|
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
|
|
190
225
|
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
|
|
191
226
|
});
|
|
192
|
-
},
|
|
227
|
+
}, dt = ({
|
|
193
228
|
mode: e,
|
|
194
229
|
disabled: t,
|
|
195
230
|
variant: r
|
|
@@ -197,27 +232,27 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
197
232
|
if (t)
|
|
198
233
|
return "";
|
|
199
234
|
if (r === "primary")
|
|
200
|
-
return
|
|
235
|
+
return d("hover:text-copy-light-hover", {
|
|
201
236
|
"hover:bg-action-dark-hover": e === "dark",
|
|
202
237
|
"hover:bg-action-light-hover": e === "light",
|
|
203
238
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
|
|
204
239
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
|
|
205
240
|
});
|
|
206
241
|
if (r === "secondary")
|
|
207
|
-
return
|
|
242
|
+
return d("hover:text-copy-light-hover", {
|
|
208
243
|
"hover:bg-action-dark-hover": e === "light",
|
|
209
244
|
"hover:bg-action-light-hover": e === "dark",
|
|
210
245
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
|
|
211
246
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
|
|
212
247
|
});
|
|
213
248
|
if (r === "danger")
|
|
214
|
-
return
|
|
249
|
+
return d("hover:text-copy-light-hover", {
|
|
215
250
|
"hover:bg-action-danger-dark-hover": e === "dark",
|
|
216
251
|
"hover:bg-action-danger-light-hover": e === "light",
|
|
217
252
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
218
253
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
|
|
219
254
|
});
|
|
220
|
-
},
|
|
255
|
+
}, lt = ({
|
|
221
256
|
mode: e,
|
|
222
257
|
disabled: t,
|
|
223
258
|
variant: r
|
|
@@ -225,27 +260,27 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
225
260
|
if (t)
|
|
226
261
|
return "";
|
|
227
262
|
if (r === "primary")
|
|
228
|
-
return
|
|
263
|
+
return d("active:text-copy-light-active", {
|
|
229
264
|
"active:bg-action-dark-active": e === "dark",
|
|
230
265
|
"active:bg-action-light-active": e === "light",
|
|
231
266
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
|
|
232
267
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
|
|
233
268
|
});
|
|
234
269
|
if (r === "secondary")
|
|
235
|
-
return
|
|
270
|
+
return d("active:text-copy-light-active", {
|
|
236
271
|
"active:bg-action-dark-active": e === "light",
|
|
237
272
|
"active:bg-action-light-active": e === "dark",
|
|
238
273
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
|
|
239
274
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
|
|
240
275
|
});
|
|
241
276
|
if (r === "danger")
|
|
242
|
-
return
|
|
277
|
+
return d("active:text-copy-lighter-active", {
|
|
243
278
|
"active:bg-action-danger-dark-active": e === "dark",
|
|
244
279
|
"active:bg-action-danger-light-active": e === "light",
|
|
245
280
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
246
281
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
|
|
247
282
|
});
|
|
248
|
-
},
|
|
283
|
+
}, ct = ({
|
|
249
284
|
mode: e,
|
|
250
285
|
noBorder: t,
|
|
251
286
|
variant: r
|
|
@@ -253,27 +288,27 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
253
288
|
if (t)
|
|
254
289
|
return "border border-transparent";
|
|
255
290
|
if (r === "primary")
|
|
256
|
-
return
|
|
291
|
+
return d("border", {
|
|
257
292
|
"border-border-dark": e === "dark",
|
|
258
293
|
"border-border-accent": e === "light",
|
|
259
294
|
"border-border-dark dark:border-border-accent": e === "system",
|
|
260
295
|
"border-border-accent dark:border-border-dark": e === "alt-system"
|
|
261
296
|
});
|
|
262
297
|
if (r === "secondary")
|
|
263
|
-
return
|
|
298
|
+
return d("border", {
|
|
264
299
|
"border-border-dark": e === "light",
|
|
265
300
|
"border-border-accent": e === "dark",
|
|
266
301
|
"border-border-dark dark:border-border-accent": e === "alt-system",
|
|
267
302
|
"border-border-accent dark:border-border-dark": e === "system"
|
|
268
303
|
});
|
|
269
304
|
if (r === "danger")
|
|
270
|
-
return
|
|
305
|
+
return d("border", {
|
|
271
306
|
"border-border-danger-dark": e === "dark",
|
|
272
307
|
"border-border-danger-medium": e === "light",
|
|
273
308
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
274
309
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
275
310
|
});
|
|
276
|
-
},
|
|
311
|
+
}, gt = ({ focusMode: e }) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
277
312
|
"focus:outline-focus-dark": e === "dark",
|
|
278
313
|
"focus:outline-focus-light": e === "light",
|
|
279
314
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
@@ -283,45 +318,45 @@ const Qe = "av-bubble", oe = "av-button", Xe = (e) => {
|
|
|
283
318
|
className: t,
|
|
284
319
|
raw: r,
|
|
285
320
|
mode: a,
|
|
286
|
-
focusMode:
|
|
321
|
+
focusMode: i,
|
|
287
322
|
disabled: o,
|
|
288
323
|
fullWidth: l,
|
|
289
|
-
size:
|
|
324
|
+
size: s,
|
|
290
325
|
noBorder: b,
|
|
291
|
-
labelRight:
|
|
292
|
-
labelLeft:
|
|
293
|
-
spacing:
|
|
294
|
-
noBackground:
|
|
295
|
-
variant:
|
|
296
|
-
noTruncate:
|
|
297
|
-
align:
|
|
298
|
-
}) => (
|
|
326
|
+
labelRight: u,
|
|
327
|
+
labelLeft: m,
|
|
328
|
+
spacing: c,
|
|
329
|
+
noBackground: g,
|
|
330
|
+
variant: h,
|
|
331
|
+
noTruncate: p,
|
|
332
|
+
align: y
|
|
333
|
+
}) => (h || (h = "primary"), r ? d(oe, t) : d(
|
|
299
334
|
oe,
|
|
300
335
|
t,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
336
|
+
at(c),
|
|
337
|
+
st({ mode: a, variant: h, noBackground: g, noTruncate: p }),
|
|
338
|
+
nt({ type: e, size: s, labelRight: u, labelLeft: m, align: y }),
|
|
339
|
+
ct({ mode: a, variant: h, noBorder: b }),
|
|
340
|
+
gt({ focusMode: i }),
|
|
341
|
+
dt({ mode: a, variant: h, disabled: o }),
|
|
342
|
+
lt({ mode: a, variant: h, disabled: o }),
|
|
308
343
|
{
|
|
309
344
|
"w-full": l,
|
|
310
345
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
311
346
|
}
|
|
312
|
-
)),
|
|
347
|
+
)), ut = (e, t, r) => {
|
|
313
348
|
var a;
|
|
314
349
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
315
350
|
}, X = S.forwardRef((e, t) => {
|
|
316
|
-
const { onClick: r, noInternalClick: a = !1, ...
|
|
317
|
-
return /* @__PURE__ */
|
|
351
|
+
const { onClick: r, noInternalClick: a = !1, ...i } = e;
|
|
352
|
+
return /* @__PURE__ */ n(
|
|
318
353
|
"button",
|
|
319
354
|
{
|
|
320
355
|
ref: t,
|
|
321
356
|
onClick: (o) => {
|
|
322
|
-
|
|
357
|
+
ut(o, a, r);
|
|
323
358
|
},
|
|
324
|
-
...
|
|
359
|
+
...i
|
|
325
360
|
}
|
|
326
361
|
);
|
|
327
362
|
});
|
|
@@ -332,18 +367,18 @@ const be = S.forwardRef(
|
|
|
332
367
|
disabled: t = !1,
|
|
333
368
|
mode: r = "system",
|
|
334
369
|
focusMode: a = "system",
|
|
335
|
-
fullWidth:
|
|
370
|
+
fullWidth: i = !1,
|
|
336
371
|
className: o,
|
|
337
372
|
type: l = "button",
|
|
338
|
-
raw:
|
|
373
|
+
raw: s = !1,
|
|
339
374
|
noBorder: b = !1,
|
|
340
|
-
"aria-label":
|
|
341
|
-
label:
|
|
342
|
-
size:
|
|
343
|
-
labelRight:
|
|
344
|
-
labelLeft:
|
|
345
|
-
spacing:
|
|
346
|
-
noBackground:
|
|
375
|
+
"aria-label": u,
|
|
376
|
+
label: m,
|
|
377
|
+
size: c = "medium",
|
|
378
|
+
labelRight: g,
|
|
379
|
+
labelLeft: h,
|
|
380
|
+
spacing: p,
|
|
381
|
+
noBackground: y = !1,
|
|
347
382
|
align: _ = "center",
|
|
348
383
|
...N
|
|
349
384
|
}, w) => {
|
|
@@ -351,22 +386,22 @@ const be = S.forwardRef(
|
|
|
351
386
|
type: Q,
|
|
352
387
|
mode: r,
|
|
353
388
|
focusMode: a,
|
|
354
|
-
fullWidth:
|
|
389
|
+
fullWidth: i,
|
|
355
390
|
disabled: t,
|
|
356
|
-
raw:
|
|
391
|
+
raw: s,
|
|
357
392
|
className: o,
|
|
358
393
|
noBorder: b,
|
|
359
|
-
size:
|
|
360
|
-
labelRight:
|
|
361
|
-
labelLeft:
|
|
362
|
-
spacing:
|
|
363
|
-
noBackground:
|
|
394
|
+
size: c,
|
|
395
|
+
labelRight: g,
|
|
396
|
+
labelLeft: h,
|
|
397
|
+
spacing: p,
|
|
398
|
+
noBackground: y,
|
|
364
399
|
align: _
|
|
365
|
-
}), x =
|
|
366
|
-
"text-copy-accent-dark": r === "light" && !
|
|
367
|
-
"text-copy-light": r === "dark" && !
|
|
368
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
369
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
400
|
+
}), x = d({
|
|
401
|
+
"text-copy-accent-dark": r === "light" && !s,
|
|
402
|
+
"text-copy-light": r === "dark" && !s,
|
|
403
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
|
|
404
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !s
|
|
370
405
|
});
|
|
371
406
|
return /* @__PURE__ */ v(
|
|
372
407
|
X,
|
|
@@ -375,12 +410,12 @@ const be = S.forwardRef(
|
|
|
375
410
|
className: k,
|
|
376
411
|
disabled: t,
|
|
377
412
|
type: l,
|
|
378
|
-
"aria-label":
|
|
413
|
+
"aria-label": u || m,
|
|
379
414
|
...N,
|
|
380
415
|
children: [
|
|
381
|
-
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
|
|
416
|
+
h && /* @__PURE__ */ n("span", { className: "pr-2", children: h }),
|
|
417
|
+
/* @__PURE__ */ n("div", { className: x, children: e }),
|
|
418
|
+
g && /* @__PURE__ */ n("span", { className: "pl-2", children: g })
|
|
384
419
|
]
|
|
385
420
|
}
|
|
386
421
|
);
|
|
@@ -400,24 +435,24 @@ try {
|
|
|
400
435
|
});
|
|
401
436
|
} catch {
|
|
402
437
|
}
|
|
403
|
-
const
|
|
438
|
+
const mt = S.forwardRef(
|
|
404
439
|
({
|
|
405
440
|
children: e,
|
|
406
441
|
disabled: t = !1,
|
|
407
442
|
mode: r = "system",
|
|
408
443
|
focusMode: a = "system",
|
|
409
|
-
fullWidth:
|
|
444
|
+
fullWidth: i = !1,
|
|
410
445
|
className: o,
|
|
411
446
|
type: l = "button",
|
|
412
|
-
raw:
|
|
447
|
+
raw: s = !1,
|
|
413
448
|
noBorder: b = !1,
|
|
414
|
-
"aria-label":
|
|
415
|
-
label:
|
|
416
|
-
size:
|
|
417
|
-
labelRight:
|
|
418
|
-
labelLeft:
|
|
419
|
-
spacing:
|
|
420
|
-
noBackground:
|
|
449
|
+
"aria-label": u,
|
|
450
|
+
label: m,
|
|
451
|
+
size: c = "medium",
|
|
452
|
+
labelRight: g,
|
|
453
|
+
labelLeft: h,
|
|
454
|
+
spacing: p,
|
|
455
|
+
noBackground: y = !1,
|
|
421
456
|
align: _ = "center",
|
|
422
457
|
active: N = !1,
|
|
423
458
|
...w
|
|
@@ -426,23 +461,23 @@ const lt = S.forwardRef(
|
|
|
426
461
|
type: Q,
|
|
427
462
|
mode: r,
|
|
428
463
|
focusMode: a,
|
|
429
|
-
fullWidth:
|
|
464
|
+
fullWidth: i,
|
|
430
465
|
disabled: t,
|
|
431
|
-
raw:
|
|
466
|
+
raw: s,
|
|
432
467
|
className: o,
|
|
433
468
|
noBorder: b,
|
|
434
|
-
size:
|
|
435
|
-
labelRight:
|
|
436
|
-
labelLeft:
|
|
437
|
-
spacing:
|
|
438
|
-
noBackground:
|
|
469
|
+
size: c,
|
|
470
|
+
labelRight: g,
|
|
471
|
+
labelLeft: h,
|
|
472
|
+
spacing: p,
|
|
473
|
+
noBackground: y,
|
|
439
474
|
align: _
|
|
440
|
-
}), A =
|
|
441
|
-
"text-copy-accent-dark": r === "light" && !
|
|
442
|
-
"text-copy-light": r === "dark" && !
|
|
443
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
444
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
445
|
-
}), T = N ?
|
|
475
|
+
}), A = d({
|
|
476
|
+
"text-copy-accent-dark": r === "light" && !s,
|
|
477
|
+
"text-copy-light": r === "dark" && !s,
|
|
478
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
|
|
479
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !s
|
|
480
|
+
}), T = N ? d(
|
|
446
481
|
"relative",
|
|
447
482
|
"focus-within:static",
|
|
448
483
|
"focus-within:after:border-transparent",
|
|
@@ -459,26 +494,26 @@ const lt = S.forwardRef(
|
|
|
459
494
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
460
495
|
}
|
|
461
496
|
) : "";
|
|
462
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ n("div", { className: T, children: /* @__PURE__ */ v(
|
|
463
498
|
X,
|
|
464
499
|
{
|
|
465
500
|
ref: k,
|
|
466
501
|
className: x,
|
|
467
502
|
disabled: t,
|
|
468
503
|
type: l,
|
|
469
|
-
"aria-label":
|
|
504
|
+
"aria-label": u || m,
|
|
470
505
|
...w,
|
|
471
506
|
children: [
|
|
472
|
-
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
|
|
507
|
+
h && /* @__PURE__ */ n("span", { className: "pr-2", children: h }),
|
|
508
|
+
/* @__PURE__ */ n("div", { className: A, children: e }),
|
|
509
|
+
g && /* @__PURE__ */ n("span", { className: "pl-2", children: g })
|
|
475
510
|
]
|
|
476
511
|
}
|
|
477
512
|
) });
|
|
478
513
|
}
|
|
479
514
|
);
|
|
480
|
-
|
|
481
|
-
const
|
|
515
|
+
mt.displayName = "ButtonSort";
|
|
516
|
+
const ht = (e) => {
|
|
482
517
|
let t = "";
|
|
483
518
|
if (typeof e == "number" || typeof e == "string")
|
|
484
519
|
t = "m-" + e;
|
|
@@ -487,38 +522,38 @@ const ct = (e) => {
|
|
|
487
522
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
488
523
|
}
|
|
489
524
|
return t;
|
|
490
|
-
},
|
|
525
|
+
}, fe = ({
|
|
491
526
|
children: e,
|
|
492
527
|
fill: t,
|
|
493
528
|
viewBox: r,
|
|
494
529
|
className: a,
|
|
495
|
-
defaultViewBox:
|
|
530
|
+
defaultViewBox: i,
|
|
496
531
|
defaultClassName: o,
|
|
497
532
|
spacing: l,
|
|
498
|
-
title:
|
|
533
|
+
title: s,
|
|
499
534
|
semantic: b = !1,
|
|
500
|
-
...
|
|
535
|
+
...u
|
|
501
536
|
}) => {
|
|
502
|
-
const
|
|
503
|
-
|
|
537
|
+
const m = ht(l), c = d(
|
|
538
|
+
m,
|
|
504
539
|
a || o
|
|
505
540
|
);
|
|
506
541
|
return /* @__PURE__ */ v(H, { children: [
|
|
507
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ n(
|
|
508
543
|
"svg",
|
|
509
544
|
{
|
|
510
545
|
xmlns: "http://www.w3.org/2000/svg",
|
|
511
|
-
className:
|
|
512
|
-
viewBox: r ||
|
|
546
|
+
className: c,
|
|
547
|
+
viewBox: r || i,
|
|
513
548
|
fill: t || "currentColor",
|
|
514
549
|
role: "img",
|
|
515
550
|
"aria-hidden": !b,
|
|
516
551
|
focusable: !1,
|
|
517
|
-
...
|
|
552
|
+
...u,
|
|
518
553
|
children: e
|
|
519
554
|
}
|
|
520
555
|
),
|
|
521
|
-
|
|
556
|
+
s && b && /* @__PURE__ */ n("span", { className: "sr-only", children: s })
|
|
522
557
|
] });
|
|
523
558
|
};
|
|
524
559
|
/*!
|
|
@@ -534,15 +569,15 @@ try {
|
|
|
534
569
|
});
|
|
535
570
|
} catch {
|
|
536
571
|
}
|
|
537
|
-
const
|
|
572
|
+
const pt = ({
|
|
538
573
|
className: e,
|
|
539
574
|
viewBox: t,
|
|
540
575
|
spacing: r,
|
|
541
576
|
title: a,
|
|
542
|
-
monotone:
|
|
577
|
+
monotone: i,
|
|
543
578
|
...o
|
|
544
579
|
}) => /* @__PURE__ */ v(
|
|
545
|
-
|
|
580
|
+
fe,
|
|
546
581
|
{
|
|
547
582
|
defaultViewBox: "0 0 448 512",
|
|
548
583
|
defaultClassName: "size-5",
|
|
@@ -552,25 +587,25 @@ const gt = ({
|
|
|
552
587
|
title: a || "Copied",
|
|
553
588
|
...o,
|
|
554
589
|
children: [
|
|
555
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ n(
|
|
556
591
|
"path",
|
|
557
592
|
{
|
|
558
593
|
opacity: "0.4",
|
|
559
594
|
d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"
|
|
560
595
|
}
|
|
561
596
|
),
|
|
562
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ n("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
|
|
563
598
|
]
|
|
564
599
|
}
|
|
565
|
-
),
|
|
600
|
+
), bt = ({
|
|
566
601
|
className: e,
|
|
567
602
|
viewBox: t,
|
|
568
603
|
spacing: r,
|
|
569
604
|
title: a,
|
|
570
|
-
monotone:
|
|
605
|
+
monotone: i,
|
|
571
606
|
...o
|
|
572
|
-
}) => /* @__PURE__ */
|
|
573
|
-
|
|
607
|
+
}) => /* @__PURE__ */ n(
|
|
608
|
+
fe,
|
|
574
609
|
{
|
|
575
610
|
defaultViewBox: "0 0 512 512",
|
|
576
611
|
defaultClassName: "size-5",
|
|
@@ -579,7 +614,7 @@ const gt = ({
|
|
|
579
614
|
spacing: r,
|
|
580
615
|
title: a || "Copy",
|
|
581
616
|
...o,
|
|
582
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ n("path", { d: "M64 464H288c8.8 0 16-7.2 16-16V384h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM224 304H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16V288c0 8.8 7.2 16 16 16zm-64-16V64c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64z" })
|
|
583
618
|
}
|
|
584
619
|
);
|
|
585
620
|
/*!
|
|
@@ -595,7 +630,7 @@ try {
|
|
|
595
630
|
});
|
|
596
631
|
} catch {
|
|
597
632
|
}
|
|
598
|
-
const
|
|
633
|
+
const ft = (e) => {
|
|
599
634
|
let t = "";
|
|
600
635
|
if (typeof e == "number" || typeof e == "string")
|
|
601
636
|
t = "m-" + e;
|
|
@@ -604,93 +639,93 @@ const mt = (e) => {
|
|
|
604
639
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
605
640
|
}
|
|
606
641
|
return t;
|
|
607
|
-
},
|
|
642
|
+
}, yt = () => "p-4 sm:max-w-md md:max-w-2xl", vt = ({ kind: e }) => d({
|
|
608
643
|
"bg-surface-lighter dark:bg-surface-dark": e === "left",
|
|
609
644
|
"bg-surface-accent": e === "right"
|
|
610
|
-
}),
|
|
645
|
+
}), kt = ({ kind: e }) => d(
|
|
611
646
|
"prose prose-dark dark:prose-lighter prose-p:my-3 prose-blockquote:my-3 prose-ol:my-3 prose-ul:my-3 prose-ul:prose-li:marker:text-black",
|
|
612
647
|
{
|
|
613
648
|
"text-copy-lighter": e === "right"
|
|
614
649
|
}
|
|
615
|
-
),
|
|
650
|
+
), xt = ({ kind: e }) => d("rounded-b-xl", {
|
|
616
651
|
"rounded-tr-xl": e === "left",
|
|
617
652
|
"rounded-tl-xl": e === "right"
|
|
618
|
-
}),
|
|
653
|
+
}), Tt = ({
|
|
619
654
|
kind: e,
|
|
620
655
|
className: t,
|
|
621
656
|
spacing: r
|
|
622
657
|
}) => {
|
|
623
|
-
const a =
|
|
658
|
+
const a = d(
|
|
624
659
|
t,
|
|
625
|
-
|
|
660
|
+
rt,
|
|
626
661
|
"flex items-start",
|
|
627
|
-
|
|
662
|
+
ft(r),
|
|
628
663
|
{
|
|
629
664
|
"flex-row-reverse": e === "right"
|
|
630
665
|
}
|
|
631
|
-
),
|
|
666
|
+
), i = d(
|
|
632
667
|
"flex flex-col empty:hidden",
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
), o = "pr-2 pt-1 text-end text-xs text-copy-light", l =
|
|
668
|
+
yt(),
|
|
669
|
+
kt({ kind: e }),
|
|
670
|
+
vt({ kind: e }),
|
|
671
|
+
xt({ kind: e })
|
|
672
|
+
), o = "pr-2 pt-1 text-end text-xs text-copy-light", l = d("flex flex-col-reverse gap-2 sm:flex-row", {
|
|
638
673
|
"ml-2": e === "left",
|
|
639
674
|
"mr-2": e === "right"
|
|
640
675
|
});
|
|
641
676
|
return {
|
|
642
677
|
wrapper: a,
|
|
643
|
-
main:
|
|
678
|
+
main: i,
|
|
644
679
|
footer: o,
|
|
645
680
|
copyButton: l
|
|
646
681
|
};
|
|
647
|
-
},
|
|
682
|
+
}, _t = ({
|
|
648
683
|
children: e,
|
|
649
684
|
kind: t = "left",
|
|
650
685
|
className: r,
|
|
651
686
|
footer: a,
|
|
652
|
-
rawFooter:
|
|
687
|
+
rawFooter: i,
|
|
653
688
|
copyToClipboard: o,
|
|
654
689
|
copyToClipboardFocusMode: l = "system",
|
|
655
|
-
copyToClipboardMode:
|
|
690
|
+
copyToClipboardMode: s = "system",
|
|
656
691
|
spacing: b
|
|
657
692
|
}) => {
|
|
658
|
-
const [
|
|
659
|
-
|
|
693
|
+
const [u, m] = P(!1), c = Tt({ kind: t, className: r, spacing: b }), g = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), h = () => {
|
|
694
|
+
m(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
|
|
660
695
|
};
|
|
661
696
|
return E(() => {
|
|
662
|
-
let
|
|
663
|
-
return
|
|
664
|
-
|
|
697
|
+
let p;
|
|
698
|
+
return u && (p = window.setTimeout(() => {
|
|
699
|
+
m(!1);
|
|
665
700
|
}, 3e3)), () => {
|
|
666
|
-
clearTimeout(
|
|
701
|
+
clearTimeout(p);
|
|
667
702
|
};
|
|
668
|
-
}, [
|
|
703
|
+
}, [u]), /* @__PURE__ */ v("div", { className: c.wrapper, children: [
|
|
669
704
|
/* @__PURE__ */ v("div", { children: [
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
a && Object.keys(a).map((
|
|
672
|
-
|
|
705
|
+
/* @__PURE__ */ n("div", { className: c.main, children: e }),
|
|
706
|
+
a && Object.keys(a).map((p) => a[p] ? /* @__PURE__ */ n("div", { className: "prose-p:m-0", children: /* @__PURE__ */ v("p", { className: c.footer, children: [
|
|
707
|
+
p,
|
|
673
708
|
": ",
|
|
674
|
-
a[
|
|
675
|
-
] }) }, `-${
|
|
676
|
-
|
|
709
|
+
a[p]
|
|
710
|
+
] }) }, `-${p}`) : null),
|
|
711
|
+
i && i
|
|
677
712
|
] }),
|
|
678
|
-
|
|
713
|
+
g && /* @__PURE__ */ n("div", { className: c.copyButton, children: /* @__PURE__ */ n(
|
|
679
714
|
be,
|
|
680
715
|
{
|
|
681
716
|
noBorder: !0,
|
|
682
717
|
noBackground: !0,
|
|
683
718
|
size: "small",
|
|
684
|
-
mode:
|
|
719
|
+
mode: s,
|
|
685
720
|
focusMode: l,
|
|
686
|
-
label:
|
|
687
|
-
onClick:
|
|
688
|
-
disabled:
|
|
689
|
-
children:
|
|
721
|
+
label: u ? "Copied to clipboard" : "Copy to clipboard",
|
|
722
|
+
onClick: h,
|
|
723
|
+
disabled: u,
|
|
724
|
+
children: u ? /* @__PURE__ */ n(pt, { className: "size-3" }) : /* @__PURE__ */ n(bt, { className: "size-3" })
|
|
690
725
|
}
|
|
691
726
|
) })
|
|
692
727
|
] });
|
|
693
|
-
}, ie = "av-button",
|
|
728
|
+
}, ie = "av-button", Nt = (e) => {
|
|
694
729
|
let t = "";
|
|
695
730
|
if (typeof e == "number" || typeof e == "string")
|
|
696
731
|
t = "m-" + e;
|
|
@@ -699,32 +734,32 @@ const mt = (e) => {
|
|
|
699
734
|
(e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
|
|
700
735
|
}
|
|
701
736
|
return t;
|
|
702
|
-
},
|
|
737
|
+
}, ye = "icon", ve = "button", wt = "link", Et = ({
|
|
703
738
|
type: e,
|
|
704
739
|
size: t,
|
|
705
740
|
labelRight: r,
|
|
706
741
|
labelLeft: a,
|
|
707
|
-
align:
|
|
742
|
+
align: i
|
|
708
743
|
}) => {
|
|
709
|
-
const o = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1",
|
|
744
|
+
const o = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
|
|
710
745
|
switch (e) {
|
|
711
746
|
case ve:
|
|
712
|
-
return
|
|
747
|
+
return d("px-4", {
|
|
713
748
|
[o]: t === "small",
|
|
714
749
|
[l]: t === "medium",
|
|
715
|
-
[
|
|
750
|
+
[s]: t === "large"
|
|
716
751
|
});
|
|
717
|
-
case
|
|
718
|
-
return
|
|
752
|
+
case wt:
|
|
753
|
+
return d("px-4 text-center", {
|
|
719
754
|
[o]: t === "small",
|
|
720
755
|
[l]: t === "medium",
|
|
721
|
-
[
|
|
756
|
+
[s]: t === "large"
|
|
722
757
|
});
|
|
723
|
-
case
|
|
724
|
-
return
|
|
725
|
-
"justify-center":
|
|
726
|
-
"justify-start":
|
|
727
|
-
"justify-end":
|
|
758
|
+
case ye:
|
|
759
|
+
return d("inline-flex items-center", {
|
|
760
|
+
"justify-center": i === "center",
|
|
761
|
+
"justify-start": i === "left",
|
|
762
|
+
"justify-end": i === "right",
|
|
728
763
|
"h-6 w-6 p-0": t === "small" && !(r || a),
|
|
729
764
|
"h-6 px-4 text-sm font-medium": t === "small" && (r || a),
|
|
730
765
|
"h-8 w-8 p-1": t === "medium" && !(r || a),
|
|
@@ -733,7 +768,7 @@ const mt = (e) => {
|
|
|
733
768
|
"h-12 px-4 text-lg font-medium": t === "large" && (r || a)
|
|
734
769
|
});
|
|
735
770
|
}
|
|
736
|
-
},
|
|
771
|
+
}, Ct = ({
|
|
737
772
|
mode: e,
|
|
738
773
|
noBackground: t,
|
|
739
774
|
noTruncate: r,
|
|
@@ -742,7 +777,7 @@ const mt = (e) => {
|
|
|
742
777
|
if (t)
|
|
743
778
|
return "not-prose rounded-full";
|
|
744
779
|
if (a === "primary")
|
|
745
|
-
return
|
|
780
|
+
return d("not-prose rounded-full", {
|
|
746
781
|
truncate: !r,
|
|
747
782
|
"bg-action-dark text-copy-light": e === "dark",
|
|
748
783
|
"bg-action-light text-copy-lighter": e === "light",
|
|
@@ -750,7 +785,7 @@ const mt = (e) => {
|
|
|
750
785
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
|
|
751
786
|
});
|
|
752
787
|
if (a === "secondary")
|
|
753
|
-
return
|
|
788
|
+
return d("not-prose rounded-full", {
|
|
754
789
|
truncate: !r,
|
|
755
790
|
"bg-action-dark text-copy-light": e === "light",
|
|
756
791
|
"bg-action-light text-copy-lighter": e === "dark",
|
|
@@ -758,14 +793,14 @@ const mt = (e) => {
|
|
|
758
793
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
|
|
759
794
|
});
|
|
760
795
|
if (a === "danger")
|
|
761
|
-
return
|
|
796
|
+
return d("not-prose rounded-full", {
|
|
762
797
|
truncate: !r,
|
|
763
798
|
"bg-action-danger-dark text-copy-light": e === "dark",
|
|
764
799
|
"bg-action-danger-light text-copy-lighter": e === "light",
|
|
765
800
|
"bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
|
|
766
801
|
"bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
|
|
767
802
|
});
|
|
768
|
-
},
|
|
803
|
+
}, It = ({
|
|
769
804
|
mode: e,
|
|
770
805
|
disabled: t,
|
|
771
806
|
variant: r
|
|
@@ -773,27 +808,27 @@ const mt = (e) => {
|
|
|
773
808
|
if (t)
|
|
774
809
|
return "";
|
|
775
810
|
if (r === "primary")
|
|
776
|
-
return
|
|
811
|
+
return d("hover:text-copy-light-hover", {
|
|
777
812
|
"hover:bg-action-dark-hover": e === "dark",
|
|
778
813
|
"hover:bg-action-light-hover": e === "light",
|
|
779
814
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
|
|
780
815
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
|
|
781
816
|
});
|
|
782
817
|
if (r === "secondary")
|
|
783
|
-
return
|
|
818
|
+
return d("hover:text-copy-light-hover", {
|
|
784
819
|
"hover:bg-action-dark-hover": e === "light",
|
|
785
820
|
"hover:bg-action-light-hover": e === "dark",
|
|
786
821
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
|
|
787
822
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
|
|
788
823
|
});
|
|
789
824
|
if (r === "danger")
|
|
790
|
-
return
|
|
825
|
+
return d("hover:text-copy-light-hover", {
|
|
791
826
|
"hover:bg-action-danger-dark-hover": e === "dark",
|
|
792
827
|
"hover:bg-action-danger-light-hover": e === "light",
|
|
793
828
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
794
829
|
"hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
|
|
795
830
|
});
|
|
796
|
-
},
|
|
831
|
+
}, Rt = ({
|
|
797
832
|
mode: e,
|
|
798
833
|
disabled: t,
|
|
799
834
|
variant: r
|
|
@@ -801,27 +836,27 @@ const mt = (e) => {
|
|
|
801
836
|
if (t)
|
|
802
837
|
return "";
|
|
803
838
|
if (r === "primary")
|
|
804
|
-
return
|
|
839
|
+
return d("active:text-copy-light-active", {
|
|
805
840
|
"active:bg-action-dark-active": e === "dark",
|
|
806
841
|
"active:bg-action-light-active": e === "light",
|
|
807
842
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
|
|
808
843
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
|
|
809
844
|
});
|
|
810
845
|
if (r === "secondary")
|
|
811
|
-
return
|
|
846
|
+
return d("active:text-copy-light-active", {
|
|
812
847
|
"active:bg-action-dark-active": e === "light",
|
|
813
848
|
"active:bg-action-light-active": e === "dark",
|
|
814
849
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
|
|
815
850
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
|
|
816
851
|
});
|
|
817
852
|
if (r === "danger")
|
|
818
|
-
return
|
|
853
|
+
return d("active:text-copy-lighter-active", {
|
|
819
854
|
"active:bg-action-danger-dark-active": e === "dark",
|
|
820
855
|
"active:bg-action-danger-light-active": e === "light",
|
|
821
856
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
822
857
|
"active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
|
|
823
858
|
});
|
|
824
|
-
},
|
|
859
|
+
}, St = ({
|
|
825
860
|
mode: e,
|
|
826
861
|
noBorder: t,
|
|
827
862
|
variant: r
|
|
@@ -829,27 +864,27 @@ const mt = (e) => {
|
|
|
829
864
|
if (t)
|
|
830
865
|
return "border border-transparent";
|
|
831
866
|
if (r === "primary")
|
|
832
|
-
return
|
|
867
|
+
return d("border", {
|
|
833
868
|
"border-border-dark": e === "dark",
|
|
834
869
|
"border-border-accent": e === "light",
|
|
835
870
|
"border-border-dark dark:border-border-accent": e === "system",
|
|
836
871
|
"border-border-accent dark:border-border-dark": e === "alt-system"
|
|
837
872
|
});
|
|
838
873
|
if (r === "secondary")
|
|
839
|
-
return
|
|
874
|
+
return d("border", {
|
|
840
875
|
"border-border-dark": e === "light",
|
|
841
876
|
"border-border-accent": e === "dark",
|
|
842
877
|
"border-border-dark dark:border-border-accent": e === "alt-system",
|
|
843
878
|
"border-border-accent dark:border-border-dark": e === "system"
|
|
844
879
|
});
|
|
845
880
|
if (r === "danger")
|
|
846
|
-
return
|
|
881
|
+
return d("border", {
|
|
847
882
|
"border-border-danger-dark": e === "dark",
|
|
848
883
|
"border-border-danger-medium": e === "light",
|
|
849
884
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
850
885
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
851
886
|
});
|
|
852
|
-
},
|
|
887
|
+
}, At = ({ focusMode: e }) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
853
888
|
"focus:outline-focus-dark": e === "dark",
|
|
854
889
|
"focus:outline-focus-light": e === "light",
|
|
855
890
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
@@ -859,45 +894,45 @@ const mt = (e) => {
|
|
|
859
894
|
className: t,
|
|
860
895
|
raw: r,
|
|
861
896
|
mode: a,
|
|
862
|
-
focusMode:
|
|
897
|
+
focusMode: i,
|
|
863
898
|
disabled: o,
|
|
864
899
|
fullWidth: l,
|
|
865
|
-
size:
|
|
900
|
+
size: s,
|
|
866
901
|
noBorder: b,
|
|
867
|
-
labelRight:
|
|
868
|
-
labelLeft:
|
|
869
|
-
spacing:
|
|
870
|
-
noBackground:
|
|
871
|
-
variant:
|
|
872
|
-
noTruncate:
|
|
873
|
-
align:
|
|
874
|
-
}) => (
|
|
902
|
+
labelRight: u,
|
|
903
|
+
labelLeft: m,
|
|
904
|
+
spacing: c,
|
|
905
|
+
noBackground: g,
|
|
906
|
+
variant: h,
|
|
907
|
+
noTruncate: p,
|
|
908
|
+
align: y
|
|
909
|
+
}) => (h || (h = "primary"), r ? d(ie, t) : d(
|
|
875
910
|
ie,
|
|
876
911
|
t,
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
912
|
+
Nt(c),
|
|
913
|
+
Ct({ mode: a, variant: h, noBackground: g, noTruncate: p }),
|
|
914
|
+
Et({ type: e, size: s, labelRight: u, labelLeft: m, align: y }),
|
|
915
|
+
St({ mode: a, variant: h, noBorder: b }),
|
|
916
|
+
At({ focusMode: i }),
|
|
917
|
+
It({ mode: a, variant: h, disabled: o }),
|
|
918
|
+
Rt({ mode: a, variant: h, disabled: o }),
|
|
884
919
|
{
|
|
885
920
|
"w-full": l,
|
|
886
921
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
887
922
|
}
|
|
888
|
-
)),
|
|
923
|
+
)), Bt = (e, t, r) => {
|
|
889
924
|
var a;
|
|
890
925
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
891
926
|
}, ee = S.forwardRef((e, t) => {
|
|
892
|
-
const { onClick: r, noInternalClick: a = !1, ...
|
|
893
|
-
return /* @__PURE__ */
|
|
927
|
+
const { onClick: r, noInternalClick: a = !1, ...i } = e;
|
|
928
|
+
return /* @__PURE__ */ n(
|
|
894
929
|
"button",
|
|
895
930
|
{
|
|
896
931
|
ref: t,
|
|
897
932
|
onClick: (o) => {
|
|
898
|
-
|
|
933
|
+
Bt(o, a, r);
|
|
899
934
|
},
|
|
900
|
-
...
|
|
935
|
+
...i
|
|
901
936
|
}
|
|
902
937
|
);
|
|
903
938
|
});
|
|
@@ -908,37 +943,37 @@ const xe = S.forwardRef(
|
|
|
908
943
|
disabled: t = !1,
|
|
909
944
|
mode: r = "system",
|
|
910
945
|
focusMode: a = "system",
|
|
911
|
-
fullWidth:
|
|
946
|
+
fullWidth: i = !1,
|
|
912
947
|
className: o,
|
|
913
948
|
size: l = "medium",
|
|
914
|
-
raw:
|
|
949
|
+
raw: s = !1,
|
|
915
950
|
noBorder: b = !1,
|
|
916
|
-
spacing:
|
|
917
|
-
variant:
|
|
918
|
-
noTruncate:
|
|
919
|
-
...
|
|
920
|
-
},
|
|
921
|
-
const
|
|
951
|
+
spacing: u,
|
|
952
|
+
variant: m = "primary",
|
|
953
|
+
noTruncate: c = !1,
|
|
954
|
+
...g
|
|
955
|
+
}, h) => {
|
|
956
|
+
const p = ke({
|
|
922
957
|
type: ve,
|
|
923
958
|
mode: r,
|
|
924
959
|
focusMode: a,
|
|
925
|
-
fullWidth:
|
|
960
|
+
fullWidth: i,
|
|
926
961
|
disabled: t,
|
|
927
|
-
raw:
|
|
962
|
+
raw: s,
|
|
928
963
|
className: o,
|
|
929
964
|
size: l,
|
|
930
965
|
noBorder: b,
|
|
931
|
-
spacing:
|
|
932
|
-
variant:
|
|
933
|
-
noTruncate:
|
|
966
|
+
spacing: u,
|
|
967
|
+
variant: m,
|
|
968
|
+
noTruncate: c
|
|
934
969
|
});
|
|
935
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ n(
|
|
936
971
|
ee,
|
|
937
972
|
{
|
|
938
|
-
ref:
|
|
939
|
-
className:
|
|
973
|
+
ref: h,
|
|
974
|
+
className: p,
|
|
940
975
|
disabled: t,
|
|
941
|
-
...
|
|
976
|
+
...g,
|
|
942
977
|
children: e
|
|
943
978
|
}
|
|
944
979
|
);
|
|
@@ -958,49 +993,49 @@ try {
|
|
|
958
993
|
});
|
|
959
994
|
} catch {
|
|
960
995
|
}
|
|
961
|
-
const
|
|
996
|
+
const Mt = S.forwardRef(
|
|
962
997
|
({
|
|
963
998
|
children: e,
|
|
964
999
|
disabled: t = !1,
|
|
965
1000
|
mode: r = "system",
|
|
966
1001
|
focusMode: a = "system",
|
|
967
|
-
fullWidth:
|
|
1002
|
+
fullWidth: i = !1,
|
|
968
1003
|
className: o,
|
|
969
1004
|
type: l = "button",
|
|
970
|
-
raw:
|
|
1005
|
+
raw: s = !1,
|
|
971
1006
|
noBorder: b = !1,
|
|
972
|
-
"aria-label":
|
|
973
|
-
label:
|
|
974
|
-
size:
|
|
975
|
-
labelRight:
|
|
976
|
-
labelLeft:
|
|
977
|
-
spacing:
|
|
978
|
-
noBackground:
|
|
1007
|
+
"aria-label": u,
|
|
1008
|
+
label: m,
|
|
1009
|
+
size: c = "medium",
|
|
1010
|
+
labelRight: g,
|
|
1011
|
+
labelLeft: h,
|
|
1012
|
+
spacing: p,
|
|
1013
|
+
noBackground: y = !1,
|
|
979
1014
|
align: _ = "center",
|
|
980
1015
|
active: N = !1,
|
|
981
1016
|
...w
|
|
982
1017
|
}, k) => {
|
|
983
1018
|
const x = ke({
|
|
984
|
-
type:
|
|
1019
|
+
type: ye,
|
|
985
1020
|
mode: r,
|
|
986
1021
|
focusMode: a,
|
|
987
|
-
fullWidth:
|
|
1022
|
+
fullWidth: i,
|
|
988
1023
|
disabled: t,
|
|
989
|
-
raw:
|
|
1024
|
+
raw: s,
|
|
990
1025
|
className: o,
|
|
991
1026
|
noBorder: b,
|
|
992
|
-
size:
|
|
993
|
-
labelRight:
|
|
994
|
-
labelLeft:
|
|
995
|
-
spacing:
|
|
996
|
-
noBackground:
|
|
1027
|
+
size: c,
|
|
1028
|
+
labelRight: g,
|
|
1029
|
+
labelLeft: h,
|
|
1030
|
+
spacing: p,
|
|
1031
|
+
noBackground: y,
|
|
997
1032
|
align: _
|
|
998
|
-
}), A =
|
|
999
|
-
"text-copy-accent-dark": r === "light" && !
|
|
1000
|
-
"text-copy-light": r === "dark" && !
|
|
1001
|
-
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !
|
|
1002
|
-
"text-copy-light dark:text-copy-accent-dark": r === "system" && !
|
|
1003
|
-
}), T = N ?
|
|
1033
|
+
}), A = d({
|
|
1034
|
+
"text-copy-accent-dark": r === "light" && !s,
|
|
1035
|
+
"text-copy-light": r === "dark" && !s,
|
|
1036
|
+
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
|
|
1037
|
+
"text-copy-light dark:text-copy-accent-dark": r === "system" && !s
|
|
1038
|
+
}), T = N ? d(
|
|
1004
1039
|
"relative",
|
|
1005
1040
|
"focus-within:static",
|
|
1006
1041
|
"focus-within:after:border-transparent",
|
|
@@ -1017,28 +1052,28 @@ const Rt = S.forwardRef(
|
|
|
1017
1052
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
1018
1053
|
}
|
|
1019
1054
|
) : "";
|
|
1020
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ n("div", { className: T, children: /* @__PURE__ */ v(
|
|
1021
1056
|
ee,
|
|
1022
1057
|
{
|
|
1023
1058
|
ref: k,
|
|
1024
1059
|
className: x,
|
|
1025
1060
|
disabled: t,
|
|
1026
1061
|
type: l,
|
|
1027
|
-
"aria-label":
|
|
1062
|
+
"aria-label": u || m,
|
|
1028
1063
|
...w,
|
|
1029
1064
|
children: [
|
|
1030
|
-
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
|
|
1065
|
+
h && /* @__PURE__ */ n("span", { className: "pr-2", children: h }),
|
|
1066
|
+
/* @__PURE__ */ n("div", { className: A, children: e }),
|
|
1067
|
+
g && /* @__PURE__ */ n("span", { className: "pl-2", children: g })
|
|
1033
1068
|
]
|
|
1034
1069
|
}
|
|
1035
1070
|
) });
|
|
1036
1071
|
}
|
|
1037
1072
|
);
|
|
1038
|
-
|
|
1039
|
-
const
|
|
1073
|
+
Mt.displayName = "ButtonSort";
|
|
1074
|
+
const Ot = 200, Lt = ({
|
|
1040
1075
|
string: e,
|
|
1041
|
-
idealLength: t =
|
|
1076
|
+
idealLength: t = Ot
|
|
1042
1077
|
}) => {
|
|
1043
1078
|
if (e.length <= t)
|
|
1044
1079
|
return { string: e, isTruncated: !1 };
|
|
@@ -1049,22 +1084,22 @@ const St = 200, At = ({
|
|
|
1049
1084
|
string: e.slice(0, t + r),
|
|
1050
1085
|
isTruncated: !0
|
|
1051
1086
|
};
|
|
1052
|
-
},
|
|
1087
|
+
}, $t = ({
|
|
1053
1088
|
children: e,
|
|
1054
1089
|
length: t = 200,
|
|
1055
1090
|
mode: r = "system",
|
|
1056
1091
|
focusMode: a = "system"
|
|
1057
1092
|
}) => {
|
|
1058
|
-
const [
|
|
1093
|
+
const [i, o] = P(!1);
|
|
1059
1094
|
if (typeof e != "string")
|
|
1060
1095
|
return e;
|
|
1061
|
-
const { string: l, isTruncated:
|
|
1096
|
+
const { string: l, isTruncated: s } = Lt({
|
|
1062
1097
|
string: e,
|
|
1063
1098
|
idealLength: t
|
|
1064
1099
|
});
|
|
1065
1100
|
return /* @__PURE__ */ v("span", { children: [
|
|
1066
|
-
|
|
1067
|
-
|
|
1101
|
+
i ? e : l,
|
|
1102
|
+
s && /* @__PURE__ */ n(
|
|
1068
1103
|
xe,
|
|
1069
1104
|
{
|
|
1070
1105
|
mode: r,
|
|
@@ -1072,9 +1107,9 @@ const St = 200, At = ({
|
|
|
1072
1107
|
spacing: { l: 2 },
|
|
1073
1108
|
size: "small",
|
|
1074
1109
|
onClick: (b) => {
|
|
1075
|
-
b.preventDefault(), o(!
|
|
1110
|
+
b.preventDefault(), o(!i);
|
|
1076
1111
|
},
|
|
1077
|
-
children:
|
|
1112
|
+
children: i ? "less..." : "more..."
|
|
1078
1113
|
}
|
|
1079
1114
|
)
|
|
1080
1115
|
] });
|
|
@@ -1095,32 +1130,32 @@ try {
|
|
|
1095
1130
|
const ne = We(
|
|
1096
1131
|
() => import(
|
|
1097
1132
|
/* webpackChunkName: "LazyMessageAssistant" */
|
|
1098
|
-
"./LazyMessageAssistant.
|
|
1133
|
+
"./LazyMessageAssistant.s5h7NaV1.js"
|
|
1099
1134
|
).then((e) => e.LazyMessageAssistant)
|
|
1100
|
-
),
|
|
1135
|
+
), Ut = () => {
|
|
1101
1136
|
const { state: e } = U(j);
|
|
1102
1137
|
return /* @__PURE__ */ v(H, { children: [
|
|
1103
1138
|
e && e.messages.length > 0 && e.messages.map((t, r) => {
|
|
1104
|
-
const { role: a, content:
|
|
1105
|
-
return (a === I || a ===
|
|
1139
|
+
const { role: a, content: i, name: o, processingTime: l } = t.message;
|
|
1140
|
+
return (a === I || a === q) && i ? /* @__PURE__ */ n(re, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(
|
|
1106
1141
|
ne,
|
|
1107
1142
|
{
|
|
1108
1143
|
name: o,
|
|
1109
1144
|
processingTime: l,
|
|
1110
|
-
children:
|
|
1145
|
+
children: i
|
|
1111
1146
|
}
|
|
1112
|
-
) }, `${r}-${a}`) : a ===
|
|
1113
|
-
|
|
1147
|
+
) }, `${r}-${a}`) : a === K && i ? /* @__PURE__ */ n(
|
|
1148
|
+
_t,
|
|
1114
1149
|
{
|
|
1115
1150
|
kind: "right",
|
|
1116
|
-
copyToClipboard:
|
|
1151
|
+
copyToClipboard: i,
|
|
1117
1152
|
copyToClipboardFocusMode: "light",
|
|
1118
|
-
children: /* @__PURE__ */
|
|
1153
|
+
children: /* @__PURE__ */ n($t, { mode: "light", focusMode: "light", children: i })
|
|
1119
1154
|
},
|
|
1120
1155
|
`${r}-${a}`
|
|
1121
1156
|
) : null;
|
|
1122
1157
|
}),
|
|
1123
|
-
de(
|
|
1158
|
+
de(K, e) && /* @__PURE__ */ n(re, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(ne, { loading: !0 }) })
|
|
1124
1159
|
] });
|
|
1125
1160
|
}, D = (e, t) => {
|
|
1126
1161
|
e({
|
|
@@ -1134,43 +1169,43 @@ const ne = We(
|
|
|
1134
1169
|
type: L,
|
|
1135
1170
|
payload: {
|
|
1136
1171
|
message: {
|
|
1137
|
-
role:
|
|
1172
|
+
role: q,
|
|
1138
1173
|
content: Se
|
|
1139
1174
|
}
|
|
1140
1175
|
}
|
|
1141
1176
|
});
|
|
1142
|
-
},
|
|
1143
|
-
const { state: e, dispatch: t } = U(j), { state: r, dispatch: a } = U(
|
|
1177
|
+
}, Vt = () => {
|
|
1178
|
+
const { state: e, dispatch: t } = U(j), { state: r, dispatch: a } = U(Y), [i, o] = P(""), { getAccessToken: l, user: s } = Z(), b = R(!1), u = R(null), m = R(
|
|
1144
1179
|
null
|
|
1145
1180
|
);
|
|
1146
1181
|
E(() => {
|
|
1147
1182
|
(async () => {
|
|
1148
|
-
var
|
|
1183
|
+
var h;
|
|
1149
1184
|
if (!e || e.messages.length === 0) {
|
|
1150
|
-
(
|
|
1185
|
+
(h = m == null ? void 0 : m.current) == null || h.cancel();
|
|
1151
1186
|
return;
|
|
1152
1187
|
}
|
|
1153
|
-
const
|
|
1154
|
-
if (!(e.messages.length === 0 ||
|
|
1188
|
+
const g = e.messages[e.messages.length - 1];
|
|
1189
|
+
if (!(e.messages.length === 0 || g.message.role === I || g.message.role === Ee || g.message.role === q || g.message.role === Ce))
|
|
1155
1190
|
try {
|
|
1156
|
-
const
|
|
1191
|
+
const p = await He({
|
|
1157
1192
|
accessToken: await l(),
|
|
1158
1193
|
name: "generate",
|
|
1159
1194
|
data: {
|
|
1160
1195
|
messages: e.messages,
|
|
1161
1196
|
model: e.engine || z,
|
|
1162
|
-
user: (
|
|
1197
|
+
user: (s == null ? void 0 : s.username) || "",
|
|
1163
1198
|
id: e.id,
|
|
1164
1199
|
usage: e.usage
|
|
1165
1200
|
}
|
|
1166
1201
|
});
|
|
1167
|
-
if (
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1202
|
+
if (p && p.ok) {
|
|
1203
|
+
const y = J();
|
|
1204
|
+
m.current = p.body.getReader();
|
|
1170
1205
|
const _ = new TextDecoder();
|
|
1171
1206
|
for (; ; ) {
|
|
1172
1207
|
D(t, !0);
|
|
1173
|
-
const { done: N, value: w } = await
|
|
1208
|
+
const { done: N, value: w } = await m.current.read();
|
|
1174
1209
|
if (N) {
|
|
1175
1210
|
D(t, !1);
|
|
1176
1211
|
break;
|
|
@@ -1192,7 +1227,7 @@ const ne = We(
|
|
|
1192
1227
|
message: {
|
|
1193
1228
|
content: A,
|
|
1194
1229
|
role: I,
|
|
1195
|
-
messageId:
|
|
1230
|
+
messageId: y,
|
|
1196
1231
|
processingTime: T.processingTime,
|
|
1197
1232
|
name: T.name
|
|
1198
1233
|
}
|
|
@@ -1206,49 +1241,50 @@ const ne = We(
|
|
|
1206
1241
|
message: {
|
|
1207
1242
|
content: k,
|
|
1208
1243
|
role: I,
|
|
1209
|
-
messageId:
|
|
1244
|
+
messageId: y
|
|
1210
1245
|
}
|
|
1211
1246
|
}
|
|
1212
1247
|
});
|
|
1213
1248
|
}
|
|
1214
1249
|
} else
|
|
1215
1250
|
se(t);
|
|
1216
|
-
} catch (
|
|
1217
|
-
console.error(
|
|
1251
|
+
} catch (p) {
|
|
1252
|
+
console.error(p), se(t);
|
|
1218
1253
|
}
|
|
1219
1254
|
})();
|
|
1220
1255
|
}, [e == null ? void 0 : e.messages]);
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1256
|
+
const c = async (g) => {
|
|
1257
|
+
g.preventDefault(), t({
|
|
1223
1258
|
type: L,
|
|
1224
1259
|
payload: {
|
|
1225
1260
|
message: {
|
|
1226
|
-
role:
|
|
1227
|
-
content:
|
|
1261
|
+
role: K,
|
|
1262
|
+
content: i
|
|
1228
1263
|
}
|
|
1229
1264
|
}
|
|
1230
1265
|
}), o("");
|
|
1231
1266
|
};
|
|
1232
1267
|
return E(() => {
|
|
1233
|
-
(e == null ? void 0 : e.streaming) === !1 && !b.current &&
|
|
1268
|
+
(e == null ? void 0 : e.streaming) === !1 && !b.current && u.current && (b.current = !0, u.current.focus()), (e == null ? void 0 : e.streaming) === !0 && b.current === !0 && (b.current = !1);
|
|
1234
1269
|
}, [e]), E(() => {
|
|
1235
|
-
r.tag !== "" && O[r.tag] && (o(O[r.tag].content),
|
|
1270
|
+
r.tag !== "" && O[r.tag] && (o(O[r.tag].content), u.current && u.current.focus(), a({
|
|
1236
1271
|
type: ue
|
|
1237
1272
|
}));
|
|
1238
|
-
}, [r, a]), /* @__PURE__ */
|
|
1273
|
+
}, [r, a]), /* @__PURE__ */ n("form", { className: "mt-2", onSubmit: c, children: /* @__PURE__ */ n(
|
|
1239
1274
|
je,
|
|
1240
1275
|
{
|
|
1241
1276
|
mode: "dark",
|
|
1242
1277
|
focusMode: "light",
|
|
1243
|
-
ref:
|
|
1278
|
+
ref: u,
|
|
1244
1279
|
name: "chat-input",
|
|
1245
1280
|
label: Ie,
|
|
1246
1281
|
helperText: "Press ENTER to add a new line",
|
|
1247
1282
|
helperTextOnFocus: !0,
|
|
1248
1283
|
required: !0,
|
|
1249
|
-
value:
|
|
1250
|
-
onChange: (
|
|
1251
|
-
|
|
1284
|
+
value: i,
|
|
1285
|
+
onChange: (g) => o(g.target.value),
|
|
1286
|
+
onKeyDown: Ze([["mod+Enter", c]]),
|
|
1287
|
+
rightElement: /* @__PURE__ */ n(
|
|
1252
1288
|
B,
|
|
1253
1289
|
{
|
|
1254
1290
|
disabled: e == null ? void 0 : e.streaming,
|
|
@@ -1261,21 +1297,21 @@ const ne = We(
|
|
|
1261
1297
|
)
|
|
1262
1298
|
}
|
|
1263
1299
|
) });
|
|
1264
|
-
},
|
|
1265
|
-
const { isAuthenticated: e } =
|
|
1300
|
+
}, zt = () => {
|
|
1301
|
+
const { isAuthenticated: e } = Z(), t = Ae(e);
|
|
1266
1302
|
return /* @__PURE__ */ v(H, { children: [
|
|
1267
1303
|
/* @__PURE__ */ v("div", { className: t, children: [
|
|
1268
|
-
/* @__PURE__ */
|
|
1269
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ n(Be, {}),
|
|
1305
|
+
/* @__PURE__ */ n(Ut, {})
|
|
1270
1306
|
] }),
|
|
1271
|
-
/* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ n(tt, {}),
|
|
1308
|
+
/* @__PURE__ */ n(Vt, {})
|
|
1273
1309
|
] });
|
|
1274
|
-
},
|
|
1310
|
+
}, Dt = (e, t) => (t == null ? void 0 : t.type) === ce ? {
|
|
1275
1311
|
tag: t.payload.tag
|
|
1276
1312
|
} : (t == null ? void 0 : t.type) === ue ? {
|
|
1277
1313
|
tag: ""
|
|
1278
|
-
} : e,
|
|
1314
|
+
} : e, Ht = (e, t) => (t == null ? void 0 : t.type) === Me ? {
|
|
1279
1315
|
searchString: t.payload.searchString,
|
|
1280
1316
|
sortedCell: e.sortedCell,
|
|
1281
1317
|
sortDirection: e.sortDirection
|
|
@@ -1283,7 +1319,7 @@ const ne = We(
|
|
|
1283
1319
|
searchString: e.searchString,
|
|
1284
1320
|
sortedCell: t.payload.sortedCell,
|
|
1285
1321
|
sortDirection: t.payload.sortDirection
|
|
1286
|
-
} : e,
|
|
1322
|
+
} : e, jt = (e, t) => {
|
|
1287
1323
|
if ((t == null ? void 0 : t.type) === Le) {
|
|
1288
1324
|
const r = t.payload.messages.map((a) => ({
|
|
1289
1325
|
message: {
|
|
@@ -1303,34 +1339,34 @@ const ne = We(
|
|
|
1303
1339
|
};
|
|
1304
1340
|
}
|
|
1305
1341
|
if ((t == null ? void 0 : t.type) === L) {
|
|
1306
|
-
const r = t.payload.message.role, a = t.payload.message.content,
|
|
1342
|
+
const r = t.payload.message.role, a = t.payload.message.content, i = t.payload.message.name, o = t.payload.message.processingTime, l = t.payload.message.messageId;
|
|
1307
1343
|
if (r !== "") {
|
|
1308
|
-
const
|
|
1344
|
+
const s = {
|
|
1309
1345
|
role: r,
|
|
1310
1346
|
content: a,
|
|
1311
|
-
name:
|
|
1347
|
+
name: i,
|
|
1312
1348
|
processingTime: o,
|
|
1313
1349
|
messageId: l
|
|
1314
1350
|
};
|
|
1315
1351
|
if (r === I) {
|
|
1316
1352
|
const b = e.messages.findIndex(
|
|
1317
|
-
(
|
|
1353
|
+
(u) => u.message.messageId === l
|
|
1318
1354
|
);
|
|
1319
1355
|
if (b !== -1) {
|
|
1320
|
-
const
|
|
1356
|
+
const u = e.messages.map((m, c) => c === b ? {
|
|
1321
1357
|
message: {
|
|
1322
|
-
...
|
|
1323
|
-
content: `${
|
|
1358
|
+
...m.message,
|
|
1359
|
+
content: `${m.message.content}${a}`,
|
|
1324
1360
|
processingTime: o,
|
|
1325
|
-
name:
|
|
1361
|
+
name: i
|
|
1326
1362
|
}
|
|
1327
|
-
} :
|
|
1363
|
+
} : m);
|
|
1328
1364
|
return {
|
|
1329
1365
|
id: e.id,
|
|
1330
1366
|
model: e.model,
|
|
1331
1367
|
usage: e.usage,
|
|
1332
1368
|
isComponent: e.isComponent,
|
|
1333
|
-
messages:
|
|
1369
|
+
messages: u,
|
|
1334
1370
|
engine: e.engine
|
|
1335
1371
|
};
|
|
1336
1372
|
}
|
|
@@ -1344,14 +1380,14 @@ const ne = We(
|
|
|
1344
1380
|
messages: [
|
|
1345
1381
|
...e.messages,
|
|
1346
1382
|
{
|
|
1347
|
-
message:
|
|
1383
|
+
message: s
|
|
1348
1384
|
}
|
|
1349
1385
|
]
|
|
1350
1386
|
};
|
|
1351
1387
|
}
|
|
1352
1388
|
}
|
|
1353
1389
|
return (t == null ? void 0 : t.type) === le ? {
|
|
1354
|
-
id:
|
|
1390
|
+
id: J(),
|
|
1355
1391
|
model: e.model,
|
|
1356
1392
|
engine: e.engine,
|
|
1357
1393
|
usage: 0,
|
|
@@ -1373,26 +1409,26 @@ const ne = We(
|
|
|
1373
1409
|
} : e;
|
|
1374
1410
|
};
|
|
1375
1411
|
function Te({ isComponent: e = !1 }) {
|
|
1376
|
-
const t = R(!1), { getAccessToken: r, user: a } =
|
|
1412
|
+
const t = R(!1), { getAccessToken: r, user: a } = Z(), [i] = $({
|
|
1377
1413
|
key: M + ze,
|
|
1378
1414
|
initialValue: ""
|
|
1379
1415
|
}), [o] = $({
|
|
1380
1416
|
key: M + De,
|
|
1381
1417
|
initialValue: Fe.ASC
|
|
1382
|
-
}), [l,
|
|
1383
|
-
id:
|
|
1418
|
+
}), [l, s] = F(jt, {
|
|
1419
|
+
id: J(),
|
|
1384
1420
|
model: z,
|
|
1385
1421
|
engine: z,
|
|
1386
1422
|
usage: 0,
|
|
1387
1423
|
messages: [],
|
|
1388
1424
|
isComponent: e
|
|
1389
|
-
}), [b,
|
|
1390
|
-
searchString:
|
|
1425
|
+
}), [b, u] = F(Ht, {
|
|
1426
|
+
searchString: i,
|
|
1391
1427
|
sortedCell: "timestamp",
|
|
1392
1428
|
sortDirection: o
|
|
1393
|
-
}), [
|
|
1429
|
+
}), [m, c] = F(Dt, {
|
|
1394
1430
|
tag: ""
|
|
1395
|
-
}), [
|
|
1431
|
+
}), [g, h] = P({
|
|
1396
1432
|
version: "",
|
|
1397
1433
|
models: [],
|
|
1398
1434
|
plugins: [],
|
|
@@ -1400,45 +1436,45 @@ function Te({ isComponent: e = !1 }) {
|
|
|
1400
1436
|
engines: []
|
|
1401
1437
|
});
|
|
1402
1438
|
return E(() => {
|
|
1403
|
-
|
|
1439
|
+
g.version !== "" || t.current || (async () => {
|
|
1404
1440
|
try {
|
|
1405
1441
|
t.current = !0;
|
|
1406
|
-
const
|
|
1442
|
+
const p = await Pe({
|
|
1407
1443
|
accessToken: await r(),
|
|
1408
1444
|
type: Ge.ABOUT,
|
|
1409
1445
|
params: {
|
|
1410
1446
|
user: a == null ? void 0 : a.username
|
|
1411
1447
|
}
|
|
1412
1448
|
});
|
|
1413
|
-
t.current = !1,
|
|
1449
|
+
t.current = !1, p.status === 200 && (h(p.data), s({
|
|
1414
1450
|
type: he,
|
|
1415
1451
|
payload: {
|
|
1416
|
-
engine:
|
|
1452
|
+
engine: p.data.engine
|
|
1417
1453
|
}
|
|
1418
1454
|
}));
|
|
1419
1455
|
} catch {
|
|
1420
1456
|
}
|
|
1421
1457
|
})();
|
|
1422
|
-
}, [
|
|
1423
|
-
var
|
|
1424
|
-
(
|
|
1425
|
-
var
|
|
1426
|
-
(
|
|
1458
|
+
}, [g, r, a]), E(() => {
|
|
1459
|
+
var p;
|
|
1460
|
+
(p = document.getElementById("logo")) == null || p.classList.add("fadeOut"), setTimeout(() => {
|
|
1461
|
+
var y;
|
|
1462
|
+
(y = document.getElementById("root")) == null || y.classList.replace("app-hidden", "fadeIn");
|
|
1427
1463
|
}, 500);
|
|
1428
|
-
}), /* @__PURE__ */
|
|
1464
|
+
}), /* @__PURE__ */ n(j.Provider, { value: { state: l, dispatch: s, serverStats: g }, children: /* @__PURE__ */ n(
|
|
1429
1465
|
$e.Provider,
|
|
1430
1466
|
{
|
|
1431
1467
|
value: {
|
|
1432
1468
|
state: b,
|
|
1433
|
-
dispatch:
|
|
1469
|
+
dispatch: u
|
|
1434
1470
|
},
|
|
1435
1471
|
children: /* @__PURE__ */ v(
|
|
1436
|
-
|
|
1472
|
+
Y.Provider,
|
|
1437
1473
|
{
|
|
1438
|
-
value: { state:
|
|
1474
|
+
value: { state: m, dispatch: c },
|
|
1439
1475
|
children: [
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ n(Ue, { children: /* @__PURE__ */ n(zt, {}) }),
|
|
1477
|
+
/* @__PURE__ */ n(Ve, { serverStats: g })
|
|
1442
1478
|
]
|
|
1443
1479
|
}
|
|
1444
1480
|
)
|
|
@@ -1446,8 +1482,8 @@ function Te({ isComponent: e = !1 }) {
|
|
|
1446
1482
|
) });
|
|
1447
1483
|
}
|
|
1448
1484
|
Te.displayName = "App";
|
|
1449
|
-
const
|
|
1485
|
+
const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Te }, Symbol.toStringTag, { value: "Module" }));
|
|
1450
1486
|
export {
|
|
1451
|
-
|
|
1452
|
-
|
|
1487
|
+
Yt as App,
|
|
1488
|
+
_t as le
|
|
1453
1489
|
};
|