@carlonicora/nextjs-jsonapi 6.2.0 → 6.4.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/{AssistantMessageInterface-S7oyERTT.d.mts → AssistantMessageInterface-0ZQ1EJKO.d.mts} +1 -1
- package/dist/{AssistantMessageInterface-DHJJO_Z_.d.ts → AssistantMessageInterface-CA-hZ5Wj.d.ts} +1 -1
- package/dist/{BlockNoteEditor-Q757ZLCO.js → BlockNoteEditor-CT4XUXPC.js} +19 -19
- package/dist/{BlockNoteEditor-Q757ZLCO.js.map → BlockNoteEditor-CT4XUXPC.js.map} +1 -1
- package/dist/{BlockNoteEditor-D6VMXRZH.mjs → BlockNoteEditor-M6UQRVRK.mjs} +4 -4
- package/dist/{BlockNoteViewer-KG4CIJC5.js → BlockNoteViewer-MFLWF3Y2.js} +3 -3
- package/dist/{BlockNoteViewer-KG4CIJC5.js.map → BlockNoteViewer-MFLWF3Y2.js.map} +1 -1
- package/dist/{BlockNoteViewer-GI5LVQHZ.mjs → BlockNoteViewer-XZJ5Y7WN.mjs} +2 -2
- package/dist/{BlogPostInterface-BB_4wcDR.d.mts → BlogPostInterface-BN2mXc46.d.mts} +1 -1
- package/dist/{BlogPostInterface-bWAT1rfR.d.ts → BlogPostInterface-CTGfsR1I.d.ts} +1 -1
- package/dist/{auth.interface-CSzJ1oP1.d.ts → auth.interface-D5606g19.d.ts} +1 -1
- package/dist/{auth.interface-DD4uQv2K.d.mts → auth.interface-tsOuc0Fi.d.mts} +1 -1
- package/dist/billing/index.d.mts +3 -3
- package/dist/billing/index.d.ts +3 -3
- package/dist/billing/index.js +501 -493
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +13 -5
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-QKDPCZ3G.mjs → chunk-3FD6Y734.mjs} +73 -15
- package/dist/chunk-3FD6Y734.mjs.map +1 -0
- package/dist/{chunk-3P3IYUWQ.js → chunk-DSGP6GC3.js} +8 -8
- package/dist/{chunk-3P3IYUWQ.js.map → chunk-DSGP6GC3.js.map} +1 -1
- package/dist/{chunk-MHBE4KQR.mjs → chunk-DYOSXIEL.mjs} +26 -21
- package/dist/chunk-DYOSXIEL.mjs.map +1 -0
- package/dist/{chunk-S332ZCIE.js → chunk-ELQHE2DK.js} +27 -22
- package/dist/chunk-ELQHE2DK.js.map +1 -0
- package/dist/{chunk-HLW3SUMD.mjs → chunk-O2TEUH5S.mjs} +2 -2
- package/dist/{chunk-UEWDYVLW.js → chunk-QJIDORHM.js} +4 -4
- package/dist/{chunk-UEWDYVLW.js.map → chunk-QJIDORHM.js.map} +1 -1
- package/dist/{chunk-CUNSPLOD.mjs → chunk-RUJCWOJE.mjs} +2 -2
- package/dist/{chunk-6PW3562E.mjs → chunk-TIT4CJYQ.mjs} +1233 -1181
- package/dist/chunk-TIT4CJYQ.mjs.map +1 -0
- package/dist/{chunk-GSHMGL6N.js → chunk-XZCCIKX3.js} +151 -93
- package/dist/chunk-XZCCIKX3.js.map +1 -0
- package/dist/{chunk-XQEYBESH.js → chunk-Y7JIQNM6.js} +922 -870
- package/dist/chunk-Y7JIQNM6.js.map +1 -0
- package/dist/client/index.d.mts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +22 -6
- package/dist/components/index.d.ts +22 -6
- package/dist/components/index.js +10 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -4
- package/dist/contexts/index.d.mts +5 -5
- package/dist/contexts/index.d.ts +5 -5
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +23 -13
- package/dist/core/index.d.ts +23 -13
- package/dist/core/index.js +8 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +7 -1
- package/dist/{currency-DrEVd_Xs.d.mts → currency-BhuEoBOn.d.mts} +2 -115
- package/dist/{currency-8ErEC39n.d.ts → currency-CBgZkS0u.d.ts} +2 -115
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.d.mts +2 -2
- package/dist/features/analytics/index.d.ts +2 -2
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.d.mts +4 -4
- package/dist/features/blog/index.d.ts +4 -4
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.d.mts +4 -4
- package/dist/features/blog/server.d.ts +4 -4
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.d.mts +123 -1
- package/dist/features/tokenusage/index.d.ts +123 -1
- package/dist/features/tokenusage/index.js +130 -127
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +7 -4
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/{notification.interface-BB6GPpZY.d.mts → notification.interface-CF5h90U2.d.mts} +1 -1
- package/dist/{notification.interface-CmAGrijJ.d.ts → notification.interface-DQReXAD7.d.ts} +1 -1
- package/dist/{s3.service-Bz_K-tjz.d.ts → s3.service-BTCpmp5g.d.ts} +11 -4
- package/dist/{s3.service-D5zNCEW3.d.mts → s3.service-CzFBDEuQ.d.mts} +11 -4
- package/dist/server/index.d.mts +5 -5
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/stripe-price.interface-D6mKjAdr.d.mts +132 -0
- package/dist/stripe-price.interface-DGqcklFJ.d.ts +132 -0
- package/dist/{useSocket-B0H9pmmH.d.ts → useSocket-BM3q9A0C.d.ts} +1 -1
- package/dist/{useSocket-B5RQb6v2.d.mts → useSocket-CwSoq6VS.d.mts} +1 -1
- package/dist/{user.interface-CIWGlbqM.d.mts → user.interface-BYnGJ7ss.d.mts} +37 -2
- package/dist/{user.interface-C0ZdsBZj.d.ts → user.interface-BqPjVyJI.d.ts} +37 -2
- package/messages/en.json +8 -0
- package/messages/it.json +8 -0
- package/package.json +1 -1
- package/src/components/containers/RoundPageContainer.tsx +7 -2
- package/src/components/index.ts +5 -0
- package/src/features/billing/components/containers/BillingDashboardContainer.tsx +20 -3
- package/src/features/billing/components/widgets/CreditWarningBanner.tsx +93 -0
- package/src/features/billing/data/credit-warning.spec.ts +96 -0
- package/src/features/billing/data/credit-warning.ts +57 -0
- package/src/features/billing/data/index.ts +3 -0
- package/src/features/billing/i18n-keys.ts +6 -0
- package/src/features/company/data/company.interface.ts +11 -0
- package/src/features/company/data/company.service.ts +17 -0
- package/src/features/company/data/company.spec.ts +29 -0
- package/src/features/company/data/company.ts +31 -0
- package/src/features/tokenusage/index.ts +5 -0
- package/dist/chunk-6PW3562E.mjs.map +0 -1
- package/dist/chunk-GSHMGL6N.js.map +0 -1
- package/dist/chunk-MHBE4KQR.mjs.map +0 -1
- package/dist/chunk-QKDPCZ3G.mjs.map +0 -1
- package/dist/chunk-S332ZCIE.js.map +0 -1
- package/dist/chunk-XQEYBESH.js.map +0 -1
- package/dist/feature.interface-BO25VLlx.d.ts +0 -19
- package/dist/feature.interface-CXb1-vNq.d.mts +0 -19
- /package/dist/{BlockNoteEditor-D6VMXRZH.mjs.map → BlockNoteEditor-M6UQRVRK.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-GI5LVQHZ.mjs.map → BlockNoteViewer-XZJ5Y7WN.mjs.map} +0 -0
- /package/dist/{chunk-HLW3SUMD.mjs.map → chunk-O2TEUH5S.mjs.map} +0 -0
- /package/dist/{chunk-CUNSPLOD.mjs.map → chunk-RUJCWOJE.mjs.map} +0 -0
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var _chunkS332ZCIEjs = require('../../chunk-S332ZCIE.js');
|
|
13
12
|
|
|
13
|
+
var _chunkELQHE2DKjs = require('../../chunk-ELQHE2DK.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -40,8 +40,9 @@ var _chunkS332ZCIEjs = require('../../chunk-S332ZCIE.js');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
require('../../chunk-
|
|
43
|
+
|
|
44
|
+
var _chunkY7JIQNM6js = require('../../chunk-Y7JIQNM6.js');
|
|
45
|
+
require('../../chunk-DSGP6GC3.js');
|
|
45
46
|
require('../../chunk-G4JR3SFV.js');
|
|
46
47
|
|
|
47
48
|
|
|
@@ -60,7 +61,7 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
|
|
63
|
-
var
|
|
64
|
+
var _chunkXZCCIKX3js = require('../../chunk-XZCCIKX3.js');
|
|
64
65
|
require('../../chunk-GHE4VT2R.js');
|
|
65
66
|
require('../../chunk-LXKSUWAV.js');
|
|
66
67
|
require('../../chunk-JTPRJNT2.js');
|
|
@@ -85,7 +86,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
85
86
|
};
|
|
86
87
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
87
88
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
88
|
-
|
|
89
|
+
_chunkY7JIQNM6js.DateRangeSelector,
|
|
89
90
|
{
|
|
90
91
|
onDateChange: (range) => {
|
|
91
92
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -120,16 +121,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
120
121
|
}
|
|
121
122
|
),
|
|
122
123
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
123
|
-
|
|
124
|
+
_chunkY7JIQNM6js.Select,
|
|
124
125
|
{
|
|
125
126
|
items: companyItems,
|
|
126
127
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
127
128
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
128
129
|
children: [
|
|
129
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
130
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
131
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
132
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
131
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.SelectContent, { children: [
|
|
132
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
133
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
133
134
|
] })
|
|
134
135
|
]
|
|
135
136
|
}
|
|
@@ -152,13 +153,13 @@ function Segmented({
|
|
|
152
153
|
children: options.map((option) => {
|
|
153
154
|
const selected = option.value === value;
|
|
154
155
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
155
|
-
|
|
156
|
+
_chunkY7JIQNM6js.Button,
|
|
156
157
|
{
|
|
157
158
|
type: "button",
|
|
158
159
|
size: "sm",
|
|
159
160
|
variant: selected ? "default" : "ghost",
|
|
160
161
|
"aria-pressed": selected,
|
|
161
|
-
className:
|
|
162
|
+
className: _chunkXZCCIKX3js.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
162
163
|
onClick: () => onSelect(option.value),
|
|
163
164
|
children: option.label
|
|
164
165
|
},
|
|
@@ -178,36 +179,36 @@ function withFilters(endpoint, filters) {
|
|
|
178
179
|
return endpoint;
|
|
179
180
|
}
|
|
180
181
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
181
|
-
var TokenUsageAdminService = class extends
|
|
182
|
+
var TokenUsageAdminService = class extends _chunkXZCCIKX3js.AbstractService {
|
|
182
183
|
static {
|
|
183
184
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
184
185
|
}
|
|
185
186
|
/** Six rows: {customer, platform, total} × {current, previous}. */
|
|
186
187
|
static async getSummary(filters) {
|
|
187
|
-
const endpoint = withFilters(new (0,
|
|
188
|
+
const endpoint = withFilters(new (0, _chunkXZCCIKX3js.EndpointCreator)({ endpoint: _chunkXZCCIKX3js.Modules.TokenUsageAdminSummary }), filters);
|
|
188
189
|
return this.callApi({
|
|
189
|
-
type:
|
|
190
|
+
type: _chunkXZCCIKX3js.Modules.TokenUsageAdminSummary,
|
|
190
191
|
method: "GET" /* GET */,
|
|
191
192
|
endpoint: endpoint.generate()
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
195
|
static async getTimeline(params) {
|
|
195
|
-
const endpoint = withFilters(new (0,
|
|
196
|
+
const endpoint = withFilters(new (0, _chunkXZCCIKX3js.EndpointCreator)({ endpoint: _chunkXZCCIKX3js.Modules.TokenUsageAdminTimeline }), params);
|
|
196
197
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
197
198
|
endpoint.addAdditionalParam("stackBy", params.stackBy);
|
|
198
199
|
return this.callApi({
|
|
199
|
-
type:
|
|
200
|
+
type: _chunkXZCCIKX3js.Modules.TokenUsageAdminTimeline,
|
|
200
201
|
method: "GET" /* GET */,
|
|
201
202
|
endpoint: endpoint.generate()
|
|
202
203
|
});
|
|
203
204
|
}
|
|
204
205
|
static async getBreakdown(params) {
|
|
205
|
-
const endpoint = withFilters(new (0,
|
|
206
|
+
const endpoint = withFilters(new (0, _chunkXZCCIKX3js.EndpointCreator)({ endpoint: _chunkXZCCIKX3js.Modules.TokenUsageAdminBreakdown }), params);
|
|
206
207
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
207
208
|
endpoint.addAdditionalParam("scope", params.scope);
|
|
208
209
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
209
210
|
return this.callApi({
|
|
210
|
-
type:
|
|
211
|
+
type: _chunkXZCCIKX3js.Modules.TokenUsageAdminBreakdown,
|
|
211
212
|
method: "GET" /* GET */,
|
|
212
213
|
endpoint: endpoint.generate()
|
|
213
214
|
});
|
|
@@ -344,7 +345,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
344
345
|
error
|
|
345
346
|
]
|
|
346
347
|
);
|
|
347
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
348
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
348
349
|
}, "TokenUsageAdminProvider");
|
|
349
350
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
350
351
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -365,7 +366,7 @@ var _lucidereact = require('lucide-react');
|
|
|
365
366
|
var ZERO = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
366
367
|
function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
367
368
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
368
|
-
const { decimal, metricValue: formatValue, currency, percent } =
|
|
369
|
+
const { decimal, metricValue: formatValue, currency, percent } = _chunkELQHE2DKjs.useUsageFormatters.call(void 0, );
|
|
369
370
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (scope, window) => _nullishCoalesce(summary.find((r) => r.scope === scope && r.window === window), () => ( ZERO)), "rowFor");
|
|
370
371
|
const customerCurrent = rowFor("customer", "current");
|
|
371
372
|
const customerPrevious = rowFor("customer", "previous");
|
|
@@ -374,16 +375,16 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
374
375
|
const totalCurrent = rowFor("total", "current");
|
|
375
376
|
const totalPrevious = rowFor("total", "previous");
|
|
376
377
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
377
|
-
const cacheHit =
|
|
378
|
+
const cacheHit = _chunkELQHE2DKjs.cacheHitPercentage.call(void 0, totalCurrent.cached, totalCurrent.tokensIn);
|
|
378
379
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
379
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
380
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkXZCCIKX3js.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
380
381
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
381
382
|
LeadTile,
|
|
382
383
|
{
|
|
383
384
|
testId: "tile-customer",
|
|
384
385
|
label: t("token_usage.admin.customer_spend"),
|
|
385
|
-
value: formatValue(
|
|
386
|
-
delta:
|
|
386
|
+
value: formatValue(_chunkELQHE2DKjs.metricValue.call(void 0, customerCurrent, metric), metric),
|
|
387
|
+
delta: _chunkELQHE2DKjs.percentageDelta.call(void 0, _chunkELQHE2DKjs.metricValue.call(void 0, customerCurrent, metric), _chunkELQHE2DKjs.metricValue.call(void 0, customerPrevious, metric)),
|
|
387
388
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
388
389
|
decimal
|
|
389
390
|
}
|
|
@@ -393,8 +394,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
393
394
|
{
|
|
394
395
|
testId: "tile-platform",
|
|
395
396
|
label: t("token_usage.admin.platform_spend"),
|
|
396
|
-
value: formatValue(
|
|
397
|
-
delta:
|
|
397
|
+
value: formatValue(_chunkELQHE2DKjs.metricValue.call(void 0, platformCurrent, metric), metric),
|
|
398
|
+
delta: _chunkELQHE2DKjs.percentageDelta.call(void 0, _chunkELQHE2DKjs.metricValue.call(void 0, platformCurrent, metric), _chunkELQHE2DKjs.metricValue.call(void 0, platformPrevious, metric)),
|
|
398
399
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
399
400
|
decimal
|
|
400
401
|
}
|
|
@@ -406,8 +407,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
406
407
|
{
|
|
407
408
|
testId: "tile-total",
|
|
408
409
|
label: t("token_usage.admin.total_cost"),
|
|
409
|
-
value: formatValue(
|
|
410
|
-
delta:
|
|
410
|
+
value: formatValue(_chunkELQHE2DKjs.metricValue.call(void 0, totalCurrent, metric), metric),
|
|
411
|
+
delta: _chunkELQHE2DKjs.percentageDelta.call(void 0, _chunkELQHE2DKjs.metricValue.call(void 0, totalCurrent, metric), _chunkELQHE2DKjs.metricValue.call(void 0, totalPrevious, metric)),
|
|
411
412
|
decimal
|
|
412
413
|
}
|
|
413
414
|
),
|
|
@@ -441,7 +442,7 @@ function LeadTile({
|
|
|
441
442
|
previousLabel,
|
|
442
443
|
decimal
|
|
443
444
|
}) {
|
|
444
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardContent, { className: "grid gap-1", children: [
|
|
445
446
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
446
447
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
447
448
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -458,7 +459,7 @@ function SupportingTile({
|
|
|
458
459
|
delta,
|
|
459
460
|
decimal
|
|
460
461
|
}) {
|
|
461
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
462
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardContent, { className: "grid gap-1", children: [
|
|
462
463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
463
464
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
464
465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -481,7 +482,7 @@ function Delta({
|
|
|
481
482
|
"span",
|
|
482
483
|
{
|
|
483
484
|
"data-testid": testId,
|
|
484
|
-
className:
|
|
485
|
+
className: _chunkXZCCIKX3js.cn.call(void 0,
|
|
485
486
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
486
487
|
increased ? "text-success" : "text-destructive"
|
|
487
488
|
),
|
|
@@ -502,10 +503,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, Delta, "Delta");
|
|
|
502
503
|
|
|
503
504
|
function TokenUsageBreakdownTable({ rows, metric }) {
|
|
504
505
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
505
|
-
const { decimal, metricValue: formatValue, percent, compare } =
|
|
506
|
+
const { decimal, metricValue: formatValue, percent, compare } = _chunkELQHE2DKjs.useUsageFormatters.call(void 0, );
|
|
506
507
|
const [sort, setSort] = _react.useState.call(void 0, void 0);
|
|
507
508
|
const showActiveUsers = rows.some((row) => row.activeUsers !== void 0);
|
|
508
|
-
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum +
|
|
509
|
+
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum + _chunkELQHE2DKjs.metricValue.call(void 0, row, metric), 0), [rows, metric]);
|
|
509
510
|
const sortValue = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row, key) => {
|
|
510
511
|
switch (key) {
|
|
511
512
|
case "label":
|
|
@@ -515,9 +516,9 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
515
516
|
case "activeUsers":
|
|
516
517
|
return _nullishCoalesce(row.activeUsers, () => ( 0));
|
|
517
518
|
case "cacheHit":
|
|
518
|
-
return
|
|
519
|
+
return _chunkELQHE2DKjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn);
|
|
519
520
|
case "share":
|
|
520
|
-
return
|
|
521
|
+
return _chunkELQHE2DKjs.metricValue.call(void 0, row, metric);
|
|
521
522
|
default:
|
|
522
523
|
return row[key];
|
|
523
524
|
}
|
|
@@ -555,13 +556,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
555
556
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
556
557
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
557
558
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
558
|
-
/* @__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,
|
|
559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
559
|
+
/* @__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, _chunkY7JIQNM6js.Table, { children: [
|
|
560
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableHead, { className: _chunkXZCCIKX3js.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
560
561
|
"button",
|
|
561
562
|
{
|
|
562
563
|
type: "button",
|
|
563
564
|
onClick: () => toggleSort(column.key),
|
|
564
|
-
className:
|
|
565
|
+
className: _chunkXZCCIKX3js.cn.call(void 0,
|
|
565
566
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
566
567
|
column.numeric && "flex-row-reverse"
|
|
567
568
|
),
|
|
@@ -571,20 +572,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
571
572
|
]
|
|
572
573
|
}
|
|
573
574
|
) }, column.key)) }) }),
|
|
574
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
575
|
-
const value =
|
|
575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableBody, { children: sortedRows.map((row) => {
|
|
576
|
+
const value = _chunkELQHE2DKjs.metricValue.call(void 0, row, metric);
|
|
576
577
|
const share = total > 0 ? value / total * 100 : 0;
|
|
577
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
578
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
579
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
/* @__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,
|
|
578
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
579
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
580
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
581
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
584
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunkELQHE2DKjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
586
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
587
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
588
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
588
589
|
] }, row.id);
|
|
589
590
|
}) })
|
|
590
591
|
] }) })
|
|
@@ -618,7 +619,7 @@ var operationDescription = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
618
619
|
|
|
619
620
|
function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes = false }) {
|
|
620
621
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
621
|
-
const { metricValue: formatValue, percent } =
|
|
622
|
+
const { metricValue: formatValue, percent } = _chunkELQHE2DKjs.useUsageFormatters.call(void 0, );
|
|
622
623
|
const renderLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row) => {
|
|
623
624
|
if (row.id === "other") return t("token_usage.admin.other");
|
|
624
625
|
if (!labelsAreOperationTypes) return row.label;
|
|
@@ -640,9 +641,9 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
640
641
|
const label = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) });
|
|
641
642
|
const description = renderDescription(row);
|
|
642
643
|
if (!description) return label;
|
|
643
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
644
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Tooltip, { children: [
|
|
644
645
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
645
|
-
|
|
646
|
+
_chunkY7JIQNM6js.TooltipTrigger,
|
|
646
647
|
{
|
|
647
648
|
"data-testid": `ranked-description-${row.id}`,
|
|
648
649
|
className: "min-w-0 cursor-help justify-self-start truncate",
|
|
@@ -650,19 +651,19 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
650
651
|
children: label
|
|
651
652
|
}
|
|
652
653
|
),
|
|
653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
654
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs", children: description }) })
|
|
654
655
|
] });
|
|
655
656
|
}, "renderLabelCell");
|
|
656
657
|
if (rows.length === 0) {
|
|
657
658
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
|
|
658
659
|
}
|
|
659
|
-
const values = rows.map((row) =>
|
|
660
|
+
const values = rows.map((row) => _chunkELQHE2DKjs.metricValue.call(void 0, row, metric));
|
|
660
661
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
661
662
|
const max = Math.max(...values, 0);
|
|
662
663
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-0.5", children: rows.map((row, index) => {
|
|
663
664
|
const value = values[index];
|
|
664
665
|
const isOther = row.id === "other";
|
|
665
|
-
const step = isOther ?
|
|
666
|
+
const step = isOther ? _chunkELQHE2DKjs.SEQUENTIAL_RAMP.length - 1 : Math.min(index, _chunkELQHE2DKjs.SEQUENTIAL_RAMP.length - 1);
|
|
666
667
|
const width = max > 0 ? value / max * 100 : 0;
|
|
667
668
|
const share = total > 0 ? value / total * 100 : 0;
|
|
668
669
|
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: [
|
|
@@ -674,7 +675,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
674
675
|
"data-testid": `ranked-fill-${row.id}`,
|
|
675
676
|
"data-ramp-step": String(step),
|
|
676
677
|
className: "h-full rounded-r-[4px]",
|
|
677
|
-
style: { width: `${width}%`, backgroundColor:
|
|
678
|
+
style: { width: `${width}%`, backgroundColor: _chunkELQHE2DKjs.SEQUENTIAL_RAMP[step] }
|
|
678
679
|
}
|
|
679
680
|
) })
|
|
680
681
|
] }),
|
|
@@ -724,7 +725,7 @@ var inferGranularity = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (buc
|
|
|
724
725
|
}, "inferGranularity");
|
|
725
726
|
function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
726
727
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
727
|
-
const { compact, bucketDate, metricValue: formatValue } =
|
|
728
|
+
const { compact, bucketDate, metricValue: formatValue } = _chunkELQHE2DKjs.useUsageFormatters.call(void 0, );
|
|
728
729
|
const { resolvedTheme } = _nextthemes.useTheme.call(void 0, );
|
|
729
730
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
730
731
|
const { chartData, seriesKeys } = _react.useMemo.call(void 0, () => {
|
|
@@ -732,8 +733,8 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
732
733
|
const totals = /* @__PURE__ */ new Map();
|
|
733
734
|
for (const row of rows) totals.set(row.series, (_nullishCoalesce(totals.get(row.series), () => ( 0))) + metricValue2(row, metric));
|
|
734
735
|
const ranked = [...totals.entries()].sort((a, b) => b[1] - a[1]).map(([series]) => series);
|
|
735
|
-
const named = ranked.slice(0,
|
|
736
|
-
const folded = new Set(ranked.slice(
|
|
736
|
+
const named = ranked.slice(0, _chunkELQHE2DKjs.CATEGORICAL_CEILING);
|
|
737
|
+
const folded = new Set(ranked.slice(_chunkELQHE2DKjs.CATEGORICAL_CEILING));
|
|
737
738
|
const keys = folded.size > 0 ? [...named, OTHER_SERIES] : named;
|
|
738
739
|
const byBucket = /* @__PURE__ */ new Map();
|
|
739
740
|
for (const row of rows) {
|
|
@@ -773,7 +774,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
773
774
|
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" });
|
|
774
775
|
}
|
|
775
776
|
const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
|
|
776
|
-
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ?
|
|
777
|
+
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? _chunkELQHE2DKjs.OTHER_COLOR : _chunkELQHE2DKjs.seriesColor.call(void 0, index, mode), "seriesColorFor");
|
|
777
778
|
return (
|
|
778
779
|
// The chart is a coordinate system, not prose: recharts lays the axes and the
|
|
779
780
|
// stacked bars out left-to-right, so the whole chart stays an LTR island even
|
|
@@ -782,7 +783,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
782
783
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
783
784
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
784
785
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
785
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
786
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.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: [
|
|
786
787
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
787
788
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
788
789
|
_recharts.XAxis,
|
|
@@ -806,10 +807,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
806
807
|
}
|
|
807
808
|
),
|
|
808
809
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
809
|
-
|
|
810
|
+
_chunkY7JIQNM6js.ChartTooltip,
|
|
810
811
|
{
|
|
811
812
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
812
|
-
|
|
813
|
+
_chunkY7JIQNM6js.ChartTooltipContent,
|
|
813
814
|
{
|
|
814
815
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
815
816
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -818,7 +819,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
818
819
|
)
|
|
819
820
|
}
|
|
820
821
|
),
|
|
821
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
822
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.ChartLegendContent, {}) }) : null,
|
|
822
823
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
823
824
|
_recharts.Bar,
|
|
824
825
|
{
|
|
@@ -870,19 +871,19 @@ function TokenUsageAdminContainer() {
|
|
|
870
871
|
[t]
|
|
871
872
|
);
|
|
872
873
|
if (error) {
|
|
873
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
874
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.RoundPageContainer, { module: _chunkXZCCIKX3js.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
874
875
|
}
|
|
875
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
876
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.RoundPageContainer, { module: _chunkXZCCIKX3js.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true });
|
|
876
877
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
877
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
878
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.RoundPageContainer, { module: _chunkXZCCIKX3js.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: [
|
|
878
879
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
879
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
880
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
880
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: [
|
|
882
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
883
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
883
884
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
884
885
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
885
|
-
|
|
886
|
+
_chunkY7JIQNM6js.Select,
|
|
886
887
|
{
|
|
887
888
|
items: stackByItems,
|
|
888
889
|
value: filters.stackBy,
|
|
@@ -890,29 +891,29 @@ function TokenUsageAdminContainer() {
|
|
|
890
891
|
if (value) setFilters({ stackBy: value });
|
|
891
892
|
},
|
|
892
893
|
children: [
|
|
893
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectValue, {}) }),
|
|
895
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
895
896
|
]
|
|
896
897
|
}
|
|
897
898
|
)
|
|
898
899
|
] }) })
|
|
899
900
|
] }),
|
|
900
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
901
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
901
902
|
] }),
|
|
902
903
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
903
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
904
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
905
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
905
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
906
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
906
907
|
] }),
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
908
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
908
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
909
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
910
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
910
911
|
] })
|
|
911
912
|
] }),
|
|
912
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
915
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkXZCCIKX3js.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
915
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
916
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
917
|
TokenUsageRankedBar,
|
|
917
918
|
{
|
|
918
919
|
rows: byCustomerOperation,
|
|
@@ -922,9 +923,9 @@ function TokenUsageAdminContainer() {
|
|
|
922
923
|
}
|
|
923
924
|
) })
|
|
924
925
|
] }),
|
|
925
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
926
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
927
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
928
929
|
TokenUsageRankedBar,
|
|
929
930
|
{
|
|
930
931
|
rows: byOperation,
|
|
@@ -935,9 +936,9 @@ function TokenUsageAdminContainer() {
|
|
|
935
936
|
) })
|
|
936
937
|
] })
|
|
937
938
|
] }),
|
|
938
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
939
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
940
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
939
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
940
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
941
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
941
942
|
] })
|
|
942
943
|
] }) });
|
|
943
944
|
}
|
|
@@ -950,36 +951,36 @@ function withFilters2(endpoint, filters) {
|
|
|
950
951
|
return endpoint;
|
|
951
952
|
}
|
|
952
953
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters2, "withFilters");
|
|
953
|
-
var TokenUsageReportService = class extends
|
|
954
|
+
var TokenUsageReportService = class extends _chunkXZCCIKX3js.AbstractService {
|
|
954
955
|
static {
|
|
955
956
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageReportService");
|
|
956
957
|
}
|
|
957
958
|
/** Two rows: window "current" and "previous". */
|
|
958
959
|
static async getSummary(filters) {
|
|
959
|
-
const endpoint = withFilters2(new (0,
|
|
960
|
+
const endpoint = withFilters2(new (0, _chunkXZCCIKX3js.EndpointCreator)({ endpoint: _chunkXZCCIKX3js.Modules.TokenUsageReportSummary }), filters);
|
|
960
961
|
return this.callApi({
|
|
961
|
-
type:
|
|
962
|
+
type: _chunkXZCCIKX3js.Modules.TokenUsageReportSummary,
|
|
962
963
|
method: "GET" /* GET */,
|
|
963
964
|
endpoint: endpoint.generate()
|
|
964
965
|
});
|
|
965
966
|
}
|
|
966
967
|
static async getTimeline(params) {
|
|
967
|
-
const endpoint = withFilters2(new (0,
|
|
968
|
+
const endpoint = withFilters2(new (0, _chunkXZCCIKX3js.EndpointCreator)({ endpoint: _chunkXZCCIKX3js.Modules.TokenUsageReportTimeline }), params);
|
|
968
969
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
969
970
|
return this.callApi({
|
|
970
|
-
type:
|
|
971
|
+
type: _chunkXZCCIKX3js.Modules.TokenUsageReportTimeline,
|
|
971
972
|
method: "GET" /* GET */,
|
|
972
973
|
endpoint: endpoint.generate()
|
|
973
974
|
});
|
|
974
975
|
}
|
|
975
976
|
static async getBreakdown(params) {
|
|
976
|
-
const endpoint = withFilters2(new (0,
|
|
977
|
+
const endpoint = withFilters2(new (0, _chunkXZCCIKX3js.EndpointCreator)({ endpoint: _chunkXZCCIKX3js.Modules.TokenUsageReportBreakdown }), params);
|
|
977
978
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
978
979
|
if (params.targetLabel) endpoint.addAdditionalParam("targetLabel", params.targetLabel);
|
|
979
980
|
endpoint.addAdditionalParam("metric", params.metric);
|
|
980
981
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
981
982
|
return this.callApi({
|
|
982
|
-
type:
|
|
983
|
+
type: _chunkXZCCIKX3js.Modules.TokenUsageReportBreakdown,
|
|
983
984
|
method: "GET" /* GET */,
|
|
984
985
|
endpoint: endpoint.generate()
|
|
985
986
|
});
|
|
@@ -1058,7 +1059,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1058
1059
|
|
|
1059
1060
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1060
1061
|
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,
|
|
1061
|
-
|
|
1062
|
+
_chunkY7JIQNM6js.DateRangeSelector,
|
|
1062
1063
|
{
|
|
1063
1064
|
onDateChange: (range) => {
|
|
1064
1065
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1091,7 +1092,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1091
1092
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1092
1093
|
}) => {
|
|
1093
1094
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1094
|
-
const generateUrl =
|
|
1095
|
+
const generateUrl = _chunkY7JIQNM6js.usePageUrlGenerator.call(void 0, );
|
|
1095
1096
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1096
1097
|
const range = defaultRange2();
|
|
1097
1098
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1155,7 +1156,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1155
1156
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1156
1157
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1157
1158
|
);
|
|
1158
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1159
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1159
1160
|
}, "TokenUsageReportProvider");
|
|
1160
1161
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1161
1162
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1175,7 +1176,7 @@ var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1175
1176
|
var ZERO2 = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
1176
1177
|
function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
1177
1178
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1178
|
-
const { decimal, metricValue: formatValue } =
|
|
1179
|
+
const { decimal, metricValue: formatValue } = _chunkELQHE2DKjs.useUsageFormatters.call(void 0, );
|
|
1179
1180
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (window) => _nullishCoalesce(summary.find((row) => row.window === window), () => ( ZERO2)), "rowFor");
|
|
1180
1181
|
const current = rowFor("current");
|
|
1181
1182
|
const previous = rowFor("previous");
|
|
@@ -1183,15 +1184,15 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1183
1184
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1184
1185
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1185
1186
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1186
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1187
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardContent, { className: "grid gap-1", children: [
|
|
1187
1188
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1188
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(
|
|
1189
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunkELQHE2DKjs.metricValue.call(void 0, current, metric), metric) }),
|
|
1189
1190
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
1190
1191
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1191
1192
|
Delta2,
|
|
1192
1193
|
{
|
|
1193
1194
|
testId: "tile-used-delta",
|
|
1194
|
-
delta:
|
|
1195
|
+
delta: _chunkELQHE2DKjs.percentageDelta.call(void 0, _chunkELQHE2DKjs.metricValue.call(void 0, current, metric), _chunkELQHE2DKjs.metricValue.call(void 0, previous, metric)),
|
|
1195
1196
|
decimal
|
|
1196
1197
|
}
|
|
1197
1198
|
),
|
|
@@ -1199,21 +1200,21 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1199
1200
|
] })
|
|
1200
1201
|
] }) }),
|
|
1201
1202
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1202
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1203
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardContent, { className: "grid gap-1", children: [
|
|
1203
1204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1204
1205
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1205
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className:
|
|
1206
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunkXZCCIKX3js.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
1206
1207
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
1207
1208
|
"/ ",
|
|
1208
1209
|
whole(balances.monthlyCredits)
|
|
1209
1210
|
] })
|
|
1210
1211
|
] })
|
|
1211
1212
|
] }) }),
|
|
1212
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1213
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardContent, { className: "grid gap-1", children: [
|
|
1213
1214
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1214
1215
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1215
1216
|
] }) }),
|
|
1216
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.CardContent, { className: "grid gap-1", children: [
|
|
1217
1218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1218
1219
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1219
1220
|
] }) })
|
|
@@ -1235,7 +1236,7 @@ function Delta2({
|
|
|
1235
1236
|
"span",
|
|
1236
1237
|
{
|
|
1237
1238
|
"data-testid": testId,
|
|
1238
|
-
className:
|
|
1239
|
+
className: _chunkXZCCIKX3js.cn.call(void 0,
|
|
1239
1240
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
1240
1241
|
increased ? "text-warning" : "text-success"
|
|
1241
1242
|
),
|
|
@@ -1255,21 +1256,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1255
1256
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1256
1257
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1257
1258
|
if (error) {
|
|
1258
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1259
1260
|
}
|
|
1260
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1261
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1261
1262
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1262
1263
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1263
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1264
1265
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1265
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1267
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1266
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
1267
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1268
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1268
1269
|
] }),
|
|
1269
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1270
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1271
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1272
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1270
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkXZCCIKX3js.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1271
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
1272
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1273
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1273
1274
|
TokenUsageRankedBar,
|
|
1274
1275
|
{
|
|
1275
1276
|
rows: byOperation,
|
|
@@ -1279,9 +1280,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1279
1280
|
}
|
|
1280
1281
|
) })
|
|
1281
1282
|
] }),
|
|
1282
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1283
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1284
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1283
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkY7JIQNM6js.Card, { children: [
|
|
1284
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardTitle, { children: targetTitle }) }),
|
|
1285
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkY7JIQNM6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1285
1286
|
] })
|
|
1286
1287
|
] })
|
|
1287
1288
|
] }) });
|
|
@@ -1319,5 +1320,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageReportContainer, "TokenUsageRepor
|
|
|
1319
1320
|
|
|
1320
1321
|
|
|
1321
1322
|
|
|
1322
|
-
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunkXZCCIKX3js.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunkXZCCIKX3js.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunkXZCCIKX3js.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunkXZCCIKX3js.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunkXZCCIKX3js.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunkXZCCIKX3js.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageReportBreakdown = _chunkXZCCIKX3js.TokenUsageReportBreakdown; exports.TokenUsageReportContainer = TokenUsageReportContainer; exports.TokenUsageReportFilterBar = TokenUsageReportFilterBar; exports.TokenUsageReportProvider = TokenUsageReportProvider; exports.TokenUsageReportService = TokenUsageReportService; exports.TokenUsageReportSummary = _chunkXZCCIKX3js.TokenUsageReportSummary; exports.TokenUsageReportTiles = TokenUsageReportTiles; exports.TokenUsageReportTimeline = _chunkXZCCIKX3js.TokenUsageReportTimeline; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.configureTokenUsage = _chunkXZCCIKX3js.configureTokenUsage; exports.createUsageFormatters = _chunkELQHE2DKjs.createUsageFormatters; exports.getTokenUsageCurrency = _chunkXZCCIKX3js.getTokenUsageCurrency; exports.seriesColor = _chunkELQHE2DKjs.seriesColor; exports.seriesTheme = _chunkELQHE2DKjs.seriesTheme; exports.tokenUsageModules = _chunkXZCCIKX3js.tokenUsageModules; exports.useTokenUsageAdmin = useTokenUsageAdmin; exports.useTokenUsageReport = useTokenUsageReport; exports.useUsageFormatters = _chunkELQHE2DKjs.useUsageFormatters;
|
|
1323
1326
|
//# sourceMappingURL=index.js.map
|