@versini/sassysaint 5.3.7 → 5.3.9

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