@xenosystem/blocks 0.13.0 → 0.13.2

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.
@@ -6,6 +6,16 @@ import {
6
6
  quoteLiteral,
7
7
  renderFilterGroup
8
8
  } from "../chunk-DJJGZ6U4.js";
9
+ import {
10
+ ChevronGlyph,
11
+ DownloadGlyph,
12
+ PlugGlyph,
13
+ PlusGlyph,
14
+ RefreshGlyph,
15
+ SortAscGlyph,
16
+ SortDescGlyph,
17
+ XGlyph
18
+ } from "../chunk-GQWAIPDF.js";
9
19
  import "../chunk-2KG3PWR4.js";
10
20
 
11
21
  // src/data/table/panel.ts
@@ -961,51 +971,8 @@ function safe(n, fallback) {
961
971
  return typeof n === "number" && Number.isFinite(n) ? n : fallback;
962
972
  }
963
973
 
964
- // src/data/table/react/icons.tsx
965
- import { jsx, jsxs } from "react/jsx-runtime";
966
- function Svg({ children, size = 11 }) {
967
- return /* @__PURE__ */ jsx(
968
- "svg",
969
- {
970
- width: size,
971
- height: size,
972
- viewBox: "0 0 24 24",
973
- fill: "none",
974
- stroke: "currentColor",
975
- strokeWidth: "1.5",
976
- strokeLinecap: "round",
977
- strokeLinejoin: "round",
978
- "aria-hidden": "true",
979
- children
980
- }
981
- );
982
- }
983
- function SortAscGlyph() {
984
- return /* @__PURE__ */ jsxs(Svg, { size: 9, children: [
985
- /* @__PURE__ */ jsx("path", { d: "m5 12 7-7 7 7" }),
986
- /* @__PURE__ */ jsx("path", { d: "M12 19V5" })
987
- ] });
988
- }
989
- function SortDescGlyph() {
990
- return /* @__PURE__ */ jsxs(Svg, { size: 9, children: [
991
- /* @__PURE__ */ jsx("path", { d: "M12 5v14" }),
992
- /* @__PURE__ */ jsx("path", { d: "m19 12-7 7-7-7" })
993
- ] });
994
- }
995
- function RefreshGlyph() {
996
- return /* @__PURE__ */ jsxs(Svg, { children: [
997
- /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
998
- /* @__PURE__ */ jsx("path", { d: "M3 3v5h5" }),
999
- /* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }),
1000
- /* @__PURE__ */ jsx("path", { d: "M16 16h5v5" })
1001
- ] });
1002
- }
1003
- function ChevronGlyph({ direction }) {
1004
- return /* @__PURE__ */ jsx(Svg, { children: direction === "left" ? /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" }) : /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" }) });
1005
- }
1006
-
1007
974
  // src/data/table/react/TablePanelView.tsx
1008
- import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
975
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1009
976
  function TablePanelView({
1010
977
  controller,
1011
978
  showRowNumbers = false,
@@ -1033,7 +1000,7 @@ function TablePanelView({
1033
1000
  const columns = useMemo(() => controller.resolvedColumns(), [controller, state]);
1034
1001
  const result = state.result;
1035
1002
  if (!result || result.status === "idle") {
1036
- return /* @__PURE__ */ jsx2(Frame, { controller, state, children: /* @__PURE__ */ jsx2(
1003
+ return /* @__PURE__ */ jsx(Frame, { controller, state, children: /* @__PURE__ */ jsx(
1037
1004
  EmptyState,
1038
1005
  {
1039
1006
  title: "No data",
@@ -1042,7 +1009,7 @@ function TablePanelView({
1042
1009
  ) });
1043
1010
  }
1044
1011
  if (result.status === "error") {
1045
- return /* @__PURE__ */ jsx2(Frame, { controller, state, children: /* @__PURE__ */ jsx2(
1012
+ return /* @__PURE__ */ jsx(Frame, { controller, state, children: /* @__PURE__ */ jsx(
1046
1013
  ErrorState,
1047
1014
  {
1048
1015
  title: result.error?.code ? `Query failed (${result.error.code})` : "Query failed",
@@ -1052,15 +1019,15 @@ function TablePanelView({
1052
1019
  ) });
1053
1020
  }
1054
1021
  if (result.status === "loading" && result.rows.length === 0) {
1055
- return /* @__PURE__ */ jsx2(Frame, { controller, state, children: /* @__PURE__ */ jsx2(LoadingState, { label: "Running query\u2026" }) });
1022
+ return /* @__PURE__ */ jsx(Frame, { controller, state, children: /* @__PURE__ */ jsx(LoadingState, { label: "Running query\u2026" }) });
1056
1023
  }
1057
- const body = state.viewMode === "pivot" ? /* @__PURE__ */ jsx2(PivotBody, { controller, columns, groups: result.groups ?? [] }) : result.rows.length === 0 ? /* @__PURE__ */ jsx2(
1024
+ const body = state.viewMode === "pivot" ? /* @__PURE__ */ jsx(PivotBody, { controller, columns, groups: result.groups ?? [] }) : result.rows.length === 0 ? /* @__PURE__ */ jsx(
1058
1025
  EmptyState,
1059
1026
  {
1060
1027
  title: "No rows",
1061
1028
  hint: "Every row was filtered out. Clear a filter, or widen the time window."
1062
1029
  }
1063
- ) : /* @__PURE__ */ jsx2(
1030
+ ) : /* @__PURE__ */ jsx(
1064
1031
  GridBody,
1065
1032
  {
1066
1033
  controller,
@@ -1073,7 +1040,7 @@ function TablePanelView({
1073
1040
  onScroll
1074
1041
  }
1075
1042
  );
1076
- return /* @__PURE__ */ jsx2(Frame, { controller, state, showFooter, children: body });
1043
+ return /* @__PURE__ */ jsx(Frame, { controller, state, showFooter, children: body });
1077
1044
  }
1078
1045
  function Frame({
1079
1046
  controller,
@@ -1086,12 +1053,12 @@ function Frame({
1086
1053
  const total = page?.total;
1087
1054
  const from = page ? page.offset + 1 : 0;
1088
1055
  const to = page ? page.offset + (result?.rows.length ?? 0) : 0;
1089
- return /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
1090
- /* @__PURE__ */ jsx2(
1056
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
1057
+ /* @__PURE__ */ jsx(
1091
1058
  Toolbar,
1092
1059
  {
1093
- left: /* @__PURE__ */ jsxs2(Fragment, { children: [
1094
- /* @__PURE__ */ jsx2(
1060
+ left: /* @__PURE__ */ jsxs(Fragment, { children: [
1061
+ /* @__PURE__ */ jsx(
1095
1062
  SegmentedControl,
1096
1063
  {
1097
1064
  size: "sm",
@@ -1104,31 +1071,31 @@ function Frame({
1104
1071
  onChange: (mode) => controller.setViewMode(mode)
1105
1072
  }
1106
1073
  ),
1107
- result?.status === "partial" ? /* @__PURE__ */ jsx2(Badge, { tone: "warning", children: "Partial" }) : state.pending ? /* @__PURE__ */ jsx2(Badge, { children: "Loading" }) : null
1074
+ result?.status === "partial" ? /* @__PURE__ */ jsx(Badge, { tone: "warning", children: "Partial" }) : state.pending ? /* @__PURE__ */ jsx(Badge, { children: "Loading" }) : null
1108
1075
  ] }),
1109
- right: /* @__PURE__ */ jsxs2(ToolbarGroup, { end: true, children: [
1110
- /* @__PURE__ */ jsx2(
1076
+ right: /* @__PURE__ */ jsxs(ToolbarGroup, { end: true, children: [
1077
+ /* @__PURE__ */ jsx(
1111
1078
  IconButton,
1112
1079
  {
1113
- icon: /* @__PURE__ */ jsx2(ChevronGlyph, { direction: "left" }),
1080
+ icon: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "left" }),
1114
1081
  label: "Previous page",
1115
1082
  disabled: (page?.offset ?? 0) === 0,
1116
1083
  onClick: () => controller.stepPage(-1)
1117
1084
  }
1118
1085
  ),
1119
- /* @__PURE__ */ jsx2(
1086
+ /* @__PURE__ */ jsx(
1120
1087
  IconButton,
1121
1088
  {
1122
- icon: /* @__PURE__ */ jsx2(ChevronGlyph, { direction: "right" }),
1089
+ icon: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "right" }),
1123
1090
  label: "Next page",
1124
1091
  disabled: !page?.hasMore,
1125
1092
  onClick: () => controller.stepPage(1)
1126
1093
  }
1127
1094
  ),
1128
- /* @__PURE__ */ jsx2(
1095
+ /* @__PURE__ */ jsx(
1129
1096
  IconButton,
1130
1097
  {
1131
- icon: /* @__PURE__ */ jsx2(RefreshGlyph, {}),
1098
+ icon: /* @__PURE__ */ jsx(RefreshGlyph, {}),
1132
1099
  label: "Refresh",
1133
1100
  onClick: () => controller.refresh()
1134
1101
  }
@@ -1137,7 +1104,7 @@ function Frame({
1137
1104
  }
1138
1105
  ),
1139
1106
  children,
1140
- showFooter ? /* @__PURE__ */ jsx2(
1107
+ showFooter ? /* @__PURE__ */ jsx(
1141
1108
  StatusBar,
1142
1109
  {
1143
1110
  left: total === void 0 ? `${to - from + 1} rows` : `${from}\u2013${to} of ${total}`,
@@ -1170,14 +1137,14 @@ function GridBody({
1170
1137
  const visible = columns.slice(colWindow.startIndex, colWindow.endIndex);
1171
1138
  const width = totalWidth(columns);
1172
1139
  const sorts = controller.effectiveQuery().sorts ?? [];
1173
- return /* @__PURE__ */ jsx2(ScrollArea, { children: /* @__PURE__ */ jsxs2(
1140
+ return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsxs(
1174
1141
  "div",
1175
1142
  {
1176
1143
  ref: scrollRef,
1177
1144
  onScroll,
1178
1145
  style: { position: "relative", height: "100%", overflow: "auto" },
1179
1146
  children: [
1180
- /* @__PURE__ */ jsxs2(
1147
+ /* @__PURE__ */ jsxs(
1181
1148
  "div",
1182
1149
  {
1183
1150
  style: {
@@ -1190,16 +1157,16 @@ function GridBody({
1190
1157
  background: "var(--xeno-panel-header)"
1191
1158
  },
1192
1159
  children: [
1193
- frozen.map((c) => /* @__PURE__ */ jsx2(HeaderCell, { resolved: c, controller, sorts, sticky: true }, c.column.id)),
1194
- /* @__PURE__ */ jsx2("div", { style: { width: colWindow.offsetLeft, flex: "0 0 auto" } }),
1195
- visible.filter((c) => !c.frozen).map((c) => /* @__PURE__ */ jsx2(HeaderCell, { resolved: c, controller, sorts }, c.column.id))
1160
+ frozen.map((c) => /* @__PURE__ */ jsx(HeaderCell, { resolved: c, controller, sorts, sticky: true }, c.column.id)),
1161
+ /* @__PURE__ */ jsx("div", { style: { width: colWindow.offsetLeft, flex: "0 0 auto" } }),
1162
+ visible.filter((c) => !c.frozen).map((c) => /* @__PURE__ */ jsx(HeaderCell, { resolved: c, controller, sorts }, c.column.id))
1196
1163
  ]
1197
1164
  }
1198
1165
  ),
1199
- /* @__PURE__ */ jsx2("div", { style: { height: rowWindow.totalHeight, width, position: "relative" }, children: /* @__PURE__ */ jsx2("div", { style: { transform: `translateY(${rowWindow.offsetTop}px)` }, children: result.rows.slice(rowWindow.startIndex, rowWindow.endIndex).map((row, i) => {
1166
+ /* @__PURE__ */ jsx("div", { style: { height: rowWindow.totalHeight, width, position: "relative" }, children: /* @__PURE__ */ jsx("div", { style: { transform: `translateY(${rowWindow.offsetTop}px)` }, children: result.rows.slice(rowWindow.startIndex, rowWindow.endIndex).map((row, i) => {
1200
1167
  const rowIndex = rowWindow.startIndex + i;
1201
1168
  const selected = state.selection.includes(row.id);
1202
- return /* @__PURE__ */ jsxs2(
1169
+ return /* @__PURE__ */ jsxs(
1203
1170
  "div",
1204
1171
  {
1205
1172
  role: "row",
@@ -1213,7 +1180,7 @@ function GridBody({
1213
1180
  background: selected ? "var(--xeno-border)" : zebra && rowIndex % 2 === 1 ? "var(--xeno-border-subtle)" : "transparent"
1214
1181
  },
1215
1182
  children: [
1216
- showRowNumbers ? /* @__PURE__ */ jsx2(
1183
+ showRowNumbers ? /* @__PURE__ */ jsx(
1217
1184
  "div",
1218
1185
  {
1219
1186
  role: "gridcell",
@@ -1231,9 +1198,9 @@ function GridBody({
1231
1198
  children: (result.page?.offset ?? 0) + rowIndex + 1
1232
1199
  }
1233
1200
  ) : null,
1234
- frozen.map((c) => /* @__PURE__ */ jsx2(Cell, { controller, row, resolved: c, sticky: true }, c.column.id)),
1235
- /* @__PURE__ */ jsx2("div", { style: { width: colWindow.offsetLeft, flex: "0 0 auto" } }),
1236
- visible.filter((c) => !c.frozen).map((c) => /* @__PURE__ */ jsx2(Cell, { controller, row, resolved: c }, c.column.id))
1201
+ frozen.map((c) => /* @__PURE__ */ jsx(Cell, { controller, row, resolved: c, sticky: true }, c.column.id)),
1202
+ /* @__PURE__ */ jsx("div", { style: { width: colWindow.offsetLeft, flex: "0 0 auto" } }),
1203
+ visible.filter((c) => !c.frozen).map((c) => /* @__PURE__ */ jsx(Cell, { controller, row, resolved: c }, c.column.id))
1237
1204
  ]
1238
1205
  },
1239
1206
  row.id
@@ -1250,7 +1217,7 @@ function HeaderCell({
1250
1217
  sticky
1251
1218
  }) {
1252
1219
  const sort = sorts.find((s) => s.columnId === resolved.column.id);
1253
- return /* @__PURE__ */ jsxs2(
1220
+ return /* @__PURE__ */ jsxs(
1254
1221
  "div",
1255
1222
  {
1256
1223
  role: "columnheader",
@@ -1279,14 +1246,14 @@ function HeaderCell({
1279
1246
  userSelect: "none"
1280
1247
  },
1281
1248
  children: [
1282
- /* @__PURE__ */ jsx2(
1249
+ /* @__PURE__ */ jsx(
1283
1250
  "span",
1284
1251
  {
1285
1252
  style: { flex: "1 1 auto", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
1286
1253
  children: resolved.column.name
1287
1254
  }
1288
1255
  ),
1289
- sort ? sort.direction === "asc" ? /* @__PURE__ */ jsx2(SortAscGlyph, {}) : /* @__PURE__ */ jsx2(SortDescGlyph, {}) : null
1256
+ sort ? sort.direction === "asc" ? /* @__PURE__ */ jsx(SortAscGlyph, {}) : /* @__PURE__ */ jsx(SortDescGlyph, {}) : null
1290
1257
  ]
1291
1258
  }
1292
1259
  );
@@ -1321,7 +1288,7 @@ function Cell({
1321
1288
  borderRight: "1px solid var(--xeno-border)"
1322
1289
  };
1323
1290
  if (editing) {
1324
- return /* @__PURE__ */ jsx2("div", { style, children: /* @__PURE__ */ jsx2(
1291
+ return /* @__PURE__ */ jsx("div", { style, children: /* @__PURE__ */ jsx(
1325
1292
  "input",
1326
1293
  {
1327
1294
  autoFocus: true,
@@ -1352,7 +1319,7 @@ function Cell({
1352
1319
  }
1353
1320
  ) });
1354
1321
  }
1355
- return /* @__PURE__ */ jsx2(
1322
+ return /* @__PURE__ */ jsx(
1356
1323
  "div",
1357
1324
  {
1358
1325
  role: "gridcell",
@@ -1373,7 +1340,7 @@ function PivotBody({
1373
1340
  const state = controller.getState();
1374
1341
  const totals = state.result?.totals;
1375
1342
  if (groups.length === 0) {
1376
- return /* @__PURE__ */ jsx2(
1343
+ return /* @__PURE__ */ jsx(
1377
1344
  EmptyState,
1378
1345
  {
1379
1346
  title: "No cross-tab",
@@ -1381,15 +1348,15 @@ function PivotBody({
1381
1348
  }
1382
1349
  );
1383
1350
  }
1384
- return /* @__PURE__ */ jsx2(ScrollArea, { children: /* @__PURE__ */ jsxs2("div", { style: { display: "table", width: "100%", fontSize: 11 }, children: [
1385
- /* @__PURE__ */ jsxs2("div", { style: { display: "table-row", position: "sticky", top: 0 }, children: [
1386
- /* @__PURE__ */ jsx2(PivotHeadCell, { children: "\xA0" }),
1387
- columns.map((c) => /* @__PURE__ */ jsx2(PivotHeadCell, { children: c.column.name }, c.column.id))
1351
+ return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsxs("div", { style: { display: "table", width: "100%", fontSize: 11 }, children: [
1352
+ /* @__PURE__ */ jsxs("div", { style: { display: "table-row", position: "sticky", top: 0 }, children: [
1353
+ /* @__PURE__ */ jsx(PivotHeadCell, { children: "\xA0" }),
1354
+ columns.map((c) => /* @__PURE__ */ jsx(PivotHeadCell, { children: c.column.name }, c.column.id))
1388
1355
  ] }),
1389
- groups.map((group) => /* @__PURE__ */ jsx2(PivotRow, { group, columns, depth: 0 }, group.key.join("/"))),
1390
- totals ? /* @__PURE__ */ jsxs2("div", { style: { display: "table-row", fontWeight: 600 }, children: [
1391
- /* @__PURE__ */ jsx2(PivotCell, { head: true, children: "Total" }),
1392
- columns.map((c) => /* @__PURE__ */ jsx2(PivotCell, { numeric: true, children: formatValue2(totals[c.column.id] ?? null, c.column) }, c.column.id))
1356
+ groups.map((group) => /* @__PURE__ */ jsx(PivotRow, { group, columns, depth: 0 }, group.key.join("/"))),
1357
+ totals ? /* @__PURE__ */ jsxs("div", { style: { display: "table-row", fontWeight: 600 }, children: [
1358
+ /* @__PURE__ */ jsx(PivotCell, { head: true, children: "Total" }),
1359
+ columns.map((c) => /* @__PURE__ */ jsx(PivotCell, { numeric: true, children: formatValue2(totals[c.column.id] ?? null, c.column) }, c.column.id))
1393
1360
  ] }) : null
1394
1361
  ] }) });
1395
1362
  }
@@ -1398,16 +1365,16 @@ function PivotRow({
1398
1365
  columns,
1399
1366
  depth
1400
1367
  }) {
1401
- return /* @__PURE__ */ jsxs2(Fragment, { children: [
1402
- /* @__PURE__ */ jsxs2("div", { style: { display: "table-row" }, children: [
1403
- /* @__PURE__ */ jsx2(PivotCell, { head: true, indent: depth, children: group.label || "\u2014" }),
1404
- columns.map((c) => /* @__PURE__ */ jsx2(PivotCell, { numeric: true, children: group.aggregates?.[c.column.id] === null || group.aggregates?.[c.column.id] === void 0 ? "" : formatValue2(group.aggregates[c.column.id] ?? null, c.column) }, c.column.id))
1368
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1369
+ /* @__PURE__ */ jsxs("div", { style: { display: "table-row" }, children: [
1370
+ /* @__PURE__ */ jsx(PivotCell, { head: true, indent: depth, children: group.label || "\u2014" }),
1371
+ columns.map((c) => /* @__PURE__ */ jsx(PivotCell, { numeric: true, children: group.aggregates?.[c.column.id] === null || group.aggregates?.[c.column.id] === void 0 ? "" : formatValue2(group.aggregates[c.column.id] ?? null, c.column) }, c.column.id))
1405
1372
  ] }),
1406
- group.children?.map((child) => /* @__PURE__ */ jsx2(PivotRow, { group: child, columns, depth: depth + 1 }, child.key.join("/")))
1373
+ group.children?.map((child) => /* @__PURE__ */ jsx(PivotRow, { group: child, columns, depth: depth + 1 }, child.key.join("/")))
1407
1374
  ] });
1408
1375
  }
1409
1376
  function PivotHeadCell({ children }) {
1410
- return /* @__PURE__ */ jsx2(
1377
+ return /* @__PURE__ */ jsx(
1411
1378
  "div",
1412
1379
  {
1413
1380
  style: {
@@ -1431,7 +1398,7 @@ function PivotCell({
1431
1398
  numeric,
1432
1399
  indent = 0
1433
1400
  }) {
1434
- return /* @__PURE__ */ jsx2(
1401
+ return /* @__PURE__ */ jsx(
1435
1402
  "div",
1436
1403
  {
1437
1404
  style: {
@@ -2300,32 +2267,8 @@ function shade(index) {
2300
2267
  return MONO_PALETTE[index % MONO_PALETTE.length];
2301
2268
  }
2302
2269
 
2303
- // src/data/chart/react/icons.tsx
2304
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
2305
- function DownloadGlyph() {
2306
- return /* @__PURE__ */ jsxs3(
2307
- "svg",
2308
- {
2309
- width: 11,
2310
- height: 11,
2311
- viewBox: "0 0 24 24",
2312
- fill: "none",
2313
- stroke: "currentColor",
2314
- strokeWidth: "1.5",
2315
- strokeLinecap: "round",
2316
- strokeLinejoin: "round",
2317
- "aria-hidden": "true",
2318
- children: [
2319
- /* @__PURE__ */ jsx3("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2320
- /* @__PURE__ */ jsx3("path", { d: "M7 10l5 5 5-5" }),
2321
- /* @__PURE__ */ jsx3("path", { d: "M12 15V3" })
2322
- ]
2323
- }
2324
- );
2325
- }
2326
-
2327
2270
  // src/data/chart/react/ChartPanelView.tsx
2328
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
2271
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
2329
2272
  var DEFAULT_OPTIONS = {
2330
2273
  showLegend: true,
2331
2274
  showGrid: true,
@@ -2350,10 +2293,10 @@ function ChartPanelView({ controller, options, emptyHint }) {
2350
2293
  onMarkActivate: (label, seriesId) => controller.activateMark(label, seriesId)
2351
2294
  });
2352
2295
  }, [state.data, state.highlightedRowIds, controller, JSON.stringify(resolved)]);
2353
- const toolbar = /* @__PURE__ */ jsx4(
2296
+ const toolbar = /* @__PURE__ */ jsx2(
2354
2297
  Toolbar2,
2355
2298
  {
2356
- left: /* @__PURE__ */ jsx4(
2299
+ left: /* @__PURE__ */ jsx2(
2357
2300
  SegmentedControl2,
2358
2301
  {
2359
2302
  size: "sm",
@@ -2363,9 +2306,9 @@ function ChartPanelView({ controller, options, emptyHint }) {
2363
2306
  onChange: (t) => controller.setType(t)
2364
2307
  }
2365
2308
  ),
2366
- right: /* @__PURE__ */ jsxs4(ToolbarGroup2, { end: true, children: [
2367
- state.partial ? /* @__PURE__ */ jsx4(Badge2, { tone: "warning", title: "Some measures have not synced yet.", children: "partial" }) : null,
2368
- state.data?.tooDense ? /* @__PURE__ */ jsx4(
2309
+ right: /* @__PURE__ */ jsxs2(ToolbarGroup2, { end: true, children: [
2310
+ state.partial ? /* @__PURE__ */ jsx2(Badge2, { tone: "warning", title: "Some measures have not synced yet.", children: "partial" }) : null,
2311
+ state.data?.tooDense ? /* @__PURE__ */ jsx2(
2369
2312
  Badge2,
2370
2313
  {
2371
2314
  tone: "warning",
@@ -2373,10 +2316,10 @@ function ChartPanelView({ controller, options, emptyHint }) {
2373
2316
  children: "aggregating"
2374
2317
  }
2375
2318
  ) : null,
2376
- /* @__PURE__ */ jsx4(
2319
+ /* @__PURE__ */ jsx2(
2377
2320
  IconButton2,
2378
2321
  {
2379
- icon: /* @__PURE__ */ jsx4(DownloadGlyph, {}),
2322
+ icon: /* @__PURE__ */ jsx2(DownloadGlyph, {}),
2380
2323
  label: "Export chart",
2381
2324
  onClick: () => controller.requestExport("png")
2382
2325
  }
@@ -2386,16 +2329,16 @@ function ChartPanelView({ controller, options, emptyHint }) {
2386
2329
  );
2387
2330
  const body = (() => {
2388
2331
  if (state.errorMessage) {
2389
- return /* @__PURE__ */ jsx4(ErrorState2, { title: "Could not load data", message: state.errorMessage });
2332
+ return /* @__PURE__ */ jsx2(ErrorState2, { title: "Could not load data", message: state.errorMessage });
2390
2333
  }
2391
2334
  if (state.empty) {
2392
- return /* @__PURE__ */ jsx4(EmptyState2, { title: "No data", hint: emptyHint ?? "Wire a result into this chart to plot it." });
2335
+ return /* @__PURE__ */ jsx2(EmptyState2, { title: "No data", hint: emptyHint ?? "Wire a result into this chart to plot it." });
2393
2336
  }
2394
2337
  if (state.encodingProblem) {
2395
- return /* @__PURE__ */ jsx4(EmptyState2, { title: "Nothing to plot", hint: state.encodingProblem });
2338
+ return /* @__PURE__ */ jsx2(EmptyState2, { title: "Nothing to plot", hint: state.encodingProblem });
2396
2339
  }
2397
2340
  if (!getChartRenderer()) {
2398
- return /* @__PURE__ */ jsx4(
2341
+ return /* @__PURE__ */ jsx2(
2399
2342
  EmptyState2,
2400
2343
  {
2401
2344
  title: "No renderer installed",
@@ -2403,12 +2346,12 @@ function ChartPanelView({ controller, options, emptyHint }) {
2403
2346
  }
2404
2347
  );
2405
2348
  }
2406
- return /* @__PURE__ */ jsx4("div", { ref: plotRef, style: { flex: "1 1 0", minHeight: 0, position: "relative" } });
2349
+ return /* @__PURE__ */ jsx2("div", { ref: plotRef, style: { flex: "1 1 0", minHeight: 0, position: "relative" } });
2407
2350
  })();
2408
- return /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
2351
+ return /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
2409
2352
  toolbar,
2410
2353
  body,
2411
- /* @__PURE__ */ jsx4(
2354
+ /* @__PURE__ */ jsx2(
2412
2355
  StatusBar2,
2413
2356
  {
2414
2357
  left: state.data ? `${state.data.series.length} series \xB7 ${state.data.labels.length} points` : void 0,
@@ -2977,7 +2920,7 @@ import {
2977
2920
  StatusBar as StatusBar3,
2978
2921
  Toolbar as Toolbar3
2979
2922
  } from "@xenosystem/components/chrome";
2980
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2923
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
2981
2924
  function MetricsPanelView({
2982
2925
  controller,
2983
2926
  layout = "grid",
@@ -2988,10 +2931,10 @@ function MetricsPanelView({
2988
2931
  partialHint = "Some measures have not finished syncing."
2989
2932
  }) {
2990
2933
  const state = useSyncExternalStore3(controller.subscribe, controller.getState, controller.getState);
2991
- const toolbar = state.ranges.length > 0 ? /* @__PURE__ */ jsx5(
2934
+ const toolbar = state.ranges.length > 0 ? /* @__PURE__ */ jsx3(
2992
2935
  Toolbar3,
2993
2936
  {
2994
- left: /* @__PURE__ */ jsx5(
2937
+ left: /* @__PURE__ */ jsx3(
2995
2938
  SegmentedControl3,
2996
2939
  {
2997
2940
  size: "sm",
@@ -3003,20 +2946,20 @@ function MetricsPanelView({
3003
2946
  ),
3004
2947
  right: state.partial ? (
3005
2948
  // The honest state: rows are real, measures are still landing.
3006
- /* @__PURE__ */ jsx5(Badge3, { tone: "warning", title: partialHint, children: "partial" })
2949
+ /* @__PURE__ */ jsx3(Badge3, { tone: "warning", title: partialHint, children: "partial" })
3007
2950
  ) : void 0
3008
2951
  }
3009
2952
  ) : null;
3010
2953
  if (state.errorMessage) {
3011
- return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
2954
+ return /* @__PURE__ */ jsxs3("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
3012
2955
  toolbar,
3013
- /* @__PURE__ */ jsx5(ErrorState3, { title: "Could not load metrics", message: state.errorMessage })
2956
+ /* @__PURE__ */ jsx3(ErrorState3, { title: "Could not load metrics", message: state.errorMessage })
3014
2957
  ] });
3015
2958
  }
3016
2959
  if (state.metrics.length === 0) {
3017
- return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
2960
+ return /* @__PURE__ */ jsxs3("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
3018
2961
  toolbar,
3019
- /* @__PURE__ */ jsx5(
2962
+ /* @__PURE__ */ jsx3(
3020
2963
  EmptyState3,
3021
2964
  {
3022
2965
  title: "No metrics",
@@ -3026,9 +2969,9 @@ function MetricsPanelView({
3026
2969
  ] });
3027
2970
  }
3028
2971
  const gridStyle = layout === "grid" ? { display: "grid", gridTemplateColumns: `repeat(${Math.max(1, columns)}, minmax(0, 1fr))`, gap: 6 } : layout === "row" ? { display: "flex", gap: 6, overflowX: "auto" } : { display: "flex", flexDirection: "column", gap: 6 };
3029
- return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
2972
+ return /* @__PURE__ */ jsxs3("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
3030
2973
  toolbar,
3031
- /* @__PURE__ */ jsx5(ScrollArea2, { children: /* @__PURE__ */ jsx5("div", { style: { ...gridStyle, padding: 6 }, children: state.metrics.map((metric) => /* @__PURE__ */ jsx5(
2974
+ /* @__PURE__ */ jsx3(ScrollArea2, { children: /* @__PURE__ */ jsx3("div", { style: { ...gridStyle, padding: 6 }, children: state.metrics.map((metric) => /* @__PURE__ */ jsx3(
3032
2975
  Tile,
3033
2976
  {
3034
2977
  metric,
@@ -3039,7 +2982,7 @@ function MetricsPanelView({
3039
2982
  },
3040
2983
  metric.spec.id
3041
2984
  )) }) }),
3042
- /* @__PURE__ */ jsx5(
2985
+ /* @__PURE__ */ jsx3(
3043
2986
  StatusBar3,
3044
2987
  {
3045
2988
  left: `${state.metrics.length} metric${state.metrics.length === 1 ? "" : "s"}`,
@@ -3056,7 +2999,7 @@ function Tile({
3056
2999
  onActivate
3057
3000
  }) {
3058
3001
  const tone = metric.level === "critical" ? "error" : metric.level === "warn" ? "warning" : void 0;
3059
- return /* @__PURE__ */ jsx5(
3002
+ return /* @__PURE__ */ jsx3(
3060
3003
  "div",
3061
3004
  {
3062
3005
  role: "button",
@@ -3069,15 +3012,15 @@ function Tile({
3069
3012
  }
3070
3013
  },
3071
3014
  style: { cursor: "pointer", minWidth: 0 },
3072
- children: /* @__PURE__ */ jsx5(
3015
+ children: /* @__PURE__ */ jsx3(
3073
3016
  StatTile,
3074
3017
  {
3075
3018
  title: metric.spec.description,
3076
3019
  label: metric.spec.label,
3077
3020
  value: metric.partial && metric.value === null ? "\u2014" : metric.display,
3078
- icon: tone ? /* @__PURE__ */ jsx5(Badge3, { tone, children: metric.level }) : void 0,
3079
- sub: /* @__PURE__ */ jsxs5("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
3080
- showDelta && metric.delta !== void 0 ? /* @__PURE__ */ jsxs5(
3021
+ icon: tone ? /* @__PURE__ */ jsx3(Badge3, { tone, children: metric.level }) : void 0,
3022
+ sub: /* @__PURE__ */ jsxs3("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
3023
+ showDelta && metric.delta !== void 0 ? /* @__PURE__ */ jsxs3(
3081
3024
  "span",
3082
3025
  {
3083
3026
  style: {
@@ -3093,8 +3036,8 @@ function Tile({
3093
3036
  ]
3094
3037
  }
3095
3038
  ) : null,
3096
- metric.partial ? /* @__PURE__ */ jsx5("span", { style: { opacity: 0.6 }, children: partialHint }) : null,
3097
- sparkline && metric.spark && metric.spark.length > 1 ? /* @__PURE__ */ jsx5(Sparkline, { data: metric.spark, label: `${metric.spec.label} trend` }) : null
3039
+ metric.partial ? /* @__PURE__ */ jsx3("span", { style: { opacity: 0.6 }, children: partialHint }) : null,
3040
+ sparkline && metric.spark && metric.spark.length > 1 ? /* @__PURE__ */ jsx3(Sparkline, { data: metric.spark, label: `${metric.spec.label} trend` }) : null
3098
3041
  ] })
3099
3042
  }
3100
3043
  )
@@ -3960,41 +3903,7 @@ import {
3960
3903
  Toolbar as Toolbar4,
3961
3904
  ToolbarGroup as ToolbarGroup3
3962
3905
  } from "@xenosystem/components/chrome";
3963
-
3964
- // src/data/fields/react/icons.tsx
3965
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
3966
- function Svg2({ children }) {
3967
- return /* @__PURE__ */ jsx6(
3968
- "svg",
3969
- {
3970
- width: 11,
3971
- height: 11,
3972
- viewBox: "0 0 24 24",
3973
- fill: "none",
3974
- stroke: "currentColor",
3975
- strokeWidth: "1.5",
3976
- strokeLinecap: "round",
3977
- strokeLinejoin: "round",
3978
- "aria-hidden": "true",
3979
- children
3980
- }
3981
- );
3982
- }
3983
- function PlusGlyph() {
3984
- return /* @__PURE__ */ jsxs6(Svg2, { children: [
3985
- /* @__PURE__ */ jsx6("path", { d: "M5 12h14" }),
3986
- /* @__PURE__ */ jsx6("path", { d: "M12 5v14" })
3987
- ] });
3988
- }
3989
- function XGlyph() {
3990
- return /* @__PURE__ */ jsxs6(Svg2, { children: [
3991
- /* @__PURE__ */ jsx6("path", { d: "M18 6 6 18" }),
3992
- /* @__PURE__ */ jsx6("path", { d: "m6 6 12 12" })
3993
- ] });
3994
- }
3995
-
3996
- // src/data/fields/react/FieldsPanelView.tsx
3997
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3906
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
3998
3907
  function FieldsPanelView({
3999
3908
  controller,
4000
3909
  showStats = true,
@@ -4002,7 +3911,7 @@ function FieldsPanelView({
4002
3911
  }) {
4003
3912
  const state = useSyncExternalStore4(controller.subscribe, controller.getState, controller.getState);
4004
3913
  if (state.columns.length === 0) {
4005
- return /* @__PURE__ */ jsx7(
3914
+ return /* @__PURE__ */ jsx4(
4006
3915
  EmptyState4,
4007
3916
  {
4008
3917
  title: "No fields",
@@ -4010,50 +3919,50 @@ function FieldsPanelView({
4010
3919
  }
4011
3920
  );
4012
3921
  }
4013
- return /* @__PURE__ */ jsxs7("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
4014
- /* @__PURE__ */ jsx7(
3922
+ return /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
3923
+ /* @__PURE__ */ jsx4(
4015
3924
  Toolbar4,
4016
3925
  {
4017
3926
  left: state.sampleWarning ? (
4018
3927
  // An inferred shape is a GUESS; building a query on a guessed column is how a
4019
3928
  // dashboard breaks next Tuesday.
4020
3929
  // Badge has no title prop, so the tooltip lives on a wrapper.
4021
- /* @__PURE__ */ jsx7("span", { title: state.sampleWarning, children: /* @__PURE__ */ jsx7(Badge4, { tone: "warning", children: "sampled schema" }) })
3930
+ /* @__PURE__ */ jsx4("span", { title: state.sampleWarning, children: /* @__PURE__ */ jsx4(Badge4, { tone: "warning", children: "sampled schema" }) })
4022
3931
  ) : void 0,
4023
- right: /* @__PURE__ */ jsxs7(ToolbarGroup3, { end: true, children: [
4024
- /* @__PURE__ */ jsx7(TextButton, { onClick: () => controller.autoAssign(), children: "Auto-assign" }),
4025
- manualApply ? /* @__PURE__ */ jsx7(TextButton, { strong: true, disabled: !state.dirty, onClick: () => controller.apply(true), children: "Apply" }) : null
3932
+ right: /* @__PURE__ */ jsxs4(ToolbarGroup3, { end: true, children: [
3933
+ /* @__PURE__ */ jsx4(TextButton, { onClick: () => controller.autoAssign(), children: "Auto-assign" }),
3934
+ manualApply ? /* @__PURE__ */ jsx4(TextButton, { strong: true, disabled: !state.dirty, onClick: () => controller.apply(true), children: "Apply" }) : null
4026
3935
  ] })
4027
3936
  }
4028
3937
  ),
4029
- /* @__PURE__ */ jsxs7(ScrollArea3, { children: [
4030
- /* @__PURE__ */ jsx7(Section, { title: "Fields", flush: true, children: /* @__PURE__ */ jsx7(RowList, { children: state.columns.map((column) => /* @__PURE__ */ jsx7(
3938
+ /* @__PURE__ */ jsxs4(ScrollArea3, { children: [
3939
+ /* @__PURE__ */ jsx4(Section, { title: "Fields", flush: true, children: /* @__PURE__ */ jsx4(RowList, { children: state.columns.map((column) => /* @__PURE__ */ jsx4(
4031
3940
  Row,
4032
3941
  {
4033
3942
  label: column.name,
4034
3943
  meta: column.role ?? "dimension",
4035
3944
  selected: state.focusedColumnId === column.id,
4036
3945
  onClick: () => controller.focusColumn(column.id),
4037
- trailing: showStats && state.stats[column.id] ? /* @__PURE__ */ jsx7("span", { title: `${state.stats[column.id]?.nulls ?? 0} empty`, children: /* @__PURE__ */ jsx7(Badge4, { children: String(state.stats[column.id]?.distinct ?? 0) }) }) : null
3946
+ trailing: showStats && state.stats[column.id] ? /* @__PURE__ */ jsx4("span", { title: `${state.stats[column.id]?.nulls ?? 0} empty`, children: /* @__PURE__ */ jsx4(Badge4, { children: String(state.stats[column.id]?.distinct ?? 0) }) }) : null
4038
3947
  },
4039
3948
  column.id
4040
3949
  )) }) }),
4041
3950
  state.shelves.filter((shelf) => shelf.id !== "filters").map((shelf) => {
4042
3951
  const entries = state.entries[shelf.id] ?? [];
4043
- return /* @__PURE__ */ jsx7(
3952
+ return /* @__PURE__ */ jsx4(
4044
3953
  Section,
4045
3954
  {
4046
3955
  title: shelf.label,
4047
- badge: entries.length > 0 ? /* @__PURE__ */ jsx7(Badge4, { children: String(entries.length) }) : void 0,
3956
+ badge: entries.length > 0 ? /* @__PURE__ */ jsx4(Badge4, { children: String(entries.length) }) : void 0,
4048
3957
  flush: true,
4049
- children: entries.length === 0 ? /* @__PURE__ */ jsx7("div", { style: { padding: "4px 8px", fontSize: 10, opacity: 0.5 }, children: shelf.hint ?? `Drop a ${shelf.accepts.join(" or ")} here.` }) : /* @__PURE__ */ jsx7(RowList, { children: entries.map((entry) => {
3958
+ children: entries.length === 0 ? /* @__PURE__ */ jsx4("div", { style: { padding: "4px 8px", fontSize: 10, opacity: 0.5 }, children: shelf.hint ?? `Drop a ${shelf.accepts.join(" or ")} here.` }) : /* @__PURE__ */ jsx4(RowList, { children: entries.map((entry) => {
4050
3959
  const column = state.columns.find((c) => c.id === entry.columnId);
4051
- return /* @__PURE__ */ jsx7(
3960
+ return /* @__PURE__ */ jsx4(
4052
3961
  Row,
4053
3962
  {
4054
3963
  label: entry.label ?? column?.name ?? entry.columnId,
4055
3964
  style: entry.suggested ? { opacity: 0.6 } : void 0,
4056
- meta: shelf.aggregated ? /* @__PURE__ */ jsx7(
3965
+ meta: shelf.aggregated ? /* @__PURE__ */ jsx4(
4057
3966
  AggregateSelect,
4058
3967
  {
4059
3968
  controller,
@@ -4062,18 +3971,18 @@ function FieldsPanelView({
4062
3971
  value: entry.fn ?? "count",
4063
3972
  allowed: state.allowedAggregates
4064
3973
  }
4065
- ) : shelf.id === "sorts" ? /* @__PURE__ */ jsx7(
3974
+ ) : shelf.id === "sorts" ? /* @__PURE__ */ jsx4(
4066
3975
  TextButton,
4067
3976
  {
4068
3977
  onClick: () => controller.toggleDirection(shelf.id, entry.columnId),
4069
3978
  children: entry.direction === "desc" ? "desc" : "asc"
4070
3979
  }
4071
- ) : entry.granularity ? /* @__PURE__ */ jsx7(Badge4, { children: entry.granularity }) : null,
4072
- trailing: /* @__PURE__ */ jsx7(
3980
+ ) : entry.granularity ? /* @__PURE__ */ jsx4(Badge4, { children: entry.granularity }) : null,
3981
+ trailing: /* @__PURE__ */ jsx4(
4073
3982
  IconButton3,
4074
3983
  {
4075
3984
  size: "sm",
4076
- icon: /* @__PURE__ */ jsx7(XGlyph, {}),
3985
+ icon: /* @__PURE__ */ jsx4(XGlyph, {}),
4077
3986
  label: `Remove ${column?.name ?? entry.columnId}`,
4078
3987
  onClick: () => controller.removeFromShelf(shelf.id, entry.columnId)
4079
3988
  }
@@ -4086,9 +3995,9 @@ function FieldsPanelView({
4086
3995
  shelf.id
4087
3996
  );
4088
3997
  }),
4089
- /* @__PURE__ */ jsx7(FilterBuilder, { controller })
3998
+ /* @__PURE__ */ jsx4(FilterBuilder, { controller })
4090
3999
  ] }),
4091
- /* @__PURE__ */ jsx7(
4000
+ /* @__PURE__ */ jsx4(
4092
4001
  StatusBar4,
4093
4002
  {
4094
4003
  left: `${state.columns.length} field${state.columns.length === 1 ? "" : "s"}`,
@@ -4105,29 +4014,29 @@ function AggregateSelect({
4105
4014
  allowed
4106
4015
  }) {
4107
4016
  const options = offerableAggregates(column, allowed);
4108
- return /* @__PURE__ */ jsx7(
4017
+ return /* @__PURE__ */ jsx4(
4109
4018
  "select",
4110
4019
  {
4111
4020
  value,
4112
4021
  onClick: (e) => e.stopPropagation(),
4113
4022
  onChange: (e) => controller.setAggregate(shelfId, column?.id ?? "", e.target.value),
4114
4023
  style: { font: "inherit", fontSize: 9, background: "transparent", color: "inherit", border: "none" },
4115
- children: options.map((fn) => /* @__PURE__ */ jsx7("option", { value: fn, children: fn }, fn))
4024
+ children: options.map((fn) => /* @__PURE__ */ jsx4("option", { value: fn, children: fn }, fn))
4116
4025
  }
4117
4026
  );
4118
4027
  }
4119
4028
  function FilterBuilder({ controller }) {
4120
4029
  const state = useSyncExternalStore4(controller.subscribe, controller.getState, controller.getState);
4121
- return /* @__PURE__ */ jsxs7(
4030
+ return /* @__PURE__ */ jsxs4(
4122
4031
  Section,
4123
4032
  {
4124
4033
  title: "Filters",
4125
- badge: state.filters.filters.length > 0 ? /* @__PURE__ */ jsx7(Badge4, { children: String(state.filters.filters.length) }) : void 0,
4126
- actions: /* @__PURE__ */ jsx7(
4034
+ badge: state.filters.filters.length > 0 ? /* @__PURE__ */ jsx4(Badge4, { children: String(state.filters.filters.length) }) : void 0,
4035
+ actions: /* @__PURE__ */ jsx4(
4127
4036
  IconButton3,
4128
4037
  {
4129
4038
  size: "sm",
4130
- icon: /* @__PURE__ */ jsx7(PlusGlyph, {}),
4039
+ icon: /* @__PURE__ */ jsx4(PlusGlyph, {}),
4131
4040
  label: "Add filter",
4132
4041
  onClick: () => {
4133
4042
  const column = state.columns[0];
@@ -4137,17 +4046,17 @@ function FilterBuilder({ controller }) {
4137
4046
  ),
4138
4047
  flush: true,
4139
4048
  children: [
4140
- state.filters.filters.length === 0 ? /* @__PURE__ */ jsx7("div", { style: { padding: "4px 8px", fontSize: 10, opacity: 0.5 }, children: "No filters. Everything passes." }) : /* @__PURE__ */ jsx7(RowList, { children: state.filters.filters.map((member, index) => {
4049
+ state.filters.filters.length === 0 ? /* @__PURE__ */ jsx4("div", { style: { padding: "4px 8px", fontSize: 10, opacity: 0.5 }, children: "No filters. Everything passes." }) : /* @__PURE__ */ jsx4(RowList, { children: state.filters.filters.map((member, index) => {
4141
4050
  if (!isLeafFilter(member)) {
4142
- return /* @__PURE__ */ jsx7(
4051
+ return /* @__PURE__ */ jsx4(
4143
4052
  Row,
4144
4053
  {
4145
4054
  label: `(${member.combinator.toUpperCase()} group \u2014 ${member.filters.length})`,
4146
- trailing: /* @__PURE__ */ jsx7(
4055
+ trailing: /* @__PURE__ */ jsx4(
4147
4056
  IconButton3,
4148
4057
  {
4149
4058
  size: "sm",
4150
- icon: /* @__PURE__ */ jsx7(XGlyph, {}),
4059
+ icon: /* @__PURE__ */ jsx4(XGlyph, {}),
4151
4060
  label: "Remove group",
4152
4061
  onClick: () => controller.removeFilter([], index)
4153
4062
  }
@@ -4157,11 +4066,11 @@ function FilterBuilder({ controller }) {
4157
4066
  );
4158
4067
  }
4159
4068
  const column = state.columns.find((c) => c.id === member.columnId);
4160
- return /* @__PURE__ */ jsx7(
4069
+ return /* @__PURE__ */ jsx4(
4161
4070
  Row,
4162
4071
  {
4163
4072
  label: column?.name ?? member.columnId,
4164
- meta: /* @__PURE__ */ jsx7(
4073
+ meta: /* @__PURE__ */ jsx4(
4165
4074
  "select",
4166
4075
  {
4167
4076
  value: member.op,
@@ -4174,14 +4083,14 @@ function FilterBuilder({ controller }) {
4174
4083
  color: "inherit",
4175
4084
  border: "none"
4176
4085
  },
4177
- children: offerableFilterOps(column, state.allowedFilterOps).map((op) => /* @__PURE__ */ jsx7("option", { value: op, children: op }, op))
4086
+ children: offerableFilterOps(column, state.allowedFilterOps).map((op) => /* @__PURE__ */ jsx4("option", { value: op, children: op }, op))
4178
4087
  }
4179
4088
  ),
4180
- trailing: /* @__PURE__ */ jsx7(
4089
+ trailing: /* @__PURE__ */ jsx4(
4181
4090
  IconButton3,
4182
4091
  {
4183
4092
  size: "sm",
4184
- icon: /* @__PURE__ */ jsx7(XGlyph, {}),
4093
+ icon: /* @__PURE__ */ jsx4(XGlyph, {}),
4185
4094
  label: "Remove filter",
4186
4095
  onClick: () => controller.removeFilter([], index)
4187
4096
  }
@@ -4190,8 +4099,8 @@ function FilterBuilder({ controller }) {
4190
4099
  `f${index}`
4191
4100
  );
4192
4101
  }) }),
4193
- /* @__PURE__ */ jsxs7("div", { style: { padding: "2px 8px", display: "flex", gap: 8 }, children: [
4194
- /* @__PURE__ */ jsx7(
4102
+ /* @__PURE__ */ jsxs4("div", { style: { padding: "2px 8px", display: "flex", gap: 8 }, children: [
4103
+ /* @__PURE__ */ jsx4(
4195
4104
  SegmentedControl4,
4196
4105
  {
4197
4106
  size: "sm",
@@ -4204,7 +4113,7 @@ function FilterBuilder({ controller }) {
4204
4113
  onChange: (c) => controller.setCombinator([], c)
4205
4114
  }
4206
4115
  ),
4207
- /* @__PURE__ */ jsx7(TextButton, { onClick: () => controller.addFilterGroup([]), children: "+ group" })
4116
+ /* @__PURE__ */ jsx4(TextButton, { onClick: () => controller.addFilterGroup([]), children: "+ group" })
4208
4117
  ] })
4209
4118
  ]
4210
4119
  }
@@ -6518,43 +6427,8 @@ function credentialSpecProblem(spec) {
6518
6427
  return null;
6519
6428
  }
6520
6429
 
6521
- // src/data/connectors/react/icons.tsx
6522
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
6523
- function Svg3({ children, size = 11 }) {
6524
- return /* @__PURE__ */ jsx8(
6525
- "svg",
6526
- {
6527
- width: size,
6528
- height: size,
6529
- viewBox: "0 0 24 24",
6530
- fill: "none",
6531
- stroke: "currentColor",
6532
- strokeWidth: "1.5",
6533
- strokeLinecap: "round",
6534
- strokeLinejoin: "round",
6535
- "aria-hidden": "true",
6536
- children
6537
- }
6538
- );
6539
- }
6540
- function PlugGlyph() {
6541
- return /* @__PURE__ */ jsxs8(Svg3, { children: [
6542
- /* @__PURE__ */ jsx8("path", { d: "M12 22v-5" }),
6543
- /* @__PURE__ */ jsx8("path", { d: "M9 8V2M15 8V2" }),
6544
- /* @__PURE__ */ jsx8("path", { d: "M18 8v3a6 6 0 0 1-12 0V8Z" })
6545
- ] });
6546
- }
6547
- function RefreshGlyph2() {
6548
- return /* @__PURE__ */ jsxs8(Svg3, { children: [
6549
- /* @__PURE__ */ jsx8("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
6550
- /* @__PURE__ */ jsx8("path", { d: "M3 3v5h5" }),
6551
- /* @__PURE__ */ jsx8("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }),
6552
- /* @__PURE__ */ jsx8("path", { d: "M16 16h5v5" })
6553
- ] });
6554
- }
6555
-
6556
6430
  // src/data/connectors/react/ConnectorsPanelView.tsx
6557
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
6431
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
6558
6432
  var TONE = {
6559
6433
  unknown: "neutral",
6560
6434
  ok: "success",
@@ -6570,46 +6444,46 @@ function ConnectorsPanelView({
6570
6444
  }) {
6571
6445
  const state = useSyncExternalStore5(controller.subscribe, controller.getState, controller.getState);
6572
6446
  if (state.form) {
6573
- return /* @__PURE__ */ jsx9(CredentialForm, { controller });
6447
+ return /* @__PURE__ */ jsx5(CredentialForm, { controller });
6574
6448
  }
6575
- return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
6576
- /* @__PURE__ */ jsx9(
6449
+ return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
6450
+ /* @__PURE__ */ jsx5(
6577
6451
  Toolbar5,
6578
6452
  {
6579
- right: /* @__PURE__ */ jsx9(ToolbarGroup4, { end: true, children: /* @__PURE__ */ jsx9(
6453
+ right: /* @__PURE__ */ jsx5(ToolbarGroup4, { end: true, children: /* @__PURE__ */ jsx5(
6580
6454
  IconButton4,
6581
6455
  {
6582
- icon: /* @__PURE__ */ jsx9(RefreshGlyph2, {}),
6456
+ icon: /* @__PURE__ */ jsx5(RefreshGlyph, {}),
6583
6457
  label: "Refresh all",
6584
6458
  onClick: () => void controller.refreshAll()
6585
6459
  }
6586
6460
  ) })
6587
6461
  }
6588
6462
  ),
6589
- state.connections.length === 0 ? /* @__PURE__ */ jsx9(
6463
+ state.connections.length === 0 ? /* @__PURE__ */ jsx5(
6590
6464
  EmptyState5,
6591
6465
  {
6592
6466
  title: "No sources",
6593
6467
  hint: emptyHint ?? "Paste CSV or JSON to start with an inline source \u2014 no setup needed."
6594
6468
  }
6595
- ) : /* @__PURE__ */ jsx9(ScrollArea4, { children: /* @__PURE__ */ jsx9(RowList2, { role: "listbox", "aria-label": "Data sources", children: state.connections.map(({ connection, status }) => {
6469
+ ) : /* @__PURE__ */ jsx5(ScrollArea4, { children: /* @__PURE__ */ jsx5(RowList2, { role: "listbox", "aria-label": "Data sources", children: state.connections.map(({ connection, status }) => {
6596
6470
  const disabled = status.health === "unsupported";
6597
- return /* @__PURE__ */ jsx9(
6471
+ return /* @__PURE__ */ jsx5(
6598
6472
  Row2,
6599
6473
  {
6600
- icon: /* @__PURE__ */ jsx9(PlugGlyph, {}),
6474
+ icon: /* @__PURE__ */ jsx5(PlugGlyph, {}),
6601
6475
  label: connection.name,
6602
6476
  meta: connection.kind,
6603
6477
  selected: connection.id === state.selectedId,
6604
6478
  disabled,
6605
6479
  title: status.message,
6606
6480
  onClick: () => controller.select(connection.id),
6607
- trailing: /* @__PURE__ */ jsx9(Badge5, { tone: TONE[status.health], children: status.health })
6481
+ trailing: /* @__PURE__ */ jsx5(Badge5, { tone: TONE[status.health], children: status.health })
6608
6482
  },
6609
6483
  connection.id
6610
6484
  );
6611
6485
  }) }) }),
6612
- /* @__PURE__ */ jsx9(
6486
+ /* @__PURE__ */ jsx5(
6613
6487
  StatusBar5,
6614
6488
  {
6615
6489
  left: `${state.connections.length} source${state.connections.length === 1 ? "" : "s"}`,
@@ -6625,14 +6499,14 @@ function CredentialForm({ controller }) {
6625
6499
  if (!form) return null;
6626
6500
  const problem = credentialSpecProblem(form);
6627
6501
  if (problem) {
6628
- return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
6629
- /* @__PURE__ */ jsx9(Toolbar5, { left: /* @__PURE__ */ jsx9("span", { style: { fontSize: 11 }, children: form.title }) }),
6630
- /* @__PURE__ */ jsx9(EmptyState5, { title: "This connection cannot be set up", hint: problem }),
6631
- /* @__PURE__ */ jsx9(
6502
+ return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
6503
+ /* @__PURE__ */ jsx5(Toolbar5, { left: /* @__PURE__ */ jsx5("span", { style: { fontSize: 11 }, children: form.title }) }),
6504
+ /* @__PURE__ */ jsx5(EmptyState5, { title: "This connection cannot be set up", hint: problem }),
6505
+ /* @__PURE__ */ jsx5(
6632
6506
  Toolbar5,
6633
6507
  {
6634
6508
  divided: false,
6635
- right: /* @__PURE__ */ jsx9(ToolbarGroup4, { end: true, children: /* @__PURE__ */ jsx9(TextButton2, { onClick: () => controller.cancelCredential(), children: "Close" }) })
6509
+ right: /* @__PURE__ */ jsx5(ToolbarGroup4, { end: true, children: /* @__PURE__ */ jsx5(TextButton2, { onClick: () => controller.cancelCredential(), children: "Close" }) })
6636
6510
  }
6637
6511
  )
6638
6512
  ] });
@@ -6640,13 +6514,13 @@ function CredentialForm({ controller }) {
6640
6514
  const shown = visibleFields(form, values);
6641
6515
  const errors = validateCredentialDraft(form, values);
6642
6516
  const invalid = Object.keys(errors).length > 0;
6643
- return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
6644
- /* @__PURE__ */ jsx9(Toolbar5, { left: /* @__PURE__ */ jsx9("span", { style: { fontSize: 11 }, children: form.title }) }),
6645
- /* @__PURE__ */ jsxs9(ScrollArea4, { children: [
6646
- form.message ? /* @__PURE__ */ jsx9("div", { style: { padding: 8, fontSize: 11, opacity: 0.8 }, children: form.message }) : null,
6647
- form.redirectUri ? /* @__PURE__ */ jsxs9("div", { style: { padding: 8, fontSize: 11 }, children: [
6648
- /* @__PURE__ */ jsx9("div", { style: { opacity: 0.7, marginBottom: 4 }, children: "Add this exact redirect URI to the provider:" }),
6649
- /* @__PURE__ */ jsx9(
6517
+ return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
6518
+ /* @__PURE__ */ jsx5(Toolbar5, { left: /* @__PURE__ */ jsx5("span", { style: { fontSize: 11 }, children: form.title }) }),
6519
+ /* @__PURE__ */ jsxs5(ScrollArea4, { children: [
6520
+ form.message ? /* @__PURE__ */ jsx5("div", { style: { padding: 8, fontSize: 11, opacity: 0.8 }, children: form.message }) : null,
6521
+ form.redirectUri ? /* @__PURE__ */ jsxs5("div", { style: { padding: 8, fontSize: 11 }, children: [
6522
+ /* @__PURE__ */ jsx5("div", { style: { opacity: 0.7, marginBottom: 4 }, children: "Add this exact redirect URI to the provider:" }),
6523
+ /* @__PURE__ */ jsx5(
6650
6524
  "code",
6651
6525
  {
6652
6526
  style: {
@@ -6661,24 +6535,24 @@ function CredentialForm({ controller }) {
6661
6535
  }
6662
6536
  )
6663
6537
  ] }) : null,
6664
- /* @__PURE__ */ jsx9(FieldGroup, { children: shown.map((field) => /* @__PURE__ */ jsx9(Field, { label: field.label, hint: errors[field.key] ?? field.description, children: field.type === "boolean" ? /* @__PURE__ */ jsx9(
6538
+ /* @__PURE__ */ jsx5(FieldGroup, { children: shown.map((field) => /* @__PURE__ */ jsx5(Field, { label: field.label, hint: errors[field.key] ?? field.description, children: field.type === "boolean" ? /* @__PURE__ */ jsx5(
6665
6539
  "input",
6666
6540
  {
6667
6541
  type: "checkbox",
6668
6542
  checked: values[field.key] === true,
6669
6543
  onChange: (e) => setValues((v) => ({ ...v, [field.key]: e.target.checked }))
6670
6544
  }
6671
- ) : field.type === "select" ? /* @__PURE__ */ jsxs9(
6545
+ ) : field.type === "select" ? /* @__PURE__ */ jsxs5(
6672
6546
  "select",
6673
6547
  {
6674
6548
  value: String(values[field.key] ?? ""),
6675
6549
  onChange: (e) => setValues((v) => ({ ...v, [field.key]: e.target.value })),
6676
6550
  children: [
6677
- /* @__PURE__ */ jsx9("option", { value: "" }),
6678
- field.options?.map((o) => /* @__PURE__ */ jsx9("option", { value: o.value, children: o.label }, o.value))
6551
+ /* @__PURE__ */ jsx5("option", { value: "" }),
6552
+ field.options?.map((o) => /* @__PURE__ */ jsx5("option", { value: o.value, children: o.label }, o.value))
6679
6553
  ]
6680
6554
  }
6681
- ) : /* @__PURE__ */ jsx9(
6555
+ ) : /* @__PURE__ */ jsx5(
6682
6556
  "input",
6683
6557
  {
6684
6558
  type: field.type === "password" ? "password" : "text",
@@ -6698,14 +6572,14 @@ function CredentialForm({ controller }) {
6698
6572
  }
6699
6573
  }
6700
6574
  ) }, field.key)) }),
6701
- form.docsUrl ? /* @__PURE__ */ jsx9("div", { style: { padding: 8 }, children: /* @__PURE__ */ jsx9("a", { href: form.docsUrl, target: "_blank", rel: "noreferrer", style: { fontSize: 10 }, children: "Where do I get this?" }) }) : null
6575
+ form.docsUrl ? /* @__PURE__ */ jsx5("div", { style: { padding: 8 }, children: /* @__PURE__ */ jsx5("a", { href: form.docsUrl, target: "_blank", rel: "noreferrer", style: { fontSize: 10 }, children: "Where do I get this?" }) }) : null
6702
6576
  ] }),
6703
- /* @__PURE__ */ jsx9(
6577
+ /* @__PURE__ */ jsx5(
6704
6578
  Toolbar5,
6705
6579
  {
6706
6580
  divided: false,
6707
- right: /* @__PURE__ */ jsxs9(ToolbarGroup4, { end: true, children: [
6708
- /* @__PURE__ */ jsx9(
6581
+ right: /* @__PURE__ */ jsxs5(ToolbarGroup4, { end: true, children: [
6582
+ /* @__PURE__ */ jsx5(
6709
6583
  TextButton2,
6710
6584
  {
6711
6585
  onClick: () => {
@@ -6715,7 +6589,7 @@ function CredentialForm({ controller }) {
6715
6589
  children: "Cancel"
6716
6590
  }
6717
6591
  ),
6718
- /* @__PURE__ */ jsx9(
6592
+ /* @__PURE__ */ jsx5(
6719
6593
  TextButton2,
6720
6594
  {
6721
6595
  strong: true,