@nivaro/react 0.3.109 → 0.3.111

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.
@@ -10,7 +10,7 @@ import { noteReplayEvent as Fe, createReplayCheckoutState as Me } from "../share
10
10
  import { emitReplayTap as Ne, setReplayRecorderMode as O, registerReplayCapture as Oe, clipEndOffset as Ue, withClipKind as We } from "../shared/lib/replay-capture.js";
11
11
  import { instrumentConsole as He, instrumentRequests as Ke, redactSecrets as $e } from "../shared/lib/replay-context.js";
12
12
  import { instrumentSocket as Be } from "../shared/lib/replay-socket.js";
13
- const ze = "nivaro-react@0.3.109", Q = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, V = () => typeof navigator > "u" || navigator.onLine !== !1;
13
+ const ze = "nivaro-react@0.3.111", Q = 1e4, Ye = 150, xe = 3e3, je = 600, Ge = (o) => `nvr_replay_resume${o ? `:${o}` : ""}`, V = () => typeof navigator > "u" || navigator.onLine !== !1;
14
14
  function Je(o) {
15
15
  return typeof o.url != "string" || typeof fetch != "function" ? null : (f, u) => {
16
16
  const l = typeof o.getToken == "function" ? o.getToken() : void 0, d = { "Content-Type": "application/json" };
@@ -6145,7 +6145,7 @@ ${r.join(`
6145
6145
  {
6146
6146
  "data-form-sticky": o ? "" : void 0,
6147
6147
  "data-form-width": r ? "half" : void 0,
6148
- className: o ? "md:sticky md:top-[var(--nvr-sticky-top,0px)] md:z-20" : r ? "min-w-0" : void 0,
6148
+ className: o ? "md:sticky md:top-[var(--nvr-sticky-top,0px)] md:z-20" : r ? "flex min-w-0 flex-col [&>[data-section-key]:not([data-collapsed])]:flex-1" : void 0,
6149
6149
  children: s
6150
6150
  },
6151
6151
  t
@@ -6795,8 +6795,8 @@ ${r.join(`
6795
6795
  "data-form-row": "",
6796
6796
  "data-form-row-cols": Au ? 2 : 1,
6797
6797
  className: Pe(
6798
- "grid items-start gap-4 [&>:empty]:hidden",
6799
- Au ? "grid-cols-2" : "grid-cols-1"
6798
+ "grid gap-4 [&>:empty]:hidden",
6799
+ Au ? "grid-cols-2 items-stretch" : "grid-cols-1 items-start"
6800
6800
  ),
6801
6801
  children: s.items.map((l, d) => Do(l, t(l, d), e, !0))
6802
6802
  },
@@ -1,55 +1,62 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { useState as g, useRef as v, useEffect as m, useLayoutEffect as b } from "react";
3
- import { createPortal as E } from "react-dom";
4
- const c = [], L = '[data-nvr-header-menu-panel], [role="menu"]', x = 6;
5
- function A() {
6
- const [e, o] = g(null), [r, u] = g(!1), f = v(null);
7
- return m(() => (c.push(u), c[0] === u && u(!0), () => {
8
- var t;
9
- const i = c.indexOf(u);
10
- i < 0 || (c.splice(i, 1), i === 0 && ((t = c[0]) == null || t.call(c, !0)));
11
- }), []), m(() => {
12
- if (!r) return;
13
- const i = (l) => {
14
- var w, p;
15
- const n = (p = (w = l.target) == null ? void 0 : w.closest) == null ? void 0 : p.call(w, "[data-tip]"), s = n == null ? void 0 : n.getAttribute("data-tip");
16
- if (!n || !s || n.getAttribute("aria-expanded") === "true") {
17
- o((a) => a && null);
1
+ import { jsx as L } from "react/jsx-runtime";
2
+ import { useState as g, useRef as y, useEffect as x, useLayoutEffect as E } from "react";
3
+ import { createPortal as M } from "react-dom";
4
+ const a = [], R = '[data-nvr-header-menu-panel], [role="menu"]', b = 6;
5
+ function T() {
6
+ const [e, d] = g(null), [o, f] = g(!1), p = y(null);
7
+ return x(() => (a.push(f), a[0] === f && f(!0), () => {
8
+ var n;
9
+ const s = a.indexOf(f);
10
+ s < 0 || (a.splice(s, 1), s === 0 && ((n = a[0]) == null || n.call(a, !0)));
11
+ }), []), x(() => {
12
+ if (!o) return;
13
+ const s = (i) => {
14
+ var v;
15
+ const t = (v = i == null ? void 0 : i.closest) == null ? void 0 : v.call(i, "[data-tip]"), r = t == null ? void 0 : t.getAttribute("data-tip");
16
+ if (!t || !r || t.getAttribute("aria-expanded") === "true") {
17
+ d((h) => h && null);
18
18
  return;
19
19
  }
20
- const d = n.getBoundingClientRect(), h = n.closest(L);
21
- if (h && h !== n) {
22
- const a = h.getBoundingClientRect();
23
- o({
24
- x: a.left,
25
- y: d.top,
26
- text: s,
27
- beside: { left: a.left, right: a.right, rowTop: d.top, rowHeight: d.height }
20
+ const l = t.getBoundingClientRect(), m = t.closest(R);
21
+ if (m && m !== t) {
22
+ const h = m.getBoundingClientRect();
23
+ d({
24
+ x: h.left,
25
+ y: l.top,
26
+ text: r,
27
+ beside: { left: h.left, right: h.right, rowTop: l.top, rowHeight: l.height }
28
28
  });
29
29
  return;
30
30
  }
31
- o({ x: d.left, y: d.bottom + 4, text: s });
32
- }, t = () => o(null);
33
- return window.addEventListener("mouseover", i), window.addEventListener("pointerdown", t, !0), window.addEventListener("scroll", t, !0), () => {
34
- window.removeEventListener("mouseover", i), window.removeEventListener("pointerdown", t, !0), window.removeEventListener("scroll", t, !0);
31
+ d({ x: l.left, y: l.bottom + 4, text: r });
32
+ }, n = (i) => s(i.target), u = () => d(null), c = (i) => {
33
+ var r, l;
34
+ const t = (l = (r = i.target) == null ? void 0 : r.closest) == null ? void 0 : l.call(r, "[data-tip-focus]");
35
+ t && s(t);
36
+ }, w = (i) => {
37
+ var t, r;
38
+ (r = (t = i.target) == null ? void 0 : t.closest) != null && r.call(t, "[data-tip-focus]") && d(null);
35
39
  };
36
- }, [r]), b(() => {
40
+ return window.addEventListener("mouseover", n), window.addEventListener("focusin", c), window.addEventListener("focusout", w), window.addEventListener("pointerdown", u, !0), window.addEventListener("scroll", u, !0), () => {
41
+ window.removeEventListener("mouseover", n), window.removeEventListener("focusin", c), window.removeEventListener("focusout", w), window.removeEventListener("pointerdown", u, !0), window.removeEventListener("scroll", u, !0);
42
+ };
43
+ }, [o]), E(() => {
37
44
  if (!e) return;
38
- const i = f.current;
39
- if (!i) return;
40
- const t = i.getBoundingClientRect();
41
- let { x: l, y: n } = e;
45
+ const s = p.current;
46
+ if (!s) return;
47
+ const n = s.getBoundingClientRect();
48
+ let { x: u, y: c } = e;
42
49
  if (e.beside) {
43
- const s = e.beside, d = s.left - x - t.width;
44
- l = d >= 8 ? d : Math.min(s.right + x, Math.max(8, window.innerWidth - t.width - 8)), n = Math.round(s.rowTop + (s.rowHeight - t.height) / 2), n = Math.max(8, Math.min(n, window.innerHeight - t.height - 8));
50
+ const w = e.beside, i = w.left - b - n.width;
51
+ u = i >= 8 ? i : Math.min(w.right + b, Math.max(8, window.innerWidth - n.width - 8)), c = Math.round(w.rowTop + (w.rowHeight - n.height) / 2), c = Math.max(8, Math.min(c, window.innerHeight - n.height - 8));
45
52
  } else
46
- t.right > window.innerWidth - 8 && (l = Math.max(8, window.innerWidth - t.width - 8)), t.bottom > window.innerHeight - 8 && (n = Math.max(8, e.y - t.height - 30));
47
- (l !== e.x || n !== e.y) && o({ ...e, x: l, y: n });
48
- }, [e]), !r || !e ? null : E(
49
- /* @__PURE__ */ y(
53
+ n.right > window.innerWidth - 8 && (u = Math.max(8, window.innerWidth - n.width - 8)), n.bottom > window.innerHeight - 8 && (c = Math.max(8, e.y - n.height - 30));
54
+ (u !== e.x || c !== e.y) && d({ ...e, x: u, y: c });
55
+ }, [e]), !o || !e ? null : M(
56
+ /* @__PURE__ */ L(
50
57
  "div",
51
58
  {
52
- ref: f,
59
+ ref: p,
53
60
  style: { position: "fixed", left: e.x, top: e.y, zIndex: 120 },
54
61
  className: "pointer-events-none max-w-[340px] whitespace-pre-wrap break-words rounded-md bg-[#0f172a] px-2 py-1 text-[11px] font-medium leading-snug text-white shadow-lg dark:bg-[#334155] dark:ring-1 dark:ring-white/10",
55
62
  children: e.text
@@ -58,20 +65,20 @@ function A() {
58
65
  document.body
59
66
  );
60
67
  }
61
- function O(e) {
62
- const o = v(null);
63
- return b(() => {
64
- const r = o.current;
65
- if (!r) return;
66
- const u = () => {
67
- (r.scrollWidth > r.clientWidth + 1 || r.scrollHeight > r.clientHeight + 1) && e ? r.setAttribute("data-tip", e) : r.removeAttribute("data-tip");
68
+ function W(e) {
69
+ const d = y(null);
70
+ return E(() => {
71
+ const o = d.current;
72
+ if (!o) return;
73
+ const f = () => {
74
+ (o.scrollWidth > o.clientWidth + 1 || o.scrollHeight > o.clientHeight + 1) && e ? o.setAttribute("data-tip", e) : o.removeAttribute("data-tip");
68
75
  };
69
- if (u(), typeof ResizeObserver > "u") return;
70
- const f = new ResizeObserver(u);
71
- return f.observe(r), () => f.disconnect();
72
- }, [e]), o;
76
+ if (f(), typeof ResizeObserver > "u") return;
77
+ const p = new ResizeObserver(f);
78
+ return p.observe(o), () => p.disconnect();
79
+ }, [e]), d;
73
80
  }
74
81
  export {
75
- A as TipLayer,
76
- O as useOverflowTip
82
+ T as TipLayer,
83
+ W as useOverflowTip
77
84
  };
@@ -536,7 +536,7 @@ function bn({
536
536
  return M != null && M !== "" && !(Array.isArray(M) && M.length === 0);
537
537
  }) : O;
538
538
  if (c.length === 0) return null;
539
- const x = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", S = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", D = "text-[12px] text-slate-300 dark:text-slate-600", R = "flex items-baseline gap-1.5", pe = (_) => {
539
+ const x = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", S = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", D = "text-[12px] text-slate-300 dark:text-slate-600", z = "flex items-baseline gap-1.5", pe = (_) => {
540
540
  if (_ === "__owners__") {
541
541
  const u = (m == null ? void 0 : m.label_override) || "Owners";
542
542
  return /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5", children: [
@@ -589,14 +589,14 @@ function bn({
589
589
  } else
590
590
  I = B.toLocaleString(void 0, { maximumFractionDigits: 2 });
591
591
  }
592
- return /* @__PURE__ */ y("div", { className: R, children: [
592
+ return /* @__PURE__ */ y("div", { className: z, children: [
593
593
  /* @__PURE__ */ e("span", { className: x, children: T }),
594
594
  /* @__PURE__ */ e("span", { className: S, children: I })
595
595
  ] });
596
596
  }
597
597
  if (d && _ in d) {
598
598
  const u = d[_];
599
- return /* @__PURE__ */ y("div", { className: R, children: [
599
+ return /* @__PURE__ */ y("div", { className: z, children: [
600
600
  /* @__PURE__ */ e("span", { className: x, children: C }),
601
601
  /* @__PURE__ */ y("span", { className: S, children: [
602
602
  u,
@@ -607,7 +607,7 @@ function bn({
607
607
  }
608
608
  if (F && _ in F) {
609
609
  const u = F[_];
610
- return /* @__PURE__ */ y("div", { className: R, children: [
610
+ return /* @__PURE__ */ y("div", { className: z, children: [
611
611
  /* @__PURE__ */ e("span", { className: x, children: C }),
612
612
  /* @__PURE__ */ y("span", { className: S, children: [
613
613
  u,
@@ -621,14 +621,14 @@ function bn({
621
621
  );
622
622
  if (P != null && P.one_collection) {
623
623
  const u = Array.isArray(q) ? q : q != null && q !== "" ? [q] : [];
624
- return /* @__PURE__ */ y("div", { className: R, children: [
624
+ return /* @__PURE__ */ y("div", { className: z, children: [
625
625
  /* @__PURE__ */ e("span", { className: x, children: C }),
626
626
  u.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : P.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: u.map((T) => /* @__PURE__ */ e(nt, { userId: String(T) }, String(T))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: u.map((T) => /* @__PURE__ */ e(re, { relCollection: P.one_collection, id: T }, String(T))) })
627
627
  ] });
628
628
  }
629
629
  if (Array.isArray(q)) {
630
630
  const u = a.find((B) => B.many_field === _ && B.junction_field), T = u == null ? void 0 : u.one_collection;
631
- return /* @__PURE__ */ y("div", { className: R, children: [
631
+ return /* @__PURE__ */ y("div", { className: z, children: [
632
632
  /* @__PURE__ */ e("span", { className: x, children: C }),
633
633
  q.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : T ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: q.map(
634
634
  (B) => T === "nivaro_users" ? /* @__PURE__ */ e(nt, { userId: String(B) }, String(B)) : /* @__PURE__ */ e(re, { relCollection: T, id: B }, String(B))
@@ -639,7 +639,7 @@ function bn({
639
639
  ] })
640
640
  ] });
641
641
  }
642
- return /* @__PURE__ */ y("div", { className: R, children: [
642
+ return /* @__PURE__ */ y("div", { className: z, children: [
643
643
  /* @__PURE__ */ e("span", { className: x, children: C }),
644
644
  q == null || q === "" ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : /* @__PURE__ */ e("span", { className: S, children: Fe(q, H) })
645
645
  ] });
@@ -673,7 +673,7 @@ const zn = It(function({
673
673
  isOpen: x,
674
674
  onToggle: S,
675
675
  summaryFields: D,
676
- m2mCounts: R,
676
+ m2mCounts: z,
677
677
  o2mCounts: pe,
678
678
  o2mAggValues: _,
679
679
  summaryAggConfigs: M,
@@ -708,14 +708,14 @@ const zn = It(function({
708
708
  }, [Z == null ? void 0 : Z.seq]), ne(() => {
709
709
  X && At(X.target) === t.key && xe(!1);
710
710
  }, [X == null ? void 0 : X.seq]);
711
- const Ie = S !== void 0, z = Te ?? (Ie ? !x : ht);
711
+ const Ie = S !== void 0, V = Te ?? (Ie ? !x : ht);
712
712
  ne(() => {
713
- ie && !z && (se == null || se(t.key));
714
- }, [ie, z, se, t.key]);
713
+ ie && !V && (se == null || se(t.key));
714
+ }, [ie, V, se, t.key]);
715
715
  const ge = Te !== null ? () => xe((f) => !f) : Ie ? S : () => ft((f) => !f), Me = !j && I != null, ye = () => {
716
716
  Me && ot({ layoutId: Number(I), collection: r, kind: "opened", key: t.key });
717
717
  }, gt = () => {
718
- z && ye(), ge == null || ge();
718
+ V && ye(), ge == null || ge();
719
719
  }, yt = !g && i.some((f) => m[f.field]), Pe = j ? "always" : t.visibility_mode ?? "always";
720
720
  if (Pe === "new_only" && !O || Pe === "existing_only" && O) return null;
721
721
  const ee = A ?? [], _t = !O && ee.some((f) => f.widget_id != null && Be[f.field] === void 0);
@@ -740,6 +740,7 @@ const zn = It(function({
740
740
  {
741
741
  "data-loads-on-open": ie ? "" : void 0,
742
742
  "data-section-key": t.key,
743
+ "data-collapsed": V ? "" : void 0,
743
744
  className: E(
744
745
  "nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
745
746
  g && "bg-slate-50/60 dark:bg-slate-900/20",
@@ -768,7 +769,7 @@ const zn = It(function({
768
769
  // Round the bottom only when nothing renders below the header — an
769
770
  // expanded body (or collapsed summary strip) square-joins it, and a
770
771
  // rounded hover overlay would leave see-through notches at the seam.
771
- z && !(D && D.length > 0) && "rounded-b-xl"
772
+ V && !(D && D.length > 0) && "rounded-b-xl"
772
773
  ),
773
774
  children: [
774
775
  Ge && /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
@@ -781,7 +782,7 @@ const zn = It(function({
781
782
  "data-design-pass": j ? "" : void 0,
782
783
  className: E(
783
784
  "h-4 w-4 text-slate-400 dark:text-slate-500 transition-transform duration-200",
784
- z && "-rotate-90"
785
+ V && "-rotate-90"
785
786
  )
786
787
  }
787
788
  )
@@ -789,7 +790,7 @@ const zn = It(function({
789
790
  }
790
791
  )
791
792
  ),
792
- z && D && D.length > 0 && /* @__PURE__ */ e(
793
+ V && D && D.length > 0 && /* @__PURE__ */ e(
793
794
  bn,
794
795
  {
795
796
  summaryFields: D,
@@ -801,7 +802,7 @@ const zn = It(function({
801
802
  ownersCollection: C,
802
803
  ownersItemId: q,
803
804
  ownersAssignment: P,
804
- m2mCounts: R,
805
+ m2mCounts: z,
805
806
  o2mCounts: pe,
806
807
  o2mAggValues: _,
807
808
  summaryAggConfigs: M,
@@ -809,7 +810,7 @@ const zn = It(function({
809
810
  hideEmpty: !!t.summary_hide_empty || !!W
810
811
  }
811
812
  ),
812
- z && !ie && t.hide_when_empty && ee.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: ee.filter((f) => f.widget_id != null).map((f) => /* @__PURE__ */ e(
813
+ V && !ie && t.hide_when_empty && ee.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: ee.filter((f) => f.widget_id != null).map((f) => /* @__PURE__ */ e(
813
814
  Qe,
814
815
  {
815
816
  widgetId: f.widget_id,
@@ -823,7 +824,7 @@ const zn = It(function({
823
824
  },
824
825
  f.field
825
826
  )) }),
826
- !z && /* @__PURE__ */ y(
827
+ !V && /* @__PURE__ */ y(
827
828
  "div",
828
829
  {
829
830
  "data-section-body": "",
@@ -903,8 +904,8 @@ const zn = It(function({
903
904
  children: [
904
905
  /* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: U.label || ut(U.field) }),
905
906
  /* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
906
- const k = a[U.field], V = Array.isArray(k) ? k : k != null && k !== "" ? [k] : [];
907
- return V.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: V.map((G) => /* @__PURE__ */ e(pt, { userId: String(G) }, String(G))) });
907
+ const k = a[U.field], J = Array.isArray(k) ? k : k != null && k !== "" ? [k] : [];
908
+ return J.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: J.map((G) => /* @__PURE__ */ e(pt, { userId: String(G) }, String(G))) });
908
909
  })() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: a[U.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: Fe(a[U.field], U) }) })
909
910
  ]
910
911
  },
@@ -965,7 +966,7 @@ const zn = It(function({
965
966
  }
966
967
  if (b._t === "pdf") {
967
968
  if (!I) return null;
968
- const w = b.slot.col_span ?? 12, J = ((Ee = b.slot.label_override) == null ? void 0 : Ee.trim()) || "Generate PDF";
969
+ const w = b.slot.col_span ?? 12, R = ((Ee = b.slot.label_override) == null ? void 0 : Ee.trim()) || "Generate PDF";
969
970
  return K(
970
971
  le("__pdf__"),
971
972
  /* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
@@ -976,21 +977,21 @@ const zn = It(function({
976
977
  layoutId: I,
977
978
  attachField: T ?? null,
978
979
  filenameTemplate: B,
979
- label: J
980
+ label: R
980
981
  }
981
982
  ) }, "__pdf__")
982
983
  );
983
984
  }
984
985
  if (b._t === "widget") {
985
986
  if (!b.slot.widget_id) return null;
986
- const w = b.slot.col_span ?? 12, J = et(b.slot.input_bindings);
987
+ const w = b.slot.col_span ?? 12, R = et(b.slot.input_bindings);
987
988
  return K(
988
989
  le(b.slot.field),
989
990
  /* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
990
991
  Qe,
991
992
  {
992
993
  widgetId: b.slot.widget_id,
993
- inputBindings: J,
994
+ inputBindings: R,
994
995
  itemDraft: a,
995
996
  label: b.slot.label_override ?? void 0,
996
997
  defaultExpanded: b.slot.default_expanded ?? !0,
@@ -1003,14 +1004,14 @@ const zn = It(function({
1003
1004
  ) }, b.slot.field)
1004
1005
  );
1005
1006
  }
1006
- const k = b.f, V = fe == null ? void 0 : fe[k.field], G = V == null ? void 0 : V.entries, kt = (V == null ? void 0 : V.separator) ?? null, oe = a[k.field], Ve = oe != null && oe !== "", Je = G != null && G.length && Ve ? ((We = o.find(
1007
+ const k = b.f, J = fe == null ? void 0 : fe[k.field], G = J == null ? void 0 : J.entries, kt = (J == null ? void 0 : J.separator) ?? null, oe = a[k.field], Ve = oe != null && oe !== "", Je = G != null && G.length && Ve ? ((We = o.find(
1007
1008
  (w) => w.many_collection === r && w.many_field === k.field && !w.junction_field
1008
1009
  )) == null ? void 0 : We.one_collection) ?? null : null, Re = (L == null ? void 0 : L.enabled) && k.field === L.primary_field, ze = (() => {
1009
1010
  const w = a[(L == null ? void 0 : L.primary_field) ?? ""];
1010
1011
  return w != null && w !== "";
1011
1012
  })(), He = (Q ?? []).some((w) => {
1012
- const J = a[w.field];
1013
- return J != null && J !== "";
1013
+ const R = a[w.field];
1014
+ return R != null && R !== "";
1014
1015
  }), St = Re && Oe ? /* @__PURE__ */ y("span", { className: "inline-flex items-center gap-1.5", children: [
1015
1016
  /* @__PURE__ */ e(
1016
1017
  "button",
@@ -1066,8 +1067,8 @@ const zn = It(function({
1066
1067
  }
1067
1068
  )
1068
1069
  ] }) : void 0, $t = Re && je && (Q != null && Q.length) ? /* @__PURE__ */ e("div", { className: "mt-2 rounded-lg border border-slate-200 bg-slate-50 dark:border-border dark:bg-slate-900/40 p-3", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: Q.map((w) => {
1069
- const J = (he == null ? void 0 : he[w.field]) ?? 2;
1070
- return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${J}` }, children: /* @__PURE__ */ e(
1070
+ const R = (he == null ? void 0 : he[w.field]) ?? 2;
1071
+ return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${R}` }, children: /* @__PURE__ */ e(
1071
1072
  Se,
1072
1073
  {
1073
1074
  field: w,
@@ -0,0 +1,73 @@
1
+ import { jsx as d, jsxs as c } from "react/jsx-runtime";
2
+ import { Lock as l } from "lucide-react";
3
+ import { forwardRef as u } from "react";
4
+ import { cn as p } from "../../lib/utils.js";
5
+ import { Button as f } from "../ui/button.js";
6
+ function v(t, r) {
7
+ if (!r || r.length === 0) return t;
8
+ const o = new Set(t.map((e) => String(e.id).toUpperCase())), a = r.filter((e) => e.blocked && !o.has(String(e.id).toUpperCase()));
9
+ if (a.length === 0) return t;
10
+ const n = [...t, ...a], s = (e) => typeof e.sort == "number" ? e.sort : Number.POSITIVE_INFINITY;
11
+ return n.map((e, i) => ({ t: e, i })).sort((e, i) => s(e.t) - s(i.t) || e.i - i.i).map(({ t: e }) => e);
12
+ }
13
+ function w(t) {
14
+ var r;
15
+ return !!((r = t.blocked) != null && r.reason);
16
+ }
17
+ function B(t, r) {
18
+ const o = [...new Set(t.map((a) => {
19
+ var n;
20
+ return ((n = a.blocked) == null ? void 0 : n.reason) ?? "";
21
+ }).filter(Boolean))];
22
+ return o.length <= 1 ? o[0] ?? "" : t.map((a, n) => {
23
+ var s;
24
+ return `${r(n)}: ${((s = a.blocked) == null ? void 0 : s.reason) ?? ""}`;
25
+ }).join(`
26
+ `);
27
+ }
28
+ const M = u(function({ label: r, reason: o, code: a, small: n = !1, className: s }, e) {
29
+ return /* @__PURE__ */ c(
30
+ f,
31
+ {
32
+ ref: e,
33
+ type: "button",
34
+ size: "sm",
35
+ variant: "outline",
36
+ "aria-disabled": !0,
37
+ "aria-description": o,
38
+ "data-tip": o,
39
+ "data-tip-focus": !0,
40
+ "data-move-unavailable": a ?? !0,
41
+ onClick: (i) => i.preventDefault(),
42
+ className: p(k, n ? "h-7 text-[11px]" : "text-[12px]", s),
43
+ children: [
44
+ /* @__PURE__ */ d(l, { className: "h-3 w-3", "aria-hidden": !0 }),
45
+ r
46
+ ]
47
+ }
48
+ );
49
+ }), k = "gap-1.5 cursor-not-allowed border-dashed border-slate-300 bg-transparent text-slate-500 shadow-none hover:bg-transparent hover:text-slate-500 active:scale-100 dark:border-slate-600 dark:bg-transparent dark:text-slate-400 dark:hover:bg-transparent dark:hover:text-slate-400 [&_svg]:size-3";
50
+ function S(t) {
51
+ var r;
52
+ return (r = t.blocked) != null && r.reason ? {
53
+ "aria-disabled": !0,
54
+ "aria-description": t.blocked.reason,
55
+ "data-tip": t.blocked.reason,
56
+ "data-tip-focus": !0,
57
+ "data-move-unavailable": t.blocked.code,
58
+ onSelect: (o) => o.preventDefault(),
59
+ className: "cursor-not-allowed text-slate-400 focus:bg-slate-50 focus:text-slate-500 dark:text-slate-500 dark:focus:bg-white/5 dark:focus:text-slate-400"
60
+ } : {};
61
+ }
62
+ function N() {
63
+ return /* @__PURE__ */ d(l, { "aria-hidden": !0, className: "ml-auto h-3 w-3 shrink-0 text-slate-400" });
64
+ }
65
+ export {
66
+ k as BLOCKED_MOVE_CLASS,
67
+ N as BlockedMenuMark,
68
+ M as BlockedMoveButton,
69
+ B as blockedGroupTip,
70
+ S as blockedMenuItemProps,
71
+ w as isBlockedMove,
72
+ v as withBlockedMoves
73
+ };