@versini/sassysaint 5.5.37 → 5.5.39

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.
@@ -1,4114 +0,0 @@
1
- import { jsxs as x, jsx as i, Fragment as Le } from "react/jsx-runtime";
2
- import { g as me, ACTION_RESTORE as qr, ACTION_MESSAGE as ye, ROLE_ASSISTANT as ve, ACTION_RESET as ft, ACTION_MODEL as ir, ACTION_STREAMING as cr, ACTION_SORT as Kr, ACTION_SEARCH as Jr, ACTION_RESET_PROMPT as lr, ACTION_TOGGLE_PROMPT as dr, DEFAULT_AI_ENGINE as ke, P as Ae, un as Ee, ENGINE_ANTHROPIC as Fe, ENGINE_OPENAI as zt, PROMPT_CLASSNAME as Yr, PROMPT_EDITABLE_AREA_CLASSNAME as Zr, ROLE_SYSTEM as Xr, ROLE_INTERNAL as pt, ROLE_HIDDEN as Qr, STATS_SEPARATOR as $t, CLIPBOARD_PROMPT as Dt, TYPE_QUESTION as ea, ERROR_MESSAGE as ta, ROLE_USER as Qe, FOOTER_DISCLAIMER as ra, isLastMessageFromRole as aa, getMessageContaintWrapperClass as na, Logo as oa, getMainPaddingClass as Vt, r as sa, LOCAL_STORAGE_PREFIX as Pt, LOCAL_STORAGE_SEARCH as ia, LOCAL_STORAGE_SORT as ca } from "./index.gfLDgD4t.js";
3
- import l from "clsx";
4
- import * as et from "react";
5
- import A, { useRef as M, useState as q, useCallback as ne, useSyncExternalStore as la, useEffect as D, useMemo as ur, useId as da, useContext as z, createContext as ua, useLayoutEffect as ma, useDebugValue as ga, forwardRef as mr, lazy as gr, Suspense as tt, useReducer as He } from "react";
6
- import { useFloatingTree as hr, useFloatingNodeId as ha, useListItem as fr, useFloating as fa, offset as pa, flip as ba, shift as ya, autoUpdate as va, useClick as ka, useRole as _a, useDismiss as Ea, useListNavigation as xa, useTypeahead as Ta, useInteractions as wa, useMergeRefs as pr, FloatingNode as Sa, FloatingList as Na, FloatingPortal as Ca, FloatingFocusManager as Ra, FloatingTree as Ia } from "@floating-ui/react";
7
- const La = ({
8
- className: e,
9
- viewBox: t,
10
- title: r,
11
- monotone: a,
12
- ...n
13
- }) => /* @__PURE__ */ x(
14
- me,
15
- {
16
- defaultViewBox: "0 0 448 512",
17
- size: "size-5",
18
- viewBox: t,
19
- className: e,
20
- title: r || "Add",
21
- ...n,
22
- children: [
23
- /* @__PURE__ */ i("path", { className: "fa-secondary", opacity: a ? "1" : "0.4", d: "" }),
24
- /* @__PURE__ */ i(
25
- "path",
26
- {
27
- className: "fa-primary",
28
- d: "M248 72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 160L40 232c-13.3 0-24 10.7-24 24s10.7 24 24 24l160 0 0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160 160 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-160 0 0-160z"
29
- }
30
- )
31
- ]
32
- }
33
- ), Ut = ({
34
- className: e,
35
- viewBox: t,
36
- title: r,
37
- monotone: a,
38
- ...n
39
- }) => /* @__PURE__ */ i(
40
- me,
41
- {
42
- defaultViewBox: "0 0 24 24",
43
- size: "size-5",
44
- viewBox: t,
45
- className: e,
46
- title: r || "Anthropic",
47
- ...n,
48
- children: /* @__PURE__ */ i("path", { d: "M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z" })
49
- }
50
- ), Aa = ({
51
- className: e,
52
- viewBox: t,
53
- title: r,
54
- monotone: a,
55
- ...n
56
- }) => /* @__PURE__ */ x(
57
- me,
58
- {
59
- defaultViewBox: "0 0 448 512",
60
- size: "size-5",
61
- viewBox: t,
62
- className: e,
63
- title: r || "Book",
64
- ...n,
65
- children: [
66
- /* @__PURE__ */ i(
67
- "path",
68
- {
69
- className: "fa-secondary",
70
- opacity: a ? "1" : "0.4",
71
- d: "M48 88l0 270.7c9.8-4.3 20.6-6.7 32-6.7l312 0c4.4 0 8-3.6 8-8l0-288c0-4.4-3.6-8-8-8L88 48C65.9 48 48 65.9 48 88zm94.3 32.8L160 112l8.8-17.7c2.9-5.9 11.4-5.9 14.3 0L192 112l17.7 8.8c5.9 2.9 5.9 11.4 0 14.3L192 144l-8.8 17.7c-2.9 5.9-11.4 5.9-14.3 0L160 144l-17.7-8.8c-5.9-2.9-5.9-11.4 0-14.3zm82.8 111.8L264 216l16.6-38.8c2.8-6.5 11.9-6.5 14.7 0L312 216l38.8 16.6c6.5 2.8 6.5 11.9 0 14.7L312 264l-16.6 38.8c-2.8 6.5-11.9 6.5-14.7 0L264 264l-38.8-16.6c-6.5-2.8-6.5-11.9 0-14.7z"
72
- }
73
- ),
74
- /* @__PURE__ */ i(
75
- "path",
76
- {
77
- className: "fa-primary",
78
- d: "M0 88C0 39.4 39.4 0 88 0L392 0c30.9 0 56 25.1 56 56l0 288c0 22.3-13.1 41.6-32 50.6l0 69.4 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L80 512c-44.2 0-80-35.8-80-80c0-2.7 .1-5.4 .4-8L0 424 0 88zM80 400c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0 0-64L80 400zM48 358.7c9.8-4.3 20.6-6.7 32-6.7l312 0c4.4 0 8-3.6 8-8l0-288c0-4.4-3.6-8-8-8L88 48C65.9 48 48 65.9 48 88l0 270.7zM160 112l8.8-17.7c2.9-5.9 11.4-5.9 14.3 0L192 112l17.7 8.8c5.9 2.9 5.9 11.4 0 14.3L192 144l-8.8 17.7c-2.9 5.9-11.4 5.9-14.3 0L160 144l-17.7-8.8c-5.9-2.9-5.9-11.4 0-14.3L160 112zM264 216l16.6-38.8c2.8-6.5 11.9-6.5 14.7 0L312 216l38.8 16.6c6.5 2.8 6.5 11.9 0 14.7L312 264l-16.6 38.8c-2.8 6.5-11.9 6.5-14.7 0L264 264l-38.8-16.6c-6.5-2.8-6.5-11.9 0-14.7L264 216z"
79
- }
80
- )
81
- ]
82
- }
83
- ), Oa = ({
84
- className: e,
85
- viewBox: t,
86
- title: r,
87
- monotone: a,
88
- ...n
89
- }) => /* @__PURE__ */ i(
90
- me,
91
- {
92
- defaultViewBox: "0 0 384 512",
93
- size: "size-5",
94
- viewBox: t,
95
- className: e,
96
- title: r || "Close",
97
- ...n,
98
- children: /* @__PURE__ */ i("path", { d: "M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z" })
99
- }
100
- ), Ft = ({
101
- className: e,
102
- viewBox: t,
103
- title: r,
104
- monotone: a,
105
- ...n
106
- }) => /* @__PURE__ */ i(
107
- me,
108
- {
109
- defaultViewBox: "0 0 24 24",
110
- size: "size-5",
111
- viewBox: t,
112
- className: e,
113
- title: r || "OpenAI",
114
- ...n,
115
- children: /* @__PURE__ */ i("path", { d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" })
116
- }
117
- ), Ba = ({
118
- className: e,
119
- viewBox: t,
120
- title: r,
121
- monotone: a,
122
- ...n
123
- }) => /* @__PURE__ */ i(
124
- me,
125
- {
126
- defaultViewBox: "0 0 384 512",
127
- size: "size-5",
128
- viewBox: t,
129
- className: e,
130
- title: r || "Up",
131
- ...n,
132
- children: /* @__PURE__ */ i("path", { d: "M209.4 39.4C204.8 34.7 198.6 32 192 32s-12.8 2.7-17.4 7.4l-168 176c-9.2 9.6-8.8 24.8 .8 33.9s24.8 8.8 33.9-.8L168 115.9 168 456c0 13.3 10.7 24 24 24s24-10.7 24-24l0-340.1L342.6 248.6c9.2 9.6 24.3 9.9 33.9 .8s9.9-24.3 .8-33.9l-168-176z" })
133
- }
134
- );
135
- /*!
136
- @versini/ui-header v3.0.4
137
- © 2025 gizmette.com
138
- */
139
- try {
140
- window.__VERSINI_UI_HEADER__ || (window.__VERSINI_UI_HEADER__ = {
141
- version: "3.0.4",
142
- buildTime: "01/14/2025 10:39 AM EST",
143
- homepage: "https://github.com/aversini/ui-components",
144
- license: "MIT"
145
- });
146
- } catch {
147
- }
148
- const Ma = "av-header", za = ({
149
- children: e,
150
- className: t,
151
- raw: r = !1,
152
- mode: a = "system",
153
- noColors: n = !1,
154
- sticky: o = !1,
155
- noBorder: s = !1,
156
- noMargin: c = !1,
157
- noPadding: g = !1
158
- }) => {
159
- const d = l(
160
- Ma,
161
- {
162
- "border-border-accent": a === "dark" && !r && !n && !s,
163
- "border-border-medium": a === "light" && !r && !n && !s,
164
- "border-border-accent dark:border-border-medium": a === "alt-system" && !r && !n && !s,
165
- "border-border-medium dark:border-border-accent": a === "system" && !r && !n && !s,
166
- "border-b-4": !r && !s,
167
- "border-transparent": !r && n,
168
- "bg-surface-dark": a === "dark" && !r && !n,
169
- "bg-surface-light": a === "light" && !r && !n,
170
- "bg-surface-dark dark:bg-surface-light": a === "alt-system" && !r && !n,
171
- "bg-surface-light dark:bg-surface-dark": a === "system" && !r && !n,
172
- "sticky top-0 z-50": o
173
- },
174
- t
175
- ), f = l({
176
- "mt-0": !c,
177
- "p-2": !g,
178
- "flex flex-col w-full md:mx-auto md:max-w-4xl": !r
179
- });
180
- return /* @__PURE__ */ i("header", { className: d, children: /* @__PURE__ */ i("div", { className: f, children: e }) });
181
- };
182
- function $a(e) {
183
- const t = e.toLowerCase().split("+").map((o) => o.trim()), r = {
184
- alt: t.includes("alt"),
185
- ctrl: t.includes("ctrl"),
186
- meta: t.includes("meta"),
187
- mod: t.includes("mod"),
188
- shift: t.includes("shift")
189
- }, a = ["alt", "ctrl", "meta", "shift", "mod"], n = t.find((o) => !a.includes(o));
190
- return {
191
- ...r,
192
- key: n
193
- };
194
- }
195
- function Da(e, t) {
196
- const { alt: r, ctrl: a, meta: n, mod: o, shift: s, key: c } = e, { altKey: g, ctrlKey: d, metaKey: f, shiftKey: m, key: u } = t;
197
- if (r !== g)
198
- return !1;
199
- if (o) {
200
- if (!d && !f)
201
- return !1;
202
- } else if (a !== d || n !== f)
203
- return !1;
204
- return s !== m ? !1 : !!(c && (u.toLowerCase() === c.toLowerCase() || t.code.replace("Key", "").toLowerCase() === c.toLowerCase()));
205
- }
206
- function Va(e) {
207
- return (t) => Da($a(e), t);
208
- }
209
- function Pa(e) {
210
- return (t) => {
211
- const r = "nativeEvent" in t ? t.nativeEvent : t;
212
- e.forEach(([a, n, o = { preventDefault: !0 }]) => {
213
- Va(a)(r) && (o.preventDefault && t.preventDefault(), n(r));
214
- });
215
- };
216
- }
217
- function Ua() {
218
- const e = M(null), [t, r] = q(!1);
219
- return { ref: ne((a) => {
220
- var n, o;
221
- typeof IntersectionObserver < "u" && (a && !e.current ? e.current = new IntersectionObserver(
222
- (s) => r(s.some((c) => c.isIntersecting))
223
- ) : (n = e.current) == null || n.disconnect(), a ? (o = e.current) == null || o.observe(a) : r(!1));
224
- }, []), inViewport: t };
225
- }
226
- function br(e, t) {
227
- window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
228
- }
229
- const Ht = (e, t) => {
230
- const r = JSON.stringify(
231
- typeof t == "function" ? t() : t
232
- );
233
- window.localStorage.setItem(e, r), br(e, r);
234
- }, Fa = (e) => {
235
- window.localStorage.removeItem(e), br(e, null);
236
- }, Wt = (e) => window.localStorage.getItem(e), Ha = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
237
- function Gt({
238
- key: e,
239
- initialValue: t
240
- }) {
241
- const r = la(Ha, () => Wt(e)), a = ne(
242
- (s) => {
243
- try {
244
- const c = typeof s == "function" ? s(JSON.parse(r)) : s;
245
- c == null ? Fa(e) : Ht(e, c);
246
- } catch (c) {
247
- console.warn(c);
248
- }
249
- },
250
- [e, r]
251
- ), n = ne(() => {
252
- a(t);
253
- }, [t, a]), o = ne(() => {
254
- a(null);
255
- }, [a]);
256
- return D(() => {
257
- try {
258
- Wt(e) === null && typeof t < "u" && Ht(e, t);
259
- } catch (s) {
260
- console.warn(s);
261
- }
262
- }, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
263
- }
264
- function Wa(e) {
265
- return ur(() => e.every((t) => t == null) ? () => {
266
- } : (t) => {
267
- e.forEach((r) => {
268
- typeof r == "function" ? r(t) : r != null && (r.current = t);
269
- });
270
- }, e);
271
- }
272
- function Ga({
273
- value: e,
274
- defaultValue: t,
275
- finalValue: r,
276
- onChange: a = () => {
277
- },
278
- initialControlledDelay: n = 0
279
- }) {
280
- const [o, s] = q(!1), [c, g] = q(
281
- t !== void 0 ? t : r
282
- ), d = (f) => {
283
- g(f), a == null || a(f);
284
- };
285
- return D(() => {
286
- (async () => e !== void 0 && !o && n > 0 && (await new Promise(
287
- (f) => setTimeout(f, n)
288
- ), s(!0)))();
289
- }, [e, n, o]), e !== void 0 ? !o && n > 0 ? ["", a, !0] : [e, a, !0] : [c, d, !1];
290
- }
291
- function ja(e) {
292
- return da();
293
- }
294
- /*!
295
- @versini/ui-table v3.0.11
296
- © 2025 gizmette.com
297
- */
298
- try {
299
- window.__VERSINI_UI_TABLE__ || (window.__VERSINI_UI_TABLE__ = {
300
- version: "3.0.11",
301
- buildTime: "01/14/2025 10:39 AM EST",
302
- homepage: "https://github.com/aversini/ui-components",
303
- license: "MIT"
304
- });
305
- } catch {
306
- }
307
- const Oe = "thead", bt = "tfoot", ue = "tbody", be = {
308
- ASC: "asc",
309
- DESC: "desc"
310
- }, qa = ({
311
- mode: e,
312
- className: t,
313
- wrapperClassName: r,
314
- stickyHeader: a,
315
- stickyFooter: n
316
- }) => ({
317
- wrapper: l(
318
- "not-prose relative w-full rounded-lg shadow-md",
319
- {
320
- "overflow-x-auto": !a && !n,
321
- "overflow-y-scroll": a || n,
322
- "bg-surface-darker": e === "dark" || e === "system",
323
- "bg-surface-light": e === "light" || e === "alt-system",
324
- "dark:bg-surface-light": e === "system",
325
- "dark:bg-surface-darker": e === "alt-system",
326
- "text-copy-light": e === "dark",
327
- "text-copy-dark": e === "light",
328
- "text-copy-light dark:text-copy-dark": e === "system",
329
- "text-copy-dark dark:text-copy-light": e === "alt-system"
330
- },
331
- r
332
- ),
333
- table: l("my-0 w-full text-left text-sm", t, {
334
- "text-copy-light": e === "dark",
335
- "text-copy-dark": e === "light",
336
- "text-copy-light dark:text-copy-dark": e === "system",
337
- "text-copy-dark dark:text-copy-light": e === "alt-system"
338
- }),
339
- caption: l("py-2 text-sm font-bold", {
340
- "text-copy-light": e === "dark",
341
- "text-copy-dark": e === "light",
342
- "text-copy-light dark:text-copy-dark": e === "system",
343
- "text-copy-dark dark:text-copy-light": e === "alt-system"
344
- })
345
- }), Ka = ({
346
- className: e,
347
- stickyHeader: t,
348
- mode: r
349
- }) => l(
350
- {
351
- "sticky top-0 z-10": t,
352
- "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": t && r === "dark",
353
- "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": t && r === "system",
354
- "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": t && r === "light",
355
- "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": t && r === "alt-system"
356
- },
357
- e
358
- ), Ja = ({
359
- className: e,
360
- stickyFooter: t,
361
- mode: r
362
- }) => l(
363
- {
364
- "sticky bottom-0 z-10": t,
365
- "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": t && r === "dark",
366
- "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": t && r === "system",
367
- "shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": t && r === "light",
368
- "shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": t && r === "alt-system"
369
- },
370
- e
371
- ), Ya = ({
372
- mode: e,
373
- className: t,
374
- cellWrapper: r
375
- }) => r === Oe || r === bt ? l(
376
- {
377
- "bg-table-head-dark": e === "dark" || e === "system",
378
- "bg-table-head-light": e === "light" || e === "alt-system",
379
- "dark:bg-table-head-light": e === "system",
380
- "dark:bg-table-head-dark": e === "alt-system"
381
- },
382
- t
383
- ) : l(
384
- "border-b last:border-0",
385
- {
386
- "border-table-dark": e === "dark" || e === "system",
387
- "odd:bg-table-dark-odd even:bg-table-dark-even": r === ue && e === "dark",
388
- "border-table-light": e === "light" || e === "alt-system",
389
- "odd:bg-table-light-odd even:bg-table-light-even": r === ue && e === "light",
390
- "dark:border-table-light": e === "system",
391
- "odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": r === ue && e === "system",
392
- "dark:border-table-dark": e === "alt-system",
393
- "odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": r === ue && e === "alt-system"
394
- },
395
- t
396
- ), Za = ({
397
- cellWrapper: e,
398
- className: t,
399
- compact: r,
400
- mode: a,
401
- align: n
402
- }) => ({
403
- alignClasses: l({
404
- "flex justify-start text-left": n === "left",
405
- "flex justify-center text-center": n === "center",
406
- "flex justify-end text-right": n === "right"
407
- }),
408
- mainClasses: l(
409
- {
410
- "text-copy-light": a === "dark" || a === "system",
411
- "text-copy-dark": a === "light" || a === "alt-system",
412
- "dark:text-copy-dark": a === "system",
413
- "dark:text-copy-light": a === "alt-system",
414
- "px-4 py-3": !r && (e === Oe || e === bt),
415
- "p-4": !r && e === ue,
416
- "px-2 py-1.5": r
417
- },
418
- t
419
- )
420
- }), Xa = ({
421
- buttonClassName: e
422
- }) => l("rounded-none text-sm", e), jt = "av-button", yt = "icon", yr = "button", rt = "link", Qa = ({
423
- type: e,
424
- size: t,
425
- labelRight: r,
426
- labelLeft: a,
427
- align: n
428
- }) => {
429
- const o = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", c = "max-h-12 py-2 px-4";
430
- switch (e) {
431
- case yr:
432
- case rt:
433
- return l({
434
- [o]: t === "small",
435
- [s]: t === "medium",
436
- [c]: t === "large"
437
- });
438
- case yt:
439
- return l("inline-flex items-center", {
440
- "justify-center": n === "center",
441
- "justify-start": n === "left",
442
- "justify-end": n === "right",
443
- "h-6 w-6 p-0": t === "small" && !(r || a),
444
- "h-6 px-2": t === "small" && (r || a),
445
- "h-8 w-8 p-1": t === "medium" && !(r || a),
446
- "h-8 px-3": t === "medium" && (r || a),
447
- "h-12 w-12 p-2": t === "large" && !(r || a),
448
- "h-12 px-4": t === "large" && (r || a)
449
- });
450
- }
451
- }, en = ({
452
- type: e,
453
- size: t,
454
- labelRight: r,
455
- labelLeft: a
456
- }) => {
457
- const n = "text-sm font-medium", o = "text-base font-medium", s = "text-lg font-medium";
458
- switch (e) {
459
- case yr:
460
- case rt:
461
- return l({
462
- "text-center": e === rt,
463
- [n]: t === "small",
464
- [o]: t === "medium",
465
- [s]: t === "large"
466
- });
467
- case yt:
468
- return l({
469
- [n]: t === "small" && (r || a),
470
- [o]: t === "medium" && (r || a),
471
- [s]: t === "large" && (r || a)
472
- });
473
- }
474
- }, tn = ({
475
- mode: e,
476
- noBackground: t,
477
- noTruncate: r,
478
- variant: a
479
- }) => {
480
- if (t)
481
- return "not-prose";
482
- if (a === "primary")
483
- return l("not-prose", {
484
- truncate: !r,
485
- "text-copy-light": e === "dark" || e === "system",
486
- "text-copy-lighter": e === "light" || e === "alt-system",
487
- "dark:text-copy-lighter": e === "system",
488
- "dark:text-copy-light": e === "alt-system"
489
- });
490
- if (a === "secondary")
491
- return l("not-prose", {
492
- truncate: !r,
493
- "text-copy-light": e === "light" || e === "system",
494
- "text-copy-lighter": e === "dark" || e === "alt-system",
495
- "dark:text-copy-lighter": e === "alt-system",
496
- "dark:text-copy-light": e === "system"
497
- });
498
- if (a === "danger")
499
- return l("not-prose", {
500
- truncate: !r,
501
- "text-copy-light": e === "dark" || e === "system",
502
- "text-copy-lighter": e === "light" || e === "alt-system",
503
- "dark:text-copy-lighter": e === "system",
504
- "dark:text-copy-light": e === "alt-system"
505
- });
506
- if (a === "selected")
507
- return l("not-prose text-copy-lighter", {
508
- truncate: !r
509
- });
510
- }, rn = ({
511
- mode: e,
512
- noBackground: t,
513
- variant: r
514
- }) => {
515
- if (!t) {
516
- if (r === "primary")
517
- return l({
518
- "bg-action-dark": e === "dark",
519
- "bg-action-light": e === "light",
520
- "bg-action-dark dark:bg-action-light": e === "system",
521
- "bg-action-light dark:bg-action-dark": e === "alt-system"
522
- });
523
- if (r === "secondary")
524
- return l({
525
- "bg-action-dark": e === "light",
526
- "bg-action-light": e === "dark",
527
- "bg-action-dark dark:bg-action-light": e === "alt-system",
528
- "bg-action-light dark:bg-action-dark": e === "system"
529
- });
530
- if (r === "danger")
531
- return l({
532
- "bg-action-danger-dark": e === "dark",
533
- "bg-action-danger-light": e === "light",
534
- "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
535
- "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
536
- });
537
- if (r === "selected")
538
- return "bg-action-selected-dark";
539
- }
540
- }, an = ({
541
- radius: e
542
- }) => l({
543
- "rounded-full": e === "large",
544
- "rounded-md": e === "medium",
545
- "rounded-sm": e === "small"
546
- }), nn = ({
547
- mode: e,
548
- disabled: t,
549
- variant: r
550
- }) => {
551
- if (t)
552
- return "";
553
- if (r === "primary")
554
- return l("hover:text-copy-light-hover", {
555
- "hover:bg-action-dark-hover": e === "dark",
556
- "hover:bg-action-light-hover": e === "light",
557
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
558
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
559
- });
560
- if (r === "secondary")
561
- return l("hover:text-copy-light-hover", {
562
- "hover:bg-action-dark-hover": e === "light",
563
- "hover:bg-action-light-hover": e === "dark",
564
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
565
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
566
- });
567
- if (r === "danger")
568
- return l("hover:text-copy-light-hover", {
569
- "hover:bg-action-danger-dark-hover": e === "dark",
570
- "hover:bg-action-danger-light-hover": e === "light",
571
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
572
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
573
- });
574
- if (r === "selected")
575
- return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
576
- }, on = ({
577
- mode: e,
578
- disabled: t,
579
- variant: r
580
- }) => {
581
- if (t)
582
- return "";
583
- if (r === "primary")
584
- return l("active:text-copy-light-active", {
585
- "active:bg-action-dark-active": e === "dark",
586
- "active:bg-action-light-active": e === "light",
587
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
588
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
589
- });
590
- if (r === "secondary")
591
- return l("active:text-copy-light-active", {
592
- "active:bg-action-dark-active": e === "light",
593
- "active:bg-action-light-active": e === "dark",
594
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
595
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
596
- });
597
- if (r === "danger")
598
- return l("active:text-copy-lighter-active", {
599
- "active:bg-action-danger-dark-active": e === "dark",
600
- "active:bg-action-danger-light-active": e === "light",
601
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
602
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
603
- });
604
- if (r === "selected")
605
- return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
606
- }, sn = ({
607
- mode: e,
608
- noBorder: t,
609
- variant: r
610
- }) => {
611
- if (t)
612
- return "border border-transparent";
613
- if (r === "primary")
614
- return l("border", {
615
- "border-border-dark": e === "dark",
616
- "border-border-accent": e === "light",
617
- "border-border-dark dark:border-border-accent": e === "system",
618
- "border-border-accent dark:border-border-dark": e === "alt-system"
619
- });
620
- if (r === "secondary")
621
- return l("border", {
622
- "border-border-dark": e === "light",
623
- "border-border-accent": e === "dark",
624
- "border-border-dark dark:border-border-accent": e === "alt-system",
625
- "border-border-accent dark:border-border-dark": e === "system"
626
- });
627
- if (r === "danger")
628
- return l("border", {
629
- "border-border-danger-dark": e === "dark",
630
- "border-border-danger-medium": e === "light",
631
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
632
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
633
- });
634
- if (r === "selected")
635
- return "border border-border-selected-dark";
636
- }, cn = ({
637
- focusMode: e
638
- }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
639
- "focus:outline-focus-dark": e === "dark",
640
- "focus:outline-focus-light": e === "light",
641
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
642
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
643
- }), ln = ({
644
- type: e,
645
- className: t,
646
- raw: r,
647
- mode: a,
648
- focusMode: n,
649
- disabled: o,
650
- fullWidth: s,
651
- size: c,
652
- noBorder: g,
653
- labelRight: d,
654
- labelLeft: f,
655
- noBackground: m,
656
- variant: u,
657
- noTruncate: h,
658
- align: p,
659
- radius: y
660
- }) => (u || (u = "primary"), r ? l(jt, t) : l(
661
- jt,
662
- tn({
663
- mode: a,
664
- variant: u,
665
- noBackground: m,
666
- noTruncate: h
667
- }),
668
- rn({ mode: a, noBackground: m, variant: u }),
669
- an({ radius: y }),
670
- Qa({
671
- type: e,
672
- size: c,
673
- labelRight: d,
674
- labelLeft: f,
675
- align: p
676
- }),
677
- en({ type: e, size: c, labelRight: d, labelLeft: f }),
678
- sn({ mode: a, variant: u, noBorder: g }),
679
- cn({ focusMode: n }),
680
- nn({ mode: a, variant: u, disabled: o }),
681
- on({ mode: a, variant: u, disabled: o }),
682
- {
683
- "w-full": s,
684
- "disabled:cursor-not-allowed disabled:opacity-50": o
685
- },
686
- t
687
- )), dn = (e, t, r) => {
688
- var a;
689
- !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);
690
- }, vr = A.forwardRef((e, t) => {
691
- const { onClick: r, noInternalClick: a = !1, ...n } = e;
692
- return /* @__PURE__ */ i(
693
- "button",
694
- {
695
- ref: t,
696
- onClick: (o) => {
697
- dn(o, a, r);
698
- },
699
- ...n
700
- }
701
- );
702
- });
703
- vr.displayName = "BaseButton";
704
- /*!
705
- @versini/ui-button v4.0.10
706
- © 2025 gizmette.com
707
- */
708
- try {
709
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
710
- version: "4.0.10",
711
- buildTime: "01/14/2025 10:39 AM EST",
712
- homepage: "https://github.com/aversini/ui-components",
713
- license: "MIT"
714
- });
715
- } catch {
716
- }
717
- const kr = A.forwardRef(
718
- ({
719
- children: e,
720
- disabled: t = !1,
721
- mode: r = "system",
722
- focusMode: a = "system",
723
- fullWidth: n = !1,
724
- className: o,
725
- type: s = "button",
726
- raw: c = !1,
727
- noBorder: g = !1,
728
- "aria-label": d,
729
- label: f,
730
- size: m = "medium",
731
- labelRight: u,
732
- labelLeft: h,
733
- noBackground: p = !1,
734
- align: y = "center",
735
- active: v = !1,
736
- radius: b = "large",
737
- ..._
738
- }, T) => {
739
- const N = ln({
740
- type: yt,
741
- mode: r,
742
- focusMode: a,
743
- fullWidth: n,
744
- disabled: t,
745
- raw: c,
746
- className: o,
747
- noBorder: g,
748
- size: m,
749
- labelRight: u,
750
- labelLeft: h,
751
- noBackground: p,
752
- align: y,
753
- radius: b
754
- }), k = l({
755
- "text-copy-accent-dark": r === "light" && !c,
756
- "text-copy-light": r === "dark" && !c,
757
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
758
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
759
- }), C = v ? l(
760
- "relative",
761
- "focus-within:static",
762
- "focus-within:after:border-transparent",
763
- "after:absolute",
764
- "after:content-['']",
765
- "after:border-b-2",
766
- "after:bottom-[-4px]",
767
- "after:left-0",
768
- "after:right-0",
769
- {
770
- "after:border-table-dark": r === "dark",
771
- "after:border-table-light": r === "light",
772
- "after:border-table-dark dark:after:border-table-light": r === "system",
773
- "after:border-table-light dark:after:border-table-dark": r === "alt-system"
774
- }
775
- ) : "";
776
- return /* @__PURE__ */ i("div", { className: C, children: /* @__PURE__ */ x(
777
- vr,
778
- {
779
- ref: T,
780
- className: N,
781
- disabled: t,
782
- type: s,
783
- "aria-label": d || f,
784
- ..._,
785
- children: [
786
- h && /* @__PURE__ */ i("span", { className: "pr-2", children: h }),
787
- /* @__PURE__ */ i("div", { className: k, children: e }),
788
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
789
- ]
790
- }
791
- ) });
792
- }
793
- );
794
- kr.displayName = "ButtonSort";
795
- const vt = ({
796
- children: e,
797
- fill: t,
798
- viewBox: r,
799
- className: a,
800
- defaultViewBox: n,
801
- size: o,
802
- title: s,
803
- semantic: c = !1,
804
- ...g
805
- }) => {
806
- const d = l(o, a);
807
- return /* @__PURE__ */ x(Le, { children: [
808
- /* @__PURE__ */ i(
809
- "svg",
810
- {
811
- xmlns: "http://www.w3.org/2000/svg",
812
- className: d,
813
- viewBox: r || n,
814
- fill: t || "currentColor",
815
- role: "img",
816
- "aria-hidden": !c,
817
- focusable: !1,
818
- ...g,
819
- children: e
820
- }
821
- ),
822
- s && c && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
823
- ] });
824
- };
825
- /*!
826
- @versini/ui-svgicon v4.0.3
827
- © 2025 gizmette.com
828
- */
829
- try {
830
- window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
831
- version: "4.0.3",
832
- buildTime: "01/14/2025 10:39 AM EST",
833
- homepage: "https://github.com/aversini/ui-components",
834
- license: "MIT"
835
- });
836
- } catch {
837
- }
838
- const un = ({
839
- className: e,
840
- viewBox: t,
841
- title: r,
842
- monotone: a,
843
- ...n
844
- }) => /* @__PURE__ */ x(
845
- vt,
846
- {
847
- defaultViewBox: "0 0 576 512",
848
- size: "size-5",
849
- viewBox: t,
850
- className: e,
851
- title: r || "Sort",
852
- ...n,
853
- children: [
854
- /* @__PURE__ */ i(
855
- "path",
856
- {
857
- className: "fa-secondary",
858
- opacity: a ? "1" : "0.4",
859
- d: "M297.4 137.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L384 141.3 384 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7 41.4 41.4c12.5 12.5 32.8 12.5 45.3 0c6.2-6.2 9.4-14.4 9.4-22.6s-3.1-16.4-9.4-22.6l-96-96C432.4 35.1 424.2 32 416 32s-16.4 3.1-22.6 9.4l-96 96z"
860
- }
861
- ),
862
- /* @__PURE__ */ i(
863
- "path",
864
- {
865
- className: "fa-primary",
866
- d: "M137.4 470.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 370.7 192 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 306.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z"
867
- }
868
- )
869
- ]
870
- }
871
- ), mn = ({
872
- className: e,
873
- viewBox: t,
874
- title: r,
875
- monotone: a,
876
- ...n
877
- }) => /* @__PURE__ */ x(
878
- vt,
879
- {
880
- defaultViewBox: "0 0 576 512",
881
- size: "size-5",
882
- viewBox: t,
883
- className: e,
884
- title: r || "Sort Down",
885
- ...n,
886
- children: [
887
- /* @__PURE__ */ i(
888
- "path",
889
- {
890
- className: "fa-secondary",
891
- opacity: a ? "1" : "0.4",
892
- d: "M288 64c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32z"
893
- }
894
- ),
895
- /* @__PURE__ */ i(
896
- "path",
897
- {
898
- className: "fa-primary",
899
- d: "M128 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L160 365.7 160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 301.7L63.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C110.5 476.2 119 480 128 480z"
900
- }
901
- )
902
- ]
903
- }
904
- ), gn = ({
905
- className: e,
906
- viewBox: t,
907
- title: r,
908
- monotone: a,
909
- ...n
910
- }) => /* @__PURE__ */ x(
911
- vt,
912
- {
913
- defaultViewBox: "0 0 576 512",
914
- size: "size-5",
915
- viewBox: t,
916
- className: e,
917
- title: r || "Sort Up",
918
- ...n,
919
- children: [
920
- /* @__PURE__ */ i(
921
- "path",
922
- {
923
- className: "fa-secondary",
924
- opacity: a ? "1" : "0.4",
925
- d: "M288 64c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32z"
926
- }
927
- ),
928
- /* @__PURE__ */ i(
929
- "path",
930
- {
931
- className: "fa-primary",
932
- d: "M128 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L160 146.3 160 448c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-301.7L63.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32z"
933
- }
934
- )
935
- ]
936
- }
937
- );
938
- /*!
939
- @versini/ui-icons v4.4.2
940
- © 2025 gizmette.com
941
- */
942
- try {
943
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
944
- version: "4.4.2",
945
- buildTime: "01/14/2025 10:39 AM EST",
946
- homepage: "https://github.com/aversini/ui-components",
947
- license: "MIT"
948
- });
949
- } catch {
950
- }
951
- const ge = A.createContext({
952
- mode: "light",
953
- cellWrapper: "thead",
954
- stickyHeader: !1,
955
- stickyFooter: !1,
956
- compact: !1
957
- }), gs = ({
958
- children: e,
959
- mode: t = "system",
960
- caption: r,
961
- compact: a,
962
- summary: n,
963
- className: o,
964
- wrapperClassName: s,
965
- maxHeight: c,
966
- stickyHeader: g,
967
- stickyFooter: d,
968
- ...f
969
- }) => {
970
- const m = qa({
971
- mode: t,
972
- className: o,
973
- wrapperClassName: s,
974
- stickyHeader: g,
975
- stickyFooter: d
976
- });
977
- return /* @__PURE__ */ i(
978
- ge.Provider,
979
- {
980
- value: { mode: t, stickyHeader: g, stickyFooter: d, compact: a },
981
- children: /* @__PURE__ */ i(
982
- "div",
983
- {
984
- className: m.wrapper,
985
- ...c && {
986
- style: { maxHeight: c }
987
- },
988
- children: /* @__PURE__ */ x("table", { className: m.table, summary: n, ...f, children: [
989
- r && /* @__PURE__ */ i("caption", { className: m.caption, children: r }),
990
- e
991
- ] })
992
- }
993
- )
994
- }
995
- );
996
- }, hs = ({
997
- children: e,
998
- className: t,
999
- ...r
1000
- }) => {
1001
- const a = z(ge);
1002
- a.cellWrapper = Oe;
1003
- const n = Ka({
1004
- className: t,
1005
- mode: a.mode,
1006
- stickyHeader: a.stickyHeader
1007
- });
1008
- return /* @__PURE__ */ i("thead", { className: n, ...r, children: e });
1009
- }, fs = ({
1010
- children: e,
1011
- className: t,
1012
- ...r
1013
- }) => {
1014
- const a = z(ge);
1015
- a.cellWrapper = bt;
1016
- const n = Ja({
1017
- className: t,
1018
- mode: a.mode,
1019
- stickyFooter: a.stickyFooter
1020
- });
1021
- return /* @__PURE__ */ i("tfoot", { className: n, ...r, children: e });
1022
- }, ps = ({ children: e, ...t }) => {
1023
- const r = z(ge);
1024
- return r.cellWrapper = ue, /* @__PURE__ */ i("tbody", { ...t, children: e });
1025
- }, bs = ({
1026
- children: e,
1027
- className: t,
1028
- ...r
1029
- }) => {
1030
- const a = z(ge), n = Ya({
1031
- mode: a.mode,
1032
- cellWrapper: a.cellWrapper,
1033
- className: t
1034
- });
1035
- return /* @__PURE__ */ i("tr", { className: n, ...r, children: e });
1036
- }, hn = ({
1037
- children: e,
1038
- component: t,
1039
- className: r,
1040
- align: a,
1041
- ...n
1042
- }) => {
1043
- const o = z(ge), s = t || (o.cellWrapper === Oe ? "th" : "td"), { mainClasses: c, alignClasses: g } = Za({
1044
- cellWrapper: o.cellWrapper,
1045
- className: r,
1046
- mode: o.mode,
1047
- compact: o.compact,
1048
- align: a
1049
- });
1050
- return a ? /* @__PURE__ */ i(s, { className: c, ...n, children: /* @__PURE__ */ i("div", { className: g, children: e }) }) : /* @__PURE__ */ i(s, { className: c, ...n, children: e });
1051
- }, ys = ({
1052
- align: e,
1053
- children: t,
1054
- buttonClassName: r,
1055
- className: a,
1056
- component: n,
1057
- focusMode: o = "alt-system",
1058
- mode: s = "alt-system",
1059
- onClick: c,
1060
- sortDirection: g,
1061
- sortedCell: d,
1062
- cellId: f,
1063
- ...m
1064
- }) => {
1065
- const u = Xa({ buttonClassName: r });
1066
- return /* @__PURE__ */ i(
1067
- hn,
1068
- {
1069
- component: n,
1070
- className: a,
1071
- role: "columnheader",
1072
- "aria-sort": g === be.ASC && d === f ? "ascending" : g === be.DESC && d === f ? "descending" : "other",
1073
- ...m,
1074
- children: /* @__PURE__ */ i(
1075
- kr,
1076
- {
1077
- active: d === f,
1078
- className: u,
1079
- onClick: c,
1080
- align: e,
1081
- noBorder: !0,
1082
- focusMode: o,
1083
- mode: s,
1084
- fullWidth: !0,
1085
- labelRight: t,
1086
- children: g === be.ASC && d === f ? /* @__PURE__ */ i(gn, { className: "size-4", monotone: !0 }) : g === be.DESC && d === f ? /* @__PURE__ */ i(mn, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ i(un, { className: "size-4", monotone: !0 })
1087
- }
1088
- )
1089
- }
1090
- );
1091
- }, B = [];
1092
- for (let e = 0; e < 256; ++e)
1093
- B.push((e + 256).toString(16).slice(1));
1094
- function fn(e, t = 0) {
1095
- return (B[e[t + 0]] + B[e[t + 1]] + B[e[t + 2]] + B[e[t + 3]] + "-" + B[e[t + 4]] + B[e[t + 5]] + "-" + B[e[t + 6]] + B[e[t + 7]] + "-" + B[e[t + 8]] + B[e[t + 9]] + "-" + B[e[t + 10]] + B[e[t + 11]] + B[e[t + 12]] + B[e[t + 13]] + B[e[t + 14]] + B[e[t + 15]]).toLowerCase();
1096
- }
1097
- let We;
1098
- const pn = new Uint8Array(16);
1099
- function bn() {
1100
- if (!We) {
1101
- if (typeof crypto > "u" || !crypto.getRandomValues)
1102
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1103
- We = crypto.getRandomValues.bind(crypto);
1104
- }
1105
- return We(pn);
1106
- }
1107
- const yn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), qt = { randomUUID: yn };
1108
- function kt(e, t, r) {
1109
- var n;
1110
- if (qt.randomUUID && !t && !e)
1111
- return qt.randomUUID();
1112
- e = e || {};
1113
- const a = e.random ?? ((n = e.rng) == null ? void 0 : n.call(e)) ?? bn();
1114
- if (a.length < 16)
1115
- throw new Error("Random bytes length must be >= 16");
1116
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, fn(a);
1117
- }
1118
- const vn = (e, t) => {
1119
- if ((t == null ? void 0 : t.type) === qr) {
1120
- const r = t.payload.messages.map((a) => ({
1121
- message: {
1122
- role: a.role,
1123
- content: a.content,
1124
- name: a.name,
1125
- processingTime: a.processingTime
1126
- }
1127
- }));
1128
- return {
1129
- id: t.payload.id,
1130
- model: t.payload.model,
1131
- usage: t.payload.usage,
1132
- isComponent: e.isComponent,
1133
- messages: r,
1134
- engine: e.engine,
1135
- prompts: e.prompts,
1136
- streaming: e.streaming,
1137
- lastTriggeredTimestamp: e.lastTriggeredTimestamp
1138
- };
1139
- }
1140
- if ((t == null ? void 0 : t.type) === ye) {
1141
- const r = t.payload.message.role, a = t.payload.message.content, n = t.payload.message.name, o = t.payload.message.processingTime, s = t.payload.message.messageId;
1142
- if (r !== "") {
1143
- const c = {
1144
- role: r,
1145
- content: a,
1146
- name: n,
1147
- processingTime: o,
1148
- messageId: s
1149
- };
1150
- if (r === ve) {
1151
- const g = e.messages.findIndex(
1152
- (d) => d.message.messageId === s
1153
- );
1154
- if (g !== -1) {
1155
- const d = e.messages.map((f, m) => m === g ? {
1156
- message: {
1157
- ...f.message,
1158
- content: `${f.message.content}${a}`,
1159
- processingTime: o,
1160
- name: n
1161
- }
1162
- } : f);
1163
- return {
1164
- id: e.id,
1165
- model: e.model,
1166
- usage: e.usage,
1167
- isComponent: e.isComponent,
1168
- messages: d,
1169
- engine: e.engine,
1170
- prompts: e.prompts,
1171
- streaming: e.streaming,
1172
- lastTriggeredTimestamp: e.lastTriggeredTimestamp
1173
- };
1174
- }
1175
- }
1176
- return {
1177
- id: e.id,
1178
- model: e.model,
1179
- engine: e.engine,
1180
- prompts: e.prompts,
1181
- usage: e.usage,
1182
- isComponent: e.isComponent,
1183
- streaming: e.streaming,
1184
- lastTriggeredTimestamp: e.lastTriggeredTimestamp,
1185
- messages: [
1186
- ...e.messages,
1187
- {
1188
- message: c
1189
- }
1190
- ]
1191
- };
1192
- }
1193
- }
1194
- if ((t == null ? void 0 : t.type) === ft)
1195
- return {
1196
- id: kt(),
1197
- model: e.model,
1198
- engine: e.engine,
1199
- usage: 0,
1200
- messages: [],
1201
- isComponent: e.isComponent,
1202
- prompts: e.prompts,
1203
- streaming: e.streaming,
1204
- lastTriggeredTimestamp: e.lastTriggeredTimestamp
1205
- };
1206
- if ((t == null ? void 0 : t.type) === ir)
1207
- return {
1208
- id: e.id,
1209
- model: t.payload.model,
1210
- engine: e.engine,
1211
- prompts: e.prompts,
1212
- usage: t.payload.usage,
1213
- messages: e.messages,
1214
- isComponent: e.isComponent,
1215
- streaming: e.streaming,
1216
- lastTriggeredTimestamp: e.lastTriggeredTimestamp
1217
- };
1218
- if ((t == null ? void 0 : t.type) === cr) {
1219
- let r = e.lastTriggeredTimestamp;
1220
- return e.streaming !== t.payload.streaming && (r = (/* @__PURE__ */ new Date()).getTime()), {
1221
- ...e,
1222
- streaming: t.payload.streaming,
1223
- lastTriggeredTimestamp: r
1224
- };
1225
- }
1226
- return e;
1227
- }, kn = (e, t) => {
1228
- switch (t == null ? void 0 : t.type) {
1229
- case Jr:
1230
- return {
1231
- searchString: t.payload.searchString,
1232
- sortedCell: e.sortedCell,
1233
- sortDirection: e.sortDirection
1234
- };
1235
- case Kr:
1236
- return {
1237
- searchString: e.searchString,
1238
- sortedCell: t.payload.sortedCell,
1239
- sortDirection: t.payload.sortDirection
1240
- };
1241
- default:
1242
- return e;
1243
- }
1244
- }, _n = (e, t) => {
1245
- switch (t == null ? void 0 : t.type) {
1246
- case dr:
1247
- return {
1248
- prompt: t.payload.prompt,
1249
- lastTriggeredTimestamp: e.lastTriggeredTimestamp
1250
- };
1251
- case lr:
1252
- return {
1253
- prompt: "",
1254
- lastTriggeredTimestamp: (/* @__PURE__ */ new Date()).getTime()
1255
- };
1256
- default:
1257
- return e;
1258
- }
1259
- };
1260
- var Ne = { exports: {} }, Ge = {};
1261
- /**
1262
- * @license React
1263
- * use-sync-external-store-shim.production.js
1264
- *
1265
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1266
- *
1267
- * This source code is licensed under the MIT license found in the
1268
- * LICENSE file in the root directory of this source tree.
1269
- */
1270
- var Kt;
1271
- function En() {
1272
- if (Kt) return Ge;
1273
- Kt = 1;
1274
- var e = A;
1275
- function t(m, u) {
1276
- return m === u && (m !== 0 || 1 / m === 1 / u) || m !== m && u !== u;
1277
- }
1278
- var r = typeof Object.is == "function" ? Object.is : t, a = e.useState, n = e.useEffect, o = e.useLayoutEffect, s = e.useDebugValue;
1279
- function c(m, u) {
1280
- var h = u(), p = a({ inst: { value: h, getSnapshot: u } }), y = p[0].inst, v = p[1];
1281
- return o(
1282
- function() {
1283
- y.value = h, y.getSnapshot = u, g(y) && v({ inst: y });
1284
- },
1285
- [m, h, u]
1286
- ), n(
1287
- function() {
1288
- return g(y) && v({ inst: y }), m(function() {
1289
- g(y) && v({ inst: y });
1290
- });
1291
- },
1292
- [m]
1293
- ), s(h), h;
1294
- }
1295
- function g(m) {
1296
- var u = m.getSnapshot;
1297
- m = m.value;
1298
- try {
1299
- var h = u();
1300
- return !r(m, h);
1301
- } catch {
1302
- return !0;
1303
- }
1304
- }
1305
- function d(m, u) {
1306
- return u();
1307
- }
1308
- var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : c;
1309
- return Ge.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : f, Ge;
1310
- }
1311
- var je = {};
1312
- /**
1313
- * @license React
1314
- * use-sync-external-store-shim.development.js
1315
- *
1316
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1317
- *
1318
- * This source code is licensed under the MIT license found in the
1319
- * LICENSE file in the root directory of this source tree.
1320
- */
1321
- var Jt;
1322
- function xn() {
1323
- return Jt || (Jt = 1, process.env.NODE_ENV !== "production" && function() {
1324
- function e(h, p) {
1325
- return h === p && (h !== 0 || 1 / h === 1 / p) || h !== h && p !== p;
1326
- }
1327
- function t(h, p) {
1328
- f || n.startTransition === void 0 || (f = !0, console.error(
1329
- "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
1330
- ));
1331
- var y = p();
1332
- if (!m) {
1333
- var v = p();
1334
- o(y, v) || (console.error(
1335
- "The result of getSnapshot should be cached to avoid an infinite loop"
1336
- ), m = !0);
1337
- }
1338
- v = s({
1339
- inst: { value: y, getSnapshot: p }
1340
- });
1341
- var b = v[0].inst, _ = v[1];
1342
- return g(
1343
- function() {
1344
- b.value = y, b.getSnapshot = p, r(b) && _({ inst: b });
1345
- },
1346
- [h, y, p]
1347
- ), c(
1348
- function() {
1349
- return r(b) && _({ inst: b }), h(function() {
1350
- r(b) && _({ inst: b });
1351
- });
1352
- },
1353
- [h]
1354
- ), d(y), y;
1355
- }
1356
- function r(h) {
1357
- var p = h.getSnapshot;
1358
- h = h.value;
1359
- try {
1360
- var y = p();
1361
- return !o(h, y);
1362
- } catch {
1363
- return !0;
1364
- }
1365
- }
1366
- function a(h, p) {
1367
- return p();
1368
- }
1369
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1370
- var n = A, o = typeof Object.is == "function" ? Object.is : e, s = n.useState, c = n.useEffect, g = n.useLayoutEffect, d = n.useDebugValue, f = !1, m = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : t;
1371
- je.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1372
- }()), je;
1373
- }
1374
- var Yt;
1375
- function Tn() {
1376
- return Yt || (Yt = 1, process.env.NODE_ENV === "production" ? Ne.exports = /* @__PURE__ */ En() : Ne.exports = /* @__PURE__ */ xn()), Ne.exports;
1377
- }
1378
- var wn = /* @__PURE__ */ Tn(), Zt = Object.prototype.hasOwnProperty;
1379
- function at(e, t) {
1380
- var r, a;
1381
- if (e === t) return !0;
1382
- if (e && t && (r = e.constructor) === t.constructor) {
1383
- if (r === Date) return e.getTime() === t.getTime();
1384
- if (r === RegExp) return e.toString() === t.toString();
1385
- if (r === Array) {
1386
- if ((a = e.length) === t.length)
1387
- for (; a-- && at(e[a], t[a]); ) ;
1388
- return a === -1;
1389
- }
1390
- if (!r || typeof e == "object") {
1391
- a = 0;
1392
- for (r in e)
1393
- if (Zt.call(e, r) && ++a && !Zt.call(t, r) || !(r in t) || !at(e[r], t[r])) return !1;
1394
- return Object.keys(t).length === a;
1395
- }
1396
- }
1397
- return e !== e && t !== t;
1398
- }
1399
- const G = /* @__PURE__ */ new WeakMap(), ae = () => {
1400
- }, P = (
1401
- /*#__NOINLINE__*/
1402
- ae()
1403
- ), nt = Object, E = (e) => e === P, j = (e) => typeof e == "function", oe = (e, t) => ({
1404
- ...e,
1405
- ...t
1406
- }), _r = (e) => j(e.then), qe = {}, Ce = {}, _t = "undefined", Be = typeof window != _t, ot = typeof document != _t, Sn = () => Be && typeof window.requestAnimationFrame != _t, Er = (e, t) => {
1407
- const r = G.get(e);
1408
- return [
1409
- // Getter
1410
- () => !E(t) && e.get(t) || qe,
1411
- // Setter
1412
- (a) => {
1413
- if (!E(t)) {
1414
- const n = e.get(t);
1415
- t in Ce || (Ce[t] = n), r[5](t, oe(n, a), n || qe);
1416
- }
1417
- },
1418
- // Subscriber
1419
- r[6],
1420
- // Get server cache snapshot
1421
- () => !E(t) && t in Ce ? Ce[t] : !E(t) && e.get(t) || qe
1422
- ];
1423
- };
1424
- let st = !0;
1425
- const Nn = () => st, [it, ct] = Be && window.addEventListener ? [
1426
- window.addEventListener.bind(window),
1427
- window.removeEventListener.bind(window)
1428
- ] : [
1429
- ae,
1430
- ae
1431
- ], Cn = () => {
1432
- const e = ot && document.visibilityState;
1433
- return E(e) || e !== "hidden";
1434
- }, Rn = (e) => (ot && document.addEventListener("visibilitychange", e), it("focus", e), () => {
1435
- ot && document.removeEventListener("visibilitychange", e), ct("focus", e);
1436
- }), In = (e) => {
1437
- const t = () => {
1438
- st = !0, e();
1439
- }, r = () => {
1440
- st = !1;
1441
- };
1442
- return it("online", t), it("offline", r), () => {
1443
- ct("online", t), ct("offline", r);
1444
- };
1445
- }, Ln = {
1446
- isOnline: Nn,
1447
- isVisible: Cn
1448
- }, An = {
1449
- initFocus: Rn,
1450
- initReconnect: In
1451
- }, Xt = !A.useId, _e = !Be || "Deno" in globalThis, On = (e) => Sn() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Ke = _e ? D : ma, Je = typeof navigator < "u" && navigator.connection, Qt = !_e && Je && ([
1452
- "slow-2g",
1453
- "2g"
1454
- ].includes(Je.effectiveType) || Je.saveData), Re = /* @__PURE__ */ new WeakMap(), Ye = (e, t) => nt.prototype.toString.call(e) === `[object ${t}]`;
1455
- let Bn = 0;
1456
- const lt = (e) => {
1457
- const t = typeof e, r = Ye(e, "Date"), a = Ye(e, "RegExp"), n = Ye(e, "Object");
1458
- let o, s;
1459
- if (nt(e) === e && !r && !a) {
1460
- if (o = Re.get(e), o) return o;
1461
- if (o = ++Bn + "~", Re.set(e, o), Array.isArray(e)) {
1462
- for (o = "@", s = 0; s < e.length; s++)
1463
- o += lt(e[s]) + ",";
1464
- Re.set(e, o);
1465
- }
1466
- if (n) {
1467
- o = "#";
1468
- const c = nt.keys(e).sort();
1469
- for (; !E(s = c.pop()); )
1470
- E(e[s]) || (o += s + ":" + lt(e[s]) + ",");
1471
- Re.set(e, o);
1472
- }
1473
- } else
1474
- o = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
1475
- return o;
1476
- }, Me = (e) => {
1477
- if (j(e))
1478
- try {
1479
- e = e();
1480
- } catch {
1481
- e = "";
1482
- }
1483
- const t = e;
1484
- return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? lt(e) : "", [
1485
- e,
1486
- t
1487
- ];
1488
- };
1489
- let Mn = 0;
1490
- const dt = () => ++Mn, xr = 0, Tr = 1, wr = 2, zn = 3;
1491
- var pe = {
1492
- __proto__: null,
1493
- ERROR_REVALIDATE_EVENT: zn,
1494
- FOCUS_EVENT: xr,
1495
- MUTATE_EVENT: wr,
1496
- RECONNECT_EVENT: Tr
1497
- };
1498
- async function Sr(...e) {
1499
- const [t, r, a, n] = e, o = oe({
1500
- populateCache: !0,
1501
- throwOnError: !0
1502
- }, typeof n == "boolean" ? {
1503
- revalidate: n
1504
- } : n || {});
1505
- let s = o.populateCache;
1506
- const c = o.rollbackOnError;
1507
- let g = o.optimisticData;
1508
- const d = (u) => typeof c == "function" ? c(u) : c !== !1, f = o.throwOnError;
1509
- if (j(r)) {
1510
- const u = r, h = [], p = t.keys();
1511
- for (const y of p)
1512
- // Skip the special useSWRInfinite and useSWRSubscription keys.
1513
- !/^\$(inf|sub)\$/.test(y) && u(t.get(y)._k) && h.push(y);
1514
- return Promise.all(h.map(m));
1515
- }
1516
- return m(r);
1517
- async function m(u) {
1518
- const [h] = Me(u);
1519
- if (!h) return;
1520
- const [p, y] = Er(t, h), [v, b, _, T] = G.get(t), N = () => {
1521
- const U = v[h];
1522
- return (j(o.revalidate) ? o.revalidate(p().data, u) : o.revalidate !== !1) && (delete _[h], delete T[h], U && U[0]) ? U[0](wr).then(() => p().data) : p().data;
1523
- };
1524
- if (e.length < 3)
1525
- return N();
1526
- let k = a, C;
1527
- const I = dt();
1528
- b[h] = [
1529
- I,
1530
- 0
1531
- ];
1532
- const R = !E(g), Z = p(), F = Z.data, X = Z._c, K = E(X) ? F : X;
1533
- if (R && (g = j(g) ? g(K, F) : g, y({
1534
- data: g,
1535
- _c: K
1536
- })), j(k))
1537
- try {
1538
- k = k(K);
1539
- } catch (U) {
1540
- C = U;
1541
- }
1542
- if (k && _r(k))
1543
- if (k = await k.catch((U) => {
1544
- C = U;
1545
- }), I !== b[h][0]) {
1546
- if (C) throw C;
1547
- return k;
1548
- } else C && R && d(C) && (s = !0, y({
1549
- data: K,
1550
- _c: P
1551
- }));
1552
- if (s && !C)
1553
- if (j(s)) {
1554
- const U = s(k, K);
1555
- y({
1556
- data: U,
1557
- error: P,
1558
- _c: P
1559
- });
1560
- } else
1561
- y({
1562
- data: k,
1563
- error: P,
1564
- _c: P
1565
- });
1566
- if (b[h][1] = dt(), Promise.resolve(N()).then(() => {
1567
- y({
1568
- _c: P
1569
- });
1570
- }), C) {
1571
- if (f) throw C;
1572
- return;
1573
- }
1574
- return k;
1575
- }
1576
- }
1577
- const er = (e, t) => {
1578
- for (const r in e)
1579
- e[r][0] && e[r][0](t);
1580
- }, $n = (e, t) => {
1581
- if (!G.has(e)) {
1582
- const r = oe(An, t), a = {}, n = Sr.bind(P, e);
1583
- let o = ae;
1584
- const s = {}, c = (f, m) => {
1585
- const u = s[f] || [];
1586
- return s[f] = u, u.push(m), () => u.splice(u.indexOf(m), 1);
1587
- }, g = (f, m, u) => {
1588
- e.set(f, m);
1589
- const h = s[f];
1590
- if (h)
1591
- for (const p of h)
1592
- p(m, u);
1593
- }, d = () => {
1594
- if (!G.has(e) && (G.set(e, [
1595
- a,
1596
- {},
1597
- {},
1598
- {},
1599
- n,
1600
- g,
1601
- c
1602
- ]), !_e)) {
1603
- const f = r.initFocus(setTimeout.bind(P, er.bind(P, a, xr))), m = r.initReconnect(setTimeout.bind(P, er.bind(P, a, Tr)));
1604
- o = () => {
1605
- f && f(), m && m(), G.delete(e);
1606
- };
1607
- }
1608
- };
1609
- return d(), [
1610
- e,
1611
- n,
1612
- d,
1613
- o
1614
- ];
1615
- }
1616
- return [
1617
- e,
1618
- G.get(e)[4]
1619
- ];
1620
- }, Dn = (e, t, r, a, n) => {
1621
- const o = r.errorRetryCount, s = n.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * r.errorRetryInterval;
1622
- !E(o) && s > o || setTimeout(a, c, n);
1623
- }, Vn = at, [Et, Pn] = $n(/* @__PURE__ */ new Map()), Un = oe(
1624
- {
1625
- // events
1626
- onLoadingSlow: ae,
1627
- onSuccess: ae,
1628
- onError: ae,
1629
- onErrorRetry: Dn,
1630
- onDiscarded: ae,
1631
- // switches
1632
- revalidateOnFocus: !0,
1633
- revalidateOnReconnect: !0,
1634
- revalidateIfStale: !0,
1635
- shouldRetryOnError: !0,
1636
- // timeouts
1637
- errorRetryInterval: Qt ? 1e4 : 5e3,
1638
- focusThrottleInterval: 5 * 1e3,
1639
- dedupingInterval: 2 * 1e3,
1640
- loadingTimeout: Qt ? 5e3 : 3e3,
1641
- // providers
1642
- compare: Vn,
1643
- isPaused: () => !1,
1644
- cache: Et,
1645
- mutate: Pn,
1646
- fallback: {}
1647
- },
1648
- // use web preset by default
1649
- Ln
1650
- ), Fn = (e, t) => {
1651
- const r = oe(e, t);
1652
- if (t) {
1653
- const { use: a, fallback: n } = e, { use: o, fallback: s } = t;
1654
- a && o && (r.use = a.concat(o)), n && s && (r.fallback = oe(n, s));
1655
- }
1656
- return r;
1657
- }, Hn = ua({}), Wn = "$inf$", Nr = Be && window.__SWR_DEVTOOLS_USE__, Gn = Nr ? window.__SWR_DEVTOOLS_USE__ : [], jn = () => {
1658
- Nr && (window.__SWR_DEVTOOLS_REACT__ = A);
1659
- }, qn = (e) => j(e[1]) ? [
1660
- e[0],
1661
- e[1],
1662
- e[2] || {}
1663
- ] : [
1664
- e[0],
1665
- null,
1666
- (e[1] === null ? e[2] : e[1]) || {}
1667
- ], Kn = () => oe(Un, z(Hn)), xt = (e, t) => {
1668
- const [r, a] = Me(e), [, , , n] = G.get(Et);
1669
- if (n[r]) return n[r];
1670
- const o = t(a);
1671
- return n[r] = o, o;
1672
- }, Jn = (e) => (t, r, a) => e(t, r && ((...o) => {
1673
- const [s] = Me(t), [, , , c] = G.get(Et);
1674
- if (s.startsWith(Wn))
1675
- return r(...o);
1676
- const g = c[s];
1677
- return E(g) ? r(...o) : (delete c[s], g);
1678
- }), a), Yn = Gn.concat(Jn), Zn = (e) => function(...r) {
1679
- const a = Kn(), [n, o, s] = qn(r), c = Fn(a, s);
1680
- let g = e;
1681
- const { use: d } = c, f = (d || []).concat(Yn);
1682
- for (let m = f.length; m--; )
1683
- g = f[m](g);
1684
- return g(n, o || c.fetcher || null, c);
1685
- }, Xn = (e, t, r) => {
1686
- const a = t[e] || (t[e] = []);
1687
- return a.push(r), () => {
1688
- const n = a.indexOf(r);
1689
- n >= 0 && (a[n] = a[a.length - 1], a.pop());
1690
- };
1691
- };
1692
- jn();
1693
- const Ze = A.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
1694
- // and emitting an error.
1695
- // We assume that this is only for the `use(thenable)` case, not `use(context)`.
1696
- // https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
1697
- ((e) => {
1698
- switch (e.status) {
1699
- case "pending":
1700
- throw e;
1701
- case "fulfilled":
1702
- return e.value;
1703
- case "rejected":
1704
- throw e.reason;
1705
- default:
1706
- throw e.status = "pending", e.then((t) => {
1707
- e.status = "fulfilled", e.value = t;
1708
- }, (t) => {
1709
- e.status = "rejected", e.reason = t;
1710
- }), e;
1711
- }
1712
- }), Xe = {
1713
- dedupe: !0
1714
- }, Qn = (e, t, r) => {
1715
- const { cache: a, compare: n, suspense: o, fallbackData: s, revalidateOnMount: c, revalidateIfStale: g, refreshInterval: d, refreshWhenHidden: f, refreshWhenOffline: m, keepPreviousData: u } = r, [h, p, y, v] = G.get(a), [b, _] = Me(e), T = M(!1), N = M(!1), k = M(b), C = M(t), I = M(r), R = () => I.current, Z = () => R().isVisible() && R().isOnline(), [F, X, K, U] = Er(a, b), Q = M({}).current, ie = E(s) ? E(r.fallback) ? P : r.fallback[b] : s, he = (w, S) => {
1716
- for (const $ in Q) {
1717
- const L = $;
1718
- if (L === "data") {
1719
- if (!n(w[L], S[L]) && (!E(w[L]) || !n(Se, S[L])))
1720
- return !1;
1721
- } else if (S[L] !== w[L])
1722
- return !1;
1723
- }
1724
- return !0;
1725
- }, Te = ur(() => {
1726
- const w = !b || !t ? !1 : E(c) ? R().isPaused() || o ? !1 : g !== !1 : c, S = (V) => {
1727
- const J = oe(V);
1728
- return delete J._k, w ? {
1729
- isValidating: !0,
1730
- isLoading: !0,
1731
- ...J
1732
- } : J;
1733
- }, $ = F(), L = U(), W = S($), de = $ === L ? W : S(L);
1734
- let O = W;
1735
- return [
1736
- () => {
1737
- const V = S(F());
1738
- return he(V, O) ? (O.data = V.data, O.isLoading = V.isLoading, O.isValidating = V.isValidating, O.error = V.error, O) : (O = V, V);
1739
- },
1740
- () => de
1741
- ];
1742
- }, [
1743
- a,
1744
- b
1745
- ]), ee = wn.useSyncExternalStore(ne(
1746
- (w) => K(b, (S, $) => {
1747
- he($, S) || w();
1748
- }),
1749
- // eslint-disable-next-line react-hooks/exhaustive-deps
1750
- [
1751
- a,
1752
- b
1753
- ]
1754
- ), Te[0], Te[1]), te = !T.current, Hr = h[b] && h[b].length > 0, ce = ee.data, le = E(ce) ? ie && _r(ie) ? Ze(ie) : ie : ce, we = ee.error, Rt = M(le), Se = u ? E(ce) ? Rt.current : ce : le, It = Hr && !E(we) ? !1 : te && !E(c) ? c : R().isPaused() ? !1 : o ? E(le) ? !1 : g : E(le) || g, Lt = !!(b && t && te && It), Wr = E(ee.isValidating) ? Lt : ee.isValidating, Gr = E(ee.isLoading) ? Lt : ee.isLoading, fe = ne(
1755
- async (w) => {
1756
- const S = C.current;
1757
- if (!b || !S || N.current || R().isPaused())
1758
- return !1;
1759
- let $, L, W = !0;
1760
- const de = w || {}, O = !y[b] || !de.dedupe, V = () => Xt ? !N.current && b === k.current && T.current : b === k.current, J = {
1761
- isValidating: !1,
1762
- isLoading: !1
1763
- }, Ot = () => {
1764
- X(J);
1765
- }, Bt = () => {
1766
- const H = y[b];
1767
- H && H[1] === L && delete y[b];
1768
- }, Mt = {
1769
- isValidating: !0
1770
- };
1771
- E(F().data) && (Mt.isLoading = !0);
1772
- try {
1773
- if (O && (X(Mt), r.loadingTimeout && E(F().data) && setTimeout(() => {
1774
- W && V() && R().onLoadingSlow(b, r);
1775
- }, r.loadingTimeout), y[b] = [
1776
- S(_),
1777
- dt()
1778
- ]), [$, L] = y[b], $ = await $, O && setTimeout(Bt, r.dedupingInterval), !y[b] || y[b][1] !== L)
1779
- return O && V() && R().onDiscarded(b), !1;
1780
- J.error = P;
1781
- const H = p[b];
1782
- if (!E(H) && // case 1
1783
- (L <= H[0] || // case 2
1784
- L <= H[1] || // case 3
1785
- H[1] === 0))
1786
- return Ot(), O && V() && R().onDiscarded(b), !1;
1787
- const Y = F().data;
1788
- J.data = n(Y, $) ? Y : $, O && V() && R().onSuccess($, b, r);
1789
- } catch (H) {
1790
- Bt();
1791
- const Y = R(), { shouldRetryOnError: Pe } = Y;
1792
- Y.isPaused() || (J.error = H, O && V() && (Y.onError(H, b, Y), (Pe === !0 || j(Pe) && Pe(H)) && (!R().revalidateOnFocus || !R().revalidateOnReconnect || Z()) && Y.onErrorRetry(H, b, Y, (jr) => {
1793
- const Ue = h[b];
1794
- Ue && Ue[0] && Ue[0](pe.ERROR_REVALIDATE_EVENT, jr);
1795
- }, {
1796
- retryCount: (de.retryCount || 0) + 1,
1797
- dedupe: !0
1798
- })));
1799
- }
1800
- return W = !1, Ot(), !0;
1801
- },
1802
- // `setState` is immutable, and `eventsCallback`, `fnArg`, and
1803
- // `keyValidating` are depending on `key`, so we can exclude them from
1804
- // the deps array.
1805
- //
1806
- // FIXME:
1807
- // `fn` and `config` might be changed during the lifecycle,
1808
- // but they might be changed every render like this.
1809
- // `useSWR('key', () => fetch('/api/'), { suspense: true })`
1810
- // So we omit the values from the deps array
1811
- // even though it might cause unexpected behaviors.
1812
- // eslint-disable-next-line react-hooks/exhaustive-deps
1813
- [
1814
- b,
1815
- a
1816
- ]
1817
- ), At = ne(
1818
- // Use callback to make sure `keyRef.current` returns latest result every time
1819
- (...w) => Sr(a, k.current, ...w),
1820
- // eslint-disable-next-line react-hooks/exhaustive-deps
1821
- []
1822
- );
1823
- if (Ke(() => {
1824
- C.current = t, I.current = r, E(ce) || (Rt.current = ce);
1825
- }), Ke(() => {
1826
- if (!b) return;
1827
- const w = fe.bind(P, Xe);
1828
- let S = 0;
1829
- const L = Xn(b, h, (W, de = {}) => {
1830
- if (W == pe.FOCUS_EVENT) {
1831
- const O = Date.now();
1832
- R().revalidateOnFocus && O > S && Z() && (S = O + R().focusThrottleInterval, w());
1833
- } else if (W == pe.RECONNECT_EVENT)
1834
- R().revalidateOnReconnect && Z() && w();
1835
- else {
1836
- if (W == pe.MUTATE_EVENT)
1837
- return fe();
1838
- if (W == pe.ERROR_REVALIDATE_EVENT)
1839
- return fe(de);
1840
- }
1841
- });
1842
- return N.current = !1, k.current = b, T.current = !0, X({
1843
- _k: _
1844
- }), It && (E(le) || _e ? w() : On(w)), () => {
1845
- N.current = !0, L();
1846
- };
1847
- }, [
1848
- b
1849
- ]), Ke(() => {
1850
- let w;
1851
- function S() {
1852
- const L = j(d) ? d(F().data) : d;
1853
- L && w !== -1 && (w = setTimeout($, L));
1854
- }
1855
- function $() {
1856
- !F().error && (f || R().isVisible()) && (m || R().isOnline()) ? fe(Xe).then(S) : S();
1857
- }
1858
- return S(), () => {
1859
- w && (clearTimeout(w), w = -1);
1860
- };
1861
- }, [
1862
- d,
1863
- f,
1864
- m,
1865
- b
1866
- ]), ga(Se), o && E(le) && b) {
1867
- if (!Xt && _e)
1868
- throw new Error("Fallback data is required when using Suspense in SSR.");
1869
- C.current = t, I.current = r, N.current = !1;
1870
- const w = v[b];
1871
- if (!E(w)) {
1872
- const S = At(w);
1873
- Ze(S);
1874
- }
1875
- if (E(we)) {
1876
- const S = fe(Xe);
1877
- E(Se) || (S.status = "fulfilled", S.value = !0), Ze(S);
1878
- } else
1879
- throw we;
1880
- }
1881
- return {
1882
- mutate: At,
1883
- get data() {
1884
- return Q.data = !0, Se;
1885
- },
1886
- get error() {
1887
- return Q.error = !0, we;
1888
- },
1889
- get isValidating() {
1890
- return Q.isValidating = !0, Wr;
1891
- },
1892
- get isLoading() {
1893
- return Q.isLoading = !0, Gr;
1894
- }
1895
- };
1896
- }, eo = Zn(Qn), re = {
1897
- GET_LOCATION: `query GetLocation($latitude: Float!, $longitude: Float!) {
1898
- location(latitude: $latitude, longitude: $longitude) {
1899
- country
1900
- state
1901
- city
1902
- displayName
1903
- }
1904
- }`,
1905
- GET_CHATS: `query GetChats(
1906
- $user: String!,
1907
- $searchString: String,
1908
- $limit: Float,
1909
- $direction: String,
1910
- $truncateSize: Float) {
1911
- chats(
1912
- user: $user,
1913
- searchString: $searchString,
1914
- limit: $limit,
1915
- direction: $direction,
1916
- truncateSize: $truncateSize) {
1917
- timestamp
1918
- id
1919
- model
1920
- messages {
1921
- content
1922
- }
1923
- }
1924
- }`,
1925
- GET_CHATS_STATS: `query GetChatsStats($user: String!) {
1926
- chatsStats(user: $user) {
1927
- totalChats
1928
- averageProcessingTimes
1929
- }
1930
- }`,
1931
- GET_CHAT: `query GetChatById($id: String!) {
1932
- chatById(id: $id) {
1933
- model
1934
- usage
1935
- messages {
1936
- content
1937
- role
1938
- name
1939
- processingTime
1940
- }
1941
- }
1942
- }`,
1943
- DELETE_CHAT: `mutation DeleteChat(
1944
- $id: String!,
1945
- $userId: String!) {
1946
- deleteChat(
1947
- id: $id,
1948
- user: $userId) {
1949
- id
1950
- }
1951
- }`,
1952
- GET_SERVER_CAPABILITIES: `query GetServerCapabilities {
1953
- getServerCapabilities {
1954
- version
1955
- models
1956
- plugins
1957
- engines
1958
- runningMode
1959
- }
1960
- }`,
1961
- GET_USER_PREFERENCES: `query GetUserPreferences($user: String!) {
1962
- getUserPreferences(user: $user) {
1963
- instructions
1964
- location
1965
- engine
1966
- tags {
1967
- enabled
1968
- slot
1969
- label
1970
- content
1971
- }
1972
- }
1973
- }`,
1974
- SET_USER_PREFERENCES: `mutation SetUserPreferences(
1975
- $user: String!,
1976
- $instructions: String,
1977
- $location: String,
1978
- $engine: String,
1979
- $tags: [TagIn]) {
1980
- setUserPreferences(
1981
- user: $user,
1982
- instructions: $instructions,
1983
- location: $location,
1984
- engine: $engine,
1985
- tags: $tags)
1986
- }`
1987
- }, xe = {
1988
- GET_LOCATION: {
1989
- schema: re.GET_LOCATION,
1990
- method: "location"
1991
- },
1992
- GET_CHATS: {
1993
- schema: re.GET_CHATS,
1994
- method: "chats"
1995
- },
1996
- GET_CHATS_STATS: {
1997
- schema: re.GET_CHATS_STATS,
1998
- method: "chatsStats"
1999
- },
2000
- GET_CHAT: {
2001
- schema: re.GET_CHAT,
2002
- method: "chatById"
2003
- },
2004
- DELETE_CHAT: {
2005
- schema: re.DELETE_CHAT,
2006
- method: "deleteChat"
2007
- },
2008
- GET_SERVER_CAPABILITIES: {
2009
- schema: re.GET_SERVER_CAPABILITIES,
2010
- method: "getServerCapabilities"
2011
- },
2012
- GET_USER_PREFERENCES: {
2013
- schema: re.GET_USER_PREFERENCES,
2014
- method: "getUserPreferences"
2015
- },
2016
- SET_USER_PREFERENCES: {
2017
- schema: re.SET_USER_PREFERENCES,
2018
- method: "setUserPreferences"
2019
- }
2020
- }, Cr = process.env.PUBLIC_SASSY_API_SERVER_URL, to = async ({
2021
- query: e,
2022
- data: t,
2023
- headers: r = {}
2024
- }) => await fetch(`${Cr}/graphql`, {
2025
- method: "POST",
2026
- credentials: "include",
2027
- headers: {
2028
- ...r,
2029
- "Content-Type": "application/json",
2030
- Accept: "application/json"
2031
- },
2032
- body: JSON.stringify({
2033
- query: e,
2034
- variables: t
2035
- })
2036
- }), Rr = async ({
2037
- accessToken: e,
2038
- type: t,
2039
- params: r = {}
2040
- }) => {
2041
- const a = t != null && t.data ? t.data(r) : r;
2042
- try {
2043
- const n = `Bearer ${e}`, o = await to({
2044
- headers: {
2045
- authorization: n
2046
- },
2047
- query: t.schema,
2048
- data: a
2049
- });
2050
- if (o.status !== 200)
2051
- return { status: o.status, data: [] };
2052
- const { data: s, errors: c } = await o.json();
2053
- return {
2054
- status: o.status,
2055
- data: s[t.method],
2056
- errors: c
2057
- };
2058
- } catch (n) {
2059
- return console.error(n), { status: 500, data: [] };
2060
- }
2061
- }, ro = async ({
2062
- accessToken: e,
2063
- name: t,
2064
- data: r,
2065
- method: a = "POST"
2066
- }) => {
2067
- const n = `Bearer ${e}`;
2068
- return await fetch(`${Cr}/api/${t}`, {
2069
- method: a,
2070
- credentials: "include",
2071
- headers: {
2072
- "Content-Type": "application/json",
2073
- authorization: n
2074
- },
2075
- body: JSON.stringify(r)
2076
- });
2077
- }, ze = ({
2078
- fetcher: e,
2079
- scope: t,
2080
- keys: r,
2081
- swrOptions: a,
2082
- getAccessToken: n
2083
- }) => {
2084
- const { data: o, error: s, isLoading: c, mutate: g } = eo(
2085
- [t, ...r],
2086
- (d) => e(d, n),
2087
- { ...a }
2088
- );
2089
- return { data: o, error: s, isLoading: c, mutate: g };
2090
- }, $e = async ({
2091
- getAccessToken: e,
2092
- type: t,
2093
- params: r
2094
- }) => {
2095
- const a = await e(), n = await Rr({
2096
- accessToken: a,
2097
- type: t,
2098
- params: r
2099
- });
2100
- if (n.status === 200 && n.errors === void 0)
2101
- return n.data;
2102
- throw new Error("An error occurred while fetching the data.");
2103
- }, Ir = async ([e, t], r) => $e({
2104
- getAccessToken: r,
2105
- type: xe.GET_USER_PREFERENCES,
2106
- params: {
2107
- user: t
2108
- }
2109
- }), Lr = ({
2110
- keys: e,
2111
- getAccessToken: t
2112
- }) => ze({
2113
- fetcher: Ir,
2114
- scope: "/preferences",
2115
- keys: e,
2116
- swrOptions: { keepPreviousData: !0 },
2117
- getAccessToken: t
2118
- }), ao = ({
2119
- keys: e,
2120
- getAccessToken: t
2121
- }) => {
2122
- xt(
2123
- ["/preferences", ...e],
2124
- (r) => Ir(r, t)
2125
- );
2126
- }, no = async ([e, t], r) => $e({
2127
- getAccessToken: r,
2128
- type: xe.GET_CHATS_STATS,
2129
- params: {
2130
- user: t
2131
- }
2132
- }), vs = ({
2133
- keys: e,
2134
- getAccessToken: t
2135
- }) => ze({
2136
- fetcher: no,
2137
- scope: "/stats",
2138
- keys: e,
2139
- getAccessToken: t
2140
- }), Ar = async ([e, t, r, a], n) => $e({
2141
- getAccessToken: n,
2142
- type: xe.GET_CHATS,
2143
- params: {
2144
- user: t,
2145
- searchString: r,
2146
- direction: a,
2147
- limit: 1,
2148
- truncateSize: 100
2149
- }
2150
- }), ks = ({
2151
- keys: e,
2152
- getAccessToken: t
2153
- }) => ze({
2154
- fetcher: Ar,
2155
- scope: "/history",
2156
- keys: e,
2157
- getAccessToken: t,
2158
- swrOptions: {
2159
- keepPreviousData: !0,
2160
- dedupingInterval: 1e4
2161
- }
2162
- }), oo = ({
2163
- keys: e,
2164
- getAccessToken: t
2165
- }) => {
2166
- xt(["/history", ...e], (r) => Ar(r, t));
2167
- }, Or = async ([e], t) => $e({
2168
- getAccessToken: t,
2169
- type: xe.GET_SERVER_CAPABILITIES
2170
- }), _s = ({
2171
- getAccessToken: e
2172
- }) => ze({
2173
- fetcher: Or,
2174
- scope: "/capabilities",
2175
- keys: [],
2176
- getAccessToken: e
2177
- }), so = ({
2178
- getAccessToken: e
2179
- }) => {
2180
- xt(["/capabilities"], (t) => Or(t, e));
2181
- }, io = "z-20", co = "z-10", se = A.createContext({
2182
- state: {
2183
- id: "",
2184
- model: ke,
2185
- engine: ke,
2186
- usage: 0,
2187
- messages: [],
2188
- isComponent: !1,
2189
- prompts: []
2190
- },
2191
- dispatch: () => {
2192
- },
2193
- serverStats: {
2194
- version: "",
2195
- models: [],
2196
- plugins: [],
2197
- engines: []
2198
- }
2199
- }), lo = A.createContext({
2200
- state: { searchString: "", sortedCell: "", sortDirection: "" },
2201
- dispatch: () => {
2202
- }
2203
- }), De = A.createContext({
2204
- state: { prompt: "", lastTriggeredTimestamp: 0 },
2205
- dispatch: () => {
2206
- }
2207
- }), uo = ({
2208
- className: e
2209
- }) => {
2210
- const { state: t, dispatch: r } = z(se), a = M(null), n = M(!1), o = (s) => {
2211
- s.preventDefault(), r({
2212
- type: ft
2213
- });
2214
- };
2215
- return D(() => {
2216
- var s;
2217
- (t == null ? void 0 : t.streaming) === !0 && !n.current && a.current && (n.current = !0, a.current.focus()), (t == null ? void 0 : t.streaming) === !1 && (n.current = !1, (s = a.current) == null || s.blur());
2218
- }, [t]), /* @__PURE__ */ i(
2219
- Ae,
2220
- {
2221
- className: e,
2222
- noBorder: !0,
2223
- radius: "small",
2224
- mode: "dark",
2225
- focusMode: "light",
2226
- label: "New Chat",
2227
- ref: a,
2228
- onClick: o,
2229
- children: t != null && t.streaming ? /* @__PURE__ */ i(Oa, { size: "size-4", monotone: !0 }) : /* @__PURE__ */ i(La, { size: "size-4", monotone: !0 })
2230
- }
2231
- );
2232
- }, ut = et.createContext({
2233
- getItemProps: () => ({}),
2234
- activeIndex: null,
2235
- /* v8 ignore next 2 */
2236
- setActiveIndex: () => {
2237
- },
2238
- setHasFocusInside: () => {
2239
- },
2240
- isOpen: !1
2241
- }), tr = (e) => {
2242
- if (typeof e == "string")
2243
- return e;
2244
- if (typeof e == "function")
2245
- return e.displayName || e.name || "Component";
2246
- if (typeof e == "object" && e !== null && "type" in e) {
2247
- const t = e.type;
2248
- if (typeof t == "function" || typeof t == "object")
2249
- return t.displayName || t.name || "Component";
2250
- }
2251
- return "Element";
2252
- }, Br = mr(
2253
- ({
2254
- trigger: e,
2255
- children: t,
2256
- label: r = "Open menu",
2257
- defaultPlacement: a = "bottom-start",
2258
- onOpenChange: n,
2259
- mode: o = "system",
2260
- focusMode: s = "system",
2261
- ...c
2262
- }, g) => {
2263
- const [d, f] = q(!1), [m, u] = q(!1), [h, p] = q(null), y = M([]), v = M([]), b = z(ut), _ = hr(), T = ha(), N = fr(), { floatingStyles: k, refs: C, context: I } = fa({
2264
- nodeId: T,
2265
- open: d,
2266
- onOpenChange: (te) => {
2267
- f(te), n == null || n(te);
2268
- },
2269
- placement: a,
2270
- strategy: "fixed",
2271
- middleware: [pa({ mainAxis: 10 }), ba(), ya()],
2272
- whileElementsMounted: va
2273
- }), R = ka(I, {
2274
- event: "mousedown",
2275
- toggle: !0,
2276
- ignoreMouse: !1
2277
- }), Z = _a(I, { role: "menu" }), F = Ea(I, { bubbles: !0 }), X = xa(I, {
2278
- listRef: y,
2279
- activeIndex: h,
2280
- nested: !1,
2281
- onNavigate: p,
2282
- loop: !0
2283
- }), K = Ta(I, {
2284
- listRef: v,
2285
- onMatch: d ? p : void 0,
2286
- activeIndex: h
2287
- }), { getReferenceProps: U, getFloatingProps: Q, getItemProps: ie } = wa([R, Z, F, X, K]), he = tr(e) === "Button" || tr(e) === "ButtonIcon", Te = he ? {
2288
- noInternalClick: he,
2289
- focusMode: s,
2290
- mode: o
2291
- } : {}, ee = A.cloneElement(
2292
- e,
2293
- {
2294
- ...Te,
2295
- "aria-label": r,
2296
- "data-open": d ? "" : void 0,
2297
- "data-focus-inside": m ? "" : void 0,
2298
- ref: pr([C.setReference, N.ref, g]),
2299
- ...U(
2300
- b.getItemProps({
2301
- ...c
2302
- })
2303
- )
2304
- }
2305
- );
2306
- return D(() => {
2307
- if (!_)
2308
- return;
2309
- function te() {
2310
- f(!1), n == null || n(!1);
2311
- }
2312
- return _.events.on("click", te), () => {
2313
- _.events.off("click", te);
2314
- };
2315
- }, [_, n]), D(() => {
2316
- d && _ && _.events.emit("menuopen", { nodeId: T });
2317
- }, [_, d, T]), /* @__PURE__ */ x(Sa, { id: T, children: [
2318
- ee,
2319
- /* @__PURE__ */ i(
2320
- ut.Provider,
2321
- {
2322
- value: {
2323
- activeIndex: h,
2324
- setActiveIndex: p,
2325
- getItemProps: ie,
2326
- setHasFocusInside: u,
2327
- isOpen: d
2328
- },
2329
- children: /* @__PURE__ */ i(Na, { elementsRef: y, labelsRef: v, children: d && /* @__PURE__ */ i(Ca, { children: /* @__PURE__ */ i(
2330
- Ra,
2331
- {
2332
- context: I,
2333
- modal: !1,
2334
- initialFocus: 0,
2335
- returnFocus: !0,
2336
- children: /* @__PURE__ */ i(
2337
- "div",
2338
- {
2339
- ref: C.setFloating,
2340
- className: "rounded-md bg-surface-light shadow-sm shadow-border-dark outline-none p-4 sm:p-2",
2341
- style: k,
2342
- ...Q(),
2343
- children: t
2344
- }
2345
- )
2346
- }
2347
- ) }) })
2348
- }
2349
- )
2350
- ] });
2351
- }
2352
- ), Tt = mr((e, t) => /* @__PURE__ */ i(Ia, { children: /* @__PURE__ */ i(Br, { ...e, ref: t }) }));
2353
- Tt.displayName = "Menu";
2354
- Br.displayName = "MenuComponent";
2355
- const Ie = et.forwardRef(
2356
- ({
2357
- label: e,
2358
- disabled: t,
2359
- icon: r,
2360
- raw: a = !1,
2361
- children: n,
2362
- ignoreClick: o = !1,
2363
- selected: s = !1,
2364
- ...c
2365
- }, g) => {
2366
- let d = "";
2367
- const f = et.useContext(ut), m = fr({ label: t ? null : e }), u = hr(), h = pr([m.ref, g]);
2368
- if (a && n)
2369
- return /* @__PURE__ */ i(
2370
- "div",
2371
- {
2372
- role: "menuitem",
2373
- ...f.getItemProps({
2374
- onClick(y) {
2375
- var v;
2376
- o || ((v = c.onClick) == null || v.call(c, y), u == null || u.events.emit("click"));
2377
- }
2378
- }),
2379
- children: n
2380
- }
2381
- );
2382
- r && (d = "pl-2");
2383
- const p = l(
2384
- "m-0 first:mt-0 mt-2 sm:mt-1 px-2 py-1 flex w-full rounded-md border border-transparent text-left text-base outline-none focus:border focus:border-border-medium focus:bg-surface-lighter focus:underline disabled:cursor-not-allowed disabled:text-copy-medium",
2385
- {
2386
- "bg-surface-medium text-copy-lighter font-bold": !t && s,
2387
- "bg-none": !t && !s,
2388
- "focus:text-copy-dark": s
2389
- }
2390
- );
2391
- return /* @__PURE__ */ x(
2392
- "button",
2393
- {
2394
- ...c,
2395
- ref: h,
2396
- role: "menuitem",
2397
- className: p,
2398
- tabIndex: 0,
2399
- disabled: t,
2400
- ...f.getItemProps({
2401
- onClick(y) {
2402
- var v;
2403
- o || ((v = c.onClick) == null || v.call(c, y), u == null || u.events.emit("click"));
2404
- },
2405
- onFocus(y) {
2406
- var v;
2407
- (v = c.onFocus) == null || v.call(c, y), f.setHasFocusInside(!0);
2408
- }
2409
- }),
2410
- children: [
2411
- r,
2412
- e && /* @__PURE__ */ i("span", { className: d, children: e })
2413
- ]
2414
- }
2415
- );
2416
- }
2417
- );
2418
- Ie.displayName = "MenuItem";
2419
- const Es = ({ className: e, ...t }) => {
2420
- const r = l(e, "my-1 border-t border-border-medium");
2421
- return /* @__PURE__ */ i("div", { className: r, ...t });
2422
- }, Mr = ({
2423
- className: e,
2424
- ...t
2425
- }) => {
2426
- const r = l(e, "py-1 px-2 text-sm text-copy-medium");
2427
- return /* @__PURE__ */ i("div", { className: r, ...t });
2428
- };
2429
- /*!
2430
- @versini/ui-menu v3.2.5
2431
- © 2025 gizmette.com
2432
- */
2433
- try {
2434
- window.__VERSINI_UI_MENU__ || (window.__VERSINI_UI_MENU__ = {
2435
- version: "3.2.5",
2436
- buildTime: "01/14/2025 10:39 AM EST",
2437
- homepage: "https://github.com/aversini/ui-components",
2438
- license: "MIT"
2439
- });
2440
- } catch {
2441
- }
2442
- const mo = (e) => {
2443
- for (let t = 0; t < e.length; t++)
2444
- if (e[t].enabled)
2445
- return !0;
2446
- return !1;
2447
- }, go = ({
2448
- className: e,
2449
- defaultPlacement: t = "top-start"
2450
- }) => {
2451
- const { dispatch: r } = z(De), { getAccessToken: a, user: n } = Ee(), {
2452
- data: o,
2453
- error: s,
2454
- isLoading: c
2455
- } = Lr({
2456
- keys: [n == null ? void 0 : n.username],
2457
- getAccessToken: a
2458
- }), g = (d, f) => {
2459
- d.preventDefault(), r({
2460
- type: dr,
2461
- payload: {
2462
- prompt: f
2463
- }
2464
- });
2465
- };
2466
- return s || c ? null : o && o.tags && mo(o.tags) && /* @__PURE__ */ x(
2467
- Tt,
2468
- {
2469
- mode: "dark",
2470
- focusMode: "light",
2471
- trigger: /* @__PURE__ */ i(Ae, { className: e, noBorder: !0, label: "Prompts", children: /* @__PURE__ */ i(Aa, { size: "size-4" }) }),
2472
- defaultPlacement: t,
2473
- children: [
2474
- /* @__PURE__ */ i(Mr, { children: "Prompts" }),
2475
- o && o.tags && o.tags.map((d) => d.enabled && d.label && d.content && /* @__PURE__ */ i(
2476
- Ie,
2477
- {
2478
- label: d.label,
2479
- onClick: (f) => g(f, d.content)
2480
- },
2481
- `prompt-button-${d.slot}`
2482
- ))
2483
- ]
2484
- }
2485
- );
2486
- }, ho = ({
2487
- className: e
2488
- }) => {
2489
- const { state: t } = z(se);
2490
- return /* @__PURE__ */ i(
2491
- Ae,
2492
- {
2493
- className: e,
2494
- disabled: t == null ? void 0 : t.streaming,
2495
- label: "Send",
2496
- noBorder: !0,
2497
- type: "submit",
2498
- mode: "light",
2499
- focusMode: "light",
2500
- children: /* @__PURE__ */ i(Ba, { size: "size-4" })
2501
- }
2502
- );
2503
- }, fo = ({
2504
- className: e
2505
- }) => {
2506
- const { state: t, dispatch: r } = z(se), { getAccessToken: a, user: n } = Ee(), {
2507
- data: o,
2508
- error: s,
2509
- isLoading: c,
2510
- mutate: g
2511
- } = Lr({
2512
- keys: [n == null ? void 0 : n.username],
2513
- getAccessToken: a
2514
- }), d = async (f) => {
2515
- try {
2516
- await Rr({
2517
- accessToken: await a(),
2518
- type: xe.SET_USER_PREFERENCES,
2519
- params: {
2520
- user: n == null ? void 0 : n.username,
2521
- engine: f
2522
- }
2523
- }), g({ ...o }), t && (t == null ? void 0 : t.messages.length) > 0 && r({
2524
- type: ft
2525
- });
2526
- } catch {
2527
- }
2528
- };
2529
- return s || c ? null : o && /* @__PURE__ */ x(
2530
- Tt,
2531
- {
2532
- mode: "dark",
2533
- focusMode: "light",
2534
- trigger: /* @__PURE__ */ i(Ae, { className: e, noBorder: !0, label: "Engines", children: o && o.engine === Fe ? /* @__PURE__ */ i(Ut, { size: "size-4 sm:size-5" }) : /* @__PURE__ */ i(Ft, { size: "size-4 sm:size-5" }) }),
2535
- defaultPlacement: "top-start",
2536
- children: [
2537
- /* @__PURE__ */ i(Mr, { children: "Engines" }),
2538
- /* @__PURE__ */ i(
2539
- Ie,
2540
- {
2541
- selected: o && o.engine === zt,
2542
- label: "OpenAI",
2543
- icon: /* @__PURE__ */ i(Ft, {}),
2544
- onClick: () => d(zt)
2545
- }
2546
- ),
2547
- /* @__PURE__ */ i(
2548
- Ie,
2549
- {
2550
- selected: o && o.engine === Fe,
2551
- label: "Anthropic",
2552
- icon: /* @__PURE__ */ i(Ut, {}),
2553
- onClick: () => d(Fe)
2554
- }
2555
- )
2556
- ]
2557
- }
2558
- );
2559
- }, po = () => l(
2560
- "relative rounded-md text-base h-auto min-w-28 overflow-hidden pt-2"
2561
- ), rr = () => l("bg-surface-darker"), bo = () => l("text-copy-lighter caret-copy-light"), yo = () => l(
2562
- "has-[.av-prompt-editable:focus]:outline",
2563
- "has-[.av-prompt-editable:focus]:outline-2",
2564
- "has-[.av-prompt-editable:focus]:outline-offset-2",
2565
- "has-[.av-prompt-editable:focus]:outline-focus-light"
2566
- ), vo = () => l(
2567
- "peer",
2568
- "text-base resize-none overflow-hidden w-full text-inherit outline-none",
2569
- "h-6 pr-2 pl-4"
2570
- ), ko = ({ className: e }) => {
2571
- const t = l(
2572
- Yr,
2573
- po(),
2574
- rr(),
2575
- bo(),
2576
- yo(),
2577
- e
2578
- ), r = l(
2579
- Zr,
2580
- vo(),
2581
- rr()
2582
- );
2583
- return {
2584
- wrapper: t,
2585
- textArea: r
2586
- };
2587
- }, _o = ({
2588
- className: e,
2589
- label: t,
2590
- value: r,
2591
- defaultValue: a,
2592
- onChange: n,
2593
- onSubmit: o,
2594
- ref: s,
2595
- ...c
2596
- }) => {
2597
- const { state: m } = z(se), { state: u } = z(De), h = M(null), p = M(null), y = Wa([s, p]), v = ja(), b = ko({
2598
- className: e
2599
- }), [_, T] = Ga({
2600
- value: r,
2601
- initialControlledDelay: 20,
2602
- defaultValue: a,
2603
- onChange: (I) => {
2604
- n && n({
2605
- target: {
2606
- value: I
2607
- }
2608
- });
2609
- }
2610
- }), N = ne(() => {
2611
- if (!p.current)
2612
- return;
2613
- p.current.style.height = "auto";
2614
- const I = p.current.scrollHeight;
2615
- if (I > 120) {
2616
- p.current.style.height = "120px", p.current.style.overflowY = "scroll";
2617
- return;
2618
- }
2619
- p.current.style.height = `${I}px`, p.current.style.overflowY = "hidden";
2620
- }, [120]), k = (I) => {
2621
- p.current && (p.current.style.height = "24px"), o(I, _), T("");
2622
- }, C = (I) => {
2623
- T(I.target.value), N();
2624
- };
2625
- return D(() => {
2626
- m && m.usage === 0 && m.messages.length === 0 && p.current && (p.current.style.height = "24px");
2627
- }, [m]), D(() => {
2628
- u.lastTriggeredTimestamp && setTimeout(() => {
2629
- N();
2630
- }, 100);
2631
- }, [u.lastTriggeredTimestamp, N]), /* @__PURE__ */ i(
2632
- "div",
2633
- {
2634
- className: b.wrapper,
2635
- ref: h,
2636
- ...c,
2637
- children: /* @__PURE__ */ x("form", { onSubmit: k, children: [
2638
- /* @__PURE__ */ i("div", { id: v, className: "sr-only", children: t }),
2639
- /* @__PURE__ */ i("div", { className: "relative", children: /* @__PURE__ */ i(
2640
- "textarea",
2641
- {
2642
- required: !0,
2643
- rows: 1,
2644
- ref: y,
2645
- placeholder: "Type your question here.",
2646
- translate: "no",
2647
- onChange: C,
2648
- value: _,
2649
- onKeyDown: Pa([["mod+Enter", k]]),
2650
- className: b.textArea,
2651
- "aria-labelledby": v
2652
- }
2653
- ) }),
2654
- /* @__PURE__ */ x("div", { className: "p-2 flex items-center", children: [
2655
- /* @__PURE__ */ i(ho, { className: "order-4 ml-auto" }),
2656
- /* @__PURE__ */ i(uo, { className: "order-1 mr-2" }),
2657
- /* @__PURE__ */ i(fo, { className: "order-2 mr-2" }),
2658
- /* @__PURE__ */ i(go, { className: "order-3 mr-2" })
2659
- ] })
2660
- ] })
2661
- }
2662
- );
2663
- }, mt = (e, t) => {
2664
- e({
2665
- type: cr,
2666
- payload: {
2667
- streaming: t
2668
- }
2669
- });
2670
- }, ar = (e) => {
2671
- mt(e, !1), e({
2672
- type: ye,
2673
- payload: {
2674
- message: {
2675
- role: pt,
2676
- content: ta
2677
- }
2678
- }
2679
- });
2680
- }, Eo = () => {
2681
- const { state: e, dispatch: t } = z(se), { state: r, dispatch: a } = z(De), [n, o] = q(""), { getAccessToken: s, user: c } = Ee(), g = M(null), d = M(
2682
- null
2683
- );
2684
- D(() => {
2685
- (async () => {
2686
- var u;
2687
- if (!e || e.messages.length === 0) {
2688
- (u = d == null ? void 0 : d.current) == null || u.cancel();
2689
- return;
2690
- }
2691
- const m = e.messages[e.messages.length - 1];
2692
- if (!(e.messages.length === 0 || m.message.role === ve || m.message.role === Xr || m.message.role === pt || m.message.role === Qr))
2693
- try {
2694
- const h = await ro({
2695
- accessToken: await s(),
2696
- name: "generate",
2697
- data: {
2698
- messages: e.messages,
2699
- model: e.engine || ke,
2700
- user: (c == null ? void 0 : c.username) || "",
2701
- id: e.id,
2702
- usage: e.usage
2703
- }
2704
- });
2705
- if (h && h.ok) {
2706
- mt(t, !0);
2707
- const p = kt();
2708
- d.current = h.body.getReader();
2709
- const y = new TextDecoder();
2710
- for (; ; ) {
2711
- const { done: v, value: b } = await d.current.read();
2712
- if (v)
2713
- break;
2714
- const _ = y.decode(b, { stream: !0 }), T = _.indexOf($t);
2715
- if (T !== -1) {
2716
- const N = _.substring(0, T), k = JSON.parse(
2717
- _.substring(T + $t.length)
2718
- );
2719
- t({
2720
- type: ir,
2721
- payload: {
2722
- model: k.model,
2723
- usage: k.usage
2724
- }
2725
- }), t({
2726
- type: ye,
2727
- payload: {
2728
- message: {
2729
- content: N,
2730
- role: ve,
2731
- messageId: p,
2732
- processingTime: k.processingTime,
2733
- name: k.name
2734
- }
2735
- }
2736
- });
2737
- break;
2738
- } else
2739
- t({
2740
- type: ye,
2741
- payload: {
2742
- message: {
2743
- content: _,
2744
- role: ve,
2745
- messageId: p
2746
- }
2747
- }
2748
- });
2749
- }
2750
- mt(t, !1);
2751
- } else
2752
- ar(t);
2753
- } catch (h) {
2754
- console.error(h), ar(t);
2755
- }
2756
- })();
2757
- }, [e == null ? void 0 : e.messages]);
2758
- const f = async (m) => {
2759
- m.preventDefault(), t({
2760
- type: ye,
2761
- payload: {
2762
- message: {
2763
- role: Qe,
2764
- content: n
2765
- }
2766
- }
2767
- }), o("");
2768
- };
2769
- return D(() => {
2770
- if (r.prompt !== "") {
2771
- const m = r.prompt.endsWith(":") && !r.prompt.endsWith(": ") ? r.prompt + " " : r.prompt;
2772
- m.indexOf(Dt) !== -1 ? navigator.clipboard.readText().then((h) => {
2773
- o(m.replace(Dt, h));
2774
- }) : o(m), g.current && g.current.focus(), a({
2775
- type: lr
2776
- });
2777
- }
2778
- }, [r, a]), D(() => {
2779
- e && e.usage === 0 && e.messages.length === 0 && (o(""), g.current && g.current.focus());
2780
- }, [e]), D(() => {
2781
- (e == null ? void 0 : e.streaming) === !1 && g.current && g.current.focus();
2782
- }, [e]), /* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(
2783
- _o,
2784
- {
2785
- label: ea,
2786
- onSubmit: f,
2787
- ref: g,
2788
- value: n,
2789
- onChange: (m) => o(m.target.value)
2790
- }
2791
- ) });
2792
- }, xo = () => {
2793
- const { state: e } = z(se), t = M(!1), r = window.innerWidth < 403, [a, n] = q(
2794
- r ? "bottom-4" : "top-[245px]"
2795
- );
2796
- return D(() => {
2797
- r || e && (!t.current && e.streaming && n("bottom-4"), t.current = !!e.streaming);
2798
- }, [e, r]), D(() => {
2799
- r || (e && e.messages.length === 0 && n("top-[245px]"), e && !e.streaming && e.messages.length > 0 && n("bottom-4"));
2800
- }, [e, r]), /* @__PURE__ */ x(
2801
- "footer",
2802
- {
2803
- className: l(
2804
- "px-2 sm:px-0 md:mx-auto md:max-w-4xl w-full fixed left-1/2 transform -translate-x-1/2",
2805
- io,
2806
- a
2807
- ),
2808
- children: [
2809
- /* @__PURE__ */ i(Eo, {}),
2810
- /* @__PURE__ */ i("div", { className: "w-full text-center text-xs text-copy-lighter pt-2", children: ra })
2811
- ]
2812
- }
2813
- );
2814
- }, To = ({ show: e }) => e ? /* @__PURE__ */ i(
2815
- "div",
2816
- {
2817
- className: l(
2818
- co,
2819
- "bottom-44 fixed left-1/2 transform -translate-x-1/2"
2820
- ),
2821
- children: /* @__PURE__ */ i(
2822
- "button",
2823
- {
2824
- className: "av-button not-prose truncate text-copy-light rounded-full inline-flex items-center justify-center h-8 w-8 p-1 border border-transparent focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-focus-dark dark:focus:outline-focus-light disabled:opacity-50 dark:bg-slate-50 bg-slate-500 disabled:cursor-auto",
2825
- disabled: !0,
2826
- type: "button",
2827
- "aria-label": "Scroll to bottom",
2828
- children: /* @__PURE__ */ i("div", { className: "text-copy-light", children: /* @__PURE__ */ i(
2829
- "svg",
2830
- {
2831
- xmlns: "http://www.w3.org/2000/svg",
2832
- className: "size-4 dark:text-copy-dark text-copy-lighter",
2833
- viewBox: "0 0 384 512",
2834
- fill: "currentColor",
2835
- role: "img",
2836
- "aria-hidden": "true",
2837
- focusable: "false",
2838
- children: /* @__PURE__ */ i("path", { d: "M174.6 472.6c4.5 4.7 10.8 7.4 17.4 7.4s12.8-2.7 17.4-7.4l168-176c9.2-9.6 8.8-24.8-.8-33.9s-24.8-8.8-33.9 .8L216 396.1 216 56c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 340.1L41.4 263.4c-9.2-9.6-24.3-9.9-33.9-.8s-9.9 24.3-.8 33.9l168 176z" })
2839
- }
2840
- ) })
2841
- }
2842
- )
2843
- }
2844
- ) : null;
2845
- /*!
2846
- @versini/ui-bubble v3.1.7
2847
- © 2025 gizmette.com
2848
- */
2849
- try {
2850
- window.__VERSINI_UI_BUBBLE__ || (window.__VERSINI_UI_BUBBLE__ = {
2851
- version: "3.1.7",
2852
- buildTime: "01/14/2025 10:39 AM EST",
2853
- homepage: "https://github.com/aversini/ui-components",
2854
- license: "MIT"
2855
- });
2856
- } catch {
2857
- }
2858
- const wo = "av-bubble", nr = "av-button", Ve = "icon", zr = "button", gt = "link", So = ({
2859
- type: e,
2860
- size: t,
2861
- labelRight: r,
2862
- labelLeft: a,
2863
- align: n
2864
- }) => {
2865
- const o = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", c = "max-h-12 py-2 px-4";
2866
- switch (e) {
2867
- case zr:
2868
- case gt:
2869
- return l({
2870
- [o]: t === "small",
2871
- [s]: t === "medium",
2872
- [c]: t === "large"
2873
- });
2874
- case Ve:
2875
- return l("inline-flex items-center", {
2876
- "justify-center": n === "center",
2877
- "justify-start": n === "left",
2878
- "justify-end": n === "right",
2879
- "h-6 w-6 p-0": t === "small" && !(r || a),
2880
- "h-6 px-2": t === "small" && (r || a),
2881
- "h-8 w-8 p-1": t === "medium" && !(r || a),
2882
- "h-8 px-3": t === "medium" && (r || a),
2883
- "h-12 w-12 p-2": t === "large" && !(r || a),
2884
- "h-12 px-4": t === "large" && (r || a)
2885
- });
2886
- }
2887
- }, No = ({
2888
- type: e,
2889
- size: t,
2890
- labelRight: r,
2891
- labelLeft: a
2892
- }) => {
2893
- const n = "text-sm font-medium", o = "text-base font-medium", s = "text-lg font-medium";
2894
- switch (e) {
2895
- case zr:
2896
- case gt:
2897
- return l({
2898
- "text-center": e === gt,
2899
- [n]: t === "small",
2900
- [o]: t === "medium",
2901
- [s]: t === "large"
2902
- });
2903
- case Ve:
2904
- return l({
2905
- [n]: t === "small" && (r || a),
2906
- [o]: t === "medium" && (r || a),
2907
- [s]: t === "large" && (r || a)
2908
- });
2909
- }
2910
- }, Co = ({
2911
- mode: e,
2912
- noBackground: t,
2913
- noTruncate: r,
2914
- variant: a
2915
- }) => {
2916
- if (t)
2917
- return "not-prose";
2918
- if (a === "primary")
2919
- return l("not-prose", {
2920
- truncate: !r,
2921
- "text-copy-light": e === "dark" || e === "system",
2922
- "text-copy-lighter": e === "light" || e === "alt-system",
2923
- "dark:text-copy-lighter": e === "system",
2924
- "dark:text-copy-light": e === "alt-system"
2925
- });
2926
- if (a === "secondary")
2927
- return l("not-prose", {
2928
- truncate: !r,
2929
- "text-copy-light": e === "light" || e === "system",
2930
- "text-copy-lighter": e === "dark" || e === "alt-system",
2931
- "dark:text-copy-lighter": e === "alt-system",
2932
- "dark:text-copy-light": e === "system"
2933
- });
2934
- if (a === "danger")
2935
- return l("not-prose", {
2936
- truncate: !r,
2937
- "text-copy-light": e === "dark" || e === "system",
2938
- "text-copy-lighter": e === "light" || e === "alt-system",
2939
- "dark:text-copy-lighter": e === "system",
2940
- "dark:text-copy-light": e === "alt-system"
2941
- });
2942
- if (a === "selected")
2943
- return l("not-prose text-copy-lighter", {
2944
- truncate: !r
2945
- });
2946
- }, Ro = ({
2947
- mode: e,
2948
- noBackground: t,
2949
- variant: r
2950
- }) => {
2951
- if (!t) {
2952
- if (r === "primary")
2953
- return l({
2954
- "bg-action-dark": e === "dark",
2955
- "bg-action-light": e === "light",
2956
- "bg-action-dark dark:bg-action-light": e === "system",
2957
- "bg-action-light dark:bg-action-dark": e === "alt-system"
2958
- });
2959
- if (r === "secondary")
2960
- return l({
2961
- "bg-action-dark": e === "light",
2962
- "bg-action-light": e === "dark",
2963
- "bg-action-dark dark:bg-action-light": e === "alt-system",
2964
- "bg-action-light dark:bg-action-dark": e === "system"
2965
- });
2966
- if (r === "danger")
2967
- return l({
2968
- "bg-action-danger-dark": e === "dark",
2969
- "bg-action-danger-light": e === "light",
2970
- "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
2971
- "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
2972
- });
2973
- if (r === "selected")
2974
- return "bg-action-selected-dark";
2975
- }
2976
- }, Io = ({
2977
- radius: e
2978
- }) => l({
2979
- "rounded-full": e === "large",
2980
- "rounded-md": e === "medium",
2981
- "rounded-sm": e === "small"
2982
- }), Lo = ({
2983
- mode: e,
2984
- disabled: t,
2985
- variant: r
2986
- }) => {
2987
- if (t)
2988
- return "";
2989
- if (r === "primary")
2990
- return l("hover:text-copy-light-hover", {
2991
- "hover:bg-action-dark-hover": e === "dark",
2992
- "hover:bg-action-light-hover": e === "light",
2993
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
2994
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
2995
- });
2996
- if (r === "secondary")
2997
- return l("hover:text-copy-light-hover", {
2998
- "hover:bg-action-dark-hover": e === "light",
2999
- "hover:bg-action-light-hover": e === "dark",
3000
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
3001
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
3002
- });
3003
- if (r === "danger")
3004
- return l("hover:text-copy-light-hover", {
3005
- "hover:bg-action-danger-dark-hover": e === "dark",
3006
- "hover:bg-action-danger-light-hover": e === "light",
3007
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
3008
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
3009
- });
3010
- if (r === "selected")
3011
- return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
3012
- }, Ao = ({
3013
- mode: e,
3014
- disabled: t,
3015
- variant: r
3016
- }) => {
3017
- if (t)
3018
- return "";
3019
- if (r === "primary")
3020
- return l("active:text-copy-light-active", {
3021
- "active:bg-action-dark-active": e === "dark",
3022
- "active:bg-action-light-active": e === "light",
3023
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
3024
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
3025
- });
3026
- if (r === "secondary")
3027
- return l("active:text-copy-light-active", {
3028
- "active:bg-action-dark-active": e === "light",
3029
- "active:bg-action-light-active": e === "dark",
3030
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
3031
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
3032
- });
3033
- if (r === "danger")
3034
- return l("active:text-copy-lighter-active", {
3035
- "active:bg-action-danger-dark-active": e === "dark",
3036
- "active:bg-action-danger-light-active": e === "light",
3037
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
3038
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
3039
- });
3040
- if (r === "selected")
3041
- return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
3042
- }, Oo = ({
3043
- mode: e,
3044
- noBorder: t,
3045
- variant: r
3046
- }) => {
3047
- if (t)
3048
- return "border border-transparent";
3049
- if (r === "primary")
3050
- return l("border", {
3051
- "border-border-dark": e === "dark",
3052
- "border-border-accent": e === "light",
3053
- "border-border-dark dark:border-border-accent": e === "system",
3054
- "border-border-accent dark:border-border-dark": e === "alt-system"
3055
- });
3056
- if (r === "secondary")
3057
- return l("border", {
3058
- "border-border-dark": e === "light",
3059
- "border-border-accent": e === "dark",
3060
- "border-border-dark dark:border-border-accent": e === "alt-system",
3061
- "border-border-accent dark:border-border-dark": e === "system"
3062
- });
3063
- if (r === "danger")
3064
- return l("border", {
3065
- "border-border-danger-dark": e === "dark",
3066
- "border-border-danger-medium": e === "light",
3067
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
3068
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
3069
- });
3070
- if (r === "selected")
3071
- return "border border-border-selected-dark";
3072
- }, Bo = ({
3073
- focusMode: e
3074
- }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
3075
- "focus:outline-focus-dark": e === "dark",
3076
- "focus:outline-focus-light": e === "light",
3077
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
3078
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
3079
- }), $r = ({
3080
- type: e,
3081
- className: t,
3082
- raw: r,
3083
- mode: a,
3084
- focusMode: n,
3085
- disabled: o,
3086
- fullWidth: s,
3087
- size: c,
3088
- noBorder: g,
3089
- labelRight: d,
3090
- labelLeft: f,
3091
- noBackground: m,
3092
- variant: u,
3093
- noTruncate: h,
3094
- align: p,
3095
- radius: y
3096
- }) => (u || (u = "primary"), r ? l(nr, t) : l(
3097
- nr,
3098
- Co({
3099
- mode: a,
3100
- variant: u,
3101
- noBackground: m,
3102
- noTruncate: h
3103
- }),
3104
- Ro({ mode: a, noBackground: m, variant: u }),
3105
- Io({ radius: y }),
3106
- So({
3107
- type: e,
3108
- size: c,
3109
- labelRight: d,
3110
- labelLeft: f,
3111
- align: p
3112
- }),
3113
- No({ type: e, size: c, labelRight: d, labelLeft: f }),
3114
- Oo({ mode: a, variant: u, noBorder: g }),
3115
- Bo({ focusMode: n }),
3116
- Lo({ mode: a, variant: u, disabled: o }),
3117
- Ao({ mode: a, variant: u, disabled: o }),
3118
- {
3119
- "w-full": s,
3120
- "disabled:cursor-not-allowed disabled:opacity-50": o
3121
- },
3122
- t
3123
- )), Mo = (e, t, r) => {
3124
- var a;
3125
- !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);
3126
- }, wt = A.forwardRef((e, t) => {
3127
- const { onClick: r, noInternalClick: a = !1, ...n } = e;
3128
- return /* @__PURE__ */ i(
3129
- "button",
3130
- {
3131
- ref: t,
3132
- onClick: (o) => {
3133
- Mo(o, a, r);
3134
- },
3135
- ...n
3136
- }
3137
- );
3138
- });
3139
- wt.displayName = "BaseButton";
3140
- const Dr = A.forwardRef(
3141
- ({
3142
- children: e,
3143
- disabled: t = !1,
3144
- mode: r = "system",
3145
- focusMode: a = "system",
3146
- fullWidth: n = !1,
3147
- className: o,
3148
- type: s = "button",
3149
- raw: c = !1,
3150
- noBorder: g = !1,
3151
- "aria-label": d,
3152
- label: f,
3153
- size: m = "medium",
3154
- labelRight: u,
3155
- labelLeft: h,
3156
- noBackground: p = !1,
3157
- align: y = "center",
3158
- radius: v = "large",
3159
- variant: b = "primary",
3160
- ..._
3161
- }, T) => {
3162
- const N = $r({
3163
- type: Ve,
3164
- mode: r,
3165
- focusMode: a,
3166
- fullWidth: n,
3167
- disabled: t,
3168
- raw: c,
3169
- className: o,
3170
- noBorder: g,
3171
- size: m,
3172
- labelRight: u,
3173
- labelLeft: h,
3174
- noBackground: p,
3175
- align: y,
3176
- radius: v,
3177
- variant: b
3178
- }), k = l({
3179
- "text-copy-accent-dark": (r === "light" || r === "alt-system") && !c,
3180
- "text-copy-light": (r === "dark" || r === "system") && !c,
3181
- "dark:text-copy-light": r === "alt-system" && !c,
3182
- "dark:text-copy-accent-dark": r === "system" && !c
3183
- });
3184
- return /* @__PURE__ */ x(
3185
- wt,
3186
- {
3187
- ref: T,
3188
- className: N,
3189
- disabled: t,
3190
- type: s,
3191
- "aria-label": d || f,
3192
- ..._,
3193
- children: [
3194
- h && /* @__PURE__ */ i("span", { className: "pr-2", children: h }),
3195
- /* @__PURE__ */ i("div", { className: k, children: e }),
3196
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
3197
- ]
3198
- }
3199
- );
3200
- }
3201
- );
3202
- Dr.displayName = "ButtonIcon";
3203
- /*!
3204
- @versini/ui-button v4.0.10
3205
- © 2025 gizmette.com
3206
- */
3207
- try {
3208
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
3209
- version: "4.0.10",
3210
- buildTime: "01/14/2025 10:39 AM EST",
3211
- homepage: "https://github.com/aversini/ui-components",
3212
- license: "MIT"
3213
- });
3214
- } catch {
3215
- }
3216
- const zo = A.forwardRef(
3217
- ({
3218
- children: e,
3219
- disabled: t = !1,
3220
- mode: r = "system",
3221
- focusMode: a = "system",
3222
- fullWidth: n = !1,
3223
- className: o,
3224
- type: s = "button",
3225
- raw: c = !1,
3226
- noBorder: g = !1,
3227
- "aria-label": d,
3228
- label: f,
3229
- size: m = "medium",
3230
- labelRight: u,
3231
- labelLeft: h,
3232
- noBackground: p = !1,
3233
- align: y = "center",
3234
- active: v = !1,
3235
- radius: b = "large",
3236
- ..._
3237
- }, T) => {
3238
- const N = $r({
3239
- type: Ve,
3240
- mode: r,
3241
- focusMode: a,
3242
- fullWidth: n,
3243
- disabled: t,
3244
- raw: c,
3245
- className: o,
3246
- noBorder: g,
3247
- size: m,
3248
- labelRight: u,
3249
- labelLeft: h,
3250
- noBackground: p,
3251
- align: y,
3252
- radius: b
3253
- }), k = l({
3254
- "text-copy-accent-dark": r === "light" && !c,
3255
- "text-copy-light": r === "dark" && !c,
3256
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
3257
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
3258
- }), C = v ? l(
3259
- "relative",
3260
- "focus-within:static",
3261
- "focus-within:after:border-transparent",
3262
- "after:absolute",
3263
- "after:content-['']",
3264
- "after:border-b-2",
3265
- "after:bottom-[-4px]",
3266
- "after:left-0",
3267
- "after:right-0",
3268
- {
3269
- "after:border-table-dark": r === "dark",
3270
- "after:border-table-light": r === "light",
3271
- "after:border-table-dark dark:after:border-table-light": r === "system",
3272
- "after:border-table-light dark:after:border-table-dark": r === "alt-system"
3273
- }
3274
- ) : "";
3275
- return /* @__PURE__ */ i("div", { className: C, children: /* @__PURE__ */ x(
3276
- wt,
3277
- {
3278
- ref: T,
3279
- className: N,
3280
- disabled: t,
3281
- type: s,
3282
- "aria-label": d || f,
3283
- ..._,
3284
- children: [
3285
- h && /* @__PURE__ */ i("span", { className: "pr-2", children: h }),
3286
- /* @__PURE__ */ i("div", { className: k, children: e }),
3287
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
3288
- ]
3289
- }
3290
- ) });
3291
- }
3292
- );
3293
- zo.displayName = "ButtonSort";
3294
- const Vr = ({
3295
- children: e,
3296
- fill: t,
3297
- viewBox: r,
3298
- className: a,
3299
- defaultViewBox: n,
3300
- size: o,
3301
- title: s,
3302
- semantic: c = !1,
3303
- ...g
3304
- }) => {
3305
- const d = l(o, a);
3306
- return /* @__PURE__ */ x(Le, { children: [
3307
- /* @__PURE__ */ i(
3308
- "svg",
3309
- {
3310
- xmlns: "http://www.w3.org/2000/svg",
3311
- className: d,
3312
- viewBox: r || n,
3313
- fill: t || "currentColor",
3314
- role: "img",
3315
- "aria-hidden": !c,
3316
- focusable: !1,
3317
- ...g,
3318
- children: e
3319
- }
3320
- ),
3321
- s && c && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
3322
- ] });
3323
- };
3324
- /*!
3325
- @versini/ui-svgicon v4.0.3
3326
- © 2025 gizmette.com
3327
- */
3328
- try {
3329
- window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
3330
- version: "4.0.3",
3331
- buildTime: "01/14/2025 10:39 AM EST",
3332
- homepage: "https://github.com/aversini/ui-components",
3333
- license: "MIT"
3334
- });
3335
- } catch {
3336
- }
3337
- const $o = ({
3338
- className: e,
3339
- viewBox: t,
3340
- title: r,
3341
- monotone: a,
3342
- ...n
3343
- }) => /* @__PURE__ */ x(
3344
- Vr,
3345
- {
3346
- defaultViewBox: "0 0 448 512",
3347
- size: "size-5",
3348
- viewBox: t,
3349
- className: e,
3350
- title: r || "Copied",
3351
- ...n,
3352
- children: [
3353
- /* @__PURE__ */ i(
3354
- "path",
3355
- {
3356
- className: "fa-secondary",
3357
- opacity: "0.4",
3358
- d: "M0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32C28.7 32 0 60.7 0 96zM104 256c0-6.1 2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l47 47c37-37 74-74 111-111c4.7-4.7 10.8-7 17-7s12.3 2.3 17 7c2.3 2.3 4.1 5 5.3 7.9c.6 1.5 1 2.9 1.3 4.4c.2 1.1 .3 2.2 .3 2.2c.1 1.2 .1 1.2 .1 2.5c-.1 1.5-.1 1.9-.1 2.3c-.1 .7-.2 1.5-.3 2.2c-.3 1.5-.7 3-1.3 4.4c-1.2 2.9-2.9 5.6-5.3 7.9c-42.7 42.7-85.3 85.3-128 128c-4.7 4.7-10.8 7-17 7s-12.3-2.3-17-7c-21.3-21.3-42.7-42.7-64-64c-4.7-4.7-7-10.8-7-17z"
3359
- }
3360
- ),
3361
- /* @__PURE__ */ i(
3362
- "path",
3363
- {
3364
- className: "fa-primary",
3365
- 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"
3366
- }
3367
- )
3368
- ]
3369
- }
3370
- ), Do = ({
3371
- className: e,
3372
- viewBox: t,
3373
- title: r,
3374
- monotone: a,
3375
- ...n
3376
- }) => /* @__PURE__ */ i(
3377
- Vr,
3378
- {
3379
- defaultViewBox: "0 0 512 512",
3380
- size: "size-5",
3381
- viewBox: t,
3382
- className: e,
3383
- title: r || "Copy",
3384
- ...n,
3385
- children: /* @__PURE__ */ i("path", { d: "M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z" })
3386
- }
3387
- );
3388
- /*!
3389
- @versini/ui-icons v4.4.2
3390
- © 2025 gizmette.com
3391
- */
3392
- try {
3393
- window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
3394
- version: "4.4.2",
3395
- buildTime: "01/14/2025 10:39 AM EST",
3396
- homepage: "https://github.com/aversini/ui-components",
3397
- license: "MIT"
3398
- });
3399
- } catch {
3400
- }
3401
- const Vo = ({
3402
- kind: e,
3403
- noMaxWidth: t
3404
- }) => l("p-4", {
3405
- "max-w-xs sm:max-w-md md:max-w-2xl": !t,
3406
- "lg:max-w-3xl": e === "left" && !t
3407
- }), Po = ({ kind: e }) => l({
3408
- "bg-surface-lighter dark:bg-surface-dark": e === "left",
3409
- "bg-surface-accent": e === "right"
3410
- }), Uo = ({ kind: e }) => l(
3411
- "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",
3412
- {
3413
- "text-copy-lighter": e === "right"
3414
- }
3415
- ), Fo = ({ kind: e }) => l("rounded-b-xl", {
3416
- "rounded-tr-xl": e === "left",
3417
- "rounded-tl-xl": e === "right"
3418
- }), Ho = ({
3419
- kind: e,
3420
- className: t,
3421
- noMaxWidth: r
3422
- }) => {
3423
- const a = l(
3424
- wo,
3425
- "flex items-start",
3426
- {
3427
- "flex-row-reverse": e === "right"
3428
- },
3429
- t
3430
- ), n = l(
3431
- "flex flex-col empty:hidden",
3432
- Vo({ kind: e, noMaxWidth: r }),
3433
- Uo({ kind: e }),
3434
- Po({ kind: e }),
3435
- Fo({ kind: e })
3436
- ), o = "pr-2 pt-1 text-end text-xs text-copy-light", s = l("flex flex-col-reverse gap-2 sm:flex-row", {
3437
- "ml-2": e === "left",
3438
- "mr-2": e === "right"
3439
- });
3440
- return {
3441
- wrapper: a,
3442
- main: n,
3443
- footer: o,
3444
- copyButton: s
3445
- };
3446
- }, Wo = ({
3447
- children: e,
3448
- kind: t = "left",
3449
- className: r,
3450
- footer: a,
3451
- rawFooter: n,
3452
- copyToClipboard: o,
3453
- copyToClipboardFocusMode: s = "system",
3454
- copyToClipboardMode: c = "system",
3455
- noMaxWidth: g = !1
3456
- }) => {
3457
- const [d, f] = q(!1), m = Ho({ kind: t, className: r, noMaxWidth: g }), u = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), h = () => {
3458
- f(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
3459
- };
3460
- return D(() => {
3461
- let p;
3462
- return d && (p = window.setTimeout(() => {
3463
- f(!1);
3464
- }, 3e3)), () => {
3465
- clearTimeout(p);
3466
- };
3467
- }, [d]), /* @__PURE__ */ x("div", { className: m.wrapper, children: [
3468
- /* @__PURE__ */ x("div", { children: [
3469
- /* @__PURE__ */ i("div", { className: m.main, children: e }),
3470
- a && Object.keys(a).map((p) => a[p] ? /* @__PURE__ */ i("div", { className: "prose-p:m-0", children: /* @__PURE__ */ x("p", { className: m.footer, children: [
3471
- p,
3472
- ": ",
3473
- a[p]
3474
- ] }) }, `-${p}`) : null),
3475
- n && n
3476
- ] }),
3477
- u && /* @__PURE__ */ i("div", { className: m.copyButton, children: /* @__PURE__ */ i(
3478
- Dr,
3479
- {
3480
- noBorder: !0,
3481
- noBackground: !0,
3482
- size: "small",
3483
- mode: c,
3484
- focusMode: s,
3485
- label: d ? "Copied to clipboard" : "Copy to clipboard",
3486
- onClick: h,
3487
- disabled: d,
3488
- children: d ? /* @__PURE__ */ i($o, { size: "size-3" }) : /* @__PURE__ */ i(Do, { size: "size-3" })
3489
- }
3490
- ) })
3491
- ] });
3492
- }, or = "av-button", St = "icon", Nt = "button", ht = "link", Go = ({
3493
- type: e,
3494
- size: t,
3495
- labelRight: r,
3496
- labelLeft: a,
3497
- align: n
3498
- }) => {
3499
- const o = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", c = "max-h-12 py-2 px-4";
3500
- switch (e) {
3501
- case Nt:
3502
- case ht:
3503
- return l({
3504
- [o]: t === "small",
3505
- [s]: t === "medium",
3506
- [c]: t === "large"
3507
- });
3508
- case St:
3509
- return l("inline-flex items-center", {
3510
- "justify-center": n === "center",
3511
- "justify-start": n === "left",
3512
- "justify-end": n === "right",
3513
- "h-6 w-6 p-0": t === "small" && !(r || a),
3514
- "h-6 px-2": t === "small" && (r || a),
3515
- "h-8 w-8 p-1": t === "medium" && !(r || a),
3516
- "h-8 px-3": t === "medium" && (r || a),
3517
- "h-12 w-12 p-2": t === "large" && !(r || a),
3518
- "h-12 px-4": t === "large" && (r || a)
3519
- });
3520
- }
3521
- }, jo = ({
3522
- type: e,
3523
- size: t,
3524
- labelRight: r,
3525
- labelLeft: a
3526
- }) => {
3527
- const n = "text-sm font-medium", o = "text-base font-medium", s = "text-lg font-medium";
3528
- switch (e) {
3529
- case Nt:
3530
- case ht:
3531
- return l({
3532
- "text-center": e === ht,
3533
- [n]: t === "small",
3534
- [o]: t === "medium",
3535
- [s]: t === "large"
3536
- });
3537
- case St:
3538
- return l({
3539
- [n]: t === "small" && (r || a),
3540
- [o]: t === "medium" && (r || a),
3541
- [s]: t === "large" && (r || a)
3542
- });
3543
- }
3544
- }, qo = ({
3545
- mode: e,
3546
- noBackground: t,
3547
- noTruncate: r,
3548
- variant: a
3549
- }) => {
3550
- if (t)
3551
- return "not-prose";
3552
- if (a === "primary")
3553
- return l("not-prose", {
3554
- truncate: !r,
3555
- "text-copy-light": e === "dark" || e === "system",
3556
- "text-copy-lighter": e === "light" || e === "alt-system",
3557
- "dark:text-copy-lighter": e === "system",
3558
- "dark:text-copy-light": e === "alt-system"
3559
- });
3560
- if (a === "secondary")
3561
- return l("not-prose", {
3562
- truncate: !r,
3563
- "text-copy-light": e === "light" || e === "system",
3564
- "text-copy-lighter": e === "dark" || e === "alt-system",
3565
- "dark:text-copy-lighter": e === "alt-system",
3566
- "dark:text-copy-light": e === "system"
3567
- });
3568
- if (a === "danger")
3569
- return l("not-prose", {
3570
- truncate: !r,
3571
- "text-copy-light": e === "dark" || e === "system",
3572
- "text-copy-lighter": e === "light" || e === "alt-system",
3573
- "dark:text-copy-lighter": e === "system",
3574
- "dark:text-copy-light": e === "alt-system"
3575
- });
3576
- if (a === "selected")
3577
- return l("not-prose text-copy-lighter", {
3578
- truncate: !r
3579
- });
3580
- }, Ko = ({
3581
- mode: e,
3582
- noBackground: t,
3583
- variant: r
3584
- }) => {
3585
- if (!t) {
3586
- if (r === "primary")
3587
- return l({
3588
- "bg-action-dark": e === "dark",
3589
- "bg-action-light": e === "light",
3590
- "bg-action-dark dark:bg-action-light": e === "system",
3591
- "bg-action-light dark:bg-action-dark": e === "alt-system"
3592
- });
3593
- if (r === "secondary")
3594
- return l({
3595
- "bg-action-dark": e === "light",
3596
- "bg-action-light": e === "dark",
3597
- "bg-action-dark dark:bg-action-light": e === "alt-system",
3598
- "bg-action-light dark:bg-action-dark": e === "system"
3599
- });
3600
- if (r === "danger")
3601
- return l({
3602
- "bg-action-danger-dark": e === "dark",
3603
- "bg-action-danger-light": e === "light",
3604
- "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
3605
- "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
3606
- });
3607
- if (r === "selected")
3608
- return "bg-action-selected-dark";
3609
- }
3610
- }, Jo = ({
3611
- radius: e
3612
- }) => l({
3613
- "rounded-full": e === "large",
3614
- "rounded-md": e === "medium",
3615
- "rounded-sm": e === "small"
3616
- }), Yo = ({
3617
- mode: e,
3618
- disabled: t,
3619
- variant: r
3620
- }) => {
3621
- if (t)
3622
- return "";
3623
- if (r === "primary")
3624
- return l("hover:text-copy-light-hover", {
3625
- "hover:bg-action-dark-hover": e === "dark",
3626
- "hover:bg-action-light-hover": e === "light",
3627
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
3628
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
3629
- });
3630
- if (r === "secondary")
3631
- return l("hover:text-copy-light-hover", {
3632
- "hover:bg-action-dark-hover": e === "light",
3633
- "hover:bg-action-light-hover": e === "dark",
3634
- "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
3635
- "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
3636
- });
3637
- if (r === "danger")
3638
- return l("hover:text-copy-light-hover", {
3639
- "hover:bg-action-danger-dark-hover": e === "dark",
3640
- "hover:bg-action-danger-light-hover": e === "light",
3641
- "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
3642
- "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
3643
- });
3644
- if (r === "selected")
3645
- return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
3646
- }, Zo = ({
3647
- mode: e,
3648
- disabled: t,
3649
- variant: r
3650
- }) => {
3651
- if (t)
3652
- return "";
3653
- if (r === "primary")
3654
- return l("active:text-copy-light-active", {
3655
- "active:bg-action-dark-active": e === "dark",
3656
- "active:bg-action-light-active": e === "light",
3657
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
3658
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
3659
- });
3660
- if (r === "secondary")
3661
- return l("active:text-copy-light-active", {
3662
- "active:bg-action-dark-active": e === "light",
3663
- "active:bg-action-light-active": e === "dark",
3664
- "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
3665
- "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
3666
- });
3667
- if (r === "danger")
3668
- return l("active:text-copy-lighter-active", {
3669
- "active:bg-action-danger-dark-active": e === "dark",
3670
- "active:bg-action-danger-light-active": e === "light",
3671
- "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
3672
- "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
3673
- });
3674
- if (r === "selected")
3675
- return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
3676
- }, Xo = ({
3677
- mode: e,
3678
- noBorder: t,
3679
- variant: r
3680
- }) => {
3681
- if (t)
3682
- return "border border-transparent";
3683
- if (r === "primary")
3684
- return l("border", {
3685
- "border-border-dark": e === "dark",
3686
- "border-border-accent": e === "light",
3687
- "border-border-dark dark:border-border-accent": e === "system",
3688
- "border-border-accent dark:border-border-dark": e === "alt-system"
3689
- });
3690
- if (r === "secondary")
3691
- return l("border", {
3692
- "border-border-dark": e === "light",
3693
- "border-border-accent": e === "dark",
3694
- "border-border-dark dark:border-border-accent": e === "alt-system",
3695
- "border-border-accent dark:border-border-dark": e === "system"
3696
- });
3697
- if (r === "danger")
3698
- return l("border", {
3699
- "border-border-danger-dark": e === "dark",
3700
- "border-border-danger-medium": e === "light",
3701
- "border-border-danger-dark dark:border-border-danger-medium": e === "system",
3702
- "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
3703
- });
3704
- if (r === "selected")
3705
- return "border border-border-selected-dark";
3706
- }, Qo = ({
3707
- focusMode: e
3708
- }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
3709
- "focus:outline-focus-dark": e === "dark",
3710
- "focus:outline-focus-light": e === "light",
3711
- "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
3712
- "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
3713
- }), Pr = ({
3714
- type: e,
3715
- className: t,
3716
- raw: r,
3717
- mode: a,
3718
- focusMode: n,
3719
- disabled: o,
3720
- fullWidth: s,
3721
- size: c,
3722
- noBorder: g,
3723
- labelRight: d,
3724
- labelLeft: f,
3725
- noBackground: m,
3726
- variant: u,
3727
- noTruncate: h,
3728
- align: p,
3729
- radius: y
3730
- }) => (u || (u = "primary"), r ? l(or, t) : l(
3731
- or,
3732
- qo({
3733
- mode: a,
3734
- variant: u,
3735
- noBackground: m,
3736
- noTruncate: h
3737
- }),
3738
- Ko({ mode: a, noBackground: m, variant: u }),
3739
- Jo({ radius: y }),
3740
- Go({
3741
- type: e,
3742
- size: c,
3743
- labelRight: d,
3744
- labelLeft: f,
3745
- align: p
3746
- }),
3747
- jo({ type: e, size: c, labelRight: d, labelLeft: f }),
3748
- Xo({ mode: a, variant: u, noBorder: g }),
3749
- Qo({ focusMode: n }),
3750
- Yo({ mode: a, variant: u, disabled: o }),
3751
- Zo({ mode: a, variant: u, disabled: o }),
3752
- {
3753
- "w-full": s,
3754
- "disabled:cursor-not-allowed disabled:opacity-50": o
3755
- },
3756
- t
3757
- )), es = (e, t, r) => {
3758
- var a;
3759
- !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);
3760
- }, Ct = A.forwardRef((e, t) => {
3761
- const { onClick: r, noInternalClick: a = !1, ...n } = e;
3762
- return /* @__PURE__ */ i(
3763
- "button",
3764
- {
3765
- ref: t,
3766
- onClick: (o) => {
3767
- es(o, a, r);
3768
- },
3769
- ...n
3770
- }
3771
- );
3772
- });
3773
- Ct.displayName = "BaseButton";
3774
- const Ur = A.forwardRef(
3775
- ({
3776
- children: e,
3777
- disabled: t = !1,
3778
- mode: r = "system",
3779
- focusMode: a = "system",
3780
- fullWidth: n = !1,
3781
- className: o,
3782
- size: s = "medium",
3783
- raw: c = !1,
3784
- noBorder: g = !1,
3785
- variant: d = "primary",
3786
- noTruncate: f = !1,
3787
- radius: m = "large",
3788
- ...u
3789
- }, h) => {
3790
- const p = Pr({
3791
- type: Nt,
3792
- mode: r,
3793
- focusMode: a,
3794
- fullWidth: n,
3795
- disabled: t,
3796
- raw: c,
3797
- className: o,
3798
- size: s,
3799
- noBorder: g,
3800
- variant: d,
3801
- noTruncate: f,
3802
- radius: m
3803
- });
3804
- return /* @__PURE__ */ i(
3805
- Ct,
3806
- {
3807
- ref: h,
3808
- className: p,
3809
- disabled: t,
3810
- ...u,
3811
- children: e
3812
- }
3813
- );
3814
- }
3815
- );
3816
- Ur.displayName = "Button";
3817
- /*!
3818
- @versini/ui-button v4.0.10
3819
- © 2025 gizmette.com
3820
- */
3821
- try {
3822
- window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
3823
- version: "4.0.10",
3824
- buildTime: "01/14/2025 10:39 AM EST",
3825
- homepage: "https://github.com/aversini/ui-components",
3826
- license: "MIT"
3827
- });
3828
- } catch {
3829
- }
3830
- const ts = A.forwardRef(
3831
- ({
3832
- children: e,
3833
- disabled: t = !1,
3834
- mode: r = "system",
3835
- focusMode: a = "system",
3836
- fullWidth: n = !1,
3837
- className: o,
3838
- type: s = "button",
3839
- raw: c = !1,
3840
- noBorder: g = !1,
3841
- "aria-label": d,
3842
- label: f,
3843
- size: m = "medium",
3844
- labelRight: u,
3845
- labelLeft: h,
3846
- noBackground: p = !1,
3847
- align: y = "center",
3848
- active: v = !1,
3849
- radius: b = "large",
3850
- ..._
3851
- }, T) => {
3852
- const N = Pr({
3853
- type: St,
3854
- mode: r,
3855
- focusMode: a,
3856
- fullWidth: n,
3857
- disabled: t,
3858
- raw: c,
3859
- className: o,
3860
- noBorder: g,
3861
- size: m,
3862
- labelRight: u,
3863
- labelLeft: h,
3864
- noBackground: p,
3865
- align: y,
3866
- radius: b
3867
- }), k = l({
3868
- "text-copy-accent-dark": r === "light" && !c,
3869
- "text-copy-light": r === "dark" && !c,
3870
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !c,
3871
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !c
3872
- }), C = v ? l(
3873
- "relative",
3874
- "focus-within:static",
3875
- "focus-within:after:border-transparent",
3876
- "after:absolute",
3877
- "after:content-['']",
3878
- "after:border-b-2",
3879
- "after:bottom-[-4px]",
3880
- "after:left-0",
3881
- "after:right-0",
3882
- {
3883
- "after:border-table-dark": r === "dark",
3884
- "after:border-table-light": r === "light",
3885
- "after:border-table-dark dark:after:border-table-light": r === "system",
3886
- "after:border-table-light dark:after:border-table-dark": r === "alt-system"
3887
- }
3888
- ) : "";
3889
- return /* @__PURE__ */ i("div", { className: C, children: /* @__PURE__ */ x(
3890
- Ct,
3891
- {
3892
- ref: T,
3893
- className: N,
3894
- disabled: t,
3895
- type: s,
3896
- "aria-label": d || f,
3897
- ..._,
3898
- children: [
3899
- h && /* @__PURE__ */ i("span", { className: "pr-2", children: h }),
3900
- /* @__PURE__ */ i("div", { className: k, children: e }),
3901
- u && /* @__PURE__ */ i("span", { className: "pl-2", children: u })
3902
- ]
3903
- }
3904
- ) });
3905
- }
3906
- );
3907
- ts.displayName = "ButtonSort";
3908
- const rs = 200, as = ({
3909
- string: e,
3910
- idealLength: t = rs
3911
- }) => {
3912
- if (e.length <= t)
3913
- return { string: e, isTruncated: !1 };
3914
- if (e.charAt(t) === " ")
3915
- return { string: e.slice(0, t), isTruncated: !0 };
3916
- const r = e.slice(t).search(" ");
3917
- return {
3918
- string: e.slice(0, t + r),
3919
- isTruncated: !0
3920
- };
3921
- }, ns = ({
3922
- children: e,
3923
- length: t = 200,
3924
- mode: r = "system",
3925
- focusMode: a = "system"
3926
- }) => {
3927
- const [n, o] = q(!1);
3928
- if (typeof e != "string")
3929
- return e;
3930
- const { string: s, isTruncated: c } = as({
3931
- string: e,
3932
- idealLength: t
3933
- });
3934
- return /* @__PURE__ */ x("span", { style: { wordBreak: "break-word" }, children: [
3935
- n ? e : s,
3936
- c && /* @__PURE__ */ i(
3937
- Ur,
3938
- {
3939
- mode: r,
3940
- focusMode: a,
3941
- className: "ml-2",
3942
- size: "small",
3943
- onClick: (g) => {
3944
- g.preventDefault(), o(!n);
3945
- },
3946
- children: n ? "less..." : "more..."
3947
- }
3948
- )
3949
- ] });
3950
- };
3951
- /*!
3952
- @versini/ui-truncate v3.0.10
3953
- © 2025 gizmette.com
3954
- */
3955
- try {
3956
- window.__VERSINI_UI_TRUNCATE__ || (window.__VERSINI_UI_TRUNCATE__ = {
3957
- version: "3.0.10",
3958
- buildTime: "01/14/2025 10:39 AM EST",
3959
- homepage: "https://github.com/aversini/ui-components",
3960
- license: "MIT"
3961
- });
3962
- } catch {
3963
- }
3964
- const sr = gr(
3965
- () => import(
3966
- /* webpackChunkName: "LazyMessageAssistant" */
3967
- "./MessageAssistant.Dskbm0QC.js"
3968
- ).then((e) => e.MessageAssistant)
3969
- ), os = () => {
3970
- const { state: e } = z(se);
3971
- return /* @__PURE__ */ x("div", { className: "space-y-6 mt-2 @container", children: [
3972
- e && e.messages.length > 0 && e.messages.map((t, r) => {
3973
- const { role: a, content: n, name: o, processingTime: s } = t.message;
3974
- return (a === ve || a === pt) && n ? /* @__PURE__ */ i(tt, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(sr, { name: o, processingTime: s, children: n }) }, `${r}-${a}`) : a === Qe && n ? /* @__PURE__ */ i(
3975
- Wo,
3976
- {
3977
- kind: "right",
3978
- copyToClipboard: n,
3979
- copyToClipboardFocusMode: "light",
3980
- children: /* @__PURE__ */ i(ns, { mode: "light", focusMode: "light", children: n })
3981
- },
3982
- `${r}-${a}`
3983
- ) : null;
3984
- }),
3985
- aa(Qe, e) && /* @__PURE__ */ i(tt, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(sr, { loading: !0 }) })
3986
- ] });
3987
- }, ss = () => {
3988
- const { isAuthenticated: e } = Ee(), { ref: t, inViewport: r } = Ua(), a = na({
3989
- isAuthenticated: e,
3990
- extraClass: "rounded-b-md"
3991
- });
3992
- return /* @__PURE__ */ x(Le, { children: [
3993
- /* @__PURE__ */ x("div", { className: a, children: [
3994
- /* @__PURE__ */ i(oa, {}),
3995
- /* @__PURE__ */ i(os, {}),
3996
- /* @__PURE__ */ i("div", { ref: t })
3997
- ] }),
3998
- /* @__PURE__ */ i(To, { show: !r })
3999
- ] });
4000
- }, is = gr(
4001
- () => import(
4002
- /* webpackChunkName: "LazyHeader" */
4003
- "./HeaderToolbar.BeLs87sR.js"
4004
- )
4005
- );
4006
- function Fr({ isComponent: e = !1 }) {
4007
- const { user: t, getAccessToken: r } = Ee(), [a] = Gt({
4008
- key: Pt + ia,
4009
- initialValue: ""
4010
- }), [n] = Gt({
4011
- key: Pt + ca,
4012
- initialValue: be.ASC
4013
- }), [o, s] = He(vn, {
4014
- id: kt(),
4015
- model: ke,
4016
- engine: ke,
4017
- usage: 0,
4018
- messages: [],
4019
- prompts: [],
4020
- isComponent: e
4021
- }), [c, g] = He(kn, {
4022
- searchString: a,
4023
- sortedCell: "timestamp",
4024
- sortDirection: n
4025
- }), [d, f] = He(_n, {
4026
- prompt: "",
4027
- lastTriggeredTimestamp: 0
4028
- });
4029
- return oo({
4030
- keys: [
4031
- t == null ? void 0 : t.username,
4032
- c.searchString,
4033
- c.sortDirection,
4034
- 0
4035
- ],
4036
- getAccessToken: r
4037
- }), so({ getAccessToken: r }), ao({ keys: [t == null ? void 0 : t.username], getAccessToken: r }), D(() => {
4038
- var u;
4039
- (u = document.getElementById("logo")) == null || u.classList.add("fadeOut"), setTimeout(() => {
4040
- var h;
4041
- (h = document.getElementById("root")) == null || h.classList.replace("app-hidden", "fadeIn");
4042
- }, 500);
4043
- }), /* @__PURE__ */ i(se.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ i(
4044
- lo.Provider,
4045
- {
4046
- value: {
4047
- state: c,
4048
- dispatch: g
4049
- },
4050
- children: /* @__PURE__ */ x(
4051
- De.Provider,
4052
- {
4053
- value: { state: d, dispatch: f },
4054
- children: [
4055
- /* @__PURE__ */ i(
4056
- za,
4057
- {
4058
- noColors: !0,
4059
- noMargin: !0,
4060
- noPadding: !0,
4061
- noBorder: !0,
4062
- className: Vt({
4063
- extraClass: "mt-5"
4064
- }),
4065
- children: /* @__PURE__ */ i(tt, { fallback: /* @__PURE__ */ i("div", {}), children: /* @__PURE__ */ i(is, {}) })
4066
- }
4067
- ),
4068
- /* @__PURE__ */ i(
4069
- sa,
4070
- {
4071
- className: Vt({
4072
- extraClass: "max-h-[calc(100svh_-_250px)]"
4073
- }),
4074
- noMargin: !0,
4075
- noPadding: !0,
4076
- children: /* @__PURE__ */ i(ss, {})
4077
- }
4078
- ),
4079
- /* @__PURE__ */ i(xo, {})
4080
- ]
4081
- }
4082
- )
4083
- }
4084
- ) });
4085
- }
4086
- Fr.displayName = "App";
4087
- const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Fr }, Symbol.toStringTag, { value: "Module" }));
4088
- export {
4089
- xs as App,
4090
- se as AppContext,
4091
- Gt as E,
4092
- lo as HistoryContext,
4093
- Es as P,
4094
- Ie as R,
4095
- xe as SERVICE_TYPES,
4096
- fs as be,
4097
- be as f,
4098
- gs as ge,
4099
- hs as he,
4100
- ja as i,
4101
- Ft as i$1,
4102
- hn as ie,
4103
- Wo as le,
4104
- ps as me,
4105
- Tt as me$1,
4106
- Ut as p,
4107
- Rr as serviceCall,
4108
- bs as ue,
4109
- ks as useChatsHistory,
4110
- _s as useServerCapabilities,
4111
- vs as useUserChatStats,
4112
- Lr as useUserPreferences,
4113
- ys as ye
4114
- };