@nivaro/react 0.3.5 → 0.3.7

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,5 +1,5 @@
1
- import { jsxs as a, jsx as e, Fragment as Ce } from "react/jsx-runtime";
2
- import { useQuery as Ne, useQueryClient as Rt, useMutation as Ee } from "@tanstack/react-query";
1
+ import { jsxs as a, jsx as e, Fragment as _e } from "react/jsx-runtime";
2
+ import { useQuery as Ce, useQueryClient as Rt, useMutation as Ee } from "@tanstack/react-query";
3
3
  import { Search as Wn, Plus as Wa, Hash as _t, Lock as Fa, ChevronLeft as ct, X as dt, PinOff as za, Pin as St, Headphones as Ha, PlayCircle as Ga, MessageCircle as Fn, Users as Tt, AtSign as Qa, AlarmClock as Ka, Sparkles as Ja, BellOff as Sn, PencilLine as Ya, Star as Za, ArchiveRestore as Va, Archive as Xa, Bell as es, LogOut as ts, Info as ns, MapPin as as, Check as At, ArrowUpDown as ss, MessageSquareReply as rs, Quote as ls, ClipboardPlus as os, NotebookPen as is, Bookmark as cs, Pencil as ds, Trash2 as us, AlertTriangle as ms, Paperclip as ps, Bot as hs, CheckCheck as fs, Plane as xs, FilePlus2 as gs } from "lucide-react";
4
4
  import { useState as T, useEffect as ae, useMemo as fe, useRef as oe, useContext as bs } from "react";
5
5
  import { toast as he } from "sonner";
@@ -14,36 +14,37 @@ import { CustomStatusEditor as Ss } from "../CustomStatusEditor.js";
14
14
  import { DoNotDisturbRow as Ts } from "../DoNotDisturb.js";
15
15
  import { FilePreviewLightbox as Us } from "../FilePreviewLightbox.js";
16
16
  import { UserChip as Hn } from "../item-edit/UserChip.js";
17
- import { UserAvatar as Ds } from "../UserAvatar.js";
17
+ import { StaleBuildChip as Ds } from "../StaleBuildChip.js";
18
+ import { UserAvatar as $s } from "../UserAvatar.js";
18
19
  import { Popover as Ye, PopoverTrigger as Ze, PopoverContent as Ve } from "../ui/popover.js";
19
20
  import { SimpleSelect as Ot } from "../ui/SimpleSelect.js";
20
- import { useBotStream as $s, BotStreamBubble as Rs } from "./BotStream.js";
21
- import { MembershipHistory as As, ArchiveSuggestionBanner as Ms } from "./ChannelArchive.js";
22
- import { ChannelExtrasEditor as Os, BulkInvitePanel as Ls, ChannelAuditLog as Ps } from "./ChannelExtras.js";
21
+ import { useBotStream as Rs, BotStreamBubble as As } from "./BotStream.js";
22
+ import { MembershipHistory as Ms, ArchiveSuggestionBanner as Os } from "./ChannelArchive.js";
23
+ import { ChannelExtrasEditor as Ls, BulkInvitePanel as Ps, ChannelAuditLog as Is } from "./ChannelExtras.js";
23
24
  import { ChannelTile as Ke, ChannelLookPicker as Gn } from "./ChannelLook.js";
24
- import { MentionsView as Qn, ScheduledView as Kn, CatchUpView as Jn, useSearchFilterState as Is, FilterToggle as js, ChatSettingsButton as qs, SearchFilterBar as Es } from "./ChatViews.js";
25
- import { ChatComposer as Bs } from "./Composer.js";
26
- import { useMyPreferences as Lt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as Ws, useRoomMembership as Pt, useCreateChannel as Fs, useChatConfig as Me, useChannelMembers as It, useChannelAdmin as Vn, useUserSearch as jt, GENERAL_CHANNEL_ID as Xn, useChatRooms as ea, useArchivedRooms as ta, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as qt, useChatSearch as zs, dmPeer as we, useChatMessages as Hs, useOpenRoomRegistration as Gs, useMarkRoomRead as Qs, useTypingIndicator as Ks, usePeerReadAt as Js, useEntityRoomLink as Ys, useToggleReaction as Zs, useRoomPins as Vs, useTogglePin as Xs, useEditMessage as er, useDeleteMessage as tr, useChatBotName as nr, useChatThread as ar, useRecordBrowserTimezone as sr, chatInitials as rr, chatAvatarColor as lr, useCreateGroupDm as or, canOpenDm as ir, openDmWith as cr, chatRoomTypesQuery as aa, REACTION_EMOJI as dr } from "./chat-core.js";
27
- import { useDraftRooms as ur } from "./chat-drafts.js";
28
- import { useCustomEmoji as mr, EmojiButton as pr, EmojiGlyph as hr } from "./chat-emoji.js";
29
- import { useRoomRecord as sa, useRecordFileTargets as fr } from "./chat-hooks.js";
30
- import { offHoursNote as xr } from "./chat-local-time.js";
31
- import { useMessageWindow as gr } from "./chat-window.js";
25
+ import { MentionsView as Qn, ScheduledView as Kn, CatchUpView as Jn, useSearchFilterState as js, FilterToggle as qs, ChatSettingsButton as Es, SearchFilterBar as Bs } from "./ChatViews.js";
26
+ import { ChatComposer as Ws } from "./Composer.js";
27
+ import { useMyPreferences as Lt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as Fs, useRoomMembership as Pt, useCreateChannel as zs, useChatConfig as Me, useChannelMembers as It, useChannelAdmin as Vn, useUserSearch as jt, GENERAL_CHANNEL_ID as Xn, useChatRooms as ea, useArchivedRooms as ta, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as qt, useChatSearch as Hs, dmPeer as Ne, useChatMessages as Gs, useOpenRoomRegistration as Qs, useMarkRoomRead as Ks, useTypingIndicator as Js, usePeerReadAt as Ys, useEntityRoomLink as Zs, useToggleReaction as Vs, useRoomPins as Xs, useTogglePin as er, useEditMessage as tr, useDeleteMessage as nr, useChatBotName as ar, useChatThread as sr, useRecordBrowserTimezone as rr, chatInitials as lr, chatAvatarColor as or, useCreateGroupDm as ir, canOpenDm as cr, openDmWith as dr, chatRoomTypesQuery as aa, REACTION_EMOJI as ur } from "./chat-core.js";
28
+ import { useDraftRooms as mr } from "./chat-drafts.js";
29
+ import { useCustomEmoji as pr, EmojiButton as hr, EmojiGlyph as fr } from "./chat-emoji.js";
30
+ import { useRoomRecord as sa, useRecordFileTargets as xr } from "./chat-hooks.js";
31
+ import { offHoursNote as gr } from "./chat-local-time.js";
32
+ import { useMessageWindow as br } from "./chat-window.js";
32
33
  import { HuddleFollowHost as $n } from "./huddle/HuddleCollab.js";
33
- import { HuddleControls as br } from "./huddle/HuddleControls.js";
34
- import { HuddleLiveBadge as vr } from "./huddle/HuddleLiveBadge.js";
35
- import { HuddleScheduleCard as yr } from "./huddle/HuddleScheduleCard.js";
36
- import { HuddleScheduleForm as kr } from "./huddle/HuddleScheduleForm.js";
37
- import { HuddleStage as wr } from "./huddle/HuddleStage.js";
38
- import { useHuddleLive as Nr } from "./huddle/huddle-live.js";
34
+ import { HuddleControls as vr } from "./huddle/HuddleControls.js";
35
+ import { HuddleLiveBadge as yr } from "./huddle/HuddleLiveBadge.js";
36
+ import { HuddleScheduleCard as kr } from "./huddle/HuddleScheduleCard.js";
37
+ import { HuddleScheduleForm as wr } from "./huddle/HuddleScheduleForm.js";
38
+ import { HuddleStage as Nr } from "./huddle/HuddleStage.js";
39
+ import { useHuddleLive as Cr } from "./huddle/huddle-live.js";
39
40
  import { stripHuddleRef as Rn, huddleRefOf as An } from "./huddle/huddle-schedule.js";
40
- import { useHuddle as Cr } from "./huddle/useHuddle.js";
41
- import { useMessageActions as _r, MessageActionsMenu as Sr, actionsForMessage as Tr } from "./MessageActions.js";
42
- import { FormattedMessage as Ur, LinkPreviews as Dr } from "./MessageFormat.js";
43
- import { PollCard as $r } from "./PollCard.js";
44
- import { RoomStatusMarks as Rr, headerIconIdle as Mn, headerIconButton as On, RoomHeaderMenu as Ar } from "./RoomHeaderMenu.js";
45
- import { MemberCountLine as Mr, ChannelIntro as Or, WelcomeNote as Lr, ThreadPane as Pr, RoomInfoDrawer as Ir } from "./RoomParts.js";
46
- import { clipInfo as jr, ClipPlayer as qr } from "./ScreenClip.js";
41
+ import { useHuddle as _r } from "./huddle/useHuddle.js";
42
+ import { useMessageActions as Sr, MessageActionsMenu as Tr, actionsForMessage as Ur } from "./MessageActions.js";
43
+ import { FormattedMessage as Dr, LinkPreviews as $r } from "./MessageFormat.js";
44
+ import { PollCard as Rr } from "./PollCard.js";
45
+ import { RoomStatusMarks as Ar, headerIconIdle as Mn, headerIconButton as On, RoomHeaderMenu as Mr } from "./RoomHeaderMenu.js";
46
+ import { MemberCountLine as Or, ChannelIntro as Lr, WelcomeNote as Pr, ThreadPane as Ir, RoomInfoDrawer as jr } from "./RoomParts.js";
47
+ import { clipInfo as qr, ClipPlayer as Er } from "./ScreenClip.js";
47
48
  import { useOutbox as ra } from "./chat-outbox.js";
48
49
  import { OutboxBubbles as la } from "./OutboxBubbles.js";
49
50
  const oa = {
@@ -58,7 +59,7 @@ const oa = {
58
59
  divider: "border-slate-100 dark:border-border/60"
59
60
  }, Et = {};
60
61
  Et.current = oa;
61
- function so({
62
+ function lo({
62
63
  children: n,
63
64
  me: s,
64
65
  onlineUsers: o = [],
@@ -114,7 +115,7 @@ function ie() {
114
115
  return Et.current;
115
116
  }
116
117
  const Ln = /* @__PURE__ */ new WeakMap();
117
- function Er(n, s) {
118
+ function Br(n, s) {
118
119
  const o = String(s).toUpperCase();
119
120
  let r = Ln.get(n);
120
121
  r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, Ln.set(n, r));
@@ -138,9 +139,9 @@ function Er(n, s) {
138
139
  });
139
140
  }
140
141
  function Bt(n, s = !0) {
141
- const o = Je(), { data: r } = Ne({
142
+ const o = Je(), { data: r } = Ce({
142
143
  queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
143
- queryFn: () => Er(o, n),
144
+ queryFn: () => Br(o, n),
144
145
  enabled: !!n && s,
145
146
  staleTime: 6e4
146
147
  });
@@ -168,14 +169,14 @@ function da(n) {
168
169
  timeZone: Mt() ?? void 0
169
170
  })}` : "Out of office" : null;
170
171
  }
171
- function Br({ id: n, size: s }) {
172
+ function Wr({ id: n, size: s }) {
172
173
  const { state: o, title: r, page: l } = ca(n), i = Bt(n), d = o === "offline" ? ia(i) : null, c = da(i), h = s >= 30 ? 10 : 8, f = [
173
174
  d ? `Offline · ${d}` : r,
174
175
  l && o !== "offline" ? `On ${l}` : null,
175
176
  c,
176
177
  c && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
177
178
  ].filter(Boolean).join(" · ");
178
- return /* @__PURE__ */ a(Ce, { children: [
179
+ return /* @__PURE__ */ a(_e, { children: [
179
180
  /* @__PURE__ */ e(
180
181
  "span",
181
182
  {
@@ -217,14 +218,14 @@ function Z({
217
218
  style: {
218
219
  width: o,
219
220
  height: o,
220
- backgroundColor: lr(n),
221
+ backgroundColor: or(n),
221
222
  fontSize: o * 0.36
222
223
  },
223
224
  "aria-hidden": !0,
224
- children: rr(s)
225
+ children: lr(s)
225
226
  }
226
227
  ), d = /* @__PURE__ */ e(
227
- Ds,
228
+ $s,
228
229
  {
229
230
  userId: n,
230
231
  fallback: i,
@@ -234,10 +235,10 @@ function Z({
234
235
  ), c = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === String(n).toUpperCase();
235
236
  return !r || c ? d : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: o, height: o }, children: [
236
237
  d,
237
- /* @__PURE__ */ e(Br, { id: n, size: o })
238
+ /* @__PURE__ */ e(Wr, { id: n, size: o })
238
239
  ] });
239
240
  }
240
- function Wr({ peerId: n, name: s }) {
241
+ function Fr({ peerId: n, name: s }) {
241
242
  const o = qt(), r = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === n.toUpperCase(), l = /* @__PURE__ */ e(Z, { id: n, name: s, size: 28 });
242
243
  return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: l }) : /* @__PURE__ */ e(Hn, { userId: n, children: /* @__PURE__ */ e(
243
244
  "button",
@@ -251,7 +252,7 @@ function Wr({ peerId: n, name: s }) {
251
252
  ) });
252
253
  }
253
254
  function Pn({ token: n, url: s, mine: o }) {
254
- const r = Me(), l = ie(), i = Je(), { data: d } = Ne(aa(i)), { data: c } = Ne({
255
+ const r = Me(), l = ie(), i = Je(), { data: d } = Ce(aa(i)), { data: c } = Ce({
255
256
  queryKey: ["nvr-chat-entity-card", n],
256
257
  queryFn: async () => {
257
258
  var u, p, b, U;
@@ -325,11 +326,11 @@ function Pn({ token: n, url: s, mine: o }) {
325
326
  }
326
327
  );
327
328
  }
328
- function Fr(n) {
329
+ function zr(n) {
329
330
  const s = new Date(n), o = /* @__PURE__ */ new Date(), r = new Date(o);
330
331
  return r.setDate(o.getDate() - 1), s.toDateString() === o.toDateString() ? "Today" : s.toDateString() === r.toDateString() ? "Yesterday" : s.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
331
332
  }
332
- function zr({ botName: n }) {
333
+ function Hr({ botName: n }) {
333
334
  const s = ie(), o = [
334
335
  {
335
336
  k: "@name",
@@ -393,8 +394,8 @@ function zr({ botName: n }) {
393
394
  )) })
394
395
  ] });
395
396
  }
396
- function Hr({ room: n }) {
397
- const s = Me(), o = ie(), r = Je(), l = n.indexOf(":"), i = l > 0 ? n.slice(0, l) : null, d = l > 0 ? n.slice(l + 1) : null, c = !!i && !!d && n !== s.globalRoom && i !== "dm" && i !== "ch", h = Rt(), { data: f } = Ne({
397
+ function Gr({ room: n }) {
398
+ const s = Me(), o = ie(), r = Je(), l = n.indexOf(":"), i = l > 0 ? n.slice(0, l) : null, d = l > 0 ? n.slice(l + 1) : null, c = !!i && !!d && n !== s.globalRoom && i !== "dm" && i !== "ch", h = Rt(), { data: f } = Ce({
398
399
  queryKey: ["nvr-chat-room-card", n],
399
400
  queryFn: async () => {
400
401
  var R, G, H, V;
@@ -487,7 +488,7 @@ function Hr({ room: n }) {
487
488
  }
488
489
  );
489
490
  }
490
- function Gr(n, s) {
491
+ function Qr(n, s) {
491
492
  if (!n) return null;
492
493
  const o = Mt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
493
494
  let l, i;
@@ -510,19 +511,19 @@ function ua() {
510
511
  return () => clearInterval(o);
511
512
  }, []), n;
512
513
  }
513
- function Qr({ peerId: n, name: s }) {
514
+ function Kr({ peerId: n, name: s }) {
514
515
  ua();
515
516
  const { state: o, title: r } = ca(n), l = Bt(n), i = o === "online" ? "Active now" : o === "offline" ? (() => {
516
517
  const f = ia(l);
517
518
  return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
518
- })() : r, d = Gr((l == null ? void 0 : l.timezone) ?? null, s), c = da(l), h = c ? (l == null ? void 0 : l.delegate) ?? null : null;
519
+ })() : r, d = Qr((l == null ? void 0 : l.timezone) ?? null, s), c = da(l), h = c ? (l == null ? void 0 : l.delegate) ?? null : null;
519
520
  return /* @__PURE__ */ a(
520
521
  "p",
521
522
  {
522
523
  className: "flex min-w-0 items-center gap-1.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
523
524
  "data-chat-dm-peer-line": o,
524
525
  children: [
525
- c && /* @__PURE__ */ a(Ce, { children: [
526
+ c && /* @__PURE__ */ a(_e, { children: [
526
527
  /* @__PURE__ */ e(
527
528
  "span",
528
529
  {
@@ -531,11 +532,11 @@ function Qr({ peerId: n, name: s }) {
531
532
  children: c
532
533
  }
533
534
  ),
534
- h && ir() && /* @__PURE__ */ a(
535
+ h && cr() && /* @__PURE__ */ a(
535
536
  "button",
536
537
  {
537
538
  type: "button",
538
- onClick: () => cr(h.id, h.name),
539
+ onClick: () => dr(h.id, h.name),
539
540
  className: "shrink-0 font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-slate-200 dark:hover:text-white",
540
541
  "data-chat-dm-delegate": h.id,
541
542
  children: [
@@ -548,7 +549,7 @@ function Qr({ peerId: n, name: s }) {
548
549
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" })
549
550
  ] }),
550
551
  /* @__PURE__ */ e("span", { className: "truncate", children: i }),
551
- d && /* @__PURE__ */ a(Ce, { children: [
552
+ d && /* @__PURE__ */ a(_e, { children: [
552
553
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" }),
553
554
  /* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (l == null ? void 0 : l.timezone) ?? void 0, children: d })
554
555
  ] })
@@ -567,18 +568,18 @@ function In({
567
568
  openThread: c = null
568
569
  }) {
569
570
  var pn, hn, fn, xn, gn, bn, vn, yn, kn, wn;
570
- const h = Me(), f = ie(), u = Je(), p = h.me, b = Cr(n), U = p ? we(n, p.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Ne({
571
+ const h = Me(), f = ie(), u = Je(), p = h.me, b = _r(n), U = p ? Ne(n, p.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Ce({
571
572
  ..._s(u, U),
572
573
  enabled: !!U && $,
573
574
  staleTime: 12e4
574
575
  }), S = $ && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : s, [W, M] = T(d);
575
576
  ae(() => M(d), [d]);
576
- const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } = Hs(
577
+ const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } = Gs(
577
578
  n,
578
579
  W
579
580
  );
580
- Gs(n);
581
- const se = ra(n), ee = Qs(), te = Ks(n), ge = Js(n.startsWith("dm:") ? n : null), de = Ys(n), A = Zs(n), w = Vs(n), P = Xs(n), x = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== h.globalRoom && n.includes(":"), j = sa(n, x), _e = fr(n, !!j), Se = n.startsWith("ch:"), { data: ue = [] } = Ne({
581
+ Qs(n);
582
+ const se = ra(n), ee = Ks(), te = Js(n), ge = Ys(n.startsWith("dm:") ? n : null), de = Zs(n), A = Vs(n), w = Xs(n), P = er(n), x = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== h.globalRoom && n.includes(":"), q = sa(n, x), ve = xr(n, !!q), Se = n.startsWith("ch:"), { data: ue = [] } = Ce({
582
583
  queryKey: ["chat-read-marks", n],
583
584
  queryFn: () => u.request(
584
585
  xe(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
@@ -588,43 +589,43 @@ function In({
588
589
  staleTime: 15e3
589
590
  }), Oe = (t) => ue.filter(
590
591
  (m) => m.user !== String(t.sender ?? "") && new Date(m.last_read_at).getTime() >= new Date(t.date_created).getTime()
591
- ), ve = Rt(), { data: ye = [] } = Ne({
592
+ ), ye = Rt(), { data: ke = [] } = Ce({
592
593
  queryKey: ["chat-saved"],
593
594
  queryFn: () => u.request(xe("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
594
595
  staleTime: 6e4
595
- }), $e = fe(() => new Set(ye.map((t) => t.id)), [ye]), k = Ee({
596
+ }), $e = fe(() => new Set(ke.map((t) => t.id)), [ke]), k = Ee({
596
597
  mutationFn: (t) => u.request(Be(`/chat/messages/${t}/save`, {})),
597
- onSuccess: () => void ve.invalidateQueries({ queryKey: ["chat-saved"] })
598
- }), [L, q] = T(null), X = Ee({
598
+ onSuccess: () => void ye.invalidateQueries({ queryKey: ["chat-saved"] })
599
+ }), [L, I] = T(null), X = Ee({
599
600
  mutationFn: () => u.request(
600
601
  Be("/chat/rooms/summary", { room: n })
601
602
  ).then((t) => t.data),
602
- onSuccess: (t) => q((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
603
- onError: () => q("Summary unavailable.")
603
+ onSuccess: (t) => I((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
604
+ onError: () => I("Summary unavailable.")
604
605
  }), Te = Ee({
605
606
  mutationFn: async (t) => {
606
- if (!j || !p) throw new Error("no record");
607
+ if (!q || !p) throw new Error("no record");
607
608
  await u.request(
608
609
  Be("/tasks", {
609
- collection: j.collection,
610
- item: String(j.id),
610
+ collection: q.collection,
611
+ item: String(q.id),
611
612
  title: t.message.replace(/<[^>]*>/g, "").slice(0, 200),
612
613
  assignee: p.id
613
614
  })
614
615
  );
615
616
  },
616
617
  onSuccess: () => {
617
- j && Cs(ve, j.collection, j.id), he.success("Task created from message — assigned to you");
618
+ q && Cs(ye, q.collection, q.id), he.success("Task created from message — assigned to you");
618
619
  },
619
620
  onError: () => he.error("Could not create a task")
620
621
  }), _ = Ee({
621
622
  mutationFn: (t) => u.request(Be(`/chat/messages/${t.id}/to-notes`, {})),
622
- onSuccess: () => he.success(`Copied to the Notes of ${(j == null ? void 0 : j.label) ?? "the record"}`),
623
+ onSuccess: () => he.success(`Copied to the Notes of ${(q == null ? void 0 : q.label) ?? "the record"}`),
623
624
  onError: (t) => {
624
625
  var m;
625
626
  return he.error(((m = t == null ? void 0 : t.response) == null ? void 0 : m.error) ?? "Could not copy it");
626
627
  }
627
- }), I = Ee({
628
+ }), j = Ee({
628
629
  mutationFn: (t) => u.request(
629
630
  Be(`/chat/messages/${t.messageId}/attach-to-record`, {
630
631
  file_id: t.fileId,
@@ -634,7 +635,7 @@ function In({
634
635
  onSuccess: (t, m) => {
635
636
  var N;
636
637
  return he.success(
637
- `Attached to ${(j == null ? void 0 : j.label) ?? "the record"} — ${((N = _e.find((Q) => Q.field === m.field)) == null ? void 0 : N.label) ?? m.field}`
638
+ `Attached to ${(q == null ? void 0 : q.label) ?? "the record"} — ${((N = ve.find((Q) => Q.field === m.field)) == null ? void 0 : N.label) ?? m.field}`
638
639
  );
639
640
  },
640
641
  onError: (t) => {
@@ -645,14 +646,14 @@ function In({
645
646
  }
646
647
  }), E = Ee({
647
648
  mutationFn: (t) => u.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
648
- onSuccess: () => void ve.invalidateQueries({ queryKey: ["nvr-chat", n] })
649
- }), ne = er(n), K = tr(n), { isAdmin: F } = ut(), { setMuted: J, setNotifyMode: fa, setArchived: xa, setStarred: ga, dismissWelcome: ba, leave: va } = Pt(), { rooms: ya, loading: ka } = ea(), Ft = ya.find((t) => t.room === n) ?? null, { rooms: wa } = ta(!ka && !Ft), y = Ft ?? wa.find((t) => t.room === n) ?? null, Na = ma(y), zt = y != null && y.muted ? "muted" : (y == null ? void 0 : y.notify_mode) === "mentions" ? "mentions" : "all", ce = nr(), [Xe, Ca] = T(!1), [et, Ht] = T(""), [_a, mt] = T(null), [Gt, Qt] = T(""), [Sa, pt] = T(null), Ta = _r(n), [Ua, Kt] = T(null), [Jt, Yt] = T(null), [Zt, Le] = T(null), Vt = ar(c ? n : null, c), Xt = !!Vt.root && !Vt.root.deleted_at;
649
+ onSuccess: () => void ye.invalidateQueries({ queryKey: ["nvr-chat", n] })
650
+ }), ne = tr(n), K = nr(n), { isAdmin: F } = ut(), { setMuted: J, setNotifyMode: fa, setArchived: xa, setStarred: ga, dismissWelcome: ba, leave: va } = Pt(), { rooms: ya, loading: ka } = ea(), Ft = ya.find((t) => t.room === n) ?? null, { rooms: wa } = ta(!ka && !Ft), y = Ft ?? wa.find((t) => t.room === n) ?? null, Na = ma(y), zt = y != null && y.muted ? "muted" : (y == null ? void 0 : y.notify_mode) === "mentions" ? "mentions" : "all", ce = ar(), [Xe, Ca] = T(!1), [et, Ht] = T(""), [_a, mt] = T(null), [Gt, Qt] = T(""), [Sa, pt] = T(null), Ta = Sr(n), [Ua, Kt] = T(null), [Jt, Yt] = T(null), [Zt, Le] = T(null), Vt = sr(c ? n : null, c), Xt = !!Vt.root && !Vt.root.deleted_at;
650
651
  ae(() => {
651
652
  c && Xt && Le(c);
652
653
  }, [c, Xt]);
653
654
  const [Da, en] = T(null), [$a, tn] = T(null), [ht, We] = T(!1), [Ra, ft] = T(!1), [le, Fe] = T(null), [ze, tt] = T(
654
655
  d && "around" in d ? d.around : null
655
- ), [nt, xt] = T(null), He = $s(n, (p == null ? void 0 : p.id) ?? null), nn = oe(null), gt = oe(null), bt = oe(Math.max(0, i ?? 0)), Ue = oe(!1), Re = oe(null), an = oe(null), re = oe(!d), Ge = oe(0), Qe = oe(null), vt = oe(0), at = () => {
656
+ ), [nt, xt] = T(null), He = Rs(n, (p == null ? void 0 : p.id) ?? null), nn = oe(null), gt = oe(null), bt = oe(Math.max(0, i ?? 0)), Ue = oe(!1), Re = oe(null), an = oe(null), re = oe(!d), Ge = oe(0), Qe = oe(null), vt = oe(0), at = () => {
656
657
  const t = Re.current;
657
658
  t && (t.scrollTop = t.scrollHeight);
658
659
  }, yt = (t) => {
@@ -721,7 +722,7 @@ function In({
721
722
  const t = /* @__PURE__ */ new Set();
722
723
  for (const m of v) for (const N of m.attachments ?? []) t.add(N);
723
724
  return [...t];
724
- }, [v]), { data: kt } = Ne({
725
+ }, [v]), { data: kt } = Ce({
725
726
  queryKey: ["nvr-chat-attachments", st.slice().sort().join("|")],
726
727
  queryFn: async () => {
727
728
  const t = await u.request(
@@ -744,26 +745,26 @@ function In({
744
745
  const m = ce.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
745
746
  new RegExp(`@\\[?${m}\\]?\\b`, "i").test(t) && xt(Date.now());
746
747
  }
747
- }, Pe = (hn = p == null ? void 0 : p.id) == null ? void 0 : hn.toLowerCase(), me = Xe && et.trim().length > 0, ke = fe(
748
+ }, Pe = (hn = p == null ? void 0 : p.id) == null ? void 0 : hn.toLowerCase(), me = Xe && et.trim().length > 0, we = fe(
748
749
  () => me ? v.filter((t) => t.message.toLowerCase().includes(et.trim().toLowerCase())) : v,
749
750
  [v, me, et]
750
751
  ), Ma = fe(() => {
751
752
  var t;
752
753
  if (me) return -1;
753
- for (let m = ke.length - 1; m >= 0; m--)
754
- if (((t = ke[m].sender) == null ? void 0 : t.toLowerCase()) === Pe) return m;
754
+ for (let m = we.length - 1; m >= 0; m--)
755
+ if (((t = we[m].sender) == null ? void 0 : t.toLowerCase()) === Pe) return m;
755
756
  return -1;
756
- }, [ke, Pe, me]), rn = ge ? new Date(ge).getTime() : 0, Ie = Lt().chat_density === "compact" ? "compact" : "comfortable", ln = oe(null), Oa = fe(() => ke.map((t) => t.id), [ke]), be = gr({
757
+ }, [we, Pe, me]), rn = ge ? new Date(ge).getTime() : 0, Ie = Lt().chat_density === "compact" ? "compact" : "comfortable", ln = oe(null), Oa = fe(() => we.map((t) => t.id), [we]), be = br({
757
758
  scrollerRef: Re,
758
759
  listRef: ln,
759
760
  ids: Oa,
760
761
  estimate: Ie === "compact" ? 40 : 72,
761
762
  resetKey: `${n}|${JSON.stringify(W)}|${me ? "search" : ""}`,
762
763
  pinnedRef: re
763
- }), z = (y == null ? void 0 : y.channel) ?? null, on = !!z && !!p && String(z.created_by ?? "").toUpperCase() === p.id.toUpperCase(), cn = z != null && z.announce && !on && !F ? z.id === Xn ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, dn = p ? we(n, p.id) : null, La = Bt(dn);
764
+ }), z = (y == null ? void 0 : y.channel) ?? null, on = !!z && !!p && String(z.created_by ?? "").toUpperCase() === p.id.toUpperCase(), cn = z != null && z.announce && !on && !F ? z.id === Xn ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, dn = p ? Ne(n, p.id) : null, La = Bt(dn);
764
765
  ua();
765
- const Pa = dn ? xr(La, S, /* @__PURE__ */ new Date()) : null;
766
- sr(), mr();
766
+ const Pa = dn ? gr(La, S, /* @__PURE__ */ new Date()) : null;
767
+ rr(), pr();
767
768
  const Ia = !!(z != null && z.welcome_note) && !!(y != null && y.joined) && !(y != null && y.welcome_seen_at) && !z.is_direct, ja = (t, m) => t.entity ? /* @__PURE__ */ e(Pn, { token: t.text, url: h.entityUrl(t.entity) }, m) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), qa = (t, m) => t.entity ? /* @__PURE__ */ e(Pn, { token: t.text, url: h.entityUrl(t.entity), mine: !0 }, m) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), un = (t, m = {}) => {
768
769
  var Nn, Cn;
769
770
  const N = ((Nn = t.sender) == null ? void 0 : Nn.toLowerCase()) === Pe;
@@ -837,7 +838,7 @@ function In({
837
838
  ),
838
839
  "data-chat-msg-actions": !0,
839
840
  children: [
840
- dr.map((D) => /* @__PURE__ */ e(
841
+ ur.map((D) => /* @__PURE__ */ e(
841
842
  "button",
842
843
  {
843
844
  type: "button",
@@ -849,7 +850,7 @@ function In({
849
850
  D
850
851
  )),
851
852
  /* @__PURE__ */ e(
852
- pr,
853
+ hr,
853
854
  {
854
855
  label: "More reactions",
855
856
  className: qe,
@@ -881,7 +882,7 @@ function In({
881
882
  children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
882
883
  }
883
884
  ),
884
- j && /* @__PURE__ */ a(Ce, { children: [
885
+ q && /* @__PURE__ */ a(_e, { children: [
885
886
  /* @__PURE__ */ e(
886
887
  "button",
887
888
  {
@@ -896,7 +897,7 @@ function In({
896
897
  "button",
897
898
  {
898
899
  type: "button",
899
- title: `Copy into the Notes of ${j.label}`,
900
+ title: `Copy into the Notes of ${q.label}`,
900
901
  onClick: () => _.mutate(t),
901
902
  className: qe,
902
903
  "data-chat-to-notes": !0,
@@ -964,10 +965,10 @@ function In({
964
965
  }
965
966
  )),
966
967
  /* @__PURE__ */ e(
967
- Sr,
968
+ Tr,
968
969
  {
969
970
  messageId: t.id,
970
- actions: Tr(Ta, t, Pe),
971
+ actions: Ur(Ta, t, Pe),
971
972
  navigate: h.navigate,
972
973
  onOpenChange: (D) => Kt(D ? t.id : null)
973
974
  }
@@ -1052,7 +1053,7 @@ function In({
1052
1053
  }
1053
1054
  ),
1054
1055
  t.message && Rn(t.message) && (l ? l(t, { mine: N }) : /* @__PURE__ */ e(
1055
- Ur,
1056
+ Dr,
1056
1057
  {
1057
1058
  text: Rn(t.message),
1058
1059
  mine: N,
@@ -1063,31 +1064,31 @@ function In({
1063
1064
  }
1064
1065
  )),
1065
1066
  An(t.message) != null && /* @__PURE__ */ e(
1066
- yr,
1067
+ kr,
1067
1068
  {
1068
1069
  id: An(t.message),
1069
1070
  mine: N,
1070
1071
  renderAvatar: (D, O) => /* @__PURE__ */ e(Z, { id: D, name: O, size: 18, presence: !1 })
1071
1072
  }
1072
1073
  ),
1073
- t.poll && /* @__PURE__ */ e($r, { poll: t.poll, room: t.room, mine: N }),
1074
+ t.poll && /* @__PURE__ */ e(Rr, { poll: t.poll, room: t.room, mine: N }),
1074
1075
  (t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: g("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((D) => {
1075
- const O = kt == null ? void 0 : kt.get(D), rt = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", wt = u.fileUrl(D), Ea = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), lt = jr(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), _n = () => Yt({
1076
+ const O = kt == null ? void 0 : kt.get(D), rt = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", wt = u.fileUrl(D), Ea = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), lt = qr(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), _n = () => Yt({
1076
1077
  id: D,
1077
1078
  url: wt,
1078
1079
  name: rt,
1079
1080
  type: (O == null ? void 0 : O.type) ?? null,
1080
1081
  size: (O == null ? void 0 : O.filesize) ?? null
1081
- }), ot = j && _e.length > 0 ? /* @__PURE__ */ e(
1082
- Jr,
1082
+ }), ot = q && ve.length > 0 ? /* @__PURE__ */ e(
1083
+ Yr,
1083
1084
  {
1084
- targets: _e,
1085
- recordLabel: j.label,
1086
- onPick: (Ba) => I.mutate({ messageId: t.id, fileId: D, field: Ba })
1085
+ targets: ve,
1086
+ recordLabel: q.label,
1087
+ onPick: (Ba) => j.mutate({ messageId: t.id, fileId: D, field: Ba })
1087
1088
  }
1088
1089
  ) : null;
1089
1090
  return lt ? /* @__PURE__ */ e(
1090
- qr,
1091
+ Er,
1091
1092
  {
1092
1093
  url: wt,
1093
1094
  poster: lt.poster ? u.fileUrl(lt.poster) : null,
@@ -1138,7 +1139,7 @@ function In({
1138
1139
  }
1139
1140
  ),
1140
1141
  !Y && !De && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
1141
- Dr,
1142
+ $r,
1142
1143
  {
1143
1144
  text: t.message,
1144
1145
  navigate: h.navigate,
@@ -1161,7 +1162,7 @@ function In({
1161
1162
  O.mine ? g("font-semibold", f.accentSoft, "border-transparent") : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted"
1162
1163
  ),
1163
1164
  children: [
1164
- /* @__PURE__ */ e(hr, { value: D }),
1165
+ /* @__PURE__ */ e(fr, { value: D }),
1165
1166
  /* @__PURE__ */ e("span", { className: "tabular-nums", children: O.count })
1166
1167
  ]
1167
1168
  },
@@ -1218,7 +1219,7 @@ function In({
1218
1219
  var O;
1219
1220
  const D = Oe(t);
1220
1221
  return D.length === 0 ? null : /* @__PURE__ */ e(
1221
- Vr,
1222
+ Xr,
1222
1223
  {
1223
1224
  seen: D,
1224
1225
  channelId: ((O = y == null ? void 0 : y.channel) == null ? void 0 : O.id) ?? null,
@@ -1239,7 +1240,7 @@ function In({
1239
1240
  }
1240
1241
  );
1241
1242
  }, mn = (t) => /* @__PURE__ */ e(
1242
- Bs,
1243
+ Ws,
1243
1244
  {
1244
1245
  ref: t ? void 0 : nn,
1245
1246
  room: n,
@@ -1290,11 +1291,11 @@ function In({
1290
1291
  }
1291
1292
  ),
1292
1293
  ((y == null ? void 0 : y.kind) === "channel" && !((fn = y.channel) != null && fn.is_direct) || (y == null ? void 0 : y.kind) === "global" && (((xn = y.channel) == null ? void 0 : xn.icon) || ((gn = y.channel) == null ? void 0 : gn.color))) && /* @__PURE__ */ e(Ke, { icon: (bn = y == null ? void 0 : y.channel) == null ? void 0 : bn.icon, color: (vn = y == null ? void 0 : y.channel) == null ? void 0 : vn.color, size: 24 }),
1293
- p && we(n, p.id) && /* @__PURE__ */ e(Wr, { peerId: we(n, p.id), name: S }),
1294
+ p && Ne(n, p.id) && /* @__PURE__ */ e(Fr, { peerId: Ne(n, p.id), name: S }),
1294
1295
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1295
1296
  /* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1296
1297
  /* @__PURE__ */ e("span", { className: "truncate", children: S }),
1297
- y && /* @__PURE__ */ e(Rr, { starred: !!y.starred, notify: zt }),
1298
+ y && /* @__PURE__ */ e(Ar, { starred: !!y.starred, notify: zt }),
1298
1299
  (z == null ? void 0 : z.announce) && /* @__PURE__ */ e(
1299
1300
  "span",
1300
1301
  {
@@ -1304,8 +1305,8 @@ function In({
1304
1305
  }
1305
1306
  )
1306
1307
  ] }),
1307
- p && we(n, p.id) ? /* @__PURE__ */ e(Qr, { peerId: we(n, p.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1308
- Mr,
1308
+ p && Ne(n, p.id) ? /* @__PURE__ */ e(Kr, { peerId: Ne(n, p.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1309
+ Or,
1309
1310
  {
1310
1311
  room: n,
1311
1312
  me: ((yn = h.me) == null ? void 0 : yn.id) ?? null,
@@ -1314,7 +1315,7 @@ function In({
1314
1315
  ) : null
1315
1316
  ] }),
1316
1317
  /* @__PURE__ */ e(
1317
- br,
1318
+ vr,
1318
1319
  {
1319
1320
  room: n,
1320
1321
  roomLabel: S,
@@ -1336,7 +1337,7 @@ function In({
1336
1337
  children: /* @__PURE__ */ e(Wn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1337
1338
  }
1338
1339
  ),
1339
- ((kn = y == null ? void 0 : y.channel) == null ? void 0 : kn.is_direct) && /* @__PURE__ */ e(Xr, { channel: y.channel, onLeft: o }),
1340
+ ((kn = y == null ? void 0 : y.channel) == null ? void 0 : kn.is_direct) && /* @__PURE__ */ e(el, { channel: y.channel, onLeft: o }),
1340
1341
  /* @__PURE__ */ e(
1341
1342
  "button",
1342
1343
  {
@@ -1353,11 +1354,11 @@ function In({
1353
1354
  }
1354
1355
  ),
1355
1356
  /* @__PURE__ */ e(
1356
- Ar,
1357
+ Mr,
1357
1358
  {
1358
1359
  th: f,
1359
1360
  huddleSchedule: b.enabled ? (t) => /* @__PURE__ */ e(
1360
- kr,
1361
+ wr,
1361
1362
  {
1362
1363
  room: n,
1363
1364
  me: (p == null ? void 0 : p.id) ?? null,
@@ -1384,7 +1385,7 @@ function In({
1384
1385
  try {
1385
1386
  let N = [];
1386
1387
  if (n.startsWith("dm:") && p) {
1387
- const Q = we(n, p.id);
1388
+ const Q = Ne(n, p.id);
1388
1389
  if (Q) {
1389
1390
  const Y = await u.request(
1390
1391
  xe(`/users/${Q}`)
@@ -1431,12 +1432,12 @@ function In({
1431
1432
  }), o();
1432
1433
  }
1433
1434
  }) : void 0,
1434
- tips: /* @__PURE__ */ e(zr, { botName: ce })
1435
+ tips: /* @__PURE__ */ e(Hr, { botName: ce })
1435
1436
  }
1436
1437
  )
1437
1438
  ] }),
1438
1439
  /* @__PURE__ */ e(
1439
- wr,
1440
+ Nr,
1440
1441
  {
1441
1442
  room: n,
1442
1443
  me: p,
@@ -1455,9 +1456,9 @@ function In({
1455
1456
  "aria-label": "Search messages"
1456
1457
  }
1457
1458
  ) }),
1458
- /* @__PURE__ */ e(Hr, { room: n }),
1459
+ /* @__PURE__ */ e(Gr, { room: n }),
1459
1460
  z && !z.is_direct && /* @__PURE__ */ e(
1460
- Or,
1461
+ Lr,
1461
1462
  {
1462
1463
  description: z.description,
1463
1464
  links: z.links,
@@ -1482,7 +1483,7 @@ function In({
1482
1483
  }
1483
1484
  ) }),
1484
1485
  (z == null ? void 0 : z.archive_suggested_at) && z.id !== 0 && (on || F) && /* @__PURE__ */ e(
1485
- Ms,
1486
+ Os,
1486
1487
  {
1487
1488
  channelId: z.id,
1488
1489
  channelName: S,
@@ -1490,7 +1491,7 @@ function In({
1490
1491
  }
1491
1492
  ),
1492
1493
  Ia && (z == null ? void 0 : z.welcome_note) && /* @__PURE__ */ e(
1493
- Lr,
1494
+ Pr,
1494
1495
  {
1495
1496
  note: z.welcome_note,
1496
1497
  channelName: S,
@@ -1523,7 +1524,7 @@ function In({
1523
1524
  children: V ? "Loading…" : "Load earlier messages"
1524
1525
  }
1525
1526
  ) }),
1526
- B ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : ke.length === 0 && se.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: me ? "No messages match." : W ? "Nothing was said around then." : /* @__PURE__ */ a(Ce, { children: [
1527
+ B ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : we.length === 0 && se.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: me ? "No messages match." : W ? "Nothing was said around then." : /* @__PURE__ */ a(_e, { children: [
1527
1528
  /* @__PURE__ */ e("p", { children: "No messages yet — say hello." }),
1528
1529
  /* @__PURE__ */ a("p", { className: "mt-1 text-[11px]", children: [
1529
1530
  "Tip: @ mentions someone",
@@ -1536,9 +1537,9 @@ function In({
1536
1537
  ref: ln,
1537
1538
  style: be.windowed ? { paddingTop: be.padTop, paddingBottom: be.padBottom } : void 0,
1538
1539
  "data-chat-rows": be.windowed ? "windowed" : "all",
1539
- children: ke.slice(be.start, be.end).map((t, m) => {
1540
+ children: we.slice(be.start, be.end).map((t, m) => {
1540
1541
  var De;
1541
- const N = be.start + m, Q = ke[N - 1], Y = N === 0 || Q && new Date(Q.date_created).toDateString() !== new Date(t.date_created).toDateString(), Ae = !me && !W && bt.current > 0 && N === Math.max(0, ke.length - bt.current), je = Ie === "compact" && !Y && !!Q && Q.sender === t.sender && !Q.is_system && new Date(t.date_created).getTime() - new Date(Q.date_created).getTime() < 5 * 6e4;
1542
+ const N = be.start + m, Q = we[N - 1], Y = N === 0 || Q && new Date(Q.date_created).toDateString() !== new Date(t.date_created).toDateString(), Ae = !me && !W && bt.current > 0 && N === Math.max(0, we.length - bt.current), je = Ie === "compact" && !Y && !!Q && Q.sender === t.sender && !Q.is_system && new Date(t.date_created).getTime() - new Date(Q.date_created).getTime() < 5 * 6e4;
1542
1543
  return /* @__PURE__ */ a(
1543
1544
  "div",
1544
1545
  {
@@ -1548,7 +1549,7 @@ function In({
1548
1549
  children: [
1549
1550
  Y && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
1550
1551
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
1551
- /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Fr(t.date_created) }),
1552
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: zr(t.date_created) }),
1552
1553
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
1553
1554
  ] }),
1554
1555
  Ae && /* @__PURE__ */ a(
@@ -1588,7 +1589,7 @@ function In({
1588
1589
  ),
1589
1590
  !me && !G && /* @__PURE__ */ e(la, { items: se, th: f }),
1590
1591
  !me && !G && He.live && ce && /* @__PURE__ */ e(
1591
- Rs,
1592
+ As,
1592
1593
  {
1593
1594
  live: He.live,
1594
1595
  botName: ce,
@@ -1639,7 +1640,7 @@ function In({
1639
1640
  Jt && /* @__PURE__ */ e(Us, { file: Jt, onClose: () => Yt(null) }),
1640
1641
  mn(null),
1641
1642
  Zt != null && /* @__PURE__ */ e(
1642
- Pr,
1643
+ Ir,
1643
1644
  {
1644
1645
  room: n,
1645
1646
  rootId: Zt,
@@ -1647,11 +1648,11 @@ function In({
1647
1648
  onClose: () => Le(null),
1648
1649
  renderRow: (t) => un(t, { inThread: !0 }),
1649
1650
  renderComposer: (t) => mn(t),
1650
- renderOutbox: (t) => /* @__PURE__ */ e(Kr, { room: n, parentId: t, th: f })
1651
+ renderOutbox: (t) => /* @__PURE__ */ e(Jr, { room: n, parentId: t, th: f })
1651
1652
  }
1652
1653
  ),
1653
1654
  ht && /* @__PURE__ */ e(
1654
- Ir,
1655
+ jr,
1655
1656
  {
1656
1657
  room: n,
1657
1658
  label: S,
@@ -1668,11 +1669,11 @@ function In({
1668
1669
  }
1669
1670
  );
1670
1671
  }
1671
- function Kr({ room: n, parentId: s, th: o }) {
1672
+ function Jr({ room: n, parentId: s, th: o }) {
1672
1673
  const r = ra(n, s);
1673
1674
  return /* @__PURE__ */ e(la, { items: r, th: o });
1674
1675
  }
1675
- function Jr({
1676
+ function Yr({
1676
1677
  targets: n,
1677
1678
  recordLabel: s,
1678
1679
  onPick: o
@@ -1721,20 +1722,20 @@ function jn(n) {
1721
1722
  color: n.color ?? null
1722
1723
  };
1723
1724
  }
1724
- const Yr = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1725
+ const Zr = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1725
1726
  function Dt(n) {
1726
1727
  const s = typeof n.idle_minutes == "number" ? n.idle_minutes : n.last_active ? Math.floor((Date.now() - new Date(n.last_active).getTime()) / 6e4) : null;
1727
1728
  return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
1728
1729
  }
1729
1730
  function qn(n) {
1730
1731
  const s = n == null ? void 0 : n.trim();
1731
- return !s || Yr.test(s) ? null : s;
1732
+ return !s || Zr.test(s) ? null : s;
1732
1733
  }
1733
- function Zr(n) {
1734
+ function Vr(n) {
1734
1735
  const s = new Date(n), o = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
1735
1736
  return s.toDateString() === o.toDateString() ? r : (o.getTime() - s.getTime()) / 864e5 < 6 ? `${s.toLocaleDateString("en-US", { weekday: "short" })} ${r}` : `${s.toLocaleDateString("en-US", { month: "short", day: "numeric" })}, ${r}`;
1736
1737
  }
1737
- function Vr({
1738
+ function Xr({
1738
1739
  seen: n,
1739
1740
  channelId: s,
1740
1741
  senderId: o
@@ -1783,11 +1784,11 @@ function Vr({
1783
1784
  {
1784
1785
  className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
1785
1786
  "data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
1786
- children: Zr(u.last_read_at)
1787
+ children: Vr(u.last_read_at)
1787
1788
  }
1788
1789
  )
1789
1790
  ] }, u.user)),
1790
- h.length > 0 && /* @__PURE__ */ a(Ce, { children: [
1791
+ h.length > 0 && /* @__PURE__ */ a(_e, { children: [
1791
1792
  /* @__PURE__ */ a("p", { className: "px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1792
1793
  "Not seen yet · ",
1793
1794
  h.length
@@ -1807,7 +1808,7 @@ function Vr({
1807
1808
  )
1808
1809
  ] });
1809
1810
  }
1810
- function Xr({ channel: n, onLeft: s }) {
1811
+ function el({ channel: n, onLeft: s }) {
1811
1812
  var B;
1812
1813
  const o = ie(), r = Me(), { isAdmin: l } = ut(), [i, d] = T(!1), { members: c, loading: h } = It(n.id), { addMember: f, removeMember: u } = Vn(n.id), [p, b] = T(""), U = Wt(p, 250), $ = ((B = r.me) == null ? void 0 : B.id.toUpperCase()) ?? "", C = l || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = jt(U, i && C && !!p.trim()), W = new Set(c.map((R) => String(R.user).toUpperCase())), M = (R) => [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.user, v = [...c].sort((R, G) => {
1813
1814
  const H = String(R.user).toUpperCase(), V = String(G.user).toUpperCase();
@@ -1929,7 +1930,7 @@ function Xr({ channel: n, onLeft: s }) {
1929
1930
  )
1930
1931
  ] });
1931
1932
  }
1932
- function el({
1933
+ function tl({
1933
1934
  channel: n,
1934
1935
  label: s,
1935
1936
  onBack: o
@@ -1956,7 +1957,7 @@ function el({
1956
1957
  ] })
1957
1958
  ] }),
1958
1959
  /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-3", children: [
1959
- te ? /* @__PURE__ */ a(Ce, { children: [
1960
+ te ? /* @__PURE__ */ a(_e, { children: [
1960
1961
  /* @__PURE__ */ a("label", { className: "block", children: [
1961
1962
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Name" }),
1962
1963
  /* @__PURE__ */ e(
@@ -2058,7 +2059,7 @@ function el({
2058
2059
  )
2059
2060
  ] }),
2060
2061
  f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: f.error.message }),
2061
- !n.is_direct && /* @__PURE__ */ e(Os, { channel: n, th: r, isAdmin: i })
2062
+ !n.is_direct && /* @__PURE__ */ e(Ls, { channel: n, th: r, isAdmin: i })
2062
2063
  ] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
2063
2064
  n.topic || "No topic set.",
2064
2065
  /* @__PURE__ */ e("br", {}),
@@ -2117,10 +2118,10 @@ function el({
2117
2118
  }) }),
2118
2119
  /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] leading-snug text-slate-400", children: "Only members can see an invite-only channel — it is not listed to anyone else." })
2119
2120
  ] }),
2120
- te && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Ls, { channelId: n.id, th: r }) })
2121
+ te && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Ps, { channelId: n.id, th: r }) })
2121
2122
  ] }),
2122
- te && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(As, { channelId: n.id, border: r.divider }),
2123
- !n.is_direct && /* @__PURE__ */ e(Ps, { channelId: n.id, th: r })
2123
+ te && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Ms, { channelId: n.id, border: r.divider }),
2124
+ !n.is_direct && /* @__PURE__ */ e(Is, { channelId: n.id, th: r })
2124
2125
  ] })
2125
2126
  ] });
2126
2127
  }
@@ -2144,11 +2145,11 @@ function En(n) {
2144
2145
  var s;
2145
2146
  return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
2146
2147
  }
2147
- function tl(n, s) {
2148
+ function nl(n, s) {
2148
2149
  const o = (i, d) => i.label.localeCompare(d.label), r = (i, d) => En(d) - En(i) || o(i, d), l = [...n];
2149
2150
  return s === "alpha" ? l.sort(o) : s === "unread" ? l.sort((i, d) => +(d.unread > 0) - +(i.unread > 0) || r(i, d)) : l.sort(r);
2150
2151
  }
2151
- function nl({
2152
+ function al({
2152
2153
  value: n,
2153
2154
  onChange: s
2154
2155
  }) {
@@ -2194,7 +2195,7 @@ function Bn({
2194
2195
  loading: l = !1,
2195
2196
  onView: i
2196
2197
  }) {
2197
- const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } = Pt(), b = Is(), U = fe(
2198
+ const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } = Pt(), b = js(), U = fe(
2198
2199
  () => new Map(
2199
2200
  c.onlineUsers.map((w) => [
2200
2201
  String(w.user_id).toUpperCase(),
@@ -2202,11 +2203,11 @@ function Bn({
2202
2203
  ])
2203
2204
  ),
2204
2205
  [c.onlineUsers]
2205
- ), $ = qt(), C = Nr(), [S, W] = T(""), M = Wt(S.trim(), 250), { hits: v, loading: B } = zs(M, b.filters), R = M.length >= 2 || b.active, G = fe(() => {
2206
+ ), $ = qt(), C = Cr(), [S, W] = T(""), M = Wt(S.trim(), 250), { hits: v, loading: B } = Hs(M, b.filters), R = M.length >= 2 || b.active, G = fe(() => {
2206
2207
  const w = /* @__PURE__ */ new Map();
2207
2208
  for (const P of v) w.set(P.room, [...w.get(P.room) ?? [], P]);
2208
2209
  return [...w.entries()].sort((P, x) => x[1].length - P[1].length);
2209
- }, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = ur(), se = fe(() => new Map(n.map((w) => [w.room, w])), [n]), ee = Lt(), te = Yn(), ge = ee.chat_sidebar_sort === "unread" || ee.chat_sidebar_sort === "alpha" ? ee.chat_sidebar_sort : "recent", de = tl(
2210
+ }, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = mr(), se = fe(() => new Map(n.map((w) => [w.room, w])), [n]), ee = Lt(), te = Yn(), ge = ee.chat_sidebar_sort === "unread" || ee.chat_sidebar_sort === "alpha" ? ee.chat_sidebar_sort : "recent", de = nl(
2210
2211
  M ? n.filter((w) => w.label.toLowerCase().includes(M.toLowerCase())) : n,
2211
2212
  ge
2212
2213
  ), A = (w) => {
@@ -2229,15 +2230,15 @@ function Bn({
2229
2230
  "data-chat-global-search": !0
2230
2231
  }
2231
2232
  ),
2232
- !r && /* @__PURE__ */ e(js, { open: b.open, active: b.active, onClick: () => b.setOpen(!b.open) }),
2233
+ !r && /* @__PURE__ */ e(qs, { open: b.open, active: b.active, onClick: () => b.setOpen(!b.open) }),
2233
2234
  /* @__PURE__ */ e(
2234
- nl,
2235
+ al,
2235
2236
  {
2236
2237
  value: ge,
2237
2238
  onChange: (w) => te.mutate({ chat_sidebar_sort: w === "recent" ? null : w })
2238
2239
  }
2239
2240
  ),
2240
- !r && /* @__PURE__ */ e(qs, {}),
2241
+ !r && /* @__PURE__ */ e(Es, {}),
2241
2242
  o && /* @__PURE__ */ e(
2242
2243
  "button",
2243
2244
  {
@@ -2250,7 +2251,7 @@ function Bn({
2250
2251
  }
2251
2252
  )
2252
2253
  ] }),
2253
- !r && b.open && /* @__PURE__ */ e(Es, { filters: b.filters, onChange: b.setFilters, rooms: n, th: d }),
2254
+ !r && b.open && /* @__PURE__ */ e(Bs, { filters: b.filters, onChange: b.setFilters, rooms: n, th: d }),
2254
2255
  !r && i && !R && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2255
2256
  /* @__PURE__ */ a(
2256
2257
  "button",
@@ -2309,25 +2310,25 @@ function Bn({
2309
2310
  /* @__PURE__ */ e("span", { className: "truncate", children: (x == null ? void 0 : x.label) ?? w }),
2310
2311
  /* @__PURE__ */ e("span", { className: "rounded-full bg-slate-100 px-1.5 text-[10px] font-medium tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: P.length })
2311
2312
  ] }),
2312
- P.slice(0, 5).map((j) => /* @__PURE__ */ a(
2313
+ P.slice(0, 5).map((q) => /* @__PURE__ */ a(
2313
2314
  "button",
2314
2315
  {
2315
2316
  type: "button",
2316
2317
  disabled: !x,
2317
2318
  onClick: () => {
2318
- x && s(x, { around: j.parent_id ?? j.id });
2319
+ x && s(x, { around: q.parent_id ?? q.id });
2319
2320
  },
2320
2321
  className: "flex w-full flex-col gap-0.5 rounded-lg px-2.5 py-1.5 text-left transition-colors hover:bg-slate-50 disabled:cursor-default dark:hover:bg-muted/50",
2321
- "data-chat-search-hit": j.id,
2322
+ "data-chat-search-hit": q.id,
2322
2323
  children: [
2323
2324
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
2324
- /* @__PURE__ */ e("span", { className: "truncate", children: j.sender_name ?? "Someone" }),
2325
- /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(j.date_created).toLocaleDateString() })
2325
+ /* @__PURE__ */ e("span", { className: "truncate", children: q.sender_name ?? "Someone" }),
2326
+ /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(q.date_created).toLocaleDateString() })
2326
2327
  ] }),
2327
- /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: j.message })
2328
+ /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: q.message })
2328
2329
  ]
2329
2330
  },
2330
- j.id
2331
+ q.id
2331
2332
  )),
2332
2333
  P.length > 5 && x && /* @__PURE__ */ a(
2333
2334
  "button",
@@ -2403,7 +2404,7 @@ function Bn({
2403
2404
  ([w, P]) => P.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
2404
2405
  /* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: w }),
2405
2406
  P.map((x) => {
2406
- var j, _e, Se, ue, Oe, ve;
2407
+ var q, ve, Se, ue, Oe, ye;
2407
2408
  return /* @__PURE__ */ a("div", { className: "group/room relative", children: [
2408
2409
  /* @__PURE__ */ a(
2409
2410
  "button",
@@ -2413,26 +2414,26 @@ function Bn({
2413
2414
  className: "flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
2414
2415
  children: [
2415
2416
  (() => {
2416
- const ye = x.kind === "dm" && c.me ? we(x.room, c.me.id) : null;
2417
- if (!ye) return null;
2418
- const $e = U.get(ye.toUpperCase()) ?? "offline";
2419
- return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": $e, children: /* @__PURE__ */ e(Z, { id: ye, name: x.label, size: 32 }) });
2417
+ const ke = x.kind === "dm" && c.me ? Ne(x.room, c.me.id) : null;
2418
+ if (!ke) return null;
2419
+ const $e = U.get(ke.toUpperCase()) ?? "offline";
2420
+ return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": $e, children: /* @__PURE__ */ e(Z, { id: ke, name: x.label, size: 32 }) });
2420
2421
  })(),
2421
- x.kind === "channel" && !((j = x.channel) != null && j.is_direct) || x.kind === "global" && ((_e = x.channel) != null && _e.icon || (Se = x.channel) != null && Se.color) ? /* @__PURE__ */ e(Ke, { icon: (ue = x.channel) == null ? void 0 : ue.icon, color: (Oe = x.channel) == null ? void 0 : Oe.color, size: 32 }) : /* @__PURE__ */ e(
2422
+ x.kind === "channel" && !((q = x.channel) != null && q.is_direct) || x.kind === "global" && ((ve = x.channel) != null && ve.icon || (Se = x.channel) != null && Se.color) ? /* @__PURE__ */ e(Ke, { icon: (ue = x.channel) == null ? void 0 : ue.icon, color: (Oe = x.channel) == null ? void 0 : Oe.color, size: 32 }) : /* @__PURE__ */ e(
2422
2423
  "span",
2423
2424
  {
2424
2425
  className: g(
2425
2426
  "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400",
2426
- x.kind === "dm" && c.me && we(x.room, c.me.id) && "hidden"
2427
+ x.kind === "dm" && c.me && Ne(x.room, c.me.id) && "hidden"
2427
2428
  ),
2428
- children: x.kind === "dm" ? /* @__PURE__ */ e(Fn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (ve = x.channel) != null && ve.is_direct ? /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(_t, { className: "h-4 w-4", strokeWidth: 1.8 })
2429
+ children: x.kind === "dm" ? /* @__PURE__ */ e(Fn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (ye = x.channel) != null && ye.is_direct ? /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(_t, { className: "h-4 w-4", strokeWidth: 1.8 })
2429
2430
  }
2430
2431
  ),
2431
2432
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2432
2433
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
2433
2434
  /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: x.label }),
2434
2435
  x.muted && /* @__PURE__ */ e(Sn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2435
- /* @__PURE__ */ e(vr, { count: C.countFor(x.room), label: x.label }),
2436
+ /* @__PURE__ */ e(yr, { count: C.countFor(x.room), label: x.label }),
2436
2437
  V.has(x.room) && /* @__PURE__ */ e(
2437
2438
  Ya,
2438
2439
  {
@@ -2532,7 +2533,7 @@ function Bn({
2532
2533
  )
2533
2534
  ] });
2534
2535
  }
2535
- function ro({
2536
+ function oo({
2536
2537
  view: n,
2537
2538
  rooms: s,
2538
2539
  onBack: o,
@@ -2551,13 +2552,13 @@ function ro({
2551
2552
  }
2552
2553
  ) : /* @__PURE__ */ e(Jn, { rooms: s, th: l, onBack: o, onOpen: r });
2553
2554
  }
2554
- function al({
2555
+ function sl({
2555
2556
  onOpen: n
2556
2557
  }) {
2557
2558
  const s = ie(), [o, r] = T(""), [l, i] = T(!1), [d, c] = T(""), [h, f] = T("open"), [u, p] = T(""), [b, U] = T({
2558
2559
  icon: null,
2559
2560
  color: null
2560
- }), $ = Zn(), { channels: C, loading: S } = Ws(o), { join: W } = Pt(), M = Fs();
2561
+ }), $ = Zn(), { channels: C, loading: S } = Fs(o), { join: W } = Pt(), M = zs();
2561
2562
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
2562
2563
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
2563
2564
  /* @__PURE__ */ a("div", { className: "relative flex-1", children: [
@@ -2720,11 +2721,11 @@ function al({
2720
2721
  ] })
2721
2722
  ] });
2722
2723
  }
2723
- function sl() {
2724
+ function rl() {
2724
2725
  const n = /* @__PURE__ */ new Date();
2725
2726
  return n.setHours(23, 59, 59, 999), n;
2726
2727
  }
2727
- function rl() {
2728
+ function ll() {
2728
2729
  const n = Lt(), s = Yn(), [o, r] = T(!1), l = n.presence_override, i = !!l && l.mode === "away" && !(l.until && new Date(l.until).getTime() < Date.now()), d = (h) => {
2729
2730
  s.mutate({
2730
2731
  presence_override: h === "off" ? null : { mode: "away", until: (h == null ? void 0 : h.toISOString()) ?? null }
@@ -2776,7 +2777,7 @@ function rl() {
2776
2777
  [
2777
2778
  ["1 hour", () => new Date(Date.now() + 36e5)],
2778
2779
  ["4 hours", () => new Date(Date.now() + 4 * 36e5)],
2779
- ["The rest of today", sl],
2780
+ ["The rest of today", rl],
2780
2781
  ["Until I switch it off", () => null]
2781
2782
  ].map(([h, f]) => /* @__PURE__ */ e(
2782
2783
  "button",
@@ -2795,7 +2796,7 @@ function rl() {
2795
2796
  }
2796
2797
  );
2797
2798
  }
2798
- function ll({ myStatus: n }) {
2799
+ function ol({ myStatus: n }) {
2799
2800
  const s = ie();
2800
2801
  return /* @__PURE__ */ e(
2801
2802
  Ss,
@@ -2808,7 +2809,7 @@ function ll({ myStatus: n }) {
2808
2809
  }
2809
2810
  function pa() {
2810
2811
  var l, i, d;
2811
- const n = Je(), { data: s, isFetched: o } = Ne({
2812
+ const n = Je(), { data: s, isFetched: o } = Ce({
2812
2813
  queryKey: ["presence-online"],
2813
2814
  queryFn: () => n.request(xe("/presence/online")),
2814
2815
  // Matches the presence heartbeat cadence — the page someone is on should
@@ -2835,11 +2836,11 @@ function ha(n) {
2835
2836
  const o = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((l) => !o.has(l));
2836
2837
  return r.length === 0 ? "Home" : r.map((l, i) => i === 0 ? l.replace(/[-_]/g, " ").replace(/\b\w/g, (d) => d.toUpperCase()) : l).join(" › ");
2837
2838
  }
2838
- function ol({
2839
+ function il({
2839
2840
  onClose: n,
2840
2841
  onCreated: s
2841
2842
  }) {
2842
- const o = ie(), [r, l] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = jt(r, !0), u = or(), p = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ") || (b.email ?? "Unknown");
2843
+ const o = ie(), [r, l] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = jt(r, !0), u = ir(), p = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ") || (b.email ?? "Unknown");
2843
2844
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
2844
2845
  /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
2845
2846
  /* @__PURE__ */ e(
@@ -2945,14 +2946,14 @@ function ol({
2945
2946
  ] });
2946
2947
  }
2947
2948
  const $t = "nvr-chat-pinned", Ct = 400;
2948
- function il() {
2949
+ function cl() {
2949
2950
  try {
2950
2951
  return typeof window < "u" && window.localStorage.getItem($t) === "1";
2951
2952
  } catch {
2952
2953
  return !1;
2953
2954
  }
2954
2955
  }
2955
- function cl() {
2956
+ function dl() {
2956
2957
  const n = "(min-width: 1024px)", [s, o] = T(
2957
2958
  () => {
2958
2959
  var r;
@@ -2967,7 +2968,7 @@ function cl() {
2967
2968
  return r.addEventListener("change", l), () => r.removeEventListener("change", l);
2968
2969
  }, []), s;
2969
2970
  }
2970
- function lo({
2971
+ function io({
2971
2972
  open: n,
2972
2973
  onClose: s,
2973
2974
  renderMessageBody: o,
@@ -2975,7 +2976,7 @@ function lo({
2975
2976
  requestedRoom: l
2976
2977
  }) {
2977
2978
  var $e;
2978
- const i = Me(), d = ie(), c = i.me, [h, f] = T(il), u = cl(), p = h && u, b = () => {
2979
+ const i = Me(), d = ie(), c = i.me, [h, f] = T(cl), u = dl(), p = h && u, b = () => {
2979
2980
  const k = !h;
2980
2981
  f(k);
2981
2982
  try {
@@ -2987,42 +2988,42 @@ function lo({
2987
2988
  if (!n || !p) return;
2988
2989
  const k = document.body, L = k.style.paddingRight;
2989
2990
  k.style.paddingRight = `${Ct}px`, k.dataset.nvrChatPinned = "1";
2990
- const q = document.createElement("style");
2991
- return q.dataset.nvrChatPinnedStyle = "", q.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
2992
- body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, document.head.appendChild(q), () => {
2993
- k.style.paddingRight = L, delete k.dataset.nvrChatPinned, q.remove();
2991
+ const I = document.createElement("style");
2992
+ return I.dataset.nvrChatPinnedStyle = "", I.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
2993
+ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, document.head.appendChild(I), () => {
2994
+ k.style.paddingRight = L, delete k.dataset.nvrChatPinned, I.remove();
2994
2995
  };
2995
2996
  }, [n, p]);
2996
- const [U, $] = T("online"), [C, S] = T(null), [W, M] = T(null), v = (k, L, q) => {
2997
+ const [U, $] = T("online"), [C, S] = T(null), [W, M] = T(null), v = (k, L, I) => {
2997
2998
  const X = ee.find((Te) => Te.room === k);
2998
- H(!1), S({ room: k, label: (X == null ? void 0 : X.label) ?? L, channel: X == null ? void 0 : X.channel, anchor: q });
2999
- }, [B, R] = T(!1), [G, H] = T(!1), [V, se] = T(null), { rooms: ee, totalUnread: te } = ea(), ge = ta(U === "archived"), de = (k, L, q) => {
2999
+ H(!1), S({ room: k, label: (X == null ? void 0 : X.label) ?? L, channel: X == null ? void 0 : X.channel, anchor: I });
3000
+ }, [B, R] = T(!1), [G, H] = T(!1), [V, se] = T(null), { rooms: ee, totalUnread: te } = ea(), ge = ta(U === "archived"), de = (k, L, I) => {
3000
3001
  var Te, _;
3001
3002
  if (!L) return [{ key: "all", label: null, users: k }];
3002
3003
  const X = /* @__PURE__ */ new Map();
3003
- for (const I of k) {
3004
- const E = q.get(String(I.user_id).toUpperCase()), ne = L === "__role__" ? [qn((E == null ? void 0 : E.role_name) ?? I.role_name) || "No role"] : (_ = (Te = E == null ? void 0 : E.scopes_by_dimension) == null ? void 0 : Te[L]) != null && _.length ? E.scopes_by_dimension[L] : ["Unassigned"], K = [...new Set(ne)].sort((F, J) => F.localeCompare(J)).join(", ");
3005
- X.set(K, [...X.get(K) ?? [], I]);
3004
+ for (const j of k) {
3005
+ const E = I.get(String(j.user_id).toUpperCase()), ne = L === "__role__" ? [qn((E == null ? void 0 : E.role_name) ?? j.role_name) || "No role"] : (_ = (Te = E == null ? void 0 : E.scopes_by_dimension) == null ? void 0 : Te[L]) != null && _.length ? E.scopes_by_dimension[L] : ["Unassigned"], K = [...new Set(ne)].sort((F, J) => F.localeCompare(J)).join(", ");
3006
+ X.set(K, [...X.get(K) ?? [], j]);
3006
3007
  }
3007
- return [...X.entries()].sort((I, E) => I[0] === "Unassigned" ? 1 : E[0] === "Unassigned" ? -1 : I[0].localeCompare(E[0])).map(([I, E]) => ({ key: I, label: I, users: E }));
3008
- }, [A, w] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), P = pa(), x = P.loaded ? i.onlineUsers.filter((k) => P.byUser.has(String(k.user_id).toUpperCase())) : [], j = fe(
3008
+ return [...X.entries()].sort((j, E) => j[0] === "Unassigned" ? 1 : E[0] === "Unassigned" ? -1 : j[0].localeCompare(E[0])).map(([j, E]) => ({ key: j, label: j, users: E }));
3009
+ }, [A, w] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), P = pa(), x = P.loaded ? i.onlineUsers.filter((k) => P.byUser.has(String(k.user_id).toUpperCase())) : [], q = fe(
3009
3010
  () => de(x, A, P.byUser),
3010
3011
  // biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
3011
3012
  [x, A, P.byUser]
3012
- ), { isAdmin: _e } = ut(), { navigate: Se } = vs(), ue = (k) => {
3013
+ ), { isAdmin: ve } = ut(), { navigate: Se } = vs(), ue = (k) => {
3013
3014
  /^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : Se(k);
3014
3015
  }, Oe = (k) => {
3015
3016
  c && ($("chat"), S({ room: Ut(c.id, k.user_id), label: k.display_name ?? "Direct message" }));
3016
- }, ve = oe(0);
3017
+ }, ye = oe(0);
3017
3018
  ae(() => {
3018
- !r || !c || r.nonce === ve.current || (ve.current = r.nonce, $("chat"), H(!1), S({
3019
+ !r || !c || r.nonce === ye.current || (ye.current = r.nonce, $("chat"), H(!1), S({
3019
3020
  room: Ut(c.id, r.userId),
3020
3021
  label: r.name ?? "Direct message"
3021
3022
  }));
3022
3023
  }, [r, c]);
3023
- const ye = oe(0);
3024
+ const ke = oe(0);
3024
3025
  return ae(() => {
3025
- !l || l.nonce === ye.current || (ye.current = l.nonce, $("chat"), H(!1), S({ room: l.room, label: l.label ?? l.room }));
3026
+ !l || l.nonce === ke.current || (ke.current = l.nonce, $("chat"), H(!1), S({ room: l.room, label: l.label ?? l.room }));
3026
3027
  }, [l]), n ? /* @__PURE__ */ a(
3027
3028
  "div",
3028
3029
  {
@@ -3105,12 +3106,12 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
3105
3106
  ] }),
3106
3107
  U === "online" ? /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", "data-chat-online": !0, children: [
3107
3108
  /* @__PURE__ */ e(
3108
- ll,
3109
+ ol,
3109
3110
  {
3110
3111
  myStatus: c ? (($e = P.byUser.get(String(c.id).toUpperCase())) == null ? void 0 : $e.custom_status) ?? null : null
3111
3112
  }
3112
3113
  ),
3113
- /* @__PURE__ */ e(rl, {}),
3114
+ /* @__PURE__ */ e(ll, {}),
3114
3115
  /* @__PURE__ */ e(Ts, {}),
3115
3116
  x.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
3116
3117
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
@@ -3135,13 +3136,13 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
3135
3136
  }
3136
3137
  )
3137
3138
  ] }),
3138
- x.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12px] text-slate-400", children: "No one else is online right now." }) : j.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3139
+ x.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12px] text-slate-400", children: "No one else is online right now." }) : q.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3139
3140
  k.label !== null && /* @__PURE__ */ a("div", { className: "sticky top-0 z-[1] flex items-center gap-1.5 bg-white/95 px-2 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 backdrop-blur dark:bg-card/95", children: [
3140
3141
  k.label,
3141
3142
  /* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
3142
3143
  ] }),
3143
3144
  k.users.map((L) => {
3144
- const q = P.byUser.get(String(L.user_id).toUpperCase()), X = (q == null ? void 0 : q.is_idle) ?? L.is_idle, Te = q ?? L;
3145
+ const I = P.byUser.get(String(L.user_id).toUpperCase()), X = (I == null ? void 0 : I.is_idle) ?? L.is_idle, Te = I ?? L;
3145
3146
  return /* @__PURE__ */ a(
3146
3147
  "button",
3147
3148
  {
@@ -3154,16 +3155,16 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
3154
3155
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
3155
3156
  /* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
3156
3157
  L.display_name ?? "Unknown user",
3157
- X && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: q != null && q.away ? "Away" : Dt(Te) }),
3158
- !X && (q == null ? void 0 : q.stuck) && (() => {
3159
- const _ = q.stuck, I = P.fields.includes("page"), E = Tn(
3160
- q.current_path,
3161
- q.app,
3158
+ X && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: I != null && I.away ? "Away" : Dt(Te) }),
3159
+ !X && (I == null ? void 0 : I.stuck) && (() => {
3160
+ const _ = I.stuck, j = P.fields.includes("page"), E = Tn(
3161
+ I.current_path,
3162
+ I.app,
3162
3163
  P.adminUrl,
3163
3164
  i.recordUrl,
3164
3165
  typeof window > "u" ? null : window.location.origin
3165
3166
  ), ne = `${Un(_)} — at the keyboard, on the same page, nothing saved for ten minutes${E ? `
3166
- ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
3167
+ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
3167
3168
  return E ? (
3168
3169
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3169
3170
  /* @__PURE__ */ e(
@@ -3195,10 +3196,10 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3195
3196
  );
3196
3197
  })(),
3197
3198
  (() => {
3198
- var I;
3199
- const _ = (I = P.byUser.get(
3199
+ var j;
3200
+ const _ = (j = P.byUser.get(
3200
3201
  String(L.user_id).toUpperCase()
3201
- )) == null ? void 0 : I.masquerade;
3202
+ )) == null ? void 0 : j.masquerade;
3202
3203
  return _ ? /* @__PURE__ */ a(
3203
3204
  "span",
3204
3205
  {
@@ -3211,11 +3212,12 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3211
3212
  ]
3212
3213
  }
3213
3214
  ) : null;
3214
- })()
3215
+ })(),
3216
+ ve && /* @__PURE__ */ e(Ds, { builds: I == null ? void 0 : I.stale_build })
3215
3217
  ] }),
3216
3218
  (() => {
3217
- const _ = P.byUser.get(String(L.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
3218
- return !I && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
3219
+ const _ = P.byUser.get(String(L.user_id).toUpperCase()), j = _ == null ? void 0 : _.custom_status;
3220
+ return !j && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
3219
3221
  "span",
3220
3222
  {
3221
3223
  className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
@@ -3229,34 +3231,34 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3229
3231
  "data-tip": "In a huddle right now",
3230
3232
  children: [
3231
3233
  /* @__PURE__ */ e(Ha, { className: "h-3 w-3", strokeWidth: 2 }),
3232
- !I && "In a huddle"
3234
+ !j && "In a huddle"
3233
3235
  ]
3234
3236
  }
3235
3237
  ),
3236
- I && /* @__PURE__ */ a("span", { className: "truncate italic", children: [
3237
- I.emoji ? `${I.emoji} ` : "",
3238
- I.text
3238
+ j && /* @__PURE__ */ a("span", { className: "truncate italic", children: [
3239
+ j.emoji ? `${j.emoji} ` : "",
3240
+ j.text
3239
3241
  ] })
3240
3242
  ]
3241
3243
  }
3242
3244
  );
3243
3245
  })(),
3244
3246
  (() => {
3245
- const _ = P.byUser.get(String(L.user_id).toUpperCase()), I = [];
3247
+ const _ = P.byUser.get(String(L.user_id).toUpperCase()), j = [];
3246
3248
  let E = null;
3247
3249
  for (const K of P.fields)
3248
3250
  if (K === "role") {
3249
3251
  const F = qn((_ == null ? void 0 : _.role_name) ?? L.role_name);
3250
- F && I.push(F);
3252
+ F && j.push(F);
3251
3253
  } else if (K === "scopes") {
3252
3254
  const F = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
3253
- F && I.push(F);
3255
+ F && j.push(F);
3254
3256
  } else if (K === "page") {
3255
3257
  const F = (_ == null ? void 0 : _.page) ?? L.page ?? ha((_ == null ? void 0 : _.current_path) ?? L.current_path), J = (_ == null ? void 0 : _.app) ?? L.app;
3256
3258
  E = (J ? `${F ?? ""}${F ? " · " : ""}${J}`.trim() : F) || null;
3257
3259
  }
3258
- const ne = I.join(" · ");
3259
- return !ne && !E ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(Ce, { children: [
3260
+ const ne = j.join(" · ");
3261
+ return !ne && !E ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(_e, { children: [
3260
3262
  ne && /* @__PURE__ */ e(
3261
3263
  "span",
3262
3264
  {
@@ -3273,7 +3275,7 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3273
3275
  P.adminUrl,
3274
3276
  i.recordUrl,
3275
3277
  typeof window > "u" ? null : window.location.origin
3276
- ), F = /* @__PURE__ */ a(Ce, { children: [
3278
+ ), F = /* @__PURE__ */ a(_e, { children: [
3277
3279
  /* @__PURE__ */ e(as, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
3278
3280
  /* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: E })
3279
3281
  ] });
@@ -3314,8 +3316,8 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3314
3316
  (() => {
3315
3317
  var K;
3316
3318
  const _ = P.byUser.get(String(L.user_id).toUpperCase());
3317
- if (!_e || !(_ != null && _.recording_id)) return null;
3318
- const I = ((K = P.adminUrl) == null ? void 0 : K.replace(/\/$/, "")) ?? "", E = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ne = i.sessionUrl ? i.sessionUrl(_.recording_id, String(L.user_id)) : E ? `${I}/session-replays?recording=${_.recording_id}` : null;
3319
+ if (!ve || !(_ != null && _.recording_id)) return null;
3320
+ const j = ((K = P.adminUrl) == null ? void 0 : K.replace(/\/$/, "")) ?? "", E = !!j && (typeof window > "u" || new URL(j, window.location.origin).origin !== window.location.origin), ne = i.sessionUrl ? i.sessionUrl(_.recording_id, String(L.user_id)) : E ? `${j}/session-replays?recording=${_.recording_id}` : null;
3319
3321
  return ne ? /* @__PURE__ */ e(
3320
3322
  "span",
3321
3323
  {
@@ -3367,15 +3369,15 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3367
3369
  // switching to Browse with a conversation open kept showing that
3368
3370
  // conversation (or its settings) under the Browse tab.
3369
3371
  /* @__PURE__ */ e(
3370
- al,
3372
+ sl,
3371
3373
  {
3372
- onOpen: (k, L, q) => {
3373
- H(!1), S({ room: k, label: L, channel: q }), $("chat");
3374
+ onOpen: (k, L, I) => {
3375
+ H(!1), S({ room: k, label: L, channel: I }), $("chat");
3374
3376
  }
3375
3377
  }
3376
3378
  )
3377
3379
  ) : B ? /* @__PURE__ */ e(
3378
- ol,
3380
+ il,
3379
3381
  {
3380
3382
  onClose: () => R(!1),
3381
3383
  onCreated: (k, L) => {
@@ -3383,7 +3385,7 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3383
3385
  }
3384
3386
  }
3385
3387
  ) : C && G && C.channel ? /* @__PURE__ */ e(
3386
- el,
3388
+ tl,
3387
3389
  {
3388
3390
  channel: C.channel,
3389
3391
  label: C.label,
@@ -3407,7 +3409,7 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3407
3409
  onBack: () => M(null),
3408
3410
  roomLabel: (k) => {
3409
3411
  var L;
3410
- return ((L = ee.find((q) => q.room === k)) == null ? void 0 : L.label) ?? k;
3412
+ return ((L = ee.find((I) => I.room === k)) == null ? void 0 : L.label) ?? k;
3411
3413
  }
3412
3414
  }
3413
3415
  ) : W === "catchup" ? /* @__PURE__ */ e(
@@ -3443,13 +3445,13 @@ ${Dn(E)}` : ""}`, K = Un(I ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
3443
3445
  ) : /* @__PURE__ */ e($n, {});
3444
3446
  }
3445
3447
  export {
3446
- rl as ChatAppearAwayRow,
3447
- al as ChatChannelBrowser,
3448
- el as ChatChannelSettings,
3449
- lo as ChatPanel,
3450
- so as ChatProvider,
3448
+ ll as ChatAppearAwayRow,
3449
+ sl as ChatChannelBrowser,
3450
+ tl as ChatChannelSettings,
3451
+ io as ChatPanel,
3452
+ lo as ChatProvider,
3451
3453
  Bn as ChatRoomList,
3452
3454
  In as ChatRoomView,
3453
- ro as ChatSideView,
3454
- il as isChatPanelPinned
3455
+ oo as ChatSideView,
3456
+ cl as isChatPanelPinned
3455
3457
  };