@versini/sassysaint 5.5.3 → 5.5.5

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