@nivaro/react 0.2.56 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/components/slots/TasksSlot.js +31 -29
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +73 -1
  5. package/dist/index.js +515 -505
  6. package/dist/shared/components/ItemEditForm.js +666 -658
  7. package/dist/shared/components/MyWorkView.js +47 -37
  8. package/dist/shared/components/ProfileView.js +163 -144
  9. package/dist/shared/components/ai/AiPlanCard.js +427 -0
  10. package/dist/shared/components/ai/AiPlanChanges.js +117 -0
  11. package/dist/shared/components/ai/TaskDo.js +1022 -0
  12. package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
  13. package/dist/shared/components/chat/ChatPanel.js +1356 -1317
  14. package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
  15. package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
  16. package/dist/shared/components/chat/chat-core.js +273 -264
  17. package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
  18. package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
  19. package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
  20. package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
  21. package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
  22. package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
  23. package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
  24. package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
  25. package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
  26. package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
  27. package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
  28. package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
  29. package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
  30. package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
  31. package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
  32. package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
  33. package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
  34. package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
  35. package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
  36. package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
  37. package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
  38. package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
  39. package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
  40. package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
  41. package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
  42. package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
  43. package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
  44. package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
  45. package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
  46. package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
  47. package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
  48. package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
  49. package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
  50. package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
  51. package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
  52. package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
  53. package/dist/shared/components/item-edit/GroupSection.js +1 -0
  54. package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
  55. package/dist/shared/components/item-edit/UserChip.js +145 -142
  56. package/dist/shared/components/panels/TaskPanel.js +51 -49
  57. package/dist/shared/components/support/TicketDetailSheet.js +57 -42
  58. package/dist/shared/lib/notification-sound.js +25 -16
  59. package/package.json +2 -1
@@ -1,109 +1,111 @@
1
1
  import { jsx as a, jsxs as r } from "react/jsx-runtime";
2
2
  import { useQuery as _ } from "@tanstack/react-query";
3
- import { UserCheck as R, Mail as E, Phone as U, Building2 as q, User as M, Clock as D, MessageCircle as S, ExternalLink as z } from "lucide-react";
4
- import P, { useState as $, useRef as N, useEffect as F } from "react";
3
+ import { UserCheck as R, Mail as E, Phone as U, Building2 as q, User as B, Clock as D, MessageCircle as S, ExternalLink as z } from "lucide-react";
4
+ import L, { useState as $, useRef as N, useEffect as F } from "react";
5
5
  import { createPortal as K } from "react-dom";
6
- import { useOptionalNivaroClient as B, useNavigation as W, useItemEditAuth as Q } from "../../context.js";
7
- import { get as O, post as Z } from "../../lib/commands.js";
8
- import { userCardQuery as H } from "../../lib/user-cards.js";
6
+ import { useOptionalNivaroClient as P, useNavigation as W, useItemEditAuth as H } from "../../context.js";
7
+ import { get as M, post as Q } from "../../lib/commands.js";
8
+ import { userCardQuery as Z } from "../../lib/user-cards.js";
9
9
  import { cn as J } from "../../lib/utils.js";
10
10
  import { canOpenDm as V, openDmWith as G } from "../chat/chat-core.js";
11
- import { MailSuppressedPill as X } from "../profile/MailSuppressedPill.js";
12
- import { useCardPresence as Y } from "../profile/usePersonPresence.js";
11
+ import { HuddlePresenceLine as X } from "../chat/huddle/HuddleLiveBadge.js";
12
+ import { useHuddleLive as Y } from "../chat/huddle/huddle-live.js";
13
+ import { MailSuppressedPill as I } from "../profile/MailSuppressedPill.js";
14
+ import { useCardPresence as A } from "../profile/usePersonPresence.js";
13
15
  import { UserAvatar as C } from "../UserAvatar.js";
14
- import { Popover as I, PopoverTrigger as A, PopoverContent as ee } from "../ui/popover.js";
15
- function T(e, l, s) {
16
- const o = N(l);
17
- o.current = l;
16
+ import { Popover as ee, PopoverTrigger as te, PopoverContent as ae } from "../ui/popover.js";
17
+ function O(e, l, s) {
18
+ const c = N(l);
19
+ c.current = l;
18
20
  const d = N(s);
19
21
  d.current = s, F(() => {
20
22
  if (!e) return;
21
- const p = (n) => {
22
- const x = n.target;
23
- x && o.current(x) || d.current();
24
- }, m = () => d.current();
25
- return document.addEventListener("pointerdown", p, !0), window.addEventListener("blur", m), () => {
26
- document.removeEventListener("pointerdown", p, !0), window.removeEventListener("blur", m);
23
+ const m = (n) => {
24
+ const f = n.target;
25
+ f && c.current(f) || d.current();
26
+ }, p = () => d.current();
27
+ return document.addEventListener("pointerdown", m, !0), window.addEventListener("blur", p), () => {
28
+ document.removeEventListener("pointerdown", m, !0), window.removeEventListener("blur", p);
27
29
  };
28
30
  }, [e]);
29
31
  }
30
- function te({
32
+ function ne({
31
33
  users: e,
32
34
  showSingleName: l = !0
33
35
  }) {
34
- const s = N(null), o = N(null), d = N(null), [p, m] = $(null), [n, x] = $({ x: 0, y: 0 }), g = () => {
36
+ const s = N(null), c = N(null), d = N(null), [m, p] = $(null), [n, f] = $({ x: 0, y: 0 }), b = () => {
35
37
  d.current && clearTimeout(d.current), d.current = null;
36
- }, i = (t) => {
37
- var f;
38
- g();
39
- const c = (f = s.current) == null ? void 0 : f.getBoundingClientRect();
40
- c && x({ x: c.left, y: c.bottom + 6 }), m((h) => h === "pin" ? "pin" : t);
38
+ }, o = (t) => {
39
+ var x;
40
+ b();
41
+ const i = (x = s.current) == null ? void 0 : x.getBoundingClientRect();
42
+ i && f({ x: i.left, y: i.bottom + 6 }), p((h) => h === "pin" ? "pin" : t);
41
43
  }, w = () => {
42
- g(), d.current = setTimeout(() => m((t) => t === "pin" ? t : null), 160);
44
+ b(), d.current = setTimeout(() => p((t) => t === "pin" ? t : null), 160);
43
45
  };
44
- P.useLayoutEffect(() => {
46
+ L.useLayoutEffect(() => {
45
47
  var y;
46
- if (!p) return;
47
- const t = o.current;
48
+ if (!m) return;
49
+ const t = c.current;
48
50
  if (!t) return;
49
- const c = t.getBoundingClientRect();
50
- let { x: f, y: h } = n;
51
- if (c.right > window.innerWidth - 8 && (f = Math.max(8, window.innerWidth - c.width - 8)), c.bottom > window.innerHeight - 8) {
51
+ const i = t.getBoundingClientRect();
52
+ let { x, y: h } = n;
53
+ if (i.right > window.innerWidth - 8 && (x = Math.max(8, window.innerWidth - i.width - 8)), i.bottom > window.innerHeight - 8) {
52
54
  const j = (y = s.current) == null ? void 0 : y.getBoundingClientRect();
53
- h = Math.max(8, ((j == null ? void 0 : j.top) ?? h) - c.height - 6);
55
+ h = Math.max(8, ((j == null ? void 0 : j.top) ?? h) - i.height - 6);
54
56
  }
55
- (f !== n.x || h !== n.y) && x({ x: f, y: h });
56
- }, [p, n]), T(
57
- !!p,
57
+ (x !== n.x || h !== n.y) && f({ x, y: h });
58
+ }, [m, n]), O(
59
+ !!m,
58
60
  (t) => {
59
- var c, f, h;
61
+ var i, x, h;
60
62
  return (
61
63
  // Clicks inside the user-card popover (portaled by Radix) keep the
62
64
  // roster mounted — closing would unmount the card mid-click.
63
- !!((c = t.closest) != null && c.call(t, "[data-radix-popper-content-wrapper]")) || !!((f = o.current) != null && f.contains(t)) || !!((h = s.current) != null && h.contains(t))
65
+ !!((i = t.closest) != null && i.call(t, "[data-radix-popper-content-wrapper]")) || !!((x = c.current) != null && x.contains(t)) || !!((h = s.current) != null && h.contains(t))
64
66
  );
65
67
  },
66
- () => m(null)
68
+ () => p(null)
67
69
  );
68
- const k = (t) => t.split(" ").map((c) => c[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
70
+ const u = (t) => t.split(" ").map((i) => i[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
69
71
  if (e.length === 0)
70
72
  return /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", "data-roster-empty": !0, children: "—" });
71
- const b = e.slice(0, 4), u = e.length - b.length, v = "flex h-6 w-6 items-center justify-center rounded-full border-2 border-white bg-[#c7f0fb] text-[10px] font-bold leading-none text-[#04516b] dark:border-slate-900 dark:bg-[#0c3b4a] dark:text-[#7dd8f2]";
73
+ const v = e.slice(0, 4), g = e.length - v.length, k = "flex h-6 w-6 items-center justify-center rounded-full border-2 border-white bg-[#c7f0fb] text-[10px] font-bold leading-none text-[#04516b] dark:border-slate-900 dark:bg-[#0c3b4a] dark:text-[#7dd8f2]";
72
74
  return /* @__PURE__ */ r(
73
75
  "span",
74
76
  {
75
77
  ref: s,
76
- onMouseEnter: () => i("hover"),
78
+ onMouseEnter: () => o("hover"),
77
79
  onMouseLeave: w,
78
80
  onClick: (t) => {
79
- t.stopPropagation(), i("pin");
81
+ t.stopPropagation(), o("pin");
80
82
  },
81
83
  className: "inline-flex cursor-pointer items-center",
82
84
  children: [
83
- /* @__PURE__ */ a("span", { className: "flex -space-x-2", children: b.map((t) => /* @__PURE__ */ a(
85
+ /* @__PURE__ */ a("span", { className: "flex -space-x-2", children: v.map((t) => /* @__PURE__ */ a(
84
86
  C,
85
87
  {
86
88
  userId: t.id,
87
89
  className: "h-6 w-6 border-2 border-white dark:border-slate-900",
88
- fallback: /* @__PURE__ */ a("span", { "data-copy-skip": !0, "aria-hidden": "true", className: v, children: k(t.name) })
90
+ fallback: /* @__PURE__ */ a("span", { "data-copy-skip": !0, "aria-hidden": "true", className: k, children: u(t.name) })
89
91
  },
90
92
  t.id
91
93
  )) }),
92
- u > 0 && /* @__PURE__ */ r("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: [
94
+ g > 0 && /* @__PURE__ */ r("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: [
93
95
  "+",
94
- u
96
+ g
95
97
  ] }),
96
98
  l && e.length === 1 && /* @__PURE__ */ a("span", { className: "ml-1.5 max-w-[130px] truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: e[0].name }),
97
- p && K(
99
+ m && K(
98
100
  /* @__PURE__ */ r(
99
101
  "div",
100
102
  {
101
- ref: o,
102
- style: ae(s.current, n),
103
- onMouseEnter: g,
103
+ ref: c,
104
+ style: re(s.current, n),
105
+ onMouseEnter: b,
104
106
  onMouseLeave: w,
105
107
  onMouseDown: (t) => {
106
- t.stopPropagation(), m("pin");
108
+ t.stopPropagation(), p("pin");
107
109
  },
108
110
  onClick: (t) => t.stopPropagation(),
109
111
  className: "w-max min-w-[190px] max-w-[300px] rounded-lg border border-slate-200 bg-white py-1.5 shadow-xl dark:border-slate-600 dark:bg-slate-800",
@@ -113,53 +115,53 @@ function te({
113
115
  " user",
114
116
  e.length === 1 ? "" : "s"
115
117
  ] }),
116
- e.map((t) => /* @__PURE__ */ a("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ a(re, { userId: t.id, size: "compact" }) }, t.id))
118
+ e.map((t) => /* @__PURE__ */ a("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ a(se, { userId: t.id, size: "compact" }) }, t.id))
117
119
  ]
118
120
  }
119
121
  ),
120
- L(s.current)
122
+ T(s.current)
121
123
  )
122
124
  ]
123
125
  }
124
126
  );
125
127
  }
126
- function L(e) {
128
+ function T(e) {
127
129
  return (e == null ? void 0 : e.closest('[role="dialog"]')) ?? document.body;
128
130
  }
129
- function ae(e, l) {
130
- const s = L(e);
131
+ function re(e, l) {
132
+ const s = T(e);
131
133
  if (s === document.body) return { position: "fixed", left: l.x, top: l.y, zIndex: 50 };
132
- const o = s.getBoundingClientRect();
133
- return { position: "absolute", left: l.x - o.left, top: l.y - o.top, zIndex: 120 };
134
+ const c = s.getBoundingClientRect();
135
+ return { position: "absolute", left: l.x - c.left, top: l.y - c.top, zIndex: 120 };
134
136
  }
135
- function ve({
137
+ function Ne({
136
138
  collection: e,
137
139
  itemId: l
138
140
  }) {
139
- const s = B(), { data: o = [], isLoading: d } = _({
141
+ const s = P(), { data: c = [], isLoading: d } = _({
140
142
  queryKey: ["pipeline-owners-resolved", e, l],
141
143
  queryFn: () => s.request(
142
- Z(`/pipelines/instance/${e}/owners/batch`, { ids: [l] })
143
- ).then((p) => {
144
- var m;
145
- return ((m = p.data) == null ? void 0 : m[l]) ?? [];
144
+ Q(`/pipelines/instance/${e}/owners/batch`, { ids: [l] })
145
+ ).then((m) => {
146
+ var p;
147
+ return ((p = m.data) == null ? void 0 : p[l]) ?? [];
146
148
  }),
147
149
  enabled: !!s && !!e && !!l && l !== "new",
148
150
  staleTime: 3e4
149
151
  });
150
- return d ? /* @__PURE__ */ a("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" }) : /* @__PURE__ */ a(te, { users: o });
152
+ return d ? /* @__PURE__ */ a("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" }) : /* @__PURE__ */ a(ne, { users: c });
151
153
  }
152
- function we({
154
+ function Ce({
153
155
  collection: e,
154
156
  itemId: l,
155
157
  label: s
156
158
  }) {
157
- const o = B(), { data: d = [] } = _({
159
+ const c = P(), { data: d = [] } = _({
158
160
  queryKey: ["pipeline-instance-owners", e, l],
159
- queryFn: () => o.request(O(`/pipelines/instance/${e}/${l}/owners`)).then((n) => n.data ?? []),
160
- enabled: !!o && !!e && !!l && l !== "new",
161
+ queryFn: () => c.request(M(`/pipelines/instance/${e}/${l}/owners`)).then((n) => n.data ?? []),
162
+ enabled: !!c && !!e && !!l && l !== "new",
161
163
  staleTime: 3e4
162
- }), p = (n) => [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email, m = (n) => p(n).split(" ").map((x) => x[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
164
+ }), m = (n) => [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email, p = (n) => m(n).split(" ").map((f) => f[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
163
165
  return /* @__PURE__ */ r("div", { children: [
164
166
  /* @__PURE__ */ a("p", { className: "text-[11px] font-medium text-slate-400 mb-1.5", children: s }),
165
167
  d.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: d.map((n) => /* @__PURE__ */ r(
@@ -172,54 +174,54 @@ function we({
172
174
  {
173
175
  userId: n.id,
174
176
  className: "h-6 w-6",
175
- fallback: /* @__PURE__ */ a("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: m(n) })
177
+ fallback: /* @__PURE__ */ a("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: p(n) })
176
178
  }
177
179
  ),
178
- /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700", children: p(n) })
180
+ /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700", children: m(n) })
179
181
  ]
180
182
  },
181
183
  n.id
182
184
  )) })
183
185
  ] });
184
186
  }
185
- function ne({
187
+ function le({
186
188
  user: e,
187
189
  userId: l,
188
190
  initials: s,
189
- navigate: o,
191
+ navigate: c,
190
192
  profileUrl: d,
191
- online: p,
192
- cardId: m,
193
+ online: m,
194
+ cardId: p,
193
195
  onAction: n,
194
- open: x = !1
196
+ open: f = !1
195
197
  }) {
196
- var u;
197
- const { isAdmin: g } = Q(), i = Y(l, x), w = ((u = e == null ? void 0 : e.manager_name) == null ? void 0 : u.trim()) || null, k = (() => {
198
- const v = e == null ? void 0 : e.timezone;
199
- if (!v) return null;
198
+ var k;
199
+ const { isAdmin: b } = H(), o = A(l, f), w = Y().roomOf(l), u = ((k = e == null ? void 0 : e.manager_name) == null ? void 0 : k.trim()) || null, v = (() => {
200
+ const t = e == null ? void 0 : e.timezone;
201
+ if (!t) return null;
200
202
  try {
201
- const t = Intl.DateTimeFormat().resolvedOptions().timeZone;
202
- return v === t ? null : new Intl.DateTimeFormat(void 0, {
203
+ const i = Intl.DateTimeFormat().resolvedOptions().timeZone;
204
+ return t === i ? null : new Intl.DateTimeFormat(void 0, {
203
205
  hour: "numeric",
204
206
  minute: "2-digit",
205
- timeZone: v
207
+ timeZone: t
206
208
  }).format(/* @__PURE__ */ new Date());
207
209
  } catch {
208
210
  return null;
209
211
  }
210
- })(), b = e != null && e.last_access ? (() => {
211
- const v = Date.now() - new Date(e.last_access).getTime(), t = Math.floor(v / 6e4);
212
- if (t < 2) return "Just now";
213
- if (t < 60) return `${t}m ago`;
214
- const c = Math.floor(t / 60);
215
- return c < 24 ? `${c}h ago` : `${Math.floor(c / 24)}d ago`;
212
+ })(), g = e != null && e.last_access ? (() => {
213
+ const t = Date.now() - new Date(e.last_access).getTime(), i = Math.floor(t / 6e4);
214
+ if (i < 2) return "Just now";
215
+ if (i < 60) return `${i}m ago`;
216
+ const x = Math.floor(i / 60);
217
+ return x < 24 ? `${x}h ago` : `${Math.floor(x / 24)}d ago`;
216
218
  })() : null;
217
219
  return /* @__PURE__ */ r(
218
- ee,
220
+ ae,
219
221
  {
220
222
  align: "start",
221
223
  className: "w-72 p-0 overflow-hidden",
222
- "data-nvr-user-card": m ?? "",
224
+ "data-nvr-user-card": p ?? "",
223
225
  children: [
224
226
  /* @__PURE__ */ r("div", { className: "flex items-center gap-3 p-4 bg-gradient-to-br from-nvr-cyan/8 to-nvr-cyan/4 dark:from-nvr-cyan/10 dark:to-transparent border-b border-slate-100 dark:border-border", children: [
225
227
  /* @__PURE__ */ a(
@@ -232,15 +234,15 @@ function ne({
232
234
  ),
233
235
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
234
236
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
235
- (p || i.word) && /* @__PURE__ */ a(
237
+ (m || o.word) && /* @__PURE__ */ a(
236
238
  "span",
237
239
  {
238
- "data-card-presence": i.word ?? "online",
240
+ "data-card-presence": o.word ?? "online",
239
241
  className: J(
240
242
  "h-2 w-2 shrink-0 rounded-full ring-2 ring-white dark:ring-card",
241
- i.word === "away" ? "bg-white ring-amber-400 dark:bg-card" : i.word === "idle" ? "bg-amber-400" : "bg-emerald-400"
243
+ o.word === "away" ? "bg-white ring-amber-400 dark:bg-card" : o.word === "idle" ? "bg-amber-400" : "bg-emerald-400"
242
244
  ),
243
- title: i.word === "away" ? "Away" : i.word === "idle" ? "Idle" : "Online"
245
+ title: o.word === "away" ? "Away" : o.word === "idle" ? "Idle" : "Online"
244
246
  }
245
247
  ),
246
248
  /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100 truncate", children: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : l }),
@@ -253,31 +255,32 @@ function ne({
253
255
  )
254
256
  ] }),
255
257
  ((e == null ? void 0 : e.title) || (e == null ? void 0 : e.department)) && /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-500 dark:text-slate-400 truncate mt-0.5", children: [e.title, e.department].filter(Boolean).join(" · ") }),
256
- i.word && /* @__PURE__ */ r(
258
+ o.word && /* @__PURE__ */ r(
257
259
  "p",
258
260
  {
259
261
  className: "mt-0.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
260
262
  "data-card-presence-line": !0,
261
263
  children: [
262
- i.word === "away" ? "Away" : i.word === "idle" ? `Idle${i.minutes ? ` · ${i.minutes}m` : ""}` : "Online now",
263
- i.page ? ` · on ${i.page}` : ""
264
+ o.word === "away" ? "Away" : o.word === "idle" ? `Idle${o.minutes ? ` · ${o.minutes}m` : ""}` : "Online now",
265
+ o.page ? ` · on ${o.page}` : ""
264
266
  ]
265
267
  }
266
268
  ),
267
- k && /* @__PURE__ */ r("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
269
+ /* @__PURE__ */ a(X, { label: (w == null ? void 0 : w.label) ?? null, className: "mt-0.5" }),
270
+ v && /* @__PURE__ */ r("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
268
271
  "Local time: ",
269
- k
272
+ v
270
273
  ] }),
271
274
  (e == null ? void 0 : e.is_out_of_office) && /* @__PURE__ */ r("span", { className: "mt-1 inline-flex items-center gap-1 rounded-full bg-amber-100 dark:bg-amber-900/30 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: [
272
275
  /* @__PURE__ */ a(R, { className: "h-2.5 w-2.5" }),
273
276
  " Out of office"
274
277
  ] }),
275
278
  /* @__PURE__ */ a(
276
- X,
279
+ I,
277
280
  {
278
281
  email: e == null ? void 0 : e.email,
279
- enabled: x,
280
- canClear: g,
282
+ enabled: f,
283
+ canClear: b,
281
284
  className: "mt-1"
282
285
  }
283
286
  )
@@ -307,24 +310,24 @@ function ne({
307
310
  }
308
311
  )
309
312
  ] }),
310
- ((e == null ? void 0 : e.role_name) || w || b) && /* @__PURE__ */ r("div", { className: "px-4 py-3 space-y-1.5 border-b border-slate-100 dark:border-border", children: [
313
+ ((e == null ? void 0 : e.role_name) || u || g) && /* @__PURE__ */ r("div", { className: "px-4 py-3 space-y-1.5 border-b border-slate-100 dark:border-border", children: [
311
314
  (e == null ? void 0 : e.role_name) && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
312
315
  /* @__PURE__ */ a(q, { className: "h-3.5 w-3.5 shrink-0" }),
313
316
  /* @__PURE__ */ a("span", { children: e.role_name })
314
317
  ] }),
315
- w && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
316
- /* @__PURE__ */ a(M, { className: "h-3.5 w-3.5 shrink-0" }),
318
+ u && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
319
+ /* @__PURE__ */ a(B, { className: "h-3.5 w-3.5 shrink-0" }),
317
320
  /* @__PURE__ */ r("span", { children: [
318
321
  "Reports to",
319
322
  " ",
320
- /* @__PURE__ */ a("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: w })
323
+ /* @__PURE__ */ a("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: u })
321
324
  ] })
322
325
  ] }),
323
- b && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-400", children: [
326
+ g && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-400", children: [
324
327
  /* @__PURE__ */ a(D, { className: "h-3.5 w-3.5 shrink-0" }),
325
328
  /* @__PURE__ */ r("span", { children: [
326
329
  "Last seen ",
327
- b
330
+ g
328
331
  ] })
329
332
  ] })
330
333
  ] }),
@@ -334,11 +337,11 @@ function ne({
334
337
  {
335
338
  type: "button",
336
339
  onClick: () => {
337
- n == null || n(), o(d);
340
+ n == null || n(), c(d);
338
341
  },
339
342
  className: "flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-accent transition-colors",
340
343
  children: [
341
- /* @__PURE__ */ a(M, { className: "h-3.5 w-3.5" }),
344
+ /* @__PURE__ */ a(B, { className: "h-3.5 w-3.5" }),
342
345
  " View profile"
343
346
  ]
344
347
  }
@@ -379,37 +382,37 @@ function ne({
379
382
  }
380
383
  );
381
384
  }
382
- function re({
385
+ function se({
383
386
  userId: e,
384
387
  size: l = "default",
385
388
  children: s
386
389
  }) {
387
- const o = B(), { navigate: d, userUrl: p } = W(), m = p ? p(e) : `/users/${e}`, [n, x] = $(!1), g = P.useId();
388
- T(
390
+ const c = P(), { navigate: d, userUrl: m } = W(), p = m ? m(e) : `/users/${e}`, [n, f] = $(!1), b = L.useId();
391
+ O(
389
392
  n,
390
393
  (t) => {
391
- var c, f, h, y;
392
- return !!((c = t.closest) != null && c.call(t, `[data-nvr-user-card="${CSS.escape(g)}"]`)) || !!((f = t.closest) != null && f.call(t, `[data-nvr-user-chip="${CSS.escape(g)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
394
+ var i, x, h, y;
395
+ return !!((i = t.closest) != null && i.call(t, `[data-nvr-user-card="${CSS.escape(b)}"]`)) || !!((x = t.closest) != null && x.call(t, `[data-nvr-user-chip="${CSS.escape(b)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
393
396
  !!((h = t.closest) != null && h.call(t, "[data-radix-popper-content-wrapper]")) && !((y = t.closest) != null && y.call(t, "[data-nvr-user-card]"));
394
397
  },
395
- () => x(!1)
398
+ () => f(!1)
396
399
  );
397
- const { data: i, isLoading: w } = _({
398
- ...H(o, e),
399
- enabled: !!o && !!e,
400
+ const { data: o, isLoading: w } = _({
401
+ ...Z(c, e),
402
+ enabled: !!c && !!e,
400
403
  staleTime: 12e4
401
- }), { data: k } = _({
404
+ }), { data: u } = _({
402
405
  queryKey: ["user-presence", e],
403
- queryFn: () => o.request(O(`/presence/users/${e}`)).then((t) => t),
404
- enabled: !!o && !!e && n,
406
+ queryFn: () => c.request(M(`/presence/users/${e}`)).then((t) => t),
407
+ enabled: !!c && !!e && n,
405
408
  staleTime: 15e3,
406
409
  refetchInterval: n ? 2e4 : !1
407
- }), b = i ? [i.first_name, i.last_name].filter(Boolean).join(" ") || i.email : e, u = b.split(" ").map((t) => t[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(), v = (k == null ? void 0 : k.online) ?? !1;
410
+ }), v = o ? [o.first_name, o.last_name].filter(Boolean).join(" ") || o.email : e, g = v.split(" ").map((t) => t[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(), k = (u == null ? void 0 : u.online) ?? !1;
408
411
  return w && !s ? l === "compact" ? /* @__PURE__ */ a("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5", children: [
409
412
  /* @__PURE__ */ a("span", { className: "flex h-6 w-6 shrink-0 rounded-full animate-pulse bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
410
413
  /* @__PURE__ */ a("span", { className: "animate-pulse h-2.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" })
411
- ] }) : /* @__PURE__ */ r(I, { open: n, onOpenChange: x, children: [
412
- /* @__PURE__ */ a(A, { asChild: !0, "data-nvr-user-chip": g, children: s || (l === "compact" ? /* @__PURE__ */ r("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: [
414
+ ] }) : /* @__PURE__ */ r(ee, { open: n, onOpenChange: f, children: [
415
+ /* @__PURE__ */ a(te, { asChild: !0, "data-nvr-user-chip": b, children: s || (l === "compact" ? /* @__PURE__ */ r("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: [
413
416
  /* @__PURE__ */ a(
414
417
  C,
415
418
  {
@@ -421,12 +424,12 @@ function re({
421
424
  "data-copy-skip": !0,
422
425
  "aria-hidden": "true",
423
426
  className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[9px] font-bold text-nvr-navy dark:text-nvr-cyan",
424
- children: u
427
+ children: g
425
428
  }
426
429
  )
427
430
  }
428
431
  ),
429
- /* @__PURE__ */ a("span", { className: "text-[11px] font-medium text-slate-600 dark:text-slate-300", children: b })
432
+ /* @__PURE__ */ a("span", { className: "text-[11px] font-medium text-slate-600 dark:text-slate-300", children: v })
430
433
  ] }) : /* @__PURE__ */ r("div", { className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5 hover:bg-slate-100 dark:border-border dark:bg-card dark:hover:bg-accent transition-colors", children: [
431
434
  /* @__PURE__ */ a(
432
435
  C,
@@ -439,32 +442,32 @@ function re({
439
442
  "data-copy-skip": !0,
440
443
  "aria-hidden": "true",
441
444
  className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan",
442
- children: u
445
+ children: g
443
446
  }
444
447
  )
445
448
  }
446
449
  ),
447
- /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children: b })
450
+ /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children: v })
448
451
  ] })) }),
449
452
  /* @__PURE__ */ a(
450
- ne,
453
+ le,
451
454
  {
452
- user: i,
455
+ user: o,
453
456
  userId: e,
454
- initials: u,
457
+ initials: g,
455
458
  navigate: d,
456
- profileUrl: m,
457
- online: v,
458
- cardId: g,
459
- onAction: () => x(!1),
459
+ profileUrl: p,
460
+ online: k,
461
+ cardId: b,
462
+ onAction: () => f(!1),
460
463
  open: n
461
464
  }
462
465
  )
463
466
  ] });
464
467
  }
465
468
  export {
466
- we as OwnersInline,
467
- ve as OwnersInlineCompact,
468
- re as UserChip,
469
- te as UserRosterCluster
469
+ Ce as OwnersInline,
470
+ Ne as OwnersInlineCompact,
471
+ se as UserChip,
472
+ ne as UserRosterCluster
470
473
  };