@nivaro/react 0.3.46 → 0.3.47
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 +248 -16
- package/dist/index.js +679 -659
- package/dist/shared/components/CollectionBrowserView.js +813 -826
- package/dist/shared/components/ErrorNotice.js +169 -0
- package/dist/shared/components/ErrorSurface.js +23 -17
- package/dist/shared/components/ListLoadError.js +8 -29
- package/dist/shared/components/LoadErrorNote.js +38 -21
- package/dist/shared/components/QueryErrorState.js +8 -11
- package/dist/shared/components/ReportView.js +1320 -1291
- package/dist/shared/components/chat/ChannelArchive.js +60 -60
- package/dist/shared/components/chat/ChannelExtras.js +74 -74
- package/dist/shared/components/chat/ChatPanel.js +368 -367
- package/dist/shared/components/command-center/PeekPanel.js +33 -32
- package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
- package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
- package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
- package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
- package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
- package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
- package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
- package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
- package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
- package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
- package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
- package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
- package/dist/shared/components/import/ImportFromFileButton.js +61 -60
- package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
- package/dist/shared/components/imports/NewImportDialog.js +29 -28
- package/dist/shared/components/imports/RunDetailSheet.js +63 -63
- package/dist/shared/components/item-edit/FieldRow.js +329 -329
- package/dist/shared/components/item-edit/InlineTableField.js +898 -898
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
- package/dist/shared/components/item-edit/PlanGrid.js +220 -221
- package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
- package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
- package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
- package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
- package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
- package/dist/shared/components/panels/SlaClock.js +35 -36
- package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
- package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
- package/dist/shared/components/profile/AgentsPanel.js +73 -72
- package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
- package/dist/shared/components/support/SupportRequestDialog.js +85 -81
- package/dist/shared/components/support/SupportView.js +94 -87
- package/dist/shared/lib/autofill-poll.js +21 -18
- package/dist/shared/lib/error-actions.js +85 -0
- package/dist/shared/lib/error-message.js +223 -82
- package/dist/shared/lib/error-toast.js +71 -13
- package/dist/shared/lib/safe-error.js +136 -38
- package/package.json +1 -1
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as ke } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as Te, useQueryClient as Ot, useMutation as We } from "@tanstack/react-query";
|
|
3
|
-
import { Search as Hn, Plus as
|
|
4
|
-
import { useState as T, useEffect as ae, useMemo as ve, useRef as de, useContext as
|
|
3
|
+
import { Search as Hn, Plus as za, Hash as Ut, Lock as Ha, ChevronLeft as ut, X as pt, PinOff as Ga, Pin as Dt, Headphones as Qa, PlayCircle as Ka, MessageCircle as Gn, Users as Mt, AtSign as Ja, AlarmClock as Ya, Sparkles as Za, BellOff as Un, PencilLine as Va, Star as Xa, ArchiveRestore as es, Archive as ts, Bell as ns, LogOut as as, Info as ss, MapPin as Dn, Check as Lt, ArrowUpDown as rs, MessageSquareReply as ls, Quote as os, ClipboardPlus as is, NotebookPen as cs, Bookmark as ds, Pencil as us, Trash2 as ms, AlertTriangle as ps, Paperclip as hs, Bot as fs, CheckCheck as xs, Plane as bs, FilePlus2 as gs } from "lucide-react";
|
|
4
|
+
import { useState as T, useEffect as ae, useMemo as ve, useRef as de, useContext as vs } from "react";
|
|
5
5
|
import { toast as ge } from "sonner";
|
|
6
|
-
import { useItemEditAuth as ht, useNavigation as
|
|
7
|
-
import { get as ye, post as Fe, patch as
|
|
8
|
-
import { useLiveRecord as
|
|
9
|
-
import { usePresenceOnlinePoll as
|
|
10
|
-
import { presencePlaceHref as
|
|
11
|
-
import { invalidateRecordTasks as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
6
|
+
import { useItemEditAuth as ht, useNavigation as ys, useNivaroClient as Ze } from "../../context.js";
|
|
7
|
+
import { get as ye, post as Fe, patch as ks } from "../../lib/commands.js";
|
|
8
|
+
import { useLiveRecord as ws, batchTouches as Ns, LIVE_ASPECTS as Cs } from "../../lib/live.js";
|
|
9
|
+
import { usePresenceOnlinePoll as _s } from "../../lib/presence-live.js";
|
|
10
|
+
import { presencePlaceHref as Mn, stuckText as $n, fullHref as An } from "../../lib/presence-state.js";
|
|
11
|
+
import { invalidateRecordTasks as Ss } from "../../lib/record-tasks.js";
|
|
12
|
+
import { userErrorMessage as Qn } from "../../lib/safe-error.js";
|
|
13
|
+
import { userCardQuery as Ts } from "../../lib/user-cards.js";
|
|
14
|
+
import { cn as g, getDisplayTimezone as Pt, formatRelative as Kn } from "../../lib/utils.js";
|
|
15
|
+
import { CustomStatusEditor as Us } from "../CustomStatusEditor.js";
|
|
16
|
+
import { DoNotDisturbRow as Ds } from "../DoNotDisturb.js";
|
|
17
|
+
import { FilePreviewLightbox as Ms } from "../FilePreviewLightbox.js";
|
|
17
18
|
import { UserChip as It } from "../item-edit/UserChip.js";
|
|
18
19
|
import { StaleBuildChip as $s } from "../StaleBuildChip.js";
|
|
19
|
-
import { UserAvatar as
|
|
20
|
+
import { UserAvatar as As } from "../UserAvatar.js";
|
|
20
21
|
import { Popover as Ve, PopoverTrigger as Xe, PopoverContent as et } from "../ui/popover.js";
|
|
21
22
|
import { SimpleSelect as jt } from "../ui/SimpleSelect.js";
|
|
22
|
-
import { useBotStream as
|
|
23
|
-
import { MembershipHistory as
|
|
24
|
-
import { ChannelExtrasEditor as
|
|
25
|
-
import { ChannelTile as Ye, ChannelLookPicker as
|
|
26
|
-
import { MentionsView as
|
|
27
|
-
import { ChatComposer as
|
|
28
|
-
import { useMyPreferences as
|
|
29
|
-
import { useDraftRooms as
|
|
30
|
-
import { useCustomEmoji as
|
|
31
|
-
import { useRoomRecord as
|
|
32
|
-
import { offHoursNote as
|
|
33
|
-
import { useMessageWindow as
|
|
23
|
+
import { useBotStream as Rs, BotStreamBubble as Os } from "./BotStream.js";
|
|
24
|
+
import { MembershipHistory as Ls, ArchiveSuggestionBanner as Ps } from "./ChannelArchive.js";
|
|
25
|
+
import { ChannelExtrasEditor as Is, BulkInvitePanel as js, ChannelAuditLog as Es } from "./ChannelExtras.js";
|
|
26
|
+
import { ChannelTile as Ye, ChannelLookPicker as Jn } from "./ChannelLook.js";
|
|
27
|
+
import { MentionsView as Yn, ScheduledView as Zn, CatchUpView as Vn, useSearchFilterState as qs, FilterToggle as Bs, ChatSettingsButton as Ws, SearchFilterBar as Fs } from "./ChatViews.js";
|
|
28
|
+
import { ChatComposer as zs } from "./Composer.js";
|
|
29
|
+
import { useMyPreferences as Et, useSetMyPreferences as Xn, useChatRoles as ea, useChannelDirectory as Hs, useRoomMembership as qt, useCreateChannel as Gs, useChatConfig as Le, useChannelMembers as ta, useChannelAdmin as na, useUserSearch as Bt, GENERAL_CHANNEL_ID as aa, useChatRooms as sa, useArchivedRooms as ra, sortOnlineUsers as Qs, dmRoom as $t, CHAT_DEFAULTS as dt, ChatConfigContext as la, useChatBotInfo as Wt, useChatSearch as Ks, dmPeer as Se, useChatMessages as Js, useOpenRoomRegistration as Ys, useMarkRoomRead as Zs, useTypingIndicator as Vs, usePeerReadAt as Xs, useEntityRoomLink as er, useToggleReaction as tr, useRoomPins as nr, useTogglePin as ar, useEditMessage as sr, useDeleteMessage as rr, useChatBotName as lr, useChatThread as or, useRecordBrowserTimezone as ir, chatInitials as cr, chatAvatarColor as dr, useCreateGroupDm as ur, canOpenDm as mr, openDmWith as pr, usePagedMembers as hr, chatRoomTypesQuery as oa, REACTION_EMOJI as fr } from "./chat-core.js";
|
|
30
|
+
import { useDraftRooms as xr } from "./chat-drafts.js";
|
|
31
|
+
import { useCustomEmoji as br, EmojiButton as gr, EmojiGlyph as vr } from "./chat-emoji.js";
|
|
32
|
+
import { useRoomRecord as ia, useRecordFileTargets as yr } from "./chat-hooks.js";
|
|
33
|
+
import { offHoursNote as kr } from "./chat-local-time.js";
|
|
34
|
+
import { useMessageWindow as wr } from "./chat-window.js";
|
|
34
35
|
import { HuddleFollowHost as Rn } from "./huddle/HuddleCollab.js";
|
|
35
|
-
import { HuddleControls as
|
|
36
|
-
import { HuddleLiveBadge as
|
|
37
|
-
import { HuddleScheduleCard as
|
|
38
|
-
import { HuddleScheduleForm as
|
|
39
|
-
import { HuddleStage as
|
|
40
|
-
import { useHuddleLive as
|
|
36
|
+
import { HuddleControls as Nr } from "./huddle/HuddleControls.js";
|
|
37
|
+
import { HuddleLiveBadge as Cr } from "./huddle/HuddleLiveBadge.js";
|
|
38
|
+
import { HuddleScheduleCard as _r } from "./huddle/HuddleScheduleCard.js";
|
|
39
|
+
import { HuddleScheduleForm as Sr } from "./huddle/HuddleScheduleForm.js";
|
|
40
|
+
import { HuddleStage as Tr } from "./huddle/HuddleStage.js";
|
|
41
|
+
import { useHuddleLive as Ur } from "./huddle/huddle-live.js";
|
|
41
42
|
import { stripHuddleRef as On, huddleRefOf as Ln } from "./huddle/huddle-schedule.js";
|
|
42
|
-
import { useHuddle as
|
|
43
|
-
import { MemberSearchBox as
|
|
44
|
-
import { useMessageActions as
|
|
45
|
-
import { FormattedMessage as
|
|
46
|
-
import { PollCard as
|
|
47
|
-
import { RoomStatusMarks as
|
|
48
|
-
import { MemberCountLine as
|
|
49
|
-
import { clipInfo as
|
|
50
|
-
import { useOutbox as
|
|
51
|
-
import { OutboxBubbles as
|
|
52
|
-
const
|
|
43
|
+
import { useHuddle as Dr } from "./huddle/useHuddle.js";
|
|
44
|
+
import { MemberSearchBox as Mr, MemberOnlineDot as $r, MemberLoadMore as Ar } from "./MemberPaging.js";
|
|
45
|
+
import { useMessageActions as Rr, MessageActionsMenu as Or, actionsForMessage as Lr } from "./MessageActions.js";
|
|
46
|
+
import { FormattedMessage as Pr, LinkPreviews as Ir } from "./MessageFormat.js";
|
|
47
|
+
import { PollCard as jr } from "./PollCard.js";
|
|
48
|
+
import { RoomStatusMarks as Er, headerIconIdle as Pn, headerIconButton as In, RoomHeaderMenu as qr } from "./RoomHeaderMenu.js";
|
|
49
|
+
import { MemberCountLine as Br, ChannelIntro as Wr, WelcomeNote as Fr, ThreadPane as zr, RoomInfoDrawer as Hr } from "./RoomParts.js";
|
|
50
|
+
import { clipInfo as Gr, ClipPlayer as Qr } from "./ScreenClip.js";
|
|
51
|
+
import { useOutbox as ca } from "./chat-outbox.js";
|
|
52
|
+
import { OutboxBubbles as da } from "./OutboxBubbles.js";
|
|
53
|
+
const ua = {
|
|
53
54
|
bubbleMine: "bg-nvr-cyan text-white",
|
|
54
55
|
bubbleOther: "bg-slate-100 text-slate-800 dark:bg-muted dark:text-slate-100",
|
|
55
56
|
accentText: "text-nvr-navy dark:text-nvr-cyan",
|
|
@@ -60,8 +61,8 @@ const da = {
|
|
|
60
61
|
input: "border-slate-200 bg-slate-50 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100",
|
|
61
62
|
divider: "border-slate-100 dark:border-border/60"
|
|
62
63
|
}, Ft = {};
|
|
63
|
-
Ft.current =
|
|
64
|
-
function
|
|
64
|
+
Ft.current = ua;
|
|
65
|
+
function bo({
|
|
65
66
|
children: n,
|
|
66
67
|
me: s,
|
|
67
68
|
onlineUsers: l = [],
|
|
@@ -111,13 +112,13 @@ function fo({
|
|
|
111
112
|
C
|
|
112
113
|
]
|
|
113
114
|
);
|
|
114
|
-
return Ft.current = { ...
|
|
115
|
+
return Ft.current = { ...ua, ...S }, /* @__PURE__ */ e(la.Provider, { value: B, children: n });
|
|
115
116
|
}
|
|
116
117
|
function ue() {
|
|
117
118
|
return Ft.current;
|
|
118
119
|
}
|
|
119
120
|
const jn = /* @__PURE__ */ new WeakMap();
|
|
120
|
-
function
|
|
121
|
+
function Kr(n, s) {
|
|
121
122
|
const l = String(s).toUpperCase();
|
|
122
123
|
let r = jn.get(n);
|
|
123
124
|
r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, jn.set(n, r));
|
|
@@ -143,27 +144,27 @@ function Qr(n, s) {
|
|
|
143
144
|
function zt(n, s = !0) {
|
|
144
145
|
const l = Ze(), { data: r } = Te({
|
|
145
146
|
queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
|
|
146
|
-
queryFn: () =>
|
|
147
|
+
queryFn: () => Kr(l, n),
|
|
147
148
|
enabled: !!n && s,
|
|
148
149
|
staleTime: 6e4
|
|
149
150
|
});
|
|
150
151
|
return r ?? null;
|
|
151
152
|
}
|
|
152
|
-
function ua(n) {
|
|
153
|
-
return n != null && n.last_seen ? `last seen ${Qn(n.last_seen)}` : null;
|
|
154
|
-
}
|
|
155
153
|
function ma(n) {
|
|
156
|
-
|
|
154
|
+
return n != null && n.last_seen ? `last seen ${Kn(n.last_seen)}` : null;
|
|
155
|
+
}
|
|
156
|
+
function pa(n) {
|
|
157
|
+
const s = vs(la), l = ba(), r = String(n).toUpperCase();
|
|
157
158
|
if (l.loaded) {
|
|
158
159
|
const i = l.byUser.get(r);
|
|
159
160
|
if (!i) return { state: "offline", title: "Offline", page: null };
|
|
160
|
-
const p = i.page ??
|
|
161
|
+
const p = i.page ?? ga(i.current_path);
|
|
161
162
|
return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: At(i), page: p } : { state: "online", title: "Online", page: p };
|
|
162
163
|
}
|
|
163
164
|
const o = s == null ? void 0 : s.onlineUsers.find((i) => String(i.user_id).toUpperCase() === r);
|
|
164
165
|
return o ? o.is_idle ? { state: "idle", title: At(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function ha(n) {
|
|
167
168
|
return n != null && n.out_of_office ? n.ooo_end ? `Out of office until ${new Date(n.ooo_end).toLocaleDateString(void 0, {
|
|
168
169
|
weekday: "short",
|
|
169
170
|
month: "short",
|
|
@@ -171,8 +172,8 @@ function pa(n) {
|
|
|
171
172
|
timeZone: Pt() ?? void 0
|
|
172
173
|
})}` : "Out of office" : null;
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
const { state: l, title: r, page: o } =
|
|
175
|
+
function Jr({ id: n, size: s }) {
|
|
176
|
+
const { state: l, title: r, page: o } = pa(n), i = zt(n), p = l === "offline" ? ma(i) : null, d = ha(i), x = s >= 30 ? 10 : 8, f = [
|
|
176
177
|
p ? `Offline · ${p}` : r,
|
|
177
178
|
o && l !== "offline" ? `On ${o}` : null,
|
|
178
179
|
d,
|
|
@@ -202,7 +203,7 @@ function Kr({ id: n, size: s }) {
|
|
|
202
203
|
"data-chat-ooo": !0,
|
|
203
204
|
title: f,
|
|
204
205
|
"aria-label": d,
|
|
205
|
-
children: /* @__PURE__ */ e(
|
|
206
|
+
children: /* @__PURE__ */ e(bs, { style: { width: x - 3, height: x - 3 }, strokeWidth: 2.5 })
|
|
206
207
|
}
|
|
207
208
|
)
|
|
208
209
|
] });
|
|
@@ -220,14 +221,14 @@ function Q({
|
|
|
220
221
|
style: {
|
|
221
222
|
width: l,
|
|
222
223
|
height: l,
|
|
223
|
-
backgroundColor:
|
|
224
|
+
backgroundColor: dr(n),
|
|
224
225
|
fontSize: l * 0.36
|
|
225
226
|
},
|
|
226
227
|
"aria-hidden": !0,
|
|
227
|
-
children:
|
|
228
|
+
children: cr(s)
|
|
228
229
|
}
|
|
229
230
|
), p = /* @__PURE__ */ e(
|
|
230
|
-
|
|
231
|
+
As,
|
|
231
232
|
{
|
|
232
233
|
userId: n,
|
|
233
234
|
fallback: i,
|
|
@@ -237,10 +238,10 @@ function Q({
|
|
|
237
238
|
), d = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
|
|
238
239
|
return !r || d ? p : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
|
|
239
240
|
p,
|
|
240
|
-
/* @__PURE__ */ e(
|
|
241
|
+
/* @__PURE__ */ e(Jr, { id: n, size: l })
|
|
241
242
|
] });
|
|
242
243
|
}
|
|
243
|
-
function
|
|
244
|
+
function Yr({ peerId: n, name: s }) {
|
|
244
245
|
const l = Wt(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Q, { id: n, name: s, size: 28 });
|
|
245
246
|
return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(It, { userId: n, children: /* @__PURE__ */ e(
|
|
246
247
|
"button",
|
|
@@ -253,8 +254,8 @@ function Jr({ peerId: n, name: s }) {
|
|
|
253
254
|
}
|
|
254
255
|
) });
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
-
const r = Le(), o = ue(), i = Ze(), { data: p } = Te(
|
|
257
|
+
function En({ token: n, url: s, mine: l }) {
|
|
258
|
+
const r = Le(), o = ue(), i = Ze(), { data: p } = Te(oa(i)), { data: d } = Te({
|
|
258
259
|
queryKey: ["nvr-chat-entity-card", n],
|
|
259
260
|
queryFn: async () => {
|
|
260
261
|
var u, b, y, U;
|
|
@@ -268,14 +269,14 @@ function qn({ token: n, url: s, mine: l }) {
|
|
|
268
269
|
})
|
|
269
270
|
)).data) == null ? void 0 : u[0]) == null ? void 0 : b.id;
|
|
270
271
|
if (S == null) continue;
|
|
271
|
-
const
|
|
272
|
+
const M = (U = (y = (await i.request(
|
|
272
273
|
ye(`/pipelines/instance/${A.collection}/${S}`)
|
|
273
274
|
)).data) == null ? void 0 : y.instance) == null ? void 0 : U.current_state_obj;
|
|
274
275
|
return {
|
|
275
276
|
collection: A.collection,
|
|
276
277
|
id: S,
|
|
277
|
-
state: (
|
|
278
|
-
color: (
|
|
278
|
+
state: (M == null ? void 0 : M.label) ?? null,
|
|
279
|
+
color: (M == null ? void 0 : M.color) ?? null
|
|
279
280
|
};
|
|
280
281
|
} catch {
|
|
281
282
|
}
|
|
@@ -284,11 +285,11 @@ function qn({ token: n, url: s, mine: l }) {
|
|
|
284
285
|
enabled: ((p == null ? void 0 : p.length) ?? 0) > 0,
|
|
285
286
|
staleTime: 10 * 6e4
|
|
286
287
|
}), x = Ot();
|
|
287
|
-
return
|
|
288
|
+
return ws(
|
|
288
289
|
d == null ? void 0 : d.collection,
|
|
289
290
|
d == null ? void 0 : d.id,
|
|
290
291
|
(u) => {
|
|
291
|
-
|
|
292
|
+
Ns(u, Cs.state) && x.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
|
|
292
293
|
},
|
|
293
294
|
{ includeOwn: !0, debounceMs: 400 }
|
|
294
295
|
), /* @__PURE__ */ a(
|
|
@@ -328,11 +329,11 @@ function qn({ token: n, url: s, mine: l }) {
|
|
|
328
329
|
}
|
|
329
330
|
);
|
|
330
331
|
}
|
|
331
|
-
function
|
|
332
|
+
function Zr(n) {
|
|
332
333
|
const s = new Date(n), l = /* @__PURE__ */ new Date(), r = new Date(l);
|
|
333
334
|
return r.setDate(l.getDate() - 1), s.toDateString() === l.toDateString() ? "Today" : s.toDateString() === r.toDateString() ? "Yesterday" : s.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
+
function Vr({ botName: n }) {
|
|
336
337
|
const s = ue(), l = [
|
|
337
338
|
{
|
|
338
339
|
k: "@name",
|
|
@@ -396,35 +397,35 @@ function Zr({ botName: n }) {
|
|
|
396
397
|
)) })
|
|
397
398
|
] });
|
|
398
399
|
}
|
|
399
|
-
function
|
|
400
|
+
function Xr({ room: n }) {
|
|
400
401
|
const s = Le(), l = ue(), r = Ze(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, p = o > 0 ? n.slice(o + 1) : null, d = !!i && !!p && n !== s.globalRoom && i !== "dm" && i !== "ch", x = Ot(), { data: f } = Te({
|
|
401
402
|
queryKey: ["nvr-chat-room-card", n],
|
|
402
403
|
queryFn: async () => {
|
|
403
404
|
var J, G, F, O;
|
|
404
|
-
const S = (await x.fetchQuery(
|
|
405
|
+
const S = (await x.fetchQuery(oa(r))).find((K) => K.is_active && K.prefix === i);
|
|
405
406
|
if (!S) return null;
|
|
406
|
-
const
|
|
407
|
+
const M = (G = (J = (await r.request(
|
|
407
408
|
ye(`/items/${S.collection}`, {
|
|
408
409
|
limit: 1,
|
|
409
410
|
fields: "id",
|
|
410
411
|
filter: JSON.stringify({ [S.match_field]: { _eq: p } })
|
|
411
412
|
})
|
|
412
413
|
)).data) == null ? void 0 : J[0]) == null ? void 0 : G.id;
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
415
|
-
ye(`/pipelines/instance/${S.collection}/${
|
|
414
|
+
if (M == null) return null;
|
|
415
|
+
const E = (O = (F = (await r.request(
|
|
416
|
+
ye(`/pipelines/instance/${S.collection}/${M}`)
|
|
416
417
|
)).data) == null ? void 0 : F.instance) == null ? void 0 : O.current_state_obj;
|
|
417
418
|
return {
|
|
418
419
|
collection: S.collection,
|
|
419
420
|
type_label: S.label ?? S.collection.replace(/_/g, " "),
|
|
420
|
-
id:
|
|
421
|
-
state: (
|
|
422
|
-
color: (
|
|
421
|
+
id: M,
|
|
422
|
+
state: (E == null ? void 0 : E.label) ?? null,
|
|
423
|
+
color: (E == null ? void 0 : E.color) ?? null
|
|
423
424
|
};
|
|
424
425
|
},
|
|
425
426
|
enabled: d,
|
|
426
427
|
staleTime: 6e4
|
|
427
|
-
}), u =
|
|
428
|
+
}), u = ia(n, d && !!f);
|
|
428
429
|
if (!d || !f) return null;
|
|
429
430
|
const y = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (u == null ? void 0 : u.sla) ?? null, A = (U == null ? void 0 : U.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (U == null ? void 0 : U.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
|
|
430
431
|
return /* @__PURE__ */ a(
|
|
@@ -490,7 +491,7 @@ function Vr({ room: n }) {
|
|
|
490
491
|
}
|
|
491
492
|
);
|
|
492
493
|
}
|
|
493
|
-
function
|
|
494
|
+
function el(n, s) {
|
|
494
495
|
if (!n) return null;
|
|
495
496
|
const l = Pt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
|
|
496
497
|
let o, i;
|
|
@@ -506,19 +507,19 @@ function Xr(n, s) {
|
|
|
506
507
|
const p = s.split(/\s+/)[0] || s;
|
|
507
508
|
return `${o} for ${p}`;
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
+
function fa() {
|
|
510
511
|
const [n, s] = T(0);
|
|
511
512
|
return ae(() => {
|
|
512
513
|
const l = setInterval(() => s((r) => r + 1), 6e4);
|
|
513
514
|
return () => clearInterval(l);
|
|
514
515
|
}, []), n;
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
-
|
|
518
|
-
const { state: l, title: r } =
|
|
519
|
-
const f =
|
|
517
|
+
function tl({ peerId: n, name: s }) {
|
|
518
|
+
fa();
|
|
519
|
+
const { state: l, title: r } = pa(n), o = zt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
|
|
520
|
+
const f = ma(o);
|
|
520
521
|
return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
|
|
521
|
-
})() : r, p =
|
|
522
|
+
})() : r, p = el((o == null ? void 0 : o.timezone) ?? null, s), d = ha(o), x = d ? (o == null ? void 0 : o.delegate) ?? null : null;
|
|
522
523
|
return /* @__PURE__ */ a(
|
|
523
524
|
"p",
|
|
524
525
|
{
|
|
@@ -534,11 +535,11 @@ function el({ peerId: n, name: s }) {
|
|
|
534
535
|
children: d
|
|
535
536
|
}
|
|
536
537
|
),
|
|
537
|
-
x &&
|
|
538
|
+
x && mr() && /* @__PURE__ */ a(
|
|
538
539
|
"button",
|
|
539
540
|
{
|
|
540
541
|
type: "button",
|
|
541
|
-
onClick: () =>
|
|
542
|
+
onClick: () => pr(x.id, x.name),
|
|
542
543
|
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",
|
|
543
544
|
"data-chat-dm-delegate": x.id,
|
|
544
545
|
children: [
|
|
@@ -559,7 +560,7 @@ function el({ peerId: n, name: s }) {
|
|
|
559
560
|
}
|
|
560
561
|
);
|
|
561
562
|
}
|
|
562
|
-
function
|
|
563
|
+
function qn({
|
|
563
564
|
room: n,
|
|
564
565
|
label: s,
|
|
565
566
|
onBack: l,
|
|
@@ -570,18 +571,18 @@ function En({
|
|
|
570
571
|
openThread: d = null
|
|
571
572
|
}) {
|
|
572
573
|
var fn, xn, bn, gn, vn, yn, kn, wn, Nn, Cn;
|
|
573
|
-
const x = Le(), f = ue(), u = Ze(), b = x.me, y =
|
|
574
|
-
...
|
|
574
|
+
const x = Le(), f = ue(), u = Ze(), b = x.me, y = Dr(n), U = b ? Se(n, b.id) : null, A = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Te({
|
|
575
|
+
...Ts(u, U),
|
|
575
576
|
enabled: !!U && A,
|
|
576
577
|
staleTime: 12e4
|
|
577
|
-
}), S = A && 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, [B,
|
|
578
|
-
ae(() =>
|
|
579
|
-
const { messages: v, loading:
|
|
578
|
+
}), S = A && 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, [B, M] = T(p);
|
|
579
|
+
ae(() => M(p), [p]);
|
|
580
|
+
const { messages: v, loading: E, hasOlder: J, hasNewer: G, loadOlder: F, loadingOlder: O } = Js(
|
|
580
581
|
n,
|
|
581
582
|
B
|
|
582
583
|
);
|
|
583
|
-
|
|
584
|
-
const K =
|
|
584
|
+
Ys(n);
|
|
585
|
+
const K = ca(n), ee = Zs(), Y = Vs(n), te = Xs(n.startsWith("dm:") ? n : null), oe = er(n), se = tr(n), me = nr(n), c = ar(n), L = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== x.globalRoom && n.includes(":"), m = ia(n, L), Z = yr(n, !!m), Ue = n.startsWith("ch:"), { data: he = [] } = Te({
|
|
585
586
|
queryKey: ["chat-read-marks", n],
|
|
586
587
|
queryFn: () => u.request(
|
|
587
588
|
ye(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
|
|
@@ -598,13 +599,13 @@ function En({
|
|
|
598
599
|
}), Ce = ve(() => new Set(De.map((t) => t.id)), [De]), k = We({
|
|
599
600
|
mutationFn: (t) => u.request(Fe(`/chat/messages/${t}/save`, {})),
|
|
600
601
|
onSuccess: () => void Ne.invalidateQueries({ queryKey: ["chat-saved"] })
|
|
601
|
-
}), [
|
|
602
|
+
}), [$, P] = T(null), V = We({
|
|
602
603
|
mutationFn: () => u.request(
|
|
603
604
|
Fe("/chat/rooms/summary", { room: n })
|
|
604
605
|
).then((t) => t.data),
|
|
605
606
|
onSuccess: (t) => P((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
|
|
606
607
|
onError: () => P("Summary unavailable.")
|
|
607
|
-
}),
|
|
608
|
+
}), Me = We({
|
|
608
609
|
mutationFn: async (t) => {
|
|
609
610
|
if (!m || !b) throw new Error("no record");
|
|
610
611
|
await u.request(
|
|
@@ -617,7 +618,7 @@ function En({
|
|
|
617
618
|
);
|
|
618
619
|
},
|
|
619
620
|
onSuccess: () => {
|
|
620
|
-
m &&
|
|
621
|
+
m && Ss(Ne, m.collection, m.id), ge.success("Task created from message — assigned to you");
|
|
621
622
|
},
|
|
622
623
|
onError: () => ge.error("Could not create a task")
|
|
623
624
|
}), _ = We({
|
|
@@ -647,15 +648,15 @@ function En({
|
|
|
647
648
|
);
|
|
648
649
|
}
|
|
649
650
|
}), j = We({
|
|
650
|
-
mutationFn: (t) => u.request(
|
|
651
|
+
mutationFn: (t) => u.request(ks(`/chat/messages/${t}`, { no_preview: !0 })),
|
|
651
652
|
onSuccess: () => void Ne.invalidateQueries({ queryKey: ["nvr-chat", n] })
|
|
652
|
-
}), ie =
|
|
653
|
+
}), ie = sr(n), ne = rr(n), { isAdmin: X } = ht(), { setMuted: z, setNotifyMode: re, setArchived: fe, setStarred: va, dismissWelcome: ya, leave: ka } = qt(), { rooms: wa, loading: Na } = sa(), Ht = wa.find((t) => t.room === n) ?? null, { rooms: Ca } = ra(!Na && !Ht), w = Ht ?? Ca.find((t) => t.room === n) ?? null, _a = xa(w), Gt = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", pe = lr(), [tt, Sa] = T(!1), [nt, Qt] = T(""), [Ta, ft] = T(null), [Kt, Jt] = T(""), [Ua, xt] = T(null), Da = Rr(n), [Ma, Yt] = T(null), [Zt, Vt] = T(null), [Xt, Ie] = T(null), en = or(d ? n : null, d), tn = !!en.root && !en.root.deleted_at;
|
|
653
654
|
ae(() => {
|
|
654
655
|
d && tn && Ie(d);
|
|
655
656
|
}, [d, tn]);
|
|
656
|
-
const [$a, nn] = T(null), [
|
|
657
|
+
const [$a, nn] = T(null), [Aa, an] = T(null), [bt, ze] = T(!1), [Ra, gt] = T(!1), [ce, He] = T(null), [Ge, at] = T(
|
|
657
658
|
p && "around" in p ? p.around : null
|
|
658
|
-
), [st, vt] = T(null), Qe =
|
|
659
|
+
), [st, vt] = T(null), Qe = Rs(n, (b == null ? void 0 : b.id) ?? null), sn = de(null), yt = de(null), kt = de(Math.max(0, i ?? 0)), $e = de(!1), Re = de(null), rn = de(null), le = de(!p), Ke = de(0), Je = de(null), wt = de(0), rt = () => {
|
|
659
660
|
const t = Re.current;
|
|
660
661
|
t && (t.scrollTop = t.scrollHeight);
|
|
661
662
|
}, Nt = (t) => {
|
|
@@ -663,19 +664,19 @@ function En({
|
|
|
663
664
|
const h = (N = Re.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
|
|
664
665
|
return h ? (h.scrollIntoView({ block: "center" }), le.current = !1, at(t), !0) : we.reveal(t) ? (le.current = !1, at(t), !0) : !1;
|
|
665
666
|
}, ln = (t) => {
|
|
666
|
-
ze(!1), Nt(t) || (
|
|
667
|
+
ze(!1), Nt(t) || ($e.current = !1, le.current = !1, at(t), M({ around: t }));
|
|
667
668
|
};
|
|
668
669
|
ae(() => {
|
|
669
670
|
if (Ge == null) return;
|
|
670
671
|
const t = setTimeout(() => at(null), 2400);
|
|
671
672
|
return () => clearTimeout(t);
|
|
672
673
|
}, [Ge]), ae(() => {
|
|
673
|
-
|
|
674
|
+
$e.current = !1, Ke.current = 0, He(null);
|
|
674
675
|
}, [n, B]), ae(() => {
|
|
675
|
-
var Oe,
|
|
676
|
+
var Oe, qe;
|
|
676
677
|
const t = Re.current, h = ((Oe = v[0]) == null ? void 0 : Oe.id) ?? null;
|
|
677
|
-
if (
|
|
678
|
-
if (
|
|
678
|
+
if (!$e.current && v.length > 0) {
|
|
679
|
+
if ($e.current = !0, Ke.current = v.length, Je.current = h, Ge != null && Nt(Ge)) return;
|
|
679
680
|
yt.current && !B ? (yt.current.scrollIntoView({ block: "center" }), le.current = !1) : B || (rt(), le.current = !0);
|
|
680
681
|
return;
|
|
681
682
|
}
|
|
@@ -686,7 +687,7 @@ function En({
|
|
|
686
687
|
Je.current = h;
|
|
687
688
|
const N = v.length - Ke.current;
|
|
688
689
|
if (Ke.current = v.length, N <= 0) return;
|
|
689
|
-
const W = v[v.length - 1], H = !!(W != null && W.sender) && W.sender.toLowerCase() === ((
|
|
690
|
+
const W = v[v.length - 1], H = !!(W != null && W.sender) && W.sender.toLowerCase() === ((qe = b == null ? void 0 : b.id) == null ? void 0 : qe.toLowerCase());
|
|
690
691
|
if (le.current || H)
|
|
691
692
|
rt(), le.current = !0, He(null);
|
|
692
693
|
else {
|
|
@@ -704,7 +705,7 @@ function En({
|
|
|
704
705
|
}, []), ae(() => {
|
|
705
706
|
var N, W;
|
|
706
707
|
const t = v[v.length - 1];
|
|
707
|
-
if (!t ||
|
|
708
|
+
if (!t || !$e.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((W = b == null ? void 0 : b.id) == null ? void 0 : W.toLowerCase()))
|
|
708
709
|
return;
|
|
709
710
|
const h = Date.now() - new Date(t.date_created).getTime();
|
|
710
711
|
h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && u.request(Fe("/chat/health/delivery", { ms: h })).catch(() => {
|
|
@@ -742,32 +743,32 @@ function En({
|
|
|
742
743
|
ae(() => {
|
|
743
744
|
B || ee.mutate(n);
|
|
744
745
|
}, [n, v.length, B]);
|
|
745
|
-
const
|
|
746
|
-
if (le.current = !0, B &&
|
|
746
|
+
const Oa = (t) => {
|
|
747
|
+
if (le.current = !0, B && M(null), pe) {
|
|
747
748
|
const h = pe.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
748
749
|
new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && vt(Date.now());
|
|
749
750
|
}
|
|
750
751
|
}, je = (xn = b == null ? void 0 : b.id) == null ? void 0 : xn.toLowerCase(), xe = tt && nt.trim().length > 0, _e = ve(
|
|
751
752
|
() => xe ? v.filter((t) => t.message.toLowerCase().includes(nt.trim().toLowerCase())) : v,
|
|
752
753
|
[v, xe, nt]
|
|
753
|
-
),
|
|
754
|
+
), La = ve(() => {
|
|
754
755
|
var t;
|
|
755
756
|
if (xe) return -1;
|
|
756
757
|
for (let h = _e.length - 1; h >= 0; h--)
|
|
757
758
|
if (((t = _e[h].sender) == null ? void 0 : t.toLowerCase()) === je) return h;
|
|
758
759
|
return -1;
|
|
759
|
-
}, [_e, je, xe]), on = te ? new Date(te).getTime() : 0,
|
|
760
|
+
}, [_e, je, xe]), on = te ? new Date(te).getTime() : 0, Ee = Et().chat_density === "compact" ? "compact" : "comfortable", cn = de(null), Pa = ve(() => _e.map((t) => t.id), [_e]), we = wr({
|
|
760
761
|
scrollerRef: Re,
|
|
761
762
|
listRef: cn,
|
|
762
|
-
ids:
|
|
763
|
-
estimate:
|
|
763
|
+
ids: Pa,
|
|
764
|
+
estimate: Ee === "compact" ? 40 : 72,
|
|
764
765
|
resetKey: `${n}|${JSON.stringify(B)}|${xe ? "search" : ""}`,
|
|
765
766
|
pinnedRef: le
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
const
|
|
767
|
+
}), q = (w == null ? void 0 : w.channel) ?? null, dn = !!q && !!b && String(q.created_by ?? "").toUpperCase() === b.id.toUpperCase(), un = q != null && q.announce && !dn && !X ? q.id === aa ? "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, mn = b ? Se(n, b.id) : null, Ia = zt(mn);
|
|
768
|
+
fa();
|
|
769
|
+
const ja = mn ? kr(Ia, S, /* @__PURE__ */ new Date()) : null;
|
|
770
|
+
ir(), br();
|
|
771
|
+
const Ea = !!(q != null && q.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !q.is_direct, qa = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: x.entityUrl(t.entity) }, h) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), Ba = (t, h) => t.entity ? /* @__PURE__ */ e(En, { token: t.text, url: x.entityUrl(t.entity), mine: !0 }, h) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), pn = (t, h = {}) => {
|
|
771
772
|
var _n, Sn;
|
|
772
773
|
const N = ((_n = t.sender) == null ? void 0 : _n.toLowerCase()) === je;
|
|
773
774
|
if (t.is_system)
|
|
@@ -786,7 +787,7 @@ function En({
|
|
|
786
787
|
] })
|
|
787
788
|
}
|
|
788
789
|
);
|
|
789
|
-
const W = h.isLastMine && on > 0 && new Date(t.date_created).getTime() <= on, H = !!t.deleted_at, Oe = N && !H && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4,
|
|
790
|
+
const W = h.isLastMine && on > 0 && new Date(t.date_created).getTime() <= on, H = !!t.deleted_at, Oe = N && !H && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, qe = !H && (N || X), Ae = Ta === t.id, be = /* @__PURE__ */ new Map();
|
|
790
791
|
for (const D of t.reactions ?? []) {
|
|
791
792
|
const R = be.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
|
|
792
793
|
R.count++, ((Sn = D.user) == null ? void 0 : Sn.toLowerCase()) === je && (R.mine = !0), D.user_name && R.names.push(D.user_name), be.set(D.emoji, R);
|
|
@@ -809,7 +810,7 @@ function En({
|
|
|
809
810
|
className: "h-fit shrink-0 rounded-full",
|
|
810
811
|
"aria-label": `${t.sender_name ?? "Sender"} — profile`,
|
|
811
812
|
"data-chat-avatar-card": !0,
|
|
812
|
-
children: /* @__PURE__ */ e(Q, { id: t.sender, name: t.sender_name, size:
|
|
813
|
+
children: /* @__PURE__ */ e(Q, { id: t.sender, name: t.sender_name, size: Ee === "compact" ? 22 : 26 })
|
|
813
814
|
}
|
|
814
815
|
) }),
|
|
815
816
|
/* @__PURE__ */ a("div", { className: g("relative max-w-[78%]", N && "text-right"), children: [
|
|
@@ -833,14 +834,14 @@ function En({
|
|
|
833
834
|
{
|
|
834
835
|
className: g(
|
|
835
836
|
"absolute -top-3 z-10 hidden items-center gap-0.5 rounded-full border px-1 py-0.5 shadow-sm group-hover/msg:flex",
|
|
836
|
-
|
|
837
|
+
Ma === t.id && "flex",
|
|
837
838
|
f.surface,
|
|
838
839
|
"border-slate-200 dark:border-border",
|
|
839
840
|
N ? "right-0" : "left-0"
|
|
840
841
|
),
|
|
841
842
|
"data-chat-msg-actions": !0,
|
|
842
843
|
children: [
|
|
843
|
-
|
|
844
|
+
fr.map((D) => /* @__PURE__ */ e(
|
|
844
845
|
"button",
|
|
845
846
|
{
|
|
846
847
|
type: "button",
|
|
@@ -852,7 +853,7 @@ function En({
|
|
|
852
853
|
D
|
|
853
854
|
)),
|
|
854
855
|
/* @__PURE__ */ e(
|
|
855
|
-
|
|
856
|
+
gr,
|
|
856
857
|
{
|
|
857
858
|
label: "More reactions",
|
|
858
859
|
className: Be,
|
|
@@ -870,7 +871,7 @@ function En({
|
|
|
870
871
|
},
|
|
871
872
|
className: Be,
|
|
872
873
|
"data-chat-reply-thread": !0,
|
|
873
|
-
children: /* @__PURE__ */ e(
|
|
874
|
+
children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
|
|
874
875
|
}
|
|
875
876
|
),
|
|
876
877
|
/* @__PURE__ */ e(
|
|
@@ -881,7 +882,7 @@ function En({
|
|
|
881
882
|
onClick: () => h.inThread ? an(t) : nn(t),
|
|
882
883
|
className: Be,
|
|
883
884
|
"data-chat-quote": !0,
|
|
884
|
-
children: /* @__PURE__ */ e(
|
|
885
|
+
children: /* @__PURE__ */ e(os, { className: "h-3 w-3" })
|
|
885
886
|
}
|
|
886
887
|
),
|
|
887
888
|
m && /* @__PURE__ */ a(ke, { children: [
|
|
@@ -890,9 +891,9 @@ function En({
|
|
|
890
891
|
{
|
|
891
892
|
type: "button",
|
|
892
893
|
title: "Make a task from this message",
|
|
893
|
-
onClick: () =>
|
|
894
|
+
onClick: () => Me.mutate(t),
|
|
894
895
|
className: Be,
|
|
895
|
-
children: /* @__PURE__ */ e(
|
|
896
|
+
children: /* @__PURE__ */ e(is, { className: "h-3 w-3" })
|
|
896
897
|
}
|
|
897
898
|
),
|
|
898
899
|
t.message && /* @__PURE__ */ e(
|
|
@@ -903,7 +904,7 @@ function En({
|
|
|
903
904
|
onClick: () => _.mutate(t),
|
|
904
905
|
className: Be,
|
|
905
906
|
"data-chat-to-notes": !0,
|
|
906
|
-
children: /* @__PURE__ */ e(
|
|
907
|
+
children: /* @__PURE__ */ e(cs, { className: "h-3 w-3" })
|
|
907
908
|
}
|
|
908
909
|
)
|
|
909
910
|
] }),
|
|
@@ -930,7 +931,7 @@ function En({
|
|
|
930
931
|
"rounded-full p-0.5",
|
|
931
932
|
Ce.has(t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
|
|
932
933
|
),
|
|
933
|
-
children: /* @__PURE__ */ e(
|
|
934
|
+
children: /* @__PURE__ */ e(ds, { className: "h-3 w-3" })
|
|
934
935
|
}
|
|
935
936
|
),
|
|
936
937
|
Oe && /* @__PURE__ */ e(
|
|
@@ -942,10 +943,10 @@ function En({
|
|
|
942
943
|
ft(t.id), Jt(t.message), xt(null);
|
|
943
944
|
},
|
|
944
945
|
className: Be,
|
|
945
|
-
children: /* @__PURE__ */ e(
|
|
946
|
+
children: /* @__PURE__ */ e(us, { className: "h-3 w-3" })
|
|
946
947
|
}
|
|
947
948
|
),
|
|
948
|
-
|
|
949
|
+
qe && (Ua === t.id ? /* @__PURE__ */ e(
|
|
949
950
|
"button",
|
|
950
951
|
{
|
|
951
952
|
type: "button",
|
|
@@ -963,14 +964,14 @@ function En({
|
|
|
963
964
|
title: N ? "Delete" : "Delete (admin)",
|
|
964
965
|
onClick: () => xt(t.id),
|
|
965
966
|
className: "rounded-full p-0.5 text-slate-400 hover:text-red-500",
|
|
966
|
-
children: /* @__PURE__ */ e(
|
|
967
|
+
children: /* @__PURE__ */ e(ms, { className: "h-3 w-3" })
|
|
967
968
|
}
|
|
968
969
|
)),
|
|
969
970
|
/* @__PURE__ */ e(
|
|
970
|
-
|
|
971
|
+
Or,
|
|
971
972
|
{
|
|
972
973
|
messageId: t.id,
|
|
973
|
-
actions:
|
|
974
|
+
actions: Lr(Da, t, je),
|
|
974
975
|
navigate: x.navigate,
|
|
975
976
|
onOpenChange: (D) => Yt(D ? t.id : null)
|
|
976
977
|
}
|
|
@@ -987,7 +988,7 @@ function En({
|
|
|
987
988
|
),
|
|
988
989
|
"data-chat-urgent": !0,
|
|
989
990
|
children: [
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
+
/* @__PURE__ */ e(ps, { className: "h-3 w-3" }),
|
|
991
992
|
" Urgent"
|
|
992
993
|
]
|
|
993
994
|
}
|
|
@@ -1033,7 +1034,7 @@ function En({
|
|
|
1033
1034
|
{
|
|
1034
1035
|
className: g(
|
|
1035
1036
|
"inline-block max-w-full rounded-2xl text-left leading-snug",
|
|
1036
|
-
|
|
1037
|
+
Ee === "compact" ? "px-2.5 py-1 text-[12px]" : "px-3 py-1.5 text-[12.5px]",
|
|
1037
1038
|
N ? g("rounded-br-md", f.bubbleMine) : g("rounded-bl-md", f.bubbleOther),
|
|
1038
1039
|
t.urgent && "ring-2 ring-red-400/70"
|
|
1039
1040
|
),
|
|
@@ -1055,42 +1056,42 @@ function En({
|
|
|
1055
1056
|
}
|
|
1056
1057
|
),
|
|
1057
1058
|
t.message && On(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
|
|
1058
|
-
|
|
1059
|
+
Pr,
|
|
1059
1060
|
{
|
|
1060
1061
|
text: On(t.message),
|
|
1061
1062
|
mine: N,
|
|
1062
|
-
renderToken: N ?
|
|
1063
|
+
renderToken: N ? Ba : qa,
|
|
1063
1064
|
entityPattern: x.entityPattern,
|
|
1064
1065
|
timeRefs: t.time_refs,
|
|
1065
1066
|
navigate: x.navigate
|
|
1066
1067
|
}
|
|
1067
1068
|
)),
|
|
1068
1069
|
Ln(t.message) != null && /* @__PURE__ */ e(
|
|
1069
|
-
|
|
1070
|
+
_r,
|
|
1070
1071
|
{
|
|
1071
1072
|
id: Ln(t.message),
|
|
1072
1073
|
mine: N,
|
|
1073
1074
|
renderAvatar: (D, R) => /* @__PURE__ */ e(Q, { id: D, name: R, size: 18, presence: !1 })
|
|
1074
1075
|
}
|
|
1075
1076
|
),
|
|
1076
|
-
t.poll && /* @__PURE__ */ e(
|
|
1077
|
+
t.poll && /* @__PURE__ */ e(jr, { poll: t.poll, room: t.room, mine: N }),
|
|
1077
1078
|
(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) => {
|
|
1078
|
-
const R = Ct == null ? void 0 : Ct.get(D), ot = (R == null ? void 0 : R.title) || (R == null ? void 0 : R.filename_download) || "Attachment", _t = u.fileUrl(D),
|
|
1079
|
+
const R = Ct == null ? void 0 : Ct.get(D), ot = (R == null ? void 0 : R.title) || (R == null ? void 0 : R.filename_download) || "Attachment", _t = u.fileUrl(D), Wa = ((R == null ? void 0 : R.type) ?? "").startsWith("image/"), it = Gr(R == null ? void 0 : R.tags, R == null ? void 0 : R.type), Tn = () => Vt({
|
|
1079
1080
|
id: D,
|
|
1080
1081
|
url: _t,
|
|
1081
1082
|
name: ot,
|
|
1082
1083
|
type: (R == null ? void 0 : R.type) ?? null,
|
|
1083
1084
|
size: (R == null ? void 0 : R.filesize) ?? null
|
|
1084
1085
|
}), ct = m && Z.length > 0 ? /* @__PURE__ */ e(
|
|
1085
|
-
|
|
1086
|
+
al,
|
|
1086
1087
|
{
|
|
1087
1088
|
targets: Z,
|
|
1088
1089
|
recordLabel: m.label,
|
|
1089
|
-
onPick: (
|
|
1090
|
+
onPick: (Fa) => I.mutate({ messageId: t.id, fileId: D, field: Fa })
|
|
1090
1091
|
}
|
|
1091
1092
|
) : null;
|
|
1092
1093
|
return it ? /* @__PURE__ */ e(
|
|
1093
|
-
|
|
1094
|
+
Qr,
|
|
1094
1095
|
{
|
|
1095
1096
|
url: _t,
|
|
1096
1097
|
poster: it.poster ? u.fileUrl(it.poster) : null,
|
|
@@ -1099,7 +1100,7 @@ function En({
|
|
|
1099
1100
|
action: ct
|
|
1100
1101
|
},
|
|
1101
1102
|
D
|
|
1102
|
-
) :
|
|
1103
|
+
) : Wa ? /* @__PURE__ */ a("span", { className: "relative inline-block", children: [
|
|
1103
1104
|
/* @__PURE__ */ e(
|
|
1104
1105
|
"button",
|
|
1105
1106
|
{
|
|
@@ -1129,7 +1130,7 @@ function En({
|
|
|
1129
1130
|
N ? "border-white/30 bg-white/10" : "border-slate-200 bg-white dark:border-border dark:bg-card"
|
|
1130
1131
|
),
|
|
1131
1132
|
children: [
|
|
1132
|
-
/* @__PURE__ */ e(
|
|
1133
|
+
/* @__PURE__ */ e(hs, { className: "h-3 w-3 shrink-0 opacity-60" }),
|
|
1133
1134
|
/* @__PURE__ */ e("span", { className: "truncate", children: ot })
|
|
1134
1135
|
]
|
|
1135
1136
|
}
|
|
@@ -1141,7 +1142,7 @@ function En({
|
|
|
1141
1142
|
}
|
|
1142
1143
|
),
|
|
1143
1144
|
!H && !Ae && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
|
|
1144
|
-
|
|
1145
|
+
Ir,
|
|
1145
1146
|
{
|
|
1146
1147
|
text: t.message,
|
|
1147
1148
|
navigate: x.navigate,
|
|
@@ -1164,7 +1165,7 @@ function En({
|
|
|
1164
1165
|
R.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"
|
|
1165
1166
|
),
|
|
1166
1167
|
children: [
|
|
1167
|
-
/* @__PURE__ */ e(
|
|
1168
|
+
/* @__PURE__ */ e(vr, { value: D }),
|
|
1168
1169
|
/* @__PURE__ */ e("span", { className: "tabular-nums", children: R.count })
|
|
1169
1170
|
]
|
|
1170
1171
|
},
|
|
@@ -1190,7 +1191,7 @@ function En({
|
|
|
1190
1191
|
t.thread.count === 1 ? "reply" : "replies",
|
|
1191
1192
|
t.thread.last_reply_at && /* @__PURE__ */ a("span", { className: "font-normal text-slate-500 dark:text-slate-400", children: [
|
|
1192
1193
|
"· last ",
|
|
1193
|
-
|
|
1194
|
+
Kn(t.thread.last_reply_at)
|
|
1194
1195
|
] })
|
|
1195
1196
|
]
|
|
1196
1197
|
}
|
|
@@ -1204,7 +1205,7 @@ function En({
|
|
|
1204
1205
|
"data-tip": `Posted for ${N ? "you" : t.sender_name ?? "this person"} through an app or API key named "${t.via_app}". The name is the app's own, not a person.`,
|
|
1205
1206
|
"data-chat-message-via-app": !0,
|
|
1206
1207
|
children: [
|
|
1207
|
-
/* @__PURE__ */ e(
|
|
1208
|
+
/* @__PURE__ */ e(fs, { className: "h-3 w-3 shrink-0", "aria-hidden": !0 }),
|
|
1208
1209
|
/* @__PURE__ */ a("span", { className: "truncate", children: [
|
|
1209
1210
|
"via app · ",
|
|
1210
1211
|
t.via_app
|
|
@@ -1221,7 +1222,7 @@ function En({
|
|
|
1221
1222
|
var R;
|
|
1222
1223
|
const D = Pe(t);
|
|
1223
1224
|
return D.length === 0 ? null : /* @__PURE__ */ e(
|
|
1224
|
-
|
|
1225
|
+
ll,
|
|
1225
1226
|
{
|
|
1226
1227
|
seen: D,
|
|
1227
1228
|
channelId: ((R = w == null ? void 0 : w.channel) == null ? void 0 : R.id) ?? null,
|
|
@@ -1230,7 +1231,7 @@ function En({
|
|
|
1230
1231
|
);
|
|
1231
1232
|
})(),
|
|
1232
1233
|
h.isLastMine && n.startsWith("dm:") && (W ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
|
|
1233
|
-
/* @__PURE__ */ e(
|
|
1234
|
+
/* @__PURE__ */ e(xs, { className: "h-3 w-3", strokeWidth: 2.4 }),
|
|
1234
1235
|
" Read"
|
|
1235
1236
|
] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
1236
1237
|
/* @__PURE__ */ e(Lt, { className: "h-3 w-3", strokeWidth: 2.2 }),
|
|
@@ -1242,17 +1243,17 @@ function En({
|
|
|
1242
1243
|
}
|
|
1243
1244
|
);
|
|
1244
1245
|
}, hn = (t) => /* @__PURE__ */ e(
|
|
1245
|
-
|
|
1246
|
+
zs,
|
|
1246
1247
|
{
|
|
1247
1248
|
ref: t ? void 0 : sn,
|
|
1248
1249
|
room: n,
|
|
1249
1250
|
label: S,
|
|
1250
1251
|
parentId: t,
|
|
1251
|
-
quote: t ?
|
|
1252
|
+
quote: t ? Aa : $a,
|
|
1252
1253
|
onClearQuote: () => t ? an(null) : nn(null),
|
|
1253
|
-
onSent:
|
|
1254
|
+
onSent: Oa,
|
|
1254
1255
|
disabledReason: t ? null : un,
|
|
1255
|
-
quietNote:
|
|
1256
|
+
quietNote: ja,
|
|
1256
1257
|
th: f,
|
|
1257
1258
|
renderAvatar: (h, N) => /* @__PURE__ */ e(Q, { id: h, name: N, size: 22, presence: h !== "__bot__" })
|
|
1258
1259
|
}
|
|
@@ -1273,7 +1274,7 @@ function En({
|
|
|
1273
1274
|
t.dataTransfer.files.length && (t.preventDefault(), gt(!1), (h = sn.current) == null || h.addFiles([...t.dataTransfer.files]));
|
|
1274
1275
|
},
|
|
1275
1276
|
children: [
|
|
1276
|
-
|
|
1277
|
+
Ra && /* @__PURE__ */ e(
|
|
1277
1278
|
"div",
|
|
1278
1279
|
{
|
|
1279
1280
|
className: "pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-xl border-2 border-dashed border-nvr-cyan bg-white/85 text-[13px] font-semibold text-slate-700 dark:bg-card/90 dark:text-slate-100",
|
|
@@ -1293,12 +1294,12 @@ function En({
|
|
|
1293
1294
|
}
|
|
1294
1295
|
),
|
|
1295
1296
|
((w == null ? void 0 : w.kind) === "channel" && !((bn = w.channel) != null && bn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((gn = w.channel) == null ? void 0 : gn.icon) || ((vn = w.channel) == null ? void 0 : vn.color))) && /* @__PURE__ */ e(Ye, { icon: (yn = w == null ? void 0 : w.channel) == null ? void 0 : yn.icon, color: (kn = w == null ? void 0 : w.channel) == null ? void 0 : kn.color, size: 24 }),
|
|
1296
|
-
b && Se(n, b.id) && /* @__PURE__ */ e(
|
|
1297
|
+
b && Se(n, b.id) && /* @__PURE__ */ e(Yr, { peerId: Se(n, b.id), name: S }),
|
|
1297
1298
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
1298
1299
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
1299
1300
|
/* @__PURE__ */ e("span", { className: "truncate", children: S }),
|
|
1300
|
-
w && /* @__PURE__ */ e(
|
|
1301
|
-
(
|
|
1301
|
+
w && /* @__PURE__ */ e(Er, { starred: !!w.starred, notify: Gt }),
|
|
1302
|
+
(q == null ? void 0 : q.announce) && /* @__PURE__ */ e(
|
|
1302
1303
|
"span",
|
|
1303
1304
|
{
|
|
1304
1305
|
className: "shrink-0 rounded bg-slate-100 px-1.5 py-px text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
@@ -1307,8 +1308,8 @@ function En({
|
|
|
1307
1308
|
}
|
|
1308
1309
|
)
|
|
1309
1310
|
] }),
|
|
1310
|
-
b && Se(n, b.id) ? /* @__PURE__ */ e(
|
|
1311
|
-
|
|
1311
|
+
b && Se(n, b.id) ? /* @__PURE__ */ e(tl, { peerId: Se(n, b.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
|
|
1312
|
+
Br,
|
|
1312
1313
|
{
|
|
1313
1314
|
room: n,
|
|
1314
1315
|
me: ((wn = x.me) == null ? void 0 : wn.id) ?? null,
|
|
@@ -1317,7 +1318,7 @@ function En({
|
|
|
1317
1318
|
) : null
|
|
1318
1319
|
] }),
|
|
1319
1320
|
/* @__PURE__ */ e(
|
|
1320
|
-
|
|
1321
|
+
Nr,
|
|
1321
1322
|
{
|
|
1322
1323
|
room: n,
|
|
1323
1324
|
roomLabel: S,
|
|
@@ -1330,7 +1331,7 @@ function En({
|
|
|
1330
1331
|
{
|
|
1331
1332
|
type: "button",
|
|
1332
1333
|
onClick: () => {
|
|
1333
|
-
|
|
1334
|
+
Sa((t) => !t), Qt("");
|
|
1334
1335
|
},
|
|
1335
1336
|
className: g(In, tt ? f.accentSoft : Pn),
|
|
1336
1337
|
"aria-label": "Search in this conversation",
|
|
@@ -1339,7 +1340,7 @@ function En({
|
|
|
1339
1340
|
children: /* @__PURE__ */ e(Hn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1340
1341
|
}
|
|
1341
1342
|
),
|
|
1342
|
-
((Nn = w == null ? void 0 : w.channel) == null ? void 0 : Nn.is_direct) && /* @__PURE__ */ e(
|
|
1343
|
+
((Nn = w == null ? void 0 : w.channel) == null ? void 0 : Nn.is_direct) && /* @__PURE__ */ e(ol, { channel: w.channel, onLeft: l }),
|
|
1343
1344
|
/* @__PURE__ */ e(
|
|
1344
1345
|
"button",
|
|
1345
1346
|
{
|
|
@@ -1352,7 +1353,7 @@ function En({
|
|
|
1352
1353
|
"aria-pressed": bt,
|
|
1353
1354
|
"data-tip": "Room info — members, pinned, files and links",
|
|
1354
1355
|
"data-chat-info-button": !0,
|
|
1355
|
-
children: /* @__PURE__ */ e(
|
|
1356
|
+
children: /* @__PURE__ */ e(ss, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
1356
1357
|
}
|
|
1357
1358
|
),
|
|
1358
1359
|
/* @__PURE__ */ e(
|
|
@@ -1360,7 +1361,7 @@ function En({
|
|
|
1360
1361
|
{
|
|
1361
1362
|
th: f,
|
|
1362
1363
|
huddleSchedule: y.enabled ? (t) => /* @__PURE__ */ e(
|
|
1363
|
-
|
|
1364
|
+
Sr,
|
|
1364
1365
|
{
|
|
1365
1366
|
room: n,
|
|
1366
1367
|
me: (b == null ? void 0 : b.id) ?? null,
|
|
@@ -1370,13 +1371,13 @@ function En({
|
|
|
1370
1371
|
}
|
|
1371
1372
|
) : void 0,
|
|
1372
1373
|
starred: w ? !!w.starred : void 0,
|
|
1373
|
-
onStar: w ? () =>
|
|
1374
|
+
onStar: w ? () => va.mutate({ room: n, starred: !w.starred }) : void 0,
|
|
1374
1375
|
notify: w ? Gt : void 0,
|
|
1375
1376
|
onNotify: w ? (t) => {
|
|
1376
1377
|
t === "muted" ? z.mutate({ room: n, muted: !0 }) : (w.muted && z.mutate({ room: n, muted: !1 }), re.mutate({ room: n, mode: t }));
|
|
1377
1378
|
} : void 0,
|
|
1378
1379
|
onJump: (t) => {
|
|
1379
|
-
|
|
1380
|
+
$e.current = !1, le.current = !1, M({ date: t });
|
|
1380
1381
|
},
|
|
1381
1382
|
onOpenRecord: oe ? () => {
|
|
1382
1383
|
var t;
|
|
@@ -1414,7 +1415,7 @@ function En({
|
|
|
1414
1415
|
} : void 0,
|
|
1415
1416
|
onSettings: r,
|
|
1416
1417
|
archived: !!(w != null && w.archived),
|
|
1417
|
-
onArchive: w &&
|
|
1418
|
+
onArchive: w && _a ? () => fe.mutate(
|
|
1418
1419
|
{ room: n, archived: !w.archived },
|
|
1419
1420
|
{
|
|
1420
1421
|
onSuccess: () => {
|
|
@@ -1427,19 +1428,19 @@ function En({
|
|
|
1427
1428
|
}
|
|
1428
1429
|
}
|
|
1429
1430
|
) : void 0,
|
|
1430
|
-
onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () =>
|
|
1431
|
+
onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () => ka.mutate(n, {
|
|
1431
1432
|
onSuccess: () => {
|
|
1432
1433
|
ge.success(`Left ${w.label}`, {
|
|
1433
1434
|
description: "Open the record's chat again to rejoin."
|
|
1434
1435
|
}), l();
|
|
1435
1436
|
}
|
|
1436
1437
|
}) : void 0,
|
|
1437
|
-
tips: /* @__PURE__ */ e(
|
|
1438
|
+
tips: /* @__PURE__ */ e(Vr, { botName: pe })
|
|
1438
1439
|
}
|
|
1439
1440
|
)
|
|
1440
1441
|
] }),
|
|
1441
1442
|
/* @__PURE__ */ e(
|
|
1442
|
-
|
|
1443
|
+
Tr,
|
|
1443
1444
|
{
|
|
1444
1445
|
room: n,
|
|
1445
1446
|
me: b,
|
|
@@ -1458,12 +1459,12 @@ function En({
|
|
|
1458
1459
|
"aria-label": "Search messages"
|
|
1459
1460
|
}
|
|
1460
1461
|
) }),
|
|
1461
|
-
/* @__PURE__ */ e(
|
|
1462
|
-
|
|
1463
|
-
|
|
1462
|
+
/* @__PURE__ */ e(Xr, { room: n }),
|
|
1463
|
+
q && !q.is_direct && /* @__PURE__ */ e(
|
|
1464
|
+
Wr,
|
|
1464
1465
|
{
|
|
1465
|
-
description:
|
|
1466
|
-
links:
|
|
1466
|
+
description: q.description,
|
|
1467
|
+
links: q.links,
|
|
1467
1468
|
th: f,
|
|
1468
1469
|
navigate: x.navigate
|
|
1469
1470
|
}
|
|
@@ -1484,21 +1485,21 @@ function En({
|
|
|
1484
1485
|
]
|
|
1485
1486
|
}
|
|
1486
1487
|
) }),
|
|
1487
|
-
(
|
|
1488
|
-
|
|
1488
|
+
(q == null ? void 0 : q.archive_suggested_at) && q.id !== 0 && (dn || X) && /* @__PURE__ */ e(
|
|
1489
|
+
Ps,
|
|
1489
1490
|
{
|
|
1490
|
-
channelId:
|
|
1491
|
+
channelId: q.id,
|
|
1491
1492
|
channelName: S,
|
|
1492
|
-
suggestedAt:
|
|
1493
|
+
suggestedAt: q.archive_suggested_at
|
|
1493
1494
|
}
|
|
1494
1495
|
),
|
|
1495
|
-
|
|
1496
|
-
|
|
1496
|
+
Ea && (q == null ? void 0 : q.welcome_note) && /* @__PURE__ */ e(
|
|
1497
|
+
Fr,
|
|
1497
1498
|
{
|
|
1498
|
-
note:
|
|
1499
|
+
note: q.welcome_note,
|
|
1499
1500
|
channelName: S,
|
|
1500
1501
|
th: f,
|
|
1501
|
-
onDismiss: () =>
|
|
1502
|
+
onDismiss: () => ya.mutate(n)
|
|
1502
1503
|
}
|
|
1503
1504
|
),
|
|
1504
1505
|
/* @__PURE__ */ e(
|
|
@@ -1507,11 +1508,11 @@ function En({
|
|
|
1507
1508
|
ref: Re,
|
|
1508
1509
|
onScroll: (t) => {
|
|
1509
1510
|
const h = t.currentTarget;
|
|
1510
|
-
le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, wt.current = h.scrollHeight, le.current && ce && He(null), we.onScroll(), h.scrollTop < 200 && J && !O && !xe &&
|
|
1511
|
+
le.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, wt.current = h.scrollHeight, le.current && ce && He(null), we.onScroll(), h.scrollTop < 200 && J && !O && !xe && $e.current && F();
|
|
1511
1512
|
},
|
|
1512
1513
|
className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
|
|
1513
1514
|
"data-chat-messages": !0,
|
|
1514
|
-
children: /* @__PURE__ */ a("div", { ref: rn, className:
|
|
1515
|
+
children: /* @__PURE__ */ a("div", { ref: rn, className: Ee === "compact" ? "space-y-1" : "space-y-2.5", children: [
|
|
1515
1516
|
J && !xe && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
|
|
1516
1517
|
"button",
|
|
1517
1518
|
{
|
|
@@ -1526,7 +1527,7 @@ function En({
|
|
|
1526
1527
|
children: O ? "Loading…" : "Load earlier messages"
|
|
1527
1528
|
}
|
|
1528
1529
|
) }),
|
|
1529
|
-
|
|
1530
|
+
E ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : _e.length === 0 && K.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: xe ? "No messages match." : B ? "Nothing was said around then." : /* @__PURE__ */ a(ke, { children: [
|
|
1530
1531
|
/* @__PURE__ */ e("p", { children: "No messages yet — say hello." }),
|
|
1531
1532
|
/* @__PURE__ */ a("p", { className: "mt-1 text-[11px]", children: [
|
|
1532
1533
|
"Tip: @ mentions someone",
|
|
@@ -1541,17 +1542,17 @@ function En({
|
|
|
1541
1542
|
"data-chat-rows": we.windowed ? "windowed" : "all",
|
|
1542
1543
|
children: _e.slice(we.start, we.end).map((t, h) => {
|
|
1543
1544
|
var Ae;
|
|
1544
|
-
const N = we.start + h, W = _e[N - 1], H = N === 0 || W && new Date(W.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !B && kt.current > 0 && N === Math.max(0, _e.length - kt.current),
|
|
1545
|
+
const N = we.start + h, W = _e[N - 1], H = N === 0 || W && new Date(W.date_created).toDateString() !== new Date(t.date_created).toDateString(), Oe = !xe && !B && kt.current > 0 && N === Math.max(0, _e.length - kt.current), qe = Ee === "compact" && !H && !!W && W.sender === t.sender && !W.is_system && new Date(t.date_created).getTime() - new Date(W.date_created).getTime() < 5 * 6e4;
|
|
1545
1546
|
return /* @__PURE__ */ a(
|
|
1546
1547
|
"div",
|
|
1547
1548
|
{
|
|
1548
1549
|
ref: we.rowRef(t.id),
|
|
1549
1550
|
"data-chat-row": t.id,
|
|
1550
|
-
className: N > 0 ?
|
|
1551
|
+
className: N > 0 ? Ee === "compact" ? "pt-1" : "pt-2.5" : void 0,
|
|
1551
1552
|
children: [
|
|
1552
1553
|
H && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
|
|
1553
1554
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
|
|
1554
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children:
|
|
1555
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Zr(t.date_created) }),
|
|
1555
1556
|
/* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
|
|
1556
1557
|
] }),
|
|
1557
1558
|
Oe && /* @__PURE__ */ a(
|
|
@@ -1577,10 +1578,10 @@ function En({
|
|
|
1577
1578
|
]
|
|
1578
1579
|
}
|
|
1579
1580
|
),
|
|
1580
|
-
Oe &&
|
|
1581
|
+
Oe && $ && /* @__PURE__ */ e("div", { className: "my-1 rounded-md border border-nvr-cyan/25 bg-nvr-cyan/5 px-2.5 py-1.5 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: $ }),
|
|
1581
1582
|
pn(t, {
|
|
1582
|
-
isLastMine: ((Ae = t.sender) == null ? void 0 : Ae.toLowerCase()) === je && N ===
|
|
1583
|
-
showSender: !
|
|
1583
|
+
isLastMine: ((Ae = t.sender) == null ? void 0 : Ae.toLowerCase()) === je && N === La,
|
|
1584
|
+
showSender: !qe
|
|
1584
1585
|
})
|
|
1585
1586
|
]
|
|
1586
1587
|
},
|
|
@@ -1589,9 +1590,9 @@ function En({
|
|
|
1589
1590
|
})
|
|
1590
1591
|
}
|
|
1591
1592
|
),
|
|
1592
|
-
!xe && !G && /* @__PURE__ */ e(
|
|
1593
|
+
!xe && !G && /* @__PURE__ */ e(da, { items: K, th: f }),
|
|
1593
1594
|
!xe && !G && Qe.live && pe && /* @__PURE__ */ e(
|
|
1594
|
-
|
|
1595
|
+
Os,
|
|
1595
1596
|
{
|
|
1596
1597
|
live: Qe.live,
|
|
1597
1598
|
botName: pe,
|
|
@@ -1610,7 +1611,7 @@ function En({
|
|
|
1610
1611
|
type: "button",
|
|
1611
1612
|
onClick: () => {
|
|
1612
1613
|
if (G) {
|
|
1613
|
-
|
|
1614
|
+
$e.current = !1, le.current = !0, M(null);
|
|
1614
1615
|
return;
|
|
1615
1616
|
}
|
|
1616
1617
|
ce && !Nt(ce.firstId) && rt(), He(null);
|
|
@@ -1639,10 +1640,10 @@ function En({
|
|
|
1639
1640
|
]
|
|
1640
1641
|
}
|
|
1641
1642
|
) : Y.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: Y.typingText }) }),
|
|
1642
|
-
Zt && /* @__PURE__ */ e(
|
|
1643
|
+
Zt && /* @__PURE__ */ e(Ms, { file: Zt, onClose: () => Vt(null) }),
|
|
1643
1644
|
hn(null),
|
|
1644
1645
|
Xt != null && /* @__PURE__ */ e(
|
|
1645
|
-
|
|
1646
|
+
zr,
|
|
1646
1647
|
{
|
|
1647
1648
|
room: n,
|
|
1648
1649
|
rootId: Xt,
|
|
@@ -1650,11 +1651,11 @@ function En({
|
|
|
1650
1651
|
onClose: () => Ie(null),
|
|
1651
1652
|
renderRow: (t) => pn(t, { inThread: !0 }),
|
|
1652
1653
|
renderComposer: (t) => hn(t),
|
|
1653
|
-
renderOutbox: (t) => /* @__PURE__ */ e(
|
|
1654
|
+
renderOutbox: (t) => /* @__PURE__ */ e(nl, { room: n, parentId: t, th: f })
|
|
1654
1655
|
}
|
|
1655
1656
|
),
|
|
1656
1657
|
bt && /* @__PURE__ */ e(
|
|
1657
|
-
|
|
1658
|
+
Hr,
|
|
1658
1659
|
{
|
|
1659
1660
|
room: n,
|
|
1660
1661
|
label: S,
|
|
@@ -1671,11 +1672,11 @@ function En({
|
|
|
1671
1672
|
}
|
|
1672
1673
|
);
|
|
1673
1674
|
}
|
|
1674
|
-
function
|
|
1675
|
-
const r =
|
|
1676
|
-
return /* @__PURE__ */ e(
|
|
1675
|
+
function nl({ room: n, parentId: s, th: l }) {
|
|
1676
|
+
const r = ca(n, s);
|
|
1677
|
+
return /* @__PURE__ */ e(da, { items: r, th: l });
|
|
1677
1678
|
}
|
|
1678
|
-
function
|
|
1679
|
+
function al({
|
|
1679
1680
|
targets: n,
|
|
1680
1681
|
recordLabel: s,
|
|
1681
1682
|
onPick: l
|
|
@@ -1690,7 +1691,7 @@ function nl({
|
|
|
1690
1691
|
title: `Attach to ${s}`,
|
|
1691
1692
|
"aria-label": `Attach to ${s}`,
|
|
1692
1693
|
"data-chat-attach-to-record": !0,
|
|
1693
|
-
children: /* @__PURE__ */ e(
|
|
1694
|
+
children: /* @__PURE__ */ e(gs, { className: "h-3 w-3" })
|
|
1694
1695
|
}
|
|
1695
1696
|
) }),
|
|
1696
1697
|
/* @__PURE__ */ a(et, { align: "end", className: "w-[220px] p-1.5", children: [
|
|
@@ -1724,25 +1725,25 @@ function Bn(n) {
|
|
|
1724
1725
|
color: n.color ?? null
|
|
1725
1726
|
};
|
|
1726
1727
|
}
|
|
1727
|
-
const
|
|
1728
|
+
const sl = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1728
1729
|
function At(n) {
|
|
1729
1730
|
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;
|
|
1730
1731
|
return s == null || s < 1 ? "Idle" : s < 60 ? `Idle · ${s}m` : `Idle · ${Math.floor(s / 60)}h ${s % 60}m`;
|
|
1731
1732
|
}
|
|
1732
1733
|
function Wn(n) {
|
|
1733
1734
|
const s = n == null ? void 0 : n.trim();
|
|
1734
|
-
return !s ||
|
|
1735
|
+
return !s || sl.test(s) ? null : s;
|
|
1735
1736
|
}
|
|
1736
|
-
function
|
|
1737
|
+
function rl(n) {
|
|
1737
1738
|
const s = new Date(n), l = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
1738
1739
|
return s.toDateString() === l.toDateString() ? r : (l.getTime() - s.getTime()) / 864e5 < 6 ? `${s.toLocaleDateString("en-US", { weekday: "short" })} ${r}` : `${s.toLocaleDateString("en-US", { month: "short", day: "numeric" })}, ${r}`;
|
|
1739
1740
|
}
|
|
1740
|
-
function
|
|
1741
|
+
function ll({
|
|
1741
1742
|
seen: n,
|
|
1742
1743
|
channelId: s,
|
|
1743
1744
|
senderId: l
|
|
1744
1745
|
}) {
|
|
1745
|
-
const r = ue(), [o, i] = T(!1), { members: p } =
|
|
1746
|
+
const r = ue(), [o, i] = T(!1), { members: p } = ta(o ? s : null), d = new Set(n.map((u) => String(u.user).toUpperCase())), x = p.filter((u) => {
|
|
1746
1747
|
const b = String(u.user).toUpperCase();
|
|
1747
1748
|
return b !== l.toUpperCase() && !d.has(b);
|
|
1748
1749
|
}), f = [...n].sort(
|
|
@@ -1786,7 +1787,7 @@ function rl({
|
|
|
1786
1787
|
{
|
|
1787
1788
|
className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
|
|
1788
1789
|
"data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
|
|
1789
|
-
children:
|
|
1790
|
+
children: rl(u.last_read_at)
|
|
1790
1791
|
}
|
|
1791
1792
|
)
|
|
1792
1793
|
] }, u.user)),
|
|
@@ -1810,14 +1811,14 @@ function rl({
|
|
|
1810
1811
|
)
|
|
1811
1812
|
] });
|
|
1812
1813
|
}
|
|
1813
|
-
function
|
|
1814
|
+
function ol({ channel: n, onLeft: s }) {
|
|
1814
1815
|
var F;
|
|
1815
|
-
const l = ue(), r = Le(), { isAdmin: o } = ht(), [i, p] = T(!1), [d, x] = T(""), f = mt(d, 250), u =
|
|
1816
|
+
const l = ue(), r = Le(), { isAdmin: o } = ht(), [i, p] = T(!1), [d, x] = T(""), f = mt(d, 250), u = hr(
|
|
1816
1817
|
`channel-${n.id}`,
|
|
1817
1818
|
`/chat/channels/${n.id}/members`,
|
|
1818
1819
|
f,
|
|
1819
1820
|
i
|
|
1820
|
-
), b = u.members, y = u.loading, { addMember: U, removeMember: A } =
|
|
1821
|
+
), b = u.members, y = u.loading, { addMember: U, removeMember: A } = na(n.id), [C, S] = T(""), B = mt(C, 250), M = ((F = r.me) == null ? void 0 : F.id.toUpperCase()) ?? "", v = o || !!M && String(n.created_by ?? "").toUpperCase() === M, { users: E } = Bt(B, i && v && !!C.trim()), J = new Set(b.map((O) => O.id.toUpperCase())), G = b;
|
|
1821
1822
|
return /* @__PURE__ */ a(Ve, { open: i, onOpenChange: p, children: [
|
|
1822
1823
|
/* @__PURE__ */ e(Xe, { asChild: !0, children: /* @__PURE__ */ a(
|
|
1823
1824
|
"button",
|
|
@@ -1831,7 +1832,7 @@ function ll({ channel: n, onLeft: s }) {
|
|
|
1831
1832
|
),
|
|
1832
1833
|
"data-chat-group-members": !0,
|
|
1833
1834
|
children: [
|
|
1834
|
-
/* @__PURE__ */ e(
|
|
1835
|
+
/* @__PURE__ */ e(Mt, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
|
|
1835
1836
|
u.total > 0 && u.total
|
|
1836
1837
|
]
|
|
1837
1838
|
}
|
|
@@ -1849,13 +1850,13 @@ function ll({ channel: n, onLeft: s }) {
|
|
|
1849
1850
|
"In this conversation ",
|
|
1850
1851
|
u.total > 0 && `· ${u.total.toLocaleString("en-US")}`
|
|
1851
1852
|
] }),
|
|
1852
|
-
(u.total > 10 || d) && /* @__PURE__ */ e(
|
|
1853
|
+
(u.total > 10 || d) && /* @__PURE__ */ e(Mr, { value: d, onChange: x, className: "mt-1.5" })
|
|
1853
1854
|
] }),
|
|
1854
1855
|
/* @__PURE__ */ a("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
|
|
1855
1856
|
y && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
|
|
1856
1857
|
!y && G.length === 0 && d.trim() && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No one matches." }),
|
|
1857
1858
|
G.map((O) => {
|
|
1858
|
-
const K = O.id.toUpperCase(), ee = O.name, Y = K ===
|
|
1859
|
+
const K = O.id.toUpperCase(), ee = O.name, Y = K === M, te = String(n.created_by ?? "").toUpperCase() === K;
|
|
1859
1860
|
return /* @__PURE__ */ a(
|
|
1860
1861
|
"div",
|
|
1861
1862
|
{
|
|
@@ -1888,7 +1889,7 @@ function ll({ channel: n, onLeft: s }) {
|
|
|
1888
1889
|
);
|
|
1889
1890
|
}),
|
|
1890
1891
|
/* @__PURE__ */ e(
|
|
1891
|
-
|
|
1892
|
+
Ar,
|
|
1892
1893
|
{
|
|
1893
1894
|
hasMore: u.hasMore,
|
|
1894
1895
|
loading: u.loadingMore,
|
|
@@ -1907,7 +1908,7 @@ function ll({ channel: n, onLeft: s }) {
|
|
|
1907
1908
|
"data-chat-group-add": !0
|
|
1908
1909
|
}
|
|
1909
1910
|
),
|
|
1910
|
-
C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children:
|
|
1911
|
+
C.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: E.filter((O) => !J.has(String(O.id).toUpperCase())).map((O) => {
|
|
1911
1912
|
const K = [O.first_name, O.last_name].filter(Boolean).join(" ") || O.email || O.id;
|
|
1912
1913
|
return /* @__PURE__ */ a(
|
|
1913
1914
|
"button",
|
|
@@ -1926,7 +1927,7 @@ function ll({ channel: n, onLeft: s }) {
|
|
|
1926
1927
|
);
|
|
1927
1928
|
}) })
|
|
1928
1929
|
] }),
|
|
1929
|
-
|
|
1930
|
+
M && J.has(M) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
|
|
1930
1931
|
"button",
|
|
1931
1932
|
{
|
|
1932
1933
|
type: "button",
|
|
@@ -1947,15 +1948,15 @@ function ll({ channel: n, onLeft: s }) {
|
|
|
1947
1948
|
)
|
|
1948
1949
|
] });
|
|
1949
1950
|
}
|
|
1950
|
-
function
|
|
1951
|
+
function il({
|
|
1951
1952
|
channel: n,
|
|
1952
1953
|
label: s,
|
|
1953
1954
|
onBack: l
|
|
1954
1955
|
}) {
|
|
1955
|
-
const r = ue(), o = Le(), { isAdmin: i } = ht(), p =
|
|
1956
|
+
const r = ue(), o = Le(), { isAdmin: i } = ht(), p = ea(), { members: d, loading: x } = ta(n.id), { update: f, addMember: u, removeMember: b } = na(n.id), [y, U] = T(s), [A, C] = T(n.topic ?? ""), [S, B] = T(n.visibility), [M, v] = T(n.role ?? ""), [E, J] = T({
|
|
1956
1957
|
icon: n.icon ?? null,
|
|
1957
1958
|
color: n.color ?? null
|
|
1958
|
-
}), [G, F] = T(""), O = mt(G, 250), { users: K } = Bt(O, S === "private"), [ee, Y] = T(!1), te = n.id ===
|
|
1959
|
+
}), [G, F] = T(""), O = mt(G, 250), { users: K } = Bt(O, S === "private"), [ee, Y] = T(!1), te = n.id === aa, oe = i || !te && !!o.me && String(n.created_by ?? "") === String(o.me.id), se = new Set(d.map((c) => String(c.user).toUpperCase())), me = y !== s || A !== (n.topic ?? "") || S !== n.visibility || E.icon !== (n.icon ?? null) || E.color !== (n.color ?? null) || S === "role" && M !== (n.role ?? "");
|
|
1959
1960
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
|
|
1960
1961
|
/* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
|
|
1961
1962
|
/* @__PURE__ */ e(
|
|
@@ -1987,8 +1988,8 @@ function ol({
|
|
|
1987
1988
|
)
|
|
1988
1989
|
] }),
|
|
1989
1990
|
!n.is_direct && /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
1990
|
-
/* @__PURE__ */ e(Ye, { icon:
|
|
1991
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
1991
|
+
/* @__PURE__ */ e(Ye, { icon: E.icon, color: E.color, size: 40 }),
|
|
1992
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Jn, { icon: E.icon, color: E.color, onChange: J }) })
|
|
1992
1993
|
] }),
|
|
1993
1994
|
/* @__PURE__ */ a("label", { className: "block", children: [
|
|
1994
1995
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Topic" }),
|
|
@@ -2024,7 +2025,7 @@ function ol({
|
|
|
2024
2025
|
S === "role" && /* @__PURE__ */ e(
|
|
2025
2026
|
jt,
|
|
2026
2027
|
{
|
|
2027
|
-
value:
|
|
2028
|
+
value: M,
|
|
2028
2029
|
onChange: v,
|
|
2029
2030
|
className: g(
|
|
2030
2031
|
"mt-2 h-8 w-full rounded-md px-2 text-[12.5px] outline-none",
|
|
@@ -2042,20 +2043,20 @@ function ol({
|
|
|
2042
2043
|
"button",
|
|
2043
2044
|
{
|
|
2044
2045
|
type: "button",
|
|
2045
|
-
disabled: !me || f.isPending || S === "role" &&
|
|
2046
|
+
disabled: !me || f.isPending || S === "role" && !M,
|
|
2046
2047
|
onClick: () => f.mutate(
|
|
2047
2048
|
te ? {
|
|
2048
2049
|
name: y.trim() || s,
|
|
2049
2050
|
topic: A.trim() || null,
|
|
2050
|
-
icon:
|
|
2051
|
-
color:
|
|
2051
|
+
icon: E.icon,
|
|
2052
|
+
color: E.color
|
|
2052
2053
|
} : {
|
|
2053
2054
|
name: y.trim() || s,
|
|
2054
2055
|
topic: A.trim() || null,
|
|
2055
2056
|
visibility: S,
|
|
2056
|
-
role: S === "role" ?
|
|
2057
|
-
icon:
|
|
2058
|
-
color:
|
|
2057
|
+
role: S === "role" ? M : null,
|
|
2058
|
+
icon: E.icon,
|
|
2059
|
+
color: E.color
|
|
2059
2060
|
}
|
|
2060
2061
|
),
|
|
2061
2062
|
className: g(
|
|
@@ -2126,8 +2127,8 @@ function ol({
|
|
|
2126
2127
|
]
|
|
2127
2128
|
}
|
|
2128
2129
|
),
|
|
2129
|
-
f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: f.error
|
|
2130
|
-
!n.is_direct && /* @__PURE__ */ e(
|
|
2130
|
+
f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Qn(f.error, "Could not save the changes") }),
|
|
2131
|
+
!n.is_direct && /* @__PURE__ */ e(Is, { channel: n, th: r, isAdmin: i })
|
|
2131
2132
|
] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
|
|
2132
2133
|
n.topic || "No topic set.",
|
|
2133
2134
|
/* @__PURE__ */ e("br", {}),
|
|
@@ -2186,10 +2187,10 @@ function ol({
|
|
|
2186
2187
|
}) }),
|
|
2187
2188
|
/* @__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." })
|
|
2188
2189
|
] }),
|
|
2189
|
-
oe && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(
|
|
2190
|
+
oe && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(js, { channelId: n.id, th: r }) })
|
|
2190
2191
|
] }),
|
|
2191
|
-
oe && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(
|
|
2192
|
-
!n.is_direct && /* @__PURE__ */ e(
|
|
2192
|
+
oe && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Ls, { channelId: n.id, border: r.divider }),
|
|
2193
|
+
!n.is_direct && /* @__PURE__ */ e(Es, { channelId: n.id, th: r })
|
|
2193
2194
|
] })
|
|
2194
2195
|
] });
|
|
2195
2196
|
}
|
|
@@ -2200,7 +2201,7 @@ function mt(n, s) {
|
|
|
2200
2201
|
return () => clearTimeout(o);
|
|
2201
2202
|
}, [n, s]), l;
|
|
2202
2203
|
}
|
|
2203
|
-
function
|
|
2204
|
+
function xa(n) {
|
|
2204
2205
|
var s;
|
|
2205
2206
|
return n ? n.kind === "dm" || n.kind === "entity" || n.kind === "channel" && !!((s = n.channel) != null && s.is_direct) : !1;
|
|
2206
2207
|
}
|
|
@@ -2213,11 +2214,11 @@ function Fn(n) {
|
|
|
2213
2214
|
var s;
|
|
2214
2215
|
return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
|
|
2215
2216
|
}
|
|
2216
|
-
function
|
|
2217
|
+
function cl(n, s) {
|
|
2217
2218
|
const l = (i, p) => i.label.localeCompare(p.label), r = (i, p) => Fn(p) - Fn(i) || l(i, p), o = [...n];
|
|
2218
2219
|
return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, p) => +(p.unread > 0) - +(i.unread > 0) || r(i, p)) : o.sort(r);
|
|
2219
2220
|
}
|
|
2220
|
-
function
|
|
2221
|
+
function dl({
|
|
2221
2222
|
value: n,
|
|
2222
2223
|
onChange: s
|
|
2223
2224
|
}) {
|
|
@@ -2231,7 +2232,7 @@ function cl({
|
|
|
2231
2232
|
"aria-label": `Sort rooms: ${o.label}`,
|
|
2232
2233
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-muted",
|
|
2233
2234
|
"data-chat-sort": n,
|
|
2234
|
-
children: /* @__PURE__ */ e(
|
|
2235
|
+
children: /* @__PURE__ */ e(rs, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2235
2236
|
}
|
|
2236
2237
|
) }),
|
|
2237
2238
|
/* @__PURE__ */ a(et, { align: "end", className: "w-44 p-1", children: [
|
|
@@ -2263,7 +2264,7 @@ function zn({
|
|
|
2263
2264
|
loading: o = !1,
|
|
2264
2265
|
onView: i
|
|
2265
2266
|
}) {
|
|
2266
|
-
const p = ue(), d = Le(), { setMuted: x, leave: f, setArchived: u, setStarred: b } =
|
|
2267
|
+
const p = ue(), d = Le(), { setMuted: x, leave: f, setArchived: u, setStarred: b } = qt(), y = qs(), U = ve(
|
|
2267
2268
|
() => new Map(
|
|
2268
2269
|
d.onlineUsers.map((c) => [
|
|
2269
2270
|
String(c.user_id).toUpperCase(),
|
|
@@ -2271,12 +2272,12 @@ function zn({
|
|
|
2271
2272
|
])
|
|
2272
2273
|
),
|
|
2273
2274
|
[d.onlineUsers]
|
|
2274
|
-
), A = Wt(), C =
|
|
2275
|
+
), A = Wt(), C = Ur(), [S, B] = T(""), M = mt(S.trim(), 250), { hits: v, meaning: E, loading: J } = Ks(M, y.filters), G = M.length >= 2 || y.active, F = ve(() => {
|
|
2275
2276
|
const c = /* @__PURE__ */ new Map();
|
|
2276
2277
|
for (const L of v) c.set(L.room, [...c.get(L.room) ?? [], L]);
|
|
2277
2278
|
return [...c.entries()].sort((L, m) => m[1].length - L[1].length);
|
|
2278
|
-
}, [v]), O = n.filter((c) => c.unread > 0 && !c.muted).length, K =
|
|
2279
|
-
|
|
2279
|
+
}, [v]), O = n.filter((c) => c.unread > 0 && !c.muted).length, K = xr(), ee = ve(() => new Map(n.map((c) => [c.room, c])), [n]), Y = Et(), te = Xn(), oe = Y.chat_sidebar_sort === "unread" || Y.chat_sidebar_sort === "alpha" ? Y.chat_sidebar_sort : "recent", se = cl(
|
|
2280
|
+
M ? n.filter((c) => c.label.toLowerCase().includes(M.toLowerCase())) : n,
|
|
2280
2281
|
oe
|
|
2281
2282
|
), me = (c) => {
|
|
2282
2283
|
var L;
|
|
@@ -2298,15 +2299,15 @@ function zn({
|
|
|
2298
2299
|
"data-chat-global-search": !0
|
|
2299
2300
|
}
|
|
2300
2301
|
),
|
|
2301
|
-
!r && /* @__PURE__ */ e(
|
|
2302
|
+
!r && /* @__PURE__ */ e(Bs, { open: y.open, active: y.active, onClick: () => y.setOpen(!y.open) }),
|
|
2302
2303
|
/* @__PURE__ */ e(
|
|
2303
|
-
|
|
2304
|
+
dl,
|
|
2304
2305
|
{
|
|
2305
2306
|
value: oe,
|
|
2306
2307
|
onChange: (c) => te.mutate({ chat_sidebar_sort: c === "recent" ? null : c })
|
|
2307
2308
|
}
|
|
2308
2309
|
),
|
|
2309
|
-
!r && /* @__PURE__ */ e(
|
|
2310
|
+
!r && /* @__PURE__ */ e(Ws, {}),
|
|
2310
2311
|
l && /* @__PURE__ */ e(
|
|
2311
2312
|
"button",
|
|
2312
2313
|
{
|
|
@@ -2315,11 +2316,11 @@ function zn({
|
|
|
2315
2316
|
title: "New group conversation",
|
|
2316
2317
|
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-border dark:text-slate-400 dark:hover:bg-muted",
|
|
2317
2318
|
"data-chat-new-group": !0,
|
|
2318
|
-
children: /* @__PURE__ */ e(
|
|
2319
|
+
children: /* @__PURE__ */ e(Mt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
2319
2320
|
}
|
|
2320
2321
|
)
|
|
2321
2322
|
] }),
|
|
2322
|
-
!r && y.open && /* @__PURE__ */ e(
|
|
2323
|
+
!r && y.open && /* @__PURE__ */ e(Fs, { filters: y.filters, onChange: y.setFilters, rooms: n, th: p }),
|
|
2323
2324
|
!r && i && !G && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
|
|
2324
2325
|
/* @__PURE__ */ a(
|
|
2325
2326
|
"button",
|
|
@@ -2329,7 +2330,7 @@ function zn({
|
|
|
2329
2330
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
2330
2331
|
"data-chat-view": "mentions",
|
|
2331
2332
|
children: [
|
|
2332
|
-
/* @__PURE__ */ e(
|
|
2333
|
+
/* @__PURE__ */ e(Ja, { className: "h-3 w-3" }),
|
|
2333
2334
|
" Mentions"
|
|
2334
2335
|
]
|
|
2335
2336
|
}
|
|
@@ -2342,7 +2343,7 @@ function zn({
|
|
|
2342
2343
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
2343
2344
|
"data-chat-view": "scheduled",
|
|
2344
2345
|
children: [
|
|
2345
|
-
/* @__PURE__ */ e(
|
|
2346
|
+
/* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
|
|
2346
2347
|
" Scheduled"
|
|
2347
2348
|
]
|
|
2348
2349
|
}
|
|
@@ -2358,7 +2359,7 @@ function zn({
|
|
|
2358
2359
|
),
|
|
2359
2360
|
"data-chat-view": "catchup",
|
|
2360
2361
|
children: [
|
|
2361
|
-
/* @__PURE__ */ e(
|
|
2362
|
+
/* @__PURE__ */ e(Za, { className: "h-3 w-3" }),
|
|
2362
2363
|
" Catch up · ",
|
|
2363
2364
|
O,
|
|
2364
2365
|
" rooms"
|
|
@@ -2414,7 +2415,7 @@ function zn({
|
|
|
2414
2415
|
)
|
|
2415
2416
|
] }, c);
|
|
2416
2417
|
}),
|
|
2417
|
-
!J &&
|
|
2418
|
+
!J && E === "words" && /* @__PURE__ */ e(
|
|
2418
2419
|
"p",
|
|
2419
2420
|
{
|
|
2420
2421
|
className: "px-2.5 pb-1 pt-1.5 text-[10.5px] leading-snug text-slate-400",
|
|
@@ -2430,7 +2431,7 @@ function zn({
|
|
|
2430
2431
|
{
|
|
2431
2432
|
type: "button",
|
|
2432
2433
|
onClick: () => s({
|
|
2433
|
-
room:
|
|
2434
|
+
room: $t(d.me.id, A.bot_user_id),
|
|
2434
2435
|
label: `@${A.bot_name}`,
|
|
2435
2436
|
kind: "dm",
|
|
2436
2437
|
lastMessage: null,
|
|
@@ -2502,16 +2503,16 @@ function zn({
|
|
|
2502
2503
|
"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",
|
|
2503
2504
|
m.kind === "dm" && d.me && Se(m.room, d.me.id) && "hidden"
|
|
2504
2505
|
),
|
|
2505
|
-
children: m.kind === "dm" ? /* @__PURE__ */ e(Gn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (De = m.channel) != null && De.is_direct ? /* @__PURE__ */ e(
|
|
2506
|
+
children: m.kind === "dm" ? /* @__PURE__ */ e(Gn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (De = m.channel) != null && De.is_direct ? /* @__PURE__ */ e(Mt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(Ut, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
2506
2507
|
}
|
|
2507
2508
|
),
|
|
2508
2509
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
2509
2510
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
|
|
2510
2511
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: m.label }),
|
|
2511
2512
|
m.muted && /* @__PURE__ */ e(Un, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
|
|
2512
|
-
/* @__PURE__ */ e(
|
|
2513
|
+
/* @__PURE__ */ e(Cr, { count: C.countFor(m.room), label: m.label }),
|
|
2513
2514
|
K.has(m.room) && /* @__PURE__ */ e(
|
|
2514
|
-
|
|
2515
|
+
Va,
|
|
2515
2516
|
{
|
|
2516
2517
|
className: "h-3 w-3 shrink-0 text-slate-400",
|
|
2517
2518
|
strokeWidth: 2,
|
|
@@ -2561,14 +2562,14 @@ function zn({
|
|
|
2561
2562
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2562
2563
|
"data-chat-row-star": m.starred ? "on" : "off",
|
|
2563
2564
|
children: /* @__PURE__ */ e(
|
|
2564
|
-
|
|
2565
|
+
Xa,
|
|
2565
2566
|
{
|
|
2566
2567
|
className: g("h-3 w-3", m.starred && "fill-amber-400 text-amber-500")
|
|
2567
2568
|
}
|
|
2568
2569
|
)
|
|
2569
2570
|
}
|
|
2570
2571
|
),
|
|
2571
|
-
|
|
2572
|
+
xa(m) && /* @__PURE__ */ e(
|
|
2572
2573
|
"button",
|
|
2573
2574
|
{
|
|
2574
2575
|
type: "button",
|
|
@@ -2577,7 +2578,7 @@ function zn({
|
|
|
2577
2578
|
onClick: () => u.mutate({ room: m.room, archived: !r }),
|
|
2578
2579
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2579
2580
|
"data-chat-row-archive": r ? "unarchive" : "archive",
|
|
2580
|
-
children: r ? /* @__PURE__ */ e(
|
|
2581
|
+
children: r ? /* @__PURE__ */ e(es, { className: "h-3 w-3" }) : /* @__PURE__ */ e(ts, { className: "h-3 w-3" })
|
|
2581
2582
|
}
|
|
2582
2583
|
),
|
|
2583
2584
|
/* @__PURE__ */ e(
|
|
@@ -2587,7 +2588,7 @@ function zn({
|
|
|
2587
2588
|
title: m.muted ? "Unmute" : "Mute",
|
|
2588
2589
|
onClick: () => x.mutate({ room: m.room, muted: !m.muted }),
|
|
2589
2590
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2590
|
-
children: m.muted ? /* @__PURE__ */ e(
|
|
2591
|
+
children: m.muted ? /* @__PURE__ */ e(ns, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Un, { className: "h-3 w-3" })
|
|
2591
2592
|
}
|
|
2592
2593
|
),
|
|
2593
2594
|
(m.kind === "channel" || m.kind === "global" || m.kind === "entity") && m.joined && /* @__PURE__ */ e(
|
|
@@ -2599,7 +2600,7 @@ function zn({
|
|
|
2599
2600
|
"data-chat-row-leave": !0,
|
|
2600
2601
|
onClick: () => f.mutate(m.room),
|
|
2601
2602
|
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
2602
|
-
children: /* @__PURE__ */ e(
|
|
2603
|
+
children: /* @__PURE__ */ e(as, { className: "h-3 w-3" })
|
|
2603
2604
|
}
|
|
2604
2605
|
)
|
|
2605
2606
|
] })
|
|
@@ -2609,15 +2610,15 @@ function zn({
|
|
|
2609
2610
|
)
|
|
2610
2611
|
] });
|
|
2611
2612
|
}
|
|
2612
|
-
function
|
|
2613
|
+
function go({
|
|
2613
2614
|
view: n,
|
|
2614
2615
|
rooms: s,
|
|
2615
2616
|
onBack: l,
|
|
2616
2617
|
onOpen: r
|
|
2617
2618
|
}) {
|
|
2618
2619
|
const o = ue();
|
|
2619
|
-
return n === "mentions" ? /* @__PURE__ */ e(
|
|
2620
|
-
|
|
2620
|
+
return n === "mentions" ? /* @__PURE__ */ e(Yn, { th: o, onBack: l, onOpen: r }) : n === "scheduled" ? /* @__PURE__ */ e(
|
|
2621
|
+
Zn,
|
|
2621
2622
|
{
|
|
2622
2623
|
th: o,
|
|
2623
2624
|
onBack: l,
|
|
@@ -2626,15 +2627,15 @@ function xo({
|
|
|
2626
2627
|
return ((p = s.find((d) => d.room === i)) == null ? void 0 : p.label) ?? i;
|
|
2627
2628
|
}
|
|
2628
2629
|
}
|
|
2629
|
-
) : /* @__PURE__ */ e(
|
|
2630
|
+
) : /* @__PURE__ */ e(Vn, { rooms: s, th: o, onBack: l, onOpen: r });
|
|
2630
2631
|
}
|
|
2631
|
-
function
|
|
2632
|
+
function ul({
|
|
2632
2633
|
onOpen: n
|
|
2633
2634
|
}) {
|
|
2634
2635
|
const s = ue(), [l, r] = T(""), [o, i] = T(!1), [p, d] = T(""), [x, f] = T("open"), [u, b] = T(""), [y, U] = T({
|
|
2635
2636
|
icon: null,
|
|
2636
2637
|
color: null
|
|
2637
|
-
}), A =
|
|
2638
|
+
}), A = ea(), { channels: C, loading: S } = Hs(l), { join: B } = qt(), M = Gs();
|
|
2638
2639
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
|
|
2639
2640
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2640
2641
|
/* @__PURE__ */ a("div", { className: "relative flex-1", children: [
|
|
@@ -2659,7 +2660,7 @@ function dl({
|
|
|
2659
2660
|
s.action
|
|
2660
2661
|
),
|
|
2661
2662
|
children: [
|
|
2662
|
-
/* @__PURE__ */ e(
|
|
2663
|
+
/* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" }),
|
|
2663
2664
|
" New"
|
|
2664
2665
|
]
|
|
2665
2666
|
}
|
|
@@ -2670,7 +2671,7 @@ function dl({
|
|
|
2670
2671
|
{
|
|
2671
2672
|
className: "flex flex-col gap-2 border-b border-slate-100 p-2 dark:border-border/60",
|
|
2672
2673
|
onSubmit: (v) => {
|
|
2673
|
-
v.preventDefault(), p.trim() && (x === "role" && !u ||
|
|
2674
|
+
v.preventDefault(), p.trim() && (x === "role" && !u || M.mutate(
|
|
2674
2675
|
{
|
|
2675
2676
|
name: p.trim(),
|
|
2676
2677
|
visibility: x,
|
|
@@ -2701,13 +2702,13 @@ function dl({
|
|
|
2701
2702
|
}
|
|
2702
2703
|
)
|
|
2703
2704
|
] }),
|
|
2704
|
-
/* @__PURE__ */ e(
|
|
2705
|
+
/* @__PURE__ */ e(Jn, { icon: y.icon, color: y.color, onChange: U }),
|
|
2705
2706
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
2706
2707
|
[
|
|
2707
2708
|
["open", "Anyone"],
|
|
2708
2709
|
["role", "One role"],
|
|
2709
2710
|
["private", "Invite only"]
|
|
2710
|
-
].map(([v,
|
|
2711
|
+
].map(([v, E]) => /* @__PURE__ */ e(
|
|
2711
2712
|
"button",
|
|
2712
2713
|
{
|
|
2713
2714
|
type: "button",
|
|
@@ -2716,7 +2717,7 @@ function dl({
|
|
|
2716
2717
|
"rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
|
|
2717
2718
|
x === v ? s.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
|
|
2718
2719
|
),
|
|
2719
|
-
children:
|
|
2720
|
+
children: E
|
|
2720
2721
|
},
|
|
2721
2722
|
v
|
|
2722
2723
|
)),
|
|
@@ -2724,9 +2725,9 @@ function dl({
|
|
|
2724
2725
|
"button",
|
|
2725
2726
|
{
|
|
2726
2727
|
type: "submit",
|
|
2727
|
-
disabled: !p.trim() ||
|
|
2728
|
+
disabled: !p.trim() || M.isPending || x === "role" && !u,
|
|
2728
2729
|
className: g("ml-auto rounded-md px-2.5 py-1 text-[12px] font-medium", s.action),
|
|
2729
|
-
children:
|
|
2730
|
+
children: M.isPending ? "Creating…" : "Create"
|
|
2730
2731
|
}
|
|
2731
2732
|
)
|
|
2732
2733
|
] }),
|
|
@@ -2742,7 +2743,7 @@ function dl({
|
|
|
2742
2743
|
]
|
|
2743
2744
|
}
|
|
2744
2745
|
),
|
|
2745
|
-
|
|
2746
|
+
M.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: Qn(M.error, "Could not create it") })
|
|
2746
2747
|
]
|
|
2747
2748
|
}
|
|
2748
2749
|
),
|
|
@@ -2764,7 +2765,7 @@ function dl({
|
|
|
2764
2765
|
icon: v.icon,
|
|
2765
2766
|
color: v.color,
|
|
2766
2767
|
size: 32,
|
|
2767
|
-
fallback: v.visibility === "private" ?
|
|
2768
|
+
fallback: v.visibility === "private" ? Ha : Ut
|
|
2768
2769
|
}
|
|
2769
2770
|
),
|
|
2770
2771
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
@@ -2797,12 +2798,12 @@ function dl({
|
|
|
2797
2798
|
] })
|
|
2798
2799
|
] });
|
|
2799
2800
|
}
|
|
2800
|
-
function
|
|
2801
|
+
function ml() {
|
|
2801
2802
|
const n = /* @__PURE__ */ new Date();
|
|
2802
2803
|
return n.setHours(23, 59, 59, 999), n;
|
|
2803
2804
|
}
|
|
2804
|
-
function
|
|
2805
|
-
const n =
|
|
2805
|
+
function pl() {
|
|
2806
|
+
const n = Et(), s = Xn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), p = (x) => {
|
|
2806
2807
|
s.mutate({
|
|
2807
2808
|
presence_override: x === "off" ? null : { mode: "away", until: (x == null ? void 0 : x.toISOString()) ?? null }
|
|
2808
2809
|
}), r(!1);
|
|
@@ -2853,7 +2854,7 @@ function ml() {
|
|
|
2853
2854
|
[
|
|
2854
2855
|
["1 hour", () => new Date(Date.now() + 36e5)],
|
|
2855
2856
|
["4 hours", () => new Date(Date.now() + 4 * 36e5)],
|
|
2856
|
-
["The rest of today",
|
|
2857
|
+
["The rest of today", ml],
|
|
2857
2858
|
["Until I switch it off", () => null]
|
|
2858
2859
|
].map(([x, f]) => /* @__PURE__ */ e(
|
|
2859
2860
|
"button",
|
|
@@ -2872,10 +2873,10 @@ function ml() {
|
|
|
2872
2873
|
}
|
|
2873
2874
|
);
|
|
2874
2875
|
}
|
|
2875
|
-
function
|
|
2876
|
+
function hl({ myStatus: n }) {
|
|
2876
2877
|
const s = ue();
|
|
2877
2878
|
return /* @__PURE__ */ e(
|
|
2878
|
-
|
|
2879
|
+
Us,
|
|
2879
2880
|
{
|
|
2880
2881
|
status: n ? { text: n.text, emoji: n.emoji } : null,
|
|
2881
2882
|
theme: { accentSoft: s.accentSoft, input: s.input, action: s.action },
|
|
@@ -2883,9 +2884,9 @@ function pl({ myStatus: n }) {
|
|
|
2883
2884
|
}
|
|
2884
2885
|
);
|
|
2885
2886
|
}
|
|
2886
|
-
function
|
|
2887
|
+
function ba() {
|
|
2887
2888
|
var i, p, d;
|
|
2888
|
-
const n = Ze(), s =
|
|
2889
|
+
const n = Ze(), s = _s(15e3), { data: l, isFetched: r } = Te({
|
|
2889
2890
|
queryKey: ["presence-online"],
|
|
2890
2891
|
queryFn: () => n.request(ye("/presence/online")),
|
|
2891
2892
|
// Matches the presence heartbeat cadence without a live socket — the page someone is on
|
|
@@ -2905,18 +2906,18 @@ function xa() {
|
|
|
2905
2906
|
loaded: r
|
|
2906
2907
|
};
|
|
2907
2908
|
}
|
|
2908
|
-
function
|
|
2909
|
+
function ga(n) {
|
|
2909
2910
|
if (!n) return null;
|
|
2910
2911
|
const s = n.split("/").filter(Boolean);
|
|
2911
2912
|
if (s.length === 0) return "Home";
|
|
2912
2913
|
const l = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((o) => !l.has(o));
|
|
2913
2914
|
return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (p) => p.toUpperCase()) : o).join(" › ");
|
|
2914
2915
|
}
|
|
2915
|
-
function
|
|
2916
|
+
function fl({
|
|
2916
2917
|
onClose: n,
|
|
2917
2918
|
onCreated: s
|
|
2918
2919
|
}) {
|
|
2919
|
-
const l = ue(), [r, o] = T(""), [i, p] = T(""), [d, x] = T(/* @__PURE__ */ new Map()), { users: f } = Bt(r, !0), u =
|
|
2920
|
+
const l = ue(), [r, o] = T(""), [i, p] = T(""), [d, x] = T(/* @__PURE__ */ new Map()), { users: f } = Bt(r, !0), u = ur(), b = (y) => [y.first_name, y.last_name].filter(Boolean).join(" ") || (y.email ?? "Unknown");
|
|
2920
2921
|
return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
|
|
2921
2922
|
/* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
2922
2923
|
/* @__PURE__ */ e(
|
|
@@ -3022,14 +3023,14 @@ function hl({
|
|
|
3022
3023
|
] });
|
|
3023
3024
|
}
|
|
3024
3025
|
const Rt = "nvr-chat-pinned", Tt = 400;
|
|
3025
|
-
function
|
|
3026
|
+
function xl() {
|
|
3026
3027
|
try {
|
|
3027
3028
|
return typeof window < "u" && window.localStorage.getItem(Rt) === "1";
|
|
3028
3029
|
} catch {
|
|
3029
3030
|
return !1;
|
|
3030
3031
|
}
|
|
3031
3032
|
}
|
|
3032
|
-
function
|
|
3033
|
+
function bl() {
|
|
3033
3034
|
const n = "(min-width: 1024px)", [s, l] = T(
|
|
3034
3035
|
() => {
|
|
3035
3036
|
var r;
|
|
@@ -3044,7 +3045,7 @@ function xl() {
|
|
|
3044
3045
|
return r.addEventListener("change", o), () => r.removeEventListener("change", o);
|
|
3045
3046
|
}, []), s;
|
|
3046
3047
|
}
|
|
3047
|
-
function
|
|
3048
|
+
function vo({
|
|
3048
3049
|
open: n,
|
|
3049
3050
|
onClose: s,
|
|
3050
3051
|
renderMessageBody: l,
|
|
@@ -3052,7 +3053,7 @@ function bo({
|
|
|
3052
3053
|
requestedRoom: o
|
|
3053
3054
|
}) {
|
|
3054
3055
|
var Ce;
|
|
3055
|
-
const i = Le(), p = ue(), d = i.me, [x, f] = T(
|
|
3056
|
+
const i = Le(), p = ue(), d = i.me, [x, f] = T(xl), u = bl(), b = x && u, y = () => {
|
|
3056
3057
|
const k = !x;
|
|
3057
3058
|
f(k);
|
|
3058
3059
|
try {
|
|
@@ -3062,40 +3063,40 @@ function bo({
|
|
|
3062
3063
|
};
|
|
3063
3064
|
ae(() => {
|
|
3064
3065
|
if (!n || !b) return;
|
|
3065
|
-
const k = document.body,
|
|
3066
|
+
const k = document.body, $ = k.style.paddingRight;
|
|
3066
3067
|
k.style.paddingRight = `${Tt}px`, k.dataset.nvrChatPinned = "1";
|
|
3067
3068
|
const P = document.createElement("style");
|
|
3068
3069
|
return P.dataset.nvrChatPinnedStyle = "", P.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
|
|
3069
3070
|
body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, document.head.appendChild(P), () => {
|
|
3070
|
-
k.style.paddingRight =
|
|
3071
|
+
k.style.paddingRight = $, delete k.dataset.nvrChatPinned, P.remove();
|
|
3071
3072
|
};
|
|
3072
3073
|
}, [n, b]);
|
|
3073
|
-
const [U, A] = T("online"), [C, S] = T(null), [B,
|
|
3074
|
-
const V = ee.find((
|
|
3075
|
-
F(!1), S({ room: k, label: (V == null ? void 0 : V.label) ??
|
|
3076
|
-
}, [
|
|
3077
|
-
var
|
|
3078
|
-
if (
|
|
3074
|
+
const [U, A] = T("online"), [C, S] = T(null), [B, M] = T(null), v = (k, $, P) => {
|
|
3075
|
+
const V = ee.find((Me) => Me.room === k);
|
|
3076
|
+
F(!1), S({ room: k, label: (V == null ? void 0 : V.label) ?? $, channel: V == null ? void 0 : V.channel, anchor: P });
|
|
3077
|
+
}, [E, J] = T(!1), [G, F] = T(!1), [O, K] = T(null), { rooms: ee, totalUnread: Y } = sa(), te = ra(U === "archived"), oe = (k, $, P) => {
|
|
3078
|
+
var Me, _;
|
|
3079
|
+
if (!$) return [{ key: "all", label: null, users: k }];
|
|
3079
3080
|
const V = /* @__PURE__ */ new Map();
|
|
3080
3081
|
for (const I of k) {
|
|
3081
|
-
const j = P.get(String(I.user_id).toUpperCase()), ie =
|
|
3082
|
+
const j = P.get(String(I.user_id).toUpperCase()), ie = $ === "__role__" ? [Wn((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = (Me = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : Me[$]) != null && _.length ? j.scopes_by_dimension[$] : ["Unassigned"], ne = [...new Set(ie)].sort((X, z) => X.localeCompare(z)).join(", ");
|
|
3082
3083
|
V.set(ne, [...V.get(ne) ?? [], I]);
|
|
3083
3084
|
}
|
|
3084
3085
|
return [...V.entries()].sort((I, j) => I[0] === "Unassigned" ? 1 : j[0] === "Unassigned" ? -1 : I[0].localeCompare(j[0])).map(([I, j]) => ({ key: I, label: I, users: j }));
|
|
3085
|
-
}, [se, me] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c =
|
|
3086
|
+
}, [se, me] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = ba(), L = c.loaded ? Qs(
|
|
3086
3087
|
i.onlineUsers.filter((k) => c.byUser.has(String(k.user_id).toUpperCase()))
|
|
3087
3088
|
) : [], m = ve(
|
|
3088
3089
|
() => oe(L, se, c.byUser),
|
|
3089
3090
|
// biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
|
|
3090
3091
|
[L, se, c.byUser]
|
|
3091
|
-
), { isAdmin: Z } = ht(), { navigate: Ue } =
|
|
3092
|
+
), { isAdmin: Z } = ht(), { navigate: Ue } = ys(), he = (k) => {
|
|
3092
3093
|
/^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : Ue(k);
|
|
3093
3094
|
}, Pe = (k) => {
|
|
3094
|
-
d && (A("chat"), S({ room:
|
|
3095
|
+
d && (A("chat"), S({ room: $t(d.id, k.user_id), label: k.display_name ?? "Direct message" }));
|
|
3095
3096
|
}, Ne = de(0);
|
|
3096
3097
|
ae(() => {
|
|
3097
3098
|
!r || !d || r.nonce === Ne.current || (Ne.current = r.nonce, A("chat"), F(!1), S({
|
|
3098
|
-
room:
|
|
3099
|
+
room: $t(d.id, r.userId),
|
|
3099
3100
|
label: r.name ?? "Direct message"
|
|
3100
3101
|
}));
|
|
3101
3102
|
}, [r, d]);
|
|
@@ -3169,7 +3170,7 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3169
3170
|
x ? p.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
|
|
3170
3171
|
),
|
|
3171
3172
|
"data-chat-pin": x ? "on" : "off",
|
|
3172
|
-
children: x ? /* @__PURE__ */ e(
|
|
3173
|
+
children: x ? /* @__PURE__ */ e(Ga, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(Dt, { className: "h-4 w-4", strokeWidth: 2 })
|
|
3173
3174
|
}
|
|
3174
3175
|
),
|
|
3175
3176
|
/* @__PURE__ */ e(
|
|
@@ -3190,13 +3191,13 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3190
3191
|
"data-chat-online": !0,
|
|
3191
3192
|
children: [
|
|
3192
3193
|
/* @__PURE__ */ e(
|
|
3193
|
-
|
|
3194
|
+
hl,
|
|
3194
3195
|
{
|
|
3195
3196
|
myStatus: d ? ((Ce = c.byUser.get(String(d.id).toUpperCase())) == null ? void 0 : Ce.custom_status) ?? null : null
|
|
3196
3197
|
}
|
|
3197
3198
|
),
|
|
3198
|
-
/* @__PURE__ */ e(
|
|
3199
|
-
/* @__PURE__ */ e(
|
|
3199
|
+
/* @__PURE__ */ e(pl, {}),
|
|
3200
|
+
/* @__PURE__ */ e(Ds, {}),
|
|
3200
3201
|
L.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
|
|
3201
3202
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
|
|
3202
3203
|
/* @__PURE__ */ e(
|
|
@@ -3225,45 +3226,45 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Tt}px; }`, do
|
|
|
3225
3226
|
k.label,
|
|
3226
3227
|
/* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
|
|
3227
3228
|
] }),
|
|
3228
|
-
k.users.map((
|
|
3229
|
-
const P = c.byUser.get(String(
|
|
3229
|
+
k.users.map(($) => {
|
|
3230
|
+
const P = c.byUser.get(String($.user_id).toUpperCase()), V = (P == null ? void 0 : P.is_idle) ?? $.is_idle, Me = P ?? $;
|
|
3230
3231
|
return /* @__PURE__ */ a(
|
|
3231
3232
|
"div",
|
|
3232
3233
|
{
|
|
3233
3234
|
className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
|
|
3234
3235
|
"data-chat-online-row": !0,
|
|
3235
3236
|
children: [
|
|
3236
|
-
/* @__PURE__ */ e(It, { userId:
|
|
3237
|
+
/* @__PURE__ */ e(It, { userId: $.user_id, children: /* @__PURE__ */ e(
|
|
3237
3238
|
"button",
|
|
3238
3239
|
{
|
|
3239
3240
|
type: "button",
|
|
3240
3241
|
className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
3241
|
-
"aria-label": `${
|
|
3242
|
+
"aria-label": `${$.display_name ?? "Unknown user"} — profile`,
|
|
3242
3243
|
"data-chat-online-avatar": !0,
|
|
3243
|
-
children: /* @__PURE__ */ e(Q, { id:
|
|
3244
|
+
children: /* @__PURE__ */ e(Q, { id: $.user_id, name: $.display_name })
|
|
3244
3245
|
}
|
|
3245
3246
|
) }),
|
|
3246
3247
|
/* @__PURE__ */ a(
|
|
3247
3248
|
"button",
|
|
3248
3249
|
{
|
|
3249
3250
|
type: "button",
|
|
3250
|
-
onClick: () => Pe(
|
|
3251
|
+
onClick: () => Pe($),
|
|
3251
3252
|
title: "Send a direct message",
|
|
3252
3253
|
className: "flex min-w-0 flex-1 items-center gap-3 py-2 pl-3 pr-2.5 text-left",
|
|
3253
3254
|
children: [
|
|
3254
3255
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
3255
3256
|
/* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
|
|
3256
|
-
|
|
3257
|
-
V && /* @__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: P != null && P.away ? "Away" : At(
|
|
3257
|
+
$.display_name ?? "Unknown user",
|
|
3258
|
+
V && /* @__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: P != null && P.away ? "Away" : At(Me) }),
|
|
3258
3259
|
!V && (P == null ? void 0 : P.stuck) && (() => {
|
|
3259
|
-
const _ = P.stuck, I = c.fields.includes("page"), j =
|
|
3260
|
+
const _ = P.stuck, I = c.fields.includes("page"), j = Mn(
|
|
3260
3261
|
P.current_path,
|
|
3261
3262
|
P.app,
|
|
3262
3263
|
c.adminUrl,
|
|
3263
3264
|
i.recordUrl,
|
|
3264
3265
|
typeof window > "u" ? null : window.location.origin
|
|
3265
|
-
), ie = `${
|
|
3266
|
-
${An(j)}` : ""}`, ne =
|
|
3266
|
+
), ie = `${$n(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
|
|
3267
|
+
${An(j)}` : ""}`, ne = $n(
|
|
3267
3268
|
I ? { ..._, label: null } : _
|
|
3268
3269
|
), X = "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";
|
|
3269
3270
|
return j ? (
|
|
@@ -3299,7 +3300,7 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3299
3300
|
(() => {
|
|
3300
3301
|
var I;
|
|
3301
3302
|
const _ = (I = c.byUser.get(
|
|
3302
|
-
String(
|
|
3303
|
+
String($.user_id).toUpperCase()
|
|
3303
3304
|
)) == null ? void 0 : I.masquerade;
|
|
3304
3305
|
return _ ? /* @__PURE__ */ a(
|
|
3305
3306
|
"span",
|
|
@@ -3317,7 +3318,7 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3317
3318
|
Z && /* @__PURE__ */ e($s, { builds: P == null ? void 0 : P.stale_build })
|
|
3318
3319
|
] }),
|
|
3319
3320
|
(() => {
|
|
3320
|
-
const _ = c.byUser.get(String(
|
|
3321
|
+
const _ = c.byUser.get(String($.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
|
|
3321
3322
|
return !I && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
|
|
3322
3323
|
"span",
|
|
3323
3324
|
{
|
|
@@ -3331,7 +3332,7 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3331
3332
|
"data-chat-in-huddle": !0,
|
|
3332
3333
|
"data-tip": "In a huddle right now",
|
|
3333
3334
|
children: [
|
|
3334
|
-
/* @__PURE__ */ e(
|
|
3335
|
+
/* @__PURE__ */ e(Qa, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
3335
3336
|
!I && "In a huddle"
|
|
3336
3337
|
]
|
|
3337
3338
|
}
|
|
@@ -3345,17 +3346,17 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3345
3346
|
);
|
|
3346
3347
|
})(),
|
|
3347
3348
|
(() => {
|
|
3348
|
-
const _ = c.byUser.get(String(
|
|
3349
|
+
const _ = c.byUser.get(String($.user_id).toUpperCase()), I = [];
|
|
3349
3350
|
let j = null, ie = !1;
|
|
3350
3351
|
for (const z of c.fields)
|
|
3351
3352
|
if (z === "role") {
|
|
3352
|
-
const re = Wn((_ == null ? void 0 : _.role_name) ??
|
|
3353
|
+
const re = Wn((_ == null ? void 0 : _.role_name) ?? $.role_name);
|
|
3353
3354
|
re && I.push(re);
|
|
3354
3355
|
} else if (z === "scopes") {
|
|
3355
3356
|
const re = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
|
|
3356
3357
|
re && I.push(re);
|
|
3357
3358
|
} else if (z === "page") {
|
|
3358
|
-
const re = (_ == null ? void 0 : _.page) ??
|
|
3359
|
+
const re = (_ == null ? void 0 : _.page) ?? $.page ?? ga((_ == null ? void 0 : _.current_path) ?? $.current_path), fe = (_ == null ? void 0 : _.app) ?? $.app;
|
|
3359
3360
|
j = (fe ? `${re ?? ""}${re ? " · " : ""}${fe}`.trim() : re) || null, ie = !j && !!_ && !_.away;
|
|
3360
3361
|
}
|
|
3361
3362
|
const ne = I.join(" · "), X = ie ? /* @__PURE__ */ a(
|
|
@@ -3382,7 +3383,7 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3382
3383
|
),
|
|
3383
3384
|
X,
|
|
3384
3385
|
j && (() => {
|
|
3385
|
-
const z =
|
|
3386
|
+
const z = Mn(
|
|
3386
3387
|
_ == null ? void 0 : _.current_path,
|
|
3387
3388
|
_ == null ? void 0 : _.app,
|
|
3388
3389
|
c.adminUrl,
|
|
@@ -3428,9 +3429,9 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3428
3429
|
] }),
|
|
3429
3430
|
(() => {
|
|
3430
3431
|
var ne;
|
|
3431
|
-
const _ = c.byUser.get(String(
|
|
3432
|
+
const _ = c.byUser.get(String($.user_id).toUpperCase());
|
|
3432
3433
|
if (!Z || !(_ != null && _.recording_id)) return null;
|
|
3433
|
-
const I = ((ne = c.adminUrl) == null ? void 0 : ne.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ie = i.sessionUrl ? i.sessionUrl(_.recording_id, String(
|
|
3434
|
+
const I = ((ne = c.adminUrl) == null ? void 0 : ne.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), ie = i.sessionUrl ? i.sessionUrl(_.recording_id, String($.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
|
|
3434
3435
|
return ie ? /* @__PURE__ */ e(
|
|
3435
3436
|
"span",
|
|
3436
3437
|
{
|
|
@@ -3444,7 +3445,7 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3444
3445
|
(X.key === "Enter" || X.key === " ") && (X.stopPropagation(), he(ie));
|
|
3445
3446
|
},
|
|
3446
3447
|
className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
|
|
3447
|
-
children: /* @__PURE__ */ e(
|
|
3448
|
+
children: /* @__PURE__ */ e(Ka, { className: "h-4 w-4", strokeWidth: 1.8 })
|
|
3448
3449
|
}
|
|
3449
3450
|
) : null;
|
|
3450
3451
|
})(),
|
|
@@ -3460,14 +3461,14 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3460
3461
|
)
|
|
3461
3462
|
]
|
|
3462
3463
|
},
|
|
3463
|
-
|
|
3464
|
+
$.user_id
|
|
3464
3465
|
);
|
|
3465
3466
|
})
|
|
3466
3467
|
] }, k.key))
|
|
3467
3468
|
]
|
|
3468
3469
|
}
|
|
3469
3470
|
) : U === "archived" ? O ? /* @__PURE__ */ e(
|
|
3470
|
-
|
|
3471
|
+
qn,
|
|
3471
3472
|
{
|
|
3472
3473
|
room: O.room,
|
|
3473
3474
|
label: O.label,
|
|
@@ -3488,30 +3489,30 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3488
3489
|
// switching to Browse with a conversation open kept showing that
|
|
3489
3490
|
// conversation (or its settings) under the Browse tab.
|
|
3490
3491
|
/* @__PURE__ */ e(
|
|
3491
|
-
|
|
3492
|
+
ul,
|
|
3492
3493
|
{
|
|
3493
|
-
onOpen: (k,
|
|
3494
|
-
F(!1), S({ room: k, label:
|
|
3494
|
+
onOpen: (k, $, P) => {
|
|
3495
|
+
F(!1), S({ room: k, label: $, channel: P }), A("chat");
|
|
3495
3496
|
}
|
|
3496
3497
|
}
|
|
3497
3498
|
)
|
|
3498
|
-
) :
|
|
3499
|
-
|
|
3499
|
+
) : E ? /* @__PURE__ */ e(
|
|
3500
|
+
fl,
|
|
3500
3501
|
{
|
|
3501
3502
|
onClose: () => J(!1),
|
|
3502
|
-
onCreated: (k,
|
|
3503
|
-
J(!1), S({ room: k, label:
|
|
3503
|
+
onCreated: (k, $) => {
|
|
3504
|
+
J(!1), S({ room: k, label: $ });
|
|
3504
3505
|
}
|
|
3505
3506
|
}
|
|
3506
3507
|
) : C && G && C.channel ? /* @__PURE__ */ e(
|
|
3507
|
-
|
|
3508
|
+
il,
|
|
3508
3509
|
{
|
|
3509
3510
|
channel: C.channel,
|
|
3510
3511
|
label: C.label,
|
|
3511
3512
|
onBack: () => F(!1)
|
|
3512
3513
|
}
|
|
3513
3514
|
) : C ? /* @__PURE__ */ e(
|
|
3514
|
-
|
|
3515
|
+
qn,
|
|
3515
3516
|
{
|
|
3516
3517
|
room: C.room,
|
|
3517
3518
|
label: C.label,
|
|
@@ -3522,39 +3523,39 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3522
3523
|
anchor: C.anchor ?? null
|
|
3523
3524
|
},
|
|
3524
3525
|
C.room
|
|
3525
|
-
) : B === "mentions" ? /* @__PURE__ */ e(
|
|
3526
|
-
|
|
3526
|
+
) : B === "mentions" ? /* @__PURE__ */ e(Yn, { th: p, onBack: () => M(null), onOpen: v }) : B === "scheduled" ? /* @__PURE__ */ e(
|
|
3527
|
+
Zn,
|
|
3527
3528
|
{
|
|
3528
3529
|
th: p,
|
|
3529
|
-
onBack: () =>
|
|
3530
|
+
onBack: () => M(null),
|
|
3530
3531
|
roomLabel: (k) => {
|
|
3531
|
-
var
|
|
3532
|
-
return ((
|
|
3532
|
+
var $;
|
|
3533
|
+
return (($ = ee.find((P) => P.room === k)) == null ? void 0 : $.label) ?? k;
|
|
3533
3534
|
}
|
|
3534
3535
|
}
|
|
3535
3536
|
) : B === "catchup" ? /* @__PURE__ */ e(
|
|
3536
|
-
|
|
3537
|
+
Vn,
|
|
3537
3538
|
{
|
|
3538
3539
|
rooms: ee,
|
|
3539
3540
|
th: p,
|
|
3540
|
-
onBack: () =>
|
|
3541
|
+
onBack: () => M(null),
|
|
3541
3542
|
onOpen: v
|
|
3542
3543
|
}
|
|
3543
3544
|
) : /* @__PURE__ */ e(
|
|
3544
3545
|
zn,
|
|
3545
3546
|
{
|
|
3546
3547
|
rooms: ee,
|
|
3547
|
-
onOpen: (k,
|
|
3548
|
+
onOpen: (k, $) => {
|
|
3548
3549
|
F(!1), S({
|
|
3549
3550
|
room: k.room,
|
|
3550
3551
|
label: k.label,
|
|
3551
3552
|
channel: k.channel,
|
|
3552
3553
|
unread: k.unread,
|
|
3553
|
-
anchor:
|
|
3554
|
+
anchor: $
|
|
3554
3555
|
});
|
|
3555
3556
|
},
|
|
3556
3557
|
onNewGroup: () => J(!0),
|
|
3557
|
-
onView:
|
|
3558
|
+
onView: M
|
|
3558
3559
|
}
|
|
3559
3560
|
)
|
|
3560
3561
|
]
|
|
@@ -3565,13 +3566,13 @@ ${An(j)}` : ""}`, ne = Mn(
|
|
|
3565
3566
|
) : /* @__PURE__ */ e(Rn, {});
|
|
3566
3567
|
}
|
|
3567
3568
|
export {
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3569
|
+
pl as ChatAppearAwayRow,
|
|
3570
|
+
ul as ChatChannelBrowser,
|
|
3571
|
+
il as ChatChannelSettings,
|
|
3572
|
+
vo as ChatPanel,
|
|
3573
|
+
bo as ChatProvider,
|
|
3573
3574
|
zn as ChatRoomList,
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3575
|
+
qn as ChatRoomView,
|
|
3576
|
+
go as ChatSideView,
|
|
3577
|
+
xl as isChatPanelPinned
|
|
3577
3578
|
};
|