@linktr.ee/messaging-react 3.6.2-rc-1783311731 → 3.6.2-rc-1783314663
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/{Card-RZ6C_IkE.js → Card-Byosl29s.js} +3 -3
- package/dist/{Card-RZ6C_IkE.js.map → Card-Byosl29s.js.map} +1 -1
- package/dist/{Card-4UyBK3XO.cjs → Card-CLfoYI1R.cjs} +2 -2
- package/dist/{Card-4UyBK3XO.cjs.map → Card-CLfoYI1R.cjs.map} +1 -1
- package/dist/{Card-DsQhJjj0.cjs → Card-CSkWY9mH.cjs} +2 -2
- package/dist/{Card-DsQhJjj0.cjs.map → Card-CSkWY9mH.cjs.map} +1 -1
- package/dist/{Card-iGNcxybY.js → Card-CqEKHw9S.js} +2 -2
- package/dist/{Card-iGNcxybY.js.map → Card-CqEKHw9S.js.map} +1 -1
- package/dist/{Card-0wf8lj5n.js → Card-ILtY9lfF.js} +2 -2
- package/dist/{Card-0wf8lj5n.js.map → Card-ILtY9lfF.js.map} +1 -1
- package/dist/{Card-6b4Ws9rn.cjs → Card-UN0QRlxk.cjs} +2 -2
- package/dist/{Card-6b4Ws9rn.cjs.map → Card-UN0QRlxk.cjs.map} +1 -1
- package/dist/{LockedThumbnail-Do9udNMm.js → LockedThumbnail-BKI_6JUF.js} +2 -2
- package/dist/{LockedThumbnail-Do9udNMm.js.map → LockedThumbnail-BKI_6JUF.js.map} +1 -1
- package/dist/{LockedThumbnail-N0pNOO3D.cjs → LockedThumbnail-DZ6C2xsr.cjs} +2 -2
- package/dist/{LockedThumbnail-N0pNOO3D.cjs.map → LockedThumbnail-DZ6C2xsr.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-wFe1UO9t.js → index-DPwo1avm.js} +780 -788
- package/dist/index-DPwo1avm.js.map +1 -0
- package/dist/index-Q0FmgUJF.cjs +2 -0
- package/dist/index-Q0FmgUJF.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +18 -11
- package/src/components/CustomMessage/MessageDeliveryStatus.test.tsx +60 -0
- package/src/components/CustomMessage/MessageDeliveryStatus.tsx +43 -0
- package/src/components/CustomMessage/index.tsx +2 -2
- package/src/styles.css +16 -25
- package/dist/index-B3ZJaqJY.cjs +0 -2
- package/dist/index-B3ZJaqJY.cjs.map +0 -1
- package/dist/index-wFe1UO9t.js.map +0 -1
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +0 -107
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +0 -86
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as s, jsxs as m, Fragment as
|
|
2
|
-
import U, { createContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ee, DotsThreeIcon as
|
|
1
|
+
import { jsx as s, jsxs as m, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import U, { createContext as at, useContext as Se, useCallback as J, useState as B, useRef as G, useEffect as K, useId as Vs, useMemo as ae, Suspense as rt } from "react";
|
|
3
|
+
import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Hs, LinkPreviewsManager as Ht } from "stream-chat";
|
|
5
|
+
import { Chat as Ys, useChannelStateContext as ue, useChatContext as me, DateSeparator as qs, areMessageUIPropsEqual as Ws, useMessageReminder as Xs, useComponentContext as rs, Attachment as Ks, EditMessageModal as Js, MessageBlocked as Zs, MessageBouncePrompt as Qs, MessageDeleted as en, MessageIsThreadReplyInChannelButtonIndicator as tn, MessageRepliesCountButton as sn, ReminderNotification as nn, StreamedMessageText as an, messageHasAttachments as rn, messageHasReactions as ln, isDateSeparatorMessage as on, isMessageBlocked as cn, isMessageBounced as dn, MessageBounceModal as un, MessageText as Yt, MessageErrorIcon as qt, Poll as mn, useMessageContext as Ie, useMessageComposer as hn, useStateStore as fn, MessageInput as gn, useMessageInputContext as pn, useMessageComposerHasSendableData as bn, AttachmentPreviewList as vn, QuotedMessagePreview as xn, TextareaComposer as wn, MessageTimestamp as Ye, AIStates as qe, useTypingContext as _n, useAIState as Nn, Channel as yn, WithComponents as kn, Window as Cn, MessageList as En, ChannelList as Sn, InfiniteScroll as In } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, DotsThreeIcon as Tn, SpinnerGapIcon as ze, SignOutIcon as An, ProhibitInsetIcon as Wt, FlagIcon as is, ArrowLeftIcon as Qe, CurrencyDollarIcon as Mn, CaretRightIcon as ve, SparkleIcon as xe, FileIcon as ls, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as os, FileMdIcon as Dn, FileTextIcon as zn, FileZipIcon as Pn, FilePptIcon as Fn, FileCsvIcon as On, FileXlsIcon as $n, FileDocIcon as jn, FilePdfIcon as Bn, CircleNotchIcon as ke, PlayIcon as et, PauseIcon as Un, LinkIcon as Vn, DownloadSimpleIcon as Ce, XIcon as Be, CaretLeftIcon as Gn, ChecksIcon as Hn, GiftIcon as Yn, ThumbsUpIcon as qn, ThumbsDownIcon as Wn, PencilSimpleIcon as Xn, TrashSimpleIcon as Kn, ArrowUpIcon as Jn, ProhibitIcon as Zn } from "@phosphor-icons/react";
|
|
7
7
|
import k from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as Qn, DefaultDropdownActionButton as cs } from "stream-chat-react/experimental";
|
|
9
|
+
const ds = at({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const us = rt({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), it = () => Se(ds), ll = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -24,7 +24,7 @@ const us = rt({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var A,
|
|
27
|
+
var A, S;
|
|
28
28
|
const l = J(
|
|
29
29
|
(C, ...I) => {
|
|
30
30
|
i && console.log(`🔥 [MessagingProvider] ${C}`, ...I);
|
|
@@ -39,8 +39,8 @@ const us = rt({
|
|
|
39
39
|
});
|
|
40
40
|
const [o, d] = B(null), [u, p] = B(null), [h, g] = B(!1), [c, v] = B(!1), [w, b] = B(null), f = G(!1), x = G(null), N = G(n);
|
|
41
41
|
N.current = n;
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const E = G(i);
|
|
43
|
+
E.current = i;
|
|
44
44
|
const T = G({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
@@ -62,12 +62,12 @@ const us = rt({
|
|
|
62
62
|
serviceConfig: n,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((A =
|
|
67
|
-
const
|
|
65
|
+
const D = G(null);
|
|
66
|
+
a && ((A = D.current) == null ? void 0 : A.apiKey) !== a && (D.current = { apiKey: a, client: new Hs(a) });
|
|
67
|
+
const L = a ? ((S = D.current) == null ? void 0 : S.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
69
|
const C = M.current, I = N.current;
|
|
70
|
-
if (!a || !
|
|
70
|
+
if (!a || !L || !I) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: C,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,17 +78,17 @@ const us = rt({
|
|
|
78
78
|
renderCount: C,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const $ = new
|
|
81
|
+
const $ = new Gs({
|
|
82
82
|
...I,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: E.current,
|
|
85
|
+
client: L
|
|
86
86
|
});
|
|
87
87
|
x.current = $, d($), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: C,
|
|
89
89
|
serviceInstance: !!$
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
91
|
+
}, [a, L]);
|
|
92
92
|
const O = G(null);
|
|
93
93
|
K(() => {
|
|
94
94
|
var I, $;
|
|
@@ -137,12 +137,12 @@ const us = rt({
|
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
139
|
}, [o, t, l, h]), K(() => {
|
|
140
|
-
const C =
|
|
140
|
+
const C = L;
|
|
141
141
|
return () => {
|
|
142
142
|
var I;
|
|
143
143
|
C && (O.current = null, (I = x.current) == null || I.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
145
|
+
}, [L]);
|
|
146
146
|
const z = J(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
@@ -194,19 +194,19 @@ const us = rt({
|
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
196
|
renderCount: M.current,
|
|
197
|
-
willRenderChat: !!
|
|
197
|
+
willRenderChat: !!L,
|
|
198
198
|
contextValueReady: !!y
|
|
199
|
-
}), /* @__PURE__ */ s(
|
|
200
|
-
|
|
199
|
+
}), /* @__PURE__ */ s(ds.Provider, { value: y, children: L ? /* @__PURE__ */ s(
|
|
200
|
+
Ys,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: L,
|
|
203
203
|
customClasses: {
|
|
204
204
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
205
|
},
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, ea = () => it(), lt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
211
|
const [t, n] = B(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -228,14 +228,14 @@ const us = rt({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
231
|
+
}, ta = "linktree-official", sa = "linktree-official-sender";
|
|
232
232
|
function Ue(e, t, n) {
|
|
233
233
|
const a = Object.values(e || {});
|
|
234
|
-
if (n ===
|
|
234
|
+
if (n === ta) {
|
|
235
235
|
const r = a.find(
|
|
236
236
|
(i) => {
|
|
237
237
|
var l;
|
|
238
|
-
return ((l = i.user) == null ? void 0 : l.id) ===
|
|
238
|
+
return ((l = i.user) == null ? void 0 : l.id) === sa;
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
if (r) return r;
|
|
@@ -247,18 +247,18 @@ function Ue(e, t, n) {
|
|
|
247
247
|
}
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
function
|
|
252
|
-
return
|
|
250
|
+
const na = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
251
|
+
function aa(e) {
|
|
252
|
+
return na.test(e.trim());
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Xt(e, t) {
|
|
255
255
|
const n = e == null ? void 0 : e.trim();
|
|
256
|
-
return !n || t && n === t ? !1 : !
|
|
256
|
+
return !n || t && n === t ? !1 : !aa(n);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
function ot(e) {
|
|
259
|
+
return Xt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Xt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
260
260
|
}
|
|
261
|
-
const
|
|
261
|
+
const Kt = [
|
|
262
262
|
{ emoji: "🍎", bgColor: "#FFD1DD" },
|
|
263
263
|
// Apple
|
|
264
264
|
{ emoji: "🍌", bgColor: "#FFF1C9" },
|
|
@@ -286,7 +286,7 @@ const Jt = [
|
|
|
286
286
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
287
287
|
// Melon
|
|
288
288
|
];
|
|
289
|
-
function
|
|
289
|
+
function ra(e) {
|
|
290
290
|
let t = 0;
|
|
291
291
|
for (let n = 0; n < e.length; n++) {
|
|
292
292
|
const a = e.charCodeAt(n);
|
|
@@ -294,16 +294,16 @@ function la(e) {
|
|
|
294
294
|
}
|
|
295
295
|
return Math.abs(t);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
297
|
+
function us(e) {
|
|
298
|
+
return Kt[ra(e) % Kt.length];
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
return
|
|
300
|
+
function ia(e) {
|
|
301
|
+
return us(e).emoji;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return
|
|
303
|
+
function la(e) {
|
|
304
|
+
return us(e).bgColor;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const se = ({
|
|
307
307
|
id: e,
|
|
308
308
|
image: t,
|
|
309
309
|
size: n = 40,
|
|
@@ -312,7 +312,7 @@ const ne = ({
|
|
|
312
312
|
shape: i = "squircle",
|
|
313
313
|
dmAgentEnabled: l = !1
|
|
314
314
|
}) => {
|
|
315
|
-
const o =
|
|
315
|
+
const o = ia(e), d = la(e), u = 0.45, h = n < 32 ? Math.round(n * u) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
316
316
|
"img",
|
|
317
317
|
{
|
|
318
318
|
src: t,
|
|
@@ -376,7 +376,7 @@ const ne = ({
|
|
|
376
376
|
]
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
|
-
},
|
|
379
|
+
}, oa = "https://linktr.ee/s/about/trust-center/report", ca = ({
|
|
380
380
|
channel: e,
|
|
381
381
|
participant: t,
|
|
382
382
|
showBlockParticipant: n = !0,
|
|
@@ -390,53 +390,53 @@ const ne = ({
|
|
|
390
390
|
logLabel: p = "useChannelModerationActions"
|
|
391
391
|
}) => {
|
|
392
392
|
var A;
|
|
393
|
-
const { service: h, debug: g } =
|
|
393
|
+
const { service: h, debug: g } = it(), c = (A = t == null ? void 0 : t.user) == null ? void 0 : A.id, v = !!(a && n && h && c), [w, b] = B(!1), [f, x] = B(null), [N, E] = B(!1), [T, M] = B(!1), D = v && ((f == null ? void 0 : f.participantId) !== c || (f == null ? void 0 : f.service) !== h);
|
|
394
394
|
return K(() => {
|
|
395
395
|
if (!v || !h || !c) {
|
|
396
396
|
b(!1), x(null);
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
|
-
let
|
|
399
|
+
let S = !1;
|
|
400
400
|
return (async () => {
|
|
401
401
|
try {
|
|
402
402
|
const C = await h.getBlockedUsers();
|
|
403
|
-
if (
|
|
403
|
+
if (S) return;
|
|
404
404
|
b(
|
|
405
405
|
C.some(
|
|
406
406
|
(I) => I.blocked_user_id === c
|
|
407
407
|
)
|
|
408
408
|
);
|
|
409
409
|
} catch (C) {
|
|
410
|
-
|
|
410
|
+
S || console.error(`[${p}] Failed to check blocked status:`, C);
|
|
411
411
|
} finally {
|
|
412
|
-
|
|
412
|
+
S || x({ participantId: c, service: h });
|
|
413
413
|
}
|
|
414
414
|
})(), () => {
|
|
415
|
-
|
|
415
|
+
S = !0;
|
|
416
416
|
};
|
|
417
417
|
}, [v, h, c, p]), {
|
|
418
418
|
isParticipantBlocked: w,
|
|
419
|
-
isCheckingBlockedStatus:
|
|
419
|
+
isCheckingBlockedStatus: D,
|
|
420
420
|
isLeaving: N,
|
|
421
421
|
isUpdatingBlockStatus: T,
|
|
422
422
|
handleLeaveConversation: async () => {
|
|
423
|
-
var
|
|
423
|
+
var S;
|
|
424
424
|
if (!N) {
|
|
425
|
-
l == null || l(), g && console.log(`[${p}] Leave conversation`, e.cid),
|
|
425
|
+
l == null || l(), g && console.log(`[${p}] Leave conversation`, e.cid), E(!0);
|
|
426
426
|
try {
|
|
427
|
-
const C = ((
|
|
427
|
+
const C = ((S = e._client) == null ? void 0 : S.userID) ?? null;
|
|
428
428
|
await e.hide(C, !1), r && await r(e), u == null || u();
|
|
429
429
|
} catch (C) {
|
|
430
430
|
console.error(`[${p}] Failed to leave conversation`, C);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
E(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
handleBlockUser: async () => {
|
|
437
|
-
var
|
|
437
|
+
var S, C, I;
|
|
438
438
|
if (!(T || !h)) {
|
|
439
|
-
o == null || o(), g && console.log(`[${p}] Block member`, (
|
|
439
|
+
o == null || o(), g && console.log(`[${p}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), M(!0);
|
|
440
440
|
try {
|
|
441
441
|
await h.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), u == null || u();
|
|
442
442
|
} catch ($) {
|
|
@@ -447,9 +447,9 @@ const ne = ({
|
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
handleUnblockUser: async () => {
|
|
450
|
-
var
|
|
450
|
+
var S, C, I;
|
|
451
451
|
if (!(T || !h)) {
|
|
452
|
-
o == null || o(), g && console.log(`[${p}] Unblock member`, (
|
|
452
|
+
o == null || o(), g && console.log(`[${p}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), M(!0);
|
|
453
453
|
try {
|
|
454
454
|
await h.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), u == null || u();
|
|
455
455
|
} catch ($) {
|
|
@@ -460,10 +460,10 @@ const ne = ({
|
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
handleReportUser: () => {
|
|
463
|
-
d == null || d(), u == null || u(), window.open(
|
|
463
|
+
d == null || d(), u == null || u(), window.open(oa, "_blank", "noopener,noreferrer");
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
|
-
},
|
|
466
|
+
}, _e = ({
|
|
467
467
|
variant: e = "default",
|
|
468
468
|
className: t,
|
|
469
469
|
children: n,
|
|
@@ -480,7 +480,7 @@ const ne = ({
|
|
|
480
480
|
...a,
|
|
481
481
|
children: n
|
|
482
482
|
}
|
|
483
|
-
),
|
|
483
|
+
), tt = ({
|
|
484
484
|
channel: e,
|
|
485
485
|
participant: t,
|
|
486
486
|
showDeleteConversation: n = !0,
|
|
@@ -494,16 +494,16 @@ const ne = ({
|
|
|
494
494
|
customChannelActions: p,
|
|
495
495
|
triggerClassName: h
|
|
496
496
|
}) => {
|
|
497
|
-
const [g, c] = B(!1), v = G(null), w =
|
|
497
|
+
const [g, c] = B(!1), v = G(null), w = Vs(), b = J(() => c(!1), []), {
|
|
498
498
|
isParticipantBlocked: f,
|
|
499
499
|
isCheckingBlockedStatus: x,
|
|
500
500
|
isLeaving: N,
|
|
501
|
-
isUpdatingBlockStatus:
|
|
501
|
+
isUpdatingBlockStatus: E,
|
|
502
502
|
handleLeaveConversation: T,
|
|
503
503
|
handleBlockUser: M,
|
|
504
|
-
handleUnblockUser:
|
|
505
|
-
handleReportUser:
|
|
506
|
-
} =
|
|
504
|
+
handleUnblockUser: D,
|
|
505
|
+
handleReportUser: L
|
|
506
|
+
} = ca({
|
|
507
507
|
channel: e,
|
|
508
508
|
participant: t,
|
|
509
509
|
showBlockParticipant: a,
|
|
@@ -537,7 +537,7 @@ const ne = ({
|
|
|
537
537
|
"aria-controls": g ? w : void 0,
|
|
538
538
|
onClick: () => c((z) => !z),
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */ s(
|
|
540
|
+
/* @__PURE__ */ s(Tn, { className: "size-5 text-black/90" }),
|
|
541
541
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
542
542
|
]
|
|
543
543
|
}
|
|
@@ -553,13 +553,13 @@ const ne = ({
|
|
|
553
553
|
),
|
|
554
554
|
children: /* @__PURE__ */ m("ul", { className: "flex flex-col gap-1", children: [
|
|
555
555
|
n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
556
|
-
|
|
556
|
+
_e,
|
|
557
557
|
{
|
|
558
558
|
onClick: T,
|
|
559
559
|
disabled: N,
|
|
560
560
|
"aria-busy": N,
|
|
561
561
|
children: [
|
|
562
|
-
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
562
|
+
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(An, { className: "h-5 w-5" }),
|
|
563
563
|
/* @__PURE__ */ s("span", { children: "Delete Conversation" })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
@@ -567,35 +567,35 @@ const ne = ({
|
|
|
567
567
|
a && /* @__PURE__ */ s("li", { children: x ? (
|
|
568
568
|
// Block status not yet resolved — show a disabled placeholder
|
|
569
569
|
// so a premature click can't act on a stale block state.
|
|
570
|
-
/* @__PURE__ */ m(
|
|
570
|
+
/* @__PURE__ */ m(_e, { disabled: !0, "aria-busy": !0, children: [
|
|
571
571
|
/* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }),
|
|
572
572
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
573
573
|
] })
|
|
574
574
|
) : f ? /* @__PURE__ */ m(
|
|
575
|
-
|
|
575
|
+
_e,
|
|
576
576
|
{
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
"aria-busy":
|
|
577
|
+
onClick: D,
|
|
578
|
+
disabled: E,
|
|
579
|
+
"aria-busy": E,
|
|
580
580
|
children: [
|
|
581
|
-
|
|
581
|
+
E ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Wt, { className: "h-5 w-5" }),
|
|
582
582
|
/* @__PURE__ */ s("span", { children: "Unblock" })
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) : /* @__PURE__ */ m(
|
|
586
|
-
|
|
586
|
+
_e,
|
|
587
587
|
{
|
|
588
588
|
onClick: M,
|
|
589
|
-
disabled:
|
|
590
|
-
"aria-busy":
|
|
589
|
+
disabled: E,
|
|
590
|
+
"aria-busy": E,
|
|
591
591
|
children: [
|
|
592
|
-
|
|
592
|
+
E ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Wt, { className: "h-5 w-5" }),
|
|
593
593
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
) }),
|
|
597
|
-
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
598
|
-
/* @__PURE__ */ s(
|
|
597
|
+
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(_e, { variant: "danger", onClick: L, children: [
|
|
598
|
+
/* @__PURE__ */ s(is, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ s("span", { children: "Report" })
|
|
600
600
|
] }) }),
|
|
601
601
|
p
|
|
@@ -603,10 +603,10 @@ const ne = ({
|
|
|
603
603
|
}
|
|
604
604
|
)
|
|
605
605
|
] });
|
|
606
|
-
}, We = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring",
|
|
606
|
+
}, We = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", da = "CUSTOMER_PAID", ua = "Replies instantly with AI assistant", ma = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === da, ha = (e) => {
|
|
607
607
|
const t = e;
|
|
608
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(
|
|
609
|
-
},
|
|
608
|
+
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(ma);
|
|
609
|
+
}, fa = ({
|
|
610
610
|
onBack: e,
|
|
611
611
|
showBackButton: t,
|
|
612
612
|
showStarButton: n = !1,
|
|
@@ -624,8 +624,8 @@ const ne = ({
|
|
|
624
624
|
showChannelInfo: v = !0,
|
|
625
625
|
onParticipantNameClick: w
|
|
626
626
|
}) => {
|
|
627
|
-
var
|
|
628
|
-
const { channel: b } =
|
|
627
|
+
var L, O, z;
|
|
628
|
+
const { channel: b } = ue(), { client: f } = me(), x = U.useMemo(
|
|
629
629
|
() => {
|
|
630
630
|
var y;
|
|
631
631
|
return Ue(
|
|
@@ -634,8 +634,8 @@ const ne = ({
|
|
|
634
634
|
b.type
|
|
635
635
|
);
|
|
636
636
|
},
|
|
637
|
-
[(
|
|
638
|
-
), N =
|
|
637
|
+
[(L = b.state) == null ? void 0 : L.members, f == null ? void 0 : f.userID, b.type]
|
|
638
|
+
), N = ot(x == null ? void 0 : x.user), E = (O = x == null ? void 0 : x.user) == null ? void 0 : O.image, T = lt(b), M = ha(x), D = async () => {
|
|
639
639
|
try {
|
|
640
640
|
T ? await b.unpin() : await b.pin();
|
|
641
641
|
} catch (y) {
|
|
@@ -657,7 +657,7 @@ const ne = ({
|
|
|
657
657
|
}),
|
|
658
658
|
type: "button",
|
|
659
659
|
"aria-label": "Back to conversations",
|
|
660
|
-
children: /* @__PURE__ */ s(
|
|
660
|
+
children: /* @__PURE__ */ s(Qe, { className: "size-5 text-black/90" })
|
|
661
661
|
}
|
|
662
662
|
) }),
|
|
663
663
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: /* @__PURE__ */ m(
|
|
@@ -669,11 +669,11 @@ const ne = ({
|
|
|
669
669
|
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ s(
|
|
672
|
-
|
|
672
|
+
se,
|
|
673
673
|
{
|
|
674
674
|
id: ((z = x == null ? void 0 : x.user) == null ? void 0 : z.id) || b.id || "unknown",
|
|
675
675
|
name: N,
|
|
676
|
-
image:
|
|
676
|
+
image: E,
|
|
677
677
|
dmAgentEnabled: a,
|
|
678
678
|
shape: "circle",
|
|
679
679
|
size: 48,
|
|
@@ -689,7 +689,7 @@ const ne = ({
|
|
|
689
689
|
{
|
|
690
690
|
"aria-label": "Paid customer",
|
|
691
691
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
692
|
-
children: /* @__PURE__ */ s(
|
|
692
|
+
children: /* @__PURE__ */ s(Mn, { className: "size-2.5", weight: "bold" })
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
695
|
n && T && /* @__PURE__ */ s(
|
|
@@ -712,7 +712,7 @@ const ne = ({
|
|
|
712
712
|
] }),
|
|
713
713
|
a && /* @__PURE__ */ m("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
714
714
|
/* @__PURE__ */ s(xe, { className: "size-3 shrink-0 text-black/55" }),
|
|
715
|
-
/* @__PURE__ */ s("span", { children:
|
|
715
|
+
/* @__PURE__ */ s("span", { children: ua })
|
|
716
716
|
] })
|
|
717
717
|
] })
|
|
718
718
|
]
|
|
@@ -723,7 +723,7 @@ const ne = ({
|
|
|
723
723
|
"button",
|
|
724
724
|
{
|
|
725
725
|
className: We,
|
|
726
|
-
onClick:
|
|
726
|
+
onClick: D,
|
|
727
727
|
type: "button",
|
|
728
728
|
"aria-pressed": T,
|
|
729
729
|
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
@@ -740,7 +740,7 @@ const ne = ({
|
|
|
740
740
|
}
|
|
741
741
|
),
|
|
742
742
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
743
|
-
|
|
743
|
+
tt,
|
|
744
744
|
{
|
|
745
745
|
channel: b,
|
|
746
746
|
participant: x,
|
|
@@ -758,20 +758,20 @@ const ne = ({
|
|
|
758
758
|
))
|
|
759
759
|
] })
|
|
760
760
|
] }) });
|
|
761
|
-
},
|
|
762
|
-
function
|
|
763
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
761
|
+
}, ga = (e) => /* @__PURE__ */ s(qs, { ...e, position: "center" }), st = "vote_up", nt = "vote_down";
|
|
762
|
+
function pa(e) {
|
|
763
|
+
return e != null && e.length ? e.some((t) => t.type === nt) ? "down" : e.some((t) => t.type === st) ? "up" : null : null;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
const { channel: t } =
|
|
767
|
-
() =>
|
|
765
|
+
function ba(e) {
|
|
766
|
+
const { channel: t } = ue(), { client: n } = me("useMessageVote"), a = ae(
|
|
767
|
+
() => pa(e.own_reactions),
|
|
768
768
|
[e.own_reactions]
|
|
769
769
|
), r = J(async () => {
|
|
770
770
|
if (n != null && n.userID)
|
|
771
771
|
try {
|
|
772
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
772
|
+
a === "up" ? await t.deleteReaction(e.id, st) : await t.sendReaction(
|
|
773
773
|
e.id,
|
|
774
|
-
{ type:
|
|
774
|
+
{ type: st },
|
|
775
775
|
{ enforce_unique: !0, skip_push: !0 }
|
|
776
776
|
);
|
|
777
777
|
} catch {
|
|
@@ -779,9 +779,9 @@ function xa(e) {
|
|
|
779
779
|
}, [t, n == null ? void 0 : n.userID, e.id, a]), i = J(async () => {
|
|
780
780
|
if (n != null && n.userID)
|
|
781
781
|
try {
|
|
782
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
782
|
+
a === "down" ? await t.deleteReaction(e.id, nt) : await t.sendReaction(
|
|
783
783
|
e.id,
|
|
784
|
-
{ type:
|
|
784
|
+
{ type: nt },
|
|
785
785
|
{ enforce_unique: !0, skip_push: !0 }
|
|
786
786
|
);
|
|
787
787
|
} catch {
|
|
@@ -789,24 +789,24 @@ function xa(e) {
|
|
|
789
789
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
790
790
|
return { selected: a, voteUp: r, voteDown: i };
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function va(e) {
|
|
793
793
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function ms({
|
|
796
796
|
message: e,
|
|
797
797
|
viewerLanguage: t
|
|
798
798
|
}) {
|
|
799
799
|
var r;
|
|
800
|
-
const n = e == null ? void 0 : e.text, a =
|
|
800
|
+
const n = e == null ? void 0 : e.text, a = va(t);
|
|
801
801
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
802
802
|
}
|
|
803
|
-
const
|
|
803
|
+
const xa = U.lazy(() => import("./Card-CqEKHw9S.js")), wa = U.lazy(() => import("./Card-ILtY9lfF.js")), _a = U.lazy(() => import("./Card-Byosl29s.js")), ct = () => /* @__PURE__ */ s(
|
|
804
804
|
"div",
|
|
805
805
|
{
|
|
806
806
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
807
807
|
"aria-hidden": !0
|
|
808
808
|
}
|
|
809
|
-
),
|
|
809
|
+
), Na = (e) => /* @__PURE__ */ s(rt, { fallback: /* @__PURE__ */ s(ct, {}), children: /* @__PURE__ */ s(xa, { ...e }) }), hs = (e) => /* @__PURE__ */ s(rt, { fallback: /* @__PURE__ */ s(ct, {}), children: /* @__PURE__ */ s(wa, { ...e }) }), fs = (e) => /* @__PURE__ */ s(rt, { fallback: /* @__PURE__ */ s(ct, {}), children: /* @__PURE__ */ s(_a, { ...e }) }), ya = hs, ka = fs, Jt = { Composer: Na, Sent: hs, Received: fs, Creator: ya, Visitor: ka }, Ca = [
|
|
810
810
|
[/pdf/, "pdf"],
|
|
811
811
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
812
812
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -816,42 +816,42 @@ const _a = U.lazy(() => import("./Card-iGNcxybY.js")), Na = U.lazy(() => import(
|
|
|
816
816
|
[/plain|rtf/, "text"],
|
|
817
817
|
[/markdown/, "markdown"]
|
|
818
818
|
];
|
|
819
|
-
function
|
|
819
|
+
function le(e) {
|
|
820
820
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
const t =
|
|
822
|
+
function gs(e) {
|
|
823
|
+
const t = Ca.find(
|
|
824
824
|
([n]) => n.test(e)
|
|
825
825
|
);
|
|
826
826
|
return t ? t[1] : "generic";
|
|
827
827
|
}
|
|
828
|
-
const
|
|
829
|
-
video:
|
|
830
|
-
audio:
|
|
831
|
-
image:
|
|
832
|
-
document:
|
|
833
|
-
},
|
|
834
|
-
pdf:
|
|
835
|
-
doc:
|
|
836
|
-
xls:
|
|
837
|
-
csv:
|
|
838
|
-
ppt:
|
|
839
|
-
zip:
|
|
840
|
-
text:
|
|
841
|
-
markdown:
|
|
842
|
-
generic:
|
|
828
|
+
const Ea = {
|
|
829
|
+
video: os,
|
|
830
|
+
audio: Ln,
|
|
831
|
+
image: Rn,
|
|
832
|
+
document: ls
|
|
833
|
+
}, Sa = {
|
|
834
|
+
pdf: Bn,
|
|
835
|
+
doc: jn,
|
|
836
|
+
xls: $n,
|
|
837
|
+
csv: On,
|
|
838
|
+
ppt: Fn,
|
|
839
|
+
zip: Pn,
|
|
840
|
+
text: zn,
|
|
841
|
+
markdown: Dn,
|
|
842
|
+
generic: ls
|
|
843
843
|
};
|
|
844
|
-
function
|
|
845
|
-
const t =
|
|
846
|
-
return t !== "document" ?
|
|
844
|
+
function Ia(e) {
|
|
845
|
+
const t = le(e);
|
|
846
|
+
return t !== "document" ? Ea[t] : Sa[gs(e)];
|
|
847
847
|
}
|
|
848
848
|
function we(e, t) {
|
|
849
|
-
return U.createElement(
|
|
849
|
+
return U.createElement(Ia(e), t);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
851
|
+
const Ta = (e) => {
|
|
852
852
|
var t, n;
|
|
853
853
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
|
|
854
|
-
},
|
|
854
|
+
}, Aa = ({
|
|
855
855
|
source: e,
|
|
856
856
|
mimeType: t,
|
|
857
857
|
poster: n,
|
|
@@ -863,21 +863,21 @@ const Ma = (e) => {
|
|
|
863
863
|
muted: d = !1,
|
|
864
864
|
onContainerClick: u
|
|
865
865
|
}) => {
|
|
866
|
-
const p =
|
|
867
|
-
|
|
866
|
+
const p = le(t), h = G(null), g = G(null), c = G(null), v = G(r), [w, b] = B(a), [f, x] = B(0), [N, E] = B(!1), [T, M] = B(!1), [D, L] = B(!1), [O, z] = B(!1), [y, A] = B(!0), [S, C] = B(null), I = J(() => {
|
|
867
|
+
L(!1), b(!0);
|
|
868
868
|
}, []), $ = J((_) => {
|
|
869
869
|
const R = g.current;
|
|
870
870
|
if (!R) return 0;
|
|
871
871
|
const H = R.getBoundingClientRect();
|
|
872
872
|
return Math.max(
|
|
873
873
|
0,
|
|
874
|
-
Math.min(1, (
|
|
874
|
+
Math.min(1, (Ta(_) - H.left) / H.width)
|
|
875
875
|
);
|
|
876
876
|
}, []), F = J((_) => {
|
|
877
877
|
const R = h.current;
|
|
878
878
|
R && R.duration && (R.currentTime = _ * R.duration);
|
|
879
879
|
}, []), V = (_) => {
|
|
880
|
-
_.stopPropagation(),
|
|
880
|
+
_.stopPropagation(), E(!0);
|
|
881
881
|
const R = $(_);
|
|
882
882
|
x(R), F(R);
|
|
883
883
|
};
|
|
@@ -898,31 +898,31 @@ const Ma = (e) => {
|
|
|
898
898
|
}, [w, N]), K(() => {
|
|
899
899
|
const _ = h.current;
|
|
900
900
|
_ && (w ? _.play().catch((R) => {
|
|
901
|
-
b(!1),
|
|
901
|
+
b(!1), L(!0);
|
|
902
902
|
}) : _.pause());
|
|
903
903
|
}, [w]), K(() => {
|
|
904
904
|
if (!N) return;
|
|
905
905
|
const _ = (H) => x($(H)), R = (H) => {
|
|
906
|
-
|
|
906
|
+
E(!1), F($(H));
|
|
907
907
|
};
|
|
908
908
|
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", R), window.addEventListener("touchmove", _, { passive: !0 }), window.addEventListener("touchend", R), () => {
|
|
909
909
|
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", R), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", R);
|
|
910
910
|
};
|
|
911
911
|
}, [N, $, F]);
|
|
912
|
-
const Q =
|
|
912
|
+
const Q = S ? { aspectRatio: String(S) } : void 0, ee = S ? "" : " aspect-video", X = Math.round(f * 100);
|
|
913
913
|
return /* @__PURE__ */ m(
|
|
914
914
|
"div",
|
|
915
915
|
{
|
|
916
916
|
role: "button",
|
|
917
917
|
tabIndex: 0,
|
|
918
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
918
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${ee}`,
|
|
919
919
|
style: Q,
|
|
920
920
|
onClick: (_) => {
|
|
921
921
|
if (u) {
|
|
922
922
|
u(_);
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
D || l && b((R) => !R);
|
|
926
926
|
},
|
|
927
927
|
onKeyDown: (_) => {
|
|
928
928
|
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
@@ -930,7 +930,7 @@ const Ma = (e) => {
|
|
|
930
930
|
u(_);
|
|
931
931
|
return;
|
|
932
932
|
}
|
|
933
|
-
|
|
933
|
+
D || l && b((R) => !R);
|
|
934
934
|
}
|
|
935
935
|
},
|
|
936
936
|
children: [
|
|
@@ -959,7 +959,7 @@ const Ma = (e) => {
|
|
|
959
959
|
z(!1), A(!1);
|
|
960
960
|
},
|
|
961
961
|
onWaiting: () => z(!0),
|
|
962
|
-
onPlay: () =>
|
|
962
|
+
onPlay: () => L(!1),
|
|
963
963
|
onEnded: () => {
|
|
964
964
|
i || (b(!1), x(0));
|
|
965
965
|
},
|
|
@@ -979,7 +979,7 @@ const Ma = (e) => {
|
|
|
979
979
|
z(!1), A(!1);
|
|
980
980
|
},
|
|
981
981
|
onWaiting: () => z(!0),
|
|
982
|
-
onPlay: () =>
|
|
982
|
+
onPlay: () => L(!1),
|
|
983
983
|
onLoadedMetadata: () => {
|
|
984
984
|
const _ = h.current;
|
|
985
985
|
_ instanceof HTMLVideoElement && _.videoWidth && _.videoHeight && C(_.videoWidth / _.videoHeight);
|
|
@@ -990,14 +990,14 @@ const Ma = (e) => {
|
|
|
990
990
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
991
991
|
}
|
|
992
992
|
) }),
|
|
993
|
-
O && !
|
|
994
|
-
|
|
993
|
+
O && !D && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
994
|
+
ke,
|
|
995
995
|
{
|
|
996
996
|
className: "size-8 animate-spin text-white/80",
|
|
997
997
|
weight: "bold"
|
|
998
998
|
}
|
|
999
999
|
) }),
|
|
1000
|
-
|
|
1000
|
+
D && !l && /* @__PURE__ */ s(
|
|
1001
1001
|
"div",
|
|
1002
1002
|
{
|
|
1003
1003
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1010,7 +1010,7 @@ const Ma = (e) => {
|
|
|
1010
1010
|
onKeyDown: (_) => {
|
|
1011
1011
|
_.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), I());
|
|
1012
1012
|
},
|
|
1013
|
-
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(
|
|
1013
|
+
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1014
1014
|
}
|
|
1015
1015
|
),
|
|
1016
1016
|
o && !l && /* @__PURE__ */ s("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ s(
|
|
@@ -1049,7 +1049,7 @@ const Ma = (e) => {
|
|
|
1049
1049
|
},
|
|
1050
1050
|
className: "shrink-0 text-white",
|
|
1051
1051
|
"aria-label": w ? "Pause" : "Play",
|
|
1052
|
-
children: w ? /* @__PURE__ */ s(
|
|
1052
|
+
children: w ? /* @__PURE__ */ s(Un, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(et, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1053
1053
|
}
|
|
1054
1054
|
),
|
|
1055
1055
|
/* @__PURE__ */ m(
|
|
@@ -1099,7 +1099,7 @@ const Ma = (e) => {
|
|
|
1099
1099
|
]
|
|
1100
1100
|
}
|
|
1101
1101
|
);
|
|
1102
|
-
},
|
|
1102
|
+
}, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ma = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", ps = ({
|
|
1103
1103
|
mimeType: e,
|
|
1104
1104
|
sourceUrl: t,
|
|
1105
1105
|
thumbnailUrl: n,
|
|
@@ -1108,9 +1108,9 @@ const Ma = (e) => {
|
|
|
1108
1108
|
mediaPlayerProps: i,
|
|
1109
1109
|
containedImage: l = !1
|
|
1110
1110
|
}) => {
|
|
1111
|
-
const o =
|
|
1111
|
+
const o = le(e), [d, u] = B(!1);
|
|
1112
1112
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ s(
|
|
1113
|
-
|
|
1113
|
+
Aa,
|
|
1114
1114
|
{
|
|
1115
1115
|
source: t,
|
|
1116
1116
|
mimeType: e,
|
|
@@ -1157,11 +1157,11 @@ const Ma = (e) => {
|
|
|
1157
1157
|
{
|
|
1158
1158
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1159
1159
|
children: we(e, {
|
|
1160
|
-
className:
|
|
1160
|
+
className: Zt(r),
|
|
1161
1161
|
weight: "regular"
|
|
1162
1162
|
})
|
|
1163
1163
|
}
|
|
1164
|
-
) : n ? /* @__PURE__ */ s("div", { className: `relative ${
|
|
1164
|
+
) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ma(r)}`, children: /* @__PURE__ */ s(
|
|
1165
1165
|
"img",
|
|
1166
1166
|
{
|
|
1167
1167
|
src: n,
|
|
@@ -1174,12 +1174,12 @@ const Ma = (e) => {
|
|
|
1174
1174
|
{
|
|
1175
1175
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1176
1176
|
children: we(e, {
|
|
1177
|
-
className:
|
|
1177
|
+
className: Zt(r),
|
|
1178
1178
|
weight: "regular"
|
|
1179
1179
|
})
|
|
1180
1180
|
}
|
|
1181
1181
|
);
|
|
1182
|
-
},
|
|
1182
|
+
}, bs = ({
|
|
1183
1183
|
variant: e,
|
|
1184
1184
|
thumbnail: t,
|
|
1185
1185
|
title: n,
|
|
@@ -1245,28 +1245,28 @@ const Ma = (e) => {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
);
|
|
1247
1247
|
};
|
|
1248
|
-
function
|
|
1248
|
+
function vs(e) {
|
|
1249
1249
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1250
1250
|
}
|
|
1251
|
-
function
|
|
1251
|
+
function dt(e) {
|
|
1252
1252
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Ra(e) {
|
|
1255
1255
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function La(e) {
|
|
1258
1258
|
return e ? "text-white" : "text-black";
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function Da(e) {
|
|
1261
1261
|
return e ? "text-white/55" : "text-black/55";
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function za(e) {
|
|
1264
1264
|
return e ? "text-white/40" : "text-black/40";
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Pa(e) {
|
|
1267
1267
|
return e ? "text-white/20" : "text-black/20";
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const ut = ({ attachment: e, isMyMessage: t }) => {
|
|
1270
1270
|
const { title: n, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ m(U.Fragment, { children: [
|
|
1271
1271
|
/* @__PURE__ */ s("div", { className: "p-2", children: r ? /* @__PURE__ */ s(
|
|
1272
1272
|
"img",
|
|
@@ -1278,26 +1278,26 @@ const mt = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1278
1278
|
) : /* @__PURE__ */ s(
|
|
1279
1279
|
"div",
|
|
1280
1280
|
{
|
|
1281
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1282
|
-
children: /* @__PURE__ */ s(
|
|
1281
|
+
className: `aspect-video w-full rounded-[20px] ${Ra(t)} flex items-center justify-center`,
|
|
1282
|
+
children: /* @__PURE__ */ s(Vn, { className: `size-12 ${Pa(t)}` })
|
|
1283
1283
|
}
|
|
1284
1284
|
) }),
|
|
1285
1285
|
/* @__PURE__ */ m("div", { className: "px-3 pb-3", children: [
|
|
1286
|
-
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1287
|
-
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${
|
|
1288
|
-
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1286
|
+
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${La(t)}`, children: n }),
|
|
1287
|
+
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Da(t)}`, children: a }),
|
|
1288
|
+
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${za(t)}`, children: d })
|
|
1289
1289
|
] })
|
|
1290
1290
|
] });
|
|
1291
1291
|
return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ s("div", { className: "block", children: u });
|
|
1292
1292
|
};
|
|
1293
|
-
function
|
|
1293
|
+
function xs(e) {
|
|
1294
1294
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function mt(e) {
|
|
1297
1297
|
var t;
|
|
1298
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1298
|
+
return (t = e.attachments) == null ? void 0 : t.find(xs);
|
|
1299
1299
|
}
|
|
1300
|
-
async function
|
|
1300
|
+
async function Fa(e, t) {
|
|
1301
1301
|
let n;
|
|
1302
1302
|
try {
|
|
1303
1303
|
n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1309,7 +1309,7 @@ async function $a(e, t) {
|
|
|
1309
1309
|
const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
1310
1310
|
l.href = i, l.download = n, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1312
|
+
const Oa = ({
|
|
1313
1313
|
url: e,
|
|
1314
1314
|
filename: t
|
|
1315
1315
|
}) => {
|
|
@@ -1321,7 +1321,7 @@ const ja = ({
|
|
|
1321
1321
|
onClick: (i) => {
|
|
1322
1322
|
i.stopPropagation();
|
|
1323
1323
|
const l = window.open("", "_blank", "noopener,noreferrer");
|
|
1324
|
-
a(!0),
|
|
1324
|
+
a(!0), Fa(e, t).then(() => {
|
|
1325
1325
|
l == null || l.close();
|
|
1326
1326
|
}).catch(() => {
|
|
1327
1327
|
l && (l.location.href = e);
|
|
@@ -1329,14 +1329,14 @@ const ja = ({
|
|
|
1329
1329
|
},
|
|
1330
1330
|
disabled: n,
|
|
1331
1331
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1332
|
-
children: n ? /* @__PURE__ */ s(
|
|
1333
|
-
/* @__PURE__ */ s(
|
|
1332
|
+
children: n ? /* @__PURE__ */ s(ke, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(U.Fragment, { children: [
|
|
1333
|
+
/* @__PURE__ */ s(Ce, { className: "size-4 text-white", weight: "bold" }),
|
|
1334
1334
|
"Download"
|
|
1335
1335
|
] })
|
|
1336
1336
|
}
|
|
1337
1337
|
);
|
|
1338
1338
|
};
|
|
1339
|
-
function
|
|
1339
|
+
function ht(e) {
|
|
1340
1340
|
var h, g, c, v;
|
|
1341
1341
|
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1342
1342
|
(w) => w.type === "video" && w.asset_url
|
|
@@ -1357,16 +1357,16 @@ function ft(e) {
|
|
|
1357
1357
|
thumbnailUrl: p
|
|
1358
1358
|
};
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1360
|
+
const ws = ({
|
|
1361
1361
|
resolvedUrl: e,
|
|
1362
1362
|
resolvedType: t,
|
|
1363
1363
|
title: n,
|
|
1364
1364
|
fileSize: a,
|
|
1365
1365
|
thumbnailUrl: r
|
|
1366
1366
|
}) => {
|
|
1367
|
-
const i = a !== void 0 ?
|
|
1367
|
+
const i = a !== void 0 ? vs(a) : void 0;
|
|
1368
1368
|
return /* @__PURE__ */ s(
|
|
1369
|
-
|
|
1369
|
+
bs,
|
|
1370
1370
|
{
|
|
1371
1371
|
variant: "dark",
|
|
1372
1372
|
title: n,
|
|
@@ -1374,7 +1374,7 @@ const _s = ({
|
|
|
1374
1374
|
mimeType: t,
|
|
1375
1375
|
detail: i,
|
|
1376
1376
|
thumbnail: /* @__PURE__ */ s(
|
|
1377
|
-
|
|
1377
|
+
ps,
|
|
1378
1378
|
{
|
|
1379
1379
|
mimeType: t,
|
|
1380
1380
|
sourceUrl: e,
|
|
@@ -1385,23 +1385,23 @@ const _s = ({
|
|
|
1385
1385
|
)
|
|
1386
1386
|
}
|
|
1387
1387
|
);
|
|
1388
|
-
},
|
|
1388
|
+
}, _s = ({
|
|
1389
1389
|
resolvedUrl: e,
|
|
1390
1390
|
resolvedType: t,
|
|
1391
1391
|
title: n,
|
|
1392
1392
|
fileSize: a,
|
|
1393
1393
|
thumbnailUrl: r
|
|
1394
1394
|
}) => {
|
|
1395
|
-
const i =
|
|
1395
|
+
const i = le(t), l = a !== void 0 ? vs(a) : void 0;
|
|
1396
1396
|
return /* @__PURE__ */ s(
|
|
1397
|
-
|
|
1397
|
+
bs,
|
|
1398
1398
|
{
|
|
1399
1399
|
variant: "light",
|
|
1400
1400
|
title: n,
|
|
1401
1401
|
mimeType: t,
|
|
1402
1402
|
detail: l,
|
|
1403
1403
|
thumbnail: /* @__PURE__ */ s(
|
|
1404
|
-
|
|
1404
|
+
ps,
|
|
1405
1405
|
{
|
|
1406
1406
|
mimeType: t,
|
|
1407
1407
|
sourceUrl: e,
|
|
@@ -1411,17 +1411,17 @@ const _s = ({
|
|
|
1411
1411
|
containedImage: i === "image" || i === "document"
|
|
1412
1412
|
}
|
|
1413
1413
|
),
|
|
1414
|
-
action: /* @__PURE__ */ s(
|
|
1414
|
+
action: /* @__PURE__ */ s(Oa, { url: e, filename: n })
|
|
1415
1415
|
}
|
|
1416
1416
|
);
|
|
1417
|
-
},
|
|
1417
|
+
}, $a = ({
|
|
1418
1418
|
message: e,
|
|
1419
1419
|
isMyMessage: t = !1
|
|
1420
1420
|
}) => {
|
|
1421
|
-
const n =
|
|
1421
|
+
const n = mt(e), a = ht(e);
|
|
1422
1422
|
return !n && !a ? null : /* @__PURE__ */ m("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1423
1423
|
!t && e.user && /* @__PURE__ */ s(
|
|
1424
|
-
|
|
1424
|
+
se,
|
|
1425
1425
|
{
|
|
1426
1426
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1427
1427
|
id: e.user.id,
|
|
@@ -1439,41 +1439,41 @@ const _s = ({
|
|
|
1439
1439
|
{
|
|
1440
1440
|
className: "str-chat__message-bubble",
|
|
1441
1441
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1442
|
-
children: n ? /* @__PURE__ */ s("div", { className:
|
|
1442
|
+
children: n ? /* @__PURE__ */ s("div", { className: dt(t), children: /* @__PURE__ */ s(ut, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(ws, { ...a }) : /* @__PURE__ */ s(_s, { ...a })
|
|
1443
1443
|
}
|
|
1444
1444
|
) })
|
|
1445
1445
|
}
|
|
1446
1446
|
)
|
|
1447
1447
|
] });
|
|
1448
|
-
},
|
|
1448
|
+
}, ja = ({
|
|
1449
1449
|
message: e
|
|
1450
1450
|
}) => {
|
|
1451
|
-
const t =
|
|
1451
|
+
const t = mt(e);
|
|
1452
1452
|
if (t)
|
|
1453
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1454
|
-
const n =
|
|
1455
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1456
|
-
},
|
|
1453
|
+
return /* @__PURE__ */ s("div", { className: dt(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ut, { attachment: t, isMyMessage: !0 }) });
|
|
1454
|
+
const n = ht(e);
|
|
1455
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ws, { ...n }) }) : null;
|
|
1456
|
+
}, Ba = ({
|
|
1457
1457
|
message: e
|
|
1458
1458
|
}) => {
|
|
1459
|
-
const t =
|
|
1459
|
+
const t = mt(e);
|
|
1460
1460
|
if (t)
|
|
1461
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1462
|
-
const n =
|
|
1463
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1464
|
-
},
|
|
1465
|
-
Creator:
|
|
1466
|
-
Visitor:
|
|
1467
|
-
}),
|
|
1461
|
+
return /* @__PURE__ */ s("div", { className: dt(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ut, { attachment: t, isMyMessage: !1 }) });
|
|
1462
|
+
const n = ht(e);
|
|
1463
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(_s, { ...n }) }) : null;
|
|
1464
|
+
}, ol = Object.assign($a, {
|
|
1465
|
+
Creator: ja,
|
|
1466
|
+
Visitor: Ba
|
|
1467
|
+
}), Ua = {
|
|
1468
1468
|
dark: "bg-[#121110]",
|
|
1469
1469
|
light: "bg-[#e9eaed]"
|
|
1470
|
-
},
|
|
1470
|
+
}, Va = {
|
|
1471
1471
|
dark: "text-white",
|
|
1472
1472
|
light: "text-[#080707]"
|
|
1473
|
-
},
|
|
1473
|
+
}, Ga = {
|
|
1474
1474
|
dark: "border-white/[0.08]",
|
|
1475
1475
|
light: "border-black/[0.08]"
|
|
1476
|
-
},
|
|
1476
|
+
}, Ha = (e) => e === "dark" ? "sender" : "receiver", Ya = {
|
|
1477
1477
|
sender: {
|
|
1478
1478
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1479
1479
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1495,7 +1495,7 @@ const _s = ({
|
|
|
1495
1495
|
children: i,
|
|
1496
1496
|
"data-testid": l
|
|
1497
1497
|
}) => {
|
|
1498
|
-
const o = t != null && t !== "", d =
|
|
1498
|
+
const o = t != null && t !== "", d = Ya[Ha(e)][a];
|
|
1499
1499
|
return /* @__PURE__ */ m(
|
|
1500
1500
|
"div",
|
|
1501
1501
|
{
|
|
@@ -1510,10 +1510,10 @@ const _s = ({
|
|
|
1510
1510
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1511
1511
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1512
1512
|
d,
|
|
1513
|
-
|
|
1514
|
-
|
|
1513
|
+
Ua[e],
|
|
1514
|
+
Va[e],
|
|
1515
1515
|
n && "border",
|
|
1516
|
-
n &&
|
|
1516
|
+
n && Ga[e],
|
|
1517
1517
|
r
|
|
1518
1518
|
),
|
|
1519
1519
|
children: [
|
|
@@ -1556,16 +1556,16 @@ const _s = ({
|
|
|
1556
1556
|
),
|
|
1557
1557
|
children: /* @__PURE__ */ s(Be, { className: "size-3", weight: "bold" })
|
|
1558
1558
|
}
|
|
1559
|
-
), Me = (e) => e === "received" ? "light" : "dark",
|
|
1559
|
+
), Me = (e) => e === "received" ? "light" : "dark", qa = ({
|
|
1560
1560
|
firstOfGroup: e,
|
|
1561
1561
|
endOfGroup: t,
|
|
1562
1562
|
groupedByUser: n
|
|
1563
|
-
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1563
|
+
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Wa = ({
|
|
1564
1564
|
src: e,
|
|
1565
1565
|
mimeType: t,
|
|
1566
1566
|
filename: n,
|
|
1567
1567
|
items: a
|
|
1568
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [],
|
|
1568
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Xa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1569
1569
|
/* @__PURE__ */ s(
|
|
1570
1570
|
"audio",
|
|
1571
1571
|
{
|
|
@@ -1577,7 +1577,7 @@ const _s = ({
|
|
|
1577
1577
|
}
|
|
1578
1578
|
),
|
|
1579
1579
|
n ?? null
|
|
1580
|
-
] }),
|
|
1580
|
+
] }), ft = ({
|
|
1581
1581
|
state: e,
|
|
1582
1582
|
src: t,
|
|
1583
1583
|
mimeType: n,
|
|
@@ -1588,7 +1588,7 @@ const _s = ({
|
|
|
1588
1588
|
preload: o,
|
|
1589
1589
|
onDismiss: d
|
|
1590
1590
|
}) => {
|
|
1591
|
-
const u = Me(e), p = e === "composer" && !!d, h =
|
|
1591
|
+
const u = Me(e), p = e === "composer" && !!d, h = Wa({ src: t, mimeType: n, filename: a, items: r });
|
|
1592
1592
|
if (h.length === 0)
|
|
1593
1593
|
return null;
|
|
1594
1594
|
const g = o ?? (h.length > 1 ? "none" : "metadata");
|
|
@@ -1600,7 +1600,7 @@ const _s = ({
|
|
|
1600
1600
|
groupPosition: l,
|
|
1601
1601
|
"data-testid": "audio-attachment",
|
|
1602
1602
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, v) => /* @__PURE__ */ s(
|
|
1603
|
-
|
|
1603
|
+
Xa,
|
|
1604
1604
|
{
|
|
1605
1605
|
item: c,
|
|
1606
1606
|
preload: g,
|
|
@@ -1614,15 +1614,15 @@ const _s = ({
|
|
|
1614
1614
|
)) })
|
|
1615
1615
|
}
|
|
1616
1616
|
);
|
|
1617
|
-
},
|
|
1618
|
-
Composer:
|
|
1619
|
-
Sent:
|
|
1620
|
-
Received:
|
|
1617
|
+
}, Ka = (e) => /* @__PURE__ */ s(ft, { ...e, state: "composer" }), Ja = (e) => /* @__PURE__ */ s(ft, { ...e, state: "sent" }), Za = (e) => /* @__PURE__ */ s(ft, { ...e, state: "received" }), Qa = {
|
|
1618
|
+
Composer: Ka,
|
|
1619
|
+
Sent: Ja,
|
|
1620
|
+
Received: Za
|
|
1621
1621
|
};
|
|
1622
|
-
function
|
|
1622
|
+
function er(e) {
|
|
1623
1623
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1625
|
+
const tr = {
|
|
1626
1626
|
pdf: "PDF",
|
|
1627
1627
|
doc: "DOC",
|
|
1628
1628
|
xls: "XLS",
|
|
@@ -1632,7 +1632,7 @@ const nr = {
|
|
|
1632
1632
|
text: "TXT",
|
|
1633
1633
|
markdown: "MD"
|
|
1634
1634
|
};
|
|
1635
|
-
function
|
|
1635
|
+
function sr(e, t) {
|
|
1636
1636
|
if (t) {
|
|
1637
1637
|
const r = t.lastIndexOf(".");
|
|
1638
1638
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1641,8 +1641,8 @@ function ar(e, t) {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
if (!e) return;
|
|
1644
|
-
if (
|
|
1645
|
-
const r =
|
|
1644
|
+
if (le(e) === "document") {
|
|
1645
|
+
const r = gs(e), i = tr[r];
|
|
1646
1646
|
if (i) return i;
|
|
1647
1647
|
if (e === "application/octet-stream") return;
|
|
1648
1648
|
}
|
|
@@ -1650,8 +1650,8 @@ function ar(e, t) {
|
|
|
1650
1650
|
if (!(!a || a === "*"))
|
|
1651
1651
|
return a.toUpperCase();
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1654
|
-
const a =
|
|
1653
|
+
function nr(e, t, n) {
|
|
1654
|
+
const a = sr(e, t), r = typeof n == "number" && n > 0 ? er(n) : void 0;
|
|
1655
1655
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1656
1656
|
}
|
|
1657
1657
|
function re(e) {
|
|
@@ -1662,16 +1662,16 @@ function re(e) {
|
|
|
1662
1662
|
return "download";
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
|
-
const
|
|
1665
|
+
const ar = {
|
|
1666
1666
|
dark: "text-white/55",
|
|
1667
1667
|
light: "text-black/65"
|
|
1668
|
-
},
|
|
1668
|
+
}, rr = {
|
|
1669
1669
|
dark: "bg-white/10",
|
|
1670
1670
|
light: "bg-black/5"
|
|
1671
|
-
},
|
|
1671
|
+
}, ir = {
|
|
1672
1672
|
dark: "text-white/85",
|
|
1673
1673
|
light: "text-black/85"
|
|
1674
|
-
},
|
|
1674
|
+
}, Ns = ({
|
|
1675
1675
|
variant: e,
|
|
1676
1676
|
filename: t,
|
|
1677
1677
|
title: n,
|
|
@@ -1681,16 +1681,16 @@ const ir = {
|
|
|
1681
1681
|
activateLabel: l,
|
|
1682
1682
|
trailingAction: o
|
|
1683
1683
|
}) => {
|
|
1684
|
-
const d = n ?? t ?? "File", u =
|
|
1684
|
+
const d = n ?? t ?? "File", u = nr(a, t, r), p = /* @__PURE__ */ s(
|
|
1685
1685
|
"div",
|
|
1686
1686
|
{
|
|
1687
1687
|
className: k(
|
|
1688
1688
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1689
|
-
|
|
1689
|
+
rr[e]
|
|
1690
1690
|
),
|
|
1691
1691
|
"aria-hidden": !0,
|
|
1692
1692
|
children: we(a, {
|
|
1693
|
-
className: k("size-6",
|
|
1693
|
+
className: k("size-6", ir[e]),
|
|
1694
1694
|
weight: "regular"
|
|
1695
1695
|
})
|
|
1696
1696
|
}
|
|
@@ -1701,7 +1701,7 @@ const ir = {
|
|
|
1701
1701
|
{
|
|
1702
1702
|
className: k(
|
|
1703
1703
|
"truncate text-xs leading-4",
|
|
1704
|
-
|
|
1704
|
+
ar[e]
|
|
1705
1705
|
),
|
|
1706
1706
|
children: u
|
|
1707
1707
|
}
|
|
@@ -1721,7 +1721,7 @@ const ir = {
|
|
|
1721
1721
|
h
|
|
1722
1722
|
]
|
|
1723
1723
|
}
|
|
1724
|
-
) : /* @__PURE__ */ m(
|
|
1724
|
+
) : /* @__PURE__ */ m(te, { children: [
|
|
1725
1725
|
p,
|
|
1726
1726
|
h
|
|
1727
1727
|
] });
|
|
@@ -1730,7 +1730,7 @@ const ir = {
|
|
|
1730
1730
|
o ? /* @__PURE__ */ s("div", { className: "shrink-0", children: o }) : null
|
|
1731
1731
|
] });
|
|
1732
1732
|
};
|
|
1733
|
-
async function
|
|
1733
|
+
async function ys(e, t) {
|
|
1734
1734
|
const n = t ?? re(e);
|
|
1735
1735
|
try {
|
|
1736
1736
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -1744,14 +1744,14 @@ async function ks(e, t) {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
|
-
const
|
|
1747
|
+
const lr = ({
|
|
1748
1748
|
src: e,
|
|
1749
1749
|
filename: t,
|
|
1750
1750
|
fileSize: n,
|
|
1751
1751
|
mimeType: a,
|
|
1752
1752
|
title: r,
|
|
1753
1753
|
items: i
|
|
1754
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [],
|
|
1754
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], or = ({
|
|
1755
1755
|
variant: e,
|
|
1756
1756
|
item: t,
|
|
1757
1757
|
index: n,
|
|
@@ -1760,7 +1760,7 @@ const cr = ({
|
|
|
1760
1760
|
}) => {
|
|
1761
1761
|
const i = t.filename ?? re(t.src);
|
|
1762
1762
|
return /* @__PURE__ */ s(
|
|
1763
|
-
|
|
1763
|
+
Ns,
|
|
1764
1764
|
{
|
|
1765
1765
|
variant: e,
|
|
1766
1766
|
filename: i,
|
|
@@ -1772,7 +1772,7 @@ const cr = ({
|
|
|
1772
1772
|
trailingAction: r
|
|
1773
1773
|
}
|
|
1774
1774
|
);
|
|
1775
|
-
},
|
|
1775
|
+
}, gt = ({
|
|
1776
1776
|
state: e,
|
|
1777
1777
|
src: t,
|
|
1778
1778
|
filename: n,
|
|
@@ -1785,7 +1785,7 @@ const cr = ({
|
|
|
1785
1785
|
onClick: u,
|
|
1786
1786
|
onDismiss: p
|
|
1787
1787
|
}) => {
|
|
1788
|
-
const h = Me(e), g = e === "composer" && !!p, c =
|
|
1788
|
+
const h = Me(e), g = e === "composer" && !!p, c = lr({
|
|
1789
1789
|
src: t,
|
|
1790
1790
|
filename: n,
|
|
1791
1791
|
fileSize: a,
|
|
@@ -1797,7 +1797,7 @@ const cr = ({
|
|
|
1797
1797
|
const f = c[b];
|
|
1798
1798
|
if (!f) return;
|
|
1799
1799
|
const x = f.filename ?? re(f.src);
|
|
1800
|
-
|
|
1800
|
+
ys(f.src, x);
|
|
1801
1801
|
};
|
|
1802
1802
|
if (c.length === 0)
|
|
1803
1803
|
return null;
|
|
@@ -1809,7 +1809,7 @@ const cr = ({
|
|
|
1809
1809
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1810
1810
|
),
|
|
1811
1811
|
"aria-hidden": !0,
|
|
1812
|
-
children: /* @__PURE__ */ s(
|
|
1812
|
+
children: /* @__PURE__ */ s(Ce, { className: "size-5", weight: "bold" })
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
return /* @__PURE__ */ s(
|
|
@@ -1820,7 +1820,7 @@ const cr = ({
|
|
|
1820
1820
|
groupPosition: d,
|
|
1821
1821
|
"data-testid": "file-attachment",
|
|
1822
1822
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((b, f) => /* @__PURE__ */ s(
|
|
1823
|
-
|
|
1823
|
+
or,
|
|
1824
1824
|
{
|
|
1825
1825
|
variant: h,
|
|
1826
1826
|
item: b,
|
|
@@ -1832,16 +1832,16 @@ const cr = ({
|
|
|
1832
1832
|
)) })
|
|
1833
1833
|
}
|
|
1834
1834
|
);
|
|
1835
|
-
},
|
|
1836
|
-
Composer:
|
|
1837
|
-
Sent:
|
|
1838
|
-
Received:
|
|
1839
|
-
},
|
|
1835
|
+
}, cr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "composer" }), dr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "sent" }), ur = (e) => /* @__PURE__ */ s(gt, { ...e, state: "received" }), mr = {
|
|
1836
|
+
Composer: cr,
|
|
1837
|
+
Sent: dr,
|
|
1838
|
+
Received: ur
|
|
1839
|
+
}, pt = ({
|
|
1840
1840
|
onPrev: e,
|
|
1841
1841
|
onNext: t,
|
|
1842
1842
|
prevLabel: n = "Previous",
|
|
1843
1843
|
nextLabel: a = "Next"
|
|
1844
|
-
}) => /* @__PURE__ */ m(
|
|
1844
|
+
}) => /* @__PURE__ */ m(te, { children: [
|
|
1845
1845
|
/* @__PURE__ */ s(
|
|
1846
1846
|
"button",
|
|
1847
1847
|
{
|
|
@@ -1849,7 +1849,7 @@ const cr = ({
|
|
|
1849
1849
|
onClick: e,
|
|
1850
1850
|
"aria-label": n,
|
|
1851
1851
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1852
|
-
children: /* @__PURE__ */ s(
|
|
1852
|
+
children: /* @__PURE__ */ s(Gn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1853
1853
|
}
|
|
1854
1854
|
),
|
|
1855
1855
|
/* @__PURE__ */ s(
|
|
@@ -1862,7 +1862,7 @@ const cr = ({
|
|
|
1862
1862
|
children: /* @__PURE__ */ s(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1863
1863
|
}
|
|
1864
1864
|
)
|
|
1865
|
-
] }),
|
|
1865
|
+
] }), ks = ({
|
|
1866
1866
|
url: e,
|
|
1867
1867
|
filename: t,
|
|
1868
1868
|
variant: n = "pill",
|
|
@@ -1873,7 +1873,7 @@ const cr = ({
|
|
|
1873
1873
|
}) => {
|
|
1874
1874
|
const [o, d] = B(!1), u = J(
|
|
1875
1875
|
(c) => {
|
|
1876
|
-
c.stopPropagation(), !o && (d(!0),
|
|
1876
|
+
c.stopPropagation(), !o && (d(!0), ys(e, t).catch(() => {
|
|
1877
1877
|
}).finally(() => {
|
|
1878
1878
|
d(!1), l == null || l();
|
|
1879
1879
|
}));
|
|
@@ -1898,14 +1898,14 @@ const cr = ({
|
|
|
1898
1898
|
}[i]
|
|
1899
1899
|
),
|
|
1900
1900
|
children: o ? /* @__PURE__ */ s(
|
|
1901
|
-
|
|
1901
|
+
ke,
|
|
1902
1902
|
{
|
|
1903
1903
|
className: "size-4 animate-spin",
|
|
1904
1904
|
weight: "bold",
|
|
1905
1905
|
"aria-hidden": !0
|
|
1906
1906
|
}
|
|
1907
1907
|
) : /* @__PURE__ */ s(
|
|
1908
|
-
|
|
1908
|
+
Ce,
|
|
1909
1909
|
{
|
|
1910
1910
|
className: "size-5 shrink-0",
|
|
1911
1911
|
weight: "bold",
|
|
@@ -1921,7 +1921,7 @@ const cr = ({
|
|
|
1921
1921
|
disabled: o,
|
|
1922
1922
|
"aria-label": a,
|
|
1923
1923
|
className: "mes-media-viewer__action",
|
|
1924
|
-
children: o ? /* @__PURE__ */ s(
|
|
1924
|
+
children: o ? /* @__PURE__ */ s(ke, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Ce, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1925
1925
|
}
|
|
1926
1926
|
) : /* @__PURE__ */ m(
|
|
1927
1927
|
"button",
|
|
@@ -1936,18 +1936,18 @@ const cr = ({
|
|
|
1936
1936
|
),
|
|
1937
1937
|
children: [
|
|
1938
1938
|
o ? /* @__PURE__ */ s(
|
|
1939
|
-
|
|
1939
|
+
ke,
|
|
1940
1940
|
{
|
|
1941
1941
|
className: "size-4 animate-spin",
|
|
1942
1942
|
weight: "bold",
|
|
1943
1943
|
"aria-hidden": !0
|
|
1944
1944
|
}
|
|
1945
|
-
) : /* @__PURE__ */ s(
|
|
1945
|
+
) : /* @__PURE__ */ s(Ce, { ...g, "aria-hidden": !0 }),
|
|
1946
1946
|
p ? null : a
|
|
1947
1947
|
]
|
|
1948
1948
|
}
|
|
1949
1949
|
);
|
|
1950
|
-
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n),
|
|
1950
|
+
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n), bt = ({
|
|
1951
1951
|
length: e,
|
|
1952
1952
|
initialIndex: t,
|
|
1953
1953
|
open: n
|
|
@@ -1972,7 +1972,7 @@ const cr = ({
|
|
|
1972
1972
|
};
|
|
1973
1973
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
1974
1974
|
}, [n, e, l, o]), { index: r, prev: l, next: o };
|
|
1975
|
-
},
|
|
1975
|
+
}, vt = ({
|
|
1976
1976
|
open: e,
|
|
1977
1977
|
onClose: t,
|
|
1978
1978
|
ariaLabel: n,
|
|
@@ -2062,29 +2062,29 @@ const cr = ({
|
|
|
2062
2062
|
]
|
|
2063
2063
|
}
|
|
2064
2064
|
);
|
|
2065
|
-
},
|
|
2065
|
+
}, Cs = ({
|
|
2066
2066
|
open: e,
|
|
2067
2067
|
items: t,
|
|
2068
2068
|
initialIndex: n = 0,
|
|
2069
2069
|
onClose: a
|
|
2070
2070
|
}) => {
|
|
2071
|
-
const { index: r, prev: i, next: l } =
|
|
2071
|
+
const { index: r, prev: i, next: l } = bt({
|
|
2072
2072
|
length: t.length,
|
|
2073
2073
|
initialIndex: n,
|
|
2074
2074
|
open: e
|
|
2075
|
-
}), o = t[r], d =
|
|
2075
|
+
}), o = t[r], d = ae(
|
|
2076
2076
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "image"),
|
|
2077
2077
|
[o]
|
|
2078
2078
|
);
|
|
2079
2079
|
return o ? /* @__PURE__ */ m(
|
|
2080
|
-
|
|
2080
|
+
vt,
|
|
2081
2081
|
{
|
|
2082
2082
|
open: e,
|
|
2083
2083
|
onClose: a,
|
|
2084
2084
|
ariaLabel: d,
|
|
2085
2085
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
2086
2086
|
actions: /* @__PURE__ */ s(
|
|
2087
|
-
|
|
2087
|
+
ks,
|
|
2088
2088
|
{
|
|
2089
2089
|
url: o.src,
|
|
2090
2090
|
filename: d,
|
|
@@ -2107,7 +2107,7 @@ const cr = ({
|
|
|
2107
2107
|
`${r}:${o.src}`
|
|
2108
2108
|
),
|
|
2109
2109
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2110
|
-
|
|
2110
|
+
pt,
|
|
2111
2111
|
{
|
|
2112
2112
|
onPrev: i,
|
|
2113
2113
|
onNext: l,
|
|
@@ -2118,7 +2118,7 @@ const cr = ({
|
|
|
2118
2118
|
]
|
|
2119
2119
|
}
|
|
2120
2120
|
) : null;
|
|
2121
|
-
},
|
|
2121
|
+
}, hr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", Es = ({
|
|
2122
2122
|
tiles: e,
|
|
2123
2123
|
onTileActivate: t,
|
|
2124
2124
|
maxVisible: n = 4,
|
|
@@ -2127,7 +2127,7 @@ const cr = ({
|
|
|
2127
2127
|
const r = e.length;
|
|
2128
2128
|
if (r === 0) return null;
|
|
2129
2129
|
const i = e.slice(0, Math.min(r, n)), l = r - i.length, o = (d, u, p) => {
|
|
2130
|
-
const h = k(
|
|
2130
|
+
const h = k(hr, "h-full w-full");
|
|
2131
2131
|
return t ? /* @__PURE__ */ m(
|
|
2132
2132
|
"button",
|
|
2133
2133
|
{
|
|
@@ -2196,7 +2196,7 @@ const cr = ({
|
|
|
2196
2196
|
[e]
|
|
2197
2197
|
), l = J(() => n(!1), []);
|
|
2198
2198
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
2199
|
-
},
|
|
2199
|
+
}, fr = (e, t, n, a) => ({
|
|
2200
2200
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
2201
2201
|
content: /* @__PURE__ */ s(
|
|
2202
2202
|
"img",
|
|
@@ -2211,15 +2211,15 @@ const cr = ({
|
|
|
2211
2211
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2212
2212
|
}
|
|
2213
2213
|
)
|
|
2214
|
-
}),
|
|
2214
|
+
}), gr = ({
|
|
2215
2215
|
src: e,
|
|
2216
2216
|
alt: t,
|
|
2217
2217
|
items: n
|
|
2218
|
-
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [],
|
|
2218
|
+
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Ss = (e, t) => e.map((n, a) => ({
|
|
2219
2219
|
src: n.src,
|
|
2220
2220
|
alt: n.alt,
|
|
2221
2221
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2222
|
-
})),
|
|
2222
|
+
})), pr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2223
2223
|
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: u } = Re(
|
|
2224
2224
|
r
|
|
2225
2225
|
);
|
|
@@ -2246,16 +2246,16 @@ const cr = ({
|
|
|
2246
2246
|
),
|
|
2247
2247
|
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
|
|
2248
2248
|
/* @__PURE__ */ s(
|
|
2249
|
-
|
|
2249
|
+
Cs,
|
|
2250
2250
|
{
|
|
2251
2251
|
open: l,
|
|
2252
|
-
items:
|
|
2252
|
+
items: Ss([{ src: e, alt: t }], n),
|
|
2253
2253
|
initialIndex: o,
|
|
2254
2254
|
onClose: u
|
|
2255
2255
|
}
|
|
2256
2256
|
)
|
|
2257
2257
|
] });
|
|
2258
|
-
},
|
|
2258
|
+
}, Is = ({
|
|
2259
2259
|
state: e,
|
|
2260
2260
|
src: t,
|
|
2261
2261
|
alt: n,
|
|
@@ -2266,13 +2266,13 @@ const cr = ({
|
|
|
2266
2266
|
loading: o = "lazy",
|
|
2267
2267
|
onClick: d
|
|
2268
2268
|
}) => {
|
|
2269
|
-
const u =
|
|
2269
|
+
const u = gr({ src: t, alt: n, items: r }), p = Me(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: v } = Re(
|
|
2270
2270
|
d
|
|
2271
2271
|
);
|
|
2272
2272
|
if (u.length === 0)
|
|
2273
2273
|
return null;
|
|
2274
2274
|
const w = u.map(
|
|
2275
|
-
(b, f) =>
|
|
2275
|
+
(b, f) => fr(b, f, u.length, o)
|
|
2276
2276
|
);
|
|
2277
2277
|
return /* @__PURE__ */ m(
|
|
2278
2278
|
Te,
|
|
@@ -2284,10 +2284,10 @@ const cr = ({
|
|
|
2284
2284
|
children: [
|
|
2285
2285
|
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Es, { tiles: w, onTileActivate: c }) }),
|
|
2286
2286
|
/* @__PURE__ */ s(
|
|
2287
|
-
|
|
2287
|
+
Cs,
|
|
2288
2288
|
{
|
|
2289
2289
|
open: h,
|
|
2290
|
-
items:
|
|
2290
|
+
items: Ss(u, a),
|
|
2291
2291
|
initialIndex: g,
|
|
2292
2292
|
onClose: v
|
|
2293
2293
|
}
|
|
@@ -2295,29 +2295,29 @@ const cr = ({
|
|
|
2295
2295
|
]
|
|
2296
2296
|
}
|
|
2297
2297
|
);
|
|
2298
|
-
},
|
|
2299
|
-
Composer:
|
|
2300
|
-
Sent:
|
|
2301
|
-
Received:
|
|
2302
|
-
},
|
|
2298
|
+
}, br = (e) => /* @__PURE__ */ s(pr, { ...e }), vr = (e) => /* @__PURE__ */ s(Is, { ...e, state: "sent" }), xr = (e) => /* @__PURE__ */ s(Is, { ...e, state: "received" }), wr = {
|
|
2299
|
+
Composer: br,
|
|
2300
|
+
Sent: vr,
|
|
2301
|
+
Received: xr
|
|
2302
|
+
}, _r = ({
|
|
2303
2303
|
open: e,
|
|
2304
2304
|
items: t,
|
|
2305
2305
|
initialIndex: n = 0,
|
|
2306
2306
|
onClose: a
|
|
2307
2307
|
}) => {
|
|
2308
|
-
const { index: r, prev: i, next: l } =
|
|
2308
|
+
const { index: r, prev: i, next: l } = bt({
|
|
2309
2309
|
length: t.length,
|
|
2310
2310
|
initialIndex: n,
|
|
2311
2311
|
open: e
|
|
2312
|
-
}), o = t[r], d =
|
|
2312
|
+
}), o = t[r], d = ae(
|
|
2313
2313
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "document"),
|
|
2314
2314
|
[o]
|
|
2315
|
-
), u =
|
|
2316
|
-
() => o ?
|
|
2315
|
+
), u = ae(
|
|
2316
|
+
() => o ? Nr(o.src) : void 0,
|
|
2317
2317
|
[o]
|
|
2318
2318
|
);
|
|
2319
2319
|
return !o || !u ? null : /* @__PURE__ */ m(
|
|
2320
|
-
|
|
2320
|
+
vt,
|
|
2321
2321
|
{
|
|
2322
2322
|
open: e,
|
|
2323
2323
|
onClose: a,
|
|
@@ -2336,7 +2336,7 @@ const cr = ({
|
|
|
2336
2336
|
`${r}:${o.src}`
|
|
2337
2337
|
),
|
|
2338
2338
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2339
|
-
|
|
2339
|
+
pt,
|
|
2340
2340
|
{
|
|
2341
2341
|
onPrev: i,
|
|
2342
2342
|
onNext: l,
|
|
@@ -2347,16 +2347,16 @@ const cr = ({
|
|
|
2347
2347
|
]
|
|
2348
2348
|
}
|
|
2349
2349
|
);
|
|
2350
|
-
},
|
|
2350
|
+
}, Nr = (e) => {
|
|
2351
2351
|
const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2352
2352
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
|
|
2353
|
-
},
|
|
2353
|
+
}, yr = ({
|
|
2354
2354
|
src: e,
|
|
2355
2355
|
filename: t,
|
|
2356
2356
|
fileSize: n,
|
|
2357
2357
|
title: a,
|
|
2358
2358
|
items: r
|
|
2359
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [],
|
|
2359
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], kr = ({
|
|
2360
2360
|
variant: e,
|
|
2361
2361
|
item: t,
|
|
2362
2362
|
index: n,
|
|
@@ -2365,7 +2365,7 @@ const cr = ({
|
|
|
2365
2365
|
}) => {
|
|
2366
2366
|
const i = t.filename ?? re(t.src);
|
|
2367
2367
|
return /* @__PURE__ */ s(
|
|
2368
|
-
|
|
2368
|
+
Ns,
|
|
2369
2369
|
{
|
|
2370
2370
|
variant: e,
|
|
2371
2371
|
filename: i,
|
|
@@ -2377,7 +2377,7 @@ const cr = ({
|
|
|
2377
2377
|
trailingAction: r
|
|
2378
2378
|
}
|
|
2379
2379
|
);
|
|
2380
|
-
},
|
|
2380
|
+
}, xt = ({
|
|
2381
2381
|
state: e,
|
|
2382
2382
|
src: t,
|
|
2383
2383
|
filename: n,
|
|
@@ -2389,7 +2389,7 @@ const cr = ({
|
|
|
2389
2389
|
onClick: d,
|
|
2390
2390
|
onDismiss: u
|
|
2391
2391
|
}) => {
|
|
2392
|
-
const p = Me(e), h =
|
|
2392
|
+
const p = Me(e), h = yr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2393
2393
|
d
|
|
2394
2394
|
), b = e === "composer" && !!u;
|
|
2395
2395
|
if (h.length === 0)
|
|
@@ -2407,18 +2407,18 @@ const cr = ({
|
|
|
2407
2407
|
"data-testid": "pdf-attachment",
|
|
2408
2408
|
children: [
|
|
2409
2409
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((x, N) => {
|
|
2410
|
-
const
|
|
2411
|
-
|
|
2410
|
+
const E = x.filename ?? re(x.src), T = b && N === 0 ? /* @__PURE__ */ s(Ae, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2411
|
+
ks,
|
|
2412
2412
|
{
|
|
2413
2413
|
url: x.src,
|
|
2414
|
-
filename:
|
|
2414
|
+
filename: E,
|
|
2415
2415
|
variant: "inline",
|
|
2416
|
-
label: `Download ${
|
|
2416
|
+
label: `Download ${E}`,
|
|
2417
2417
|
tone: p
|
|
2418
2418
|
}
|
|
2419
2419
|
);
|
|
2420
2420
|
return /* @__PURE__ */ s(
|
|
2421
|
-
|
|
2421
|
+
kr,
|
|
2422
2422
|
{
|
|
2423
2423
|
variant: p,
|
|
2424
2424
|
item: x,
|
|
@@ -2430,7 +2430,7 @@ const cr = ({
|
|
|
2430
2430
|
);
|
|
2431
2431
|
}) }),
|
|
2432
2432
|
/* @__PURE__ */ s(
|
|
2433
|
-
|
|
2433
|
+
_r,
|
|
2434
2434
|
{
|
|
2435
2435
|
open: g,
|
|
2436
2436
|
items: f,
|
|
@@ -2441,26 +2441,26 @@ const cr = ({
|
|
|
2441
2441
|
]
|
|
2442
2442
|
}
|
|
2443
2443
|
);
|
|
2444
|
-
},
|
|
2445
|
-
Composer:
|
|
2446
|
-
Sent:
|
|
2447
|
-
Received:
|
|
2448
|
-
},
|
|
2444
|
+
}, Cr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "composer" }), Er = (e) => /* @__PURE__ */ s(xt, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "received" }), Ir = {
|
|
2445
|
+
Composer: Cr,
|
|
2446
|
+
Sent: Er,
|
|
2447
|
+
Received: Sr
|
|
2448
|
+
}, Ts = ({
|
|
2449
2449
|
open: e,
|
|
2450
2450
|
items: t,
|
|
2451
2451
|
initialIndex: n = 0,
|
|
2452
2452
|
onClose: a
|
|
2453
2453
|
}) => {
|
|
2454
|
-
const { index: r, prev: i, next: l } =
|
|
2454
|
+
const { index: r, prev: i, next: l } = bt({
|
|
2455
2455
|
length: t.length,
|
|
2456
2456
|
initialIndex: n,
|
|
2457
2457
|
open: e
|
|
2458
|
-
}), o = t[r], d =
|
|
2458
|
+
}), o = t[r], d = ae(
|
|
2459
2459
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "video"),
|
|
2460
2460
|
[o]
|
|
2461
2461
|
);
|
|
2462
2462
|
return o ? /* @__PURE__ */ m(
|
|
2463
|
-
|
|
2463
|
+
vt,
|
|
2464
2464
|
{
|
|
2465
2465
|
open: e,
|
|
2466
2466
|
onClose: a,
|
|
@@ -2484,7 +2484,7 @@ const cr = ({
|
|
|
2484
2484
|
`${r}:${o.src}`
|
|
2485
2485
|
),
|
|
2486
2486
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2487
|
-
|
|
2487
|
+
pt,
|
|
2488
2488
|
{
|
|
2489
2489
|
onPrev: i,
|
|
2490
2490
|
onNext: l,
|
|
@@ -2495,7 +2495,7 @@ const cr = ({
|
|
|
2495
2495
|
]
|
|
2496
2496
|
}
|
|
2497
2497
|
) : null;
|
|
2498
|
-
},
|
|
2498
|
+
}, Tr = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(et, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), As = ({
|
|
2499
2499
|
item: e,
|
|
2500
2500
|
index: t
|
|
2501
2501
|
}) => /* @__PURE__ */ m("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2510,30 +2510,30 @@ const cr = ({
|
|
|
2510
2510
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2511
2511
|
}
|
|
2512
2512
|
) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
2513
|
-
|
|
2513
|
+
os,
|
|
2514
2514
|
{
|
|
2515
2515
|
className: "size-16 rounded-md text-white/30",
|
|
2516
2516
|
weight: "regular",
|
|
2517
2517
|
"aria-hidden": !0
|
|
2518
2518
|
}
|
|
2519
2519
|
) }),
|
|
2520
|
-
/* @__PURE__ */ s(
|
|
2521
|
-
] }),
|
|
2520
|
+
/* @__PURE__ */ s(Tr, {})
|
|
2521
|
+
] }), Ar = (e, t, n) => ({
|
|
2522
2522
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2523
|
-
content: /* @__PURE__ */ s(
|
|
2524
|
-
}),
|
|
2523
|
+
content: /* @__PURE__ */ s(As, { item: e, index: t })
|
|
2524
|
+
}), Mr = ({
|
|
2525
2525
|
src: e,
|
|
2526
2526
|
poster: t,
|
|
2527
2527
|
mimeType: n,
|
|
2528
2528
|
preload: a,
|
|
2529
2529
|
items: r
|
|
2530
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [],
|
|
2530
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Ms = (e, t) => e.map((n, a) => ({
|
|
2531
2531
|
src: n.src,
|
|
2532
2532
|
poster: n.poster,
|
|
2533
2533
|
mimeType: n.mimeType,
|
|
2534
2534
|
preload: n.preload,
|
|
2535
2535
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2536
|
-
})),
|
|
2536
|
+
})), Rr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
2537
2537
|
const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer: p } = Re(
|
|
2538
2538
|
i
|
|
2539
2539
|
);
|
|
@@ -2545,15 +2545,15 @@ const cr = ({
|
|
|
2545
2545
|
onClick: () => u(0),
|
|
2546
2546
|
"aria-label": "Play video",
|
|
2547
2547
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2548
|
-
children: /* @__PURE__ */ s(
|
|
2548
|
+
children: /* @__PURE__ */ s(As, { item: { src: e, poster: t, mimeType: n }, index: 0 })
|
|
2549
2549
|
}
|
|
2550
2550
|
),
|
|
2551
2551
|
l ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: l }) }) : null,
|
|
2552
2552
|
/* @__PURE__ */ s(
|
|
2553
|
-
|
|
2553
|
+
Ts,
|
|
2554
2554
|
{
|
|
2555
2555
|
open: o,
|
|
2556
|
-
items:
|
|
2556
|
+
items: Ms(
|
|
2557
2557
|
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2558
2558
|
a
|
|
2559
2559
|
),
|
|
@@ -2562,7 +2562,7 @@ const cr = ({
|
|
|
2562
2562
|
}
|
|
2563
2563
|
)
|
|
2564
2564
|
] });
|
|
2565
|
-
},
|
|
2565
|
+
}, Rs = ({
|
|
2566
2566
|
state: e,
|
|
2567
2567
|
src: t,
|
|
2568
2568
|
poster: n,
|
|
@@ -2574,13 +2574,13 @@ const cr = ({
|
|
|
2574
2574
|
preload: d,
|
|
2575
2575
|
onClick: u
|
|
2576
2576
|
}) => {
|
|
2577
|
-
const p =
|
|
2577
|
+
const p = Mr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Me(e), { viewerOpen: g, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2578
2578
|
u
|
|
2579
2579
|
);
|
|
2580
2580
|
if (p.length === 0)
|
|
2581
2581
|
return null;
|
|
2582
2582
|
const b = p.map(
|
|
2583
|
-
(f, x) =>
|
|
2583
|
+
(f, x) => Ar(f, x, p.length)
|
|
2584
2584
|
);
|
|
2585
2585
|
return /* @__PURE__ */ m(
|
|
2586
2586
|
Te,
|
|
@@ -2599,10 +2599,10 @@ const cr = ({
|
|
|
2599
2599
|
}
|
|
2600
2600
|
) }),
|
|
2601
2601
|
/* @__PURE__ */ s(
|
|
2602
|
-
|
|
2602
|
+
Ts,
|
|
2603
2603
|
{
|
|
2604
2604
|
open: g,
|
|
2605
|
-
items:
|
|
2605
|
+
items: Ms(p, r),
|
|
2606
2606
|
initialIndex: c,
|
|
2607
2607
|
onClose: w
|
|
2608
2608
|
}
|
|
@@ -2610,25 +2610,38 @@ const cr = ({
|
|
|
2610
2610
|
]
|
|
2611
2611
|
}
|
|
2612
2612
|
);
|
|
2613
|
-
},
|
|
2614
|
-
Composer:
|
|
2615
|
-
Sent:
|
|
2616
|
-
Received:
|
|
2617
|
-
},
|
|
2618
|
-
Image:
|
|
2619
|
-
Video:
|
|
2620
|
-
Audio:
|
|
2621
|
-
Pdf:
|
|
2622
|
-
File:
|
|
2623
|
-
},
|
|
2613
|
+
}, Lr = (e) => /* @__PURE__ */ s(Rr, { ...e }), Dr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "sent" }), zr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "received" }), Pr = {
|
|
2614
|
+
Composer: Lr,
|
|
2615
|
+
Sent: Dr,
|
|
2616
|
+
Received: zr
|
|
2617
|
+
}, Ne = {
|
|
2618
|
+
Image: wr,
|
|
2619
|
+
Video: Pr,
|
|
2620
|
+
Audio: Qa,
|
|
2621
|
+
Pdf: Ir,
|
|
2622
|
+
File: mr
|
|
2623
|
+
}, Fr = {
|
|
2624
2624
|
isUnlocking: () => !1
|
|
2625
|
-
},
|
|
2626
|
-
LockedAttachment:
|
|
2627
|
-
}, Ls =
|
|
2628
|
-
function
|
|
2629
|
-
return
|
|
2625
|
+
}, Or = {
|
|
2626
|
+
LockedAttachment: Fr
|
|
2627
|
+
}, Ls = at({}), cl = Ls.Provider;
|
|
2628
|
+
function $r(e) {
|
|
2629
|
+
return Se(Ls)[e] ?? Or[e];
|
|
2630
2630
|
}
|
|
2631
|
-
const
|
|
2631
|
+
const jr = ({
|
|
2632
|
+
message: e,
|
|
2633
|
+
endOfGroup: t
|
|
2634
|
+
}) => !t || e.type === "error" || e.status !== "received" ? null : /* @__PURE__ */ m(
|
|
2635
|
+
"div",
|
|
2636
|
+
{
|
|
2637
|
+
className: "str-chat__message-delivery-status",
|
|
2638
|
+
"data-testid": "message-delivery-status",
|
|
2639
|
+
children: [
|
|
2640
|
+
/* @__PURE__ */ s(Hn, { size: 14, weight: "bold", "aria-hidden": "true" }),
|
|
2641
|
+
/* @__PURE__ */ s("span", { children: "Delivered" })
|
|
2642
|
+
]
|
|
2643
|
+
}
|
|
2644
|
+
), Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2632
2645
|
"svg",
|
|
2633
2646
|
{
|
|
2634
2647
|
width: e,
|
|
@@ -2645,21 +2658,21 @@ const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2645
2658
|
}
|
|
2646
2659
|
)
|
|
2647
2660
|
}
|
|
2648
|
-
),
|
|
2661
|
+
), Ur = (e) => {
|
|
2649
2662
|
var t;
|
|
2650
2663
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2651
|
-
},
|
|
2664
|
+
}, Vr = (e) => {
|
|
2652
2665
|
var t;
|
|
2653
2666
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2654
2667
|
}, Fe = (e) => {
|
|
2655
2668
|
var t;
|
|
2656
2669
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2657
|
-
},
|
|
2670
|
+
}, Gr = (e) => {
|
|
2658
2671
|
var t;
|
|
2659
2672
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2660
|
-
},
|
|
2673
|
+
}, Ds = (e) => Ur(e) || Vr(e), Hr = (e) => {
|
|
2661
2674
|
var t;
|
|
2662
|
-
return
|
|
2675
|
+
return Ds(e) && !((t = e.text) != null && t.trim());
|
|
2663
2676
|
}, Ke = ({
|
|
2664
2677
|
message: e,
|
|
2665
2678
|
standalone: t = !1,
|
|
@@ -2667,7 +2680,7 @@ const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2667
2680
|
hasAttachment: a = !1
|
|
2668
2681
|
}) => {
|
|
2669
2682
|
var h;
|
|
2670
|
-
const r =
|
|
2683
|
+
const r = Ds(e), i = Fe(e);
|
|
2671
2684
|
if (!r && !i)
|
|
2672
2685
|
return null;
|
|
2673
2686
|
if (r) {
|
|
@@ -2675,7 +2688,7 @@ const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2675
2688
|
if (!g) return null;
|
|
2676
2689
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${g} tip` : `Delivered with ${g} tip`;
|
|
2677
2690
|
return /* @__PURE__ */ m("div", { className: c, children: [
|
|
2678
|
-
/* @__PURE__ */ s(
|
|
2691
|
+
/* @__PURE__ */ s(Yn, { size: t ? 14 : 12 }),
|
|
2679
2692
|
/* @__PURE__ */ s("span", { children: v })
|
|
2680
2693
|
] });
|
|
2681
2694
|
}
|
|
@@ -2683,15 +2696,15 @@ const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2683
2696
|
"message-chatbot-indicator",
|
|
2684
2697
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2685
2698
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2686
|
-
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(
|
|
2687
|
-
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ m(
|
|
2699
|
+
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(Br, { size: l ? 12 : 15 }) });
|
|
2700
|
+
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ m(te, { children: [
|
|
2688
2701
|
u,
|
|
2689
2702
|
p
|
|
2690
|
-
] }) : /* @__PURE__ */ m(
|
|
2703
|
+
] }) : /* @__PURE__ */ m(te, { children: [
|
|
2691
2704
|
p,
|
|
2692
2705
|
u
|
|
2693
2706
|
] }) });
|
|
2694
|
-
},
|
|
2707
|
+
}, Yr = ({
|
|
2695
2708
|
selected: e,
|
|
2696
2709
|
onVoteUp: t,
|
|
2697
2710
|
onVoteDown: n
|
|
@@ -2707,7 +2720,7 @@ const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2707
2720
|
"aria-label": "Good response",
|
|
2708
2721
|
"aria-pressed": e === "up",
|
|
2709
2722
|
"data-tooltip": "Good response",
|
|
2710
|
-
children: /* @__PURE__ */ s(
|
|
2723
|
+
children: /* @__PURE__ */ s(qn, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2711
2724
|
}
|
|
2712
2725
|
),
|
|
2713
2726
|
/* @__PURE__ */ s(
|
|
@@ -2721,50 +2734,29 @@ const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2721
2734
|
"aria-label": "Bad response",
|
|
2722
2735
|
"aria-pressed": e === "down",
|
|
2723
2736
|
"data-tooltip": "Bad response",
|
|
2724
|
-
children: /* @__PURE__ */ s(
|
|
2737
|
+
children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2725
2738
|
}
|
|
2726
2739
|
)
|
|
2727
|
-
] }),
|
|
2728
|
-
|
|
2729
|
-
const { message: e } = _e("SentMessageDeliveryStatus"), { messages: t } = le("SentMessageDeliveryStatus"), { client: n } = oe("SentMessageDeliveryStatus"), a = (i = n.user) == null ? void 0 : i.id, r = se(() => {
|
|
2730
|
-
var l;
|
|
2731
|
-
if (!(!a || !t)) {
|
|
2732
|
-
for (let o = t.length - 1; o >= 0; o -= 1)
|
|
2733
|
-
if (((l = t[o].user) == null ? void 0 : l.id) === a) return t[o].id;
|
|
2734
|
-
}
|
|
2735
|
-
}, [t, a]);
|
|
2736
|
-
return e.id !== r ? null : /* @__PURE__ */ m(ee, { children: [
|
|
2737
|
-
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2738
|
-
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2739
|
-
] });
|
|
2740
|
-
}, Wr = () => null, Xr = () => /* @__PURE__ */ s(
|
|
2741
|
-
Xs,
|
|
2742
|
-
{
|
|
2743
|
-
MessageSentStatus: Je,
|
|
2744
|
-
MessageDeliveredStatus: Je,
|
|
2745
|
-
MessageReadStatus: Je,
|
|
2746
|
-
MessageSendingStatus: Wr
|
|
2747
|
-
}
|
|
2748
|
-
), Kr = /^([a-z][a-z0-9+.-]*):/i, Jr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2749
|
-
function _t(e) {
|
|
2740
|
+
] }), qr = /^([a-z][a-z0-9+.-]*):/i, Wr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2741
|
+
function wt(e) {
|
|
2750
2742
|
if (typeof e != "string") return;
|
|
2751
2743
|
const t = e.trim();
|
|
2752
2744
|
if (t === "") return;
|
|
2753
|
-
const n =
|
|
2745
|
+
const n = qr.exec(t);
|
|
2754
2746
|
if (n) {
|
|
2755
2747
|
const a = n[1].toLowerCase();
|
|
2756
|
-
return
|
|
2748
|
+
return Wr.has(a) ? t : void 0;
|
|
2757
2749
|
}
|
|
2758
2750
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2759
2751
|
}
|
|
2760
|
-
const
|
|
2752
|
+
const Xr = {
|
|
2761
2753
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2762
2754
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2763
|
-
},
|
|
2755
|
+
}, Kr = ({ variant: e, cta: t }) => {
|
|
2764
2756
|
const n = k(
|
|
2765
2757
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2766
|
-
|
|
2767
|
-
), a =
|
|
2758
|
+
Xr[e]
|
|
2759
|
+
), a = wt(t.href);
|
|
2768
2760
|
return a ? /* @__PURE__ */ s(
|
|
2769
2761
|
"a",
|
|
2770
2762
|
{
|
|
@@ -2790,13 +2782,13 @@ const Zr = {
|
|
|
2790
2782
|
children: t.label
|
|
2791
2783
|
}
|
|
2792
2784
|
);
|
|
2793
|
-
},
|
|
2785
|
+
}, Jr = {
|
|
2794
2786
|
dark: "text-white",
|
|
2795
2787
|
light: "text-black/90"
|
|
2796
|
-
},
|
|
2788
|
+
}, Zr = "text-white/30", Qr = {
|
|
2797
2789
|
dark: "text-white/55",
|
|
2798
2790
|
light: "text-black/55"
|
|
2799
|
-
},
|
|
2791
|
+
}, _t = ({
|
|
2800
2792
|
variant: e,
|
|
2801
2793
|
title: t,
|
|
2802
2794
|
placeholderTitle: n,
|
|
@@ -2810,10 +2802,10 @@ const Zr = {
|
|
|
2810
2802
|
if (!p && !h && !c && !v) return null;
|
|
2811
2803
|
const b = k(
|
|
2812
2804
|
"truncate text-base font-medium leading-6",
|
|
2813
|
-
d && !t ?
|
|
2805
|
+
d && !t ? Zr : Jr[e]
|
|
2814
2806
|
), f = k(
|
|
2815
2807
|
"truncate text-xs leading-4",
|
|
2816
|
-
|
|
2808
|
+
Qr[e]
|
|
2817
2809
|
);
|
|
2818
2810
|
return /* @__PURE__ */ m("div", { className: "px-4 py-3", children: [
|
|
2819
2811
|
/* @__PURE__ */ m("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2829,9 +2821,9 @@ const Zr = {
|
|
|
2829
2821
|
] }),
|
|
2830
2822
|
o && /* @__PURE__ */ s("div", { className: "shrink-0", children: o })
|
|
2831
2823
|
] }),
|
|
2832
|
-
l && /* @__PURE__ */ s(
|
|
2824
|
+
l && /* @__PURE__ */ s(Kr, { variant: e, cta: l })
|
|
2833
2825
|
] });
|
|
2834
|
-
},
|
|
2826
|
+
}, ei = k(
|
|
2835
2827
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2836
2828
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2837
2829
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2850,7 +2842,7 @@ const Zr = {
|
|
|
2850
2842
|
"data-testid": d
|
|
2851
2843
|
}) => {
|
|
2852
2844
|
const u = n != null || a != null, p = k(
|
|
2853
|
-
|
|
2845
|
+
ei,
|
|
2854
2846
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2855
2847
|
// `focus-ring` is a design-system utility from the component-library
|
|
2856
2848
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2898,17 +2890,17 @@ const Zr = {
|
|
|
2898
2890
|
]
|
|
2899
2891
|
}
|
|
2900
2892
|
);
|
|
2901
|
-
},
|
|
2893
|
+
}, ti = {
|
|
2902
2894
|
dark: "bg-white/10",
|
|
2903
2895
|
light: "bg-black/5"
|
|
2904
|
-
},
|
|
2896
|
+
}, si = {
|
|
2905
2897
|
dark: "size-16 text-white/25",
|
|
2906
2898
|
light: "size-16 text-black/25"
|
|
2907
|
-
}, Ve = (e, t) => !!t && !!e &&
|
|
2899
|
+
}, Ve = (e, t) => !!t && !!e && le(e) === "audio", Nt = (e, t) => {
|
|
2908
2900
|
if (!t || !e) return !1;
|
|
2909
|
-
const n =
|
|
2901
|
+
const n = le(e);
|
|
2910
2902
|
return n === "video" || n === "audio";
|
|
2911
|
-
},
|
|
2903
|
+
}, yt = "bg-[#F2F3F4]", $e = ({
|
|
2912
2904
|
variant: e,
|
|
2913
2905
|
thumbnailUrl: t,
|
|
2914
2906
|
sourceUrl: n,
|
|
@@ -2917,7 +2909,7 @@ const Zr = {
|
|
|
2917
2909
|
topLeft: i,
|
|
2918
2910
|
topRight: l
|
|
2919
2911
|
}) => {
|
|
2920
|
-
const o =
|
|
2912
|
+
const o = le(r), d = !!n && o === "video";
|
|
2921
2913
|
return Ve(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
|
|
2922
2914
|
"audio",
|
|
2923
2915
|
{
|
|
@@ -2959,10 +2951,10 @@ const Zr = {
|
|
|
2959
2951
|
{
|
|
2960
2952
|
className: k(
|
|
2961
2953
|
"flex h-full w-full items-center justify-center",
|
|
2962
|
-
|
|
2954
|
+
ti[e]
|
|
2963
2955
|
),
|
|
2964
2956
|
children: we(r, {
|
|
2965
|
-
className:
|
|
2957
|
+
className: si[e],
|
|
2966
2958
|
weight: "regular"
|
|
2967
2959
|
})
|
|
2968
2960
|
}
|
|
@@ -2972,7 +2964,7 @@ const Zr = {
|
|
|
2972
2964
|
]
|
|
2973
2965
|
}
|
|
2974
2966
|
);
|
|
2975
|
-
},
|
|
2967
|
+
}, ni = ({
|
|
2976
2968
|
title: e,
|
|
2977
2969
|
placeholderTitle: t,
|
|
2978
2970
|
description: n,
|
|
@@ -3002,10 +2994,10 @@ const Zr = {
|
|
|
3002
2994
|
onClick: h,
|
|
3003
2995
|
"aria-label": "Edit attachment",
|
|
3004
2996
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3005
|
-
children: /* @__PURE__ */ s(
|
|
2997
|
+
children: /* @__PURE__ */ s(Xn, { className: "size-5", weight: "regular" })
|
|
3006
2998
|
}
|
|
3007
2999
|
) : void 0;
|
|
3008
|
-
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName:
|
|
3000
|
+
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName: yt, children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3009
3001
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3010
3002
|
$e,
|
|
3011
3003
|
{
|
|
@@ -3034,7 +3026,7 @@ const Zr = {
|
|
|
3034
3026
|
}
|
|
3035
3027
|
),
|
|
3036
3028
|
/* @__PURE__ */ s(
|
|
3037
|
-
|
|
3029
|
+
_t,
|
|
3038
3030
|
{
|
|
3039
3031
|
variant: "dark",
|
|
3040
3032
|
title: e,
|
|
@@ -3049,7 +3041,7 @@ const Zr = {
|
|
|
3049
3041
|
]
|
|
3050
3042
|
}
|
|
3051
3043
|
);
|
|
3052
|
-
},
|
|
3044
|
+
}, ai = ({
|
|
3053
3045
|
title: e,
|
|
3054
3046
|
description: t,
|
|
3055
3047
|
url: n,
|
|
@@ -3061,7 +3053,7 @@ const Zr = {
|
|
|
3061
3053
|
cta: d,
|
|
3062
3054
|
onClick: u
|
|
3063
3055
|
}) => {
|
|
3064
|
-
const p =
|
|
3056
|
+
const p = Nt(a, i), h = wt(n), g = d == null && h != null && !p ? h : void 0, c = d == null && !p ? u : void 0, v = Ve(a, i) ? yt : void 0, w = d && u ? {
|
|
3065
3057
|
...d,
|
|
3066
3058
|
onClick: () => {
|
|
3067
3059
|
var b;
|
|
@@ -3089,7 +3081,7 @@ const Zr = {
|
|
|
3089
3081
|
}
|
|
3090
3082
|
),
|
|
3091
3083
|
/* @__PURE__ */ s(
|
|
3092
|
-
|
|
3084
|
+
_t,
|
|
3093
3085
|
{
|
|
3094
3086
|
variant: "light",
|
|
3095
3087
|
title: e,
|
|
@@ -3102,7 +3094,7 @@ const Zr = {
|
|
|
3102
3094
|
]
|
|
3103
3095
|
}
|
|
3104
3096
|
);
|
|
3105
|
-
},
|
|
3097
|
+
}, ri = ({
|
|
3106
3098
|
title: e,
|
|
3107
3099
|
placeholderTitle: t,
|
|
3108
3100
|
description: n,
|
|
@@ -3115,14 +3107,14 @@ const Zr = {
|
|
|
3115
3107
|
cta: u,
|
|
3116
3108
|
onClick: p
|
|
3117
3109
|
}) => {
|
|
3118
|
-
const h =
|
|
3110
|
+
const h = Nt(r, l), g = wt(a), c = u == null && g != null && !h ? g : void 0, v = u == null && !h && c != null ? p : void 0;
|
|
3119
3111
|
return /* @__PURE__ */ m(
|
|
3120
3112
|
Oe,
|
|
3121
3113
|
{
|
|
3122
3114
|
variant: "dark",
|
|
3123
3115
|
href: c,
|
|
3124
3116
|
onClick: v,
|
|
3125
|
-
bgClassName: Ve(r, l) ?
|
|
3117
|
+
bgClassName: Ve(r, l) ? yt : void 0,
|
|
3126
3118
|
children: [
|
|
3127
3119
|
o === "featured" && /* @__PURE__ */ s(
|
|
3128
3120
|
$e,
|
|
@@ -3135,7 +3127,7 @@ const Zr = {
|
|
|
3135
3127
|
}
|
|
3136
3128
|
),
|
|
3137
3129
|
/* @__PURE__ */ s(
|
|
3138
|
-
|
|
3130
|
+
_t,
|
|
3139
3131
|
{
|
|
3140
3132
|
variant: "dark",
|
|
3141
3133
|
title: e,
|
|
@@ -3149,22 +3141,22 @@ const Zr = {
|
|
|
3149
3141
|
]
|
|
3150
3142
|
}
|
|
3151
3143
|
);
|
|
3152
|
-
},
|
|
3153
|
-
Composer:
|
|
3154
|
-
Sent:
|
|
3155
|
-
Received:
|
|
3156
|
-
},
|
|
3144
|
+
}, Qt = {
|
|
3145
|
+
Composer: ni,
|
|
3146
|
+
Sent: ri,
|
|
3147
|
+
Received: ai
|
|
3148
|
+
}, ii = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#121110] px-4 py-2 text-white", li = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#e9eaed] px-4 py-2 text-[#080707]";
|
|
3157
3149
|
function P(e) {
|
|
3158
3150
|
const t = e == null ? void 0 : e.trim();
|
|
3159
3151
|
return t || void 0;
|
|
3160
3152
|
}
|
|
3161
|
-
function
|
|
3153
|
+
function es(e) {
|
|
3162
3154
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3163
3155
|
}
|
|
3164
|
-
function
|
|
3156
|
+
function oi(e, t) {
|
|
3165
3157
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3166
3158
|
return !1;
|
|
3167
|
-
const n =
|
|
3159
|
+
const n = es(e), a = es(t);
|
|
3168
3160
|
if (n === a)
|
|
3169
3161
|
return !0;
|
|
3170
3162
|
if (!n.includes(a))
|
|
@@ -3172,7 +3164,7 @@ function ui(e, t) {
|
|
|
3172
3164
|
const r = n.split(a).join("");
|
|
3173
3165
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3174
3166
|
}
|
|
3175
|
-
function
|
|
3167
|
+
function ts(e) {
|
|
3176
3168
|
const t = P(e.og_scrape_url) ?? P(e.title_link), n = P(e.image_url) ?? P(e.thumb_url), a = P(e.asset_url), r = P(e.mime_type);
|
|
3177
3169
|
return {
|
|
3178
3170
|
title: P(e.title),
|
|
@@ -3182,19 +3174,19 @@ function ss(e) {
|
|
|
3182
3174
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3183
3175
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3184
3176
|
sourceUrl: a,
|
|
3185
|
-
layout: n ||
|
|
3177
|
+
layout: n || Nt(r, a) ? "featured" : "classic",
|
|
3186
3178
|
mimeType: r
|
|
3187
3179
|
};
|
|
3188
3180
|
}
|
|
3189
|
-
function
|
|
3181
|
+
function ci(e) {
|
|
3190
3182
|
var t;
|
|
3191
|
-
return
|
|
3183
|
+
return zs(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3192
3184
|
}
|
|
3193
|
-
function
|
|
3185
|
+
function zs(e) {
|
|
3194
3186
|
const t = P(e.og_scrape_url);
|
|
3195
3187
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3196
3188
|
}
|
|
3197
|
-
function
|
|
3189
|
+
function Ps(e) {
|
|
3198
3190
|
if (!(e != null && e.length)) return [];
|
|
3199
3191
|
const t = [], n = (r, i) => {
|
|
3200
3192
|
const l = t[t.length - 1];
|
|
@@ -3212,51 +3204,51 @@ function Fs(e) {
|
|
|
3212
3204
|
t.push({ type: "link", attachments: [r] });
|
|
3213
3205
|
};
|
|
3214
3206
|
for (const r of e) {
|
|
3215
|
-
if (
|
|
3207
|
+
if (zs(r)) {
|
|
3216
3208
|
a(r);
|
|
3217
3209
|
continue;
|
|
3218
3210
|
}
|
|
3219
|
-
const i =
|
|
3211
|
+
const i = ci(r);
|
|
3220
3212
|
i && n(i, r);
|
|
3221
3213
|
}
|
|
3222
3214
|
return t;
|
|
3223
3215
|
}
|
|
3224
|
-
function
|
|
3216
|
+
function di(e) {
|
|
3225
3217
|
let t = 0;
|
|
3226
3218
|
for (const n of e)
|
|
3227
3219
|
t += n.type === "link" ? n.attachments.length : 1;
|
|
3228
3220
|
return t;
|
|
3229
3221
|
}
|
|
3230
|
-
function
|
|
3222
|
+
function ui(e) {
|
|
3231
3223
|
return e.filter((t) => t.type === "media").length;
|
|
3232
3224
|
}
|
|
3233
|
-
function
|
|
3225
|
+
function mi(e, t, n) {
|
|
3234
3226
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3235
3227
|
}
|
|
3236
|
-
function
|
|
3228
|
+
function ss(e) {
|
|
3237
3229
|
return P(e.image_url) ?? P(e.asset_url) ?? "";
|
|
3238
3230
|
}
|
|
3239
|
-
function
|
|
3231
|
+
function hi(e) {
|
|
3240
3232
|
switch (e) {
|
|
3241
3233
|
case "image":
|
|
3242
|
-
return
|
|
3234
|
+
return Ne.Image;
|
|
3243
3235
|
case "video":
|
|
3244
|
-
return
|
|
3236
|
+
return Ne.Video;
|
|
3245
3237
|
case "audio":
|
|
3246
|
-
return
|
|
3238
|
+
return Ne.Audio;
|
|
3247
3239
|
case "pdf":
|
|
3248
|
-
return
|
|
3240
|
+
return Ne.Pdf;
|
|
3249
3241
|
default:
|
|
3250
|
-
return
|
|
3242
|
+
return Ne.File;
|
|
3251
3243
|
}
|
|
3252
3244
|
}
|
|
3253
|
-
function
|
|
3245
|
+
function fi(e, t) {
|
|
3254
3246
|
if (t.length > 1)
|
|
3255
3247
|
switch (e) {
|
|
3256
3248
|
case "image":
|
|
3257
3249
|
return {
|
|
3258
3250
|
items: t.map((a) => ({
|
|
3259
|
-
src:
|
|
3251
|
+
src: ss(a),
|
|
3260
3252
|
alt: P(a.title)
|
|
3261
3253
|
}))
|
|
3262
3254
|
};
|
|
@@ -3307,7 +3299,7 @@ function bi(e, t) {
|
|
|
3307
3299
|
switch (e) {
|
|
3308
3300
|
case "image":
|
|
3309
3301
|
return {
|
|
3310
|
-
src:
|
|
3302
|
+
src: ss(n),
|
|
3311
3303
|
alt: P(n.title)
|
|
3312
3304
|
};
|
|
3313
3305
|
case "video":
|
|
@@ -3337,48 +3329,48 @@ function bi(e, t) {
|
|
|
3337
3329
|
};
|
|
3338
3330
|
}
|
|
3339
3331
|
}
|
|
3340
|
-
function
|
|
3332
|
+
function gi({
|
|
3341
3333
|
groupPosition: e,
|
|
3342
3334
|
isMyMessage: t,
|
|
3343
3335
|
segment: n,
|
|
3344
3336
|
text: a
|
|
3345
3337
|
}) {
|
|
3346
|
-
const r =
|
|
3347
|
-
...
|
|
3338
|
+
const r = hi(n.kind), i = {
|
|
3339
|
+
...fi(n.kind, n.attachments),
|
|
3348
3340
|
groupPosition: e,
|
|
3349
3341
|
...a ? { text: a } : {}
|
|
3350
3342
|
};
|
|
3351
3343
|
return t ? /* @__PURE__ */ s(r.Sent, { ...i }) : /* @__PURE__ */ s(r.Received, { ...i });
|
|
3352
3344
|
}
|
|
3353
|
-
const
|
|
3345
|
+
const pi = ({
|
|
3354
3346
|
groupPosition: e,
|
|
3355
3347
|
isMyMessage: t,
|
|
3356
3348
|
message: n
|
|
3357
3349
|
}) => {
|
|
3358
3350
|
var w;
|
|
3359
|
-
const a =
|
|
3351
|
+
const a = Ps(n.attachments);
|
|
3360
3352
|
if (a.length === 0) return null;
|
|
3361
|
-
const r =
|
|
3353
|
+
const r = di(a), i = ui(a), l = (w = n.text) == null ? void 0 : w.trim(), o = a.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? ts(o.attachments[0] ?? {}).url : void 0, u = l && oi(l, d) ? void 0 : l;
|
|
3362
3354
|
let p = 0, h = 0;
|
|
3363
3355
|
const g = [], c = (b, f) => {
|
|
3364
3356
|
const x = p === r - 1;
|
|
3365
3357
|
p += 1;
|
|
3366
|
-
const N = t ?
|
|
3358
|
+
const N = t ? Qt.Sent : Qt.Received;
|
|
3367
3359
|
g.push(
|
|
3368
3360
|
/* @__PURE__ */ m(U.Fragment, { children: [
|
|
3369
|
-
/* @__PURE__ */ s(N, { ...
|
|
3370
|
-
x && u ? /* @__PURE__ */ s("div", { className: t ?
|
|
3361
|
+
/* @__PURE__ */ s(N, { ...ts(b) }),
|
|
3362
|
+
x && u ? /* @__PURE__ */ s("div", { className: t ? ii : li, children: u }) : null
|
|
3371
3363
|
] }, f)
|
|
3372
3364
|
);
|
|
3373
3365
|
}, v = (b, f) => {
|
|
3374
|
-
const x = p === r - 1, N =
|
|
3366
|
+
const x = p === r - 1, N = mi(
|
|
3375
3367
|
h,
|
|
3376
3368
|
i,
|
|
3377
3369
|
e
|
|
3378
3370
|
);
|
|
3379
3371
|
p += 1, h += 1, g.push(
|
|
3380
3372
|
/* @__PURE__ */ s(
|
|
3381
|
-
|
|
3373
|
+
gi,
|
|
3382
3374
|
{
|
|
3383
3375
|
groupPosition: N,
|
|
3384
3376
|
isMyMessage: t,
|
|
@@ -3397,9 +3389,9 @@ const xi = ({
|
|
|
3397
3389
|
return;
|
|
3398
3390
|
}
|
|
3399
3391
|
v(b, `media-${f}`);
|
|
3400
|
-
}), /* @__PURE__ */ s(
|
|
3401
|
-
},
|
|
3402
|
-
var At, Mt, Rt,
|
|
3392
|
+
}), /* @__PURE__ */ s(te, { children: g });
|
|
3393
|
+
}, bi = (e) => {
|
|
3394
|
+
var Tt, At, Mt, Rt, Lt, Dt, zt, Pt, Ft, Ot, $t, jt, Bt, Ut;
|
|
3403
3395
|
const {
|
|
3404
3396
|
additionalMessageInputProps: t,
|
|
3405
3397
|
chatbotVotingEnabled: n,
|
|
@@ -3417,52 +3409,52 @@ const xi = ({
|
|
|
3417
3409
|
renderText: v,
|
|
3418
3410
|
threadList: w,
|
|
3419
3411
|
viewerLanguage: b
|
|
3420
|
-
} = e, { client: f } =
|
|
3421
|
-
Attachment:
|
|
3422
|
-
EditMessageModal: C =
|
|
3412
|
+
} = e, { client: f } = me("CustomMessage"), { channel: x } = ue("CustomMessage"), { isUnlocking: N, onUnlockClick: E, onFetchSource: T, onDownloadClick: M } = $r("LockedAttachment"), [D, L] = B(!1), O = Xs(c.id), { selected: z, voteUp: y, voteDown: A } = ba(c), {
|
|
3413
|
+
Attachment: S = Ks,
|
|
3414
|
+
EditMessageModal: C = Js,
|
|
3423
3415
|
MessageActions: I,
|
|
3424
|
-
MessageBlocked: $ =
|
|
3425
|
-
MessageBouncePrompt: F =
|
|
3426
|
-
MessageDeleted: V =
|
|
3427
|
-
MessageIsThreadReplyInChannelButtonIndicator: Q =
|
|
3428
|
-
MessageRepliesCountButton:
|
|
3429
|
-
ReminderNotification: X =
|
|
3430
|
-
StreamedMessageText: _ =
|
|
3416
|
+
MessageBlocked: $ = Zs,
|
|
3417
|
+
MessageBouncePrompt: F = Qs,
|
|
3418
|
+
MessageDeleted: V = en,
|
|
3419
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = tn,
|
|
3420
|
+
MessageRepliesCountButton: ee = sn,
|
|
3421
|
+
ReminderNotification: X = nn,
|
|
3422
|
+
StreamedMessageText: _ = an,
|
|
3431
3423
|
PinIndicator: R
|
|
3432
|
-
} =
|
|
3424
|
+
} = rs("CustomMessage"), H = rn(c), q = ln(c), Y = ae(
|
|
3433
3425
|
() => h == null ? void 0 : h(c),
|
|
3434
3426
|
[h, c]
|
|
3435
|
-
), j =
|
|
3436
|
-
const
|
|
3427
|
+
), j = ae(() => {
|
|
3428
|
+
const de = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...de] : de;
|
|
3437
3429
|
if (!Fe(c)) return pe;
|
|
3438
|
-
const
|
|
3439
|
-
return
|
|
3440
|
-
}, [c]), W =
|
|
3441
|
-
() =>
|
|
3430
|
+
const Vt = pe.filter((Gt) => !("type" in Gt) || !xs(Gt));
|
|
3431
|
+
return Vt.length === pe.length ? pe : Vt;
|
|
3432
|
+
}, [c]), W = ae(
|
|
3433
|
+
() => Ps(j),
|
|
3442
3434
|
[j]
|
|
3443
|
-
), Z =
|
|
3444
|
-
const
|
|
3445
|
-
return
|
|
3446
|
-
}, [c, b]),
|
|
3447
|
-
(
|
|
3435
|
+
), Z = ae(() => {
|
|
3436
|
+
const de = ms({ message: c, viewerLanguage: b });
|
|
3437
|
+
return de === c.text ? c : { ...c, text: de };
|
|
3438
|
+
}, [c, b]), oe = W.length > 0, Le = W.reduce(
|
|
3439
|
+
(de, pe) => de + pe.attachments.length,
|
|
3448
3440
|
0
|
|
3449
|
-
) === ((j == null ? void 0 : j.length) ?? 0),
|
|
3441
|
+
) === ((j == null ? void 0 : j.length) ?? 0), De = qa(
|
|
3450
3442
|
{
|
|
3451
3443
|
endOfGroup: r,
|
|
3452
3444
|
firstOfGroup: i,
|
|
3453
3445
|
groupedByUser: l
|
|
3454
3446
|
}
|
|
3455
3447
|
);
|
|
3456
|
-
if (
|
|
3448
|
+
if (on(c))
|
|
3457
3449
|
return null;
|
|
3458
3450
|
if (c.deleted_at || c.type === "deleted")
|
|
3459
3451
|
return /* @__PURE__ */ s(V, { message: c });
|
|
3460
|
-
if (
|
|
3452
|
+
if (cn(c))
|
|
3461
3453
|
return /* @__PURE__ */ s($, {});
|
|
3462
|
-
const
|
|
3454
|
+
const ne = !w && !!c.reply_count, ce = !w && c.show_in_channel && c.parent_id, ie = c.status === "failed" && ((Tt = c.error) == null ? void 0 : Tt.status) !== 403, Ct = dn(c);
|
|
3463
3455
|
let he;
|
|
3464
|
-
ie ? he = () => u(c) :
|
|
3465
|
-
const fe = g(),
|
|
3456
|
+
ie ? he = () => u(c) : Ct && (he = () => L(!0));
|
|
3457
|
+
const fe = g(), Bs = k(
|
|
3466
3458
|
"str-chat__message str-chat__message-simple",
|
|
3467
3459
|
`str-chat__message--${c.type}`,
|
|
3468
3460
|
`str-chat__message--${c.status}`,
|
|
@@ -3473,39 +3465,39 @@ const xi = ({
|
|
|
3473
3465
|
"str-chat__message--highlighted": p,
|
|
3474
3466
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3475
3467
|
"str-chat__message--with-reactions": q,
|
|
3476
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3477
|
-
"str-chat__message-with-thread-link":
|
|
3468
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((At = c == null ? void 0 : c.error) == null ? void 0 : At.status) !== 403,
|
|
3469
|
+
"str-chat__message-with-thread-link": ne || ce,
|
|
3478
3470
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3479
3471
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3480
3472
|
"str-chat__virtual-message__wrapper--group": l
|
|
3481
3473
|
}
|
|
3482
|
-
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Et =
|
|
3483
|
-
return /* @__PURE__ */ m(
|
|
3474
|
+
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Et = Hr(c), ge = Fe(c), St = Gr(c), He = !!(j != null && j.length && !c.quoted_message), It = ge && fe && He, Us = oe && Le && !c.quoted_message && !Ge && !Y && !ge;
|
|
3475
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
3484
3476
|
a && /* @__PURE__ */ s(
|
|
3485
3477
|
C,
|
|
3486
3478
|
{
|
|
3487
3479
|
additionalMessageInputProps: t
|
|
3488
3480
|
}
|
|
3489
3481
|
),
|
|
3490
|
-
|
|
3491
|
-
|
|
3482
|
+
D && /* @__PURE__ */ s(
|
|
3483
|
+
un,
|
|
3492
3484
|
{
|
|
3493
3485
|
MessageBouncePrompt: F,
|
|
3494
|
-
onClose: () =>
|
|
3495
|
-
open:
|
|
3486
|
+
onClose: () => L(!1),
|
|
3487
|
+
open: D
|
|
3496
3488
|
}
|
|
3497
3489
|
),
|
|
3498
3490
|
/* @__PURE__ */ m(
|
|
3499
3491
|
"div",
|
|
3500
3492
|
{
|
|
3501
|
-
className:
|
|
3493
|
+
className: Bs,
|
|
3502
3494
|
"data-message-id": c.id,
|
|
3503
3495
|
"data-dd-privacy": "mask",
|
|
3504
3496
|
children: [
|
|
3505
3497
|
R && /* @__PURE__ */ s(R, {}),
|
|
3506
3498
|
!!O && /* @__PURE__ */ s(X, { reminder: O }),
|
|
3507
3499
|
c.user && /* @__PURE__ */ s(
|
|
3508
|
-
|
|
3500
|
+
se,
|
|
3509
3501
|
{
|
|
3510
3502
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3511
3503
|
id: c.user.id,
|
|
@@ -3520,7 +3512,7 @@ const xi = ({
|
|
|
3520
3512
|
"div",
|
|
3521
3513
|
{
|
|
3522
3514
|
className: k("str-chat__message-inner", {
|
|
3523
|
-
"str-chat__simple-message--error-failed": ie ||
|
|
3515
|
+
"str-chat__simple-message--error-failed": ie || Ct
|
|
3524
3516
|
}),
|
|
3525
3517
|
"data-testid": "message-inner",
|
|
3526
3518
|
onClick: he,
|
|
@@ -3533,34 +3525,34 @@ const xi = ({
|
|
|
3533
3525
|
marginInlineEnd: 0,
|
|
3534
3526
|
marginInlineStart: 0
|
|
3535
3527
|
},
|
|
3536
|
-
children:
|
|
3528
|
+
children: St ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3537
3529
|
fe ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3538
3530
|
I && /* @__PURE__ */ s(I, {}),
|
|
3539
3531
|
/* @__PURE__ */ s(
|
|
3540
|
-
|
|
3532
|
+
Jt.Sent,
|
|
3541
3533
|
{
|
|
3542
|
-
title: (
|
|
3543
|
-
mimeType: (
|
|
3534
|
+
title: (Mt = c.metadata) == null ? void 0 : Mt.attachment_title,
|
|
3535
|
+
mimeType: (Rt = c.metadata) == null ? void 0 : Rt.attachment_mime_type,
|
|
3544
3536
|
thumbnailUrl: (Lt = c.metadata) == null ? void 0 : Lt.attachment_thumbnail,
|
|
3545
|
-
amountText: (
|
|
3546
|
-
detail: (
|
|
3547
|
-
paymentStatus: (
|
|
3548
|
-
onPreviewClick: () =>
|
|
3537
|
+
amountText: (Dt = c.metadata) == null ? void 0 : Dt.amount_text,
|
|
3538
|
+
detail: (zt = c.metadata) == null ? void 0 : zt.attachment_detail,
|
|
3539
|
+
paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
|
|
3540
|
+
onPreviewClick: () => E == null ? void 0 : E(c, x),
|
|
3549
3541
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x))
|
|
3550
3542
|
}
|
|
3551
3543
|
)
|
|
3552
3544
|
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3553
3545
|
/* @__PURE__ */ s(
|
|
3554
|
-
|
|
3546
|
+
Jt.Received,
|
|
3555
3547
|
{
|
|
3556
|
-
title: (
|
|
3557
|
-
mimeType: (
|
|
3558
|
-
thumbnailUrl: (
|
|
3559
|
-
amountText: (
|
|
3560
|
-
detail: (
|
|
3561
|
-
paymentStatus: (
|
|
3548
|
+
title: (Ft = c.metadata) == null ? void 0 : Ft.attachment_title,
|
|
3549
|
+
mimeType: (Ot = c.metadata) == null ? void 0 : Ot.attachment_mime_type,
|
|
3550
|
+
thumbnailUrl: ($t = c.metadata) == null ? void 0 : $t.attachment_thumbnail,
|
|
3551
|
+
amountText: (jt = c.metadata) == null ? void 0 : jt.amount_text,
|
|
3552
|
+
detail: (Bt = c.metadata) == null ? void 0 : Bt.attachment_detail,
|
|
3553
|
+
paymentStatus: (Ut = c.metadata) == null ? void 0 : Ut.payment_status,
|
|
3562
3554
|
isUnlocking: N(c.id),
|
|
3563
|
-
onUnlockClick: () =>
|
|
3555
|
+
onUnlockClick: () => E == null ? void 0 : E(c, x),
|
|
3564
3556
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x)),
|
|
3565
3557
|
onDownloadClick: () => M == null ? void 0 : M(c, x)
|
|
3566
3558
|
}
|
|
@@ -3568,7 +3560,7 @@ const xi = ({
|
|
|
3568
3560
|
I && /* @__PURE__ */ s(I, {})
|
|
3569
3561
|
] }),
|
|
3570
3562
|
c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
|
|
3571
|
-
|
|
3563
|
+
Yt,
|
|
3572
3564
|
{
|
|
3573
3565
|
message: Z,
|
|
3574
3566
|
renderText: v
|
|
@@ -3577,7 +3569,7 @@ const xi = ({
|
|
|
3577
3569
|
] }) : Et ? (
|
|
3578
3570
|
/* Tip-only messages render as a standalone bubble */
|
|
3579
3571
|
/* @__PURE__ */ s(Ke, { message: c, standalone: !0 })
|
|
3580
|
-
) :
|
|
3572
|
+
) : Us ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m(
|
|
3581
3573
|
"div",
|
|
3582
3574
|
{
|
|
3583
3575
|
className: "str-chat__message-bubble",
|
|
@@ -3589,9 +3581,9 @@ const xi = ({
|
|
|
3589
3581
|
},
|
|
3590
3582
|
children: [
|
|
3591
3583
|
/* @__PURE__ */ s(
|
|
3592
|
-
|
|
3584
|
+
pi,
|
|
3593
3585
|
{
|
|
3594
|
-
groupPosition:
|
|
3586
|
+
groupPosition: De,
|
|
3595
3587
|
isMyMessage: fe,
|
|
3596
3588
|
message: {
|
|
3597
3589
|
attachments: j,
|
|
@@ -3599,11 +3591,11 @@ const xi = ({
|
|
|
3599
3591
|
}
|
|
3600
3592
|
}
|
|
3601
3593
|
),
|
|
3602
|
-
/* @__PURE__ */ s(
|
|
3594
|
+
/* @__PURE__ */ s(qt, {})
|
|
3603
3595
|
]
|
|
3604
3596
|
}
|
|
3605
3597
|
) }) : /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m("div", { className: "str-chat__message-bubble", children: [
|
|
3606
|
-
ge && !
|
|
3598
|
+
ge && !It && /* @__PURE__ */ s(
|
|
3607
3599
|
Ke,
|
|
3608
3600
|
{
|
|
3609
3601
|
message: c,
|
|
@@ -3611,9 +3603,9 @@ const xi = ({
|
|
|
3611
3603
|
isMyMessage: fe
|
|
3612
3604
|
}
|
|
3613
3605
|
),
|
|
3614
|
-
Ge && /* @__PURE__ */ s(
|
|
3606
|
+
Ge && /* @__PURE__ */ s(mn, { poll: Ge }),
|
|
3615
3607
|
j != null && j.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3616
|
-
|
|
3608
|
+
S,
|
|
3617
3609
|
{
|
|
3618
3610
|
actionHandler: o,
|
|
3619
3611
|
attachments: j
|
|
@@ -3626,18 +3618,18 @@ const xi = ({
|
|
|
3626
3618
|
renderText: v
|
|
3627
3619
|
}
|
|
3628
3620
|
) : /* @__PURE__ */ s(
|
|
3629
|
-
|
|
3621
|
+
Yt,
|
|
3630
3622
|
{
|
|
3631
3623
|
message: Z,
|
|
3632
3624
|
renderText: v
|
|
3633
3625
|
}
|
|
3634
3626
|
),
|
|
3635
|
-
/* @__PURE__ */ s(
|
|
3627
|
+
/* @__PURE__ */ s(qt, {})
|
|
3636
3628
|
] }) })
|
|
3637
3629
|
}
|
|
3638
3630
|
),
|
|
3639
|
-
!
|
|
3640
|
-
(!ge ||
|
|
3631
|
+
!St && !Et && /* @__PURE__ */ m("div", { className: "str-chat__message-footer", children: [
|
|
3632
|
+
(!ge || It) && /* @__PURE__ */ s(
|
|
3641
3633
|
Ke,
|
|
3642
3634
|
{
|
|
3643
3635
|
message: c,
|
|
@@ -3646,7 +3638,7 @@ const xi = ({
|
|
|
3646
3638
|
}
|
|
3647
3639
|
),
|
|
3648
3640
|
n && ge && /* @__PURE__ */ s(
|
|
3649
|
-
|
|
3641
|
+
Yr,
|
|
3650
3642
|
{
|
|
3651
3643
|
selected: z,
|
|
3652
3644
|
onVoteUp: y,
|
|
@@ -3654,64 +3646,64 @@ const xi = ({
|
|
|
3654
3646
|
}
|
|
3655
3647
|
)
|
|
3656
3648
|
] }),
|
|
3657
|
-
/* @__PURE__ */ s(
|
|
3658
|
-
|
|
3659
|
-
|
|
3649
|
+
/* @__PURE__ */ s(jr, { message: c, endOfGroup: r }),
|
|
3650
|
+
ne && /* @__PURE__ */ s(
|
|
3651
|
+
ee,
|
|
3660
3652
|
{
|
|
3661
3653
|
onClick: d,
|
|
3662
3654
|
reply_count: c.reply_count
|
|
3663
3655
|
}
|
|
3664
3656
|
),
|
|
3665
|
-
|
|
3657
|
+
ce && /* @__PURE__ */ s(Q, {})
|
|
3666
3658
|
]
|
|
3667
3659
|
},
|
|
3668
3660
|
c.id
|
|
3669
3661
|
)
|
|
3670
3662
|
] });
|
|
3671
|
-
},
|
|
3672
|
-
|
|
3673
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
3674
|
-
),
|
|
3675
|
-
const t =
|
|
3676
|
-
return /* @__PURE__ */ s(
|
|
3677
|
-
},
|
|
3663
|
+
}, vi = U.memo(
|
|
3664
|
+
bi,
|
|
3665
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ws(e, t)
|
|
3666
|
+
), xi = (e) => {
|
|
3667
|
+
const t = Ie("CustomMessage");
|
|
3668
|
+
return /* @__PURE__ */ s(vi, { ...t, ...e });
|
|
3669
|
+
}, wi = () => {
|
|
3678
3670
|
var n;
|
|
3679
|
-
const { handleDelete: e, message: t } =
|
|
3671
|
+
const { handleDelete: e, message: t } = Ie("CustomMessageActions");
|
|
3680
3672
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
3681
|
-
|
|
3673
|
+
cs,
|
|
3682
3674
|
{
|
|
3683
3675
|
onClick: e,
|
|
3684
3676
|
"aria-label": "Delete",
|
|
3685
3677
|
title: "Delete",
|
|
3686
3678
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3687
|
-
children: /* @__PURE__ */ s(
|
|
3679
|
+
children: /* @__PURE__ */ s(Kn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3688
3680
|
}
|
|
3689
3681
|
);
|
|
3690
|
-
},
|
|
3691
|
-
const { handleFlag: e } =
|
|
3682
|
+
}, _i = () => {
|
|
3683
|
+
const { handleFlag: e } = Ie("CustomMessageActions");
|
|
3692
3684
|
return /* @__PURE__ */ s(
|
|
3693
|
-
|
|
3685
|
+
cs,
|
|
3694
3686
|
{
|
|
3695
3687
|
onClick: e,
|
|
3696
3688
|
"aria-label": "Report",
|
|
3697
3689
|
title: "Report",
|
|
3698
3690
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3699
|
-
children: /* @__PURE__ */ s(
|
|
3691
|
+
children: /* @__PURE__ */ s(is, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3700
3692
|
}
|
|
3701
3693
|
);
|
|
3702
|
-
},
|
|
3694
|
+
}, Ni = () => {
|
|
3703
3695
|
var t;
|
|
3704
|
-
const { message: e } =
|
|
3696
|
+
const { message: e } = Ie("CustomMessageActions");
|
|
3705
3697
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3706
|
-
|
|
3698
|
+
Qn,
|
|
3707
3699
|
{
|
|
3708
3700
|
messageActionSet: [
|
|
3709
|
-
{ Component:
|
|
3710
|
-
{ Component:
|
|
3701
|
+
{ Component: wi, placement: "quick", type: "delete" },
|
|
3702
|
+
{ Component: _i, placement: "quick", type: "flag" }
|
|
3711
3703
|
]
|
|
3712
3704
|
}
|
|
3713
3705
|
);
|
|
3714
|
-
},
|
|
3706
|
+
}, yi = ({
|
|
3715
3707
|
link: e,
|
|
3716
3708
|
onDismiss: t
|
|
3717
3709
|
}) => {
|
|
@@ -3751,14 +3743,14 @@ const xi = ({
|
|
|
3751
3743
|
]
|
|
3752
3744
|
}
|
|
3753
3745
|
);
|
|
3754
|
-
},
|
|
3746
|
+
}, ki = (e) => ({
|
|
3755
3747
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3756
|
-
(t) =>
|
|
3748
|
+
(t) => Ht.previewIsLoaded(t) || Ht.previewIsLoading(t)
|
|
3757
3749
|
)
|
|
3758
|
-
}),
|
|
3759
|
-
const { linkPreviewsManager: e } =
|
|
3750
|
+
}), Ci = () => {
|
|
3751
|
+
const { linkPreviewsManager: e } = hn(), { linkPreviews: t } = fn(
|
|
3760
3752
|
e.state,
|
|
3761
|
-
|
|
3753
|
+
ki
|
|
3762
3754
|
), n = (r) => {
|
|
3763
3755
|
e.dismissPreview(r);
|
|
3764
3756
|
};
|
|
@@ -3771,9 +3763,9 @@ const xi = ({
|
|
|
3771
3763
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3772
3764
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3773
3765
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3774
|
-
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(
|
|
3766
|
+
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(yi, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3775
3767
|
) : null;
|
|
3776
|
-
},
|
|
3768
|
+
}, kt = U.createContext(!1), dl = () => Se(kt), Ei = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3777
3769
|
"button",
|
|
3778
3770
|
{
|
|
3779
3771
|
...n,
|
|
@@ -3781,13 +3773,13 @@ const xi = ({
|
|
|
3781
3773
|
"aria-label": "Send",
|
|
3782
3774
|
disabled: t,
|
|
3783
3775
|
onClick: e,
|
|
3784
|
-
children: /* @__PURE__ */ s(
|
|
3776
|
+
children: /* @__PURE__ */ s(Jn, { weight: "bold", className: "size-4" })
|
|
3785
3777
|
}
|
|
3786
|
-
),
|
|
3787
|
-
const e =
|
|
3788
|
-
SendButton: r =
|
|
3789
|
-
AttachmentPreviewList: i =
|
|
3790
|
-
} =
|
|
3778
|
+
), Si = () => {
|
|
3779
|
+
const e = Se(kt), { handleSubmit: t } = pn(), n = bn(), a = e || !n, {
|
|
3780
|
+
SendButton: r = Ei,
|
|
3781
|
+
AttachmentPreviewList: i = vn
|
|
3782
|
+
} = rs("CustomMessageInput");
|
|
3791
3783
|
return (
|
|
3792
3784
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3793
3785
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3803,12 +3795,12 @@ const xi = ({
|
|
|
3803
3795
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
3804
3796
|
"data-dd-privacy": "mask",
|
|
3805
3797
|
children: [
|
|
3806
|
-
/* @__PURE__ */ s(
|
|
3807
|
-
/* @__PURE__ */ s(
|
|
3798
|
+
/* @__PURE__ */ s(xn, {}),
|
|
3799
|
+
/* @__PURE__ */ s(Ci, {}),
|
|
3808
3800
|
/* @__PURE__ */ s(i, {}),
|
|
3809
3801
|
/* @__PURE__ */ m("div", { className: "flex shrink-0", children: [
|
|
3810
3802
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
3811
|
-
|
|
3803
|
+
wn,
|
|
3812
3804
|
{
|
|
3813
3805
|
"aria-disabled": e || void 0,
|
|
3814
3806
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3834,7 +3826,7 @@ const xi = ({
|
|
|
3834
3826
|
}
|
|
3835
3827
|
)
|
|
3836
3828
|
);
|
|
3837
|
-
},
|
|
3829
|
+
}, Ii = ({
|
|
3838
3830
|
renderActions: e,
|
|
3839
3831
|
renderFooter: t,
|
|
3840
3832
|
disabled: n = !1,
|
|
@@ -3842,8 +3834,8 @@ const xi = ({
|
|
|
3842
3834
|
composerInput: r
|
|
3843
3835
|
}) => {
|
|
3844
3836
|
var o;
|
|
3845
|
-
const { channel: i } =
|
|
3846
|
-
return n ? /* @__PURE__ */ m(
|
|
3837
|
+
const { channel: i } = ue(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
3838
|
+
return n ? /* @__PURE__ */ m(te, { children: [
|
|
3847
3839
|
/* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
3848
3840
|
t == null ? void 0 : t()
|
|
3849
3841
|
] }) : /* @__PURE__ */ m("div", { className: "flex min-h-0 flex-col gap-4 p-4", children: [
|
|
@@ -3855,67 +3847,67 @@ const xi = ({
|
|
|
3855
3847
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3856
3848
|
children: [
|
|
3857
3849
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3858
|
-
/* @__PURE__ */ s(
|
|
3850
|
+
/* @__PURE__ */ s(kt.Provider, { value: l, children: /* @__PURE__ */ s(gn, { Input: r ?? Si }) })
|
|
3859
3851
|
]
|
|
3860
3852
|
}
|
|
3861
3853
|
),
|
|
3862
3854
|
t == null ? void 0 : t()
|
|
3863
3855
|
] });
|
|
3864
|
-
},
|
|
3856
|
+
}, Ti = [
|
|
3865
3857
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3866
3858
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3867
|
-
],
|
|
3859
|
+
], Ai = {
|
|
3868
3860
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3869
3861
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3870
|
-
},
|
|
3862
|
+
}, Mi = [
|
|
3871
3863
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3872
|
-
],
|
|
3864
|
+
], Ri = {
|
|
3873
3865
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3874
|
-
},
|
|
3866
|
+
}, Je = "age safety guidelines.", Li = "https://linktr.ee/s/about/contact", ns = (e) => Ti.includes(e), Di = (e) => Mi.includes(e), zi = (e) => {
|
|
3875
3867
|
var a;
|
|
3876
3868
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3877
|
-
if (
|
|
3869
|
+
if (ns(t))
|
|
3878
3870
|
return {
|
|
3879
3871
|
kind: "dm-agent",
|
|
3880
3872
|
type: t
|
|
3881
3873
|
};
|
|
3882
|
-
if (
|
|
3874
|
+
if (Di(t))
|
|
3883
3875
|
return {
|
|
3884
3876
|
kind: "age-safety",
|
|
3885
3877
|
type: t
|
|
3886
3878
|
};
|
|
3887
3879
|
const n = e.dm_agent_system_type;
|
|
3888
|
-
if (
|
|
3880
|
+
if (ns(n))
|
|
3889
3881
|
return {
|
|
3890
3882
|
kind: "dm-agent",
|
|
3891
3883
|
type: n
|
|
3892
3884
|
};
|
|
3893
|
-
},
|
|
3894
|
-
const t = e.indexOf(
|
|
3885
|
+
}, Pi = (e) => {
|
|
3886
|
+
const t = e.indexOf(Je);
|
|
3895
3887
|
if (t === -1)
|
|
3896
3888
|
return e;
|
|
3897
|
-
const n = t +
|
|
3898
|
-
return /* @__PURE__ */ m(
|
|
3889
|
+
const n = t + Je.length;
|
|
3890
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
3899
3891
|
e.slice(0, t),
|
|
3900
3892
|
/* @__PURE__ */ s(
|
|
3901
3893
|
"a",
|
|
3902
3894
|
{
|
|
3903
|
-
href:
|
|
3895
|
+
href: Li,
|
|
3904
3896
|
target: "_blank",
|
|
3905
3897
|
rel: "noopener noreferrer",
|
|
3906
3898
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
3907
|
-
children:
|
|
3899
|
+
children: Je
|
|
3908
3900
|
}
|
|
3909
3901
|
),
|
|
3910
3902
|
e.slice(n)
|
|
3911
3903
|
] });
|
|
3912
|
-
},
|
|
3904
|
+
}, Fi = (e) => {
|
|
3913
3905
|
var a, r;
|
|
3914
|
-
const t = e.message.hide_date === !0, n =
|
|
3906
|
+
const t = e.message.hide_date === !0, n = zi(
|
|
3915
3907
|
e.message
|
|
3916
3908
|
);
|
|
3917
3909
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
3918
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3910
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ai[n.type];
|
|
3919
3911
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3920
3912
|
/* @__PURE__ */ m(
|
|
3921
3913
|
"div",
|
|
@@ -3941,7 +3933,7 @@ const xi = ({
|
|
|
3941
3933
|
] });
|
|
3942
3934
|
}
|
|
3943
3935
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
3944
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
3936
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ri[n.type];
|
|
3945
3937
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3946
3938
|
/* @__PURE__ */ m(
|
|
3947
3939
|
"div",
|
|
@@ -3951,7 +3943,7 @@ const xi = ({
|
|
|
3951
3943
|
"data-age-safety-system-type": n.type,
|
|
3952
3944
|
children: [
|
|
3953
3945
|
/* @__PURE__ */ s(
|
|
3954
|
-
|
|
3946
|
+
Zn,
|
|
3955
3947
|
{
|
|
3956
3948
|
size: 24,
|
|
3957
3949
|
weight: "duotone",
|
|
@@ -3960,7 +3952,7 @@ const xi = ({
|
|
|
3960
3952
|
"data-testid": "age-safety-system-message-icon"
|
|
3961
3953
|
}
|
|
3962
3954
|
),
|
|
3963
|
-
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
3955
|
+
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Pi(i) }) })
|
|
3964
3956
|
]
|
|
3965
3957
|
}
|
|
3966
3958
|
),
|
|
@@ -3975,7 +3967,7 @@ const xi = ({
|
|
|
3975
3967
|
] }),
|
|
3976
3968
|
!t && /* @__PURE__ */ s(Ye, { message: e.message })
|
|
3977
3969
|
] });
|
|
3978
|
-
},
|
|
3970
|
+
}, Fs = at(!1), Ze = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
|
|
3979
3971
|
"animateTransform",
|
|
3980
3972
|
{
|
|
3981
3973
|
attributeName: "transform",
|
|
@@ -3985,17 +3977,17 @@ const xi = ({
|
|
|
3985
3977
|
begin: `${120 * t}ms`,
|
|
3986
3978
|
repeatCount: "indefinite"
|
|
3987
3979
|
}
|
|
3988
|
-
) }),
|
|
3980
|
+
) }), Oi = /* @__PURE__ */ new Set([
|
|
3989
3981
|
qe.Thinking,
|
|
3990
3982
|
qe.Generating,
|
|
3991
3983
|
qe.ExternalSources
|
|
3992
|
-
]),
|
|
3984
|
+
]), $i = ({ threadList: e }) => {
|
|
3993
3985
|
var v, w;
|
|
3994
|
-
const { channel: t, channelConfig: n, thread: a } =
|
|
3995
|
-
if (!e && o &&
|
|
3996
|
-
const b =
|
|
3986
|
+
const { channel: t, channelConfig: n, thread: a } = ue(), { client: r } = me(), { typing: i = {} } = _n(), { aiState: l } = Nn(t), o = Se(Fs);
|
|
3987
|
+
if (!e && o && Oi.has(l)) {
|
|
3988
|
+
const b = ji(t, (v = r.user) == null ? void 0 : v.id);
|
|
3997
3989
|
return /* @__PURE__ */ s(
|
|
3998
|
-
|
|
3990
|
+
as,
|
|
3999
3991
|
{
|
|
4000
3992
|
avatarId: (b == null ? void 0 : b.id) ?? "ai-agent",
|
|
4001
3993
|
avatarName: (b == null ? void 0 : b.name) ?? (b == null ? void 0 : b.id) ?? "Agent",
|
|
@@ -4021,7 +4013,7 @@ const xi = ({
|
|
|
4021
4013
|
return null;
|
|
4022
4014
|
const g = (w = h[0]) == null ? void 0 : w.user, c = g != null && g.id && t.state.members[g.id] ? t.state.members[g.id].user : void 0;
|
|
4023
4015
|
return /* @__PURE__ */ s(
|
|
4024
|
-
|
|
4016
|
+
as,
|
|
4025
4017
|
{
|
|
4026
4018
|
avatarId: (g == null ? void 0 : g.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
4027
4019
|
avatarName: (g == null ? void 0 : g.name) ?? (c == null ? void 0 : c.name) ?? (g == null ? void 0 : g.id) ?? "Typing user",
|
|
@@ -4029,7 +4021,7 @@ const xi = ({
|
|
|
4029
4021
|
testId: "typing-indicator"
|
|
4030
4022
|
}
|
|
4031
4023
|
);
|
|
4032
|
-
},
|
|
4024
|
+
}, as = ({
|
|
4033
4025
|
avatarId: e,
|
|
4034
4026
|
avatarName: t,
|
|
4035
4027
|
avatarImage: n,
|
|
@@ -4044,7 +4036,7 @@ const xi = ({
|
|
|
4044
4036
|
},
|
|
4045
4037
|
children: /* @__PURE__ */ m("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
4046
4038
|
/* @__PURE__ */ s(
|
|
4047
|
-
|
|
4039
|
+
se,
|
|
4048
4040
|
{
|
|
4049
4041
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4050
4042
|
id: e,
|
|
@@ -4064,16 +4056,16 @@ const xi = ({
|
|
|
4064
4056
|
height: "13",
|
|
4065
4057
|
overflow: "visible",
|
|
4066
4058
|
children: [
|
|
4067
|
-
/* @__PURE__ */ s(
|
|
4068
|
-
/* @__PURE__ */ s(
|
|
4069
|
-
/* @__PURE__ */ s(
|
|
4059
|
+
/* @__PURE__ */ s(Ze, { cx: "4", index: 0 }),
|
|
4060
|
+
/* @__PURE__ */ s(Ze, { cx: "16", index: 1 }),
|
|
4061
|
+
/* @__PURE__ */ s(Ze, { cx: "28", index: 2 })
|
|
4070
4062
|
]
|
|
4071
4063
|
}
|
|
4072
4064
|
) }) }) }) }) })
|
|
4073
4065
|
] })
|
|
4074
4066
|
}
|
|
4075
4067
|
);
|
|
4076
|
-
function
|
|
4068
|
+
function ji(e, t) {
|
|
4077
4069
|
var a;
|
|
4078
4070
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4079
4071
|
for (const r of Object.values(n)) {
|
|
@@ -4082,7 +4074,7 @@ function Vi(e, t) {
|
|
|
4082
4074
|
return i;
|
|
4083
4075
|
}
|
|
4084
4076
|
}
|
|
4085
|
-
const
|
|
4077
|
+
const Bi = () => null, Ui = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
4086
4078
|
"div",
|
|
4087
4079
|
{
|
|
4088
4080
|
className: k("flex items-center justify-center h-full", e),
|
|
@@ -4126,11 +4118,11 @@ const Gi = () => null, Hi = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
|
4126
4118
|
]
|
|
4127
4119
|
}
|
|
4128
4120
|
), je = U.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
4129
|
-
/* @__PURE__ */ s(
|
|
4121
|
+
/* @__PURE__ */ s(Ui, { className: "w-6 h-6" }),
|
|
4130
4122
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4131
4123
|
] }) }));
|
|
4132
4124
|
je.displayName = "LoadingState";
|
|
4133
|
-
const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant",
|
|
4125
|
+
const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant", Vi = ({
|
|
4134
4126
|
onBack: e,
|
|
4135
4127
|
showBackButton: t,
|
|
4136
4128
|
showStarButton: n = !1,
|
|
@@ -4149,8 +4141,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4149
4141
|
onParticipantNameClick: w,
|
|
4150
4142
|
renderHeaderTitleBadges: b
|
|
4151
4143
|
}) => {
|
|
4152
|
-
var A,
|
|
4153
|
-
const { channel: f } =
|
|
4144
|
+
var A, S, C, I, $, F;
|
|
4145
|
+
const { channel: f } = ue(), { client: x } = me(), N = U.useMemo(
|
|
4154
4146
|
() => {
|
|
4155
4147
|
var V;
|
|
4156
4148
|
return Ue(
|
|
@@ -4160,12 +4152,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4160
4152
|
);
|
|
4161
4153
|
},
|
|
4162
4154
|
[(A = f.state) == null ? void 0 : A.members, x == null ? void 0 : x.userID, f.type]
|
|
4163
|
-
),
|
|
4155
|
+
), E = ot(N == null ? void 0 : N.user), T = (S = N == null ? void 0 : N.user) == null ? void 0 : S.image, M = lt(f), D = b == null ? void 0 : b({
|
|
4164
4156
|
channel: f,
|
|
4165
4157
|
participant: N
|
|
4166
|
-
}),
|
|
4167
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children:
|
|
4168
|
-
|
|
4158
|
+
}), L = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", O = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ m(te, { children: [
|
|
4159
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: E }),
|
|
4160
|
+
D && /* @__PURE__ */ s("span", { className: "shrink-0", children: D })
|
|
4169
4161
|
] }), y = async () => {
|
|
4170
4162
|
try {
|
|
4171
4163
|
M ? await f.unpin() : await f.pin();
|
|
@@ -4189,7 +4181,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4189
4181
|
}),
|
|
4190
4182
|
type: "button",
|
|
4191
4183
|
"aria-label": "Back to conversations",
|
|
4192
|
-
children: /* @__PURE__ */ s(
|
|
4184
|
+
children: /* @__PURE__ */ s(Qe, { className: "size-5 text-black/90" })
|
|
4193
4185
|
}
|
|
4194
4186
|
) }),
|
|
4195
4187
|
/* @__PURE__ */ s(
|
|
@@ -4202,17 +4194,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4202
4194
|
{
|
|
4203
4195
|
type: "button",
|
|
4204
4196
|
onClick: w,
|
|
4205
|
-
"aria-label": `View details for ${
|
|
4197
|
+
"aria-label": `View details for ${E}`,
|
|
4206
4198
|
className: k(
|
|
4207
|
-
|
|
4199
|
+
L,
|
|
4208
4200
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4209
4201
|
),
|
|
4210
4202
|
children: [
|
|
4211
4203
|
/* @__PURE__ */ s(
|
|
4212
|
-
|
|
4204
|
+
se,
|
|
4213
4205
|
{
|
|
4214
4206
|
id: ((C = N == null ? void 0 : N.user) == null ? void 0 : C.id) || f.id || "unknown",
|
|
4215
|
-
name:
|
|
4207
|
+
name: E,
|
|
4216
4208
|
image: T,
|
|
4217
4209
|
starred: n && M,
|
|
4218
4210
|
dmAgentEnabled: a,
|
|
@@ -4229,12 +4221,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4229
4221
|
] })
|
|
4230
4222
|
]
|
|
4231
4223
|
}
|
|
4232
|
-
) : /* @__PURE__ */ m("div", { className:
|
|
4224
|
+
) : /* @__PURE__ */ m("div", { className: L, children: [
|
|
4233
4225
|
/* @__PURE__ */ s(
|
|
4234
|
-
|
|
4226
|
+
se,
|
|
4235
4227
|
{
|
|
4236
4228
|
id: ((I = N == null ? void 0 : N.user) == null ? void 0 : I.id) || f.id || "unknown",
|
|
4237
|
-
name:
|
|
4229
|
+
name: E,
|
|
4238
4230
|
image: T,
|
|
4239
4231
|
starred: n && M,
|
|
4240
4232
|
dmAgentEnabled: a,
|
|
@@ -4279,7 +4271,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4279
4271
|
}
|
|
4280
4272
|
),
|
|
4281
4273
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4282
|
-
|
|
4274
|
+
tt,
|
|
4283
4275
|
{
|
|
4284
4276
|
channel: f,
|
|
4285
4277
|
participant: N,
|
|
@@ -4309,7 +4301,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4309
4301
|
type: "button",
|
|
4310
4302
|
onClick: e,
|
|
4311
4303
|
"aria-label": "Back to conversations",
|
|
4312
|
-
children: /* @__PURE__ */ s(
|
|
4304
|
+
children: /* @__PURE__ */ s(Qe, { className: "size-5 text-black/90" })
|
|
4313
4305
|
}
|
|
4314
4306
|
),
|
|
4315
4307
|
w ? /* @__PURE__ */ m(
|
|
@@ -4317,17 +4309,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4317
4309
|
{
|
|
4318
4310
|
type: "button",
|
|
4319
4311
|
onClick: w,
|
|
4320
|
-
"aria-label": `View details for ${
|
|
4312
|
+
"aria-label": `View details for ${E}`,
|
|
4321
4313
|
className: k(
|
|
4322
4314
|
O,
|
|
4323
4315
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4324
4316
|
),
|
|
4325
4317
|
children: [
|
|
4326
4318
|
/* @__PURE__ */ s(
|
|
4327
|
-
|
|
4319
|
+
se,
|
|
4328
4320
|
{
|
|
4329
4321
|
id: (($ = N == null ? void 0 : N.user) == null ? void 0 : $.id) || f.id || "unknown",
|
|
4330
|
-
name:
|
|
4322
|
+
name: E,
|
|
4331
4323
|
image: T,
|
|
4332
4324
|
starred: n && M,
|
|
4333
4325
|
dmAgentEnabled: a,
|
|
@@ -4348,10 +4340,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4348
4340
|
}
|
|
4349
4341
|
) : /* @__PURE__ */ m("div", { className: O, children: [
|
|
4350
4342
|
/* @__PURE__ */ s(
|
|
4351
|
-
|
|
4343
|
+
se,
|
|
4352
4344
|
{
|
|
4353
4345
|
id: ((F = N == null ? void 0 : N.user) == null ? void 0 : F.id) || f.id || "unknown",
|
|
4354
|
-
name:
|
|
4346
|
+
name: E,
|
|
4355
4347
|
image: T,
|
|
4356
4348
|
starred: n && M,
|
|
4357
4349
|
dmAgentEnabled: a,
|
|
@@ -4397,7 +4389,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4397
4389
|
}
|
|
4398
4390
|
),
|
|
4399
4391
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4400
|
-
|
|
4392
|
+
tt,
|
|
4401
4393
|
{
|
|
4402
4394
|
channel: f,
|
|
4403
4395
|
participant: N,
|
|
@@ -4416,7 +4408,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4416
4408
|
] })
|
|
4417
4409
|
] })
|
|
4418
4410
|
] });
|
|
4419
|
-
},
|
|
4411
|
+
}, Gi = ({
|
|
4420
4412
|
onBack: e,
|
|
4421
4413
|
showBackButton: t,
|
|
4422
4414
|
renderMessageInputActions: n,
|
|
@@ -4437,16 +4429,16 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4437
4429
|
renderChannelBanner: f,
|
|
4438
4430
|
renderHeaderTitleBadges: x,
|
|
4439
4431
|
customChannelActions: N,
|
|
4440
|
-
renderChannelActions:
|
|
4432
|
+
renderChannelActions: E,
|
|
4441
4433
|
renderMessage: T,
|
|
4442
4434
|
dmAgentEnabled: M = !1,
|
|
4443
|
-
viewerLanguage:
|
|
4444
|
-
showChannelInfo:
|
|
4435
|
+
viewerLanguage: D,
|
|
4436
|
+
showChannelInfo: L = !0,
|
|
4445
4437
|
onParticipantNameClick: O,
|
|
4446
4438
|
composerInput: z
|
|
4447
4439
|
}) => {
|
|
4448
4440
|
var _, R, H, q;
|
|
4449
|
-
const { channel: y } =
|
|
4441
|
+
const { channel: y } = ue(), { client: A } = me(), S = U.useMemo(
|
|
4450
4442
|
() => {
|
|
4451
4443
|
var Y;
|
|
4452
4444
|
return Ue(
|
|
@@ -4460,17 +4452,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4460
4452
|
var W;
|
|
4461
4453
|
const Y = A == null ? void 0 : A.userID;
|
|
4462
4454
|
return Y ? Object.values(((W = y.state) == null ? void 0 : W.members) || {}).find((Z) => {
|
|
4463
|
-
var
|
|
4464
|
-
return ((
|
|
4455
|
+
var oe;
|
|
4456
|
+
return ((oe = Z.user) == null ? void 0 : oe.id) === Y;
|
|
4465
4457
|
}) : void 0;
|
|
4466
|
-
}, [A == null ? void 0 : A.userID, (R = y.state) == null ? void 0 : R.members]), I = ((H = C == null ? void 0 : C.user) == null ? void 0 : H.is_account) ?? (C == null ? void 0 : C.is_account), $ = ((q =
|
|
4458
|
+
}, [A == null ? void 0 : A.userID, (R = y.state) == null ? void 0 : R.members]), I = ((H = C == null ? void 0 : C.user) == null ? void 0 : H.is_account) ?? (C == null ? void 0 : C.is_account), $ = ((q = S == null ? void 0 : S.user) == null ? void 0 : q.is_account) ?? (S == null ? void 0 : S.is_account), F = M && I === !1 && $ === !0, V = y.state.messages.some(
|
|
4467
4459
|
(Y) => Y.type !== "deleted"
|
|
4468
|
-
), Q = f ? /* @__PURE__ */ s(U.Fragment, { children: f() }, "lt-channel-banner") : null,
|
|
4469
|
-
|
|
4460
|
+
), Q = f ? /* @__PURE__ */ s(U.Fragment, { children: f() }, "lt-channel-banner") : null, ee = O ? /* @__PURE__ */ s(
|
|
4461
|
+
fa,
|
|
4470
4462
|
{
|
|
4471
4463
|
onBack: e,
|
|
4472
4464
|
showBackButton: t,
|
|
4473
|
-
showChannelInfo:
|
|
4465
|
+
showChannelInfo: L,
|
|
4474
4466
|
showStarButton: w,
|
|
4475
4467
|
dmAgentEnabled: F,
|
|
4476
4468
|
onLeaveConversation: i,
|
|
@@ -4482,38 +4474,38 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4482
4474
|
onBlockParticipantClick: u,
|
|
4483
4475
|
onReportParticipantClick: p,
|
|
4484
4476
|
customChannelActions: N,
|
|
4485
|
-
renderChannelActions:
|
|
4477
|
+
renderChannelActions: E,
|
|
4486
4478
|
onParticipantNameClick: O
|
|
4487
4479
|
}
|
|
4488
4480
|
) : null, X = J(
|
|
4489
4481
|
(Y) => {
|
|
4490
|
-
const { message: j } =
|
|
4491
|
-
|
|
4482
|
+
const { message: j } = Ie("ChannelView"), W = /* @__PURE__ */ s(
|
|
4483
|
+
xi,
|
|
4492
4484
|
{
|
|
4493
4485
|
...Y,
|
|
4494
4486
|
chatbotVotingEnabled: b,
|
|
4495
|
-
viewerLanguage:
|
|
4487
|
+
viewerLanguage: D
|
|
4496
4488
|
}
|
|
4497
4489
|
);
|
|
4498
4490
|
return !T || !j ? W : T(W, j);
|
|
4499
4491
|
},
|
|
4500
|
-
[b, T,
|
|
4492
|
+
[b, T, D]
|
|
4501
4493
|
);
|
|
4502
|
-
return /* @__PURE__ */ s(
|
|
4503
|
-
|
|
4494
|
+
return /* @__PURE__ */ s(te, { children: /* @__PURE__ */ s(
|
|
4495
|
+
kn,
|
|
4504
4496
|
{
|
|
4505
4497
|
overrides: {
|
|
4506
4498
|
Message: X,
|
|
4507
|
-
MessageActions:
|
|
4499
|
+
MessageActions: Ni
|
|
4508
4500
|
},
|
|
4509
|
-
children: /* @__PURE__ */ m(
|
|
4510
|
-
!O && /* @__PURE__ */ m(
|
|
4501
|
+
children: /* @__PURE__ */ m(Cn, { children: [
|
|
4502
|
+
!O && /* @__PURE__ */ m(te, { children: [
|
|
4511
4503
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4512
|
-
|
|
4504
|
+
Vi,
|
|
4513
4505
|
{
|
|
4514
4506
|
onBack: e,
|
|
4515
4507
|
showBackButton: t,
|
|
4516
|
-
showChannelInfo:
|
|
4508
|
+
showChannelInfo: L,
|
|
4517
4509
|
showStarButton: w,
|
|
4518
4510
|
dmAgentEnabled: F,
|
|
4519
4511
|
onLeaveConversation: i,
|
|
@@ -4525,14 +4517,14 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4525
4517
|
onBlockParticipantClick: u,
|
|
4526
4518
|
onReportParticipantClick: p,
|
|
4527
4519
|
customChannelActions: N,
|
|
4528
|
-
renderChannelActions:
|
|
4520
|
+
renderChannelActions: E,
|
|
4529
4521
|
renderHeaderTitleBadges: x
|
|
4530
4522
|
}
|
|
4531
4523
|
) }, "lt-channel-header"),
|
|
4532
4524
|
Q
|
|
4533
4525
|
] }),
|
|
4534
4526
|
O && !V && /* @__PURE__ */ m("div", { className: "px-4 @lg:px-6", children: [
|
|
4535
|
-
|
|
4527
|
+
ee,
|
|
4536
4528
|
Q
|
|
4537
4529
|
] }),
|
|
4538
4530
|
/* @__PURE__ */ s(
|
|
@@ -4540,10 +4532,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4540
4532
|
{
|
|
4541
4533
|
className: "flex-1 overflow-hidden relative",
|
|
4542
4534
|
children: /* @__PURE__ */ s(
|
|
4543
|
-
|
|
4535
|
+
En,
|
|
4544
4536
|
{
|
|
4545
4537
|
head: O && V ? /* @__PURE__ */ m("div", { className: "sticky top-0 z-10", children: [
|
|
4546
|
-
|
|
4538
|
+
ee,
|
|
4547
4539
|
Q
|
|
4548
4540
|
] }) : void 0,
|
|
4549
4541
|
hideDeletedMessages: !0,
|
|
@@ -4555,7 +4547,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4555
4547
|
),
|
|
4556
4548
|
r ? /* @__PURE__ */ s(U.Fragment, { children: r(y) }, "lt-channel-conversation-footer") : null,
|
|
4557
4549
|
/* @__PURE__ */ s(
|
|
4558
|
-
|
|
4550
|
+
Ii,
|
|
4559
4551
|
{
|
|
4560
4552
|
...n && {
|
|
4561
4553
|
renderActions: () => n == null ? void 0 : n(y)
|
|
@@ -4570,7 +4562,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4570
4562
|
] })
|
|
4571
4563
|
}
|
|
4572
4564
|
) });
|
|
4573
|
-
},
|
|
4565
|
+
}, Os = U.memo(
|
|
4574
4566
|
({
|
|
4575
4567
|
channel: e,
|
|
4576
4568
|
onBack: t,
|
|
@@ -4581,7 +4573,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4581
4573
|
onLeaveConversation: l,
|
|
4582
4574
|
onBlockParticipant: o,
|
|
4583
4575
|
className: d,
|
|
4584
|
-
CustomChannelEmptyState: u =
|
|
4576
|
+
CustomChannelEmptyState: u = Bi,
|
|
4585
4577
|
showDeleteConversation: p = !0,
|
|
4586
4578
|
onDeleteConversationClick: h,
|
|
4587
4579
|
onBlockParticipantClick: g,
|
|
@@ -4592,16 +4584,16 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4592
4584
|
composerDisabledReason: f,
|
|
4593
4585
|
dmAgentEnabled: x,
|
|
4594
4586
|
messageMetadata: N,
|
|
4595
|
-
onMessageSent:
|
|
4587
|
+
onMessageSent: E,
|
|
4596
4588
|
showStarButton: T = !1,
|
|
4597
4589
|
chatbotVotingEnabled: M = !1,
|
|
4598
|
-
renderChannelBanner:
|
|
4599
|
-
renderHeaderTitleBadges:
|
|
4590
|
+
renderChannelBanner: D,
|
|
4591
|
+
renderHeaderTitleBadges: L,
|
|
4600
4592
|
customChannelActions: O,
|
|
4601
4593
|
renderChannelActions: z,
|
|
4602
4594
|
renderMessage: y,
|
|
4603
4595
|
onMessageLinkClick: A,
|
|
4604
|
-
sendButton:
|
|
4596
|
+
sendButton: S,
|
|
4605
4597
|
attachmentPreviewList: C,
|
|
4606
4598
|
viewerLanguage: I,
|
|
4607
4599
|
showChannelInfo: $ = !0,
|
|
@@ -4624,43 +4616,43 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4624
4616
|
...R,
|
|
4625
4617
|
...q && { skip_push: !0 }
|
|
4626
4618
|
}, W = await e.sendMessage(Y, j);
|
|
4627
|
-
return
|
|
4619
|
+
return E == null || E(W), W;
|
|
4628
4620
|
},
|
|
4629
|
-
[e, x, N,
|
|
4630
|
-
),
|
|
4621
|
+
[e, x, N, E]
|
|
4622
|
+
), ee = G(null);
|
|
4631
4623
|
return K(() => {
|
|
4632
4624
|
if (!A) return;
|
|
4633
|
-
const X =
|
|
4625
|
+
const X = ee.current;
|
|
4634
4626
|
if (!X) return;
|
|
4635
4627
|
const _ = (R) => {
|
|
4636
4628
|
const H = R.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4637
4629
|
if (!Y) return;
|
|
4638
|
-
const j = q == null ? void 0 : q.closest("[data-message-id]"), W = j == null ? void 0 : j.getAttribute("data-message-id"), Z = W ? e.state.messages.find((
|
|
4630
|
+
const j = q == null ? void 0 : q.closest("[data-message-id]"), W = j == null ? void 0 : j.getAttribute("data-message-id"), Z = W ? e.state.messages.find((oe) => oe.id === W) : void 0;
|
|
4639
4631
|
A(Y, Z);
|
|
4640
4632
|
};
|
|
4641
4633
|
return X.addEventListener("click", _), () => X.removeEventListener("click", _);
|
|
4642
4634
|
}, [A, e]), /* @__PURE__ */ s(
|
|
4643
4635
|
"div",
|
|
4644
4636
|
{
|
|
4645
|
-
ref:
|
|
4637
|
+
ref: ee,
|
|
4646
4638
|
className: k(
|
|
4647
4639
|
"messaging-channel-view h-full flex flex-col",
|
|
4648
4640
|
d
|
|
4649
4641
|
),
|
|
4650
|
-
children: /* @__PURE__ */ s(
|
|
4651
|
-
|
|
4642
|
+
children: /* @__PURE__ */ s(Fs.Provider, { value: x ?? !1, children: /* @__PURE__ */ s(
|
|
4643
|
+
yn,
|
|
4652
4644
|
{
|
|
4653
4645
|
channel: e,
|
|
4654
|
-
MessageSystem:
|
|
4646
|
+
MessageSystem: Fi,
|
|
4655
4647
|
EmptyStateIndicator: u,
|
|
4656
4648
|
LoadingIndicator: je,
|
|
4657
|
-
DateSeparator:
|
|
4658
|
-
TypingIndicator:
|
|
4649
|
+
DateSeparator: ga,
|
|
4650
|
+
TypingIndicator: $i,
|
|
4659
4651
|
doSendMessageRequest: Q,
|
|
4660
|
-
...
|
|
4652
|
+
...S ? { SendButton: S } : {},
|
|
4661
4653
|
...C ? { AttachmentPreviewList: C } : {},
|
|
4662
4654
|
children: /* @__PURE__ */ s(
|
|
4663
|
-
|
|
4655
|
+
Gi,
|
|
4664
4656
|
{
|
|
4665
4657
|
onBack: t,
|
|
4666
4658
|
showBackButton: n,
|
|
@@ -4681,8 +4673,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4681
4673
|
showStarButton: T,
|
|
4682
4674
|
dmAgentEnabled: x,
|
|
4683
4675
|
chatbotVotingEnabled: M,
|
|
4684
|
-
renderChannelBanner:
|
|
4685
|
-
renderHeaderTitleBadges:
|
|
4676
|
+
renderChannelBanner: D,
|
|
4677
|
+
renderHeaderTitleBadges: L,
|
|
4686
4678
|
customChannelActions: O,
|
|
4687
4679
|
renderChannelActions: z,
|
|
4688
4680
|
renderMessage: y,
|
|
@@ -4698,8 +4690,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4698
4690
|
);
|
|
4699
4691
|
}
|
|
4700
4692
|
);
|
|
4701
|
-
|
|
4702
|
-
const
|
|
4693
|
+
Os.displayName = "ChannelView";
|
|
4694
|
+
const ye = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ m("div", { className: "text-center max-w-sm", children: [
|
|
4703
4695
|
/* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
4704
4696
|
/* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4705
4697
|
/* @__PURE__ */ s("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4713,8 +4705,8 @@ const ke = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4713
4705
|
}
|
|
4714
4706
|
)
|
|
4715
4707
|
] }) }));
|
|
4716
|
-
|
|
4717
|
-
const
|
|
4708
|
+
ye.displayName = "ErrorState";
|
|
4709
|
+
const ul = ({
|
|
4718
4710
|
capabilities: e = {},
|
|
4719
4711
|
renderMessageInputActions: t,
|
|
4720
4712
|
renderConversationFooter: n,
|
|
@@ -4735,19 +4727,19 @@ const fl = ({
|
|
|
4735
4727
|
renderChannelActions: f,
|
|
4736
4728
|
onParticipantNameClick: x,
|
|
4737
4729
|
renderMessage: N,
|
|
4738
|
-
onMessageLinkClick:
|
|
4730
|
+
onMessageLinkClick: E,
|
|
4739
4731
|
showChannelInfo: T,
|
|
4740
4732
|
composerInput: M
|
|
4741
4733
|
}) => {
|
|
4742
4734
|
const {
|
|
4743
|
-
client:
|
|
4744
|
-
isConnected:
|
|
4735
|
+
client: D,
|
|
4736
|
+
isConnected: L,
|
|
4745
4737
|
isLoading: O,
|
|
4746
4738
|
error: z,
|
|
4747
4739
|
refreshConnection: y,
|
|
4748
4740
|
service: A,
|
|
4749
|
-
debug:
|
|
4750
|
-
} =
|
|
4741
|
+
debug: S
|
|
4742
|
+
} = ea(), [C, I] = B(null), [$, F] = B(null), [V, Q] = B(!1), { showDeleteConversation: ee = !0 } = e, X = G(l);
|
|
4751
4743
|
X.current = l;
|
|
4752
4744
|
const _ = G(a);
|
|
4753
4745
|
_.current = a;
|
|
@@ -4755,8 +4747,8 @@ const fl = ({
|
|
|
4755
4747
|
K(() => {
|
|
4756
4748
|
H.current = C;
|
|
4757
4749
|
}, [C]), K(() => {
|
|
4758
|
-
if (!
|
|
4759
|
-
const j =
|
|
4750
|
+
if (!D || !L) return;
|
|
4751
|
+
const j = D.userID;
|
|
4760
4752
|
if (!j) return;
|
|
4761
4753
|
const W = `${j}::${i}`;
|
|
4762
4754
|
if (R.current === W) return;
|
|
@@ -4765,13 +4757,13 @@ const fl = ({
|
|
|
4765
4757
|
R.current === W && (R.current = null);
|
|
4766
4758
|
};
|
|
4767
4759
|
(async () => {
|
|
4768
|
-
var
|
|
4760
|
+
var Le, De;
|
|
4769
4761
|
try {
|
|
4770
|
-
|
|
4762
|
+
S && console.log(
|
|
4771
4763
|
"[MessagingShell] Loading initial conversation with:",
|
|
4772
4764
|
i
|
|
4773
4765
|
);
|
|
4774
|
-
const
|
|
4766
|
+
const ne = await D.queryChannels(
|
|
4775
4767
|
{
|
|
4776
4768
|
type: "messaging",
|
|
4777
4769
|
members: { $eq: [j, i] }
|
|
@@ -4779,16 +4771,16 @@ const fl = ({
|
|
|
4779
4771
|
{},
|
|
4780
4772
|
{ limit: 1 }
|
|
4781
4773
|
);
|
|
4782
|
-
if (
|
|
4783
|
-
I(
|
|
4774
|
+
if (ne.length > 0) {
|
|
4775
|
+
I(ne[0]), F(null), (Le = _.current) == null || Le.call(_, ne[0]), S && console.log(
|
|
4784
4776
|
"[MessagingShell] Initial conversation loaded:",
|
|
4785
|
-
|
|
4777
|
+
ne[0].id
|
|
4786
4778
|
);
|
|
4787
4779
|
return;
|
|
4788
4780
|
}
|
|
4789
|
-
const
|
|
4790
|
-
if (!
|
|
4791
|
-
Z(), F("No conversation found with this account"),
|
|
4781
|
+
const ce = X.current;
|
|
4782
|
+
if (!ce || !A) {
|
|
4783
|
+
Z(), F("No conversation found with this account"), S && console.log(
|
|
4792
4784
|
"[MessagingShell] No conversation found for:",
|
|
4793
4785
|
i
|
|
4794
4786
|
);
|
|
@@ -4796,11 +4788,11 @@ const fl = ({
|
|
|
4796
4788
|
}
|
|
4797
4789
|
try {
|
|
4798
4790
|
const ie = await A.startChannelWithParticipant({
|
|
4799
|
-
id:
|
|
4800
|
-
name:
|
|
4801
|
-
phone:
|
|
4791
|
+
id: ce.id,
|
|
4792
|
+
name: ce.name,
|
|
4793
|
+
phone: ce.phone
|
|
4802
4794
|
});
|
|
4803
|
-
I(ie), F(null), (
|
|
4795
|
+
I(ie), F(null), (De = _.current) == null || De.call(_, ie), S && console.log(
|
|
4804
4796
|
"[MessagingShell] Channel created and loaded:",
|
|
4805
4797
|
ie.id
|
|
4806
4798
|
);
|
|
@@ -4810,28 +4802,28 @@ const fl = ({
|
|
|
4810
4802
|
ie
|
|
4811
4803
|
), Z(), F("Failed to create conversation");
|
|
4812
4804
|
}
|
|
4813
|
-
} catch (
|
|
4805
|
+
} catch (ne) {
|
|
4814
4806
|
console.error(
|
|
4815
4807
|
"[MessagingShell] Failed to load initial conversation:",
|
|
4816
|
-
|
|
4808
|
+
ne
|
|
4817
4809
|
), Z(), H.current || F("Failed to load conversation");
|
|
4818
4810
|
}
|
|
4819
4811
|
})();
|
|
4820
|
-
}, [i,
|
|
4812
|
+
}, [i, D, L, A, S]);
|
|
4821
4813
|
const q = G(r);
|
|
4822
4814
|
q.current = r;
|
|
4823
4815
|
const Y = J(() => {
|
|
4824
4816
|
var j;
|
|
4825
4817
|
I(null), Q(!0), (j = q.current) == null || j.call(q);
|
|
4826
4818
|
}, []);
|
|
4827
|
-
return O ? /* @__PURE__ */ s(je, {}) : z ? /* @__PURE__ */ s(
|
|
4828
|
-
|
|
4819
|
+
return O ? /* @__PURE__ */ s(je, {}) : z ? /* @__PURE__ */ s(ye, { message: z, onBack: y }) : !L || !D ? /* @__PURE__ */ s(
|
|
4820
|
+
ye,
|
|
4829
4821
|
{
|
|
4830
4822
|
message: "Not connected to messaging service",
|
|
4831
4823
|
onBack: y
|
|
4832
4824
|
}
|
|
4833
|
-
) : $ ? /* @__PURE__ */ s(
|
|
4834
|
-
|
|
4825
|
+
) : $ ? /* @__PURE__ */ s(ye, { message: $ }) : V && !C ? /* @__PURE__ */ s(ye, { message: "Conversation ended" }) : C ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
|
|
4826
|
+
Os,
|
|
4835
4827
|
{
|
|
4836
4828
|
channel: C,
|
|
4837
4829
|
renderMessageInputActions: t,
|
|
@@ -4840,7 +4832,7 @@ const fl = ({
|
|
|
4840
4832
|
onLeaveConversation: Y,
|
|
4841
4833
|
onBlockParticipant: Y,
|
|
4842
4834
|
CustomChannelEmptyState: o,
|
|
4843
|
-
showDeleteConversation:
|
|
4835
|
+
showDeleteConversation: ee,
|
|
4844
4836
|
onBlockParticipantClick: d,
|
|
4845
4837
|
onReportParticipantClick: u,
|
|
4846
4838
|
dmAgentEnabled: p,
|
|
@@ -4852,20 +4844,20 @@ const fl = ({
|
|
|
4852
4844
|
renderChannelActions: f,
|
|
4853
4845
|
onParticipantNameClick: x,
|
|
4854
4846
|
renderMessage: N,
|
|
4855
|
-
onMessageLinkClick:
|
|
4847
|
+
onMessageLinkClick: E,
|
|
4856
4848
|
showChannelInfo: T,
|
|
4857
4849
|
composerInput: M
|
|
4858
4850
|
},
|
|
4859
4851
|
C.id
|
|
4860
4852
|
) }) }) : /* @__PURE__ */ s(je, {});
|
|
4861
4853
|
};
|
|
4862
|
-
function
|
|
4854
|
+
function Hi(e) {
|
|
4863
4855
|
const t = e.state.pending_messages;
|
|
4864
4856
|
if (t != null && t.length)
|
|
4865
4857
|
for (const n of t)
|
|
4866
4858
|
e.state.addMessageSorted(n.message);
|
|
4867
4859
|
}
|
|
4868
|
-
const
|
|
4860
|
+
const $s = U.createContext({
|
|
4869
4861
|
selectedChannel: void 0,
|
|
4870
4862
|
onChannelSelect: () => {
|
|
4871
4863
|
},
|
|
@@ -4873,18 +4865,18 @@ const js = U.createContext({
|
|
|
4873
4865
|
renderMessagePreview: void 0,
|
|
4874
4866
|
channelPreview: void 0,
|
|
4875
4867
|
viewerLanguage: void 0
|
|
4876
|
-
}),
|
|
4868
|
+
}), Yi = $s.Provider, qi = () => U.useContext($s), Wi = (e, t) => {
|
|
4877
4869
|
const n = new Date(
|
|
4878
4870
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4879
4871
|
), r = new Date(
|
|
4880
4872
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4881
4873
|
).getTime() - n.getTime();
|
|
4882
4874
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4883
|
-
},
|
|
4875
|
+
}, Xi = (e) => {
|
|
4884
4876
|
const t = /* @__PURE__ */ new Date();
|
|
4885
4877
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4886
4878
|
return "Just now";
|
|
4887
|
-
const a =
|
|
4879
|
+
const a = Wi(e, t);
|
|
4888
4880
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4889
4881
|
hour: "numeric",
|
|
4890
4882
|
minute: "2-digit",
|
|
@@ -4894,9 +4886,9 @@ const js = U.createContext({
|
|
|
4894
4886
|
day: "numeric",
|
|
4895
4887
|
year: "2-digit"
|
|
4896
4888
|
});
|
|
4897
|
-
},
|
|
4889
|
+
}, js = U.memo(
|
|
4898
4890
|
(e) => {
|
|
4899
|
-
var
|
|
4891
|
+
var L, O, z;
|
|
4900
4892
|
const { channel: t, unread: n } = e, {
|
|
4901
4893
|
selectedChannel: a,
|
|
4902
4894
|
onChannelSelect: r,
|
|
@@ -4904,7 +4896,7 @@ const js = U.createContext({
|
|
|
4904
4896
|
channelPreview: l,
|
|
4905
4897
|
renderMessagePreview: o,
|
|
4906
4898
|
viewerLanguage: d
|
|
4907
|
-
} =
|
|
4899
|
+
} = qi(), { client: u } = me(), p = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = lt(t);
|
|
4908
4900
|
if (l)
|
|
4909
4901
|
return /* @__PURE__ */ s(
|
|
4910
4902
|
l,
|
|
@@ -4919,22 +4911,22 @@ const js = U.createContext({
|
|
|
4919
4911
|
const g = () => {
|
|
4920
4912
|
t && r(t);
|
|
4921
4913
|
}, c = (y) => {
|
|
4922
|
-
const A = y.key === "Enter" || y.key === " ",
|
|
4923
|
-
!A ||
|
|
4914
|
+
const A = y.key === "Enter" || y.key === " ", S = y.repeat;
|
|
4915
|
+
!A || S || (y.preventDefault(), g());
|
|
4924
4916
|
}, v = Ue(
|
|
4925
|
-
(
|
|
4917
|
+
(L = t == null ? void 0 : t.state) == null ? void 0 : L.members,
|
|
4926
4918
|
u == null ? void 0 : u.userID,
|
|
4927
4919
|
t == null ? void 0 : t.type
|
|
4928
|
-
), w =
|
|
4920
|
+
), w = ot(v == null ? void 0 : v.user), b = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, f = (() => {
|
|
4929
4921
|
var A;
|
|
4930
4922
|
const y = (A = t == null ? void 0 : t.state) == null ? void 0 : A.messages;
|
|
4931
4923
|
if (y != null && y.length) {
|
|
4932
|
-
for (let
|
|
4933
|
-
if (y[
|
|
4924
|
+
for (let S = y.length - 1; S >= 0; S--)
|
|
4925
|
+
if (y[S].type !== "system") return y[S];
|
|
4934
4926
|
}
|
|
4935
4927
|
})(), N = (() => {
|
|
4936
4928
|
var $, F, V, Q;
|
|
4937
|
-
const y =
|
|
4929
|
+
const y = ms({
|
|
4938
4930
|
message: f,
|
|
4939
4931
|
viewerLanguage: d
|
|
4940
4932
|
});
|
|
@@ -4945,13 +4937,13 @@ const js = U.createContext({
|
|
|
4945
4937
|
if (y) return y;
|
|
4946
4938
|
const I = (Q = f == null ? void 0 : f.attachments) == null ? void 0 : Q[0];
|
|
4947
4939
|
return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4948
|
-
})(),
|
|
4940
|
+
})(), E = f != null && f.created_at ? Xi(new Date(f.created_at)) : "", T = f ? Fe(f) : !1, M = o ? o(f, N) : `${T ? "✨ " : ""}${N}`, D = n ?? 0;
|
|
4949
4941
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4950
4942
|
channelId: t == null ? void 0 : t.id,
|
|
4951
4943
|
isSelected: p,
|
|
4952
4944
|
participantName: w,
|
|
4953
|
-
unreadCount:
|
|
4954
|
-
hasTimestamp: !!
|
|
4945
|
+
unreadCount: D,
|
|
4946
|
+
hasTimestamp: !!E
|
|
4955
4947
|
}), /* @__PURE__ */ s(
|
|
4956
4948
|
"div",
|
|
4957
4949
|
{
|
|
@@ -4969,7 +4961,7 @@ const js = U.createContext({
|
|
|
4969
4961
|
"data-dd-privacy": "mask",
|
|
4970
4962
|
children: /* @__PURE__ */ m("div", { className: "flex items-start gap-4", children: [
|
|
4971
4963
|
/* @__PURE__ */ s(
|
|
4972
|
-
|
|
4964
|
+
se,
|
|
4973
4965
|
{
|
|
4974
4966
|
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || t.id || "unknown",
|
|
4975
4967
|
name: w,
|
|
@@ -4992,11 +4984,11 @@ const js = U.createContext({
|
|
|
4992
4984
|
]
|
|
4993
4985
|
}
|
|
4994
4986
|
),
|
|
4995
|
-
|
|
4987
|
+
E && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: E })
|
|
4996
4988
|
] }),
|
|
4997
4989
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4998
4990
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
4999
|
-
|
|
4991
|
+
D > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: D > 99 ? "99+" : D })
|
|
5000
4992
|
] })
|
|
5001
4993
|
] })
|
|
5002
4994
|
] })
|
|
@@ -5004,28 +4996,28 @@ const js = U.createContext({
|
|
|
5004
4996
|
);
|
|
5005
4997
|
}
|
|
5006
4998
|
);
|
|
5007
|
-
|
|
5008
|
-
const
|
|
4999
|
+
js.displayName = "CustomChannelPreview";
|
|
5000
|
+
const Ki = { last_message_at: -1 }, Ji = U.memo(
|
|
5009
5001
|
({
|
|
5010
5002
|
onChannelSelect: e,
|
|
5011
5003
|
selectedChannel: t,
|
|
5012
5004
|
filters: n,
|
|
5013
5005
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
5014
5006
|
channelRenderFilterFn: r,
|
|
5015
|
-
sort: i =
|
|
5007
|
+
sort: i = Ki,
|
|
5016
5008
|
className: l,
|
|
5017
5009
|
customEmptyStateIndicator: o,
|
|
5018
|
-
channelListPaginator: d =
|
|
5010
|
+
channelListPaginator: d = In,
|
|
5019
5011
|
channelPreview: u,
|
|
5020
5012
|
renderMessagePreview: p,
|
|
5021
5013
|
viewerLanguage: h
|
|
5022
5014
|
}) => {
|
|
5023
5015
|
const g = U.useRef(0);
|
|
5024
5016
|
g.current++;
|
|
5025
|
-
const { debug: c = !1 } =
|
|
5017
|
+
const { debug: c = !1 } = it(), v = U.useCallback(
|
|
5026
5018
|
(b) => {
|
|
5027
5019
|
for (const f of b)
|
|
5028
|
-
|
|
5020
|
+
Hi(f);
|
|
5029
5021
|
return r ? r(b) : b;
|
|
5030
5022
|
},
|
|
5031
5023
|
[r]
|
|
@@ -5060,8 +5052,8 @@ const Qi = { last_message_at: -1 }, el = U.memo(
|
|
|
5060
5052
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
5061
5053
|
l
|
|
5062
5054
|
),
|
|
5063
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
5064
|
-
|
|
5055
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Yi, { value: w, children: /* @__PURE__ */ s(
|
|
5056
|
+
Sn,
|
|
5065
5057
|
{
|
|
5066
5058
|
filters: n,
|
|
5067
5059
|
sort: i,
|
|
@@ -5069,7 +5061,7 @@ const Qi = { last_message_at: -1 }, el = U.memo(
|
|
|
5069
5061
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
5070
5062
|
channelRenderFilterFn: v,
|
|
5071
5063
|
Paginator: d,
|
|
5072
|
-
Preview:
|
|
5064
|
+
Preview: js,
|
|
5073
5065
|
EmptyStateIndicator: o
|
|
5074
5066
|
},
|
|
5075
5067
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -5078,8 +5070,8 @@ const Qi = { last_message_at: -1 }, el = U.memo(
|
|
|
5078
5070
|
);
|
|
5079
5071
|
}
|
|
5080
5072
|
);
|
|
5081
|
-
|
|
5082
|
-
const
|
|
5073
|
+
Ji.displayName = "ChannelList";
|
|
5074
|
+
const Zi = ({
|
|
5083
5075
|
question: e,
|
|
5084
5076
|
onClick: t,
|
|
5085
5077
|
loading: n = !1,
|
|
@@ -5101,7 +5093,7 @@ const tl = ({
|
|
|
5101
5093
|
),
|
|
5102
5094
|
children: e
|
|
5103
5095
|
}
|
|
5104
|
-
),
|
|
5096
|
+
), ml = ({
|
|
5105
5097
|
faqs: e,
|
|
5106
5098
|
onFaqClick: t,
|
|
5107
5099
|
loadingFaqId: n,
|
|
@@ -5113,7 +5105,7 @@ const tl = ({
|
|
|
5113
5105
|
const o = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
|
|
5114
5106
|
return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ m("div", { className: "flex gap-3 items-end", children: [
|
|
5115
5107
|
(i || l) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
|
|
5116
|
-
|
|
5108
|
+
se,
|
|
5117
5109
|
{
|
|
5118
5110
|
id: l || "account",
|
|
5119
5111
|
name: l || "Account",
|
|
@@ -5130,7 +5122,7 @@ const tl = ({
|
|
|
5130
5122
|
children: [
|
|
5131
5123
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5132
5124
|
o.map((d) => /* @__PURE__ */ s(
|
|
5133
|
-
|
|
5125
|
+
Zi,
|
|
5134
5126
|
{
|
|
5135
5127
|
question: d.question,
|
|
5136
5128
|
onClick: () => t(d.id),
|
|
@@ -5144,40 +5136,40 @@ const tl = ({
|
|
|
5144
5136
|
] }) });
|
|
5145
5137
|
};
|
|
5146
5138
|
export {
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5139
|
+
ps as A,
|
|
5140
|
+
dl as B,
|
|
5141
|
+
Bi as C,
|
|
5142
|
+
$r as D,
|
|
5143
|
+
ba as E,
|
|
5144
|
+
ml as F,
|
|
5145
|
+
ea as G,
|
|
5146
|
+
Qt as L,
|
|
5147
|
+
ol as M,
|
|
5148
|
+
_e as a,
|
|
5149
|
+
se as b,
|
|
5150
|
+
Ji as c,
|
|
5151
|
+
Os as d,
|
|
5152
|
+
cl as e,
|
|
5153
|
+
Zi as f,
|
|
5154
|
+
le as g,
|
|
5155
|
+
Jt as h,
|
|
5156
|
+
Ne as i,
|
|
5157
|
+
Yr as j,
|
|
5158
|
+
ll as k,
|
|
5159
|
+
ul as l,
|
|
5160
|
+
nr as m,
|
|
5161
|
+
er as n,
|
|
5162
|
+
Xi as o,
|
|
5163
|
+
sr as p,
|
|
5164
|
+
ms as q,
|
|
5173
5165
|
we as r,
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5166
|
+
xs as s,
|
|
5167
|
+
aa as t,
|
|
5168
|
+
qa as u,
|
|
5169
|
+
va as v,
|
|
5178
5170
|
Ue as w,
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5171
|
+
mt as x,
|
|
5172
|
+
ht as y,
|
|
5173
|
+
ot as z
|
|
5182
5174
|
};
|
|
5183
|
-
//# sourceMappingURL=index-
|
|
5175
|
+
//# sourceMappingURL=index-DPwo1avm.js.map
|