@dashspec/renderer 0.1.43 → 0.1.44

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.js CHANGED
@@ -102,7 +102,7 @@ import {
102
102
  translator,
103
103
  validateDocument,
104
104
  widgetChecks
105
- } from "./chunk-IBSZQEYY.js";
105
+ } from "./chunk-HAYQEYMT.js";
106
106
  import {
107
107
  Chips,
108
108
  asRows,
@@ -1986,7 +1986,7 @@ function partsCss(theme, scope2, mode = "light") {
1986
1986
  ],
1987
1987
  [".ds-live[data-stale] > span", decl({ background: c(p.liveDot?.staleColor) })],
1988
1988
  [
1989
- ".ds-flow-hover",
1989
+ ".ds-flowmap-hover",
1990
1990
  decl({
1991
1991
  padding: p.popover?.padding,
1992
1992
  "border-radius": px(p.popover?.radius),
@@ -2283,50 +2283,135 @@ var CardGrid = defineWidget({
2283
2283
 
2284
2284
  // src/widgets/builtins/Container.tsx
2285
2285
  import "zod";
2286
- import { jsx as jsx4 } from "react/jsx-runtime";
2287
- var JUSTIFY = {
2288
- start: "flex-start",
2289
- center: "center",
2290
- end: "flex-end",
2291
- between: "space-between",
2292
- around: "space-around",
2293
- evenly: "space-evenly"
2294
- };
2295
- var ALIGN = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" };
2296
- var Container = defineWidget({
2297
- ...ContainerContract,
2298
- implements: "layout",
2299
- frame: "plain",
2300
- meta: { label: "Container", icon: "container", category: "Layout", size: { w: 12, h: 5, minW: 2, minH: 2 } },
2301
- events: [],
2302
- defaults: { direction: "row", wrap: true, gap: 12 },
2303
- component: function ContainerWidget({ spec, renderSlot }) {
2304
- const style = {
2305
- display: "flex",
2306
- flexDirection: spec.direction,
2307
- flexWrap: spec.wrap ? "wrap" : "nowrap",
2308
- gap: spec.gap,
2309
- justifyContent: JUSTIFY[spec.justify],
2310
- alignItems: ALIGN[spec.align],
2311
- // An equal split is across a row; in a column, children keep their own height.
2312
- ["--ds-child-flex"]: spec.equal && spec.direction === "row" ? `1 1 ${spec.childMinWidth}px` : "0 0 auto",
2313
- ["--ds-child-min"]: `${spec.direction === "row" ? spec.childMinWidth : 0}px`,
2314
- overflow: spec.scroll ? "auto" : "visible"
2315
- };
2316
- return renderSlot("items", {
2317
- className: "ds-container",
2318
- style,
2319
- empty: /* @__PURE__ */ jsx4("span", { className: "ds-slot-hint", children: "Drop widgets here" })
2320
- });
2286
+
2287
+ // src/widgets/shared/clickable.ts
2288
+ import { useContext as useContext5 } from "react";
2289
+
2290
+ // src/components/PanelFrame.tsx
2291
+ import { useCallback as useCallback3, useEffect as useEffect4, useId as useId4, useMemo as useMemo3, useRef as useRef5, useState as useState4 } from "react";
2292
+
2293
+ // src/widgets/parseProps.ts
2294
+ function without(value, path) {
2295
+ if (path.length === 0 || value === null || typeof value !== "object") return value;
2296
+ const [head, ...rest] = path;
2297
+ if (Array.isArray(value)) {
2298
+ if (typeof head !== "number" || head < 0 || head >= value.length) return value;
2299
+ const copy2 = [...value];
2300
+ if (rest.length === 0) copy2.splice(head, 1);
2301
+ else copy2[head] = without(copy2[head], rest);
2302
+ return copy2;
2321
2303
  }
2322
- });
2304
+ if (!Object.hasOwn(value, head)) return value;
2305
+ const copy = { ...value };
2306
+ if (rest.length === 0) delete copy[head];
2307
+ else copy[head] = without(copy[head], rest);
2308
+ return copy;
2309
+ }
2310
+ function parseWidgetProps(schema, props) {
2311
+ let current = props;
2312
+ const dropped = [];
2313
+ for (let round = 0; round < 25; round++) {
2314
+ const r = schema.safeParse(current);
2315
+ if (r.success) return { props: r.data, dropped };
2316
+ const issue = r.error.issues.find((i) => i.path.length > 0);
2317
+ if (!issue) break;
2318
+ const lastIndex = issue.path.reduce((at, k, i) => typeof k === "number" ? i : at, -1);
2319
+ const path = lastIndex >= 0 ? issue.path.slice(0, lastIndex + 1) : issue.path;
2320
+ const next = without(current, path);
2321
+ if (next === current) break;
2322
+ dropped.push(path.join("."));
2323
+ current = next;
2324
+ }
2325
+ return { props, dropped };
2326
+ }
2323
2327
 
2324
- // src/widgets/builtins/Content.tsx
2325
- import "zod";
2328
+ // src/widgets/shared/InfoTip.tsx
2329
+ import { useEffect, useLayoutEffect, useRef as useRef2, useState } from "react";
2330
+ import { createPortal } from "react-dom";
2331
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
2332
+ function InfoTip({ text: text2 }) {
2333
+ const ref = useRef2(null);
2334
+ const tip = useRef2(null);
2335
+ const [open, setOpen] = useState(false);
2336
+ const [mounted, setMounted] = useState(false);
2337
+ const closing = useRef2(void 0);
2338
+ useEffect(() => () => clearTimeout(closing.current), []);
2339
+ const show = () => {
2340
+ clearTimeout(closing.current);
2341
+ setMounted(true);
2342
+ setOpen(true);
2343
+ };
2344
+ const hide = () => {
2345
+ setOpen(false);
2346
+ clearTimeout(closing.current);
2347
+ closing.current = setTimeout(() => {
2348
+ setMounted(false);
2349
+ setPos(null);
2350
+ }, 160);
2351
+ };
2352
+ const [pos, setPos] = useState(null);
2353
+ useLayoutEffect(() => {
2354
+ if (!mounted || !ref.current || !tip.current) return;
2355
+ const a = ref.current.getBoundingClientRect();
2356
+ const t = tip.current.getBoundingClientRect();
2357
+ const gap = 8;
2358
+ const margin = 8;
2359
+ const vw = window.innerWidth || document.documentElement.clientWidth;
2360
+ const box = ref.current.closest(".ds-root")?.getBoundingClientRect();
2361
+ const minX = Math.max(margin, (box?.left ?? 0) + margin);
2362
+ const maxX = Math.min(vw, box?.right ?? vw) - margin;
2363
+ const minY = Math.max(margin, (box?.top ?? 0) + margin);
2364
+ const below = a.top - t.height - gap < minY;
2365
+ const centre = a.left + a.width / 2;
2366
+ const left = Math.min(Math.max(centre - t.width / 2, minX), Math.max(minX, maxX - t.width));
2367
+ setPos({ left, top: below ? a.bottom + gap : a.top - t.height - gap, arrow: centre - left, below });
2368
+ }, [mounted]);
2369
+ const root = ref.current?.closest(".ds-root") ?? (typeof document !== "undefined" ? document.body : null);
2370
+ return /* @__PURE__ */ jsxs4(
2371
+ "button",
2372
+ {
2373
+ ref,
2374
+ type: "button",
2375
+ className: "ds-info",
2376
+ "aria-label": text2,
2377
+ onClick: (e) => e.stopPropagation(),
2378
+ onMouseEnter: show,
2379
+ onMouseLeave: hide,
2380
+ onFocus: show,
2381
+ onBlur: hide,
2382
+ children: [
2383
+ /* @__PURE__ */ jsxs4("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: [
2384
+ /* @__PURE__ */ jsx4("circle", { cx: "8", cy: "8", r: "6.5", fill: "none", stroke: "currentColor", strokeWidth: "1" }),
2385
+ /* @__PURE__ */ jsx4("path", { d: "M8 7.2v3.6M8 5.2v.1", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })
2386
+ ] }),
2387
+ mounted && root && createPortal(
2388
+ /* @__PURE__ */ jsx4(
2389
+ "span",
2390
+ {
2391
+ ref: tip,
2392
+ className: "ds-tip",
2393
+ role: "tooltip",
2394
+ "data-below": pos?.below || void 0,
2395
+ "data-open": open && pos ? "" : void 0,
2396
+ style: {
2397
+ left: pos?.left ?? 0,
2398
+ top: pos?.top ?? 0,
2399
+ visibility: pos ? "visible" : "hidden",
2400
+ ["--ds-tip-arrow"]: `${pos?.arrow ?? 0}px`
2401
+ },
2402
+ children: text2
2403
+ }
2404
+ ),
2405
+ root
2406
+ )
2407
+ ]
2408
+ }
2409
+ );
2410
+ }
2326
2411
 
2327
2412
  // src/widgets/shared/Markdown.tsx
2328
2413
  import { Fragment } from "react";
2329
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
2414
+ import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2330
2415
  function Markdown({ text: text2, onAction }) {
2331
2416
  const blocks = text2.replace(/\r\n/g, "\n").split(/\n{2,}/);
2332
2417
  return /* @__PURE__ */ jsx5(Fragment2, { children: blocks.map((b, i) => {
@@ -2342,7 +2427,7 @@ function Markdown({ text: text2, onAction }) {
2342
2427
  const Tag = `h${level}`;
2343
2428
  return /* @__PURE__ */ jsx5(Tag, { className: "ds-md-h", children: inline(h[2], onAction) }, key);
2344
2429
  }
2345
- return /* @__PURE__ */ jsx5("p", { className: "ds-md-p", children: lines.map((l, j) => /* @__PURE__ */ jsxs4(Fragment, { children: [
2430
+ return /* @__PURE__ */ jsx5("p", { className: "ds-md-p", children: lines.map((l, j) => /* @__PURE__ */ jsxs5(Fragment, { children: [
2346
2431
  j > 0 && /* @__PURE__ */ jsx5("br", {}),
2347
2432
  inline(l, onAction)
2348
2433
  ] }, `${j}-${l}`)) }, key);
@@ -2396,39 +2481,41 @@ function inline(s, onAction) {
2396
2481
  return out;
2397
2482
  }
2398
2483
 
2399
- // src/widgets/builtins/Content.tsx
2400
- import { jsx as jsx6 } from "react/jsx-runtime";
2401
- var Content = defineWidget({
2402
- ...ContentContract,
2403
- implements: "text",
2404
- meta: { label: "Rich text", icon: "text", category: "Content", size: { w: 4, h: 3, minW: 2, minH: 1 } },
2405
- events: ["click"],
2406
- defaults: { markdown: "Write **Markdown** here." },
2407
- component: function ContentWidget({ spec, run }) {
2408
- return /* @__PURE__ */ jsx6("div", { className: "ds-content", style: { textAlign: spec.align }, children: /* @__PURE__ */ jsx6(Markdown, { text: spec.markdown, onAction: (name) => run(name) }) });
2484
+ // src/components/Boundary.tsx
2485
+ import { Component } from "react";
2486
+ var sameKeys = (a, b) => a.length === b.length && a.every((x, i) => Object.is(x, b[i]));
2487
+ var Boundary = class extends Component {
2488
+ state = { error: null };
2489
+ static getDerivedStateFromError(error) {
2490
+ return { error };
2409
2491
  }
2410
- });
2411
-
2412
- // src/widgets/builtins/Filter.tsx
2413
- import { useCallback as useCallback3 } from "react";
2414
- import "zod";
2492
+ componentDidCatch(error, _info) {
2493
+ this.props.onError?.(error);
2494
+ }
2495
+ componentDidUpdate(prev) {
2496
+ if (this.state.error && !sameKeys(prev.resetKeys ?? [], this.props.resetKeys ?? [])) this.setState({ error: null });
2497
+ }
2498
+ render() {
2499
+ return this.state.error ? this.props.fallback(this.state.error) : this.props.children;
2500
+ }
2501
+ };
2415
2502
 
2416
2503
  // src/components/FilterBar.tsx
2417
- import { useCallback as useCallback2, useEffect as useEffect2, useId as useId3, useRef as useRef3, useState as useState2 } from "react";
2504
+ import { useCallback as useCallback2, useEffect as useEffect3, useId as useId3, useRef as useRef4, useState as useState3 } from "react";
2418
2505
 
2419
2506
  // src/components/controls.tsx
2420
2507
  import {
2421
2508
  useContext as useContext3,
2422
- useEffect,
2509
+ useEffect as useEffect2,
2423
2510
  useId as useId2,
2424
- useLayoutEffect,
2511
+ useLayoutEffect as useLayoutEffect2,
2425
2512
  useMemo as useMemo2,
2426
- useRef as useRef2,
2427
- useState
2513
+ useRef as useRef3,
2514
+ useState as useState2
2428
2515
  } from "react";
2429
- import { createPortal } from "react-dom";
2430
- import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2431
- var Chevron = () => /* @__PURE__ */ jsx7("svg", { className: "ds-pill-chev", viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: /* @__PURE__ */ jsx7(
2516
+ import { createPortal as createPortal2 } from "react-dom";
2517
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2518
+ var Chevron = () => /* @__PURE__ */ jsx6("svg", { className: "ds-pill-chev", viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: /* @__PURE__ */ jsx6(
2432
2519
  "path",
2433
2520
  {
2434
2521
  d: "m4 6 4 4 4-4",
@@ -2442,9 +2529,9 @@ var Chevron = () => /* @__PURE__ */ jsx7("svg", { className: "ds-pill-chev", vie
2442
2529
  var Arrow = ({ dir }) => {
2443
2530
  const icons = useContext3(DashboardContext)?.options.ui?.icons;
2444
2531
  const own = dir === "left" ? icons?.previous : icons?.next;
2445
- return own ? /* @__PURE__ */ jsx7(Fragment3, { children: own }) : /* @__PURE__ */ jsx7(DefaultArrow, { dir });
2532
+ return own ? /* @__PURE__ */ jsx6(Fragment3, { children: own }) : /* @__PURE__ */ jsx6(DefaultArrow, { dir });
2446
2533
  };
2447
- var DefaultArrow = ({ dir }) => /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: /* @__PURE__ */ jsx7(
2534
+ var DefaultArrow = ({ dir }) => /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: /* @__PURE__ */ jsx6(
2448
2535
  "path",
2449
2536
  {
2450
2537
  d: dir === "left" ? "M13 8H3m4-4L3 8l4 4" : "M3 8h10M9 4l4 4-4 4",
@@ -2455,16 +2542,16 @@ var DefaultArrow = ({ dir }) => /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 16 1
2455
2542
  strokeLinejoin: "round"
2456
2543
  }
2457
2544
  ) });
2458
- var Calendar = () => /* @__PURE__ */ jsxs5("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: [
2459
- /* @__PURE__ */ jsx7("rect", { x: "2.5", y: "3.5", width: "11", height: "10", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.3" }),
2460
- /* @__PURE__ */ jsx7("path", { d: "M2.5 6.5h11M5.5 2v3M10.5 2v3", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
2545
+ var Calendar = () => /* @__PURE__ */ jsxs6("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: [
2546
+ /* @__PURE__ */ jsx6("rect", { x: "2.5", y: "3.5", width: "11", height: "10", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.3" }),
2547
+ /* @__PURE__ */ jsx6("path", { d: "M2.5 6.5h11M5.5 2v3M10.5 2v3", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
2461
2548
  ] });
2462
2549
  function usePopover() {
2463
- const [open, setOpen] = useState(false);
2464
- const root = useRef2(null);
2465
- const trigger = useRef2(null);
2466
- const floating = useRef2(null);
2467
- useEffect(() => {
2550
+ const [open, setOpen] = useState2(false);
2551
+ const root = useRef3(null);
2552
+ const trigger = useRef3(null);
2553
+ const floating = useRef3(null);
2554
+ useEffect2(() => {
2468
2555
  if (!open) return;
2469
2556
  const inside = (t) => t instanceof Node && Boolean(root.current?.contains(t) || floating.current?.contains(t));
2470
2557
  const onDown = (e) => {
@@ -2501,9 +2588,9 @@ function Floating({
2501
2588
  role,
2502
2589
  label
2503
2590
  }) {
2504
- const [pos, setPos] = useState(null);
2591
+ const [pos, setPos] = useState2(null);
2505
2592
  const host = anchor.current?.closest(".ds-root") ?? (typeof document !== "undefined" ? document.body : null);
2506
- useLayoutEffect(() => {
2593
+ useLayoutEffect2(() => {
2507
2594
  const place = () => {
2508
2595
  const a = anchor.current?.getBoundingClientRect();
2509
2596
  const f = floatingRef.current?.getBoundingClientRect();
@@ -2527,8 +2614,8 @@ function Floating({
2527
2614
  };
2528
2615
  }, [anchor, floatingRef]);
2529
2616
  if (!host) return null;
2530
- return createPortal(
2531
- /* @__PURE__ */ jsx7(
2617
+ return createPortal2(
2618
+ /* @__PURE__ */ jsx6(
2532
2619
  "div",
2533
2620
  {
2534
2621
  ref: floatingRef,
@@ -2560,7 +2647,7 @@ function PillTrigger({
2560
2647
  controls,
2561
2648
  ariaLabel
2562
2649
  }) {
2563
- return /* @__PURE__ */ jsxs5(
2650
+ return /* @__PURE__ */ jsxs6(
2564
2651
  "button",
2565
2652
  {
2566
2653
  ref: triggerRef,
@@ -2573,16 +2660,16 @@ function PillTrigger({
2573
2660
  onClick,
2574
2661
  children: [
2575
2662
  icon2,
2576
- label ? /* @__PURE__ */ jsxs5("span", { children: [
2663
+ label ? /* @__PURE__ */ jsxs6("span", { children: [
2577
2664
  label,
2578
2665
  " ",
2579
- /* @__PURE__ */ jsxs5("span", { className: "ds-pill-value", children: [
2666
+ /* @__PURE__ */ jsxs6("span", { className: "ds-pill-value", children: [
2580
2667
  "(",
2581
2668
  value,
2582
2669
  ")"
2583
2670
  ] })
2584
- ] }) : /* @__PURE__ */ jsx7("span", { className: "ds-pill-value ds-pill-value-only", children: value }),
2585
- /* @__PURE__ */ jsx7(Chevron, {})
2671
+ ] }) : /* @__PURE__ */ jsx6("span", { className: "ds-pill-value ds-pill-value-only", children: value }),
2672
+ /* @__PURE__ */ jsx6(Chevron, {})
2586
2673
  ]
2587
2674
  }
2588
2675
  );
@@ -2594,14 +2681,14 @@ function OptionList({
2594
2681
  onPick,
2595
2682
  multiple
2596
2683
  }) {
2597
- const list = useRef2(null);
2684
+ const list = useRef3(null);
2598
2685
  const start = Math.max(
2599
2686
  0,
2600
2687
  options.findIndex((o) => isSelected(o.value))
2601
2688
  );
2602
- const [active, setActive] = useState(start);
2603
- const typed = useRef2({ text: "", at: 0 });
2604
- useEffect(() => {
2689
+ const [active, setActive] = useState2(start);
2690
+ const typed = useRef3({ text: "", at: 0 });
2691
+ useEffect2(() => {
2605
2692
  list.current?.querySelector(`[data-i="${start}"]`)?.focus();
2606
2693
  }, [start]);
2607
2694
  const move = (i) => {
@@ -2622,7 +2709,7 @@ function OptionList({
2622
2709
  } else return;
2623
2710
  e.preventDefault();
2624
2711
  };
2625
- return /* @__PURE__ */ jsxs5(
2712
+ return /* @__PURE__ */ jsxs6(
2626
2713
  "div",
2627
2714
  {
2628
2715
  className: "ds-menu",
@@ -2633,10 +2720,10 @@ function OptionList({
2633
2720
  onKeyDown: onKey,
2634
2721
  tabIndex: -1,
2635
2722
  children: [
2636
- options.length === 0 && /* @__PURE__ */ jsx7("div", { className: "ds-menu-empty", children: "No options" }),
2723
+ options.length === 0 && /* @__PURE__ */ jsx6("div", { className: "ds-menu-empty", children: "No options" }),
2637
2724
  options.map((o, i) => {
2638
2725
  const sel = isSelected(o.value);
2639
- return /* @__PURE__ */ jsxs5(
2726
+ return /* @__PURE__ */ jsxs6(
2640
2727
  "button",
2641
2728
  {
2642
2729
  type: "button",
@@ -2648,10 +2735,10 @@ function OptionList({
2648
2735
  onClick: () => onPick(o),
2649
2736
  onFocus: () => setActive(i),
2650
2737
  children: [
2651
- multiple && /* @__PURE__ */ jsx7("span", { className: "ds-check", "data-on": sel || void 0, "aria-hidden": "true" }),
2652
- /* @__PURE__ */ jsx7("span", { className: "ds-menu-label", children: o.label }),
2653
- o.count !== void 0 && /* @__PURE__ */ jsx7("span", { className: "ds-menu-count", children: o.count }),
2654
- !multiple && sel && /* @__PURE__ */ jsx7("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", className: "ds-menu-tick", children: /* @__PURE__ */ jsx7(
2738
+ multiple && /* @__PURE__ */ jsx6("span", { className: "ds-check", "data-on": sel || void 0, "aria-hidden": "true" }),
2739
+ /* @__PURE__ */ jsx6("span", { className: "ds-menu-label", children: o.label }),
2740
+ o.count !== void 0 && /* @__PURE__ */ jsx6("span", { className: "ds-menu-count", children: o.count }),
2741
+ !multiple && sel && /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", className: "ds-menu-tick", children: /* @__PURE__ */ jsx6(
2655
2742
  "path",
2656
2743
  {
2657
2744
  d: "m3.5 8.5 3 3 6-7",
@@ -2687,7 +2774,7 @@ function SelectControl({
2687
2774
  const id = useId2();
2688
2775
  const i = options.findIndex((o) => o.value === value);
2689
2776
  const current = i >= 0 ? options[i].label : value === null || value === void 0 || value === "" ? allLabel : String(value);
2690
- const pill = /* @__PURE__ */ jsxs5(
2777
+ const pill = /* @__PURE__ */ jsxs6(
2691
2778
  "div",
2692
2779
  {
2693
2780
  className: "ds-dd",
@@ -2696,7 +2783,7 @@ function SelectControl({
2696
2783
  "data-block": block || void 0,
2697
2784
  "data-plain": plain || void 0,
2698
2785
  children: [
2699
- /* @__PURE__ */ jsx7(
2786
+ /* @__PURE__ */ jsx6(
2700
2787
  PillTrigger,
2701
2788
  {
2702
2789
  label: stepper ? void 0 : label,
@@ -2708,7 +2795,7 @@ function SelectControl({
2708
2795
  ariaLabel
2709
2796
  }
2710
2797
  ),
2711
- p.open && /* @__PURE__ */ jsx7(Floating, { anchor: p.trigger, floatingRef: p.floating, children: /* @__PURE__ */ jsx7(
2798
+ p.open && /* @__PURE__ */ jsx6(Floating, { anchor: p.trigger, floatingRef: p.floating, children: /* @__PURE__ */ jsx6(
2712
2799
  OptionList,
2713
2800
  {
2714
2801
  id,
@@ -2725,8 +2812,8 @@ function SelectControl({
2725
2812
  }
2726
2813
  );
2727
2814
  if (!stepper) return pill;
2728
- return /* @__PURE__ */ jsxs5("div", { className: "ds-stepper", role: "group", "aria-label": label, children: [
2729
- /* @__PURE__ */ jsx7(
2815
+ return /* @__PURE__ */ jsxs6("div", { className: "ds-stepper", role: "group", "aria-label": label, children: [
2816
+ /* @__PURE__ */ jsx6(
2730
2817
  "button",
2731
2818
  {
2732
2819
  type: "button",
@@ -2734,11 +2821,11 @@ function SelectControl({
2734
2821
  "aria-label": `Previous ${label ?? ""}`,
2735
2822
  disabled: i <= 0,
2736
2823
  onClick: () => onChange(options[i - 1]?.value),
2737
- children: /* @__PURE__ */ jsx7(Arrow, { dir: "left" })
2824
+ children: /* @__PURE__ */ jsx6(Arrow, { dir: "left" })
2738
2825
  }
2739
2826
  ),
2740
2827
  pill,
2741
- /* @__PURE__ */ jsx7(
2828
+ /* @__PURE__ */ jsx6(
2742
2829
  "button",
2743
2830
  {
2744
2831
  type: "button",
@@ -2746,7 +2833,7 @@ function SelectControl({
2746
2833
  "aria-label": `Next ${label ?? ""}`,
2747
2834
  disabled: i === -1 || i >= options.length - 1,
2748
2835
  onClick: () => onChange(options[i + 1]?.value),
2749
- children: /* @__PURE__ */ jsx7(Arrow, { dir: "right" })
2836
+ children: /* @__PURE__ */ jsx6(Arrow, { dir: "right" })
2750
2837
  }
2751
2838
  )
2752
2839
  ] });
@@ -2766,8 +2853,8 @@ function MultiSelectControl({
2766
2853
  const chosen = Array.isArray(value) ? value : [];
2767
2854
  const names = options.filter((o) => chosen.includes(o.value)).map((o) => o.label);
2768
2855
  const text2 = chosen.length === 0 ? emptyLabel : names.length <= 2 ? names.join(", ") : `${chosen.length} selected`;
2769
- return /* @__PURE__ */ jsxs5("div", { className: "ds-dd", ref: p.root, "data-block": block || void 0, "data-plain": plain || void 0, children: [
2770
- /* @__PURE__ */ jsx7(
2856
+ return /* @__PURE__ */ jsxs6("div", { className: "ds-dd", ref: p.root, "data-block": block || void 0, "data-plain": plain || void 0, children: [
2857
+ /* @__PURE__ */ jsx6(
2771
2858
  PillTrigger,
2772
2859
  {
2773
2860
  label,
@@ -2779,8 +2866,8 @@ function MultiSelectControl({
2779
2866
  ariaLabel
2780
2867
  }
2781
2868
  ),
2782
- p.open && /* @__PURE__ */ jsxs5(Floating, { anchor: p.trigger, floatingRef: p.floating, children: [
2783
- /* @__PURE__ */ jsx7(
2869
+ p.open && /* @__PURE__ */ jsxs6(Floating, { anchor: p.trigger, floatingRef: p.floating, children: [
2870
+ /* @__PURE__ */ jsx6(
2784
2871
  OptionList,
2785
2872
  {
2786
2873
  id,
@@ -2790,9 +2877,9 @@ function MultiSelectControl({
2790
2877
  onPick: (o) => onChange(chosen.includes(o.value) ? chosen.filter((x) => x !== o.value) : [...chosen, o.value])
2791
2878
  }
2792
2879
  ),
2793
- chosen.length > 0 && /* @__PURE__ */ jsxs5("div", { className: "ds-pop-foot", children: [
2794
- /* @__PURE__ */ jsx7("button", { type: "button", className: "ds-link", onClick: () => onChange([]), children: "Clear" }),
2795
- /* @__PURE__ */ jsxs5("span", { children: [
2880
+ chosen.length > 0 && /* @__PURE__ */ jsxs6("div", { className: "ds-pop-foot", children: [
2881
+ /* @__PURE__ */ jsx6("button", { type: "button", className: "ds-link", onClick: () => onChange([]), children: "Clear" }),
2882
+ /* @__PURE__ */ jsxs6("span", { children: [
2796
2883
  chosen.length,
2797
2884
  " selected"
2798
2885
  ] })
@@ -2821,8 +2908,8 @@ function Month({
2821
2908
  onMove,
2822
2909
  focusDate
2823
2910
  }) {
2824
- const grid = useRef2(null);
2825
- useEffect(() => {
2911
+ const grid = useRef3(null);
2912
+ useEffect2(() => {
2826
2913
  if (focusDate) grid.current?.querySelector(`[data-date="${focusDate}"]`)?.focus();
2827
2914
  }, [focusDate]);
2828
2915
  const fullDate = (d) => parse2(d).toLocaleDateString(locale, {
@@ -2852,16 +2939,16 @@ function Month({
2852
2939
  }),
2853
2940
  [locale]
2854
2941
  );
2855
- return /* @__PURE__ */ jsxs5("div", { className: "ds-cal-grid", ref: grid, role: "group", "aria-label": month, onKeyDown: onKey, children: [
2856
- weekdays.map((w) => /* @__PURE__ */ jsx7("span", { className: "ds-cal-wd", children: w.label }, w.key)),
2857
- lead > 0 && /* @__PURE__ */ jsx7("span", { style: { gridColumn: `span ${lead}` } }),
2942
+ return /* @__PURE__ */ jsxs6("div", { className: "ds-cal-grid", ref: grid, role: "group", "aria-label": month, onKeyDown: onKey, children: [
2943
+ weekdays.map((w) => /* @__PURE__ */ jsx6("span", { className: "ds-cal-wd", children: w.label }, w.key)),
2944
+ lead > 0 && /* @__PURE__ */ jsx6("span", { style: { gridColumn: `span ${lead}` } }),
2858
2945
  Array.from({ length: days }, (_, i) => {
2859
2946
  const d = `${month}-${String(i + 1).padStart(2, "0")}`;
2860
2947
  const off = min && d < min || max && d > max;
2861
2948
  const isStart = d === from;
2862
2949
  const isEnd = d === end;
2863
2950
  const inRange = from && end && d > from && d < end;
2864
- return /* @__PURE__ */ jsx7(
2951
+ return /* @__PURE__ */ jsx6(
2865
2952
  "button",
2866
2953
  {
2867
2954
  type: "button",
@@ -2899,17 +2986,17 @@ function DateRangeControl({
2899
2986
  const p = usePopover();
2900
2987
  const id = useId2();
2901
2988
  const short = (d) => parse2(d).toLocaleDateString(locale, { day: "numeric", month: "short", timeZone: "UTC" });
2902
- const [draft, setDraft] = useState({});
2903
- const [hover, setHover] = useState();
2904
- const [month, setMonth] = useState(() => (value.to ?? value.from ?? max ?? iso(/* @__PURE__ */ new Date())).slice(0, 7));
2905
- const [focusDate, setFocusDate] = useState();
2906
- useEffect(() => {
2989
+ const [draft, setDraft] = useState2({});
2990
+ const [hover, setHover] = useState2();
2991
+ const [month, setMonth] = useState2(() => (value.to ?? value.from ?? max ?? iso(/* @__PURE__ */ new Date())).slice(0, 7));
2992
+ const [focusDate, setFocusDate] = useState2();
2993
+ useEffect2(() => {
2907
2994
  if (p.open) {
2908
2995
  setDraft({ ...value.from ? { from: value.from } : {}, ...value.to ? { to: value.to } : {} });
2909
2996
  setMonth((value.to ?? value.from ?? max ?? iso(/* @__PURE__ */ new Date())).slice(0, 7));
2910
2997
  } else setFocusDate(void 0);
2911
2998
  }, [p.open, value.from, value.to, max]);
2912
- useEffect(() => {
2999
+ useEffect2(() => {
2913
3000
  if (!p.open) return;
2914
3001
  const f = p.floating.current;
2915
3002
  const target = f?.querySelector(".ds-cal-day[data-start]:not(:disabled)") ?? f?.querySelector(".ds-cal-day:not(:disabled)") ?? f?.querySelector("button:not(:disabled)");
@@ -2944,8 +3031,8 @@ function DateRangeControl({
2944
3031
  });
2945
3032
  const canPrev = !min || `${month}-01` > min;
2946
3033
  const canNext = !max || addDays2(iso(new Date(Date.UTC(Number(month.slice(0, 4)), Number(month.slice(5, 7)), 0))), 1) <= max;
2947
- return /* @__PURE__ */ jsxs5("div", { className: "ds-dd", ref: p.root, children: [
2948
- /* @__PURE__ */ jsxs5(
3034
+ return /* @__PURE__ */ jsxs6("div", { className: "ds-dd", ref: p.root, children: [
3035
+ /* @__PURE__ */ jsxs6(
2949
3036
  "button",
2950
3037
  {
2951
3038
  ref: p.trigger,
@@ -2956,22 +3043,22 @@ function DateRangeControl({
2956
3043
  "aria-controls": id,
2957
3044
  onClick: () => p.setOpen(!p.open),
2958
3045
  children: [
2959
- /* @__PURE__ */ jsx7(Calendar, {}),
2960
- /* @__PURE__ */ jsxs5("span", { children: [
3046
+ /* @__PURE__ */ jsx6(Calendar, {}),
3047
+ /* @__PURE__ */ jsxs6("span", { children: [
2961
3048
  label && !value.preset ? `${label} ` : "",
2962
3049
  name,
2963
3050
  " ",
2964
- range && /* @__PURE__ */ jsxs5("span", { className: "ds-pill-value", children: [
3051
+ range && /* @__PURE__ */ jsxs6("span", { className: "ds-pill-value", children: [
2965
3052
  "(",
2966
3053
  range,
2967
3054
  ")"
2968
3055
  ] })
2969
3056
  ] }),
2970
- /* @__PURE__ */ jsx7(Chevron, {})
3057
+ /* @__PURE__ */ jsx6(Chevron, {})
2971
3058
  ]
2972
3059
  }
2973
3060
  ),
2974
- p.open && /* @__PURE__ */ jsx7(
3061
+ p.open && /* @__PURE__ */ jsx6(
2975
3062
  Floating,
2976
3063
  {
2977
3064
  anchor: p.trigger,
@@ -2980,10 +3067,10 @@ function DateRangeControl({
2980
3067
  id,
2981
3068
  role: "dialog",
2982
3069
  label: label ?? "Choose dates",
2983
- children: /* @__PURE__ */ jsxs5("div", { className: "ds-range", children: [
2984
- presets.filter((x) => x !== "custom").length > 0 && /* @__PURE__ */ jsx7("div", { className: "ds-range-presets", children: presets.filter((x) => x !== "custom").map((x) => {
3070
+ children: /* @__PURE__ */ jsxs6("div", { className: "ds-range", children: [
3071
+ presets.filter((x) => x !== "custom").length > 0 && /* @__PURE__ */ jsx6("div", { className: "ds-range-presets", children: presets.filter((x) => x !== "custom").map((x) => {
2985
3072
  const r = presetRange2(x);
2986
- return /* @__PURE__ */ jsxs5(
3073
+ return /* @__PURE__ */ jsxs6(
2987
3074
  "button",
2988
3075
  {
2989
3076
  type: "button",
@@ -2994,16 +3081,16 @@ function DateRangeControl({
2994
3081
  p.setOpen(false);
2995
3082
  },
2996
3083
  children: [
2997
- /* @__PURE__ */ jsx7("span", { className: "ds-menu-label", children: presetLabel(x) }),
2998
- /* @__PURE__ */ jsx7("span", { className: "ds-menu-count", children: r.from === r.to ? short(r.from) : `${short(r.from)} \u2013 ${short(r.to)}` })
3084
+ /* @__PURE__ */ jsx6("span", { className: "ds-menu-label", children: presetLabel(x) }),
3085
+ /* @__PURE__ */ jsx6("span", { className: "ds-menu-count", children: r.from === r.to ? short(r.from) : `${short(r.from)} \u2013 ${short(r.to)}` })
2999
3086
  ]
3000
3087
  },
3001
3088
  x
3002
3089
  );
3003
3090
  }) }),
3004
- /* @__PURE__ */ jsxs5("div", { className: "ds-cal", children: [
3005
- /* @__PURE__ */ jsxs5("div", { className: "ds-cal-head", children: [
3006
- /* @__PURE__ */ jsx7(
3091
+ /* @__PURE__ */ jsxs6("div", { className: "ds-cal", children: [
3092
+ /* @__PURE__ */ jsxs6("div", { className: "ds-cal-head", children: [
3093
+ /* @__PURE__ */ jsx6(
3007
3094
  "button",
3008
3095
  {
3009
3096
  type: "button",
@@ -3011,11 +3098,11 @@ function DateRangeControl({
3011
3098
  "aria-label": "Previous month",
3012
3099
  disabled: !canPrev,
3013
3100
  onClick: () => shift(-1),
3014
- children: /* @__PURE__ */ jsx7(Arrow, { dir: "left" })
3101
+ children: /* @__PURE__ */ jsx6(Arrow, { dir: "left" })
3015
3102
  }
3016
3103
  ),
3017
- /* @__PURE__ */ jsx7("strong", { children: monthTitle }),
3018
- /* @__PURE__ */ jsx7(
3104
+ /* @__PURE__ */ jsx6("strong", { children: monthTitle }),
3105
+ /* @__PURE__ */ jsx6(
3019
3106
  "button",
3020
3107
  {
3021
3108
  type: "button",
@@ -3023,11 +3110,11 @@ function DateRangeControl({
3023
3110
  "aria-label": "Next month",
3024
3111
  disabled: !canNext,
3025
3112
  onClick: () => shift(1),
3026
- children: /* @__PURE__ */ jsx7(Arrow, { dir: "right" })
3113
+ children: /* @__PURE__ */ jsx6(Arrow, { dir: "right" })
3027
3114
  }
3028
3115
  )
3029
3116
  ] }),
3030
- /* @__PURE__ */ jsx7(
3117
+ /* @__PURE__ */ jsx6(
3031
3118
  Month,
3032
3119
  {
3033
3120
  month,
@@ -3043,9 +3130,9 @@ function DateRangeControl({
3043
3130
  focusDate
3044
3131
  }
3045
3132
  ),
3046
- !single && /* @__PURE__ */ jsxs5("div", { className: "ds-pop-foot", children: [
3047
- /* @__PURE__ */ jsx7("span", { className: tooLong ? "ds-cal-error" : void 0, children: tooLong ? `Pick a range of ${maxDays} days or less` : draft.from && draft.to ? `${short(draft.from)} \u2013 ${short(draft.to)} \xB7 ${daysBetween(draft.from, draft.to)} days` : draft.from ? "Now pick the end date" : "Pick the start date" }),
3048
- /* @__PURE__ */ jsx7(
3133
+ !single && /* @__PURE__ */ jsxs6("div", { className: "ds-pop-foot", children: [
3134
+ /* @__PURE__ */ jsx6("span", { className: tooLong ? "ds-cal-error" : void 0, children: tooLong ? `Pick a range of ${maxDays} days or less` : draft.from && draft.to ? `${short(draft.from)} \u2013 ${short(draft.to)} \xB7 ${daysBetween(draft.from, draft.to)} days` : draft.from ? "Now pick the end date" : "Pick the start date" }),
3135
+ /* @__PURE__ */ jsx6(
3049
3136
  "button",
3050
3137
  {
3051
3138
  type: "button",
@@ -3076,7 +3163,7 @@ function DateControl({
3076
3163
  locale,
3077
3164
  onChange
3078
3165
  }) {
3079
- const control = /* @__PURE__ */ jsx7(
3166
+ const control = /* @__PURE__ */ jsx6(
3080
3167
  DateRangeControl,
3081
3168
  {
3082
3169
  label,
@@ -3092,8 +3179,8 @@ function DateControl({
3092
3179
  }
3093
3180
  );
3094
3181
  if (!stepper) return control;
3095
- return /* @__PURE__ */ jsxs5("div", { className: "ds-stepper", role: "group", "aria-label": label, children: [
3096
- /* @__PURE__ */ jsx7(
3182
+ return /* @__PURE__ */ jsxs6("div", { className: "ds-stepper", role: "group", "aria-label": label, children: [
3183
+ /* @__PURE__ */ jsx6(
3097
3184
  "button",
3098
3185
  {
3099
3186
  type: "button",
@@ -3101,11 +3188,11 @@ function DateControl({
3101
3188
  "aria-label": "Previous day",
3102
3189
  disabled: Boolean(min && value <= min),
3103
3190
  onClick: () => onChange(addDays2(value, -1)),
3104
- children: /* @__PURE__ */ jsx7(Arrow, { dir: "left" })
3191
+ children: /* @__PURE__ */ jsx6(Arrow, { dir: "left" })
3105
3192
  }
3106
3193
  ),
3107
3194
  control,
3108
- /* @__PURE__ */ jsx7(
3195
+ /* @__PURE__ */ jsx6(
3109
3196
  "button",
3110
3197
  {
3111
3198
  type: "button",
@@ -3113,14 +3200,14 @@ function DateControl({
3113
3200
  "aria-label": "Next day",
3114
3201
  disabled: Boolean(max && value >= max),
3115
3202
  onClick: () => onChange(addDays2(value, 1)),
3116
- children: /* @__PURE__ */ jsx7(Arrow, { dir: "right" })
3203
+ children: /* @__PURE__ */ jsx6(Arrow, { dir: "right" })
3117
3204
  }
3118
3205
  )
3119
3206
  ] });
3120
3207
  }
3121
3208
 
3122
3209
  // src/components/FilterBar.tsx
3123
- import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
3210
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3124
3211
  var PRESET_LABELS = {
3125
3212
  today: "Today",
3126
3213
  yesterday: "Yesterday",
@@ -3191,10 +3278,10 @@ function ControlField({
3191
3278
  const r = v2 === "today" ? runtime.helpers.today() : interpolate(v2, rootScope(runtime.getTree(), runtime.helpers));
3192
3279
  return typeof r === "number" ? new Date(r).toISOString().slice(0, 10) : r || void 0;
3193
3280
  };
3194
- const [text2, setText] = useState2(typeof value === "string" ? value : "");
3195
- const timer = useRef3(void 0);
3196
- useEffect2(() => setText(typeof value === "string" ? value : ""), [value]);
3197
- useEffect2(() => () => clearTimeout(timer.current), []);
3281
+ const [text2, setText] = useState3(typeof value === "string" ? value : "");
3282
+ const timer = useRef4(void 0);
3283
+ useEffect3(() => setText(typeof value === "string" ? value : ""), [value]);
3284
+ useEffect3(() => () => clearTimeout(timer.current), []);
3198
3285
  const name = String(def.name);
3199
3286
  const own = designSystemControl(def, ui, {
3200
3287
  name,
@@ -3233,7 +3320,7 @@ function ControlField({
3233
3320
  "thisMonth",
3234
3321
  "custom"
3235
3322
  ];
3236
- return /* @__PURE__ */ jsx8(
3323
+ return /* @__PURE__ */ jsx7(
3237
3324
  DateRangeControl,
3238
3325
  {
3239
3326
  label,
@@ -3252,7 +3339,7 @@ function ControlField({
3252
3339
  );
3253
3340
  }
3254
3341
  case "Date":
3255
- return /* @__PURE__ */ jsx8(
3342
+ return /* @__PURE__ */ jsx7(
3256
3343
  DateControl,
3257
3344
  {
3258
3345
  label,
@@ -3265,7 +3352,7 @@ function ControlField({
3265
3352
  }
3266
3353
  );
3267
3354
  case "Select":
3268
- return /* @__PURE__ */ jsx8(
3355
+ return /* @__PURE__ */ jsx7(
3269
3356
  SelectControl,
3270
3357
  {
3271
3358
  label,
@@ -3276,14 +3363,14 @@ function ControlField({
3276
3363
  }
3277
3364
  );
3278
3365
  case "MultiSelect":
3279
- return /* @__PURE__ */ jsx8(MultiSelectControl, { label, options, value, onChange });
3366
+ return /* @__PURE__ */ jsx7(MultiSelectControl, { label, options, value, onChange });
3280
3367
  case "Chips": {
3281
3368
  const multi = Boolean(def.multiple);
3282
3369
  const chosen = multi ? Array.isArray(value) ? value : [] : [value];
3283
3370
  const toggle = (v2) => multi ? onChange(chosen.includes(v2) ? chosen.filter((x) => x !== v2) : [...chosen, v2]) : onChange(value === v2 ? null : v2);
3284
3371
  return (
3285
3372
  // biome-ignore lint/a11y/useSemanticElements: a chip group, not a form fieldset
3286
- /* @__PURE__ */ jsx8("div", { className: "ds-chips", role: "group", "aria-label": label ?? String(def.name), children: options.map((o, k) => /* @__PURE__ */ jsxs6(
3373
+ /* @__PURE__ */ jsx7("div", { className: "ds-chips", role: "group", "aria-label": label ?? String(def.name), children: options.map((o, k) => /* @__PURE__ */ jsxs7(
3287
3374
  "button",
3288
3375
  {
3289
3376
  type: "button",
@@ -3292,7 +3379,7 @@ function ControlField({
3292
3379
  onClick: () => toggle(o.value),
3293
3380
  children: [
3294
3381
  o.label,
3295
- o.count !== void 0 && /* @__PURE__ */ jsx8("span", { className: "ds-chip-count", children: o.count })
3382
+ o.count !== void 0 && /* @__PURE__ */ jsx7("span", { className: "ds-chip-count", children: o.count })
3296
3383
  ]
3297
3384
  },
3298
3385
  `${String(o.value)}-${k}`
@@ -3301,12 +3388,12 @@ function ControlField({
3301
3388
  }
3302
3389
  case "Search": {
3303
3390
  const wait = def.debounce ? parseDuration(def.debounce) : 300;
3304
- return /* @__PURE__ */ jsxs6("label", { className: "ds-search", children: [
3305
- /* @__PURE__ */ jsxs6("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: [
3306
- /* @__PURE__ */ jsx8("circle", { cx: "7", cy: "7", r: "4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }),
3307
- /* @__PURE__ */ jsx8("path", { d: "m10.5 10.5 3 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3391
+ return /* @__PURE__ */ jsxs7("label", { className: "ds-search", children: [
3392
+ /* @__PURE__ */ jsxs7("svg", { viewBox: "0 0 16 16", width: "15", height: "15", "aria-hidden": "true", children: [
3393
+ /* @__PURE__ */ jsx7("circle", { cx: "7", cy: "7", r: "4.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }),
3394
+ /* @__PURE__ */ jsx7("path", { d: "m10.5 10.5 3 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
3308
3395
  ] }),
3309
- /* @__PURE__ */ jsx8(
3396
+ /* @__PURE__ */ jsx7(
3310
3397
  "input",
3311
3398
  {
3312
3399
  type: "search",
@@ -3324,8 +3411,8 @@ function ControlField({
3324
3411
  ] });
3325
3412
  }
3326
3413
  case "Toggle":
3327
- return /* @__PURE__ */ jsxs6("label", { className: "ds-switch", children: [
3328
- /* @__PURE__ */ jsx8(
3414
+ return /* @__PURE__ */ jsxs7("label", { className: "ds-switch", children: [
3415
+ /* @__PURE__ */ jsx7(
3329
3416
  "input",
3330
3417
  {
3331
3418
  type: "checkbox",
@@ -3335,7 +3422,7 @@ function ControlField({
3335
3422
  onChange: (e) => onChange(e.target.checked)
3336
3423
  }
3337
3424
  ),
3338
- /* @__PURE__ */ jsx8("span", { "aria-hidden": "true" }),
3425
+ /* @__PURE__ */ jsx7("span", { "aria-hidden": "true" }),
3339
3426
  label ?? (compact ? "" : String(def.name))
3340
3427
  ] });
3341
3428
  default:
@@ -3346,9 +3433,9 @@ function designSystemControl(def, ui, c) {
3346
3433
  const base = { name: c.name, label: c.label };
3347
3434
  switch (def.kind) {
3348
3435
  case "Select":
3349
- return ui.Select ? /* @__PURE__ */ jsx8(ui.Select, { ...base, options: c.options, value: c.value, onChange: c.onChange, stepper: Boolean(def.stepper) }) : null;
3436
+ return ui.Select ? /* @__PURE__ */ jsx7(ui.Select, { ...base, options: c.options, value: c.value, onChange: c.onChange, stepper: Boolean(def.stepper) }) : null;
3350
3437
  case "MultiSelect":
3351
- return ui.MultiSelect ? /* @__PURE__ */ jsx8(
3438
+ return ui.MultiSelect ? /* @__PURE__ */ jsx7(
3352
3439
  ui.MultiSelect,
3353
3440
  {
3354
3441
  ...base,
@@ -3358,7 +3445,7 @@ function designSystemControl(def, ui, c) {
3358
3445
  }
3359
3446
  ) : null;
3360
3447
  case "Date":
3361
- return ui.Date ? /* @__PURE__ */ jsx8(
3448
+ return ui.Date ? /* @__PURE__ */ jsx7(
3362
3449
  ui.Date,
3363
3450
  {
3364
3451
  ...base,
@@ -3370,7 +3457,7 @@ function designSystemControl(def, ui, c) {
3370
3457
  }
3371
3458
  ) : null;
3372
3459
  case "DateRange":
3373
- return ui.DateRange ? /* @__PURE__ */ jsx8(
3460
+ return ui.DateRange ? /* @__PURE__ */ jsx7(
3374
3461
  ui.DateRange,
3375
3462
  {
3376
3463
  ...base,
@@ -3383,11 +3470,11 @@ function designSystemControl(def, ui, c) {
3383
3470
  }
3384
3471
  ) : null;
3385
3472
  case "Search":
3386
- return ui.Search ? /* @__PURE__ */ jsx8(ui.Search, { ...base, value: c.text, onChange: c.setText, placeholder: def.placeholder }) : null;
3473
+ return ui.Search ? /* @__PURE__ */ jsx7(ui.Search, { ...base, value: c.text, onChange: c.setText, placeholder: def.placeholder }) : null;
3387
3474
  case "Toggle":
3388
- return ui.Toggle ? /* @__PURE__ */ jsx8(ui.Toggle, { ...base, value: Boolean(c.value), onChange: c.onChange }) : null;
3475
+ return ui.Toggle ? /* @__PURE__ */ jsx7(ui.Toggle, { ...base, value: Boolean(c.value), onChange: c.onChange }) : null;
3389
3476
  case "Chips":
3390
- return ui.Chips ? /* @__PURE__ */ jsx8(
3477
+ return ui.Chips ? /* @__PURE__ */ jsx7(
3391
3478
  ui.Chips,
3392
3479
  {
3393
3480
  ...base,
@@ -3399,12 +3486,12 @@ function designSystemControl(def, ui, c) {
3399
3486
  ) : null;
3400
3487
  default: {
3401
3488
  const Own = ui.filters?.[String(def.kind)];
3402
- return Own ? /* @__PURE__ */ jsx8(Own, { ...base, value: c.value, onChange: c.onChange, config: def }) : null;
3489
+ return Own ? /* @__PURE__ */ jsx7(Own, { ...base, value: c.value, onChange: c.onChange, config: def }) : null;
3403
3490
  }
3404
3491
  }
3405
3492
  }
3406
3493
  var BAR = "__filterBar";
3407
- var icon = (d) => /* @__PURE__ */ jsx8(
3494
+ var icon = (d) => /* @__PURE__ */ jsx7(
3408
3495
  "svg",
3409
3496
  {
3410
3497
  viewBox: "0 0 20 20",
@@ -3420,23 +3507,23 @@ var icon = (d) => /* @__PURE__ */ jsx8(
3420
3507
  );
3421
3508
  var BAR_ICONS = {
3422
3509
  sliders: icon(
3423
- /* @__PURE__ */ jsxs6(Fragment4, { children: [
3424
- /* @__PURE__ */ jsx8("path", { d: "M3 6h9M15 6h2M3 14h3M9 14h8" }),
3425
- /* @__PURE__ */ jsx8("circle", { cx: "13.5", cy: "6", r: "1.8" }),
3426
- /* @__PURE__ */ jsx8("circle", { cx: "7.5", cy: "14", r: "1.8" })
3510
+ /* @__PURE__ */ jsxs7(Fragment4, { children: [
3511
+ /* @__PURE__ */ jsx7("path", { d: "M3 6h9M15 6h2M3 14h3M9 14h8" }),
3512
+ /* @__PURE__ */ jsx7("circle", { cx: "13.5", cy: "6", r: "1.8" }),
3513
+ /* @__PURE__ */ jsx7("circle", { cx: "7.5", cy: "14", r: "1.8" })
3427
3514
  ] })
3428
3515
  ),
3429
- filter: icon(/* @__PURE__ */ jsx8("path", { d: "M3 4h14l-5.5 6.5V16l-3-1.5v-4z", strokeLinejoin: "round" })),
3516
+ filter: icon(/* @__PURE__ */ jsx7("path", { d: "M3 4h14l-5.5 6.5V16l-3-1.5v-4z", strokeLinejoin: "round" })),
3430
3517
  calendar: icon(
3431
- /* @__PURE__ */ jsxs6(Fragment4, { children: [
3432
- /* @__PURE__ */ jsx8("rect", { x: "3", y: "4.5", width: "14", height: "12", rx: "2" }),
3433
- /* @__PURE__ */ jsx8("path", { d: "M3 8.5h14M7 2.5v4M13 2.5v4" })
3518
+ /* @__PURE__ */ jsxs7(Fragment4, { children: [
3519
+ /* @__PURE__ */ jsx7("rect", { x: "3", y: "4.5", width: "14", height: "12", rx: "2" }),
3520
+ /* @__PURE__ */ jsx7("path", { d: "M3 8.5h14M7 2.5v4M13 2.5v4" })
3434
3521
  ] })
3435
3522
  ),
3436
3523
  search: icon(
3437
- /* @__PURE__ */ jsxs6(Fragment4, { children: [
3438
- /* @__PURE__ */ jsx8("circle", { cx: "9", cy: "9", r: "5" }),
3439
- /* @__PURE__ */ jsx8("path", { d: "M13 13l4 4" })
3524
+ /* @__PURE__ */ jsxs7(Fragment4, { children: [
3525
+ /* @__PURE__ */ jsx7("circle", { cx: "9", cy: "9", r: "5" }),
3526
+ /* @__PURE__ */ jsx7("path", { d: "M13 13l4 4" })
3440
3527
  ] })
3441
3528
  )
3442
3529
  };
@@ -3457,7 +3544,7 @@ function FilterBar() {
3457
3544
  (a, b) => a.filters === b.filters && a.visible === b.visible && a.view === b.view
3458
3545
  );
3459
3546
  const visibleNames = new Set(state.visible.split("\0"));
3460
- const [draft, setDraft] = useState2(null);
3547
+ const [draft, setDraft] = useState3(null);
3461
3548
  const bar = runtime.doc.spec.display.filterBar ?? {};
3462
3549
  const applyMode = (v2) => v2.apply === "button" ? "button" : v2.apply === "immediate" ? "change" : bar.apply ?? "change";
3463
3550
  const needsApply = variables.some((v2) => applyMode(v2) === "button");
@@ -3486,7 +3573,7 @@ function FilterBar() {
3486
3573
  for (const l of layouts)
3487
3574
  if (l.view && !views.some((v2) => v2.name === l.view)) views.push({ name: l.view, label: l.label ?? l.view });
3488
3575
  const byName = new Map(variables.map((v2) => [v2.name, v2]));
3489
- return /* @__PURE__ */ jsx8(
3576
+ return /* @__PURE__ */ jsx7(
3490
3577
  Custom,
3491
3578
  {
3492
3579
  filters: shown.map((v2) => ({
@@ -3508,7 +3595,7 @@ function FilterBar() {
3508
3595
  setView: (view) => runtime.store.dispatch(stateActions.setView(view)),
3509
3596
  renderControl: (name) => {
3510
3597
  const def = byName.get(name);
3511
- return def ? /* @__PURE__ */ jsx8(
3598
+ return def ? /* @__PURE__ */ jsx7(
3512
3599
  ControlField,
3513
3600
  {
3514
3601
  compact: true,
@@ -3521,7 +3608,7 @@ function FilterBar() {
3521
3608
  }
3522
3609
  );
3523
3610
  }
3524
- const toolbar = /* @__PURE__ */ jsxs6(
3611
+ const toolbar = /* @__PURE__ */ jsxs7(
3525
3612
  "div",
3526
3613
  {
3527
3614
  className: "ds-filters",
@@ -3534,12 +3621,12 @@ function FilterBar() {
3534
3621
  if (!e.target.closest(".ds-filter-pick")) options.onFilterSelect?.(BAR);
3535
3622
  } : void 0,
3536
3623
  children: [
3537
- /* @__PURE__ */ jsxs6(Track, { segmented: bar.look === "segmented", children: [
3538
- bar.icon !== "none" && /* @__PURE__ */ jsx8("span", { className: "ds-filters-icon", "aria-hidden": "true", children: options.ui?.icons?.filterBar ?? BAR_ICONS[bar.icon ?? "sliders"] ?? BAR_ICONS.sliders }),
3624
+ /* @__PURE__ */ jsxs7(Track, { segmented: bar.look === "segmented", children: [
3625
+ bar.icon !== "none" && /* @__PURE__ */ jsx7("span", { className: "ds-filters-icon", "aria-hidden": "true", children: options.ui?.icons?.filterBar ?? BAR_ICONS[bar.icon ?? "sliders"] ?? BAR_ICONS.sliders }),
3539
3626
  shown.map(
3540
3627
  (v2) => options.onFilterSelect ? (
3541
3628
  // Builder: a click selects the filter to configure it instead of opening it.
3542
- /* @__PURE__ */ jsx8(
3629
+ /* @__PURE__ */ jsx7(
3543
3630
  "div",
3544
3631
  {
3545
3632
  className: "ds-filter-pick",
@@ -3549,12 +3636,12 @@ function FilterBar() {
3549
3636
  e.preventDefault();
3550
3637
  e.stopPropagation();
3551
3638
  },
3552
- children: /* @__PURE__ */ jsx8(ControlField, { compact: true, def: v2, value: values[v2.name], onChange: () => {
3639
+ children: /* @__PURE__ */ jsx7(ControlField, { compact: true, def: v2, value: values[v2.name], onChange: () => {
3553
3640
  } })
3554
3641
  },
3555
3642
  v2.name
3556
3643
  )
3557
- ) : /* @__PURE__ */ jsx8(
3644
+ ) : /* @__PURE__ */ jsx7(
3558
3645
  ControlField,
3559
3646
  {
3560
3647
  compact: true,
@@ -3566,8 +3653,8 @@ function FilterBar() {
3566
3653
  )
3567
3654
  )
3568
3655
  ] }),
3569
- (needsApply || bar.reset) && /* @__PURE__ */ jsx8("span", { className: "ds-filters-spacer" }),
3570
- bar.reset && /* @__PURE__ */ jsx8(
3656
+ (needsApply || bar.reset) && /* @__PURE__ */ jsx7("span", { className: "ds-filters-spacer" }),
3657
+ bar.reset && /* @__PURE__ */ jsx7(
3571
3658
  "button",
3572
3659
  {
3573
3660
  type: "button",
@@ -3581,7 +3668,7 @@ function FilterBar() {
3581
3668
  children: "Reset"
3582
3669
  }
3583
3670
  ),
3584
- needsApply && /* @__PURE__ */ jsx8(
3671
+ needsApply && /* @__PURE__ */ jsx7(
3585
3672
  "button",
3586
3673
  {
3587
3674
  type: "button",
@@ -3599,16 +3686,16 @@ function FilterBar() {
3599
3686
  }
3600
3687
  );
3601
3688
  if (runtime.doc.spec.display.filters === "drawer" && !options.onFilterSelect)
3602
- return /* @__PURE__ */ jsx8(FilterDrawer, { active: shown.filter(changed).length, children: toolbar });
3689
+ return /* @__PURE__ */ jsx7(FilterDrawer, { active: shown.filter(changed).length, children: toolbar });
3603
3690
  return toolbar;
3604
3691
  }
3605
3692
  var FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
3606
3693
  function FilterDrawer({ active, children }) {
3607
- const [open, setOpen] = useState2(false);
3608
- const button = useRef3(null);
3609
- const panel = useRef3(null);
3694
+ const [open, setOpen] = useState3(false);
3695
+ const button = useRef4(null);
3696
+ const panel = useRef4(null);
3610
3697
  const id = useId3();
3611
- useEffect2(() => {
3698
+ useEffect3(() => {
3612
3699
  if (!open) return;
3613
3700
  const first = panel.current?.querySelector(FOCUSABLE);
3614
3701
  (first ?? panel.current)?.focus();
@@ -3617,8 +3704,8 @@ function FilterDrawer({ active, children }) {
3617
3704
  setOpen(false);
3618
3705
  button.current?.focus();
3619
3706
  };
3620
- return /* @__PURE__ */ jsxs6("div", { className: "ds-filter-drawer", children: [
3621
- /* @__PURE__ */ jsxs6(
3707
+ return /* @__PURE__ */ jsxs7("div", { className: "ds-filter-drawer", children: [
3708
+ /* @__PURE__ */ jsxs7(
3622
3709
  "button",
3623
3710
  {
3624
3711
  ref: button,
@@ -3631,13 +3718,13 @@ function FilterDrawer({ active, children }) {
3631
3718
  onClick: () => open ? close() : setOpen(true),
3632
3719
  children: [
3633
3720
  BAR_ICONS.filter,
3634
- /* @__PURE__ */ jsx8("span", { children: "Filters" }),
3635
- active > 0 && /* @__PURE__ */ jsx8("span", { className: "ds-filters-count", "aria-hidden": "true", children: active })
3721
+ /* @__PURE__ */ jsx7("span", { children: "Filters" }),
3722
+ active > 0 && /* @__PURE__ */ jsx7("span", { className: "ds-filters-count", "aria-hidden": "true", children: active })
3636
3723
  ]
3637
3724
  }
3638
3725
  ),
3639
3726
  open && // A non-modal <dialog>: the rest of the dashboard stays usable while it is open.
3640
- /* @__PURE__ */ jsxs6(
3727
+ /* @__PURE__ */ jsxs7(
3641
3728
  "dialog",
3642
3729
  {
3643
3730
  open: true,
@@ -3653,9 +3740,9 @@ function FilterDrawer({ active, children }) {
3653
3740
  close();
3654
3741
  },
3655
3742
  children: [
3656
- /* @__PURE__ */ jsxs6("div", { className: "ds-filter-panel-head", children: [
3657
- /* @__PURE__ */ jsx8("span", { children: "Filters" }),
3658
- /* @__PURE__ */ jsx8("button", { type: "button", className: "ds-close", "aria-label": "Close filters", onClick: close, children: "\xD7" })
3743
+ /* @__PURE__ */ jsxs7("div", { className: "ds-filter-panel-head", children: [
3744
+ /* @__PURE__ */ jsx7("span", { children: "Filters" }),
3745
+ /* @__PURE__ */ jsx7("button", { type: "button", className: "ds-close", "aria-label": "Close filters", onClick: close, children: "\xD7" })
3659
3746
  ] }),
3660
3747
  children
3661
3748
  ]
@@ -3664,329 +3751,12 @@ function FilterDrawer({ active, children }) {
3664
3751
  ] });
3665
3752
  }
3666
3753
  function Track({ segmented, children }) {
3667
- return segmented ? /* @__PURE__ */ jsx8("div", { className: "ds-filters-track", children }) : /* @__PURE__ */ jsx8(Fragment4, { children });
3754
+ return segmented ? /* @__PURE__ */ jsx7("div", { className: "ds-filters-track", children }) : /* @__PURE__ */ jsx7(Fragment4, { children });
3668
3755
  }
3669
3756
 
3670
- // src/widgets/builtins/Filter.tsx
3671
- import { jsx as jsx9 } from "react/jsx-runtime";
3672
- var Filter = defineWidget({
3673
- ...FilterContract,
3674
- implements: "filter",
3675
- frame: "plain",
3676
- meta: { label: "Filter", icon: "filter", category: "Filters", size: { w: 12, h: 2, minW: 2, minH: 2 } },
3677
- events: [],
3678
- defaults: { variable: "" },
3679
- component: function FilterWidget({ spec, mode }) {
3680
- const { runtime } = useDashboard();
3681
- const def = (runtime.doc.spec.variables ?? []).find((v2) => v2.name === spec.variable);
3682
- const state = useTree(
3683
- useCallback3((t) => ({ value: t.filters[spec.variable], tree: t }), [spec.variable]),
3684
- (a, b) => a.value === b.value && a.tree.view === b.tree.view && a.tree.filters === b.tree.filters
3685
- );
3686
- if (!def)
3687
- return mode === "edit" ? /* @__PURE__ */ jsx9("div", { className: "ds-filter-missing", children: "Choose a filter in the right panel" }) : null;
3688
- if (typeof def.visibleWhen === "string" && !evaluateSafe(def.visibleWhen, rootScope(state.tree, runtime.helpers), true))
3689
- return null;
3690
- return /* @__PURE__ */ jsx9("div", { className: "ds-filter-widget", "data-fill": spec.fill || void 0, children: /* @__PURE__ */ jsx9(
3691
- ControlField,
3692
- {
3693
- compact: true,
3694
- def,
3695
- value: state.value,
3696
- onChange: (value) => runtime.store.dispatch(stateActions.setFilter({ name: spec.variable, value }))
3697
- }
3698
- ) });
3699
- }
3700
- });
3701
-
3702
- // src/widgets/wrap.tsx
3703
- import { Suspense, lazy } from "react";
3704
- import { z as z6 } from "zod";
3705
- import { jsx as jsx10 } from "react/jsx-runtime";
3706
- function wrapComponent(Component2, o) {
3707
- const schema = o.schema ?? z6.record(z6.unknown());
3708
- const eventNames = [...new Set(Object.values(o.events ?? {}))];
3709
- return defineWidget({
3710
- kind: o.kind,
3711
- version: o.version ?? 1,
3712
- meta: o.meta,
3713
- schema,
3714
- ...o.defaults ? { defaults: o.defaults } : {},
3715
- ...o.implements ? { implements: o.implements } : {},
3716
- ...o.exposes ? { exposes: o.exposes } : {},
3717
- ...o.frame ? { frame: o.frame } : {},
3718
- ...o.small ? { small: true } : {},
3719
- events: eventNames,
3720
- ...o.slots ? { slots: Object.fromEntries(Object.values(o.slots).map((s) => [s, { label: s }])) } : {},
3721
- component: function Wrapped(props) {
3722
- const mapped = o.mapProps ? o.mapProps(props) : { ...props.spec, data: props.data };
3723
- const handlers = {};
3724
- for (const [prop, event] of Object.entries(o.events ?? {}))
3725
- handlers[prop] = (value, ...rest) => props.emit(event, void 0, { value, args: [value, ...rest] });
3726
- for (const [prop, path] of Object.entries(o.writes ?? {})) {
3727
- const before = handlers[prop];
3728
- handlers[prop] = (value, ...rest) => {
3729
- props.store.set(path, value);
3730
- before?.(value, ...rest);
3731
- };
3732
- }
3733
- const slotProps = {};
3734
- for (const [prop, slot] of Object.entries(o.slots ?? {})) slotProps[prop] = props.renderSlot(slot);
3735
- return /* @__PURE__ */ jsx10(Component2, { ...mapped, ...handlers, ...slotProps });
3736
- }
3737
- });
3738
- }
3739
- function lazyWidget(def) {
3740
- const { load, fallback, ...rest } = def;
3741
- let Comp;
3742
- return defineWidget({
3743
- ...rest,
3744
- component: function LazyWidget(props) {
3745
- Comp ??= lazy(load);
3746
- return /* @__PURE__ */ jsx10(Suspense, { fallback: fallback ?? /* @__PURE__ */ jsx10("div", { className: "ds-skeleton", "aria-busy": "true" }), children: /* @__PURE__ */ jsx10(Comp, { ...props }) });
3747
- }
3748
- });
3749
- }
3750
-
3751
- // src/widgets/builtins/FlowMap.tsx
3752
- var FlowMap = lazyWidget({
3753
- ...FlowMapContract,
3754
- implements: "flow-map",
3755
- exposes: { selection: "the clicked step's row" },
3756
- meta: { label: "Flow map", icon: "flow", category: "Process", size: { w: 12, h: 12, minW: 6, minH: 6 } },
3757
- events: ["click", "hover", "hoverEnd"],
3758
- parts: ["step", "chip", "tag"],
3759
- load: () => import("./FlowMapView-BSTKU7D4.js").then((m) => ({ default: m.FlowMapView }))
3760
- });
3761
-
3762
- // src/widgets/builtins/Image.tsx
3763
- import "zod";
3764
- import { jsx as jsx11 } from "react/jsx-runtime";
3765
- var Image = defineWidget({
3766
- ...ImageContract,
3767
- implements: "image",
3768
- meta: { label: "Image", icon: "image", category: "Content", size: { w: 4, h: 6, minW: 2, minH: 2 } },
3769
- events: ["click"],
3770
- component: function ImageWidget({ spec, data, emit }) {
3771
- const src = safeImageSrc(spec.src ?? field(data, spec.srcField) ?? (typeof data === "string" ? data : void 0));
3772
- if (!src) return /* @__PURE__ */ jsx11("div", { className: "ds-state", children: "No image" });
3773
- return /* @__PURE__ */ jsx11(
3774
- "button",
3775
- {
3776
- type: "button",
3777
- className: "ds-plain",
3778
- onClick: () => emit("click", "image", { value: src }),
3779
- style: { width: "100%", height: "100%" },
3780
- children: /* @__PURE__ */ jsx11("img", { src, alt: spec.alt, style: { width: "100%", height: "100%", objectFit: spec.fit } })
3781
- }
3782
- );
3783
- }
3784
- });
3785
-
3786
- // src/widgets/builtins/ImageMap.tsx
3787
- import "zod";
3788
- import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
3789
- var ImageMap = defineWidget({
3790
- ...ImageMapContract,
3791
- implements: "image-map",
3792
- meta: { label: "Image map", icon: "map", category: "Content", size: { w: 8, h: 8, minW: 3, minH: 3 } },
3793
- events: ["click", "hover"],
3794
- parts: ["marker"],
3795
- component: function ImageMapWidget({ spec, data, emit, helpers }) {
3796
- const m = spec.markers;
3797
- const markers = Array.isArray(m) ? m.map((x) => ({ ...x, row: x })) : m ? asRows(data).map((r) => ({
3798
- x: Number(field(r, m.x)),
3799
- y: Number(field(r, m.y)),
3800
- label: m.label ? String(field(r, m.label) ?? "") : void 0,
3801
- value: m.value ? field(r, m.value) : void 0,
3802
- status: m.status ? String(field(r, m.status) ?? "") : void 0,
3803
- row: r
3804
- })) : [];
3805
- const src = safeImageSrc(spec.src);
3806
- return /* @__PURE__ */ jsxs7("div", { className: "ds-imagemap", children: [
3807
- src && /* @__PURE__ */ jsx12("img", { src, alt: spec.alt }),
3808
- markers.map((mk, i) => {
3809
- const t = mk.status ? spec.statusMap?.[mk.status] ?? mk.status : "info";
3810
- return /* @__PURE__ */ jsxs7(
3811
- "button",
3812
- {
3813
- type: "button",
3814
- className: "ds-marker",
3815
- style: {
3816
- left: `${mk.x}%`,
3817
- top: `${mk.y}%`,
3818
- background: tone(t).bg,
3819
- color: tone(t).fg,
3820
- borderColor: tone(t).border
3821
- },
3822
- onClick: () => emit("click", "marker", { datum: mk.row, value: mk.value, index: i }),
3823
- onMouseEnter: () => emit("hover", "marker", { datum: mk.row, value: mk.value, index: i }),
3824
- children: [
3825
- mk.label,
3826
- mk.value !== void 0 && /* @__PURE__ */ jsxs7("strong", { children: [
3827
- " ",
3828
- formatValue(mk.value, helpers, spec.format),
3829
- spec.unit ? ` ${spec.unit}` : ""
3830
- ] })
3831
- ]
3832
- },
3833
- `${mk.x}-${mk.y}-${i}`
3834
- );
3835
- })
3836
- ] });
3837
- }
3838
- });
3839
-
3840
- // src/widgets/builtins/Kpi.tsx
3841
- import "zod";
3842
-
3843
- // src/widgets/shared/InfoTip.tsx
3844
- import { useEffect as useEffect3, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState3 } from "react";
3845
- import { createPortal as createPortal2 } from "react-dom";
3846
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
3847
- function InfoTip({ text: text2 }) {
3848
- const ref = useRef4(null);
3849
- const tip = useRef4(null);
3850
- const [open, setOpen] = useState3(false);
3851
- const [mounted, setMounted] = useState3(false);
3852
- const closing = useRef4(void 0);
3853
- useEffect3(() => () => clearTimeout(closing.current), []);
3854
- const show = () => {
3855
- clearTimeout(closing.current);
3856
- setMounted(true);
3857
- setOpen(true);
3858
- };
3859
- const hide = () => {
3860
- setOpen(false);
3861
- clearTimeout(closing.current);
3862
- closing.current = setTimeout(() => {
3863
- setMounted(false);
3864
- setPos(null);
3865
- }, 160);
3866
- };
3867
- const [pos, setPos] = useState3(null);
3868
- useLayoutEffect2(() => {
3869
- if (!mounted || !ref.current || !tip.current) return;
3870
- const a = ref.current.getBoundingClientRect();
3871
- const t = tip.current.getBoundingClientRect();
3872
- const gap = 8;
3873
- const margin = 8;
3874
- const vw = window.innerWidth || document.documentElement.clientWidth;
3875
- const box = ref.current.closest(".ds-root")?.getBoundingClientRect();
3876
- const minX = Math.max(margin, (box?.left ?? 0) + margin);
3877
- const maxX = Math.min(vw, box?.right ?? vw) - margin;
3878
- const minY = Math.max(margin, (box?.top ?? 0) + margin);
3879
- const below = a.top - t.height - gap < minY;
3880
- const centre = a.left + a.width / 2;
3881
- const left = Math.min(Math.max(centre - t.width / 2, minX), Math.max(minX, maxX - t.width));
3882
- setPos({ left, top: below ? a.bottom + gap : a.top - t.height - gap, arrow: centre - left, below });
3883
- }, [mounted]);
3884
- const root = ref.current?.closest(".ds-root") ?? (typeof document !== "undefined" ? document.body : null);
3885
- return /* @__PURE__ */ jsxs8(
3886
- "button",
3887
- {
3888
- ref,
3889
- type: "button",
3890
- className: "ds-info",
3891
- "aria-label": text2,
3892
- onClick: (e) => e.stopPropagation(),
3893
- onMouseEnter: show,
3894
- onMouseLeave: hide,
3895
- onFocus: show,
3896
- onBlur: hide,
3897
- children: [
3898
- /* @__PURE__ */ jsxs8("svg", { viewBox: "0 0 16 16", width: "14", height: "14", "aria-hidden": "true", children: [
3899
- /* @__PURE__ */ jsx13("circle", { cx: "8", cy: "8", r: "6.5", fill: "none", stroke: "currentColor", strokeWidth: "1" }),
3900
- /* @__PURE__ */ jsx13("path", { d: "M8 7.2v3.6M8 5.2v.1", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })
3901
- ] }),
3902
- mounted && root && createPortal2(
3903
- /* @__PURE__ */ jsx13(
3904
- "span",
3905
- {
3906
- ref: tip,
3907
- className: "ds-tip",
3908
- role: "tooltip",
3909
- "data-below": pos?.below || void 0,
3910
- "data-open": open && pos ? "" : void 0,
3911
- style: {
3912
- left: pos?.left ?? 0,
3913
- top: pos?.top ?? 0,
3914
- visibility: pos ? "visible" : "hidden",
3915
- ["--ds-tip-arrow"]: `${pos?.arrow ?? 0}px`
3916
- },
3917
- children: text2
3918
- }
3919
- ),
3920
- root
3921
- )
3922
- ]
3923
- }
3924
- );
3925
- }
3926
-
3927
- // src/widgets/shared/clickable.ts
3928
- import { useContext as useContext5 } from "react";
3929
-
3930
- // src/components/PanelFrame.tsx
3931
- import { useCallback as useCallback4, useEffect as useEffect4, useId as useId4, useMemo as useMemo3, useRef as useRef5, useState as useState4 } from "react";
3932
-
3933
- // src/widgets/parseProps.ts
3934
- function without(value, path) {
3935
- if (path.length === 0 || value === null || typeof value !== "object") return value;
3936
- const [head, ...rest] = path;
3937
- if (Array.isArray(value)) {
3938
- if (typeof head !== "number" || head < 0 || head >= value.length) return value;
3939
- const copy2 = [...value];
3940
- if (rest.length === 0) copy2.splice(head, 1);
3941
- else copy2[head] = without(copy2[head], rest);
3942
- return copy2;
3943
- }
3944
- if (!Object.hasOwn(value, head)) return value;
3945
- const copy = { ...value };
3946
- if (rest.length === 0) delete copy[head];
3947
- else copy[head] = without(copy[head], rest);
3948
- return copy;
3949
- }
3950
- function parseWidgetProps(schema, props) {
3951
- let current = props;
3952
- const dropped = [];
3953
- for (let round = 0; round < 25; round++) {
3954
- const r = schema.safeParse(current);
3955
- if (r.success) return { props: r.data, dropped };
3956
- const issue = r.error.issues.find((i) => i.path.length > 0);
3957
- if (!issue) break;
3958
- const lastIndex = issue.path.reduce((at, k, i) => typeof k === "number" ? i : at, -1);
3959
- const path = lastIndex >= 0 ? issue.path.slice(0, lastIndex + 1) : issue.path;
3960
- const next = without(current, path);
3961
- if (next === current) break;
3962
- dropped.push(path.join("."));
3963
- current = next;
3964
- }
3965
- return { props, dropped };
3966
- }
3967
-
3968
- // src/components/Boundary.tsx
3969
- import { Component } from "react";
3970
- var sameKeys = (a, b) => a.length === b.length && a.every((x, i) => Object.is(x, b[i]));
3971
- var Boundary = class extends Component {
3972
- state = { error: null };
3973
- static getDerivedStateFromError(error) {
3974
- return { error };
3975
- }
3976
- componentDidCatch(error, _info) {
3977
- this.props.onError?.(error);
3978
- }
3979
- componentDidUpdate(prev) {
3980
- if (this.state.error && !sameKeys(prev.resetKeys ?? [], this.props.resetKeys ?? [])) this.setState({ error: null });
3981
- }
3982
- render() {
3983
- return this.state.error ? this.props.fallback(this.state.error) : this.props.children;
3984
- }
3985
- };
3986
-
3987
3757
  // src/components/Slot.tsx
3988
3758
  import { createContext as createContext3, useContext as useContext4 } from "react";
3989
- import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
3759
+ import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
3990
3760
  var NodeScopeContext = createContext3({});
3991
3761
  var useNodeScope = () => useContext4(NodeScopeContext);
3992
3762
  var SlotOwnerContext = createContext3(null);
@@ -4022,7 +3792,7 @@ function Slot({
4022
3792
  item: item !== void 0 ? item : outer.item,
4023
3793
  index: index !== void 0 ? index : outer.index
4024
3794
  };
4025
- return /* @__PURE__ */ jsx14(NodeScopeContext.Provider, { value: scope2, children: /* @__PURE__ */ jsxs9(
3795
+ return /* @__PURE__ */ jsx8(NodeScopeContext.Provider, { value: scope2, children: /* @__PURE__ */ jsxs8(
4026
3796
  "div",
4027
3797
  {
4028
3798
  className: className ? `ds-slot ${className}` : "ds-slot",
@@ -4031,21 +3801,21 @@ function Slot({
4031
3801
  "data-owner": owner.id,
4032
3802
  "data-empty": ids.length === 0 || void 0,
4033
3803
  children: [
4034
- ids.map((id) => /* @__PURE__ */ jsx14(SlotItem, { children: renderChild(id) }, id)),
4035
- ids.length === 0 && editing && (empty ?? /* @__PURE__ */ jsx14("span", { className: "ds-slot-hint", children: "Drop here" }))
3804
+ ids.map((id) => /* @__PURE__ */ jsx8(SlotItem, { children: renderChild(id) }, id)),
3805
+ ids.length === 0 && editing && (empty ?? /* @__PURE__ */ jsx8("span", { className: "ds-slot-hint", children: "Drop here" }))
4036
3806
  ]
4037
3807
  }
4038
3808
  ) });
4039
3809
  }
4040
- var SlotItem = ({ children }) => /* @__PURE__ */ jsx14(Fragment5, { children });
3810
+ var SlotItem = ({ children }) => /* @__PURE__ */ jsx8(Fragment5, { children });
4041
3811
 
4042
3812
  // src/components/PanelFrame.tsx
4043
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
3813
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
4044
3814
  var isEmpty = (d) => d === void 0 || d === null || Array.isArray(d) && d.length === 0 || typeof d === "object" && !Array.isArray(d) && Object.keys(d).length === 0;
4045
3815
  function useSize() {
4046
3816
  const [size2, setSize] = useState4({ width: 0, height: 0 });
4047
3817
  const observer = useRef5(null);
4048
- const ref = useCallback4((el) => {
3818
+ const ref = useCallback3((el) => {
4049
3819
  observer.current?.disconnect();
4050
3820
  observer.current = null;
4051
3821
  if (!el || typeof ResizeObserver === "undefined") return;
@@ -4172,7 +3942,7 @@ function widgetStore(runtime) {
4172
3942
  get,
4173
3943
  use: function useStoreValue(pathOrSelect) {
4174
3944
  return useTree(
4175
- useCallback4(
3945
+ useCallback3(
4176
3946
  (t) => typeof pathOrSelect === "string" ? getPath(t, pathOrSelect) : pathOrSelect(t),
4177
3947
  [pathOrSelect]
4178
3948
  ),
@@ -4207,7 +3977,7 @@ function useHiddenPanels(ids) {
4207
3977
  const key = ids.join(",");
4208
3978
  const list = useTree(
4209
3979
  // biome-ignore lint/correctness/useExhaustiveDependencies: ids are compared by key
4210
- useCallback4(
3980
+ useCallback3(
4211
3981
  (tree) => ids.filter((id) => {
4212
3982
  const def = findPanel(runtime.doc, id);
4213
3983
  if (!def) return false;
@@ -4252,7 +4022,7 @@ function dropIndexAt(panel, x, y) {
4252
4022
  return { slot: box.getAttribute("data-slot") ?? void 0, index: indexIn(box, x, y) };
4253
4023
  }
4254
4024
  function PanelFrame({ id, nested = false }) {
4255
- return /* @__PURE__ */ jsx15(Boundary, { resetKeys: [id], fallback: (e) => /* @__PURE__ */ jsx15(PanelCrash, { id, error: e }), children: /* @__PURE__ */ jsx15(PanelFrameInner, { id, nested }) });
4025
+ return /* @__PURE__ */ jsx9(Boundary, { resetKeys: [id], fallback: (e) => /* @__PURE__ */ jsx9(PanelCrash, { id, error: e }), children: /* @__PURE__ */ jsx9(PanelFrameInner, { id, nested }) });
4256
4026
  }
4257
4027
  function PanelCrash({ id, error }) {
4258
4028
  const { options } = useDashboard();
@@ -4262,7 +4032,7 @@ function PanelCrash({ id, error }) {
4262
4032
  } catch {
4263
4033
  custom = void 0;
4264
4034
  }
4265
- return /* @__PURE__ */ jsx15("section", { className: "ds-panel", "data-panel": id, "aria-label": id, children: /* @__PURE__ */ jsx15("div", { className: "ds-panel-body", children: custom ?? /* @__PURE__ */ jsxs10("div", { className: "ds-state ds-state-error", role: "alert", children: [
4035
+ return /* @__PURE__ */ jsx9("section", { className: "ds-panel", "data-panel": id, "aria-label": id, children: /* @__PURE__ */ jsx9("div", { className: "ds-panel-body", children: custom ?? /* @__PURE__ */ jsxs9("div", { className: "ds-state ds-state-error", role: "alert", children: [
4266
4036
  "This panel could not be shown: ",
4267
4037
  error.message
4268
4038
  ] }) }) });
@@ -4278,7 +4048,7 @@ function PanelFrameInner({ id, nested }) {
4278
4048
  const drillLevels = def.drill?.levels ?? [];
4279
4049
  const view = useTree(
4280
4050
  // biome-ignore lint/correctness/useExhaustiveDependencies: the panel definition is fixed for a runtime
4281
- useCallback4(
4051
+ useCallback3(
4282
4052
  (tree) => {
4283
4053
  const ps = tree.panels[id] ?? {};
4284
4054
  const level = drillLevels[(ps.drill ?? []).length];
@@ -4349,7 +4119,7 @@ function PanelFrameInner({ id, nested }) {
4349
4119
  ),
4350
4120
  samePanelView
4351
4121
  );
4352
- const renderNested = useCallback4((child) => /* @__PURE__ */ jsx15(PanelFrame, { id: child, nested: true }, child), []);
4122
+ const renderNested = useCallback3((child) => /* @__PURE__ */ jsx9(PanelFrame, { id: child, nested: true }, child), []);
4353
4123
  const store = useMemo3(() => widgetStore(runtime), [runtime]);
4354
4124
  const [bodyRef, size2] = useSize();
4355
4125
  const frameRef = useRef5(null);
@@ -4382,7 +4152,7 @@ function PanelFrameInner({ id, nested }) {
4382
4152
  visibility.set(instance, null);
4383
4153
  };
4384
4154
  }, [instance, view.visible, view.hidden, wanted, visibility]);
4385
- const emit = useCallback4(
4155
+ const emit = useCallback3(
4386
4156
  (type, part, detail) => {
4387
4157
  const event = { type, panel: id, ...part ? { part } : {}, ...detail };
4388
4158
  options.onEvent?.(event);
@@ -4390,11 +4160,11 @@ function PanelFrameInner({ id, nested }) {
4390
4160
  },
4391
4161
  [id, options, runtime]
4392
4162
  );
4393
- const run = useCallback4(
4163
+ const run = useCallback3(
4394
4164
  (action, detail) => void runtime.runAction(action, { type: "click", panel: id, ...detail }),
4395
4165
  [runtime, id]
4396
4166
  );
4397
- const setUi = useCallback4(
4167
+ const setUi = useCallback3(
4398
4168
  (patch) => runtime.store.dispatch(
4399
4169
  stateActions.patchPanel({ id, patch: { ui: { ...runtime.getTree().panels[id]?.ui, ...patch } } })
4400
4170
  ),
@@ -4434,28 +4204,28 @@ function PanelFrameInner({ id, nested }) {
4434
4204
  const hideHeader = Boolean(def.style?.hideHeader) || !title && !subtitle && !meta2 && !live2 && drill.length === 0 && controls.length === 0 && !view.stale && headerKids.length === 0;
4435
4205
  const dnd = Boolean(options.onDropOnPanel);
4436
4206
  let body;
4437
- if (!widget) body = /* @__PURE__ */ jsxs10("div", { className: "ds-state", children: [
4207
+ if (!widget) body = /* @__PURE__ */ jsxs9("div", { className: "ds-state", children: [
4438
4208
  "Unknown widget \u201C",
4439
4209
  String(def.kind),
4440
4210
  "\u201D"
4441
4211
  ] });
4442
4212
  else if (view.error && view.data === void 0)
4443
- body = options.renderError?.(view.error, id) ?? /* @__PURE__ */ jsx15("div", { className: "ds-state ds-state-error", role: "alert", children: view.messages?.error ?? view.error.message });
4213
+ body = options.renderError?.(view.error, id) ?? /* @__PURE__ */ jsx9("div", { className: "ds-state ds-state-error", role: "alert", children: view.messages?.error ?? view.error.message });
4444
4214
  else if (view.source && view.data === void 0 && (view.status === "loading" || view.status === "idle"))
4445
- body = options.renderLoading?.(id, loadingText(view.messages)) ?? /* @__PURE__ */ jsx15(LoadingState, { text: loadingText(view.messages) });
4215
+ body = options.renderLoading?.(id, loadingText(view.messages)) ?? /* @__PURE__ */ jsx9(LoadingState, { text: loadingText(view.messages) });
4446
4216
  else if (view.source && isEmpty(view.data) && widget.empty !== "widget")
4447
- body = options.renderEmpty?.(id) ?? /* @__PURE__ */ jsx15("div", { className: "ds-state", children: view.messages?.empty ?? "No data" });
4217
+ body = options.renderEmpty?.(id) ?? /* @__PURE__ */ jsx9("div", { className: "ds-state", children: view.messages?.empty ?? "No data" });
4448
4218
  else {
4449
4219
  const W = widget.component;
4450
- body = /* @__PURE__ */ jsx15(
4220
+ body = /* @__PURE__ */ jsx9(
4451
4221
  Boundary,
4452
4222
  {
4453
4223
  resetKeys: [view.data, props],
4454
- fallback: (e) => /* @__PURE__ */ jsxs10("div", { className: "ds-state ds-state-error", role: "alert", children: [
4224
+ fallback: (e) => /* @__PURE__ */ jsxs9("div", { className: "ds-state ds-state-error", role: "alert", children: [
4455
4225
  "This panel could not be shown: ",
4456
4226
  e.message
4457
4227
  ] }),
4458
- children: /* @__PURE__ */ jsx15(
4228
+ children: /* @__PURE__ */ jsx9(
4459
4229
  W,
4460
4230
  {
4461
4231
  spec: props,
@@ -4471,7 +4241,7 @@ function PanelFrameInner({ id, nested }) {
4471
4241
  mode: options.mode,
4472
4242
  helpers: runtime.helpers,
4473
4243
  panelId: id,
4474
- renderSlot: (name, o) => /* @__PURE__ */ jsx15(Slot, { name, ...o }),
4244
+ renderSlot: (name, o) => /* @__PURE__ */ jsx9(Slot, { name, ...o }),
4475
4245
  store
4476
4246
  }
4477
4247
  )
@@ -4488,7 +4258,7 @@ function PanelFrameInner({ id, nested }) {
4488
4258
  const name = el?.getAttribute("data-slot") ?? defaultSlot;
4489
4259
  return { slot: name, index: el ? indexIn(el, x, y) : void 0 };
4490
4260
  };
4491
- return /* @__PURE__ */ jsx15(SlotOwnerContext.Provider, { value: { id, data: view.data, def }, children: /* @__PURE__ */ jsx15(SlotChildContext.Provider, { value: renderNested, children: /* @__PURE__ */ jsxs10(
4261
+ return /* @__PURE__ */ jsx9(SlotOwnerContext.Provider, { value: { id, data: view.data, def }, children: /* @__PURE__ */ jsx9(SlotChildContext.Provider, { value: renderNested, children: /* @__PURE__ */ jsxs9(
4492
4262
  "section",
4493
4263
  {
4494
4264
  ref: frameRef,
@@ -4537,19 +4307,19 @@ function PanelFrameInner({ id, nested }) {
4537
4307
  e.stopPropagation();
4538
4308
  } : void 0,
4539
4309
  children: [
4540
- !hideHeader && /* @__PURE__ */ jsxs10("header", { className: "ds-panel-head", children: [
4541
- /* @__PURE__ */ jsxs10("div", { style: { minWidth: 0 }, children: [
4542
- title && /* @__PURE__ */ jsxs10("h3", { className: "ds-panel-title", children: [
4310
+ !hideHeader && /* @__PURE__ */ jsxs9("header", { className: "ds-panel-head", children: [
4311
+ /* @__PURE__ */ jsxs9("div", { style: { minWidth: 0 }, children: [
4312
+ title && /* @__PURE__ */ jsxs9("h3", { className: "ds-panel-title", children: [
4543
4313
  title,
4544
- info && /* @__PURE__ */ jsx15(InfoTip, { text: info })
4314
+ info && /* @__PURE__ */ jsx9(InfoTip, { text: info })
4545
4315
  ] }),
4546
- subtitle && /* @__PURE__ */ jsx15("p", { className: "ds-panel-subtitle", children: subtitle }),
4547
- drill.length > 0 && /* @__PURE__ */ jsxs10("nav", { className: "ds-crumbs", "aria-label": "Drill path", children: [
4548
- /* @__PURE__ */ jsx15("button", { type: "button", onClick: () => runtime.runAction({ do: "drillReset", panel: id }), children: "All" }),
4549
- drill.map((d, i) => /* @__PURE__ */ jsxs10("span", { children: [
4316
+ subtitle && /* @__PURE__ */ jsx9("p", { className: "ds-panel-subtitle", children: subtitle }),
4317
+ drill.length > 0 && /* @__PURE__ */ jsxs9("nav", { className: "ds-crumbs", "aria-label": "Drill path", children: [
4318
+ /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => runtime.runAction({ do: "drillReset", panel: id }), children: "All" }),
4319
+ drill.map((d, i) => /* @__PURE__ */ jsxs9("span", { children: [
4550
4320
  "\u203A",
4551
4321
  " ",
4552
- i < drill.length - 1 ? /* @__PURE__ */ jsx15(
4322
+ i < drill.length - 1 ? /* @__PURE__ */ jsx9(
4553
4323
  "button",
4554
4324
  {
4555
4325
  type: "button",
@@ -4562,14 +4332,14 @@ function PanelFrameInner({ id, nested }) {
4562
4332
  ] }, `${d.level}-${i}`))
4563
4333
  ] })
4564
4334
  ] }),
4565
- /* @__PURE__ */ jsxs10("div", { className: "ds-panel-tools", children: [
4566
- headerKids.length > 0 && /* @__PURE__ */ jsx15(Slot, { name: "header", className: "ds-panel-addons" }),
4567
- meta2 && /* @__PURE__ */ jsx15("span", { className: "ds-panel-meta", children: meta2 }),
4568
- live2 ? /* @__PURE__ */ jsxs10("span", { className: "ds-live", "data-stale": view.stale || void 0, title: view.error?.message, children: [
4569
- /* @__PURE__ */ jsx15("span", { "aria-hidden": "true" }),
4335
+ /* @__PURE__ */ jsxs9("div", { className: "ds-panel-tools", children: [
4336
+ headerKids.length > 0 && /* @__PURE__ */ jsx9(Slot, { name: "header", className: "ds-panel-addons" }),
4337
+ meta2 && /* @__PURE__ */ jsx9("span", { className: "ds-panel-meta", children: meta2 }),
4338
+ live2 ? /* @__PURE__ */ jsxs9("span", { className: "ds-live", "data-stale": view.stale || void 0, title: view.error?.message, children: [
4339
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true" }),
4570
4340
  liveLabel(props.liveText, view.updatedAt, runtime.helpers)
4571
- ] }) : view.stale && /* @__PURE__ */ jsx15("span", { className: "ds-badge ds-badge-stale", title: view.error?.message, children: "Stale" }),
4572
- controls.map((c) => /* @__PURE__ */ jsx15(
4341
+ ] }) : view.stale && /* @__PURE__ */ jsx9("span", { className: "ds-badge ds-badge-stale", title: view.error?.message, children: "Stale" }),
4342
+ controls.map((c) => /* @__PURE__ */ jsx9(
4573
4343
  ControlField,
4574
4344
  {
4575
4345
  def: c,
@@ -4586,9 +4356,9 @@ function PanelFrameInner({ id, nested }) {
4586
4356
  ))
4587
4357
  ] })
4588
4358
  ] }),
4589
- toolbarKids.length > 0 && /* @__PURE__ */ jsx15(Slot, { name: "toolbar", className: "ds-panel-toolbar" }),
4590
- /* @__PURE__ */ jsx15("div", { className: "ds-panel-body", ref: bodyRef, children: body }),
4591
- footerKids.length > 0 && /* @__PURE__ */ jsx15(Slot, { name: "footer", className: "ds-panel-foot" })
4359
+ toolbarKids.length > 0 && /* @__PURE__ */ jsx9(Slot, { name: "toolbar", className: "ds-panel-toolbar" }),
4360
+ /* @__PURE__ */ jsx9("div", { className: "ds-panel-body", ref: bodyRef, children: body }),
4361
+ footerKids.length > 0 && /* @__PURE__ */ jsx9(Slot, { name: "footer", className: "ds-panel-foot" })
4592
4362
  ]
4593
4363
  }
4594
4364
  ) }) });
@@ -4598,10 +4368,10 @@ function loadingText(messages) {
4598
4368
  return v2 === void 0 || v2 === null || v2 === "" ? void 0 : String(v2);
4599
4369
  }
4600
4370
  function LoadingState({ text: text2 }) {
4601
- if (!text2) return /* @__PURE__ */ jsx15("div", { className: "ds-skeleton", "aria-busy": "true", "aria-label": "Loading" });
4602
- return /* @__PURE__ */ jsxs10("output", { className: "ds-loading", "aria-busy": "true", children: [
4603
- /* @__PURE__ */ jsx15("div", { className: "ds-skeleton", "aria-hidden": "true" }),
4604
- /* @__PURE__ */ jsx15("span", { className: "ds-loading-text", children: text2 })
4371
+ if (!text2) return /* @__PURE__ */ jsx9("div", { className: "ds-skeleton", "aria-busy": "true", "aria-label": "Loading" });
4372
+ return /* @__PURE__ */ jsxs9("output", { className: "ds-loading", "aria-busy": "true", children: [
4373
+ /* @__PURE__ */ jsx9("div", { className: "ds-skeleton", "aria-hidden": "true" }),
4374
+ /* @__PURE__ */ jsx9("span", { className: "ds-loading-text", children: text2 })
4605
4375
  ] });
4606
4376
  }
4607
4377
 
@@ -4623,6 +4393,237 @@ function useClickable(panelId, activate) {
4623
4393
  };
4624
4394
  }
4625
4395
 
4396
+ // src/widgets/builtins/Container.tsx
4397
+ import { jsx as jsx10 } from "react/jsx-runtime";
4398
+ var JUSTIFY = {
4399
+ start: "flex-start",
4400
+ center: "center",
4401
+ end: "flex-end",
4402
+ between: "space-between",
4403
+ around: "space-around",
4404
+ evenly: "space-evenly"
4405
+ };
4406
+ var ALIGN = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" };
4407
+ var Container = defineWidget({
4408
+ ...ContainerContract,
4409
+ implements: "layout",
4410
+ frame: "plain",
4411
+ meta: { label: "Container", icon: "container", category: "Layout", size: { w: 12, h: 5, minW: 2, minH: 2 } },
4412
+ events: ["click"],
4413
+ defaults: { direction: "row", wrap: true, gap: 12 },
4414
+ component: function ContainerWidget({ spec, renderSlot, emit, panelId }) {
4415
+ const click = useClickable(panelId, () => emit("click", void 0, {}));
4416
+ const style = {
4417
+ display: "flex",
4418
+ flexDirection: spec.direction,
4419
+ flexWrap: spec.wrap ? "wrap" : "nowrap",
4420
+ gap: spec.gap,
4421
+ justifyContent: JUSTIFY[spec.justify],
4422
+ alignItems: ALIGN[spec.align],
4423
+ // An equal split is across a row; in a column, children keep their own height.
4424
+ ["--ds-child-flex"]: spec.equal && spec.direction === "row" ? `1 1 ${spec.childMinWidth}px` : "0 0 auto",
4425
+ ["--ds-child-min"]: `${spec.direction === "row" ? spec.childMinWidth : 0}px`,
4426
+ overflow: spec.scroll ? "auto" : "visible"
4427
+ };
4428
+ const items = renderSlot("items", {
4429
+ className: "ds-container",
4430
+ style,
4431
+ empty: /* @__PURE__ */ jsx10("span", { className: "ds-slot-hint", children: "Drop widgets here" })
4432
+ });
4433
+ if (click.role !== "button") return items;
4434
+ return /* @__PURE__ */ jsx10("div", { className: "ds-container-click", ...click, children: items });
4435
+ }
4436
+ });
4437
+
4438
+ // src/widgets/builtins/Content.tsx
4439
+ import "zod";
4440
+ import { jsx as jsx11 } from "react/jsx-runtime";
4441
+ var Content = defineWidget({
4442
+ ...ContentContract,
4443
+ implements: "text",
4444
+ meta: { label: "Rich text", icon: "text", category: "Content", size: { w: 4, h: 3, minW: 2, minH: 1 } },
4445
+ events: ["click"],
4446
+ defaults: { markdown: "Write **Markdown** here." },
4447
+ component: function ContentWidget({ spec, run }) {
4448
+ return /* @__PURE__ */ jsx11("div", { className: "ds-content", style: { textAlign: spec.align }, children: /* @__PURE__ */ jsx11(Markdown, { text: spec.markdown, onAction: (name) => run(name) }) });
4449
+ }
4450
+ });
4451
+
4452
+ // src/widgets/builtins/Filter.tsx
4453
+ import { useCallback as useCallback4 } from "react";
4454
+ import "zod";
4455
+ import { jsx as jsx12 } from "react/jsx-runtime";
4456
+ var Filter = defineWidget({
4457
+ ...FilterContract,
4458
+ implements: "filter",
4459
+ frame: "plain",
4460
+ meta: { label: "Filter", icon: "filter", category: "Filters", size: { w: 12, h: 2, minW: 2, minH: 2 } },
4461
+ events: [],
4462
+ defaults: { variable: "" },
4463
+ component: function FilterWidget({ spec, mode }) {
4464
+ const { runtime } = useDashboard();
4465
+ const def = (runtime.doc.spec.variables ?? []).find((v2) => v2.name === spec.variable);
4466
+ const state = useTree(
4467
+ useCallback4((t) => ({ value: t.filters[spec.variable], tree: t }), [spec.variable]),
4468
+ (a, b) => a.value === b.value && a.tree.view === b.tree.view && a.tree.filters === b.tree.filters
4469
+ );
4470
+ if (!def)
4471
+ return mode === "edit" ? /* @__PURE__ */ jsx12("div", { className: "ds-filter-missing", children: "Choose a filter in the right panel" }) : null;
4472
+ if (typeof def.visibleWhen === "string" && !evaluateSafe(def.visibleWhen, rootScope(state.tree, runtime.helpers), true))
4473
+ return null;
4474
+ return /* @__PURE__ */ jsx12("div", { className: "ds-filter-widget", "data-fill": spec.fill || void 0, children: /* @__PURE__ */ jsx12(
4475
+ ControlField,
4476
+ {
4477
+ compact: true,
4478
+ def,
4479
+ value: state.value,
4480
+ onChange: (value) => runtime.store.dispatch(stateActions.setFilter({ name: spec.variable, value }))
4481
+ }
4482
+ ) });
4483
+ }
4484
+ });
4485
+
4486
+ // src/widgets/wrap.tsx
4487
+ import { Suspense, lazy } from "react";
4488
+ import { z as z6 } from "zod";
4489
+ import { jsx as jsx13 } from "react/jsx-runtime";
4490
+ function wrapComponent(Component2, o) {
4491
+ const schema = o.schema ?? z6.record(z6.unknown());
4492
+ const eventNames = [...new Set(Object.values(o.events ?? {}))];
4493
+ return defineWidget({
4494
+ kind: o.kind,
4495
+ version: o.version ?? 1,
4496
+ meta: o.meta,
4497
+ schema,
4498
+ ...o.defaults ? { defaults: o.defaults } : {},
4499
+ ...o.implements ? { implements: o.implements } : {},
4500
+ ...o.exposes ? { exposes: o.exposes } : {},
4501
+ ...o.frame ? { frame: o.frame } : {},
4502
+ ...o.small ? { small: true } : {},
4503
+ events: eventNames,
4504
+ ...o.slots ? { slots: Object.fromEntries(Object.values(o.slots).map((s) => [s, { label: s }])) } : {},
4505
+ component: function Wrapped(props) {
4506
+ const mapped = o.mapProps ? o.mapProps(props) : { ...props.spec, data: props.data };
4507
+ const handlers = {};
4508
+ for (const [prop, event] of Object.entries(o.events ?? {}))
4509
+ handlers[prop] = (value, ...rest) => props.emit(event, void 0, { value, args: [value, ...rest] });
4510
+ for (const [prop, path] of Object.entries(o.writes ?? {})) {
4511
+ const before = handlers[prop];
4512
+ handlers[prop] = (value, ...rest) => {
4513
+ props.store.set(path, value);
4514
+ before?.(value, ...rest);
4515
+ };
4516
+ }
4517
+ const slotProps = {};
4518
+ for (const [prop, slot] of Object.entries(o.slots ?? {})) slotProps[prop] = props.renderSlot(slot);
4519
+ return /* @__PURE__ */ jsx13(Component2, { ...mapped, ...handlers, ...slotProps });
4520
+ }
4521
+ });
4522
+ }
4523
+ function lazyWidget(def) {
4524
+ const { load, fallback, ...rest } = def;
4525
+ let Comp;
4526
+ return defineWidget({
4527
+ ...rest,
4528
+ component: function LazyWidget(props) {
4529
+ Comp ??= lazy(load);
4530
+ return /* @__PURE__ */ jsx13(Suspense, { fallback: fallback ?? /* @__PURE__ */ jsx13("div", { className: "ds-skeleton", "aria-busy": "true" }), children: /* @__PURE__ */ jsx13(Comp, { ...props }) });
4531
+ }
4532
+ });
4533
+ }
4534
+
4535
+ // src/widgets/builtins/FlowMap.tsx
4536
+ var FlowMap = lazyWidget({
4537
+ ...FlowMapContract,
4538
+ implements: "flow-map",
4539
+ exposes: { selection: "the clicked step's row" },
4540
+ meta: { label: "Flow map", icon: "flow", category: "Process", size: { w: 12, h: 12, minW: 6, minH: 6 } },
4541
+ events: ["click", "hover", "hoverEnd"],
4542
+ parts: ["step", "chip", "tag"],
4543
+ load: () => import("./FlowMapView-7ROMAXSY.js").then((m) => ({ default: m.FlowMapView }))
4544
+ });
4545
+
4546
+ // src/widgets/builtins/Image.tsx
4547
+ import "zod";
4548
+ import { jsx as jsx14 } from "react/jsx-runtime";
4549
+ var Image = defineWidget({
4550
+ ...ImageContract,
4551
+ implements: "image",
4552
+ meta: { label: "Image", icon: "image", category: "Content", size: { w: 4, h: 6, minW: 2, minH: 2 } },
4553
+ events: ["click"],
4554
+ component: function ImageWidget({ spec, data, emit }) {
4555
+ const src = safeImageSrc(spec.src ?? field(data, spec.srcField) ?? (typeof data === "string" ? data : void 0));
4556
+ if (!src) return /* @__PURE__ */ jsx14("div", { className: "ds-state", children: "No image" });
4557
+ return /* @__PURE__ */ jsx14(
4558
+ "button",
4559
+ {
4560
+ type: "button",
4561
+ className: "ds-plain",
4562
+ onClick: () => emit("click", "image", { value: src }),
4563
+ style: { width: "100%", height: "100%" },
4564
+ children: /* @__PURE__ */ jsx14("img", { src, alt: spec.alt, style: { width: "100%", height: "100%", objectFit: spec.fit } })
4565
+ }
4566
+ );
4567
+ }
4568
+ });
4569
+
4570
+ // src/widgets/builtins/ImageMap.tsx
4571
+ import "zod";
4572
+ import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
4573
+ var ImageMap = defineWidget({
4574
+ ...ImageMapContract,
4575
+ implements: "image-map",
4576
+ meta: { label: "Image map", icon: "map", category: "Content", size: { w: 8, h: 8, minW: 3, minH: 3 } },
4577
+ events: ["click", "hover"],
4578
+ parts: ["marker"],
4579
+ component: function ImageMapWidget({ spec, data, emit, helpers }) {
4580
+ const m = spec.markers;
4581
+ const markers = Array.isArray(m) ? m.map((x) => ({ ...x, row: x })) : m ? asRows(data).map((r) => ({
4582
+ x: Number(field(r, m.x)),
4583
+ y: Number(field(r, m.y)),
4584
+ label: m.label ? String(field(r, m.label) ?? "") : void 0,
4585
+ value: m.value ? field(r, m.value) : void 0,
4586
+ status: m.status ? String(field(r, m.status) ?? "") : void 0,
4587
+ row: r
4588
+ })) : [];
4589
+ const src = safeImageSrc(spec.src);
4590
+ return /* @__PURE__ */ jsxs10("div", { className: "ds-imagemap", children: [
4591
+ src && /* @__PURE__ */ jsx15("img", { src, alt: spec.alt }),
4592
+ markers.map((mk, i) => {
4593
+ const t = mk.status ? spec.statusMap?.[mk.status] ?? mk.status : "info";
4594
+ return /* @__PURE__ */ jsxs10(
4595
+ "button",
4596
+ {
4597
+ type: "button",
4598
+ className: "ds-marker",
4599
+ style: {
4600
+ left: `${mk.x}%`,
4601
+ top: `${mk.y}%`,
4602
+ background: tone(t).bg,
4603
+ color: tone(t).fg,
4604
+ borderColor: tone(t).border
4605
+ },
4606
+ onClick: () => emit("click", "marker", { datum: mk.row, value: mk.value, index: i }),
4607
+ onMouseEnter: () => emit("hover", "marker", { datum: mk.row, value: mk.value, index: i }),
4608
+ children: [
4609
+ mk.label,
4610
+ mk.value !== void 0 && /* @__PURE__ */ jsxs10("strong", { children: [
4611
+ " ",
4612
+ formatValue(mk.value, helpers, spec.format),
4613
+ spec.unit ? ` ${spec.unit}` : ""
4614
+ ] })
4615
+ ]
4616
+ },
4617
+ `${mk.x}-${mk.y}-${i}`
4618
+ );
4619
+ })
4620
+ ] });
4621
+ }
4622
+ });
4623
+
4624
+ // src/widgets/builtins/Kpi.tsx
4625
+ import "zod";
4626
+
4626
4627
  // src/widgets/shared/motion.ts
4627
4628
  import { useEffect as useEffect5, useRef as useRef6, useState as useState5 } from "react";
4628
4629
  var reduced = () => typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
@@ -7781,6 +7782,9 @@ var RENDERER_CSS = `
7781
7782
 
7782
7783
  /* Container: a flex layout of panels */
7783
7784
  .ds-container { height: 100%; min-height: 0; }
7785
+ .ds-container-click { height: 100%; cursor: pointer; outline: none; border-radius: inherit; }
7786
+ .ds-container-click:focus-visible { outline: 2px solid var(--ds-color-border-focus); outline-offset: 2px; }
7787
+ .ds-container-click > .ds-container { height: 100%; }
7784
7788
  .ds-container > .ds-panel { flex: var(--ds-child-flex, 1 1 160px); min-width: var(--ds-child-min, 0); height: auto; }
7785
7789
  .ds-container[data-direction="column"] > .ds-panel { min-height: 0; }
7786
7790
  .ds-container-empty { display: grid; place-items: center; height: 100%; min-height: 80px; border: 1.5px dashed var(--ds-color-border-default); border-radius: var(--ds-radius-card); color: var(--ds-color-text-subtle); font-size: 12px; }
@@ -7900,44 +7904,44 @@ var RENDERER_CSS = `
7900
7904
  .ds-repeater-item { display: flex; flex-direction: column; gap: 8px; }
7901
7905
  .ds-repeater-item > .ds-panel { height: auto; }
7902
7906
  /* FlowMap: a process flow; every colour from the theme, so it works in light and dark */
7903
- .ds-flow { display: block; min-width: 0; }
7904
- .ds-flow-scroll { flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
7905
- .ds-flow-svg { display: block; width: 100%; height: auto; margin: 0 auto; }
7906
- .ds-flow-track { fill: none; stroke: var(--ds-flow-track, var(--ds-color-border-default)); stroke-width: var(--ds-flow-track-width, 6); stroke-linecap: round; stroke-linejoin: round; }
7907
- .ds-flow-track[data-dashed] { stroke-linecap: butt; stroke-dasharray: 5 2.5; }
7908
- .ds-flow-chevron { fill: none; stroke: var(--ds-color-text-subtle); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
7909
- .ds-flow-tag rect { fill: var(--ds-color-status-info-bg); }
7910
- .ds-flow-tag text { font-family: var(--ds-font-heading); font-size: 11px; font-weight: 500; fill: var(--ds-color-status-info-fg); }
7911
- .ds-flow-tag[data-dim] rect { fill: var(--ds-color-surface-table-header); }
7912
- .ds-flow-tag[data-dim] text { fill: var(--ds-color-text-subtle); }
7913
- .ds-flow-step { cursor: pointer; outline: none; }
7914
- .ds-flow-step[data-untracked] { cursor: default; }
7915
- .ds-flow-step:focus-visible .ds-flow-hit { stroke: var(--ds-color-border-focus); stroke-width: 2; }
7916
- .ds-flow-hit { fill: transparent; pointer-events: all; }
7917
- .ds-flow-label { font-family: var(--ds-font-heading); font-size: 14px; font-weight: 700; fill: var(--ds-color-text-primary); paint-order: stroke; stroke: var(--ds-color-surface-card); stroke-width: 6px; stroke-linejoin: round; }
7918
- .ds-flow-label[data-selected] { font-size: 16px; }
7919
- .ds-flow-step[data-untracked] .ds-flow-label { fill: var(--ds-color-text-disabled); }
7920
- .ds-flow-untracked { fill: var(--ds-color-surface-card); stroke: var(--ds-color-text-disabled); stroke-width: 2; stroke-dasharray: 3 2; }
7921
- .ds-flow-shape { stroke: var(--ds-color-surface-card); stroke-width: 3; paint-order: stroke; }
7922
- .ds-flow-step[data-dim] .ds-flow-shape { fill: var(--ds-color-text-subtle); }
7923
- .ds-flow-step[data-dim] image { filter: grayscale(1); }
7924
- .ds-flow-halo { animation: ds-flow-pulse 1.2s ease-in-out infinite; }
7925
- @keyframes ds-flow-pulse { 50% { opacity: .7; } }
7926
- @media (prefers-reduced-motion: reduce) { .ds-flow-halo { animation: none; } }
7927
- .ds-flow-chip rect { fill: var(--ds-color-surface-table-header); }
7928
- .ds-flow-chip text { font-family: var(--ds-font-body); fill: var(--ds-color-text-primary); }
7929
- .ds-flow-chip-value { font-size: 14px; font-weight: 700; }
7930
- .ds-flow-chip-unit { font-size: 12px; font-weight: 400; fill: var(--ds-color-text-subtle); }
7931
- .ds-flow-chip[data-tone="good"] rect { fill: var(--ds-color-status-good-bg); }
7932
- .ds-flow-chip[data-tone="good"] text, .ds-flow-chip[data-tone="good"] .ds-flow-chip-unit { fill: var(--ds-color-status-good-fg); }
7933
- .ds-flow-chip[data-tone="dim"] text, .ds-flow-chip[data-tone="dim"] .ds-flow-chip-unit { fill: var(--ds-color-text-subtle); }
7934
- .ds-flow-chip[data-tone="selected"] rect { fill: var(--ds-color-surface-selection); }
7935
- .ds-flow-chip[data-tone="selected"] text, .ds-flow-chip[data-tone="selected"] .ds-flow-chip-unit { fill: var(--ds-color-action-primary); }
7936
- .ds-flow-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; font-family: var(--ds-font-body); font-size: 12px; color: var(--ds-color-text-primary); }
7937
- .ds-flow-legend li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
7938
- .ds-panel-tools .ds-flow-legend { flex: none; }
7939
- .ds-flow-hover { position: fixed; z-index: var(--ds-z-tooltip); min-width: 220px; max-width: 320px; padding: 12px; border-radius: 12px; background: var(--ds-color-chart-tooltip-bg); color: var(--ds-color-chart-tooltip-text); box-shadow: var(--ds-shadow-overlay); backdrop-filter: blur(16px); }
7940
- .ds-flow-hover > * { margin: 0; }
7907
+ .ds-flowmap { display: block; min-width: 0; }
7908
+ .ds-flowmap-scroll { flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
7909
+ .ds-flowmap-svg { display: block; width: 100%; height: auto; margin: 0 auto; }
7910
+ .ds-flowmap-track { fill: none; stroke: var(--ds-flowmap-track, var(--ds-color-border-default)); stroke-width: var(--ds-flowmap-track-width, 6); stroke-linecap: round; stroke-linejoin: round; }
7911
+ .ds-flowmap-track[data-dashed] { stroke-linecap: butt; stroke-dasharray: 5 2.5; }
7912
+ .ds-flowmap-chevron { fill: none; stroke: var(--ds-color-text-subtle); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
7913
+ .ds-flowmap-tag rect { fill: var(--ds-color-status-info-bg); }
7914
+ .ds-flowmap-tag text { font-family: var(--ds-font-heading); font-size: 11px; font-weight: 500; fill: var(--ds-color-status-info-fg); }
7915
+ .ds-flowmap-tag[data-dim] rect { fill: var(--ds-color-surface-table-header); }
7916
+ .ds-flowmap-tag[data-dim] text { fill: var(--ds-color-text-subtle); }
7917
+ .ds-flowmap-step { cursor: pointer; outline: none; }
7918
+ .ds-flowmap-step[data-untracked] { cursor: default; }
7919
+ .ds-flowmap-step:focus-visible .ds-flowmap-hit { stroke: var(--ds-color-border-focus); stroke-width: 2; }
7920
+ .ds-flowmap-hit { fill: transparent; pointer-events: all; }
7921
+ .ds-flowmap-label { font-family: var(--ds-font-heading); font-size: 14px; font-weight: 700; fill: var(--ds-color-text-primary); paint-order: stroke; stroke: var(--ds-color-surface-card); stroke-width: 6px; stroke-linejoin: round; }
7922
+ .ds-flowmap-label[data-selected] { font-size: 16px; }
7923
+ .ds-flowmap-step[data-untracked] .ds-flowmap-label { fill: var(--ds-color-text-disabled); }
7924
+ .ds-flowmap-untracked { fill: var(--ds-color-surface-card); stroke: var(--ds-color-text-disabled); stroke-width: 2; stroke-dasharray: 3 2; }
7925
+ .ds-flowmap-shape { stroke: var(--ds-color-surface-card); stroke-width: 3; paint-order: stroke; }
7926
+ .ds-flowmap-step[data-dim] .ds-flowmap-shape { fill: var(--ds-color-text-subtle); }
7927
+ .ds-flowmap-step[data-dim] image { filter: grayscale(1); }
7928
+ .ds-flowmap-halo { animation: ds-flowmap-pulse 1.2s ease-in-out infinite; }
7929
+ @keyframes ds-flowmap-pulse { 50% { opacity: .7; } }
7930
+ @media (prefers-reduced-motion: reduce) { .ds-flowmap-halo { animation: none; } }
7931
+ .ds-flowmap-chip rect { fill: var(--ds-color-surface-table-header); }
7932
+ .ds-flowmap-chip text { font-family: var(--ds-font-body); fill: var(--ds-color-text-primary); }
7933
+ .ds-flowmap-chip-value { font-size: 14px; font-weight: 700; }
7934
+ .ds-flowmap-chip-unit { font-size: 12px; font-weight: 400; fill: var(--ds-color-text-subtle); }
7935
+ .ds-flowmap-chip[data-tone="good"] rect { fill: var(--ds-color-status-good-bg); }
7936
+ .ds-flowmap-chip[data-tone="good"] text, .ds-flowmap-chip[data-tone="good"] .ds-flowmap-chip-unit { fill: var(--ds-color-status-good-fg); }
7937
+ .ds-flowmap-chip[data-tone="dim"] text, .ds-flowmap-chip[data-tone="dim"] .ds-flowmap-chip-unit { fill: var(--ds-color-text-subtle); }
7938
+ .ds-flowmap-chip[data-tone="selected"] rect { fill: var(--ds-color-surface-selection); }
7939
+ .ds-flowmap-chip[data-tone="selected"] text, .ds-flowmap-chip[data-tone="selected"] .ds-flowmap-chip-unit { fill: var(--ds-color-action-primary); }
7940
+ .ds-flowmap-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; font-family: var(--ds-font-body); font-size: 12px; color: var(--ds-color-text-primary); }
7941
+ .ds-flowmap-legend li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
7942
+ .ds-panel-tools .ds-flowmap-legend { flex: none; }
7943
+ .ds-flowmap-hover { position: fixed; z-index: var(--ds-z-tooltip); min-width: 220px; max-width: 320px; padding: 12px; border-radius: 12px; background: var(--ds-color-chart-tooltip-bg); color: var(--ds-color-chart-tooltip-text); box-shadow: var(--ds-shadow-overlay); backdrop-filter: blur(16px); }
7944
+ .ds-flowmap-hover > * { margin: 0; }
7941
7945
  `;
7942
7946
 
7943
7947
  // src/components/urlSync.ts
@@ -8096,6 +8100,7 @@ function stateView(C, p) {
8096
8100
  }
8097
8101
  var CONTENT_SIZED = /* @__PURE__ */ new Set([
8098
8102
  "Kpi",
8103
+ "FlowMap",
8099
8104
  "Tiles",
8100
8105
  "Table",
8101
8106
  "Breakdown",