@nivaro/react 0.3.103 → 0.3.104

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.
@@ -1,34 +1,34 @@
1
- import { jsx as n, jsxs as u } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
2
  import { useQuery as V, useQueryClient as w, useMutation as B } from "@tanstack/react-query";
3
3
  import { RotateCcw as F, RefreshCw as v, Eye as L, Loader2 as Q, Send as T } from "lucide-react";
4
4
  import { useState as A } from "react";
5
5
  import { toast as y } from "sonner";
6
6
  import { useNivaroClient as S } from "../../context.js";
7
- import { get as K, post as P } from "../../lib/commands.js";
8
- import { bannerLines as D } from "../../lib/obligation-banner.js";
9
- import { requestTransitionRun as E } from "../../lib/run-transition.js";
7
+ import { get as I, post as K } from "../../lib/commands.js";
8
+ import { bannerLines as P } from "../../lib/obligation-banner.js";
9
+ import { requestTransitionRun as D } from "../../lib/run-transition.js";
10
10
  import { cn as f } from "../../lib/utils.js";
11
- import { colorPair as I } from "../QueryTable.js";
11
+ import { colorPair as E } from "../QueryTable.js";
12
12
  import { roleForTone as O } from "./IntegrationObligationsView.js";
13
13
  import { SendCurrentDataButton as M } from "./SendCurrentData.js";
14
14
  function U({
15
15
  obligationId: d,
16
16
  collection: i,
17
17
  itemId: m,
18
- enabled: o = !0
18
+ enabled: r = !0
19
19
  }) {
20
- const e = S(), b = w(), [r, c] = A(!1), s = B({
20
+ const e = S(), b = w(), [t, c] = A(!1), l = B({
21
21
  mutationFn: () => e.request(
22
- P(`/integration-obligations/${d}/send`)
22
+ K(`/integration-obligations/${d}/send`)
23
23
  ),
24
- onSuccess: (l) => {
24
+ onSuccess: (s) => {
25
25
  var a;
26
- y.message(((a = l == null ? void 0 : l.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
26
+ y.message(((a = s == null ? void 0 : s.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
27
27
  queryKey: ["integration-obligations", "record", i, String(m)]
28
28
  });
29
29
  },
30
- onError: (l) => {
31
- const a = l == null ? void 0 : l.response;
30
+ onError: (s) => {
31
+ const a = s == null ? void 0 : s.response;
32
32
  y.error((a == null ? void 0 : a.error) ?? "Send now failed", { duration: 8e3 });
33
33
  },
34
34
  onSettled: () => c(!1)
@@ -38,33 +38,33 @@ function U({
38
38
  {
39
39
  type: "button",
40
40
  "data-obligation-send-now": !0,
41
- "data-obligation-send-now-enabled": o,
42
- disabled: s.isPending || !o,
43
- title: o ? "Send the stored request again, unchanged (admins)" : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation, then this sends from here",
41
+ "data-obligation-send-now-enabled": r,
42
+ disabled: l.isPending || !r,
43
+ title: r ? "Send the stored request again, unchanged (admins)" : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation, then this sends from here",
44
44
  onClick: () => {
45
- if (!r) {
45
+ if (!t) {
46
46
  c(!0);
47
47
  return;
48
48
  }
49
- s.mutate();
49
+ l.mutate();
50
50
  },
51
51
  className: f(
52
52
  "inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors disabled:opacity-60",
53
- r ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
53
+ t ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
54
54
  ),
55
55
  children: [
56
- s.isPending ? /* @__PURE__ */ n(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(T, { className: "h-3 w-3" }),
57
- r ? "Confirm send?" : "Send now"
56
+ l.isPending ? /* @__PURE__ */ o(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ o(T, { className: "h-3 w-3" }),
57
+ t ? "Confirm send?" : "Send now"
58
58
  ]
59
59
  }
60
60
  );
61
61
  }
62
62
  function ae(d, i) {
63
- var e, b;
64
- const m = S(), o = V({
63
+ var e, b, t;
64
+ const m = S(), r = V({
65
65
  queryKey: ["integration-obligations", "record", d, String(i)],
66
66
  queryFn: () => m.request(
67
- K(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
67
+ I(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
68
68
  ),
69
69
  enabled: !!d && !!i,
70
70
  staleTime: 3e4,
@@ -73,9 +73,12 @@ function ae(d, i) {
73
73
  retry: !1
74
74
  });
75
75
  return {
76
- ...o,
77
- lines: D(((e = o.data) == null ? void 0 : e.data) ?? []),
78
- remediationEnabled: ((b = o.data) == null ? void 0 : b.remediation_enabled) === !0
76
+ ...r,
77
+ lines: P(((e = r.data) == null ? void 0 : e.data) ?? []),
78
+ remediationEnabled: ((b = r.data) == null ? void 0 : b.remediation_enabled) === !0,
79
+ /** Obligation rows on the record (null until answered). */
80
+ obligationCount: r.data ? (r.data.data ?? []).length : null,
81
+ partnerIntegration: (t = r.data) == null ? void 0 : t.partner_integration
79
82
  };
80
83
  }
81
84
  const h = "inline-flex shrink-0 items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10.5px] font-medium text-slate-600 transition-colors hover:border-slate-300 hover:bg-slate-50 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:bg-muted";
@@ -83,20 +86,20 @@ function de({
83
86
  collection: d,
84
87
  itemId: i,
85
88
  lines: m,
86
- remediationEnabled: o,
89
+ remediationEnabled: r,
87
90
  actions: e
88
91
  }) {
89
92
  const b = w();
90
- return m.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((r) => {
93
+ return m.length === 0 ? null : /* @__PURE__ */ o("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((t) => {
91
94
  var k;
92
- const c = O(r.tone), [s, l] = c ? I(c) : [null, null], a = r.outcome === "failed" || r.outcome === "missing" || r.outcome === "overdue", N = a && r.can_resend !== !1, C = a && r.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(r.api.toLowerCase()), p = r.submission_id ?? (g == null ? void 0 : g.id) ?? null, q = !!(e != null && e.onRetry) && p != null && (r.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), R = !!(e != null && e.onView) && p != null, _ = !!r.transition_id && !!r.transition_label && a, $ = !!(e != null && e.onCheck) && (r.outcome === "pending" || r.outcome === "overdue"), j = () => {
95
+ const c = O(t.tone), [l, s] = c ? E(c) : [null, null], a = t.outcome === "failed" || t.outcome === "missing" || t.outcome === "overdue", C = a && t.can_resend !== !1, N = a && t.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(t.api.toLowerCase()), p = t.submission_id ?? (g == null ? void 0 : g.id) ?? null, _ = !!(e != null && e.onRetry) && p != null && (t.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), q = !!(e != null && e.onView) && p != null, R = !!t.transition_id && !!t.transition_label && a, $ = !!(e != null && e.onCheck) && (t.outcome === "pending" || t.outcome === "overdue"), j = () => {
93
96
  var x;
94
- if (!E({
97
+ if (!D({
95
98
  collection: d,
96
99
  item: String(i),
97
- transition_id: r.transition_id
100
+ transition_id: t.transition_id
98
101
  })) {
99
- y.error(`Open the record to run “${r.transition_label}”`);
102
+ y.error(`Open the record to run “${t.transition_label}”`);
100
103
  return;
101
104
  }
102
105
  (x = e == null ? void 0 : e.onRanTransition) == null || x.call(e);
@@ -104,68 +107,68 @@ function de({
104
107
  return /* @__PURE__ */ u(
105
108
  "div",
106
109
  {
107
- "data-integration-line": r.api,
108
- "data-integration-outcome": r.outcome,
109
- style: s ? { "--obt": s, "--obtd": l } : void 0,
110
+ "data-integration-line": t.api,
111
+ "data-integration-outcome": t.outcome,
112
+ style: l ? { "--obt": l, "--obtd": s } : void 0,
110
113
  className: f(
111
114
  "flex items-start gap-2 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-[12px] dark:border-border dark:bg-card",
112
- s && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
115
+ l && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
113
116
  ),
114
117
  children: [
115
- /* @__PURE__ */ n(
118
+ /* @__PURE__ */ o(
116
119
  "span",
117
120
  {
118
121
  "aria-hidden": !0,
119
122
  className: f(
120
123
  "mt-1 h-1.5 w-1.5 shrink-0 rounded-full",
121
- s ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
124
+ l ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
122
125
  )
123
126
  }
124
127
  ),
125
128
  /* @__PURE__ */ u("p", { className: "min-w-0 flex-1 leading-5 text-slate-700 dark:text-slate-200", children: [
126
129
  /* @__PURE__ */ u("span", { className: "font-semibold text-slate-800 dark:text-foreground", children: [
127
- r.api,
130
+ t.api,
128
131
  ":"
129
132
  ] }),
130
133
  " ",
131
- /* @__PURE__ */ n(
134
+ /* @__PURE__ */ o(
132
135
  "span",
133
136
  {
134
137
  "data-integration-reason": !0,
135
- className: s ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
136
- children: r.text
138
+ className: l ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
139
+ children: t.text
137
140
  }
138
141
  )
139
142
  ] }),
140
143
  /* @__PURE__ */ u("span", { className: "ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1", children: [
141
- _ && /* @__PURE__ */ u(
144
+ R && /* @__PURE__ */ u(
142
145
  "button",
143
146
  {
144
147
  type: "button",
145
148
  "data-integration-action": "rerun",
146
149
  onClick: j,
147
- title: `Fix what ${r.api} rejected, then run “${r.transition_label}” again — it re-sends from the current values`,
150
+ title: `Fix what ${t.api} rejected, then run “${t.transition_label}” again — it re-sends from the current values`,
148
151
  className: f(h, "border-nvr-cyan/40 text-nvr-cyan hover:bg-nvr-cyan/10"),
149
152
  children: [
150
- /* @__PURE__ */ n(F, { className: "h-3 w-3" }),
153
+ /* @__PURE__ */ o(F, { className: "h-3 w-3" }),
151
154
  "Re-run ",
152
- r.transition_label
155
+ t.transition_label
153
156
  ]
154
157
  }
155
158
  ),
156
- q && /* @__PURE__ */ u(
159
+ _ && /* @__PURE__ */ u(
157
160
  "button",
158
161
  {
159
162
  type: "button",
160
163
  "data-integration-action": "retry",
161
164
  onClick: () => {
162
- var t;
163
- return (t = e == null ? void 0 : e.onRetry) == null ? void 0 : t.call(e, p);
165
+ var n;
166
+ return (n = e == null ? void 0 : e.onRetry) == null ? void 0 : n.call(e, p);
164
167
  },
165
168
  title: "Send the same request again, unchanged — for a partner that was down, not for data it rejected",
166
169
  className: h,
167
170
  children: [
168
- /* @__PURE__ */ n(v, { className: "h-3 w-3" }),
171
+ /* @__PURE__ */ o(v, { className: "h-3 w-3" }),
169
172
  "Retry"
170
173
  ]
171
174
  }
@@ -176,61 +179,61 @@ function de({
176
179
  type: "button",
177
180
  "data-integration-action": "check",
178
181
  onClick: () => {
179
- var t;
180
- return (t = e == null ? void 0 : e.onCheck) == null ? void 0 : t.call(e);
182
+ var n;
183
+ return (n = e == null ? void 0 : e.onCheck) == null ? void 0 : n.call(e);
181
184
  },
182
185
  title: "Ask again whether the partner has acknowledged it",
183
186
  className: h,
184
187
  children: [
185
- /* @__PURE__ */ n(v, { className: "h-3 w-3" }),
188
+ /* @__PURE__ */ o(v, { className: "h-3 w-3" }),
186
189
  "Check now"
187
190
  ]
188
191
  }
189
192
  ),
190
- R && /* @__PURE__ */ u(
193
+ q && /* @__PURE__ */ u(
191
194
  "button",
192
195
  {
193
196
  type: "button",
194
197
  "data-integration-action": "view",
195
198
  onClick: () => {
196
- var t;
197
- return (t = e == null ? void 0 : e.onView) == null ? void 0 : t.call(e, p);
199
+ var n;
200
+ return (n = e == null ? void 0 : e.onView) == null ? void 0 : n.call(e, p);
198
201
  },
199
202
  title: "Show the request and the reply",
200
203
  className: h,
201
204
  children: [
202
- /* @__PURE__ */ n(L, { className: "h-3 w-3" }),
203
- r.outcome === "failed" ? "View error" : "View request"
205
+ /* @__PURE__ */ o(L, { className: "h-3 w-3" }),
206
+ t.outcome === "failed" ? "View error" : "View request"
204
207
  ]
205
208
  }
206
209
  ),
207
- N && /* @__PURE__ */ n(
210
+ C && /* @__PURE__ */ o(
208
211
  U,
209
212
  {
210
- obligationId: r.obligation_id,
213
+ obligationId: t.obligation_id,
211
214
  collection: d,
212
215
  itemId: i,
213
- enabled: o
216
+ enabled: r
214
217
  }
215
218
  ),
216
- C && /* @__PURE__ */ n(
219
+ N && /* @__PURE__ */ o(
217
220
  M,
218
221
  {
219
- obligationId: r.obligation_id,
220
- api: r.api,
221
- enabled: o,
222
+ obligationId: t.obligation_id,
223
+ api: t.api,
224
+ enabled: r,
222
225
  onSent: () => {
223
- var t;
226
+ var n;
224
227
  b.invalidateQueries({
225
228
  queryKey: ["integration-obligations", "record", d, String(i)]
226
- }), (t = e == null ? void 0 : e.onCheck) == null || t.call(e);
229
+ }), (n = e == null ? void 0 : e.onCheck) == null || n.call(e);
227
230
  }
228
231
  }
229
232
  )
230
233
  ] })
231
234
  ]
232
235
  },
233
- r.api
236
+ t.api
234
237
  );
235
238
  }) });
236
239
  }
@@ -1,11 +1,11 @@
1
1
  import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
2
  import { useQuery as _ } from "@tanstack/react-query";
3
3
  import { UserCheck as q, Mail as D, Phone as F, Building2 as z, User as O, Clock as K, MessageCircle as W, ExternalLink as H, RefreshCw as J, LogOut as Z } from "lucide-react";
4
- import R, { useState as S, useRef as C, useEffect as L } from "react";
4
+ import R, { useState as S, useRef as C, useEffect as $ } from "react";
5
5
  import { createPortal as G } from "react-dom";
6
6
  import { useOptionalNivaroClient as M, useNavigation as V, useItemEditAuth as X } from "../../context.js";
7
- import { get as $, post as Y } from "../../lib/commands.js";
8
- import { userCardQuery as B } from "../../lib/user-cards.js";
7
+ import { get as B, post as Y } from "../../lib/commands.js";
8
+ import { userCardQuery as L } from "../../lib/user-cards.js";
9
9
  import { cn as P } from "../../lib/utils.js";
10
10
  import { canOpenDm as I, openDmWith as A } from "../chat/chat-core.js";
11
11
  import { HuddlePresenceLine as Q } from "../chat/huddle/HuddleLiveBadge.js";
@@ -20,7 +20,7 @@ function E(e, n, i) {
20
20
  const s = C(n);
21
21
  s.current = n;
22
22
  const d = C(i);
23
- d.current = i, L(() => {
23
+ d.current = i, $(() => {
24
24
  if (!e) return;
25
25
  const o = (r) => {
26
26
  const p = r.target;
@@ -44,7 +44,7 @@ function pe({
44
44
  avatarCls: n
45
45
  }) {
46
46
  const i = M(), { data: s } = _({
47
- ...B(i, e.id),
47
+ ...L(i, e.id),
48
48
  enabled: !!i && !!e.id && !String(e.name ?? "").trim(),
49
49
  staleTime: 30 * 6e4,
50
50
  retry: !1
@@ -75,13 +75,13 @@ function xe({
75
75
  showSingleName: n = !0,
76
76
  nameLabel: i = !1
77
77
  }) {
78
- const s = C(null), d = C(null), o = C(null), [m, r] = S(null), [p, g] = S({ x: 0, y: 0 }), h = () => {
78
+ const s = C(null), d = C(null), o = C(null), [m, r] = S(null), [p, b] = S({ x: 0, y: 0 }), h = () => {
79
79
  o.current && clearTimeout(o.current), o.current = null;
80
80
  }, k = (a) => {
81
- var b;
81
+ var g;
82
82
  h();
83
- const f = (b = s.current) == null ? void 0 : b.getBoundingClientRect();
84
- f && g({ x: f.left, y: f.bottom + 6 }), r((x) => x === "pin" ? "pin" : a);
83
+ const f = (g = s.current) == null ? void 0 : g.getBoundingClientRect();
84
+ f && b({ x: f.left, y: f.bottom + 6 }), r((x) => x === "pin" ? "pin" : a);
85
85
  }, c = () => {
86
86
  h(), o.current = setTimeout(() => r((a) => a === "pin" ? a : null), 160);
87
87
  };
@@ -91,20 +91,20 @@ function xe({
91
91
  const a = d.current;
92
92
  if (!a) return;
93
93
  const f = a.getBoundingClientRect();
94
- let { x: b, y: x } = p;
95
- if (f.right > window.innerWidth - 8 && (b = Math.max(8, window.innerWidth - f.width - 8)), f.bottom > window.innerHeight - 8) {
94
+ let { x: g, y: x } = p;
95
+ if (f.right > window.innerWidth - 8 && (g = Math.max(8, window.innerWidth - f.width - 8)), f.bottom > window.innerHeight - 8) {
96
96
  const y = (u = s.current) == null ? void 0 : u.getBoundingClientRect();
97
97
  x = Math.max(8, ((y == null ? void 0 : y.top) ?? x) - f.height - 6);
98
98
  }
99
- (b !== p.x || x !== p.y) && g({ x: b, y: x });
99
+ (g !== p.x || x !== p.y) && b({ x: g, y: x });
100
100
  }, [m, p]), E(
101
101
  !!m,
102
102
  (a) => {
103
- var f, b, x;
103
+ var f, g, x;
104
104
  return (
105
105
  // Clicks inside the user-card popover (portaled by Radix) keep the
106
106
  // roster mounted — closing would unmount the card mid-click.
107
- !!((f = a.closest) != null && f.call(a, "[data-radix-popper-content-wrapper]")) || !!((b = d.current) != null && b.contains(a)) || !!((x = s.current) != null && x.contains(a))
107
+ !!((f = a.closest) != null && f.call(a, "[data-radix-popper-content-wrapper]")) || !!((g = d.current) != null && g.contains(a)) || !!((x = s.current) != null && x.contains(a))
108
108
  );
109
109
  },
110
110
  () => r(null)
@@ -122,7 +122,7 @@ function xe({
122
122
  },
123
123
  className: "inline-flex cursor-pointer items-center",
124
124
  children: [
125
- /* @__PURE__ */ t("span", { className: "flex -space-x-2", children: w.map((a) => /* @__PURE__ */ t(pe, { user: a, avatarCls: N }, a.id)) }),
125
+ /* @__PURE__ */ t("span", { className: i ? "flex -space-x-1" : "flex -space-x-2", children: w.map((a) => /* @__PURE__ */ t(pe, { user: a, avatarCls: N }, a.id)) }),
126
126
  v > 0 && /* @__PURE__ */ l("span", { className: "ml-1 rounded-full bg-slate-200 px-1.5 py-0.5 text-[10.5px] font-bold leading-none text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: [
127
127
  "+",
128
128
  v
@@ -133,11 +133,11 @@ function xe({
133
133
  "span",
134
134
  {
135
135
  "data-roster-label": "",
136
- className: "ml-1.5 inline-flex max-w-[170px] items-baseline gap-1 text-[12px] font-medium text-slate-700 dark:text-slate-200",
136
+ className: "ml-1.5 inline-flex max-w-[170px] items-baseline gap-1 text-[13px] font-semibold leading-tight text-slate-900 dark:text-slate-100",
137
137
  children: [
138
138
  /* @__PURE__ */ t("span", { className: "truncate", children: a.name }),
139
139
  a.mark && /* @__PURE__ */ t(T, { mark: a.mark }),
140
- a.more > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 text-slate-500 dark:text-slate-400", children: [
140
+ a.more > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 font-normal text-slate-500 dark:text-slate-400", children: [
141
141
  "+",
142
142
  a.more
143
143
  ] })
@@ -225,7 +225,7 @@ function qe({
225
225
  }) {
226
226
  const s = M(), { data: d = [] } = _({
227
227
  queryKey: ["pipeline-instance-owners", e, n],
228
- queryFn: () => s.request($(`/pipelines/instance/${e}/${n}/owners`)).then((r) => r.data ?? []),
228
+ queryFn: () => s.request(B(`/pipelines/instance/${e}/${n}/owners`)).then((r) => r.data ?? []),
229
229
  enabled: !!s && !!e && !!n && n !== "new",
230
230
  staleTime: 3e4
231
231
  }), o = (r) => [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email, m = (r) => o(r).split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
@@ -251,7 +251,7 @@ function qe({
251
251
  )) })
252
252
  ] });
253
253
  }
254
- function be({
254
+ function ge({
255
255
  user: e,
256
256
  userId: n,
257
257
  initials: i,
@@ -262,8 +262,8 @@ function be({
262
262
  onAction: r,
263
263
  open: p = !1
264
264
  }) {
265
- var b;
266
- const { isAdmin: g, userId: h } = X(), k = !!h && h.toUpperCase() === n.toUpperCase(), c = se(n, p), w = ee().roomOf(n), v = ((b = e == null ? void 0 : e.manager_name) == null ? void 0 : b.trim()) || null, N = (() => {
265
+ var g;
266
+ const { isAdmin: b, userId: h } = X(), k = !!h && h.toUpperCase() === n.toUpperCase(), c = se(n, p), w = ee().roomOf(n), v = ((g = e == null ? void 0 : e.manager_name) == null ? void 0 : g.trim()) || null, N = (() => {
267
267
  const x = e == null ? void 0 : e.timezone;
268
268
  if (!x) return null;
269
269
  try {
@@ -347,7 +347,7 @@ function be({
347
347
  {
348
348
  email: e == null ? void 0 : e.email,
349
349
  enabled: p,
350
- canClear: g,
350
+ canClear: b,
351
351
  className: "mt-1"
352
352
  }
353
353
  )
@@ -445,8 +445,8 @@ function be({
445
445
  }
446
446
  )
447
447
  ] }),
448
- g && !k && /* @__PURE__ */ t(
449
- ge,
448
+ b && !k && /* @__PURE__ */ t(
449
+ be,
450
450
  {
451
451
  userId: n,
452
452
  name: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : n,
@@ -457,18 +457,18 @@ function be({
457
457
  }
458
458
  );
459
459
  }
460
- function ge({
460
+ function be({
461
461
  userId: e,
462
462
  name: n,
463
463
  onDone: i
464
464
  }) {
465
465
  const [s, d] = S(!1), [o, m] = S("");
466
- L(() => {
466
+ $(() => {
467
467
  if (!s || o.trim()) return;
468
468
  const k = setTimeout(() => d(!1), ne);
469
469
  return () => clearTimeout(k);
470
470
  }, [s, o]);
471
- const r = re(e, { onDone: i }), p = le(e, n, { onDone: i }), g = () => p.mutate({ message: o }), h = "flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-50";
471
+ const r = re(e, { onDone: i }), p = le(e, n, { onDone: i }), b = () => p.mutate({ message: o }), h = "flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-50";
472
472
  return /* @__PURE__ */ l("div", { className: "border-t border-slate-100 p-2 dark:border-border", "data-user-card-admin": !0, children: [
473
473
  /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
474
474
  /* @__PURE__ */ l(
@@ -494,7 +494,7 @@ function ge({
494
494
  {
495
495
  type: "button",
496
496
  disabled: p.isPending,
497
- onClick: () => s ? g() : d(!0),
497
+ onClick: () => s ? b() : d(!0),
498
498
  "data-tip": s ? "Click again to sign them out of every session" : "Ends every session they have, on every app — they can sign in again",
499
499
  className: P(
500
500
  h,
@@ -513,7 +513,7 @@ function ge({
513
513
  {
514
514
  value: o,
515
515
  onChange: m,
516
- onSubmit: g,
516
+ onSubmit: b,
517
517
  className: "mt-2"
518
518
  }
519
519
  )
@@ -524,23 +524,23 @@ function ue({
524
524
  size: n = "default",
525
525
  children: i
526
526
  }) {
527
- const s = M(), { navigate: d, userUrl: o } = V(), m = o ? o(e) : `/users/${e}`, [r, p] = S(!1), g = R.useId();
527
+ const s = M(), { navigate: d, userUrl: o } = V(), m = o ? o(e) : `/users/${e}`, [r, p] = S(!1), b = R.useId();
528
528
  E(
529
529
  r,
530
530
  (a) => {
531
- var f, b, x, u;
532
- return !!((f = a.closest) != null && f.call(a, `[data-nvr-user-card="${CSS.escape(g)}"]`)) || !!((b = a.closest) != null && b.call(a, `[data-nvr-user-chip="${CSS.escape(g)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
531
+ var f, g, x, u;
532
+ return !!((f = a.closest) != null && f.call(a, `[data-nvr-user-card="${CSS.escape(b)}"]`)) || !!((g = a.closest) != null && g.call(a, `[data-nvr-user-chip="${CSS.escape(b)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
533
533
  !!((x = a.closest) != null && x.call(a, "[data-radix-popper-content-wrapper]")) && !((u = a.closest) != null && u.call(a, "[data-nvr-user-card]"));
534
534
  },
535
535
  () => p(!1)
536
536
  );
537
537
  const { data: h, isLoading: k } = _({
538
- ...B(s, e),
538
+ ...L(s, e),
539
539
  enabled: !!s && !!e,
540
540
  staleTime: 12e4
541
541
  }), { data: c } = _({
542
542
  queryKey: ["user-presence", e],
543
- queryFn: () => s.request($(`/presence/users/${e}`)).then((a) => a),
543
+ queryFn: () => s.request(B(`/presence/users/${e}`)).then((a) => a),
544
544
  enabled: !!s && !!e && r,
545
545
  staleTime: 15e3,
546
546
  refetchInterval: r ? 2e4 : !1
@@ -549,7 +549,7 @@ function ue({
549
549
  /* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 rounded-full animate-pulse bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
550
550
  /* @__PURE__ */ t("span", { className: "animate-pulse h-2.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" })
551
551
  ] }) : /* @__PURE__ */ l(ie, { open: r, onOpenChange: p, children: [
552
- /* @__PURE__ */ t(oe, { asChild: !0, "data-nvr-user-chip": g, children: i || (n === "compact" ? /* @__PURE__ */ l("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 dark:bg-slate-800 py-px pl-px pr-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors", children: [
552
+ /* @__PURE__ */ t(oe, { asChild: !0, "data-nvr-user-chip": b, children: i || (n === "compact" ? /* @__PURE__ */ l("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 dark:bg-slate-800 py-px pl-px pr-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors", children: [
553
553
  /* @__PURE__ */ t(
554
554
  j,
555
555
  {
@@ -587,7 +587,7 @@ function ue({
587
587
  /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children: w })
588
588
  ] })) }),
589
589
  /* @__PURE__ */ t(
590
- be,
590
+ ge,
591
591
  {
592
592
  user: h,
593
593
  userId: e,
@@ -595,7 +595,7 @@ function ue({
595
595
  navigate: d,
596
596
  profileUrl: m,
597
597
  online: N,
598
- cardId: g,
598
+ cardId: b,
599
599
  onAction: () => p(!1),
600
600
  open: r
601
601
  }
@@ -605,7 +605,7 @@ function ue({
605
605
  export {
606
606
  qe as OwnersInline,
607
607
  Ue as OwnersInlineCompact,
608
- ge as UserCardAdminRow,
608
+ be as UserCardAdminRow,
609
609
  ue as UserChip,
610
610
  xe as UserRosterCluster,
611
611
  ce as rosterInitials,
@@ -44,16 +44,18 @@ function Se({
44
44
  ...c
45
45
  }) {
46
46
  var G, H, U, V, Z, J, X, q, Q, Y, ee;
47
- const n = ie(), m = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, le = c["data-design-copy"] !== void 0, ce = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, w = (l == null ? void 0 : l.kind) === "removed", x = !n || !!m || le || w || !!((H = n.locked) != null && H.call(n, e)), b = je((n == null ? void 0 : n.dnd) ?? Fe, e, { disabled: x, noDrop: ce });
47
+ const n = ie(), m = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, le = c["data-design-copy"] !== void 0, ce = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, w = (l == null ? void 0 : l.kind) === "removed", x = !n || !!m || le || w || !!((H = n.locked) != null && H.call(n, e)), k = je((n == null ? void 0 : n.dnd) ?? Fe, e, { disabled: x, noDrop: ce });
48
48
  if (!n) return /* @__PURE__ */ o(L, { children: a });
49
- const ue = Re(e), D = ze(n, e), s = ((U = n.roleMark) == null ? void 0 : U.call(n, e)) ?? null, R = ((V = n.marks) == null ? void 0 : V.call(n, e)) ?? [], k = ((Z = n.overlay) == null ? void 0 : Z.call(n, e)) ?? null, S = ((J = n.unsaved) == null ? void 0 : J.call(n, e)) ?? !1, v = ((X = n.peers) == null ? void 0 : X.call(n, e)) ?? [], pe = R.some((t) => t.highlight), B = ((q = n.note) == null ? void 0 : q.call(n, e)) ?? null, z = B ? /* @__PURE__ */ o(Ie, { note: B }) : null, j = x ? {} : b.props, ge = b.dragging, C = x ? null : b.slot, p = r && oe(a) ? a : null, me = (p == null ? void 0 : p.props.className) ?? "", he = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(me), fe = f(
49
+ const ue = Re(e), D = ze(n, e), s = ((U = n.roleMark) == null ? void 0 : U.call(n, e)) ?? null, R = ((V = n.marks) == null ? void 0 : V.call(n, e)) ?? [], b = ((Z = n.overlay) == null ? void 0 : Z.call(n, e)) ?? null, S = ((J = n.unsaved) == null ? void 0 : J.call(n, e)) ?? !1, v = ((X = n.peers) == null ? void 0 : X.call(n, e)) ?? [], pe = R.some((t) => t.highlight), B = ((q = n.note) == null ? void 0 : q.call(n, e)) ?? null, z = B ? /* @__PURE__ */ o(Ie, { note: B }) : null, j = x ? {} : k.props, ge = k.dragging, C = x ? null : k.slot, p = r && oe(a) ? a : null, me = (p == null ? void 0 : p.props.className) ?? "", he = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(me), fe = f(
50
50
  !he && "relative",
51
- "cursor-pointer rounded-md outline-offset-2",
51
+ "cursor-pointer rounded-md",
52
+ // Header tiles sit in a strip that clips what overflows it: their ring is drawn inside.
53
+ e.kind === "header" ? "-outline-offset-2" : "outline-offset-2",
52
54
  // #3193: on touch a press-and-hold picks the node up — no callout, no text selection.
53
55
  "touch-manipulation [-webkit-touch-callout:none] [@media(pointer:coarse)]:select-none",
54
56
  !p && (i ? "inline-block" : "block"),
55
57
  D ? "outline outline-2 outline-nvr-cyan" : v.length > 0 ? `outline outline-2 ${v[0].outline}` : pe ? "outline-dashed outline-2 outline-violet-400 dark:outline-violet-400/70" : "hover:outline hover:outline-1 hover:outline-slate-300 dark:hover:outline-slate-600",
56
- k == null ? void 0 : k.className,
58
+ b == null ? void 0 : b.className,
57
59
  "focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
58
60
  Le,
59
61
  // The section's "Changed by" shows while the pointer is over it.
@@ -63,7 +65,7 @@ function Se({
63
65
  (s == null ? void 0 : s.kind) === "hidden" && "[&>:not([data-design-badges])]:opacity-40",
64
66
  l && Ve[l.kind],
65
67
  w && "cursor-default [&>:not([data-design-badges])]:opacity-40"
66
- ), be = (t) => {
68
+ ), ke = (t) => {
67
69
  const u = t.target;
68
70
  if (u.closest("[data-design-target]") !== t.currentTarget) return;
69
71
  if (w) {
@@ -73,7 +75,7 @@ function Se({
73
75
  t.shiftKey || t.metaKey || t.ctrlKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e);
74
76
  const _ = u.closest("[data-design-pass]");
75
77
  _ && t.currentTarget.contains(_) || (t.preventDefault(), t.stopPropagation());
76
- }, ke = (t) => {
78
+ }, be = (t) => {
77
79
  t.key !== "Enter" || t.target !== t.currentTarget || w || t.currentTarget.tagName !== "BUTTON" && (t.preventDefault(), t.shiftKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e));
78
80
  }, y = c["data-design-tab"] !== void 0 || ((Q = p == null ? void 0 : p.props) == null ? void 0 : Q["data-design-tab"]) !== void 0, F = {
79
81
  "data-design-target": ue,
@@ -88,8 +90,8 @@ function Se({
88
90
  ...x || !("tabIndex" in j) ? { role: "button", tabIndex: 0 } : {},
89
91
  ...y && m ? { "data-tip": `From ${m}` } : {},
90
92
  className: fe,
91
- onClickCapture: be,
92
- onKeyDown: ke
93
+ onClickCapture: ke,
94
+ onKeyDown: be
93
95
  }, ve = (s == null ? void 0 : s.kind) === "hidden" ? ye : Ne, M = e.kind === "field" || e.kind === "header" ? ((Y = n.fillRate) == null ? void 0 : Y.call(n, e.field)) ?? null : null, N = e.kind === "group" && !y ? ((ee = n.lastChange) == null ? void 0 : ee.call(n, e)) ?? null : null, P = N && [N.by ? `by ${N.by}` : null, N.at ? Te(N.at) : null].filter(Boolean).join(" · ") || null, A = P && !l ? /* @__PURE__ */ g(
94
96
  "span",
95
97
  {
@@ -120,10 +122,10 @@ function Se({
120
122
  ]
121
123
  }
122
124
  )
123
- }), k && h.push({
125
+ }), b && h.push({
124
126
  rank: 1,
125
127
  text: "Who sees it",
126
- node: /* @__PURE__ */ o("span", { "data-design-pass": "", className: "pointer-events-auto", children: k.chip })
128
+ node: /* @__PURE__ */ o("span", { "data-design-pass": "", className: "pointer-events-auto", children: b.chip })
127
129
  }), R.forEach((t, u) => {
128
130
  const _ = f(
129
131
  Ke,
@@ -171,7 +173,7 @@ function Se({
171
173
  m
172
174
  ] })
173
175
  });
174
- const { shown: xe, rest: $ } = Ge(h), W = R.length > 0 || k != null || v.length > 0, T = y && !l ? [...h.map((t) => t.text), ...v.map((t) => t.name)] : [];
176
+ const { shown: xe, rest: $ } = Ge(h), W = R.length > 0 || b != null || v.length > 0, T = y && !l ? [...h.map((t) => t.text), ...v.map((t) => t.name)] : [];
175
177
  T.length > 0 && (F["data-tip"] = m && !s && !W ? `From ${m}` : T.join(" · "));
176
178
  const I = y && l ? /* @__PURE__ */ o("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ o(re, { diff: l }) }) : T.length > 0 ? /* @__PURE__ */ o(
177
179
  "span",
@@ -238,15 +240,15 @@ function Se({
238
240
  "aria-hidden": !0,
239
241
  "data-design-drop-indicator": C,
240
242
  className: "pointer-events-none absolute z-30 rounded-full bg-nvr-cyan shadow-[0_0_0_2px_#fff] dark:shadow-[0_0_0_2px_#0f172a]",
241
- style: b.indicator ?? de[C],
242
- children: b.merge && /* @__PURE__ */ g(
243
+ style: k.indicator ?? de[C],
244
+ children: k.merge && /* @__PURE__ */ g(
243
245
  "span",
244
246
  {
245
247
  "data-design-merge-label": "",
246
248
  className: "absolute right-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded bg-nvr-cyan px-1.5 text-[11px] font-medium leading-5 text-white",
247
249
  children: [
248
250
  "Join into ",
249
- b.merge
251
+ k.merge
250
252
  ]
251
253
  }
252
254
  )