@versini/sassysaint 8.109.2 → 8.110.1
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.
- package/dist/chunks/{AboutChangelog.BSdcqHox.js → AboutChangelog.DfItgg_1.js} +2 -2
- package/dist/chunks/AboutEntry.DIYTS0Pp.js +77 -0
- package/dist/chunks/{App.Ck18sHiX.js → App.7P9lyXTX.js} +4104 -3874
- package/dist/chunks/{Bubble.B6v5eAOZ.js → Bubble.C3J-YrAQ.js} +1 -1
- package/dist/chunks/ButtonIconDelete.CAEfJOI7.js +333 -0
- package/dist/chunks/{Chart.BIy5YDm2.js → Chart.Dg1jAFpj.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.CN-iqEkP.js → ChatBubbleAssistant.DavDkAFx.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.D4OLR3vD.js → ChatBubbleUser.DSMfBmEP.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.ZOLprzfc.js → ChatHistoryTable.qju2f_Sh.js} +73 -73
- package/dist/chunks/{HistoryEntry.DY5WIpTu.js → HistoryEntry.QxUwQO5B.js} +73 -81
- package/dist/chunks/LoginEntry.BbhZpovW.js +118 -0
- package/dist/chunks/{LogoEntry.B1e2c-s0.js → LogoEntry.CTMAkXZN.js} +643 -747
- package/dist/chunks/{MemoriesEntry.CVrI1Ter.js → MemoriesEntry.BYYT1IVl.js} +304 -318
- package/dist/chunks/ProfileEntry.vCF-ayWr.js +205 -0
- package/dist/chunks/{SettingsEntry.BxF_ZqA5.js → SettingsEntry.DEaHLi7A.js} +114 -122
- package/dist/chunks/UsageEntry.B3Z4Zr4a.js +230 -0
- package/dist/chunks/{_baseUniq.B6Gcl5nF.js → _baseUniq.CKo3g19j.js} +1 -1
- package/dist/chunks/{arc.w_BReByh.js → arc.ny1AnYpL.js} +1 -1
- package/dist/chunks/{architecture-U656AL7Q.BPCpLHAc.js → architecture-U656AL7Q.CoJV4P-W.js} +1 -1
- package/dist/chunks/{architectureDiagram-VXUJARFQ.D96Sa2WG.js → architectureDiagram-VXUJARFQ.C_r6hPXf.js} +4 -4
- package/dist/chunks/{blockDiagram-VD42YOAC.fDjFSO1h.js → blockDiagram-VD42YOAC.DeTKi9HH.js} +5 -5
- package/dist/chunks/{browser.Cb_vr1PR.js → browser.Dd1PVu4Q.js} +1 -1
- package/dist/chunks/{c4Diagram-YG6GDRKO.U8IWA3ML.js → c4Diagram-YG6GDRKO.PYJXPQRd.js} +2 -2
- package/dist/chunks/{channel.Dw9Rrvd2.js → channel.CldxJpdX.js} +1 -1
- package/dist/chunks/{chunk-4BX2VUAB.Cio3OsS-.js → chunk-4BX2VUAB.D_xGzQXV.js} +1 -1
- package/dist/chunks/{chunk-55IACEB6.CFaFqBKt.js → chunk-55IACEB6.D91lGO9k.js} +1 -1
- package/dist/chunks/{chunk-B4BG7PRW.DGkVxxTo.js → chunk-B4BG7PRW.rABluadn.js} +4 -4
- package/dist/chunks/{chunk-DI55MBZ5.DsnidbDu.js → chunk-DI55MBZ5.BisMfdbP.js} +3 -3
- package/dist/chunks/{chunk-FMBD7UC4.DTxRjjKJ.js → chunk-FMBD7UC4.IZluU3TG.js} +1 -1
- package/dist/chunks/{chunk-QN33PNHL.CuRPKMac.js → chunk-QN33PNHL.DdhRwJuC.js} +1 -1
- package/dist/chunks/{chunk-QZHKN3VN.CntLD_-Z.js → chunk-QZHKN3VN.DxJRkbxl.js} +1 -1
- package/dist/chunks/{chunk-TZMSLE5B.B7_0n6Dd.js → chunk-TZMSLE5B.yJUdJdZG.js} +1 -1
- package/dist/chunks/{classDiagram-2ON5EDUG.BJsNaiPY.js → classDiagram-2ON5EDUG.BJJShSGE.js} +2 -2
- package/dist/chunks/{classDiagram-v2-WZHVMYZB.BJsNaiPY.js → classDiagram-v2-WZHVMYZB.BJJShSGE.js} +2 -2
- package/dist/chunks/{clone.BFX0o9-g.js → clone.CYQWcQos.js} +1 -1
- package/dist/chunks/{cose-bilkent-S5V4N54A.CJtHnhhQ.js → cose-bilkent-S5V4N54A.CFiLRTlV.js} +2 -2
- package/dist/chunks/{dagre-6UL2VRFP.CuwjO6gV.js → dagre-6UL2VRFP.BAOLjlsO.js} +5 -5
- package/dist/chunks/{diagram-PSM6KHXK.CnNu5_LM.js → diagram-PSM6KHXK.B7fd_KvS.js} +4 -4
- package/dist/chunks/{diagram-QEK2KX5R.D74ae4xj.js → diagram-QEK2KX5R.nRWB6Pdu.js} +3 -3
- package/dist/chunks/{diagram-S2PKOQOG.C_JbSw1v.js → diagram-S2PKOQOG.C4gQIrc_.js} +3 -3
- package/dist/chunks/{erDiagram-Q2GNP2WA.Bu-foyWC.js → erDiagram-Q2GNP2WA.U2TDWSHg.js} +4 -4
- package/dist/chunks/{flowDiagram-NV44I4VS.YDgJ2OQY.js → flowDiagram-NV44I4VS.CmXaVrq9.js} +5 -5
- package/dist/chunks/{ganttDiagram-JELNMOA3.ymNQ3Hoy.js → ganttDiagram-JELNMOA3.DSD39bjf.js} +2 -2
- package/dist/chunks/{gitGraph-F6HP7TQM.D-mPOTEU.js → gitGraph-F6HP7TQM.C_axBowD.js} +1 -1
- package/dist/chunks/{gitGraphDiagram-NY62KEGX.jrbht_5k.js → gitGraphDiagram-NY62KEGX.Y6LpuRjD.js} +4 -4
- package/dist/chunks/{graph.Dw24ucCU.js → graph.CsEnoNl4.js} +2 -2
- package/dist/chunks/{index.KPs76GKZ.js → index.-DOP9Ckx.js} +1 -1
- package/dist/chunks/{index.CmWau6U1.js → index.4552QdXH.js} +3 -3
- package/dist/chunks/{index.Ci301JK4.js → index.76MlCVOY.js} +1 -1
- package/dist/chunks/{index.CQg0p3pG.js → index.BYUyJHzk.js} +1 -1
- package/dist/chunks/{index.BGnEq9eh.js → index.Bi2ow_w5.js} +1 -1
- package/dist/chunks/{index.BzMdQGY-.js → index.CK3q1Sfv.js} +1 -1
- package/dist/chunks/{index.Cn19xWGt.js → index.CR9-xbTg.js} +3 -3
- package/dist/chunks/{index.D5R76Qhp.js → index.MD-I3XF8.js} +2 -2
- package/dist/chunks/{index.CmK3RbmJ.js → index.whZY27YH.js} +1 -1
- package/dist/chunks/{info-NVLQJR56.CzwKOAh7.js → info-NVLQJR56.BM1oszeu.js} +1 -1
- package/dist/chunks/{infoDiagram-WHAUD3N6.au7bTIRT.js → infoDiagram-WHAUD3N6.BOdkf_MU.js} +2 -2
- package/dist/chunks/{journeyDiagram-XKPGCS4Q.C9l-1F8k.js → journeyDiagram-XKPGCS4Q.Dw7-F-3G.js} +4 -4
- package/dist/chunks/{kanban-definition-3W4ZIXB7.D6Vfi9gE.js → kanban-definition-3W4ZIXB7.DBHZd8kd.js} +2 -2
- package/dist/chunks/{layout.DPHpmMar.js → layout.FDyoYwG2.js} +4 -4
- package/dist/chunks/{mermaid-parser.core.DInxEyfY.js → mermaid-parser.core.C4lg1K9H.js} +10 -10
- package/dist/chunks/{min.MWawyr81.js → min.DBs1Msoe.js} +2 -2
- package/dist/chunks/{mindmap-definition-VGOIOE7T.AmwLTujL.js → mindmap-definition-VGOIOE7T.CU1TS1Wz.js} +3 -3
- package/dist/chunks/{packet-BFZMPI3H.CSmnVpE_.js → packet-BFZMPI3H.BQDJHYjU.js} +1 -1
- package/dist/chunks/{pie-7BOR55EZ.DJwvoEep.js → pie-7BOR55EZ.BlU94TQO.js} +1 -1
- package/dist/chunks/{pieDiagram-ADFJNKIX.Ci_Ogfw5.js → pieDiagram-ADFJNKIX.CKbT8AbG.js} +4 -4
- package/dist/chunks/{quadrantDiagram-AYHSOK5B.DenSBLBq.js → quadrantDiagram-AYHSOK5B.iibdk6QV.js} +1 -1
- package/dist/chunks/{radar-NHE76QYJ.Bs1Xji9w.js → radar-NHE76QYJ.CqellN1R.js} +1 -1
- package/dist/chunks/{rehype-mermaid.DlMgdumz.js → rehype-mermaid.D5rxFoLJ.js} +33 -33
- package/dist/chunks/{requirementDiagram-UZGBJVZJ.CjMQhoO7.js → requirementDiagram-UZGBJVZJ.BeoYCRTt.js} +3 -3
- package/dist/chunks/{sankeyDiagram-TZEHDZUN.B9hWlv5i.js → sankeyDiagram-TZEHDZUN.Cl7AJQyH.js} +1 -1
- package/dist/chunks/{sequenceDiagram-WL72ISMW.MHpp_BjQ.js → sequenceDiagram-WL72ISMW.DJiYzLwe.js} +3 -3
- package/dist/chunks/{stateDiagram-FKZM4ZOC.C4fbHKw_.js → stateDiagram-FKZM4ZOC.CEH77n-u.js} +4 -4
- package/dist/chunks/{stateDiagram-v2-4FDKWEC3.ByhBnYKV.js → stateDiagram-v2-4FDKWEC3.C7e8FoNM.js} +2 -2
- package/dist/chunks/{timeline-definition-IT6M3QCI.BVQ3wHwi.js → timeline-definition-IT6M3QCI.DpH45C9N.js} +2 -2
- package/dist/chunks/{treemap-KMMF4GRG.DCYbqvVC.js → treemap-KMMF4GRG.CaXoo_S5.js} +1 -1
- package/dist/chunks/{useMarkdown.4iaTIP2g.js → useMarkdown.C2zWe9xE.js} +8 -8
- package/dist/chunks/{xychartDiagram-PRI3JC2R.Dp6iurqL.js → xychartDiagram-PRI3JC2R.l9efaY6c.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/chunks/AboutEntry.CAewlRU7.js +0 -85
- package/dist/chunks/ButtonIconDelete.jqbd7Q9b.js +0 -456
- package/dist/chunks/LoginEntry.CC1V4TOR.js +0 -118
- package/dist/chunks/ProfileEntry.VlRvWAq4.js +0 -213
- package/dist/chunks/UsageEntry.DHYx6GmN.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.Ck18sHiX.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.B1e2c-s0.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.D5R76Qhp.js";
|
|
6
|
-
import { Card as C } from "./index.KPs76GKZ.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.D5R76Qhp.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.B1e2c-s0.js";
|
|
4
|
-
import { Card as P } from "./index.KPs76GKZ.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.Ck18sHiX.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.BIy5YDm2.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
|
-
};
|