@estiva-app/ui 0.117.0 → 0.119.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/ActivityLine.d.ts +37 -0
  2. package/dist/ActivityLine.d.ts.map +1 -0
  3. package/dist/CollapsibleSection.d.ts +6 -1
  4. package/dist/CollapsibleSection.d.ts.map +1 -1
  5. package/dist/ContainerHeader.d.ts +10 -1
  6. package/dist/ContainerHeader.d.ts.map +1 -1
  7. package/dist/ConversationLayout.d.ts.map +1 -1
  8. package/dist/DialogShell.d.ts +11 -3
  9. package/dist/DialogShell.d.ts.map +1 -1
  10. package/dist/ListColumn.d.ts +6 -1
  11. package/dist/ListColumn.d.ts.map +1 -1
  12. package/dist/ListTable.d.ts +71 -0
  13. package/dist/ListTable.d.ts.map +1 -0
  14. package/dist/MembersDialog.d.ts.map +1 -1
  15. package/dist/NavTree.d.ts +12 -1
  16. package/dist/NavTree.d.ts.map +1 -1
  17. package/dist/PageHeader.d.ts +11 -2
  18. package/dist/PageHeader.d.ts.map +1 -1
  19. package/dist/conversationScroll.d.ts +6 -0
  20. package/dist/conversationScroll.d.ts.map +1 -1
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +586 -433
  24. package/dist/index.js.map +4 -4
  25. package/dist/revealCurrentRow.d.ts +28 -0
  26. package/dist/revealCurrentRow.d.ts.map +1 -0
  27. package/dist/showInConversation.d.ts +5 -0
  28. package/dist/showInConversation.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/registry.json +253 -5
  31. package/src/ActivityLine.mdx +67 -0
  32. package/src/ActivityLine.stories.tsx +49 -0
  33. package/src/ActivityLine.test.tsx +47 -0
  34. package/src/ActivityLine.tsx +74 -0
  35. package/src/Button.mdx +5 -0
  36. package/src/CollapsibleSection.mdx +6 -0
  37. package/src/CollapsibleSection.stories.tsx +4 -1
  38. package/src/CollapsibleSection.test.tsx +11 -0
  39. package/src/CollapsibleSection.tsx +7 -2
  40. package/src/ContainerHeader.mdx +7 -0
  41. package/src/ContainerHeader.stories.tsx +3 -0
  42. package/src/ContainerHeader.test.tsx +12 -1
  43. package/src/ContainerHeader.tsx +38 -18
  44. package/src/ConversationLayout.mdx +5 -2
  45. package/src/ConversationLayout.scroll.test.tsx +62 -1
  46. package/src/ConversationLayout.stories.tsx +44 -0
  47. package/src/ConversationLayout.tsx +33 -2
  48. package/src/DialogShell.mdx +8 -2
  49. package/src/DialogShell.stories.tsx +20 -7
  50. package/src/DialogShell.tsx +10 -4
  51. package/src/ListColumn.mdx +1 -0
  52. package/src/ListColumn.stories.tsx +53 -1
  53. package/src/ListColumn.tsx +10 -2
  54. package/src/ListTable.mdx +112 -0
  55. package/src/ListTable.stories.tsx +133 -0
  56. package/src/ListTable.test.tsx +81 -0
  57. package/src/ListTable.tsx +178 -0
  58. package/src/MembersDialog.test.tsx +8 -0
  59. package/src/MembersDialog.tsx +2 -10
  60. package/src/NavTree.mdx +7 -1
  61. package/src/NavTree.stories.tsx +75 -1
  62. package/src/NavTree.test.tsx +18 -0
  63. package/src/NavTree.tsx +23 -34
  64. package/src/PageHeader.mdx +13 -2
  65. package/src/PageHeader.stories.tsx +35 -1
  66. package/src/PageHeader.test.tsx +21 -0
  67. package/src/PageHeader.tsx +17 -5
  68. package/src/conversationScroll.ts +11 -0
  69. package/src/index.ts +2 -0
  70. package/src/registry/registry.test.ts +5 -5
  71. package/src/revealCurrentRow.test.tsx +168 -0
  72. package/src/revealCurrentRow.ts +68 -0
  73. package/src/showInConversation.ts +9 -1
  74. package/stories/Choosing.mdx +2 -0
package/dist/index.js CHANGED
@@ -1334,7 +1334,7 @@ import { AlertDialog } from "@base-ui/react/alert-dialog";
1334
1334
  import { IconX as IconX3 } from "@tabler/icons-react";
1335
1335
 
1336
1336
  // src/ContainerHeader.tsx
1337
- import { IconChevronDown } from "@tabler/icons-react";
1337
+ import { IconArrowLeft, IconChevronDown } from "@tabler/icons-react";
1338
1338
  import { Button as BaseButton5 } from "@base-ui/react/button";
1339
1339
 
1340
1340
  // src/Menu.tsx
@@ -1660,12 +1660,19 @@ function MenuRow({ children, className }) {
1660
1660
 
1661
1661
  // src/ContainerHeader.tsx
1662
1662
  import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
1663
- function ContainerHeader({ title, chevron = false, titleMenu, actions, className }) {
1663
+ function ContainerHeader({ title, chevron = false, titleMenu, actions, back, className }) {
1664
1664
  const text = typeof title === "string";
1665
1665
  const name = /* @__PURE__ */ jsxs16("div", { className: cn("flex items-center gap-1", text ? "shrink-0" : "min-w-0 flex-1"), children: [
1666
1666
  text ? /* @__PURE__ */ jsx23("span", { className: "whitespace-nowrap text-body-2-strong text-text-primary", children: title }) : /* @__PURE__ */ jsx23("div", { className: "min-w-0 flex-1", children: title }),
1667
1667
  (chevron || titleMenu != null) && /* @__PURE__ */ jsx23(IconChevronDown, { size: 12, stroke: 1.5, className: "shrink-0 text-text-secondary" })
1668
1668
  ] });
1669
+ const titleBox = /* @__PURE__ */ jsx23("div", { className: cn("flex items-center gap-2 overflow-hidden", text && !back ? "shrink-0" : "min-w-0 flex-1"), children: titleMenu != null ? /* @__PURE__ */ jsx23(
1670
+ Menu,
1671
+ {
1672
+ trigger: /* @__PURE__ */ jsx23(BaseButton5, { type: "button", className: cn("flex min-w-0 items-center px-1.5 py-1", MENU_TRIGGER_CLASSES), children: name }),
1673
+ children: titleMenu
1674
+ }
1675
+ ) : name });
1669
1676
  return (
1670
1677
  // The title 16px in, where the column's content starts (Katerina, 7 October; it was 20px).
1671
1678
  // With a title menu the bar gives the button 6px of its left padding
@@ -1674,14 +1681,14 @@ function ContainerHeader({ title, chevron = false, titleMenu, actions, className
1674
1681
  // (Katerina, 5 October).
1675
1682
  // 12px between the title and the buttons, as between the right group's own parts: a cut title, and a button
1676
1683
  // after it, ran right up to them (Leaf's adoption review, 4 November). A bar whose title fits does not move.
1677
- /* @__PURE__ */ jsxs16("div", { className: cn("flex h-12 shrink-0 items-center justify-between gap-3 overflow-hidden border-b border-border-subtle py-2 pr-4", titleMenu != null ? "pl-2.5" : "pl-4", className), children: [
1678
- /* @__PURE__ */ jsx23("div", { className: cn("flex items-center gap-2 overflow-hidden", text ? "shrink-0" : "min-w-0 flex-1"), children: titleMenu != null ? /* @__PURE__ */ jsx23(
1679
- Menu,
1680
- {
1681
- trigger: /* @__PURE__ */ jsx23(BaseButton5, { type: "button", className: cn("flex min-w-0 items-center px-1.5 py-1", MENU_TRIGGER_CLASSES), children: name }),
1682
- children: titleMenu
1683
- }
1684
- ) : name }),
1684
+ /* @__PURE__ */ jsxs16("div", { className: cn("flex h-12 shrink-0 items-center justify-between gap-3 overflow-hidden border-b border-border-subtle py-2 pr-4", back ? "pl-3" : titleMenu != null ? "pl-2.5" : "pl-4", className), children: [
1685
+ back ? (
1686
+ // The arrow outside the title's box, which clips: its fill and its ring stay whole; 8px to the title.
1687
+ /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
1688
+ /* @__PURE__ */ jsx23(IconButton, { tooltip: back.label, "aria-label": back.label, onClick: back.onClick, children: /* @__PURE__ */ jsx23(IconArrowLeft, { size: 16, stroke: 1.5 }) }),
1689
+ titleBox
1690
+ ] })
1691
+ ) : titleBox,
1685
1692
  actions && /* @__PURE__ */ jsx23("div", { className: "flex shrink-0 items-center justify-end gap-3", children: /* @__PURE__ */ jsx23("div", { className: "flex shrink-0 items-center gap-1", children: actions }) })
1686
1693
  ] })
1687
1694
  );
@@ -1689,7 +1696,7 @@ function ContainerHeader({ title, chevron = false, titleMenu, actions, className
1689
1696
 
1690
1697
  // src/DialogShell.tsx
1691
1698
  import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
1692
- function DialogShell({ title, onClose, headerContent, footer, children, bodyClassName, bodyMaxHeight, width = 502, alert = false }) {
1699
+ function DialogShell({ title, onClose, back, headerContent, footer, children, bodyClassName, bodyMaxHeight, width = 502, alert = false }) {
1693
1700
  const Parts = alert ? AlertDialog : Dialog2;
1694
1701
  const popupRef = useRef4(null);
1695
1702
  return /* @__PURE__ */ jsx24(
@@ -1713,7 +1720,7 @@ function DialogShell({ title, onClose, headerContent, footer, children, bodyClas
1713
1720
  /* @__PURE__ */ jsx24(
1714
1721
  ContainerHeader,
1715
1722
  {
1716
- className: "pl-5",
1723
+ ...back ? { back } : { className: "pl-5" },
1717
1724
  title: headerContent ?? /* @__PURE__ */ jsx24(Parts.Title, { className: "block truncate text-h4 text-text-primary", render: /* @__PURE__ */ jsx24("span", {}), children: title }),
1718
1725
  actions: (
1719
1726
  /*
@@ -2191,7 +2198,7 @@ import { IconUserMinus as IconUserMinus2, IconUserPlus as IconUserPlus2 } from "
2191
2198
 
2192
2199
  // src/MembersDialog.tsx
2193
2200
  import { useId as useId3, useState as useState8 } from "react";
2194
- import { IconArrowLeft, IconUserMinus, IconUserPlus } from "@tabler/icons-react";
2201
+ import { IconUserMinus, IconUserPlus } from "@tabler/icons-react";
2195
2202
 
2196
2203
  // src/Chip.tsx
2197
2204
  import { Fragment as Fragment6, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
@@ -2420,10 +2427,7 @@ function AddPeopleLayer({
2420
2427
  {
2421
2428
  title,
2422
2429
  onClose,
2423
- headerContent: /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-2", children: [
2424
- /* @__PURE__ */ jsx32(IconButton, { tooltip: backLabel, "aria-label": backLabel, className: "-ml-2", onClick: onBack, children: /* @__PURE__ */ jsx32(IconArrowLeft, { size: 16, stroke: 1.5 }) }),
2425
- /* @__PURE__ */ jsx32("span", { className: "truncate text-h4 text-text-primary", children: title })
2426
- ] }),
2430
+ back: { label: backLabel, onClick: onBack },
2427
2431
  bodyClassName: "flex flex-col gap-6",
2428
2432
  footer: /* @__PURE__ */ jsxs24(Fragment7, { children: [
2429
2433
  /* @__PURE__ */ jsx32(Button, { variant: "muted", onClick: onClose, children: "Cancel" }),
@@ -4184,7 +4188,7 @@ function useRememberedOpen(storageKey, fallback) {
4184
4188
  };
4185
4189
  return [choice ?? fallback, setOpen];
4186
4190
  }
4187
- function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenChange, pending = false, storageKey, openFor, icon, trailing, actions, menu, menuLabel, showActions, look = "heading", indent = false, children, className, contentClassName }) {
4191
+ function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenChange, pending = false, storageKey, openFor, icon, trailing, count, actions, menu, menuLabel, showActions, look = "heading", indent = false, children, className, contentClassName }) {
4188
4192
  const [initial] = useState15(defaultOpen);
4189
4193
  const [openState, remember] = useRememberedOpen(storageKey, initial);
4190
4194
  const open = openProp ?? openState;
@@ -4195,7 +4199,7 @@ function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenC
4195
4199
  useOpenFor(openFor, open, setOpen, useContext7(sectionLinked));
4196
4200
  const shown2 = open && !pending;
4197
4201
  return /* @__PURE__ */ jsxs40(Collapsible.Root, { open: shown2, onOpenChange: (next, details) => setOpen(pending && details.reason === "trigger-press" ? !open : next), className: cn("flex flex-col", className), children: [
4198
- /* @__PURE__ */ jsx55(SectionHeader, { title, chevron: true, icon, isExpanded: open, trailing, actions, menu, menuLabel, showActions, look, className: "shrink-0", render: /* @__PURE__ */ jsx55(Collapsible.Trigger, { "aria-expanded": open, "aria-busy": pending && open ? true : void 0 }) }),
4202
+ /* @__PURE__ */ jsx55(SectionHeader, { title, chevron: true, icon, isExpanded: open, trailing, ...count != null ? { count } : {}, actions, menu, menuLabel, showActions, look, className: "shrink-0", render: /* @__PURE__ */ jsx55(Collapsible.Trigger, { "aria-expanded": open, "aria-busy": pending && open ? true : void 0 }) }),
4199
4203
  /* @__PURE__ */ jsx55(
4200
4204
  Collapsible.Panel,
4201
4205
  {
@@ -4460,10 +4464,52 @@ function NavItem({
4460
4464
  }
4461
4465
 
4462
4466
  // src/NavTree.tsx
4463
- import { createContext as createContext8, useContext as useContext8, useEffect as useEffect10, useRef as useRef16, useState as useState18 } from "react";
4467
+ import { createContext as createContext8, useContext as useContext8, useEffect as useEffect11, useRef as useRef17, useState as useState18 } from "react";
4468
+
4469
+ // src/revealCurrentRow.ts
4470
+ import { useEffect as useEffect10, useRef as useRef16 } from "react";
4471
+ var REVEAL_MS = 200;
4472
+ function scrollToRow(row) {
4473
+ let box = row.parentElement;
4474
+ while (box && !(/(auto|scroll)/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) box = box.parentElement;
4475
+ if (!box || box === document.documentElement || box === document.body) return;
4476
+ const at = row.getBoundingClientRect();
4477
+ const view = box.getBoundingClientRect();
4478
+ if (at.top < view.top) box.scrollTop -= view.top - at.top;
4479
+ else if (at.bottom > view.bottom) box.scrollTop += Math.min(at.bottom - view.bottom, at.top - view.top);
4480
+ }
4481
+ function useRevealCurrentRow(box, current) {
4482
+ const shown2 = useRef16(void 0);
4483
+ useEffect10(() => {
4484
+ const root = box.current;
4485
+ if (!root) return;
4486
+ let timer;
4487
+ const look = () => {
4488
+ timer = void 0;
4489
+ const row = root.querySelector('[aria-current="page"]');
4490
+ if (!row) return;
4491
+ const key = current ?? row.getAttribute("href") ?? row.textContent ?? "";
4492
+ if (shown2.current === key) return;
4493
+ if (row.getBoundingClientRect().height === 0) return;
4494
+ shown2.current = key;
4495
+ scrollToRow(row);
4496
+ };
4497
+ const soon = () => {
4498
+ if (timer === void 0) timer = setTimeout(look, REVEAL_MS);
4499
+ };
4500
+ const watch = typeof MutationObserver === "undefined" ? void 0 : new MutationObserver(soon);
4501
+ watch?.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ["aria-current", "hidden"] });
4502
+ soon();
4503
+ return () => {
4504
+ watch?.disconnect();
4505
+ if (timer !== void 0) clearTimeout(timer);
4506
+ };
4507
+ }, [box, current]);
4508
+ }
4509
+
4510
+ // src/NavTree.tsx
4464
4511
  import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
4465
4512
  var NAV_TREE_INTENT_MS = 150;
4466
- var NAV_TREE_REVEAL_MS = 200;
4467
4513
  var NAV_TREE_PENDING_MS = 2e3;
4468
4514
  function holds(nodes, id) {
4469
4515
  return !!nodes && id !== void 0 && nodes.some((node) => node.id === id || holds(node.children ?? null, id));
@@ -4488,15 +4534,6 @@ function openingFor(groups, selected, selectedParent) {
4488
4534
  }
4489
4535
  return null;
4490
4536
  }
4491
- function scrollToRow(row) {
4492
- let box = row.parentElement;
4493
- while (box && !(/(auto|scroll)/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) box = box.parentElement;
4494
- if (!box || box === document.documentElement || box === document.body) return;
4495
- const at = row.getBoundingClientRect();
4496
- const view = box.getBoundingClientRect();
4497
- if (at.top < view.top) box.scrollTop -= view.top - at.top;
4498
- else if (at.bottom > view.bottom) box.scrollTop += Math.min(at.bottom - view.bottom, at.top - view.top);
4499
- }
4500
4537
  function Line({ message }) {
4501
4538
  return /* @__PURE__ */ jsx59(EmptyState, { scope: "rows", message });
4502
4539
  }
@@ -4538,8 +4575,10 @@ function Group({ group, selected, onSelect, opening, storageKey }) {
4538
4575
  message: group.message,
4539
4576
  loading: group.nodes === null,
4540
4577
  trailing: group.trailing,
4578
+ ...group.count != null ? { count: group.count } : {},
4541
4579
  actions: group.actions,
4542
4580
  menu: group.menu,
4581
+ ...group.menuLabel != null ? { menuLabel: group.menuLabel } : {},
4543
4582
  icon: group.icon,
4544
4583
  defaultOpen: group.defaultOpen ?? holds(group.nodes, selected),
4545
4584
  open: group.open,
@@ -4551,12 +4590,12 @@ function Group({ group, selected, onSelect, opening, storageKey }) {
4551
4590
  }
4552
4591
  );
4553
4592
  }
4554
- function NavTreeSection({ id, title, message, loading = false, pending = false, trailing, actions, menu, icon, defaultOpen = true, open, onOpenChange, storageKey, openFor, onIntent, children }) {
4555
- const timer = useRef16(void 0);
4556
- useEffect10(() => () => clearTimeout(timer.current), []);
4593
+ function NavTreeSection({ id, title, message, loading = false, pending = false, trailing, count, actions, menu, menuLabel, icon, defaultOpen = true, open, onOpenChange, storageKey, openFor, onIntent, children }) {
4594
+ const timer = useRef17(void 0);
4595
+ useEffect11(() => () => clearTimeout(timer.current), []);
4557
4596
  const [slow, setSlow] = useState18(false);
4558
4597
  if (!pending && slow) setSlow(false);
4559
- useEffect10(() => {
4598
+ useEffect11(() => {
4560
4599
  if (!pending) return;
4561
4600
  const wait = setTimeout(() => setSlow(true), NAV_TREE_PENDING_MS);
4562
4601
  return () => clearTimeout(wait);
@@ -4587,8 +4626,10 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
4587
4626
  storageKey,
4588
4627
  openFor,
4589
4628
  trailing,
4629
+ ...count != null ? { count } : {},
4590
4630
  actions,
4591
4631
  menu,
4632
+ ...menuLabel != null ? { menuLabel } : {},
4592
4633
  icon,
4593
4634
  className: "shrink-0",
4594
4635
  contentClassName: "gap-0.5",
@@ -4600,24 +4641,10 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
4600
4641
  }
4601
4642
  function NavTree({ title, titleActions, groups, children, selected, selectedParent, selectedGroup, onSelect, emptyMessage = "", storageKey }) {
4602
4643
  const opening = groups ? openingFor(groups, selected, selectedParent) : null;
4603
- const box = useRef16(null);
4604
- const scrolled = useRef16(void 0);
4605
- const waiting = useRef16(void 0);
4606
- const latest = useRef16(selected);
4607
- latest.current = selected;
4608
- useEffect10(() => {
4609
- if (selected === void 0 || scrolled.current === selected || waiting.current !== void 0) return;
4610
- waiting.current = setTimeout(() => {
4611
- waiting.current = void 0;
4612
- const row = box.current?.querySelector('[aria-current="page"]');
4613
- if (!row || row.getBoundingClientRect().height === 0) return;
4614
- scrolled.current = latest.current;
4615
- scrollToRow(row);
4616
- }, NAV_TREE_REVEAL_MS);
4617
- });
4618
- useEffect10(() => () => clearTimeout(waiting.current), []);
4619
- const groupScrolled = useRef16(void 0);
4620
- useEffect10(() => {
4644
+ const box = useRef17(null);
4645
+ useRevealCurrentRow(box, selected);
4646
+ const groupScrolled = useRef17(void 0);
4647
+ useEffect11(() => {
4621
4648
  if (selectedGroup === void 0) {
4622
4649
  groupScrolled.current = void 0;
4623
4650
  return;
@@ -4696,10 +4723,10 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
4696
4723
  }
4697
4724
 
4698
4725
  // src/SuggestionMenu.tsx
4699
- import { useCallback as useCallback5, useEffect as useEffect11, useId as useId5, useImperativeHandle, useMemo as useMemo5, useRef as useRef17, useState as useState19 } from "react";
4726
+ import { useCallback as useCallback5, useEffect as useEffect12, useId as useId5, useImperativeHandle, useMemo as useMemo5, useRef as useRef18, useState as useState19 } from "react";
4700
4727
  import { jsx as jsx61, jsxs as jsxs45 } from "react/jsx-runtime";
4701
4728
  function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sections, itemKey, row, onSelect, handle }) {
4702
- const last = useRef17(null);
4729
+ const last = useRef18(null);
4703
4730
  const anchor = useMemo5(() => {
4704
4731
  if (typeof rect !== "function") return rect;
4705
4732
  return {
@@ -4716,9 +4743,9 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4716
4743
  const [highlight, setHighlight] = useState19(0);
4717
4744
  const base = useId5();
4718
4745
  const listboxId = `${base}-list`;
4719
- const chosen = useRef17(null);
4720
- useEffect11(() => void (chosen.current = highlight > 0 ? keys.split("\n")[highlight] ?? null : null), [highlight]);
4721
- useEffect11(() => {
4746
+ const chosen = useRef18(null);
4747
+ useEffect12(() => void (chosen.current = highlight > 0 ? keys.split("\n")[highlight] ?? null : null), [highlight]);
4748
+ useEffect12(() => {
4722
4749
  const at = chosen.current ? keys.split("\n").indexOf(chosen.current) : -1;
4723
4750
  setHighlight(at > 0 ? at : 0);
4724
4751
  }, [keys]);
@@ -4743,7 +4770,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4743
4770
  }
4744
4771
  }), [items, highlight, onSelect]);
4745
4772
  const open = rect !== null && items.length > 0;
4746
- useEffect11(() => {
4773
+ useEffect12(() => {
4747
4774
  if (!editorElement || !open) return;
4748
4775
  editorElement.setAttribute("aria-autocomplete", "list");
4749
4776
  editorElement.setAttribute("aria-haspopup", "listbox");
@@ -4752,7 +4779,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4752
4779
  for (const name of ["aria-autocomplete", "aria-haspopup", "aria-controls", "aria-activedescendant"]) editorElement.removeAttribute(name);
4753
4780
  };
4754
4781
  }, [editorElement, open, listboxId]);
4755
- useEffect11(() => {
4782
+ useEffect12(() => {
4756
4783
  if (!editorElement || !open) return;
4757
4784
  editorElement.setAttribute("aria-activedescendant", `${base}-${highlight}`);
4758
4785
  }, [editorElement, open, base, highlight]);
@@ -4809,12 +4836,12 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4809
4836
  }
4810
4837
 
4811
4838
  // src/ShowMore.tsx
4812
- import { useLayoutEffect as useLayoutEffect5, useRef as useRef18, useState as useState20 } from "react";
4839
+ import { useLayoutEffect as useLayoutEffect5, useRef as useRef19, useState as useState20 } from "react";
4813
4840
  import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
4814
4841
  import { jsx as jsx62, jsxs as jsxs46 } from "react/jsx-runtime";
4815
4842
  var FADE = "linear-gradient(to top, transparent, black 40px)";
4816
4843
  function ShowMore({ children, maxHeight = 96, contentClassName, className }) {
4817
- const box = useRef18(null);
4844
+ const box = useRef19(null);
4818
4845
  const [open, setOpen] = useState20(false);
4819
4846
  const [overflows, setOverflows] = useState20(false);
4820
4847
  useLayoutEffect5(() => {
@@ -5692,7 +5719,7 @@ function LinkChip({ link, preview = true }) {
5692
5719
  }
5693
5720
 
5694
5721
  // src/AttachedCard.tsx
5695
- import { createContext as createContext10, useContext as useContext12, useEffect as useEffect12, useRef as useRef19 } from "react";
5722
+ import { createContext as createContext10, useContext as useContext12, useEffect as useEffect13, useRef as useRef20 } from "react";
5696
5723
  import { Fragment as Fragment19, jsx as jsx70, jsxs as jsxs51 } from "react/jsx-runtime";
5697
5724
  var Attached = createContext10(false);
5698
5725
  function useRememberedHeight(link, remember, box) {
@@ -5701,7 +5728,7 @@ function useRememberedHeight(link, remember, box) {
5701
5728
  const kept = memory && id && link?.state === "loading" ? memory.of(id, link.kind) : void 0;
5702
5729
  const shapeKey = memory && id && link?.state === "ready" ? JSON.stringify(loadingShapeOf(link.linked)) : void 0;
5703
5730
  const kind = link?.state === "ready" ? link.linked.kind : link?.kind;
5704
- useEffect12(() => {
5731
+ useEffect13(() => {
5705
5732
  const card = box.current;
5706
5733
  if (!memory || !id || !kind || !shapeKey || !card) return;
5707
5734
  const drawn = JSON.parse(shapeKey);
@@ -5725,7 +5752,7 @@ function useRememberedHeight(link, remember, box) {
5725
5752
  return { kept, held: kept?.height ? { minHeight: kept.height } : void 0 };
5726
5753
  }
5727
5754
  function AttachedCard({ link, children, onRemove, remember }) {
5728
- const box = useRef19(null);
5755
+ const box = useRef20(null);
5729
5756
  const { kept, held } = useRememberedHeight(link, remember, box);
5730
5757
  const shown2 = link?.state === "loading" && !link.shape && kept ? { ...link, shape: kept } : link;
5731
5758
  const card = shown2 ? /* @__PURE__ */ jsx70(LinkCard, { link: shown2 }) : children;
@@ -5917,10 +5944,53 @@ function Reaction({ emoji, count, pressed = false, className, ...props }) {
5917
5944
  );
5918
5945
  }
5919
5946
 
5947
+ // src/MetaText.tsx
5948
+ import { jsx as jsx77 } from "react/jsx-runtime";
5949
+ var TONE_CLASSES2 = {
5950
+ muted: "text-text-muted",
5951
+ secondary: "text-text-secondary",
5952
+ success: "text-success-default"
5953
+ };
5954
+ function MetaText({ children, tone = "muted", size = "caption", className }) {
5955
+ return /* @__PURE__ */ jsx77(
5956
+ "span",
5957
+ {
5958
+ className: cn(
5959
+ size === "chip" ? "text-chip font-normal" : "text-caption",
5960
+ TONE_CLASSES2[tone],
5961
+ TIME_CLASSES,
5962
+ className
5963
+ ),
5964
+ children
5965
+ }
5966
+ );
5967
+ }
5968
+
5969
+ // src/ActivityLine.tsx
5970
+ import { jsx as jsx78, jsxs as jsxs57 } from "react/jsx-runtime";
5971
+ function ActivityLine({ person, did, time, mark, where, words, seen = false, href, onClick, className, ...rest }) {
5972
+ const body = /* @__PURE__ */ jsx78(MenuItemBody, { leading: mark, leadingAt: "top", children: /* @__PURE__ */ jsxs57("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
5973
+ /* @__PURE__ */ jsxs57("span", { className: "flex min-w-0 items-center gap-1.5", children: [
5974
+ /* @__PURE__ */ jsx78("span", { className: cn("flex min-w-0 shrink-0 text-body-2-strong", seen ? "text-text-secondary" : "text-text-primary"), children: /* @__PURE__ */ jsx78(Person, { size: 16, name: person.name, ...person.picture ? { picture: person.picture } : {}, ...person.bot ? { bot: true } : {} }) }),
5975
+ /* @__PURE__ */ jsx78("span", { className: "min-w-0 truncate text-body-2 text-text-secondary", children: did }),
5976
+ /* @__PURE__ */ jsx78(MetaText, { size: "chip", className: "ml-auto shrink-0", children: time })
5977
+ ] }),
5978
+ (where || words) && /* @__PURE__ */ jsxs57("span", { className: "truncate text-caption text-text-muted", children: [
5979
+ where && /* @__PURE__ */ jsx78("span", { className: "text-text-secondary", children: `${where}${words ? " \xB7 " : ""}` }),
5980
+ words
5981
+ ] })
5982
+ ] }) });
5983
+ const row = menuItemClassName({ size: "default", className });
5984
+ if (href) {
5985
+ return /* @__PURE__ */ jsx78(Link, { href, variant: "plain", className: row, ...onClick ? { onClick } : {}, ...rest, children: body });
5986
+ }
5987
+ return /* @__PURE__ */ jsx78("button", { type: "button", className: row, ...onClick ? { onClick } : {}, ...rest, children: body });
5988
+ }
5989
+
5920
5990
  // src/ConversationActions.tsx
5921
5991
  import { useState as useState21 } from "react";
5922
5992
  import { IconCircleCheck as IconCircleCheck2, IconCircleDashed as IconCircleDashed4, IconMessage2 as IconMessage23, IconMoodPlus } from "@tabler/icons-react";
5923
- import { Fragment as Fragment20, jsx as jsx77, jsxs as jsxs57 } from "react/jsx-runtime";
5993
+ import { Fragment as Fragment20, jsx as jsx79, jsxs as jsxs58 } from "react/jsx-runtime";
5924
5994
  function ConversationActions({ options, onReact, onReply, resolved = false, onResolve, onReopen, onPickerOpenChange, more, className }) {
5925
5995
  const [picking, setPicking] = useState21(false);
5926
5996
  const [strip, setStrip] = useState21(null);
@@ -5930,8 +6000,8 @@ function ConversationActions({ options, onReact, onReply, resolved = false, onRe
5930
6000
  };
5931
6001
  const resolves = resolved ? onReopen : onResolve;
5932
6002
  const answers = !!onReact && !!options || !!onReply;
5933
- return /* @__PURE__ */ jsx77("div", { ref: setStrip, className: cn("inline-flex", className), children: /* @__PURE__ */ jsxs57(Toolbar, { "aria-label": "Actions", children: [
5934
- onReact && options && /* @__PURE__ */ jsx77(
6003
+ return /* @__PURE__ */ jsx79("div", { ref: setStrip, className: cn("inline-flex", className), children: /* @__PURE__ */ jsxs58(Toolbar, { "aria-label": "Actions", children: [
6004
+ onReact && options && /* @__PURE__ */ jsx79(
5935
6005
  Popover,
5936
6006
  {
5937
6007
  side: "top",
@@ -5942,8 +6012,8 @@ function ConversationActions({ options, onReact, onReply, resolved = false, onRe
5942
6012
  contentClassName: "p-1",
5943
6013
  open: picking,
5944
6014
  onOpenChange: setOpen,
5945
- trigger: /* @__PURE__ */ jsx77(ToolbarButton, { tooltip: "React", "aria-label": "React", children: /* @__PURE__ */ jsx77(IconMoodPlus, { size: 16, stroke: 1.5 }) }),
5946
- children: /* @__PURE__ */ jsx77(
6015
+ trigger: /* @__PURE__ */ jsx79(ToolbarButton, { tooltip: "React", "aria-label": "React", children: /* @__PURE__ */ jsx79(IconMoodPlus, { size: 16, stroke: 1.5 }) }),
6016
+ children: /* @__PURE__ */ jsx79(
5947
6017
  ReactionPicker,
5948
6018
  {
5949
6019
  options: [...options],
@@ -5956,60 +6026,65 @@ function ConversationActions({ options, onReact, onReply, resolved = false, onRe
5956
6026
  )
5957
6027
  }
5958
6028
  ),
5959
- onReply && /* @__PURE__ */ jsx77(ToolbarButton, { tooltip: "Reply", "aria-label": "Reply", onClick: onReply, children: /* @__PURE__ */ jsx77(IconMessage23, { size: 16, stroke: 1.5 }) }),
5960
- resolves && /* @__PURE__ */ jsxs57(Fragment20, { children: [
5961
- answers && /* @__PURE__ */ jsx77(ToolbarSeparator, {}),
5962
- resolved ? /* @__PURE__ */ jsx77(ToolbarButton, { tooltip: "Reopen", "aria-label": "Reopen", onClick: onReopen, children: /* @__PURE__ */ jsx77(IconCircleDashed4, { size: 16, stroke: 1.5 }) }) : /* @__PURE__ */ jsx77(ToolbarButton, { variant: "resolve", tooltip: "Resolve", "aria-label": "Resolve", onClick: onResolve, children: /* @__PURE__ */ jsx77(IconCircleCheck2, { size: 16, stroke: 1.5 }) })
6029
+ onReply && /* @__PURE__ */ jsx79(ToolbarButton, { tooltip: "Reply", "aria-label": "Reply", onClick: onReply, children: /* @__PURE__ */ jsx79(IconMessage23, { size: 16, stroke: 1.5 }) }),
6030
+ resolves && /* @__PURE__ */ jsxs58(Fragment20, { children: [
6031
+ answers && /* @__PURE__ */ jsx79(ToolbarSeparator, {}),
6032
+ resolved ? /* @__PURE__ */ jsx79(ToolbarButton, { tooltip: "Reopen", "aria-label": "Reopen", onClick: onReopen, children: /* @__PURE__ */ jsx79(IconCircleDashed4, { size: 16, stroke: 1.5 }) }) : /* @__PURE__ */ jsx79(ToolbarButton, { variant: "resolve", tooltip: "Resolve", "aria-label": "Resolve", onClick: onResolve, children: /* @__PURE__ */ jsx79(IconCircleCheck2, { size: 16, stroke: 1.5 }) })
5963
6033
  ] }),
5964
- more && /* @__PURE__ */ jsxs57(Fragment20, { children: [
5965
- (answers || resolves) && /* @__PURE__ */ jsx77(ToolbarSeparator, {}),
6034
+ more && /* @__PURE__ */ jsxs58(Fragment20, { children: [
6035
+ (answers || resolves) && /* @__PURE__ */ jsx79(ToolbarSeparator, {}),
5966
6036
  more
5967
6037
  ] })
5968
6038
  ] }) });
5969
6039
  }
5970
6040
 
5971
6041
  // src/ConversationCard.tsx
5972
- import { useContext as useContext14, useLayoutEffect as useLayoutEffect7, useRef as useRef20, useState as useState26 } from "react";
6042
+ import { useContext as useContext14, useLayoutEffect as useLayoutEffect7, useRef as useRef21, useState as useState26 } from "react";
5973
6043
  import { IconArrowNarrowRight, IconCircleCheck as IconCircleCheck4, IconDotsVertical as IconDotsVertical5 } from "@tabler/icons-react";
5974
6044
 
5975
6045
  // src/ConversationMenu.tsx
5976
6046
  import { IconCircleCheck as IconCircleCheck3, IconCircleDashed as IconCircleDashed5, IconDotsVertical as IconDotsVertical4 } from "@tabler/icons-react";
5977
- import { Fragment as Fragment21, jsx as jsx78, jsxs as jsxs58 } from "react/jsx-runtime";
6047
+ import { Fragment as Fragment21, jsx as jsx80, jsxs as jsxs59 } from "react/jsx-runtime";
5978
6048
  function ConversationMenu({ resolved = false, onResolve, onReopen, resolveHint, children, label, onEdit, editLabel = "Edit", after, onDelete, deleteLabel = "Delete", moreLabel = "More actions", open, onOpenChange, trigger }) {
5979
6049
  const resolves = resolved ? onReopen : onResolve;
5980
- const first = (resolves || children) && /* @__PURE__ */ jsxs58(Fragment21, { children: [
5981
- resolves && (resolved ? /* @__PURE__ */ jsx78(MenuItem, { leading: /* @__PURE__ */ jsx78(IconCircleDashed5, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Reopen", onClick: onReopen }) : /* @__PURE__ */ jsx78(MenuItem, { leading: /* @__PURE__ */ jsx78(IconCircleCheck3, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Resolve", shortcut: resolveHint, onClick: onResolve })),
6050
+ const first = (resolves || children) && /* @__PURE__ */ jsxs59(Fragment21, { children: [
6051
+ resolves && (resolved ? /* @__PURE__ */ jsx80(MenuItem, { leading: /* @__PURE__ */ jsx80(IconCircleDashed5, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Reopen", onClick: onReopen }) : /* @__PURE__ */ jsx80(MenuItem, { leading: /* @__PURE__ */ jsx80(IconCircleCheck3, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Resolve", shortcut: resolveHint, onClick: onResolve })),
5982
6052
  children
5983
6053
  ] });
5984
- const middle = (onEdit || after) && /* @__PURE__ */ jsxs58(Fragment21, { children: [
5985
- onEdit && /* @__PURE__ */ jsx78(MenuItem, { label: editLabel, onClick: onEdit }),
6054
+ const middle = (onEdit || after) && /* @__PURE__ */ jsxs59(Fragment21, { children: [
6055
+ onEdit && /* @__PURE__ */ jsx80(MenuItem, { label: editLabel, onClick: onEdit }),
5986
6056
  after
5987
6057
  ] });
5988
- return /* @__PURE__ */ jsxs58(
6058
+ return /* @__PURE__ */ jsxs59(
5989
6059
  Menu,
5990
6060
  {
5991
- trigger: trigger ?? /* @__PURE__ */ jsx78(IconButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx78(IconDotsVertical4, { size: 16, stroke: 1.5 }) }),
6061
+ trigger: trigger ?? /* @__PURE__ */ jsx80(IconButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx80(IconDotsVertical4, { size: 16, stroke: 1.5 }) }),
5992
6062
  align: "right",
5993
6063
  open,
5994
6064
  onOpenChange,
5995
6065
  className: "w-[244px]",
5996
6066
  children: [
5997
- first && (label ? /* @__PURE__ */ jsx78(MenuSection, { label, children: first }) : first),
5998
- first && middle && /* @__PURE__ */ jsx78(MenuSeparator, {}),
6067
+ first && (label ? /* @__PURE__ */ jsx80(MenuSection, { label, children: first }) : first),
6068
+ first && middle && /* @__PURE__ */ jsx80(MenuSeparator, {}),
5999
6069
  middle,
6000
- onDelete && (first || middle) && /* @__PURE__ */ jsx78(MenuSeparator, {}),
6001
- onDelete && /* @__PURE__ */ jsx78(MenuItem, { label: deleteLabel, destructive: true, onClick: onDelete })
6070
+ onDelete && (first || middle) && /* @__PURE__ */ jsx80(MenuSeparator, {}),
6071
+ onDelete && /* @__PURE__ */ jsx80(MenuItem, { label: deleteLabel, destructive: true, onClick: onDelete })
6002
6072
  ]
6003
6073
  }
6004
6074
  );
6005
6075
  }
6006
6076
 
6007
6077
  // src/conversationScroll.ts
6008
- import { createContext as createContext11, useEffect as useEffect13, useState as useState22 } from "react";
6078
+ import { createContext as createContext11, useEffect as useEffect14, useState as useState22 } from "react";
6009
6079
  var NEAR_BOTTOM_PX = 80;
6010
6080
  function isNearBottom(el) {
6011
6081
  return el.scrollHeight - el.scrollTop - el.clientHeight <= NEAR_BOTTOM_PX;
6012
6082
  }
6083
+ function landOn(el, item) {
6084
+ const box = el.getBoundingClientRect();
6085
+ const at = item.getBoundingClientRect();
6086
+ el.scrollTop += at.top - box.top - (el.clientHeight - at.height) / 2;
6087
+ }
6013
6088
  function anchorIn(el) {
6014
6089
  if (typeof document.elementFromPoint !== "function") return void 0;
6015
6090
  const box = el.getBoundingClientRect();
@@ -6024,7 +6099,7 @@ var cardIn = (el, id) => el.querySelector(`[data-conversation-item="${CSS.escape
6024
6099
  function useSteadyScroll(scrollRef, atBottom, ready, key, enabled) {
6025
6100
  const [handle] = useState22(() => ({ rebase: () => {
6026
6101
  } }));
6027
- useEffect13(() => {
6102
+ useEffect14(() => {
6028
6103
  const el = scrollRef.current;
6029
6104
  if (!enabled || !el || typeof ResizeObserver === "undefined") return;
6030
6105
  let fromBottom = 0;
@@ -6091,38 +6166,16 @@ var sendsInLayout = createContext11(null);
6091
6166
  var repliesDrawn = createContext11(null);
6092
6167
 
6093
6168
  // src/EditedMarker.tsx
6094
- import { jsx as jsx79 } from "react/jsx-runtime";
6169
+ import { jsx as jsx81 } from "react/jsx-runtime";
6095
6170
  function EditedMarker({ edited }) {
6096
6171
  if (!edited) return null;
6097
- return /* @__PURE__ */ jsx79(WithTooltip, { label: edited, wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx79("span", { className: "whitespace-nowrap text-caption text-text-muted", children: "(edited)" }) });
6098
- }
6099
-
6100
- // src/MetaText.tsx
6101
- import { jsx as jsx80 } from "react/jsx-runtime";
6102
- var TONE_CLASSES2 = {
6103
- muted: "text-text-muted",
6104
- secondary: "text-text-secondary",
6105
- success: "text-success-default"
6106
- };
6107
- function MetaText({ children, tone = "muted", size = "caption", className }) {
6108
- return /* @__PURE__ */ jsx80(
6109
- "span",
6110
- {
6111
- className: cn(
6112
- size === "chip" ? "text-chip font-normal" : "text-caption",
6113
- TONE_CLASSES2[tone],
6114
- TIME_CLASSES,
6115
- className
6116
- ),
6117
- children
6118
- }
6119
- );
6172
+ return /* @__PURE__ */ jsx81(WithTooltip, { label: edited, wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx81("span", { className: "whitespace-nowrap text-caption text-text-muted", children: "(edited)" }) });
6120
6173
  }
6121
6174
 
6122
6175
  // src/ReactionRow.tsx
6123
6176
  import { useState as useState23 } from "react";
6124
6177
  import { IconMoodPlus as IconMoodPlus2 } from "@tabler/icons-react";
6125
- import { jsx as jsx81, jsxs as jsxs59 } from "react/jsx-runtime";
6178
+ import { jsx as jsx82, jsxs as jsxs60 } from "react/jsx-runtime";
6126
6179
  var NAMED = 8;
6127
6180
  var meaningOf = (options, emoji) => options.find((o) => o.emoji === emoji)?.label ?? emoji;
6128
6181
  function whoReacted(reaction, nameOf, options, viewer) {
@@ -6137,7 +6190,7 @@ function whoReacted(reaction, nameOf, options, viewer) {
6137
6190
  }
6138
6191
  function AddReactionButton({ options, onPick, className }) {
6139
6192
  const [picking, setPicking] = useState23(false);
6140
- return /* @__PURE__ */ jsx81(
6193
+ return /* @__PURE__ */ jsx82(
6141
6194
  Popover,
6142
6195
  {
6143
6196
  open: picking,
@@ -6147,8 +6200,8 @@ function AddReactionButton({ options, onPick, className }) {
6147
6200
  ariaLabel: "Add a reaction",
6148
6201
  contentClassName: "p-1",
6149
6202
  className: cn("w-auto min-w-0", className),
6150
- trigger: /* @__PURE__ */ jsx81(IconButton, { variant: "muted", tooltip: "Add a reaction", "aria-label": "Add a reaction", children: /* @__PURE__ */ jsx81(IconMoodPlus2, { size: 16, stroke: 1.5 }) }),
6151
- children: /* @__PURE__ */ jsx81(
6203
+ trigger: /* @__PURE__ */ jsx82(IconButton, { variant: "muted", tooltip: "Add a reaction", "aria-label": "Add a reaction", children: /* @__PURE__ */ jsx82(IconMoodPlus2, { size: 16, stroke: 1.5 }) }),
6204
+ children: /* @__PURE__ */ jsx82(
6152
6205
  ReactionPicker,
6153
6206
  {
6154
6207
  options: [...options],
@@ -6165,8 +6218,8 @@ function AddReactionButton({ options, onPick, className }) {
6165
6218
  function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }) {
6166
6219
  const shown2 = reactions.filter((r) => r.by.length > 0);
6167
6220
  if (shown2.length === 0) return null;
6168
- return /* @__PURE__ */ jsxs59("div", { "data-reaction-row": true, className: cn("flex flex-wrap items-center gap-1", className), children: [
6169
- shown2.map((r) => /* @__PURE__ */ jsx81(WithTooltip, { label: whoReacted(r, nameOf, options, viewer), children: /* @__PURE__ */ jsx81(
6221
+ return /* @__PURE__ */ jsxs60("div", { "data-reaction-row": true, className: cn("flex flex-wrap items-center gap-1", className), children: [
6222
+ shown2.map((r) => /* @__PURE__ */ jsx82(WithTooltip, { label: whoReacted(r, nameOf, options, viewer), children: /* @__PURE__ */ jsx82(
6170
6223
  Reaction,
6171
6224
  {
6172
6225
  emoji: r.emoji,
@@ -6177,13 +6230,13 @@ function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }
6177
6230
  onClick: () => onToggle?.(r.emoji)
6178
6231
  }
6179
6232
  ) }, r.emoji)),
6180
- onToggle && /* @__PURE__ */ jsx81(AddReactionButton, { options, onPick: onToggle })
6233
+ onToggle && /* @__PURE__ */ jsx82(AddReactionButton, { options, onPick: onToggle })
6181
6234
  ] });
6182
6235
  }
6183
6236
 
6184
6237
  // src/RepliesRow.tsx
6185
6238
  import { IconChevronRight as IconChevronRight4, IconMessage2 as IconMessage24 } from "@tabler/icons-react";
6186
- import { Fragment as Fragment22, jsx as jsx82, jsxs as jsxs60 } from "react/jsx-runtime";
6239
+ import { Fragment as Fragment22, jsx as jsx83, jsxs as jsxs61 } from "react/jsx-runtime";
6187
6240
  var ROW_CLASSES3 = "flex w-full items-center gap-2 pb-1.5 pl-8 pr-2";
6188
6241
  var OPEN_CLASSES = "border-accent-outline bg-accent-wash";
6189
6242
  var BOX_CLASSES = "group/replies flex shrink-0 items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors hover:border-accent-outline hover:bg-accent-wash";
@@ -6192,9 +6245,9 @@ function RepliesRow({ count, faces, last, isNew = false, newCount, urgent = fals
6192
6245
  const label = `${count} ${count === 1 ? "reply" : "replies"}`;
6193
6246
  const fresh = newCount ?? (isNew ? 1 : 0);
6194
6247
  const name = newCount ? `${label}, ${newCount} new` : label;
6195
- const inner = /* @__PURE__ */ jsxs60(Fragment22, { children: [
6196
- withFaces && /* @__PURE__ */ jsx82("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ jsx82(AvatarGroup, { size: 18, members: faces.map((f) => ({ name: f.name, picture: f.picture, bot: f.bot })) }) }),
6197
- /* @__PURE__ */ jsx82(
6248
+ const inner = /* @__PURE__ */ jsxs61(Fragment22, { children: [
6249
+ withFaces && /* @__PURE__ */ jsx83("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ jsx83(AvatarGroup, { size: 18, members: faces.map((f) => ({ name: f.name, picture: f.picture, bot: f.bot })) }) }),
6250
+ /* @__PURE__ */ jsx83(
6198
6251
  IconMessage24,
6199
6252
  {
6200
6253
  size: 16,
@@ -6205,9 +6258,9 @@ function RepliesRow({ count, faces, last, isNew = false, newCount, urgent = fals
6205
6258
  )
6206
6259
  }
6207
6260
  ),
6208
- /* @__PURE__ */ jsx82("span", { className: "text-chip font-medium text-text-interactive transition-colors group-hover/replies:text-text-primary", children: label }),
6209
- last && /* @__PURE__ */ jsx82("span", { className: cn("mt-px text-small leading-3 text-text-muted", TIME_CLASSES), children: last }),
6210
- /* @__PURE__ */ jsx82(
6261
+ /* @__PURE__ */ jsx83("span", { className: "text-chip font-medium text-text-interactive transition-colors group-hover/replies:text-text-primary", children: label }),
6262
+ last && /* @__PURE__ */ jsx83("span", { className: cn("mt-px text-small leading-3 text-text-muted", TIME_CLASSES), children: last }),
6263
+ /* @__PURE__ */ jsx83(
6211
6264
  IconChevronRight4,
6212
6265
  {
6213
6266
  size: 12,
@@ -6216,20 +6269,20 @@ function RepliesRow({ count, faces, last, isNew = false, newCount, urgent = fals
6216
6269
  }
6217
6270
  )
6218
6271
  ] });
6219
- const chip = fresh > 0 && /* @__PURE__ */ jsxs60(Fragment22, { children: [
6220
- /* @__PURE__ */ jsx82("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-text-muted" }),
6221
- /* @__PURE__ */ jsx82(Chip, { type: urgent ? "warning" : "brand", label: `${fresh} new` })
6272
+ const chip = fresh > 0 && /* @__PURE__ */ jsxs61(Fragment22, { children: [
6273
+ /* @__PURE__ */ jsx83("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-text-muted" }),
6274
+ /* @__PURE__ */ jsx83(Chip, { type: urgent ? "warning" : "brand", label: `${fresh} new` })
6222
6275
  ] });
6223
6276
  if (!onOpen) {
6224
- return /* @__PURE__ */ jsxs60("div", { className: ROW_CLASSES3, children: [
6225
- /* @__PURE__ */ jsx82("div", { className: BOX_CLASSES, children: inner }),
6277
+ return /* @__PURE__ */ jsxs61("div", { className: ROW_CLASSES3, children: [
6278
+ /* @__PURE__ */ jsx83("div", { className: BOX_CLASSES, children: inner }),
6226
6279
  chip
6227
6280
  ] });
6228
6281
  }
6229
6282
  return (
6230
6283
  // @estiva-escape(no-raw-element): the row is the thread's way in, Peek's replies row; no kit button takes a face stack, a count, a time and the new chip in one press
6231
- /* @__PURE__ */ jsxs60("button", { type: "button", className: cn(ROW_CLASSES3, "cursor-pointer text-left"), onClick: onOpen, "aria-expanded": open, "aria-label": `${name}, ${open ? "close" : "open"} the thread`, "data-interactive": true, children: [
6232
- /* @__PURE__ */ jsx82("span", { className: cn(BOX_CLASSES, open && OPEN_CLASSES), children: inner }),
6284
+ /* @__PURE__ */ jsxs61("button", { type: "button", className: cn(ROW_CLASSES3, "cursor-pointer text-left"), onClick: onOpen, "aria-expanded": open, "aria-label": `${name}, ${open ? "close" : "open"} the thread`, "data-interactive": true, children: [
6285
+ /* @__PURE__ */ jsx83("span", { className: cn(BOX_CLASSES, open && OPEN_CLASSES), children: inner }),
6233
6286
  chip
6234
6287
  ] })
6235
6288
  );
@@ -6237,14 +6290,14 @@ function RepliesRow({ count, faces, last, isNew = false, newCount, urgent = fals
6237
6290
 
6238
6291
  // src/ResolveDialog.tsx
6239
6292
  import { useState as useState24 } from "react";
6240
- import { jsx as jsx83, jsxs as jsxs61 } from "react/jsx-runtime";
6293
+ import { jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
6241
6294
  function ResolveDialog({ onResolve, onCancel, refused }) {
6242
6295
  const [note, setNote] = useState24("");
6243
6296
  return (
6244
6297
  // Outlined at rest and green on hover in Signal, the kit's `resolve` look.
6245
- /* @__PURE__ */ jsx83(FormDialog, { title: "Resolve", submitLabel: "Resolve", submitVariant: "resolve", onSubmit: () => onResolve(note), onClose: onCancel, children: /* @__PURE__ */ jsxs61(Field, { label: "Resolution message (optional)", children: [
6246
- /* @__PURE__ */ jsx83(Textarea, { autoFocus: true, value: note, onChange: (e) => setNote(e.target.value), placeholder: "Summarize the outcome or decision...", className: "h-[109px]" }),
6247
- refused && /* @__PURE__ */ jsx83(FieldLine, { tone: "error", children: refused })
6298
+ /* @__PURE__ */ jsx84(FormDialog, { title: "Resolve", submitLabel: "Resolve", submitVariant: "resolve", onSubmit: () => onResolve(note), onClose: onCancel, children: /* @__PURE__ */ jsxs62(Field, { label: "Resolution message (optional)", children: [
6299
+ /* @__PURE__ */ jsx84(Textarea, { autoFocus: true, value: note, onChange: (e) => setNote(e.target.value), placeholder: "Summarize the outcome or decision...", className: "h-[109px]" }),
6300
+ refused && /* @__PURE__ */ jsx84(FieldLine, { tone: "error", children: refused })
6248
6301
  ] }) })
6249
6302
  );
6250
6303
  }
@@ -6292,31 +6345,31 @@ function useFaceLine(root, active, toDot = false) {
6292
6345
  }
6293
6346
 
6294
6347
  // src/PinnedComment.tsx
6295
- import { jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
6348
+ import { jsx as jsx85, jsxs as jsxs63 } from "react/jsx-runtime";
6296
6349
  var goneWords = (deleted) => deleted ? "This comment was deleted." : "This comment can\u2019t be shown.";
6297
6350
  var GONE_CLOSED = "This thread takes no new replies.";
6298
6351
  function PinnedComment({ author, time, at: given, words, deleted = false, unseen = false }) {
6299
6352
  const at = momentOf(given);
6300
- return /* @__PURE__ */ jsx84(Card, { fill: "elevated", clip: true, children: deleted || unseen ? /* @__PURE__ */ jsx84("p", { className: "p-2 text-caption italic text-text-muted", children: goneWords(deleted) }) : /* @__PURE__ */ jsxs62("div", { className: "flex flex-col p-2", children: [
6301
- /* @__PURE__ */ jsxs62("div", { className: "flex items-center gap-2", children: [
6302
- /* @__PURE__ */ jsx84(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }),
6303
- /* @__PURE__ */ jsx84("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
6304
- /* @__PURE__ */ jsx84(MetaText, { className: "shrink-0", children: at === void 0 ? time : /* @__PURE__ */ jsx84(WithTooltip, { label: exactTime(at), children: /* @__PURE__ */ jsx84("time", { dateTime: new Date(at).toISOString(), children: time }) }) })
6353
+ return /* @__PURE__ */ jsx85(Card, { fill: "elevated", clip: true, children: deleted || unseen ? /* @__PURE__ */ jsx85("p", { className: "p-2 text-caption italic text-text-muted", children: goneWords(deleted) }) : /* @__PURE__ */ jsxs63("div", { className: "flex flex-col p-2", children: [
6354
+ /* @__PURE__ */ jsxs63("div", { className: "flex items-center gap-2", children: [
6355
+ /* @__PURE__ */ jsx85(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }),
6356
+ /* @__PURE__ */ jsx85("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
6357
+ /* @__PURE__ */ jsx85(MetaText, { className: "shrink-0", children: at === void 0 ? time : /* @__PURE__ */ jsx85(WithTooltip, { label: exactTime(at), children: /* @__PURE__ */ jsx85("time", { dateTime: new Date(at).toISOString(), children: time }) }) })
6305
6358
  ] }),
6306
- /* @__PURE__ */ jsx84("div", { className: "pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx84("div", { className: "truncate text-caption text-text-secondary", children: words }) })
6359
+ /* @__PURE__ */ jsx85("div", { className: "pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx85("div", { className: "truncate text-caption text-text-secondary", children: words }) })
6307
6360
  ] }) });
6308
6361
  }
6309
6362
 
6310
6363
  // src/ConversationCard.tsx
6311
- import { Fragment as Fragment23, jsx as jsx85, jsxs as jsxs63 } from "react/jsx-runtime";
6364
+ import { Fragment as Fragment23, jsx as jsx86, jsxs as jsxs64 } from "react/jsx-runtime";
6312
6365
  function When({ time, at: given, timeHref, timeLabel = "Link to this" }) {
6313
6366
  const at = momentOf(given);
6314
6367
  const exact = at === void 0 ? void 0 : exactTime(at);
6315
- const said = at === void 0 ? time : /* @__PURE__ */ jsx85("time", { dateTime: new Date(at).toISOString(), children: time });
6368
+ const said = at === void 0 ? time : /* @__PURE__ */ jsx86("time", { dateTime: new Date(at).toISOString(), children: time });
6316
6369
  if (timeHref) {
6317
- return /* @__PURE__ */ jsx85(WithTooltip, { label: exact ? `${exact} \xB7 ${timeLabel}` : timeLabel, wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx85(MetaText, { className: "contents", children: /* @__PURE__ */ jsx85(Link, { href: timeHref, variant: "quiet", "data-interactive": true, children: said }) }) });
6370
+ return /* @__PURE__ */ jsx86(WithTooltip, { label: exact ? `${exact} \xB7 ${timeLabel}` : timeLabel, wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx86(MetaText, { className: "contents", children: /* @__PURE__ */ jsx86(Link, { href: timeHref, variant: "quiet", "data-interactive": true, children: said }) }) });
6318
6371
  }
6319
- return /* @__PURE__ */ jsx85(MetaText, { className: "shrink-0", children: exact ? /* @__PURE__ */ jsx85(WithTooltip, { label: exact, children: said }) : time });
6372
+ return /* @__PURE__ */ jsx86(MetaText, { className: "shrink-0", children: exact ? /* @__PURE__ */ jsx86(WithTooltip, { label: exact, children: said }) : time });
6320
6373
  }
6321
6374
  var fadeBefore = (end) => `linear-gradient(to right, black ${end - 16}px, transparent ${end}px)`;
6322
6375
  function useClearOfStrip(root, strip, shown2) {
@@ -6336,15 +6389,15 @@ function useClearOfStrip(root, strip, shown2) {
6336
6389
  return end;
6337
6390
  }
6338
6391
  function Head({ author, time, at, timeHref, timeLabel, edited, isNew, urgent, meta, end }) {
6339
- return /* @__PURE__ */ jsxs63("div", { className: "flex w-full items-center gap-2", children: [
6340
- /* @__PURE__ */ jsxs63("div", { "data-head": true, className: "flex min-w-0 flex-1 items-center gap-2", style: end === void 0 ? void 0 : { maskImage: fadeBefore(end), WebkitMaskImage: fadeBefore(end) }, children: [
6341
- /* @__PURE__ */ jsx85("span", { "data-face": true, className: "relative flex shrink-0", children: /* @__PURE__ */ jsx85(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }) }),
6342
- /* @__PURE__ */ jsx85("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
6343
- /* @__PURE__ */ jsx85(When, { time, at, timeHref, timeLabel }),
6344
- /* @__PURE__ */ jsx85(EditedMarker, { edited }),
6392
+ return /* @__PURE__ */ jsxs64("div", { className: "flex w-full items-center gap-2", children: [
6393
+ /* @__PURE__ */ jsxs64("div", { "data-head": true, className: "flex min-w-0 flex-1 items-center gap-2", style: end === void 0 ? void 0 : { maskImage: fadeBefore(end), WebkitMaskImage: fadeBefore(end) }, children: [
6394
+ /* @__PURE__ */ jsx86("span", { "data-face": true, className: "relative flex shrink-0", children: /* @__PURE__ */ jsx86(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }) }),
6395
+ /* @__PURE__ */ jsx86("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
6396
+ /* @__PURE__ */ jsx86(When, { time, at, timeHref, timeLabel }),
6397
+ /* @__PURE__ */ jsx86(EditedMarker, { edited }),
6345
6398
  meta
6346
6399
  ] }),
6347
- isNew && (urgent ? /* @__PURE__ */ jsx85(UrgentMark, {}) : /* @__PURE__ */ jsx85(UnreadDot, {}))
6400
+ isNew && (urgent ? /* @__PURE__ */ jsx86(UrgentMark, {}) : /* @__PURE__ */ jsx86(UnreadDot, {}))
6348
6401
  ] });
6349
6402
  }
6350
6403
  function attentionOf(fresh, urgent, inThreadCard) {
@@ -6352,13 +6405,13 @@ function attentionOf(fresh, urgent, inThreadCard) {
6352
6405
  return urgent ? "warning" : "accent";
6353
6406
  }
6354
6407
  function EndedLine({ by, note, at }) {
6355
- return /* @__PURE__ */ jsxs63("div", { "data-resolved": "line", className: "relative flex items-start py-1", children: [
6356
- /* @__PURE__ */ jsx85("span", { className: "flex h-[17px] w-10 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx85("span", { "data-dot": true, className: "relative z-10 flex size-2 items-center justify-center rounded-full bg-bg-surface", children: /* @__PURE__ */ jsx85("span", { className: "size-1 rounded-full bg-success-default" }) }) }),
6357
- /* @__PURE__ */ jsxs63("p", { className: "min-w-0 text-h5 leading-snug", children: [
6358
- /* @__PURE__ */ jsx85("span", { className: "whitespace-nowrap text-text-primary", children: by }),
6359
- /* @__PURE__ */ jsx85(IconArrowNarrowRight, { size: 12, stroke: 1.5, className: "mx-1.5 -mt-px inline shrink-0 text-text-primary" }),
6360
- /* @__PURE__ */ jsx85("span", { className: "text-text-secondary", children: note }),
6361
- at && /* @__PURE__ */ jsxs63(MetaText, { size: "chip", children: [
6408
+ return /* @__PURE__ */ jsxs64("div", { "data-resolved": "line", className: "relative flex items-start py-1", children: [
6409
+ /* @__PURE__ */ jsx86("span", { className: "flex h-[17px] w-10 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx86("span", { "data-dot": true, className: "relative z-10 flex size-2 items-center justify-center rounded-full bg-bg-surface", children: /* @__PURE__ */ jsx86("span", { className: "size-1 rounded-full bg-success-default" }) }) }),
6410
+ /* @__PURE__ */ jsxs64("p", { className: "min-w-0 text-h5 leading-snug", children: [
6411
+ /* @__PURE__ */ jsx86("span", { className: "whitespace-nowrap text-text-primary", children: by }),
6412
+ /* @__PURE__ */ jsx86(IconArrowNarrowRight, { size: 12, stroke: 1.5, className: "mx-1.5 -mt-px inline shrink-0 text-text-primary" }),
6413
+ /* @__PURE__ */ jsx86("span", { className: "text-text-secondary", children: note }),
6414
+ at && /* @__PURE__ */ jsxs64(MetaText, { size: "chip", children: [
6362
6415
  " \xB7 ",
6363
6416
  at
6364
6417
  ] })
@@ -6367,17 +6420,17 @@ function EndedLine({ by, note, at }) {
6367
6420
  }
6368
6421
  function ResolvedCheck({ by, note, at }) {
6369
6422
  const said = `Resolved by ${by}${at ? `, ${at}` : ""}${note ? `: ${note}` : ""}`;
6370
- return /* @__PURE__ */ jsx85(WithTooltip, { label: said, wrapperClassName: "flex shrink-0", children: /* @__PURE__ */ jsxs63("span", { className: "flex items-center gap-1 text-caption text-success-default", children: [
6371
- /* @__PURE__ */ jsx85(IconCircleCheck4, { size: 14, stroke: 1.5 }),
6423
+ return /* @__PURE__ */ jsx86(WithTooltip, { label: said, wrapperClassName: "flex shrink-0", children: /* @__PURE__ */ jsxs64("span", { className: "flex items-center gap-1 text-caption text-success-default", children: [
6424
+ /* @__PURE__ */ jsx86(IconCircleCheck4, { size: 14, stroke: 1.5 }),
6372
6425
  "Resolved"
6373
6426
  ] }) });
6374
6427
  }
6375
6428
  function Words({ children }) {
6376
- return /* @__PURE__ */ jsx85("div", { className: "relative w-full break-words pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx85("div", { className: "flex flex-col gap-2 text-body-2 text-text-secondary", children }) });
6429
+ return /* @__PURE__ */ jsx86("div", { className: "relative w-full break-words pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx86("div", { className: "flex flex-col gap-2 text-body-2 text-text-secondary", children }) });
6377
6430
  }
6378
6431
  function useReactionRefusal(reactions) {
6379
6432
  const [refused, setRefused] = useState26();
6380
- const latest = useRef20(0);
6433
+ const latest = useRef21(0);
6381
6434
  const toggle = reactions?.onToggle;
6382
6435
  if (!reactions || !toggle) return { row: reactions, refused };
6383
6436
  const onToggle = (emoji) => {
@@ -6400,9 +6453,9 @@ function useReactionRefusal(reactions) {
6400
6453
  }
6401
6454
  function Reactions({ reactions, refused, readOnly }) {
6402
6455
  if ((!reactions || reactions.reactions.length === 0) && !refused) return null;
6403
- return /* @__PURE__ */ jsxs63("div", { className: "relative flex w-full flex-col gap-1 pb-2 pl-8 pt-1", children: [
6404
- reactions && /* @__PURE__ */ jsx85(ReactionRow, { ...reactions, onToggle: readOnly ? void 0 : reactions.onToggle }),
6405
- refused && /* @__PURE__ */ jsxs63(FieldLine, { tone: "error", children: [
6456
+ return /* @__PURE__ */ jsxs64("div", { className: "relative flex w-full flex-col gap-1 pb-2 pl-8 pt-1", children: [
6457
+ reactions && /* @__PURE__ */ jsx86(ReactionRow, { ...reactions, onToggle: readOnly ? void 0 : reactions.onToggle }),
6458
+ refused && /* @__PURE__ */ jsxs64(FieldLine, { tone: "error", children: [
6406
6459
  "Not reacted: ",
6407
6460
  refused,
6408
6461
  "."
@@ -6410,11 +6463,11 @@ function Reactions({ reactions, refused, readOnly }) {
6410
6463
  ] });
6411
6464
  }
6412
6465
  function Editing({ author, heading, children }) {
6413
- return /* @__PURE__ */ jsxs63("div", { className: "p-2", children: [
6414
- !!heading && /* @__PURE__ */ jsx85("div", { className: "w-full pb-2", children: heading }),
6415
- /* @__PURE__ */ jsxs63("div", { className: "flex items-start gap-2", children: [
6416
- /* @__PURE__ */ jsx85(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot, className: "mt-1 shrink-0" }),
6417
- /* @__PURE__ */ jsx85("div", { className: "min-w-0 flex-1", children })
6466
+ return /* @__PURE__ */ jsxs64("div", { className: "p-2", children: [
6467
+ !!heading && /* @__PURE__ */ jsx86("div", { className: "w-full pb-2", children: heading }),
6468
+ /* @__PURE__ */ jsxs64("div", { className: "flex items-start gap-2", children: [
6469
+ /* @__PURE__ */ jsx86(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot, className: "mt-1 shrink-0" }),
6470
+ /* @__PURE__ */ jsx86("div", { className: "min-w-0 flex-1", children })
6418
6471
  ] })
6419
6472
  ] });
6420
6473
  }
@@ -6428,7 +6481,7 @@ function stillHere(root) {
6428
6481
  }
6429
6482
  function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
6430
6483
  const [answered, setAnswered] = useState26(false);
6431
- return /* @__PURE__ */ jsx85(
6484
+ return /* @__PURE__ */ jsx86(
6432
6485
  ConfirmDialog,
6433
6486
  {
6434
6487
  title: `Delete this ${noun}?`,
@@ -6447,7 +6500,7 @@ function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
6447
6500
  }
6448
6501
  function ResolveQuestion({ onResolve, refused, onClose }) {
6449
6502
  const [answered, setAnswered] = useState26(false);
6450
- return /* @__PURE__ */ jsx85(
6503
+ return /* @__PURE__ */ jsx86(
6451
6504
  ResolveDialog,
6452
6505
  {
6453
6506
  refused: answered ? refused : void 0,
@@ -6487,12 +6540,12 @@ function ConversationCard(props) {
6487
6540
  const resolves = resolved ? onReopen : onResolve;
6488
6541
  const lined = inThreadCard;
6489
6542
  const toDot = !lined && !!resolved?.note && !isEditing;
6490
- const root = useRef20(null);
6543
+ const root = useRef21(null);
6491
6544
  const dotLine = useFaceLine(root, toDot, true);
6492
6545
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
6493
6546
  const offersMenu = !!resolves || !!menu || !!menuAfter || own && (!!editor || !!onDelete);
6494
6547
  const showStrip = hovered && !isEditing && !readOnly;
6495
- const strip = useRef20(null);
6548
+ const strip = useRef21(null);
6496
6549
  const wordsEnd = useClearOfStrip(root, strip, showStrip);
6497
6550
  const { row: reactionRow, refused: reactionRefused } = useReactionRefusal(reactions);
6498
6551
  const react = reactionRow?.onToggle;
@@ -6500,9 +6553,9 @@ function ConversationCard(props) {
6500
6553
  const reply = onReply ?? item?.show;
6501
6554
  const marked = selected ?? (item && !item.under ? item.open : void 0);
6502
6555
  const under = !!item?.under;
6503
- const repliesRow = replies && replies.count > 0 && /* @__PURE__ */ jsx85(RepliesRow, { ...replies, onOpen: replies.onOpen ?? (under ? item?.toggle : void 0), open: replies.open ?? (under && !!item?.open), urgent });
6504
- return /* @__PURE__ */ jsxs63(Fragment23, { children: [
6505
- /* @__PURE__ */ jsxs63(
6556
+ const repliesRow = replies && replies.count > 0 && /* @__PURE__ */ jsx86(RepliesRow, { ...replies, onOpen: replies.onOpen ?? (under ? item?.toggle : void 0), open: replies.open ?? (under && !!item?.open), urgent });
6557
+ return /* @__PURE__ */ jsxs64(Fragment23, { children: [
6558
+ /* @__PURE__ */ jsxs64(
6506
6559
  Card,
6507
6560
  {
6508
6561
  ref: root,
@@ -6527,14 +6580,14 @@ function ConversationCard(props) {
6527
6580
  setHovered(false);
6528
6581
  },
6529
6582
  children: [
6530
- isEditing ? /* @__PURE__ */ jsx85(Editing, { author, heading, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs63("div", { "data-comment-body": true, className: "flex flex-col items-start px-2 pt-2", children: [
6583
+ isEditing ? /* @__PURE__ */ jsx86(Editing, { author, heading, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs64("div", { "data-comment-body": true, className: "flex flex-col items-start px-2 pt-2", children: [
6531
6584
  !!heading && // Faded clear of the strip, as the head's words are (useClearOfStrip).
6532
- /* @__PURE__ */ jsx85("div", { className: "w-full pb-2", style: wordsEnd === void 0 ? void 0 : { maskImage: fadeBefore(wordsEnd), WebkitMaskImage: fadeBefore(wordsEnd) }, children: heading }),
6533
- deleted ? /* @__PURE__ */ jsxs63(Fragment23, { children: [
6534
- !!about && /* @__PURE__ */ jsx85("div", { className: "relative w-full pl-8 pr-2", children: about }),
6535
- /* @__PURE__ */ jsx85("p", { className: cn("w-full pb-2 pl-8 pr-2 text-caption italic text-text-muted", !!about && "pt-1"), children: goneWords(isDeleted) })
6536
- ] }) : /* @__PURE__ */ jsxs63(Fragment23, { children: [
6537
- /* @__PURE__ */ jsx85(
6585
+ /* @__PURE__ */ jsx86("div", { className: "w-full pb-2", style: wordsEnd === void 0 ? void 0 : { maskImage: fadeBefore(wordsEnd), WebkitMaskImage: fadeBefore(wordsEnd) }, children: heading }),
6586
+ deleted ? /* @__PURE__ */ jsxs64(Fragment23, { children: [
6587
+ !!about && /* @__PURE__ */ jsx86("div", { className: "relative w-full pl-8 pr-2", children: about }),
6588
+ /* @__PURE__ */ jsx86("p", { className: cn("w-full pb-2 pl-8 pr-2 text-caption italic text-text-muted", !!about && "pt-1"), children: goneWords(isDeleted) })
6589
+ ] }) : /* @__PURE__ */ jsxs64(Fragment23, { children: [
6590
+ /* @__PURE__ */ jsx86(
6538
6591
  Head,
6539
6592
  {
6540
6593
  author,
@@ -6545,24 +6598,24 @@ function ConversationCard(props) {
6545
6598
  edited: props.edited,
6546
6599
  isNew,
6547
6600
  urgent,
6548
- meta: resolved && /* @__PURE__ */ jsx85(ResolvedCheck, { by: resolved.by, note: resolved.note, at: resolved.at }),
6601
+ meta: resolved && /* @__PURE__ */ jsx86(ResolvedCheck, { by: resolved.by, note: resolved.note, at: resolved.at }),
6549
6602
  end: wordsEnd
6550
6603
  }
6551
6604
  ),
6552
6605
  !!about && // Under the name, above the words (Katerina, 1 November).
6553
- /* @__PURE__ */ jsx85("div", { className: "relative w-full pl-8 pr-2 pt-0.5", children: about }),
6554
- /* @__PURE__ */ jsx85(Words, { children })
6606
+ /* @__PURE__ */ jsx86("div", { className: "relative w-full pl-8 pr-2 pt-0.5", children: about }),
6607
+ /* @__PURE__ */ jsx86(Words, { children })
6555
6608
  ] }),
6556
- !deleted && files && /* @__PURE__ */ jsx85("div", { className: "relative flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
6557
- /* @__PURE__ */ jsx85(Reactions, { reactions: reactionRow, refused: reactionRefused, readOnly }),
6609
+ !deleted && files && /* @__PURE__ */ jsx86("div", { className: "relative flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
6610
+ /* @__PURE__ */ jsx86(Reactions, { reactions: reactionRow, refused: reactionRefused, readOnly }),
6558
6611
  resolved?.note && // Who resolved it and the note, above the way into the replies; the check by the time says "Resolved" (Katerina, 1 November).
6559
- /* @__PURE__ */ jsx85("div", { className: "relative w-full pb-1", children: /* @__PURE__ */ jsx85("div", { className: "-ml-2 w-[calc(100%+8px)]", children: /* @__PURE__ */ jsx85(EndedLine, { by: resolved.by, note: resolved.note, at: resolved.at }) }) }),
6560
- repliesRow && /* @__PURE__ */ jsx85("div", { className: "relative w-full", children: repliesRow })
6612
+ /* @__PURE__ */ jsx86("div", { className: "relative w-full pb-1", children: /* @__PURE__ */ jsx86("div", { className: "-ml-2 w-[calc(100%+8px)]", children: /* @__PURE__ */ jsx86(EndedLine, { by: resolved.by, note: resolved.note, at: resolved.at }) }) }),
6613
+ repliesRow && /* @__PURE__ */ jsx86("div", { className: "relative w-full", children: repliesRow })
6561
6614
  ] }),
6562
6615
  dotLine && // One bar from the face to the dot, measured (useFaceLine): 2px, centred under the 24px face, 8px in.
6563
6616
  // Its top and height come from the measure: where the face ends and the dot stands are not known ahead.
6564
- /* @__PURE__ */ jsx85("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: dotLine.top, height: dotLine.height } }),
6565
- showStrip && /* @__PURE__ */ jsx85("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx85(
6617
+ /* @__PURE__ */ jsx86("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: dotLine.top, height: dotLine.height } }),
6618
+ showStrip && /* @__PURE__ */ jsx86("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx86(
6566
6619
  ConversationActions,
6567
6620
  {
6568
6621
  options: reactions?.options,
@@ -6575,10 +6628,10 @@ function ConversationCard(props) {
6575
6628
  resolved: !!resolved,
6576
6629
  onResolve: onResolve && (() => setResolving(true)),
6577
6630
  onReopen,
6578
- more: offersMenu && /* @__PURE__ */ jsx85(
6631
+ more: offersMenu && /* @__PURE__ */ jsx86(
6579
6632
  ConversationMenu,
6580
6633
  {
6581
- trigger: /* @__PURE__ */ jsx85(ToolbarButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx85(IconDotsVertical5, { size: 16, stroke: 1.5 }) }),
6634
+ trigger: /* @__PURE__ */ jsx86(ToolbarButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx86(IconDotsVertical5, { size: 16, stroke: 1.5 }) }),
6582
6635
  open: menuOpen,
6583
6636
  onOpenChange: (open) => {
6584
6637
  setMenuOpen(open);
@@ -6602,15 +6655,15 @@ function ConversationCard(props) {
6602
6655
  ]
6603
6656
  }
6604
6657
  ),
6605
- deleting && onDelete && /* @__PURE__ */ jsx85(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote !== void 0 ? typeof deleteNote === "string" ? /* @__PURE__ */ jsx85("p", { children: deleteNote }) : deleteNote : /* @__PURE__ */ jsxs63(Fragment23, { children: [
6606
- /* @__PURE__ */ jsx85("p", { children: "It is deleted for everyone." }),
6607
- replies && replies.count > 0 && /* @__PURE__ */ jsxs63("p", { children: [
6658
+ deleting && onDelete && /* @__PURE__ */ jsx86(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote !== void 0 ? typeof deleteNote === "string" ? /* @__PURE__ */ jsx86("p", { children: deleteNote }) : deleteNote : /* @__PURE__ */ jsxs64(Fragment23, { children: [
6659
+ /* @__PURE__ */ jsx86("p", { children: "It is deleted for everyone." }),
6660
+ replies && replies.count > 0 && /* @__PURE__ */ jsxs64("p", { children: [
6608
6661
  "Its ",
6609
6662
  replies.count === 1 ? "reply stays" : `${replies.count} replies stay`,
6610
6663
  "."
6611
6664
  ] })
6612
6665
  ] }) }),
6613
- resolving && onResolve && /* @__PURE__ */ jsx85(ResolveQuestion, { onResolve, refused: resolveRefused, onClose: () => setResolving(false) })
6666
+ resolving && onResolve && /* @__PURE__ */ jsx86(ResolveQuestion, { onResolve, refused: resolveRefused, onClose: () => setResolving(false) })
6614
6667
  ] });
6615
6668
  }
6616
6669
  function ReplyCard(props) {
@@ -6625,16 +6678,16 @@ function ReplyCard(props) {
6625
6678
  const isEditing = editing && !readOnly && !!editor;
6626
6679
  const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
6627
6680
  const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
6628
- const root = useRef20(null);
6629
- const strip = useRef20(null);
6681
+ const root = useRef21(null);
6682
+ const strip = useRef21(null);
6630
6683
  const wordsEnd = useClearOfStrip(root, strip, showStrip);
6631
6684
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
6632
6685
  const drawn = useContext14(repliesDrawn);
6633
6686
  useLayoutEffect7(() => {
6634
6687
  if (drawn) drawn.added += 1;
6635
6688
  }, [drawn]);
6636
- return /* @__PURE__ */ jsxs63(Fragment23, { children: [
6637
- /* @__PURE__ */ jsxs63(
6689
+ return /* @__PURE__ */ jsxs64(Fragment23, { children: [
6690
+ /* @__PURE__ */ jsxs64(
6638
6691
  Card,
6639
6692
  {
6640
6693
  ref: root,
@@ -6657,15 +6710,15 @@ function ReplyCard(props) {
6657
6710
  setHovered(false);
6658
6711
  },
6659
6712
  children: [
6660
- isEditing ? /* @__PURE__ */ jsx85(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs63("div", { className: "flex flex-col items-start px-2 pt-2", children: [
6661
- /* @__PURE__ */ jsx85(Head, { author, time: props.time, at: props.at, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent, end: wordsEnd }),
6662
- about && /* @__PURE__ */ jsx85("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
6663
- /* @__PURE__ */ jsx85(Words, { children }),
6664
- files && /* @__PURE__ */ jsx85("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
6665
- /* @__PURE__ */ jsx85(Reactions, { reactions, refused: reactionRefused, readOnly })
6713
+ isEditing ? /* @__PURE__ */ jsx86(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs64("div", { className: "flex flex-col items-start px-2 pt-2", children: [
6714
+ /* @__PURE__ */ jsx86(Head, { author, time: props.time, at: props.at, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent, end: wordsEnd }),
6715
+ about && /* @__PURE__ */ jsx86("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
6716
+ /* @__PURE__ */ jsx86(Words, { children }),
6717
+ files && /* @__PURE__ */ jsx86("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
6718
+ /* @__PURE__ */ jsx86(Reactions, { reactions, refused: reactionRefused, readOnly })
6666
6719
  ] }),
6667
6720
  showStrip && // In a box of its own, as a comment's: the box is what the head measures to keep clear of.
6668
- /* @__PURE__ */ jsx85("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx85(
6721
+ /* @__PURE__ */ jsx86("div", { ref: strip, className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ jsx86(
6669
6722
  ConversationActions,
6670
6723
  {
6671
6724
  options: reactions?.options,
@@ -6674,10 +6727,10 @@ function ReplyCard(props) {
6674
6727
  setPicking(open);
6675
6728
  if (!open) settle();
6676
6729
  },
6677
- more: offersMenu && /* @__PURE__ */ jsx85(
6730
+ more: offersMenu && /* @__PURE__ */ jsx86(
6678
6731
  ConversationMenu,
6679
6732
  {
6680
- trigger: /* @__PURE__ */ jsx85(ToolbarButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx85(IconDotsVertical5, { size: 16, stroke: 1.5 }) }),
6733
+ trigger: /* @__PURE__ */ jsx86(ToolbarButton, { tooltip: moreLabel, "aria-label": moreLabel, children: /* @__PURE__ */ jsx86(IconDotsVertical5, { size: 16, stroke: 1.5 }) }),
6681
6734
  open: menuOpen,
6682
6735
  onOpenChange: (next) => {
6683
6736
  setMenuOpen(next);
@@ -6697,41 +6750,88 @@ function ReplyCard(props) {
6697
6750
  ]
6698
6751
  }
6699
6752
  ),
6700
- deleting && onDelete && /* @__PURE__ */ jsx85(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote === void 0 ? /* @__PURE__ */ jsx85("p", { children: "It is deleted for everyone." }) : typeof deleteNote === "string" ? /* @__PURE__ */ jsx85("p", { children: deleteNote }) : deleteNote })
6753
+ deleting && onDelete && /* @__PURE__ */ jsx86(DeleteQuestion, { noun, onDelete, refused: deleteRefused, onClose: () => setDeleting(false), children: deleteNote === void 0 ? /* @__PURE__ */ jsx86("p", { children: "It is deleted for everyone." }) : typeof deleteNote === "string" ? /* @__PURE__ */ jsx86("p", { children: deleteNote }) : deleteNote })
6701
6754
  ] });
6702
6755
  }
6703
6756
 
6704
6757
  // src/ConversationLayout.tsx
6705
- import { Fragment as Fragment24, useCallback as useCallback6, useEffect as useEffect15, useLayoutEffect as useLayoutEffect8, useRef as useRef21, useState as useState28 } from "react";
6758
+ import { Fragment as Fragment24, useCallback as useCallback6, useEffect as useEffect16, useLayoutEffect as useLayoutEffect8, useRef as useRef22, useState as useState28 } from "react";
6706
6759
 
6707
6760
  // src/Panel.tsx
6708
- import { jsx as jsx86, jsxs as jsxs64 } from "react/jsx-runtime";
6761
+ import { jsx as jsx87, jsxs as jsxs65 } from "react/jsx-runtime";
6709
6762
  function Frame({ title, chevron = false, actions, header, children, footer, bodyClassName, bodyRef, onBodyScroll, className, broken = false }) {
6710
- return /* @__PURE__ */ jsxs64("div", { className: cn("flex h-full min-h-0 flex-1 flex-col", className), children: [
6711
- header ?? /* @__PURE__ */ jsx86(ContainerHeader, { title, chevron, actions }),
6763
+ return /* @__PURE__ */ jsxs65("div", { className: cn("flex h-full min-h-0 flex-1 flex-col", className), children: [
6764
+ header ?? /* @__PURE__ */ jsx87(ContainerHeader, { title, chevron, actions }),
6712
6765
  broken ? (
6713
6766
  // The message takes the room the body had and centres itself in it.
6714
- /* @__PURE__ */ jsx86("div", { className: "flex min-h-0 flex-1 flex-col px-4", children })
6715
- ) : /* @__PURE__ */ jsx86(ScrollArea, { className: "min-h-0 flex-1", contentClassName: bodyClassName, viewportRef: bodyRef, onScroll: onBodyScroll, children }),
6716
- !broken && footer && /* @__PURE__ */ jsx86("div", { className: "shrink-0", children: footer })
6767
+ /* @__PURE__ */ jsx87("div", { className: "flex min-h-0 flex-1 flex-col px-4", children })
6768
+ ) : /* @__PURE__ */ jsx87(ScrollArea, { className: "min-h-0 flex-1", contentClassName: bodyClassName, viewportRef: bodyRef, onScroll: onBodyScroll, children }),
6769
+ !broken && footer && /* @__PURE__ */ jsx87("div", { className: "shrink-0", children: footer })
6717
6770
  ] });
6718
6771
  }
6719
6772
  function Panel(props) {
6720
- return /* @__PURE__ */ jsx86(
6773
+ return /* @__PURE__ */ jsx87(
6721
6774
  ErrorBoundary,
6722
6775
  {
6723
6776
  label: "panel",
6724
6777
  frame: (message) => (
6725
6778
  // Only the name comes back with the message: the actions and the footer may be what threw.
6726
- /* @__PURE__ */ jsx86(Frame, { title: props.title, chevron: props.chevron, className: props.className, broken: true, children: message })
6779
+ /* @__PURE__ */ jsx87(Frame, { title: props.title, chevron: props.chevron, className: props.className, broken: true, children: message })
6727
6780
  ),
6728
- children: /* @__PURE__ */ jsx86(Frame, { ...props })
6781
+ children: /* @__PURE__ */ jsx87(Frame, { ...props })
6729
6782
  }
6730
6783
  );
6731
6784
  }
6732
6785
 
6786
+ // src/showInConversation.ts
6787
+ var SHOWN_MS = 1800;
6788
+ var WAIT_MS = 3e3;
6789
+ var POLL_MS = 50;
6790
+ var owed = /* @__PURE__ */ new WeakMap();
6791
+ var asked = 0;
6792
+ function find(id, { comments = false }) {
6793
+ const quoted = CSS.escape(id);
6794
+ return document.querySelector(`[data-reply-id="${quoted}"], [data-thread-start="${quoted}"]`) ?? (comments ? document.querySelector(`[data-conversation-item="${quoted}"]`) : null);
6795
+ }
6796
+ function showInConversation(id, options = {}) {
6797
+ asked += 1;
6798
+ return show(id, options);
6799
+ }
6800
+ function show(id, options) {
6801
+ const el = find(id, options);
6802
+ if (!el) return false;
6803
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
6804
+ markShown(el);
6805
+ return true;
6806
+ }
6807
+ function markShown(el) {
6808
+ const previous = owed.get(el);
6809
+ if (previous !== void 0) window.clearTimeout(previous);
6810
+ el.dataset.shown = "true";
6811
+ owed.set(
6812
+ el,
6813
+ window.setTimeout(() => {
6814
+ delete el.dataset.shown;
6815
+ owed.delete(el);
6816
+ }, SHOWN_MS)
6817
+ );
6818
+ }
6819
+ function showInConversationWhenDrawn(id, { wait = WAIT_MS, ...options } = {}) {
6820
+ const mine = ++asked;
6821
+ return new Promise((resolve) => {
6822
+ const deadline = Date.now() + wait;
6823
+ const attempt = () => {
6824
+ if (mine !== asked) return resolve(false);
6825
+ if (show(id, options)) return resolve(true);
6826
+ if (Date.now() >= deadline) return resolve(false);
6827
+ window.setTimeout(attempt, POLL_MS);
6828
+ };
6829
+ attempt();
6830
+ });
6831
+ }
6832
+
6733
6833
  // src/seenOnScreen.ts
6734
- import { useEffect as useEffect14, useMemo as useMemo6, useState as useState27 } from "react";
6834
+ import { useEffect as useEffect15, useMemo as useMemo6, useState as useState27 } from "react";
6735
6835
  var NONE = /* @__PURE__ */ new Set();
6736
6836
  var DWELL_MS = 1500;
6737
6837
  var TALL_ENOUGH_PX = 120;
@@ -6740,7 +6840,7 @@ var watchers = /* @__PURE__ */ new WeakMap();
6740
6840
  function useSeenOnScreen(key) {
6741
6841
  const [seen, setSeen] = useState27({ key: null, ids: NONE });
6742
6842
  const [watcher] = useState27(() => ({ roots: /* @__PURE__ */ new Map(), watch: { current: null } }));
6743
- useEffect14(() => {
6843
+ useEffect15(() => {
6744
6844
  if (!key) return;
6745
6845
  const timers = /* @__PURE__ */ new Map();
6746
6846
  const showing = /* @__PURE__ */ new Set();
@@ -6815,7 +6915,7 @@ function useSeenOnScreen(key) {
6815
6915
  }, [ids, watcher]);
6816
6916
  }
6817
6917
  function useWatchSeen(seen, root, attribute) {
6818
- useEffect14(() => {
6918
+ useEffect15(() => {
6819
6919
  const watcher = seen && watchers.get(seen);
6820
6920
  const el = root.current;
6821
6921
  if (!watcher || !el) return;
@@ -6829,11 +6929,11 @@ function useWatchSeen(seen, root, attribute) {
6829
6929
  }
6830
6930
 
6831
6931
  // src/ConversationLayout.tsx
6832
- import { Fragment as Fragment25, jsx as jsx87, jsxs as jsxs65 } from "react/jsx-runtime";
6932
+ import { Fragment as Fragment25, jsx as jsx88, jsxs as jsxs66 } from "react/jsx-runtime";
6833
6933
  var threadOf = (item) => typeof item?.thread === "function" ? item.thread() : item?.thread;
6834
6934
  function List({ items, open, under, above, loading, empty, change, caret }) {
6835
- if (loading) return /* @__PURE__ */ jsx87(SkeletonConversation, {});
6836
- if (items.length === 0) return typeof empty === "string" ? /* @__PURE__ */ jsx87(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx87(Fragment25, { children: empty });
6935
+ if (loading) return /* @__PURE__ */ jsx88(SkeletonConversation, {});
6936
+ if (items.length === 0) return typeof empty === "string" ? /* @__PURE__ */ jsx88(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx88(Fragment25, { children: empty });
6837
6937
  const stateOf = (item) => change && item.thread ? {
6838
6938
  under,
6839
6939
  open: open === item.id,
@@ -6842,12 +6942,12 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
6842
6942
  } : null;
6843
6943
  const draw2 = (item) => {
6844
6944
  if (!under) {
6845
- return /* @__PURE__ */ jsxs65(Fragment24, { children: [
6945
+ return /* @__PURE__ */ jsxs66(Fragment24, { children: [
6846
6946
  item.before,
6847
- /* @__PURE__ */ jsx87("div", { "data-conversation-item": item.id, className: cn("flex flex-col", SHOWN_CLASSES), children: /* @__PURE__ */ jsx87(InConversationItem.Provider, { value: stateOf(item), children: item.card }) })
6947
+ /* @__PURE__ */ jsx88("div", { "data-conversation-item": item.id, className: cn("flex flex-col", SHOWN_CLASSES), children: /* @__PURE__ */ jsx88(InConversationItem.Provider, { value: stateOf(item), children: item.card }) })
6848
6948
  ] }, item.id);
6849
6949
  }
6850
- return /* @__PURE__ */ jsx87(UnderItem, { item, isOpen: open === item.id && !!item.thread, state: stateOf(item), caret }, item.id);
6950
+ return /* @__PURE__ */ jsx88(UnderItem, { item, isOpen: open === item.id && !!item.thread, state: stateOf(item), caret }, item.id);
6851
6951
  };
6852
6952
  if (!under) {
6853
6953
  const stretches = [];
@@ -6863,11 +6963,11 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
6863
6963
  seen.set(name, count);
6864
6964
  stretches.push({ key: `${item.day === void 0 ? "no-day" : `day:${name}`}#${count}`, day: item.day, items: [item] });
6865
6965
  }
6866
- return /* @__PURE__ */ jsxs65(Fragment25, { children: [
6966
+ return /* @__PURE__ */ jsxs66(Fragment25, { children: [
6867
6967
  above,
6868
6968
  stretches.map(
6869
- (stretch) => stretch.day === void 0 ? /* @__PURE__ */ jsx87(Fragment24, { children: stretch.items.map(draw2) }, stretch.key) : /* @__PURE__ */ jsxs65("div", { className: "flex flex-col gap-2", children: [
6870
- /* @__PURE__ */ jsx87(Divider, { look: "section", label: stretch.day, sticky: true }),
6969
+ (stretch) => stretch.day === void 0 ? /* @__PURE__ */ jsx88(Fragment24, { children: stretch.items.map(draw2) }, stretch.key) : /* @__PURE__ */ jsxs66("div", { className: "flex flex-col gap-2", children: [
6970
+ /* @__PURE__ */ jsx88(Divider, { look: "section", label: stretch.day, sticky: true }),
6871
6971
  stretch.items.map(draw2)
6872
6972
  ] }, stretch.key)
6873
6973
  )
@@ -6875,11 +6975,11 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
6875
6975
  }
6876
6976
  const resolved = items.filter((item) => item.resolved);
6877
6977
  const gone = items.filter((item) => item.gone && !item.resolved);
6878
- const group = (title, list) => list.length > 0 && /* @__PURE__ */ jsx87(
6978
+ const group = (title, list) => list.length > 0 && /* @__PURE__ */ jsx88(
6879
6979
  CollapsibleSection,
6880
6980
  {
6881
6981
  title,
6882
- trailing: /* @__PURE__ */ jsx87(Chip, { type: "neutral", label: String(list.length) }),
6982
+ trailing: /* @__PURE__ */ jsx88(Chip, { type: "neutral", label: String(list.length) }),
6883
6983
  defaultOpen: false,
6884
6984
  openFor: list.some((item) => item.id === open) ? open : void 0,
6885
6985
  className: "shrink-0",
@@ -6887,7 +6987,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
6887
6987
  children: list.map(draw2)
6888
6988
  }
6889
6989
  );
6890
- return /* @__PURE__ */ jsxs65(Fragment25, { children: [
6990
+ return /* @__PURE__ */ jsxs66(Fragment25, { children: [
6891
6991
  above,
6892
6992
  items.filter((item) => !item.resolved && !item.gone).map(draw2),
6893
6993
  group("On deleted blocks", gone),
@@ -6895,9 +6995,9 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
6895
6995
  ] });
6896
6996
  }
6897
6997
  function UnderItem({ item, isOpen, state, caret }) {
6898
- const root = useRef21(null);
6998
+ const root = useRef22(null);
6899
6999
  const line = useFaceLine(root, isOpen);
6900
- return /* @__PURE__ */ jsxs65(
7000
+ return /* @__PURE__ */ jsxs66(
6901
7001
  Card,
6902
7002
  {
6903
7003
  ref: root,
@@ -6909,13 +7009,13 @@ function UnderItem({ item, isOpen, state, caret }) {
6909
7009
  quietUntilHover: !isOpen,
6910
7010
  className: cn("relative flex flex-col", isOpen && "pb-2", SHOWN_CLASSES),
6911
7011
  children: [
6912
- /* @__PURE__ */ jsx87(InConversationItem.Provider, { value: state, children: /* @__PURE__ */ jsx87(InThreadCard.Provider, { value: isOpen, children: /* @__PURE__ */ jsxs65(LineByLayout.Provider, { value: true, children: [
6913
- /* @__PURE__ */ jsx87("div", { className: "-m-px flex flex-col", children: item.card }),
6914
- isOpen && /* @__PURE__ */ jsx87(caretOnOpen.Provider, { value: caret, children: threadOf(item) })
7012
+ /* @__PURE__ */ jsx88(InConversationItem.Provider, { value: state, children: /* @__PURE__ */ jsx88(InThreadCard.Provider, { value: isOpen, children: /* @__PURE__ */ jsxs66(LineByLayout.Provider, { value: true, children: [
7013
+ /* @__PURE__ */ jsx88("div", { className: "-m-px flex flex-col", children: item.card }),
7014
+ isOpen && /* @__PURE__ */ jsx88(caretOnOpen.Provider, { value: caret, children: threadOf(item) })
6915
7015
  ] }) }) }),
6916
7016
  line && // The face's line, one bar, last so it stands over a hovered card's fill; 19px in, centred under the face.
6917
7017
  // Its top and height come from the measure: where the face and the last reply end are not known ahead.
6918
- /* @__PURE__ */ jsx87("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: line.top, height: line.height } })
7018
+ /* @__PURE__ */ jsx88("span", { "aria-hidden": true, className: "pointer-events-none absolute left-[19px] w-0.5 bg-border-default", style: { top: line.top, height: line.height } })
6919
7019
  ]
6920
7020
  }
6921
7021
  );
@@ -6943,7 +7043,7 @@ function ConversationLayout({
6943
7043
  className
6944
7044
  }) {
6945
7045
  const beside = threads === "beside";
6946
- const body = useRef21(null);
7046
+ const body = useRef22(null);
6947
7047
  const setBody = useCallback6(
6948
7048
  (el) => {
6949
7049
  body.current = el;
@@ -6953,7 +7053,8 @@ function ConversationLayout({
6953
7053
  [bodyRef]
6954
7054
  );
6955
7055
  useWatchSeen(seen, body, "data-conversation-item");
6956
- const pressed = useRef21(null);
7056
+ const pressed = useRef22(null);
7057
+ const byPress = useRef22(false);
6957
7058
  const itemAt = (id) => body.current?.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`) ?? null;
6958
7059
  const [caret, setCaret] = useState28(0);
6959
7060
  const change = onOpenChange ? (id, next, reply = false) => {
@@ -6963,6 +7064,7 @@ function ConversationLayout({
6963
7064
  }
6964
7065
  const item = threads === "under" ? itemAt(id) : null;
6965
7066
  pressed.current = item ? { id, top: item.getBoundingClientRect().top } : null;
7067
+ byPress.current = true;
6966
7068
  onOpenChange(next);
6967
7069
  } : void 0;
6968
7070
  useLayoutEffect8(() => {
@@ -6973,13 +7075,13 @@ function ConversationLayout({
6973
7075
  const moved = item.getBoundingClientRect().top - at.top;
6974
7076
  if (moved !== 0) body.current.scrollTop += moved;
6975
7077
  }, [open]);
6976
- const was = useRef21(open);
6977
- useEffect15(() => {
7078
+ const was = useRef22(open);
7079
+ useEffect16(() => {
6978
7080
  if (open !== void 0 && open !== was.current) setCaret((n) => n + 1);
6979
7081
  was.current = open;
6980
7082
  }, [open]);
6981
- const nearBottom = useRef21(true);
6982
- const placedFor = useRef21(null);
7083
+ const nearBottom = useRef22(true);
7084
+ const placedFor = useRef22(null);
6983
7085
  const placeKey = rememberAs ?? FRESH;
6984
7086
  const scrolled = (event) => {
6985
7087
  const el = body.current;
@@ -6999,7 +7101,13 @@ function ConversationLayout({
6999
7101
  const el = body.current;
7000
7102
  if (!el) return;
7001
7103
  const left = rememberAs ? places.get(rememberAs) : void 0;
7002
- if (left && !left.atBottom) {
7104
+ const opened2 = open !== void 0 ? itemAt(open) : null;
7105
+ if (opened2) {
7106
+ landOn(el, opened2);
7107
+ markShown(opened2);
7108
+ nearBottom.current = isNearBottom(el);
7109
+ if (rememberAs) places.set(rememberAs, { atBottom: nearBottom.current, offset: el.scrollTop, anchor: anchorIn(el), leftAt: Date.now() });
7110
+ } else if (left && !left.atBottom) {
7003
7111
  el.scrollTop = left.offset;
7004
7112
  const card = left.anchor && cardIn(el, left.anchor.id);
7005
7113
  if (card && left.anchor) el.scrollTop += card.getBoundingClientRect().top - el.getBoundingClientRect().top - left.anchor.top;
@@ -7011,9 +7119,20 @@ function ConversationLayout({
7011
7119
  }
7012
7120
  placedFor.current = placeKey;
7013
7121
  }, [beside, placeKey, rememberAs, loading]);
7122
+ useLayoutEffect8(() => {
7123
+ const pressedIt = byPress.current;
7124
+ byPress.current = false;
7125
+ if (!beside || pressedIt || open === void 0 || placedFor.current !== placeKey) return;
7126
+ const el = body.current;
7127
+ const item = itemAt(open);
7128
+ if (!el || !item) return;
7129
+ landOn(el, item);
7130
+ markShown(item);
7131
+ nearBottom.current = isNearBottom(el);
7132
+ }, [open]);
7014
7133
  const placed = useCallback6(() => placedFor.current === placeKey, [placeKey]);
7015
7134
  useSteadyScroll(body, nearBottom, placed, loading, beside);
7016
- useEffect15(() => {
7135
+ useEffect16(() => {
7017
7136
  if (!beside || !rememberAs) return;
7018
7137
  return () => {
7019
7138
  const left = places.get(rememberAs);
@@ -7038,49 +7157,49 @@ function ConversationLayout({
7038
7157
  // The body at least the column's height: the comments start at its top, and the note under them (`below`) is pushed
7039
7158
  // to its foot, so with few comments it sits on the box, as a short conversation's last line does in Peek's two
7040
7159
  // columns (Katerina, 2 November); with many it comes after them, and scrolls with them.
7041
- /* @__PURE__ */ jsxs65(Panel, { className: cn("w-[384px] flex-none", className), title, actions, bodyRef: setBody, bodyClassName: "flex min-h-full flex-col gap-2 p-3", footer: box && /* @__PURE__ */ jsx87("div", { className: "p-3", children: box }), children: [
7042
- /* @__PURE__ */ jsx87(List, { items, open, under: true, above, loading, empty, change, caret }),
7043
- !loading && below != null && below !== false && below !== "" && /* @__PURE__ */ jsx87("div", { className: "mt-auto flex flex-col gap-2", children: below })
7160
+ /* @__PURE__ */ jsxs66(Panel, { className: cn("w-[384px] flex-none", className), title, actions, bodyRef: setBody, bodyClassName: "flex min-h-full flex-col gap-2 p-3", footer: box && /* @__PURE__ */ jsx88("div", { className: "p-3", children: box }), children: [
7161
+ /* @__PURE__ */ jsx88(List, { items, open, under: true, above, loading, empty, change, caret }),
7162
+ !loading && below != null && below !== false && below !== "" && /* @__PURE__ */ jsx88("div", { className: "mt-auto flex flex-col gap-2", children: below })
7044
7163
  ] })
7045
7164
  );
7046
7165
  }
7047
7166
  const opened = threadOf(items.find((item) => item.id === open));
7048
7167
  const side = opened || aside;
7049
- return /* @__PURE__ */ jsxs65("div", { className: cn("flex min-h-0 min-w-0 flex-1", className), children: [
7050
- /* @__PURE__ */ jsx87(
7168
+ return /* @__PURE__ */ jsxs66("div", { className: cn("flex min-h-0 min-w-0 flex-1", className), children: [
7169
+ /* @__PURE__ */ jsx88(
7051
7170
  ErrorBoundary,
7052
7171
  {
7053
7172
  label: "conversation",
7054
- frame: (message) => /* @__PURE__ */ jsxs65("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
7055
- /* @__PURE__ */ jsx87(ContainerHeader, { title }),
7056
- /* @__PURE__ */ jsx87("div", { className: "flex min-h-0 flex-1 flex-col px-4", children: message })
7173
+ frame: (message) => /* @__PURE__ */ jsxs66("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
7174
+ /* @__PURE__ */ jsx88(ContainerHeader, { title }),
7175
+ /* @__PURE__ */ jsx88("div", { className: "flex min-h-0 flex-1 flex-col px-4", children: message })
7057
7176
  ] }),
7058
- children: /* @__PURE__ */ jsxs65("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
7177
+ children: /* @__PURE__ */ jsxs66("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
7059
7178
  header,
7060
- /* @__PURE__ */ jsxs65(ScrollArea, { className: "min-h-0 flex-1", viewportRef: setBody, onScroll: scrolled, contentClassName: "flex min-h-full flex-col", children: [
7061
- top != null && top !== false && top !== "" && /* @__PURE__ */ jsx87("div", { className: "shrink-0 px-4 pt-4", children: top }),
7062
- /* @__PURE__ */ jsx87("div", { className: "min-h-0 flex-1" }),
7063
- /* @__PURE__ */ jsxs65("div", { className: "flex shrink-0 flex-col gap-2 p-4", children: [
7064
- /* @__PURE__ */ jsx87(List, { items, open, under: false, above, loading, empty, change, caret }),
7179
+ /* @__PURE__ */ jsxs66(ScrollArea, { className: "min-h-0 flex-1", viewportRef: setBody, onScroll: scrolled, contentClassName: "flex min-h-full flex-col", children: [
7180
+ top != null && top !== false && top !== "" && /* @__PURE__ */ jsx88("div", { className: "shrink-0 px-4 pt-4", children: top }),
7181
+ /* @__PURE__ */ jsx88("div", { className: "min-h-0 flex-1" }),
7182
+ /* @__PURE__ */ jsxs66("div", { className: "flex shrink-0 flex-col gap-2 p-4", children: [
7183
+ /* @__PURE__ */ jsx88(List, { items, open, under: false, above, loading, empty, change, caret }),
7065
7184
  !loading && below
7066
7185
  ] })
7067
7186
  ] }),
7068
- box && /* @__PURE__ */ jsx87("div", { className: "shrink-0 p-3", children: /* @__PURE__ */ jsx87(sendsInLayout.Provider, { value: sends, children: box }) })
7187
+ box && /* @__PURE__ */ jsx88("div", { className: "shrink-0 p-3", children: /* @__PURE__ */ jsx88(sendsInLayout.Provider, { value: sends, children: box }) })
7069
7188
  ] })
7070
7189
  }
7071
7190
  ),
7072
7191
  side && // Its own catch, as Peek's column had: a thread or a panel that throws says so in the column, and the comments stay.
7073
7192
  // One catch per thread, and one for the aside: a thread that threw is let go once it is closed or another opens,
7074
7193
  // as Peek's column, drawn only while a thread was open, let it go on closing. Each thread is drawn afresh.
7075
- /* @__PURE__ */ jsx87("div", { className: "flex w-[384px] shrink-0 flex-col overflow-hidden border-l border-border-subtle", children: /* @__PURE__ */ jsx87(ErrorBoundary, { label: "thread panel", children: opened ? /* @__PURE__ */ jsx87(caretOnOpen.Provider, { value: caret, children: opened }) : aside }, opened ? `thread:${open}` : "aside") })
7194
+ /* @__PURE__ */ jsx88("div", { className: "flex w-[384px] shrink-0 flex-col overflow-hidden border-l border-border-subtle", children: /* @__PURE__ */ jsx88(ErrorBoundary, { label: "thread panel", children: opened ? /* @__PURE__ */ jsx88(caretOnOpen.Provider, { value: caret, children: opened }) : aside }, opened ? `thread:${open}` : "aside") })
7076
7195
  ] });
7077
7196
  }
7078
7197
 
7079
7198
  // src/ConversationHeading.tsx
7080
- import { jsx as jsx88, jsxs as jsxs66 } from "react/jsx-runtime";
7199
+ import { jsx as jsx89, jsxs as jsxs67 } from "react/jsx-runtime";
7081
7200
  var NAME = "-mx-1 min-w-0 truncate rounded px-1 text-left text-h4 text-text-primary";
7082
7201
  function ConversationHeading({ icon, name, onOpen, href, className }) {
7083
- const label = href ? /* @__PURE__ */ jsx88(
7202
+ const label = href ? /* @__PURE__ */ jsx89(
7084
7203
  "a",
7085
7204
  {
7086
7205
  href,
@@ -7092,42 +7211,42 @@ function ConversationHeading({ icon, name, onOpen, href, className }) {
7092
7211
  className: cn(NAME, "hover:bg-bg-hover"),
7093
7212
  children: name
7094
7213
  }
7095
- ) : onOpen ? /* @__PURE__ */ jsx88("button", { type: "button", onClick: onOpen, className: cn(NAME, "hover:bg-bg-hover"), children: name }) : /* @__PURE__ */ jsx88("span", { className: NAME, children: name });
7096
- return /* @__PURE__ */ jsxs66("div", { "data-conversation-heading": true, className: cn("flex w-full items-center gap-2", className), children: [
7097
- /* @__PURE__ */ jsx88("span", { "aria-hidden": true, className: "flex size-6 shrink-0 items-center justify-center text-text-secondary", children: icon }),
7214
+ ) : onOpen ? /* @__PURE__ */ jsx89("button", { type: "button", onClick: onOpen, className: cn(NAME, "hover:bg-bg-hover"), children: name }) : /* @__PURE__ */ jsx89("span", { className: NAME, children: name });
7215
+ return /* @__PURE__ */ jsxs67("div", { "data-conversation-heading": true, className: cn("flex w-full items-center gap-2", className), children: [
7216
+ /* @__PURE__ */ jsx89("span", { "aria-hidden": true, className: "flex size-6 shrink-0 items-center justify-center text-text-secondary", children: icon }),
7098
7217
  label
7099
7218
  ] });
7100
7219
  }
7101
7220
 
7102
7221
  // src/ConversationPlace.tsx
7103
- import { jsx as jsx89, jsxs as jsxs67 } from "react/jsx-runtime";
7222
+ import { jsx as jsx90, jsxs as jsxs68 } from "react/jsx-runtime";
7104
7223
  function ConversationPlace({ relation, place, children, className, ...props }) {
7105
- return /* @__PURE__ */ jsxs67("div", { className: cn("flex flex-col gap-1", className), ...props, children: [
7106
- /* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
7107
- /* @__PURE__ */ jsx89(Chip, { type: "neutral", label: relation }),
7108
- place && /* @__PURE__ */ jsx89("span", { className: "truncate text-caption text-text-muted", children: place })
7224
+ return /* @__PURE__ */ jsxs68("div", { className: cn("flex flex-col gap-1", className), ...props, children: [
7225
+ /* @__PURE__ */ jsxs68("div", { className: "flex items-center gap-2", children: [
7226
+ /* @__PURE__ */ jsx90(Chip, { type: "neutral", label: relation }),
7227
+ place && /* @__PURE__ */ jsx90("span", { className: "truncate text-caption text-text-muted", children: place })
7109
7228
  ] }),
7110
7229
  children
7111
7230
  ] });
7112
7231
  }
7113
7232
 
7114
7233
  // src/QuotedLine.tsx
7115
- import { jsx as jsx90, jsxs as jsxs68 } from "react/jsx-runtime";
7234
+ import { jsx as jsx91, jsxs as jsxs69 } from "react/jsx-runtime";
7116
7235
  var SINCE = { reworded: "Changed since", gone: "Deleted from the page" };
7117
7236
  function QuotedLine({ words, state = "here", label, href, external }) {
7118
7237
  const shown2 = words ?? label ?? "";
7119
7238
  const inThePage = !!words && state === "here";
7120
- const mark = /* @__PURE__ */ jsx90("mark", { className: cn("rounded-sm px-0.5 text-text-primary [box-decoration-break:clone]", inThePage ? "bg-warning-muted" : "bg-bg-inset text-text-secondary", state === "gone" && "line-through"), children: shown2 });
7121
- return /* @__PURE__ */ jsxs68("div", { "data-quoted": words ? state : "part", className: "flex w-full min-w-0 flex-col gap-0.5", children: [
7122
- /* @__PURE__ */ jsx90(WithTooltip, { label: shown2, wrapperClassName: "flex min-w-0", children: /* @__PURE__ */ jsx90("p", { className: "line-clamp-2 text-caption text-text-secondary", children: href ? /* @__PURE__ */ jsx90(Link, { href, variant: "quiet", external, children: mark }) : mark }) }),
7123
- state !== "here" && /* @__PURE__ */ jsx90("span", { className: "text-caption italic text-text-muted", children: SINCE[state] })
7239
+ const mark = /* @__PURE__ */ jsx91("mark", { className: cn("rounded-sm px-0.5 text-text-primary [box-decoration-break:clone]", inThePage ? "bg-warning-muted" : "bg-bg-inset text-text-secondary", state === "gone" && "line-through"), children: shown2 });
7240
+ return /* @__PURE__ */ jsxs69("div", { "data-quoted": words ? state : "part", className: "flex w-full min-w-0 flex-col gap-0.5", children: [
7241
+ /* @__PURE__ */ jsx91(WithTooltip, { label: shown2, wrapperClassName: "flex min-w-0", children: /* @__PURE__ */ jsx91("p", { className: "line-clamp-2 text-caption text-text-secondary", children: href ? /* @__PURE__ */ jsx91(Link, { href, variant: "quiet", external, children: mark }) : mark }) }),
7242
+ state !== "here" && /* @__PURE__ */ jsx91("span", { className: "text-caption italic text-text-muted", children: SINCE[state] })
7124
7243
  ] });
7125
7244
  }
7126
7245
 
7127
7246
  // src/ReactionHorizon.tsx
7128
- import { Fragment as Fragment26, jsx as jsx91, jsxs as jsxs69 } from "react/jsx-runtime";
7247
+ import { Fragment as Fragment26, jsx as jsx92, jsxs as jsxs70 } from "react/jsx-runtime";
7129
7248
  function Said({ limit, omitted, noun }) {
7130
- return /* @__PURE__ */ jsxs69(Fragment26, { children: [
7249
+ return /* @__PURE__ */ jsxs70(Fragment26, { children: [
7131
7250
  "Reactions are shown for the latest ",
7132
7251
  limit,
7133
7252
  " ",
@@ -7140,11 +7259,11 @@ function Said({ limit, omitted, noun }) {
7140
7259
  ] });
7141
7260
  }
7142
7261
  function ReactionHorizon({ limit, omitted, cut = false, noun = "comments", keepRoom = false }) {
7143
- const room = keepRoom && omitted <= 0 && /* @__PURE__ */ jsx91("p", { "aria-hidden": true, className: "invisible text-caption text-text-muted", children: /* @__PURE__ */ jsx91(Said, { limit, omitted: 1, noun }) });
7262
+ const room = keepRoom && omitted <= 0 && /* @__PURE__ */ jsx92("p", { "aria-hidden": true, className: "invisible text-caption text-text-muted", children: /* @__PURE__ */ jsx92(Said, { limit, omitted: 1, noun }) });
7144
7263
  if (omitted <= 0 && !cut) return room || null;
7145
- return /* @__PURE__ */ jsxs69(Fragment26, { children: [
7146
- /* @__PURE__ */ jsxs69("p", { className: "text-caption text-text-muted", children: [
7147
- omitted > 0 && /* @__PURE__ */ jsx91(Said, { limit, omitted, noun }),
7264
+ return /* @__PURE__ */ jsxs70(Fragment26, { children: [
7265
+ /* @__PURE__ */ jsxs70("p", { className: "text-caption text-text-muted", children: [
7266
+ omitted > 0 && /* @__PURE__ */ jsx92(Said, { limit, omitted, noun }),
7148
7267
  omitted > 0 && cut && " ",
7149
7268
  cut && "Some reactions may be missing."
7150
7269
  ] }),
@@ -7154,18 +7273,18 @@ function ReactionHorizon({ limit, omitted, cut = false, noun = "comments", keepR
7154
7273
 
7155
7274
  // src/ArchiveDialog.tsx
7156
7275
  import { useState as useState29 } from "react";
7157
- import { jsx as jsx92, jsxs as jsxs70 } from "react/jsx-runtime";
7276
+ import { jsx as jsx93, jsxs as jsxs71 } from "react/jsx-runtime";
7158
7277
  var listOf = (parts) => parts.length <= 1 ? parts[0] ?? "" : `${parts.slice(0, -1).join(", ")} and ${parts.at(-1)}`;
7159
7278
  function ArchiveDialog({ title, what, hides, staysVisible = [], apps, getBack, onClose, onArchive }) {
7160
7279
  const [resolution, setResolution] = useState29("");
7161
7280
  const where = apps.length ? `, ${listOf(apps.map((app) => `in ${app}`))}` : "";
7162
- return /* @__PURE__ */ jsxs70(FormDialog, { title: `Archive \u201C${title}\u201D?`, submitLabel: `Archive ${what}`, ready: hides !== null, onSubmit: () => onArchive(resolution.trim()), onClose, children: [
7163
- /* @__PURE__ */ jsxs70("div", { className: "flex flex-col gap-2 text-body-2 text-text-primary", children: [
7164
- /* @__PURE__ */ jsx92("p", { children: hides === null ? `Counting what archiving this ${what} would hide\u2026` : hides.length ? `This hides the ${what} and ${listOf(hides)} from every list${where}.` : `This hides the ${what} from every list${where}.` }),
7165
- staysVisible.length > 0 && /* @__PURE__ */ jsx92("p", { children: `${listOf(staysVisible)} stay visible there.` }),
7166
- /* @__PURE__ */ jsx92("p", { className: "text-text-secondary", children: getBack })
7281
+ return /* @__PURE__ */ jsxs71(FormDialog, { title: `Archive \u201C${title}\u201D?`, submitLabel: `Archive ${what}`, ready: hides !== null, onSubmit: () => onArchive(resolution.trim()), onClose, children: [
7282
+ /* @__PURE__ */ jsxs71("div", { className: "flex flex-col gap-2 text-body-2 text-text-primary", children: [
7283
+ /* @__PURE__ */ jsx93("p", { children: hides === null ? `Counting what archiving this ${what} would hide\u2026` : hides.length ? `This hides the ${what} and ${listOf(hides)} from every list${where}.` : `This hides the ${what} from every list${where}.` }),
7284
+ staysVisible.length > 0 && /* @__PURE__ */ jsx93("p", { children: `${listOf(staysVisible)} stay visible there.` }),
7285
+ /* @__PURE__ */ jsx93("p", { className: "text-text-secondary", children: getBack })
7167
7286
  ] }),
7168
- /* @__PURE__ */ jsx92(Field, { label: "Resolution (optional)", children: /* @__PURE__ */ jsx92(
7287
+ /* @__PURE__ */ jsx93(Field, { label: "Resolution (optional)", children: /* @__PURE__ */ jsx93(
7169
7288
  Textarea,
7170
7289
  {
7171
7290
  value: resolution,
@@ -7180,19 +7299,19 @@ function ArchiveDialog({ title, what, hides, staysVisible = [], apps, getBack, o
7180
7299
  // src/ArchivedNotice.tsx
7181
7300
  import { useState as useState30 } from "react";
7182
7301
  import { IconArchive } from "@tabler/icons-react";
7183
- import { jsx as jsx93, jsxs as jsxs71 } from "react/jsx-runtime";
7302
+ import { jsx as jsx94, jsxs as jsxs72 } from "react/jsx-runtime";
7184
7303
  function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive, onOpenParent }) {
7185
7304
  const [unarchiving, setUnarchiving] = useState30(false);
7186
7305
  const parent = withWhat ?? (withTitle ? "parent" : void 0);
7187
7306
  const named2 = withTitle ? ` \u201C${withTitle}\u201D` : "";
7188
7307
  const line = parent ? `Archived with its ${parent}${named2} by ${by} \xB7 ${when}` : `Archived by ${by} \xB7 ${when}`;
7189
- return /* @__PURE__ */ jsxs71(Card, { fill: "inset", className: "flex items-start gap-3 px-4 py-3", children: [
7190
- /* @__PURE__ */ jsx93(IconArchive, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted" }),
7191
- /* @__PURE__ */ jsxs71("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
7192
- /* @__PURE__ */ jsx93("span", { className: "text-body-2-strong text-text-primary", children: line }),
7193
- resolution && /* @__PURE__ */ jsx93("p", { className: "whitespace-pre-wrap text-caption text-text-secondary", children: resolution })
7308
+ return /* @__PURE__ */ jsxs72(Card, { fill: "inset", className: "flex items-start gap-3 px-4 py-3", children: [
7309
+ /* @__PURE__ */ jsx94(IconArchive, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted" }),
7310
+ /* @__PURE__ */ jsxs72("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
7311
+ /* @__PURE__ */ jsx94("span", { className: "text-body-2-strong text-text-primary", children: line }),
7312
+ resolution && /* @__PURE__ */ jsx94("p", { className: "whitespace-pre-wrap text-caption text-text-secondary", children: resolution })
7194
7313
  ] }),
7195
- parent ? onOpenParent && /* @__PURE__ */ jsx93(Button, { variant: "outlined", size: "small", className: "shrink-0", onClick: onOpenParent, children: `Open ${parent}` }) : onUnarchive && /* @__PURE__ */ jsx93(
7314
+ parent ? onOpenParent && /* @__PURE__ */ jsx94(Button, { variant: "outlined", size: "small", className: "shrink-0", onClick: onOpenParent, children: `Open ${parent}` }) : onUnarchive && /* @__PURE__ */ jsx94(
7196
7315
  Button,
7197
7316
  {
7198
7317
  variant: "outlined",
@@ -7212,13 +7331,13 @@ function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive
7212
7331
  // src/DeletedNotice.tsx
7213
7332
  import { useState as useState31 } from "react";
7214
7333
  import { IconTrash } from "@tabler/icons-react";
7215
- import { jsx as jsx94, jsxs as jsxs72 } from "react/jsx-runtime";
7334
+ import { jsx as jsx95, jsxs as jsxs73 } from "react/jsx-runtime";
7216
7335
  function DeletedNotice({ by, when, onRestore }) {
7217
7336
  const [restoring, setRestoring] = useState31(false);
7218
- return /* @__PURE__ */ jsxs72(Card, { fill: "inset", className: "flex items-start gap-3 px-4 py-3", children: [
7219
- /* @__PURE__ */ jsx94(IconTrash, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted" }),
7220
- /* @__PURE__ */ jsx94("span", { className: "min-w-0 flex-1 text-body-2-strong text-text-primary", children: `Deleted by ${by} \xB7 ${when}` }),
7221
- onRestore && /* @__PURE__ */ jsx94(
7337
+ return /* @__PURE__ */ jsxs73(Card, { fill: "inset", className: "flex items-start gap-3 px-4 py-3", children: [
7338
+ /* @__PURE__ */ jsx95(IconTrash, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted" }),
7339
+ /* @__PURE__ */ jsx95("span", { className: "min-w-0 flex-1 text-body-2-strong text-text-primary", children: `Deleted by ${by} \xB7 ${when}` }),
7340
+ onRestore && /* @__PURE__ */ jsx95(
7222
7341
  Button,
7223
7342
  {
7224
7343
  variant: "outlined",
@@ -7237,21 +7356,21 @@ function DeletedNotice({ by, when, onRestore }) {
7237
7356
 
7238
7357
  // src/NoAccessNotice.tsx
7239
7358
  import { IconLock } from "@tabler/icons-react";
7240
- import { jsx as jsx95 } from "react/jsx-runtime";
7359
+ import { jsx as jsx96 } from "react/jsx-runtime";
7241
7360
  function NoAccessNotice({ what }) {
7242
- return /* @__PURE__ */ jsx95(EmptyState, { scope: "page", icon: /* @__PURE__ */ jsx95(IconLock, { size: 16, stroke: 1.5 }), message: `You can't open this ${what}` });
7361
+ return /* @__PURE__ */ jsx96(EmptyState, { scope: "page", icon: /* @__PURE__ */ jsx96(IconLock, { size: 16, stroke: 1.5 }), message: `You can't open this ${what}` });
7243
7362
  }
7244
7363
 
7245
7364
  // src/Thread.tsx
7246
- import { Children, useCallback as useCallback7, useContext as useContext15, useLayoutEffect as useLayoutEffect9, useRef as useRef22, useState as useState32 } from "react";
7365
+ import { Children, useCallback as useCallback7, useContext as useContext15, useLayoutEffect as useLayoutEffect9, useRef as useRef23, useState as useState32 } from "react";
7247
7366
  import { IconX as IconX6 } from "@tabler/icons-react";
7248
- import { Fragment as Fragment27, jsx as jsx96, jsxs as jsxs73 } from "react/jsx-runtime";
7367
+ import { Fragment as Fragment27, jsx as jsx97, jsxs as jsxs74 } from "react/jsx-runtime";
7249
7368
  var always = () => true;
7250
7369
  var anyIn = (children) => Children.toArray(children).length > 0;
7251
7370
  function Replies({ children, loading, empty }) {
7252
- if (loading) return /* @__PURE__ */ jsx96(SkeletonConversation, {});
7253
- if (!anyIn(children)) return typeof empty === "string" ? /* @__PURE__ */ jsx96(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx96(Fragment27, { children: empty });
7254
- return /* @__PURE__ */ jsx96(Fragment27, { children });
7371
+ if (loading) return /* @__PURE__ */ jsx97(SkeletonConversation, {});
7372
+ if (!anyIn(children)) return typeof empty === "string" ? /* @__PURE__ */ jsx97(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx97(Fragment27, { children: empty });
7373
+ return /* @__PURE__ */ jsx97(Fragment27, { children });
7255
7374
  }
7256
7375
  function Thread({
7257
7376
  place = "beside",
@@ -7270,7 +7389,7 @@ function Thread({
7270
7389
  seen,
7271
7390
  className
7272
7391
  }) {
7273
- const body = useRef22(null);
7392
+ const body = useRef23(null);
7274
7393
  const setBody = useCallback7(
7275
7394
  (el) => {
7276
7395
  body.current = el;
@@ -7279,10 +7398,10 @@ function Thread({
7279
7398
  },
7280
7399
  [bodyRef]
7281
7400
  );
7282
- const under = useRef22(null);
7401
+ const under = useRef23(null);
7283
7402
  useWatchSeen(seen, place === "under" ? under : body, "data-reply-id");
7284
7403
  const [drawn] = useState32(() => ({ added: 0 }));
7285
- const last = useRef22(null);
7404
+ const last = useRef23(null);
7286
7405
  const steady = useSteadyScroll(body, void 0, always, start?.id, place === "beside");
7287
7406
  useLayoutEffect9(() => {
7288
7407
  const el = body.current;
@@ -7296,91 +7415,47 @@ function Thread({
7296
7415
  const foot = notice ?? box;
7297
7416
  const layoutLine = useContext15(LineByLayout);
7298
7417
  if (place === "under") {
7299
- return /* @__PURE__ */ jsxs73("div", { ref: under, "data-thread": "under", className: cn("flex flex-col", className), children: [
7418
+ return /* @__PURE__ */ jsxs74("div", { ref: under, "data-thread": "under", className: cn("flex flex-col", className), children: [
7300
7419
  (loading || anyIn(children)) && // The replies hang from a line under the comment's face (20px in: its 8px and half its 24px), one step in (Ship's way).
7301
7420
  // 8px from the one card's right edge too, as the box under them: a hovered reply never touches it (Katerina, 31 October).
7302
7421
  // 2px, as the line from the comment's face that runs into it (Katerina, 1 November), and drawn the same way, a
7303
7422
  // filled bar rather than a border: a border snaps to the screen's pixels on its own, and at some zooms the two
7304
7423
  // stood a pixel apart (Katerina: "the line breaks in the middle").
7305
- /* @__PURE__ */ jsxs73("div", { "data-thread-replies": true, className: "relative ml-[19px] mr-2 flex flex-col gap-1 pl-2.5", children: [
7306
- !layoutLine && /* @__PURE__ */ jsx96("span", { "aria-hidden": true, className: "absolute bottom-0 left-0 top-0 w-0.5 bg-border-default" }),
7307
- /* @__PURE__ */ jsx96(caretOnOpen.Provider, { value: 0, children: loading ? /* @__PURE__ */ jsx96(SkeletonConversation, {}) : children })
7424
+ /* @__PURE__ */ jsxs74("div", { "data-thread-replies": true, className: "relative ml-[19px] mr-2 flex flex-col gap-1 pl-2.5", children: [
7425
+ !layoutLine && /* @__PURE__ */ jsx97("span", { "aria-hidden": true, className: "absolute bottom-0 left-0 top-0 w-0.5 bg-border-default" }),
7426
+ /* @__PURE__ */ jsx97(caretOnOpen.Provider, { value: 0, children: loading ? /* @__PURE__ */ jsx97(SkeletonConversation, {}) : children })
7308
7427
  ] }),
7309
- foot && /* @__PURE__ */ jsx96("div", { className: "px-2 pt-2", children: foot })
7428
+ foot && /* @__PURE__ */ jsx97("div", { className: "px-2 pt-2", children: foot })
7310
7429
  ] });
7311
7430
  }
7312
- return /* @__PURE__ */ jsxs73(
7431
+ return /* @__PURE__ */ jsxs74(
7313
7432
  Panel,
7314
7433
  {
7315
7434
  className,
7316
7435
  bodyRef: setBody,
7317
7436
  bodyClassName: "flex flex-col",
7318
7437
  title,
7319
- actions: /* @__PURE__ */ jsxs73(Fragment27, { children: [
7320
- resolved && /* @__PURE__ */ jsx96(Chip, { type: "success", label: "Resolved" }),
7438
+ actions: /* @__PURE__ */ jsxs74(Fragment27, { children: [
7439
+ resolved && /* @__PURE__ */ jsx97(Chip, { type: "success", label: "Resolved" }),
7321
7440
  actions,
7322
- onClose && /* @__PURE__ */ jsx96(IconButton, { tooltip: "Close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx96(IconX6, { size: 16, stroke: 1.5 }) })
7441
+ onClose && /* @__PURE__ */ jsx97(IconButton, { tooltip: "Close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx97(IconX6, { size: 16, stroke: 1.5 }) })
7323
7442
  ] }),
7324
- footer: foot && /* @__PURE__ */ jsx96("div", { className: "p-3", children: foot }),
7443
+ footer: foot && /* @__PURE__ */ jsx97("div", { className: "p-3", children: foot }),
7325
7444
  children: [
7326
- start && /* @__PURE__ */ jsx96("div", { className: cn("px-4 pb-2 pt-4", SHOWN_CLASSES), "data-thread-start": start.id, children: /* @__PURE__ */ jsx96(PinnedComment, { author: start.author, time: start.time, at: start.at, words: start.words, deleted: start.deleted, unseen: start.unseen }) }),
7327
- /* @__PURE__ */ jsx96(Divider, { look: "section", label: "Replies", className: "px-4 py-2" }),
7328
- /* @__PURE__ */ jsx96("div", { className: "flex flex-col gap-2 px-4 pb-4", children: /* @__PURE__ */ jsx96(caretOnOpen.Provider, { value: 0, children: /* @__PURE__ */ jsx96(repliesDrawn.Provider, { value: drawn, children: /* @__PURE__ */ jsx96(Replies, { loading, empty, children }) }) }) })
7445
+ start && /* @__PURE__ */ jsx97("div", { className: cn("px-4 pb-2 pt-4", SHOWN_CLASSES), "data-thread-start": start.id, children: /* @__PURE__ */ jsx97(PinnedComment, { author: start.author, time: start.time, at: start.at, words: start.words, deleted: start.deleted, unseen: start.unseen }) }),
7446
+ /* @__PURE__ */ jsx97(Divider, { look: "section", label: "Replies", className: "px-4 py-2" }),
7447
+ /* @__PURE__ */ jsx97("div", { className: "flex flex-col gap-2 px-4 pb-4", children: /* @__PURE__ */ jsx97(caretOnOpen.Provider, { value: 0, children: /* @__PURE__ */ jsx97(repliesDrawn.Provider, { value: drawn, children: /* @__PURE__ */ jsx97(Replies, { loading, empty, children }) }) }) })
7329
7448
  ]
7330
7449
  }
7331
7450
  );
7332
7451
  }
7333
7452
 
7334
- // src/showInConversation.ts
7335
- var SHOWN_MS = 1800;
7336
- var WAIT_MS = 3e3;
7337
- var POLL_MS = 50;
7338
- var owed = /* @__PURE__ */ new WeakMap();
7339
- var asked = 0;
7340
- function find(id, { comments = false }) {
7341
- const quoted = CSS.escape(id);
7342
- return document.querySelector(`[data-reply-id="${quoted}"], [data-thread-start="${quoted}"]`) ?? (comments ? document.querySelector(`[data-conversation-item="${quoted}"]`) : null);
7343
- }
7344
- function showInConversation(id, options = {}) {
7345
- asked += 1;
7346
- return show(id, options);
7347
- }
7348
- function show(id, options) {
7349
- const el = find(id, options);
7350
- if (!el) return false;
7351
- el.scrollIntoView({ behavior: "smooth", block: "center" });
7352
- const previous = owed.get(el);
7353
- if (previous !== void 0) window.clearTimeout(previous);
7354
- el.dataset.shown = "true";
7355
- owed.set(
7356
- el,
7357
- window.setTimeout(() => {
7358
- delete el.dataset.shown;
7359
- owed.delete(el);
7360
- }, SHOWN_MS)
7361
- );
7362
- return true;
7363
- }
7364
- function showInConversationWhenDrawn(id, { wait = WAIT_MS, ...options } = {}) {
7365
- const mine = ++asked;
7366
- return new Promise((resolve) => {
7367
- const deadline = Date.now() + wait;
7368
- const attempt = () => {
7369
- if (mine !== asked) return resolve(false);
7370
- if (show(id, options)) return resolve(true);
7371
- if (Date.now() >= deadline) return resolve(false);
7372
- window.setTimeout(attempt, POLL_MS);
7373
- };
7374
- attempt();
7375
- });
7376
- }
7377
-
7378
7453
  // src/SearchInput.tsx
7379
7454
  import "react";
7380
7455
  import { Input as Input3 } from "@base-ui/react/input";
7381
- import { jsx as jsx97, jsxs as jsxs74 } from "react/jsx-runtime";
7456
+ import { jsx as jsx98, jsxs as jsxs75 } from "react/jsx-runtime";
7382
7457
  function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...props }) {
7383
- return /* @__PURE__ */ jsxs74(
7458
+ return /* @__PURE__ */ jsxs75(
7384
7459
  "div",
7385
7460
  {
7386
7461
  className: cn(
@@ -7392,7 +7467,7 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
7392
7467
  className
7393
7468
  ),
7394
7469
  children: [
7395
- /* @__PURE__ */ jsx97(
7470
+ /* @__PURE__ */ jsx98(
7396
7471
  Input3,
7397
7472
  {
7398
7473
  className: cn("flex-1 min-w-0 text-input-value", BARE_INPUT_CLASSES),
@@ -7400,7 +7475,7 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
7400
7475
  ...props
7401
7476
  }
7402
7477
  ),
7403
- shortcut && /* @__PURE__ */ jsx97(Kbd, { children: shortcut })
7478
+ shortcut && /* @__PURE__ */ jsx98(Kbd, { children: shortcut })
7404
7479
  ]
7405
7480
  }
7406
7481
  );
@@ -7409,37 +7484,42 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
7409
7484
  // src/PageHeader.tsx
7410
7485
  import { Fragment as Fragment28 } from "react";
7411
7486
  import { IconLock as IconLock2 } from "@tabler/icons-react";
7412
- import { Fragment as Fragment29, jsx as jsx98, jsxs as jsxs75 } from "react/jsx-runtime";
7413
- function PageHeader({ title, leading, private: locked = false, after, meta, time, members, actions, className }) {
7487
+ import { Fragment as Fragment29, jsx as jsx99, jsxs as jsxs76 } from "react/jsx-runtime";
7488
+ function PageHeader({ title, leading, private: locked = false, after, meta, time, members, button, actions, className }) {
7414
7489
  const words = (meta ?? []).map((one) => typeof one === "string" ? { label: one } : one);
7415
7490
  const quiet = words.length > 0 || time != null || members != null;
7416
- const name = /* @__PURE__ */ jsxs75("div", { className: "flex min-w-0 items-center gap-2", children: [
7417
- leading != null && /* @__PURE__ */ jsx98("span", { className: "flex shrink-0 items-center text-text-secondary", children: leading }),
7418
- locked && /* @__PURE__ */ jsx98(WithTooltip, { label: "Private", children: /* @__PURE__ */ jsx98(IconLock2, { size: 16, stroke: 1.5, role: "img", "aria-label": "Private", className: "shrink-0 text-text-secondary" }) }),
7419
- typeof title === "string" ? /* @__PURE__ */ jsx98("span", { className: "truncate text-body-2-strong text-text-primary", children: title }) : /* @__PURE__ */ jsx98("div", { className: "flex min-w-0 items-center", children: title }),
7420
- after != null && /* @__PURE__ */ jsx98("span", { className: "flex shrink-0 items-center", children: after })
7491
+ const name = /* @__PURE__ */ jsxs76("div", { className: "flex min-w-0 items-center gap-2", children: [
7492
+ leading != null && /* @__PURE__ */ jsx99("span", { className: "flex shrink-0 items-center text-text-secondary", children: leading }),
7493
+ locked && /* @__PURE__ */ jsx99(WithTooltip, { label: "Private", children: /* @__PURE__ */ jsx99(IconLock2, { size: 16, stroke: 1.5, role: "img", "aria-label": "Private", className: "shrink-0 text-text-secondary" }) }),
7494
+ typeof title === "string" ? /* @__PURE__ */ jsx99("span", { className: "truncate text-body-2-strong text-text-primary", children: title }) : /* @__PURE__ */ jsx99("div", { className: "flex min-w-0 items-center", children: title }),
7495
+ after != null && /* @__PURE__ */ jsx99("span", { className: "flex shrink-0 items-center gap-2", children: after })
7421
7496
  ] });
7422
- const right = quiet || actions != null ? /* @__PURE__ */ jsxs75(Fragment29, { children: [
7497
+ const buttons = actions != null || button != null;
7498
+ const right = quiet || buttons ? /* @__PURE__ */ jsxs76(Fragment29, { children: [
7423
7499
  quiet && // The quiet group: 12px between its parts, and 12px clear of the buttons — the bar sets
7424
7500
  // its actions 4px apart, so the group adds the other 8px, as Peek's and Leaf's bars do.
7425
- /* @__PURE__ */ jsxs75("div", { className: cn("flex items-center gap-3", actions != null && "pr-2"), children: [
7426
- words.length > 0 && /* @__PURE__ */ jsx98("div", { className: "flex items-center gap-2", children: words.map((one, i) => /* @__PURE__ */ jsxs75(Fragment28, { children: [
7501
+ /* @__PURE__ */ jsxs76("div", { className: cn("flex items-center gap-3", buttons && "pr-2"), children: [
7502
+ words.length > 0 && /* @__PURE__ */ jsx99("div", { className: "flex items-center gap-2", children: words.map((one, i) => /* @__PURE__ */ jsxs76(Fragment28, { children: [
7427
7503
  i > 0 && // eslint-disable-next-line token-spacing/no-restricted-classes -- @estiva-escape: Peek's dot between its counts, 3px measured on 31 October; the scale steps from 2px to 4px
7428
- /* @__PURE__ */ jsx98("span", { "aria-hidden": "true", className: "size-[3px] shrink-0 rounded-full bg-text-muted" }),
7429
- /* @__PURE__ */ jsx98(MetaText, { tone: one.done ? "success" : "secondary", children: one.label })
7504
+ /* @__PURE__ */ jsx99("span", { "aria-hidden": "true", className: "size-[3px] shrink-0 rounded-full bg-text-muted" }),
7505
+ /* @__PURE__ */ jsx99(MetaText, { tone: one.done ? "success" : "secondary", children: one.label })
7430
7506
  ] }, `${one.label}-${i}`)) }),
7431
- time && /* @__PURE__ */ jsx98(WithTooltip, { label: time.exact, children: /* @__PURE__ */ jsx98("span", { className: "whitespace-nowrap text-caption italic text-text-muted", children: time.label }) }),
7507
+ time && /* @__PURE__ */ jsx99(WithTooltip, { label: time.exact, children: /* @__PURE__ */ jsx99("span", { className: "whitespace-nowrap text-caption italic text-text-muted", children: time.label }) }),
7432
7508
  members
7433
7509
  ] }),
7510
+ button != null && /* @__PURE__ */ jsx99("span", { className: cn("flex shrink-0 items-center gap-2", actions != null && "pr-1"), children: button }),
7434
7511
  actions
7435
7512
  ] }) : void 0;
7436
- return /* @__PURE__ */ jsx98(ContainerHeader, { title: name, actions: right, className });
7513
+ return /* @__PURE__ */ jsx99(ContainerHeader, { title: name, actions: right, className });
7437
7514
  }
7438
7515
 
7439
7516
  // src/ListColumn.tsx
7440
- import { jsx as jsx99, jsxs as jsxs76 } from "react/jsx-runtime";
7517
+ import { useRef as useRef24 } from "react";
7518
+ import { jsx as jsx100, jsxs as jsxs77 } from "react/jsx-runtime";
7441
7519
  function Column({ title, chevron = false, titleMenu, actions, above, collapsed = false, children, className, broken = false }) {
7442
- return /* @__PURE__ */ jsxs76(
7520
+ const rows = useRef24(null);
7521
+ useRevealCurrentRow(rows);
7522
+ return /* @__PURE__ */ jsxs77(
7443
7523
  "div",
7444
7524
  {
7445
7525
  className: cn(
@@ -7452,35 +7532,105 @@ function Column({ title, chevron = false, titleMenu, actions, above, collapsed =
7452
7532
  "data-collapsed": collapsed || void 0,
7453
7533
  inert: collapsed,
7454
7534
  children: [
7455
- /* @__PURE__ */ jsx99(ContainerHeader, { title, chevron, titleMenu, actions }),
7535
+ /* @__PURE__ */ jsx100(ContainerHeader, { title, chevron, titleMenu, actions }),
7456
7536
  above,
7457
7537
  broken ? (
7458
7538
  // The message takes the room the list had and centres itself in it (Katerina, 19 September).
7459
- /* @__PURE__ */ jsx99("div", { className: "flex min-h-0 flex-1 flex-col px-3", children })
7460
- ) : /* @__PURE__ */ jsx99(ScrollArea, { className: "flex-1", contentClassName: "flex flex-col gap-0.5 px-3 pt-4 pb-3", children })
7539
+ /* @__PURE__ */ jsx100("div", { className: "flex min-h-0 flex-1 flex-col px-3", children })
7540
+ ) : /* @__PURE__ */ jsx100(ScrollArea, { className: "flex-1", viewportRef: rows, contentClassName: "flex flex-col gap-0.5 px-3 pt-4 pb-3", children })
7461
7541
  ]
7462
7542
  }
7463
7543
  );
7464
7544
  }
7465
7545
  function ListColumn(props) {
7466
- return /* @__PURE__ */ jsx99(
7546
+ return /* @__PURE__ */ jsx100(
7467
7547
  ErrorBoundary,
7468
7548
  {
7469
7549
  label: "list panel",
7470
7550
  frame: (message) => (
7471
7551
  // Only the name comes back with the message: the actions and the row above may be what threw.
7472
- /* @__PURE__ */ jsx99(Column, { title: props.title, chevron: props.chevron, collapsed: props.collapsed, className: props.className, broken: true, children: message })
7552
+ /* @__PURE__ */ jsx100(Column, { title: props.title, chevron: props.chevron, collapsed: props.collapsed, className: props.className, broken: true, children: message })
7473
7553
  ),
7474
- children: /* @__PURE__ */ jsx99(Column, { ...props })
7554
+ children: /* @__PURE__ */ jsx100(Column, { ...props })
7475
7555
  }
7476
7556
  );
7477
7557
  }
7478
7558
 
7559
+ // src/ListTable.tsx
7560
+ import { createContext as createContext13, useCallback as useCallback8, useContext as useContext16, useLayoutEffect as useLayoutEffect10, useRef as useRef25, useState as useState33 } from "react";
7561
+ import { jsx as jsx101, jsxs as jsxs78 } from "react/jsx-runtime";
7562
+ var WIDTH_PX = { small: 80, medium: 96, large: 112 };
7563
+ var WIDTH_CLASSES = { small: "w-20", medium: "w-24", large: "w-28" };
7564
+ var NAME_LEAST_PX = 200;
7565
+ var DEFAULT_WIDTH = "medium";
7566
+ var sizeOf = (column) => column.width ?? DEFAULT_WIDTH;
7567
+ var ROW_FRAME_PX = 24 + 16 + 12;
7568
+ var GAP_PX = 12;
7569
+ var END_PX = 64;
7570
+ var ListTableContext = createContext13(null);
7571
+ var showsColumn = (column, shown2) => shown2 === "all" || shown2 === "high" && (column.keep ?? "high") === "high";
7572
+ var widthOf = (columns, end) => ROW_FRAME_PX + NAME_LEAST_PX + columns.reduce((sum, column) => sum + GAP_PX + WIDTH_PX[sizeOf(column)], 0) + (end ? GAP_PX + END_PX : 0);
7573
+ function ListTable({ "aria-label": label, nameLabel = "Name", columns, end = false, headings = true, children, className }) {
7574
+ const box = useRef25(null);
7575
+ const [shown2, setShown] = useState33("all");
7576
+ const measure = useCallback8(() => {
7577
+ const width = box.current?.getBoundingClientRect().width ?? 0;
7578
+ if (width === 0) return;
7579
+ const high = columns.filter((column) => (column.keep ?? "high") === "high");
7580
+ setShown(width >= widthOf(columns, end) ? "all" : width >= widthOf(high, end) ? "high" : "none");
7581
+ }, [columns, end]);
7582
+ useLayoutEffect10(() => {
7583
+ measure();
7584
+ const list = box.current;
7585
+ if (!list || typeof ResizeObserver === "undefined") return;
7586
+ const observer = new ResizeObserver(measure);
7587
+ observer.observe(list);
7588
+ return () => observer.disconnect();
7589
+ }, [measure]);
7590
+ return /* @__PURE__ */ jsx101(ListTableContext.Provider, { value: { columns, shown: shown2, end }, children: /* @__PURE__ */ jsxs78("div", { ref: box, role: "table", "aria-label": label, className: cn("flex w-full flex-col gap-2", className), children: [
7591
+ columns.length > 0 && // Hidden, it is out of the flow too: the rows start where the list does, with no gap for it.
7592
+ /* @__PURE__ */ jsxs78("div", { role: "row", className: cn("flex items-center gap-3 px-3 text-caption text-text-muted", !headings && "sr-only"), children: [
7593
+ /* @__PURE__ */ jsx101("span", { role: "columnheader", className: "min-w-0 max-w-sm flex-1 pl-7", children: nameLabel }),
7594
+ columns.map(
7595
+ (column) => showsColumn(column, shown2) ? /* @__PURE__ */ jsx101("span", { role: "columnheader", className: cn("shrink-0 truncate", WIDTH_CLASSES[sizeOf(column)]), children: column.label }, column.label) : null
7596
+ ),
7597
+ end && /* @__PURE__ */ jsx101("span", { role: "columnheader", "aria-label": "Actions", className: "ml-auto w-16 shrink-0" })
7598
+ ] }),
7599
+ /* @__PURE__ */ jsx101("div", { role: "rowgroup", className: "flex flex-col gap-0.5", children })
7600
+ ] }) });
7601
+ }
7602
+ function ListTableRow({ href, label, description, icon, cells, end, onClick, ...rest }) {
7603
+ const table = useContext16(ListTableContext);
7604
+ if (!table) throw new Error("ListTableRow is a row of a ListTable: put it inside one.");
7605
+ return (
7606
+ // A row's look in every list: 8px corners, the fill under the pointer and no edge.
7607
+ /* @__PURE__ */ jsxs78("div", { role: "row", className: "relative flex min-w-0 items-center gap-3 rounded-lg px-3 py-2 hover:bg-bg-hover", ...rest, children: [
7608
+ /* @__PURE__ */ jsxs78("span", { role: "cell", className: "flex min-w-0 max-w-sm flex-1 items-center gap-3", children: [
7609
+ icon != null && /* @__PURE__ */ jsx101("span", { className: "flex shrink-0 items-center text-text-secondary", children: icon }),
7610
+ /* @__PURE__ */ jsxs78(Link, { href, variant: "plain", cover: true, className: "flex min-w-0 flex-1 flex-col gap-0.5", ...onClick ? { onClick } : {}, children: [
7611
+ /* @__PURE__ */ jsx101("span", { className: "truncate text-body-2 font-medium text-text-primary", children: label }),
7612
+ description && /* @__PURE__ */ jsx101("span", { className: "truncate text-caption text-text-secondary", children: description })
7613
+ ] })
7614
+ ] }),
7615
+ table.columns.map(
7616
+ (column, i) => showsColumn(column, table.shown) ? (
7617
+ // A cell's parts sit 6px apart: faces and their number.
7618
+ /* @__PURE__ */ jsx101("span", { role: "cell", className: cn("flex shrink-0 items-center gap-1.5 truncate text-caption text-text-secondary", WIDTH_CLASSES[sizeOf(column)]), children: cells[i] ?? "\u2013" }, column.label)
7619
+ ) : null
7620
+ ),
7621
+ table.end && // After the covering link and `relative`, so what is here stays its own control.
7622
+ // The room the name leaves goes before it: the end keeps the list's right edge. A button's height (24px) in every
7623
+ // row, so a row with nothing at its end is as tall as one with its ⋮ (40px; it was 36, Katerina, 16 November).
7624
+ /* @__PURE__ */ jsx101("span", { role: "cell", className: "relative ml-auto flex h-6 w-16 shrink-0 items-center justify-end gap-1", children: end })
7625
+ ] })
7626
+ );
7627
+ }
7628
+
7479
7629
  // src/Tabs.tsx
7480
7630
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
7481
- import { Fragment as Fragment30, jsx as jsx100, jsxs as jsxs77 } from "react/jsx-runtime";
7631
+ import { Fragment as Fragment30, jsx as jsx102, jsxs as jsxs79 } from "react/jsx-runtime";
7482
7632
  function Tabs({ tabs, active, onChange, size = "default", className, ...aria }) {
7483
- return /* @__PURE__ */ jsx100(
7633
+ return /* @__PURE__ */ jsx102(
7484
7634
  BaseTabs.Root,
7485
7635
  {
7486
7636
  value: active,
@@ -7488,14 +7638,14 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
7488
7638
  if (details.reason === "none") onChange(value);
7489
7639
  },
7490
7640
  className,
7491
- children: /* @__PURE__ */ jsx100(
7641
+ children: /* @__PURE__ */ jsx102(
7492
7642
  BaseTabs.List,
7493
7643
  {
7494
7644
  activateOnFocus: true,
7495
7645
  "aria-label": aria["aria-label"],
7496
7646
  "aria-labelledby": aria["aria-labelledby"],
7497
7647
  className: "flex items-center gap-2",
7498
- children: tabs.map((tab) => /* @__PURE__ */ jsxs77(
7648
+ children: tabs.map((tab) => /* @__PURE__ */ jsxs79(
7499
7649
  BaseTabs.Tab,
7500
7650
  {
7501
7651
  value: tab.id,
@@ -7508,13 +7658,13 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
7508
7658
  ),
7509
7659
  children: [
7510
7660
  tab.icon,
7511
- /* @__PURE__ */ jsxs77("span", { className: "flex items-baseline", children: [
7661
+ /* @__PURE__ */ jsxs79("span", { className: "flex items-baseline", children: [
7512
7662
  tab.label,
7513
- tab.count !== void 0 ? /* @__PURE__ */ jsx100("span", { className: "ml-2.5 font-mono text-caption tabular-nums text-text-secondary", children: tab.count }) : null
7663
+ tab.count !== void 0 ? /* @__PURE__ */ jsx102("span", { className: "ml-2.5 font-mono text-caption tabular-nums text-text-secondary", children: tab.count }) : null
7514
7664
  ] }),
7515
- tab.unread ? /* @__PURE__ */ jsxs77(Fragment30, { children: [
7516
- /* @__PURE__ */ jsx100(UnreadDot, { className: "h-auto w-auto" }),
7517
- /* @__PURE__ */ jsx100("span", { className: "sr-only", children: "new" })
7665
+ tab.unread ? /* @__PURE__ */ jsxs79(Fragment30, { children: [
7666
+ /* @__PURE__ */ jsx102(UnreadDot, { className: "h-auto w-auto" }),
7667
+ /* @__PURE__ */ jsx102("span", { className: "sr-only", children: "new" })
7518
7668
  ] }) : null
7519
7669
  ]
7520
7670
  },
@@ -7527,10 +7677,10 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
7527
7677
  }
7528
7678
 
7529
7679
  // src/Toast.tsx
7530
- import { createContext as createContext13, useContext as useContext16, useMemo as useMemo7 } from "react";
7680
+ import { createContext as createContext14, useContext as useContext17, useMemo as useMemo7 } from "react";
7531
7681
  import { Toast as BaseToast } from "@base-ui/react/toast";
7532
7682
  import { IconAlertCircle as IconAlertCircle2, IconCircleCheck as IconCircleCheck5, IconCircleX as IconCircleX2 } from "@tabler/icons-react";
7533
- import { jsx as jsx101, jsxs as jsxs78 } from "react/jsx-runtime";
7683
+ import { jsx as jsx103, jsxs as jsxs80 } from "react/jsx-runtime";
7534
7684
  var SURFACE_STYLES = {
7535
7685
  success: "bg-success-muted signal:bg-bg-inset signal:border signal:border-border-default signal:shadow-md leaf:bg-bg-inset leaf:border leaf:border-border-default leaf:shadow-md",
7536
7686
  brand: "bg-accent-muted signal:bg-bg-inset signal:border signal:border-border-default signal:shadow-md leaf:bg-bg-inset leaf:border leaf:border-border-default leaf:shadow-md",
@@ -7566,19 +7716,19 @@ var pillClassName = (type, hasAction, className) => cn(
7566
7716
  );
7567
7717
  function LeadingIcon({ type }) {
7568
7718
  const Icon = ICONS2[type];
7569
- return /* @__PURE__ */ jsx101(Icon, { size: 16, stroke: 1.5, className: cn("text-text-primary shrink-0", ICON_STYLES[type]) });
7719
+ return /* @__PURE__ */ jsx103(Icon, { size: 16, stroke: 1.5, className: cn("text-text-primary shrink-0", ICON_STYLES[type]) });
7570
7720
  }
7571
7721
  function Toast({ label, type = "neutral", leadingIcon = true, actionLabel, onAction, className }) {
7572
7722
  const hasAction = !!(actionLabel && onAction);
7573
- return /* @__PURE__ */ jsxs78("div", { className: pillClassName(type, hasAction, className), children: [
7574
- /* @__PURE__ */ jsxs78("div", { className: "flex items-center gap-2 shrink-0", children: [
7575
- leadingIcon && /* @__PURE__ */ jsx101(LeadingIcon, { type }),
7576
- /* @__PURE__ */ jsx101("span", { className: LABEL_CLASSES, children: label })
7723
+ return /* @__PURE__ */ jsxs80("div", { className: pillClassName(type, hasAction, className), children: [
7724
+ /* @__PURE__ */ jsxs80("div", { className: "flex items-center gap-2 shrink-0", children: [
7725
+ leadingIcon && /* @__PURE__ */ jsx103(LeadingIcon, { type }),
7726
+ /* @__PURE__ */ jsx103("span", { className: LABEL_CLASSES, children: label })
7577
7727
  ] }),
7578
- hasAction && /* @__PURE__ */ jsx101(Button, { variant: "outlined", size: "small", onClick: onAction, children: actionLabel })
7728
+ hasAction && /* @__PURE__ */ jsx103(Button, { variant: "outlined", size: "small", onClick: onAction, children: actionLabel })
7579
7729
  ] });
7580
7730
  }
7581
- var ToastContext = createContext13(null);
7731
+ var ToastContext = createContext14(null);
7582
7732
  var VISIBLE_TOASTS = 3;
7583
7733
  function ToastProvider({ children }) {
7584
7734
  const manager = useMemo7(() => BaseToast.createToastManager(), []);
@@ -7597,9 +7747,9 @@ function ToastProvider({ children }) {
7597
7747
  }),
7598
7748
  [manager]
7599
7749
  );
7600
- return /* @__PURE__ */ jsx101(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs78(BaseToast.Provider, { toastManager: manager, limit: VISIBLE_TOASTS, children: [
7750
+ return /* @__PURE__ */ jsx103(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs80(BaseToast.Provider, { toastManager: manager, limit: VISIBLE_TOASTS, children: [
7601
7751
  children,
7602
- /* @__PURE__ */ jsx101(BaseToast.Portal, { children: /* @__PURE__ */ jsx101(BaseToast.Viewport, { className: "fixed bottom-4 left-4 z-[100] flex flex-col-reverse items-start gap-2 pointer-events-none", children: /* @__PURE__ */ jsx101(ToastList, {}) }) })
7752
+ /* @__PURE__ */ jsx103(BaseToast.Portal, { children: /* @__PURE__ */ jsx103(BaseToast.Viewport, { className: "fixed bottom-4 left-4 z-[100] flex flex-col-reverse items-start gap-2 pointer-events-none", children: /* @__PURE__ */ jsx103(ToastList, {}) }) })
7603
7753
  ] }) });
7604
7754
  }
7605
7755
  function ToastList() {
@@ -7607,25 +7757,25 @@ function ToastList() {
7607
7757
  return toasts.map((toast) => {
7608
7758
  const type = toast.type ?? "neutral";
7609
7759
  const { leadingIcon = true, actionLabel, onAction } = toast.data ?? {};
7610
- return /* @__PURE__ */ jsxs78(
7760
+ return /* @__PURE__ */ jsxs80(
7611
7761
  BaseToast.Root,
7612
7762
  {
7613
7763
  toast,
7614
7764
  swipeDirection: ["left", "down"],
7615
7765
  className: pillClassName(type, !!actionLabel, "pointer-events-auto data-[limited]:hidden"),
7616
7766
  children: [
7617
- /* @__PURE__ */ jsxs78("div", { className: "flex items-center gap-2 shrink-0", children: [
7618
- leadingIcon && /* @__PURE__ */ jsx101(LeadingIcon, { type }),
7619
- /* @__PURE__ */ jsx101(BaseToast.Title, { render: /* @__PURE__ */ jsx101("span", {}), className: LABEL_CLASSES })
7767
+ /* @__PURE__ */ jsxs80("div", { className: "flex items-center gap-2 shrink-0", children: [
7768
+ leadingIcon && /* @__PURE__ */ jsx103(LeadingIcon, { type }),
7769
+ /* @__PURE__ */ jsx103(BaseToast.Title, { render: /* @__PURE__ */ jsx103("span", {}), className: LABEL_CLASSES })
7620
7770
  ] }),
7621
- actionLabel && /* @__PURE__ */ jsx101(
7771
+ actionLabel && /* @__PURE__ */ jsx103(
7622
7772
  BaseToast.Action,
7623
7773
  {
7624
7774
  onClick: () => {
7625
7775
  onAction?.();
7626
7776
  close(toast.id);
7627
7777
  },
7628
- render: /* @__PURE__ */ jsx101(Button, { variant: "outlined", size: "small", children: actionLabel })
7778
+ render: /* @__PURE__ */ jsx103(Button, { variant: "outlined", size: "small", children: actionLabel })
7629
7779
  }
7630
7780
  )
7631
7781
  ]
@@ -7635,11 +7785,12 @@ function ToastList() {
7635
7785
  });
7636
7786
  }
7637
7787
  function useToast() {
7638
- const ctx = useContext16(ToastContext);
7788
+ const ctx = useContext17(ToastContext);
7639
7789
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
7640
7790
  return ctx;
7641
7791
  }
7642
7792
  export {
7793
+ ActivityLine,
7643
7794
  AddReactionButton,
7644
7795
  AppProvider,
7645
7796
  AppShell,
@@ -7714,6 +7865,8 @@ export {
7714
7865
  LinkUnavailable,
7715
7866
  LinkedIcon,
7716
7867
  ListColumn,
7868
+ ListTable,
7869
+ ListTableRow,
7717
7870
  MembersDialog,
7718
7871
  MembersPill,
7719
7872
  Menu,