@carlonicora/nextjs-jsonapi 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- var _chunkUGNLKDI6js = require('../../chunk-UGNLKDI6.js');
29
+ var _chunk5GVBUTS4js = require('../../chunk-5GVBUTS4.js');
30
30
  require('../../chunk-JKGEJGSD.js');
31
31
 
32
32
 
@@ -70,7 +70,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
70
70
  };
71
71
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
72
72
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
73
- _chunkUGNLKDI6js.DateRangeSelector,
73
+ _chunk5GVBUTS4js.DateRangeSelector,
74
74
  {
75
75
  onDateChange: (range) => {
76
76
  if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
@@ -105,16 +105,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
105
105
  }
106
106
  ),
107
107
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
108
- _chunkUGNLKDI6js.Select,
108
+ _chunk5GVBUTS4js.Select,
109
109
  {
110
110
  items: companyItems,
111
111
  value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
112
112
  onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
113
113
  children: [
114
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
115
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.SelectContent, { children: [
116
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
117
- companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectItem, { value: company.id, children: company.label }, company.id))
114
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
115
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.SelectContent, { children: [
116
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
117
+ companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectItem, { value: company.id, children: company.label }, company.id))
118
118
  ] })
119
119
  ]
120
120
  }
@@ -137,7 +137,7 @@ function Segmented({
137
137
  children: options.map((option) => {
138
138
  const selected = option.value === value;
139
139
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
140
- _chunkUGNLKDI6js.Button,
140
+ _chunk5GVBUTS4js.Button,
141
141
  {
142
142
  type: "button",
143
143
  size: "sm",
@@ -219,7 +219,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
219
219
  pageUrl = TOKEN_USAGE_ADMIN_PAGE_URL
220
220
  }) => {
221
221
  const t = _nextintl.useTranslations.call(void 0, );
222
- const generateUrl = _chunkUGNLKDI6js.usePageUrlGenerator.call(void 0, );
222
+ const generateUrl = _chunk5GVBUTS4js.usePageUrlGenerator.call(void 0, );
223
223
  const [filters, setFilterState] = _react.useState.call(void 0, () => {
224
224
  const range = defaultRange();
225
225
  return {
@@ -337,7 +337,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
337
337
  error
338
338
  ]
339
339
  );
340
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
340
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
341
341
  }, "TokenUsageAdminProvider");
342
342
  var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
343
343
  const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
@@ -497,7 +497,7 @@ function LeadTile({
497
497
  previousLabel,
498
498
  decimal
499
499
  }) {
500
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardContent, { className: "grid gap-1", children: [
500
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "grid gap-1", children: [
501
501
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
502
502
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
503
503
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
@@ -514,7 +514,7 @@ function SupportingTile({
514
514
  delta,
515
515
  decimal
516
516
  }) {
517
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardContent, { className: "grid gap-1", children: [
517
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "grid gap-1", children: [
518
518
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
519
519
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
520
520
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
@@ -611,8 +611,8 @@ function TokenUsageBreakdownTable({ rows, metric }) {
611
611
  // The package's <Table> wraps itself in an `overflow-x-clip` container, which
612
612
  // would swallow the overflow before this scroller ever saw it — hence the
613
613
  // child override. Wide metric tables must scroll, never widen the page.
614
- /* @__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, _chunkUGNLKDI6js.Table, { children: [
615
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableHead, { className: _chunk53B6NPGAjs.cn.call(void 0, column.numeric && "text-right"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
614
+ /* @__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, _chunk5GVBUTS4js.Table, { children: [
615
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableHead, { className: _chunk53B6NPGAjs.cn.call(void 0, column.numeric && "text-right"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
616
616
  "button",
617
617
  {
618
618
  type: "button",
@@ -627,20 +627,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
627
627
  ]
628
628
  }
629
629
  ) }, column.key)) }) }),
630
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableBody, { children: sortedRows.map((row) => {
630
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableBody, { children: sortedRows.map((row) => {
631
631
  const value = metricValue(row, metric);
632
632
  const share = total > 0 ? value / total * 100 : 0;
633
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
634
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
635
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
636
- showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
637
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.calls, 0) }),
638
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
639
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
640
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(cacheHitPercentage(row.cached, row.tokensIn)) }),
641
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
642
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
643
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(share) })
633
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
634
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
635
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
636
+ showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
637
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.calls, 0) }),
638
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
639
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
640
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(cacheHitPercentage(row.cached, row.tokensIn)) }),
641
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
642
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
643
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(share) })
644
644
  ] }, row.id);
645
645
  }) })
646
646
  ] }) })
@@ -833,7 +833,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
833
833
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, children: [
834
834
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
835
835
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
836
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.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: [
836
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.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: [
837
837
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
838
838
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
839
839
  _recharts.XAxis,
@@ -857,10 +857,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
857
857
  }
858
858
  ),
859
859
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
860
- _chunkUGNLKDI6js.ChartTooltip,
860
+ _chunk5GVBUTS4js.ChartTooltip,
861
861
  {
862
862
  content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
863
- _chunkUGNLKDI6js.ChartTooltipContent,
863
+ _chunk5GVBUTS4js.ChartTooltipContent,
864
864
  {
865
865
  labelFormatter: (value) => bucketDate(String(value), granularity),
866
866
  valueFormatter: (value) => formatValue(Number(value), metric),
@@ -869,7 +869,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
869
869
  )
870
870
  }
871
871
  ),
872
- seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.ChartLegendContent, {}) }) : null,
872
+ seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.ChartLegendContent, {}) }) : null,
873
873
  seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
874
874
  _recharts.Bar,
875
875
  {
@@ -920,19 +920,19 @@ function TokenUsageAdminContainer() {
920
920
  [t]
921
921
  );
922
922
  if (error) {
923
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
923
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
924
924
  }
925
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.RoundPageContainer, { fullWidth: true, forceHeader: true });
925
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { fullWidth: true, forceHeader: true });
926
926
  const emptyLabel = t("token_usage.admin.no_data");
927
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
927
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
928
928
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
929
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
930
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: [
931
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
932
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
929
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
930
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: [
931
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
932
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
933
933
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
934
934
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
935
- _chunkUGNLKDI6js.Select,
935
+ _chunk5GVBUTS4js.Select,
936
936
  {
937
937
  items: stackByItems,
938
938
  value: filters.stackBy,
@@ -940,29 +940,29 @@ function TokenUsageAdminContainer() {
940
940
  if (value) setFilters({ stackBy: value });
941
941
  },
942
942
  children: [
943
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectValue, {}) }),
944
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SelectItem, { value, children: stackByItems[value] }, value)) })
943
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectValue, {}) }),
944
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SelectItem, { value, children: stackByItems[value] }, value)) })
945
945
  ]
946
946
  }
947
947
  )
948
948
  ] }) })
949
949
  ] }),
950
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
950
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
951
951
  ] }),
952
952
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
953
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
954
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
955
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
953
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
954
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
955
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
956
956
  ] }),
957
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
958
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
959
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
957
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
958
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
959
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
960
960
  ] })
961
961
  ] }),
962
962
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk53B6NPGAjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
963
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
964
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
965
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
963
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
964
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
965
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
966
966
  TokenUsageRankedBar,
967
967
  {
968
968
  rows: byCustomerOperation,
@@ -972,9 +972,9 @@ function TokenUsageAdminContainer() {
972
972
  }
973
973
  ) })
974
974
  ] }),
975
- !hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
976
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
977
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
975
+ !hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
976
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
977
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
978
978
  TokenUsageRankedBar,
979
979
  {
980
980
  rows: byOperation,
@@ -985,9 +985,9 @@ function TokenUsageAdminContainer() {
985
985
  ) })
986
986
  ] })
987
987
  ] }),
988
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
989
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.admin.detail") }) }),
990
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
988
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
989
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.admin.detail") }) }),
990
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
991
991
  ] })
992
992
  ] }) });
993
993
  }
@@ -1108,7 +1108,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
1108
1108
 
1109
1109
  function TokenUsageReportFilterBar({ onChange }) {
1110
1110
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1111
- _chunkUGNLKDI6js.DateRangeSelector,
1111
+ _chunk5GVBUTS4js.DateRangeSelector,
1112
1112
  {
1113
1113
  onDateChange: (range) => {
1114
1114
  if (!_optionalChain([range, 'optionalAccess', _10 => _10.from]) || !_optionalChain([range, 'optionalAccess', _11 => _11.to])) return;
@@ -1141,7 +1141,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
1141
1141
  pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
1142
1142
  }) => {
1143
1143
  const t = _nextintl.useTranslations.call(void 0, );
1144
- const generateUrl = _chunkUGNLKDI6js.usePageUrlGenerator.call(void 0, );
1144
+ const generateUrl = _chunk5GVBUTS4js.usePageUrlGenerator.call(void 0, );
1145
1145
  const [filters, setFilterState] = _react.useState.call(void 0, () => {
1146
1146
  const range = defaultRange2();
1147
1147
  return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
@@ -1205,7 +1205,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
1205
1205
  () => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
1206
1206
  [summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
1207
1207
  );
1208
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
1208
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
1209
1209
  }, "TokenUsageReportProvider");
1210
1210
  var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1211
1211
  const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
@@ -1233,7 +1233,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1233
1233
  const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
1234
1234
  const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
1235
1235
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
1236
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardContent, { className: "grid gap-1", children: [
1236
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "grid gap-1", children: [
1237
1237
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
1238
1238
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(metricValue(current, metric), metric) }),
1239
1239
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
@@ -1249,7 +1249,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1249
1249
  ] })
1250
1250
  ] }) }),
1251
1251
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
1252
- balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardContent, { className: "grid gap-1", children: [
1252
+ balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "grid gap-1", children: [
1253
1253
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
1254
1254
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
1255
1255
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunk53B6NPGAjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
@@ -1259,11 +1259,11 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1259
1259
  ] })
1260
1260
  ] })
1261
1261
  ] }) }),
1262
- balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardContent, { className: "grid gap-1", children: [
1262
+ balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "grid gap-1", children: [
1263
1263
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
1264
1264
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
1265
1265
  ] }) }),
1266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.CardContent, { className: "grid gap-1", children: [
1266
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.CardContent, { className: "grid gap-1", children: [
1267
1267
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
1268
1268
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
1269
1269
  ] }) })
@@ -1305,21 +1305,21 @@ function TokenUsageReportContainer({ balances = null }) {
1305
1305
  const t = _nextintl.useTranslations.call(void 0, );
1306
1306
  const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
1307
1307
  if (error) {
1308
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
1308
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
1309
1309
  }
1310
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.RoundPageContainer, { fullWidth: true, forceHeader: true });
1310
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { fullWidth: true, forceHeader: true });
1311
1311
  const emptyLabel = t("token_usage.report.no_data");
1312
1312
  const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
1313
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
1313
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
1314
1314
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
1315
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
1316
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
1317
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
1315
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
1316
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
1317
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
1318
1318
  ] }),
1319
1319
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk53B6NPGAjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
1320
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
1321
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
1322
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1320
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
1321
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
1322
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1323
1323
  TokenUsageRankedBar,
1324
1324
  {
1325
1325
  rows: byOperation,
@@ -1329,9 +1329,9 @@ function TokenUsageReportContainer({ balances = null }) {
1329
1329
  }
1330
1330
  ) })
1331
1331
  ] }),
1332
- targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkUGNLKDI6js.Card, { children: [
1333
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardTitle, { children: targetTitle }) }),
1334
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUGNLKDI6js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
1332
+ targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5GVBUTS4js.Card, { children: [
1333
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardTitle, { children: targetTitle }) }),
1334
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5GVBUTS4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
1335
1335
  ] })
1336
1336
  ] })
1337
1337
  ] }) });
@@ -26,7 +26,7 @@ import {
26
26
  TableHeader,
27
27
  TableRow,
28
28
  usePageUrlGenerator
29
- } from "../../chunk-J54546YC.mjs";
29
+ } from "../../chunk-WCX4CLRJ.mjs";
30
30
  import "../../chunk-PHEFWL6L.mjs";
31
31
  import {
32
32
  AbstractService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carlonicora/nextjs-jsonapi",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Next.js JSON:API client with server/client support and caching",
5
5
  "author": "Carlo Nicora",
6
6
  "license": "GPL-3.0-or-later",
@@ -108,7 +108,12 @@ function UserEditorInternal({
108
108
  const formSchema = useMemo(
109
109
  () =>
110
110
  z.object({
111
- id: z.uuidv4(),
111
+ // Any UUID version: on edit this is the PERSISTED id, and seeded/legacy
112
+ // users can carry a non-v4 uuid (the migration-created Administrator is
113
+ // v1). `z.uuidv4()` rejected those, and because `id` has no rendered
114
+ // field the failure was invisible — handleSubmit simply never fired.
115
+ // New users still get a v4 from `v4()` in getDefaultValues.
116
+ id: z.uuid(),
112
117
  name: z.string().min(1, { message: t(`user.fields.name.error`) }),
113
118
  email: z.string().min(1, { message: t(`common.fields.email.error`) }),
114
119
  password: z.string().optional(),
@@ -205,7 +210,11 @@ function UserEditorInternal({
205
210
  avatar: resetImage ? undefined : values.avatar,
206
211
  roleIds: values.roleIds,
207
212
  sendInvitationEmail: values.sendInvitationEmail,
208
- companyId: company!.id,
213
+ // Optional: `companyId` only sets the `x-companyid` header, and a user
214
+ // can legitimately have no company (the seeded Administrator does), in
215
+ // which case `company` is null here. `company!.id` threw a TypeError
216
+ // and surfaced as a generic "update failed" toast.
217
+ companyId: company?.id,
209
218
  adminCreated: adminCreated,
210
219
  };
211
220