@nivaro/react 0.3.40 → 0.3.41

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.
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
9
9
  import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
10
10
  import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
11
11
  import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
12
- const Ue = "nivaro-react@0.3.40", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ const Ue = "nivaro-react@0.3.41", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
13
13
  function Be(n) {
14
14
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
15
15
  const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -5085,7 +5085,7 @@ export declare interface ItemEditFormProps {
5085
5085
  * header toolbar. Off by default — the admin's ItemEdit page renders its
5086
5086
  * own copy in the page header; headless hosts opt in. */
5087
5087
  showItemActions?: boolean;
5088
- /** Offer "Schedule a change…" and "Disable in pickers" in the More menu
5088
+ /** Offer "Schedule a change…" and "Hide from pickers" in the More menu
5089
5089
  * when this record's form grants them to everyone (allow_schedule /
5090
5090
  * allow_disable_pickers) or the viewer is an admin. Off by default — the
5091
5091
  * admin's ItemEdit page renders its own copies in the page header;
@@ -15,7 +15,7 @@ import { deliverLive as Ao, releaseLiveOwner as Io } from "../lib/focus-mode.js"
15
15
  import { formatValue as ga, formatMultiValue as Al, countFromResolved as jo } from "../lib/format-value.js";
16
16
  import { createCursorBook as Ko, pageRequest as Bo, noteNextCursor as zo, isCursorRefusal as Uo, stopCursors as Wo } from "../lib/keyset-pager.js";
17
17
  import { expandCoalesced as Qo, LIVE_ASPECTS as xa } from "../lib/live.js";
18
- import { useRowChanges as Vo, useRowLocks as Yo, lockLabel as Ho, viewerMatches as Jo, conditionFields as Go, mayAffectMatch as Xo, writerOf as Zo } from "../lib/live-list.js";
18
+ import { useRowChanges as Vo, useRowLocks as Ho, lockLabel as Yo, viewerMatches as Jo, conditionFields as Go, mayAffectMatch as Xo, writerOf as Zo } from "../lib/live-list.js";
19
19
  import { loadErrorStatus as ei, listLoadErrorText as ti } from "../lib/load-error.js";
20
20
  import { OPEN_IN_TABS_CAP as ai, openInTabs as ni, openInTabsMessage as Il } from "../lib/open-in-tabs.js";
21
21
  import { isOwnWrite as ri } from "../lib/own-writes.js";
@@ -42,8 +42,8 @@ import { FormulaColumnAdder as Ki } from "./cbv/FormulaColumnAdder.js";
42
42
  import { useHierarchyScope as Bi, HierarchyScopePicker as zi } from "./cbv/HierarchyScope.js";
43
43
  import { splitRiskFilter as Ui, riskFilterEntry as Wi } from "./cbv/saved-view-risk.js";
44
44
  import { isFilterRefusal as Qi, unknownFieldsOf as Bl, dropUnknownField as Vi } from "./cbv/unknown-fields.js";
45
- import { ViewDefaultMenu as Yi } from "./cbv/ViewDefaultMenu.js";
46
- import { useRecordRoomTypes as Hi, canOpenChatRoom as Ji, discussRecord as Gi } from "./chat/chat-core.js";
45
+ import { ViewDefaultMenu as Hi } from "./cbv/ViewDefaultMenu.js";
46
+ import { useRecordRoomTypes as Yi, canOpenChatRoom as Ji, discussRecord as Gi } from "./chat/chat-core.js";
47
47
  import { FilterControl as Xi } from "./DataTable.js";
48
48
  import { FocusModeToggle as Zi } from "./FocusModeToggle.js";
49
49
  import { FULFILMENT_FILTER_OPTIONS as ed, FulfilmentPill as td, fulfilmentFigures as ad } from "./FulfilmentPill.js";
@@ -79,7 +79,7 @@ function La(n) {
79
79
  for (const i of ur) if (o.has(i)) return i;
80
80
  return "id";
81
81
  }
82
- const Vl = (n) => typeof n == "string" ? n : n.key, Yl = {
82
+ const Vl = (n) => typeof n == "string" ? n : n.key, Hl = {
83
83
  red: "text-red-600 dark:text-red-400 font-semibold",
84
84
  amber: "text-amber-600 dark:text-amber-400 font-semibold",
85
85
  green: "text-emerald-600 dark:text-emerald-400 font-semibold",
@@ -278,8 +278,8 @@ function Rd({
278
278
  bulkEnabledKeys: O,
279
279
  disabled: B = !1
280
280
  }) {
281
- var Ma, je, Pt, it, Ye, ka, aa, na, Ut, Wt, Da, Oa, se, Aa, ra, la;
282
- const $ = st(), u = cr(), { isAdmin: y } = cn(), [I, q] = v(!1), [g, T] = v({ x: 0, y: 0 }), E = me(null), H = me(null);
281
+ var Ma, je, Pt, it, He, ka, aa, na, Ut, Wt, Da, Oa, se, Aa, ra, la;
282
+ const $ = st(), u = cr(), { isAdmin: y } = cn(), [I, q] = v(!1), [g, T] = v({ x: 0, y: 0 }), E = me(null), Y = me(null);
283
283
  xe(() => {
284
284
  B && q(!1);
285
285
  }, [B]);
@@ -291,13 +291,13 @@ function Rd({
291
291
  }), D = y || Fd(j, n), Q = cd(n, String(o), {
292
292
  enabled: I && y,
293
293
  onDone: () => q(!1)
294
- }), [ke, A] = v(!1), Ce = Hi(I), kt = Ji() && !!(Ce != null && Ce.some((b) => b.collection === n));
294
+ }), [ke, A] = v(!1), Ce = Yi(I), kt = Ji() && !!(Ce != null && Ce.some((b) => b.collection === n));
295
295
  xe(() => {
296
296
  if (!I) return;
297
297
  const b = (G) => {
298
- var Qe, He;
298
+ var Qe, Ye;
299
299
  const ue = G.target;
300
- !((Qe = H.current) != null && Qe.contains(ue)) && !((He = E.current) != null && He.contains(ue)) && q(!1);
300
+ !((Qe = Y.current) != null && Qe.contains(ue)) && !((Ye = E.current) != null && Ye.contains(ue)) && q(!1);
301
301
  }, F = (G) => {
302
302
  G.key === "Escape" && q(!1);
303
303
  };
@@ -362,13 +362,13 @@ function Rd({
362
362
  if (b.has(Qe))
363
363
  b.get(Qe).push(ue);
364
364
  else {
365
- const He = [ue];
366
- b.set(Qe, He), F.push({ key: `g:${Qe}`, label: Qe, options: He });
365
+ const Ye = [ue];
366
+ b.set(Qe, Ye), F.push({ key: `g:${Qe}`, label: Qe, options: Ye });
367
367
  }
368
368
  }
369
369
  for (const ue of F)
370
370
  ue.options.length > 1 && ue.options.sort(
371
- (Qe, He) => (le.get(Qe.to_state ?? "") ?? 999) - (le.get(He.to_state ?? "") ?? 999)
371
+ (Qe, Ye) => (le.get(Qe.to_state ?? "") ?? 999) - (le.get(Ye.to_state ?? "") ?? 999)
372
372
  );
373
373
  return F;
374
374
  }, [$e, le]), Rt = (b) => {
@@ -394,12 +394,12 @@ function Rd({
394
394
  No.useLayoutEffect(() => {
395
395
  var Qe;
396
396
  if (!I) return;
397
- const b = H.current;
397
+ const b = Y.current;
398
398
  if (!b) return;
399
399
  const F = b.getBoundingClientRect();
400
400
  let { x: G, y: ue } = g;
401
401
  if (F.right > window.innerWidth - 8 && (G = Math.max(8, window.innerWidth - F.width - 8)), F.bottom > window.innerHeight - 8) {
402
- const He = (Qe = E.current) == null ? void 0 : Qe.getBoundingClientRect(), Mt = ((He == null ? void 0 : He.top) ?? ue) - F.height - 4;
402
+ const Ye = (Qe = E.current) == null ? void 0 : Qe.getBoundingClientRect(), Mt = ((Ye == null ? void 0 : Ye.top) ?? ue) - F.height - 4;
403
403
  ue = Mt >= 8 ? Mt : Math.max(8, window.innerHeight - F.height - 8);
404
404
  }
405
405
  (G !== g.x || ue !== g.y) && T({ x: G, y: ue });
@@ -491,7 +491,7 @@ function Rd({
491
491
  /* @__PURE__ */ t(
492
492
  "div",
493
493
  {
494
- ref: H,
494
+ ref: Y,
495
495
  style: { position: "fixed", left: g.x, top: g.y, zIndex: 60 },
496
496
  className: `nvr-pop-in ${K ? "w-64" : "w-44"} rounded-lg border border-slate-200 bg-white py-1 shadow-xl dark:border-slate-700 dark:bg-slate-900`,
497
497
  children: K ? /* @__PURE__ */ d("div", { className: "px-2 pb-2", children: [
@@ -550,7 +550,7 @@ function Rd({
550
550
  {
551
551
  value: ot,
552
552
  onChange: (b) => Ea(b.target.value),
553
- placeholder: ((it = K.push) == null ? void 0 : it.kind) === "push" ? ((ka = (Ye = K.push.action.confirm) == null ? void 0 : Ye.input) == null ? void 0 : ka.placeholder) ?? ((na = (aa = K.push.action.confirm) == null ? void 0 : aa.input) == null ? void 0 : na.label) ?? "" : (Ut = K.action) != null && Ut.require_reason || ((Wt = $e.find((b) => b.id === K.picked)) == null ? void 0 : Wt.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
553
+ placeholder: ((it = K.push) == null ? void 0 : it.kind) === "push" ? ((ka = (He = K.push.action.confirm) == null ? void 0 : He.input) == null ? void 0 : ka.placeholder) ?? ((na = (aa = K.push.action.confirm) == null ? void 0 : aa.input) == null ? void 0 : na.label) ?? "" : (Ut = K.action) != null && Ut.require_reason || ((Wt = $e.find((b) => b.id === K.picked)) == null ? void 0 : Wt.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
554
554
  rows: 2,
555
555
  className: "w-full resize-none rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
556
556
  }
@@ -726,7 +726,7 @@ function Rd({
726
726
  onClick: () => Q.toggle.mutate(),
727
727
  "data-tip": Q.excluded ? "Hidden from every picker — offer it again" : "Hide from every picker that would offer it",
728
728
  className: "block w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 disabled:cursor-default disabled:opacity-50 dark:text-slate-200 dark:hover:bg-slate-800",
729
- children: Q.isLoading ? "Checking pickers…" : Q.excluded ? "Include in pickers" : "Exclude from pickers"
729
+ children: Q.isLoading ? "Checking pickers…" : Q.excluded ? "Show in pickers" : "Hide from pickers"
730
730
  }
731
731
  )
732
732
  ] }),
@@ -772,7 +772,7 @@ function Rd({
772
772
  function lr(n) {
773
773
  return n === "id" || /(^|_)id$/i.test(n) || /(^|_)uuid$/i.test(n);
774
774
  }
775
- function Hl({
775
+ function Yl({
776
776
  collection: n,
777
777
  field: o,
778
778
  fieldType: h,
@@ -851,9 +851,9 @@ function mn({
851
851
  const u = me(null);
852
852
  xe(() => {
853
853
  if (!w) return;
854
- const E = (H) => {
854
+ const E = (Y) => {
855
855
  var j;
856
- (j = u.current) != null && j.contains(H.target) || O(!1);
856
+ (j = u.current) != null && j.contains(Y.target) || O(!1);
857
857
  };
858
858
  return window.addEventListener("mousedown", E), () => window.removeEventListener("mousedown", E);
859
859
  }, [w]);
@@ -864,7 +864,7 @@ function mn({
864
864
  {
865
865
  type: "button",
866
866
  onClick: (E) => {
867
- E.stopPropagation(), O((H) => !H);
867
+ E.stopPropagation(), O((Y) => !Y);
868
868
  },
869
869
  title: n,
870
870
  className: `inline-flex h-6 items-center gap-1 rounded border px-1.5 text-[11px] font-normal normal-case tracking-normal ${k ? "w-full min-w-[64px]" : "max-w-[150px]"} ${h.length ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400"}`,
@@ -917,7 +917,7 @@ function mn({
917
917
  type: "checkbox",
918
918
  checked: I.has(String(E.value)),
919
919
  onChange: () => i(
920
- I.has(String(E.value)) ? h.filter((H) => String(H) !== String(E.value)) : [...h, E.value]
920
+ I.has(String(E.value)) ? h.filter((Y) => String(Y) !== String(E.value)) : [...h, E.value]
921
921
  )
922
922
  }
923
923
  ),
@@ -981,7 +981,7 @@ function Ed({
981
981
  enabled: N && !!$ && !q && g.length > 0,
982
982
  staleTime: 10 * 6e4,
983
983
  retry: !1
984
- }), H = E.length > 0 ? [
984
+ }), Y = E.length > 0 ? [
985
985
  ...I,
986
986
  ...E.filter((j) => !I.some((D) => String(D.value) === String(j.value)))
987
987
  ] : I;
@@ -990,7 +990,7 @@ function Ed({
990
990
  {
991
991
  block: !0,
992
992
  label: o ?? "All",
993
- options: H,
993
+ options: Y,
994
994
  selected: h,
995
995
  onChange: i,
996
996
  loading: q,
@@ -1463,9 +1463,9 @@ function jd({
1463
1463
  if (T.hidden) continue;
1464
1464
  const E = Ge(N.relations, n, T.field);
1465
1465
  E != null && E.one_collection && !vt(E.one_collection) && g.add(E.one_collection);
1466
- const H = Ra(N.relations, n, T.field);
1467
- if (H) {
1468
- const j = H.relation.many_collection;
1466
+ const Y = Ra(N.relations, n, T.field);
1467
+ if (Y) {
1468
+ const j = Y.relation.many_collection;
1469
1469
  j && !vt(j) && g.add(j);
1470
1470
  }
1471
1471
  }
@@ -1481,8 +1481,8 @@ function jd({
1481
1481
  }), B = be(() => {
1482
1482
  const g = /* @__PURE__ */ new Map();
1483
1483
  return w.forEach((T, E) => {
1484
- var H;
1485
- return g.set(T, (H = O[E]) == null ? void 0 : H.data);
1484
+ var Y;
1485
+ return g.set(T, (Y = O[E]) == null ? void 0 : Y.data);
1486
1486
  }), g;
1487
1487
  }, [w, O]);
1488
1488
  if (!N)
@@ -1490,7 +1490,7 @@ function jd({
1490
1490
  const $ = i.trim().toLowerCase(), u = (g) => !$ || g.toLowerCase().includes($) || g.toLowerCase().replace(/ /g, "_").includes($), y = [];
1491
1491
  for (const g of N.fields) {
1492
1492
  if (g.hidden) continue;
1493
- const T = ze(g.field), E = Ge(N.relations, n, g.field), H = Ra(N.relations, n, g.field), j = [...o, g.field], D = [...h, T];
1493
+ const T = ze(g.field), E = Ge(N.relations, n, g.field), Y = Ra(N.relations, n, g.field), j = [...o, g.field], D = [...h, T];
1494
1494
  if (E != null && E.one_collection && !vt(E.one_collection))
1495
1495
  u(T) && y.push({
1496
1496
  key: g.field,
@@ -1504,14 +1504,14 @@ function jd({
1504
1504
  relTarget: E.one_collection
1505
1505
  }
1506
1506
  });
1507
- else if (H) {
1508
- const Q = H.relation.many_collection;
1507
+ else if (Y) {
1508
+ const Q = Y.relation.many_collection;
1509
1509
  u(T) && Q && y.push({
1510
1510
  key: g.field,
1511
1511
  label: T,
1512
- hint: H.kind === "m2m" ? "list" : "items",
1512
+ hint: Y.kind === "m2m" ? "list" : "items",
1513
1513
  drillTo: x < 2 ? { collection: Q, path: j, pathLabels: D } : void 0,
1514
- leaf: H.kind === "m2m" ? { path: j, pathLabels: D, fieldType: "relation", relTarget: "" } : void 0
1514
+ leaf: Y.kind === "m2m" ? { path: j, pathLabels: D, fieldType: "relation", relTarget: "" } : void 0
1515
1515
  });
1516
1516
  } else u(T) && y.push({
1517
1517
  key: g.field,
@@ -1528,7 +1528,7 @@ function jd({
1528
1528
  if (!(T != null && T.one_collection) || vt(T.one_collection)) continue;
1529
1529
  const E = B.get(T.one_collection);
1530
1530
  if (!E) continue;
1531
- const H = ze(g.field);
1531
+ const Y = ze(g.field);
1532
1532
  for (const j of E.fields) {
1533
1533
  if (j.hidden) continue;
1534
1534
  const D = ze(j.field);
@@ -1537,11 +1537,11 @@ function jd({
1537
1537
  I.push({
1538
1538
  key: `${g.field}.${j.field}`,
1539
1539
  label: D,
1540
- breadcrumb: H,
1540
+ breadcrumb: Y,
1541
1541
  hint: Xl(j, Q ?? void 0),
1542
1542
  leaf: {
1543
1543
  path: [...o, g.field, j.field],
1544
- pathLabels: [...h, H, D],
1544
+ pathLabels: [...h, Y, D],
1545
1545
  fieldType: Q != null && Q.one_collection ? "relation" : j.type ?? "string",
1546
1546
  relTarget: (Q == null ? void 0 : Q.one_collection) ?? void 0
1547
1547
  }
@@ -1686,7 +1686,7 @@ function zd({
1686
1686
  collection: n,
1687
1687
  path: [],
1688
1688
  pathLabels: []
1689
- }), [$, u] = v(null), [y, I] = v("_contains"), [q, g] = v(""), [T, E] = v(""), [H, j] = v([]), [D, Q] = v({}), [ke, A] = v(null), Ce = me(null);
1689
+ }), [$, u] = v(null), [y, I] = v("_contains"), [q, g] = v(""), [T, E] = v(""), [Y, j] = v([]), [D, Q] = v({}), [ke, A] = v(null), Ce = me(null);
1690
1690
  xe(() => {
1691
1691
  if (!_) return;
1692
1692
  const f = (le) => {
@@ -1714,13 +1714,13 @@ function zd({
1714
1714
  value: z
1715
1715
  });
1716
1716
  }, Ee = () => {
1717
- !$ || H.length === 0 || $e({
1717
+ !$ || Y.length === 0 || $e({
1718
1718
  path: $.path,
1719
1719
  pathLabels: $.pathLabels,
1720
1720
  fieldType: "relation",
1721
1721
  op: "_in",
1722
- value: H,
1723
- valueLabels: H.map((f) => D[String(f)] ?? String(f)),
1722
+ value: Y,
1723
+ valueLabels: Y.map((f) => D[String(f)] ?? String(f)),
1724
1724
  relTarget: $.relTarget
1725
1725
  });
1726
1726
  }, L = (f) => {
@@ -1924,7 +1924,7 @@ function zd({
1924
1924
  Kd,
1925
1925
  {
1926
1926
  target: $.relTarget,
1927
- selected: H,
1927
+ selected: Y,
1928
1928
  labels: D,
1929
1929
  onToggle: (f, z) => {
1930
1930
  j(
@@ -1937,12 +1937,12 @@ function zd({
1937
1937
  "button",
1938
1938
  {
1939
1939
  type: "button",
1940
- disabled: H.length === 0,
1940
+ disabled: Y.length === 0,
1941
1941
  onClick: Ee,
1942
1942
  className: "h-8 w-full rounded-md bg-nvr-cyan text-[13px] font-medium text-white disabled:opacity-40",
1943
1943
  children: [
1944
1944
  "Apply",
1945
- H.length > 0 ? ` (${H.length})` : ""
1945
+ Y.length > 0 ? ` (${Y.length})` : ""
1946
1946
  ]
1947
1947
  }
1948
1948
  ) })
@@ -2231,7 +2231,7 @@ function Qd({
2231
2231
  onCancel: i
2232
2232
  }) {
2233
2233
  var ke;
2234
- const x = st(), [k, _] = v(""), [C, N] = v(""), [w, O] = v(!0), [B, $] = v(!0), [u, y] = v(!1), [I, q] = v(!1), [g, T] = v(!1), [E, H] = v(null), { data: j } = re({
2234
+ const x = st(), [k, _] = v(""), [C, N] = v(""), [w, O] = v(!0), [B, $] = v(!0), [u, y] = v(!1), [I, q] = v(!1), [g, T] = v(!1), [E, Y] = v(null), { data: j } = re({
2235
2235
  queryKey: ["cbv-msg-preview", n, o.join(","), w, B],
2236
2236
  queryFn: () => x.request(
2237
2237
  he("/notifications/message-stakeholders", {
@@ -2244,7 +2244,7 @@ function Qd({
2244
2244
  enabled: w || B
2245
2245
  }), D = w || B ? (j == null ? void 0 : j.count) ?? null : 0, Q = async () => {
2246
2246
  if (!(!k.trim() || !C.trim())) {
2247
- T(!0), H(null);
2247
+ T(!0), Y(null);
2248
2248
  try {
2249
2249
  const A = await x.request(
2250
2250
  he("/notifications/message-stakeholders", {
@@ -2258,7 +2258,7 @@ function Qd({
2258
2258
  );
2259
2259
  h(`Messaged ${A.sent} stakeholder(s) across ${A.records} record(s)`);
2260
2260
  } catch (A) {
2261
- H(Ft(A, "Failed to send")), T(!1);
2261
+ Y(Ft(A, "Failed to send")), T(!1);
2262
2262
  }
2263
2263
  }
2264
2264
  };
@@ -2390,7 +2390,7 @@ function Vd({
2390
2390
  queryKey: ["bulk-recipes", n],
2391
2391
  queryFn: () => w.request(J("/bulk-recipes", { collection: n })).then((L) => L.data ?? []).catch(() => []),
2392
2392
  staleTime: 6e4
2393
- }), [q, g] = v(null), [T, E] = v(""), H = async () => {
2393
+ }), [q, g] = v(null), [T, E] = v(""), Y = async () => {
2394
2394
  if (!(!q || !T.trim()))
2395
2395
  try {
2396
2396
  await w.request(
@@ -2490,7 +2490,7 @@ function Vd({
2490
2490
  collection: n,
2491
2491
  ids: o.slice(0, 3),
2492
2492
  fields: i,
2493
- renderValue: (L, ee) => Yd(n, x, L, ee),
2493
+ renderValue: (L, ee) => Hd(n, x, L, ee),
2494
2494
  onClose: () => Q(!1)
2495
2495
  }
2496
2496
  ),
@@ -2709,7 +2709,7 @@ function Vd({
2709
2709
  {
2710
2710
  className: "flex items-center gap-1.5",
2711
2711
  onSubmit: (L) => {
2712
- L.preventDefault(), H();
2712
+ L.preventDefault(), Y();
2713
2713
  },
2714
2714
  children: [
2715
2715
  /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: "Recipe name:" }),
@@ -2794,7 +2794,7 @@ function cu({
2794
2794
  className: $
2795
2795
  }) {
2796
2796
  var yl, wl, _l, Nl, Sl, Cl, $l, ql, Tl, Ll, Fl;
2797
- const u = st(), y = cr(), { open: I, urlFor: q } = ts(), [g, T] = v(1), E = me(Ko()), [H, j] = v(k), D = Dl(H.trim(), 350), [Q, ke] = v(_ ?? []), [A, Ce] = v(i ?? ""), [kt, ve] = v(h ?? null), [$e, ye] = v({}), [Ee, L] = v({}), [ee, we] = v(null), [ne, f] = v({}), [z, le] = v({}), [Ue, Rt] = v({}), [Et, K] = v({}), [ht, ot] = v(null), [Ea, De] = v(!1), St = me(null), [Zt, Ct] = v({}), [yt, We] = v({}), [ea, Pa] = v(C ?? []), { scopes: wt, ready: ta } = mi(), [$t, ft] = v(!1), [qt, Ma] = v(/* @__PURE__ */ new Set()), [je, Pt] = v({}), it = Co("drill.browser"), Ye = it.value, [ka, aa] = v(null), [na, Ut] = v(!1), [Wt, Da] = v(() => {
2797
+ const u = st(), y = cr(), { open: I, urlFor: q } = ts(), [g, T] = v(1), E = me(Ko()), [Y, j] = v(k), D = Dl(Y.trim(), 350), [Q, ke] = v(_ ?? []), [A, Ce] = v(i ?? ""), [kt, ve] = v(h ?? null), [$e, ye] = v({}), [Ee, L] = v({}), [ee, we] = v(null), [ne, f] = v({}), [z, le] = v({}), [Ue, Rt] = v({}), [Et, K] = v({}), [ht, ot] = v(null), [Ea, De] = v(!1), St = me(null), [Zt, Ct] = v({}), [yt, We] = v({}), [ea, Pa] = v(C ?? []), { scopes: wt, ready: ta } = mi(), [$t, ft] = v(!1), [qt, Ma] = v(/* @__PURE__ */ new Set()), [je, Pt] = v({}), it = Co("drill.browser"), He = it.value, [ka, aa] = v(null), [na, Ut] = v(!1), [Wt, Da] = v(() => {
2798
2798
  try {
2799
2799
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
2800
2800
  } catch {
@@ -2819,7 +2819,7 @@ function cu({
2819
2819
  e ? localStorage.setItem(`nvr_cbv_group_${n}`, e) : localStorage.removeItem(`nvr_cbv_group_${n}`);
2820
2820
  } catch {
2821
2821
  }
2822
- }, [Qe, He] = v(!1), [Mt, bn] = v(""), [Oe, br] = v(null), sa = bt({
2822
+ }, [Qe, Ye] = v(!1), [Mt, bn] = v(""), [Oe, br] = v(null), sa = bt({
2823
2823
  mutationFn: (e) => u.request(he("/ai/query", { collection: n, prompt: e, limit: 200 })),
2824
2824
  onSuccess: (e) => {
2825
2825
  var a;
@@ -2838,7 +2838,7 @@ function cu({
2838
2838
  br(null), bn("");
2839
2839
  }, hr = me(!1);
2840
2840
  xe(() => {
2841
- !w || hr.current || (hr.current = !0, He(!0), bn(w), sa.mutate(w));
2841
+ !w || hr.current || (hr.current = !0, Ye(!0), bn(w), sa.mutate(w));
2842
2842
  }, [w]);
2843
2843
  const [oe, Dt] = v(null), [hn, fr] = v([]);
2844
2844
  xe(() => {
@@ -2850,7 +2850,7 @@ function cu({
2850
2850
  }, [oe]);
2851
2851
  const [Qt, Vt] = v([]);
2852
2852
  To();
2853
- const [oa, Ia] = v(null), [is, fn] = v(!1), [Yt, gn] = v(""), [xn, gr] = v(!1), [ds, xr] = v(!1), [vn, ia] = v(!1), vr = me(null);
2853
+ const [oa, Ia] = v(null), [is, fn] = v(!1), [Ht, gn] = v(""), [xn, gr] = v(!1), [ds, xr] = v(!1), [vn, ia] = v(!1), vr = me(null);
2854
2854
  xe(() => {
2855
2855
  if (!vn) return;
2856
2856
  const e = (a) => {
@@ -2859,9 +2859,9 @@ function cu({
2859
2859
  };
2860
2860
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2861
2861
  }, [vn]);
2862
- const kr = me(null), yr = me(null), kn = me(!1), { isAdmin: Ht } = cn(), wr = me(n);
2862
+ const kr = me(null), yr = me(null), kn = me(!1), { isAdmin: Yt } = cn(), wr = me(n);
2863
2863
  xe(() => {
2864
- wr.current !== n && (wr.current = n, T(1), j(k), ke([]), Ce(i ?? ""), ve(h ?? null), ye({}), L({}), f({}), le({}), Vt([]), Ia(null), Ct({}), We({}), Pt({}), Pa([]), Ye != null && Ye.length && it.back(Ye.length), aa(null), kn.current = !1);
2864
+ wr.current !== n && (wr.current = n, T(1), j(k), ke([]), Ce(i ?? ""), ve(h ?? null), ye({}), L({}), f({}), le({}), Vt([]), Ia(null), Ct({}), We({}), Pt({}), Pa([]), He != null && He.length && it.back(He.length), aa(null), kn.current = !1);
2865
2865
  }, [n]), xe(() => {
2866
2866
  if (!na) return;
2867
2867
  const e = (a) => {
@@ -3207,7 +3207,7 @@ function cu({
3207
3207
  (r) => !e.has(JSON.stringify(r))
3208
3208
  );
3209
3209
  return a.length > 0 ? JSON.stringify(a) : void 0;
3210
- }, [Qr, fe, yt]), { data: Ya } = re({
3210
+ }, [Qr, fe, yt]), { data: Ha } = re({
3211
3211
  queryKey: ["cbv-default-hidden", n, D, Ln],
3212
3212
  enabled: !!n && !Oe && !!qe && !Gt && Le === 0 && $a.length > 0,
3213
3213
  staleTime: 3e4,
@@ -3228,14 +3228,14 @@ function cu({
3228
3228
  return l;
3229
3229
  };
3230
3230
  Ct(a), We(a), T(1);
3231
- }, Vr = me(Date.now()), Ha = me(null);
3231
+ }, Vr = me(Date.now()), Ya = me(null);
3232
3232
  xe(() => {
3233
3233
  Vr.current = Date.now();
3234
3234
  }, [n, D]), xe(() => {
3235
3235
  var a, r;
3236
3236
  if (!n || D.length < 2 || !qe || Gt || Oe) return;
3237
3237
  const e = `${n}\0${D}`;
3238
- ((a = Ha.current) == null ? void 0 : a.key) !== e && (Ha.current = {
3238
+ ((a = Ya.current) == null ? void 0 : a.key) !== e && (Ya.current = {
3239
3239
  key: e,
3240
3240
  id: ui(u, {
3241
3241
  surface: "collection",
@@ -3262,12 +3262,12 @@ function cu({
3262
3262
  }
3263
3263
  } : null
3264
3264
  );
3265
- const Cs = ki(), Yr = qo(Gt), Fn = ii(), { userId: Rn } = cn(), Nt = Vo(), En = me(/* @__PURE__ */ new Set());
3265
+ const Cs = ki(), Hr = qo(Gt), Fn = ii(), { userId: Rn } = cn(), Nt = Vo(), En = me(/* @__PURE__ */ new Set());
3266
3266
  En.current = new Set(pe.map((e) => String(e.id)));
3267
3267
  const $s = be(
3268
3268
  () => pe.slice(0, 100).map((e) => ({ collection: n, item: String(e.id) })),
3269
3269
  [pe, n]
3270
- ), Hr = oi($s), Jr = me([]);
3270
+ ), Yr = oi($s), Jr = me([]);
3271
3271
  Jr.current = [
3272
3272
  "cbv-items",
3273
3273
  n,
@@ -3293,18 +3293,18 @@ function cu({
3293
3293
  const Pn = me({}).current, [qs, Ts] = v(0), [Mn, Dn] = v(0);
3294
3294
  xe(() => {
3295
3295
  if (!Fn || !n) return;
3296
- const e = (V = 1) => Dn((Y) => Y + V), a = /* @__PURE__ */ new Map();
3296
+ const e = (V = 1) => Dn((H) => H + V), a = /* @__PURE__ */ new Map();
3297
3297
  let r = null;
3298
3298
  const l = (V) => {
3299
- const Y = (te) => a.set(JSON.stringify(te), te);
3300
- V.includes(xa.tasks) && Y(["cbv-task-counts", n]), V.includes(xa.addendums) && Y(["cbv-addendum-summary", n]), V.includes(xa.integrations) && Y(["cbv-integrations-summary", n]), V.includes(xa.comments) && Y(["row-comment-counts", n]), V.includes(xa.state) && (Y(["cbv-pipeline-instances", n]), Y(["cbv-owners", n]), Y(["cbv-view-count", n])), V.includes(xa.lock) && Ts((te) => te + 1), !r && (r = setTimeout(() => {
3299
+ const H = (te) => a.set(JSON.stringify(te), te);
3300
+ V.includes(xa.tasks) && H(["cbv-task-counts", n]), V.includes(xa.addendums) && H(["cbv-addendum-summary", n]), V.includes(xa.integrations) && H(["cbv-integrations-summary", n]), V.includes(xa.comments) && H(["row-comment-counts", n]), V.includes(xa.state) && (H(["cbv-pipeline-instances", n]), H(["cbv-owners", n]), H(["cbv-view-count", n])), V.includes(xa.lock) && Ts((te) => te + 1), !r && (r = setTimeout(() => {
3301
3301
  r = null;
3302
3302
  for (const te of a.values()) y.invalidateQueries({ queryKey: te });
3303
3303
  a.clear();
3304
3304
  }, 300));
3305
3305
  }, s = (V) => y.setQueryData(
3306
3306
  Jr.current,
3307
- (Y) => Y && { ...Y, ...V(Y) }
3307
+ (H) => H && { ...H, ...V(H) }
3308
3308
  );
3309
3309
  let c = [], m = null, R = null, P = !1;
3310
3310
  const Se = async () => {
@@ -3314,7 +3314,7 @@ function cu({
3314
3314
  R || (R = setTimeout(() => {
3315
3315
  R = null, y.invalidateQueries({ queryKey: ["cbv-view-count", n] });
3316
3316
  }, 1500));
3317
- const Y = /* @__PURE__ */ new Map();
3317
+ const H = /* @__PURE__ */ new Map();
3318
3318
  let te = !1;
3319
3319
  for (const U of V) {
3320
3320
  const ie = String(U.item);
@@ -3322,8 +3322,8 @@ function cu({
3322
3322
  te = !0;
3323
3323
  continue;
3324
3324
  }
3325
- const ae = Y.get(ie), _e = (ae == null ? void 0 : ae.action) === "delete" || U.action === "delete" ? "delete" : (ae == null ? void 0 : ae.action) === "create" ? "create" : U.action, et = /* @__PURE__ */ new Set([...(ae == null ? void 0 : ae.changed_fields) ?? [], ...U.changed_fields ?? []]);
3326
- Y.set(ie, {
3325
+ const ae = H.get(ie), _e = (ae == null ? void 0 : ae.action) === "delete" || U.action === "delete" ? "delete" : (ae == null ? void 0 : ae.action) === "create" ? "create" : U.action, et = /* @__PURE__ */ new Set([...(ae == null ? void 0 : ae.changed_fields) ?? [], ...U.changed_fields ?? []]);
3326
+ H.set(ie, {
3327
3327
  ...U,
3328
3328
  action: _e,
3329
3329
  changed_fields: U.changed_fields || ae != null && ae.changed_fields ? [...et] : void 0
@@ -3334,8 +3334,8 @@ function cu({
3334
3334
  const ie = Zo(U);
3335
3335
  return ie && Rn && ie.toUpperCase() === Rn.toUpperCase() ? "self" : ie;
3336
3336
  }, pt = [];
3337
- for (const [U, ie] of Y)
3338
- ie.action === "delete" && (p.has(U) ? pt.push(U) : e(), Y.delete(U));
3337
+ for (const [U, ie] of H)
3338
+ ie.action === "delete" && (p.has(U) ? pt.push(U) : e(), H.delete(U));
3339
3339
  if (pt.length > 0) {
3340
3340
  const U = new Set(pt);
3341
3341
  s((ie) => ({
@@ -3343,19 +3343,19 @@ function cu({
3343
3343
  total: Math.max(0, ie.total - pt.length)
3344
3344
  })), Nt.forget(pt);
3345
3345
  }
3346
- if (Y.size === 0) return;
3346
+ if (H.size === 0) return;
3347
3347
  const mt = Gr.current;
3348
3348
  let Xt;
3349
3349
  try {
3350
3350
  Xt = await Jo(
3351
3351
  u,
3352
3352
  n,
3353
- [...Y.keys()],
3353
+ [...H.keys()],
3354
3354
  mt.conditions,
3355
3355
  mt.search
3356
3356
  );
3357
3357
  } catch {
3358
- for (const [U, ie] of Y) {
3358
+ for (const [U, ie] of H) {
3359
3359
  if (!p.has(U)) {
3360
3360
  e();
3361
3361
  continue;
@@ -3372,7 +3372,7 @@ function cu({
3372
3372
  }
3373
3373
  if (P) return;
3374
3374
  const W = Go(mt.conditions), Z = mt.page === 1 && !mt.grouped, Te = /* @__PURE__ */ new Map(), S = [], Ve = [];
3375
- for (const [U, ie] of Y) {
3375
+ for (const [U, ie] of H) {
3376
3376
  const ae = Xt.get(U);
3377
3377
  p.has(U) ? ae ? Te.set(U, ae) : S.push(U) : ae && ((ie.action === "create" || !!mt.conditions && Xo(ie, W)) && Z ? Ve.push({ row: ae, ev: ie }) : e());
3378
3378
  }
@@ -3391,7 +3391,7 @@ function cu({
3391
3391
  }
3392
3392
  S.length > 0 && Nt.forget(S);
3393
3393
  for (const [U] of Te) {
3394
- const ie = Y.get(U), ae = Be(Te.get(U));
3394
+ const ie = H.get(U), ae = Be(Te.get(U));
3395
3395
  ie && !Bt(ie) && ae !== "self" && Nt.note([U], ae);
3396
3396
  }
3397
3397
  for (const { row: U, ev: ie } of Ve) {
@@ -3399,13 +3399,13 @@ function cu({
3399
3399
  Be(U) !== "self" && Nt.note([ae], Be(U), "create");
3400
3400
  }
3401
3401
  }, X = (V) => {
3402
- for (const Y of V.flatMap((te) => Qo(te))) {
3403
- const te = Y.changed_fields;
3404
- if (!Y.action && (te != null && te.length) && te.every((p) => p.startsWith("$"))) {
3405
- (String(Y.item) === "*" || En.current.has(String(Y.item))) && l(te);
3402
+ for (const H of V.flatMap((te) => Qo(te))) {
3403
+ const te = H.changed_fields;
3404
+ if (!H.action && (te != null && te.length) && te.every((p) => p.startsWith("$"))) {
3405
+ (String(H.item) === "*" || En.current.has(String(H.item))) && l(te);
3406
3406
  continue;
3407
3407
  }
3408
- c.push(Y);
3408
+ c.push(H);
3409
3409
  }
3410
3410
  c.length > 0 && !m && (m = setTimeout(() => void Se(), 300));
3411
3411
  }, Re = Fn.subscribeCollections(
@@ -3416,7 +3416,7 @@ function cu({
3416
3416
  P = !0, Re(), Io(Pn), r && clearTimeout(r), m && clearTimeout(m), R && clearTimeout(R);
3417
3417
  };
3418
3418
  }, [Fn, n, y, u, Rn, Nt, Pn]);
3419
- const Ls = Yo(
3419
+ const Ls = Ho(
3420
3420
  n,
3421
3421
  pe.map((e) => String(e.id)),
3422
3422
  qs
@@ -3444,7 +3444,7 @@ function cu({
3444
3444
  }), Pe = pe.map((e) => String(e.id)).join(","), Es = be(
3445
3445
  () => pe.map((e) => ({ collection: n, id: e.id })),
3446
3446
  [pe, n]
3447
- ), Ps = md(Es, Ht), An = !!(M != null && M.addendums_enabled), { data: In } = re({
3447
+ ), Ps = md(Es, Yt), An = !!(M != null && M.addendums_enabled), { data: In } = re({
3448
3448
  queryKey: ["cbv-addendum-summary", n, Pe],
3449
3449
  queryFn: () => u.request(
3450
3450
  he("/addendums/summary", { collection: n, ids: Pe.split(",") })
@@ -3501,8 +3501,8 @@ function cu({
3501
3501
  staleTime: 3e4,
3502
3502
  retry: !1
3503
3503
  }), Ja = (_l = Ne == null ? void 0 : Ne.binding) == null ? void 0 : _l.template, { data: ua } = re({
3504
- queryKey: ["cbv-pipeline-template", Ja, Ht ? "full" : "outline"],
3505
- queryFn: () => u.request(J(Ht ? `/pipelines/${Ja}` : `/pipelines/${Ja}/outline`)).then((e) => e.data),
3504
+ queryKey: ["cbv-pipeline-template", Ja, Yt ? "full" : "outline"],
3505
+ queryFn: () => u.request(J(Yt ? `/pipelines/${Ja}` : `/pipelines/${Ja}/outline`)).then((e) => e.data),
3506
3506
  enabled: !!Ja,
3507
3507
  retry: !1
3508
3508
  }), Ds = !!(Ne != null && Ne.binding), { data: zn } = re({
@@ -3585,8 +3585,8 @@ function cu({
3585
3585
  if (c.kind === "in") {
3586
3586
  const Re = Ge(at, n, a) ? r[a] != null ? [r[a]] : [] : ((Se = (P = (R = ge == null ? void 0 : ge.rows) == null ? void 0 : R[String(s)]) == null ? void 0 : P[Ke[a]]) == null ? void 0 : Se.ids) ?? [];
3587
3587
  if (Re.length === 0) return;
3588
- const V = je[a], Y = (V == null ? void 0 : V.kind) === "in" ? V.value : [];
3589
- Me(a, { kind: "in", value: [.../* @__PURE__ */ new Set([...Y, ...Re])] });
3588
+ const V = je[a], H = (V == null ? void 0 : V.kind) === "in" ? V.value : [];
3589
+ Me(a, { kind: "in", value: [.../* @__PURE__ */ new Set([...H, ...Re])] });
3590
3590
  return;
3591
3591
  }
3592
3592
  if (c.kind === "enum") {
@@ -3775,7 +3775,7 @@ function cu({
3775
3775
  e.columns.filter((p) => typeof p != "string" && p.admin_only).map(Vl)
3776
3776
  );
3777
3777
  Us(s);
3778
- const c = e.columns.map(Vl).filter((p) => Ht || !s.has(p)), m = {};
3778
+ const c = e.columns.map(Vl).filter((p) => Yt || !s.has(p)), m = {};
3779
3779
  for (const p of e.columns)
3780
3780
  typeof p != "string" && p.formula && p.key.startsWith("__f:") && (m[p.key] = p.formula);
3781
3781
  L(m);
@@ -3783,10 +3783,10 @@ function cu({
3783
3783
  R.length > 0 && ve(R);
3784
3784
  const P = {}, Se = {}, X = {};
3785
3785
  let Re = !1;
3786
- const V = {}, Y = {}, te = {};
3786
+ const V = {}, H = {}, te = {};
3787
3787
  for (const p of e.columns)
3788
- typeof p != "string" && p.label && (P[p.key] = p.label), typeof p != "string" && p.format && (Se[p.key] = p.format), typeof p != "string" && p.pin && (Re = !0, p.pin !== "none" && (X[p.key] = p.pin)), typeof p != "string" && ((l = p.tint) != null && l.length) && (V[p.key] = p.tint), typeof p != "string" && p.width && (Y[p.key] = p.width), typeof p != "string" && p.agg && (te[p.key] = p.agg);
3789
- le(te), ye(P), f(Se), K(V), Rt(Y), za(Re ? X : null);
3788
+ typeof p != "string" && p.label && (P[p.key] = p.label), typeof p != "string" && p.format && (Se[p.key] = p.format), typeof p != "string" && p.pin && (Re = !0, p.pin !== "none" && (X[p.key] = p.pin)), typeof p != "string" && ((l = p.tint) != null && l.length) && (V[p.key] = p.tint), typeof p != "string" && p.width && (H[p.key] = p.width), typeof p != "string" && p.agg && (te[p.key] = p.agg);
3789
+ le(te), ye(P), f(Se), K(V), Rt(H), za(Re ? X : null);
3790
3790
  } else
3791
3791
  za(null);
3792
3792
  T(1);
@@ -3868,7 +3868,7 @@ function cu({
3868
3868
  ).then(() => ce.info(`Exporting “${a}” in the background — follow it in the Jobs tray`)).catch((r) => ce.error(Ft(r, "Could not start the export")));
3869
3869
  }, en = bt({
3870
3870
  mutationFn: () => u.request(
3871
- he("/saved-views", { collection: n, name: Yt.trim(), ...Xa() })
3871
+ he("/saved-views", { collection: n, name: Ht.trim(), ...Xa() })
3872
3872
  ),
3873
3873
  onSuccess: (e) => {
3874
3874
  fn(!1), gn(""), Ia(e.data.id), ba();
@@ -3885,7 +3885,7 @@ function cu({
3885
3885
  }), Vs = bt({
3886
3886
  mutationFn: ({ id: e, on: a }) => u.request(rn(`/saved-views/${e}`, { is_default: a })),
3887
3887
  onSuccess: ba
3888
- }), Ys = bt({
3888
+ }), Hs = bt({
3889
3889
  mutationFn: ({ id: e, role: a }) => u.request(rn(`/saved-views/${e}`, { default_for_role: a })),
3890
3890
  onSuccess: ba,
3891
3891
  onError: (e) => ce.error(`Could not set the role default: ${e.message}`)
@@ -3902,7 +3902,7 @@ function cu({
3902
3902
  }), ml = bt({
3903
3903
  mutationFn: (e) => u.request(on(`/items/${n}/${e}`)),
3904
3904
  onSuccess: () => void y.invalidateQueries({ queryKey: ["cbv-items", n] })
3905
- }), Hs = bt({
3905
+ }), Ys = bt({
3906
3906
  mutationFn: (e) => u.request(on(`/saved-views/${e}`)),
3907
3907
  onSuccess: (e, a) => {
3908
3908
  oa === a && ol(), ba();
@@ -3976,7 +3976,7 @@ function cu({
3976
3976
  (W) => gi(u, W).then((Z) => X.set(W.toUpperCase(), Ai(Z, W))).catch(() => X.set(W.toUpperCase(), W))
3977
3977
  )
3978
3978
  );
3979
- const Re = new Map(c.map((W) => [W.column, W])), V = new Set(m), Y = (W) => {
3979
+ const Re = new Map(c.map((W) => [W.column, W])), V = new Set(m), H = (W) => {
3980
3980
  const Z = W == null ? "" : String(typeof W == "object" ? JSON.stringify(W) : W);
3981
3981
  return /[",\n]/.test(Z) ? `"${Z.replace(/"/g, '""')}"` : Z;
3982
3982
  }, te = (W, Z) => {
@@ -3997,15 +3997,15 @@ function cu({
3997
3997
  const S = W[Z], Ve = Re.get(Z);
3998
3998
  return Ve && S != null && S !== "" ? Ii(Ve, P[String(W.id)]) || S : V.has(Z) && S != null && S !== "" ? X.get(String(S).toUpperCase()) ?? S : Te && S != null ? ga(String(S), Te) : S;
3999
3999
  }, p = [
4000
- ["id", ...s.map((W) => ct(W))].map(Y).join(","),
4001
- ...r.map((W) => [W.id, ...s.map((Z) => te(W, Z))].map(Y).join(","))
4000
+ ["id", ...s.map((W) => ct(W))].map(H).join(","),
4001
+ ...r.map((W) => [W.id, ...s.map((Z) => te(W, Z))].map(H).join(","))
4002
4002
  ];
4003
4003
  l && (p.push(""), p.push(
4004
- Y(
4004
+ H(
4005
4005
  `First ${r.length.toLocaleString()} of ${Le.toLocaleString()} rows — narrow the filter to export the rest`
4006
4006
  )
4007
4007
  )), M != null && M.export_watermark && (p.push(""), p.push(
4008
- Y(`Exported ${(/* @__PURE__ */ new Date()).toISOString()} · ${r.length} rows · ${n} · Nivaro`)
4008
+ H(`Exported ${(/* @__PURE__ */ new Date()).toISOString()} · ${r.length} rows · ${n} · Nivaro`)
4009
4009
  )), u.request(
4010
4010
  he("/activity/export-log", {
4011
4011
  collection: n,
@@ -4034,7 +4034,7 @@ function cu({
4034
4034
  }, 250);
4035
4035
  }, ha = (e) => {
4036
4036
  var a;
4037
- ((a = Ha.current) == null ? void 0 : a.key) === `${n}\0${D}` && pi(u, Ha.current.id, {
4037
+ ((a = Ya.current) == null ? void 0 : a.key) === `${n}\0${D}` && pi(u, Ya.current.id, {
4038
4038
  type: "record",
4039
4039
  collection: n,
4040
4040
  item: e === "new" ? null : e
@@ -4059,8 +4059,8 @@ function cu({
4059
4059
  return;
4060
4060
  }
4061
4061
  r(e);
4062
- }, Yn = pe.length > 0 && pe.every((e) => Qt.includes(e.id)), to = () => Vt(
4063
- Yn ? Qt.filter((e) => !pe.some((a) => a.id === e)) : [.../* @__PURE__ */ new Set([...Qt, ...pe.map((e) => e.id)])]
4062
+ }, Hn = pe.length > 0 && pe.every((e) => Qt.includes(e.id)), to = () => Vt(
4063
+ Hn ? Qt.filter((e) => !pe.some((a) => a.id === e)) : [.../* @__PURE__ */ new Set([...Qt, ...pe.map((e) => e.id)])]
4064
4064
  ), ao = (e) => Vt((a) => a.includes(e) ? a.filter((r) => r !== e) : [...a, e]), an = 2e3, [bl, hl] = v(!1), no = async () => {
4065
4065
  hl(!0);
4066
4066
  try {
@@ -4076,7 +4076,7 @@ function cu({
4076
4076
  } finally {
4077
4077
  hl(!1);
4078
4078
  }
4079
- }, ro = Le === 0 && !ca ? 0 : (g - 1) * tt + 1, lo = ca ? (g - 1) * tt + pe.length : Math.min(g * tt, Le), qa = !!(Ne != null && Ne.instances), Hn = (Tt ? 1 : 0) + (qa ? 2 : 0) + (Nr ? 1 : 0), Jn = [
4079
+ }, ro = Le === 0 && !ca ? 0 : (g - 1) * tt + 1, lo = ca ? (g - 1) * tt + pe.length : Math.min(g * tt, Le), qa = !!(Ne != null && Ne.instances), Yn = (Tt ? 1 : 0) + (qa ? 2 : 0) + (Nr ? 1 : 0), Jn = [
4080
4080
  ...de.map(
4081
4081
  (e) => e.startsWith("__f:") ? { key: e, kind: "formula" } : { key: e, kind: "data" }
4082
4082
  ),
@@ -4427,7 +4427,7 @@ function cu({
4427
4427
  {
4428
4428
  collection: n,
4429
4429
  meta: M,
4430
- search: H,
4430
+ search: Y,
4431
4431
  onSearch: (e) => {
4432
4432
  j(e), T(1);
4433
4433
  },
@@ -4508,7 +4508,7 @@ function cu({
4508
4508
  children: /* @__PURE__ */ t(tr, { className: `h-4 w-4 ${Gt ? "animate-spin" : ""}` })
4509
4509
  }
4510
4510
  ),
4511
- Ht && Ae.copy_as !== !1 && /* @__PURE__ */ t(
4511
+ Yt && Ae.copy_as !== !1 && /* @__PURE__ */ t(
4512
4512
  Fi,
4513
4513
  {
4514
4514
  collection: n,
@@ -4573,7 +4573,7 @@ function cu({
4573
4573
  "button",
4574
4574
  {
4575
4575
  type: "button",
4576
- onClick: () => He((e) => !e),
4576
+ onClick: () => Ye((e) => !e),
4577
4577
  title: "Ask the table a question",
4578
4578
  className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${Qe || Oe ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
4579
4579
  children: [
@@ -4591,7 +4591,7 @@ function cu({
4591
4591
  value: Mt,
4592
4592
  onChange: (e) => bn(e.target.value),
4593
4593
  onKeyDown: (e) => {
4594
- e.key === "Enter" && Mt.trim() && !sa.isPending && sa.mutate(Mt.trim()), e.key === "Escape" && He(!1);
4594
+ e.key === "Enter" && Mt.trim() && !sa.isPending && sa.mutate(Mt.trim()), e.key === "Escape" && Ye(!1);
4595
4595
  },
4596
4596
  placeholder: 'Ask in plain language — "over 50k in Zone 1 still waiting on approval"',
4597
4597
  className: "h-8 flex-1 rounded-md border border-slate-200 bg-white px-3 text-[12.5px] outline-none focus:border-nvr-cyan/50 focus:ring-2 focus:ring-nvr-cyan/30 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100"
@@ -5008,11 +5008,11 @@ function cu({
5008
5008
  "input",
5009
5009
  {
5010
5010
  autoFocus: !0,
5011
- value: Yt,
5011
+ value: Ht,
5012
5012
  placeholder: "Preset name…",
5013
5013
  onChange: (e) => gn(e.target.value),
5014
5014
  onKeyDown: (e) => {
5015
- e.key === "Enter" && Yt.trim() && (en.mutate(), De(!1)), e.key === "Escape" && De(!1);
5015
+ e.key === "Enter" && Ht.trim() && (en.mutate(), De(!1)), e.key === "Escape" && De(!1);
5016
5016
  },
5017
5017
  className: "h-6 w-full min-w-0 flex-1 rounded border border-slate-200 bg-slate-50 px-1.5 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
5018
5018
  }
@@ -5021,7 +5021,7 @@ function cu({
5021
5021
  "button",
5022
5022
  {
5023
5023
  type: "button",
5024
- disabled: !Yt.trim() || en.isPending,
5024
+ disabled: !Ht.trim() || en.isPending,
5025
5025
  onClick: () => {
5026
5026
  en.mutate(), De(!1);
5027
5027
  },
@@ -5042,7 +5042,7 @@ function cu({
5042
5042
  ]
5043
5043
  }
5044
5044
  ),
5045
- Ht && /* @__PURE__ */ d(
5045
+ Yt && /* @__PURE__ */ d(
5046
5046
  "button",
5047
5047
  {
5048
5048
  type: "button",
@@ -5478,21 +5478,21 @@ ${r}`).then(() => {
5478
5478
  ) : "↺"
5479
5479
  }
5480
5480
  ),
5481
- Ht && /* @__PURE__ */ t(
5482
- Yi,
5481
+ Yt && /* @__PURE__ */ t(
5482
+ Hi,
5483
5483
  {
5484
5484
  name: e.name,
5485
5485
  isDefault: !!e.is_default,
5486
5486
  roleId: e.default_for_role ?? null,
5487
5487
  onCollectionDefault: (a) => Vs.mutate({ id: e.id, on: a }),
5488
- onRoleDefault: (a) => Ys.mutate({ id: e.id, role: a })
5488
+ onRoleDefault: (a) => Hs.mutate({ id: e.id, role: a })
5489
5489
  }
5490
5490
  ),
5491
5491
  /* @__PURE__ */ t(
5492
5492
  "button",
5493
5493
  {
5494
5494
  type: "button",
5495
- onClick: () => Hs.mutate(e.id),
5495
+ onClick: () => Ys.mutate(e.id),
5496
5496
  title: "Delete view",
5497
5497
  "aria-label": `Delete ${e.name}`,
5498
5498
  className: "hover:text-red-500",
@@ -5509,14 +5509,14 @@ ${r}`).then(() => {
5509
5509
  {
5510
5510
  className: "flex items-center gap-1",
5511
5511
  onSubmit: (e) => {
5512
- e.preventDefault(), Yt.trim() && en.mutate();
5512
+ e.preventDefault(), Ht.trim() && en.mutate();
5513
5513
  },
5514
5514
  children: [
5515
5515
  /* @__PURE__ */ t(
5516
5516
  "input",
5517
5517
  {
5518
5518
  autoFocus: !0,
5519
- value: Yt,
5519
+ value: Ht,
5520
5520
  onChange: (e) => gn(e.target.value),
5521
5521
  placeholder: "View name…",
5522
5522
  className: "h-6 w-32 rounded border border-slate-200 bg-slate-50 px-1.5 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
@@ -5526,7 +5526,7 @@ ${r}`).then(() => {
5526
5526
  "button",
5527
5527
  {
5528
5528
  type: "submit",
5529
- disabled: !Yt.trim(),
5529
+ disabled: !Ht.trim(),
5530
5530
  className: "rounded bg-nvr-cyan px-2 py-0.5 text-[11px] font-semibold text-white disabled:opacity-40",
5531
5531
  children: "Save"
5532
5532
  }
@@ -5635,7 +5635,7 @@ ${r}`).then(() => {
5635
5635
  /* @__PURE__ */ t("div", { className: "cbv-progress pointer-events-none absolute inset-x-0 top-0 z-[6] h-[3px] overflow-hidden" }),
5636
5636
  /* @__PURE__ */ t("div", { className: "cbv-overlay nvr-fade-in pointer-events-none absolute inset-0 z-[5] flex items-start justify-center bg-white/40 pt-24 dark:bg-slate-950/35", children: /* @__PURE__ */ d("span", { className: "nvr-pop-in flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300", children: [
5637
5637
  /* @__PURE__ */ t(tr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
5638
- Yr != null ? `Still working — ${Yr}s` : "Loading…"
5638
+ Hr != null ? `Still working — ${Hr}s` : "Loading…"
5639
5639
  ] }) })
5640
5640
  ] }),
5641
5641
  /* @__PURE__ */ t(
@@ -5681,7 +5681,7 @@ ${r}`).then(() => {
5681
5681
  "input",
5682
5682
  {
5683
5683
  type: "checkbox",
5684
- checked: Yn,
5684
+ checked: Hn,
5685
5685
  onChange: to,
5686
5686
  "aria-label": "Select all"
5687
5687
  }
@@ -5890,7 +5890,7 @@ ${r}`).then(() => {
5890
5890
  })
5891
5891
  ] })
5892
5892
  ] }),
5893
- /* @__PURE__ */ t("tbody", { className: "text-[12px] tabular-nums", children: Ur ? Array.from({ length: 12 }, (e, a) => /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 dark:border-slate-800", children: /* @__PURE__ */ t("td", { className: "px-3 py-2", colSpan: de.length + Hn, children: /* @__PURE__ */ t(
5893
+ /* @__PURE__ */ t("tbody", { className: "text-[12px] tabular-nums", children: Ur ? Array.from({ length: 12 }, (e, a) => /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 dark:border-slate-800", children: /* @__PURE__ */ t("td", { className: "px-3 py-2", colSpan: de.length + Yn, children: /* @__PURE__ */ t(
5894
5894
  "span",
5895
5895
  {
5896
5896
  className: "cbv-shimmer block h-3.5 rounded",
@@ -5899,7 +5899,7 @@ ${r}`).then(() => {
5899
5899
  ) }) }, a)) : pe.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
5900
5900
  "td",
5901
5901
  {
5902
- colSpan: de.length + Hn,
5902
+ colSpan: de.length + Yn,
5903
5903
  className: "nvr-fade-in py-16",
5904
5904
  children: (() => {
5905
5905
  const e = Q.length === 0 && Object.keys(je).length === 0 && !Object.values(yt).some((r) => r.length > 0) && !D, a = M == null ? void 0 : M.empty_state;
@@ -5929,19 +5929,19 @@ ${r}`).then(() => {
5929
5929
  }
5930
5930
  ) }),
5931
5931
  /* @__PURE__ */ t("p", { className: "text-[13.5px] font-medium text-slate-600 dark:text-slate-300", children: "No records match" }),
5932
- Le === 0 && (Ya ?? 0) > 0 ? /* @__PURE__ */ d(
5932
+ Le === 0 && (Ha ?? 0) > 0 ? /* @__PURE__ */ d(
5933
5933
  "p",
5934
5934
  {
5935
5935
  className: "max-w-[52ch] text-[12px] text-slate-600 dark:text-slate-300",
5936
- "data-cbv-default-hiding": Ya,
5936
+ "data-cbv-default-hiding": Ha,
5937
5937
  children: [
5938
5938
  "Your default",
5939
5939
  " ",
5940
5940
  $a.map((r) => r.label).join(" and "),
5941
5941
  " filter is hiding ",
5942
- lt(Ya ?? 0),
5942
+ lt(Ha ?? 0),
5943
5943
  " record",
5944
- Ya === 1 ? "" : "s",
5944
+ Ha === 1 ? "" : "s",
5945
5945
  " ·",
5946
5946
  " ",
5947
5947
  /* @__PURE__ */ t(
@@ -5971,7 +5971,7 @@ ${r}`).then(() => {
5971
5971
  })()
5972
5972
  }
5973
5973
  ) }) : oo.map((e, a) => {
5974
- var Y;
5974
+ var H;
5975
5975
  const r = { animationDelay: `${Math.min(a, 14) * 16}ms` };
5976
5976
  if (e.kind === "header")
5977
5977
  return /* @__PURE__ */ t(
@@ -5987,7 +5987,7 @@ ${r}`).then(() => {
5987
5987
  "td",
5988
5988
  {
5989
5989
  className: "px-3 py-1.5",
5990
- colSpan: de.length + Hn,
5990
+ colSpan: de.length + Yn,
5991
5991
  children: /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-200", children: [
5992
5992
  /* @__PURE__ */ t(
5993
5993
  Fa,
@@ -6003,7 +6003,7 @@ ${r}`).then(() => {
6003
6003
  },
6004
6004
  `__group__${e.gkey}`
6005
6005
  );
6006
- const l = e.row, s = l.id, c = Qt.includes(s), m = (Y = Ne == null ? void 0 : Ne.instances) == null ? void 0 : Y[String(s)], R = Rs[String(s)], P = Kn == null ? void 0 : Kn[String(s)], Se = Ls.get(String(s)) ?? null, X = Ps(n, s), Re = !c && R ? ci(R.color) : void 0, V = c ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Re ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6006
+ const l = e.row, s = l.id, c = Qt.includes(s), m = (H = Ne == null ? void 0 : Ne.instances) == null ? void 0 : H[String(s)], R = Rs[String(s)], P = Kn == null ? void 0 : Kn[String(s)], Se = Ls.get(String(s)) ?? null, X = Ps(n, s), Re = !c && R ? ci(R.color) : void 0, V = c ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Re ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6007
6007
  return /* @__PURE__ */ d(
6008
6008
  "tr",
6009
6009
  {
@@ -6011,7 +6011,7 @@ ${r}`).then(() => {
6011
6011
  onClick: () => ha(s),
6012
6012
  onMouseEnter: () => Zs(s),
6013
6013
  "data-row-key": String(s),
6014
- title: Nt.titleFor(String(s)) ?? (Se && !Se.is_mine ? Ho(Se) : void 0) ?? (R ? `At risk — ${R.rule}` : void 0) ?? (X ? hd : void 0),
6014
+ title: Nt.titleFor(String(s)) ?? (Se && !Se.is_mine ? Yo(Se) : void 0) ?? (R ? `At risk — ${R.rule}` : void 0) ?? (X ? hd : void 0),
6015
6015
  "data-picker-excluded": X ? "" : void 0,
6016
6016
  style: r,
6017
6017
  className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${c ? "bg-nvr-cyan/[0.08]" : Re ?? ""} ${X ? bd : ""}`,
@@ -6029,10 +6029,10 @@ ${r}`).then(() => {
6029
6029
  isNew: Nt.isNew(String(s)),
6030
6030
  dataAttr: "data-cbv-live-mark"
6031
6031
  }
6032
- ) : Hr[jl(n, String(s))] ? /* @__PURE__ */ t(
6032
+ ) : Yr[jl(n, String(s))] ? /* @__PURE__ */ t(
6033
6033
  kd,
6034
6034
  {
6035
- viewers: Hr[jl(n, String(s))],
6035
+ viewers: Yr[jl(n, String(s))],
6036
6036
  dataAttr: "data-cbv-presence"
6037
6037
  }
6038
6038
  ) : /* @__PURE__ */ t(Ql, { change: P, dataAttr: "data-cbv-unseen" }),
@@ -6332,7 +6332,7 @@ ${r}`).then(() => {
6332
6332
  {
6333
6333
  className: zt(
6334
6334
  "text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
6335
- ln(l[p], Et[p]) && Yl[ln(l[p], Et[p])]
6335
+ ln(l[p], Et[p]) && Hl[ln(l[p], Et[p])]
6336
6336
  ),
6337
6337
  children: ga(String(l[p]), ne[p])
6338
6338
  }
@@ -6341,10 +6341,10 @@ ${r}`).then(() => {
6341
6341
  {
6342
6342
  className: zt(
6343
6343
  "text-[12px]",
6344
- Yl[ln(l[p], Et[p])]
6344
+ Hl[ln(l[p], Et[p])]
6345
6345
  ),
6346
6346
  children: /* @__PURE__ */ t(
6347
- Hl,
6347
+ Yl,
6348
6348
  {
6349
6349
  collection: n,
6350
6350
  field: p,
@@ -6355,7 +6355,7 @@ ${r}`).then(() => {
6355
6355
  )
6356
6356
  }
6357
6357
  ) : /* @__PURE__ */ t(
6358
- Hl,
6358
+ Yl,
6359
6359
  {
6360
6360
  collection: n,
6361
6361
  field: p,
@@ -6495,16 +6495,16 @@ ${r}`).then(() => {
6495
6495
  )
6496
6496
  }
6497
6497
  ),
6498
- Ye != null && Ye.length ? /* @__PURE__ */ t(
6498
+ He != null && He.length ? /* @__PURE__ */ t(
6499
6499
  xd,
6500
6500
  {
6501
- collection: Ye[0].collection,
6502
- itemId: Ye[0].itemId,
6501
+ collection: He[0].collection,
6502
+ itemId: He[0].itemId,
6503
6503
  width: "85%",
6504
- stack: Ye,
6505
- onPush: (e) => it.push([...Ye, e]),
6504
+ stack: He,
6505
+ onPush: (e) => it.push([...He, e]),
6506
6506
  onPop: () => it.back(),
6507
- onClose: () => it.back(Ye.length)
6507
+ onClose: () => it.back(He.length)
6508
6508
  }
6509
6509
  ) : null,
6510
6510
  ka && /* @__PURE__ */ t(
@@ -6518,7 +6518,7 @@ ${r}`).then(() => {
6518
6518
  }
6519
6519
  }
6520
6520
  ),
6521
- Tt && dt && Yn && !se && Le > pe.length && Qt.length < Math.min(Le, an) && /* @__PURE__ */ d("div", { className: "nvr-slide-up-centered fixed bottom-16 left-1/2 z-40 -translate-x-1/2 rounded-full border border-slate-200 bg-white px-4 py-2 text-[12.5px] shadow-lg dark:border-border dark:bg-card", children: [
6521
+ Tt && dt && Hn && !se && Le > pe.length && Qt.length < Math.min(Le, an) && /* @__PURE__ */ d("div", { className: "nvr-slide-up-centered fixed bottom-16 left-1/2 z-40 -translate-x-1/2 rounded-full border border-slate-200 bg-white px-4 py-2 text-[12.5px] shadow-lg dark:border-border dark:bg-card", children: [
6522
6522
  /* @__PURE__ */ d("span", { className: "text-slate-600 dark:text-muted-foreground", children: [
6523
6523
  "All ",
6524
6524
  pe.length,
@@ -6553,7 +6553,7 @@ ${r}`).then(() => {
6553
6553
  }
6554
6554
  );
6555
6555
  }
6556
- function Yd(n, o, h, i) {
6556
+ function Hd(n, o, h, i) {
6557
6557
  const x = as(o, n, h);
6558
6558
  if (x != null && x.one_collection) return /* @__PURE__ */ t(pr, { relatedCollection: x.one_collection, id: i });
6559
6559
  if (typeof i == "boolean") return i ? "Yes" : "No";
@@ -6565,7 +6565,7 @@ export {
6565
6565
  cu as CollectionBrowserView,
6566
6566
  mn as MultiPick,
6567
6567
  Rd as RowActionsMenu,
6568
- Yl as TINT_TEXT,
6568
+ Hl as TINT_TEXT,
6569
6569
  dn as invalidateCbvRowQueries,
6570
6570
  Fd as roleMayDelete,
6571
6571
  ln as tintFor
@@ -40,7 +40,7 @@ function S(a, d) {
40
40
  [i]
41
41
  );
42
42
  }
43
- const y = "Excluded from pickers — not offered in any dropdown. Actions → Include in pickers to offer it again.", h = [
43
+ const h = "Hidden from pickers — not offered in any dropdown. Actions → Show in pickers to offer it again.", y = [
44
44
  "[&>td]:italic [&>td_*]:italic",
45
45
  "[&>td]:!text-slate-500 [&>td_a]:!text-slate-500 [&>td_button]:!text-slate-500",
46
46
  "dark:[&>td]:!text-slate-400 dark:[&>td_a]:!text-slate-400 dark:[&>td_button]:!text-slate-400",
@@ -48,8 +48,8 @@ const y = "Excluded from pickers — not offered in any dropdown. Actions → In
48
48
  "dark:[&>td]:bg-[repeating-linear-gradient(135deg,rgb(148_163_184/0.10)_0_1px,transparent_1px_6px)]"
49
49
  ].join(" ");
50
50
  export {
51
- h as PICKER_EXCLUDED_ROW_CLASS,
52
- y as PICKER_EXCLUDED_TITLE,
51
+ y as PICKER_EXCLUDED_ROW_CLASS,
52
+ h as PICKER_EXCLUDED_TITLE,
53
53
  m as PICKER_EXCLUSIONS_PAGE_KEY,
54
54
  S as usePickerExcludedRows
55
55
  };
@@ -1,23 +1,23 @@
1
1
  import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
2
  import { useQueryClient as D, useQuery as I, useMutation as q } from "@tanstack/react-query";
3
- import { Loader2 as K, EyeOff as L, CalendarClock as Q, ChevronsUpDown as R, Check as j } from "lucide-react";
3
+ import { Loader2 as K, EyeOff as L, CalendarClock as Q, ChevronsUpDown as j, Check as H } from "lucide-react";
4
4
  import { useState as m, useId as A, useMemo as B } from "react";
5
- import { toast as g } from "sonner";
5
+ import { toast as x } from "sonner";
6
6
  import { useNivaroClient as F } from "../../context.js";
7
7
  import { get as M, post as O } from "../../lib/commands.js";
8
8
  import { titleCase as U, cn as V } from "../../lib/utils.js";
9
9
  import { PICKER_EXCLUSIONS_PAGE_KEY as W } from "../PickerExcludedRows.js";
10
10
  import { Button as S } from "../ui/button.js";
11
- import { Command as z, CommandInput as G, CommandList as H, CommandEmpty as X, CommandItem as Y } from "../ui/command.js";
11
+ import { Command as z, CommandInput as G, CommandList as R, CommandEmpty as X, CommandItem as Y } from "../ui/command.js";
12
12
  import { Input as w } from "../ui/input.js";
13
13
  import { Popover as E, PopoverTrigger as _, PopoverContent as P } from "../ui/popover.js";
14
14
  function $(a, r) {
15
15
  return a instanceof Error && a.message ? a.message : r;
16
16
  }
17
17
  function J(a, r, l = {}) {
18
- const s = F(), o = D(), h = ["picker-exclusion", a, r], { data: c, isLoading: p } = I({
18
+ const o = F(), s = D(), h = ["picker-exclusion", a, r], { data: c, isLoading: p } = I({
19
19
  queryKey: h,
20
- queryFn: () => s.request(
20
+ queryFn: () => o.request(
21
21
  M(`/picker-exclusions/status/${a}/${r}`)
22
22
  ).then((i) => i.data),
23
23
  enabled: l.enabled ?? !0,
@@ -25,15 +25,15 @@ function J(a, r, l = {}) {
25
25
  }), d = (c == null ? void 0 : c.excluded) ?? !1, u = q({
26
26
  mutationFn: () => {
27
27
  const i = { collection: a, item_id: r, layout: l.layoutSlug ?? null };
28
- return s.request(
28
+ return o.request(
29
29
  d ? { _method: "DELETE", _path: "/picker-exclusions", _body: i } : O("/picker-exclusions", i)
30
30
  );
31
31
  },
32
32
  onSuccess: () => {
33
33
  var i;
34
- o.invalidateQueries({ queryKey: h }), o.invalidateQueries({ queryKey: [W, a] }), g.success(d ? "Record re-enabled in pickers" : "Record excluded from pickers"), (i = l.onDone) == null || i.call(l);
34
+ s.invalidateQueries({ queryKey: h }), s.invalidateQueries({ queryKey: [W, a] }), x.success(d ? "Shown in pickers again" : "Hidden from pickers"), (i = l.onDone) == null || i.call(l);
35
35
  },
36
- onError: (i) => g.error($(i, "Could not change picker visibility"))
36
+ onError: (i) => x.error($(i, "Could not change picker visibility"))
37
37
  });
38
38
  return { excluded: d, isLoading: p, toggle: u };
39
39
  }
@@ -42,20 +42,20 @@ function me({
42
42
  itemId: r,
43
43
  layoutSlug: l
44
44
  }) {
45
- const { excluded: s, toggle: o } = J(a, r, { layoutSlug: l });
45
+ const { excluded: o, toggle: s } = J(a, r, { layoutSlug: l });
46
46
  return /* @__PURE__ */ n(
47
47
  "button",
48
48
  {
49
49
  type: "button",
50
50
  "data-record-picker-exclusion": !0,
51
- "data-excluded": s ? "true" : "false",
52
- disabled: o.isPending,
53
- onClick: () => o.mutate(),
54
- "data-tip": s ? "This record is hidden from pickers — click to offer it again" : "Hide this record from every picker that would offer it",
51
+ "data-excluded": o ? "true" : "false",
52
+ disabled: s.isPending,
53
+ onClick: () => s.mutate(),
54
+ "data-tip": o ? "This record is hidden from pickers — click to offer it again" : "Hide this record from every picker that would offer it",
55
55
  className: "inline-flex items-center",
56
56
  children: [
57
- o.isPending ? /* @__PURE__ */ t(K, { className: "animate-spin" }) : /* @__PURE__ */ t(L, {}),
58
- s ? "Re-enable in pickers" : "Disable in pickers"
57
+ s.isPending ? /* @__PURE__ */ t(K, { className: "animate-spin" }) : /* @__PURE__ */ t(L, {}),
58
+ o ? "Show in pickers" : "Hide from pickers"
59
59
  ]
60
60
  }
61
61
  );
@@ -64,13 +64,13 @@ function he({
64
64
  collection: a,
65
65
  itemId: r,
66
66
  fields: l,
67
- layoutSlug: s
67
+ layoutSlug: o
68
68
  }) {
69
- const o = F(), [h, c] = m(!1), [p, d] = m(!1), [u, i] = m(""), [b, N] = m(""), [f, C] = m(""), x = A(), k = B(
69
+ const s = F(), [h, c] = m(!1), [p, d] = m(!1), [u, i] = m(""), [b, N] = m(""), [f, C] = m(""), g = A(), k = B(
70
70
  () => l.filter((e) => !e.field.startsWith("__") && !e.field.includes(".")).map((e) => ({ field: e.field, label: e.label || U(e.field) })),
71
71
  [l]
72
72
  ), y = k.find((e) => e.field === u), v = q({
73
- mutationFn: () => o.request(
73
+ mutationFn: () => s.request(
74
74
  O("/scheduled-changes", {
75
75
  collection: a,
76
76
  item_id: r,
@@ -78,13 +78,13 @@ function he({
78
78
  changes: { [u]: b },
79
79
  // datetime-local is the viewer's local time; the API stores UTC.
80
80
  scheduled_at: new Date(f).toISOString(),
81
- layout: s ?? null
81
+ layout: o ?? null
82
82
  })
83
83
  ),
84
84
  onSuccess: () => {
85
- c(!1), i(""), N(""), C(""), g.success("Change scheduled");
85
+ c(!1), i(""), N(""), C(""), x.success("Change scheduled");
86
86
  },
87
- onError: (e) => g.error($(e, "Could not schedule the change"))
87
+ onError: (e) => x.error($(e, "Could not schedule the change"))
88
88
  }), T = f !== "" && !Number.isNaN(new Date(f).getTime());
89
89
  return /* @__PURE__ */ n(E, { open: h, onOpenChange: c, children: [
90
90
  /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ n(
@@ -117,13 +117,13 @@ function he({
117
117
  className: "h-8 w-full justify-between text-[12px] font-normal",
118
118
  children: [
119
119
  /* @__PURE__ */ t("span", { className: "truncate", children: (y == null ? void 0 : y.label) ?? "Select a field…" }),
120
- /* @__PURE__ */ t(R, { className: "ml-1 h-3 w-3 shrink-0 opacity-50" })
120
+ /* @__PURE__ */ t(j, { className: "ml-1 h-3 w-3 shrink-0 opacity-50" })
121
121
  ]
122
122
  }
123
123
  ) }),
124
124
  /* @__PURE__ */ t(P, { className: "w-[--radix-popover-trigger-width] p-0", align: "start", children: /* @__PURE__ */ n(z, { children: [
125
125
  /* @__PURE__ */ t(G, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
126
- /* @__PURE__ */ n(H, { children: [
126
+ /* @__PURE__ */ n(R, { children: [
127
127
  /* @__PURE__ */ t(X, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field matches" }),
128
128
  k.map((e) => /* @__PURE__ */ n(
129
129
  Y,
@@ -135,7 +135,7 @@ function he({
135
135
  className: "text-[12px]",
136
136
  children: [
137
137
  /* @__PURE__ */ t(
138
- j,
138
+ H,
139
139
  {
140
140
  className: V(
141
141
  "mr-2 h-3.5 w-3.5",
@@ -157,7 +157,7 @@ function he({
157
157
  /* @__PURE__ */ t(
158
158
  "label",
159
159
  {
160
- htmlFor: `${x}-value`,
160
+ htmlFor: `${g}-value`,
161
161
  className: "mb-1 block text-[11px] font-medium text-muted-foreground",
162
162
  children: "New value"
163
163
  }
@@ -165,7 +165,7 @@ function he({
165
165
  /* @__PURE__ */ t(
166
166
  w,
167
167
  {
168
- id: `${x}-value`,
168
+ id: `${g}-value`,
169
169
  value: b,
170
170
  onChange: (e) => N(e.target.value),
171
171
  className: "h-8 text-[12px]"
@@ -176,7 +176,7 @@ function he({
176
176
  /* @__PURE__ */ t(
177
177
  "label",
178
178
  {
179
- htmlFor: `${x}-at`,
179
+ htmlFor: `${g}-at`,
180
180
  className: "mb-1 block text-[11px] font-medium text-muted-foreground",
181
181
  children: "When"
182
182
  }
@@ -184,7 +184,7 @@ function he({
184
184
  /* @__PURE__ */ t(
185
185
  w,
186
186
  {
187
- id: `${x}-at`,
187
+ id: `${g}-at`,
188
188
  type: "datetime-local",
189
189
  value: f,
190
190
  onChange: (e) => C(e.target.value),
@@ -203,7 +203,7 @@ const y = [
203
203
  {
204
204
  key: "layout.allow_disable_pickers",
205
205
  section: "buttons",
206
- label: "Hide-from-pickers button for everyone",
206
+ label: "Hide from pickers button for everyone",
207
207
  effect: "Everyone who can edit may hide a record from pickers, not only admins.",
208
208
  types: t
209
209
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.3.40",
3
+ "version": "0.3.41",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",