@versini/sassysaint 8.110.0 → 8.110.2

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.
Files changed (88) hide show
  1. package/dist/chunks/{AboutChangelog.BfOWMaYg.js → AboutChangelog.DEj7-6K6.js} +2 -2
  2. package/dist/chunks/AboutEntry.BSWdup9R.js +77 -0
  3. package/dist/chunks/{App.BD0e8HgV.js → App.Hqmg5y2Y.js} +2435 -2452
  4. package/dist/chunks/{Bubble.fxUgvZMG.js → Bubble.DJc-QO-3.js} +1 -1
  5. package/dist/chunks/ButtonIconDelete.D4aZDe7F.js +335 -0
  6. package/dist/chunks/{Chart.C-EqsPgy.js → Chart.CPv5Bfk9.js} +2 -2
  7. package/dist/chunks/{ChatBubbleAssistant.hM8owVIk.js → ChatBubbleAssistant.DqUdvWwl.js} +4 -4
  8. package/dist/chunks/{ChatBubbleUser.CnsuEhxO.js → ChatBubbleUser.Cs4LFprm.js} +3 -3
  9. package/dist/chunks/{ChatHistoryTable.WRplbgo4.js → ChatHistoryTable.CkVMdj9x.js} +73 -73
  10. package/dist/chunks/{HistoryEntry.BgO_PD7Q.js → HistoryEntry.DM331KtZ.js} +72 -80
  11. package/dist/chunks/LoginEntry.Cvod0kbl.js +118 -0
  12. package/dist/chunks/{LogoEntry.CucXks5G.js → LogoEntry.DohsYXa0.js} +642 -746
  13. package/dist/chunks/MemoriesEntry.DJEsuqmV.js +649 -0
  14. package/dist/chunks/ProfileEntry.DHOE716m.js +205 -0
  15. package/dist/chunks/{SettingsEntry.ByPtC4lj.js → SettingsEntry.6_BWb1qD.js} +114 -122
  16. package/dist/chunks/UsageEntry.CtQKtTac.js +230 -0
  17. package/dist/chunks/{_baseUniq.DJhemj5B.js → _baseUniq.DdHdSR90.js} +1 -1
  18. package/dist/chunks/{arc.ClK0mYh2.js → arc.D4_xOXXj.js} +1 -1
  19. package/dist/chunks/{architecture-U656AL7Q.DGORleeb.js → architecture-U656AL7Q.s3rGBRgV.js} +1 -1
  20. package/dist/chunks/{architectureDiagram-VXUJARFQ.HR_eet_T.js → architectureDiagram-VXUJARFQ.CdCO91E5.js} +4 -4
  21. package/dist/chunks/{blockDiagram-VD42YOAC.CWrnXf_B.js → blockDiagram-VD42YOAC.CCDa9IbF.js} +5 -5
  22. package/dist/chunks/{browser.5ieI9QUP.js → browser.G7msF8GI.js} +1 -1
  23. package/dist/chunks/{c4Diagram-YG6GDRKO.CaA0SaMc.js → c4Diagram-YG6GDRKO.BYwrdrnm.js} +2 -2
  24. package/dist/chunks/{channel.BI8KZVUl.js → channel.Bhd_WAGN.js} +1 -1
  25. package/dist/chunks/{chunk-4BX2VUAB.CTzK9jPw.js → chunk-4BX2VUAB.CAsx7lRR.js} +1 -1
  26. package/dist/chunks/{chunk-55IACEB6.DMb8Reca.js → chunk-55IACEB6.ChwKLiO_.js} +1 -1
  27. package/dist/chunks/{chunk-B4BG7PRW.BHBa3N2V.js → chunk-B4BG7PRW.0XXdIUvB.js} +4 -4
  28. package/dist/chunks/{chunk-DI55MBZ5.Bqwg_jpX.js → chunk-DI55MBZ5.PoYuLfqT.js} +3 -3
  29. package/dist/chunks/{chunk-FMBD7UC4.p8OpoFJE.js → chunk-FMBD7UC4.ClQPaEEe.js} +1 -1
  30. package/dist/chunks/{chunk-QN33PNHL._xYLGQNv.js → chunk-QN33PNHL.BNHDFW8q.js} +1 -1
  31. package/dist/chunks/{chunk-QZHKN3VN.Bt1FHb64.js → chunk-QZHKN3VN.YjxD8GE7.js} +1 -1
  32. package/dist/chunks/{chunk-TZMSLE5B.hFsU0iJf.js → chunk-TZMSLE5B.CTNar1je.js} +1 -1
  33. package/dist/chunks/{classDiagram-2ON5EDUG.DiSJfiEu.js → classDiagram-2ON5EDUG.Ccr_Z8SZ.js} +2 -2
  34. package/dist/chunks/{classDiagram-v2-WZHVMYZB.DiSJfiEu.js → classDiagram-v2-WZHVMYZB.Ccr_Z8SZ.js} +2 -2
  35. package/dist/chunks/{clone.NcwizCyH.js → clone.BX8gciZV.js} +1 -1
  36. package/dist/chunks/{cose-bilkent-S5V4N54A.DogEbzcD.js → cose-bilkent-S5V4N54A.CJs1QiYn.js} +2 -2
  37. package/dist/chunks/{dagre-6UL2VRFP.Cy_GltZx.js → dagre-6UL2VRFP.DL9dVBGy.js} +5 -5
  38. package/dist/chunks/{diagram-PSM6KHXK.CazeYJ2F.js → diagram-PSM6KHXK.BlxCy0Sy.js} +4 -4
  39. package/dist/chunks/{diagram-QEK2KX5R.ByhZHDpm.js → diagram-QEK2KX5R.BWDu5W6C.js} +3 -3
  40. package/dist/chunks/{diagram-S2PKOQOG.D49-fpQd.js → diagram-S2PKOQOG.Ri3EElHD.js} +3 -3
  41. package/dist/chunks/{erDiagram-Q2GNP2WA.nce3gDBb.js → erDiagram-Q2GNP2WA.DEiFjTBB.js} +4 -4
  42. package/dist/chunks/{flowDiagram-NV44I4VS.DDUGMSKf.js → flowDiagram-NV44I4VS.BW00PHx7.js} +5 -5
  43. package/dist/chunks/{ganttDiagram-JELNMOA3.NGXzLkaH.js → ganttDiagram-JELNMOA3.ema0-IHx.js} +2 -2
  44. package/dist/chunks/{gitGraph-F6HP7TQM.BzKXexyv.js → gitGraph-F6HP7TQM.D7K-i_h_.js} +1 -1
  45. package/dist/chunks/{gitGraphDiagram-NY62KEGX.C3cn9f8o.js → gitGraphDiagram-NY62KEGX.D4HvM8U6.js} +4 -4
  46. package/dist/chunks/{graph.CURTRirk.js → graph.WmSD_kIW.js} +2 -2
  47. package/dist/chunks/{index.DAuo-OH1.js → index.5YcMrbtG.js} +1 -1
  48. package/dist/chunks/{index.BYDZbdMZ.js → index.BDdSIqNw.js} +1 -1
  49. package/dist/chunks/{index.CBEv2y_C.js → index.BRIbdI1P.js} +2 -2
  50. package/dist/chunks/{index.BinkIORG.js → index.CUKXvrUy.js} +1 -1
  51. package/dist/chunks/{index.gy41K1EE.js → index.CspNN5N2.js} +3 -3
  52. package/dist/chunks/{index.uUNtrS04.js → index.Damzobcg.js} +3 -3
  53. package/dist/chunks/{index.BqIARWUR.js → index.HEruAaRk.js} +1 -1
  54. package/dist/chunks/{index.CkajM1v0.js → index.OMR8Uuyn.js} +1 -1
  55. package/dist/chunks/{index.CURM9PiU.js → index.fRQVHuxk.js} +1 -1
  56. package/dist/chunks/{info-NVLQJR56.CHnZmbT7.js → info-NVLQJR56.jYI0Duob.js} +1 -1
  57. package/dist/chunks/{infoDiagram-WHAUD3N6.DCZfKYU8.js → infoDiagram-WHAUD3N6.BqOPFyGl.js} +2 -2
  58. package/dist/chunks/{journeyDiagram-XKPGCS4Q.B-0JNmK_.js → journeyDiagram-XKPGCS4Q.B1bd5wZT.js} +4 -4
  59. package/dist/chunks/{kanban-definition-3W4ZIXB7.C7aI8iBJ.js → kanban-definition-3W4ZIXB7.CXydmjo0.js} +2 -2
  60. package/dist/chunks/{layout.Bmgsrc8X.js → layout.D0fWXkiy.js} +4 -4
  61. package/dist/chunks/{mermaid-parser.core.BZIZyjyF.js → mermaid-parser.core.7OYqXvcF.js} +10 -10
  62. package/dist/chunks/{min.CtR4qhyM.js → min.DULzPnFA.js} +2 -2
  63. package/dist/chunks/{mindmap-definition-VGOIOE7T.DCsxzuhI.js → mindmap-definition-VGOIOE7T.BUC8Tuhp.js} +3 -3
  64. package/dist/chunks/{packet-BFZMPI3H.CQ2Sbdms.js → packet-BFZMPI3H.D_-dNPlf.js} +1 -1
  65. package/dist/chunks/{pie-7BOR55EZ.BYs1omMd.js → pie-7BOR55EZ.C5wUCEk_.js} +1 -1
  66. package/dist/chunks/{pieDiagram-ADFJNKIX.DqkDHdMo.js → pieDiagram-ADFJNKIX.DOCTIr8o.js} +4 -4
  67. package/dist/chunks/{quadrantDiagram-AYHSOK5B.Cx-eq1uu.js → quadrantDiagram-AYHSOK5B.DbasmgIr.js} +1 -1
  68. package/dist/chunks/{radar-NHE76QYJ.CIqwL1Hw.js → radar-NHE76QYJ.D-zD079S.js} +1 -1
  69. package/dist/chunks/{rehype-mermaid.LJaY9ylI.js → rehype-mermaid.C6-wTJWi.js} +33 -33
  70. package/dist/chunks/{requirementDiagram-UZGBJVZJ.C-YKp79x.js → requirementDiagram-UZGBJVZJ.CnuUJN5O.js} +3 -3
  71. package/dist/chunks/{sankeyDiagram-TZEHDZUN.BbfUzvVS.js → sankeyDiagram-TZEHDZUN.R_1cgZZg.js} +1 -1
  72. package/dist/chunks/{sequenceDiagram-WL72ISMW.D5wDvZwT.js → sequenceDiagram-WL72ISMW.sCa2kzuv.js} +3 -3
  73. package/dist/chunks/{stateDiagram-FKZM4ZOC.-65PQCxm.js → stateDiagram-FKZM4ZOC.DczjcrsN.js} +4 -4
  74. package/dist/chunks/{stateDiagram-v2-4FDKWEC3.BXy_3BUS.js → stateDiagram-v2-4FDKWEC3.DwOAdSSj.js} +2 -2
  75. package/dist/chunks/{timeline-definition-IT6M3QCI.B2tmtGDZ.js → timeline-definition-IT6M3QCI.Qx0o1egT.js} +2 -2
  76. package/dist/chunks/{treemap-KMMF4GRG.Dm_alnmO.js → treemap-KMMF4GRG.CwfQGJx8.js} +1 -1
  77. package/dist/chunks/{useMarkdown.BWJCktGN.js → useMarkdown.CZvYSQuE.js} +8 -8
  78. package/dist/chunks/{xychartDiagram-PRI3JC2R.XQCHu3eO.js → xychartDiagram-PRI3JC2R.CFOiW2rk.js} +1 -1
  79. package/dist/components/SassySaint/SassySaint.js +1 -1
  80. package/dist/index.js +3 -3
  81. package/dist/style.css +1 -1
  82. package/package.json +4 -4
  83. package/dist/chunks/AboutEntry.B7fBRGac.js +0 -85
  84. package/dist/chunks/ButtonIconDelete.Bw7zU6Rb.js +0 -456
  85. package/dist/chunks/LoginEntry.DvDNWT7T.js +0 -118
  86. package/dist/chunks/MemoriesEntry.OQ1K4KNa.js +0 -743
  87. package/dist/chunks/ProfileEntry.CbZLIK8x.js +0 -213
  88. package/dist/chunks/UsageEntry.CSkPteMr.js +0 -238
@@ -1,213 +0,0 @@
1
- import { jsxs as t, jsx as e, Fragment as U } from "react/jsx-runtime";
2
- import { preloadToast as j, showSuccessToast as D, showErrorToast as H, LazyToastContainerWrapper as K, ConfirmationPanel as O, Panel as W, ButtonCancel as Y } from "./App.BD0e8HgV.js";
3
- import { useUniqueId as $, CARDS as a, L as N, j as l, Button as q, ButtonIcon as V, IconPasskey as x, PROFILE_TITLE as J } from "./LogoEntry.CucXks5G.js";
4
- import { useState as m, useMemo as Q, useCallback as I, useRef as X } from "react";
5
- import { n as Z, useUserPreferences as ee, useServerCapabilities as ne, p as re, setUserPlan as se, renderDataAsList as ae, st as te, isTauri as ie } from "./index.CBEv2y_C.js";
6
- import { Card as C } from "./index.BYDZbdMZ.js";
7
- import le from "clsx";
8
- const oe = ({
9
- requestConfirmation: h
10
- }) => {
11
- const {
12
- isAuthenticated: u,
13
- user: r,
14
- registeringForPasskey: T,
15
- authenticationType: p,
16
- getAccessToken: i
17
- } = Z(), [f, E] = m(null), [o, w] = m(!1), g = $(), S = r?.username || "", {
18
- data: c,
19
- isSuccess: z,
20
- refetch: k
21
- } = ee({
22
- user: r?.username,
23
- getAccessToken: i
24
- }), { data: A, isSuccess: R } = ne(), L = Q(() => !R || !A?.plans ? [] : A.plans.map((n) => ({
25
- id: n.name,
26
- label: n.label,
27
- description: n.description,
28
- features: n.features,
29
- models: n.allowedModels.map(
30
- (s) => re[s] || s
31
- )
32
- })), [R, A?.plans]), b = I(() => {
33
- o || (j(), w(!0));
34
- }, [o]), y = I(
35
- async (n, s) => {
36
- if (r?.username)
37
- try {
38
- E(n), await se({
39
- plan: n,
40
- accessToken: await i(),
41
- username: r.username
42
- }), await k(), await D(`${a.PLANS.SWITCH_SUCCESS} ${s}`, {
43
- containerId: "profile-plan-selection"
44
- });
45
- } catch {
46
- await H(a.PLANS.SWITCH_ERROR, {
47
- containerId: "profile-plan-selection"
48
- });
49
- } finally {
50
- E(null);
51
- }
52
- },
53
- [i, k, r?.username]
54
- ), B = I(
55
- (n, s) => {
56
- !r?.username || n === c?.plan || h(
57
- () => y(n, s),
58
- /* @__PURE__ */ t("p", { className: "m-0", children: [
59
- "Are you sure you want to switch to the following plan:",
60
- " ",
61
- /* @__PURE__ */ e("span", { className: "font-semibold", children: s })
62
- ] })
63
- );
64
- },
65
- [
66
- y,
67
- c?.plan,
68
- h,
69
- r?.username
70
- ]
71
- );
72
- return u && S ? /* @__PURE__ */ t(U, { children: [
73
- /* @__PURE__ */ e("div", { className: "av-sassy", children: /* @__PURE__ */ e(K, { containerId: "profile-plan-selection" }) }),
74
- /* @__PURE__ */ e(
75
- C,
76
- {
77
- header: a.PREFERENCES.TITLE,
78
- className: "prose-dark dark:prose-lighter",
79
- noBorder: !0,
80
- children: ae(g, {
81
- [a.PREFERENCES.USERNAME]: S,
82
- [a.PREFERENCES.EMAIL]: r?.email || ""
83
- })
84
- }
85
- ),
86
- z && R && L.length > 0 && /* @__PURE__ */ t(
87
- C,
88
- {
89
- header: a.PLANS.TITLE,
90
- className: "prose-dark dark:prose-lighter mt-4",
91
- noBorder: !0,
92
- children: [
93
- /* @__PURE__ */ e("p", { className: "text-sm", children: a.PLANS.DESCRIPTION }),
94
- /* @__PURE__ */ e(N, { columnGap: 3, rowGap: 3, className: "mt-4", children: L.map(({ id: n, label: s, description: F, features: _, models: G }) => {
95
- const P = c?.plan === n, M = P ? a.PLANS.ACTIVE_BADGE : `Get ${s}`, v = f === n;
96
- return /* @__PURE__ */ e(l, { span: { fallback: 12, md: 4 }, children: /* @__PURE__ */ e(C, { mode: "darker", className: "prose-lighter h-full", children: /* @__PURE__ */ t(N, { direction: "column", children: [
97
- /* @__PURE__ */ t(l, { children: [
98
- /* @__PURE__ */ e("div", { className: "flex items-start justify-between gap-2", children: /* @__PURE__ */ t("div", { children: [
99
- /* @__PURE__ */ e(
100
- "h3",
101
- {
102
- className: le("m-0", {
103
- "text-emerald-400": P
104
- }),
105
- children: s
106
- }
107
- ),
108
- /* @__PURE__ */ e("p", { className: "mb-0 text-sm opacity-80", children: F })
109
- ] }) }),
110
- /* @__PURE__ */ e("h4", { children: "Features" }),
111
- /* @__PURE__ */ e("ul", { className: "prose-li:text-sm", children: _.map((d) => /* @__PURE__ */ e("li", { children: d }, d)) }),
112
- /* @__PURE__ */ e("h4", { children: "Models" }),
113
- /* @__PURE__ */ e("ul", { className: "prose-li:text-sm", children: G.map((d) => /* @__PURE__ */ e("li", { children: d }, d)) })
114
- ] }),
115
- /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(
116
- q,
117
- {
118
- mode: "dark",
119
- size: "small",
120
- variant: P ? "selected" : "secondary",
121
- className: "mt-4",
122
- fullWidth: !0,
123
- disabled: P || v,
124
- onClick: () => {
125
- B(n, s);
126
- },
127
- onMouseEnter: b,
128
- onFocus: b,
129
- children: v ? "Updating..." : M
130
- }
131
- ) })
132
- ] }) }) }, n);
133
- }) })
134
- ]
135
- }
136
- ),
137
- p !== te.PASSKEY && !ie() && /* @__PURE__ */ t(
138
- C,
139
- {
140
- className: "prose-dark dark:prose-lighter mt-4",
141
- noBorder: !0,
142
- header: /* @__PURE__ */ e("h2", { className: "m-0", children: /* @__PURE__ */ t(N, { columnGap: 3, alignVertical: "center", children: [
143
- /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(x, { size: "size-8" }) }),
144
- /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e("div", { children: a.PREFERENCES.PASSKEY_TITLE }) })
145
- ] }) }),
146
- children: [
147
- /* @__PURE__ */ e("p", { children: a.PREFERENCES.PASSKEY_INSTRUCTIONS }),
148
- /* @__PURE__ */ e(
149
- V,
150
- {
151
- variant: "selected",
152
- size: "small",
153
- className: "mt-2",
154
- onClick: T,
155
- labelLeft: a.PREFERENCES.PASSKEY_BUTTON,
156
- children: /* @__PURE__ */ e(x, { size: "size-5", monotone: !0 })
157
- }
158
- )
159
- ]
160
- }
161
- )
162
- ] }) : null;
163
- }, Ee = ({
164
- open: h,
165
- onOpenChange: u
166
- }) => {
167
- const r = X(null), [T, p] = m(!1), [i, f] = m(null), [E, o] = m(null);
168
- return /* @__PURE__ */ t(U, { children: [
169
- /* @__PURE__ */ e(
170
- O,
171
- {
172
- showConfirmation: T,
173
- setShowConfirmation: p,
174
- action: () => {
175
- i && i(), f(null), o(null);
176
- },
177
- customStrings: {
178
- confirmAction: "Switch Plan",
179
- cancelAction: "Cancel",
180
- title: "Switch Plan"
181
- },
182
- children: E
183
- }
184
- ),
185
- /* @__PURE__ */ e(
186
- W,
187
- {
188
- open: h,
189
- onOpenChange: u,
190
- title: J,
191
- animation: !0,
192
- animationType: "fade",
193
- blurEffect: "large",
194
- initialFocus: r,
195
- footer: /* @__PURE__ */ e(
196
- N,
197
- {
198
- columnGap: 2,
199
- alignHorizontal: "flex-end",
200
- className: "pb-8 sm:pb-0",
201
- children: /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(Y, { onOpenChange: u, ref: r }) })
202
- }
203
- ),
204
- children: /* @__PURE__ */ e(oe, { requestConfirmation: (S, c) => {
205
- f(() => S), o(c), p(!0);
206
- } })
207
- }
208
- )
209
- ] });
210
- };
211
- export {
212
- Ee as Profile
213
- };
@@ -1,238 +0,0 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { n as X, useUserChatStats as Z, LOCAL_STORAGE_PREFIX as M, LOCAL_STORAGE_USAGE_VIEW_MODE as J, LOCAL_STORAGE_USAGE_TIME_RANGE as Q, LOCAL_STORAGE_USAGE_SELECTED_MONTH as $, useChatsUsage as ee, renderDataAsList as te } from "./index.CBEv2y_C.js";
3
- import { useUniqueId as ne, TIME_RANGES as e, USAGE_TITLE as re, CARDS as T, L as h, j as c, TIME_RANGE_LABELS as k, MONTHS as N, ButtonIcon as u, IconChart as le, IconSelected as H, IconUnSelected as b, IconPrevious as se, IconNext as ae } from "./LogoEntry.CucXks5G.js";
4
- import { Card as P } from "./index.BYDZbdMZ.js";
5
- import { useLocalStorage as g, Panel as oe, DropdownMenu as ie, DropdownMenuGroupLabel as ce, DropdownMenuItem as G, DropdownMenuSub as de, ButtonCancel as Te, pluralize as D } from "./App.BD0e8HgV.js";
6
- import { useRef as ue, useState as U, Suspense as Ee, lazy as Se } from "react";
7
- const a = [0, 3, 6, 9], s = {
8
- TOKEN: "token",
9
- MODEL: "model"
10
- }, Ie = [
11
- e.TODAY,
12
- e.YESTERDAY,
13
- e.MONTH_TO_DATE,
14
- e.CURRENT_YEAR,
15
- e.LAST_YEAR
16
- ], Ae = Se(
17
- () => import(
18
- /* webpackChunkName: "chart-highcharts" */
19
- "./Chart.C-EqsPgy.js"
20
- )
21
- ), Ne = ({
22
- open: v,
23
- onOpenChange: R
24
- }) => {
25
- const f = ue(null), { getAccessToken: p, user: L } = X(), x = ne(), { data: o, isSuccess: F } = Z({
26
- user: L?.username,
27
- getAccessToken: p
28
- }), z = Math.floor((/* @__PURE__ */ new Date()).getMonth() / 3) * 3, [m, O] = U(z), [i, Y] = g({
29
- key: M + J,
30
- initialValue: s.MODEL
31
- }), [n, E] = g({
32
- key: M + Q,
33
- initialValue: e.CURRENT_YEAR
34
- }), [l, S] = g({
35
- key: M + $,
36
- initialValue: null
37
- }), [B, V] = U(
38
- (/* @__PURE__ */ new Date()).getFullYear()
39
- ), { data: I, isSuccess: w } = ee({
40
- user: L?.username,
41
- getAccessToken: p,
42
- timeRange: n,
43
- month: n === e.SPECIFIC_MONTH && l !== null ? String(l) : void 0,
44
- year: n === e.SPECIFIC_MONTH ? String(B) : void 0,
45
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
46
- }), y = (r) => {
47
- if (r.preventDefault(), n === e.MONTH_TO_DATE)
48
- return;
49
- if (n === e.TODAY || n === e.YESTERDAY) {
50
- E(
51
- n === e.TODAY ? e.YESTERDAY : e.TODAY
52
- );
53
- return;
54
- }
55
- if (n === e.SPECIFIC_MONTH && l !== null) {
56
- const _ = (l + 1) % 12;
57
- S(_);
58
- return;
59
- }
60
- const C = (a.indexOf(m) + 1) % a.length;
61
- O(a[C]);
62
- }, K = (r) => {
63
- if (r.preventDefault(), n === e.MONTH_TO_DATE)
64
- return;
65
- if (n === e.TODAY || n === e.YESTERDAY) {
66
- E(
67
- n === e.TODAY ? e.YESTERDAY : e.TODAY
68
- );
69
- return;
70
- }
71
- if (n === e.SPECIFIC_MONTH && l !== null) {
72
- const _ = (l - 1 + 12) % 12;
73
- S(_);
74
- return;
75
- }
76
- const C = (a.indexOf(m) - 1 + a.length) % a.length;
77
- O(a[C]);
78
- }, j = (r) => {
79
- E(r), r !== e.SPECIFIC_MONTH && S(null), (r === e.CURRENT_YEAR || r === e.LAST_YEAR) && O(z);
80
- }, W = (r) => {
81
- S(r), V((/* @__PURE__ */ new Date()).getFullYear()), E(e.SPECIFIC_MONTH);
82
- }, q = () => n === e.SPECIFIC_MONTH && l !== null ? N[l] : k[n];
83
- return /* @__PURE__ */ d(
84
- oe,
85
- {
86
- open: v,
87
- onOpenChange: R,
88
- title: re,
89
- animation: !0,
90
- animationType: "fade",
91
- blurEffect: "large",
92
- initialFocus: f,
93
- footer: /* @__PURE__ */ t(
94
- h,
95
- {
96
- columnGap: 2,
97
- alignHorizontal: "flex-end",
98
- className: "pb-8 sm:pb-0",
99
- children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(Te, { onOpenChange: R, ref: f }) })
100
- }
101
- ),
102
- children: [
103
- /* @__PURE__ */ t(
104
- P,
105
- {
106
- header: T.MAIN_STATISTICS.USAGE,
107
- className: "prose-dark dark:prose-lighter mb-4 min-h-144",
108
- noBorder: !0,
109
- children: w && I ? /* @__PURE__ */ d(Ee, { fallback: /* @__PURE__ */ t("div", {}), children: [
110
- /* @__PURE__ */ t(h, { className: "mb-2", alignHorizontal: "center", children: /* @__PURE__ */ t(c, { children: /* @__PURE__ */ d(
111
- ie,
112
- {
113
- mode: "dark",
114
- focusMode: "light",
115
- trigger: /* @__PURE__ */ t(
116
- u,
117
- {
118
- noBorder: !0,
119
- variant: "selected",
120
- size: "small",
121
- labelRight: q(),
122
- children: /* @__PURE__ */ t(le, { className: "mr-1", size: "size-4" })
123
- }
124
- ),
125
- defaultPlacement: "bottom-start",
126
- children: [
127
- /* @__PURE__ */ t(ce, { children: "Date Range" }),
128
- Ie.map((r) => /* @__PURE__ */ t(
129
- G,
130
- {
131
- label: k[r],
132
- selected: n === r,
133
- onClick: () => j(r)
134
- },
135
- r
136
- )),
137
- /* @__PURE__ */ t(de, { label: "Month", children: N.map((r, A) => /* @__PURE__ */ t(
138
- G,
139
- {
140
- label: r,
141
- selected: n === e.SPECIFIC_MONTH && l === A,
142
- onClick: () => W(A)
143
- },
144
- r
145
- )) })
146
- ]
147
- }
148
- ) }) }),
149
- /* @__PURE__ */ d(h, { className: "mb-2", alignHorizontal: "center", columnGap: 2, children: [
150
- /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
151
- u,
152
- {
153
- onClick: () => Y(s.MODEL),
154
- labelRight: "Model Usage",
155
- noBorder: !0,
156
- size: "small",
157
- mode: i === s.MODEL ? "dark" : "light",
158
- children: i === s.MODEL ? /* @__PURE__ */ t(H, { size: "size-4" }) : /* @__PURE__ */ t(b, { size: "size-4" })
159
- }
160
- ) }),
161
- /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
162
- u,
163
- {
164
- onClick: () => Y(s.TOKEN),
165
- labelRight: "Token Usage",
166
- noBorder: !0,
167
- size: "small",
168
- mode: i === s.TOKEN ? "dark" : "light",
169
- children: i === s.TOKEN ? /* @__PURE__ */ t(H, { size: "size-4" }) : /* @__PURE__ */ t(b, { size: "size-4" })
170
- }
171
- ) })
172
- ] }),
173
- /* @__PURE__ */ t(
174
- Ae,
175
- {
176
- tokenUsage: i === s.TOKEN ? I.tokenUsage?.series || [] : I.modelUsage?.series || [],
177
- page: m,
178
- viewMode: i,
179
- timeRange: n,
180
- categories: I.categories,
181
- chartTitle: n === e.SPECIFIC_MONTH && l !== null ? N[l] : void 0
182
- }
183
- ),
184
- n !== e.MONTH_TO_DATE && /* @__PURE__ */ d(h, { className: "mt-2", alignHorizontal: "center", columnGap: 2, children: [
185
- /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
186
- u,
187
- {
188
- noBorder: !0,
189
- size: "small",
190
- label: "Previous",
191
- onClick: K,
192
- children: /* @__PURE__ */ t(se, { size: "size-4" })
193
- }
194
- ) }),
195
- /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
196
- u,
197
- {
198
- noBorder: !0,
199
- size: "small",
200
- label: "Next",
201
- onClick: y,
202
- children: /* @__PURE__ */ t(ae, { size: "size-4" })
203
- }
204
- ) })
205
- ] })
206
- ] }) : null
207
- }
208
- ),
209
- /* @__PURE__ */ t(
210
- P,
211
- {
212
- header: T.MAIN_STATISTICS.TITLE,
213
- className: "prose-dark dark:prose-lighter min-h-42",
214
- noBorder: !0,
215
- children: F ? te(
216
- x,
217
- {
218
- [D(T.MAIN_STATISTICS.TOTAL, o.totalChats)]: o.totalChats,
219
- [D(
220
- T.MAIN_STATISTICS.TOTAL_PRIVATE,
221
- o.privateChats
222
- )]: o.privateChats,
223
- [D(
224
- T.MAIN_STATISTICS.TOTAL_DELETED,
225
- o.deletedChats
226
- )]: o.deletedChats
227
- },
228
- !0
229
- ) : null
230
- }
231
- )
232
- ]
233
- }
234
- );
235
- };
236
- export {
237
- Ne as Usage
238
- };