@carlonicora/nextjs-jsonapi 5.6.0 → 5.7.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-NEYG5L6W.mjs → BlockNoteEditor-R3WXUFHX.mjs} +4 -4
- package/dist/{BlockNoteEditor-AE3ZTEEH.js → BlockNoteEditor-ZHXXFWUJ.js} +19 -19
- package/dist/{BlockNoteEditor-AE3ZTEEH.js.map → BlockNoteEditor-ZHXXFWUJ.js.map} +1 -1
- package/dist/{BlockNoteViewer-3OUT5UFY.mjs → BlockNoteViewer-BVVN6D3T.mjs} +2 -2
- package/dist/{BlockNoteViewer-4CFKQM7U.js → BlockNoteViewer-SD3ZFIXD.js} +3 -3
- package/dist/{BlockNoteViewer-4CFKQM7U.js.map → BlockNoteViewer-SD3ZFIXD.js.map} +1 -1
- package/dist/billing/index.d.mts +33 -43
- package/dist/billing/index.d.ts +33 -43
- package/dist/billing/index.js +590 -574
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +28 -12
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-3I5AAJXV.js → chunk-2TXE57LE.js} +3 -3
- package/dist/{chunk-3I5AAJXV.js.map → chunk-2TXE57LE.js.map} +1 -1
- package/dist/{chunk-HKZAESS6.js → chunk-5TH2DSAH.js} +17 -12
- package/dist/chunk-5TH2DSAH.js.map +1 -0
- package/dist/{chunk-SFYPXCK4.mjs → chunk-CFB6FHIY.mjs} +638 -536
- package/dist/{chunk-SFYPXCK4.mjs.map → chunk-CFB6FHIY.mjs.map} +1 -1
- package/dist/{chunk-EYA2F6AN.mjs → chunk-FK26NX3S.mjs} +16 -11
- package/dist/chunk-FK26NX3S.mjs.map +1 -0
- package/dist/{chunk-53BAULDP.js → chunk-IJME5SAM.js} +4 -4
- package/dist/{chunk-53BAULDP.js.map → chunk-IJME5SAM.js.map} +1 -1
- package/dist/{chunk-KQHBONL4.mjs → chunk-OKCV4GPJ.mjs} +2 -2
- package/dist/{chunk-BTPUYUQ3.mjs → chunk-RGQYFSJF.mjs} +2 -2
- package/dist/{chunk-Y7RR57EW.mjs → chunk-WCHLCOZG.mjs} +2 -2
- package/dist/{chunk-RL3PL3KV.js → chunk-XOSC3FFP.js} +8 -8
- package/dist/{chunk-RL3PL3KV.js.map → chunk-XOSC3FFP.js.map} +1 -1
- package/dist/{chunk-LQ4DK4JF.js → chunk-ZCOPOO7T.js} +1314 -1212
- package/dist/chunk-ZCOPOO7T.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +9 -3
- package/dist/core/index.d.ts +9 -3
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +9 -1
- package/dist/{format-options-D6c7FNDi.d.mts → currency-DT_dveBx.d.mts} +41 -8
- package/dist/{format-options-BtX3o0Yu.d.ts → currency-pK9eRYRC.d.ts} +41 -8
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- 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.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- 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.js +124 -124
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/core/index.ts +3 -0
- package/src/features/billing/contexts/CouponContext.tsx +0 -2
- package/src/features/billing/stripe-coupon/components/details/CouponDetails.tsx +5 -2
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeEditor.tsx +6 -5
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx +67 -45
- package/src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx +304 -212
- package/src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx +4 -3
- package/src/features/billing/stripe-coupon/data/stripe-coupon.interface.ts +11 -7
- package/src/features/billing/stripe-coupon/data/stripe-coupon.ts +6 -4
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +14 -7
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +2 -2
- package/src/features/billing/stripe-coupon/stripe-coupon-code.module.ts +3 -2
- package/src/features/billing/stripe-coupon/stripe-coupon.module.ts +11 -4
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +1 -1
- package/src/features/billing/stripe-subscription/hooks/wizard-promotion.ts +15 -8
- package/dist/chunk-EYA2F6AN.mjs.map +0 -1
- package/dist/chunk-HKZAESS6.js.map +0 -1
- package/dist/chunk-LQ4DK4JF.js.map +0 -1
- /package/dist/{BlockNoteEditor-NEYG5L6W.mjs.map → BlockNoteEditor-R3WXUFHX.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-3OUT5UFY.mjs.map → BlockNoteViewer-BVVN6D3T.mjs.map} +0 -0
- /package/dist/{chunk-KQHBONL4.mjs.map → chunk-OKCV4GPJ.mjs.map} +0 -0
- /package/dist/{chunk-BTPUYUQ3.mjs.map → chunk-RGQYFSJF.mjs.map} +0 -0
- /package/dist/{chunk-Y7RR57EW.mjs.map → chunk-WCHLCOZG.mjs.map} +0 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk2TXE57LEjs = require('../../chunk-2TXE57LE.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -37,8 +37,8 @@ var _chunk3I5AAJXVjs = require('../../chunk-3I5AAJXV.js');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
require('../../chunk-
|
|
40
|
+
var _chunkZCOPOO7Tjs = require('../../chunk-ZCOPOO7T.js');
|
|
41
|
+
require('../../chunk-XOSC3FFP.js');
|
|
42
42
|
require('../../chunk-G4JR3SFV.js');
|
|
43
43
|
|
|
44
44
|
|
|
@@ -57,7 +57,7 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var
|
|
60
|
+
var _chunk5TH2DSAHjs = require('../../chunk-5TH2DSAH.js');
|
|
61
61
|
require('../../chunk-GHE4VT2R.js');
|
|
62
62
|
require('../../chunk-LXKSUWAV.js');
|
|
63
63
|
require('../../chunk-JTPRJNT2.js');
|
|
@@ -82,7 +82,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
82
82
|
};
|
|
83
83
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
84
84
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
85
|
-
|
|
85
|
+
_chunkZCOPOO7Tjs.DateRangeSelector,
|
|
86
86
|
{
|
|
87
87
|
onDateChange: (range) => {
|
|
88
88
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -117,16 +117,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
119
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
120
|
-
|
|
120
|
+
_chunkZCOPOO7Tjs.Select,
|
|
121
121
|
{
|
|
122
122
|
items: companyItems,
|
|
123
123
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
124
124
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
125
125
|
children: [
|
|
126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
127
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
128
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
129
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
126
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
127
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.SelectContent, { children: [
|
|
128
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
129
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
130
130
|
] })
|
|
131
131
|
]
|
|
132
132
|
}
|
|
@@ -149,13 +149,13 @@ function Segmented({
|
|
|
149
149
|
children: options.map((option) => {
|
|
150
150
|
const selected = option.value === value;
|
|
151
151
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
152
|
-
|
|
152
|
+
_chunkZCOPOO7Tjs.Button,
|
|
153
153
|
{
|
|
154
154
|
type: "button",
|
|
155
155
|
size: "sm",
|
|
156
156
|
variant: selected ? "default" : "ghost",
|
|
157
157
|
"aria-pressed": selected,
|
|
158
|
-
className:
|
|
158
|
+
className: _chunk5TH2DSAHjs.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
159
159
|
onClick: () => onSelect(option.value),
|
|
160
160
|
children: option.label
|
|
161
161
|
},
|
|
@@ -175,36 +175,36 @@ function withFilters(endpoint, filters) {
|
|
|
175
175
|
return endpoint;
|
|
176
176
|
}
|
|
177
177
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
178
|
-
var TokenUsageAdminService = class extends
|
|
178
|
+
var TokenUsageAdminService = class extends _chunk5TH2DSAHjs.AbstractService {
|
|
179
179
|
static {
|
|
180
180
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
181
181
|
}
|
|
182
182
|
/** Six rows: {customer, platform, total} × {current, previous}. */
|
|
183
183
|
static async getSummary(filters) {
|
|
184
|
-
const endpoint = withFilters(new (0,
|
|
184
|
+
const endpoint = withFilters(new (0, _chunk5TH2DSAHjs.EndpointCreator)({ endpoint: _chunk5TH2DSAHjs.Modules.TokenUsageAdminSummary }), filters);
|
|
185
185
|
return this.callApi({
|
|
186
|
-
type:
|
|
186
|
+
type: _chunk5TH2DSAHjs.Modules.TokenUsageAdminSummary,
|
|
187
187
|
method: "GET" /* GET */,
|
|
188
188
|
endpoint: endpoint.generate()
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
static async getTimeline(params) {
|
|
192
|
-
const endpoint = withFilters(new (0,
|
|
192
|
+
const endpoint = withFilters(new (0, _chunk5TH2DSAHjs.EndpointCreator)({ endpoint: _chunk5TH2DSAHjs.Modules.TokenUsageAdminTimeline }), params);
|
|
193
193
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
194
194
|
endpoint.addAdditionalParam("stackBy", params.stackBy);
|
|
195
195
|
return this.callApi({
|
|
196
|
-
type:
|
|
196
|
+
type: _chunk5TH2DSAHjs.Modules.TokenUsageAdminTimeline,
|
|
197
197
|
method: "GET" /* GET */,
|
|
198
198
|
endpoint: endpoint.generate()
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
201
|
static async getBreakdown(params) {
|
|
202
|
-
const endpoint = withFilters(new (0,
|
|
202
|
+
const endpoint = withFilters(new (0, _chunk5TH2DSAHjs.EndpointCreator)({ endpoint: _chunk5TH2DSAHjs.Modules.TokenUsageAdminBreakdown }), params);
|
|
203
203
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
204
204
|
endpoint.addAdditionalParam("scope", params.scope);
|
|
205
205
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
206
206
|
return this.callApi({
|
|
207
|
-
type:
|
|
207
|
+
type: _chunk5TH2DSAHjs.Modules.TokenUsageAdminBreakdown,
|
|
208
208
|
method: "GET" /* GET */,
|
|
209
209
|
endpoint: endpoint.generate()
|
|
210
210
|
});
|
|
@@ -341,7 +341,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
341
341
|
error
|
|
342
342
|
]
|
|
343
343
|
);
|
|
344
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
344
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
345
345
|
}, "TokenUsageAdminProvider");
|
|
346
346
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
347
347
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -362,7 +362,7 @@ var _lucidereact = require('lucide-react');
|
|
|
362
362
|
var ZERO = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
363
363
|
function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
364
364
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
365
|
-
const { decimal, metricValue: formatValue, currency, percent } =
|
|
365
|
+
const { decimal, metricValue: formatValue, currency, percent } = _chunk2TXE57LEjs.useUsageFormatters.call(void 0, );
|
|
366
366
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (scope, window) => _nullishCoalesce(summary.find((r) => r.scope === scope && r.window === window), () => ( ZERO)), "rowFor");
|
|
367
367
|
const customerCurrent = rowFor("customer", "current");
|
|
368
368
|
const customerPrevious = rowFor("customer", "previous");
|
|
@@ -371,16 +371,16 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
371
371
|
const totalCurrent = rowFor("total", "current");
|
|
372
372
|
const totalPrevious = rowFor("total", "previous");
|
|
373
373
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
374
|
-
const cacheHit =
|
|
374
|
+
const cacheHit = _chunk2TXE57LEjs.cacheHitPercentage.call(void 0, totalCurrent.cached, totalCurrent.tokensIn);
|
|
375
375
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
376
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
376
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk5TH2DSAHjs.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
377
377
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
378
378
|
LeadTile,
|
|
379
379
|
{
|
|
380
380
|
testId: "tile-customer",
|
|
381
381
|
label: t("token_usage.admin.customer_spend"),
|
|
382
|
-
value: formatValue(
|
|
383
|
-
delta:
|
|
382
|
+
value: formatValue(_chunk2TXE57LEjs.metricValue.call(void 0, customerCurrent, metric), metric),
|
|
383
|
+
delta: _chunk2TXE57LEjs.percentageDelta.call(void 0, _chunk2TXE57LEjs.metricValue.call(void 0, customerCurrent, metric), _chunk2TXE57LEjs.metricValue.call(void 0, customerPrevious, metric)),
|
|
384
384
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
385
385
|
decimal
|
|
386
386
|
}
|
|
@@ -390,8 +390,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
390
390
|
{
|
|
391
391
|
testId: "tile-platform",
|
|
392
392
|
label: t("token_usage.admin.platform_spend"),
|
|
393
|
-
value: formatValue(
|
|
394
|
-
delta:
|
|
393
|
+
value: formatValue(_chunk2TXE57LEjs.metricValue.call(void 0, platformCurrent, metric), metric),
|
|
394
|
+
delta: _chunk2TXE57LEjs.percentageDelta.call(void 0, _chunk2TXE57LEjs.metricValue.call(void 0, platformCurrent, metric), _chunk2TXE57LEjs.metricValue.call(void 0, platformPrevious, metric)),
|
|
395
395
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
396
396
|
decimal
|
|
397
397
|
}
|
|
@@ -403,8 +403,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
403
403
|
{
|
|
404
404
|
testId: "tile-total",
|
|
405
405
|
label: t("token_usage.admin.total_cost"),
|
|
406
|
-
value: formatValue(
|
|
407
|
-
delta:
|
|
406
|
+
value: formatValue(_chunk2TXE57LEjs.metricValue.call(void 0, totalCurrent, metric), metric),
|
|
407
|
+
delta: _chunk2TXE57LEjs.percentageDelta.call(void 0, _chunk2TXE57LEjs.metricValue.call(void 0, totalCurrent, metric), _chunk2TXE57LEjs.metricValue.call(void 0, totalPrevious, metric)),
|
|
408
408
|
decimal
|
|
409
409
|
}
|
|
410
410
|
),
|
|
@@ -438,7 +438,7 @@ function LeadTile({
|
|
|
438
438
|
previousLabel,
|
|
439
439
|
decimal
|
|
440
440
|
}) {
|
|
441
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
441
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardContent, { className: "grid gap-1", children: [
|
|
442
442
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
443
443
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
444
444
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -455,7 +455,7 @@ function SupportingTile({
|
|
|
455
455
|
delta,
|
|
456
456
|
decimal
|
|
457
457
|
}) {
|
|
458
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
458
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardContent, { className: "grid gap-1", children: [
|
|
459
459
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
460
460
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
461
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -478,7 +478,7 @@ function Delta({
|
|
|
478
478
|
"span",
|
|
479
479
|
{
|
|
480
480
|
"data-testid": testId,
|
|
481
|
-
className:
|
|
481
|
+
className: _chunk5TH2DSAHjs.cn.call(void 0,
|
|
482
482
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
483
483
|
increased ? "text-success" : "text-destructive"
|
|
484
484
|
),
|
|
@@ -499,10 +499,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, Delta, "Delta");
|
|
|
499
499
|
|
|
500
500
|
function TokenUsageBreakdownTable({ rows, metric }) {
|
|
501
501
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
502
|
-
const { decimal, metricValue: formatValue, percent, compare } =
|
|
502
|
+
const { decimal, metricValue: formatValue, percent, compare } = _chunk2TXE57LEjs.useUsageFormatters.call(void 0, );
|
|
503
503
|
const [sort, setSort] = _react.useState.call(void 0, void 0);
|
|
504
504
|
const showActiveUsers = rows.some((row) => row.activeUsers !== void 0);
|
|
505
|
-
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum +
|
|
505
|
+
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum + _chunk2TXE57LEjs.metricValue.call(void 0, row, metric), 0), [rows, metric]);
|
|
506
506
|
const sortValue = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row, key) => {
|
|
507
507
|
switch (key) {
|
|
508
508
|
case "label":
|
|
@@ -512,9 +512,9 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
512
512
|
case "activeUsers":
|
|
513
513
|
return _nullishCoalesce(row.activeUsers, () => ( 0));
|
|
514
514
|
case "cacheHit":
|
|
515
|
-
return
|
|
515
|
+
return _chunk2TXE57LEjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn);
|
|
516
516
|
case "share":
|
|
517
|
-
return
|
|
517
|
+
return _chunk2TXE57LEjs.metricValue.call(void 0, row, metric);
|
|
518
518
|
default:
|
|
519
519
|
return row[key];
|
|
520
520
|
}
|
|
@@ -552,13 +552,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
552
552
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
553
553
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
554
554
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
555
|
-
/* @__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,
|
|
556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
555
|
+
/* @__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, _chunkZCOPOO7Tjs.Table, { children: [
|
|
556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableHead, { className: _chunk5TH2DSAHjs.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
557
557
|
"button",
|
|
558
558
|
{
|
|
559
559
|
type: "button",
|
|
560
560
|
onClick: () => toggleSort(column.key),
|
|
561
|
-
className:
|
|
561
|
+
className: _chunk5TH2DSAHjs.cn.call(void 0,
|
|
562
562
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
563
563
|
column.numeric && "flex-row-reverse"
|
|
564
564
|
),
|
|
@@ -568,20 +568,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }, column.key)) }) }),
|
|
571
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
572
|
-
const value =
|
|
571
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableBody, { children: sortedRows.map((row) => {
|
|
572
|
+
const value = _chunk2TXE57LEjs.metricValue.call(void 0, row, metric);
|
|
573
573
|
const share = total > 0 ? value / total * 100 : 0;
|
|
574
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
575
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
576
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
577
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
578
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
579
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
-
/* @__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,
|
|
574
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
576
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
577
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
579
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
580
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunk2TXE57LEjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
584
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
585
585
|
] }, row.id);
|
|
586
586
|
}) })
|
|
587
587
|
] }) })
|
|
@@ -610,7 +610,7 @@ var operationLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (type,
|
|
|
610
610
|
|
|
611
611
|
function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes = false }) {
|
|
612
612
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
613
|
-
const { metricValue: formatValue, percent } =
|
|
613
|
+
const { metricValue: formatValue, percent } = _chunk2TXE57LEjs.useUsageFormatters.call(void 0, );
|
|
614
614
|
const renderLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row) => {
|
|
615
615
|
if (row.id === "other") return t("token_usage.admin.other");
|
|
616
616
|
if (!labelsAreOperationTypes) return row.label;
|
|
@@ -623,13 +623,13 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
623
623
|
if (rows.length === 0) {
|
|
624
624
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
|
|
625
625
|
}
|
|
626
|
-
const values = rows.map((row) =>
|
|
626
|
+
const values = rows.map((row) => _chunk2TXE57LEjs.metricValue.call(void 0, row, metric));
|
|
627
627
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
628
628
|
const max = Math.max(...values, 0);
|
|
629
629
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-0.5", children: rows.map((row, index) => {
|
|
630
630
|
const value = values[index];
|
|
631
631
|
const isOther = row.id === "other";
|
|
632
|
-
const step = isOther ?
|
|
632
|
+
const step = isOther ? _chunk2TXE57LEjs.SEQUENTIAL_RAMP.length - 1 : Math.min(index, _chunk2TXE57LEjs.SEQUENTIAL_RAMP.length - 1);
|
|
633
633
|
const width = max > 0 ? value / max * 100 : 0;
|
|
634
634
|
const share = total > 0 ? value / total * 100 : 0;
|
|
635
635
|
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: [
|
|
@@ -641,7 +641,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
641
641
|
"data-testid": `ranked-fill-${row.id}`,
|
|
642
642
|
"data-ramp-step": String(step),
|
|
643
643
|
className: "h-full rounded-r-[4px]",
|
|
644
|
-
style: { width: `${width}%`, backgroundColor:
|
|
644
|
+
style: { width: `${width}%`, backgroundColor: _chunk2TXE57LEjs.SEQUENTIAL_RAMP[step] }
|
|
645
645
|
}
|
|
646
646
|
) })
|
|
647
647
|
] }),
|
|
@@ -691,7 +691,7 @@ var inferGranularity = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (buc
|
|
|
691
691
|
}, "inferGranularity");
|
|
692
692
|
function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
693
693
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
694
|
-
const { compact, bucketDate, metricValue: formatValue } =
|
|
694
|
+
const { compact, bucketDate, metricValue: formatValue } = _chunk2TXE57LEjs.useUsageFormatters.call(void 0, );
|
|
695
695
|
const { resolvedTheme } = _nextthemes.useTheme.call(void 0, );
|
|
696
696
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
697
697
|
const { chartData, seriesKeys } = _react.useMemo.call(void 0, () => {
|
|
@@ -699,8 +699,8 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
699
699
|
const totals = /* @__PURE__ */ new Map();
|
|
700
700
|
for (const row of rows) totals.set(row.series, (_nullishCoalesce(totals.get(row.series), () => ( 0))) + metricValue2(row, metric));
|
|
701
701
|
const ranked = [...totals.entries()].sort((a, b) => b[1] - a[1]).map(([series]) => series);
|
|
702
|
-
const named = ranked.slice(0,
|
|
703
|
-
const folded = new Set(ranked.slice(
|
|
702
|
+
const named = ranked.slice(0, _chunk2TXE57LEjs.CATEGORICAL_CEILING);
|
|
703
|
+
const folded = new Set(ranked.slice(_chunk2TXE57LEjs.CATEGORICAL_CEILING));
|
|
704
704
|
const keys = folded.size > 0 ? [...named, OTHER_SERIES] : named;
|
|
705
705
|
const byBucket = /* @__PURE__ */ new Map();
|
|
706
706
|
for (const row of rows) {
|
|
@@ -740,7 +740,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
740
740
|
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" });
|
|
741
741
|
}
|
|
742
742
|
const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
|
|
743
|
-
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ?
|
|
743
|
+
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? _chunk2TXE57LEjs.OTHER_COLOR : _chunk2TXE57LEjs.seriesColor.call(void 0, index, mode), "seriesColorFor");
|
|
744
744
|
return (
|
|
745
745
|
// The chart is a coordinate system, not prose: recharts lays the axes and the
|
|
746
746
|
// stacked bars out left-to-right, so the whole chart stays an LTR island even
|
|
@@ -749,7 +749,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
749
749
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
750
750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
751
751
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.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: [
|
|
753
753
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
754
754
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
755
755
|
_recharts.XAxis,
|
|
@@ -773,10 +773,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
773
773
|
}
|
|
774
774
|
),
|
|
775
775
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
776
|
-
|
|
776
|
+
_chunkZCOPOO7Tjs.ChartTooltip,
|
|
777
777
|
{
|
|
778
778
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
779
|
-
|
|
779
|
+
_chunkZCOPOO7Tjs.ChartTooltipContent,
|
|
780
780
|
{
|
|
781
781
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
782
782
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -785,7 +785,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
785
785
|
)
|
|
786
786
|
}
|
|
787
787
|
),
|
|
788
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
788
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.ChartLegendContent, {}) }) : null,
|
|
789
789
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
790
790
|
_recharts.Bar,
|
|
791
791
|
{
|
|
@@ -837,19 +837,19 @@ function TokenUsageAdminContainer() {
|
|
|
837
837
|
[t]
|
|
838
838
|
);
|
|
839
839
|
if (error) {
|
|
840
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
840
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.RoundPageContainer, { module: _chunk5TH2DSAHjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
841
841
|
}
|
|
842
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
842
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.RoundPageContainer, { module: _chunk5TH2DSAHjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true });
|
|
843
843
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
844
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
844
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.RoundPageContainer, { module: _chunk5TH2DSAHjs.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: [
|
|
845
845
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
846
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
847
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
848
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
849
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
846
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
847
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: [
|
|
848
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
849
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
850
850
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
851
851
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
852
|
-
|
|
852
|
+
_chunkZCOPOO7Tjs.Select,
|
|
853
853
|
{
|
|
854
854
|
items: stackByItems,
|
|
855
855
|
value: filters.stackBy,
|
|
@@ -857,29 +857,29 @@ function TokenUsageAdminContainer() {
|
|
|
857
857
|
if (value) setFilters({ stackBy: value });
|
|
858
858
|
},
|
|
859
859
|
children: [
|
|
860
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
861
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
860
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectValue, {}) }),
|
|
861
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
862
862
|
]
|
|
863
863
|
}
|
|
864
864
|
)
|
|
865
865
|
] }) })
|
|
866
866
|
] }),
|
|
867
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
867
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
868
868
|
] }),
|
|
869
869
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
870
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
871
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
870
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
871
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
872
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
873
873
|
] }),
|
|
874
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
875
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
876
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
874
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
875
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
876
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
877
877
|
] })
|
|
878
878
|
] }),
|
|
879
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
880
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
879
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk5TH2DSAHjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
880
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
882
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
883
883
|
TokenUsageRankedBar,
|
|
884
884
|
{
|
|
885
885
|
rows: byCustomerOperation,
|
|
@@ -889,9 +889,9 @@ function TokenUsageAdminContainer() {
|
|
|
889
889
|
}
|
|
890
890
|
) })
|
|
891
891
|
] }),
|
|
892
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
893
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
892
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
894
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
895
895
|
TokenUsageRankedBar,
|
|
896
896
|
{
|
|
897
897
|
rows: byOperation,
|
|
@@ -902,9 +902,9 @@ function TokenUsageAdminContainer() {
|
|
|
902
902
|
) })
|
|
903
903
|
] })
|
|
904
904
|
] }),
|
|
905
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
906
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
905
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
906
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
908
908
|
] })
|
|
909
909
|
] }) });
|
|
910
910
|
}
|
|
@@ -917,36 +917,36 @@ function withFilters2(endpoint, filters) {
|
|
|
917
917
|
return endpoint;
|
|
918
918
|
}
|
|
919
919
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters2, "withFilters");
|
|
920
|
-
var TokenUsageReportService = class extends
|
|
920
|
+
var TokenUsageReportService = class extends _chunk5TH2DSAHjs.AbstractService {
|
|
921
921
|
static {
|
|
922
922
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageReportService");
|
|
923
923
|
}
|
|
924
924
|
/** Two rows: window "current" and "previous". */
|
|
925
925
|
static async getSummary(filters) {
|
|
926
|
-
const endpoint = withFilters2(new (0,
|
|
926
|
+
const endpoint = withFilters2(new (0, _chunk5TH2DSAHjs.EndpointCreator)({ endpoint: _chunk5TH2DSAHjs.Modules.TokenUsageReportSummary }), filters);
|
|
927
927
|
return this.callApi({
|
|
928
|
-
type:
|
|
928
|
+
type: _chunk5TH2DSAHjs.Modules.TokenUsageReportSummary,
|
|
929
929
|
method: "GET" /* GET */,
|
|
930
930
|
endpoint: endpoint.generate()
|
|
931
931
|
});
|
|
932
932
|
}
|
|
933
933
|
static async getTimeline(params) {
|
|
934
|
-
const endpoint = withFilters2(new (0,
|
|
934
|
+
const endpoint = withFilters2(new (0, _chunk5TH2DSAHjs.EndpointCreator)({ endpoint: _chunk5TH2DSAHjs.Modules.TokenUsageReportTimeline }), params);
|
|
935
935
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
936
936
|
return this.callApi({
|
|
937
|
-
type:
|
|
937
|
+
type: _chunk5TH2DSAHjs.Modules.TokenUsageReportTimeline,
|
|
938
938
|
method: "GET" /* GET */,
|
|
939
939
|
endpoint: endpoint.generate()
|
|
940
940
|
});
|
|
941
941
|
}
|
|
942
942
|
static async getBreakdown(params) {
|
|
943
|
-
const endpoint = withFilters2(new (0,
|
|
943
|
+
const endpoint = withFilters2(new (0, _chunk5TH2DSAHjs.EndpointCreator)({ endpoint: _chunk5TH2DSAHjs.Modules.TokenUsageReportBreakdown }), params);
|
|
944
944
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
945
945
|
if (params.targetLabel) endpoint.addAdditionalParam("targetLabel", params.targetLabel);
|
|
946
946
|
endpoint.addAdditionalParam("metric", params.metric);
|
|
947
947
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
948
948
|
return this.callApi({
|
|
949
|
-
type:
|
|
949
|
+
type: _chunk5TH2DSAHjs.Modules.TokenUsageReportBreakdown,
|
|
950
950
|
method: "GET" /* GET */,
|
|
951
951
|
endpoint: endpoint.generate()
|
|
952
952
|
});
|
|
@@ -1025,7 +1025,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1025
1025
|
|
|
1026
1026
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1027
1027
|
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,
|
|
1028
|
-
|
|
1028
|
+
_chunkZCOPOO7Tjs.DateRangeSelector,
|
|
1029
1029
|
{
|
|
1030
1030
|
onDateChange: (range) => {
|
|
1031
1031
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1058,7 +1058,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1058
1058
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1059
1059
|
}) => {
|
|
1060
1060
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1061
|
-
const generateUrl =
|
|
1061
|
+
const generateUrl = _chunkZCOPOO7Tjs.usePageUrlGenerator.call(void 0, );
|
|
1062
1062
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1063
1063
|
const range = defaultRange2();
|
|
1064
1064
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1122,7 +1122,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1122
1122
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1123
1123
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1124
1124
|
);
|
|
1125
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1125
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1126
1126
|
}, "TokenUsageReportProvider");
|
|
1127
1127
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1128
1128
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1142,7 +1142,7 @@ var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1142
1142
|
var ZERO2 = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
1143
1143
|
function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
1144
1144
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1145
|
-
const { decimal, metricValue: formatValue } =
|
|
1145
|
+
const { decimal, metricValue: formatValue } = _chunk2TXE57LEjs.useUsageFormatters.call(void 0, );
|
|
1146
1146
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (window) => _nullishCoalesce(summary.find((row) => row.window === window), () => ( ZERO2)), "rowFor");
|
|
1147
1147
|
const current = rowFor("current");
|
|
1148
1148
|
const previous = rowFor("previous");
|
|
@@ -1150,15 +1150,15 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1150
1150
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1151
1151
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1152
1152
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1153
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1153
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardContent, { className: "grid gap-1", children: [
|
|
1154
1154
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(
|
|
1155
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunk2TXE57LEjs.metricValue.call(void 0, current, metric), metric) }),
|
|
1156
1156
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
1157
1157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1158
1158
|
Delta2,
|
|
1159
1159
|
{
|
|
1160
1160
|
testId: "tile-used-delta",
|
|
1161
|
-
delta:
|
|
1161
|
+
delta: _chunk2TXE57LEjs.percentageDelta.call(void 0, _chunk2TXE57LEjs.metricValue.call(void 0, current, metric), _chunk2TXE57LEjs.metricValue.call(void 0, previous, metric)),
|
|
1162
1162
|
decimal
|
|
1163
1163
|
}
|
|
1164
1164
|
),
|
|
@@ -1166,21 +1166,21 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1166
1166
|
] })
|
|
1167
1167
|
] }) }),
|
|
1168
1168
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1169
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1169
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardContent, { className: "grid gap-1", children: [
|
|
1170
1170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1171
1171
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1172
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className:
|
|
1172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunk5TH2DSAHjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
1173
1173
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
1174
1174
|
"/ ",
|
|
1175
1175
|
whole(balances.monthlyCredits)
|
|
1176
1176
|
] })
|
|
1177
1177
|
] })
|
|
1178
1178
|
] }) }),
|
|
1179
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1179
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardContent, { className: "grid gap-1", children: [
|
|
1180
1180
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1181
1181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1182
1182
|
] }) }),
|
|
1183
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1183
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.CardContent, { className: "grid gap-1", children: [
|
|
1184
1184
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1185
1185
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1186
1186
|
] }) })
|
|
@@ -1202,7 +1202,7 @@ function Delta2({
|
|
|
1202
1202
|
"span",
|
|
1203
1203
|
{
|
|
1204
1204
|
"data-testid": testId,
|
|
1205
|
-
className:
|
|
1205
|
+
className: _chunk5TH2DSAHjs.cn.call(void 0,
|
|
1206
1206
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
1207
1207
|
increased ? "text-warning" : "text-success"
|
|
1208
1208
|
),
|
|
@@ -1222,21 +1222,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1222
1222
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1223
1223
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1224
1224
|
if (error) {
|
|
1225
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1225
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1226
1226
|
}
|
|
1227
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1227
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1228
1228
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1229
1229
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1230
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1230
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1231
1231
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1232
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1234
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1232
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
1233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1235
1235
|
] }),
|
|
1236
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1237
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1238
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1239
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1236
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk5TH2DSAHjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1237
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
1238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1239
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1240
1240
|
TokenUsageRankedBar,
|
|
1241
1241
|
{
|
|
1242
1242
|
rows: byOperation,
|
|
@@ -1246,9 +1246,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
) })
|
|
1248
1248
|
] }),
|
|
1249
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1250
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1251
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1249
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkZCOPOO7Tjs.Card, { children: [
|
|
1250
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardTitle, { children: targetTitle }) }),
|
|
1251
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZCOPOO7Tjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1252
1252
|
] })
|
|
1253
1253
|
] })
|
|
1254
1254
|
] }) });
|
|
@@ -1286,5 +1286,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageReportContainer, "TokenUsageRepor
|
|
|
1286
1286
|
|
|
1287
1287
|
|
|
1288
1288
|
|
|
1289
|
-
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown =
|
|
1289
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunk5TH2DSAHjs.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunk5TH2DSAHjs.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunk5TH2DSAHjs.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunk5TH2DSAHjs.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunk5TH2DSAHjs.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunk5TH2DSAHjs.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageReportBreakdown = _chunk5TH2DSAHjs.TokenUsageReportBreakdown; exports.TokenUsageReportContainer = TokenUsageReportContainer; exports.TokenUsageReportFilterBar = TokenUsageReportFilterBar; exports.TokenUsageReportProvider = TokenUsageReportProvider; exports.TokenUsageReportService = TokenUsageReportService; exports.TokenUsageReportSummary = _chunk5TH2DSAHjs.TokenUsageReportSummary; exports.TokenUsageReportTiles = TokenUsageReportTiles; exports.TokenUsageReportTimeline = _chunk5TH2DSAHjs.TokenUsageReportTimeline; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.configureTokenUsage = _chunk5TH2DSAHjs.configureTokenUsage; exports.createUsageFormatters = _chunk2TXE57LEjs.createUsageFormatters; exports.getTokenUsageCurrency = _chunk5TH2DSAHjs.getTokenUsageCurrency; exports.tokenUsageModules = _chunk5TH2DSAHjs.tokenUsageModules; exports.useTokenUsageAdmin = useTokenUsageAdmin; exports.useTokenUsageReport = useTokenUsageReport; exports.useUsageFormatters = _chunk2TXE57LEjs.useUsageFormatters;
|
|
1290
1290
|
//# sourceMappingURL=index.js.map
|