@versini/sassysaint 5.5.9 → 5.5.11

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