@ai-matrx/records-ui 0.102.9 → 0.102.14

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
@@ -5566,7 +5566,7 @@ import { formatPhone as formatPhone2 } from "@ai-matrx/design-system/field-forma
5566
5566
 
5567
5567
  // src/ReferenceChips.tsx
5568
5568
  import { entityRefsOf as entityRefsOf2 } from "@ai-matrx/records";
5569
- import { Badge as Badge4, cn as cn16 } from "@ai-matrx/design-system";
5569
+ import { Badge as Badge4, Skeleton, cn as cn16 } from "@ai-matrx/design-system";
5570
5570
 
5571
5571
  // src/kindValues.ts
5572
5572
  import { tryDecodeDirective } from "@ai-matrx/content-ir/directives";
@@ -5662,9 +5662,11 @@ function PageGlyph() {
5662
5662
  }
5663
5663
  function ReferenceChip({ reference, waiting }) {
5664
5664
  const host = useRecordsUi();
5665
+ const look = useEmbeddedLook();
5666
+ const pending = reference.label == null && reference.token === "record" && !waiting && !host.renderReference;
5667
+ const pendingMark = /* @__PURE__ */ jsx23(Skeleton, { "aria-label": "Loading", "data-records-reference-pending": "", className: "inline-block h-3 w-16 shrink-0 rounded-sm align-middle" });
5665
5668
  const words2 = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
5666
5669
  const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words2 }) : null;
5667
- const look = useEmbeddedLook();
5668
5670
  if (look?.plainRelation) {
5669
5671
  return /* @__PURE__ */ jsxs19(
5670
5672
  "span",
@@ -5679,7 +5681,7 @@ function ReferenceChip({ reference, waiting }) {
5679
5681
  title: reference.archived ? ARCHIVED_REFERENCE_TIP : words2,
5680
5682
  children: [
5681
5683
  /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", "data-records-reference-icon": "", className: "inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground", children: glyphOf(reference.icon) ? /* @__PURE__ */ jsx23("span", { className: "text-sm leading-none", children: reference.icon }) : reference.icon && host.renderIcon?.(reference.icon) || /* @__PURE__ */ jsx23(PageGlyph, {}) }),
5682
- drawn ?? /* @__PURE__ */ jsx23("span", { className: "truncate", children: words2 }),
5684
+ drawn ?? (pending ? pendingMark : /* @__PURE__ */ jsx23("span", { className: "truncate", children: words2 })),
5683
5685
  reference.archived ? /* @__PURE__ */ jsx23("span", { className: "shrink-0 text-muted-foreground", children: ARCHIVED_REFERENCE_WORD }) : null
5684
5686
  ]
5685
5687
  }
@@ -5697,7 +5699,7 @@ function ReferenceChip({ reference, waiting }) {
5697
5699
  "data-records-reference-archived": reference.archived ? "" : void 0,
5698
5700
  title: reference.archived ? ARCHIVED_REFERENCE_TIP : words2,
5699
5701
  children: [
5700
- drawn ?? /* @__PURE__ */ jsx23("span", { className: "truncate", children: words2 }),
5702
+ drawn ?? (pending ? pendingMark : /* @__PURE__ */ jsx23("span", { className: "truncate", children: words2 })),
5701
5703
  reference.archived ? /* @__PURE__ */ jsx23("span", { className: "shrink-0 text-muted-foreground", children: ARCHIVED_REFERENCE_WORD }) : null
5702
5704
  ]
5703
5705
  }
@@ -6597,6 +6599,8 @@ function cardWords(record, field2, labels) {
6597
6599
 
6598
6600
  // src/gridEditing.tsx
6599
6601
  import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
6602
+ var FLOATING_EDITOR_TRAY_CLASS = "pointer-events-none absolute left-0 z-[26] w-max max-w-[24rem] rounded-md border bg-popover px-1.5 py-0.5 shadow-md";
6603
+ var FLOATING_EDITOR_NOTE_CLASS = "[&_[data-records-typed-reads-as]]:pointer-events-none [&_[data-records-typed-reads-as]]:absolute [&_[data-records-typed-reads-as]]:bottom-full [&_[data-records-typed-reads-as]]:left-0 [&_[data-records-typed-reads-as]]:z-[26] [&_[data-records-typed-reads-as]]:mb-1 [&_[data-records-typed-reads-as]]:w-max [&_[data-records-typed-reads-as]]:max-w-[24rem] [&_[data-records-typed-reads-as]]:rounded-md [&_[data-records-typed-reads-as]]:border [&_[data-records-typed-reads-as]]:bg-popover [&_[data-records-typed-reads-as]]:px-1.5 [&_[data-records-typed-reads-as]]:py-0.5 [&_[data-records-typed-reads-as]]:shadow-md";
6600
6604
  var NO_ROWS = [];
6601
6605
  function asksWhoChanged(event) {
6602
6606
  return event.altKey && event.shiftKey && !event.metaKey && !event.ctrlKey && (event.code === "KeyH" || event.key.toLowerCase() === "h");
@@ -7078,11 +7082,11 @@ function useGridEditing({ tableId, fields, rows, reload, reloadAfterWrite, canWr
7078
7082
  discard,
7079
7083
  forget: (cells) => {
7080
7084
  if (cells.length === 0) return;
7081
- for (const cell of cells) versions.current.delete(cell.rowId);
7085
+ for (const cell2 of cells) versions.current.delete(cell2.rowId);
7082
7086
  setOptimistic((held) => {
7083
7087
  let next = null;
7084
- for (const cell of cells) {
7085
- const id = cellKey(cell.rowId, cell.key);
7088
+ for (const cell2 of cells) {
7089
+ const id = cellKey(cell2.rowId, cell2.key);
7086
7090
  if (!(id in held)) continue;
7087
7091
  next = next ?? { ...held };
7088
7092
  delete next[id];
@@ -7556,7 +7560,13 @@ function OpenCell({
7556
7560
  "data-matrx-cell-fill": "",
7557
7561
  "data-matrx-cell-editor": "",
7558
7562
  tabIndex: -1,
7559
- className: "relative z-[25] flex w-full min-w-0 max-w-full flex-col gap-1 outline-none",
7563
+ className: cn19(
7564
+ "relative z-[25] flex w-full min-w-0 max-w-full flex-col gap-1 outline-none",
7565
+ FLOATING_EDITOR_NOTE_CLASS,
7566
+ // A field's own input is 36px (h-9); in a 35px row it grew the row 4px. In the cell it is
7567
+ // the row action strip's 32px, so opening a cell never changes the row (STABLE-TABLES).
7568
+ "[&_input:not([type=checkbox]):not([type=radio])]:h-8 [&_input:not([type=checkbox]):not([type=radio])]:py-0"
7569
+ ),
7560
7570
  onDoubleClick: (event) => event.stopPropagation(),
7561
7571
  onKeyDown: (event) => {
7562
7572
  if (event.target?.closest?.("[data-refusal-notice], [data-records-choice-ask]")) return;
@@ -7611,7 +7621,7 @@ function OpenCell({
7611
7621
  addsChoices: true
7612
7622
  }
7613
7623
  ),
7614
- picker || asksAboutAChoice(draft) ? null : blurCommits ? /* @__PURE__ */ jsx28("span", { className: "text-[10px] text-muted-foreground", children: multiline ? "\u23CE saves \xB7 \u21E7\u23CE new line \xB7 Esc cancels \xB7 Tab next" : "\u23CE saves \xB7 Esc cancels \xB7 Tab next" }) : /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1", children: [
7624
+ picker || asksAboutAChoice(draft) ? null : blurCommits ? /* @__PURE__ */ jsx28("span", { className: cn19("text-[10px] text-muted-foreground", FLOATING_EDITOR_TRAY_CLASS, "top-full mt-1"), "data-records-editor-hint": "", children: multiline ? "\u23CE saves \xB7 \u21E7\u23CE new line \xB7 Esc cancels \xB7 Tab next" : "\u23CE saves \xB7 Esc cancels \xB7 Tab next" }) : /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1", children: [
7615
7625
  /* @__PURE__ */ jsx28(Button10, { size: "sm", onClick: () => once(() => onCommit(null, "pick")), children: "Save" }),
7616
7626
  /* @__PURE__ */ jsx28(Button10, { size: "sm", variant: "ghost", onClick: () => once(() => onCancel("pick")), children: "Cancel" })
7617
7627
  ] }),
@@ -7645,7 +7655,7 @@ function rememberRowCount(key, count) {
7645
7655
  }
7646
7656
 
7647
7657
  // src/RecordsSkeleton.tsx
7648
- import { cn as cn20, Skeleton } from "@ai-matrx/design-system";
7658
+ import { cn as cn20, Skeleton as Skeleton2 } from "@ai-matrx/design-system";
7649
7659
  import { MatrxDataTable } from "@ai-matrx/design-system/data-table";
7650
7660
  import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
7651
7661
  var RECORDS_SKELETON_LAYOUTS = [
@@ -7701,7 +7711,7 @@ function GridSkeleton({ embedded, rows }) {
7701
7711
  var CHART_PLOT_PX = 140;
7702
7712
  var RECORDS_GRID_ROW_PX = 35;
7703
7713
  function Cards({ count, className }) {
7704
- return /* @__PURE__ */ jsx29(Fragment8, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx29(Skeleton, { shape: "block", className }, i)) });
7714
+ return /* @__PURE__ */ jsx29(Fragment8, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx29(Skeleton2, { shape: "block", className }, i)) });
7705
7715
  }
7706
7716
  function BodySkeleton({ layout, embedded, rows }) {
7707
7717
  const lineCount = rows === "fill" ? 12 : rows;
@@ -7711,7 +7721,7 @@ function BodySkeleton({ layout, embedded, rows }) {
7711
7721
  return /* @__PURE__ */ jsx29(GridSkeleton, { embedded, rows });
7712
7722
  case "kanban":
7713
7723
  return /* @__PURE__ */ jsx29("div", { className: "flex min-h-0 flex-1 gap-2 overflow-hidden pb-2", "data-records-skeleton-part": "body", children: Array.from({ length: 4 }, (_, c) => /* @__PURE__ */ jsxs24("div", { className: "flex w-64 shrink-0 flex-col gap-2 rounded-lg bg-muted/40 p-2", children: [
7714
- /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: "1/2", className: "my-1.5" }),
7724
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: "1/2", className: "my-1.5" }),
7715
7725
  /* @__PURE__ */ jsx29(Cards, { count: 3 - c % 2, className: "h-24" })
7716
7726
  ] }, c)) });
7717
7727
  case "gallery":
@@ -7725,33 +7735,33 @@ function BodySkeleton({ layout, embedded, rows }) {
7725
7735
  );
7726
7736
  case "list":
7727
7737
  return /* @__PURE__ */ jsx29("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", "data-records-skeleton-part": "body", children: Array.from({ length: lineCount }, (_, i) => /* @__PURE__ */ jsxs24("div", { className: "flex h-9 items-center gap-3 border-b border-border/60 px-2", children: [
7728
- /* @__PURE__ */ jsx29(Skeleton, { className: "size-4" }),
7729
- /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: i % 3 === 0 ? "1/2" : i % 3 === 1 ? "2/3" : "1/3" })
7738
+ /* @__PURE__ */ jsx29(Skeleton2, { className: "size-4" }),
7739
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: i % 3 === 0 ? "1/2" : i % 3 === 1 ? "2/3" : "1/3" })
7730
7740
  ] }, i)) });
7731
7741
  case "calendar":
7732
7742
  return /* @__PURE__ */ jsxs24("div", { className: "flex min-h-0 flex-1 flex-col gap-2 overflow-hidden", "data-records-skeleton-part": "body", children: [
7733
- /* @__PURE__ */ jsx29("div", { className: "grid grid-cols-7 gap-px", children: Array.from({ length: 7 }, (_, i) => /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: "1/3", className: "mx-auto my-1" }, i)) }),
7734
- /* @__PURE__ */ jsx29("div", { className: "grid flex-1 grid-cols-7 grid-rows-5 gap-px overflow-hidden rounded-md border border-border bg-border", children: Array.from({ length: 35 }, (_, i) => /* @__PURE__ */ jsx29("div", { className: "bg-card p-1.5", children: /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: "1/3" }) }, i)) })
7743
+ /* @__PURE__ */ jsx29("div", { className: "grid grid-cols-7 gap-px", children: Array.from({ length: 7 }, (_, i) => /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: "1/3", className: "mx-auto my-1" }, i)) }),
7744
+ /* @__PURE__ */ jsx29("div", { className: "grid flex-1 grid-cols-7 grid-rows-5 gap-px overflow-hidden rounded-md border border-border bg-border", children: Array.from({ length: 35 }, (_, i) => /* @__PURE__ */ jsx29("div", { className: "bg-card p-1.5", children: /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: "1/3" }) }, i)) })
7735
7745
  ] });
7736
7746
  case "timeline":
7737
7747
  return /* @__PURE__ */ jsxs24("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border border-border", "data-records-skeleton-part": "body", children: [
7738
- /* @__PURE__ */ jsx29("div", { className: "flex h-9 items-center gap-6 border-b border-border px-3", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: "sm", className: "w-16" }, i)) }),
7739
- Array.from({ length: Math.min(lineCount, 8) }, (_, i) => /* @__PURE__ */ jsx29("div", { className: "flex h-10 items-center border-b border-border/60 px-3", children: /* @__PURE__ */ jsx29(Skeleton, { className: "h-6 rounded-md", style: { marginLeft: `${i * 13 % 45}%`, width: `${20 + i * 7 % 25}%` } }) }, i))
7748
+ /* @__PURE__ */ jsx29("div", { className: "flex h-9 items-center gap-6 border-b border-border px-3", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: "sm", className: "w-16" }, i)) }),
7749
+ Array.from({ length: Math.min(lineCount, 8) }, (_, i) => /* @__PURE__ */ jsx29("div", { className: "flex h-10 items-center border-b border-border/60 px-3", children: /* @__PURE__ */ jsx29(Skeleton2, { className: "h-6 rounded-md", style: { marginLeft: `${i * 13 % 45}%`, width: `${20 + i * 7 % 25}%` } }) }, i))
7740
7750
  ] });
7741
7751
  case "form":
7742
7752
  case "record":
7743
7753
  return /* @__PURE__ */ jsxs24("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-hidden", "data-records-skeleton-part": "body", children: [
7744
- /* @__PURE__ */ jsx29(Skeleton, { shape: "title", width: "1/2" }),
7754
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "title", width: "1/2" }),
7745
7755
  /* @__PURE__ */ jsx29("div", { className: "grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-1.5", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsxs24("div", { className: "contents", children: [
7746
- /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: "2/3", className: "my-1.5" }),
7747
- /* @__PURE__ */ jsx29(Skeleton, { shape: "row", className: "h-7" })
7756
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: "2/3", className: "my-1.5" }),
7757
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "row", className: "h-7" })
7748
7758
  ] }, i)) }),
7749
- layout === "record" ? /* @__PURE__ */ jsx29(Skeleton, { shape: "block", height: "lg" }) : /* @__PURE__ */ jsx29(Skeleton, { shape: "control", width: "sm" })
7759
+ layout === "record" ? /* @__PURE__ */ jsx29(Skeleton2, { shape: "block", height: "lg" }) : /* @__PURE__ */ jsx29(Skeleton2, { shape: "control", width: "sm" })
7750
7760
  ] });
7751
7761
  case "chart":
7752
7762
  return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-2", "data-records-skeleton-part": "body", children: [
7753
- embedded ? null : /* @__PURE__ */ jsx29(Skeleton, { shape: "line", width: "1/3" }),
7754
- /* @__PURE__ */ jsx29(Skeleton, { shape: "block", style: { height: CHART_PLOT_PX } })
7763
+ embedded ? null : /* @__PURE__ */ jsx29(Skeleton2, { shape: "line", width: "1/3" }),
7764
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "block", style: { height: CHART_PLOT_PX } })
7755
7765
  ] });
7756
7766
  }
7757
7767
  }
@@ -7776,12 +7786,12 @@ function TablePageSkeleton({
7776
7786
  }) {
7777
7787
  return /* @__PURE__ */ jsx29("div", { className: cn20(TABLE_PAGE_FRAME_CLASS, className), "data-records-skeleton-page": layout, children: /* @__PURE__ */ jsxs24("div", { className: TABLE_PAGE_COLUMN_CLASS, children: [
7778
7788
  /* @__PURE__ */ jsxs24("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "data-records-skeleton-part": "toolbar", "aria-hidden": "true", children: [
7779
- /* @__PURE__ */ jsx29(Skeleton, { shape: "control", width: "sm", className: "w-28" }),
7780
- /* @__PURE__ */ jsx29(Skeleton, { shape: "control", className: "w-16" }),
7781
- /* @__PURE__ */ jsx29(Skeleton, { shape: "control", className: "w-16" }),
7789
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "control", width: "sm", className: "w-28" }),
7790
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "control", className: "w-16" }),
7791
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "control", className: "w-16" }),
7782
7792
  /* @__PURE__ */ jsxs24("div", { className: "ml-auto flex items-center gap-1.5", children: [
7783
- /* @__PURE__ */ jsx29(Skeleton, { shape: "control", width: "md" }),
7784
- /* @__PURE__ */ jsx29(Skeleton, { shape: "control", className: "w-24" })
7793
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "control", width: "md" }),
7794
+ /* @__PURE__ */ jsx29(Skeleton2, { shape: "control", className: "w-24" })
7785
7795
  ] })
7786
7796
  ] }),
7787
7797
  /* @__PURE__ */ jsx29("div", { className: "flex min-h-0 flex-1 flex-col gap-2", "data-table-records": "", children: /* @__PURE__ */ jsx29(RecordsSkeleton, { layout, embedded, ...rows !== void 0 ? { rows } : {} }) })
@@ -8321,7 +8331,7 @@ function FormulaTextEditor({
8321
8331
  // src/EntityReferenceKindPicker.tsx
8322
8332
  import { useMemo as useMemo12, useState as useState25 } from "react";
8323
8333
  import { useEntityReferenceKinds as useEntityReferenceKinds2 } from "@ai-matrx/records/react";
8324
- import { Badge as Badge6, BasicInput as BasicInput7, Checkbox as Checkbox5, Label as Label4, Skeleton as Skeleton2, cn as cn22 } from "@ai-matrx/design-system";
8334
+ import { Badge as Badge6, BasicInput as BasicInput7, Checkbox as Checkbox5, Label as Label4, Skeleton as Skeleton3, cn as cn22 } from "@ai-matrx/design-system";
8325
8335
  import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
8326
8336
  var ENTITY_REFERENCE_KINDS_MISSING = "Choose at least one kind of thing this column points at.";
8327
8337
  function entityReferenceSpec(input) {
@@ -8388,7 +8398,7 @@ function EntityReferenceKindPicker({ value, onChange, locked = false, className
8388
8398
  }
8389
8399
  )
8390
8400
  ] }, token)) }) : null,
8391
- locked ? /* @__PURE__ */ jsx32("p", { className: "text-[11px] text-muted-foreground", children: "The kinds an existing column points at are kept as they are; add a new column to point at others." }) : error ? /* @__PURE__ */ jsx32(RefusalNotice, { error }) : loading ? /* @__PURE__ */ jsx32(Skeleton2, { className: "h-24 w-full" }) : /* @__PURE__ */ jsxs27(Fragment9, { children: [
8401
+ locked ? /* @__PURE__ */ jsx32("p", { className: "text-[11px] text-muted-foreground", children: "The kinds an existing column points at are kept as they are; add a new column to point at others." }) : error ? /* @__PURE__ */ jsx32(RefusalNotice, { error }) : loading ? /* @__PURE__ */ jsx32(Skeleton3, { className: "h-24 w-full" }) : /* @__PURE__ */ jsxs27(Fragment9, { children: [
8392
8402
  /* @__PURE__ */ jsx32(
8393
8403
  BasicInput7,
8394
8404
  {
@@ -10351,7 +10361,7 @@ var ROLLUP_OPERATIONS = ROLLUP_AGG_VALUES.map((value) => ({
10351
10361
  label: ROLLUP_AGG_LABEL[value]
10352
10362
  }));
10353
10363
  var FORMULA_SEPARATOR_LABEL = "Joined by";
10354
- var EDITING_A_WORKED_OUT_COLUMN = "This column works out its answer from the columns picked when it was made. To change what it works out, write it as a formula below \u2014 the store checks it as you type, and a rename alone leaves it exactly as it is.";
10364
+ var EDITING_A_WORKED_OUT_COLUMN = "Written as a formula. Edit it below.";
10355
10365
  var FORMULA_DEFAULT_SEPARATOR = " \u2014 ";
10356
10366
  var FORMULA_OPERATIONS = FORMULA_OP_VALUES.map((value) => ({
10357
10367
  value,
@@ -10736,8 +10746,7 @@ function FieldEditor(props) {
10736
10746
  placeholder: "Day rate",
10737
10747
  onChange: (e) => setLabel(e.target.value)
10738
10748
  }
10739
- ),
10740
- /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: onEntity ? "What people will read beside the value." : "What people will read at the top of the column." })
10749
+ )
10741
10750
  ] }),
10742
10751
  /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-1", children: [
10743
10752
  /* @__PURE__ */ jsx40(Label8, { className: "text-xs", children: "What it holds" }),
@@ -10748,7 +10757,7 @@ function FieldEditor(props) {
10748
10757
  disabled: editing,
10749
10758
  onValueChange: (next) => setType(next),
10750
10759
  children: [
10751
- /* @__PURE__ */ jsx40(SelectTrigger7, { size: "sm", "aria-label": "What this field holds", children: /* @__PURE__ */ jsx40(SelectValue7, {}) }),
10760
+ /* @__PURE__ */ jsx40(SelectTrigger7, { size: "sm", "aria-label": "What this field holds", ...choice?.explanation ? { title: choice.explanation } : {}, children: /* @__PURE__ */ jsx40(SelectValue7, {}) }),
10752
10761
  /* @__PURE__ */ jsx40(SelectContent7, { children: FIELD_TYPE_GROUPS.filter((group) => offered.some((c) => c.group === group)).map((group) => /* @__PURE__ */ jsxs35(SelectGroup2, { children: [
10753
10762
  /* @__PURE__ */ jsx40(SelectLabel2, { children: group }),
10754
10763
  FIELD_TYPE_CATALOGUE.filter((c) => c.group === group && (c.id === type || offered.includes(c))).map((c) => /* @__PURE__ */ jsx40(SelectItem7, { value: c.id, children: c.label }, c.id))
@@ -10756,7 +10765,7 @@ function FieldEditor(props) {
10756
10765
  ]
10757
10766
  }
10758
10767
  ),
10759
- editing && field2 ? /* @__PURE__ */ jsx40(FieldRetype, { field: liveField ?? field2, tableId }) : /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: choice?.explanation ?? "" })
10768
+ editing && field2 ? /* @__PURE__ */ jsx40(FieldRetype, { field: liveField ?? field2, tableId }) : null
10760
10769
  ] })
10761
10770
  ] }),
10762
10771
  type === "formula" && others.length > 0 ? /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-2", children: [
@@ -10794,7 +10803,7 @@ function FieldEditor(props) {
10794
10803
  columns: others
10795
10804
  }
10796
10805
  ) : null
10797
- ] }) : editing && type === "formula" ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "This column works out its answer from other columns, and this table has no other column left for it to read." }) : null,
10806
+ ] }) : editing && type === "formula" ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "No other column to read." }) : null,
10798
10807
  editing && field2 && !onEntity && (type === "lookup" || type === "rollup") ? /* @__PURE__ */ jsx40(SourceArchivedNotice, { fieldId: field2.id, tableId }) : null,
10799
10808
  !editing && !(type === "formula" && formulaWritten) || type === "select" || type === "multi_select" || type === "status" || type === "rating" || type === "barcode" || type === "relation" || type === "entity_reference" ? /* @__PURE__ */ jsx40(
10800
10809
  TypeQuestions,
@@ -10964,11 +10973,7 @@ function FieldEditor(props) {
10964
10973
  ),
10965
10974
  UNIQUE_LABEL
10966
10975
  ] }) : null,
10967
- rules.length === 0 ? /* @__PURE__ */ jsxs35("p", { className: "text-muted-foreground", children: [
10968
- "No checks. Anything this kind of ",
10969
- onEntity ? "field" : "column",
10970
- " can hold will be accepted."
10971
- ] }) : null,
10976
+ rules.length === 0 ? /* @__PURE__ */ jsx40("p", { className: "text-muted-foreground", children: "No checks." }) : null,
10972
10977
  rules.map((rule, index) => rule.kind === "unique" ? null : /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-1", children: [
10973
10978
  /* @__PURE__ */ jsxs35(
10974
10979
  Select7,
@@ -11217,8 +11222,7 @@ function TypeQuestions(props) {
11217
11222
  placeholder: "$",
11218
11223
  onChange: (e) => props.setUnit(e.target.value)
11219
11224
  }
11220
- ),
11221
- /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "Shown with every amount, everywhere the value appears \u2014 including where an assistant reads it." })
11225
+ )
11222
11226
  ] });
11223
11227
  }
11224
11228
  if (type === "datetime") {
@@ -11237,7 +11241,7 @@ function TypeQuestions(props) {
11237
11241
  if (type === "lookup" || type === "rollup" || type === "count") {
11238
11242
  const usable = props.relations;
11239
11243
  if (usable.length === 0) {
11240
- return /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: type !== "lookup" ? "No link, Person or File column yet. Add one that holds more than one first." : "No link, Person or File column yet. Add one first." });
11244
+ return /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "No link, Person or File column yet." });
11241
11245
  }
11242
11246
  return /* @__PURE__ */ jsxs35("div", { className: "grid gap-3 sm:grid-cols-2", children: [
11243
11247
  /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-1", children: [
@@ -11283,7 +11287,7 @@ function TypeQuestions(props) {
11283
11287
  }
11284
11288
  if (type === "formula") {
11285
11289
  if (props.others.length === 0) {
11286
- return /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "A worked-out column needs other columns to work from, and this table has none yet." });
11290
+ return /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "No other columns yet." });
11287
11291
  }
11288
11292
  return /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-2", children: [
11289
11293
  /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-1", children: [
@@ -11310,8 +11314,7 @@ function TypeQuestions(props) {
11310
11314
  },
11311
11315
  f.id
11312
11316
  );
11313
- }) }),
11314
- /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "In the order you pick them. Columns are remembered by which column they are, so renaming one never breaks this." })
11317
+ }) })
11315
11318
  ] }),
11316
11319
  props.formulaOp === "concat" ? /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-1", children: [
11317
11320
  /* @__PURE__ */ jsx40(Label8, { className: "text-xs", children: FORMULA_SEPARATOR_LABEL }),
@@ -11324,8 +11327,7 @@ function TypeQuestions(props) {
11324
11327
  className: "max-w-[10rem]",
11325
11328
  onChange: (e) => props.setFormulaSeparator(e.target.value)
11326
11329
  }
11327
- ),
11328
- /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "What goes between the columns. Leave it empty to run them straight together." })
11330
+ )
11329
11331
  ] }) : null
11330
11332
  ] });
11331
11333
  }
@@ -11411,18 +11413,14 @@ function ValueOnTheOtherSide({
11411
11413
  const carried = sample.data?.rows[0]?.document ?? null;
11412
11414
  const offered = declared2.length > 0 ? declared2.map((f) => ({ key: f.key, name: fieldName(f) })) : Object.keys(carried ?? {}).map((key) => ({ key, name: humanizeIdentifier5(key) }));
11413
11415
  const stillAsking = columns.loading || declared2.length === 0 && sample.loading;
11414
- const body = !relation ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ jsxs35("p", { className: "text-[11px] text-muted-foreground", children: [
11415
- fieldName(relation),
11416
- " points at a table that has no columns to read yet. Add one there first."
11417
- ] }) : /* @__PURE__ */ jsxs35(Select7, { value, onValueChange: onChange, children: [
11416
+ const body = !relation ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "Choose the column above first." }) : stillAsking ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "Reading that table's columns\u2026" }) : offered.length === 0 ? /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: "No columns to read yet." }) : /* @__PURE__ */ jsxs35(Select7, { value, onValueChange: onChange, children: [
11418
11417
  /* @__PURE__ */ jsx40(SelectTrigger7, { size: "sm", "aria-label": label, children: /* @__PURE__ */ jsx40(SelectValue7, { placeholder: "Choose a column" }) }),
11419
11418
  /* @__PURE__ */ jsx40(SelectContent7, { children: offered.map((column) => /* @__PURE__ */ jsx40(SelectItem7, { value: column.key, children: column.name }, column.key)) })
11420
11419
  ] });
11421
11420
  if (compact) return /* @__PURE__ */ jsx40("div", { className: "mt-1 flex flex-col gap-1", children: body });
11422
11421
  return /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-1", children: [
11423
- /* @__PURE__ */ jsx40(Label8, { className: "text-xs", children: label }),
11424
- body,
11425
- /* @__PURE__ */ jsx40("p", { className: "text-[11px] text-muted-foreground", children: help })
11422
+ /* @__PURE__ */ jsx40(Label8, { className: "text-xs", title: help, children: label }),
11423
+ body
11426
11424
  ] });
11427
11425
  }
11428
11426
  function withNumber(rule, key, typed2) {
@@ -11804,10 +11802,10 @@ function useGridColours(args) {
11804
11802
  submenu: swatches("sel-highlight", void 0, (color) => {
11805
11803
  void (async () => {
11806
11804
  let kept = 0;
11807
- for (const cell of cells) {
11808
- const field2 = idOf(cell.columnKey);
11805
+ for (const cell2 of cells) {
11806
+ const field2 = idOf(cell2.columnKey);
11809
11807
  if (!field2) continue;
11810
- const answer = await client.tableDecorate({ table_id: tableId, path: ["cells", cell.rowId, field2.id], value: color });
11808
+ const answer = await client.tableDecorate({ table_id: tableId, path: ["cells", cell2.rowId, field2.id], value: color });
11811
11809
  if (!answer.ok) {
11812
11810
  notify?.error(`The colour was not kept: ${refusalSentence(answer.error)}`);
11813
11811
  return;
@@ -12261,15 +12259,15 @@ function ActionRowPreview({
12261
12259
  }) {
12262
12260
  const formulas = preview.cells.map((c) => c.formula ?? "").filter((f) => f.trim() !== "");
12263
12261
  const readings = useFormulaReadings(tableId, formulas);
12264
- const afterWords = (cell) => {
12265
- if (cell.how === "compute") {
12266
- const reading = cell.formula ? readings[cell.formula] : void 0;
12262
+ const afterWords = (cell2) => {
12263
+ if (cell2.how === "compute") {
12264
+ const reading = cell2.formula ? readings[cell2.formula] : void 0;
12267
12265
  if (reading && reading.ok === false) return { text: `The store cannot read this formula: ${reading.error}`, note: true };
12268
12266
  const kind = reading && reading.ok ? RESULT_WORDS[reading.result_type] ?? "a value" : "the result";
12269
- return { text: `Worked out when it runs \u2014 ${kind}${cell.formula ? ` from ${cell.formula}` : ""}`, note: true };
12267
+ return { text: `Worked out when it runs \u2014 ${kind}${cell2.formula ? ` from ${cell2.formula}` : ""}`, note: true };
12270
12268
  }
12271
- if (cell.computed && cell.how === null) return { text: words(cell.before) || "empty", note: false };
12272
- return { text: words(cell.after) || "empty", note: false };
12269
+ if (cell2.computed && cell2.how === null) return { text: words(cell2.before) || "empty", note: false };
12270
+ return { text: words(cell2.after) || "empty", note: false };
12273
12271
  };
12274
12272
  return /* @__PURE__ */ jsxs39("div", { className: "flex flex-col gap-1", "data-records-action-row-preview": "", children: [
12275
12273
  /* @__PURE__ */ jsx44("div", { className: "max-w-full overflow-x-auto rounded border", children: /* @__PURE__ */ jsxs39(
@@ -12282,38 +12280,38 @@ function ActionRowPreview({
12282
12280
  children: [
12283
12281
  /* @__PURE__ */ jsxs39("div", { role: "row", className: "contents", children: [
12284
12282
  /* @__PURE__ */ jsx44("span", { role: "columnheader", className: "sticky left-0 bg-muted/60 px-2 py-1" }),
12285
- preview.cells.map((cell) => /* @__PURE__ */ jsx44(
12283
+ preview.cells.map((cell2) => /* @__PURE__ */ jsx44(
12286
12284
  "span",
12287
12285
  {
12288
12286
  role: "columnheader",
12289
- title: cell.name,
12290
- className: cn25("truncate border-l bg-muted/60 px-2 py-1 font-medium", cell.changed ? "text-foreground" : "text-muted-foreground"),
12291
- children: cell.name
12287
+ title: cell2.name,
12288
+ className: cn25("truncate border-l bg-muted/60 px-2 py-1 font-medium", cell2.changed ? "text-foreground" : "text-muted-foreground"),
12289
+ children: cell2.name
12292
12290
  },
12293
- cell.key
12291
+ cell2.key
12294
12292
  ))
12295
12293
  ] }),
12296
12294
  ["before", "after"].map((which) => /* @__PURE__ */ jsxs39("div", { role: "row", className: "contents", "data-preview-row": which, children: [
12297
12295
  /* @__PURE__ */ jsx44("span", { role: "rowheader", className: "sticky left-0 border-t bg-background px-2 py-1 font-medium text-muted-foreground", children: which === "before" ? "Now" : "After" }),
12298
- preview.cells.map((cell) => {
12299
- const shown4 = which === "before" ? { text: words(cell.before) || "empty", note: false } : afterWords(cell);
12296
+ preview.cells.map((cell2) => {
12297
+ const shown4 = which === "before" ? { text: words(cell2.before) || "empty", note: false } : afterWords(cell2);
12300
12298
  return /* @__PURE__ */ jsx44(
12301
12299
  "span",
12302
12300
  {
12303
12301
  role: "cell",
12304
- "data-changed": cell.changed ? "true" : void 0,
12305
- "data-records-preview-cell": cell.key,
12302
+ "data-changed": cell2.changed ? "true" : void 0,
12303
+ "data-records-preview-cell": cell2.key,
12306
12304
  title: shown4.text,
12307
12305
  className: cn25(
12308
12306
  "truncate border-l border-t px-2 py-1",
12309
12307
  shown4.text === "empty" && "italic text-muted-foreground",
12310
- cell.changed && which === "before" && "bg-destructive/10 text-destructive line-through",
12311
- cell.changed && which === "after" && "bg-primary/10 font-medium",
12308
+ cell2.changed && which === "before" && "bg-destructive/10 text-destructive line-through",
12309
+ cell2.changed && which === "after" && "bg-primary/10 font-medium",
12312
12310
  shown4.note && "italic"
12313
12311
  ),
12314
12312
  children: shown4.text
12315
12313
  },
12316
- cell.key
12314
+ cell2.key
12317
12315
  );
12318
12316
  })
12319
12317
  ] }, which))
@@ -13823,15 +13821,15 @@ function planPastedBlock(args) {
13823
13821
  for (const refusal4 of predicted) {
13824
13822
  const key = refusal4.field_key;
13825
13823
  if (key === void 0) continue;
13826
- const cell = built.find((b) => b.key === key && b.refusal === null);
13827
- if (!cell) continue;
13828
- cell.refusal = refusal4.message;
13829
- cell.value = null;
13824
+ const cell2 = built.find((b) => b.key === key && b.refusal === null);
13825
+ if (!cell2) continue;
13826
+ cell2.refusal = refusal4.message;
13827
+ cell2.value = null;
13830
13828
  delete accepted[key];
13831
13829
  refusals.push({
13832
13830
  fromLine,
13833
13831
  column: fieldName(byKey.get(key) ?? { key }),
13834
- raw: cell.raw,
13832
+ raw: cell2.raw,
13835
13833
  why: refusal4.message
13836
13834
  });
13837
13835
  }
@@ -13859,7 +13857,7 @@ function planPastedBlock(args) {
13859
13857
  }
13860
13858
  function documentOf(row) {
13861
13859
  const out = {};
13862
- for (const cell of row.cells) if (cell.refusal === null) out[cell.key] = cell.value;
13860
+ for (const cell2 of row.cells) if (cell2.refusal === null) out[cell2.key] = cell2.value;
13863
13861
  return out;
13864
13862
  }
13865
13863
  var sameWords = (text) => text.trim().replace(/\s+/g, " ").toLowerCase();
@@ -13880,11 +13878,11 @@ function readPasteHeader(args) {
13880
13878
  let named = 0;
13881
13879
  let filled = 0;
13882
13880
  columnKeys.forEach((_, c) => {
13883
- const cell = head[c];
13884
- if (cell === void 0 || cell.trim() === "") return;
13881
+ const cell2 = head[c];
13882
+ if (cell2 === void 0 || cell2.trim() === "") return;
13885
13883
  filled += 1;
13886
- const hits = [...new Set(byName.get(sameWords(cell)) ?? [])];
13887
- const named1 = hits.filter((f) => sameWords(fieldName(f)) === sameWords(cell));
13884
+ const hits = [...new Set(byName.get(sameWords(cell2)) ?? [])];
13885
+ const named1 = hits.filter((f) => sameWords(fieldName(f)) === sameWords(cell2));
13888
13886
  const pick = named1.length > 0 ? named1 : hits;
13889
13887
  if (pick.length !== 1) return;
13890
13888
  const only = pick[0];
@@ -13895,8 +13893,8 @@ function readPasteHeader(args) {
13895
13893
  });
13896
13894
  if (named === 0 || named * 2 < filled) return null;
13897
13895
  const unmatched = columnKeys.flatMap((_, c) => {
13898
- const cell = head[c];
13899
- return mapped[c] === null && cell !== void 0 && cell.trim() !== "" ? [cell.trim()] : [];
13896
+ const cell2 = head[c];
13897
+ return mapped[c] === null && cell2 !== void 0 && cell2.trim() !== "" ? [cell2.trim()] : [];
13900
13898
  });
13901
13899
  return { columnKeys: mapped, unmatched, lines: lines.slice(1) };
13902
13900
  }
@@ -14233,7 +14231,7 @@ function useMergedGridControls(args) {
14233
14231
  }
14234
14232
  } : {},
14235
14233
  clearCells: (cells) => {
14236
- for (const cell of cells) editing.setCell(cell.rowId, cell.columnId, null);
14234
+ for (const cell2 of cells) editing.setCell(cell2.rowId, cell2.columnId, null);
14237
14235
  },
14238
14236
  fillDown: (rowIds, columnIds) => {
14239
14237
  const byId = new Map(rows.map((r) => [r.id, r]));
@@ -16147,29 +16145,29 @@ import {
16147
16145
  HoverCardTrigger,
16148
16146
  Input as Input2,
16149
16147
  Label as Label13,
16150
- Skeleton as Skeleton3,
16148
+ Skeleton as Skeleton4,
16151
16149
  Switch,
16152
16150
  cn as cn32
16153
16151
  } from "@ai-matrx/design-system";
16154
16152
  import { formatRelativeTime as formatRelativeTime2 } from "@ai-matrx/kit/format";
16155
16153
  import { Fragment as Fragment16, jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
16156
16154
  var NO_ENRICH_REASON = "Having an agent fill this column is not switched on here yet, so this panel does not offer it rather than offering something that cannot happen. Everything else on this panel works. It is on our list, not yours.";
16157
- function cellState(cell) {
16158
- if (!cell || !cell.agent_owned) return "none";
16159
- if (cell.pinned) return "yours";
16160
- if (cell.absent_reason === "conflicting") return "unsure";
16161
- if (cell.actor === "agent") return "agent";
16155
+ function cellState(cell2) {
16156
+ if (!cell2 || !cell2.agent_owned) return "none";
16157
+ if (cell2.pinned) return "yours";
16158
+ if (cell2.absent_reason === "conflicting") return "unsure";
16159
+ if (cell2.actor === "agent") return "agent";
16162
16160
  return "none";
16163
16161
  }
16164
16162
  function ago(at) {
16165
16163
  return at ? formatRelativeTime2(at, { style: "intl", fallback: "" }) : "";
16166
16164
  }
16167
- function EnrichBadge({ cell, onPin, className }) {
16168
- const state = cellState(cell);
16169
- if (!cell || state === "none") return null;
16170
- const source = cell.source ?? {};
16165
+ function EnrichBadge({ cell: cell2, onPin, className }) {
16166
+ const state = cellState(cell2);
16167
+ if (!cell2 || state === "none") return null;
16168
+ const source = cell2.source ?? {};
16171
16169
  const read = Array.isArray(source.read) ? source.read : [];
16172
- const alternates = cell.alternates ?? [];
16170
+ const alternates = cell2.alternates ?? [];
16173
16171
  const word = state === "yours" ? "yours" : state === "unsure" ? "unsure" : "agent";
16174
16172
  return /* @__PURE__ */ jsxs52(HoverCard, { openDelay: 120, children: [
16175
16173
  /* @__PURE__ */ jsx57(HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ jsxs52("span", { className: cn32("inline-flex items-center gap-1 align-middle", className), children: [
@@ -16181,18 +16179,18 @@ function EnrichBadge({ cell, onPin, className }) {
16181
16179
  children: word
16182
16180
  }
16183
16181
  ),
16184
- cell.stale ? /* @__PURE__ */ jsx57(Badge8, { variant: "outline", className: "text-[10px] font-normal leading-none opacity-70", children: "stale" }) : null
16182
+ cell2.stale ? /* @__PURE__ */ jsx57(Badge8, { variant: "outline", className: "text-[10px] font-normal leading-none opacity-70", children: "stale" }) : null
16185
16183
  ] }) }),
16186
16184
  /* @__PURE__ */ jsxs52(HoverCardContent, { className: "w-80 space-y-2 text-xs", children: [
16187
16185
  /* @__PURE__ */ jsx57("p", { className: "font-medium", children: state === "yours" ? "You typed this one in" : state === "unsure" ? "A model had candidates and committed to none" : "Filled in by a model" }),
16188
- state !== "yours" && cell.on_behalf_of ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
16186
+ state !== "yours" && cell2.on_behalf_of ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
16189
16187
  "Acting for ",
16190
- cell.on_behalf_of,
16191
- cell.written_at ? `, ${ago(cell.written_at)}` : "",
16188
+ cell2.on_behalf_of,
16189
+ cell2.written_at ? `, ${ago(cell2.written_at)}` : "",
16192
16190
  "."
16193
- ] }) : cell.written_at ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
16191
+ ] }) : cell2.written_at ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
16194
16192
  "Written ",
16195
- ago(cell.written_at),
16193
+ ago(cell2.written_at),
16196
16194
  "."
16197
16195
  ] }) : null,
16198
16196
  source.model ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
@@ -16209,9 +16207,9 @@ function EnrichBadge({ cell, onPin, className }) {
16209
16207
  /* @__PURE__ */ jsx57("p", { className: "text-muted-foreground", children: state === "unsure" ? "What it considered" : "What it nearly said instead" }),
16210
16208
  /* @__PURE__ */ jsx57("ul", { className: "list-inside list-decimal", children: alternates.slice(0, 4).map((a, i) => /* @__PURE__ */ jsx57("li", { children: String(a.value ?? "") }, i)) })
16211
16209
  ] }) : null,
16212
- cell.stale && cell.due_at ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
16210
+ cell2.stale && cell2.due_at ? /* @__PURE__ */ jsxs52("p", { className: "text-muted-foreground", children: [
16213
16211
  "Past its date \u2014 it was due to be looked at again ",
16214
- ago(cell.due_at),
16212
+ ago(cell2.due_at),
16215
16213
  ". The value is still here; nothing was overwritten."
16216
16214
  ] }) : null,
16217
16215
  onPin ? /* @__PURE__ */ jsx57(
@@ -16220,8 +16218,8 @@ function EnrichBadge({ cell, onPin, className }) {
16220
16218
  size: "sm",
16221
16219
  variant: "outline",
16222
16220
  className: "w-full",
16223
- onClick: () => void onPin(!cell.pinned),
16224
- children: cell.pinned ? "Let the model fill this in again" : "Keep this one \u2014 stop the model changing it"
16221
+ onClick: () => void onPin(!cell2.pinned),
16222
+ children: cell2.pinned ? "Let the model fill this in again" : "Keep this one \u2014 stop the model changing it"
16225
16223
  }
16226
16224
  ) : null
16227
16225
  ] })
@@ -16244,7 +16242,7 @@ function useEnrichCells(tableId, recordIds) {
16244
16242
  }
16245
16243
  setError(null);
16246
16244
  const next = /* @__PURE__ */ new Map();
16247
- for (const cell of answered.data) next.set(`${cell.record_id}:${cell.field_key}`, cell);
16245
+ for (const cell2 of answered.data) next.set(`${cell2.record_id}:${cell2.field_key}`, cell2);
16248
16246
  setCells(next);
16249
16247
  }, [client, tableId, key]);
16250
16248
  useEffect39(() => {
@@ -16335,7 +16333,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
16335
16333
  [host, load, tableId]
16336
16334
  );
16337
16335
  if (error) return /* @__PURE__ */ jsx57(RefusalNotice, { error, className });
16338
- if (rows === null) return /* @__PURE__ */ jsx57(Skeleton3, { className: cn32("h-40 w-full", className) });
16336
+ if (rows === null) return /* @__PURE__ */ jsx57(Skeleton4, { className: cn32("h-40 w-full", className) });
16339
16337
  if (shown4.length === 0 && fieldId) {
16340
16338
  const target = (fields.data ?? []).find((f) => f.id === fieldId);
16341
16339
  const setup = draft[fieldId] ?? { instruction: "", every: "30" };
@@ -16714,7 +16712,7 @@ function columnForField(field2, editing, mayWriteRow, whyNotRow, look, onAskWhoC
16714
16712
  filter: filterRefusal(field2) !== null ? false : editorKindFor(field2) === "select" || editorKindFor(field2) === "multi_select" ? "select" : holdsNumbers(field2) ? "number" : "auto",
16715
16713
  // THE MENU'S VALUE LIST WEARS THE CHOICES' COLOURS (lane CELL-EDITORS, night walk 2026-10-06): the
16716
16714
  // same chip the cell draws, never bare words beside a coloured column.
16717
- ...editorKindFor(field2) === "select" || editorKindFor(field2) === "multi_select" ? { filterValueClass: (value) => choiceChipLookOf(field2, value).className } : {},
16715
+ ...editorKindFor(field2) === "select" || editorKindFor(field2) === "multi_select" ? { filterValueClass: (value, label) => choiceChipLookOf(field2, value, label).className } : {},
16718
16716
  cell: (row) => (
16719
16717
  /*
16720
16718
  * 🚨 A READING QUESTION IS NOT AN EDITING RIGHT. This used to read
@@ -16825,7 +16823,7 @@ function withTypeMark(field2, header) {
16825
16823
  // src/ReverseColumns.tsx
16826
16824
  import { useCallback as useCallback21, useEffect as useEffect40, useMemo as useMemo27, useRef as useRef26, useState as useState49, useSyncExternalStore } from "react";
16827
16825
  import { useFields as useFields6, useReverseColumns as useReverseColumns3, useReverseLinks, useTable as useTable4 } from "@ai-matrx/records/react";
16828
- import { Button as Button34, Dialog as Dialog10, DialogContent as DialogContent10, DialogHeader as DialogHeader10, DialogTitle as DialogTitle10, Separator as Separator4, Skeleton as Skeleton4, cn as cn33 } from "@ai-matrx/design-system";
16826
+ import { Button as Button34, Dialog as Dialog10, DialogContent as DialogContent10, DialogHeader as DialogHeader10, DialogTitle as DialogTitle10, Separator as Separator4, Skeleton as Skeleton5, cn as cn33 } from "@ai-matrx/design-system";
16829
16827
  import { Fragment as Fragment17, jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
16830
16828
  function reverseColumnId(column) {
16831
16829
  return `${REVERSE_COLUMN_PREFIX}${column.key}`;
@@ -16847,7 +16845,7 @@ function ReverseLinkChips({
16847
16845
  loading,
16848
16846
  clamp
16849
16847
  }) {
16850
- if (!answer && loading) return /* @__PURE__ */ jsx59(Skeleton4, { className: "h-4 w-24", "data-records-reverse-loading": "" });
16848
+ if (!answer && loading) return /* @__PURE__ */ jsx59(Skeleton5, { className: "h-4 w-24", "data-records-reverse-loading": "" });
16851
16849
  if (!answer || answer.total === 0) return /* @__PURE__ */ jsx59("span", { className: "text-muted-foreground", children: "\u2014" });
16852
16850
  const refs = refsOf(column, answer);
16853
16851
  const more = answer.total - refs.length;
@@ -17187,7 +17185,7 @@ function PlanTable({ plan }) {
17187
17185
  const keys = Array.from(new Set(shown4.flatMap((row) => row.cells.map((c) => c.key))));
17188
17186
  if (shown4.length === 0 || keys.length === 0) return null;
17189
17187
  const columnName = /* @__PURE__ */ new Map();
17190
- for (const row of shown4) for (const cell of row.cells) if (!columnName.has(cell.key)) columnName.set(cell.key, cell.column);
17188
+ for (const row of shown4) for (const cell2 of row.cells) if (!columnName.has(cell2.key)) columnName.set(cell2.key, cell2.column);
17191
17189
  return /* @__PURE__ */ jsxs55("div", { className: "overflow-auto rounded border", children: [
17192
17190
  /* @__PURE__ */ jsxs55("table", { className: "w-full text-xs", "data-matrx-paste-plan": true, children: [
17193
17191
  /* @__PURE__ */ jsx60("thead", { className: "bg-muted/50", children: /* @__PURE__ */ jsxs55("tr", { children: [
@@ -17200,18 +17198,18 @@ function PlanTable({ plan }) {
17200
17198
  row.recordId === null ? /* @__PURE__ */ jsx60(Badge9, { variant: "outline", className: "ml-1", children: "new" }) : null
17201
17199
  ] }),
17202
17200
  keys.map((key) => {
17203
- const cell = row.cells.find((c) => c.key === key);
17204
- if (!cell) return /* @__PURE__ */ jsx60("td", { className: "px-2 py-1" }, key);
17205
- if (cell.refusal !== null) {
17206
- return /* @__PURE__ */ jsx60("td", { className: "px-2 py-1 text-muted-foreground line-through", children: cell.raw }, key);
17201
+ const cell2 = row.cells.find((c) => c.key === key);
17202
+ if (!cell2) return /* @__PURE__ */ jsx60("td", { className: "px-2 py-1" }, key);
17203
+ if (cell2.refusal !== null) {
17204
+ return /* @__PURE__ */ jsx60("td", { className: "px-2 py-1 text-muted-foreground line-through", children: cell2.raw }, key);
17207
17205
  }
17208
- return /* @__PURE__ */ jsx60("td", { className: "px-2 py-1", children: cell.value === null ? /* @__PURE__ */ jsx60("span", { className: "text-muted-foreground", children: "cleared" }) : (
17206
+ return /* @__PURE__ */ jsx60("td", { className: "px-2 py-1", children: cell2.value === null ? /* @__PURE__ */ jsx60("span", { className: "text-muted-foreground", children: "cleared" }) : (
17209
17207
  // THE WORDS, NOT THE ID. A choice column stores the option
17210
17208
  // record's id and the person pasted a word; showing the id
17211
17209
  // here made this panel print
17212
17210
  // `530808bf-9f2d-4062-bc09-b8cc3b162f2a` where they had
17213
17211
  // written Drain Cleaning (FIX-10C F8).
17214
- cell.display ?? String(cell.value)
17212
+ cell2.display ?? String(cell2.value)
17215
17213
  ) }, key);
17216
17214
  })
17217
17215
  ] }, row.fromLine)) })
@@ -17525,6 +17523,7 @@ function combineRows(rows, header) {
17525
17523
 
17526
17524
  // src/importRefusals.ts
17527
17525
  import { downloadFile } from "@ai-matrx/kit/download";
17526
+ import { toDelimited } from "@ai-matrx/kit/delimited";
17528
17527
  function reasonShape(reason) {
17529
17528
  return reason.replace(/"[^"]*"/g, '"\u2026"').replace(/“[^”]*”/g, "\u201C\u2026\u201D").replace(/\b\d+(?:[.,]\d+)*\b/g, "N").replace(/\s+/g, " ").trim();
17530
17529
  }
@@ -17540,21 +17539,24 @@ function groupReasons(reasons) {
17540
17539
  }
17541
17540
  return [...groups.values()].sort((a, b) => b.count - a.count);
17542
17541
  }
17543
- function csvCell(value) {
17544
- const text = value === null || value === void 0 ? "" : String(value);
17545
- return /[",\n\r]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
17542
+ function cell(value) {
17543
+ if (value === null || value === void 0) return null;
17544
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? value : String(value);
17546
17545
  }
17547
17546
  function refusedRowsCsv(rows, lineOf = (n) => n + 1) {
17548
17547
  const headers = [];
17549
17548
  for (const r of rows) for (const h of Object.keys(r.source ?? {})) if (!headers.includes(h)) headers.push(h);
17550
- const lines = [[...headers, "Line in your file", "Why it was not added"].map(csvCell).join(",")];
17551
- for (const r of rows) {
17552
- const cells = headers.map((h) => csvCell((r.source ?? {})[h]));
17553
- cells.push(csvCell(typeof r.row === "number" ? lineOf(r.row) : ""));
17554
- cells.push(csvCell(r.reason ?? ""));
17555
- lines.push(cells.join(","));
17556
- }
17557
- return lines.join("\n") + "\n";
17549
+ return toDelimited(
17550
+ [
17551
+ [...headers, "Line in your file", "Why it was not added"],
17552
+ ...rows.map((r) => [
17553
+ ...headers.map((h) => cell((r.source ?? {})[h])),
17554
+ typeof r.row === "number" ? lineOf(r.row) : "",
17555
+ r.reason ?? ""
17556
+ ])
17557
+ ],
17558
+ { trailingNewline: true }
17559
+ );
17558
17560
  }
17559
17561
  function offerDownload(name, text, type = "text/csv") {
17560
17562
  if (typeof document === "undefined" || typeof URL === "undefined" || typeof URL.createObjectURL !== "function") return false;
@@ -19058,18 +19060,18 @@ function splitPipes(line) {
19058
19060
  if (text.startsWith("|")) text = text.slice(1);
19059
19061
  if (text.endsWith("|") && !text.endsWith("\\|")) text = text.slice(0, -1);
19060
19062
  const cells = [];
19061
- let cell = "";
19063
+ let cell2 = "";
19062
19064
  for (let i = 0; i < text.length; i += 1) {
19063
19065
  const ch = text[i];
19064
19066
  if (ch === "\\" && text[i + 1] === "|") {
19065
- cell += "\\|";
19067
+ cell2 += "\\|";
19066
19068
  i += 1;
19067
19069
  } else if (ch === "|") {
19068
- cells.push(cell);
19069
- cell = "";
19070
- } else cell += ch;
19070
+ cells.push(cell2);
19071
+ cell2 = "";
19072
+ } else cell2 += ch;
19071
19073
  }
19072
- cells.push(cell);
19074
+ cells.push(cell2);
19073
19075
  return cells.map(cellWords);
19074
19076
  }
19075
19077
  var LIST_ITEM = /^(\s*)(?:[-*+•]|\d{1,3}[.)])\s+(?:\[[ xX]\]\s+)?(.*)$/;
@@ -19186,33 +19188,33 @@ function shapeFromList(items, name, at) {
19186
19188
  function parseDelimited(text, delimiter) {
19187
19189
  const rows = [];
19188
19190
  let row = [];
19189
- let cell = "";
19191
+ let cell2 = "";
19190
19192
  let quoted2 = false;
19191
19193
  for (let i = 0; i < text.length; i += 1) {
19192
19194
  const ch = text[i];
19193
19195
  if (quoted2) {
19194
19196
  if (ch === '"') {
19195
19197
  if (text[i + 1] === '"') {
19196
- cell += '"';
19198
+ cell2 += '"';
19197
19199
  i += 1;
19198
19200
  } else quoted2 = false;
19199
- } else cell += ch;
19201
+ } else cell2 += ch;
19200
19202
  continue;
19201
19203
  }
19202
- if (ch === '"' && cell.trim() === "") quoted2 = true;
19204
+ if (ch === '"' && cell2.trim() === "") quoted2 = true;
19203
19205
  else if (ch === delimiter) {
19204
- row.push(cell);
19205
- cell = "";
19206
+ row.push(cell2);
19207
+ cell2 = "";
19206
19208
  } else if (ch === "\n" || ch === "\r") {
19207
19209
  if (ch === "\r" && text[i + 1] === "\n") i += 1;
19208
- row.push(cell);
19210
+ row.push(cell2);
19209
19211
  rows.push(row);
19210
19212
  row = [];
19211
- cell = "";
19212
- } else cell += ch;
19213
+ cell2 = "";
19214
+ } else cell2 += ch;
19213
19215
  }
19214
- if (cell.length > 0 || row.length > 0) {
19215
- row.push(cell);
19216
+ if (cell2.length > 0 || row.length > 0) {
19217
+ row.push(cell2);
19216
19218
  rows.push(row);
19217
19219
  }
19218
19220
  return rows.filter((r) => r.some((c) => c.trim() !== ""));
@@ -19515,10 +19517,10 @@ function shapeTextOfNode(node) {
19515
19517
  flushLine();
19516
19518
  const width = Math.max(...rows.map((r) => r.length));
19517
19519
  const pad4 = (r) => [...r, ...Array.from({ length: width - r.length }, () => "")];
19518
- const cell = (c) => c.replace(/\|/g, "\\|").replace(/\s+/g, " ").trim();
19519
- out.push(`| ${pad4(rows[0]).map(cell).join(" | ")} |`);
19520
+ const cell2 = (c) => c.replace(/\|/g, "\\|").replace(/\s+/g, " ").trim();
19521
+ out.push(`| ${pad4(rows[0]).map(cell2).join(" | ")} |`);
19520
19522
  out.push(`|${Array.from({ length: width }, () => "---").join("|")}|`);
19521
- for (const r of rows.slice(1)) out.push(`| ${pad4(r).map(cell).join(" | ")} |`);
19523
+ for (const r of rows.slice(1)) out.push(`| ${pad4(r).map(cell2).join(" | ")} |`);
19522
19524
  rows = [];
19523
19525
  };
19524
19526
  const textOf = (n) => (n.textContent ?? "").replace(/\s+/g, " ").trim();
@@ -19944,12 +19946,12 @@ import { createUndoStack, popRedo, popUndo, pushUndo } from "@ai-matrx/design-sy
19944
19946
  import { Fragment as Fragment22, jsx as jsx66, jsxs as jsxs60 } from "react/jsx-runtime";
19945
19947
  function changesFor(step2, direction, versions = /* @__PURE__ */ new Map()) {
19946
19948
  const byRow = /* @__PURE__ */ new Map();
19947
- for (const cell of step2.cells) {
19948
- if (step2.created?.includes(cell.rowId)) continue;
19949
- const patch = byRow.get(cell.rowId) ?? {};
19950
- const value = direction === "undo" ? cell.before : cell.after;
19951
- patch[cell.key] = value === void 0 ? null : value;
19952
- byRow.set(cell.rowId, patch);
19949
+ for (const cell2 of step2.cells) {
19950
+ if (step2.created?.includes(cell2.rowId)) continue;
19951
+ const patch = byRow.get(cell2.rowId) ?? {};
19952
+ const value = direction === "undo" ? cell2.before : cell2.after;
19953
+ patch[cell2.key] = value === void 0 ? null : value;
19954
+ byRow.set(cell2.rowId, patch);
19953
19955
  }
19954
19956
  const changes = [...byRow].map(([record_id, patch]) => ({
19955
19957
  op: "update",
@@ -19977,7 +19979,7 @@ function useGridUndo(args) {
19977
19979
  const dismiss = useCallback23(() => setNotice(null), []);
19978
19980
  const push = useCallback23((step2) => {
19979
19981
  if (step2.cells.length === 0 && !step2.created?.length && !step2.archived?.length && !step2.retiredField) return;
19980
- for (const cell of step2.cells) if (typeof cell.version === "number") known.current.set(cell.rowId, cell.version);
19982
+ for (const cell2 of step2.cells) if (typeof cell2.version === "number") known.current.set(cell2.rowId, cell2.version);
19981
19983
  counter.current += 1;
19982
19984
  const id = String(counter.current);
19983
19985
  setHeld((was) => {
@@ -20306,13 +20308,12 @@ function useGridAssist(args) {
20306
20308
  const copyRecordReference = useCallback24(
20307
20309
  (rowId) => {
20308
20310
  void (async () => {
20309
- try {
20310
- const text = JSON.stringify({ __kind: tableKindSlug(tableId), _record_id: rowId });
20311
- if (!await copyText(text)) throw new Error("This browser did not let the page write to the clipboard.");
20312
- say2(true, "The record reference is copied.");
20313
- } catch (thrown) {
20314
- say2(false, thrown instanceof Error ? thrown.message : String(thrown));
20311
+ const text = JSON.stringify({ __kind: tableKindSlug(tableId), _record_id: rowId });
20312
+ if (!await copyText(text)) {
20313
+ say2(false, "This browser did not let the page write to the clipboard.");
20314
+ return;
20315
20315
  }
20316
+ say2(true, "The record reference is copied.");
20316
20317
  })();
20317
20318
  },
20318
20319
  [tableId, say2]
@@ -20489,9 +20490,9 @@ function planBulk(args) {
20489
20490
  before: (row.document ?? {})[field2.key] ?? null,
20490
20491
  after: value
20491
20492
  }));
20492
- const changes = cells.map((cell) => ({
20493
+ const changes = cells.map((cell2) => ({
20493
20494
  op: "update",
20494
- record_id: cell.rowId,
20495
+ record_id: cell2.rowId,
20495
20496
  patch: { [field2.key]: value }
20496
20497
  }));
20497
20498
  const many = countOf(cells.length, args.noun, args.nounPlural);
@@ -21927,8 +21928,8 @@ function GridBody({
21927
21928
  pastedNames.set(
21928
21929
  field2.key,
21929
21930
  lines.flatMap((line) => {
21930
- const cell = line[at];
21931
- return typeof cell === "string" ? relationNamesIn2(field2, cell) : [];
21931
+ const cell2 = line[at];
21932
+ return typeof cell2 === "string" ? relationNamesIn2(field2, cell2) : [];
21932
21933
  })
21933
21934
  );
21934
21935
  }
@@ -24775,7 +24776,7 @@ import { useCallback as useCallback31, useEffect as useEffect54, useState as use
24775
24776
  import { useRecordsClient as useRecordsClient45, useTables as useTables2 } from "@ai-matrx/records/react";
24776
24777
  import { withTableFacts } from "@ai-matrx/records/core";
24777
24778
  import { withTablePlacement as withTablePlacement2 } from "@ai-matrx/records";
24778
- import { BasicInput as BasicInput16, Button as Button50, Select as Select10, SelectContent as SelectContent10, SelectItem as SelectItem10, SelectTrigger as SelectTrigger10, SelectValue as SelectValue10, Skeleton as Skeleton7, Textarea as Textarea2, cn as cn42 } from "@ai-matrx/design-system";
24779
+ import { BasicInput as BasicInput16, Button as Button50, Select as Select10, SelectContent as SelectContent10, SelectItem as SelectItem10, SelectTrigger as SelectTrigger10, SelectValue as SelectValue10, Skeleton as Skeleton8, Textarea as Textarea2, cn as cn42 } from "@ai-matrx/design-system";
24779
24780
 
24780
24781
  // src/newTableColumns.ts
24781
24782
  import { RESOLVABLE_FIELD_TYPE_WORDS } from "@ai-matrx/records/templates";
@@ -24958,7 +24959,7 @@ import { copyText as copyText3 } from "@ai-matrx/kit/clipboard";
24958
24959
  import { useCallback as useCallback30, useEffect as useEffect52, useMemo as useMemo40, useState as useState63 } from "react";
24959
24960
  import { useRecordsClient as useRecordsClient43, useMyLevels as useMyLevels2 } from "@ai-matrx/records/react";
24960
24961
  import { bookingPath as bookingPath2 } from "@ai-matrx/records";
24961
- import { Badge as Badge11, Button as Button48, Skeleton as Skeleton6, cn as cn41 } from "@ai-matrx/design-system";
24962
+ import { Badge as Badge11, Button as Button48, Skeleton as Skeleton7, cn as cn41 } from "@ai-matrx/design-system";
24962
24963
 
24963
24964
  // src/BookingBuilder.tsx
24964
24965
  import { copyText as copyText2 } from "@ai-matrx/kit/clipboard";
@@ -24969,7 +24970,7 @@ import { formatDurationMinutes } from "@ai-matrx/kit/format";
24969
24970
  import {
24970
24971
  bookingPath
24971
24972
  } from "@ai-matrx/records";
24972
- import { BasicInput as BasicInput15, BasicTextarea as BasicTextarea7, Button as Button45, Checkbox as Checkbox8, Label as Label16, Skeleton as Skeleton5, cn as cn39 } from "@ai-matrx/design-system";
24973
+ import { BasicInput as BasicInput15, BasicTextarea as BasicTextarea7, Button as Button45, Checkbox as Checkbox8, Label as Label16, Skeleton as Skeleton6, cn as cn39 } from "@ai-matrx/design-system";
24973
24974
 
24974
24975
  // src/publicQuestions.ts
24975
24976
  var CANNOT_ASK = {
@@ -25245,7 +25246,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
25245
25246
  await load();
25246
25247
  onSaved?.({ form_id: formId });
25247
25248
  }
25248
- if (!loaded || fields.loading && !fields.data) return /* @__PURE__ */ jsx76(Skeleton5, { className: cn39("h-64 w-full", className) });
25249
+ if (!loaded || fields.loading && !fields.data) return /* @__PURE__ */ jsx76(Skeleton6, { className: cn39("h-64 w-full", className) });
25249
25250
  if (!rights.structure) {
25250
25251
  return /* @__PURE__ */ jsx76("p", { className: cn39("text-xs text-muted-foreground", className), children: rights.why("structure") ?? "Making a booking page needs the admin level on this table, because it lets people with no account take time in your calendar." });
25251
25252
  }
@@ -26062,7 +26063,7 @@ function BookingSlots({ tableId, activeBookingId, className }) {
26062
26063
  setShown(url);
26063
26064
  }
26064
26065
  }, []);
26065
- if (pages === null) return /* @__PURE__ */ jsx81(Skeleton6, { className: cn41("h-32 w-full", className) });
26066
+ if (pages === null) return /* @__PURE__ */ jsx81(Skeleton7, { className: cn41("h-32 w-full", className) });
26066
26067
  if (pages.length === 0 && !tableId && !error && !building) return null;
26067
26068
  const origin = host.publicOrigin ?? (typeof window === "undefined" ? "" : window.location.origin);
26068
26069
  return /* @__PURE__ */ jsxs72("section", { className: cn41("flex flex-col gap-3", className), "data-testid": "booking-slots", children: [
@@ -26652,8 +26653,8 @@ function TablesHome({ onOpenTable, organizationName, makingOnly = false, askedBy
26652
26653
  ] }) : null,
26653
26654
  tables.error ? /* @__PURE__ */ jsx83(RefusalNotice, { error: tables.error }) : null,
26654
26655
  tables.loading && !tables.data ? /* @__PURE__ */ jsxs74("div", { className: "space-y-2", children: [
26655
- /* @__PURE__ */ jsx83(Skeleton7, { className: "h-6 w-40" }),
26656
- /* @__PURE__ */ jsx83(Skeleton7, { className: "h-16 w-full" })
26656
+ /* @__PURE__ */ jsx83(Skeleton8, { className: "h-6 w-40" }),
26657
+ /* @__PURE__ */ jsx83(Skeleton8, { className: "h-16 w-full" })
26657
26658
  ] }) : null,
26658
26659
  makingOnly ? null : /* @__PURE__ */ jsx83(BookingSlots, {}),
26659
26660
  !makingOnly && boards && boards.length > 0 ? /* @__PURE__ */ jsxs74("section", { className: "space-y-1.5", children: [
@@ -27223,7 +27224,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, cl
27223
27224
  // src/StageRules.tsx
27224
27225
  import { useCallback as useCallback32, useEffect as useEffect55, useMemo as useMemo42, useState as useState67 } from "react";
27225
27226
  import { useFields as useFields12, useRecordsClient as useRecordsClient47, useTable as useTable10 } from "@ai-matrx/records/react";
27226
- import { BasicInput as BasicInput17, BasicTextarea as BasicTextarea8, Button as Button52, Separator as Separator7, Skeleton as Skeleton8, cn as cn44 } from "@ai-matrx/design-system";
27227
+ import { BasicInput as BasicInput17, BasicTextarea as BasicTextarea8, Button as Button52, Separator as Separator7, Skeleton as Skeleton9, cn as cn44 } from "@ai-matrx/design-system";
27227
27228
  import { jsx as jsx85, jsxs as jsxs76 } from "react/jsx-runtime";
27228
27229
  var NO_RULES_YET = "Nothing has to be true to get here yet.";
27229
27230
  var NEEDS_A_SENTENCE = "Write the sentence somebody reads when this stops them, the way you would say it out loud.";
@@ -27341,7 +27342,7 @@ function StageRulesSection({ tableId, stage, className }) {
27341
27342
  setPreview(null);
27342
27343
  await load();
27343
27344
  }
27344
- if (!asked3) return /* @__PURE__ */ jsx85(Skeleton8, { className: "h-24 w-full" });
27345
+ if (!asked3) return /* @__PURE__ */ jsx85(Skeleton9, { className: "h-24 w-full" });
27345
27346
  if (error && !pipeline) return /* @__PURE__ */ jsx85(RefusalNotice, { error });
27346
27347
  if (!pipeline?.is_pipeline) {
27347
27348
  return /* @__PURE__ */ jsxs76("div", { className: cn44("flex min-w-0 flex-col gap-2 text-xs", className), children: [
@@ -28489,7 +28490,7 @@ import { AlchemyMenu as AlchemyMenu2 } from "@ai-matrx/alchemy/react";
28489
28490
  // src/RecordChat.tsx
28490
28491
  import { useEffect as useEffect62, useMemo as useMemo45, useState as useState75 } from "react";
28491
28492
  import { useRecordsClient as useRecordsClient54 } from "@ai-matrx/records/react";
28492
- import { Skeleton as Skeleton9, cn as cn47 } from "@ai-matrx/design-system";
28493
+ import { Skeleton as Skeleton10, cn as cn47 } from "@ai-matrx/design-system";
28493
28494
  import { jsx as jsx93, jsxs as jsxs84 } from "react/jsx-runtime";
28494
28495
  var NO_CHAT_REASON = "Chatting about this record is not switched on here yet, so this panel is empty rather than showing a box that goes nowhere. It is on our list, not yours.";
28495
28496
  function RecordChat({ tableId, recordId, className }) {
@@ -28536,7 +28537,7 @@ function RecordChat({ tableId, recordId, className }) {
28536
28537
  };
28537
28538
  }, [scope, recordId, tableId]);
28538
28539
  if (error) return /* @__PURE__ */ jsx93(RefusalNotice, { error, className });
28539
- if (!context) return /* @__PURE__ */ jsx93(Skeleton9, { className: cn47("h-64 w-full", className) });
28540
+ if (!context) return /* @__PURE__ */ jsx93(Skeleton10, { className: cn47("h-64 w-full", className) });
28540
28541
  if (!host.chat) {
28541
28542
  return /* @__PURE__ */ jsxs84("section", { className: cn47("flex min-h-0 flex-col gap-2", className), children: [
28542
28543
  /* @__PURE__ */ jsxs84("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
@@ -28611,7 +28612,7 @@ function entriesFor(scope) {
28611
28612
  }
28612
28613
 
28613
28614
  // src/Peek.tsx
28614
- import { Button as Button61, Separator as Separator9, Skeleton as Skeleton10, cn as cn49 } from "@ai-matrx/design-system";
28615
+ import { Button as Button61, Separator as Separator9, Skeleton as Skeleton11, cn as cn49 } from "@ai-matrx/design-system";
28615
28616
 
28616
28617
  // src/recordInPlace.tsx
28617
28618
  import { useMemo as useMemo46, useRef as useRef36 } from "react";
@@ -28928,7 +28929,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
28928
28929
  const askOpenBelow = onPage && !host.talkToRecord && Boolean(host.chat);
28929
28930
  const href = host.hrefForRecord && table.data ? host.hrefForRecord({ table: table.data, recordId }) : void 0;
28930
28931
  return /* @__PURE__ */ jsxs88("div", { className: cn49("flex min-w-0 flex-col gap-2 text-xs", className), children: [
28931
- /* @__PURE__ */ jsx97("h3", { className: cn49("break-words font-medium leading-snug", onPage ? "text-2xl font-semibold" : "text-sm"), "data-records-peek-title": "", title, children: record.loading && !document2 ? /* @__PURE__ */ jsx97(Skeleton10, { className: "h-4 w-40" }) : title }),
28932
+ /* @__PURE__ */ jsx97("h3", { className: cn49("break-words font-medium leading-snug", onPage ? "text-2xl font-semibold" : "text-sm"), "data-records-peek-title": "", title, children: record.loading && !document2 ? /* @__PURE__ */ jsx97(Skeleton11, { className: "h-4 w-40" }) : title }),
28932
28933
  /* @__PURE__ */ jsxs88("div", { className: "flex flex-wrap items-center gap-2", children: [
28933
28934
  /* @__PURE__ */ jsx97(
28934
28935
  AlchemyMenu2,
@@ -28994,8 +28995,8 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
28994
28995
  }
28995
28996
  ) : /* @__PURE__ */ jsxs88("dl", { className: cn49("grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-1.5", onPage && "text-sm"), children: [
28996
28997
  fields.loading && !fields.data ? Array.from({ length: peekRowsWhileReading }, (_, i) => /* @__PURE__ */ jsxs88("div", { className: "contents", "data-records-skeleton-part": "field", children: [
28997
- /* @__PURE__ */ jsx97("dt", { className: "py-0.5", children: /* @__PURE__ */ jsx97(Skeleton10, { shape: "line", width: "2/3" }) }),
28998
- /* @__PURE__ */ jsx97("dd", { className: "py-0.5", children: /* @__PURE__ */ jsx97(Skeleton10, { shape: "line", width: i % 2 ? "1/2" : "3/4" }) })
28998
+ /* @__PURE__ */ jsx97("dt", { className: "py-0.5", children: /* @__PURE__ */ jsx97(Skeleton11, { shape: "line", width: "2/3" }) }),
28999
+ /* @__PURE__ */ jsx97("dd", { className: "py-0.5", children: /* @__PURE__ */ jsx97(Skeleton11, { shape: "line", width: i % 2 ? "1/2" : "3/4" }) })
28999
29000
  ] }, `sk-${i}`)) : null,
29000
29001
  shownFields.map((field2) => /* @__PURE__ */ jsxs88("div", { className: "contents", children: [
29001
29002
  /* @__PURE__ */ jsxs88("dt", { className: "flex items-baseline gap-1 truncate text-muted-foreground", children: [
@@ -29449,7 +29450,7 @@ import {
29449
29450
  DropdownMenuContent as DropdownMenuContent7,
29450
29451
  DropdownMenuItem as DropdownMenuItem6,
29451
29452
  DropdownMenuTrigger as DropdownMenuTrigger7,
29452
- Skeleton as Skeleton11,
29453
+ Skeleton as Skeleton12,
29453
29454
  cn as cn51
29454
29455
  } from "@ai-matrx/design-system";
29455
29456
  import {
@@ -29977,7 +29978,7 @@ function PipelineBoard({
29977
29978
  };
29978
29979
  if (fields.error) return /* @__PURE__ */ jsx101(RefusalNotice, { error: fields.error });
29979
29980
  if (error) return /* @__PURE__ */ jsx101(RefusalNotice, { error });
29980
- if (loading || fields.loading && !fields.data) return /* @__PURE__ */ jsx101(Skeleton11, { className: "h-40 w-full" });
29981
+ if (loading || fields.loading && !fields.data) return /* @__PURE__ */ jsx101(Skeleton12, { className: "h-40 w-full" });
29981
29982
  if (!definition?.is_pipeline) {
29982
29983
  return /* @__PURE__ */ jsx101("p", { className: "rounded border border-dashed p-4 text-xs text-muted-foreground", children: definition?.why ?? "This table has no stage column yet, so there is no board to draw." });
29983
29984
  }
@@ -30974,8 +30975,8 @@ function CalendarView({
30974
30975
  }
30975
30976
  });
30976
30977
  const dayDrop = (fallback) => dropOn((e) => {
30977
- const cell = e.target.closest?.("[data-calendar-day]");
30978
- return { day: cell?.getAttribute("data-calendar-day") ?? fallback, minute: null };
30978
+ const cell2 = e.target.closest?.("[data-calendar-day]");
30979
+ return { day: cell2?.getAttribute("data-calendar-day") ?? fallback, minute: null };
30979
30980
  });
30980
30981
  const minuteAt = (e) => {
30981
30982
  const slot = e.target?.closest?.("[data-calendar-slot]");
@@ -33630,7 +33631,7 @@ import {
33630
33631
  emptyArchiveLine
33631
33632
  } from "@ai-matrx/records";
33632
33633
  import { tableShapeChanged as tableShapeChanged11, useFields as useFields19, useRecordsClient as useRecordsClient64, useTable as useTable18 } from "@ai-matrx/records/react";
33633
- import { Button as Button68, Skeleton as Skeleton13, cn as cn56 } from "@ai-matrx/design-system";
33634
+ import { Button as Button68, Skeleton as Skeleton14, cn as cn56 } from "@ai-matrx/design-system";
33634
33635
  import { jsx as jsx109, jsxs as jsxs99 } from "react/jsx-runtime";
33635
33636
  var ARCHIVE_MEANS = "Archiving never destroys anything. A record you remove from the grid waits here until somebody brings it back.";
33636
33637
  function mayNotRestoreLine(why) {
@@ -33722,7 +33723,7 @@ function ArchivedView({
33722
33723
  }
33723
33724
  ),
33724
33725
  error ? /* @__PURE__ */ jsx109(RefusalNotice, { error }) : null,
33725
- loading && !error ? /* @__PURE__ */ jsx109(Skeleton13, { className: "h-24 w-full" }) : null,
33726
+ loading && !error ? /* @__PURE__ */ jsx109(Skeleton14, { className: "h-24 w-full" }) : null,
33726
33727
  !loading && !error && rows.length === 0 ? /* @__PURE__ */ jsx109("p", { "data-testid": "archived-empty", className: "rounded-md border border-dashed px-3 py-6 text-xs text-muted-foreground", children: emptyArchiveLine(lane) }) : null,
33727
33728
  !loading && !error && rows.length > 0 ? /* @__PURE__ */ jsx109("ul", { className: "flex flex-col gap-1", "data-testid": "archived-rows", children: rows.map((row) => /* @__PURE__ */ jsxs99(
33728
33729
  "li",
@@ -33826,7 +33827,7 @@ import {
33826
33827
  portalTitleTypedBack
33827
33828
  } from "@ai-matrx/records";
33828
33829
  import { useRecordsClient as useRecordsClient65 } from "@ai-matrx/records/react";
33829
- import { BasicInput as BasicInput20, Button as Button69, Skeleton as Skeleton14, cn as cn57 } from "@ai-matrx/design-system";
33830
+ import { BasicInput as BasicInput20, Button as Button69, Skeleton as Skeleton15, cn as cn57 } from "@ai-matrx/design-system";
33830
33831
  import { jsx as jsx110, jsxs as jsxs100 } from "react/jsx-runtime";
33831
33832
  var ARCHIVED_NEVER_DESTROYED = "Archiving never destroys anything. What you put away waits here until somebody brings it back.";
33832
33833
  function ArchivedDisclosure({
@@ -33922,7 +33923,7 @@ function ArchivedPortals({
33922
33923
  },
33923
33924
  children: [
33924
33925
  error ? /* @__PURE__ */ jsx110(RefusalNotice, { error }) : null,
33925
- rows === null && !error ? /* @__PURE__ */ jsx110(Skeleton14, { className: "h-16 w-full" }) : null,
33926
+ rows === null && !error ? /* @__PURE__ */ jsx110(Skeleton15, { className: "h-16 w-full" }) : null,
33926
33927
  said ? /* @__PURE__ */ jsx110("p", { className: "rounded-md border border-border px-3 py-2 text-xs", "data-testid": "archived-portal-said", children: said }) : null,
33927
33928
  rows !== null && !error && rows.length === 0 ? /* @__PURE__ */ jsx110("p", { "data-testid": "archived-portals-empty", className: "text-xs text-muted-foreground", children: emptyPortalArchiveLine() }) : null,
33928
33929
  rows !== null && rows.length > 0 ? /* @__PURE__ */ jsx110("ul", { className: "flex flex-col gap-1.5", "data-testid": "archived-portals", children: rows.map((portal) => {
@@ -34006,7 +34007,7 @@ function ArchivedPortals({
34006
34007
  // src/ViewBar.tsx
34007
34008
  import { useCallback as useCallback41, useEffect as useEffect76, useState as useState90 } from "react";
34008
34009
  import { useRecordsClient as useRecordsClient66 } from "@ai-matrx/records/react";
34009
- import { Badge as Badge14, Button as Button70, Input as Input6, Popover as Popover10, PopoverContent as PopoverContent10, PopoverTrigger as PopoverTrigger10, Skeleton as Skeleton15, cn as cn58 } from "@ai-matrx/design-system";
34010
+ import { Badge as Badge14, Button as Button70, Input as Input6, Popover as Popover10, PopoverContent as PopoverContent10, PopoverTrigger as PopoverTrigger10, Skeleton as Skeleton16, cn as cn58 } from "@ai-matrx/design-system";
34010
34011
 
34011
34012
  // src/seedOnce.ts
34012
34013
  import { useCallback as useCallback40, useRef as useRef42 } from "react";
@@ -34201,7 +34202,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
34201
34202
  );
34202
34203
  }
34203
34204
  if (error) return /* @__PURE__ */ jsx111(RefusalNotice, { error, className, actions: /* @__PURE__ */ jsx111(Button70, { size: "sm", variant: "ghost", onClick: () => void load(), children: "Try again" }) });
34204
- if (views === null) return /* @__PURE__ */ jsx111(Skeleton15, { className: cn58("h-8 w-28 shrink-0", className) });
34205
+ if (views === null) return /* @__PURE__ */ jsx111(Skeleton16, { className: cn58("h-8 w-28 shrink-0", className) });
34205
34206
  const current = views.find((v) => v.id === active) ?? null;
34206
34207
  return /* @__PURE__ */ jsxs101(Popover10, { open, onOpenChange: setOpen, children: [
34207
34208
  /* @__PURE__ */ jsx111(PopoverTrigger10, { asChild: true, children: /* @__PURE__ */ jsxs101(
@@ -34439,14 +34440,14 @@ function ProposalRow({
34439
34440
  // src/ActionInbox.tsx
34440
34441
  import { useCallback as useCallback43, useEffect as useEffect79, useMemo as useMemo57, useRef as useRef44, useState as useState93 } from "react";
34441
34442
  import { useRecordsClient as useRecordsClient69 } from "@ai-matrx/records/react";
34442
- import { Badge as Badge17, Button as Button73, Checkbox as Checkbox11, Skeleton as Skeleton17, cn as cn61 } from "@ai-matrx/design-system";
34443
+ import { Badge as Badge17, Button as Button73, Checkbox as Checkbox11, Skeleton as Skeleton18, cn as cn61 } from "@ai-matrx/design-system";
34443
34444
  import { toggleSelection as toggleSelection2 } from "@ai-matrx/design-system/data-table";
34444
34445
  import { formatAbsoluteDate, formatDurationMs } from "@ai-matrx/kit/format";
34445
34446
 
34446
34447
  // src/ChecklistRunner.tsx
34447
34448
  import { useCallback as useCallback42, useEffect as useEffect78, useMemo as useMemo56, useState as useState92 } from "react";
34448
34449
  import { useRecordsClient as useRecordsClient68, useTable as useTable20 } from "@ai-matrx/records/react";
34449
- import { Badge as Badge16, BasicInput as BasicInput21, BasicTextarea as BasicTextarea9, Button as Button72, Skeleton as Skeleton16, cn as cn60 } from "@ai-matrx/design-system";
34450
+ import { Badge as Badge16, BasicInput as BasicInput21, BasicTextarea as BasicTextarea9, Button as Button72, Skeleton as Skeleton17, cn as cn60 } from "@ai-matrx/design-system";
34450
34451
  import { humanizeIdentifier as humanizeIdentifier13 } from "@ai-matrx/kit/text-case";
34451
34452
  import { Fragment as Fragment44, jsx as jsx113, jsxs as jsxs103 } from "react/jsx-runtime";
34452
34453
  var DUE_WORD = DUE_STATE_LABEL;
@@ -34585,7 +34586,7 @@ function ChecklistRunner({
34585
34586
  );
34586
34587
  if (table.error) return /* @__PURE__ */ jsx113(RefusalNotice, { error: table.error, className });
34587
34588
  if (runs === null && steps === null && !runId) {
34588
- return /* @__PURE__ */ jsx113(Skeleton16, { shape: "block", height: "sm", className });
34589
+ return /* @__PURE__ */ jsx113(Skeleton17, { shape: "block", height: "sm", className });
34589
34590
  }
34590
34591
  return /* @__PURE__ */ jsxs103("section", { className: cn60("flex min-h-0 flex-col gap-2", className), "data-testid": "checklist-runner", children: [
34591
34592
  /* @__PURE__ */ jsxs103("header", { className: "flex items-center gap-2 text-xs", children: [
@@ -34871,7 +34872,7 @@ function ChecklistsPanel({ tableId, onOpenRecord, className }) {
34871
34872
  useEffect78(() => {
34872
34873
  void load();
34873
34874
  }, [load]);
34874
- if (templates === null) return /* @__PURE__ */ jsx113(Skeleton16, { className: cn60("h-40 w-full", className) });
34875
+ if (templates === null) return /* @__PURE__ */ jsx113(Skeleton17, { className: cn60("h-40 w-full", className) });
34875
34876
  if (editing) {
34876
34877
  return /* @__PURE__ */ jsx113(
34877
34878
  ChecklistTemplateEditor,
@@ -35105,7 +35106,7 @@ function ChecklistTemplateEditor({
35105
35106
  onDone?.();
35106
35107
  }, [client, onDone, onSaved, spec, savedId]);
35107
35108
  const change = (index, patch) => setRows((held) => held.map((row, i) => i === index ? { ...row, ...patch } : row));
35108
- if (loading) return /* @__PURE__ */ jsx113(Skeleton16, { className: cn60("h-48 w-full", className) });
35109
+ if (loading) return /* @__PURE__ */ jsx113(Skeleton17, { className: cn60("h-48 w-full", className) });
35109
35110
  return /* @__PURE__ */ jsxs103("section", { className: cn60("flex flex-col gap-2", className), "data-testid": "checklist-editor", children: [
35110
35111
  /* @__PURE__ */ jsxs103("header", { className: "flex items-center gap-2", children: [
35111
35112
  /* @__PURE__ */ jsx113("h3", { className: "text-sm font-medium", children: templateId ? "Change this checklist" : "Write a checklist" }),
@@ -35896,7 +35897,7 @@ function ActionInbox({
35896
35897
  item.item_id
35897
35898
  );
35898
35899
  };
35899
- if (items === null) return /* @__PURE__ */ jsx114(Skeleton17, { className: cn61("h-32 w-full", className) });
35900
+ if (items === null) return /* @__PURE__ */ jsx114(Skeleton18, { className: cn61("h-32 w-full", className) });
35900
35901
  return /* @__PURE__ */ jsxs104(
35901
35902
  "section",
35902
35903
  {
@@ -36092,7 +36093,7 @@ import {
36092
36093
  useRecordsClient as useRecordsClient70,
36093
36094
  useTable as useTable21
36094
36095
  } from "@ai-matrx/records/react";
36095
- import { Badge as Badge18, Button as Button74, Skeleton as Skeleton18, cn as cn62 } from "@ai-matrx/design-system";
36096
+ import { Badge as Badge18, Button as Button74, Skeleton as Skeleton19, cn as cn62 } from "@ai-matrx/design-system";
36096
36097
  import { formatRelativeTime as formatRelativeTime3 } from "@ai-matrx/kit/format";
36097
36098
  import { humanizeIdentifier as humanizeIdentifier14 } from "@ai-matrx/kit/text-case";
36098
36099
  import { jsx as jsx115, jsxs as jsxs105 } from "react/jsx-runtime";
@@ -36123,7 +36124,7 @@ function HistoryPanel({ tableId, recordId, onAskAboutField, className }) {
36123
36124
  }, [load]);
36124
36125
  if (error) return /* @__PURE__ */ jsx115(RefusalNotice, { error, className });
36125
36126
  if (!entries || fields.loading || table.loading) {
36126
- return /* @__PURE__ */ jsx115(Skeleton18, { shape: "block", height: "md", className });
36127
+ return /* @__PURE__ */ jsx115(Skeleton19, { shape: "block", height: "md", className });
36127
36128
  }
36128
36129
  const byKey = new Map((fields.data ?? []).map((f) => [f.key, f]));
36129
36130
  async function startRestore(version, fieldKey) {
@@ -36406,7 +36407,7 @@ import {
36406
36407
  useRecordsClient as useRecordsClient71,
36407
36408
  useTable as useTable22
36408
36409
  } from "@ai-matrx/records/react";
36409
- import { Badge as Badge19, Button as Button75, Skeleton as Skeleton19, Textarea as Textarea5, cn as cn63 } from "@ai-matrx/design-system";
36410
+ import { Badge as Badge19, Button as Button75, Skeleton as Skeleton20, Textarea as Textarea5, cn as cn63 } from "@ai-matrx/design-system";
36410
36411
  import { humanizeIdentifier as humanizeIdentifier15 } from "@ai-matrx/kit/text-case";
36411
36412
  import { jsx as jsx116, jsxs as jsxs106 } from "react/jsx-runtime";
36412
36413
  function CommentThread({ tableId, recordId, fieldKey, className }) {
@@ -36464,7 +36465,7 @@ function CommentThread({ tableId, recordId, fieldKey, className }) {
36464
36465
  return people.filter((p) => !picked.some((already) => already.userId === p.userId)).filter((p) => q === "" || (p.name ?? p.email ?? "").toLowerCase().includes(q)).slice(0, 6);
36465
36466
  }, [mentionQuery, people, picked]);
36466
36467
  if (error) return /* @__PURE__ */ jsx116(RefusalNotice, { error, className });
36467
- if (!thread || table.loading && !table.data || fields.loading && !fields.data) return /* @__PURE__ */ jsx116(Skeleton19, { shape: "block", height: "sm", className });
36468
+ if (!thread || table.loading && !table.data || fields.loading && !fields.data) return /* @__PURE__ */ jsx116(Skeleton20, { shape: "block", height: "sm", className });
36468
36469
  const shown4 = fieldKey ? thread.comments.filter((c) => c.field_key === fieldKey) : thread.comments;
36469
36470
  const roots = shown4.filter((c) => !c.parent_comment_id);
36470
36471
  const repliesOf = (id) => shown4.filter((c) => c.parent_comment_id === id);
@@ -36650,7 +36651,7 @@ import {
36650
36651
  useRecordsClient as useRecordsClient72,
36651
36652
  useTable as useTable23
36652
36653
  } from "@ai-matrx/records/react";
36653
- import { Badge as Badge20, Button as Button76, Skeleton as Skeleton20, cn as cn64 } from "@ai-matrx/design-system";
36654
+ import { Badge as Badge20, Button as Button76, Skeleton as Skeleton21, cn as cn64 } from "@ai-matrx/design-system";
36654
36655
  import { humanizeIdentifier as humanizeIdentifier16 } from "@ai-matrx/kit/text-case";
36655
36656
  import { Fragment as Fragment46, jsx as jsx117, jsxs as jsxs107 } from "react/jsx-runtime";
36656
36657
  function FieldHistoryPanel({
@@ -36686,7 +36687,7 @@ function FieldHistoryPanel({
36686
36687
  }, [load]);
36687
36688
  const label = (fields.data ?? []).find((f) => f.key === fieldKey)?.label || humanizeIdentifier16(fieldKey);
36688
36689
  if (error) return /* @__PURE__ */ jsx117(RefusalNotice, { error, className });
36689
- if (!rows || fields.loading && !fields.data || table.loading && !table.data) return /* @__PURE__ */ jsx117(Skeleton20, { className: cn64("h-40 w-full", className) });
36690
+ if (!rows || fields.loading && !fields.data || table.loading && !table.data) return /* @__PURE__ */ jsx117(Skeleton21, { className: cn64("h-40 w-full", className) });
36690
36691
  async function start(row) {
36691
36692
  setSaid(null);
36692
36693
  setPending({ phase: "asking", recordId: row.record_id, version: row.version });
@@ -36918,7 +36919,7 @@ function submissionStamp(args) {
36918
36919
  // src/PortalBuilder.tsx
36919
36920
  import { useCallback as useCallback47, useEffect as useEffect83, useMemo as useMemo59, useRef as useRef48, useState as useState97 } from "react";
36920
36921
  import { useRecordsClient as useRecordsClient73, useTables as useTables4 } from "@ai-matrx/records/react";
36921
- import { BasicInput as BasicInput22, Button as Button77, Checkbox as Checkbox12, Label as Label18, Separator as Separator10, Skeleton as Skeleton21, cn as cn65 } from "@ai-matrx/design-system";
36922
+ import { BasicInput as BasicInput22, Button as Button77, Checkbox as Checkbox12, Label as Label18, Separator as Separator10, Skeleton as Skeleton22, cn as cn65 } from "@ai-matrx/design-system";
36922
36923
  import { Fragment as Fragment47, jsx as jsx118, jsxs as jsxs108 } from "react/jsx-runtime";
36923
36924
  var RESTATING_REPLACES = "Saving replaces what this portal shows: a table you untick stops being visible to every client the moment you save. Who is invited is not touched.";
36924
36925
  function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
@@ -37095,7 +37096,7 @@ function PortalBuilder({ tableId, portalId, onSaved, onClose, className }) {
37095
37096
  setInviteEmail("");
37096
37097
  setInviteRecordId("");
37097
37098
  }
37098
- if (tables.loading || loading) return /* @__PURE__ */ jsx118(Skeleton21, { className: cn65("h-64 w-full", className) });
37099
+ if (tables.loading || loading) return /* @__PURE__ */ jsx118(Skeleton22, { className: cn65("h-64 w-full", className) });
37099
37100
  const all = tablePickerEntries(tables.data ?? []).entries.map((e) => e.table);
37100
37101
  const missingTie = ticked.filter((e) => e.namesVia.trim() === "");
37101
37102
  const ready = clientTableId !== null && ticked.length > 0 && missingTie.length === 0;
@@ -37316,7 +37317,7 @@ import {
37316
37317
  portalPath,
37317
37318
  portalTitleTypedBack as portalTitleTypedBack2
37318
37319
  } from "@ai-matrx/records";
37319
- import { Badge as Badge21, BasicInput as BasicInput24, Button as Button79, Separator as Separator11, Skeleton as Skeleton22, cn as cn69 } from "@ai-matrx/design-system";
37320
+ import { Badge as Badge21, BasicInput as BasicInput24, Button as Button79, Separator as Separator11, Skeleton as Skeleton23, cn as cn69 } from "@ai-matrx/design-system";
37320
37321
 
37321
37322
  // src/PortalLookEditor.tsx
37322
37323
  import { useEffect as useEffect84, useMemo as useMemo60, useState as useState98 } from "react";
@@ -37715,7 +37716,7 @@ function PortalsPanel({ tableId, activePortalId, className }) {
37715
37716
  useEffect85(() => {
37716
37717
  void load();
37717
37718
  }, [load]);
37718
- if (portals === null) return /* @__PURE__ */ jsx122(Skeleton22, { className: cn69("h-32 w-full", className) });
37719
+ if (portals === null) return /* @__PURE__ */ jsx122(Skeleton23, { className: cn69("h-32 w-full", className) });
37719
37720
  const onATable = Boolean(tableId);
37720
37721
  const holdingThis = new Set(
37721
37722
  exposures.filter((e) => e.table_id === tableId).map((e) => e.portal_id)
@@ -38016,7 +38017,7 @@ function PortalDetail({
38016
38017
  );
38017
38018
  if (error)
38018
38019
  return /* @__PURE__ */ jsx122("div", { className: "mt-2", children: /* @__PURE__ */ jsx122(RefusalNotice, { error }) });
38019
- if (!card) return /* @__PURE__ */ jsx122(Skeleton22, { className: "mt-2 h-24 w-full" });
38020
+ if (!card) return /* @__PURE__ */ jsx122(Skeleton23, { className: "mt-2 h-24 w-full" });
38020
38021
  return /* @__PURE__ */ jsx122(
38021
38022
  PortalCardView,
38022
38023
  {
@@ -38227,7 +38228,7 @@ function Preview({
38227
38228
  exposed.table_id
38228
38229
  )) }) : null,
38229
38230
  error ? /* @__PURE__ */ jsx122("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx122(RefusalNotice, { error }) }) : null,
38230
- rows === null && !error ? /* @__PURE__ */ jsx122(Skeleton22, { className: "mt-1.5 h-12 w-full" }) : null,
38231
+ rows === null && !error ? /* @__PURE__ */ jsx122(Skeleton23, { className: "mt-1.5 h-12 w-full" }) : null,
38231
38232
  rows && !error ? rows.length === 0 ? /* @__PURE__ */ jsx122("p", { className: "mt-1.5 text-xs", children: "They can sign in, and right now no record of this Table names them \u2014 so this page is empty for them." }) : /* @__PURE__ */ jsx122("ul", { className: "mt-1.5 flex flex-col gap-1", children: rows.map((row) => /* @__PURE__ */ jsx122("li", { className: "truncate text-xs", children: row.title }, row.record_id)) }) : null
38232
38233
  ] });
38233
38234
  }
@@ -38290,7 +38291,7 @@ function Invite({ card, onInvited }) {
38290
38291
  /* @__PURE__ */ jsx122("p", { className: "text-xs text-muted-foreground", children: "Pick the client they are, and say where to send their sign-in link. They get nothing until they follow it." }),
38291
38292
  error ? /* @__PURE__ */ jsx122(RefusalNotice, { error }) : null,
38292
38293
  said ? /* @__PURE__ */ jsx122("p", { className: "text-xs text-muted-foreground", children: said }) : null,
38293
- rows === null ? /* @__PURE__ */ jsx122(Skeleton22, { className: "h-9 w-full" }) : /* @__PURE__ */ jsxs112(Fragment48, { children: [
38294
+ rows === null ? /* @__PURE__ */ jsx122(Skeleton23, { className: "h-9 w-full" }) : /* @__PURE__ */ jsxs112(Fragment48, { children: [
38294
38295
  /* @__PURE__ */ jsx122(
38295
38296
  BasicInput24,
38296
38297
  {
@@ -38455,7 +38456,7 @@ function FormLookFrame({ look, title, children, contained = false, className })
38455
38456
  import { useCallback as useCallback49, useEffect as useEffect86, useMemo as useMemo62, useState as useState100 } from "react";
38456
38457
  import { useRecordsClient as useRecordsClient76, useTable as useTable24 } from "@ai-matrx/records/react";
38457
38458
  import { hasQuietHours } from "@ai-matrx/records";
38458
- import { BasicInput as BasicInput25, Button as Button80, Checkbox as Checkbox13, Label as Label19, Separator as Separator12, Skeleton as Skeleton23, cn as cn71 } from "@ai-matrx/design-system";
38459
+ import { BasicInput as BasicInput25, Button as Button80, Checkbox as Checkbox13, Label as Label19, Separator as Separator12, Skeleton as Skeleton24, cn as cn71 } from "@ai-matrx/design-system";
38459
38460
 
38460
38461
  // src/scheduleWords.ts
38461
38462
  var DAYS2 = {
@@ -38637,7 +38638,7 @@ function DigestScheduler({
38637
38638
  }
38638
38639
  setPreview(answered.data);
38639
38640
  }
38640
- if (views === null && !error) return /* @__PURE__ */ jsx124(Skeleton23, { className: cn71("h-56 w-full", className) });
38641
+ if (views === null && !error) return /* @__PURE__ */ jsx124(Skeleton24, { className: cn71("h-56 w-full", className) });
38641
38642
  return /* @__PURE__ */ jsxs114("section", { className: cn71("@container flex flex-col gap-3", className), children: [
38642
38643
  /* @__PURE__ */ jsxs114("header", { className: "flex items-center gap-2", children: [
38643
38644
  /* @__PURE__ */ jsx124("h3", { className: "text-sm font-medium", children: existing ? "Change this summary" : "Send this on a schedule" }),
@@ -38730,7 +38731,7 @@ function DigestScheduler({
38730
38731
  ] }),
38731
38732
  /* @__PURE__ */ jsxs114("div", { className: "flex flex-col gap-1.5", children: [
38732
38733
  /* @__PURE__ */ jsx124(Label19, { className: "text-xs font-medium", children: "Who to send it to" }),
38733
- members === null ? /* @__PURE__ */ jsx124(Skeleton23, { className: "h-8 w-full" }) : members.length === 0 ? /* @__PURE__ */ jsx124("p", { className: "text-xs text-muted-foreground", children: "Nobody else is offered here, so this will be addressed to you. Who the people are is the platform's answer and this screen reaches it through its host's `members` port, which is not bound here." }) : /* @__PURE__ */ jsxs114(Fragment49, { children: [
38734
+ members === null ? /* @__PURE__ */ jsx124(Skeleton24, { className: "h-8 w-full" }) : members.length === 0 ? /* @__PURE__ */ jsx124("p", { className: "text-xs text-muted-foreground", children: "Nobody else is offered here, so this will be addressed to you. Who the people are is the platform's answer and this screen reaches it through its host's `members` port, which is not bound here." }) : /* @__PURE__ */ jsxs114(Fragment49, { children: [
38734
38735
  /* @__PURE__ */ jsx124("div", { className: "flex flex-wrap gap-x-4 gap-y-1.5", children: members.map((m) => /* @__PURE__ */ jsxs114("label", { className: "flex items-center gap-1.5 text-xs", children: [
38735
38736
  /* @__PURE__ */ jsx124(
38736
38737
  Checkbox13,
@@ -38827,12 +38828,12 @@ function DigestScheduler({
38827
38828
  import { useCallback as useCallback51, useEffect as useEffect88, useState as useState102 } from "react";
38828
38829
  import { useRecordsClient as useRecordsClient78 } from "@ai-matrx/records/react";
38829
38830
  import { hasQuietHours as hasQuietHours2 } from "@ai-matrx/records";
38830
- import { Badge as Badge22, Button as Button82, Skeleton as Skeleton25, Switch as Switch4, cn as cn73 } from "@ai-matrx/design-system";
38831
+ import { Badge as Badge22, Button as Button82, Skeleton as Skeleton26, Switch as Switch4, cn as cn73 } from "@ai-matrx/design-system";
38831
38832
 
38832
38833
  // src/WebhooksPanel.tsx
38833
38834
  import { useCallback as useCallback50, useEffect as useEffect87, useState as useState101 } from "react";
38834
38835
  import { useRecordsClient as useRecordsClient77, useTable as useTable25 } from "@ai-matrx/records/react";
38835
- import { BasicInput as BasicInput26, Button as Button81, Checkbox as Checkbox14, ConfirmDialog as ConfirmDialog7, Label as Label20, Skeleton as Skeleton24, cn as cn72 } from "@ai-matrx/design-system";
38836
+ import { BasicInput as BasicInput26, Button as Button81, Checkbox as Checkbox14, ConfirmDialog as ConfirmDialog7, Label as Label20, Skeleton as Skeleton25, cn as cn72 } from "@ai-matrx/design-system";
38836
38837
  import { jsx as jsx125, jsxs as jsxs115 } from "react/jsx-runtime";
38837
38838
  var WEBHOOK_EVENT_LABEL = {
38838
38839
  "record.created": "A record is added",
@@ -38900,7 +38901,7 @@ function WebhooksPanel({ tableId, className }) {
38900
38901
  setEvents(DEFAULT_EVENTS);
38901
38902
  await load();
38902
38903
  };
38903
- if (hooks === null) return /* @__PURE__ */ jsx125(Skeleton24, { className: cn72("h-16 w-full", className) });
38904
+ if (hooks === null) return /* @__PURE__ */ jsx125(Skeleton25, { className: cn72("h-16 w-full", className) });
38904
38905
  const notHers = readRefused?.sqlstate === "42501" && rights.known && !rights.structure;
38905
38906
  if (notHers) {
38906
38907
  return /* @__PURE__ */ jsxs115("section", { "data-records-webhooks": "", className: cn72("flex flex-col gap-2 border-t pt-3", className), children: [
@@ -39097,7 +39098,7 @@ function SubscriptionsPanel({ tableId, activeRuleId, className }) {
39097
39098
  },
39098
39099
  [client]
39099
39100
  );
39100
- if (rows === null) return /* @__PURE__ */ jsx126(Skeleton25, { className: cn73("h-32 w-full", className) });
39101
+ if (rows === null) return /* @__PURE__ */ jsx126(Skeleton26, { className: cn73("h-32 w-full", className) });
39101
39102
  return /* @__PURE__ */ jsxs116("section", { className: cn73("flex flex-col gap-3", className), children: [
39102
39103
  /* @__PURE__ */ jsxs116("header", { className: "flex items-center gap-2", children: [
39103
39104
  /* @__PURE__ */ jsx126("h3", { className: "text-sm font-medium", children: "Notifications" }),
@@ -39264,14 +39265,14 @@ import {
39264
39265
  Button as Button85,
39265
39266
  Checkbox as Checkbox15,
39266
39267
  Label as Label21,
39267
- Skeleton as Skeleton28,
39268
+ Skeleton as Skeleton29,
39268
39269
  cn as cn76
39269
39270
  } from "@ai-matrx/design-system";
39270
39271
 
39271
39272
  // src/FormRunner.tsx
39272
39273
  import { useCallback as useCallback52, useEffect as useEffect89, useMemo as useMemo63, useRef as useRef49, useState as useState103 } from "react";
39273
39274
  import { useFields as useFields23, useOptionalRecordsClient as useOptionalRecordsClient11 } from "@ai-matrx/records/react";
39274
- import { Button as Button83, Progress, Skeleton as Skeleton26, cn as cn74 } from "@ai-matrx/design-system";
39275
+ import { Button as Button83, Progress, Skeleton as Skeleton27, cn as cn74 } from "@ai-matrx/design-system";
39275
39276
  import { humanizeIdentifier as humanizeIdentifier17 } from "@ai-matrx/kit/text-case";
39276
39277
  import { Fragment as Fragment50, jsx as jsx127, jsxs as jsxs117 } from "react/jsx-runtime";
39277
39278
  function authored(host, text, where) {
@@ -39336,7 +39337,7 @@ function ConnectedFormRunner(props) {
39336
39337
  [client, form.subject, form.questions]
39337
39338
  );
39338
39339
  if (fields.error) return /* @__PURE__ */ jsx127(RefusalNotice, { error: fields.error, className });
39339
- if (fields.loading && !fields.data) return /* @__PURE__ */ jsx127(Skeleton26, { className: cn74("h-40 w-full", className) });
39340
+ if (fields.loading && !fields.data) return /* @__PURE__ */ jsx127(Skeleton27, { className: cn74("h-40 w-full", className) });
39340
39341
  return /* @__PURE__ */ jsx127(
39341
39342
  FormStage,
39342
39343
  {
@@ -39711,7 +39712,7 @@ function Question({
39711
39712
  import { useCallback as useCallback53, useEffect as useEffect90, useState as useState104 } from "react";
39712
39713
  import { useRecordsClient as useRecordsClient79, useTable as useTable26 } from "@ai-matrx/records/react";
39713
39714
  import { hasQuietHours as hasQuietHours3 } from "@ai-matrx/records";
39714
- import { Button as Button84, Skeleton as Skeleton27, cn as cn75 } from "@ai-matrx/design-system";
39715
+ import { Button as Button84, Skeleton as Skeleton28, cn as cn75 } from "@ai-matrx/design-system";
39715
39716
  import { jsx as jsx128, jsxs as jsxs118 } from "react/jsx-runtime";
39716
39717
  var CADENCE_WORDS2 = SUBSCRIPTION_CADENCE_LABEL;
39717
39718
  var CHANNEL_WORDS3 = SUBSCRIPTION_CHANNEL_LABEL;
@@ -39842,7 +39843,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
39842
39843
  }
39843
39844
  );
39844
39845
  }
39845
- if (subscriptions === null) return /* @__PURE__ */ jsx128(Skeleton27, { className: cn75("h-40 w-full", className) });
39846
+ if (subscriptions === null) return /* @__PURE__ */ jsx128(Skeleton28, { className: cn75("h-40 w-full", className) });
39846
39847
  return /* @__PURE__ */ jsxs118("div", { className: cn75("flex flex-col gap-2", className), children: [
39847
39848
  /* @__PURE__ */ jsxs118("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
39848
39849
  /* @__PURE__ */ jsx128("span", { className: "font-medium text-foreground", children: "Tell me when" }),
@@ -40237,9 +40238,9 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
40237
40238
  }
40238
40239
  );
40239
40240
  }
40240
- if (fields.loading || forms === null) return /* @__PURE__ */ jsx129(Skeleton28, { className: cn76("h-64 w-full", className) });
40241
+ if (fields.loading || forms === null) return /* @__PURE__ */ jsx129(Skeleton29, { className: cn76("h-64 w-full", className) });
40241
40242
  if (createOnMount && (makeOnMount === "waiting" || makeOnMount === "making") && !refused) {
40242
- return /* @__PURE__ */ jsx129(Skeleton28, { className: cn76("h-64 w-full", className) });
40243
+ return /* @__PURE__ */ jsx129(Skeleton29, { className: cn76("h-64 w-full", className) });
40243
40244
  }
40244
40245
  if (!rights.admin) {
40245
40246
  return /* @__PURE__ */ jsx129("p", { className: cn76("text-xs text-muted-foreground", className), children: rights.why("structure") });
@@ -40461,7 +40462,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
40461
40462
  }
40462
40463
  )
40463
40464
  ] })
40464
- ] }) : lookUnread ? null : /* @__PURE__ */ jsx129(Skeleton28, { className: "h-12 w-full" }),
40465
+ ] }) : lookUnread ? null : /* @__PURE__ */ jsx129(Skeleton29, { className: "h-12 w-full" }),
40465
40466
  lookUnread ? /* @__PURE__ */ jsx129(RefusalLine, { error: lookUnread }) : null,
40466
40467
  refused && isLookRefusal(refused) ? /* @__PURE__ */ jsx129(RefusalLine, { error: refused }) : null
40467
40468
  ] }),
@@ -40961,7 +40962,7 @@ function ChartLegendContent({
40961
40962
  // src/DocTemplate.tsx
40962
40963
  import { useCallback as useCallback55, useEffect as useEffect93, useState as useState107 } from "react";
40963
40964
  import { useFields as useFields25, useRecordsClient as useRecordsClient81, useTable as useTable28 } from "@ai-matrx/records/react";
40964
- import { BasicInput as BasicInput28, BasicTextarea as BasicTextarea11, Button as Button86, Label as Label22, Skeleton as Skeleton29, cn as cn78 } from "@ai-matrx/design-system";
40965
+ import { BasicInput as BasicInput28, BasicTextarea as BasicTextarea11, Button as Button86, Label as Label22, Skeleton as Skeleton30, cn as cn78 } from "@ai-matrx/design-system";
40965
40966
  import { jsx as jsx131, jsxs as jsxs121 } from "react/jsx-runtime";
40966
40967
  function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, className }) {
40967
40968
  const client = useRecordsClient81();
@@ -41059,7 +41060,7 @@ function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, classN
41059
41060
  }
41060
41061
  );
41061
41062
  }
41062
- if (templates === null || fields.loading && !fields.data) return /* @__PURE__ */ jsx131(Skeleton29, { className: cn78("h-64 w-full", className) });
41063
+ if (templates === null || fields.loading && !fields.data) return /* @__PURE__ */ jsx131(Skeleton30, { className: cn78("h-64 w-full", className) });
41063
41064
  if (!rights.admin) {
41064
41065
  return /* @__PURE__ */ jsx131("p", { className: cn78("text-xs text-muted-foreground", className), children: rights.why("structure") });
41065
41066
  }
@@ -41145,7 +41146,7 @@ function DocTemplate({ tableId, seed, activeTemplateId, onActiveTemplate, classN
41145
41146
  // src/DocRender.tsx
41146
41147
  import { useCallback as useCallback56, useEffect as useEffect94, useRef as useRef52, useState as useState108 } from "react";
41147
41148
  import { useRecordsClient as useRecordsClient82 } from "@ai-matrx/records/react";
41148
- import { Button as Button87, Skeleton as Skeleton30, cn as cn79 } from "@ai-matrx/design-system";
41149
+ import { Button as Button87, Skeleton as Skeleton31, cn as cn79 } from "@ai-matrx/design-system";
41149
41150
  import { jsx as jsx132, jsxs as jsxs122 } from "react/jsx-runtime";
41150
41151
  function DocRender({ templateId, recordId, filename, onRendered, className }) {
41151
41152
  const client = useRecordsClient82();
@@ -41218,7 +41219,7 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
41218
41219
  }
41219
41220
  );
41220
41221
  }
41221
- if (preview === null || renders === null) return /* @__PURE__ */ jsx132(Skeleton30, { className: cn79("h-64 w-full", className) });
41222
+ if (preview === null || renders === null) return /* @__PURE__ */ jsx132(Skeleton31, { className: cn79("h-64 w-full", className) });
41222
41223
  const frozen = showing ? renders.find((r) => r.id === showing) ?? null : null;
41223
41224
  const text = frozen ? frozen.body : preview;
41224
41225
  return /* @__PURE__ */ jsxs122("div", { className: cn79("flex flex-col gap-2", className), children: [
@@ -41258,7 +41259,7 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
41258
41259
  // src/SignBlock.tsx
41259
41260
  import { useCallback as useCallback57, useEffect as useEffect95, useState as useState109 } from "react";
41260
41261
  import { useFields as useFields26, useRecordsClient as useRecordsClient83 } from "@ai-matrx/records/react";
41261
- import { BasicInput as BasicInput29, Button as Button88, Skeleton as Skeleton31, cn as cn80 } from "@ai-matrx/design-system";
41262
+ import { BasicInput as BasicInput29, Button as Button88, Skeleton as Skeleton32, cn as cn80 } from "@ai-matrx/design-system";
41262
41263
  import { useTable as useTable29 } from "@ai-matrx/records/react";
41263
41264
  import { jsx as jsx133, jsxs as jsxs123 } from "react/jsx-runtime";
41264
41265
  function SignBlock({ tableId, recordId, render, className }) {
@@ -41317,7 +41318,7 @@ function SignBlock({ tableId, recordId, render, className }) {
41317
41318
  }
41318
41319
  );
41319
41320
  }
41320
- if (fields.loading || signatures === null) return /* @__PURE__ */ jsx133(Skeleton31, { className: cn80("h-32 w-full", className) });
41321
+ if (fields.loading || signatures === null) return /* @__PURE__ */ jsx133(Skeleton32, { className: cn80("h-32 w-full", className) });
41321
41322
  const signable = (fields.data ?? []).filter(isSignatureField);
41322
41323
  return /* @__PURE__ */ jsxs123("div", { className: cn80("flex flex-col gap-2", className), children: [
41323
41324
  /* @__PURE__ */ jsxs123("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
@@ -41956,7 +41957,7 @@ import {
41956
41957
  SelectItem as SelectItem18,
41957
41958
  SelectTrigger as SelectTrigger18,
41958
41959
  SelectValue as SelectValue18,
41959
- Skeleton as Skeleton32,
41960
+ Skeleton as Skeleton33,
41960
41961
  cn as cn83
41961
41962
  } from "@ai-matrx/design-system";
41962
41963
 
@@ -42799,7 +42800,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
42799
42800
  }
42800
42801
  const spansTables = new Set((board?.blocks ?? []).map((b) => b.subject ?? tableId)).size > 1;
42801
42802
  const rightsPending = !rights.known && (table.loading || !!table.data && !table.error);
42802
- if (boards === null || rightsPending) return /* @__PURE__ */ jsx139(Skeleton32, { className: cn83("h-64 w-full", className) });
42803
+ if (boards === null || rightsPending) return /* @__PURE__ */ jsx139(Skeleton33, { className: cn83("h-64 w-full", className) });
42803
42804
  const PageLink = host.Link;
42804
42805
  return /* @__PURE__ */ jsxs128("div", { className: cn83("flex min-h-0 flex-col gap-2", className), children: [
42805
42806
  /* @__PURE__ */ jsxs128("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Dashboards", children: [
@@ -42928,7 +42929,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
42928
42929
  /* @__PURE__ */ jsx139(Button91, { size: "sm", disabled: !host.onReask || asking || question.trim() === "", onClick: () => void reask(), children: asking ? "Asking" : "Ask" })
42929
42930
  ] }) }) : null,
42930
42931
  notKept ? /* @__PURE__ */ jsx139("p", { role: "status", "data-records-dashboard-not-kept": "", className: "text-xs text-amber-700 dark:text-amber-400", children: notKept }) : null,
42931
- !board ? /* @__PURE__ */ jsx139("p", { className: "text-xs text-muted-foreground", children: rights.admin ? "No dashboards yet." : rights.why("structure") }) : run === null ? /* @__PURE__ */ jsx139(Skeleton32, { className: "h-64 w-full" }) : run.blocks.length === 0 ? /* @__PURE__ */ jsx139("p", { className: "text-xs text-muted-foreground", children: "No charts yet." }) : /* @__PURE__ */ jsxs128(Fragment54, { children: [
42932
+ !board ? /* @__PURE__ */ jsx139("p", { className: "text-xs text-muted-foreground", children: rights.admin ? "No dashboards yet." : rights.why("structure") }) : run === null ? /* @__PURE__ */ jsx139(Skeleton33, { className: "h-64 w-full" }) : run.blocks.length === 0 ? /* @__PURE__ */ jsx139("p", { className: "text-xs text-muted-foreground", children: "No charts yet." }) : /* @__PURE__ */ jsxs128(Fragment54, { children: [
42932
42933
  /* @__PURE__ */ jsx139(
42933
42934
  DashboardGrid,
42934
42935
  {
@@ -43264,7 +43265,7 @@ function TargetControl({
43264
43265
  // src/QuestionPanel.tsx
43265
43266
  import { copyText as copyText8 } from "@ai-matrx/kit/clipboard";
43266
43267
  import { useEffect as useEffect99, useMemo as useMemo70, useRef as useRef54, useState as useState114 } from "react";
43267
- import { Badge as Badge23, BasicInput as BasicInput31, Button as Button92, Checkbox as Checkbox16, Label as Label23, Skeleton as Skeleton33, cn as cn84 } from "@ai-matrx/design-system";
43268
+ import { Badge as Badge23, BasicInput as BasicInput31, Button as Button92, Checkbox as Checkbox16, Label as Label23, Skeleton as Skeleton34, cn as cn84 } from "@ai-matrx/design-system";
43268
43269
  import { useFields as useFields30, useRecordsClient as useRecordsClient86 } from "@ai-matrx/records/react";
43269
43270
 
43270
43271
  // src/question.ts
@@ -43801,8 +43802,8 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
43801
43802
  };
43802
43803
  if (fields.loading || hidden === null) {
43803
43804
  return /* @__PURE__ */ jsxs129("div", { className: cn84("flex flex-col gap-2 p-3", className), "data-testid": "question-panel", children: [
43804
- /* @__PURE__ */ jsx140(Skeleton33, { className: "h-8 w-full" }),
43805
- /* @__PURE__ */ jsx140(Skeleton33, { className: "h-32 w-full" })
43805
+ /* @__PURE__ */ jsx140(Skeleton34, { className: "h-8 w-full" }),
43806
+ /* @__PURE__ */ jsx140(Skeleton34, { className: "h-32 w-full" })
43806
43807
  ] });
43807
43808
  }
43808
43809
  const savedOptions = [
@@ -43935,7 +43936,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
43935
43936
  )) })
43936
43937
  ] }) : null
43937
43938
  ] }),
43938
- /* @__PURE__ */ jsx140("div", { className: cn84("min-h-24 rounded-md border p-2 transition-opacity", asking && "opacity-60"), "data-testid": "question-answer", "aria-busy": asking, children: answer === null ? /* @__PURE__ */ jsx140(Skeleton33, { className: "h-16 w-full" }) : !answer.ok ? /* @__PURE__ */ jsx140(RefusalNotice, { error: answer.error }) : /* @__PURE__ */ jsx140(QuestionAnswerView, { tableId, spec, answer: answer.data, fields: all, related }) })
43939
+ /* @__PURE__ */ jsx140("div", { className: cn84("min-h-24 rounded-md border p-2 transition-opacity", asking && "opacity-60"), "data-testid": "question-answer", "aria-busy": asking, children: answer === null ? /* @__PURE__ */ jsx140(Skeleton34, { className: "h-16 w-full" }) : !answer.ok ? /* @__PURE__ */ jsx140(RefusalNotice, { error: answer.error }) : /* @__PURE__ */ jsx140(QuestionAnswerView, { tableId, spec, answer: answer.data, fields: all, related }) })
43939
43940
  ] });
43940
43941
  }
43941
43942
  function Measures({ measures, fields, onChange }) {
@@ -44191,7 +44192,7 @@ function QuestionAnswerView({ tableId, spec, answer, fields, related = NO_RELATE
44191
44192
 
44192
44193
  // src/TableAsk.tsx
44193
44194
  import { useState as useState115 } from "react";
44194
- import { BasicInput as BasicInput32, Button as Button93, Popover as Popover12, PopoverContent as PopoverContent12, PopoverTrigger as PopoverTrigger12, Skeleton as Skeleton34 } from "@ai-matrx/design-system";
44195
+ import { BasicInput as BasicInput32, Button as Button93, Popover as Popover12, PopoverContent as PopoverContent12, PopoverTrigger as PopoverTrigger12, Skeleton as Skeleton35 } from "@ai-matrx/design-system";
44195
44196
  import { optionLabel as optionLabel4 } from "@ai-matrx/records";
44196
44197
  import { useFields as useFields31, useRecordsClient as useRecordsClient87 } from "@ai-matrx/records/react";
44197
44198
 
@@ -44462,7 +44463,7 @@ function TableAsk({ tableId, onOpenInQuestions }) {
44462
44463
  said.kind === "not-read" ? /* @__PURE__ */ jsx141("p", { className: "text-muted-foreground", role: "status", "data-table-ask-not-read": "", children: said.why }) : null,
44463
44464
  said.kind === "asking" ? /* @__PURE__ */ jsxs130(Fragment56, { children: [
44464
44465
  /* @__PURE__ */ jsx141("p", { className: "truncate text-muted-foreground", children: said.reads }),
44465
- /* @__PURE__ */ jsx141(Skeleton34, { className: "h-10 w-full" })
44466
+ /* @__PURE__ */ jsx141(Skeleton35, { className: "h-10 w-full" })
44466
44467
  ] }) : null,
44467
44468
  said.kind === "refused" ? /* @__PURE__ */ jsx141(RefusalNotice, { error: said.error }) : null,
44468
44469
  said.kind === "answer" ? /* @__PURE__ */ jsxs130(Fragment56, { children: [
@@ -44497,7 +44498,7 @@ import {
44497
44498
  useRowActions as useRowActions2
44498
44499
  } from "@ai-matrx/records/react";
44499
44500
  import { onRecordChanged } from "@ai-matrx/records/core";
44500
- import { BasicInput as BasicInput33, Button as Button94, Checkbox as Checkbox17, Skeleton as Skeleton35, cn as cn85 } from "@ai-matrx/design-system";
44501
+ import { BasicInput as BasicInput33, Button as Button94, Checkbox as Checkbox17, Skeleton as Skeleton36, cn as cn85 } from "@ai-matrx/design-system";
44501
44502
  import { Fragment as Fragment57, jsx as jsx142, jsxs as jsxs131 } from "react/jsx-runtime";
44502
44503
  var EDIT_LEVELS = /* @__PURE__ */ new Set(["editor", "admin", "owner"]);
44503
44504
  function PageScreen({
@@ -44638,7 +44639,7 @@ function PageScreen({
44638
44639
  if (missing) {
44639
44640
  return /* @__PURE__ */ jsx142("p", { className: cn85("p-4 text-sm text-muted-foreground", className), "data-records-page-missing": "", children: "This page is archived or not shared with you." });
44640
44641
  }
44641
- if (!page) return /* @__PURE__ */ jsx142(Skeleton35, { className: cn85("h-64 w-full", className) });
44642
+ if (!page) return /* @__PURE__ */ jsx142(Skeleton36, { className: cn85("h-64 w-full", className) });
44642
44643
  const filtersFor = (listId) => {
44643
44644
  const out = {};
44644
44645
  for (const b of blocks) {
@@ -44938,7 +44939,7 @@ function ListBlockView({
44938
44939
  ) : null,
44939
44940
  page.data?.total !== null && page.data?.total !== void 0 && !nobodyIsMe ? /* @__PURE__ */ jsx142("span", { className: "text-xs tabular-nums text-muted-foreground", children: page.data.total }) : null
44940
44941
  ] }),
44941
- page.error ? /* @__PURE__ */ jsx142(RefusalLine, { error: page.error, className: "px-2 pb-2" }) : waiting || page.loading && rows.length === 0 ? /* @__PURE__ */ jsx142(Skeleton35, { className: "m-2 h-24" }) : rows.length === 0 ? /* @__PURE__ */ jsx142("p", { className: "px-2 pb-2 text-xs text-muted-foreground", children: mine && meField ? "Nothing assigned to you here." : "No records match." }) : /* @__PURE__ */ jsx142("div", { className: "max-h-[28rem] overflow-auto", role: "listbox", "aria-label": block.title ?? table.data?.name ?? "Records", children: /* @__PURE__ */ jsxs131("table", { className: "w-full text-xs", children: [
44942
+ page.error ? /* @__PURE__ */ jsx142(RefusalLine, { error: page.error, className: "px-2 pb-2" }) : waiting || page.loading && rows.length === 0 ? /* @__PURE__ */ jsx142(Skeleton36, { className: "m-2 h-24" }) : rows.length === 0 ? /* @__PURE__ */ jsx142("p", { className: "px-2 pb-2 text-xs text-muted-foreground", children: mine && meField ? "Nothing assigned to you here." : "No records match." }) : /* @__PURE__ */ jsx142("div", { className: "max-h-[28rem] overflow-auto", role: "listbox", "aria-label": block.title ?? table.data?.name ?? "Records", children: /* @__PURE__ */ jsxs131("table", { className: "w-full text-xs", children: [
44942
44943
  /* @__PURE__ */ jsx142("thead", { className: "sticky top-0 bg-card text-left text-muted-foreground", children: /* @__PURE__ */ jsx142("tr", { children: columns.map((f) => /* @__PURE__ */ jsx142("th", { className: "truncate px-2 py-1 font-normal", children: fieldName(f) }, f.key)) }) }),
44943
44944
  /* @__PURE__ */ jsx142("tbody", { children: rows.map((row) => /* @__PURE__ */ jsx142(
44944
44945
  "tr",
@@ -44989,7 +44990,7 @@ function ActionButton2({ block, recordId }) {
44989
44990
  setError(null);
44990
44991
  setAsking(false);
44991
44992
  }, [recordId]);
44992
- if (action3 === "reading") return /* @__PURE__ */ jsx142(Skeleton35, { className: "h-9 w-32" });
44993
+ if (action3 === "reading") return /* @__PURE__ */ jsx142(Skeleton36, { className: "h-9 w-32" });
44993
44994
  if (!action3) return /* @__PURE__ */ jsx142(BlockNote, { children: "Choose the action this button runs." });
44994
44995
  const label = block.title ?? action3.name;
44995
44996
  async function runIt() {
@@ -45038,7 +45039,7 @@ function FormBlockView({ block }) {
45038
45039
  live = false;
45039
45040
  };
45040
45041
  }, [client, block.table_id, block.form_id]);
45041
- if (form === "reading") return /* @__PURE__ */ jsx142(Skeleton35, { className: "h-40 w-full" });
45042
+ if (form === "reading") return /* @__PURE__ */ jsx142(Skeleton36, { className: "h-40 w-full" });
45042
45043
  if (!form) return /* @__PURE__ */ jsx142(BlockNote, { children: "Choose the form this block shows." });
45043
45044
  return /* @__PURE__ */ jsx142(FormRunner, { form: formFromSummary(form), onSubmitted: () => setSent((n) => n + 1) }, sent);
45044
45045
  }
@@ -45046,7 +45047,7 @@ function FilterBlockView({ block, value, onChange }) {
45046
45047
  const fields = useFields32(block.table_id);
45047
45048
  const field2 = (fields.data ?? []).find((f) => f.key === block.field);
45048
45049
  if (!block.field) return /* @__PURE__ */ jsx142(BlockNote, { children: "Choose the column this filter narrows by." });
45049
- if (!field2) return fields.loading ? /* @__PURE__ */ jsx142(Skeleton35, { className: "h-9 w-40" }) : /* @__PURE__ */ jsx142(BlockNote, { children: "That column is no longer on the table." });
45050
+ if (!field2) return fields.loading ? /* @__PURE__ */ jsx142(Skeleton36, { className: "h-9 w-40" }) : /* @__PURE__ */ jsx142(BlockNote, { children: "That column is no longer on the table." });
45050
45051
  const set = value !== void 0 && value !== null && value !== "";
45051
45052
  return /* @__PURE__ */ jsxs131("div", { className: "flex flex-wrap items-center gap-2", "data-records-page-filter": block.id, children: [
45052
45053
  /* @__PURE__ */ jsx142("span", { className: "text-xs text-muted-foreground", children: block.title ?? fieldName(field2) }),
@@ -45279,7 +45280,7 @@ import { copyText as copyText9 } from "@ai-matrx/kit/clipboard";
45279
45280
  import { useCallback as useCallback60, useEffect as useEffect101, useState as useState117 } from "react";
45280
45281
  import { useRecordsClient as useRecordsClient89, useTable as useTable33 } from "@ai-matrx/records/react";
45281
45282
  import { publicFormPath as publicFormPath2 } from "@ai-matrx/records";
45282
- import { Badge as Badge24, Button as Button95, Skeleton as Skeleton36, cn as cn86 } from "@ai-matrx/design-system";
45283
+ import { Badge as Badge24, Button as Button95, Skeleton as Skeleton37, cn as cn86 } from "@ai-matrx/design-system";
45283
45284
  import { Fragment as Fragment58, jsx as jsx143, jsxs as jsxs132 } from "react/jsx-runtime";
45284
45285
  var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
45285
45286
  var WHAT_A_FORM_IS = "A form asks for this table's own fields, and its answers land here as ordinary records stamped with the form they came through.";
@@ -45341,7 +45342,7 @@ function FormsPanel({ tableId, activeFormId, className }) {
45341
45342
  setShown(url);
45342
45343
  }
45343
45344
  }, []);
45344
- if (forms === null) return /* @__PURE__ */ jsx143(Skeleton36, { className: cn86("h-32 w-full", className) });
45345
+ if (forms === null) return /* @__PURE__ */ jsx143(Skeleton37, { className: cn86("h-32 w-full", className) });
45345
45346
  const origin = host.publicOrigin ?? (typeof window === "undefined" ? "" : window.location.origin);
45346
45347
  return /* @__PURE__ */ jsxs132("section", { className: cn86("flex flex-col gap-3", className), children: [
45347
45348
  /* @__PURE__ */ jsxs132("header", { className: "flex items-center gap-2", children: [
@@ -45461,7 +45462,7 @@ function FormsPanel({ tableId, activeFormId, className }) {
45461
45462
  // src/CaptureSheet.tsx
45462
45463
  import { useCallback as useCallback62, useEffect as useEffect103, useRef as useRef56, useState as useState119 } from "react";
45463
45464
  import { useFields as useFields33, useRecordsClient as useRecordsClient91, useTable as useTable34 } from "@ai-matrx/records/react";
45464
- import { Button as Button97, Input as Input8, Skeleton as Skeleton38, Textarea as Textarea7, cn as cn88 } from "@ai-matrx/design-system";
45465
+ import { Button as Button97, Input as Input8, Skeleton as Skeleton39, Textarea as Textarea7, cn as cn88 } from "@ai-matrx/design-system";
45465
45466
 
45466
45467
  // src/CaptureRun.tsx
45467
45468
  import { useCallback as useCallback61, useEffect as useEffect102, useMemo as useMemo72, useRef as useRef55, useState as useState118 } from "react";
@@ -45471,7 +45472,7 @@ import {
45471
45472
  openCaptureQueue
45472
45473
  } from "@ai-matrx/records";
45473
45474
  import { useRecordsClient as useRecordsClient90 } from "@ai-matrx/records/react";
45474
- import { Button as Button96, Input as Input7, Skeleton as Skeleton37, Textarea as Textarea6, cn as cn87 } from "@ai-matrx/design-system";
45475
+ import { Button as Button96, Input as Input7, Skeleton as Skeleton38, Textarea as Textarea6, cn as cn87 } from "@ai-matrx/design-system";
45475
45476
  import { jsx as jsx144, jsxs as jsxs133 } from "react/jsx-runtime";
45476
45477
  function controlFor(field2) {
45477
45478
  if (!field2) return "text";
@@ -45652,7 +45653,7 @@ function CaptureRun({ sheetId, face: given, className }) {
45652
45653
  return /* @__PURE__ */ jsx144("section", { className: cn87("mx-auto w-full max-w-sm p-4", className), children: /* @__PURE__ */ jsx144("div", { "data-testid": "capture-refusal", children: /* @__PURE__ */ jsx144(RefusalNotice, { error: loadFailed, className: "text-sm" }) }) });
45653
45654
  }
45654
45655
  if (face === void 0) {
45655
- return /* @__PURE__ */ jsx144(Skeleton37, { className: cn87("mx-auto h-64 w-full max-w-sm", className) });
45656
+ return /* @__PURE__ */ jsx144(Skeleton38, { className: cn87("mx-auto h-64 w-full max-w-sm", className) });
45656
45657
  }
45657
45658
  if (face === null) {
45658
45659
  return /* @__PURE__ */ jsx144("section", { className: cn87("mx-auto w-full max-w-sm p-4", className), children: /* @__PURE__ */ jsx144("p", { className: "text-sm", "data-testid": "capture-refusal", children: "This capture sheet is not here, or it is not yours to open. If somebody sent you this link, ask them to check it." }) });
@@ -45985,7 +45986,7 @@ function AdHocCaptureSheet({
45985
45986
  }
45986
45987
  if (table.error) return /* @__PURE__ */ jsx145(RefusalNotice, { error: table.error, className });
45987
45988
  if (fields.error) return /* @__PURE__ */ jsx145(RefusalNotice, { error: fields.error, className });
45988
- if (fields.loading || pending === null) return /* @__PURE__ */ jsx145(Skeleton38, { className: cn88("h-64 w-full", className) });
45989
+ if (fields.loading || pending === null) return /* @__PURE__ */ jsx145(Skeleton39, { className: cn88("h-64 w-full", className) });
45989
45990
  const keys = resolved();
45990
45991
  return /* @__PURE__ */ jsxs134("section", { className: cn88("mx-auto flex w-full max-w-sm flex-col gap-2", className), children: [
45991
45992
  /* @__PURE__ */ jsxs134("header", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
@@ -46092,7 +46093,7 @@ function AdHocCaptureSheet({
46092
46093
  // src/PortalShell.tsx
46093
46094
  import { useCallback as useCallback63, useEffect as useEffect104, useState as useState120 } from "react";
46094
46095
  import { useRecordsClient as useRecordsClient92 } from "@ai-matrx/records/react";
46095
- import { Button as Button98, Skeleton as Skeleton39, cn as cn89 } from "@ai-matrx/design-system";
46096
+ import { Button as Button98, Skeleton as Skeleton40, cn as cn89 } from "@ai-matrx/design-system";
46096
46097
  import { jsx as jsx146, jsxs as jsxs135 } from "react/jsx-runtime";
46097
46098
  function PortalShell({ tableId, form, resourceType = "record", className }) {
46098
46099
  const client = useRecordsClient92();
@@ -46122,7 +46123,7 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
46122
46123
  if (error) {
46123
46124
  return /* @__PURE__ */ jsx146(RefusalNotice, { error, className });
46124
46125
  }
46125
- if (!card || reach === null) return /* @__PURE__ */ jsx146(Skeleton39, { className: cn89("h-64 w-full", className) });
46126
+ if (!card || reach === null) return /* @__PURE__ */ jsx146(Skeleton40, { className: cn89("h-64 w-full", className) });
46126
46127
  if (!card.external) {
46127
46128
  return /* @__PURE__ */ jsx146("p", { className: cn89("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: card.explanation || "You are a member of an organization here, so this portal is not yours \u2014 a portal is the scoped view an OUTSIDER gets. You have the full application instead." });
46128
46129
  }
@@ -46198,7 +46199,7 @@ function PortalRow({ tableId, recordId }) {
46198
46199
  // src/PublicViewPage.tsx
46199
46200
  import { useCallback as useCallback64, useEffect as useEffect105, useState as useState121 } from "react";
46200
46201
  import { useRecordsClient as useRecordsClient93 } from "@ai-matrx/records/react";
46201
- import { Skeleton as Skeleton40, cn as cn90 } from "@ai-matrx/design-system";
46202
+ import { Skeleton as Skeleton41, cn as cn90 } from "@ai-matrx/design-system";
46202
46203
 
46203
46204
  // src/publicBinding.ts
46204
46205
  function publicReadOf(binding) {
@@ -46274,7 +46275,7 @@ function PublicViewPage({ slug, className }) {
46274
46275
  void load();
46275
46276
  }, [load]);
46276
46277
  if (error) return /* @__PURE__ */ jsx147(RefusalNotice, { error, className });
46277
- if (binding === null) return /* @__PURE__ */ jsx147(Skeleton40, { className: cn90("h-64 w-full", className) });
46278
+ if (binding === null) return /* @__PURE__ */ jsx147(Skeleton41, { className: cn90("h-64 w-full", className) });
46278
46279
  if (binding === "none") {
46279
46280
  return /* @__PURE__ */ jsxs136("main", { className: cn90("mx-auto max-w-2xl py-16 text-center", className), children: [
46280
46281
  /* @__PURE__ */ jsx147("h1", { className: "text-lg font-medium", children: "Nothing here" }),
@@ -46287,7 +46288,7 @@ function PublicViewPage({ slug, className }) {
46287
46288
  /* @__PURE__ */ jsx147("span", { className: "font-medium text-foreground", children: binding.namespace ?? "Published" }),
46288
46289
  /* @__PURE__ */ jsx147("span", { children: plan?.read === "table" || plan?.read === "view" ? `${rows?.length ?? 0} items` : "Shared publicly" })
46289
46290
  ] }),
46290
- plan?.read === "unknown" ? /* @__PURE__ */ jsx147("p", { className: "text-sm text-muted-foreground", children: "This page can\u2019t be shown yet." }) : rows === null ? /* @__PURE__ */ jsx147(Skeleton40, { className: "h-40 w-full" }) : rows.length === 0 ? /* @__PURE__ */ jsx147("p", { className: "text-sm text-muted-foreground", children: "This page has nothing on it yet." }) : /* @__PURE__ */ jsx147("ol", { className: "flex flex-col gap-2", children: rows.map((row) => /* @__PURE__ */ jsx147("li", { className: "rounded border p-3", children: /* @__PURE__ */ jsx147(PublicRow, { row, fields }) }, row.id)) }),
46291
+ plan?.read === "unknown" ? /* @__PURE__ */ jsx147("p", { className: "text-sm text-muted-foreground", children: "This page can\u2019t be shown yet." }) : rows === null ? /* @__PURE__ */ jsx147(Skeleton41, { className: "h-40 w-full" }) : rows.length === 0 ? /* @__PURE__ */ jsx147("p", { className: "text-sm text-muted-foreground", children: "This page has nothing on it yet." }) : /* @__PURE__ */ jsx147("ol", { className: "flex flex-col gap-2", children: rows.map((row) => /* @__PURE__ */ jsx147("li", { className: "rounded border p-3", children: /* @__PURE__ */ jsx147(PublicRow, { row, fields }) }, row.id)) }),
46291
46292
  /* @__PURE__ */ jsx147("footer", { className: "mt-4 border-t pt-3 text-xs text-muted-foreground", children: binding.notice || gap || "Nothing was scanned before this was listed." })
46292
46293
  ] });
46293
46294
  }
@@ -46310,7 +46311,7 @@ function PublicRow({ row, fields }) {
46310
46311
  import { copyText as copyText10 } from "@ai-matrx/kit/clipboard";
46311
46312
  import { useCallback as useCallback65, useEffect as useEffect106, useState as useState122 } from "react";
46312
46313
  import { useRecordsClient as useRecordsClient94 } from "@ai-matrx/records/react";
46313
- import { Button as Button99, Input as Input9, Skeleton as Skeleton41, Textarea as Textarea8, cn as cn91 } from "@ai-matrx/design-system";
46314
+ import { Button as Button99, Input as Input9, Skeleton as Skeleton42, Textarea as Textarea8, cn as cn91 } from "@ai-matrx/design-system";
46314
46315
  import { useTable as useTable35 } from "@ai-matrx/records/react";
46315
46316
  import { Fragment as Fragment60, jsx as jsx148, jsxs as jsxs137 } from "react/jsx-runtime";
46316
46317
  function EmbedFrame({
@@ -46364,7 +46365,7 @@ function EmbedFrame({
46364
46365
  setTokenId(null);
46365
46366
  }, [client, tokenId]);
46366
46367
  if (table.error) return /* @__PURE__ */ jsx148(RefusalNotice, { error: table.error, className });
46367
- if (table.loading && !table.data) return /* @__PURE__ */ jsx148(Skeleton41, { className: cn91("h-48 w-full", className) });
46368
+ if (table.loading && !table.data) return /* @__PURE__ */ jsx148(Skeleton42, { className: cn91("h-48 w-full", className) });
46368
46369
  if (!rights.admin) {
46369
46370
  return /* @__PURE__ */ jsxs137("p", { className: cn91("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: [
46370
46371
  rights.why("structure"),
@@ -46460,7 +46461,7 @@ import {
46460
46461
  DropdownMenuSeparator as DropdownMenuSeparator4,
46461
46462
  DropdownMenuTrigger as DropdownMenuTrigger9,
46462
46463
  Input as Input11,
46463
- Skeleton as Skeleton42,
46464
+ Skeleton as Skeleton43,
46464
46465
  cn as cn94,
46465
46466
  useIsMobile as useIsMobile2
46466
46467
  } from "@ai-matrx/design-system";
@@ -46549,7 +46550,33 @@ function LinkedLists({ tableId, recordId }) {
46549
46550
  const links = (fields.data ?? []).filter((field2) => editorKindFor(field2) === "relation");
46550
46551
  const labels = useRecordLabels(links);
46551
46552
  const document2 = record.data?.document;
46553
+ const may = useRecordRights(recordId);
46552
46554
  if (links.length === 0 || !document2) return null;
46555
+ if (may.write) {
46556
+ return /* @__PURE__ */ jsxs138("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
46557
+ /* @__PURE__ */ jsx149(Separator13, {}),
46558
+ /* @__PURE__ */ jsx149(
46559
+ RecordFieldsInPlace,
46560
+ {
46561
+ tableId,
46562
+ recordId,
46563
+ fields: links,
46564
+ document: document2,
46565
+ hidden: record.data?.hidden,
46566
+ canWrite: true,
46567
+ reload: () => record.reload(),
46568
+ className: "flex min-w-0 flex-col gap-1",
46569
+ renderLabel: (field2) => {
46570
+ const count = referencesOf(field2, document2[field2.key], "relation", labels).length;
46571
+ return /* @__PURE__ */ jsxs138("span", { className: "flex items-center gap-2 pt-2 text-foreground", "data-record-linked-list": field2.key, children: [
46572
+ /* @__PURE__ */ jsx149("span", { className: "truncate text-xs font-medium", children: fieldName(field2) }),
46573
+ count > 0 ? /* @__PURE__ */ jsx149("span", { className: "text-[11px] text-muted-foreground", children: count }) : null
46574
+ ] });
46575
+ }
46576
+ }
46577
+ )
46578
+ ] });
46579
+ }
46553
46580
  return /* @__PURE__ */ jsxs138("div", { className: "flex flex-col gap-3", "data-record-linked-lists": "", children: [
46554
46581
  /* @__PURE__ */ jsx149(Separator13, {}),
46555
46582
  links.map((field2) => {
@@ -47268,7 +47295,7 @@ function TableNotHere({
47268
47295
  alive = false;
47269
47296
  };
47270
47297
  }, [client, tableId]);
47271
- if (archived.phase === "asking") return /* @__PURE__ */ jsx155(Skeleton42, { className: "h-40 w-full" });
47298
+ if (archived.phase === "asking") return /* @__PURE__ */ jsx155(Skeleton43, { className: "h-40 w-full" });
47272
47299
  const row = archived.phase === "answered" ? archived.row : null;
47273
47300
  if (row) {
47274
47301
  return /* @__PURE__ */ jsxs144("div", { className: cn94("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [