@nivaro/react 0.3.7 → 0.3.8
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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/shared/components/ForceReloadBanner.js +31 -26
- package/dist/shared/components/chat/ChatPanel.js +115 -113
- package/dist/shared/components/chat/chat-core.js +55 -48
- package/dist/shared/components/delegation/DelegationConsoleView.js +294 -167
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +143 -124
- package/dist/shared/components/notifications/NotificationSubscriptionsView.js +35 -9
- package/package.json +1 -1
|
@@ -24,27 +24,27 @@ import { ChannelExtrasEditor as Ls, BulkInvitePanel as Ps, ChannelAuditLog as Is
|
|
|
24
24
|
import { ChannelTile as Ke, ChannelLookPicker as Gn } from "./ChannelLook.js";
|
|
25
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
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
|
|
28
|
-
import { useDraftRooms as
|
|
29
|
-
import { useCustomEmoji as
|
|
30
|
-
import { useRoomRecord as sa, useRecordFileTargets as
|
|
31
|
-
import { offHoursNote as
|
|
32
|
-
import { useMessageWindow as
|
|
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, sortOnlineUsers as Hs, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as qt, useChatSearch as Gs, dmPeer as Ne, useChatMessages as Qs, useOpenRoomRegistration as Ks, useMarkRoomRead as Js, useTypingIndicator as Ys, usePeerReadAt as Zs, useEntityRoomLink as Vs, useToggleReaction as Xs, useRoomPins as er, useTogglePin as tr, useEditMessage as nr, useDeleteMessage as ar, useChatBotName as sr, useChatThread as rr, useRecordBrowserTimezone as lr, chatInitials as or, chatAvatarColor as ir, useCreateGroupDm as cr, canOpenDm as dr, openDmWith as ur, chatRoomTypesQuery as aa, REACTION_EMOJI as mr } from "./chat-core.js";
|
|
28
|
+
import { useDraftRooms as pr } from "./chat-drafts.js";
|
|
29
|
+
import { useCustomEmoji as hr, EmojiButton as fr, EmojiGlyph as xr } from "./chat-emoji.js";
|
|
30
|
+
import { useRoomRecord as sa, useRecordFileTargets as gr } from "./chat-hooks.js";
|
|
31
|
+
import { offHoursNote as br } from "./chat-local-time.js";
|
|
32
|
+
import { useMessageWindow as vr } from "./chat-window.js";
|
|
33
33
|
import { HuddleFollowHost as $n } from "./huddle/HuddleCollab.js";
|
|
34
|
-
import { HuddleControls as
|
|
35
|
-
import { HuddleLiveBadge as
|
|
36
|
-
import { HuddleScheduleCard as
|
|
37
|
-
import { HuddleScheduleForm as
|
|
38
|
-
import { HuddleStage as
|
|
39
|
-
import { useHuddleLive as
|
|
34
|
+
import { HuddleControls as yr } from "./huddle/HuddleControls.js";
|
|
35
|
+
import { HuddleLiveBadge as kr } from "./huddle/HuddleLiveBadge.js";
|
|
36
|
+
import { HuddleScheduleCard as wr } from "./huddle/HuddleScheduleCard.js";
|
|
37
|
+
import { HuddleScheduleForm as Nr } from "./huddle/HuddleScheduleForm.js";
|
|
38
|
+
import { HuddleStage as Cr } from "./huddle/HuddleStage.js";
|
|
39
|
+
import { useHuddleLive as _r } from "./huddle/huddle-live.js";
|
|
40
40
|
import { stripHuddleRef as Rn, huddleRefOf as An } from "./huddle/huddle-schedule.js";
|
|
41
|
-
import { useHuddle as
|
|
42
|
-
import { useMessageActions as
|
|
43
|
-
import { FormattedMessage as
|
|
44
|
-
import { PollCard as
|
|
45
|
-
import { RoomStatusMarks as
|
|
46
|
-
import { MemberCountLine as
|
|
47
|
-
import { clipInfo as
|
|
41
|
+
import { useHuddle as Sr } from "./huddle/useHuddle.js";
|
|
42
|
+
import { useMessageActions as Tr, MessageActionsMenu as Ur, actionsForMessage as Dr } from "./MessageActions.js";
|
|
43
|
+
import { FormattedMessage as $r, LinkPreviews as Rr } from "./MessageFormat.js";
|
|
44
|
+
import { PollCard as Ar } from "./PollCard.js";
|
|
45
|
+
import { RoomStatusMarks as Mr, headerIconIdle as Mn, headerIconButton as On, RoomHeaderMenu as Or } from "./RoomHeaderMenu.js";
|
|
46
|
+
import { MemberCountLine as Lr, ChannelIntro as Pr, WelcomeNote as Ir, ThreadPane as jr, RoomInfoDrawer as qr } from "./RoomParts.js";
|
|
47
|
+
import { clipInfo as Er, ClipPlayer as Br } from "./ScreenClip.js";
|
|
48
48
|
import { useOutbox as ra } from "./chat-outbox.js";
|
|
49
49
|
import { OutboxBubbles as la } from "./OutboxBubbles.js";
|
|
50
50
|
const oa = {
|
|
@@ -59,7 +59,7 @@ const oa = {
|
|
|
59
59
|
divider: "border-slate-100 dark:border-border/60"
|
|
60
60
|
}, Et = {};
|
|
61
61
|
Et.current = oa;
|
|
62
|
-
function
|
|
62
|
+
function oo({
|
|
63
63
|
children: n,
|
|
64
64
|
me: s,
|
|
65
65
|
onlineUsers: o = [],
|
|
@@ -115,7 +115,7 @@ function ie() {
|
|
|
115
115
|
return Et.current;
|
|
116
116
|
}
|
|
117
117
|
const Ln = /* @__PURE__ */ new WeakMap();
|
|
118
|
-
function
|
|
118
|
+
function Wr(n, s) {
|
|
119
119
|
const o = String(s).toUpperCase();
|
|
120
120
|
let r = Ln.get(n);
|
|
121
121
|
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, Ln.set(n, r));
|
|
@@ -141,7 +141,7 @@ function Br(n, s) {
|
|
|
141
141
|
function Bt(n, s = !0) {
|
|
142
142
|
const o = Je(), { data: r } = Ce({
|
|
143
143
|
queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
|
|
144
|
-
queryFn: () =>
|
|
144
|
+
queryFn: () => Wr(o, n),
|
|
145
145
|
enabled: !!n && s,
|
|
146
146
|
staleTime: 6e4
|
|
147
147
|
});
|
|
@@ -169,7 +169,7 @@ function da(n) {
|
|
|
169
169
|
timeZone: Mt() ?? void 0
|
|
170
170
|
})}` : "Out of office" : null;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Fr({ id: n, size: s }) {
|
|
173
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 = [
|
|
174
174
|
d ? `Offline · ${d}` : r,
|
|
175
175
|
l && o !== "offline" ? `On ${l}` : null,
|
|
@@ -218,11 +218,11 @@ function Z({
|
|
|
218
218
|
style: {
|
|
219
219
|
width: o,
|
|
220
220
|
height: o,
|
|
221
|
-
backgroundColor:
|
|
221
|
+
backgroundColor: ir(n),
|
|
222
222
|
fontSize: o * 0.36
|
|
223
223
|
},
|
|
224
224
|
"aria-hidden": !0,
|
|
225
|
-
children:
|
|
225
|
+
children: or(s)
|
|
226
226
|
}
|
|
227
227
|
), d = /* @__PURE__ */ e(
|
|
228
228
|
$s,
|
|
@@ -235,10 +235,10 @@ function Z({
|
|
|
235
235
|
), c = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === String(n).toUpperCase();
|
|
236
236
|
return !r || c ? d : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: o, height: o }, children: [
|
|
237
237
|
d,
|
|
238
|
-
/* @__PURE__ */ e(
|
|
238
|
+
/* @__PURE__ */ e(Fr, { id: n, size: o })
|
|
239
239
|
] });
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function zr({ peerId: n, name: s }) {
|
|
242
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 });
|
|
243
243
|
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: l }) : /* @__PURE__ */ e(Hn, { userId: n, children: /* @__PURE__ */ e(
|
|
244
244
|
"button",
|
|
@@ -326,11 +326,11 @@ function Pn({ token: n, url: s, mine: o }) {
|
|
|
326
326
|
}
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Hr(n) {
|
|
330
330
|
const s = new Date(n), o = /* @__PURE__ */ new Date(), r = new Date(o);
|
|
331
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" });
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Gr({ botName: n }) {
|
|
334
334
|
const s = ie(), o = [
|
|
335
335
|
{
|
|
336
336
|
k: "@name",
|
|
@@ -394,7 +394,7 @@ function Hr({ botName: n }) {
|
|
|
394
394
|
)) })
|
|
395
395
|
] });
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Qr({ room: n }) {
|
|
398
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({
|
|
399
399
|
queryKey: ["nvr-chat-room-card", n],
|
|
400
400
|
queryFn: async () => {
|
|
@@ -488,7 +488,7 @@ function Gr({ room: n }) {
|
|
|
488
488
|
}
|
|
489
489
|
);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Kr(n, s) {
|
|
492
492
|
if (!n) return null;
|
|
493
493
|
const o = Mt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
|
|
494
494
|
let l, i;
|
|
@@ -511,12 +511,12 @@ function ua() {
|
|
|
511
511
|
return () => clearInterval(o);
|
|
512
512
|
}, []), n;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function Jr({ peerId: n, name: s }) {
|
|
515
515
|
ua();
|
|
516
516
|
const { state: o, title: r } = ca(n), l = Bt(n), i = o === "online" ? "Active now" : o === "offline" ? (() => {
|
|
517
517
|
const f = ia(l);
|
|
518
518
|
return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
|
|
519
|
-
})() : r, d =
|
|
519
|
+
})() : r, d = Kr((l == null ? void 0 : l.timezone) ?? null, s), c = da(l), h = c ? (l == null ? void 0 : l.delegate) ?? null : null;
|
|
520
520
|
return /* @__PURE__ */ a(
|
|
521
521
|
"p",
|
|
522
522
|
{
|
|
@@ -532,11 +532,11 @@ function Kr({ peerId: n, name: s }) {
|
|
|
532
532
|
children: c
|
|
533
533
|
}
|
|
534
534
|
),
|
|
535
|
-
h &&
|
|
535
|
+
h && dr() && /* @__PURE__ */ a(
|
|
536
536
|
"button",
|
|
537
537
|
{
|
|
538
538
|
type: "button",
|
|
539
|
-
onClick: () =>
|
|
539
|
+
onClick: () => ur(h.id, h.name),
|
|
540
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",
|
|
541
541
|
"data-chat-dm-delegate": h.id,
|
|
542
542
|
children: [
|
|
@@ -568,18 +568,18 @@ function In({
|
|
|
568
568
|
openThread: c = null
|
|
569
569
|
}) {
|
|
570
570
|
var pn, hn, fn, xn, gn, bn, vn, yn, kn, wn;
|
|
571
|
-
const h = Me(), f = ie(), u = Je(), p = h.me, b =
|
|
571
|
+
const h = Me(), f = ie(), u = Je(), p = h.me, b = Sr(n), U = p ? Ne(n, p.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Ce({
|
|
572
572
|
..._s(u, U),
|
|
573
573
|
enabled: !!U && $,
|
|
574
574
|
staleTime: 12e4
|
|
575
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);
|
|
576
576
|
ae(() => M(d), [d]);
|
|
577
|
-
const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } =
|
|
577
|
+
const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } = Qs(
|
|
578
578
|
n,
|
|
579
579
|
W
|
|
580
580
|
);
|
|
581
|
-
|
|
582
|
-
const se = ra(n), ee =
|
|
581
|
+
Ks(n);
|
|
582
|
+
const se = ra(n), ee = Js(), te = Ys(n), ge = Zs(n.startsWith("dm:") ? n : null), de = Vs(n), A = Xs(n), w = er(n), P = tr(n), x = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== h.globalRoom && n.includes(":"), q = sa(n, x), ve = gr(n, !!q), Se = n.startsWith("ch:"), { data: ue = [] } = Ce({
|
|
583
583
|
queryKey: ["chat-read-marks", n],
|
|
584
584
|
queryFn: () => u.request(
|
|
585
585
|
xe(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
|
|
@@ -647,7 +647,7 @@ function In({
|
|
|
647
647
|
}), E = Ee({
|
|
648
648
|
mutationFn: (t) => u.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
|
|
649
649
|
onSuccess: () => void ye.invalidateQueries({ queryKey: ["nvr-chat", n] })
|
|
650
|
-
}), ne =
|
|
650
|
+
}), ne = nr(n), K = ar(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 = sr(), [Xe, Ca] = T(!1), [et, Ht] = T(""), [_a, mt] = T(null), [Gt, Qt] = T(""), [Sa, pt] = T(null), Ta = Tr(n), [Ua, Kt] = T(null), [Jt, Yt] = T(null), [Zt, Le] = T(null), Vt = rr(c ? n : null, c), Xt = !!Vt.root && !Vt.root.deleted_at;
|
|
651
651
|
ae(() => {
|
|
652
652
|
c && Xt && Le(c);
|
|
653
653
|
}, [c, Xt]);
|
|
@@ -754,7 +754,7 @@ function In({
|
|
|
754
754
|
for (let m = we.length - 1; m >= 0; m--)
|
|
755
755
|
if (((t = we[m].sender) == null ? void 0 : t.toLowerCase()) === Pe) return m;
|
|
756
756
|
return -1;
|
|
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 =
|
|
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 = vr({
|
|
758
758
|
scrollerRef: Re,
|
|
759
759
|
listRef: ln,
|
|
760
760
|
ids: Oa,
|
|
@@ -763,8 +763,8 @@ function In({
|
|
|
763
763
|
pinnedRef: re
|
|
764
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);
|
|
765
765
|
ua();
|
|
766
|
-
const Pa = dn ?
|
|
767
|
-
|
|
766
|
+
const Pa = dn ? br(La, S, /* @__PURE__ */ new Date()) : null;
|
|
767
|
+
lr(), hr();
|
|
768
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 = {}) => {
|
|
769
769
|
var Nn, Cn;
|
|
770
770
|
const N = ((Nn = t.sender) == null ? void 0 : Nn.toLowerCase()) === Pe;
|
|
@@ -838,7 +838,7 @@ function In({
|
|
|
838
838
|
),
|
|
839
839
|
"data-chat-msg-actions": !0,
|
|
840
840
|
children: [
|
|
841
|
-
|
|
841
|
+
mr.map((D) => /* @__PURE__ */ e(
|
|
842
842
|
"button",
|
|
843
843
|
{
|
|
844
844
|
type: "button",
|
|
@@ -850,7 +850,7 @@ function In({
|
|
|
850
850
|
D
|
|
851
851
|
)),
|
|
852
852
|
/* @__PURE__ */ e(
|
|
853
|
-
|
|
853
|
+
fr,
|
|
854
854
|
{
|
|
855
855
|
label: "More reactions",
|
|
856
856
|
className: qe,
|
|
@@ -965,10 +965,10 @@ function In({
|
|
|
965
965
|
}
|
|
966
966
|
)),
|
|
967
967
|
/* @__PURE__ */ e(
|
|
968
|
-
|
|
968
|
+
Ur,
|
|
969
969
|
{
|
|
970
970
|
messageId: t.id,
|
|
971
|
-
actions:
|
|
971
|
+
actions: Dr(Ta, t, Pe),
|
|
972
972
|
navigate: h.navigate,
|
|
973
973
|
onOpenChange: (D) => Kt(D ? t.id : null)
|
|
974
974
|
}
|
|
@@ -1053,7 +1053,7 @@ function In({
|
|
|
1053
1053
|
}
|
|
1054
1054
|
),
|
|
1055
1055
|
t.message && Rn(t.message) && (l ? l(t, { mine: N }) : /* @__PURE__ */ e(
|
|
1056
|
-
|
|
1056
|
+
$r,
|
|
1057
1057
|
{
|
|
1058
1058
|
text: Rn(t.message),
|
|
1059
1059
|
mine: N,
|
|
@@ -1064,23 +1064,23 @@ function In({
|
|
|
1064
1064
|
}
|
|
1065
1065
|
)),
|
|
1066
1066
|
An(t.message) != null && /* @__PURE__ */ e(
|
|
1067
|
-
|
|
1067
|
+
wr,
|
|
1068
1068
|
{
|
|
1069
1069
|
id: An(t.message),
|
|
1070
1070
|
mine: N,
|
|
1071
1071
|
renderAvatar: (D, O) => /* @__PURE__ */ e(Z, { id: D, name: O, size: 18, presence: !1 })
|
|
1072
1072
|
}
|
|
1073
1073
|
),
|
|
1074
|
-
t.poll && /* @__PURE__ */ e(
|
|
1074
|
+
t.poll && /* @__PURE__ */ e(Ar, { poll: t.poll, room: t.room, mine: N }),
|
|
1075
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) => {
|
|
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 =
|
|
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 = Er(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), _n = () => Yt({
|
|
1077
1077
|
id: D,
|
|
1078
1078
|
url: wt,
|
|
1079
1079
|
name: rt,
|
|
1080
1080
|
type: (O == null ? void 0 : O.type) ?? null,
|
|
1081
1081
|
size: (O == null ? void 0 : O.filesize) ?? null
|
|
1082
1082
|
}), ot = q && ve.length > 0 ? /* @__PURE__ */ e(
|
|
1083
|
-
|
|
1083
|
+
Zr,
|
|
1084
1084
|
{
|
|
1085
1085
|
targets: ve,
|
|
1086
1086
|
recordLabel: q.label,
|
|
@@ -1088,7 +1088,7 @@ function In({
|
|
|
1088
1088
|
}
|
|
1089
1089
|
) : null;
|
|
1090
1090
|
return lt ? /* @__PURE__ */ e(
|
|
1091
|
-
|
|
1091
|
+
Br,
|
|
1092
1092
|
{
|
|
1093
1093
|
url: wt,
|
|
1094
1094
|
poster: lt.poster ? u.fileUrl(lt.poster) : null,
|
|
@@ -1139,7 +1139,7 @@ function In({
|
|
|
1139
1139
|
}
|
|
1140
1140
|
),
|
|
1141
1141
|
!Y && !De && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
|
|
1142
|
-
|
|
1142
|
+
Rr,
|
|
1143
1143
|
{
|
|
1144
1144
|
text: t.message,
|
|
1145
1145
|
navigate: h.navigate,
|
|
@@ -1162,7 +1162,7 @@ function In({
|
|
|
1162
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"
|
|
1163
1163
|
),
|
|
1164
1164
|
children: [
|
|
1165
|
-
/* @__PURE__ */ e(
|
|
1165
|
+
/* @__PURE__ */ e(xr, { value: D }),
|
|
1166
1166
|
/* @__PURE__ */ e("span", { className: "tabular-nums", children: O.count })
|
|
1167
1167
|
]
|
|
1168
1168
|
},
|
|
@@ -1219,7 +1219,7 @@ function In({
|
|
|
1219
1219
|
var O;
|
|
1220
1220
|
const D = Oe(t);
|
|
1221
1221
|
return D.length === 0 ? null : /* @__PURE__ */ e(
|
|
1222
|
-
|
|
1222
|
+
el,
|
|
1223
1223
|
{
|
|
1224
1224
|
seen: D,
|
|
1225
1225
|
channelId: ((O = y == null ? void 0 : y.channel) == null ? void 0 : O.id) ?? null,
|
|
@@ -1291,11 +1291,11 @@ function In({
|
|
|
1291
1291
|
}
|
|
1292
1292
|
),
|
|
1293
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 }),
|
|
1294
|
-
p && Ne(n, p.id) && /* @__PURE__ */ e(
|
|
1294
|
+
p && Ne(n, p.id) && /* @__PURE__ */ e(zr, { peerId: Ne(n, p.id), name: S }),
|
|
1295
1295
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1296
1296
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
1297
1297
|
/* @__PURE__ */ e("span", { className: "truncate", children: S }),
|
|
1298
|
-
y && /* @__PURE__ */ e(
|
|
1298
|
+
y && /* @__PURE__ */ e(Mr, { starred: !!y.starred, notify: zt }),
|
|
1299
1299
|
(z == null ? void 0 : z.announce) && /* @__PURE__ */ e(
|
|
1300
1300
|
"span",
|
|
1301
1301
|
{
|
|
@@ -1305,8 +1305,8 @@ function In({
|
|
|
1305
1305
|
}
|
|
1306
1306
|
)
|
|
1307
1307
|
] }),
|
|
1308
|
-
p && Ne(n, p.id) ? /* @__PURE__ */ e(
|
|
1309
|
-
|
|
1308
|
+
p && Ne(n, p.id) ? /* @__PURE__ */ e(Jr, { peerId: Ne(n, p.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
|
|
1309
|
+
Lr,
|
|
1310
1310
|
{
|
|
1311
1311
|
room: n,
|
|
1312
1312
|
me: ((yn = h.me) == null ? void 0 : yn.id) ?? null,
|
|
@@ -1315,7 +1315,7 @@ function In({
|
|
|
1315
1315
|
) : null
|
|
1316
1316
|
] }),
|
|
1317
1317
|
/* @__PURE__ */ e(
|
|
1318
|
-
|
|
1318
|
+
yr,
|
|
1319
1319
|
{
|
|
1320
1320
|
room: n,
|
|
1321
1321
|
roomLabel: S,
|
|
@@ -1337,7 +1337,7 @@ function In({
|
|
|
1337
1337
|
children: /* @__PURE__ */ e(Wn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1338
1338
|
}
|
|
1339
1339
|
),
|
|
1340
|
-
((kn = y == null ? void 0 : y.channel) == null ? void 0 : kn.is_direct) && /* @__PURE__ */ e(
|
|
1340
|
+
((kn = y == null ? void 0 : y.channel) == null ? void 0 : kn.is_direct) && /* @__PURE__ */ e(tl, { channel: y.channel, onLeft: o }),
|
|
1341
1341
|
/* @__PURE__ */ e(
|
|
1342
1342
|
"button",
|
|
1343
1343
|
{
|
|
@@ -1354,11 +1354,11 @@ function In({
|
|
|
1354
1354
|
}
|
|
1355
1355
|
),
|
|
1356
1356
|
/* @__PURE__ */ e(
|
|
1357
|
-
|
|
1357
|
+
Or,
|
|
1358
1358
|
{
|
|
1359
1359
|
th: f,
|
|
1360
1360
|
huddleSchedule: b.enabled ? (t) => /* @__PURE__ */ e(
|
|
1361
|
-
|
|
1361
|
+
Nr,
|
|
1362
1362
|
{
|
|
1363
1363
|
room: n,
|
|
1364
1364
|
me: (p == null ? void 0 : p.id) ?? null,
|
|
@@ -1432,12 +1432,12 @@ function In({
|
|
|
1432
1432
|
}), o();
|
|
1433
1433
|
}
|
|
1434
1434
|
}) : void 0,
|
|
1435
|
-
tips: /* @__PURE__ */ e(
|
|
1435
|
+
tips: /* @__PURE__ */ e(Gr, { botName: ce })
|
|
1436
1436
|
}
|
|
1437
1437
|
)
|
|
1438
1438
|
] }),
|
|
1439
1439
|
/* @__PURE__ */ e(
|
|
1440
|
-
|
|
1440
|
+
Cr,
|
|
1441
1441
|
{
|
|
1442
1442
|
room: n,
|
|
1443
1443
|
me: p,
|
|
@@ -1456,9 +1456,9 @@ function In({
|
|
|
1456
1456
|
"aria-label": "Search messages"
|
|
1457
1457
|
}
|
|
1458
1458
|
) }),
|
|
1459
|
-
/* @__PURE__ */ e(
|
|
1459
|
+
/* @__PURE__ */ e(Qr, { room: n }),
|
|
1460
1460
|
z && !z.is_direct && /* @__PURE__ */ e(
|
|
1461
|
-
|
|
1461
|
+
Pr,
|
|
1462
1462
|
{
|
|
1463
1463
|
description: z.description,
|
|
1464
1464
|
links: z.links,
|
|
@@ -1491,7 +1491,7 @@ function In({
|
|
|
1491
1491
|
}
|
|
1492
1492
|
),
|
|
1493
1493
|
Ia && (z == null ? void 0 : z.welcome_note) && /* @__PURE__ */ e(
|
|
1494
|
-
|
|
1494
|
+
Ir,
|
|
1495
1495
|
{
|
|
1496
1496
|
note: z.welcome_note,
|
|
1497
1497
|
channelName: S,
|
|
@@ -1549,7 +1549,7 @@ function In({
|
|
|
1549
1549
|
children: [
|
|
1550
1550
|
Y && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
|
|
1551
1551
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
|
|
1552
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children:
|
|
1552
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Hr(t.date_created) }),
|
|
1553
1553
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
|
|
1554
1554
|
] }),
|
|
1555
1555
|
Ae && /* @__PURE__ */ a(
|
|
@@ -1640,7 +1640,7 @@ function In({
|
|
|
1640
1640
|
Jt && /* @__PURE__ */ e(Us, { file: Jt, onClose: () => Yt(null) }),
|
|
1641
1641
|
mn(null),
|
|
1642
1642
|
Zt != null && /* @__PURE__ */ e(
|
|
1643
|
-
|
|
1643
|
+
jr,
|
|
1644
1644
|
{
|
|
1645
1645
|
room: n,
|
|
1646
1646
|
rootId: Zt,
|
|
@@ -1648,11 +1648,11 @@ function In({
|
|
|
1648
1648
|
onClose: () => Le(null),
|
|
1649
1649
|
renderRow: (t) => un(t, { inThread: !0 }),
|
|
1650
1650
|
renderComposer: (t) => mn(t),
|
|
1651
|
-
renderOutbox: (t) => /* @__PURE__ */ e(
|
|
1651
|
+
renderOutbox: (t) => /* @__PURE__ */ e(Yr, { room: n, parentId: t, th: f })
|
|
1652
1652
|
}
|
|
1653
1653
|
),
|
|
1654
1654
|
ht && /* @__PURE__ */ e(
|
|
1655
|
-
|
|
1655
|
+
qr,
|
|
1656
1656
|
{
|
|
1657
1657
|
room: n,
|
|
1658
1658
|
label: S,
|
|
@@ -1669,11 +1669,11 @@ function In({
|
|
|
1669
1669
|
}
|
|
1670
1670
|
);
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function Yr({ room: n, parentId: s, th: o }) {
|
|
1673
1673
|
const r = ra(n, s);
|
|
1674
1674
|
return /* @__PURE__ */ e(la, { items: r, th: o });
|
|
1675
1675
|
}
|
|
1676
|
-
function
|
|
1676
|
+
function Zr({
|
|
1677
1677
|
targets: n,
|
|
1678
1678
|
recordLabel: s,
|
|
1679
1679
|
onPick: o
|
|
@@ -1722,20 +1722,20 @@ function jn(n) {
|
|
|
1722
1722
|
color: n.color ?? null
|
|
1723
1723
|
};
|
|
1724
1724
|
}
|
|
1725
|
-
const
|
|
1725
|
+
const Vr = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1726
1726
|
function Dt(n) {
|
|
1727
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;
|
|
1728
1728
|
return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
|
|
1729
1729
|
}
|
|
1730
1730
|
function qn(n) {
|
|
1731
1731
|
const s = n == null ? void 0 : n.trim();
|
|
1732
|
-
return !s ||
|
|
1732
|
+
return !s || Vr.test(s) ? null : s;
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function Xr(n) {
|
|
1735
1735
|
const s = new Date(n), o = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
1736
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}`;
|
|
1737
1737
|
}
|
|
1738
|
-
function
|
|
1738
|
+
function el({
|
|
1739
1739
|
seen: n,
|
|
1740
1740
|
channelId: s,
|
|
1741
1741
|
senderId: o
|
|
@@ -1784,7 +1784,7 @@ function Xr({
|
|
|
1784
1784
|
{
|
|
1785
1785
|
className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
|
|
1786
1786
|
"data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
|
|
1787
|
-
children:
|
|
1787
|
+
children: Xr(u.last_read_at)
|
|
1788
1788
|
}
|
|
1789
1789
|
)
|
|
1790
1790
|
] }, u.user)),
|
|
@@ -1808,7 +1808,7 @@ function Xr({
|
|
|
1808
1808
|
)
|
|
1809
1809
|
] });
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1811
|
+
function tl({ channel: n, onLeft: s }) {
|
|
1812
1812
|
var B;
|
|
1813
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) => {
|
|
1814
1814
|
const H = String(R.user).toUpperCase(), V = String(G.user).toUpperCase();
|
|
@@ -1930,7 +1930,7 @@ function el({ channel: n, onLeft: s }) {
|
|
|
1930
1930
|
)
|
|
1931
1931
|
] });
|
|
1932
1932
|
}
|
|
1933
|
-
function
|
|
1933
|
+
function nl({
|
|
1934
1934
|
channel: n,
|
|
1935
1935
|
label: s,
|
|
1936
1936
|
onBack: o
|
|
@@ -2145,11 +2145,11 @@ function En(n) {
|
|
|
2145
2145
|
var s;
|
|
2146
2146
|
return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
|
|
2147
2147
|
}
|
|
2148
|
-
function
|
|
2148
|
+
function al(n, s) {
|
|
2149
2149
|
const o = (i, d) => i.label.localeCompare(d.label), r = (i, d) => En(d) - En(i) || o(i, d), l = [...n];
|
|
2150
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);
|
|
2151
2151
|
}
|
|
2152
|
-
function
|
|
2152
|
+
function sl({
|
|
2153
2153
|
value: n,
|
|
2154
2154
|
onChange: s
|
|
2155
2155
|
}) {
|
|
@@ -2203,11 +2203,11 @@ function Bn({
|
|
|
2203
2203
|
])
|
|
2204
2204
|
),
|
|
2205
2205
|
[c.onlineUsers]
|
|
2206
|
-
), $ = qt(), C =
|
|
2206
|
+
), $ = qt(), C = _r(), [S, W] = T(""), M = Wt(S.trim(), 250), { hits: v, loading: B } = Gs(M, b.filters), R = M.length >= 2 || b.active, G = fe(() => {
|
|
2207
2207
|
const w = /* @__PURE__ */ new Map();
|
|
2208
2208
|
for (const P of v) w.set(P.room, [...w.get(P.room) ?? [], P]);
|
|
2209
2209
|
return [...w.entries()].sort((P, x) => x[1].length - P[1].length);
|
|
2210
|
-
}, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V =
|
|
2210
|
+
}, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = pr(), 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 = al(
|
|
2211
2211
|
M ? n.filter((w) => w.label.toLowerCase().includes(M.toLowerCase())) : n,
|
|
2212
2212
|
ge
|
|
2213
2213
|
), A = (w) => {
|
|
@@ -2232,7 +2232,7 @@ function Bn({
|
|
|
2232
2232
|
),
|
|
2233
2233
|
!r && /* @__PURE__ */ e(qs, { open: b.open, active: b.active, onClick: () => b.setOpen(!b.open) }),
|
|
2234
2234
|
/* @__PURE__ */ e(
|
|
2235
|
-
|
|
2235
|
+
sl,
|
|
2236
2236
|
{
|
|
2237
2237
|
value: ge,
|
|
2238
2238
|
onChange: (w) => te.mutate({ chat_sidebar_sort: w === "recent" ? null : w })
|
|
@@ -2433,7 +2433,7 @@ function Bn({
|
|
|
2433
2433
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
2434
2434
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: x.label }),
|
|
2435
2435
|
x.muted && /* @__PURE__ */ e(Sn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
|
|
2436
|
-
/* @__PURE__ */ e(
|
|
2436
|
+
/* @__PURE__ */ e(kr, { count: C.countFor(x.room), label: x.label }),
|
|
2437
2437
|
V.has(x.room) && /* @__PURE__ */ e(
|
|
2438
2438
|
Ya,
|
|
2439
2439
|
{
|
|
@@ -2533,7 +2533,7 @@ function Bn({
|
|
|
2533
2533
|
)
|
|
2534
2534
|
] });
|
|
2535
2535
|
}
|
|
2536
|
-
function
|
|
2536
|
+
function io({
|
|
2537
2537
|
view: n,
|
|
2538
2538
|
rooms: s,
|
|
2539
2539
|
onBack: o,
|
|
@@ -2552,7 +2552,7 @@ function oo({
|
|
|
2552
2552
|
}
|
|
2553
2553
|
) : /* @__PURE__ */ e(Jn, { rooms: s, th: l, onBack: o, onOpen: r });
|
|
2554
2554
|
}
|
|
2555
|
-
function
|
|
2555
|
+
function rl({
|
|
2556
2556
|
onOpen: n
|
|
2557
2557
|
}) {
|
|
2558
2558
|
const s = ie(), [o, r] = T(""), [l, i] = T(!1), [d, c] = T(""), [h, f] = T("open"), [u, p] = T(""), [b, U] = T({
|
|
@@ -2721,11 +2721,11 @@ function sl({
|
|
|
2721
2721
|
] })
|
|
2722
2722
|
] });
|
|
2723
2723
|
}
|
|
2724
|
-
function
|
|
2724
|
+
function ll() {
|
|
2725
2725
|
const n = /* @__PURE__ */ new Date();
|
|
2726
2726
|
return n.setHours(23, 59, 59, 999), n;
|
|
2727
2727
|
}
|
|
2728
|
-
function
|
|
2728
|
+
function ol() {
|
|
2729
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) => {
|
|
2730
2730
|
s.mutate({
|
|
2731
2731
|
presence_override: h === "off" ? null : { mode: "away", until: (h == null ? void 0 : h.toISOString()) ?? null }
|
|
@@ -2777,7 +2777,7 @@ function ll() {
|
|
|
2777
2777
|
[
|
|
2778
2778
|
["1 hour", () => new Date(Date.now() + 36e5)],
|
|
2779
2779
|
["4 hours", () => new Date(Date.now() + 4 * 36e5)],
|
|
2780
|
-
["The rest of today",
|
|
2780
|
+
["The rest of today", ll],
|
|
2781
2781
|
["Until I switch it off", () => null]
|
|
2782
2782
|
].map(([h, f]) => /* @__PURE__ */ e(
|
|
2783
2783
|
"button",
|
|
@@ -2796,7 +2796,7 @@ function ll() {
|
|
|
2796
2796
|
}
|
|
2797
2797
|
);
|
|
2798
2798
|
}
|
|
2799
|
-
function
|
|
2799
|
+
function il({ myStatus: n }) {
|
|
2800
2800
|
const s = ie();
|
|
2801
2801
|
return /* @__PURE__ */ e(
|
|
2802
2802
|
Ss,
|
|
@@ -2836,11 +2836,11 @@ function ha(n) {
|
|
|
2836
2836
|
const o = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((l) => !o.has(l));
|
|
2837
2837
|
return r.length === 0 ? "Home" : r.map((l, i) => i === 0 ? l.replace(/[-_]/g, " ").replace(/\b\w/g, (d) => d.toUpperCase()) : l).join(" › ");
|
|
2838
2838
|
}
|
|
2839
|
-
function
|
|
2839
|
+
function cl({
|
|
2840
2840
|
onClose: n,
|
|
2841
2841
|
onCreated: s
|
|
2842
2842
|
}) {
|
|
2843
|
-
const o = ie(), [r, l] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = jt(r, !0), u =
|
|
2843
|
+
const o = ie(), [r, l] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = jt(r, !0), u = cr(), p = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ") || (b.email ?? "Unknown");
|
|
2844
2844
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
|
|
2845
2845
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
2846
2846
|
/* @__PURE__ */ e(
|
|
@@ -2946,14 +2946,14 @@ function il({
|
|
|
2946
2946
|
] });
|
|
2947
2947
|
}
|
|
2948
2948
|
const $t = "nvr-chat-pinned", Ct = 400;
|
|
2949
|
-
function
|
|
2949
|
+
function dl() {
|
|
2950
2950
|
try {
|
|
2951
2951
|
return typeof window < "u" && window.localStorage.getItem($t) === "1";
|
|
2952
2952
|
} catch {
|
|
2953
2953
|
return !1;
|
|
2954
2954
|
}
|
|
2955
2955
|
}
|
|
2956
|
-
function
|
|
2956
|
+
function ul() {
|
|
2957
2957
|
const n = "(min-width: 1024px)", [s, o] = T(
|
|
2958
2958
|
() => {
|
|
2959
2959
|
var r;
|
|
@@ -2968,7 +2968,7 @@ function dl() {
|
|
|
2968
2968
|
return r.addEventListener("change", l), () => r.removeEventListener("change", l);
|
|
2969
2969
|
}, []), s;
|
|
2970
2970
|
}
|
|
2971
|
-
function
|
|
2971
|
+
function co({
|
|
2972
2972
|
open: n,
|
|
2973
2973
|
onClose: s,
|
|
2974
2974
|
renderMessageBody: o,
|
|
@@ -2976,7 +2976,7 @@ function io({
|
|
|
2976
2976
|
requestedRoom: l
|
|
2977
2977
|
}) {
|
|
2978
2978
|
var $e;
|
|
2979
|
-
const i = Me(), d = ie(), c = i.me, [h, f] = T(
|
|
2979
|
+
const i = Me(), d = ie(), c = i.me, [h, f] = T(dl), u = ul(), p = h && u, b = () => {
|
|
2980
2980
|
const k = !h;
|
|
2981
2981
|
f(k);
|
|
2982
2982
|
try {
|
|
@@ -3006,7 +3006,9 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3006
3006
|
X.set(K, [...X.get(K) ?? [], j]);
|
|
3007
3007
|
}
|
|
3008
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 ?
|
|
3009
|
+
}, [A, w] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), P = pa(), x = P.loaded ? Hs(
|
|
3010
|
+
i.onlineUsers.filter((k) => P.byUser.has(String(k.user_id).toUpperCase()))
|
|
3011
|
+
) : [], q = fe(
|
|
3010
3012
|
() => de(x, A, P.byUser),
|
|
3011
3013
|
// biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
|
|
3012
3014
|
[x, A, P.byUser]
|
|
@@ -3106,12 +3108,12 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
|
|
|
3106
3108
|
] }),
|
|
3107
3109
|
U === "online" ? /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", "data-chat-online": !0, children: [
|
|
3108
3110
|
/* @__PURE__ */ e(
|
|
3109
|
-
|
|
3111
|
+
il,
|
|
3110
3112
|
{
|
|
3111
3113
|
myStatus: c ? (($e = P.byUser.get(String(c.id).toUpperCase())) == null ? void 0 : $e.custom_status) ?? null : null
|
|
3112
3114
|
}
|
|
3113
3115
|
),
|
|
3114
|
-
/* @__PURE__ */ e(
|
|
3116
|
+
/* @__PURE__ */ e(ol, {}),
|
|
3115
3117
|
/* @__PURE__ */ e(Ts, {}),
|
|
3116
3118
|
x.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
|
|
3117
3119
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
|
|
@@ -3369,7 +3371,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3369
3371
|
// switching to Browse with a conversation open kept showing that
|
|
3370
3372
|
// conversation (or its settings) under the Browse tab.
|
|
3371
3373
|
/* @__PURE__ */ e(
|
|
3372
|
-
|
|
3374
|
+
rl,
|
|
3373
3375
|
{
|
|
3374
3376
|
onOpen: (k, L, I) => {
|
|
3375
3377
|
H(!1), S({ room: k, label: L, channel: I }), $("chat");
|
|
@@ -3377,7 +3379,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3377
3379
|
}
|
|
3378
3380
|
)
|
|
3379
3381
|
) : B ? /* @__PURE__ */ e(
|
|
3380
|
-
|
|
3382
|
+
cl,
|
|
3381
3383
|
{
|
|
3382
3384
|
onClose: () => R(!1),
|
|
3383
3385
|
onCreated: (k, L) => {
|
|
@@ -3385,7 +3387,7 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3385
3387
|
}
|
|
3386
3388
|
}
|
|
3387
3389
|
) : C && G && C.channel ? /* @__PURE__ */ e(
|
|
3388
|
-
|
|
3390
|
+
nl,
|
|
3389
3391
|
{
|
|
3390
3392
|
channel: C.channel,
|
|
3391
3393
|
label: C.label,
|
|
@@ -3445,13 +3447,13 @@ ${Dn(E)}` : ""}`, K = Un(j ? { ..._, label: null } : _), F = "ml-1.5 rounded-ful
|
|
|
3445
3447
|
) : /* @__PURE__ */ e($n, {});
|
|
3446
3448
|
}
|
|
3447
3449
|
export {
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3450
|
+
ol as ChatAppearAwayRow,
|
|
3451
|
+
rl as ChatChannelBrowser,
|
|
3452
|
+
nl as ChatChannelSettings,
|
|
3453
|
+
co as ChatPanel,
|
|
3454
|
+
oo as ChatProvider,
|
|
3453
3455
|
Bn as ChatRoomList,
|
|
3454
3456
|
In as ChatRoomView,
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
+
io as ChatSideView,
|
|
3458
|
+
dl as isChatPanelPinned
|
|
3457
3459
|
};
|