@mediaradar/design-components 0.58.0 → 0.60.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/index.cjs CHANGED
@@ -32,6 +32,7 @@ __export(index_exports, {
32
32
  Button: () => Button,
33
33
  Card: () => Card,
34
34
  ChartLegend: () => ChartLegend,
35
+ ChartSkeleton: () => ChartSkeleton,
35
36
  CheckBox: () => CheckBox,
36
37
  CheckBoxBox: () => CheckBoxBox,
37
38
  ChipContent: () => ChipContent,
@@ -44,6 +45,7 @@ __export(index_exports, {
44
45
  Delta: () => Delta,
45
46
  Drawer: () => Drawer,
46
47
  EmptyState: () => EmptyState,
48
+ Figure: () => Figure,
47
49
  FilterChipBar: () => FilterChipBar,
48
50
  FilterDrawer: () => FilterDrawer,
49
51
  FilterDropdownFooter: () => FilterDropdownFooter,
@@ -52,6 +54,8 @@ __export(index_exports, {
52
54
  InlineMessage: () => InlineMessage,
53
55
  LegendItem: () => LegendItem,
54
56
  LineChartPlaceholder: () => LineChartPlaceholder,
57
+ LoadError: () => LoadError,
58
+ LongWait: () => LongWait,
55
59
  MediaLabel: () => MediaLabel,
56
60
  Menu: () => Menu,
57
61
  MenuItem: () => MenuItem,
@@ -64,6 +68,7 @@ __export(index_exports, {
64
68
  NO_VALUE: () => NO_VALUE,
65
69
  NameListModal: () => NameListModal,
66
70
  NoResultsEmptyState: () => NoResultsEmptyState,
71
+ NoValue: () => NoValue,
67
72
  PRIMARY_ACTION_CLASS: () => PRIMARY_ACTION_CLASS,
68
73
  PageHeader: () => PageHeader,
69
74
  Pager: () => Pager,
@@ -71,6 +76,7 @@ __export(index_exports, {
71
76
  PrimaryBadge: () => PrimaryBadge,
72
77
  PublisherBreakdownList: () => PublisherBreakdownList,
73
78
  QUIET_ACTION_CLASS: () => QUIET_ACTION_CLASS,
79
+ RefreshLine: () => RefreshLine,
74
80
  SearchBar: () => SearchBar,
75
81
  SectionHeading: () => SectionHeading,
76
82
  SectionRail: () => SectionRail,
@@ -79,11 +85,15 @@ __export(index_exports, {
79
85
  SelectFilter: () => SelectFilter,
80
86
  SelectedSection: () => SelectedSection,
81
87
  SelectionPicker: () => SelectionPicker,
88
+ Skeleton: () => Skeleton,
89
+ SkeletonLines: () => SkeletonLines,
82
90
  SortButton: () => SortButton,
83
91
  StackedColumnPlaceholder: () => StackedColumnPlaceholder,
84
92
  StatStrip: () => StatStrip,
93
+ StatStripSkeleton: () => StatStripSkeleton,
85
94
  StatTile: () => StatTile,
86
95
  SuggestionChip: () => SuggestionChip,
96
+ TableLink: () => TableLink,
87
97
  TablePagination: () => TablePagination,
88
98
  Tabs: () => Tabs,
89
99
  Tag: () => Tag,
@@ -117,7 +127,8 @@ __export(index_exports, {
117
127
  formatWeek: () => formatWeek,
118
128
  noResultsBody: () => noResultsBody,
119
129
  resolveRange: () => resolveRange,
120
- sortProp: () => sortProp
130
+ sortProp: () => sortProp,
131
+ useDelayedLoading: () => useDelayedLoading
121
132
  });
122
133
  module.exports = __toCommonJS(index_exports);
123
134
 
@@ -2268,45 +2279,268 @@ function SelectFilter({
2268
2279
  }
2269
2280
 
2270
2281
  // src/Card.tsx
2282
+ var import_react11 = require("react");
2283
+
2284
+ // src/Skeleton.tsx
2285
+ var import_react10 = require("react");
2286
+
2287
+ // src/Button.tsx
2271
2288
  var import_react9 = require("react");
2289
+ var import_react_slot = require("@radix-ui/react-slot");
2290
+ var import_class_variance_authority = require("class-variance-authority");
2291
+ var import_lucide_react12 = require("lucide-react");
2272
2292
  var import_jsx_runtime15 = require("react/jsx-runtime");
2273
- var Card = (0, import_react9.forwardRef)(function Card2({ staticCard, title, titleAs: TitleTag = "h3", subtitle, info, variant = "default", action, className, testIdPrefix, children, ...rest }, ref) {
2293
+ var buttonVariants = (0, import_class_variance_authority.cva)(
2294
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
2295
+ {
2296
+ variants: {
2297
+ variant: {
2298
+ primary: "bg-brand-primaryAction text-brand-onprimary hover:brightness-110",
2299
+ // border-strong, not border-interactive. The interactive token is #6b6358
2300
+ // -- 5.9:1 against the surface, nearly as dark as body text -- which is
2301
+ // right for an input the eye must find in a form, and far too heavy for
2302
+ // a button sitting beside other buttons. It reads heaviest on icon-only,
2303
+ // where there is least fill inside the line to balance it.
2304
+ secondary: "bg-surface text-text-primary border border-border-strong hover:bg-subtle hover:border-border-interactive",
2305
+ ghost: "text-text-primary hover:bg-subtle",
2306
+ danger: "bg-status-danger text-status-onstatus hover:brightness-110",
2307
+ // Quiet destructive: neutral at rest, red only on hover. This is what
2308
+ // the product actually reaches for -- nearly every hand-rolled
2309
+ // destructive control is an icon that reddens on hover, while filled
2310
+ // `danger` is right only for the confirm button in a dialog the user
2311
+ // already opened.
2312
+ dangerGhost: "text-text-secondary hover:bg-subtle hover:text-text-danger",
2313
+ link: "text-text-link underline-offset-4 hover:underline px-0"
2314
+ },
2315
+ // Type scales with the box. One size across all three left xs cramped --
2316
+ // 14px inside a 24px box leaves five pixels above and below, so the label
2317
+ // fills the button instead of sitting in it.
2318
+ size: {
2319
+ xs: "h-6 px-2 text-xs",
2320
+ sm: "h-8 px-3 text-sm",
2321
+ md: "h-10 px-4 text-sm",
2322
+ // 44, the filter row's height, so a button at the end of a row of
2323
+ // filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
2324
+ lg: "h-11 px-5 text-sm"
2325
+ },
2326
+ // Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
2327
+ // be one dimension, so an icon button never lined up with the labelled
2328
+ // buttons beside it in a toolbar. As a shape it squares the box at
2329
+ // whichever height you picked.
2330
+ iconOnly: {
2331
+ true: "p-0",
2332
+ false: ""
2333
+ }
2334
+ },
2335
+ compoundVariants: [
2336
+ { size: "xs", iconOnly: true, class: "w-6" },
2337
+ { size: "sm", iconOnly: true, class: "w-8" },
2338
+ { size: "md", iconOnly: true, class: "w-10" },
2339
+ { size: "lg", iconOnly: true, class: "w-11" },
2340
+ // A boxed button is a target you aim at, so its label carries the weight
2341
+ // of one. `link` sits inline in a sentence, where semibold reads as
2342
+ // emphasis on the words rather than as a control.
2343
+ { variant: ["primary", "secondary", "ghost", "danger", "dangerGhost"], class: "font-semibold" },
2344
+ { variant: "link", class: "font-medium h-auto p-0" }
2345
+ ],
2346
+ defaultVariants: {
2347
+ variant: "primary",
2348
+ size: "md",
2349
+ iconOnly: false
2350
+ }
2351
+ }
2352
+ );
2353
+ var Button = (0, import_react9.forwardRef)(
2354
+ ({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
2355
+ const shared = {
2356
+ className: cn(buttonVariants({ variant, size, iconOnly, className })),
2357
+ "data-testid": testIdPrefix,
2358
+ disabled: disabled || loading,
2359
+ "aria-busy": loading || void 0,
2360
+ ...props
2361
+ };
2362
+ if (asChild) {
2363
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_slot.Slot, { ref, ...shared, children });
2364
+ }
2365
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { ref, ...shared, children: [
2366
+ loading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react12.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
2367
+ children
2368
+ ] });
2369
+ }
2370
+ );
2371
+ Button.displayName = "Button";
2372
+
2373
+ // src/Skeleton.tsx
2374
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2375
+ var STYLE_ID = "mrLoadingStyle";
2376
+ var CSS = `
2377
+ [data-mr-skeleton]{position:relative;overflow:hidden}
2378
+ [data-mr-skeleton]::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--mr-color-surface) 70%,transparent),transparent);animation:mr-shimmer 1.5s ease-in-out infinite}
2379
+ [data-mr-refresh-line]{position:absolute;inset:0 auto auto 0;height:2px;width:40%;background:var(--mr-color-brand-primary-action);animation:mr-refresh 1.2s ease-in-out infinite}
2380
+ @keyframes mr-shimmer{100%{transform:translateX(100%)}}
2381
+ @keyframes mr-refresh{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
2382
+ @media (prefers-reduced-motion:reduce){[data-mr-skeleton]::after{animation:none;display:none}[data-mr-refresh-line]{animation:none;width:100%;opacity:.5}}
2383
+ `;
2384
+ function useLoadingStyle() {
2385
+ (0, import_react10.useEffect)(() => {
2386
+ if (typeof document === "undefined" || document.getElementById(STYLE_ID)) return;
2387
+ const el = document.createElement("style");
2388
+ el.id = STYLE_ID;
2389
+ el.textContent = CSS;
2390
+ document.head.append(el);
2391
+ }, []);
2392
+ }
2393
+ function useDelayedLoading(loading, delay = 300, min = 500) {
2394
+ const [show, setShow] = (0, import_react10.useState)(false);
2395
+ const [shownAt, setShownAt] = (0, import_react10.useState)(0);
2396
+ (0, import_react10.useEffect)(() => {
2397
+ if (loading && !show) {
2398
+ const t = setTimeout(() => {
2399
+ setShow(true);
2400
+ setShownAt(Date.now());
2401
+ }, delay);
2402
+ return () => clearTimeout(t);
2403
+ }
2404
+ if (!loading && show) {
2405
+ const t = setTimeout(() => setShow(false), Math.max(0, min - (Date.now() - shownAt)));
2406
+ return () => clearTimeout(t);
2407
+ }
2408
+ return void 0;
2409
+ }, [loading, show, shownAt, delay, min]);
2410
+ return show;
2411
+ }
2412
+ var SHAPE = { line: "h-3 rounded-pill", block: "rounded-control", circle: "rounded-full" };
2413
+ function Skeleton({ shape = "line", className, style, testIdPrefix }) {
2414
+ useLoadingStyle();
2415
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2416
+ "span",
2417
+ {
2418
+ "aria-hidden": "true",
2419
+ "data-mr-skeleton": "",
2420
+ "data-testid": testIdPrefix,
2421
+ className: cn("block bg-subtle", SHAPE[shape], className),
2422
+ style
2423
+ }
2424
+ );
2425
+ }
2426
+ function SkeletonLines({ lines = 3, className }) {
2427
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: cn("flex flex-col gap-2", className), children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: i === lines - 1 ? "w-2/3" : "w-full" }, i)) });
2428
+ }
2429
+ function ChartSkeleton({ className }) {
2430
+ const bars = [55, 80, 40, 95, 70, 60, 85];
2431
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { "aria-hidden": "true", className: cn("flex h-48 flex-col gap-2", className), children: [
2432
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex flex-1 items-end gap-3", children: bars.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { shape: "block", className: "flex-1", style: { height: `${h}%` } }, i)) }),
2433
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex gap-3", children: bars.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-2 flex-1" }, i)) })
2434
+ ] });
2435
+ }
2436
+ function StatStripSkeleton({ tiles = 3, className }) {
2437
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2438
+ "span",
2439
+ {
2440
+ "aria-hidden": "true",
2441
+ className: cn("grid divide-y divide-border-default rounded-card border border-border-default bg-surface sm:auto-cols-fr sm:grid-flow-col sm:divide-x sm:divide-y-0", className),
2442
+ children: Array.from({ length: tiles }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex flex-col gap-2 px-5 py-3", children: [
2443
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-2 w-20" }),
2444
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-6 w-24" }),
2445
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Skeleton, { className: "h-2 w-28" })
2446
+ ] }, i))
2447
+ }
2448
+ );
2449
+ }
2450
+ function LongWait({ loading, onRetry, hint = "Large date ranges take longer.", className }) {
2451
+ const [stage, setStage] = (0, import_react10.useState)(0);
2452
+ (0, import_react10.useEffect)(() => {
2453
+ setStage(0);
2454
+ if (!loading) return void 0;
2455
+ const a = setTimeout(() => setStage(1), 5e3);
2456
+ const b = setTimeout(() => setStage(2), 3e4);
2457
+ return () => {
2458
+ clearTimeout(a);
2459
+ clearTimeout(b);
2460
+ };
2461
+ }, [loading]);
2462
+ if (!loading || stage === 0) return null;
2463
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { role: "status", className: cn("mt-3 flex items-center gap-2 text-xs text-text-tertiary", className), children: [
2464
+ stage === 1 ? `Still loading. ${hint}` : "This is taking longer than usual.",
2465
+ stage === 2 && onRetry && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "link", size: "sm", onClick: onRetry, children: "Retry" })
2466
+ ] });
2467
+ }
2468
+ function LoadError({ onRetry, children = "Couldn't load this." }) {
2469
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { role: "alert", className: "flex flex-1 flex-col items-center justify-center gap-2 py-8 text-center text-dense text-text-secondary", children: [
2470
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children }),
2471
+ onRetry && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "secondary", size: "sm", onClick: onRetry, children: "Try again" })
2472
+ ] });
2473
+ }
2474
+ function RefreshLine() {
2475
+ useLoadingStyle();
2476
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-x-0 top-0 h-0.5 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "data-mr-refresh-line": "" }) });
2477
+ }
2478
+
2479
+ // src/Card.tsx
2480
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2481
+ var Card = (0, import_react11.forwardRef)(function Card2({
2482
+ staticCard,
2483
+ title,
2484
+ titleAs: TitleTag = "h3",
2485
+ subtitle,
2486
+ info,
2487
+ variant = "default",
2488
+ action,
2489
+ className,
2490
+ testIdPrefix,
2491
+ children,
2492
+ loading = false,
2493
+ skeleton,
2494
+ refreshing = false,
2495
+ error = false,
2496
+ onRetry,
2497
+ ...rest
2498
+ }, ref) {
2274
2499
  const chart = variant === "chart";
2275
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2500
+ const showSkeleton = useDelayedLoading(loading);
2501
+ const body = error ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex min-h-48 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoadError, { onRetry }) }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex min-h-48 flex-1 flex-col", children: [
2502
+ showSkeleton && (skeleton ?? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChartSkeleton, {})),
2503
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LongWait, { loading, onRetry })
2504
+ ] }) : refreshing ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-1 flex-col opacity-50 transition-opacity motion-reduce:transition-none", children }) : children;
2505
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2276
2506
  "article",
2277
2507
  {
2278
2508
  ref,
2279
2509
  className: cn(
2280
- "flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
2510
+ "relative flex h-full flex-col overflow-hidden rounded-card border border-border-default bg-surface",
2281
2511
  !chart && "shadow-raised",
2282
2512
  // Interactive hover: deeper drop shadow only -- no elevation/transform.
2283
2513
  !staticCard && !chart && "group transition-shadow hover:shadow-overlay",
2284
2514
  className
2285
2515
  ),
2286
2516
  "data-testid": testIdPrefix,
2517
+ "aria-busy": loading || refreshing || void 0,
2287
2518
  ...rest,
2288
- children: title ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
2289
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
2290
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "min-w-0", children: [
2291
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1.5", children: [
2292
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
2293
- info && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
2519
+ children: [
2520
+ refreshing && !loading && !error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(RefreshLine, {}),
2521
+ title ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-1 flex-col p-card-padding", children: [
2522
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
2523
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0", children: [
2524
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5", children: [
2525
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TitleTag, { className: chart ? "text-panel-title font-semibold text-text-primary" : "text-style-card-title", children: title }),
2526
+ info && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(InfoTip, { text: info, label: `About ${title.toLowerCase()}` })
2527
+ ] }),
2528
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
2294
2529
  ] }),
2295
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
2530
+ action && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
2296
2531
  ] }),
2297
- action && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
2298
- ] }),
2299
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children })
2300
- ] }) : children
2532
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mt-4 flex flex-1 flex-col", children: body })
2533
+ ] }) : body
2534
+ ]
2301
2535
  }
2302
2536
  );
2303
2537
  });
2304
2538
 
2305
2539
  // src/StatStrip.tsx
2306
- var import_react10 = require("react");
2307
- var import_jsx_runtime16 = require("react/jsx-runtime");
2308
- var StatStrip = (0, import_react10.forwardRef)(
2309
- ({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2540
+ var import_react12 = require("react");
2541
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2542
+ var StatStrip = (0, import_react12.forwardRef)(
2543
+ ({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2310
2544
  "div",
2311
2545
  {
2312
2546
  ref,
@@ -2324,32 +2558,32 @@ var StatStrip = (0, import_react10.forwardRef)(
2324
2558
  );
2325
2559
  StatStrip.displayName = "StatStrip";
2326
2560
  function StatTile({ label, value, unit, change, note, icon, info, children, className, testIdPrefix }) {
2327
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
2328
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
2329
- icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
2561
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex min-w-0 flex-col gap-1 px-5 py-3", className), children: [
2562
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1.5 text-micro font-semibold uppercase tracking-wide text-text-tertiary", children: [
2563
+ icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-brand-primaryAction", children: icon }),
2330
2564
  label,
2331
- info && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
2565
+ info && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InfoTip, { text: info, label: `About ${label.toLowerCase()}` })
2332
2566
  ] }),
2333
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
2334
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
2567
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5", children: [
2568
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-xl font-bold leading-tight tracking-tight tabular-nums text-text-primary", children: [
2335
2569
  value,
2336
- unit && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
2570
+ unit && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "text-dense font-medium tracking-normal text-text-tertiary", children: [
2337
2571
  " ",
2338
2572
  unit
2339
2573
  ] })
2340
2574
  ] }),
2341
- change && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-card-title font-medium", children: change })
2575
+ change && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-card-title font-medium", children: change })
2342
2576
  ] }),
2343
- note && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs text-text-tertiary", children: note }),
2344
- children && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-xs text-text-secondary", children })
2577
+ note && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-text-tertiary", children: note }),
2578
+ children && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-xs text-text-secondary", children })
2345
2579
  ] });
2346
2580
  }
2347
2581
 
2348
2582
  // src/ChartLegend.tsx
2349
- var import_react11 = require("react");
2350
- var import_jsx_runtime17 = require("react/jsx-runtime");
2351
- var ChartLegend = (0, import_react11.forwardRef)(
2352
- ({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2583
+ var import_react13 = require("react");
2584
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2585
+ var ChartLegend = (0, import_react13.forwardRef)(
2586
+ ({ className, testIdPrefix, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2353
2587
  "ul",
2354
2588
  {
2355
2589
  ref,
@@ -2369,8 +2603,8 @@ var MARK = {
2369
2603
  };
2370
2604
  function LegendItem({ mark = "dot", color, you = false, children, className, testIdPrefix }) {
2371
2605
  const dashed = mark === "dashed";
2372
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
2373
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2606
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { "data-testid": testIdPrefix, className: cn("flex items-center gap-1.5", you && "text-text-secondary", className), children: [
2607
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2374
2608
  "span",
2375
2609
  {
2376
2610
  "aria-hidden": "true",
@@ -2384,7 +2618,7 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
2384
2618
  style: color ? dashed ? { borderColor: color } : { background: color } : void 0
2385
2619
  }
2386
2620
  ),
2387
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
2621
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
2388
2622
  children,
2389
2623
  you && " (you)"
2390
2624
  ] })
@@ -2392,30 +2626,30 @@ function LegendItem({ mark = "dot", color, you = false, children, className, tes
2392
2626
  }
2393
2627
 
2394
2628
  // src/BarList.tsx
2395
- var import_jsx_runtime18 = require("react/jsx-runtime");
2629
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2396
2630
  var COL_WIDTH = ["w-16", "w-13"];
2397
2631
  function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label": ariaLabel }) {
2398
2632
  if (!rows.length) {
2399
- return empty ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
2633
+ return empty ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: cn("text-xs text-text-tertiary", className), children: empty }) : null;
2400
2634
  }
2401
2635
  const max = Math.max(...rows.flatMap((r) => [r.bar, r.tick ?? 0]), 1);
2402
2636
  const full = !!columns?.length;
2403
2637
  const colClass = (i) => full ? COL_WIDTH[i] ?? "w-13" : "";
2404
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
2405
- full && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
2406
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex-1" }),
2407
- columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
2638
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-testid": testIdPrefix, className: cn("flex flex-col", className), children: [
2639
+ full && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "aria-hidden": "true", className: "flex items-baseline gap-2 pb-1", children: [
2640
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex-1" }),
2641
+ columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn("shrink-0 text-right text-micro font-medium text-text-tertiary", colClass(i)), children: c }, c))
2408
2642
  ] }),
2409
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("li", { className: "py-2", children: [
2410
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
2411
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
2643
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { "aria-label": ariaLabel, className: "flex flex-col", children: rows.map((r) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("li", { className: "py-2", children: [
2644
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mb-1.5 flex items-baseline gap-2", children: [
2645
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "min-w-0 flex-1 truncate text-dense font-semibold text-text-primary", children: [
2412
2646
  r.label,
2413
- r.note && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "font-normal text-text-tertiary", children: [
2647
+ r.note && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "font-normal text-text-tertiary", children: [
2414
2648
  " \xB7 ",
2415
2649
  r.note
2416
2650
  ] })
2417
2651
  ] }),
2418
- r.values?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2652
+ r.values?.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2419
2653
  "span",
2420
2654
  {
2421
2655
  className: cn(
@@ -2424,7 +2658,7 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
2424
2658
  colClass(i)
2425
2659
  ),
2426
2660
  children: [
2427
- full && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "sr-only", children: [
2661
+ full && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "sr-only", children: [
2428
2662
  columns[i],
2429
2663
  ": "
2430
2664
  ] }),
@@ -2434,15 +2668,15 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
2434
2668
  i
2435
2669
  ))
2436
2670
  ] }),
2437
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
2438
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2671
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "aria-hidden": "true", className: "relative h-2 rounded-pill bg-subtle", children: [
2672
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2439
2673
  "div",
2440
2674
  {
2441
2675
  className: cn("h-full rounded-pill", !r.color && "bg-brand-primaryAction"),
2442
2676
  style: { width: `${Math.max(r.bar, 0) / max * 100}%`, background: r.color }
2443
2677
  }
2444
2678
  ),
2445
- r.tick !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2679
+ r.tick !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2446
2680
  "span",
2447
2681
  {
2448
2682
  className: "absolute -bottom-1 -top-1 w-0.5 -translate-x-1/2 rounded-pill bg-text-primary",
@@ -2450,14 +2684,14 @@ function BarList({ rows, columns, empty, className, testIdPrefix, "aria-label":
2450
2684
  }
2451
2685
  )
2452
2686
  ] }),
2453
- r.tickLabel && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: r.tickLabel })
2687
+ r.tickLabel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: r.tickLabel })
2454
2688
  ] }, r.key)) })
2455
2689
  ] });
2456
2690
  }
2457
2691
 
2458
2692
  // src/NoResultsEmptyState.tsx
2459
- var import_lucide_react12 = require("lucide-react");
2460
- var import_jsx_runtime19 = require("react/jsx-runtime");
2693
+ var import_lucide_react13 = require("lucide-react");
2694
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2461
2695
  var NO_RESULTS_TITLE = "No results match your filters";
2462
2696
  var NO_RESULTS_BODY = "Your filters may be too narrow, conflict with each other, or have no activity in this period.";
2463
2697
  function noResultsBody(workspaceName) {
@@ -2480,12 +2714,12 @@ function NoResultsEmptyState({
2480
2714
  const showClear = hasFilters !== false && Boolean(onClearFilters);
2481
2715
  const showEdit = Boolean(onEditFilters);
2482
2716
  const hasActions = showClear || showEdit || Boolean(actions && actions.length > 0);
2483
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
2484
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react12.FilterX, { size: 20, "aria-hidden": "true" }) }),
2485
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
2486
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
2487
- hasActions && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
2488
- showClear && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2717
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: cn("flex flex-col items-center justify-center gap-3 text-center", className), "data-testid": testIdPrefix, children: [
2718
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-subtle text-text-tertiary", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.FilterX, { size: 20, "aria-hidden": "true" }) }),
2719
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "text-base font-semibold text-text-primary", children: title }),
2720
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "max-w-105 text-dense leading-relaxed text-text-secondary", children: bodyText }),
2721
+ hasActions && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "mt-1 flex flex-col items-center gap-3", children: [
2722
+ showClear && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2489
2723
  "button",
2490
2724
  {
2491
2725
  type: "button",
@@ -2495,7 +2729,7 @@ function NoResultsEmptyState({
2495
2729
  children: "Clear all filters"
2496
2730
  }
2497
2731
  ),
2498
- showEdit && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2732
+ showEdit && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2499
2733
  "button",
2500
2734
  {
2501
2735
  type: "button",
@@ -2505,7 +2739,7 @@ function NoResultsEmptyState({
2505
2739
  children: "Edit filters"
2506
2740
  }
2507
2741
  ),
2508
- actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2742
+ actions?.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2509
2743
  "button",
2510
2744
  {
2511
2745
  type: "button",
@@ -2520,11 +2754,11 @@ function NoResultsEmptyState({
2520
2754
  }
2521
2755
 
2522
2756
  // src/WorkspaceSelectedCard.tsx
2523
- var import_react12 = require("react");
2524
- var import_lucide_react13 = require("lucide-react");
2525
- var import_jsx_runtime20 = require("react/jsx-runtime");
2757
+ var import_react14 = require("react");
2758
+ var import_lucide_react14 = require("lucide-react");
2759
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2526
2760
  function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
2527
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2761
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2528
2762
  "aside",
2529
2763
  {
2530
2764
  className: cn(
@@ -2532,7 +2766,7 @@ function WorkspaceSelectedCard({ groups, className, testIdPrefix }) {
2532
2766
  className
2533
2767
  ),
2534
2768
  "data-testid": testIdPrefix,
2535
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
2769
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex flex-col divide-y divide-border-default", children: groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SummaryGroupItem, { group: g, testIdPrefix }, g.id)) })
2536
2770
  }
2537
2771
  );
2538
2772
  }
@@ -2544,15 +2778,15 @@ function SummaryGroupItem({
2544
2778
  const ownCount = group.items.length;
2545
2779
  const subCount = (group.subGroups ?? []).reduce((n, sg) => n + sg.items.length, 0);
2546
2780
  const expandCount = ownCount + subCount;
2547
- const [open, setOpen] = (0, import_react12.useState)(expandCount > 0);
2548
- const wasEmpty = (0, import_react12.useRef)(expandCount === 0);
2549
- (0, import_react12.useEffect)(() => {
2781
+ const [open, setOpen] = (0, import_react14.useState)(expandCount > 0);
2782
+ const wasEmpty = (0, import_react14.useRef)(expandCount === 0);
2783
+ (0, import_react14.useEffect)(() => {
2550
2784
  if (wasEmpty.current && expandCount > 0) setOpen(true);
2551
2785
  else if (expandCount === 0) setOpen(false);
2552
2786
  wasEmpty.current = expandCount === 0;
2553
2787
  }, [expandCount]);
2554
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
2555
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2788
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: nested ? "" : "py-3 first:pt-0 last:pb-0", children: [
2789
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2556
2790
  "button",
2557
2791
  {
2558
2792
  type: "button",
@@ -2561,45 +2795,45 @@ function SummaryGroupItem({
2561
2795
  "data-testid": testIdPrefix && `${testIdPrefix}-group-${group.id}`,
2562
2796
  className: "flex w-full min-w-0 items-center gap-2 text-left focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
2563
2797
  children: [
2564
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2565
- import_lucide_react13.ChevronDown,
2798
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2799
+ import_lucide_react14.ChevronDown,
2566
2800
  {
2567
2801
  size: 14,
2568
2802
  "aria-hidden": "true",
2569
2803
  className: cn("shrink-0 text-text-secondary transition-transform", !open && "-rotate-90")
2570
2804
  }
2571
2805
  ),
2572
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
2573
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
2806
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: cn("truncate font-semibold text-text-primary", nested ? "text-xs" : "text-dense"), children: group.label }),
2807
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "shrink-0 rounded-full bg-subtle px-1.5 py-0.5 text-micro font-semibold text-text-secondary", children: ownCount })
2574
2808
  ]
2575
2809
  }
2576
2810
  ),
2577
- open && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
2578
- ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
2579
- group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2811
+ open && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "pt-2.5", children: ownCount === 0 && subCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-text-secondary", children: "Nothing selected." }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-2.5", children: [
2812
+ ownCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
2813
+ group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2580
2814
  "div",
2581
2815
  {
2582
2816
  className: "flex items-center justify-between gap-2 rounded-control border border-border-default bg-canvas px-2 py-1",
2583
2817
  children: [
2584
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "min-w-0 flex-1", children: [
2585
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
2586
- item.meta && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
2818
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "min-w-0 flex-1", children: [
2819
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block truncate text-xs text-text-primary", children: item.name }),
2820
+ item.meta && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block truncate text-micro text-text-secondary", children: item.meta })
2587
2821
  ] }),
2588
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2822
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2589
2823
  "button",
2590
2824
  {
2591
2825
  type: "button",
2592
2826
  "aria-label": `Remove ${item.name}`,
2593
2827
  onClick: () => group.onRemove(item.id),
2594
2828
  className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-control text-text-secondary hover:bg-subtle hover:text-text-danger focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
2595
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react13.X, { size: 12, "aria-hidden": "true" })
2829
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.X, { size: 12, "aria-hidden": "true" })
2596
2830
  }
2597
2831
  )
2598
2832
  ]
2599
2833
  },
2600
2834
  item.id
2601
2835
  )),
2602
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2836
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2603
2837
  "button",
2604
2838
  {
2605
2839
  type: "button",
@@ -2610,13 +2844,13 @@ function SummaryGroupItem({
2610
2844
  }
2611
2845
  )
2612
2846
  ] }),
2613
- group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
2847
+ group.subGroups?.map((sg) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SummaryGroupItem, { group: sg, nested: true, testIdPrefix }, sg.id))
2614
2848
  ] }) })
2615
2849
  ] });
2616
2850
  }
2617
2851
 
2618
2852
  // src/chart-placeholder-shared.tsx
2619
- var import_jsx_runtime21 = require("react/jsx-runtime");
2853
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2620
2854
  var GRID_ROWS = [0, 25, 50, 75, 100];
2621
2855
  var Y_TICK_WIDTHS = [26, 30, 30, 26, 20];
2622
2856
  var Y_AXIS_W = 48;
@@ -2630,9 +2864,9 @@ function AxisFrame({
2630
2864
  testIdPrefix
2631
2865
  }) {
2632
2866
  const gutter = xTicks > 0 ? X_AXIS_H : 0;
2633
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative h-full w-full", children: [
2634
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
2635
- GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2867
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("w-full", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative h-full w-full", children: [
2868
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "absolute inset-y-0 right-0", style: { left: Y_AXIS_W, bottom: gutter }, children: [
2869
+ GRID_ROWS.map((pct) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2636
2870
  "div",
2637
2871
  {
2638
2872
  className: "absolute inset-x-0 border-t border-dashed",
@@ -2640,9 +2874,9 @@ function AxisFrame({
2640
2874
  },
2641
2875
  pct
2642
2876
  )),
2643
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0", children })
2877
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute inset-0", children })
2644
2878
  ] }),
2645
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2879
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute left-0 top-0", style: { width: Y_AXIS_W, bottom: gutter }, children: GRID_ROWS.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2646
2880
  "div",
2647
2881
  {
2648
2882
  className: "absolute right-2 h-2 -translate-y-1/2 rounded-xs bg-subtle",
@@ -2650,27 +2884,27 @@ function AxisFrame({
2650
2884
  },
2651
2885
  pct
2652
2886
  )) }),
2653
- xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2887
+ xTicks > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2654
2888
  "div",
2655
2889
  {
2656
2890
  className: "absolute bottom-0 right-0 flex items-center",
2657
2891
  style: { left: Y_AXIS_W, height: X_AXIS_H },
2658
- children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
2892
+ children: Array.from({ length: xTicks }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-1 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "h-2 w-full max-w-6.5 rounded-xs bg-subtle" }) }, i))
2659
2893
  }
2660
2894
  )
2661
2895
  ] }) });
2662
2896
  }
2663
2897
  function BlankLegend({ rows, reverse = false }) {
2664
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2898
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2665
2899
  "ul",
2666
2900
  {
2667
2901
  className: `flex flex-1 justify-center gap-1.5 ${reverse ? "flex-col-reverse" : "flex-col"}`,
2668
2902
  role: "presentation",
2669
2903
  "aria-hidden": "true",
2670
- children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
2671
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "flex items-center gap-1.5", children: [
2672
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
2673
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2904
+ children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("li", { className: "flex items-center justify-between gap-2", children: [
2905
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "flex items-center gap-1.5", children: [
2906
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "h-2.5 w-2.5 rounded-xs bg-subtle" }),
2907
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2674
2908
  "span",
2675
2909
  {
2676
2910
  className: "h-2 rounded-xs bg-subtle",
@@ -2678,21 +2912,21 @@ function BlankLegend({ rows, reverse = false }) {
2678
2912
  }
2679
2913
  )
2680
2914
  ] }),
2681
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
2915
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "h-2 w-6 rounded-xs bg-subtle" })
2682
2916
  ] }, i))
2683
2917
  }
2684
2918
  );
2685
2919
  }
2686
2920
 
2687
2921
  // src/BarChartPlaceholder.tsx
2688
- var import_jsx_runtime22 = require("react/jsx-runtime");
2922
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2689
2923
  var BAR_PROFILE = [92, 86, 76, 65, 57, 40, 30, 24, 18, 13];
2690
2924
  function BarChartPlaceholder({ height = 220, className, testIdPrefix }) {
2691
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
2925
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AxisFrame, { height, xTicks: BAR_PROFILE.length, className, testIdPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full w-full items-end gap-2", children: BAR_PROFILE.map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 rounded-t-small bg-subtle", style: { height: `${pct}%` } }, i)) }) });
2692
2926
  }
2693
2927
 
2694
2928
  // src/LineChartPlaceholder.tsx
2695
- var import_jsx_runtime23 = require("react/jsx-runtime");
2929
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2696
2930
  var LINE_SERIES = [
2697
2931
  [58, 52, 55, 41, 45, 33, 36, 25, 28, 17],
2698
2932
  [74, 71, 66, 68, 59, 61, 54, 56, 48, 45],
@@ -2702,9 +2936,9 @@ var LINE_SERIES = [
2702
2936
  var LINE_FORECAST_FROM = 7;
2703
2937
  function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
2704
2938
  const toPath = (pts, from, to) => pts.slice(from, to).map((y, i) => `${(i + from) / (pts.length - 1) * 100},${y}`).join(" ");
2705
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
2706
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("g", { children: [
2707
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2939
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AxisFrame, { height, xTicks: LINE_SERIES[0].length, className, testIdPrefix, children: [
2940
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 h-full w-full", children: LINE_SERIES.map((pts, s) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("g", { children: [
2941
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2708
2942
  "polyline",
2709
2943
  {
2710
2944
  points: toPath(pts, 0, LINE_FORECAST_FROM + 1),
@@ -2716,7 +2950,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
2716
2950
  strokeLinejoin: "round"
2717
2951
  }
2718
2952
  ),
2719
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2953
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2720
2954
  "polyline",
2721
2955
  {
2722
2956
  points: toPath(pts, LINE_FORECAST_FROM, pts.length),
@@ -2731,7 +2965,7 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
2731
2965
  )
2732
2966
  ] }, s)) }),
2733
2967
  LINE_SERIES.map(
2734
- (pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2968
+ (pts, s) => pts.map((y, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2735
2969
  "div",
2736
2970
  {
2737
2971
  className: "absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
@@ -2748,16 +2982,16 @@ function LineChartPlaceholder({ height = 280, className, testIdPrefix }) {
2748
2982
  }
2749
2983
 
2750
2984
  // src/PieChartPlaceholder.tsx
2751
- var import_jsx_runtime24 = require("react/jsx-runtime");
2985
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2752
2986
  var PIE_SEAMS = [0, 115, 180, 230, 262, 288, 310, 332];
2753
2987
  function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPrefix }) {
2754
2988
  const r = 45;
2755
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
2756
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
2757
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
2989
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: cn("flex w-full items-center gap-3", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
2990
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex h-full items-center justify-center", style: { width: "60%" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full", style: { aspectRatio: "1 / 1" }, children: [
2991
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("circle", { cx: "50", cy: "50", r, fill: "var(--mr-color-subtle)" }),
2758
2992
  PIE_SEAMS.map((deg) => {
2759
2993
  const rad = (deg - 90) * Math.PI / 180;
2760
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2994
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2761
2995
  "line",
2762
2996
  {
2763
2997
  x1: "50",
@@ -2771,12 +3005,12 @@ function PieChartPlaceholder({ height = 220, legendRows = 8, className, testIdPr
2771
3005
  );
2772
3006
  })
2773
3007
  ] }) }),
2774
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BlankLegend, { rows: legendRows })
3008
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BlankLegend, { rows: legendRows })
2775
3009
  ] });
2776
3010
  }
2777
3011
 
2778
3012
  // src/StackedColumnPlaceholder.tsx
2779
- var import_jsx_runtime25 = require("react/jsx-runtime");
3013
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2780
3014
  var COLUMN_WEIGHTS = [20, 30, 15, 35, 24, 12, 28, 18];
2781
3015
  function columnBands(count) {
2782
3016
  const weights = Array.from({ length: count }, (_, i) => COLUMN_WEIGHTS[i % COLUMN_WEIGHTS.length]);
@@ -2791,7 +3025,7 @@ function StackedColumnPlaceholder({
2791
3025
  className,
2792
3026
  testIdPrefix
2793
3027
  }) {
2794
- const column = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3028
+ const column = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-full flex-col overflow-hidden rounded-control bg-subtle", style: { width }, children: columnBands(legendRows).map((pct, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2795
3029
  "div",
2796
3030
  {
2797
3031
  style: {
@@ -2803,16 +3037,16 @@ function StackedColumnPlaceholder({
2803
3037
  },
2804
3038
  i
2805
3039
  )) });
2806
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
2807
- axis ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-stretch py-1", children: column }),
2808
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
3040
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex w-full gap-4", className), style: { height }, role: "presentation", "aria-hidden": "true", "data-testid": testIdPrefix, children: [
3041
+ axis ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { style: { width: "55%" }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(AxisFrame, { height, xTicks: 0, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-full items-stretch justify-center", children: column }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-stretch py-1", children: column }),
3042
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(BlankLegend, { rows: legendRows, reverse: !axis })
2809
3043
  ] });
2810
3044
  }
2811
3045
 
2812
3046
  // src/Tooltip.tsx
2813
- var import_react13 = require("react");
3047
+ var import_react15 = require("react");
2814
3048
  var import_react_dom3 = require("react-dom");
2815
- var import_jsx_runtime26 = require("react/jsx-runtime");
3049
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2816
3050
  function addDescribedBy(el, id) {
2817
3051
  const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter(Boolean);
2818
3052
  if (!ids.includes(id)) el.setAttribute("aria-describedby", [...ids, id].join(" "));
@@ -2848,18 +3082,18 @@ function Tooltip({
2848
3082
  variant = "surface",
2849
3083
  testIdPrefix
2850
3084
  }) {
2851
- const [anchor, setAnchor] = (0, import_react13.useState)(null);
2852
- const [boxWidth, setBoxWidth] = (0, import_react13.useState)(null);
2853
- const ref = (0, import_react13.useRef)(null);
2854
- const boxRef = (0, import_react13.useRef)(null);
2855
- const hideTimer = (0, import_react13.useRef)(null);
2856
- const showTimer = (0, import_react13.useRef)(null);
2857
- const exitTimer = (0, import_react13.useRef)(null);
2858
- const [shown, setShown] = (0, import_react13.useState)(false);
2859
- const openRef = (0, import_react13.useRef)(false);
2860
- const mountedRef = (0, import_react13.useRef)(false);
2861
- const id = (0, import_react13.useId)();
2862
- const describedRef = (0, import_react13.useRef)(null);
3085
+ const [anchor, setAnchor] = (0, import_react15.useState)(null);
3086
+ const [boxWidth, setBoxWidth] = (0, import_react15.useState)(null);
3087
+ const ref = (0, import_react15.useRef)(null);
3088
+ const boxRef = (0, import_react15.useRef)(null);
3089
+ const hideTimer = (0, import_react15.useRef)(null);
3090
+ const showTimer = (0, import_react15.useRef)(null);
3091
+ const exitTimer = (0, import_react15.useRef)(null);
3092
+ const [shown, setShown] = (0, import_react15.useState)(false);
3093
+ const openRef = (0, import_react15.useRef)(false);
3094
+ const mountedRef = (0, import_react15.useRef)(false);
3095
+ const id = (0, import_react15.useId)();
3096
+ const describedRef = (0, import_react15.useRef)(null);
2863
3097
  const clearHideTimer = () => {
2864
3098
  if (hideTimer.current) {
2865
3099
  clearTimeout(hideTimer.current);
@@ -2878,7 +3112,7 @@ function Tooltip({
2878
3112
  exitTimer.current = null;
2879
3113
  }
2880
3114
  };
2881
- (0, import_react13.useEffect)(
3115
+ (0, import_react15.useEffect)(
2882
3116
  () => () => {
2883
3117
  clearHideTimer();
2884
3118
  clearShowTimer();
@@ -2952,7 +3186,7 @@ function Tooltip({
2952
3186
  clearHideTimer();
2953
3187
  hideTimer.current = setTimeout(hideNow, 120);
2954
3188
  };
2955
- (0, import_react13.useEffect)(() => {
3189
+ (0, import_react15.useEffect)(() => {
2956
3190
  if (!anchorRef) return;
2957
3191
  const el = anchorRef.current;
2958
3192
  if (!el) return;
@@ -2967,13 +3201,13 @@ function Tooltip({
2967
3201
  el.removeEventListener("blur", hide);
2968
3202
  };
2969
3203
  }, [anchorRef, placement, delay]);
2970
- (0, import_react13.useEffect)(() => {
3204
+ (0, import_react15.useEffect)(() => {
2971
3205
  if (!anchor) return;
2972
3206
  const onKey = (e) => e.key === "Escape" && hideNow();
2973
3207
  window.addEventListener("keydown", onKey);
2974
3208
  return () => window.removeEventListener("keydown", onKey);
2975
3209
  }, [anchor]);
2976
- (0, import_react13.useLayoutEffect)(() => {
3210
+ (0, import_react15.useLayoutEffect)(() => {
2977
3211
  if (!anchor) return;
2978
3212
  const el = boxRef.current;
2979
3213
  if (!el) return;
@@ -2998,7 +3232,7 @@ function Tooltip({
2998
3232
  }
2999
3233
  }
3000
3234
  const floating = anchor != null && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
3001
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3235
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3002
3236
  "span",
3003
3237
  {
3004
3238
  ref: boxRef,
@@ -3029,7 +3263,7 @@ function Tooltip({
3029
3263
  document.body
3030
3264
  ) : null;
3031
3265
  if (anchorRef) return floating;
3032
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3266
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3033
3267
  "span",
3034
3268
  {
3035
3269
  ref,
@@ -3051,28 +3285,28 @@ function Tooltip({
3051
3285
  }
3052
3286
 
3053
3287
  // src/AdvertiserNoResults.tsx
3054
- var import_jsx_runtime27 = require("react/jsx-runtime");
3288
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3055
3289
  function AdvertiserNoResults({
3056
3290
  query,
3057
3291
  hint = "Try checking your spelling or searching for a broader brand name.",
3058
3292
  className,
3059
3293
  testIdPrefix
3060
3294
  }) {
3061
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
3062
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("p", { className: "text-dense font-medium text-text-primary", children: [
3295
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex flex-col items-center gap-1.5 px-4 py-8 text-center", className), "data-testid": testIdPrefix, children: [
3296
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { className: "text-dense font-medium text-text-primary", children: [
3063
3297
  "No results found for \u201C",
3064
3298
  query,
3065
3299
  "\u201D"
3066
3300
  ] }),
3067
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
3301
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-xs leading-snug text-text-tertiary", children: hint })
3068
3302
  ] });
3069
3303
  }
3070
3304
 
3071
3305
  // src/SelectAllVisible.tsx
3072
- var import_lucide_react14 = require("lucide-react");
3073
- var import_jsx_runtime28 = require("react/jsx-runtime");
3306
+ var import_lucide_react15 = require("lucide-react");
3307
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3074
3308
  function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }) {
3075
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3309
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3076
3310
  "button",
3077
3311
  {
3078
3312
  type: "button",
@@ -3083,7 +3317,7 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
3083
3317
  className
3084
3318
  ),
3085
3319
  children: [
3086
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.ListChecks, { size: 14, "aria-hidden": "true" }),
3320
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.ListChecks, { size: 14, "aria-hidden": "true" }),
3087
3321
  allSelected ? `Deselect ${count} visible` : `Select all ${count} visible`
3088
3322
  ]
3089
3323
  }
@@ -3091,12 +3325,12 @@ function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefi
3091
3325
  }
3092
3326
 
3093
3327
  // src/SelectedSection.tsx
3094
- var import_lucide_react15 = require("lucide-react");
3095
- var import_jsx_runtime29 = require("react/jsx-runtime");
3328
+ var import_lucide_react16 = require("lucide-react");
3329
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3096
3330
  function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }) {
3097
3331
  if (count === 0) return null;
3098
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
3099
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3332
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
3333
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3100
3334
  "button",
3101
3335
  {
3102
3336
  type: "button",
@@ -3105,25 +3339,25 @@ function SelectedSection({ count, open, onToggle, children, className, testIdPre
3105
3339
  "aria-expanded": open,
3106
3340
  className: "flex w-full items-center gap-1.5 rounded-control px-2 py-1 text-left text-micro font-semibold uppercase tracking-wide text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
3107
3341
  children: [
3108
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
3342
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", !open && "-rotate-90") }),
3109
3343
  "Selected (",
3110
3344
  count,
3111
3345
  ")"
3112
3346
  ]
3113
3347
  }
3114
3348
  ),
3115
- open && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex flex-col gap-0.5", children })
3349
+ open && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col gap-0.5", children })
3116
3350
  ] });
3117
3351
  }
3118
3352
 
3119
3353
  // src/SelectionPicker.tsx
3120
- var import_react15 = require("react");
3354
+ var import_react17 = require("react");
3121
3355
  var import_react_dom4 = require("react-dom");
3122
- var import_lucide_react16 = require("lucide-react");
3356
+ var import_lucide_react17 = require("lucide-react");
3123
3357
 
3124
3358
  // src/Tabs.tsx
3125
- var import_react14 = require("react");
3126
- var import_jsx_runtime30 = require("react/jsx-runtime");
3359
+ var import_react16 = require("react");
3360
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3127
3361
  function arrowKeys(e, row) {
3128
3362
  if (!row || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return;
3129
3363
  const items = Array.from(row.querySelectorAll("button:not([disabled])"));
@@ -3134,8 +3368,8 @@ function arrowKeys(e, row) {
3134
3368
  items[next]?.click();
3135
3369
  }
3136
3370
  function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPrefix, ...rest }) {
3137
- const row = (0, import_react14.useRef)(null);
3138
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3371
+ const row = (0, import_react16.useRef)(null);
3372
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3139
3373
  "div",
3140
3374
  {
3141
3375
  ref: row,
@@ -3146,7 +3380,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
3146
3380
  className: cn("flex gap-6 border-b border-border-default", className),
3147
3381
  children: items.map((item) => {
3148
3382
  const on = item.value === value;
3149
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3383
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3150
3384
  "button",
3151
3385
  {
3152
3386
  type: "button",
@@ -3164,7 +3398,7 @@ function Tabs({ items, value, onChange, idPrefix = "tabs", className, testIdPref
3164
3398
  ),
3165
3399
  children: [
3166
3400
  item.label,
3167
- item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
3401
+ item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-text-tertiary", children: item.count })
3168
3402
  ]
3169
3403
  },
3170
3404
  item.value
@@ -3182,8 +3416,8 @@ function SegmentedControl({
3182
3416
  testIdPrefix,
3183
3417
  ...rest
3184
3418
  }) {
3185
- const row = (0, import_react14.useRef)(null);
3186
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3419
+ const row = (0, import_react16.useRef)(null);
3420
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3187
3421
  "div",
3188
3422
  {
3189
3423
  ref: row,
@@ -3194,7 +3428,7 @@ function SegmentedControl({
3194
3428
  className: cn("inline-flex w-fit items-stretch gap-0.5 rounded-full bg-subtle p-1", size === "md" ? "h-10" : "h-8", className),
3195
3429
  children: options.map((o) => {
3196
3430
  const on = o.value === value;
3197
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3431
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3198
3432
  "button",
3199
3433
  {
3200
3434
  type: "button",
@@ -3218,7 +3452,7 @@ function SegmentedControl({
3218
3452
  }
3219
3453
 
3220
3454
  // src/SelectionPicker.tsx
3221
- var import_jsx_runtime31 = require("react/jsx-runtime");
3455
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3222
3456
  function slug5(value) {
3223
3457
  return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
3224
3458
  }
@@ -3252,15 +3486,15 @@ function SelectionPicker({
3252
3486
  testIdPrefix
3253
3487
  }) {
3254
3488
  const hasAccountLists = !!accountLists;
3255
- const [source, setSource] = (0, import_react15.useState)("search");
3256
- const [query, setQuery] = (0, import_react15.useState)("");
3257
- const [activeFilters, setActiveFilters] = (0, import_react15.useState)(() => {
3489
+ const [source, setSource] = (0, import_react17.useState)("search");
3490
+ const [query, setQuery] = (0, import_react17.useState)("");
3491
+ const [activeFilters, setActiveFilters] = (0, import_react17.useState)(() => {
3258
3492
  const init = {};
3259
3493
  if (defaultFilters) for (const [label, opts] of Object.entries(defaultFilters)) init[label] = new Set(opts);
3260
3494
  return init;
3261
3495
  });
3262
- const [expanded, setExpanded] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
3263
- const selectedIds = (0, import_react15.useMemo)(() => new Set(selected.map((s) => s.id)), [selected]);
3496
+ const [expanded, setExpanded] = (0, import_react17.useState)(/* @__PURE__ */ new Set());
3497
+ const selectedIds = (0, import_react17.useMemo)(() => new Set(selected.map((s) => s.id)), [selected]);
3264
3498
  const toggleFilter = (label, opt) => {
3265
3499
  setActiveFilters((prev) => {
3266
3500
  const next = { ...prev };
@@ -3272,7 +3506,7 @@ function SelectionPicker({
3272
3506
  };
3273
3507
  const activeFilterCount = filters.reduce((n, f) => n + (activeFilters[f.label]?.size ?? 0), 0);
3274
3508
  const hasSearched = showResultsWithoutSearch || query.trim().length > 0 || !requireQuery && activeFilterCount > 0;
3275
- const filteredCatalog = (0, import_react15.useMemo)(() => {
3509
+ const filteredCatalog = (0, import_react17.useMemo)(() => {
3276
3510
  if (!hasSearched || results !== void 0) return [];
3277
3511
  const q = query.trim().toLowerCase();
3278
3512
  return catalog.filter((row) => {
@@ -3311,12 +3545,12 @@ function SelectionPicker({
3311
3545
  }
3312
3546
  };
3313
3547
  const rowGridCols = showInfoColumn ? "grid-cols-[36px_1fr_44px]" : "grid-cols-[36px_1fr]";
3314
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
3315
- helper && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3316
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-secondary", children: helper }),
3317
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
3548
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("flex flex-col gap-4", className), "data-testid": testIdPrefix, children: [
3549
+ helper && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
3550
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-secondary", children: helper }),
3551
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("hr", { className: "-mx-5 -mt-2 border-border-default sm:-mx-6" })
3318
3552
  ] }),
3319
- hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3553
+ hasAccountLists && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3320
3554
  SegmentedControl,
3321
3555
  {
3322
3556
  "aria-label": "Add from",
@@ -3329,11 +3563,11 @@ function SelectionPicker({
3329
3563
  ]
3330
3564
  }
3331
3565
  ),
3332
- source === "search" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
3333
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3334
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex h-8 min-w-50 flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
3335
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
3336
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3566
+ source === "search" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
3567
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
3568
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex h-8 min-w-50 flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
3569
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Search, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
3570
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3337
3571
  "input",
3338
3572
  {
3339
3573
  value: query,
@@ -3349,7 +3583,7 @@ function SelectionPicker({
3349
3583
  }
3350
3584
  )
3351
3585
  ] }),
3352
- filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3586
+ filters.map((f) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3353
3587
  FilterDropdown,
3354
3588
  {
3355
3589
  filter: f,
@@ -3361,14 +3595,14 @@ function SelectionPicker({
3361
3595
  )),
3362
3596
  toolbarExtra
3363
3597
  ] }),
3364
- !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
3365
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
3366
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-1", children: [
3367
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
3368
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
3598
+ !hasSearched ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
3599
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Search, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
3600
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1", children: [
3601
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "Search to get started" }),
3602
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-tertiary", children: "Use the search or filters above to find and add options." })
3369
3603
  ] })
3370
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
3371
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3604
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "overflow-hidden rounded-control border border-border-default", children: [
3605
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3372
3606
  "div",
3373
3607
  {
3374
3608
  className: cn(
@@ -3376,7 +3610,7 @@ function SelectionPicker({
3376
3610
  rowGridCols
3377
3611
  ),
3378
3612
  children: [
3379
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3613
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3380
3614
  CheckBox,
3381
3615
  {
3382
3616
  checked: allSelected,
@@ -3387,18 +3621,18 @@ function SelectionPicker({
3387
3621
  testIdPrefix: testIdPrefix && `${testIdPrefix}-select-all`
3388
3622
  }
3389
3623
  ),
3390
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
3391
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-right", children: "Info" })
3624
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("grid gap-2", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: c.className, children: c.header }, c.key)) }),
3625
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-right", children: "Info" })
3392
3626
  ]
3393
3627
  }
3394
3628
  ),
3395
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
3629
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "max-h-90 overflow-y-auto", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-center py-6", role: "status", "aria-label": "Loading", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { size: 18, className: "animate-spin text-text-tertiary", "aria-hidden": "true" }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: errorMessage }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "px-3 py-8 text-center text-dense text-text-tertiary", children: "No matches. Try a different search or filter." }) : rows.map((row) => {
3396
3630
  const isSel = selectedIds.has(row.id);
3397
3631
  const isLocked = lockedIds?.has(row.id) ?? false;
3398
3632
  const kids = getChildren?.(row);
3399
3633
  const isOpen = expanded.has(row.id);
3400
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
3401
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3634
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "border-t border-border-default/60 first:border-t-0", children: [
3635
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3402
3636
  "div",
3403
3637
  {
3404
3638
  onClick: isLocked ? void 0 : () => toggleRow(row),
@@ -3411,7 +3645,7 @@ function SelectionPicker({
3411
3645
  !isLocked && isSel && "opacity-70"
3412
3646
  ),
3413
3647
  children: [
3414
- isLocked ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3648
+ isLocked ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3415
3649
  CheckBox,
3416
3650
  {
3417
3651
  checked: isSel,
@@ -3420,8 +3654,8 @@ function SelectionPicker({
3420
3654
  testIdPrefix: testIdPrefix && `${testIdPrefix}-row-${slug5(row.id)}`
3421
3655
  }
3422
3656
  ),
3423
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
3424
- showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3657
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("grid gap-2 text-dense text-text-primary", gridForColumns(columns)), children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("truncate", c.className), children: c.render(row) }, c.key)) }),
3658
+ showInfoColumn && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-end", children: kids && kids.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3425
3659
  "button",
3426
3660
  {
3427
3661
  type: "button",
@@ -3435,28 +3669,28 @@ function SelectionPicker({
3435
3669
  });
3436
3670
  },
3437
3671
  className: "flex h-7 w-7 items-center justify-center rounded-control text-text-secondary hover:bg-canvas hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
3438
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.ChevronRight, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
3672
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronRight, { size: 15, className: cn("transition-transform", isOpen && "rotate-90") })
3439
3673
  }
3440
- ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3674
+ ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3441
3675
  "span",
3442
3676
  {
3443
3677
  className: "flex h-7 w-7 items-center justify-center text-text-tertiary",
3444
3678
  title: "No additional details",
3445
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Info, { size: 14 })
3679
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Info, { size: 14 })
3446
3680
  }
3447
3681
  ) })
3448
3682
  ]
3449
3683
  }
3450
3684
  ),
3451
- isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
3685
+ isOpen && kids && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-canvas/60 pb-1.5 pl-10 pr-3", children: kids.map((kid) => {
3452
3686
  const kidSel = selectedIds.has(kid.id);
3453
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3687
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3454
3688
  "div",
3455
3689
  {
3456
3690
  className: "flex items-center justify-between gap-2 border-t border-border-default/40 py-2 first:border-t-0",
3457
3691
  children: [
3458
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
3459
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3692
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate text-dense text-text-secondary", children: kid.name }),
3693
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3460
3694
  "button",
3461
3695
  {
3462
3696
  type: "button",
@@ -3467,7 +3701,7 @@ function SelectionPicker({
3467
3701
  kidSel ? "text-text-tertiary" : "text-text-link hover:bg-subtle"
3468
3702
  ),
3469
3703
  children: [
3470
- kidSel ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Plus, { size: 13 }),
3704
+ kidSel ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Check, { size: 13 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Plus, { size: 13 }),
3471
3705
  kidSel ? "Added" : "Add"
3472
3706
  ]
3473
3707
  }
@@ -3479,7 +3713,7 @@ function SelectionPicker({
3479
3713
  }) })
3480
3714
  ] }, row.id);
3481
3715
  }) }),
3482
- !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3716
+ !loading && !error && hasMore && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3483
3717
  "button",
3484
3718
  {
3485
3719
  type: "button",
@@ -3488,19 +3722,19 @@ function SelectionPicker({
3488
3722
  "data-testid": testIdPrefix && `${testIdPrefix}-load-more`,
3489
3723
  className: "flex w-full items-center justify-center gap-2 border-t border-border-default px-2 py-1.5 text-dense text-brand-primaryAction transition-colors hover:bg-subtle disabled:opacity-50 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
3490
3724
  children: [
3491
- loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
3725
+ loadingMore ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { size: 13, className: "animate-spin", "aria-hidden": "true" }) : null,
3492
3726
  loadingMore ? "Loading\u2026" : "Load more"
3493
3727
  ]
3494
3728
  }
3495
3729
  )
3496
3730
  ] })
3497
3731
  ] }),
3498
- source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
3499
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
3500
- accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3501
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
3732
+ source === "lists" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex min-w-0 flex-col gap-3", children: [
3733
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-secondary", children: "Select an account list to add all of its accounts at once. Your workspace stays in sync as the list is updated." }),
3734
+ accountLists && accountLists.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
3735
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ScrollFade, { className: "flex max-h-99 flex-col gap-2 overflow-y-auto pr-0.5", children: accountLists.map((list) => {
3502
3736
  const on = (selectedListIds ?? []).includes(list.id);
3503
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3737
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3504
3738
  "button",
3505
3739
  {
3506
3740
  type: "button",
@@ -3512,19 +3746,19 @@ function SelectionPicker({
3512
3746
  on ? "border-brand-primaryAction bg-brand-primarySoft" : "border-border-default bg-surface hover:bg-subtle"
3513
3747
  ),
3514
3748
  children: [
3515
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3749
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3516
3750
  "span",
3517
3751
  {
3518
3752
  className: cn(
3519
3753
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full",
3520
3754
  on ? "text-brand-primaryAction" : "text-text-secondary"
3521
3755
  ),
3522
- children: on ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Plus, { size: 16 })
3756
+ children: on ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Plus, { size: 16 })
3523
3757
  }
3524
3758
  ),
3525
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "min-w-0 flex-1", children: [
3526
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
3527
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "block truncate text-xs text-text-secondary", children: [
3759
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "min-w-0 flex-1", children: [
3760
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate text-sm font-medium text-text-primary", children: list.name }) }),
3761
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "block truncate text-xs text-text-secondary", children: [
3528
3762
  list.count,
3529
3763
  " accounts \xB7 ",
3530
3764
  list.entityTypes.join(", "),
@@ -3532,13 +3766,13 @@ function SelectionPicker({
3532
3766
  formatListDate(list.updatedAt)
3533
3767
  ] })
3534
3768
  ] }),
3535
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
3769
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("shrink-0 text-xs font-medium", on ? "text-brand-primaryAction" : "text-text-secondary"), children: on ? "Added" : "Add" })
3536
3770
  ]
3537
3771
  },
3538
3772
  list.id
3539
3773
  );
3540
3774
  }) }),
3541
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3775
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3542
3776
  "p",
3543
3777
  {
3544
3778
  className: "border-t border-border-default pt-2 text-right text-xs font-medium text-text-tertiary",
@@ -3550,11 +3784,11 @@ function SelectionPicker({
3550
3784
  ]
3551
3785
  }
3552
3786
  )
3553
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
3554
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
3555
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-1", children: [
3556
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
3557
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
3787
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-card border border-dashed border-border-default py-10 text-center", children: [
3788
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-subtle", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.List, { size: 20, className: "text-text-tertiary", "aria-hidden": "true" }) }),
3789
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col gap-1", children: [
3790
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-semibold text-text-primary", children: "No account lists yet" }),
3791
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-dense text-text-tertiary", children: "Account lists set up for you will appear here." })
3558
3792
  ] })
3559
3793
  ] })
3560
3794
  ] })
@@ -3562,16 +3796,16 @@ function SelectionPicker({
3562
3796
  }
3563
3797
  var EDGE_FADE = 44;
3564
3798
  function ScrollFade({ className, children }) {
3565
- const elRef = (0, import_react15.useRef)(null);
3566
- const [edges, setEdges] = (0, import_react15.useState)({ top: false, bottom: false });
3567
- const sync = (0, import_react15.useCallback)(() => {
3799
+ const elRef = (0, import_react17.useRef)(null);
3800
+ const [edges, setEdges] = (0, import_react17.useState)({ top: false, bottom: false });
3801
+ const sync = (0, import_react17.useCallback)(() => {
3568
3802
  const el = elRef.current;
3569
3803
  if (!el) return;
3570
3804
  const top = el.scrollTop > 2;
3571
3805
  const bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 2;
3572
3806
  setEdges((prev) => prev.top === top && prev.bottom === bottom ? prev : { top, bottom });
3573
3807
  }, []);
3574
- const attach = (0, import_react15.useCallback)(
3808
+ const attach = (0, import_react17.useCallback)(
3575
3809
  (el) => {
3576
3810
  elRef.current = el;
3577
3811
  if (!el) return;
@@ -3586,7 +3820,7 @@ function ScrollFade({ className, children }) {
3586
3820
  [sync]
3587
3821
  );
3588
3822
  const mask = edges.top || edges.bottom ? `linear-gradient(to bottom, transparent 0, #000 ${edges.top ? EDGE_FADE : 0}px, #000 calc(100% - ${edges.bottom ? EDGE_FADE : 0}px), transparent 100%)` : void 0;
3589
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
3823
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: attach, onScroll: sync, className, style: { maskImage: mask, WebkitMaskImage: mask }, children });
3590
3824
  }
3591
3825
  function formatListDate(iso) {
3592
3826
  try {
@@ -3601,19 +3835,19 @@ function FilterDropdown({
3601
3835
  onToggle,
3602
3836
  testIdPrefix
3603
3837
  }) {
3604
- const [open, setOpen] = (0, import_react15.useState)(false);
3605
- const [q, setQ] = (0, import_react15.useState)("");
3606
- const btnRef = (0, import_react15.useRef)(null);
3607
- const menuRef = (0, import_react15.useRef)(null);
3608
- const [pos, setPos] = (0, import_react15.useState)(null);
3838
+ const [open, setOpen] = (0, import_react17.useState)(false);
3839
+ const [q, setQ] = (0, import_react17.useState)("");
3840
+ const btnRef = (0, import_react17.useRef)(null);
3841
+ const menuRef = (0, import_react17.useRef)(null);
3842
+ const [pos, setPos] = (0, import_react17.useState)(null);
3609
3843
  const searchable = filter.options.length > 8;
3610
3844
  const shownOptions = searchable && q.trim() ? filter.options.filter((o) => o.toLowerCase().includes(q.trim().toLowerCase())) : filter.options;
3611
- (0, import_react15.useLayoutEffect)(() => {
3845
+ (0, import_react17.useLayoutEffect)(() => {
3612
3846
  if (!open || !btnRef.current) return;
3613
3847
  const r = btnRef.current.getBoundingClientRect();
3614
3848
  setPos({ top: r.bottom + 6, left: r.left });
3615
3849
  }, [open]);
3616
- (0, import_react15.useEffect)(() => {
3850
+ (0, import_react17.useEffect)(() => {
3617
3851
  if (!open) {
3618
3852
  setQ("");
3619
3853
  return;
@@ -3636,8 +3870,8 @@ function FilterDropdown({
3636
3870
  const count = active.size;
3637
3871
  const label = count === 0 ? filter.label : count === 1 ? [...active][0] : "Multiple";
3638
3872
  const filterSlug = slug5(filter.label);
3639
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "relative", children: [
3640
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3873
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
3874
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3641
3875
  "button",
3642
3876
  {
3643
3877
  ref: btnRef,
@@ -3648,12 +3882,12 @@ function FilterDropdown({
3648
3882
  className: "inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-dense font-medium text-text-secondary transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
3649
3883
  children: [
3650
3884
  label,
3651
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
3885
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.ChevronDown, { size: 13, "aria-hidden": "true", className: cn("transition-transform", open && "rotate-180") })
3652
3886
  ]
3653
3887
  }
3654
3888
  ),
3655
3889
  open && pos && (0, import_react_dom4.createPortal)(
3656
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3890
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3657
3891
  "div",
3658
3892
  {
3659
3893
  ref: menuRef,
@@ -3662,9 +3896,9 @@ function FilterDropdown({
3662
3896
  style: { top: pos.top, left: pos.left },
3663
3897
  className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
3664
3898
  children: [
3665
- searchable && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
3666
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react16.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
3667
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3899
+ searchable && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
3900
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Search, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
3901
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3668
3902
  "input",
3669
3903
  {
3670
3904
  autoFocus: true,
@@ -3675,14 +3909,14 @@ function FilterDropdown({
3675
3909
  }
3676
3910
  )
3677
3911
  ] }),
3678
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
3912
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex flex-col gap-0.5", searchable && "max-h-60 overflow-y-auto"), children: shownOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "px-2 py-3 text-center text-xs text-text-secondary", children: "No matches." }) : shownOptions.map((opt) => {
3679
3913
  const on = active.has(opt);
3680
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3914
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3681
3915
  "label",
3682
3916
  {
3683
3917
  className: "flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-dense text-text-primary hover:bg-subtle",
3684
3918
  children: [
3685
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3919
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3686
3920
  CheckBox,
3687
3921
  {
3688
3922
  checked: on,
@@ -3712,8 +3946,8 @@ function gridForColumns(columns) {
3712
3946
  }
3713
3947
 
3714
3948
  // src/PublisherBreakdownList.tsx
3715
- var import_react16 = require("react");
3716
- var import_jsx_runtime32 = require("react/jsx-runtime");
3949
+ var import_react18 = require("react");
3950
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3717
3951
  var fmtM = (v) => v >= 100 ? `$${Math.round(v)}M` : `$${v.toFixed(1)}M`;
3718
3952
  function priorYearAmt(spendN, yoy) {
3719
3953
  if (yoy === "NEW" || yoy <= -100) return null;
@@ -3725,7 +3959,7 @@ function initials(name) {
3725
3959
  return name.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase();
3726
3960
  }
3727
3961
  function Monogram({ name, size = 28 }) {
3728
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3962
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3729
3963
  "span",
3730
3964
  {
3731
3965
  "aria-hidden": "true",
@@ -3736,12 +3970,12 @@ function Monogram({ name, size = 28 }) {
3736
3970
  );
3737
3971
  }
3738
3972
  function BreakdownTag({ children }) {
3739
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-micro font-medium text-text-secondary", children });
3973
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "inline-flex items-center whitespace-nowrap rounded-full bg-subtle px-2 py-0.5 text-micro font-medium text-text-secondary", children });
3740
3974
  }
3741
3975
  function DelayedTip({ label, children }) {
3742
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
3976
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "group/dt relative inline-flex", tabIndex: 0, "aria-label": label, children: [
3743
3977
  children,
3744
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3978
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3745
3979
  "span",
3746
3980
  {
3747
3981
  role: "tooltip",
@@ -3755,22 +3989,22 @@ var COL_CURRENT = 76;
3755
3989
  var COL_PREVIOUS = 76;
3756
3990
  var COL_YOY = 44;
3757
3991
  function MetricListHeader({ className }) {
3758
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
3759
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex-1" }),
3760
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3761
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
3762
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
3763
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
3992
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-baseline gap-2 pb-2", className), children: [
3993
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex-1" }),
3994
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3995
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_CURRENT }, children: "Current" }),
3996
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DelayedTip, { label: "Spend during the same time period one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_PREVIOUS }, children: "Previous" }) }),
3997
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DelayedTip, { label: "Percent change from this time period vs. the same time one year ago.", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-micro font-medium text-text-tertiary", style: { width: COL_YOY }, children: "YoY" }) })
3764
3998
  ] })
3765
3999
  ] });
3766
4000
  }
3767
4001
  function MetricCells({ spendN, yoy }) {
3768
4002
  const prior = priorYearAmt(spendN, yoy);
3769
4003
  const up = yoy !== "NEW" && yoy >= 0;
3770
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
3771
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
3772
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
3773
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
4004
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "flex shrink-0 items-center gap-2 pr-1.5", children: [
4005
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-xs font-bold tabular-nums text-text-primary", style: { width: COL_CURRENT }, children: fmtM(spendN) }),
4006
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-right text-xs font-normal tabular-nums text-text-primary", style: { width: COL_PREVIOUS }, children: prior ?? "\u2014" }),
4007
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "flex justify-end", style: { width: COL_YOY }, children: yoy === "NEW" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "rounded-full bg-status-warning/15 px-1.5 text-badge font-semibold text-text-warning", children: "NEW" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: cn("text-right text-xs font-semibold tabular-nums", up ? "text-text-success" : "text-text-danger"), children: [
3774
4008
  up ? "+" : "\u2212",
3775
4009
  Math.abs(yoy),
3776
4010
  "%"
@@ -3786,130 +4020,44 @@ function PublisherBreakdownList({
3786
4020
  className,
3787
4021
  testIdPrefix
3788
4022
  }) {
3789
- const [showAll, setShowAll] = (0, import_react16.useState)(false);
4023
+ const [showAll, setShowAll] = (0, import_react18.useState)(false);
3790
4024
  const visible = showAll ? rows : rows.slice(0, defaultVisibleCount);
3791
4025
  const rowPad = padded ? "px-5" : "";
3792
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
3793
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col", children: [
3794
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MetricListHeader, { className: rowPad }),
3795
- visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
3796
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
3797
- renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Monogram, { name: p.brand, size: 28 }),
3798
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "min-w-0", children: [
3799
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
3800
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
3801
- p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(BreakdownTag, { children: t }, t))
4026
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex flex-col", className), "data-testid": testIdPrefix, children: [
4027
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col", children: [
4028
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MetricListHeader, { className: rowPad }),
4029
+ visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center justify-between gap-3 border-t border-border-default/60 py-2.5 first:border-t-0", rowPad), children: [
4030
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
4031
+ renderLogo ? renderLogo(p) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Monogram, { name: p.brand, size: 28 }),
4032
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "min-w-0", children: [
4033
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
4034
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm font-semibold text-text-primary", children: p.brand }),
4035
+ p.tags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BreakdownTag, { children: t }, t))
3802
4036
  ] }),
3803
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
4037
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "truncate text-micro text-text-tertiary", children: p.owner })
3804
4038
  ] })
3805
4039
  ] }),
3806
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
4040
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MetricCells, { spendN: p.spendN, yoy: p.yoy })
3807
4041
  ] }, p.brand))
3808
4042
  ] }),
3809
- rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { href: viewAllHref, className: "text-xs font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
3810
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
4043
+ rows.length > defaultVisibleCount && (viewAllHref ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("border-t border-border-default py-3", rowPad), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { href: viewAllHref, className: "text-xs font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "See all publishers" }) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex items-center gap-2 border-t border-border-default py-3 text-xs text-text-tertiary", rowPad), children: [
4044
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
3811
4045
  "Showing ",
3812
4046
  visible.length,
3813
4047
  " of ",
3814
4048
  rows.length
3815
4049
  ] }),
3816
- !showAll ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: [
4050
+ !showAll ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", onClick: () => setShowAll(true), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: [
3817
4051
  "See all (",
3818
4052
  rows.length - defaultVisibleCount,
3819
4053
  " more)"
3820
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Show less" })
4054
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: () => setShowAll(false), className: "font-semibold text-text-link hover:underline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: "Show less" })
3821
4055
  ] }))
3822
4056
  ] });
3823
4057
  }
3824
4058
 
3825
- // src/Button.tsx
3826
- var import_react17 = require("react");
3827
- var import_react_slot = require("@radix-ui/react-slot");
3828
- var import_class_variance_authority = require("class-variance-authority");
3829
- var import_lucide_react17 = require("lucide-react");
3830
- var import_jsx_runtime33 = require("react/jsx-runtime");
3831
- var buttonVariants = (0, import_class_variance_authority.cva)(
3832
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-control transition-all duration-(--mr-motion-duration-interactive) ease-interactive disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
3833
- {
3834
- variants: {
3835
- variant: {
3836
- primary: "bg-brand-primaryAction text-brand-onprimary hover:brightness-110",
3837
- // border-strong, not border-interactive. The interactive token is #6b6358
3838
- // -- 5.9:1 against the surface, nearly as dark as body text -- which is
3839
- // right for an input the eye must find in a form, and far too heavy for
3840
- // a button sitting beside other buttons. It reads heaviest on icon-only,
3841
- // where there is least fill inside the line to balance it.
3842
- secondary: "bg-surface text-text-primary border border-border-strong hover:bg-subtle hover:border-border-interactive",
3843
- ghost: "text-text-primary hover:bg-subtle",
3844
- danger: "bg-status-danger text-status-onstatus hover:brightness-110",
3845
- // Quiet destructive: neutral at rest, red only on hover. This is what
3846
- // the product actually reaches for -- nearly every hand-rolled
3847
- // destructive control is an icon that reddens on hover, while filled
3848
- // `danger` is right only for the confirm button in a dialog the user
3849
- // already opened.
3850
- dangerGhost: "text-text-secondary hover:bg-subtle hover:text-text-danger",
3851
- link: "text-text-link underline-offset-4 hover:underline px-0"
3852
- },
3853
- // Type scales with the box. One size across all three left xs cramped --
3854
- // 14px inside a 24px box leaves five pixels above and below, so the label
3855
- // fills the button instead of sitting in it.
3856
- size: {
3857
- xs: "h-6 px-2 text-xs",
3858
- sm: "h-8 px-3 text-sm",
3859
- md: "h-10 px-4 text-sm",
3860
- // 44, the filter row's height, so a button at the end of a row of
3861
- // filter dropdowns lines up with them. One control scale: 32 / 40 / 44.
3862
- lg: "h-11 px-5 text-sm"
3863
- },
3864
- // Shape is orthogonal to size. As a fourth SIZE, `icon` could only ever
3865
- // be one dimension, so an icon button never lined up with the labelled
3866
- // buttons beside it in a toolbar. As a shape it squares the box at
3867
- // whichever height you picked.
3868
- iconOnly: {
3869
- true: "p-0",
3870
- false: ""
3871
- }
3872
- },
3873
- compoundVariants: [
3874
- { size: "xs", iconOnly: true, class: "w-6" },
3875
- { size: "sm", iconOnly: true, class: "w-8" },
3876
- { size: "md", iconOnly: true, class: "w-10" },
3877
- { size: "lg", iconOnly: true, class: "w-11" },
3878
- // A boxed button is a target you aim at, so its label carries the weight
3879
- // of one. `link` sits inline in a sentence, where semibold reads as
3880
- // emphasis on the words rather than as a control.
3881
- { variant: ["primary", "secondary", "ghost", "danger", "dangerGhost"], class: "font-semibold" },
3882
- { variant: "link", class: "font-medium h-auto p-0" }
3883
- ],
3884
- defaultVariants: {
3885
- variant: "primary",
3886
- size: "md",
3887
- iconOnly: false
3888
- }
3889
- }
3890
- );
3891
- var Button = (0, import_react17.forwardRef)(
3892
- ({ className, testIdPrefix, variant, size, iconOnly, asChild = false, loading = false, disabled, children, ...props }, ref) => {
3893
- const shared = {
3894
- className: cn(buttonVariants({ variant, size, iconOnly, className })),
3895
- "data-testid": testIdPrefix,
3896
- disabled: disabled || loading,
3897
- "aria-busy": loading || void 0,
3898
- ...props
3899
- };
3900
- if (asChild) {
3901
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_slot.Slot, { ref, ...shared, children });
3902
- }
3903
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { ref, ...shared, children: [
3904
- loading && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.Loader2, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }),
3905
- children
3906
- ] });
3907
- }
3908
- );
3909
- Button.displayName = "Button";
3910
-
3911
4059
  // src/FilterDropdownFooter.tsx
3912
- var import_jsx_runtime34 = require("react/jsx-runtime");
4060
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3913
4061
  function FilterDropdownFooter({
3914
4062
  onClear,
3915
4063
  onApply,
@@ -3918,7 +4066,7 @@ function FilterDropdownFooter({
3918
4066
  className,
3919
4067
  testIdPrefix
3920
4068
  }) {
3921
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
4069
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3922
4070
  "div",
3923
4071
  {
3924
4072
  className: cn(
@@ -3928,17 +4076,17 @@ function FilterDropdownFooter({
3928
4076
  ),
3929
4077
  "data-testid": testIdPrefix,
3930
4078
  children: [
3931
- onClear && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
3932
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
4079
+ onClear && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onClear, children: clearLabel }),
4080
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, children: applyLabel })
3933
4081
  ]
3934
4082
  }
3935
4083
  );
3936
4084
  }
3937
4085
 
3938
4086
  // src/NameListModal.tsx
3939
- var import_react18 = require("react");
4087
+ var import_react19 = require("react");
3940
4088
  var import_react_dom5 = require("react-dom");
3941
- var import_jsx_runtime35 = require("react/jsx-runtime");
4089
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3942
4090
  function NameListModal({
3943
4091
  title,
3944
4092
  initialName,
@@ -3951,21 +4099,21 @@ function NameListModal({
3951
4099
  className,
3952
4100
  testIdPrefix
3953
4101
  }) {
3954
- const [name, setName] = (0, import_react18.useState)(initialName);
3955
- const [checked, setChecked] = (0, import_react18.useState)(
4102
+ const [name, setName] = (0, import_react19.useState)(initialName);
4103
+ const [checked, setChecked] = (0, import_react19.useState)(
3956
4104
  () => Object.fromEntries((options ?? []).map((o) => [o.key, !!o.initial]))
3957
4105
  );
3958
4106
  const toggle = (key) => setChecked((c) => ({ ...c, [key]: !c[key] }));
3959
- const dialogRef = (0, import_react18.useRef)(null);
3960
- const titleId = (0, import_react18.useId)();
3961
- const fieldId = (0, import_react18.useId)();
3962
- (0, import_react18.useEffect)(() => {
4107
+ const dialogRef = (0, import_react19.useRef)(null);
4108
+ const titleId = (0, import_react19.useId)();
4109
+ const fieldId = (0, import_react19.useId)();
4110
+ (0, import_react19.useEffect)(() => {
3963
4111
  const onKey = (e) => e.key === "Escape" && onCancel();
3964
4112
  window.addEventListener("keydown", onKey);
3965
4113
  return () => window.removeEventListener("keydown", onKey);
3966
4114
  }, [onCancel]);
3967
- const [opener] = (0, import_react18.useState)(() => typeof document === "undefined" ? null : document.activeElement);
3968
- (0, import_react18.useEffect)(
4115
+ const [opener] = (0, import_react19.useState)(() => typeof document === "undefined" ? null : document.activeElement);
4116
+ (0, import_react19.useEffect)(
3969
4117
  () => () => {
3970
4118
  const active = document.activeElement;
3971
4119
  if (!active || active === document.body) opener?.focus?.();
@@ -3992,12 +4140,12 @@ function NameListModal({
3992
4140
  // bg-scrim, not a literal: design-tokens gained a scrim token in 2.5.0.
3993
4141
  // No in-data-[theme=dark] override needed any more -- the token redefines
3994
4142
  // itself under that attribute in dark.css, so one class covers both themes.
3995
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4143
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3996
4144
  "div",
3997
4145
  {
3998
4146
  className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim px-4",
3999
4147
  onMouseDown: (e) => e.target === e.currentTarget && onCancel(),
4000
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
4148
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
4001
4149
  "div",
4002
4150
  {
4003
4151
  ref: dialogRef,
@@ -4008,10 +4156,10 @@ function NameListModal({
4008
4156
  "data-testid": testIdPrefix,
4009
4157
  className: cn("w-full max-w-110 rounded-card border border-border-default bg-surface p-5 shadow-overlay", className),
4010
4158
  children: [
4011
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4012
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
4013
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
4014
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4159
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
4160
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-4 flex flex-col gap-1.5", children: [
4161
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: fieldLabel }),
4162
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4015
4163
  "input",
4016
4164
  {
4017
4165
  id: fieldId,
@@ -4023,13 +4171,13 @@ function NameListModal({
4023
4171
  }
4024
4172
  )
4025
4173
  ] }),
4026
- options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
4027
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
4174
+ options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-4 flex flex-col gap-2.5", children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex cursor-pointer items-center gap-2.5 text-dense text-text-primary", children: [
4175
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CheckBox, { checked: !!checked[o.key], onChange: () => toggle(o.key), ariaLabel: o.label }),
4028
4176
  o.label
4029
4177
  ] }, o.key)) }),
4030
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
4031
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
4032
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
4178
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-5 flex items-center justify-end gap-2", children: [
4179
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
4180
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { disabled: !name.trim(), onClick: () => onSubmit(name.trim(), checked), children: submitLabel })
4033
4181
  ] })
4034
4182
  ]
4035
4183
  }
@@ -4042,11 +4190,11 @@ function NameListModal({
4042
4190
 
4043
4191
  // src/FilterChipBar.tsx
4044
4192
  var import_lucide_react18 = require("lucide-react");
4045
- var import_jsx_runtime36 = require("react/jsx-runtime");
4193
+ var import_jsx_runtime37 = require("react/jsx-runtime");
4046
4194
  function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }) {
4047
4195
  if (chips.length === 0) return null;
4048
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
4049
- chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4196
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("flex flex-wrap items-center gap-1.5 border-t border-border-default pt-2.5", className), "data-testid": testIdPrefix, children: [
4197
+ chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4050
4198
  Chip,
4051
4199
  {
4052
4200
  label: c.label,
@@ -4056,7 +4204,7 @@ function FilterChipBar({ chips, onRemove, onClearAll, parkedKeys, className, tes
4056
4204
  },
4057
4205
  c.key
4058
4206
  )),
4059
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4207
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4060
4208
  "button",
4061
4209
  {
4062
4210
  type: "button",
@@ -4073,8 +4221,8 @@ function Chip({
4073
4221
  parked,
4074
4222
  onRemove
4075
4223
  }) {
4076
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "group relative inline-flex", children: [
4077
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
4224
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "group relative inline-flex", children: [
4225
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
4078
4226
  "span",
4079
4227
  {
4080
4228
  className: cn(
@@ -4086,22 +4234,22 @@ function Chip({
4086
4234
  ) : "bg-subtle text-text-secondary ring-transparent group-hover:bg-border-default group-hover:text-text-primary group-hover:ring-border-interactive"
4087
4235
  ),
4088
4236
  children: [
4089
- parked && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react18.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
4237
+ parked && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.CircleSlash, { size: 11, "aria-hidden": "true", className: "shrink-0 text-text-tertiary" }),
4090
4238
  label,
4091
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4239
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4092
4240
  "button",
4093
4241
  {
4094
4242
  type: "button",
4095
4243
  onClick: onRemove,
4096
4244
  "aria-label": `Remove ${groupLabel}: ${label}`,
4097
4245
  className: "rounded-full text-text-tertiary transition-colors hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
4098
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react18.X, { size: 12 })
4246
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react18.X, { size: 12 })
4099
4247
  }
4100
4248
  )
4101
4249
  ]
4102
4250
  }
4103
4251
  ),
4104
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4252
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4105
4253
  "span",
4106
4254
  {
4107
4255
  role: "tooltip",
@@ -4113,15 +4261,15 @@ function Chip({
4113
4261
  }
4114
4262
 
4115
4263
  // src/SortButton.tsx
4116
- var import_react19 = require("react");
4264
+ var import_react20 = require("react");
4117
4265
  var import_lucide_react19 = require("lucide-react");
4118
- var import_jsx_runtime37 = require("react/jsx-runtime");
4266
+ var import_jsx_runtime38 = require("react/jsx-runtime");
4119
4267
  var ALIGN = {
4120
4268
  left: "justify-start text-left",
4121
4269
  center: "justify-center text-center",
4122
4270
  right: "justify-end text-right"
4123
4271
  };
4124
- var SortButton = (0, import_react19.forwardRef)(
4272
+ var SortButton = (0, import_react20.forwardRef)(
4125
4273
  function SortButton2({
4126
4274
  label,
4127
4275
  sortKey,
@@ -4130,15 +4278,22 @@ var SortButton = (0, import_react19.forwardRef)(
4130
4278
  disabled = false,
4131
4279
  sortable = true,
4132
4280
  align = "left",
4281
+ description,
4133
4282
  className,
4134
4283
  testIdPrefix
4135
4284
  }, ref) {
4136
- if (!sortable) return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: cn("inline-flex", ALIGN[align], className), children: label });
4285
+ const own = (0, import_react20.useRef)(null);
4286
+ (0, import_react20.useImperativeHandle)(ref, () => own.current);
4287
+ const text = description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: DESCRIBED, children: label }) : label;
4288
+ if (!sortable) {
4289
+ const plain = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("inline-flex", ALIGN[align], className), children: text });
4290
+ return description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(HeaderTip, { description, children: plain }) : plain;
4291
+ }
4137
4292
  const active = !disabled && sort.key === sortKey;
4138
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
4293
+ const button = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
4139
4294
  "button",
4140
4295
  {
4141
- ref,
4296
+ ref: own,
4142
4297
  type: "button",
4143
4298
  disabled,
4144
4299
  onClick: () => onSort(sortKey),
@@ -4165,27 +4320,35 @@ var SortButton = (0, import_react19.forwardRef)(
4165
4320
  className
4166
4321
  ),
4167
4322
  children: [
4168
- label,
4169
- !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react19.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react19.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4323
+ text,
4324
+ !disabled && (active ? sort.dir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react19.ArrowUp, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react19.ArrowDown, { size: 12, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4170
4325
  import_lucide_react19.ArrowUpDown,
4171
4326
  {
4172
4327
  size: 12,
4173
4328
  "aria-hidden": "true",
4174
- className: "shrink-0 text-text-tertiary opacity-50 transition-opacity group-hover:opacity-100"
4329
+ className: "shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100 group-hover/head:opacity-100 pointer-coarse:opacity-50"
4175
4330
  }
4176
4331
  ))
4177
4332
  ]
4178
4333
  }
4179
4334
  );
4335
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
4336
+ button,
4337
+ description && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tooltip, { anchorRef: own, label: description, delay: 300, placement: "top" })
4338
+ ] });
4180
4339
  }
4181
4340
  );
4182
4341
  SortButton.displayName = "SortButton";
4342
+ var DESCRIBED = "underline decoration-dotted decoration-1 decoration-text-tertiary underline-offset-4";
4343
+ function HeaderTip({ description, children }) {
4344
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tooltip, { label: description, delay: 300, className: "inline-flex rounded-xs focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { tabIndex: 0, children }) });
4345
+ }
4183
4346
 
4184
4347
  // src/tableSort.ts
4185
- function cycleSort(current, key, firstDir = "desc") {
4348
+ function cycleSort(current, key, firstDir = "desc", fallback = null) {
4186
4349
  if (!current || current.key !== key) return { key, dir: firstDir };
4187
4350
  if (current.dir === firstDir) return { key, dir: firstDir === "desc" ? "asc" : "desc" };
4188
- return null;
4351
+ return fallback && fallback.key === key ? { key, dir: firstDir } : fallback;
4189
4352
  }
4190
4353
  function sortProp(sort) {
4191
4354
  return sort ?? { key: null, dir: "desc" };
@@ -4197,7 +4360,7 @@ function ariaSortFor(sort, key) {
4197
4360
 
4198
4361
  // src/Pager.tsx
4199
4362
  var import_lucide_react20 = require("lucide-react");
4200
- var import_jsx_runtime38 = require("react/jsx-runtime");
4363
+ var import_jsx_runtime39 = require("react/jsx-runtime");
4201
4364
  function pageWindow(current, total) {
4202
4365
  if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
4203
4366
  const keep = /* @__PURE__ */ new Set([1, total, current, current - 1, current + 1]);
@@ -4213,8 +4376,8 @@ function pageWindow(current, total) {
4213
4376
  }
4214
4377
  function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination", className, testIdPrefix }) {
4215
4378
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-dense transition-colors disabled:pointer-events-none disabled:opacity-30 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus";
4216
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
4217
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4379
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("nav", { "aria-label": label, className: cn("flex items-center gap-1", className), "data-testid": testIdPrefix, children: [
4380
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4218
4381
  "button",
4219
4382
  {
4220
4383
  type: "button",
@@ -4222,11 +4385,11 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
4222
4385
  disabled: disabled || page === 1,
4223
4386
  "aria-label": "Previous page",
4224
4387
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
4225
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.ChevronLeft, { size: 16 })
4388
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.ChevronLeft, { size: 16 })
4226
4389
  }
4227
4390
  ),
4228
4391
  pageWindow(page, totalPages).map(
4229
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4392
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4230
4393
  "button",
4231
4394
  {
4232
4395
  type: "button",
@@ -4242,7 +4405,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
4242
4405
  p
4243
4406
  )
4244
4407
  ),
4245
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4408
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4246
4409
  "button",
4247
4410
  {
4248
4411
  type: "button",
@@ -4250,14 +4413,14 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
4250
4413
  disabled: disabled || page === totalPages,
4251
4414
  "aria-label": "Next page",
4252
4415
  className: cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary"),
4253
- children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react20.ChevronRight, { size: 16 })
4416
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.ChevronRight, { size: 16 })
4254
4417
  }
4255
4418
  )
4256
4419
  ] });
4257
4420
  }
4258
4421
 
4259
4422
  // src/WorkspaceAvatar.tsx
4260
- var import_jsx_runtime39 = require("react/jsx-runtime");
4423
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4261
4424
  function workspaceInitials(name) {
4262
4425
  const words = name.trim().split(/\s+/).filter(Boolean);
4263
4426
  if (words.length === 0) return "\xB7";
@@ -4276,7 +4439,7 @@ var SIZES = {
4276
4439
  lg: "h-11 w-11 text-panel-title"
4277
4440
  };
4278
4441
  function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
4279
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4442
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4280
4443
  "span",
4281
4444
  {
4282
4445
  "aria-hidden": "true",
@@ -4292,20 +4455,20 @@ function WorkspaceAvatar({ name, size = "md", className, testIdPrefix }) {
4292
4455
  }
4293
4456
 
4294
4457
  // src/Toast.tsx
4295
- var import_react20 = require("react");
4458
+ var import_react21 = require("react");
4296
4459
  var import_react_dom6 = require("react-dom");
4297
4460
  var import_lucide_react21 = require("lucide-react");
4298
- var import_jsx_runtime40 = require("react/jsx-runtime");
4461
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4299
4462
  var ICON = {
4300
4463
  neutral: null,
4301
- success: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react21.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
4302
- warning: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react21.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
4464
+ success: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react21.Check, { size: 15, className: "shrink-0", "aria-hidden": "true" }),
4465
+ warning: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react21.AlertTriangle, { size: 15, className: "shrink-0", "aria-hidden": "true" })
4303
4466
  };
4304
4467
  function Toast({ message, action, onClose, tone = "neutral", duration, className, testIdPrefix }) {
4305
4468
  const ms = duration ?? (action ? 1e4 : 5e3);
4306
- const [paused, setPaused] = (0, import_react20.useState)(false);
4307
- const closed = (0, import_react20.useRef)(false);
4308
- (0, import_react20.useEffect)(() => {
4469
+ const [paused, setPaused] = (0, import_react21.useState)(false);
4470
+ const closed = (0, import_react21.useRef)(false);
4471
+ (0, import_react21.useEffect)(() => {
4309
4472
  if (paused) return;
4310
4473
  const t = window.setTimeout(() => {
4311
4474
  if (closed.current) return;
@@ -4315,7 +4478,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
4315
4478
  return () => window.clearTimeout(t);
4316
4479
  }, [message, ms, paused]);
4317
4480
  return (0, import_react_dom6.createPortal)(
4318
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4481
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
4319
4482
  "div",
4320
4483
  {
4321
4484
  role: "status",
@@ -4333,7 +4496,7 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
4333
4496
  children: [
4334
4497
  ICON[tone] && // The inverse pair, not text-success / text-warning: those are tuned
4335
4498
  // for the page, and on the toast's flipped surface amber drops to 2:1.
4336
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4499
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4337
4500
  "span",
4338
4501
  {
4339
4502
  className: cn(
@@ -4343,8 +4506,8 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
4343
4506
  children: ICON[tone]
4344
4507
  }
4345
4508
  ),
4346
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "min-w-0", children: message }),
4347
- action && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4509
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "min-w-0", children: message }),
4510
+ action && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4348
4511
  "button",
4349
4512
  {
4350
4513
  type: "button",
@@ -4366,14 +4529,14 @@ function Toast({ message, action, onClose, tone = "neutral", duration, className
4366
4529
  }
4367
4530
 
4368
4531
  // src/Tag.tsx
4369
- var import_jsx_runtime41 = require("react/jsx-runtime");
4532
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4370
4533
  function Tag({ children, className, testIdPrefix }) {
4371
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Badge, { kind: "category", className, testIdPrefix, children });
4534
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Badge, { kind: "category", className, testIdPrefix, children });
4372
4535
  }
4373
4536
 
4374
4537
  // src/TablePagination.tsx
4375
4538
  var import_lucide_react22 = require("lucide-react");
4376
- var import_jsx_runtime42 = require("react/jsx-runtime");
4539
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4377
4540
  function TablePagination({
4378
4541
  page,
4379
4542
  perPage,
@@ -4393,7 +4556,7 @@ function TablePagination({
4393
4556
  const btn = "flex h-8 min-w-8 items-center justify-center rounded-control px-2 text-dense transition-colors focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus";
4394
4557
  const off = "disabled:pointer-events-none disabled:opacity-30";
4395
4558
  const stepBtn = cn(btn, "text-text-secondary hover:bg-subtle hover:text-text-primary", off);
4396
- const range = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
4559
+ const range = /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "text-dense text-text-tertiary tabular-nums", children: [
4397
4560
  rangeStart.toLocaleString(),
4398
4561
  " \u2013 ",
4399
4562
  rangeEnd.toLocaleString(),
@@ -4402,13 +4565,13 @@ function TablePagination({
4402
4565
  " ",
4403
4566
  itemLabel
4404
4567
  ] });
4405
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
4406
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4568
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
4569
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4407
4570
  "div",
4408
4571
  {
4409
4572
  className: cn("flex items-center gap-2 text-dense text-text-secondary", !onPerPageChange && "invisible"),
4410
4573
  children: [
4411
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4574
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4412
4575
  SelectFilter,
4413
4576
  {
4414
4577
  size: "sm",
@@ -4424,8 +4587,8 @@ function TablePagination({
4424
4587
  ]
4425
4588
  }
4426
4589
  ),
4427
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
4428
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4590
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("nav", { className: "flex items-center gap-1", "aria-label": "Pagination", children: [
4591
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4429
4592
  "button",
4430
4593
  {
4431
4594
  type: "button",
@@ -4434,10 +4597,10 @@ function TablePagination({
4434
4597
  "aria-label": "First page",
4435
4598
  "data-testid": testIdPrefix && `${testIdPrefix}-first`,
4436
4599
  className: stepBtn,
4437
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronFirst, { size: 16, "aria-hidden": "true" })
4600
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronFirst, { size: 16, "aria-hidden": "true" })
4438
4601
  }
4439
4602
  ),
4440
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4603
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4441
4604
  "button",
4442
4605
  {
4443
4606
  type: "button",
@@ -4446,11 +4609,11 @@ function TablePagination({
4446
4609
  "aria-label": "Previous page",
4447
4610
  "data-testid": testIdPrefix && `${testIdPrefix}-prev`,
4448
4611
  className: stepBtn,
4449
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronLeft, { size: 16, "aria-hidden": "true" })
4612
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronLeft, { size: 16, "aria-hidden": "true" })
4450
4613
  }
4451
4614
  ),
4452
4615
  pageWindow(current, totalPages).map(
4453
- (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4616
+ (p) => typeof p === "string" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "px-1 text-dense text-text-tertiary", children: "\u2026" }, p) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4454
4617
  "button",
4455
4618
  {
4456
4619
  type: "button",
@@ -4468,7 +4631,7 @@ function TablePagination({
4468
4631
  p
4469
4632
  )
4470
4633
  ),
4471
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4634
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4472
4635
  "button",
4473
4636
  {
4474
4637
  type: "button",
@@ -4477,10 +4640,10 @@ function TablePagination({
4477
4640
  "aria-label": "Next page",
4478
4641
  "data-testid": testIdPrefix && `${testIdPrefix}-next`,
4479
4642
  className: stepBtn,
4480
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronRight, { size: 16, "aria-hidden": "true" })
4643
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronRight, { size: 16, "aria-hidden": "true" })
4481
4644
  }
4482
4645
  ),
4483
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4646
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4484
4647
  "button",
4485
4648
  {
4486
4649
  type: "button",
@@ -4489,7 +4652,7 @@ function TablePagination({
4489
4652
  "aria-label": "Last page",
4490
4653
  "data-testid": testIdPrefix && `${testIdPrefix}-last`,
4491
4654
  className: stepBtn,
4492
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react22.ChevronLast, { size: 16, "aria-hidden": "true" })
4655
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react22.ChevronLast, { size: 16, "aria-hidden": "true" })
4493
4656
  }
4494
4657
  )
4495
4658
  ] }),
@@ -4498,9 +4661,9 @@ function TablePagination({
4498
4661
  }
4499
4662
 
4500
4663
  // src/DateRangePicker.tsx
4501
- var import_react21 = require("react");
4664
+ var import_react22 = require("react");
4502
4665
  var import_lucide_react23 = require("lucide-react");
4503
- var import_jsx_runtime43 = require("react/jsx-runtime");
4666
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4504
4667
  var MONTH_ABBR = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
4505
4668
  var QUARTER_ABBR = ["Q1", "Q2", "Q3", "Q4"];
4506
4669
  var PRESETS = ["Rolling 3 months", "Rolling 6 months", "Rolling 12 months"];
@@ -4538,7 +4701,7 @@ function spanLabel2(label, today, formatDate2, formatRange) {
4538
4701
  return `${f(s)} \u2013 ${f(e)}`;
4539
4702
  }
4540
4703
  function MiniSelect({ value, onChange, options }) {
4541
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4704
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4542
4705
  "select",
4543
4706
  {
4544
4707
  value: String(value),
@@ -4547,7 +4710,7 @@ function MiniSelect({ value, onChange, options }) {
4547
4710
  if (opt) onChange(opt.value);
4548
4711
  },
4549
4712
  className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-xs text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
4550
- children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
4713
+ children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("option", { value: String(o.value), children: o.label }, String(o.value)))
4551
4714
  }
4552
4715
  );
4553
4716
  }
@@ -4566,19 +4729,19 @@ function DateRangePicker({
4566
4729
  className,
4567
4730
  testIdPrefix
4568
4731
  }) {
4569
- const end = (0, import_react21.useMemo)(() => today ?? startOfToday(), [today]);
4732
+ const end = (0, import_react22.useMemo)(() => today ?? startOfToday(), [today]);
4570
4733
  const yearOptions = years ?? [3, 2, 1, 0].map((n) => end.getFullYear() - n);
4571
- const [open, setOpen] = (0, import_react21.useState)(false);
4572
- const [value, setValue] = (0, import_react21.useState)(defaultValue);
4573
- const [draft, setDraft] = (0, import_react21.useState)(defaultValue);
4574
- const ref = (0, import_react21.useRef)(null);
4575
- const [fromMo, setFromMo] = (0, import_react21.useState)(end.getMonth());
4576
- const [fromYr, setFromYr] = (0, import_react21.useState)(end.getFullYear() - 1);
4577
- const [toMo, setToMo] = (0, import_react21.useState)(end.getMonth());
4578
- const [toYr, setToYr] = (0, import_react21.useState)(end.getFullYear());
4579
- const [fromQ, setFromQ] = (0, import_react21.useState)(Math.floor(end.getMonth() / 3));
4580
- const [toQ, setToQ] = (0, import_react21.useState)(Math.floor(end.getMonth() / 3));
4581
- (0, import_react21.useEffect)(() => {
4734
+ const [open, setOpen] = (0, import_react22.useState)(false);
4735
+ const [value, setValue] = (0, import_react22.useState)(defaultValue);
4736
+ const [draft, setDraft] = (0, import_react22.useState)(defaultValue);
4737
+ const ref = (0, import_react22.useRef)(null);
4738
+ const [fromMo, setFromMo] = (0, import_react22.useState)(end.getMonth());
4739
+ const [fromYr, setFromYr] = (0, import_react22.useState)(end.getFullYear() - 1);
4740
+ const [toMo, setToMo] = (0, import_react22.useState)(end.getMonth());
4741
+ const [toYr, setToYr] = (0, import_react22.useState)(end.getFullYear());
4742
+ const [fromQ, setFromQ] = (0, import_react22.useState)(Math.floor(end.getMonth() / 3));
4743
+ const [toQ, setToQ] = (0, import_react22.useState)(Math.floor(end.getMonth() / 3));
4744
+ (0, import_react22.useEffect)(() => {
4582
4745
  const [s, e] = resolveRange(value, end);
4583
4746
  onRangeChange?.(s, e);
4584
4747
  }, [value]);
@@ -4586,7 +4749,7 @@ function DateRangePicker({
4586
4749
  if (!open) setDraft(value);
4587
4750
  setOpen((o) => !o);
4588
4751
  };
4589
- (0, import_react21.useEffect)(() => {
4752
+ (0, import_react22.useEffect)(() => {
4590
4753
  if (!open) return;
4591
4754
  const onDown = (e) => {
4592
4755
  if (ref.current && !ref.current.contains(e.target)) setOpen(false);
@@ -4612,8 +4775,8 @@ function DateRangePicker({
4612
4775
  if (showFooter) setDraft(label);
4613
4776
  else commit(label);
4614
4777
  };
4615
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
4616
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4778
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("relative", className), ref, "data-testid": testIdPrefix, children: [
4779
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4617
4780
  "button",
4618
4781
  {
4619
4782
  type: "button",
@@ -4622,16 +4785,16 @@ function DateRangePicker({
4622
4785
  "aria-haspopup": "listbox",
4623
4786
  className: chipTriggerClass(),
4624
4787
  children: [
4625
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
4626
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate2, formatRange) }),
4627
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
4788
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
4789
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-control-caption leading-none text-text-tertiary", children: spanLabel2(value, end, formatDate2, formatRange) }),
4790
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xs leading-none font-medium text-text-primary", children: value })
4628
4791
  ] }),
4629
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react23.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
4792
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react23.ChevronDown, { size: 14, "aria-hidden": "true", className: cn("shrink-0 text-text-secondary transition-transform", open && "rotate-180") })
4630
4793
  ]
4631
4794
  }
4632
4795
  ),
4633
- open && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("absolute top-full mt-2 z-30 w-70 overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
4634
- presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4796
+ open && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("absolute top-full mt-2 z-30 w-70 overflow-hidden rounded-card border border-border-default bg-surface py-1 shadow-overlay", align === "right" ? "right-0" : "left-0"), children: [
4797
+ presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4635
4798
  "button",
4636
4799
  {
4637
4800
  type: "button",
@@ -4641,26 +4804,26 @@ function DateRangePicker({
4641
4804
  },
4642
4805
  p
4643
4806
  )),
4644
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
4645
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
4646
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
4647
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
4807
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "mt-1 border-t border-border-default px-3 pb-2 pt-2", children: [
4808
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "text-dense font-semibold text-text-primary", children: "Custom range" }),
4809
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "mt-2 flex flex-col gap-2", children: [
4810
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
4648
4811
  "From",
4649
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "flex gap-1", children: [
4650
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
4651
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
4652
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
4812
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex gap-1", children: [
4813
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: fromMo, onChange: setFromMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
4814
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: fromQ, onChange: setFromQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
4815
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: fromYr, onChange: setFromYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
4653
4816
  ] })
4654
4817
  ] }),
4655
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
4818
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center justify-between gap-2 text-xs text-text-secondary", children: [
4656
4819
  "To",
4657
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "flex gap-1", children: [
4658
- granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
4659
- granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
4660
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
4820
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex gap-1", children: [
4821
+ granularity === "month" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: toMo, onChange: setToMo, options: MONTH_ABBR.map((mm, i) => ({ label: mm, value: i })) }),
4822
+ granularity === "quarter" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: toQ, onChange: setToQ, options: QUARTER_ABBR.map((qq, i) => ({ label: qq, value: i })) }),
4823
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MiniSelect, { value: toYr, onChange: setToYr, options: yearOptions.map((y) => ({ label: String(y), value: y })) })
4661
4824
  ] })
4662
4825
  ] }),
4663
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4826
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4664
4827
  "button",
4665
4828
  {
4666
4829
  type: "button",
@@ -4672,15 +4835,15 @@ function DateRangePicker({
4672
4835
  )
4673
4836
  ] })
4674
4837
  ] }),
4675
- showFooter && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
4838
+ showFooter && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FilterDropdownFooter, { onApply: () => commit(draft) })
4676
4839
  ] })
4677
4840
  ] });
4678
4841
  }
4679
4842
 
4680
4843
  // src/MultiSelectFilter.tsx
4681
- var import_react22 = require("react");
4844
+ var import_react23 = require("react");
4682
4845
  var import_lucide_react24 = require("lucide-react");
4683
- var import_jsx_runtime44 = require("react/jsx-runtime");
4846
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4684
4847
  var SEARCH_AFTER = 8;
4685
4848
  function MultiSelectFilter({
4686
4849
  caption,
@@ -4714,11 +4877,11 @@ function MultiSelectFilter({
4714
4877
  const groupLeaves = (g) => g.children.length ? g.children : [{ id: g.id, label: g.label }];
4715
4878
  const leafOptions = groups ? groups.flatMap(groupLeaves) : options;
4716
4879
  const showSearch = searchable ?? leafOptions.length > SEARCH_AFTER;
4717
- const [open, setOpen] = (0, import_react22.useState)(false);
4718
- const [q, setQ] = (0, import_react22.useState)("");
4719
- const [draft, setDraft] = (0, import_react22.useState)(selected);
4720
- const ref = (0, import_react22.useRef)(null);
4721
- const close = (0, import_react22.useCallback)(() => {
4880
+ const [open, setOpen] = (0, import_react23.useState)(false);
4881
+ const [q, setQ] = (0, import_react23.useState)("");
4882
+ const [draft, setDraft] = (0, import_react23.useState)(selected);
4883
+ const ref = (0, import_react23.useRef)(null);
4884
+ const close = (0, import_react23.useCallback)(() => {
4722
4885
  setOpen(false);
4723
4886
  setQ("");
4724
4887
  if (showFooter) return;
@@ -4741,7 +4904,7 @@ function MultiSelectFilter({
4741
4904
  setOpen(false);
4742
4905
  setQ("");
4743
4906
  };
4744
- (0, import_react22.useEffect)(() => {
4907
+ (0, import_react23.useEffect)(() => {
4745
4908
  if (!open) return;
4746
4909
  const onKey = (e) => e.key === "Escape" && close();
4747
4910
  const onClick = (e) => {
@@ -4778,9 +4941,9 @@ function MultiSelectFilter({
4778
4941
  const shown = open && !showFooter ? draft : selected;
4779
4942
  const isAll = shown.length === 0 || fullIsAll && shown.length === leafOptions.length;
4780
4943
  const value = valueLabel ?? (isAll ? allLabel : shown.length === 1 ? leafOptions.find((o) => o.id === shown[0])?.label ?? `${shown.length} selected` : `${shown.length} selected`);
4781
- const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "flex flex-col", children: [
4782
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }),
4783
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
4944
+ const labelled = (id, label) => hints?.[id] ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "flex flex-col", children: [
4945
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: label }),
4946
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-xs font-normal text-text-tertiary", children: hints[id] })
4784
4947
  ] }) : label;
4785
4948
  const ql = q.trim().toLowerCase();
4786
4949
  const items = options.filter((o) => isAvailable(o.id) && (!ql || o.label.toLowerCase().includes(ql)));
@@ -4791,8 +4954,8 @@ function MultiSelectFilter({
4791
4954
  const kids = live.filter((c) => c.label.toLowerCase().includes(ql));
4792
4955
  return kids.length ? { ...g, children: kids } : null;
4793
4956
  }).filter((g) => g !== null) : [];
4794
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
4795
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
4957
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("relative", fullWidth && "w-full", className), ref, "data-testid": testIdPrefix, children: [
4958
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4796
4959
  "button",
4797
4960
  {
4798
4961
  type: "button",
@@ -4801,8 +4964,8 @@ function MultiSelectFilter({
4801
4964
  "data-testid": testIdPrefix && `${testIdPrefix}-trigger`,
4802
4965
  className: cn(chipTriggerClass(variant), fullWidth && "w-full justify-between"),
4803
4966
  children: [
4804
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChipContent, { caption, value, icon }),
4805
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4967
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ChipContent, { caption, value, icon }),
4968
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4806
4969
  import_lucide_react24.ChevronDown,
4807
4970
  {
4808
4971
  size: 14,
@@ -4813,7 +4976,7 @@ function MultiSelectFilter({
4813
4976
  ]
4814
4977
  }
4815
4978
  ),
4816
- open && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4979
+ open && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4817
4980
  "div",
4818
4981
  {
4819
4982
  className: cn(
@@ -4824,10 +4987,10 @@ function MultiSelectFilter({
4824
4987
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
4825
4988
  role: "dialog",
4826
4989
  "aria-label": caption,
4827
- children: loading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
4828
- showSearch && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
4829
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react24.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
4830
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4990
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MenuLoading, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(MenuError, { onRetry }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
4991
+ showSearch && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus", children: [
4992
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.Search, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
4993
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4831
4994
  "input",
4832
4995
  {
4833
4996
  type: "text",
@@ -4837,37 +5000,37 @@ function MultiSelectFilter({
4837
5000
  className: "h-full flex-1 bg-transparent text-dense outline-hidden placeholder:text-text-tertiary"
4838
5001
  }
4839
5002
  ),
4840
- q && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react24.X, { size: 13 }) })
5003
+ q && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", onClick: () => setQ(""), "aria-label": "Clear search", className: "text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react24.X, { size: 13 }) })
4841
5004
  ] }) }),
4842
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "max-h-70 overflow-y-auto p-1", children: [
5005
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "max-h-70 overflow-y-auto p-1", children: [
4843
5006
  groups ? visibleGroups.map((g) => {
4844
5007
  const state = groupState(g);
4845
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
4846
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5008
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
5009
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4847
5010
  "button",
4848
5011
  {
4849
5012
  type: "button",
4850
5013
  onClick: () => toggleGroup(g),
4851
5014
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
4852
5015
  children: [
4853
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
4854
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
4855
- counts && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionCount, { n: countFor(g.id) })
5016
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckBoxBox, { checked: state === "all", indeterminate: state === "some" }),
5017
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: cn("flex-1 text-sm text-text-primary", !plainParent && "font-semibold"), children: labelled(g.id, g.label) }),
5018
+ counts && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionCount, { n: countFor(g.id) })
4856
5019
  ]
4857
5020
  }
4858
5021
  ),
4859
5022
  g.children.map((c) => {
4860
5023
  const checked = draft.includes(c.id);
4861
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5024
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4862
5025
  "button",
4863
5026
  {
4864
5027
  type: "button",
4865
5028
  onClick: () => toggle(c.id),
4866
5029
  className: "flex w-full items-center gap-2.5 rounded-control py-2 pl-9 pr-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
4867
5030
  children: [
4868
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckBoxBox, { checked }),
4869
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
4870
- counts && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionCount, { n: countFor(c.id) })
5031
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckBoxBox, { checked }),
5032
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(c.id, c.label) }),
5033
+ counts && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionCount, { n: countFor(c.id) })
4871
5034
  ]
4872
5035
  },
4873
5036
  c.id
@@ -4876,25 +5039,25 @@ function MultiSelectFilter({
4876
5039
  ] }, g.id);
4877
5040
  }) : items.map((o) => {
4878
5041
  const checked = draft.includes(o.id);
4879
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5042
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4880
5043
  "button",
4881
5044
  {
4882
5045
  type: "button",
4883
5046
  onClick: () => toggle(o.id),
4884
5047
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
4885
5048
  children: [
4886
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckBoxBox, { checked }),
4887
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
4888
- counts && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionCount, { n: countFor(o.id) })
5049
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckBoxBox, { checked }),
5050
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "flex-1 text-sm text-text-primary", children: labelled(o.id, o.label) }),
5051
+ counts && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionCount, { n: countFor(o.id) })
4889
5052
  ]
4890
5053
  },
4891
5054
  o.id
4892
5055
  );
4893
5056
  }),
4894
- (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
5057
+ (groups && !visibleGroups.length || !groups && !items.length) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "py-6 text-center text-dense text-text-tertiary", children: "No matches." })
4895
5058
  ] }),
4896
- note && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
4897
- showFooter ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5059
+ note && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "border-t border-border-default px-3 py-2 text-xs text-text-tertiary", children: note }),
5060
+ showFooter ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FilterDropdownFooter, { onClear: clearAll, onApply: apply }) : min === 0 && draft.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "border-t border-border-default p-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4898
5061
  "button",
4899
5062
  {
4900
5063
  type: "button",
@@ -4912,7 +5075,7 @@ function MultiSelectFilter({
4912
5075
  ] });
4913
5076
  }
4914
5077
  function OptionCount({ n }) {
4915
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
5078
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "shrink-0 text-xs tabular-nums text-text-tertiary", children: [
4916
5079
  "(",
4917
5080
  n.toLocaleString(),
4918
5081
  ")"
@@ -4920,16 +5083,16 @@ function OptionCount({ n }) {
4920
5083
  }
4921
5084
 
4922
5085
  // src/Toggle.tsx
4923
- var import_react23 = require("react");
4924
- var import_jsx_runtime45 = require("react/jsx-runtime");
5086
+ var import_react24 = require("react");
5087
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4925
5088
  var SIZES2 = {
4926
5089
  sm: { track: "h-5 w-9", knob: "h-4 w-4", on: "translate-x-4.5" },
4927
5090
  md: { track: "h-6 w-11", knob: "h-5 w-5", on: "translate-x-5.5" }
4928
5091
  };
4929
5092
  var OFF_TRACK = "color-mix(in srgb, var(--mr-color-border-interactive) 70%, var(--mr-color-text-secondary))";
4930
- var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
5093
+ var Toggle = (0, import_react24.forwardRef)(function Toggle2({ checked, onChange, label, size = "md", disabled, className, testIdPrefix }, ref) {
4931
5094
  const s = SIZES2[size];
4932
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5095
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4933
5096
  "button",
4934
5097
  {
4935
5098
  ref,
@@ -4948,7 +5111,7 @@ var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange
4948
5111
  disabled && "cursor-not-allowed opacity-50",
4949
5112
  className
4950
5113
  ),
4951
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
5114
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4952
5115
  "span",
4953
5116
  {
4954
5117
  className: cn(
@@ -4964,22 +5127,22 @@ var Toggle = (0, import_react23.forwardRef)(function Toggle2({ checked, onChange
4964
5127
  Toggle.displayName = "Toggle";
4965
5128
 
4966
5129
  // src/AISpark.tsx
4967
- var import_react24 = require("react");
5130
+ var import_react25 = require("react");
4968
5131
  var import_lucide_react25 = require("lucide-react");
4969
- var import_jsx_runtime46 = require("react/jsx-runtime");
5132
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4970
5133
  function AISpark({ size = 16, className, testIdPrefix }) {
4971
- const id = (0, import_react24.useId)();
4972
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
4973
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
4974
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
4975
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
5134
+ const id = (0, import_react25.useId)();
5135
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
5136
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "0", height: "0", "aria-hidden": "true", style: { position: "absolute" }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
5137
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("stop", { offset: "0%", stopColor: "var(--mr-color-brand-primary)" }),
5138
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("stop", { offset: "100%", stopColor: "var(--mr-color-ai-violet)" })
4976
5139
  ] }) }) }),
4977
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react25.Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
5140
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react25.Sparkles, { size, stroke: `url(#${id})`, className, "data-testid": testIdPrefix, "aria-hidden": "true" })
4978
5141
  ] });
4979
5142
  }
4980
5143
 
4981
5144
  // src/Freshness.tsx
4982
- var import_jsx_runtime47 = require("react/jsx-runtime");
5145
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4983
5146
  var dotColor = {
4984
5147
  fresh: "bg-status-success",
4985
5148
  recent: "bg-status-warning",
@@ -4991,7 +5154,7 @@ var srLabel = {
4991
5154
  stale: "Older than a day"
4992
5155
  };
4993
5156
  function Freshness({ level, className, testIdPrefix }) {
4994
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5157
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4995
5158
  "span",
4996
5159
  {
4997
5160
  className: cn("inline-block h-1.5 w-1.5 shrink-0 rounded-full", dotColor[level], className),
@@ -5003,50 +5166,50 @@ function Freshness({ level, className, testIdPrefix }) {
5003
5166
  }
5004
5167
 
5005
5168
  // src/SectionHeading.tsx
5006
- var import_jsx_runtime48 = require("react/jsx-runtime");
5169
+ var import_jsx_runtime49 = require("react/jsx-runtime");
5007
5170
  function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, className, testIdPrefix }) {
5008
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
5009
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "min-w-0", children: [
5010
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
5011
- description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
5171
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex flex-wrap items-end justify-between gap-x-4 gap-y-2", className), "data-testid": testIdPrefix, children: [
5172
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
5173
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tag2, { id, className: "text-base font-semibold text-text-primary", children: title }),
5174
+ description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-0.5 text-dense text-text-secondary", children: description })
5012
5175
  ] }),
5013
- actions && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
5176
+ actions && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
5014
5177
  ] });
5015
5178
  }
5016
5179
 
5017
5180
  // src/PageHeader.tsx
5018
5181
  var import_lucide_react26 = require("lucide-react");
5019
- var import_jsx_runtime49 = require("react/jsx-runtime");
5182
+ var import_jsx_runtime50 = require("react/jsx-runtime");
5020
5183
  function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }) {
5021
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
5022
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
5023
- back && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5184
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), "data-testid": testIdPrefix, children: [
5185
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "min-w-0", children: [
5186
+ back && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
5024
5187
  "a",
5025
5188
  {
5026
5189
  href: back.href ?? "#",
5027
5190
  onClick: back.onClick,
5028
5191
  className: "mb-1.5 inline-flex items-center gap-1.5 rounded-control text-micro font-semibold uppercase tracking-wider text-text-tertiary hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5029
5192
  children: [
5030
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.ArrowLeft, { size: 13, "aria-hidden": "true" }),
5193
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react26.ArrowLeft, { size: 13, "aria-hidden": "true" }),
5031
5194
  back.label
5032
5195
  ]
5033
5196
  }
5034
5197
  ),
5035
- meta ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
5036
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
5198
+ meta ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
5199
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
5037
5200
  meta
5038
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
5039
- description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
5201
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
5202
+ description && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
5040
5203
  ] }),
5041
- actions && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
5204
+ actions && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
5042
5205
  ] });
5043
5206
  }
5044
5207
 
5045
5208
  // src/Modal.tsx
5046
- var import_react25 = require("react");
5209
+ var import_react26 = require("react");
5047
5210
  var import_react_dom7 = require("react-dom");
5048
5211
  var import_lucide_react27 = require("lucide-react");
5049
- var import_jsx_runtime50 = require("react/jsx-runtime");
5212
+ var import_jsx_runtime51 = require("react/jsx-runtime");
5050
5213
  var WIDTH = {
5051
5214
  sm: "max-w-110",
5052
5215
  md: "max-w-160",
@@ -5058,14 +5221,14 @@ var WIDTH = {
5058
5221
  var EXIT_MS = 200;
5059
5222
  var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
5060
5223
  function Modal({ open, onClose, title, description, size = "md", footer, children, className, testIdPrefix }) {
5061
- const titleId = (0, import_react25.useId)();
5062
- const descId = (0, import_react25.useId)();
5063
- const panel = (0, import_react25.useRef)(null);
5064
- const close = (0, import_react25.useRef)(onClose);
5224
+ const titleId = (0, import_react26.useId)();
5225
+ const descId = (0, import_react26.useId)();
5226
+ const panel = (0, import_react26.useRef)(null);
5227
+ const close = (0, import_react26.useRef)(onClose);
5065
5228
  close.current = onClose;
5066
- const [mounted, setMounted] = (0, import_react25.useState)(open);
5067
- const [shown, setShown] = (0, import_react25.useState)(false);
5068
- (0, import_react25.useEffect)(() => {
5229
+ const [mounted, setMounted] = (0, import_react26.useState)(open);
5230
+ const [shown, setShown] = (0, import_react26.useState)(false);
5231
+ (0, import_react26.useEffect)(() => {
5069
5232
  if (open) {
5070
5233
  setMounted(true);
5071
5234
  const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
@@ -5075,7 +5238,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
5075
5238
  const t = setTimeout(() => setMounted(false), EXIT_MS);
5076
5239
  return () => clearTimeout(t);
5077
5240
  }, [open]);
5078
- (0, import_react25.useEffect)(() => {
5241
+ (0, import_react26.useEffect)(() => {
5079
5242
  if (!open || !mounted) return;
5080
5243
  const opener = document.activeElement;
5081
5244
  const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE) ?? null;
@@ -5110,7 +5273,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
5110
5273
  }, [open, mounted]);
5111
5274
  if (!mounted || typeof document === "undefined") return null;
5112
5275
  return (0, import_react_dom7.createPortal)(
5113
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5276
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5114
5277
  "div",
5115
5278
  {
5116
5279
  className: cn(
@@ -5118,7 +5281,7 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
5118
5281
  shown ? "opacity-100" : "opacity-0"
5119
5282
  ),
5120
5283
  onMouseDown: (e) => e.target === e.currentTarget && onClose(),
5121
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
5284
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5122
5285
  "div",
5123
5286
  {
5124
5287
  ref: panel,
@@ -5136,24 +5299,24 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
5136
5299
  className
5137
5300
  ),
5138
5301
  children: [
5139
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
5140
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "min-w-0 flex-1", children: [
5141
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
5142
- description && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
5302
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
5303
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "min-w-0 flex-1", children: [
5304
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
5305
+ description && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
5143
5306
  ] }),
5144
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5307
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5145
5308
  "button",
5146
5309
  {
5147
5310
  type: "button",
5148
5311
  onClick: onClose,
5149
5312
  "aria-label": "Close",
5150
5313
  className: "-mr-1.5 -mt-1 flex size-8 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5151
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react27.X, { size: 16, "aria-hidden": "true" })
5314
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.X, { size: 16, "aria-hidden": "true" })
5152
5315
  }
5153
5316
  )
5154
5317
  ] }),
5155
- children && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
5156
- footer && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
5318
+ children && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { "data-modal-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
5319
+ footer && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { "data-modal-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
5157
5320
  ]
5158
5321
  }
5159
5322
  )
@@ -5164,10 +5327,10 @@ function Modal({ open, onClose, title, description, size = "md", footer, childre
5164
5327
  }
5165
5328
 
5166
5329
  // src/EmptyState.tsx
5167
- var import_jsx_runtime51 = require("react/jsx-runtime");
5330
+ var import_jsx_runtime52 = require("react/jsx-runtime");
5168
5331
  function EmptyState({ icon, title, description, action, size = "sm", className, testIdPrefix }) {
5169
5332
  const md = size === "md";
5170
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5333
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5171
5334
  "div",
5172
5335
  {
5173
5336
  className: cn(
@@ -5177,7 +5340,7 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
5177
5340
  ),
5178
5341
  "data-testid": testIdPrefix,
5179
5342
  children: [
5180
- icon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5343
+ icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5181
5344
  "span",
5182
5345
  {
5183
5346
  "aria-hidden": "true",
@@ -5188,27 +5351,27 @@ function EmptyState({ icon, title, description, action, size = "sm", className,
5188
5351
  children: icon
5189
5352
  }
5190
5353
  ),
5191
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
5192
- description && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
5193
- action && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
5354
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: cn("font-semibold text-text-primary", md ? "text-base" : "text-sm"), children: title }),
5355
+ description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: cn("max-w-sm text-text-secondary", md ? "text-sm" : "text-xs"), children: description }),
5356
+ action && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: md ? "mt-3" : "mt-2", children: action })
5194
5357
  ]
5195
5358
  }
5196
5359
  );
5197
5360
  }
5198
5361
 
5199
5362
  // src/TextField.tsx
5200
- var import_react26 = require("react");
5201
- var import_jsx_runtime52 = require("react/jsx-runtime");
5363
+ var import_react27 = require("react");
5364
+ var import_jsx_runtime53 = require("react/jsx-runtime");
5202
5365
  var HEIGHT2 = { sm: "h-8", md: "h-10", lg: "h-11" };
5203
- var TextField = (0, import_react26.forwardRef)(
5366
+ var TextField = (0, import_react27.forwardRef)(
5204
5367
  ({ label, hint, error, size = "md", icon, className, testIdPrefix, id, disabled, ...props }, ref) => {
5205
- const auto = (0, import_react26.useId)();
5368
+ const auto = (0, import_react27.useId)();
5206
5369
  const fieldId = id ?? auto;
5207
5370
  const noteId = `${fieldId}-note`;
5208
5371
  const note = error ?? hint;
5209
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
5210
- label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
5211
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5372
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex flex-col gap-1.5", className), "data-testid": testIdPrefix, children: [
5373
+ label && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { htmlFor: fieldId, className: "text-xs font-medium text-text-secondary", children: label }),
5374
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
5212
5375
  "div",
5213
5376
  {
5214
5377
  className: cn(
@@ -5218,8 +5381,8 @@ var TextField = (0, import_react26.forwardRef)(
5218
5381
  disabled && "opacity-50"
5219
5382
  ),
5220
5383
  children: [
5221
- icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
5222
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5384
+ icon && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": "true", className: "flex shrink-0 text-text-tertiary", children: icon }),
5385
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5223
5386
  "input",
5224
5387
  {
5225
5388
  ref,
@@ -5234,17 +5397,17 @@ var TextField = (0, import_react26.forwardRef)(
5234
5397
  ]
5235
5398
  }
5236
5399
  ),
5237
- note && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
5400
+ note && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: noteId, className: cn("text-xs", error ? "text-text-danger" : "text-text-tertiary"), children: note })
5238
5401
  ] });
5239
5402
  }
5240
5403
  );
5241
5404
  TextField.displayName = "TextField";
5242
5405
 
5243
5406
  // src/Drawer.tsx
5244
- var import_react27 = require("react");
5407
+ var import_react28 = require("react");
5245
5408
  var import_react_dom8 = require("react-dom");
5246
5409
  var import_lucide_react28 = require("lucide-react");
5247
- var import_jsx_runtime53 = require("react/jsx-runtime");
5410
+ var import_jsx_runtime54 = require("react/jsx-runtime");
5248
5411
  var WIDTH2 = {
5249
5412
  sm: "max-w-110",
5250
5413
  md: "max-w-160",
@@ -5253,14 +5416,14 @@ var WIDTH2 = {
5253
5416
  var EXIT_MS2 = 200;
5254
5417
  var FOCUSABLE2 = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
5255
5418
  function Drawer({ open, onClose, title, description, size = "sm", footer, children, className, testIdPrefix }) {
5256
- const titleId = (0, import_react27.useId)();
5257
- const descId = (0, import_react27.useId)();
5258
- const panel = (0, import_react27.useRef)(null);
5259
- const close = (0, import_react27.useRef)(onClose);
5419
+ const titleId = (0, import_react28.useId)();
5420
+ const descId = (0, import_react28.useId)();
5421
+ const panel = (0, import_react28.useRef)(null);
5422
+ const close = (0, import_react28.useRef)(onClose);
5260
5423
  close.current = onClose;
5261
- const [mounted, setMounted] = (0, import_react27.useState)(open);
5262
- const [shown, setShown] = (0, import_react27.useState)(false);
5263
- (0, import_react27.useEffect)(() => {
5424
+ const [mounted, setMounted] = (0, import_react28.useState)(open);
5425
+ const [shown, setShown] = (0, import_react28.useState)(false);
5426
+ (0, import_react28.useEffect)(() => {
5264
5427
  if (open) {
5265
5428
  setMounted(true);
5266
5429
  const raf = requestAnimationFrame(() => requestAnimationFrame(() => setShown(true)));
@@ -5270,7 +5433,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
5270
5433
  const t = setTimeout(() => setMounted(false), EXIT_MS2);
5271
5434
  return () => clearTimeout(t);
5272
5435
  }, [open]);
5273
- (0, import_react27.useEffect)(() => {
5436
+ (0, import_react28.useEffect)(() => {
5274
5437
  if (!open || !mounted) return;
5275
5438
  const opener = document.activeElement;
5276
5439
  const firstIn = (region) => panel.current?.querySelector(region)?.querySelector(FOCUSABLE2) ?? null;
@@ -5305,8 +5468,8 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
5305
5468
  }, [open, mounted]);
5306
5469
  if (!mounted || typeof document === "undefined") return null;
5307
5470
  return (0, import_react_dom8.createPortal)(
5308
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "fixed inset-0 z-modal", children: [
5309
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5471
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "fixed inset-0 z-modal", children: [
5472
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5310
5473
  "div",
5311
5474
  {
5312
5475
  "aria-hidden": "true",
@@ -5320,7 +5483,7 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
5320
5483
  )
5321
5484
  }
5322
5485
  ),
5323
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
5486
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
5324
5487
  "div",
5325
5488
  {
5326
5489
  ref: panel,
@@ -5337,24 +5500,24 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
5337
5500
  className
5338
5501
  ),
5339
5502
  children: [
5340
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
5341
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "min-w-0 flex-1", children: [
5342
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
5343
- description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
5503
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start gap-3 px-5 pt-5 pb-2", children: [
5504
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1", children: [
5505
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h2", { id: titleId, className: "text-base font-semibold text-text-primary", children: title }),
5506
+ description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { id: descId, className: "mt-0.5 text-sm text-text-secondary", children: description })
5344
5507
  ] }),
5345
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5508
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5346
5509
  "button",
5347
5510
  {
5348
5511
  type: "button",
5349
5512
  onClick: onClose,
5350
5513
  "aria-label": "Close",
5351
5514
  className: "-mr-1.5 -mt-1 flex size-8 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5352
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.X, { size: 16, "aria-hidden": "true" })
5515
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react28.X, { size: 16, "aria-hidden": "true" })
5353
5516
  }
5354
5517
  )
5355
5518
  ] }),
5356
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { "data-drawer-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
5357
- footer && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
5519
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { "data-drawer-body": true, className: "min-h-0 flex-1 overflow-y-auto px-5 pt-1 pb-5 text-sm text-text-primary", children }),
5520
+ footer && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { "data-drawer-footer": true, className: "flex items-center justify-end gap-2 border-t border-border-default px-5 py-3", children: footer })
5358
5521
  ]
5359
5522
  }
5360
5523
  )
@@ -5364,12 +5527,90 @@ function Drawer({ open, onClose, title, description, size = "sm", footer, childr
5364
5527
  }
5365
5528
 
5366
5529
  // src/DataTable.tsx
5367
- var import_react28 = require("react");
5368
- var import_jsx_runtime54 = require("react/jsx-runtime");
5530
+ var import_react29 = require("react");
5531
+ var import_lucide_react29 = require("lucide-react");
5532
+
5533
+ // src/numbers.ts
5534
+ var US = { units: ["K", "M", "B", "T"] };
5535
+ var STYLES = {
5536
+ "en-US": US,
5537
+ "en-CA": US,
5538
+ "en-GB": { units: ["k", "m", "bn", "tn"] }
5539
+ };
5540
+ var styleFor = (language) => STYLES[language ?? "en-US"] ?? US;
5541
+ var NO_VALUE = "\u2014";
5542
+ var MINUS = "\u2212";
5543
+ var SHORTEN_FROM = 1e4;
5544
+ var isMissing = (v) => v === null || v === void 0 || Number.isNaN(v);
5545
+ var withCommas = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
5546
+ function shortAbs(abs, style) {
5547
+ if (abs < SHORTEN_FROM) return withCommas(abs);
5548
+ let tier = Math.min(Math.floor(Math.log10(abs) / 3), 4);
5549
+ let scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
5550
+ if (scaled >= 1e3 && tier < 4) {
5551
+ tier += 1;
5552
+ scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
5553
+ }
5554
+ const text = Number.isInteger(scaled) ? withCommas(scaled) : scaled.toFixed(1);
5555
+ return `${text}${style.units[tier - 1]}`;
5556
+ }
5557
+ function symbol(opts) {
5558
+ const currency = opts.currency ?? "USD";
5559
+ if (currency === "GBP") return "\xA3";
5560
+ if (currency === "EUR") return "\u20AC";
5561
+ if (opts.mixedDollars) return currency === "CAD" ? "CA$" : "US$";
5562
+ return "$";
5563
+ }
5564
+ var sign = (v) => v < 0 ? MINUS : "";
5565
+ function formatCount(value, opts = {}) {
5566
+ if (isMissing(value)) return NO_VALUE;
5567
+ return sign(value) + shortAbs(Math.abs(value), styleFor(opts.language));
5568
+ }
5569
+ function formatCountFull(value) {
5570
+ if (isMissing(value)) return NO_VALUE;
5571
+ return sign(value) + withCommas(Math.abs(value));
5572
+ }
5573
+ function formatMoney(value, opts = {}) {
5574
+ if (isMissing(value)) return NO_VALUE;
5575
+ return sign(value) + symbol(opts) + shortAbs(Math.abs(value), styleFor(opts.language));
5576
+ }
5577
+ function formatMoneyFull(value, opts = {}) {
5578
+ if (isMissing(value)) return NO_VALUE;
5579
+ return sign(value) + symbol(opts) + withCommas(Math.abs(value));
5580
+ }
5581
+ function formatPercent(value, _opts = {}) {
5582
+ if (isMissing(value)) return NO_VALUE;
5583
+ const abs = Math.abs(value);
5584
+ if (abs > 0 && abs < 0.05) return `${value < 0 ? MINUS : ""}<0.1%`;
5585
+ const text = (Math.round(abs * 10) / 10).toFixed(1);
5586
+ return text === "0.0" ? "0.0%" : `${sign(value)}${text}%`;
5587
+ }
5588
+
5589
+ // src/DataTable.tsx
5590
+ var import_jsx_runtime55 = require("react/jsx-runtime");
5369
5591
  var WIDTH3 = { fill: "", sm: "w-24", md: "w-36", lg: "w-48" };
5370
5592
  var MAX_H = { sm: "max-h-80", md: "max-h-120", lg: "max-h-160" };
5371
5593
  var HEAD_PAD = { default: "px-4 py-3", compact: "px-3 py-2" };
5372
5594
  var CELL_PAD = { default: "px-4 py-3.5", compact: "px-3 py-2" };
5595
+ var OWN_CLICK = "a, button, input, select, textarea, label, summary, [role='button'], [role='checkbox'], [role='menuitem'], [role='switch'], [role='tab'], [contenteditable='true']";
5596
+ function NoValue({ reason = "No data" }) {
5597
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tooltip, { label: reason, delay: 300, className: "text-text-tertiary", children: [
5598
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "aria-hidden": "true", children: NO_VALUE }),
5599
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: reason })
5600
+ ] });
5601
+ }
5602
+ function TableLink({ className, ...props }) {
5603
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5604
+ "a",
5605
+ {
5606
+ ...props,
5607
+ className: cn(
5608
+ "rounded-xs text-inherit decoration-1 underline-offset-2 hover:underline focus-visible:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5609
+ className
5610
+ )
5611
+ }
5612
+ );
5613
+ }
5373
5614
  function DataTable({
5374
5615
  columns,
5375
5616
  rows,
@@ -5377,11 +5618,19 @@ function DataTable({
5377
5618
  title,
5378
5619
  subtitle,
5379
5620
  action,
5621
+ variant = "default",
5622
+ titleAs = "h2",
5380
5623
  sort = null,
5381
5624
  onSortChange,
5625
+ defaultSort = null,
5626
+ renderExpanded,
5627
+ canExpand,
5628
+ rowLabel,
5382
5629
  density = "default",
5383
5630
  loading = false,
5384
5631
  loadingRows = 5,
5632
+ refreshing = false,
5633
+ onRetry,
5385
5634
  empty,
5386
5635
  maxHeight,
5387
5636
  footer,
@@ -5389,83 +5638,159 @@ function DataTable({
5389
5638
  testIdPrefix,
5390
5639
  ...rest
5391
5640
  }) {
5392
- const titleId = (0, import_react28.useId)();
5641
+ const titleId = (0, import_react29.useId)();
5642
+ const showSkeleton = useDelayedLoading(loading);
5393
5643
  const head = HEAD_PAD[density];
5394
5644
  const pad2 = CELL_PAD[density];
5395
- const align = (c) => c.numeric ? "text-right" : "text-left";
5396
- const width = (c) => WIDTH3[c.width ?? (c.numeric ? "md" : "fill")];
5645
+ const right = (c) => c.numeric || c.rank;
5646
+ const align = (c) => right(c) ? "text-right" : "text-left";
5647
+ const width = (c) => c.rank ? "w-12" : WIDTH3[c.width ?? (c.numeric ? "md" : "fill")];
5648
+ const shown = sort ?? defaultSort;
5397
5649
  const onSort = (key) => {
5398
5650
  const col = columns.find((c) => c.key === key);
5399
- onSortChange?.(cycleSort(sort, key, col?.firstDir ?? (col?.numeric ? "desc" : "asc")));
5651
+ onSortChange?.(cycleSort(shown, key, col?.firstDir ?? (right(col) ? "desc" : "asc"), defaultSort));
5652
+ };
5653
+ const [open, setOpen] = (0, import_react29.useState)(() => /* @__PURE__ */ new Set());
5654
+ const visibleKeys = rows.map(rowKey).join("|");
5655
+ (0, import_react29.useEffect)(() => setOpen(/* @__PURE__ */ new Set()), [shown?.key, shown?.dir, visibleKeys]);
5656
+ const expandable = (row) => !!renderExpanded && (canExpand ? canExpand(row) : true);
5657
+ const anyExpandable = !!renderExpanded && rows.some(expandable);
5658
+ const toggle = (key) => setOpen((prev) => {
5659
+ const next = new Set(prev);
5660
+ if (next.has(key)) next.delete(key);
5661
+ else next.add(key);
5662
+ return next;
5663
+ });
5664
+ const onRowClick = (e, key) => {
5665
+ if (e.target.closest(OWN_CLICK)) return;
5666
+ if (window.getSelection?.()?.toString()) return;
5667
+ toggle(key);
5668
+ };
5669
+ const span = columns.length + (anyExpandable ? 1 : 0);
5670
+ const renderCell = (c, row) => {
5671
+ const v = c.cell(row);
5672
+ return v === null || v === void 0 || v === "" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(NoValue, { reason: c.missing }) : v;
5400
5673
  };
5401
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
5674
+ const inside = variant === "chart";
5675
+ const frame = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
5402
5676
  "div",
5403
5677
  {
5404
- className: cn("flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", className),
5678
+ className: cn("relative flex w-full flex-col overflow-hidden rounded-card border border-border-default bg-surface", !(title && !inside) && className),
5405
5679
  "data-testid": testIdPrefix,
5406
5680
  children: [
5407
- title && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
5408
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0", children: [
5409
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h3", { id: titleId, className: "text-style-card-title", children: title }),
5410
- subtitle && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "mt-0.5 text-xs text-text-tertiary", children: subtitle })
5681
+ title && inside && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-start justify-between gap-2 p-card-padding", children: [
5682
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "min-w-0", children: [
5683
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h3", { id: titleId, className: "text-panel-title font-semibold text-text-primary", children: title }),
5684
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "mt-0.5 text-xs leading-snug text-text-tertiary", children: subtitle })
5411
5685
  ] }),
5412
- action && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "shrink-0", children: action })
5686
+ action && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "shrink-0 text-text-tertiary", children: action })
5413
5687
  ] }),
5414
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
5688
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: cn("overflow-x-auto", maxHeight && cn("overflow-y-auto", MAX_H[maxHeight])), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
5415
5689
  "table",
5416
5690
  {
5417
5691
  "aria-labelledby": title ? titleId : void 0,
5418
5692
  "aria-label": title ? void 0 : rest["aria-label"],
5419
- "aria-busy": loading || void 0,
5693
+ "aria-busy": loading || refreshing || void 0,
5420
5694
  className: "w-full border-collapse text-left",
5421
5695
  children: [
5422
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5423
- "th",
5424
- {
5425
- scope: "col",
5426
- "aria-sort": c.sortable ? ariaSortFor(sort, c.key) : void 0,
5427
- className: cn("whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
5428
- children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5429
- SortButton,
5696
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("thead", { className: cn(maxHeight && "sticky top-0 z-10"), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("tr", { className: "bg-subtle text-micro font-semibold uppercase tracking-wider text-text-secondary", children: [
5697
+ anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("th", { scope: "col", className: cn("w-10 border-b border-border-default", head), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "Details" }) }),
5698
+ columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5699
+ "th",
5700
+ {
5701
+ scope: "col",
5702
+ "aria-sort": c.sortable ? ariaSortFor(shown, c.key) : void 0,
5703
+ className: cn("group/head whitespace-nowrap border-b border-border-default font-semibold", head, align(c), width(c)),
5704
+ children: c.sortable && onSortChange ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5705
+ SortButton,
5706
+ {
5707
+ label: c.label,
5708
+ sortKey: c.key,
5709
+ align: right(c) ? "right" : "left",
5710
+ sort: sortProp(shown),
5711
+ onSort,
5712
+ description: c.info,
5713
+ testIdPrefix
5714
+ }
5715
+ ) : c.info ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SortButton, { label: c.label, sortKey: c.key, sortable: false, sort: sortProp(shown), onSort: () => {
5716
+ }, description: c.info, align: right(c) ? "right" : "left" }) : c.label
5717
+ },
5718
+ c.key
5719
+ ))
5720
+ ] }) }),
5721
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tbody", { className: cn("text-dense text-text-primary", refreshing && !loading && "opacity-50 transition-opacity motion-reduce:transition-none"), children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: [
5722
+ anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { className: cn("border-b border-border-default", pad2) }),
5723
+ columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { className: cn("border-b border-border-default", pad2, align(c)), children: showSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Skeleton, { className: cn("inline-block", right(c) ? "w-12" : "w-2/3") }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-block h-3" }) }, c.key))
5724
+ ] }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { colSpan: span, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row, index) => {
5725
+ const key = rowKey(row);
5726
+ const canOpen = expandable(row);
5727
+ const isOpen = canOpen && open.has(key);
5728
+ const panelId = `${titleId}-row-${index}`;
5729
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react29.Fragment, { children: [
5730
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
5731
+ "tr",
5430
5732
  {
5431
- label: c.label,
5432
- sortKey: c.key,
5433
- align: c.numeric ? "right" : "left",
5434
- sort: sortProp(sort),
5435
- onSort,
5436
- testIdPrefix
5733
+ onClick: canOpen ? (e) => onRowClick(e, key) : void 0,
5734
+ className: cn("hover:bg-subtle [&:last-child>td]:border-b-0", canOpen && "cursor-pointer", isOpen && "bg-subtle"),
5735
+ children: [
5736
+ anyExpandable && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { className: cn("border-b border-border-default pr-0", pad2, isOpen && "border-b-0"), children: canOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5737
+ "button",
5738
+ {
5739
+ type: "button",
5740
+ "aria-expanded": isOpen,
5741
+ "aria-controls": isOpen ? panelId : void 0,
5742
+ "aria-label": `${isOpen ? "Hide" : "Show"} details${rowLabel ? ` for ${rowLabel(row)}` : ""}`,
5743
+ onClick: () => toggle(key),
5744
+ className: "flex size-6 items-center justify-center rounded-control text-text-tertiary hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5745
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5746
+ import_lucide_react29.ChevronRight,
5747
+ {
5748
+ size: 16,
5749
+ "aria-hidden": "true",
5750
+ className: cn("transition-transform motion-reduce:transition-none", isOpen && "rotate-90")
5751
+ }
5752
+ )
5753
+ }
5754
+ ) }),
5755
+ columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5756
+ "td",
5757
+ {
5758
+ className: cn(
5759
+ "border-b border-border-default",
5760
+ pad2,
5761
+ align(c),
5762
+ right(c) && "tabular-nums",
5763
+ c.rank && "text-text-tertiary",
5764
+ isOpen && "border-b-0"
5765
+ ),
5766
+ children: renderCell(c, row)
5767
+ },
5768
+ c.key
5769
+ ))
5770
+ ]
5437
5771
  }
5438
- ) : c.label
5439
- },
5440
- c.key
5441
- )) }) }),
5442
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tbody", { className: "text-dense text-text-primary", children: loading ? Array.from({ length: loadingRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { "aria-hidden": "true", className: "[&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: cn("border-b border-border-default", pad2, align(c)), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5443
- "span",
5444
- {
5445
- className: cn(
5446
- "inline-block h-3 animate-pulse rounded-full bg-subtle",
5447
- c.numeric ? "w-12" : "w-2/3"
5448
- )
5449
- }
5450
- ) }, c.key)) }, i)) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { colSpan: columns.length, className: "px-6 py-12", children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NoResultsEmptyState, {}) }) }) : rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "hover:bg-subtle [&:last-child>td]:border-b-0", children: columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5451
- "td",
5452
- {
5453
- className: cn("border-b border-border-default", pad2, align(c), c.numeric && "tabular-nums"),
5454
- children: c.cell(row)
5455
- },
5456
- c.key
5457
- )) }, rowKey(row))) })
5772
+ ),
5773
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { className: "[&:last-child>td]:border-b-0", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { id: panelId, colSpan: span, className: "border-b border-border-default bg-subtle px-4 pb-4 pl-14", children: renderExpanded(row) }) })
5774
+ ] }, key);
5775
+ }) })
5458
5776
  ]
5459
5777
  }
5460
5778
  ) }),
5461
- footer && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
5779
+ refreshing && !loading && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RefreshLine, {}),
5780
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LongWait, { loading, onRetry, className: "mb-3 px-4" }),
5781
+ footer && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "border-t border-border-default px-4 py-3", children: footer })
5462
5782
  ]
5463
5783
  }
5464
5784
  );
5785
+ if (!title || inside) return frame;
5786
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { "aria-labelledby": titleId, className: cn("flex w-full flex-col gap-3", className), children: [
5787
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SectionHeading, { id: titleId, as: titleAs, title, description: subtitle, actions: action }),
5788
+ frame
5789
+ ] });
5465
5790
  }
5466
5791
 
5467
5792
  // src/MediaLabel.tsx
5468
- var import_jsx_runtime55 = require("react/jsx-runtime");
5793
+ var import_jsx_runtime56 = require("react/jsx-runtime");
5469
5794
  var FILL = {
5470
5795
  TV: "bg-media-tv",
5471
5796
  CTV: "bg-media-ctv",
@@ -5476,7 +5801,7 @@ var FILL = {
5476
5801
  Magazine: "bg-media-magazine"
5477
5802
  };
5478
5803
  function MediaLabel({ type, className, testIdPrefix }) {
5479
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
5804
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5480
5805
  "span",
5481
5806
  {
5482
5807
  className: cn(
@@ -5491,10 +5816,10 @@ function MediaLabel({ type, className, testIdPrefix }) {
5491
5816
  }
5492
5817
 
5493
5818
  // src/SuggestionChip.tsx
5494
- var import_react29 = require("react");
5495
- var import_jsx_runtime56 = require("react/jsx-runtime");
5496
- var SuggestionChip = (0, import_react29.forwardRef)(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
5497
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5819
+ var import_react30 = require("react");
5820
+ var import_jsx_runtime57 = require("react/jsx-runtime");
5821
+ var SuggestionChip = (0, import_react30.forwardRef)(function SuggestionChip2({ children, className, testIdPrefix, type = "button", ...props }, ref) {
5822
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5498
5823
  "button",
5499
5824
  {
5500
5825
  ref,
@@ -5505,18 +5830,18 @@ var SuggestionChip = (0, import_react29.forwardRef)(function SuggestionChip2({ c
5505
5830
  "inline-flex h-8 max-w-full items-center rounded-full border border-border-default bg-surface px-3 text-sm text-text-primary transition-colors duration-(--mr-motion-duration-interactive) ease-interactive hover:border-border-strong hover:bg-subtle focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5506
5831
  className
5507
5832
  ),
5508
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "truncate", children })
5833
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "truncate", children })
5509
5834
  }
5510
5835
  );
5511
5836
  });
5512
5837
  SuggestionChip.displayName = "SuggestionChip";
5513
5838
 
5514
5839
  // src/ToggleChip.tsx
5515
- var import_react30 = require("react");
5516
- var import_lucide_react29 = require("lucide-react");
5517
- var import_jsx_runtime57 = require("react/jsx-runtime");
5518
- var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
5519
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
5840
+ var import_react31 = require("react");
5841
+ var import_lucide_react30 = require("lucide-react");
5842
+ var import_jsx_runtime58 = require("react/jsx-runtime");
5843
+ var ToggleChip = (0, import_react31.forwardRef)(function ToggleChip2({ selected, onChange, children, className, testIdPrefix, type = "button", onClick, ...props }, ref) {
5844
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5520
5845
  "button",
5521
5846
  {
5522
5847
  ref,
@@ -5534,7 +5859,7 @@ var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected,
5534
5859
  className
5535
5860
  ),
5536
5861
  children: [
5537
- selected && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react29.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
5862
+ selected && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react30.Check, { size: 14, "aria-hidden": "true", className: "-ml-0.5 shrink-0" }),
5538
5863
  children
5539
5864
  ]
5540
5865
  }
@@ -5543,14 +5868,14 @@ var ToggleChip = (0, import_react30.forwardRef)(function ToggleChip2({ selected,
5543
5868
  ToggleChip.displayName = "ToggleChip";
5544
5869
 
5545
5870
  // src/CopyButton.tsx
5546
- var import_react31 = require("react");
5547
- var import_lucide_react30 = require("lucide-react");
5548
- var import_jsx_runtime58 = require("react/jsx-runtime");
5871
+ var import_react32 = require("react");
5872
+ var import_lucide_react31 = require("lucide-react");
5873
+ var import_jsx_runtime59 = require("react/jsx-runtime");
5549
5874
  var CONFIRM_MS = 2e3;
5550
- var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
5551
- const [copied, setCopied] = (0, import_react31.useState)(false);
5552
- const timer = (0, import_react31.useRef)(void 0);
5553
- (0, import_react31.useEffect)(() => () => clearTimeout(timer.current), []);
5875
+ var CopyButton = (0, import_react32.forwardRef)(function CopyButton2({ value, label, "aria-label": ariaLabel, size = "xs", className, testIdPrefix }, ref) {
5876
+ const [copied, setCopied] = (0, import_react32.useState)(false);
5877
+ const timer = (0, import_react32.useRef)(void 0);
5878
+ (0, import_react32.useEffect)(() => () => clearTimeout(timer.current), []);
5554
5879
  const copy = async () => {
5555
5880
  try {
5556
5881
  await navigator.clipboard.writeText(typeof value === "function" ? value() : value);
@@ -5562,8 +5887,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
5562
5887
  timer.current = setTimeout(() => setCopied(false), CONFIRM_MS);
5563
5888
  };
5564
5889
  const iconSize = size === "xs" ? 13 : 15;
5565
- const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react30.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react30.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
5566
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5890
+ const icon = copied ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react31.Check, { size: iconSize, "aria-hidden": "true", className: "shrink-0 text-text-success" }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react31.Copy, { size: iconSize, "aria-hidden": "true", className: "shrink-0" });
5891
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
5567
5892
  Button,
5568
5893
  {
5569
5894
  ref,
@@ -5577,8 +5902,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
5577
5902
  className: cn(!copied && "text-text-secondary", className),
5578
5903
  children: [
5579
5904
  icon,
5580
- label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { children: copied ? "Copied" : label }),
5581
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
5905
+ label && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { children: copied ? "Copied" : label }),
5906
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { role: "status", className: "sr-only", children: copied ? "Copied" : "" })
5582
5907
  ]
5583
5908
  }
5584
5909
  );
@@ -5586,8 +5911,8 @@ var CopyButton = (0, import_react31.forwardRef)(function CopyButton2({ value, la
5586
5911
  CopyButton.displayName = "CopyButton";
5587
5912
 
5588
5913
  // src/InlineMessage.tsx
5589
- var import_lucide_react31 = require("lucide-react");
5590
- var import_jsx_runtime59 = require("react/jsx-runtime");
5914
+ var import_lucide_react32 = require("lucide-react");
5915
+ var import_jsx_runtime60 = require("react/jsx-runtime");
5591
5916
  var BOX = {
5592
5917
  info: "border-brand-primaryAction/30 bg-brand-primaryAction/10",
5593
5918
  success: "border-status-success/40 bg-status-success/10",
@@ -5601,30 +5926,30 @@ var ICON_INK = {
5601
5926
  warning: "text-text-warning",
5602
5927
  danger: "text-text-danger"
5603
5928
  };
5604
- var ICON2 = { info: import_lucide_react31.Info, success: import_lucide_react31.CheckCircle2, warning: import_lucide_react31.AlertTriangle, danger: import_lucide_react31.XCircle };
5929
+ var ICON2 = { info: import_lucide_react32.Info, success: import_lucide_react32.CheckCircle2, warning: import_lucide_react32.AlertTriangle, danger: import_lucide_react32.XCircle };
5605
5930
  function InlineMessage({ tone = "info", title, children, actions, onDismiss, className, testIdPrefix }) {
5606
5931
  const Icon = ICON2[tone];
5607
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
5932
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
5608
5933
  "div",
5609
5934
  {
5610
5935
  role: tone === "warning" || tone === "danger" ? "alert" : "status",
5611
5936
  className: cn("flex items-start gap-2.5 rounded-control border px-3 py-2.5 text-sm", BOX[tone], className),
5612
5937
  "data-testid": testIdPrefix,
5613
5938
  children: [
5614
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
5615
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "min-w-0 flex-1", children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
5617
- children && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
5618
- actions && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
5939
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { size: 16, "aria-hidden": "true", className: cn("mt-0.5 shrink-0", ICON_INK[tone]) }),
5940
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "min-w-0 flex-1", children: [
5941
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "font-semibold text-text-primary", children: title }),
5942
+ children && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "mt-0.5 text-text-secondary", children }),
5943
+ actions && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: actions })
5619
5944
  ] }),
5620
- onDismiss && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5945
+ onDismiss && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5621
5946
  "button",
5622
5947
  {
5623
5948
  type: "button",
5624
5949
  onClick: onDismiss,
5625
5950
  "aria-label": "Dismiss",
5626
5951
  className: "-mr-1 -mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-control text-text-tertiary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5627
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react31.X, { size: 14, "aria-hidden": "true" })
5952
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react32.X, { size: 14, "aria-hidden": "true" })
5628
5953
  }
5629
5954
  )
5630
5955
  ]
@@ -5633,9 +5958,9 @@ function InlineMessage({ tone = "info", title, children, actions, onDismiss, cla
5633
5958
  }
5634
5959
 
5635
5960
  // src/FilterDrawer.tsx
5636
- var import_react32 = require("react");
5637
- var import_lucide_react32 = require("lucide-react");
5638
- var import_jsx_runtime60 = require("react/jsx-runtime");
5961
+ var import_react33 = require("react");
5962
+ var import_lucide_react33 = require("lucide-react");
5963
+ var import_jsx_runtime61 = require("react/jsx-runtime");
5639
5964
  var SLIDE_MS = 200;
5640
5965
  function reducedMotion() {
5641
5966
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
@@ -5653,10 +5978,10 @@ function FilterDrawer({
5653
5978
  size = "sm",
5654
5979
  testIdPrefix
5655
5980
  }) {
5656
- const [view, setViewState] = (0, import_react32.useState)(focus);
5657
- const [leaving, setLeaving] = (0, import_react32.useState)(null);
5658
- const [phase, setPhase] = (0, import_react32.useState)("run");
5659
- const [wasOpen, setWasOpen] = (0, import_react32.useState)(open);
5981
+ const [view, setViewState] = (0, import_react33.useState)(focus);
5982
+ const [leaving, setLeaving] = (0, import_react33.useState)(null);
5983
+ const [phase, setPhase] = (0, import_react33.useState)("run");
5984
+ const [wasOpen, setWasOpen] = (0, import_react33.useState)(open);
5660
5985
  if (open !== wasOpen) {
5661
5986
  setWasOpen(open);
5662
5987
  if (open) {
@@ -5671,20 +5996,20 @@ function FilterDrawer({
5671
5996
  }
5672
5997
  setViewState(next);
5673
5998
  };
5674
- (0, import_react32.useLayoutEffect)(() => {
5999
+ (0, import_react33.useLayoutEffect)(() => {
5675
6000
  if (phase !== "start") return;
5676
6001
  const raf = requestAnimationFrame(() => requestAnimationFrame(() => setPhase("run")));
5677
6002
  return () => cancelAnimationFrame(raf);
5678
6003
  }, [phase]);
5679
- (0, import_react32.useEffect)(() => {
6004
+ (0, import_react33.useEffect)(() => {
5680
6005
  if (!leaving || phase !== "run") return;
5681
6006
  const t = setTimeout(() => setLeaving(null), SLIDE_MS);
5682
6007
  return () => clearTimeout(t);
5683
6008
  }, [leaving, phase]);
5684
- const backRef = (0, import_react32.useRef)(null);
5685
- const rowRefs = (0, import_react32.useRef)(/* @__PURE__ */ new Map());
5686
- const lastView = (0, import_react32.useRef)(null);
5687
- (0, import_react32.useEffect)(() => {
6009
+ const backRef = (0, import_react33.useRef)(null);
6010
+ const rowRefs = (0, import_react33.useRef)(/* @__PURE__ */ new Map());
6011
+ const lastView = (0, import_react33.useRef)(null);
6012
+ (0, import_react33.useEffect)(() => {
5688
6013
  if (!open) return;
5689
6014
  if (view) backRef.current?.focus();
5690
6015
  else if (lastView.current) rowRefs.current.get(lastView.current)?.focus();
@@ -5697,8 +6022,8 @@ function FilterDrawer({
5697
6022
  const outgoing = phase === "start" ? void 0 : dir > 0 ? "translateX(-33%)" : "translateX(100%)";
5698
6023
  const panel = (v, rows = true) => {
5699
6024
  const s = v ? sections.find((x) => x.id === v) : void 0;
5700
- if (s) return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
5701
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("li", { className: "border-b border-border-default", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
6025
+ if (s) return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "border-t border-border-default px-5 pt-4", children: renderSection(s.id) });
6026
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ul", { className: "border-t border-border-default", children: sections.map((x) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("li", { className: "border-b border-border-default", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
5702
6027
  "button",
5703
6028
  {
5704
6029
  ref: rows ? (el) => {
@@ -5710,7 +6035,7 @@ function FilterDrawer({
5710
6035
  "data-testid": testIdPrefix && `${testIdPrefix}-row-${x.id}`,
5711
6036
  className: "flex w-full items-center gap-3 px-5 py-3.5 text-left transition-colors hover:bg-subtle focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
5712
6037
  children: [
5713
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6038
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5714
6039
  x.icon,
5715
6040
  {
5716
6041
  size: 17,
@@ -5718,22 +6043,22 @@ function FilterDrawer({
5718
6043
  className: x.badge ? "text-brand-primaryAction" : "text-text-secondary"
5719
6044
  }
5720
6045
  ),
5721
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
5722
- x.badge && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Badge, { tone: "brand", children: x.badge }),
5723
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react32.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
6046
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "flex-1 text-sm font-medium text-text-primary", children: x.label }),
6047
+ x.badge && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brand", children: x.badge }),
6048
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react33.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
5724
6049
  ]
5725
6050
  }
5726
6051
  ) }, x.id)) });
5727
6052
  };
5728
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6053
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5729
6054
  Drawer,
5730
6055
  {
5731
6056
  open,
5732
6057
  onClose,
5733
6058
  size,
5734
6059
  testIdPrefix,
5735
- title: focused ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "flex items-center gap-1.5", children: [
5736
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6060
+ title: focused ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex items-center gap-1.5", children: [
6061
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5737
6062
  "button",
5738
6063
  {
5739
6064
  ref: backRef,
@@ -5742,23 +6067,23 @@ function FilterDrawer({
5742
6067
  "aria-label": "Back to all filters",
5743
6068
  "data-testid": testIdPrefix && `${testIdPrefix}-back`,
5744
6069
  className: "-ml-1.5 rounded-control p-1 text-text-secondary hover:bg-subtle hover:text-text-primary focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus",
5745
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react32.ChevronLeft, { size: 18, "aria-hidden": "true" })
6070
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react33.ChevronLeft, { size: 18, "aria-hidden": "true" })
5746
6071
  }
5747
6072
  ),
5748
6073
  focused.label,
5749
- focused.info && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(InfoTip, { text: focused.info, label: `About ${focused.label}` })
5750
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "flex items-center gap-2.5", children: [
6074
+ focused.info && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(InfoTip, { text: focused.info, label: `About ${focused.label}` })
6075
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex items-center gap-2.5", children: [
5751
6076
  "Filters",
5752
- activeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
6077
+ activeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brandSolid", kind: "count", children: activeCount })
5753
6078
  ] }),
5754
6079
  footer: focused ? (
5755
6080
  // Picks are kept as they're made; only See results, on the list, applies them.
5756
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
5757
- ) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [
5758
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
5759
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-2", children: [
5760
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
5761
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6081
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "link", size: "md", onClick: () => onClearSection(focused.id), className: "px-0", children: "Clear" }) })
6082
+ ) : /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex w-full items-center justify-between gap-2", children: [
6083
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "link", size: "md", onClick: onClearAll, className: "px-0", children: "Clear all" }),
6084
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center gap-2", children: [
6085
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Button, { variant: "secondary", size: "md", onClick: onClose, children: "Cancel" }),
6086
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5762
6087
  Button,
5763
6088
  {
5764
6089
  variant: "primary",
@@ -5772,8 +6097,8 @@ function FilterDrawer({
5772
6097
  )
5773
6098
  ] })
5774
6099
  ] }),
5775
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "relative -mx-5 overflow-x-clip", children: [
5776
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6100
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "relative -mx-5 overflow-x-clip", children: [
6101
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5777
6102
  "div",
5778
6103
  {
5779
6104
  style: { transform: incoming },
@@ -5782,7 +6107,7 @@ function FilterDrawer({
5782
6107
  },
5783
6108
  view ?? "__list"
5784
6109
  ),
5785
- leaving && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6110
+ leaving && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5786
6111
  "div",
5787
6112
  {
5788
6113
  "aria-hidden": "true",
@@ -5798,11 +6123,11 @@ function FilterDrawer({
5798
6123
  }
5799
6124
 
5800
6125
  // src/AllFiltersButton.tsx
5801
- var import_react33 = require("react");
5802
- var import_lucide_react33 = require("lucide-react");
5803
- var import_jsx_runtime61 = require("react/jsx-runtime");
5804
- var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
5805
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
6126
+ var import_react34 = require("react");
6127
+ var import_lucide_react34 = require("lucide-react");
6128
+ var import_jsx_runtime62 = require("react/jsx-runtime");
6129
+ var AllFiltersButton = (0, import_react34.forwardRef)(function AllFiltersButton2({ count = 0, open, className, testIdPrefix, ...rest }, ref) {
6130
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
5806
6131
  "button",
5807
6132
  {
5808
6133
  ref,
@@ -5814,19 +6139,19 @@ var AllFiltersButton = (0, import_react33.forwardRef)(function AllFiltersButton2
5814
6139
  className: cn(chipTriggerClass(), className),
5815
6140
  ...rest,
5816
6141
  children: [
5817
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react33.SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
5818
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
5819
- count > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Badge, { tone: "brandSolid", kind: "count", children: count })
6142
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react34.SlidersHorizontal, { size: 15, "aria-hidden": "true", className: "text-text-secondary" }),
6143
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-dense font-medium text-text-primary", children: "All filters" }),
6144
+ count > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { tone: "brandSolid", kind: "count", children: count })
5820
6145
  ]
5821
6146
  }
5822
6147
  );
5823
6148
  });
5824
6149
 
5825
6150
  // src/Menu.tsx
5826
- var import_react34 = require("react");
6151
+ var import_react35 = require("react");
5827
6152
  var import_react_slot2 = require("@radix-ui/react-slot");
5828
- var import_lucide_react34 = require("lucide-react");
5829
- var import_jsx_runtime62 = require("react/jsx-runtime");
6153
+ var import_lucide_react35 = require("lucide-react");
6154
+ var import_jsx_runtime63 = require("react/jsx-runtime");
5830
6155
  var ROW_SELECTOR = '[role^="menuitem"]:not([aria-disabled="true"]):not(:disabled)';
5831
6156
  function moveFocus(e) {
5832
6157
  const keys = ["ArrowDown", "ArrowUp", "Home", "End"];
@@ -5838,8 +6163,8 @@ function moveFocus(e) {
5838
6163
  const next = e.key === "Home" ? 0 : e.key === "End" ? rows.length - 1 : e.key === "ArrowDown" ? (i + 1) % rows.length : (i - 1 + rows.length) % rows.length;
5839
6164
  rows[next].focus();
5840
6165
  }
5841
- var Menu = (0, import_react34.forwardRef)(
5842
- ({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6166
+ var Menu = (0, import_react35.forwardRef)(
6167
+ ({ className, testIdPrefix, onKeyDown, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5843
6168
  "div",
5844
6169
  {
5845
6170
  ref,
@@ -5856,24 +6181,24 @@ var Menu = (0, import_react34.forwardRef)(
5856
6181
  )
5857
6182
  );
5858
6183
  Menu.displayName = "Menu";
5859
- var MenuItem = (0, import_react34.forwardRef)(
6184
+ var MenuItem = (0, import_react35.forwardRef)(
5860
6185
  ({ className, testIdPrefix, icon, trailing, description, submenu, checked, danger, disabled, asChild = false, children, ...props }, ref) => {
5861
6186
  const Comp = asChild ? import_react_slot2.Slot : "button";
5862
6187
  const radio = checked !== void 0;
5863
- const body = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
5864
- icon && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
6188
+ const body = /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
6189
+ icon && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { "aria-hidden": "true", className: cn("flex shrink-0", danger ? "text-text-danger" : "text-text-secondary"), children: icon }),
5865
6190
  asChild ? (
5866
6191
  // The link's own text lands here; the link becomes the row.
5867
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react_slot2.Slottable, { children })
5868
- ) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { className: "min-w-0 flex-1", children: [
5869
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "block truncate", children }),
5870
- description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "block truncate text-xs text-text-tertiary", children: description })
6192
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_slot2.Slottable, { children })
6193
+ ) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "min-w-0 flex-1", children: [
6194
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "block truncate", children }),
6195
+ description && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "block truncate text-xs text-text-tertiary", children: description })
5871
6196
  ] }),
5872
- trailing && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
5873
- radio && checked && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react34.Check, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
5874
- submenu && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react34.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
6197
+ trailing && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ml-auto flex shrink-0 items-center text-xs text-text-secondary", children: trailing }),
6198
+ radio && checked && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react35.Check, { size: 16, "aria-hidden": "true", className: "shrink-0 text-brand-primaryAction" }),
6199
+ submenu && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react35.ChevronRight, { size: 16, "aria-hidden": "true", className: "shrink-0 text-text-secondary" })
5875
6200
  ] });
5876
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6201
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5877
6202
  Comp,
5878
6203
  {
5879
6204
  ref,
@@ -5900,7 +6225,7 @@ var MenuItem = (0, import_react34.forwardRef)(
5900
6225
  );
5901
6226
  MenuItem.displayName = "MenuItem";
5902
6227
  function MenuLabel({ className, testIdPrefix, children }) {
5903
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6228
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5904
6229
  "div",
5905
6230
  {
5906
6231
  role: "presentation",
@@ -5911,7 +6236,7 @@ function MenuLabel({ className, testIdPrefix, children }) {
5911
6236
  );
5912
6237
  }
5913
6238
  function MenuSeparator({ className, testIdPrefix }) {
5914
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
6239
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { role: "separator", "data-testid": testIdPrefix, className: cn("-mx-1 my-1 border-t border-border-default", className) });
5915
6240
  }
5916
6241
 
5917
6242
  // src/dates.ts
@@ -6024,60 +6349,17 @@ function defaultDateOrder(country) {
6024
6349
  return c === "US" || c === "CA" || c === "" ? "mdy" : "dmy";
6025
6350
  }
6026
6351
 
6027
- // src/numbers.ts
6028
- var US = { units: ["K", "M", "B", "T"] };
6029
- var STYLES = {
6030
- "en-US": US,
6031
- "en-CA": US,
6032
- "en-GB": { units: ["k", "m", "bn", "tn"] }
6033
- };
6034
- var styleFor = (language) => STYLES[language ?? "en-US"] ?? US;
6035
- var NO_VALUE = "\u2014";
6036
- var MINUS = "\u2212";
6037
- var SHORTEN_FROM = 1e4;
6038
- var isMissing = (v) => v === null || v === void 0 || Number.isNaN(v);
6039
- var withCommas = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
6040
- function shortAbs(abs, style) {
6041
- if (abs < SHORTEN_FROM) return withCommas(abs);
6042
- let tier = Math.min(Math.floor(Math.log10(abs) / 3), 4);
6043
- let scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
6044
- if (scaled >= 1e3 && tier < 4) {
6045
- tier += 1;
6046
- scaled = Math.round(abs / 1e3 ** tier * 10) / 10;
6047
- }
6048
- const text = Number.isInteger(scaled) ? withCommas(scaled) : scaled.toFixed(1);
6049
- return `${text}${style.units[tier - 1]}`;
6050
- }
6051
- function symbol(opts) {
6052
- const currency = opts.currency ?? "USD";
6053
- if (currency === "GBP") return "\xA3";
6054
- if (currency === "EUR") return "\u20AC";
6055
- if (opts.mixedDollars) return currency === "CAD" ? "CA$" : "US$";
6056
- return "$";
6057
- }
6058
- var sign = (v) => v < 0 ? MINUS : "";
6059
- function formatCount(value, opts = {}) {
6060
- if (isMissing(value)) return NO_VALUE;
6061
- return sign(value) + shortAbs(Math.abs(value), styleFor(opts.language));
6062
- }
6063
- function formatCountFull(value) {
6064
- if (isMissing(value)) return NO_VALUE;
6065
- return sign(value) + withCommas(Math.abs(value));
6066
- }
6067
- function formatMoney(value, opts = {}) {
6068
- if (isMissing(value)) return NO_VALUE;
6069
- return sign(value) + symbol(opts) + shortAbs(Math.abs(value), styleFor(opts.language));
6070
- }
6071
- function formatMoneyFull(value, opts = {}) {
6072
- if (isMissing(value)) return NO_VALUE;
6073
- return sign(value) + symbol(opts) + withCommas(Math.abs(value));
6074
- }
6075
- function formatPercent(value, _opts = {}) {
6076
- if (isMissing(value)) return NO_VALUE;
6077
- const abs = Math.abs(value);
6078
- if (abs > 0 && abs < 0.05) return `${value < 0 ? MINUS : ""}<0.1%`;
6079
- const text = (Math.round(abs * 10) / 10).toFixed(1);
6080
- return text === "0.0" ? "0.0%" : `${sign(value)}${text}%`;
6352
+ // src/Figure.tsx
6353
+ var import_jsx_runtime64 = require("react/jsx-runtime");
6354
+ function Figure({ value, kind = "money", missing, ...opts }) {
6355
+ if (value === null || value === void 0 || Number.isNaN(value)) return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(NoValue, { reason: missing });
6356
+ const short = kind === "money" ? formatMoney(value, opts) : formatCount(value, opts);
6357
+ const full = kind === "money" ? formatMoneyFull(value, opts) : formatCountFull(value);
6358
+ if (short === full) return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: short });
6359
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Tooltip, { label: full, delay: 300, children: [
6360
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { "aria-hidden": "true", children: short }),
6361
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: full })
6362
+ ] });
6081
6363
  }
6082
6364
  // Annotate the CommonJS export names for ESM import in node:
6083
6365
  0 && (module.exports = {
@@ -6092,6 +6374,7 @@ function formatPercent(value, _opts = {}) {
6092
6374
  Button,
6093
6375
  Card,
6094
6376
  ChartLegend,
6377
+ ChartSkeleton,
6095
6378
  CheckBox,
6096
6379
  CheckBoxBox,
6097
6380
  ChipContent,
@@ -6104,6 +6387,7 @@ function formatPercent(value, _opts = {}) {
6104
6387
  Delta,
6105
6388
  Drawer,
6106
6389
  EmptyState,
6390
+ Figure,
6107
6391
  FilterChipBar,
6108
6392
  FilterDrawer,
6109
6393
  FilterDropdownFooter,
@@ -6112,6 +6396,8 @@ function formatPercent(value, _opts = {}) {
6112
6396
  InlineMessage,
6113
6397
  LegendItem,
6114
6398
  LineChartPlaceholder,
6399
+ LoadError,
6400
+ LongWait,
6115
6401
  MediaLabel,
6116
6402
  Menu,
6117
6403
  MenuItem,
@@ -6124,6 +6410,7 @@ function formatPercent(value, _opts = {}) {
6124
6410
  NO_VALUE,
6125
6411
  NameListModal,
6126
6412
  NoResultsEmptyState,
6413
+ NoValue,
6127
6414
  PRIMARY_ACTION_CLASS,
6128
6415
  PageHeader,
6129
6416
  Pager,
@@ -6131,6 +6418,7 @@ function formatPercent(value, _opts = {}) {
6131
6418
  PrimaryBadge,
6132
6419
  PublisherBreakdownList,
6133
6420
  QUIET_ACTION_CLASS,
6421
+ RefreshLine,
6134
6422
  SearchBar,
6135
6423
  SectionHeading,
6136
6424
  SectionRail,
@@ -6139,11 +6427,15 @@ function formatPercent(value, _opts = {}) {
6139
6427
  SelectFilter,
6140
6428
  SelectedSection,
6141
6429
  SelectionPicker,
6430
+ Skeleton,
6431
+ SkeletonLines,
6142
6432
  SortButton,
6143
6433
  StackedColumnPlaceholder,
6144
6434
  StatStrip,
6435
+ StatStripSkeleton,
6145
6436
  StatTile,
6146
6437
  SuggestionChip,
6438
+ TableLink,
6147
6439
  TablePagination,
6148
6440
  Tabs,
6149
6441
  Tag,
@@ -6177,6 +6469,7 @@ function formatPercent(value, _opts = {}) {
6177
6469
  formatWeek,
6178
6470
  noResultsBody,
6179
6471
  resolveRange,
6180
- sortProp
6472
+ sortProp,
6473
+ useDelayedLoading
6181
6474
  });
6182
6475
  //# sourceMappingURL=index.cjs.map