@versini/sassysaint 8.40.2 → 8.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsx as Tp } from "react/jsx-runtime";
2
- import { getDefaultExportFromCjs as ln } from "./App.CXZi-n86.js";
2
+ import { getDefaultExportFromCjs as ln } from "./App.BmLoQVGE.js";
3
3
  import Ap, { useState as Cp, useEffect as Pp } from "react";
4
- import { TRIMESTERS as rn, TRIMESTERS_SHORT as Op, isProbablyMobile as Lp } from "./index.DPutGpC0.js";
4
+ import { TRIMESTERS as rn, TRIMESTERS_SHORT as Op, isProbablyMobile as Lp } from "./index.CFV5SN1z.js";
5
5
  var ls = { exports: {} }, Ep = ls.exports, on;
6
6
  function Ip() {
7
7
  return on || (on = 1, (function(ve, ne) {
@@ -0,0 +1,75 @@
1
+ import { jsx as T } from "react/jsx-runtime";
2
+ import { n as F, convertCamelCaseToReadable as O, numberFormatter as P, pluralize as R, re as v } from "./index.CFV5SN1z.js";
3
+ import { ChatContext as y, useUserPreferences as G, Me as L, Oe as A } from "./App.BmLoQVGE.js";
4
+ import E from "clsx";
5
+ import D, { useState as x, useRef as S, useEffect as U, useContext as _ } from "react";
6
+ import { useMarkdown as j } from "./useMarkdown.D0g7JEnd.js";
7
+ const q = 2, I = q * 1e3, b = "", W = (e) => e * (2 - e);
8
+ function $(e, n = !0) {
9
+ const [a, p] = x(0), [i, C] = x(0), [t, h] = x(e), r = S(0), s = S(0);
10
+ return t !== e && (h(e), C(e.startsWith(t) ? a : 0)), U(() => {
11
+ if (!n)
12
+ return;
13
+ const u = e.split(b).length, o = (c) => {
14
+ s.current || (s.current = c);
15
+ const l = c - s.current, m = Math.min(l / I, 1), g = W(m), M = i + (u - i) * g;
16
+ p(Math.floor(M)), m < 1 && (r.current = requestAnimationFrame(o));
17
+ };
18
+ return s.current = 0, r.current = requestAnimationFrame(o), () => {
19
+ r.current && cancelAnimationFrame(r.current);
20
+ };
21
+ }, [i, e, n]), n ? e.split(b).slice(0, a).join(b) : e;
22
+ }
23
+ const d = {
24
+ MODEL: "Model",
25
+ PLUGIN: "Plugin",
26
+ USAGE: "Session usage"
27
+ }, k = E("max-w-[99cqw] mt-3"), w = E("max-w-xs", "sm:max-w-3xl", "prose-li:ps-3"), J = D.memo(
28
+ ({
29
+ content: e,
30
+ annotations: n,
31
+ toolName: a,
32
+ role: p,
33
+ smooth: i = !1,
34
+ isLastAssistantMessage: C = !1
35
+ }) => {
36
+ const t = $(e, i), {
37
+ state: { streaming: h, restoredModel: r, tokenUsage: s }
38
+ } = _(y), u = n?.model || r, o = s, [c, l] = j(), { user: m, getAccessToken: g } = F(), { data: M } = G({
39
+ user: m?.username,
40
+ getAccessToken: g
41
+ }), N = M?.showDetails || !1;
42
+ let f;
43
+ return N && (f = {
44
+ [d.MODEL]: u || null,
45
+ [d.PLUGIN]: a ? O(a) : null
46
+ }, o && (C ? f[d.USAGE] = `${P.format(o)} ${R("token", o)}` : f[d.USAGE] = L)), U(() => {
47
+ t && l(t);
48
+ }, [t, l]), p === v ? /* @__PURE__ */ T(
49
+ A,
50
+ {
51
+ tail: !0,
52
+ className: k,
53
+ contentClassName: w,
54
+ noMaxWidth: !0,
55
+ children: /* @__PURE__ */ T("div", { className: "flex items-center justify-center italic text-copy-error-dark dark:text-red-300", children: c })
56
+ }
57
+ ) : /* @__PURE__ */ T(
58
+ A,
59
+ {
60
+ tail: !0,
61
+ copyToClipboardMode: "dark",
62
+ copyToClipboardFocusMode: "light",
63
+ copyToClipboard: h ? "loading..." : e,
64
+ footer: f,
65
+ className: k,
66
+ contentClassName: w,
67
+ noMaxWidth: !0,
68
+ children: c
69
+ }
70
+ );
71
+ }
72
+ );
73
+ export {
74
+ J as default
75
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as h, jsx as e, Fragment as ne } from "react/jsx-runtime";
2
- import { I as z, ue$1 as A, Ae as M, INFINITE_SCROLL_THRESHOLD as F, CARDS as ce, pluralize as ie, ue as I, numberFormatter as le, de, isProbablyMobile as me, E as he, a as ue, i as Ce, n as Y, INFINITE_SCROLL_LIMIT as U, LOCAL_STORAGE_PREFIX as v, LOCAL_STORAGE_SORT_TIMESTAMP as pe, LOCAL_STORAGE_SORT_TOKEN_USAGE as Se, LOCAL_STORAGE_SORT as Te, APP_CLASSNAME as ge, ACTION_SORT as Ee, TOAST_CHAT_DELETED as xe, TOAST_PROVIDER_CHANGED as fe, LOCAL_STORAGE_SEARCH as ye, HISTORY_TITLE as Ae, pe$1 as De, debounce as Oe, ACTION_SEARCH as Re } from "./index.DPutGpC0.js";
3
- import { De as Ne, He as ve, qe as k, Ge as we, Fe as Me, Pe as p, Ye as V, st as $, a as _e, p as ke, p$1 as Ie, HistoryContext as K, ChatContext as W, useAiChat as be, E as w, E$1 as y, useUserPreferences as Le, ConfirmationPanel as ze, LazyToastContainerWrapper as He, mutateCall as B, SERVICE_TYPES as G, showErrorToast as Pe, setNewProvider as Ue, CHAT_SET_PROVIDER as Ve, showSuccessToast as $e, CHAT_SET_STATUS as Be, useChatsHistory as Ge, tt as Fe, a$1 as Ye } from "./App.CXZi-n86.js";
2
+ import { I as z, ue$1 as A, Ae as M, INFINITE_SCROLL_THRESHOLD as F, CARDS as ce, pluralize as ie, ue as I, numberFormatter as le, de, isProbablyMobile as me, E as he, a as ue, i as pe, n as Y, INFINITE_SCROLL_LIMIT as U, LOCAL_STORAGE_PREFIX as v, LOCAL_STORAGE_SORT_TIMESTAMP as Ce, LOCAL_STORAGE_SORT_TOKEN_USAGE as Se, LOCAL_STORAGE_SORT as Te, APP_CLASSNAME as ge, ACTION_SORT as Ee, TOAST_CHAT_DELETED as xe, TOAST_PROVIDER_CHANGED as fe, LOCAL_STORAGE_SEARCH as ye, HISTORY_TITLE as Ae, pe$1 as De, debounce as Oe, ACTION_SEARCH as Re } from "./index.CFV5SN1z.js";
3
+ import { De as Ne, He as ve, qe as k, Ge as we, Fe as Me, Pe as C, Ye as $, st as V, a as _e, p$1 as ke, p$2 as Ie, HistoryContext as K, ChatContext as W, useAiChat as be, E as w, E$1 as y, useUserPreferences as Le, ConfirmationPanel as ze, LazyToastContainerWrapper as He, mutateCall as B, SERVICE_TYPES as G, showErrorToast as Pe, setNewProvider as Ue, CHAT_SET_PROVIDER as $e, showSuccessToast as Ve, CHAT_SET_STATUS as Be, useChatsHistory as Ge, tt as Fe, a$1 as Ye } from "./App.BmLoQVGE.js";
4
4
  import { Fragment as Ke, useRef as b, useState as L, useContext as _, useCallback as We, useEffect as j } from "react";
5
5
  const je = ({
6
6
  className: c,
@@ -81,7 +81,7 @@ const je = ({
81
81
  ]
82
82
  }
83
83
  ), Je = {
84
- [Ce]: Ie,
84
+ [pe]: Ie,
85
85
  [ue]: ke,
86
86
  [he]: _e
87
87
  }, r = {
@@ -115,10 +115,10 @@ const je = ({
115
115
  const l = me() ? Qe : Ze, D = (t) => {
116
116
  switch (t) {
117
117
  case r.ROW:
118
- return /* @__PURE__ */ e(p, { className: "sr-only", children: "Row" }, t);
118
+ return /* @__PURE__ */ e(C, { className: "sr-only", children: "Row" }, t);
119
119
  case r.TIMESTAMP:
120
120
  return /* @__PURE__ */ e(
121
- V,
121
+ $,
122
122
  {
123
123
  buttonClassName: "text-xs sm:text-sm",
124
124
  cellId: A,
@@ -133,12 +133,12 @@ const je = ({
133
133
  t
134
134
  );
135
135
  case r.SUMMARY:
136
- return /* @__PURE__ */ e(p, { className: "text-xs sm:text-sm", children: "Summary" }, t);
136
+ return /* @__PURE__ */ e(C, { className: "text-xs sm:text-sm", children: "Summary" }, t);
137
137
  case r.PROVIDER:
138
- return /* @__PURE__ */ e(p, { className: "text-xs sm:text-sm", children: "Provider" }, t);
138
+ return /* @__PURE__ */ e(C, { className: "text-xs sm:text-sm", children: "Provider" }, t);
139
139
  case r.TOKEN_USAGE:
140
140
  return /* @__PURE__ */ e(
141
- V,
141
+ $,
142
142
  {
143
143
  buttonClassName: "text-xs sm:text-sm",
144
144
  cellId: M,
@@ -153,17 +153,17 @@ const je = ({
153
153
  t
154
154
  );
155
155
  case r.ACTIONS:
156
- return /* @__PURE__ */ e(p, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
156
+ return /* @__PURE__ */ e(C, { className: "text-xs sm:text-sm text-right", children: "Actions" }, t);
157
157
  default:
158
158
  return null;
159
159
  }
160
160
  }, f = (t, s, T) => {
161
161
  switch (t) {
162
162
  case r.ROW:
163
- return /* @__PURE__ */ e(p, { children: T + 1 }, t);
163
+ return /* @__PURE__ */ e(C, { children: T + 1 }, t);
164
164
  case r.TIMESTAMP:
165
165
  return /* @__PURE__ */ e(
166
- p,
166
+ C,
167
167
  {
168
168
  component: "th",
169
169
  scope: "row",
@@ -175,7 +175,7 @@ const je = ({
175
175
  case r.SUMMARY: {
176
176
  const S = s.summary || (s.messages.length > 0 ? s.messages[0]?.content : "");
177
177
  return /* @__PURE__ */ e(
178
- p,
178
+ C,
179
179
  {
180
180
  className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
181
181
  style: {
@@ -189,7 +189,7 @@ const je = ({
189
189
  case r.PROVIDER: {
190
190
  const S = s.model ? de(s.model) : null, O = S ? Je[S] : null;
191
191
  return /* @__PURE__ */ e(
192
- p,
192
+ C,
193
193
  {
194
194
  component: "th",
195
195
  scope: "row",
@@ -209,7 +209,7 @@ const je = ({
209
209
  }
210
210
  case r.TOKEN_USAGE:
211
211
  return /* @__PURE__ */ e(
212
- p,
212
+ C,
213
213
  {
214
214
  className: "text-gray-400 text-xs sm:text-sm",
215
215
  align: "right",
@@ -218,9 +218,9 @@ const je = ({
218
218
  t
219
219
  );
220
220
  case r.ACTIONS:
221
- return /* @__PURE__ */ e(p, { children: /* @__PURE__ */ h("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
221
+ return /* @__PURE__ */ e(C, { children: /* @__PURE__ */ h("div", { className: "flex flex-col items-end sm:flex-row gap-2", children: [
222
222
  /* @__PURE__ */ e(
223
- $,
223
+ V,
224
224
  {
225
225
  label: "Restore chat",
226
226
  mode: "alt-system",
@@ -242,7 +242,7 @@ const je = ({
242
242
  }
243
243
  ),
244
244
  /* @__PURE__ */ e(
245
- $,
245
+ V,
246
246
  {
247
247
  label: "Delete chat",
248
248
  mode: "alt-system",
@@ -276,7 +276,7 @@ const je = ({
276
276
  (T) => f(T, t, s)
277
277
  ) })
278
278
  ] }, `${ce.HISTORY.TITLE}-${t.id}-${s}`) : null) }),
279
- /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(p, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: ie(
279
+ /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(C, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: ie(
280
280
  `${c.length} chat`,
281
281
  c.length
282
282
  ) }) }) }) })
@@ -302,7 +302,7 @@ const je = ({
302
302
  setChatId: g,
303
303
  setInitialMessages: q
304
304
  } = _(W), { setInput: X } = be(), [H, P] = w({
305
- key: v + pe,
305
+ key: v + Ce,
306
306
  initialValue: y.DESC
307
307
  }), [J, Q] = w({
308
308
  key: v + Se,
@@ -314,17 +314,17 @@ const je = ({
314
314
  user: i?.username,
315
315
  getAccessToken: E
316
316
  }), te = (a) => {
317
- const C = s.sortedCell === a;
317
+ const p = s.sortedCell === a;
318
318
  let n, R;
319
319
  switch (a) {
320
320
  case A:
321
- R = P, n = C ? s.sortDirection : H;
321
+ R = P, n = p ? s.sortDirection : H;
322
322
  break;
323
323
  case M:
324
- R = Q, n = C ? s.sortDirection : J;
324
+ R = Q, n = p ? s.sortDirection : J;
325
325
  break;
326
326
  default:
327
- R = P, n = C ? s.sortDirection : H;
327
+ R = P, n = p ? s.sortDirection : H;
328
328
  break;
329
329
  }
330
330
  let N;
@@ -361,8 +361,8 @@ const je = ({
361
361
  }
362
362
  }, re = async (a) => {
363
363
  try {
364
- const C = await E(), n = await B({
365
- accessToken: C,
364
+ const p = await E(), n = await B({
365
+ accessToken: p,
366
366
  type: G.GET_CHAT,
367
367
  params: {
368
368
  id: a.id
@@ -370,14 +370,14 @@ const je = ({
370
370
  });
371
371
  n.status === 200 && (n.data.provider !== O && (await Ue({
372
372
  provider: n.data.provider,
373
- accessToken: C,
373
+ accessToken: p,
374
374
  username: i?.username || ""
375
375
  }), o({
376
- type: Ve,
376
+ type: $e,
377
377
  payload: {
378
378
  provider: n.data.provider
379
379
  }
380
- }), ee(), await $e(
380
+ }), ee(), await Ve(
381
381
  `${fe} ${n.data.provider}`,
382
382
  {
383
383
  containerId: "toggle-provider"
@@ -405,8 +405,8 @@ const je = ({
405
405
  const a = {
406
406
  // root: null,
407
407
  rootMargin: "20px"
408
- }, C = new IntersectionObserver(oe, a);
409
- x.current && C.observe(x.current);
408
+ }, p = new IntersectionObserver(oe, a);
409
+ x.current && p.observe(x.current);
410
410
  }), /* @__PURE__ */ h(ne, { children: [
411
411
  /* @__PURE__ */ h(
412
412
  ze,
@@ -1,4 +1,4 @@
1
- import { createContext as xe, createSignal as z, onMount as Dt, createEffect as B, createMemo as q, createComponent as m, Portal as qo, memo as me, Show as R, template as _, insert as k, createRenderEffect as N, className as A, clearDelegatedEvents as bs, delegateEvents as ir, useContext as we, onCleanup as U, sortFns as Hn, mutationSortFns as Vn, on as ct, setAttribute as D, getSidedProp as xs, use as Dn, batch as ws, getQueryStatusLabel as Ot, getMutationStatusColor as Rt, getQueryStatusColor as $s, getQueryStatusColorByLabel as Cs, displayValue as xn, For as Ss, convertRemToPixels as Kr, untrack as Kt, useTransition as ks, spread as Es, mergeProps as j, createRoot as Br, serialize as Ms, Index as Ds, updateNestedDataByPath as sr, addEventListener as As, stringify as Ts, Match as zn, Switch as Fs, deleteNestedDataByPath as Is, createUniqueId as Be, splitProps as X, Dynamic as Ps, createComputed as Ls, getPreferredColorScheme as Os } from "./index.DPutGpC0.js";
1
+ import { createContext as xe, createSignal as z, onMount as Dt, createEffect as B, createMemo as q, createComponent as m, Portal as qo, memo as me, Show as R, template as _, insert as k, createRenderEffect as N, className as A, clearDelegatedEvents as bs, delegateEvents as ir, useContext as we, onCleanup as U, sortFns as Hn, mutationSortFns as Vn, on as ct, setAttribute as D, getSidedProp as xs, use as Dn, batch as ws, getQueryStatusLabel as Ot, getMutationStatusColor as Rt, getQueryStatusColor as $s, getQueryStatusColorByLabel as Cs, displayValue as xn, For as Ss, convertRemToPixels as Kr, untrack as Kt, useTransition as ks, spread as Es, mergeProps as j, createRoot as Br, serialize as Ms, Index as Ds, updateNestedDataByPath as sr, addEventListener as As, stringify as Ts, Match as zn, Switch as Fs, deleteNestedDataByPath as Is, createUniqueId as Be, splitProps as X, Dynamic as Ps, createComputed as Ls, getPreferredColorScheme as Os } from "./index.CFV5SN1z.js";
2
2
  var qs = (e) => e != null, _s = (e) => e.filter(qs);
3
3
  function Rs(e) {
4
4
  return (...t) => {
@@ -1,6 +1,6 @@
1
1
  import { jsxs as t, Fragment as m, jsx as e } from "react/jsx-runtime";
2
- import { i as h, nt as S, tt as R } from "./App.CXZi-n86.js";
3
- import { n as u, S as a, renderDataAsList as N, CARDS as r, isTauri as P, ue as T, l as E, L as p, j as l, PROFILE_TITLE as C } from "./index.DPutGpC0.js";
2
+ import { i as h, nt as S, tt as R } from "./App.BmLoQVGE.js";
3
+ import { n as u, S as a, renderDataAsList as N, CARDS as r, isTauri as P, ue as T, l as E, L as p, j as l, PROFILE_TITLE as C } from "./index.CFV5SN1z.js";
4
4
  const A = () => {
5
5
  const { isAuthenticated: n, user: i, registeringForPasskey: o, authenticationType: c } = u(), d = h(), s = i?.username || "";
6
6
  return n && s ? /* @__PURE__ */ t(m, { children: [