@carlonicora/nextjs-jsonapi 6.13.1 → 6.14.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.
- package/dist/{BlockNoteEditor-UBVEUFNR.js → BlockNoteEditor-CUNH4LSQ.js} +25 -25
- package/dist/{BlockNoteEditor-UBVEUFNR.js.map → BlockNoteEditor-CUNH4LSQ.js.map} +1 -1
- package/dist/{BlockNoteEditor-VXMDSQAA.mjs → BlockNoteEditor-QIVV2OB4.mjs} +10 -10
- package/dist/{BlockNoteViewer-2XYASA5Y.js → BlockNoteViewer-APBOPT4B.js} +8 -8
- package/dist/{BlockNoteViewer-2XYASA5Y.js.map → BlockNoteViewer-APBOPT4B.js.map} +1 -1
- package/dist/{BlockNoteViewer-NBW2H6LC.mjs → BlockNoteViewer-HIUAJQRI.mjs} +7 -7
- package/dist/JsonApiRequest-G4J2WTSU.js +26 -0
- package/dist/{JsonApiRequest-WISJZSDE.js.map → JsonApiRequest-G4J2WTSU.js.map} +1 -1
- package/dist/{JsonApiRequest-F6TMJ42G.mjs → JsonApiRequest-IKKHWCPB.mjs} +2 -2
- package/dist/billing/index.js +497 -497
- package/dist/billing/index.mjs +9 -9
- package/dist/{chunk-7DBJTNSU.mjs → chunk-4RPGFQBA.mjs} +2 -2
- package/dist/{chunk-BZ5J2FIV.js → chunk-4XLDBOSE.js} +11 -11
- package/dist/{chunk-BZ5J2FIV.js.map → chunk-4XLDBOSE.js.map} +1 -1
- package/dist/{chunk-27LQDGNP.mjs → chunk-4ZJIUTIV.mjs} +6 -1
- package/dist/chunk-4ZJIUTIV.mjs.map +1 -0
- package/dist/{chunk-PXDUJ47N.js → chunk-6RCZ64BQ.js} +18 -18
- package/dist/{chunk-PXDUJ47N.js.map → chunk-6RCZ64BQ.js.map} +1 -1
- package/dist/{chunk-7JZHPMGW.mjs → chunk-A3RB47X4.mjs} +44 -20
- package/dist/chunk-A3RB47X4.mjs.map +1 -0
- package/dist/{chunk-DOCIFE6A.mjs → chunk-AUD6ZLBB.mjs} +3 -3
- package/dist/{chunk-GB6DBFYY.js → chunk-DGN3PR2F.js} +3 -3
- package/dist/{chunk-GB6DBFYY.js.map → chunk-DGN3PR2F.js.map} +1 -1
- package/dist/{chunk-7ZHTPFFT.js → chunk-DJXSCARG.js} +15 -15
- package/dist/{chunk-7ZHTPFFT.js.map → chunk-DJXSCARG.js.map} +1 -1
- package/dist/{chunk-QKNGZDSQ.js → chunk-GM4VZTWL.js} +2 -2
- package/dist/{chunk-QKNGZDSQ.js.map → chunk-GM4VZTWL.js.map} +1 -1
- package/dist/{chunk-PYRZCKC2.js → chunk-GSRTVIIK.js} +923 -923
- package/dist/{chunk-PYRZCKC2.js.map → chunk-GSRTVIIK.js.map} +1 -1
- package/dist/{chunk-47BBY5KA.mjs → chunk-HAW5PNJG.mjs} +4 -4
- package/dist/{chunk-YRKIFYOE.mjs → chunk-KTGKW72G.mjs} +27 -8
- package/dist/chunk-KTGKW72G.mjs.map +1 -0
- package/dist/{chunk-PV4Z5W6V.js → chunk-KV4N7DEG.js} +19 -19
- package/dist/{chunk-PV4Z5W6V.js.map → chunk-KV4N7DEG.js.map} +1 -1
- package/dist/{chunk-ZLTOUZN2.mjs → chunk-M3N7LPHX.mjs} +4 -4
- package/dist/{chunk-DGWOVYEC.mjs → chunk-MQ7TXALH.mjs} +2 -2
- package/dist/{chunk-W62MHDWM.js → chunk-N5ZE2Z6I.js} +58 -34
- package/dist/chunk-N5ZE2Z6I.js.map +1 -0
- package/dist/{chunk-2SV4SS6N.js → chunk-OQQ7CZWT.js} +12 -12
- package/dist/{chunk-2SV4SS6N.js.map → chunk-OQQ7CZWT.js.map} +1 -1
- package/dist/{chunk-JJMMT24D.mjs → chunk-OUEYZOLB.mjs} +2 -2
- package/dist/{chunk-XXP3TQHF.mjs → chunk-OY65RYD3.mjs} +2 -2
- package/dist/{chunk-MOGEGWXW.js → chunk-PMESKNKL.js} +868 -868
- package/dist/{chunk-MOGEGWXW.js.map → chunk-PMESKNKL.js.map} +1 -1
- package/dist/{chunk-B6JGKDP2.js → chunk-QGVVF77L.js} +48 -29
- package/dist/chunk-QGVVF77L.js.map +1 -0
- package/dist/{chunk-BH6JWIKI.mjs → chunk-QIEF7HIL.mjs} +2 -2
- package/dist/{chunk-P445QGOC.mjs → chunk-RFKSJIQB.mjs} +7 -7
- package/dist/{chunk-6JUCIWDC.mjs → chunk-UOTHRJD2.mjs} +2 -2
- package/dist/{chunk-KMW7UNL2.js → chunk-WCEYT3GG.js} +8 -8
- package/dist/{chunk-KMW7UNL2.js.map → chunk-WCEYT3GG.js.map} +1 -1
- package/dist/{chunk-MHB36MYE.js → chunk-WUNSG3IN.js} +7 -2
- package/dist/chunk-WUNSG3IN.js.map +1 -0
- package/dist/{chunk-N4RZZKL5.mjs → chunk-YKNULEHB.mjs} +12 -12
- package/dist/{chunk-Z4POQWFG.js → chunk-ZYSNJKOP.js} +4 -4
- package/dist/{chunk-Z4POQWFG.js.map → chunk-ZYSNJKOP.js.map} +1 -1
- package/dist/client/index.js +10 -10
- package/dist/client/index.mjs +9 -9
- package/dist/components/index.js +10 -10
- package/dist/components/index.mjs +9 -9
- package/dist/contexts/index.js +10 -10
- package/dist/contexts/index.mjs +9 -9
- package/dist/core/index.js +7 -7
- package/dist/core/index.mjs +6 -6
- package/dist/email-automations/index.js +99 -99
- package/dist/email-automations/index.mjs +9 -9
- package/dist/features/analytics/index.js +126 -126
- package/dist/features/analytics/index.mjs +9 -9
- package/dist/features/analytics/server.js +10 -10
- package/dist/features/analytics/server.mjs +8 -8
- package/dist/features/blog/index.js +156 -156
- package/dist/features/blog/index.mjs +9 -9
- package/dist/features/blog/server.js +28 -28
- package/dist/features/blog/server.mjs +7 -7
- package/dist/features/help/index.js +43 -43
- package/dist/features/help/index.mjs +9 -9
- package/dist/features/tokenusage/index.js +132 -132
- package/dist/features/tokenusage/index.mjs +9 -9
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/{lifecycle-LKGPRBS7.mjs → lifecycle-KI3PCJSE.mjs} +3 -3
- package/dist/lifecycle-TO65I7TO.js +23 -0
- package/dist/{lifecycle-4GUOTB46.js.map → lifecycle-TO65I7TO.js.map} +1 -1
- package/dist/local-transport-4YDJ6FQG.js +15 -0
- package/dist/{local-transport-7H3SPZSA.js.map → local-transport-4YDJ6FQG.js.map} +1 -1
- package/dist/local-transport-C7YTA4I7.mjs +15 -0
- package/dist/offline/index.d.mts +160 -4
- package/dist/offline/index.d.ts +160 -4
- package/dist/offline/index.js +210 -163
- package/dist/offline/index.js.map +1 -1
- package/dist/offline/index.mjs +76 -29
- package/dist/offline/index.mjs.map +1 -1
- package/dist/request-66FGJIHB.mjs +10 -0
- package/dist/request-6W6UGKJV.js +10 -0
- package/dist/{request-KTBV6HHH.js.map → request-6W6UGKJV.js.map} +1 -1
- package/dist/server/index.js +9 -9
- package/dist/server/index.mjs +8 -8
- package/dist/write-through-BAPS24GL.js +15 -0
- package/dist/{write-through-FDQ7N4YI.js.map → write-through-BAPS24GL.js.map} +1 -1
- package/dist/write-through-IWQKXYHE.mjs +15 -0
- package/package.json +1 -1
- package/src/offline/__tests__/generic-answers.spec.ts +146 -3
- package/src/offline/__tests__/local-transport.spec.ts +15 -1
- package/src/offline/__tests__/offline-fixtures.ts +29 -2
- package/src/offline/__tests__/write-through.spec.ts +27 -1
- package/src/offline/config.ts +9 -0
- package/src/offline/generic-answers.ts +44 -17
- package/src/offline/index.ts +2 -0
- package/src/offline/local-transport.ts +5 -3
- package/src/offline/sync/__tests__/runtime.spec.ts +30 -1
- package/src/offline/sync/__tests__/sync-fixtures.ts +22 -0
- package/src/offline/sync/__tests__/sync-root.spec.ts +184 -1
- package/src/offline/sync/known-roots.ts +29 -7
- package/src/offline/sync/runtime.ts +3 -2
- package/src/offline/sync/sync-root.ts +70 -19
- package/src/offline/types.ts +39 -1
- package/src/offline/write-through.ts +6 -3
- package/dist/JsonApiRequest-WISJZSDE.js +0 -26
- package/dist/chunk-27LQDGNP.mjs.map +0 -1
- package/dist/chunk-7JZHPMGW.mjs.map +0 -1
- package/dist/chunk-B6JGKDP2.js.map +0 -1
- package/dist/chunk-MHB36MYE.js.map +0 -1
- package/dist/chunk-W62MHDWM.js.map +0 -1
- package/dist/chunk-YRKIFYOE.mjs.map +0 -1
- package/dist/lifecycle-4GUOTB46.js +0 -23
- package/dist/local-transport-7H3SPZSA.js +0 -15
- package/dist/local-transport-QYFKA6AN.mjs +0 -15
- package/dist/request-KTBV6HHH.js +0 -10
- package/dist/request-SQOUNWZ4.mjs +0 -10
- package/dist/write-through-FDQ7N4YI.js +0 -15
- package/dist/write-through-R25VQMH6.mjs +0 -15
- /package/dist/{BlockNoteEditor-VXMDSQAA.mjs.map → BlockNoteEditor-QIVV2OB4.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-NBW2H6LC.mjs.map → BlockNoteViewer-HIUAJQRI.mjs.map} +0 -0
- /package/dist/{JsonApiRequest-F6TMJ42G.mjs.map → JsonApiRequest-IKKHWCPB.mjs.map} +0 -0
- /package/dist/{chunk-7DBJTNSU.mjs.map → chunk-4RPGFQBA.mjs.map} +0 -0
- /package/dist/{chunk-DOCIFE6A.mjs.map → chunk-AUD6ZLBB.mjs.map} +0 -0
- /package/dist/{chunk-47BBY5KA.mjs.map → chunk-HAW5PNJG.mjs.map} +0 -0
- /package/dist/{chunk-ZLTOUZN2.mjs.map → chunk-M3N7LPHX.mjs.map} +0 -0
- /package/dist/{chunk-DGWOVYEC.mjs.map → chunk-MQ7TXALH.mjs.map} +0 -0
- /package/dist/{chunk-JJMMT24D.mjs.map → chunk-OUEYZOLB.mjs.map} +0 -0
- /package/dist/{chunk-XXP3TQHF.mjs.map → chunk-OY65RYD3.mjs.map} +0 -0
- /package/dist/{chunk-BH6JWIKI.mjs.map → chunk-QIEF7HIL.mjs.map} +0 -0
- /package/dist/{chunk-P445QGOC.mjs.map → chunk-RFKSJIQB.mjs.map} +0 -0
- /package/dist/{chunk-6JUCIWDC.mjs.map → chunk-UOTHRJD2.mjs.map} +0 -0
- /package/dist/{chunk-N4RZZKL5.mjs.map → chunk-YKNULEHB.mjs.map} +0 -0
- /package/dist/{lifecycle-LKGPRBS7.mjs.map → lifecycle-KI3PCJSE.mjs.map} +0 -0
- /package/dist/{local-transport-QYFKA6AN.mjs.map → local-transport-C7YTA4I7.mjs.map} +0 -0
- /package/dist/{request-SQOUNWZ4.mjs.map → request-66FGJIHB.mjs.map} +0 -0
- /package/dist/{write-through-R25VQMH6.mjs.map → write-through-IWQKXYHE.mjs.map} +0 -0
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkGSRTVIIKjs = require('../../chunk-GSRTVIIK.js');
|
|
43
43
|
require('../../chunk-3EPNHTMH.js');
|
|
44
|
-
require('../../chunk-
|
|
44
|
+
require('../../chunk-DJXSCARG.js');
|
|
45
45
|
require('../../chunk-G4JR3SFV.js');
|
|
46
46
|
|
|
47
47
|
|
|
@@ -58,16 +58,16 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
var
|
|
62
|
-
require('../../chunk-
|
|
61
|
+
var _chunkPMESKNKLjs = require('../../chunk-PMESKNKL.js');
|
|
62
|
+
require('../../chunk-DGN3PR2F.js');
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
var
|
|
67
|
-
require('../../chunk-
|
|
68
|
-
require('../../chunk-
|
|
69
|
-
require('../../chunk-
|
|
70
|
-
require('../../chunk-
|
|
66
|
+
var _chunk4XLDBOSEjs = require('../../chunk-4XLDBOSE.js');
|
|
67
|
+
require('../../chunk-KV4N7DEG.js');
|
|
68
|
+
require('../../chunk-WCEYT3GG.js');
|
|
69
|
+
require('../../chunk-WUNSG3IN.js');
|
|
70
|
+
require('../../chunk-GM4VZTWL.js');
|
|
71
71
|
require('../../chunk-LXKSUWAV.js');
|
|
72
72
|
|
|
73
73
|
|
|
@@ -89,7 +89,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
89
89
|
};
|
|
90
90
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
91
91
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
92
|
-
|
|
92
|
+
_chunkGSRTVIIKjs.DateRangeSelector,
|
|
93
93
|
{
|
|
94
94
|
onDateChange: (range) => {
|
|
95
95
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -124,16 +124,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
126
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
127
|
-
|
|
127
|
+
_chunkGSRTVIIKjs.Select,
|
|
128
128
|
{
|
|
129
129
|
items: companyItems,
|
|
130
130
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
131
131
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
135
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
136
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
133
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
134
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.SelectContent, { children: [
|
|
135
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
136
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
137
137
|
] })
|
|
138
138
|
]
|
|
139
139
|
}
|
|
@@ -156,13 +156,13 @@ function Segmented({
|
|
|
156
156
|
children: options.map((option) => {
|
|
157
157
|
const selected = option.value === value;
|
|
158
158
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
-
|
|
159
|
+
_chunkGSRTVIIKjs.Button,
|
|
160
160
|
{
|
|
161
161
|
type: "button",
|
|
162
162
|
size: "sm",
|
|
163
163
|
variant: selected ? "default" : "ghost",
|
|
164
164
|
"aria-pressed": selected,
|
|
165
|
-
className:
|
|
165
|
+
className: _chunkPMESKNKLjs.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
166
166
|
onClick: () => onSelect(option.value),
|
|
167
167
|
children: option.label
|
|
168
168
|
},
|
|
@@ -182,36 +182,36 @@ function withFilters(endpoint, filters) {
|
|
|
182
182
|
return endpoint;
|
|
183
183
|
}
|
|
184
184
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
185
|
-
var TokenUsageAdminService = class extends
|
|
185
|
+
var TokenUsageAdminService = class extends _chunkPMESKNKLjs.AbstractService {
|
|
186
186
|
static {
|
|
187
187
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
188
188
|
}
|
|
189
189
|
/** Six rows: {customer, platform, total} × {current, previous}. */
|
|
190
190
|
static async getSummary(filters) {
|
|
191
|
-
const endpoint = withFilters(new (0,
|
|
191
|
+
const endpoint = withFilters(new (0, _chunk4XLDBOSEjs.EndpointCreator)({ endpoint: _chunk4XLDBOSEjs.Modules.TokenUsageAdminSummary }), filters);
|
|
192
192
|
return this.callApi({
|
|
193
|
-
type:
|
|
193
|
+
type: _chunk4XLDBOSEjs.Modules.TokenUsageAdminSummary,
|
|
194
194
|
method: "GET" /* GET */,
|
|
195
195
|
endpoint: endpoint.generate()
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
static async getTimeline(params) {
|
|
199
|
-
const endpoint = withFilters(new (0,
|
|
199
|
+
const endpoint = withFilters(new (0, _chunk4XLDBOSEjs.EndpointCreator)({ endpoint: _chunk4XLDBOSEjs.Modules.TokenUsageAdminTimeline }), params);
|
|
200
200
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
201
201
|
endpoint.addAdditionalParam("stackBy", params.stackBy);
|
|
202
202
|
return this.callApi({
|
|
203
|
-
type:
|
|
203
|
+
type: _chunk4XLDBOSEjs.Modules.TokenUsageAdminTimeline,
|
|
204
204
|
method: "GET" /* GET */,
|
|
205
205
|
endpoint: endpoint.generate()
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
static async getBreakdown(params) {
|
|
209
|
-
const endpoint = withFilters(new (0,
|
|
209
|
+
const endpoint = withFilters(new (0, _chunk4XLDBOSEjs.EndpointCreator)({ endpoint: _chunk4XLDBOSEjs.Modules.TokenUsageAdminBreakdown }), params);
|
|
210
210
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
211
211
|
endpoint.addAdditionalParam("scope", params.scope);
|
|
212
212
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
213
213
|
return this.callApi({
|
|
214
|
-
type:
|
|
214
|
+
type: _chunk4XLDBOSEjs.Modules.TokenUsageAdminBreakdown,
|
|
215
215
|
method: "GET" /* GET */,
|
|
216
216
|
endpoint: endpoint.generate()
|
|
217
217
|
});
|
|
@@ -348,7 +348,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
348
348
|
error
|
|
349
349
|
]
|
|
350
350
|
);
|
|
351
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
351
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
352
352
|
}, "TokenUsageAdminProvider");
|
|
353
353
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
354
354
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -369,7 +369,7 @@ var _lucidereact = require('lucide-react');
|
|
|
369
369
|
var ZERO = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
370
370
|
function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
371
371
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
372
|
-
const { decimal, metricValue: formatValue, currency, percent } =
|
|
372
|
+
const { decimal, metricValue: formatValue, currency, percent } = _chunkGSRTVIIKjs.useUsageFormatters.call(void 0, );
|
|
373
373
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (scope, window) => _nullishCoalesce(summary.find((r) => r.scope === scope && r.window === window), () => ( ZERO)), "rowFor");
|
|
374
374
|
const customerCurrent = rowFor("customer", "current");
|
|
375
375
|
const customerPrevious = rowFor("customer", "previous");
|
|
@@ -378,16 +378,16 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
378
378
|
const totalCurrent = rowFor("total", "current");
|
|
379
379
|
const totalPrevious = rowFor("total", "previous");
|
|
380
380
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
381
|
-
const cacheHit =
|
|
381
|
+
const cacheHit = _chunkGSRTVIIKjs.cacheHitPercentage.call(void 0, totalCurrent.cached, totalCurrent.tokensIn);
|
|
382
382
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
383
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
383
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkPMESKNKLjs.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
384
384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
385
385
|
LeadTile,
|
|
386
386
|
{
|
|
387
387
|
testId: "tile-customer",
|
|
388
388
|
label: t("token_usage.admin.customer_spend"),
|
|
389
|
-
value: formatValue(
|
|
390
|
-
delta:
|
|
389
|
+
value: formatValue(_chunkGSRTVIIKjs.metricValue.call(void 0, customerCurrent, metric), metric),
|
|
390
|
+
delta: _chunkGSRTVIIKjs.percentageDelta.call(void 0, _chunkGSRTVIIKjs.metricValue.call(void 0, customerCurrent, metric), _chunkGSRTVIIKjs.metricValue.call(void 0, customerPrevious, metric)),
|
|
391
391
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
392
392
|
decimal
|
|
393
393
|
}
|
|
@@ -397,8 +397,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
397
397
|
{
|
|
398
398
|
testId: "tile-platform",
|
|
399
399
|
label: t("token_usage.admin.platform_spend"),
|
|
400
|
-
value: formatValue(
|
|
401
|
-
delta:
|
|
400
|
+
value: formatValue(_chunkGSRTVIIKjs.metricValue.call(void 0, platformCurrent, metric), metric),
|
|
401
|
+
delta: _chunkGSRTVIIKjs.percentageDelta.call(void 0, _chunkGSRTVIIKjs.metricValue.call(void 0, platformCurrent, metric), _chunkGSRTVIIKjs.metricValue.call(void 0, platformPrevious, metric)),
|
|
402
402
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
403
403
|
decimal
|
|
404
404
|
}
|
|
@@ -410,8 +410,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
410
410
|
{
|
|
411
411
|
testId: "tile-total",
|
|
412
412
|
label: t("token_usage.admin.total_cost"),
|
|
413
|
-
value: formatValue(
|
|
414
|
-
delta:
|
|
413
|
+
value: formatValue(_chunkGSRTVIIKjs.metricValue.call(void 0, totalCurrent, metric), metric),
|
|
414
|
+
delta: _chunkGSRTVIIKjs.percentageDelta.call(void 0, _chunkGSRTVIIKjs.metricValue.call(void 0, totalCurrent, metric), _chunkGSRTVIIKjs.metricValue.call(void 0, totalPrevious, metric)),
|
|
415
415
|
decimal
|
|
416
416
|
}
|
|
417
417
|
),
|
|
@@ -445,7 +445,7 @@ function LeadTile({
|
|
|
445
445
|
previousLabel,
|
|
446
446
|
decimal
|
|
447
447
|
}) {
|
|
448
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
448
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardContent, { className: "grid gap-1", children: [
|
|
449
449
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
450
450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -462,7 +462,7 @@ function SupportingTile({
|
|
|
462
462
|
delta,
|
|
463
463
|
decimal
|
|
464
464
|
}) {
|
|
465
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
465
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardContent, { className: "grid gap-1", children: [
|
|
466
466
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
467
467
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
468
468
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -485,7 +485,7 @@ function Delta({
|
|
|
485
485
|
"span",
|
|
486
486
|
{
|
|
487
487
|
"data-testid": testId,
|
|
488
|
-
className:
|
|
488
|
+
className: _chunkPMESKNKLjs.cn.call(void 0,
|
|
489
489
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
490
490
|
increased ? "text-success" : "text-destructive"
|
|
491
491
|
),
|
|
@@ -506,10 +506,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, Delta, "Delta");
|
|
|
506
506
|
|
|
507
507
|
function TokenUsageBreakdownTable({ rows, metric }) {
|
|
508
508
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
509
|
-
const { decimal, metricValue: formatValue, percent, compare } =
|
|
509
|
+
const { decimal, metricValue: formatValue, percent, compare } = _chunkGSRTVIIKjs.useUsageFormatters.call(void 0, );
|
|
510
510
|
const [sort, setSort] = _react.useState.call(void 0, void 0);
|
|
511
511
|
const showActiveUsers = rows.some((row) => row.activeUsers !== void 0);
|
|
512
|
-
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum +
|
|
512
|
+
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum + _chunkGSRTVIIKjs.metricValue.call(void 0, row, metric), 0), [rows, metric]);
|
|
513
513
|
const sortValue = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row, key) => {
|
|
514
514
|
switch (key) {
|
|
515
515
|
case "label":
|
|
@@ -519,9 +519,9 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
519
519
|
case "activeUsers":
|
|
520
520
|
return _nullishCoalesce(row.activeUsers, () => ( 0));
|
|
521
521
|
case "cacheHit":
|
|
522
|
-
return
|
|
522
|
+
return _chunkGSRTVIIKjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn);
|
|
523
523
|
case "share":
|
|
524
|
-
return
|
|
524
|
+
return _chunkGSRTVIIKjs.metricValue.call(void 0, row, metric);
|
|
525
525
|
default:
|
|
526
526
|
return row[key];
|
|
527
527
|
}
|
|
@@ -559,13 +559,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
559
559
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
560
560
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
561
561
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
562
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
563
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Table, { children: [
|
|
563
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableHead, { className: _chunkPMESKNKLjs.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
564
564
|
"button",
|
|
565
565
|
{
|
|
566
566
|
type: "button",
|
|
567
567
|
onClick: () => toggleSort(column.key),
|
|
568
|
-
className:
|
|
568
|
+
className: _chunkPMESKNKLjs.cn.call(void 0,
|
|
569
569
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
570
570
|
column.numeric && "flex-row-reverse"
|
|
571
571
|
),
|
|
@@ -575,20 +575,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
575
575
|
]
|
|
576
576
|
}
|
|
577
577
|
) }, column.key)) }) }),
|
|
578
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
579
|
-
const value =
|
|
578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableBody, { children: sortedRows.map((row) => {
|
|
579
|
+
const value = _chunkGSRTVIIKjs.metricValue.call(void 0, row, metric);
|
|
580
580
|
const share = total > 0 ? value / total * 100 : 0;
|
|
581
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
586
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
587
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
588
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
589
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
591
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
584
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
586
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
587
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
588
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunkGSRTVIIKjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
589
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
590
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
591
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
592
592
|
] }, row.id);
|
|
593
593
|
}) })
|
|
594
594
|
] }) })
|
|
@@ -622,7 +622,7 @@ var operationDescription = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
622
622
|
|
|
623
623
|
function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes = false }) {
|
|
624
624
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
625
|
-
const { metricValue: formatValue, percent } =
|
|
625
|
+
const { metricValue: formatValue, percent } = _chunkGSRTVIIKjs.useUsageFormatters.call(void 0, );
|
|
626
626
|
const renderLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row) => {
|
|
627
627
|
if (row.id === "other") return t("token_usage.admin.other");
|
|
628
628
|
if (!labelsAreOperationTypes) return row.label;
|
|
@@ -644,9 +644,9 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
644
644
|
const label = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) });
|
|
645
645
|
const description = renderDescription(row);
|
|
646
646
|
if (!description) return label;
|
|
647
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
647
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Tooltip, { children: [
|
|
648
648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
649
|
-
|
|
649
|
+
_chunkGSRTVIIKjs.TooltipTrigger,
|
|
650
650
|
{
|
|
651
651
|
"data-testid": `ranked-description-${row.id}`,
|
|
652
652
|
className: "min-w-0 cursor-help justify-self-start truncate",
|
|
@@ -654,19 +654,19 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
654
654
|
children: label
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs", children: description }) })
|
|
658
658
|
] });
|
|
659
659
|
}, "renderLabelCell");
|
|
660
660
|
if (rows.length === 0) {
|
|
661
661
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
|
|
662
662
|
}
|
|
663
|
-
const values = rows.map((row) =>
|
|
663
|
+
const values = rows.map((row) => _chunkGSRTVIIKjs.metricValue.call(void 0, row, metric));
|
|
664
664
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
665
665
|
const max = Math.max(...values, 0);
|
|
666
666
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-0.5", children: rows.map((row, index) => {
|
|
667
667
|
const value = values[index];
|
|
668
668
|
const isOther = row.id === "other";
|
|
669
|
-
const step = isOther ?
|
|
669
|
+
const step = isOther ? _chunkGSRTVIIKjs.SEQUENTIAL_RAMP.length - 1 : Math.min(index, _chunkGSRTVIIKjs.SEQUENTIAL_RAMP.length - 1);
|
|
670
670
|
const width = max > 0 ? value / max * 100 : 0;
|
|
671
671
|
const share = total > 0 ? value / total * 100 : 0;
|
|
672
672
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-3 gap-y-0.5 py-0.5", children: [
|
|
@@ -678,7 +678,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
678
678
|
"data-testid": `ranked-fill-${row.id}`,
|
|
679
679
|
"data-ramp-step": String(step),
|
|
680
680
|
className: "h-full rounded-r-[4px]",
|
|
681
|
-
style: { width: `${width}%`, backgroundColor:
|
|
681
|
+
style: { width: `${width}%`, backgroundColor: _chunkGSRTVIIKjs.SEQUENTIAL_RAMP[step] }
|
|
682
682
|
}
|
|
683
683
|
) })
|
|
684
684
|
] }),
|
|
@@ -728,7 +728,7 @@ var inferGranularity = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (buc
|
|
|
728
728
|
}, "inferGranularity");
|
|
729
729
|
function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
730
730
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
731
|
-
const { compact, bucketDate, metricValue: formatValue } =
|
|
731
|
+
const { compact, bucketDate, metricValue: formatValue } = _chunkGSRTVIIKjs.useUsageFormatters.call(void 0, );
|
|
732
732
|
const { resolvedTheme } = _nextthemes.useTheme.call(void 0, );
|
|
733
733
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
734
734
|
const { chartData, seriesKeys } = _react.useMemo.call(void 0, () => {
|
|
@@ -736,8 +736,8 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
736
736
|
const totals = /* @__PURE__ */ new Map();
|
|
737
737
|
for (const row of rows) totals.set(row.series, (_nullishCoalesce(totals.get(row.series), () => ( 0))) + metricValue2(row, metric));
|
|
738
738
|
const ranked = [...totals.entries()].sort((a, b) => b[1] - a[1]).map(([series]) => series);
|
|
739
|
-
const named = ranked.slice(0,
|
|
740
|
-
const folded = new Set(ranked.slice(
|
|
739
|
+
const named = ranked.slice(0, _chunkGSRTVIIKjs.CATEGORICAL_CEILING);
|
|
740
|
+
const folded = new Set(ranked.slice(_chunkGSRTVIIKjs.CATEGORICAL_CEILING));
|
|
741
741
|
const keys = folded.size > 0 ? [...named, OTHER_SERIES] : named;
|
|
742
742
|
const byBucket = /* @__PURE__ */ new Map();
|
|
743
743
|
for (const row of rows) {
|
|
@@ -777,7 +777,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
777
777
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: className ? `text-muted-foreground text-sm ${className}` : "text-muted-foreground text-sm", children: t.has(key) ? t(key) : "No data in the selected period" });
|
|
778
778
|
}
|
|
779
779
|
const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
|
|
780
|
-
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ?
|
|
780
|
+
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? _chunkGSRTVIIKjs.OTHER_COLOR : _chunkGSRTVIIKjs.seriesColor.call(void 0, index, mode), "seriesColorFor");
|
|
781
781
|
return (
|
|
782
782
|
// The chart is a coordinate system, not prose: recharts lays the axes and the
|
|
783
783
|
// stacked bars out left-to-right, so the whole chart stays an LTR island even
|
|
@@ -786,7 +786,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
786
786
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
787
787
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
788
788
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
789
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
789
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.ChartContainer, { config: chartConfig, className: "aspect-auto h-72 w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _recharts.BarChart, { accessibilityLayer: true, data: chartData, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
|
|
790
790
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
791
791
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
792
|
_recharts.XAxis,
|
|
@@ -810,10 +810,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
810
810
|
}
|
|
811
811
|
),
|
|
812
812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
813
|
-
|
|
813
|
+
_chunkGSRTVIIKjs.ChartTooltip,
|
|
814
814
|
{
|
|
815
815
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
816
|
-
|
|
816
|
+
_chunkGSRTVIIKjs.ChartTooltipContent,
|
|
817
817
|
{
|
|
818
818
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
819
819
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -822,7 +822,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
822
822
|
)
|
|
823
823
|
}
|
|
824
824
|
),
|
|
825
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
825
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.ChartLegendContent, {}) }) : null,
|
|
826
826
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
827
827
|
_recharts.Bar,
|
|
828
828
|
{
|
|
@@ -874,19 +874,19 @@ function TokenUsageAdminContainer() {
|
|
|
874
874
|
[t]
|
|
875
875
|
);
|
|
876
876
|
if (error) {
|
|
877
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
877
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.RoundPageContainer, { module: _chunk4XLDBOSEjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
878
878
|
}
|
|
879
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
879
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.RoundPageContainer, { module: _chunk4XLDBOSEjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true });
|
|
880
880
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
881
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
881
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.RoundPageContainer, { module: _chunk4XLDBOSEjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
882
882
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
883
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
884
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
885
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
886
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
883
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
884
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: [
|
|
885
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
886
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
887
887
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
888
888
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
889
|
-
|
|
889
|
+
_chunkGSRTVIIKjs.Select,
|
|
890
890
|
{
|
|
891
891
|
items: stackByItems,
|
|
892
892
|
value: filters.stackBy,
|
|
@@ -894,29 +894,29 @@ function TokenUsageAdminContainer() {
|
|
|
894
894
|
if (value) setFilters({ stackBy: value });
|
|
895
895
|
},
|
|
896
896
|
children: [
|
|
897
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
898
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
897
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectValue, {}) }),
|
|
898
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
899
899
|
]
|
|
900
900
|
}
|
|
901
901
|
)
|
|
902
902
|
] }) })
|
|
903
903
|
] }),
|
|
904
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
905
905
|
] }),
|
|
906
906
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
908
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
909
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
910
910
|
] }),
|
|
911
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
912
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
911
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
914
914
|
] })
|
|
915
915
|
] }),
|
|
916
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
917
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
918
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
919
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkPMESKNKLjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
917
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
918
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
919
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
920
920
|
TokenUsageRankedBar,
|
|
921
921
|
{
|
|
922
922
|
rows: byCustomerOperation,
|
|
@@ -926,9 +926,9 @@ function TokenUsageAdminContainer() {
|
|
|
926
926
|
}
|
|
927
927
|
) })
|
|
928
928
|
] }),
|
|
929
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
931
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
929
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
931
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
932
932
|
TokenUsageRankedBar,
|
|
933
933
|
{
|
|
934
934
|
rows: byOperation,
|
|
@@ -939,9 +939,9 @@ function TokenUsageAdminContainer() {
|
|
|
939
939
|
) })
|
|
940
940
|
] })
|
|
941
941
|
] }),
|
|
942
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
943
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
944
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
942
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
943
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
944
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
945
945
|
] })
|
|
946
946
|
] }) });
|
|
947
947
|
}
|
|
@@ -954,36 +954,36 @@ function withFilters2(endpoint, filters) {
|
|
|
954
954
|
return endpoint;
|
|
955
955
|
}
|
|
956
956
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters2, "withFilters");
|
|
957
|
-
var TokenUsageReportService = class extends
|
|
957
|
+
var TokenUsageReportService = class extends _chunkPMESKNKLjs.AbstractService {
|
|
958
958
|
static {
|
|
959
959
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageReportService");
|
|
960
960
|
}
|
|
961
961
|
/** Two rows: window "current" and "previous". */
|
|
962
962
|
static async getSummary(filters) {
|
|
963
|
-
const endpoint = withFilters2(new (0,
|
|
963
|
+
const endpoint = withFilters2(new (0, _chunk4XLDBOSEjs.EndpointCreator)({ endpoint: _chunk4XLDBOSEjs.Modules.TokenUsageReportSummary }), filters);
|
|
964
964
|
return this.callApi({
|
|
965
|
-
type:
|
|
965
|
+
type: _chunk4XLDBOSEjs.Modules.TokenUsageReportSummary,
|
|
966
966
|
method: "GET" /* GET */,
|
|
967
967
|
endpoint: endpoint.generate()
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
970
|
static async getTimeline(params) {
|
|
971
|
-
const endpoint = withFilters2(new (0,
|
|
971
|
+
const endpoint = withFilters2(new (0, _chunk4XLDBOSEjs.EndpointCreator)({ endpoint: _chunk4XLDBOSEjs.Modules.TokenUsageReportTimeline }), params);
|
|
972
972
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
973
973
|
return this.callApi({
|
|
974
|
-
type:
|
|
974
|
+
type: _chunk4XLDBOSEjs.Modules.TokenUsageReportTimeline,
|
|
975
975
|
method: "GET" /* GET */,
|
|
976
976
|
endpoint: endpoint.generate()
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
static async getBreakdown(params) {
|
|
980
|
-
const endpoint = withFilters2(new (0,
|
|
980
|
+
const endpoint = withFilters2(new (0, _chunk4XLDBOSEjs.EndpointCreator)({ endpoint: _chunk4XLDBOSEjs.Modules.TokenUsageReportBreakdown }), params);
|
|
981
981
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
982
982
|
if (params.targetLabel) endpoint.addAdditionalParam("targetLabel", params.targetLabel);
|
|
983
983
|
endpoint.addAdditionalParam("metric", params.metric);
|
|
984
984
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
985
985
|
return this.callApi({
|
|
986
|
-
type:
|
|
986
|
+
type: _chunk4XLDBOSEjs.Modules.TokenUsageReportBreakdown,
|
|
987
987
|
method: "GET" /* GET */,
|
|
988
988
|
endpoint: endpoint.generate()
|
|
989
989
|
});
|
|
@@ -1062,7 +1062,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1062
1062
|
|
|
1063
1063
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1064
1064
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-help": "tokenusage.filters", className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1065
|
-
|
|
1065
|
+
_chunkGSRTVIIKjs.DateRangeSelector,
|
|
1066
1066
|
{
|
|
1067
1067
|
onDateChange: (range) => {
|
|
1068
1068
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1095,7 +1095,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1095
1095
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1096
1096
|
}) => {
|
|
1097
1097
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1098
|
-
const generateUrl =
|
|
1098
|
+
const generateUrl = _chunkGSRTVIIKjs.usePageUrlGenerator.call(void 0, );
|
|
1099
1099
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1100
1100
|
const range = defaultRange2();
|
|
1101
1101
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1159,7 +1159,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1159
1159
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1160
1160
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1161
1161
|
);
|
|
1162
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1162
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1163
1163
|
}, "TokenUsageReportProvider");
|
|
1164
1164
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1165
1165
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1179,7 +1179,7 @@ var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1179
1179
|
var ZERO2 = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
1180
1180
|
function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
1181
1181
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1182
|
-
const { decimal, metricValue: formatValue } =
|
|
1182
|
+
const { decimal, metricValue: formatValue } = _chunkGSRTVIIKjs.useUsageFormatters.call(void 0, );
|
|
1183
1183
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (window) => _nullishCoalesce(summary.find((row) => row.window === window), () => ( ZERO2)), "rowFor");
|
|
1184
1184
|
const current = rowFor("current");
|
|
1185
1185
|
const previous = rowFor("previous");
|
|
@@ -1187,15 +1187,15 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1187
1187
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1188
1188
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1189
1189
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1190
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardContent, { className: "grid gap-1", children: [
|
|
1191
1191
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(
|
|
1192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunkGSRTVIIKjs.metricValue.call(void 0, current, metric), metric) }),
|
|
1193
1193
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
1194
1194
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1195
1195
|
Delta2,
|
|
1196
1196
|
{
|
|
1197
1197
|
testId: "tile-used-delta",
|
|
1198
|
-
delta:
|
|
1198
|
+
delta: _chunkGSRTVIIKjs.percentageDelta.call(void 0, _chunkGSRTVIIKjs.metricValue.call(void 0, current, metric), _chunkGSRTVIIKjs.metricValue.call(void 0, previous, metric)),
|
|
1199
1199
|
decimal
|
|
1200
1200
|
}
|
|
1201
1201
|
),
|
|
@@ -1203,21 +1203,21 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1203
1203
|
] })
|
|
1204
1204
|
] }) }),
|
|
1205
1205
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1206
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1206
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardContent, { className: "grid gap-1", children: [
|
|
1207
1207
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1208
1208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className:
|
|
1209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunkPMESKNKLjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
1210
1210
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
1211
1211
|
"/ ",
|
|
1212
1212
|
whole(balances.monthlyCredits)
|
|
1213
1213
|
] })
|
|
1214
1214
|
] })
|
|
1215
1215
|
] }) }),
|
|
1216
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1216
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardContent, { className: "grid gap-1", children: [
|
|
1217
1217
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1218
1218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1219
1219
|
] }) }),
|
|
1220
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1220
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.CardContent, { className: "grid gap-1", children: [
|
|
1221
1221
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1222
1222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1223
1223
|
] }) })
|
|
@@ -1239,7 +1239,7 @@ function Delta2({
|
|
|
1239
1239
|
"span",
|
|
1240
1240
|
{
|
|
1241
1241
|
"data-testid": testId,
|
|
1242
|
-
className:
|
|
1242
|
+
className: _chunkPMESKNKLjs.cn.call(void 0,
|
|
1243
1243
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
1244
1244
|
increased ? "text-warning" : "text-success"
|
|
1245
1245
|
),
|
|
@@ -1259,21 +1259,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1259
1259
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1260
1260
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1261
1261
|
if (error) {
|
|
1262
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1262
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1263
1263
|
}
|
|
1264
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1265
1265
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1266
1266
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1267
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1267
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1268
1268
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1269
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1270
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1271
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1269
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
1270
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1271
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1272
1272
|
] }),
|
|
1273
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1274
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1275
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1276
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1273
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkPMESKNKLjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1274
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
1275
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1276
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1277
1277
|
TokenUsageRankedBar,
|
|
1278
1278
|
{
|
|
1279
1279
|
rows: byOperation,
|
|
@@ -1283,9 +1283,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
) })
|
|
1285
1285
|
] }),
|
|
1286
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1287
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1288
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1286
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGSRTVIIKjs.Card, { children: [
|
|
1287
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardTitle, { children: targetTitle }) }),
|
|
1288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSRTVIIKjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1289
1289
|
] })
|
|
1290
1290
|
] })
|
|
1291
1291
|
] }) });
|
|
@@ -1325,5 +1325,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageReportContainer, "TokenUsageRepor
|
|
|
1325
1325
|
|
|
1326
1326
|
|
|
1327
1327
|
|
|
1328
|
-
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown =
|
|
1328
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunkPMESKNKLjs.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunkPMESKNKLjs.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunkPMESKNKLjs.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunkPMESKNKLjs.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunkPMESKNKLjs.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunkPMESKNKLjs.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageReportBreakdown = _chunkPMESKNKLjs.TokenUsageReportBreakdown; exports.TokenUsageReportContainer = TokenUsageReportContainer; exports.TokenUsageReportFilterBar = TokenUsageReportFilterBar; exports.TokenUsageReportProvider = TokenUsageReportProvider; exports.TokenUsageReportService = TokenUsageReportService; exports.TokenUsageReportSummary = _chunkPMESKNKLjs.TokenUsageReportSummary; exports.TokenUsageReportTiles = TokenUsageReportTiles; exports.TokenUsageReportTimeline = _chunkPMESKNKLjs.TokenUsageReportTimeline; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.configureTokenUsage = _chunkPMESKNKLjs.configureTokenUsage; exports.createUsageFormatters = _chunkGSRTVIIKjs.createUsageFormatters; exports.getTokenUsageCurrency = _chunkPMESKNKLjs.getTokenUsageCurrency; exports.seriesColor = _chunkGSRTVIIKjs.seriesColor; exports.seriesTheme = _chunkGSRTVIIKjs.seriesTheme; exports.tokenUsageModules = _chunkPMESKNKLjs.tokenUsageModules; exports.useTokenUsageAdmin = useTokenUsageAdmin; exports.useTokenUsageReport = useTokenUsageReport; exports.useUsageFormatters = _chunkGSRTVIIKjs.useUsageFormatters;
|
|
1329
1329
|
//# sourceMappingURL=index.js.map
|