@linktr.ee/messaging-react 1.39.0 → 1.40.1
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-D3E-WTRO.js → Card-CmnkZNNQ.js} +2 -2
- package/dist/{Card-D3E-WTRO.js.map → Card-CmnkZNNQ.js.map} +1 -1
- package/dist/{Card-BjTfMGsC.js → Card-QrKCxqCI.js} +2 -2
- package/dist/{Card-BjTfMGsC.js.map → Card-QrKCxqCI.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-j4j9UfK1.js → index-8ZuHtwFb.js} +314 -324
- package/dist/index-8ZuHtwFb.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/index.tsx +3 -2
- package/src/components/CustomMessage/MessageVoteButtons.stories.tsx +86 -0
- package/src/components/CustomMessage/MessageVoteButtons.tsx +14 -32
- package/src/components/CustomMessage/index.tsx +3 -0
- package/src/styles.css +84 -8
- package/dist/index-j4j9UfK1.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import O, { createContext as ot, useContext as lt, useCallback as G, useState as A, useRef as
|
|
2
|
+
import D from "classnames";
|
|
3
|
+
import O, { createContext as ot, useContext as lt, useCallback as G, useState as A, useRef as K, useEffect as J, useMemo as Ce, Suspense as ct } from "react";
|
|
4
4
|
import { StreamChatService as Tt } from "@linktr.ee/messaging-core";
|
|
5
|
-
import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as
|
|
6
|
-
import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs,
|
|
5
|
+
import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as zt, MessageDeleted as Bt, MessageIsThreadReplyInChannelButtonIndicator as $t, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as Wt, isMessageBlocked as qt, isMessageBounced as Xt, MessageBounceModal as Zt, MessageText as Xe, Poll as Jt, MessageErrorIcon as Kt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as is, TextareaComposer as os, MessageTimestamp as ve, useTypingContext as ls, Channel as cs, WithComponents as ds, Window as us, MessageList as ms } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs, ThumbsUpIcon as bs, ThumbsDownIcon as ps, ArrowUpIcon as xs, SparkleIcon as Se, ProhibitIcon as vs, ArrowLeftIcon as Je, CaretRightIcon as Ke, DotsThreeIcon as Qe, FileIcon as ht, ImageIcon as ws, SpeakerHighIcon as _s, VideoCameraIcon as ys, FileMdIcon as Ns, FileTextIcon as Cs, FileZipIcon as Es, FilePptIcon as Ss, FileCsvIcon as Is, FileXlsIcon as ks, FileDocIcon as Ms, FilePdfIcon as Ts, CircleNotchIcon as ft, PlayIcon as et, PauseIcon as Ds, LinkIcon as Rs, DownloadSimpleIcon as Ls } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as tt } from "stream-chat";
|
|
8
8
|
const gt = ot({
|
|
9
9
|
service: null,
|
|
@@ -35,12 +35,12 @@ const gt = ot({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a,
|
|
38
|
+
const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, N] = A(!1), [b, C] = A(null), x = K(!1), I = K({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: o
|
|
43
|
-
}), w =
|
|
43
|
+
}), w = K(0);
|
|
44
44
|
w.current++, i("📊 RENDER INFO", {
|
|
45
45
|
renderCount: w.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
@@ -55,7 +55,7 @@ const gt = ot({
|
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: o
|
|
58
|
-
},
|
|
58
|
+
}, J(() => {
|
|
59
59
|
const k = w.current;
|
|
60
60
|
if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: k,
|
|
@@ -94,8 +94,8 @@ const gt = ot({
|
|
|
94
94
|
}), T.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [r, n, l, i]);
|
|
97
|
-
const E =
|
|
98
|
-
|
|
97
|
+
const E = K(null);
|
|
98
|
+
J(() => {
|
|
99
99
|
var T, M;
|
|
100
100
|
if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
@@ -120,28 +120,28 @@ const gt = ot({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0,
|
|
123
|
+
i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0, N(!0), C(null);
|
|
124
124
|
try {
|
|
125
125
|
i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
h(
|
|
126
|
+
const y = await c.connectUser(s);
|
|
127
|
+
h(y), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: y.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
C(
|
|
131
|
+
} catch (y) {
|
|
132
|
+
const _ = y instanceof Error ? y.message : "Connection failed";
|
|
133
|
+
C(_), i("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: _
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
N(!1), x.current = !1, i("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: f
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, i, f]),
|
|
144
|
+
}, [c, s, i, f]), J(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
146
|
isConnected: f
|
|
147
147
|
}), () => {
|
|
@@ -161,7 +161,7 @@ const gt = ot({
|
|
|
161
161
|
i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), N(!0);
|
|
165
165
|
try {
|
|
166
166
|
i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const k = await c.connectUser(s);
|
|
@@ -173,7 +173,7 @@ const gt = ot({
|
|
|
173
173
|
error: T
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
N(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
178
|
}, [c, s, i]), U = O.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
@@ -216,8 +216,8 @@ const gt = ot({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, As = () => Te();
|
|
220
|
+
function Fs(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
@@ -229,12 +229,12 @@ const bt = O.createContext({
|
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
232
|
+
}), Os = bt.Provider, Ps = () => O.useContext(bt), pt = (t) => {
|
|
233
233
|
var r, o;
|
|
234
234
|
const [s, n] = A(
|
|
235
235
|
!!((o = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && o.pinned_at)
|
|
236
236
|
);
|
|
237
|
-
return
|
|
237
|
+
return J(() => {
|
|
238
238
|
var i;
|
|
239
239
|
if (!t) {
|
|
240
240
|
n(!1);
|
|
@@ -251,18 +251,18 @@ const bt = O.createContext({
|
|
|
251
251
|
t.off("member.updated", l);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, Us = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
257
|
), o = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
260
|
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
261
|
-
},
|
|
261
|
+
}, zs = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const r =
|
|
265
|
+
const r = Us(t, s);
|
|
266
266
|
return r === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
@@ -300,7 +300,7 @@ const bt = O.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function Bs(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
306
|
const r = t.charCodeAt(n);
|
|
@@ -308,8 +308,8 @@ function Us(t) {
|
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
311
|
+
function $s(t) {
|
|
312
|
+
const n = Bs(t) % st.length;
|
|
313
313
|
return st[n];
|
|
314
314
|
}
|
|
315
315
|
const ne = ({
|
|
@@ -321,7 +321,7 @@ const ne = ({
|
|
|
321
321
|
shape: l = "squircle",
|
|
322
322
|
dmAgentEnabled: i = !1
|
|
323
323
|
}) => {
|
|
324
|
-
const c =
|
|
324
|
+
const c = $s(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
|
|
325
325
|
borderRadius: "33%",
|
|
326
326
|
cornerShape: "superellipse(1.3)"
|
|
327
327
|
}, v = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
|
|
@@ -329,13 +329,13 @@ const ne = ({
|
|
|
329
329
|
{
|
|
330
330
|
src: s,
|
|
331
331
|
alt: "",
|
|
332
|
-
className: "
|
|
332
|
+
className: "h-full w-full object-cover"
|
|
333
333
|
}
|
|
334
334
|
) : /* @__PURE__ */ e(
|
|
335
335
|
"div",
|
|
336
336
|
{
|
|
337
337
|
"aria-hidden": "true",
|
|
338
|
-
className:
|
|
338
|
+
className: D(
|
|
339
339
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
340
340
|
u
|
|
341
341
|
),
|
|
@@ -345,11 +345,12 @@ const ne = ({
|
|
|
345
345
|
return /* @__PURE__ */ d(
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
|
-
className:
|
|
348
|
+
className: D(
|
|
349
349
|
"relative flex-shrink-0 !bg-transparent",
|
|
350
350
|
r
|
|
351
351
|
),
|
|
352
352
|
style: {
|
|
353
|
+
"--str-chat__avatar-size": `${n}px`,
|
|
353
354
|
width: `${n}px`,
|
|
354
355
|
height: `${n}px`
|
|
355
356
|
},
|
|
@@ -366,7 +367,7 @@ const ne = ({
|
|
|
366
367
|
"div",
|
|
367
368
|
{
|
|
368
369
|
"data-testid": "avatar-ring",
|
|
369
|
-
className:
|
|
370
|
+
className: D(
|
|
370
371
|
"h-full w-full",
|
|
371
372
|
"bg-transparent"
|
|
372
373
|
),
|
|
@@ -385,7 +386,7 @@ const ne = ({
|
|
|
385
386
|
]
|
|
386
387
|
}
|
|
387
388
|
);
|
|
388
|
-
},
|
|
389
|
+
}, js = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
389
390
|
"svg",
|
|
390
391
|
{
|
|
391
392
|
width: t,
|
|
@@ -402,22 +403,22 @@ const ne = ({
|
|
|
402
403
|
}
|
|
403
404
|
)
|
|
404
405
|
}
|
|
405
|
-
),
|
|
406
|
+
), Gs = (t) => {
|
|
406
407
|
var s;
|
|
407
408
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
408
|
-
},
|
|
409
|
+
}, Vs = (t) => {
|
|
409
410
|
var s;
|
|
410
411
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
411
412
|
}, De = (t) => {
|
|
412
413
|
var s;
|
|
413
414
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
414
|
-
},
|
|
415
|
+
}, Hs = (t) => {
|
|
415
416
|
var s;
|
|
416
417
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
417
|
-
}, xt = (t) =>
|
|
418
|
+
}, xt = (t) => Gs(t) || Vs(t), Ys = (t) => {
|
|
418
419
|
var s;
|
|
419
420
|
return xt(t) && !((s = t.text) != null && s.trim());
|
|
420
|
-
},
|
|
421
|
+
}, _e = ({
|
|
421
422
|
message: t,
|
|
422
423
|
standalone: s = !1,
|
|
423
424
|
isMyMessage: n = !1,
|
|
@@ -430,17 +431,17 @@ const ne = ({
|
|
|
430
431
|
if (o) {
|
|
431
432
|
const v = (f = t.metadata) == null ? void 0 : f.amount_text;
|
|
432
433
|
if (!v) return null;
|
|
433
|
-
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
434
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", N = s ? `${v} tip` : `Delivered with ${v} tip`;
|
|
434
435
|
return /* @__PURE__ */ d("div", { className: a, children: [
|
|
435
436
|
/* @__PURE__ */ e(hs, { size: s ? 14 : 12 }),
|
|
436
|
-
/* @__PURE__ */ e("span", { children:
|
|
437
|
+
/* @__PURE__ */ e("span", { children: N })
|
|
437
438
|
] });
|
|
438
439
|
}
|
|
439
440
|
const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", m = [
|
|
440
441
|
"message-chatbot-indicator",
|
|
441
442
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
442
443
|
i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
443
|
-
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
444
|
+
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(js, { size: i ? 12 : 15 }) });
|
|
444
445
|
return /* @__PURE__ */ e("div", { className: m, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(ce, { children: [
|
|
445
446
|
u,
|
|
446
447
|
h
|
|
@@ -451,30 +452,30 @@ const ne = ({
|
|
|
451
452
|
}, vt = O.memo(
|
|
452
453
|
({ channel: t, unread: s }) => {
|
|
453
454
|
var P, U, k, T;
|
|
454
|
-
const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } =
|
|
455
|
+
const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Ps(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
455
456
|
t && r(t);
|
|
456
457
|
}, m = (M) => {
|
|
457
|
-
const
|
|
458
|
-
!
|
|
458
|
+
const y = M.key === "Enter" || M.key === " ", _ = M.repeat;
|
|
459
|
+
!y || _ || (M.preventDefault(), c());
|
|
459
460
|
}, h = Object.values(((P = t == null ? void 0 : t.state) == null ? void 0 : P.members) || {}).find(
|
|
460
461
|
(M) => {
|
|
461
|
-
var
|
|
462
|
-
return ((
|
|
462
|
+
var y, _;
|
|
463
|
+
return ((y = M.user) == null ? void 0 : y.id) && M.user.id !== ((_ = t == null ? void 0 : t._client) == null ? void 0 : _.userID);
|
|
463
464
|
}
|
|
464
465
|
), f = ((U = h == null ? void 0 : h.user) == null ? void 0 : U.name) || "Conversation", v = (k = h == null ? void 0 : h.user) == null ? void 0 : k.image, a = (() => {
|
|
465
|
-
var
|
|
466
|
-
const M = (
|
|
466
|
+
var y;
|
|
467
|
+
const M = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
|
|
467
468
|
if (M != null && M.length) {
|
|
468
|
-
for (let
|
|
469
|
-
if (M[
|
|
469
|
+
for (let _ = M.length - 1; _ >= 0; _--)
|
|
470
|
+
if (M[_].type !== "system") return M[_];
|
|
470
471
|
}
|
|
471
472
|
})(), b = (() => {
|
|
472
|
-
var
|
|
473
|
+
var _, F;
|
|
473
474
|
if (a != null && a.text) return a.text;
|
|
474
|
-
if (((
|
|
475
|
-
const
|
|
476
|
-
return
|
|
477
|
-
})(), C = a != null && a.created_at ?
|
|
475
|
+
if (((_ = a == null ? void 0 : a.metadata) == null ? void 0 : _.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
476
|
+
const y = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
|
|
477
|
+
return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
478
|
+
})(), C = a != null && a.created_at ? zs(new Date(a.created_at)) : "", x = a ? De(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = pt(t), E = s ?? 0;
|
|
478
479
|
return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
479
480
|
channelId: t == null ? void 0 : t.id,
|
|
480
481
|
isSelected: i,
|
|
@@ -488,7 +489,7 @@ const ne = ({
|
|
|
488
489
|
tabIndex: 0,
|
|
489
490
|
onClick: c,
|
|
490
491
|
onKeyDown: m,
|
|
491
|
-
className:
|
|
492
|
+
className: D(
|
|
492
493
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
493
494
|
{
|
|
494
495
|
"bg-primary-alt/10 border-l-4 border-l-primary": i,
|
|
@@ -512,7 +513,7 @@ const ne = ({
|
|
|
512
513
|
/* @__PURE__ */ d(
|
|
513
514
|
"h3",
|
|
514
515
|
{
|
|
515
|
-
className:
|
|
516
|
+
className: D(
|
|
516
517
|
"text-sm font-medium truncate",
|
|
517
518
|
i ? "text-primary" : "text-charcoal"
|
|
518
519
|
),
|
|
@@ -535,7 +536,7 @@ const ne = ({
|
|
|
535
536
|
}
|
|
536
537
|
);
|
|
537
538
|
vt.displayName = "CustomChannelPreview";
|
|
538
|
-
const
|
|
539
|
+
const Ws = { last_message_at: -1 }, wt = O.memo(
|
|
539
540
|
({
|
|
540
541
|
onChannelSelect: t,
|
|
541
542
|
selectedChannel: s,
|
|
@@ -544,7 +545,7 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
|
|
|
544
545
|
onMessageNew: o,
|
|
545
546
|
onAddedToChannel: l,
|
|
546
547
|
channelRenderFilterFn: i,
|
|
547
|
-
sort: c =
|
|
548
|
+
sort: c = Ws,
|
|
548
549
|
className: m,
|
|
549
550
|
customEmptyStateIndicator: u,
|
|
550
551
|
renderMessagePreview: h
|
|
@@ -554,7 +555,7 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
|
|
|
554
555
|
const { debug: v = !1 } = Te(), a = O.useCallback(
|
|
555
556
|
(b) => {
|
|
556
557
|
for (const C of b)
|
|
557
|
-
|
|
558
|
+
Fs(C);
|
|
558
559
|
return i ? i(b) : b;
|
|
559
560
|
},
|
|
560
561
|
[i]
|
|
@@ -564,7 +565,7 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
|
|
|
564
565
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
565
566
|
filters: n
|
|
566
567
|
});
|
|
567
|
-
const
|
|
568
|
+
const N = O.useMemo(
|
|
568
569
|
() => ({
|
|
569
570
|
selectedChannel: s,
|
|
570
571
|
onChannelSelect: t,
|
|
@@ -576,11 +577,11 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
|
|
|
576
577
|
return /* @__PURE__ */ e(
|
|
577
578
|
"div",
|
|
578
579
|
{
|
|
579
|
-
className:
|
|
580
|
+
className: D(
|
|
580
581
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
581
582
|
m
|
|
582
583
|
),
|
|
583
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
584
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Os, { value: N, children: /* @__PURE__ */ e(
|
|
584
585
|
Rt,
|
|
585
586
|
{
|
|
586
587
|
filters: n,
|
|
@@ -609,7 +610,7 @@ const me = ({
|
|
|
609
610
|
"button",
|
|
610
611
|
{
|
|
611
612
|
type: "button",
|
|
612
|
-
className:
|
|
613
|
+
className: D(
|
|
613
614
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
614
615
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
615
616
|
s
|
|
@@ -618,12 +619,12 @@ const me = ({
|
|
|
618
619
|
children: n
|
|
619
620
|
}
|
|
620
621
|
);
|
|
621
|
-
function
|
|
622
|
+
function qs({ label: t, className: s, children: n, ...r }) {
|
|
622
623
|
return /* @__PURE__ */ d(
|
|
623
624
|
"button",
|
|
624
625
|
{
|
|
625
626
|
type: "button",
|
|
626
|
-
className:
|
|
627
|
+
className: D(
|
|
627
628
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
628
629
|
{
|
|
629
630
|
"cursor-not-allowed opacity-50": r.disabled,
|
|
@@ -639,10 +640,10 @@ function Ys({ label: t, className: s, children: n, ...r }) {
|
|
|
639
640
|
}
|
|
640
641
|
);
|
|
641
642
|
}
|
|
642
|
-
function
|
|
643
|
-
return /* @__PURE__ */ e(
|
|
643
|
+
function Xs({ onClick: t }) {
|
|
644
|
+
return /* @__PURE__ */ e(qs, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
644
645
|
}
|
|
645
|
-
const
|
|
646
|
+
const Zs = ({
|
|
646
647
|
dialogRef: t,
|
|
647
648
|
onClose: s,
|
|
648
649
|
participant: n,
|
|
@@ -658,7 +659,7 @@ const qs = ({
|
|
|
658
659
|
customChannelActions: v
|
|
659
660
|
}) => {
|
|
660
661
|
var S, $, V, ee, te, W, g;
|
|
661
|
-
const { service: a, debug:
|
|
662
|
+
const { service: a, debug: N } = Te(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
|
|
662
663
|
var p;
|
|
663
664
|
if (!(!a || !((p = n == null ? void 0 : n.user) != null && p.id)))
|
|
664
665
|
try {
|
|
@@ -669,35 +670,35 @@ const qs = ({
|
|
|
669
670
|
}
|
|
670
671
|
);
|
|
671
672
|
C(j);
|
|
672
|
-
} catch (
|
|
673
|
+
} catch (L) {
|
|
673
674
|
console.error(
|
|
674
675
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
675
|
-
|
|
676
|
+
L
|
|
676
677
|
);
|
|
677
678
|
}
|
|
678
679
|
}, [a, (S = n == null ? void 0 : n.user) == null ? void 0 : S.id]);
|
|
679
|
-
|
|
680
|
+
J(() => {
|
|
680
681
|
P();
|
|
681
682
|
}, [P]);
|
|
682
683
|
const U = async () => {
|
|
683
684
|
var p;
|
|
684
685
|
if (!x) {
|
|
685
|
-
m == null || m(),
|
|
686
|
+
m == null || m(), N && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
|
|
686
687
|
try {
|
|
687
|
-
const
|
|
688
|
-
await r.hide(
|
|
689
|
-
} catch (
|
|
690
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
688
|
+
const L = ((p = r._client) == null ? void 0 : p.userID) ?? null;
|
|
689
|
+
await r.hide(L, !1), l && await l(r), s();
|
|
690
|
+
} catch (L) {
|
|
691
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", L);
|
|
691
692
|
} finally {
|
|
692
693
|
I(!1);
|
|
693
694
|
}
|
|
694
695
|
}
|
|
695
696
|
}, k = async () => {
|
|
696
|
-
var p,
|
|
697
|
+
var p, L, j;
|
|
697
698
|
if (!(w || !a)) {
|
|
698
|
-
u == null || u(),
|
|
699
|
+
u == null || u(), N && console.log("[ChannelInfoDialog] Block member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
|
|
699
700
|
try {
|
|
700
|
-
await a.blockUser((
|
|
701
|
+
await a.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
701
702
|
} catch (Y) {
|
|
702
703
|
console.error("[ChannelInfoDialog] Failed to block member", Y);
|
|
703
704
|
} finally {
|
|
@@ -705,11 +706,11 @@ const qs = ({
|
|
|
705
706
|
}
|
|
706
707
|
}
|
|
707
708
|
}, T = async () => {
|
|
708
|
-
var p,
|
|
709
|
+
var p, L, j;
|
|
709
710
|
if (!(w || !a)) {
|
|
710
|
-
u == null || u(),
|
|
711
|
+
u == null || u(), N && console.log("[ChannelInfoDialog] Unblock member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
|
|
711
712
|
try {
|
|
712
|
-
await a.unBlockUser((
|
|
713
|
+
await a.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
713
714
|
} catch (Y) {
|
|
714
715
|
console.error("[ChannelInfoDialog] Failed to unblock member", Y);
|
|
715
716
|
} finally {
|
|
@@ -724,7 +725,7 @@ const qs = ({
|
|
|
724
725
|
);
|
|
725
726
|
};
|
|
726
727
|
if (!n) return null;
|
|
727
|
-
const
|
|
728
|
+
const y = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", _ = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (W = n.user) == null ? void 0 : W.username, R = F || (H ? `linktr.ee/${H}` : void 0), z = ((g = n.user) == null ? void 0 : g.id) || "unknown";
|
|
728
729
|
return (
|
|
729
730
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
730
731
|
/* @__PURE__ */ e(
|
|
@@ -739,7 +740,7 @@ const qs = ({
|
|
|
739
740
|
children: /* @__PURE__ */ d("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
740
741
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
741
742
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
742
|
-
/* @__PURE__ */ e(
|
|
743
|
+
/* @__PURE__ */ e(Xs, { onClick: s })
|
|
743
744
|
] }),
|
|
744
745
|
/* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
745
746
|
/* @__PURE__ */ d(
|
|
@@ -752,16 +753,16 @@ const qs = ({
|
|
|
752
753
|
/* @__PURE__ */ e(
|
|
753
754
|
ne,
|
|
754
755
|
{
|
|
755
|
-
id:
|
|
756
|
-
name:
|
|
757
|
-
image:
|
|
756
|
+
id: z,
|
|
757
|
+
name: y,
|
|
758
|
+
image: _,
|
|
758
759
|
size: 88,
|
|
759
760
|
shape: "circle"
|
|
760
761
|
}
|
|
761
762
|
),
|
|
762
763
|
/* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
763
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
764
|
-
|
|
764
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
|
|
765
|
+
R && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: R }),
|
|
765
766
|
o && !f && /* @__PURE__ */ e(
|
|
766
767
|
"span",
|
|
767
768
|
{
|
|
@@ -829,13 +830,13 @@ const qs = ({
|
|
|
829
830
|
}
|
|
830
831
|
)
|
|
831
832
|
);
|
|
832
|
-
},
|
|
833
|
-
function
|
|
833
|
+
}, Js = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ie = "vote_up", ke = "vote_down";
|
|
834
|
+
function Ks(t) {
|
|
834
835
|
return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Ie) ? "up" : null : null;
|
|
835
836
|
}
|
|
836
|
-
function
|
|
837
|
+
function Qs(t) {
|
|
837
838
|
const { channel: s } = oe(), { client: n } = Me("useMessageVote"), r = Ce(
|
|
838
|
-
() =>
|
|
839
|
+
() => Ks(t.own_reactions),
|
|
839
840
|
[t.own_reactions]
|
|
840
841
|
), o = G(async () => {
|
|
841
842
|
if (n != null && n.userID)
|
|
@@ -860,41 +861,21 @@ function Js(t) {
|
|
|
860
861
|
}, [s, n == null ? void 0 : n.userID, t.id, r]);
|
|
861
862
|
return { selected: r, voteUp: o, voteDown: l };
|
|
862
863
|
}
|
|
863
|
-
const
|
|
864
|
+
const en = O.lazy(() => import("./Card-QrKCxqCI.js")), tn = O.lazy(() => import("./Card-CmnkZNNQ.js")), _t = () => /* @__PURE__ */ e(
|
|
864
865
|
"div",
|
|
865
866
|
{
|
|
866
867
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
867
868
|
"aria-hidden": !0
|
|
868
869
|
}
|
|
869
|
-
),
|
|
870
|
+
), sn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(_t, {}), children: /* @__PURE__ */ e(en, { ...t }) }), nn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(_t, {}), children: /* @__PURE__ */ e(tn, { ...t }) }), nt = { Creator: sn, Visitor: nn }, an = {
|
|
870
871
|
isUnlocking: () => !1
|
|
871
|
-
},
|
|
872
|
-
LockedAttachment:
|
|
873
|
-
},
|
|
874
|
-
function
|
|
875
|
-
return lt(
|
|
872
|
+
}, rn = {
|
|
873
|
+
LockedAttachment: an
|
|
874
|
+
}, yt = ot({}), ia = yt.Provider;
|
|
875
|
+
function on(t) {
|
|
876
|
+
return lt(yt)[t] ?? rn[t];
|
|
876
877
|
}
|
|
877
|
-
const
|
|
878
|
-
"path",
|
|
879
|
-
{
|
|
880
|
-
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
881
|
-
stroke: "currentColor",
|
|
882
|
-
strokeWidth: "1.33",
|
|
883
|
-
strokeLinecap: "round",
|
|
884
|
-
strokeLinejoin: "round",
|
|
885
|
-
fill: t ? "currentColor" : "none"
|
|
886
|
-
}
|
|
887
|
-
) }), on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
888
|
-
"path",
|
|
889
|
-
{
|
|
890
|
-
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
891
|
-
stroke: "currentColor",
|
|
892
|
-
strokeWidth: "1.33",
|
|
893
|
-
strokeLinecap: "round",
|
|
894
|
-
strokeLinejoin: "round",
|
|
895
|
-
fill: t ? "currentColor" : "none"
|
|
896
|
-
}
|
|
897
|
-
) }), ln = ({
|
|
878
|
+
const ln = ({
|
|
898
879
|
selected: t,
|
|
899
880
|
onVoteUp: s,
|
|
900
881
|
onVoteDown: n
|
|
@@ -903,26 +884,32 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
903
884
|
"button",
|
|
904
885
|
{
|
|
905
886
|
type: "button",
|
|
906
|
-
className:
|
|
887
|
+
className: D("message-vote-button focus-ring", {
|
|
888
|
+
"message-vote-button--selected": t === "up"
|
|
889
|
+
}),
|
|
907
890
|
onClick: s,
|
|
908
|
-
"aria-label": "
|
|
891
|
+
"aria-label": "Good response",
|
|
909
892
|
"aria-pressed": t === "up",
|
|
910
|
-
|
|
893
|
+
"data-tooltip": "Good response",
|
|
894
|
+
children: /* @__PURE__ */ e(bs, { size: 16, weight: t === "up" ? "fill" : "regular" })
|
|
911
895
|
}
|
|
912
896
|
),
|
|
913
897
|
/* @__PURE__ */ e(
|
|
914
898
|
"button",
|
|
915
899
|
{
|
|
916
900
|
type: "button",
|
|
917
|
-
className:
|
|
901
|
+
className: D("message-vote-button focus-ring", {
|
|
902
|
+
"message-vote-button--selected": t === "down"
|
|
903
|
+
}),
|
|
918
904
|
onClick: n,
|
|
919
|
-
"aria-label": "
|
|
905
|
+
"aria-label": "Bad response",
|
|
920
906
|
"aria-pressed": t === "down",
|
|
921
|
-
|
|
907
|
+
"data-tooltip": "Bad response",
|
|
908
|
+
children: /* @__PURE__ */ e(ps, { size: 16, weight: t === "down" ? "fill" : "regular" })
|
|
922
909
|
}
|
|
923
910
|
)
|
|
924
911
|
] }), cn = (t) => {
|
|
925
|
-
var se, Oe, Pe, Ue,
|
|
912
|
+
var se, Oe, Pe, Ue, ze, Be, $e, je, Ge, Ve, He, Ye, We, qe;
|
|
926
913
|
const {
|
|
927
914
|
additionalMessageInputProps: s,
|
|
928
915
|
chatbotVotingEnabled: n,
|
|
@@ -937,20 +924,20 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
937
924
|
isMessageAIGenerated: f,
|
|
938
925
|
isMyMessage: v,
|
|
939
926
|
message: a,
|
|
940
|
-
renderText:
|
|
927
|
+
renderText: N,
|
|
941
928
|
threadList: b
|
|
942
|
-
} = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } =
|
|
929
|
+
} = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = on("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: y, voteDown: _ } = Qs(a), {
|
|
943
930
|
Attachment: F = Ot,
|
|
944
931
|
EditMessageModal: H = Pt,
|
|
945
|
-
MessageBlocked:
|
|
946
|
-
MessageBouncePrompt:
|
|
947
|
-
MessageDeleted: S =
|
|
932
|
+
MessageBlocked: R = Ut,
|
|
933
|
+
MessageBouncePrompt: z = zt,
|
|
934
|
+
MessageDeleted: S = Bt,
|
|
948
935
|
MessageIsThreadReplyInChannelButtonIndicator: $ = $t,
|
|
949
936
|
MessageRepliesCountButton: V = jt,
|
|
950
937
|
ReminderNotification: ee = Gt,
|
|
951
938
|
StreamedMessageText: te = Vt,
|
|
952
939
|
PinIndicator: W
|
|
953
|
-
} = dt("CustomMessage"), g = Ht(a), p = Yt(a),
|
|
940
|
+
} = dt("CustomMessage"), g = Ht(a), p = Yt(a), L = Ce(
|
|
954
941
|
() => f == null ? void 0 : f(a),
|
|
955
942
|
[f, a]
|
|
956
943
|
), j = Ce(
|
|
@@ -962,11 +949,11 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
962
949
|
if (a.deleted_at || a.type === "deleted")
|
|
963
950
|
return /* @__PURE__ */ e(S, { message: a });
|
|
964
951
|
if (qt(a))
|
|
965
|
-
return /* @__PURE__ */ e(
|
|
952
|
+
return /* @__PURE__ */ e(R, {});
|
|
966
953
|
const Y = !b && !!a.reply_count, ae = !b && a.show_in_channel && a.parent_id, de = a.status === "failed" && ((se = a.error) == null ? void 0 : se.status) !== 403, re = Xt(a);
|
|
967
954
|
let q;
|
|
968
955
|
de ? q = () => u(a) : re && (q = () => k(!0));
|
|
969
|
-
const ie = v(), pe =
|
|
956
|
+
const ie = v(), pe = D(
|
|
970
957
|
"str-chat__message str-chat__message-simple",
|
|
971
958
|
`str-chat__message--${a.type}`,
|
|
972
959
|
`str-chat__message--${a.status}`,
|
|
@@ -983,7 +970,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
983
970
|
"str-chat__virtual-message__wrapper--first": l,
|
|
984
971
|
"str-chat__virtual-message__wrapper--group": i
|
|
985
972
|
}
|
|
986
|
-
), ue = a.poll_id && C.polls.fromState(a.poll_id), xe =
|
|
973
|
+
), ue = a.poll_id && C.polls.fromState(a.poll_id), xe = Ys(a), Z = De(a), B = Hs(a), X = !!(j != null && j.length && !a.quoted_message), Q = Z && ie && X;
|
|
987
974
|
return /* @__PURE__ */ d(ce, { children: [
|
|
988
975
|
r && /* @__PURE__ */ e(
|
|
989
976
|
H,
|
|
@@ -994,7 +981,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
994
981
|
U && /* @__PURE__ */ e(
|
|
995
982
|
Zt,
|
|
996
983
|
{
|
|
997
|
-
MessageBouncePrompt:
|
|
984
|
+
MessageBouncePrompt: z,
|
|
998
985
|
onClose: () => k(!1),
|
|
999
986
|
open: U
|
|
1000
987
|
}
|
|
@@ -1008,13 +995,16 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1008
995
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1009
996
|
id: a.user.id,
|
|
1010
997
|
image: a.user.image,
|
|
1011
|
-
name: a.user.name || a.user.id
|
|
998
|
+
name: a.user.name || a.user.id,
|
|
999
|
+
size: Z ? 24 : 28,
|
|
1000
|
+
shape: "circle",
|
|
1001
|
+
dmAgentEnabled: Z
|
|
1012
1002
|
}
|
|
1013
1003
|
),
|
|
1014
1004
|
/* @__PURE__ */ e(
|
|
1015
1005
|
"div",
|
|
1016
1006
|
{
|
|
1017
|
-
className:
|
|
1007
|
+
className: D("str-chat__message-inner", {
|
|
1018
1008
|
"str-chat__simple-message--error-failed": de || re
|
|
1019
1009
|
}),
|
|
1020
1010
|
"data-testid": "message-inner",
|
|
@@ -1028,14 +1018,14 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1028
1018
|
marginInlineEnd: 0,
|
|
1029
1019
|
marginInlineStart: 0
|
|
1030
1020
|
},
|
|
1031
|
-
children:
|
|
1021
|
+
children: B ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1032
1022
|
ie ? /* @__PURE__ */ e(
|
|
1033
1023
|
nt.Creator,
|
|
1034
1024
|
{
|
|
1035
1025
|
title: (Pe = a.metadata) == null ? void 0 : Pe.attachment_title,
|
|
1036
1026
|
mimeType: (Ue = a.metadata) == null ? void 0 : Ue.attachment_mime_type,
|
|
1037
|
-
thumbnailUrl: (
|
|
1038
|
-
amountText: (
|
|
1027
|
+
thumbnailUrl: (ze = a.metadata) == null ? void 0 : ze.attachment_thumbnail,
|
|
1028
|
+
amountText: (Be = a.metadata) == null ? void 0 : Be.amount_text,
|
|
1039
1029
|
detail: ($e = a.metadata) == null ? void 0 : $e.attachment_detail,
|
|
1040
1030
|
paymentStatus: (je = a.metadata) == null ? void 0 : je.payment_status,
|
|
1041
1031
|
isUnlocking: I(a.id),
|
|
@@ -1057,14 +1047,14 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1057
1047
|
onDownloadClick: () => P == null ? void 0 : P(a, x)
|
|
1058
1048
|
}
|
|
1059
1049
|
),
|
|
1060
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText:
|
|
1050
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: N }) })
|
|
1061
1051
|
] }) : xe ? (
|
|
1062
1052
|
/* Tip-only messages render as a standalone bubble */
|
|
1063
|
-
/* @__PURE__ */ e(
|
|
1053
|
+
/* @__PURE__ */ e(_e, { message: a, standalone: !0 })
|
|
1064
1054
|
) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1065
1055
|
/* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
|
|
1066
|
-
|
|
1067
|
-
|
|
1056
|
+
Z && !Q && /* @__PURE__ */ e(
|
|
1057
|
+
_e,
|
|
1068
1058
|
{
|
|
1069
1059
|
message: a,
|
|
1070
1060
|
hasAttachment: X,
|
|
@@ -1079,29 +1069,29 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1079
1069
|
attachments: j
|
|
1080
1070
|
}
|
|
1081
1071
|
) : null,
|
|
1082
|
-
|
|
1072
|
+
L ? /* @__PURE__ */ e(
|
|
1083
1073
|
te,
|
|
1084
1074
|
{
|
|
1085
1075
|
message: a,
|
|
1086
|
-
renderText:
|
|
1076
|
+
renderText: N
|
|
1087
1077
|
}
|
|
1088
|
-
) : /* @__PURE__ */ e(Xe, { message: a, renderText:
|
|
1078
|
+
) : /* @__PURE__ */ e(Xe, { message: a, renderText: N }),
|
|
1089
1079
|
/* @__PURE__ */ e(Kt, {})
|
|
1090
1080
|
] }),
|
|
1091
|
-
(!
|
|
1092
|
-
|
|
1081
|
+
(!Z || Q) && /* @__PURE__ */ e(
|
|
1082
|
+
_e,
|
|
1093
1083
|
{
|
|
1094
1084
|
message: a,
|
|
1095
1085
|
hasAttachment: X,
|
|
1096
1086
|
isMyMessage: ie
|
|
1097
1087
|
}
|
|
1098
1088
|
),
|
|
1099
|
-
n &&
|
|
1089
|
+
n && Z && /* @__PURE__ */ e(
|
|
1100
1090
|
ln,
|
|
1101
1091
|
{
|
|
1102
1092
|
selected: M,
|
|
1103
|
-
onVoteUp:
|
|
1104
|
-
onVoteDown:
|
|
1093
|
+
onVoteUp: y,
|
|
1094
|
+
onVoteDown: _
|
|
1105
1095
|
}
|
|
1106
1096
|
)
|
|
1107
1097
|
] })
|
|
@@ -1190,7 +1180,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1190
1180
|
"aria-label": "Send",
|
|
1191
1181
|
disabled: s,
|
|
1192
1182
|
onClick: t,
|
|
1193
|
-
children: /* @__PURE__ */ e(
|
|
1183
|
+
children: /* @__PURE__ */ e(xs, { weight: "bold", className: "size-4" })
|
|
1194
1184
|
}
|
|
1195
1185
|
), bn = () => {
|
|
1196
1186
|
var c;
|
|
@@ -1254,9 +1244,9 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1254
1244
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1255
1245
|
}, wn = [
|
|
1256
1246
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1257
|
-
],
|
|
1247
|
+
], _n = {
|
|
1258
1248
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1259
|
-
},
|
|
1249
|
+
}, ye = "age safety guidelines.", yn = "https://linktr.ee/s/about/contact", at = (t) => xn.includes(t), Nn = (t) => wn.includes(t), Cn = (t) => {
|
|
1260
1250
|
var r;
|
|
1261
1251
|
const s = (r = t.metadata) == null ? void 0 : r.custom_type;
|
|
1262
1252
|
if (at(s))
|
|
@@ -1264,7 +1254,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1264
1254
|
kind: "dm-agent",
|
|
1265
1255
|
type: s
|
|
1266
1256
|
};
|
|
1267
|
-
if (
|
|
1257
|
+
if (Nn(s))
|
|
1268
1258
|
return {
|
|
1269
1259
|
kind: "age-safety",
|
|
1270
1260
|
type: s
|
|
@@ -1276,20 +1266,20 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1276
1266
|
type: n
|
|
1277
1267
|
};
|
|
1278
1268
|
}, En = (t) => {
|
|
1279
|
-
const s = t.indexOf(
|
|
1269
|
+
const s = t.indexOf(ye);
|
|
1280
1270
|
if (s === -1)
|
|
1281
1271
|
return t;
|
|
1282
|
-
const n = s +
|
|
1272
|
+
const n = s + ye.length;
|
|
1283
1273
|
return /* @__PURE__ */ d(ce, { children: [
|
|
1284
1274
|
t.slice(0, s),
|
|
1285
1275
|
/* @__PURE__ */ e(
|
|
1286
1276
|
"a",
|
|
1287
1277
|
{
|
|
1288
|
-
href:
|
|
1278
|
+
href: yn,
|
|
1289
1279
|
target: "_blank",
|
|
1290
1280
|
rel: "noopener noreferrer",
|
|
1291
1281
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1292
|
-
children:
|
|
1282
|
+
children: ye
|
|
1293
1283
|
}
|
|
1294
1284
|
),
|
|
1295
1285
|
t.slice(n)
|
|
@@ -1326,7 +1316,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1326
1316
|
] });
|
|
1327
1317
|
}
|
|
1328
1318
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1329
|
-
const l = ((o = t.message.text) == null ? void 0 : o.trim()) ||
|
|
1319
|
+
const l = ((o = t.message.text) == null ? void 0 : o.trim()) || _n[n.type];
|
|
1330
1320
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1331
1321
|
/* @__PURE__ */ d(
|
|
1332
1322
|
"div",
|
|
@@ -1336,7 +1326,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1336
1326
|
"data-age-safety-system-type": n.type,
|
|
1337
1327
|
children: [
|
|
1338
1328
|
/* @__PURE__ */ e(
|
|
1339
|
-
|
|
1329
|
+
vs,
|
|
1340
1330
|
{
|
|
1341
1331
|
size: 24,
|
|
1342
1332
|
weight: "duotone",
|
|
@@ -1360,7 +1350,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1360
1350
|
] }),
|
|
1361
1351
|
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1362
1352
|
] });
|
|
1363
|
-
},
|
|
1353
|
+
}, Ne = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
|
|
1364
1354
|
"animateTransform",
|
|
1365
1355
|
{
|
|
1366
1356
|
attributeName: "transform",
|
|
@@ -1371,7 +1361,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1371
1361
|
repeatCount: "indefinite"
|
|
1372
1362
|
}
|
|
1373
1363
|
) }), In = ({ threadList: t }) => {
|
|
1374
|
-
var
|
|
1364
|
+
var N;
|
|
1375
1365
|
const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = Me(), { typing: l = {} } = ls();
|
|
1376
1366
|
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
1377
1367
|
return null;
|
|
@@ -1388,7 +1378,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1388
1378
|
) : [], m = t ? c : i;
|
|
1389
1379
|
if (!m.length)
|
|
1390
1380
|
return null;
|
|
1391
|
-
const u = (
|
|
1381
|
+
const u = (N = m[0]) == null ? void 0 : N.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
|
|
1392
1382
|
return /* @__PURE__ */ d(
|
|
1393
1383
|
"div",
|
|
1394
1384
|
{
|
|
@@ -1416,9 +1406,9 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1416
1406
|
height: "8",
|
|
1417
1407
|
overflow: "visible",
|
|
1418
1408
|
children: [
|
|
1419
|
-
/* @__PURE__ */ e(
|
|
1420
|
-
/* @__PURE__ */ e(
|
|
1421
|
-
/* @__PURE__ */ e(
|
|
1409
|
+
/* @__PURE__ */ e(Ne, { cx: "4", index: 0 }),
|
|
1410
|
+
/* @__PURE__ */ e(Ne, { cx: "16", index: 1 }),
|
|
1411
|
+
/* @__PURE__ */ e(Ne, { cx: "28", index: 2 })
|
|
1422
1412
|
]
|
|
1423
1413
|
}
|
|
1424
1414
|
) })
|
|
@@ -1428,7 +1418,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1428
1418
|
}, kn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ d(
|
|
1429
1419
|
"div",
|
|
1430
1420
|
{
|
|
1431
|
-
className:
|
|
1421
|
+
className: D("flex items-center justify-center h-full", t),
|
|
1432
1422
|
children: [
|
|
1433
1423
|
/* @__PURE__ */ d("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1434
1424
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -1481,13 +1471,13 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1481
1471
|
showStarButton: o = !1,
|
|
1482
1472
|
dmAgentEnabled: l = !1
|
|
1483
1473
|
}) => {
|
|
1484
|
-
var v, a,
|
|
1474
|
+
var v, a, N, b, C;
|
|
1485
1475
|
const { channel: i } = oe(), c = O.useMemo(() => Object.values(i.state.members || {}).find(
|
|
1486
1476
|
(I) => {
|
|
1487
1477
|
var w;
|
|
1488
1478
|
return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== i._client.userID;
|
|
1489
1479
|
}
|
|
1490
|
-
), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (
|
|
1480
|
+
), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (N = c == null ? void 0 : c.user) == null ? void 0 : N.image, h = pt(i), f = async () => {
|
|
1491
1481
|
try {
|
|
1492
1482
|
h ? await i.unpin() : await i.pin();
|
|
1493
1483
|
} catch (x) {
|
|
@@ -1551,7 +1541,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1551
1541
|
children: /* @__PURE__ */ e(
|
|
1552
1542
|
Ee,
|
|
1553
1543
|
{
|
|
1554
|
-
className:
|
|
1544
|
+
className: D("size-5", {
|
|
1555
1545
|
"text-yellow-600": h,
|
|
1556
1546
|
"text-black/90": !h
|
|
1557
1547
|
}),
|
|
@@ -1626,7 +1616,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1626
1616
|
children: /* @__PURE__ */ e(
|
|
1627
1617
|
Ee,
|
|
1628
1618
|
{
|
|
1629
|
-
className:
|
|
1619
|
+
className: D("size-5", {
|
|
1630
1620
|
"text-yellow-600": h,
|
|
1631
1621
|
"text-black/90": !h
|
|
1632
1622
|
}),
|
|
@@ -1663,40 +1653,40 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1663
1653
|
chatbotVotingEnabled: f = !1,
|
|
1664
1654
|
renderChannelBanner: v,
|
|
1665
1655
|
customProfileContent: a,
|
|
1666
|
-
customChannelActions:
|
|
1656
|
+
customChannelActions: N,
|
|
1667
1657
|
renderMessage: b,
|
|
1668
1658
|
dmAgentEnabled: C = !1
|
|
1669
1659
|
}) => {
|
|
1670
1660
|
var F, H;
|
|
1671
|
-
const { channel: x } = oe(), I =
|
|
1672
|
-
(
|
|
1661
|
+
const { channel: x } = oe(), I = K(null), w = O.useMemo(() => Object.values(x.state.members || {}).find(
|
|
1662
|
+
(z) => {
|
|
1673
1663
|
var S;
|
|
1674
|
-
return ((S =
|
|
1664
|
+
return ((S = z.user) == null ? void 0 : S.id) && z.user.id !== x._client.userID;
|
|
1675
1665
|
}
|
|
1676
|
-
), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((
|
|
1666
|
+
), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((z) => {
|
|
1677
1667
|
var S;
|
|
1678
|
-
return ((S =
|
|
1668
|
+
return ((S = z.user) == null ? void 0 : S.id) === x._client.userID;
|
|
1679
1669
|
}), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
|
|
1680
|
-
const
|
|
1681
|
-
if (
|
|
1682
|
-
return String(
|
|
1683
|
-
if (
|
|
1684
|
-
return
|
|
1670
|
+
const R = x.data ?? {};
|
|
1671
|
+
if (R.followerStatus)
|
|
1672
|
+
return String(R.followerStatus);
|
|
1673
|
+
if (R.isFollower !== void 0)
|
|
1674
|
+
return R.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1685
1675
|
}, [x.data]), M = G(() => {
|
|
1686
|
-
var
|
|
1687
|
-
(
|
|
1688
|
-
}, []),
|
|
1689
|
-
var
|
|
1690
|
-
(
|
|
1691
|
-
}, []),
|
|
1692
|
-
(
|
|
1693
|
-
const { message:
|
|
1694
|
-
return !b || !
|
|
1676
|
+
var R;
|
|
1677
|
+
(R = I.current) == null || R.showModal();
|
|
1678
|
+
}, []), y = G(() => {
|
|
1679
|
+
var R;
|
|
1680
|
+
(R = I.current) == null || R.close();
|
|
1681
|
+
}, []), _ = G(
|
|
1682
|
+
(R) => {
|
|
1683
|
+
const { message: z } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...R, chatbotVotingEnabled: f });
|
|
1684
|
+
return !b || !z ? S : b(S, z);
|
|
1695
1685
|
},
|
|
1696
1686
|
[f, b]
|
|
1697
1687
|
);
|
|
1698
1688
|
return /* @__PURE__ */ d(ce, { children: [
|
|
1699
|
-
/* @__PURE__ */ e(ds, { overrides: { Message:
|
|
1689
|
+
/* @__PURE__ */ e(ds, { overrides: { Message: _ }, children: /* @__PURE__ */ d(us, { children: [
|
|
1700
1690
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1701
1691
|
Tn,
|
|
1702
1692
|
{
|
|
@@ -1726,10 +1716,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1726
1716
|
)
|
|
1727
1717
|
] }) }),
|
|
1728
1718
|
/* @__PURE__ */ e(
|
|
1729
|
-
|
|
1719
|
+
Zs,
|
|
1730
1720
|
{
|
|
1731
1721
|
dialogRef: I,
|
|
1732
|
-
onClose:
|
|
1722
|
+
onClose: y,
|
|
1733
1723
|
participant: w,
|
|
1734
1724
|
channel: x,
|
|
1735
1725
|
followerStatusLabel: T,
|
|
@@ -1740,11 +1730,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1740
1730
|
onBlockParticipantClick: m,
|
|
1741
1731
|
onReportParticipantClick: u,
|
|
1742
1732
|
customProfileContent: a,
|
|
1743
|
-
customChannelActions:
|
|
1733
|
+
customChannelActions: N
|
|
1744
1734
|
}
|
|
1745
1735
|
)
|
|
1746
1736
|
] });
|
|
1747
|
-
},
|
|
1737
|
+
}, Nt = O.memo(
|
|
1748
1738
|
({
|
|
1749
1739
|
channel: t,
|
|
1750
1740
|
onBack: s,
|
|
@@ -1760,7 +1750,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1760
1750
|
onBlockParticipantClick: f,
|
|
1761
1751
|
onReportParticipantClick: v,
|
|
1762
1752
|
dmAgentEnabled: a,
|
|
1763
|
-
messageMetadata:
|
|
1753
|
+
messageMetadata: N,
|
|
1764
1754
|
onMessageSent: b,
|
|
1765
1755
|
showStarButton: C = !1,
|
|
1766
1756
|
chatbotVotingEnabled: x = !1,
|
|
@@ -1771,29 +1761,29 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1771
1761
|
sendButton: U
|
|
1772
1762
|
}) => {
|
|
1773
1763
|
const k = G(
|
|
1774
|
-
async (T, M,
|
|
1764
|
+
async (T, M, y) => {
|
|
1775
1765
|
var S;
|
|
1776
|
-
const
|
|
1766
|
+
const _ = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !_, H = {
|
|
1777
1767
|
...M,
|
|
1778
1768
|
...F && { silent: !0 },
|
|
1779
|
-
...
|
|
1769
|
+
...N && {
|
|
1780
1770
|
metadata: {
|
|
1781
1771
|
...M.metadata ?? {},
|
|
1782
|
-
...
|
|
1772
|
+
...N
|
|
1783
1773
|
}
|
|
1784
1774
|
}
|
|
1785
|
-
},
|
|
1786
|
-
...
|
|
1775
|
+
}, R = {
|
|
1776
|
+
...y,
|
|
1787
1777
|
...F && { skip_push: !0 }
|
|
1788
|
-
},
|
|
1789
|
-
return b == null || b(
|
|
1778
|
+
}, z = await t.sendMessage(H, R);
|
|
1779
|
+
return b == null || b(z), z;
|
|
1790
1780
|
},
|
|
1791
|
-
[t, a,
|
|
1781
|
+
[t, a, N, b]
|
|
1792
1782
|
);
|
|
1793
1783
|
return /* @__PURE__ */ e(
|
|
1794
1784
|
"div",
|
|
1795
1785
|
{
|
|
1796
|
-
className:
|
|
1786
|
+
className: D(
|
|
1797
1787
|
"messaging-channel-view h-full flex flex-col",
|
|
1798
1788
|
c
|
|
1799
1789
|
),
|
|
@@ -1804,7 +1794,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1804
1794
|
MessageSystem: Sn,
|
|
1805
1795
|
EmptyStateIndicator: m,
|
|
1806
1796
|
LoadingIndicator: fe,
|
|
1807
|
-
DateSeparator:
|
|
1797
|
+
DateSeparator: Js,
|
|
1808
1798
|
TypingIndicator: In,
|
|
1809
1799
|
doSendMessageRequest: k,
|
|
1810
1800
|
...U ? { SendButton: U } : {},
|
|
@@ -1837,7 +1827,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1837
1827
|
);
|
|
1838
1828
|
}
|
|
1839
1829
|
);
|
|
1840
|
-
|
|
1830
|
+
Nt.displayName = "ChannelView";
|
|
1841
1831
|
const Rn = ({ className: t }) => /* @__PURE__ */ d(
|
|
1842
1832
|
"svg",
|
|
1843
1833
|
{
|
|
@@ -2012,7 +2002,7 @@ const oa = ({
|
|
|
2012
2002
|
channelListCustomEmptyStateIndicator: f,
|
|
2013
2003
|
onDeleteConversationClick: v,
|
|
2014
2004
|
onBlockParticipantClick: a,
|
|
2015
|
-
onReportParticipantClick:
|
|
2005
|
+
onReportParticipantClick: N,
|
|
2016
2006
|
dmAgentEnabled: b,
|
|
2017
2007
|
messageMetadata: C,
|
|
2018
2008
|
onMessageSent: x,
|
|
@@ -2026,64 +2016,64 @@ const oa = ({
|
|
|
2026
2016
|
sendButton: M
|
|
2027
2017
|
}) => {
|
|
2028
2018
|
const {
|
|
2029
|
-
service:
|
|
2030
|
-
client:
|
|
2019
|
+
service: y,
|
|
2020
|
+
client: _,
|
|
2031
2021
|
isConnected: F,
|
|
2032
2022
|
isLoading: H,
|
|
2033
|
-
error:
|
|
2034
|
-
refreshConnection:
|
|
2023
|
+
error: R,
|
|
2024
|
+
refreshConnection: z,
|
|
2035
2025
|
debug: S
|
|
2036
|
-
} =
|
|
2026
|
+
} = As(), [$, V] = A(null), [ee, te] = A(!1), [W, g] = A(!1), [p, L] = A(!1), [j, Y] = A(null), {
|
|
2037
2027
|
showDeleteConversation: ae = !0
|
|
2038
2028
|
} = t, de = O.useMemo(() => {
|
|
2039
|
-
const
|
|
2029
|
+
const B = _ == null ? void 0 : _.userID;
|
|
2040
2030
|
return {
|
|
2041
2031
|
...{
|
|
2042
2032
|
type: "messaging",
|
|
2043
2033
|
last_message_at: { $exists: !0 },
|
|
2044
|
-
...
|
|
2045
|
-
members: { $in: [
|
|
2034
|
+
...B && {
|
|
2035
|
+
members: { $in: [B] },
|
|
2046
2036
|
hidden: !1
|
|
2047
2037
|
}
|
|
2048
2038
|
},
|
|
2049
2039
|
...u
|
|
2050
2040
|
};
|
|
2051
|
-
}, [u,
|
|
2052
|
-
if (!
|
|
2053
|
-
const
|
|
2054
|
-
if (
|
|
2041
|
+
}, [u, _ == null ? void 0 : _.userID]), re = K(null), q = G(async () => {
|
|
2042
|
+
if (!_ || !F) return;
|
|
2043
|
+
const B = _.userID;
|
|
2044
|
+
if (B)
|
|
2055
2045
|
try {
|
|
2056
|
-
S && console.log("[MessagingShell] Syncing channels for user:",
|
|
2057
|
-
const X = await
|
|
2046
|
+
S && console.log("[MessagingShell] Syncing channels for user:", B);
|
|
2047
|
+
const X = await _.queryChannels(
|
|
2058
2048
|
{
|
|
2059
2049
|
type: "messaging",
|
|
2060
|
-
members: { $in: [
|
|
2050
|
+
members: { $in: [B] }
|
|
2061
2051
|
},
|
|
2062
2052
|
{},
|
|
2063
2053
|
{ limit: 100 }
|
|
2064
2054
|
);
|
|
2065
|
-
te(X.length > 0), g(!0), re.current =
|
|
2055
|
+
te(X.length > 0), g(!0), re.current = B, S && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2066
2056
|
channelCount: X.length
|
|
2067
2057
|
});
|
|
2068
2058
|
} catch (X) {
|
|
2069
2059
|
console.error("[MessagingShell] Failed to sync channels:", X);
|
|
2070
2060
|
}
|
|
2071
|
-
}, [
|
|
2072
|
-
|
|
2073
|
-
if (!
|
|
2074
|
-
const
|
|
2075
|
-
|
|
2076
|
-
}, [
|
|
2077
|
-
if (!l || !
|
|
2061
|
+
}, [_, F, S]);
|
|
2062
|
+
J(() => {
|
|
2063
|
+
if (!_ || !F) return;
|
|
2064
|
+
const B = _.userID;
|
|
2065
|
+
B && re.current !== B && q();
|
|
2066
|
+
}, [_, F, q]), J(() => {
|
|
2067
|
+
if (!l || !_ || !F) return;
|
|
2078
2068
|
(async () => {
|
|
2079
|
-
const X =
|
|
2069
|
+
const X = _.userID;
|
|
2080
2070
|
if (X)
|
|
2081
2071
|
try {
|
|
2082
2072
|
S && console.log(
|
|
2083
2073
|
"[MessagingShell] Loading initial conversation with:",
|
|
2084
2074
|
l
|
|
2085
2075
|
);
|
|
2086
|
-
const Q = await
|
|
2076
|
+
const Q = await _.queryChannels(
|
|
2087
2077
|
{
|
|
2088
2078
|
type: "messaging",
|
|
2089
2079
|
members: { $eq: [X, l] }
|
|
@@ -2092,23 +2082,23 @@ const oa = ({
|
|
|
2092
2082
|
{ limit: 1 }
|
|
2093
2083
|
);
|
|
2094
2084
|
if (Q.length > 0)
|
|
2095
|
-
V(Q[0]),
|
|
2085
|
+
V(Q[0]), L(!0), Y(null), o && o(Q[0]), S && console.log(
|
|
2096
2086
|
"[MessagingShell] Initial conversation loaded:",
|
|
2097
2087
|
Q[0].id
|
|
2098
2088
|
);
|
|
2099
|
-
else if (i &&
|
|
2089
|
+
else if (i && y) {
|
|
2100
2090
|
S && console.log(
|
|
2101
2091
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2102
2092
|
i
|
|
2103
2093
|
);
|
|
2104
2094
|
try {
|
|
2105
|
-
const se = await
|
|
2095
|
+
const se = await y.startChannelWithParticipant({
|
|
2106
2096
|
id: i.id,
|
|
2107
2097
|
name: i.name,
|
|
2108
2098
|
email: i.email,
|
|
2109
2099
|
phone: i.phone
|
|
2110
2100
|
});
|
|
2111
|
-
V(se),
|
|
2101
|
+
V(se), L(!0), Y(null), o && o(se), S && console.log(
|
|
2112
2102
|
"[MessagingShell] Channel created and loaded:",
|
|
2113
2103
|
se.id
|
|
2114
2104
|
);
|
|
@@ -2135,40 +2125,40 @@ const oa = ({
|
|
|
2135
2125
|
}, [
|
|
2136
2126
|
l,
|
|
2137
2127
|
i,
|
|
2138
|
-
N,
|
|
2139
|
-
F,
|
|
2140
2128
|
_,
|
|
2129
|
+
F,
|
|
2130
|
+
y,
|
|
2141
2131
|
S,
|
|
2142
2132
|
o
|
|
2143
2133
|
]);
|
|
2144
2134
|
const ie = G(
|
|
2145
|
-
(
|
|
2146
|
-
V(
|
|
2135
|
+
(B) => {
|
|
2136
|
+
V(B), o == null || o(B);
|
|
2147
2137
|
},
|
|
2148
2138
|
[o]
|
|
2149
2139
|
), pe = G(() => {
|
|
2150
2140
|
p || V(null);
|
|
2151
2141
|
}, [p]), ue = G(
|
|
2152
|
-
async (
|
|
2153
|
-
S && console.log("[MessagingShell] Leaving conversation:",
|
|
2142
|
+
async (B) => {
|
|
2143
|
+
S && console.log("[MessagingShell] Leaving conversation:", B.id), V(null), L(!1), re.current = null, await q();
|
|
2154
2144
|
},
|
|
2155
2145
|
[q, S]
|
|
2156
2146
|
), xe = G(
|
|
2157
|
-
async (
|
|
2158
|
-
S && console.log("[MessagingShell] Blocking participant:",
|
|
2147
|
+
async (B) => {
|
|
2148
|
+
S && console.log("[MessagingShell] Blocking participant:", B), V(null), L(!1), re.current = null, await q();
|
|
2159
2149
|
},
|
|
2160
2150
|
[q, S]
|
|
2161
|
-
),
|
|
2162
|
-
return H ? /* @__PURE__ */ e("div", { className:
|
|
2151
|
+
), Z = !!$;
|
|
2152
|
+
return H ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : R ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: R, onBack: z }) }) : !F || !_ ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
2163
2153
|
he,
|
|
2164
2154
|
{
|
|
2165
2155
|
message: "Not connected to messaging service",
|
|
2166
|
-
onBack:
|
|
2156
|
+
onBack: z
|
|
2167
2157
|
}
|
|
2168
|
-
) }) : j ? /* @__PURE__ */ e("div", { className:
|
|
2158
|
+
) }) : j ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
|
|
2169
2159
|
"div",
|
|
2170
2160
|
{
|
|
2171
|
-
className:
|
|
2161
|
+
className: D(
|
|
2172
2162
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2173
2163
|
s
|
|
2174
2164
|
),
|
|
@@ -2176,14 +2166,14 @@ const oa = ({
|
|
|
2176
2166
|
/* @__PURE__ */ e(
|
|
2177
2167
|
"div",
|
|
2178
2168
|
{
|
|
2179
|
-
className:
|
|
2169
|
+
className: D(
|
|
2180
2170
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2181
2171
|
{
|
|
2182
2172
|
"!hidden": m === !1 || p,
|
|
2183
2173
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2184
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p &&
|
|
2174
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p && Z,
|
|
2185
2175
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2186
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !
|
|
2176
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !Z
|
|
2187
2177
|
}
|
|
2188
2178
|
),
|
|
2189
2179
|
children: /* @__PURE__ */ e(
|
|
@@ -2202,17 +2192,17 @@ const oa = ({
|
|
|
2202
2192
|
/* @__PURE__ */ e(
|
|
2203
2193
|
"div",
|
|
2204
2194
|
{
|
|
2205
|
-
className:
|
|
2195
|
+
className: D(
|
|
2206
2196
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2207
2197
|
{
|
|
2208
2198
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2209
|
-
flex: p ||
|
|
2199
|
+
flex: p || Z || l,
|
|
2210
2200
|
// Normal mode: hide on mobile when no channel selected
|
|
2211
|
-
"hidden lg:flex": !p && !
|
|
2201
|
+
"hidden lg:flex": !p && !Z && !l
|
|
2212
2202
|
}
|
|
2213
2203
|
),
|
|
2214
2204
|
children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2215
|
-
|
|
2205
|
+
Nt,
|
|
2216
2206
|
{
|
|
2217
2207
|
channel: $,
|
|
2218
2208
|
onBack: pe,
|
|
@@ -2226,7 +2216,7 @@ const oa = ({
|
|
|
2226
2216
|
showDeleteConversation: ae,
|
|
2227
2217
|
onDeleteConversationClick: v,
|
|
2228
2218
|
onBlockParticipantClick: a,
|
|
2229
|
-
onReportParticipantClick:
|
|
2219
|
+
onReportParticipantClick: N,
|
|
2230
2220
|
dmAgentEnabled: b,
|
|
2231
2221
|
messageMetadata: C,
|
|
2232
2222
|
onMessageSent: x,
|
|
@@ -2265,7 +2255,7 @@ const oa = ({
|
|
|
2265
2255
|
onClick: s,
|
|
2266
2256
|
disabled: n,
|
|
2267
2257
|
style: { backgroundColor: "#E6E5E3" },
|
|
2268
|
-
className:
|
|
2258
|
+
className: D(
|
|
2269
2259
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2270
2260
|
{
|
|
2271
2261
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2336,18 +2326,18 @@ function Fn(t) {
|
|
|
2336
2326
|
return s ? s[1] : "generic";
|
|
2337
2327
|
}
|
|
2338
2328
|
const On = {
|
|
2339
|
-
video:
|
|
2340
|
-
audio:
|
|
2341
|
-
image:
|
|
2329
|
+
video: ys,
|
|
2330
|
+
audio: _s,
|
|
2331
|
+
image: ws,
|
|
2342
2332
|
document: ht
|
|
2343
2333
|
}, Pn = {
|
|
2344
|
-
pdf:
|
|
2345
|
-
doc:
|
|
2346
|
-
xls:
|
|
2347
|
-
csv:
|
|
2348
|
-
ppt:
|
|
2349
|
-
zip:
|
|
2350
|
-
text:
|
|
2334
|
+
pdf: Ts,
|
|
2335
|
+
doc: Ms,
|
|
2336
|
+
xls: ks,
|
|
2337
|
+
csv: Is,
|
|
2338
|
+
ppt: Ss,
|
|
2339
|
+
zip: Es,
|
|
2340
|
+
text: Cs,
|
|
2351
2341
|
markdown: Ns,
|
|
2352
2342
|
generic: ht
|
|
2353
2343
|
};
|
|
@@ -2358,10 +2348,10 @@ function Un(t) {
|
|
|
2358
2348
|
function ge(t, s) {
|
|
2359
2349
|
return O.createElement(Un(t), s);
|
|
2360
2350
|
}
|
|
2361
|
-
const
|
|
2351
|
+
const zn = (t) => {
|
|
2362
2352
|
var s, n;
|
|
2363
2353
|
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2364
|
-
},
|
|
2354
|
+
}, Bn = ({
|
|
2365
2355
|
source: t,
|
|
2366
2356
|
mimeType: s,
|
|
2367
2357
|
poster: n,
|
|
@@ -2373,15 +2363,15 @@ const Bn = (t) => {
|
|
|
2373
2363
|
muted: m = !1,
|
|
2374
2364
|
onContainerClick: u
|
|
2375
2365
|
}) => {
|
|
2376
|
-
const h = be(s), f =
|
|
2366
|
+
const h = be(s), f = K(null), v = K(null), a = K(null), N = K(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, y] = A(!1), [_, F] = A(!0), [H, R] = A(null), z = G(() => {
|
|
2377
2367
|
T(!1), C(!0);
|
|
2378
2368
|
}, []), S = G((g) => {
|
|
2379
2369
|
const p = v.current;
|
|
2380
2370
|
if (!p) return 0;
|
|
2381
|
-
const
|
|
2371
|
+
const L = p.getBoundingClientRect();
|
|
2382
2372
|
return Math.max(
|
|
2383
2373
|
0,
|
|
2384
|
-
Math.min(1, (
|
|
2374
|
+
Math.min(1, (zn(g) - L.left) / L.width)
|
|
2385
2375
|
);
|
|
2386
2376
|
}, []), $ = G((g) => {
|
|
2387
2377
|
const p = f.current;
|
|
@@ -2391,9 +2381,9 @@ const Bn = (t) => {
|
|
|
2391
2381
|
const p = S(g);
|
|
2392
2382
|
I(p), $(p);
|
|
2393
2383
|
};
|
|
2394
|
-
|
|
2395
|
-
o !== void 0 && o !==
|
|
2396
|
-
}, [o]),
|
|
2384
|
+
J(() => {
|
|
2385
|
+
o !== void 0 && o !== N.current && (N.current = o, C(o));
|
|
2386
|
+
}, [o]), J(() => {
|
|
2397
2387
|
if (!b) {
|
|
2398
2388
|
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2399
2389
|
return;
|
|
@@ -2405,15 +2395,15 @@ const Bn = (t) => {
|
|
|
2405
2395
|
return a.current = requestAnimationFrame(g), () => {
|
|
2406
2396
|
a.current !== null && cancelAnimationFrame(a.current);
|
|
2407
2397
|
};
|
|
2408
|
-
}, [b, w]),
|
|
2398
|
+
}, [b, w]), J(() => {
|
|
2409
2399
|
const g = f.current;
|
|
2410
2400
|
g && (b ? g.play().catch((p) => {
|
|
2411
2401
|
C(!1), T(!0);
|
|
2412
2402
|
}) : g.pause());
|
|
2413
|
-
}, [b]),
|
|
2403
|
+
}, [b]), J(() => {
|
|
2414
2404
|
if (!w) return;
|
|
2415
|
-
const g = (
|
|
2416
|
-
E(!1), $(S(
|
|
2405
|
+
const g = (L) => I(S(L)), p = (L) => {
|
|
2406
|
+
E(!1), $(S(L));
|
|
2417
2407
|
};
|
|
2418
2408
|
return window.addEventListener("mousemove", g), window.addEventListener("mouseup", p), window.addEventListener("touchmove", g, { passive: !0 }), window.addEventListener("touchend", p), () => {
|
|
2419
2409
|
window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", p), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", p);
|
|
@@ -2444,7 +2434,7 @@ const Bn = (t) => {
|
|
|
2444
2434
|
}
|
|
2445
2435
|
},
|
|
2446
2436
|
children: [
|
|
2447
|
-
n && (h === "audio" ||
|
|
2437
|
+
n && (h === "audio" || _) && /* @__PURE__ */ e(
|
|
2448
2438
|
"img",
|
|
2449
2439
|
{
|
|
2450
2440
|
src: n,
|
|
@@ -2452,7 +2442,7 @@ const Bn = (t) => {
|
|
|
2452
2442
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
2453
2443
|
}
|
|
2454
2444
|
),
|
|
2455
|
-
!n && (h === "audio" ||
|
|
2445
|
+
!n && (h === "audio" || _) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(s, {
|
|
2456
2446
|
className: "size-12 text-black/20",
|
|
2457
2447
|
weight: "regular"
|
|
2458
2448
|
}) }),
|
|
@@ -2464,11 +2454,11 @@ const Bn = (t) => {
|
|
|
2464
2454
|
loop: l,
|
|
2465
2455
|
muted: m,
|
|
2466
2456
|
style: { width: "100%", height: "100%" },
|
|
2467
|
-
onLoadStart: () =>
|
|
2457
|
+
onLoadStart: () => y(!0),
|
|
2468
2458
|
onCanPlay: () => {
|
|
2469
|
-
|
|
2459
|
+
y(!1), F(!1);
|
|
2470
2460
|
},
|
|
2471
|
-
onWaiting: () =>
|
|
2461
|
+
onWaiting: () => y(!0),
|
|
2472
2462
|
onPlay: () => T(!1),
|
|
2473
2463
|
onEnded: () => {
|
|
2474
2464
|
l || (C(!1), I(0));
|
|
@@ -2484,15 +2474,15 @@ const Bn = (t) => {
|
|
|
2484
2474
|
muted: m,
|
|
2485
2475
|
playsInline: !0,
|
|
2486
2476
|
style: { width: "100%", height: "100%" },
|
|
2487
|
-
onLoadStart: () =>
|
|
2477
|
+
onLoadStart: () => y(!0),
|
|
2488
2478
|
onCanPlay: () => {
|
|
2489
|
-
|
|
2479
|
+
y(!1), F(!1);
|
|
2490
2480
|
},
|
|
2491
|
-
onWaiting: () =>
|
|
2481
|
+
onWaiting: () => y(!0),
|
|
2492
2482
|
onPlay: () => T(!1),
|
|
2493
2483
|
onLoadedMetadata: () => {
|
|
2494
2484
|
const g = f.current;
|
|
2495
|
-
g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight &&
|
|
2485
|
+
g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && R(g.videoWidth / g.videoHeight);
|
|
2496
2486
|
},
|
|
2497
2487
|
onEnded: () => {
|
|
2498
2488
|
l || (C(!1), I(0));
|
|
@@ -2515,10 +2505,10 @@ const Bn = (t) => {
|
|
|
2515
2505
|
tabIndex: 0,
|
|
2516
2506
|
"aria-label": "Play preview",
|
|
2517
2507
|
onClick: (g) => {
|
|
2518
|
-
g.stopPropagation(),
|
|
2508
|
+
g.stopPropagation(), z();
|
|
2519
2509
|
},
|
|
2520
2510
|
onKeyDown: (g) => {
|
|
2521
|
-
g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(),
|
|
2511
|
+
g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), z());
|
|
2522
2512
|
},
|
|
2523
2513
|
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2524
2514
|
}
|
|
@@ -2559,7 +2549,7 @@ const Bn = (t) => {
|
|
|
2559
2549
|
},
|
|
2560
2550
|
className: "shrink-0 text-white",
|
|
2561
2551
|
"aria-label": b ? "Pause" : "Play",
|
|
2562
|
-
children: b ? /* @__PURE__ */ e(
|
|
2552
|
+
children: b ? /* @__PURE__ */ e(Ds, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2563
2553
|
}
|
|
2564
2554
|
),
|
|
2565
2555
|
/* @__PURE__ */ d(
|
|
@@ -2620,7 +2610,7 @@ const Bn = (t) => {
|
|
|
2620
2610
|
}) => {
|
|
2621
2611
|
const c = be(t), [m, u] = A(!1);
|
|
2622
2612
|
return s && (c === "video" || c === "audio") ? /* @__PURE__ */ e(
|
|
2623
|
-
|
|
2613
|
+
Bn,
|
|
2624
2614
|
{
|
|
2625
2615
|
source: s,
|
|
2626
2616
|
mimeType: t,
|
|
@@ -2703,13 +2693,13 @@ const Bn = (t) => {
|
|
|
2703
2693
|
rootRef: h,
|
|
2704
2694
|
"data-testid": f
|
|
2705
2695
|
}) => {
|
|
2706
|
-
const v = t === "dark", a = v ? n ?? r : n ?? "",
|
|
2696
|
+
const v = t === "dark", a = v ? n ?? r : n ?? "", N = v && !n;
|
|
2707
2697
|
return /* @__PURE__ */ d(
|
|
2708
2698
|
"div",
|
|
2709
2699
|
{
|
|
2710
2700
|
ref: h,
|
|
2711
2701
|
"data-testid": f,
|
|
2712
|
-
className:
|
|
2702
|
+
className: D(
|
|
2713
2703
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
2714
2704
|
v ? "bg-[#121110]" : "bg-white"
|
|
2715
2705
|
),
|
|
@@ -2721,17 +2711,17 @@ const Bn = (t) => {
|
|
|
2721
2711
|
a.trim() !== "" && /* @__PURE__ */ e(
|
|
2722
2712
|
"p",
|
|
2723
2713
|
{
|
|
2724
|
-
className:
|
|
2714
|
+
className: D("mb-0.5 truncate text-base font-medium", {
|
|
2725
2715
|
"text-black": !v,
|
|
2726
|
-
"text-white/30": v &&
|
|
2727
|
-
"text-white": v && !
|
|
2716
|
+
"text-white/30": v && N,
|
|
2717
|
+
"text-white": v && !N
|
|
2728
2718
|
}),
|
|
2729
2719
|
children: a
|
|
2730
2720
|
}
|
|
2731
2721
|
),
|
|
2732
2722
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
2733
2723
|
ge(o, {
|
|
2734
|
-
className:
|
|
2724
|
+
className: D(
|
|
2735
2725
|
"size-5 shrink-0",
|
|
2736
2726
|
v ? "text-white/55" : "text-black/55"
|
|
2737
2727
|
),
|
|
@@ -2740,7 +2730,7 @@ const Bn = (t) => {
|
|
|
2740
2730
|
l != null && l !== "" && /* @__PURE__ */ e(
|
|
2741
2731
|
"span",
|
|
2742
2732
|
{
|
|
2743
|
-
className:
|
|
2733
|
+
className: D(
|
|
2744
2734
|
"text-xs font-medium",
|
|
2745
2735
|
v ? "text-white/55" : "text-black/55"
|
|
2746
2736
|
),
|
|
@@ -2789,7 +2779,7 @@ const Le = ({ attachment: t, isMyMessage: s }) => {
|
|
|
2789
2779
|
"div",
|
|
2790
2780
|
{
|
|
2791
2781
|
className: `aspect-video w-full rounded-[20px] ${jn(s)} flex items-center justify-center`,
|
|
2792
|
-
children: /* @__PURE__ */ e(
|
|
2782
|
+
children: /* @__PURE__ */ e(Rs, { className: `size-12 ${Yn(s)}` })
|
|
2793
2783
|
}
|
|
2794
2784
|
) }),
|
|
2795
2785
|
/* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
|
|
@@ -2839,21 +2829,21 @@ const qn = ({
|
|
|
2839
2829
|
disabled: n,
|
|
2840
2830
|
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",
|
|
2841
2831
|
children: n ? /* @__PURE__ */ e(ft, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
|
|
2842
|
-
/* @__PURE__ */ e(
|
|
2832
|
+
/* @__PURE__ */ e(Ls, { className: "size-4 text-white", weight: "bold" }),
|
|
2843
2833
|
"Download"
|
|
2844
2834
|
] })
|
|
2845
2835
|
}
|
|
2846
2836
|
);
|
|
2847
2837
|
};
|
|
2848
2838
|
function Fe(t) {
|
|
2849
|
-
var f, v, a,
|
|
2839
|
+
var f, v, a, N;
|
|
2850
2840
|
const s = (f = t.attachments) == null ? void 0 : f.find(
|
|
2851
2841
|
(b) => b.type === "video" && b.asset_url
|
|
2852
2842
|
), n = (v = t.attachments) == null ? void 0 : v.find(
|
|
2853
2843
|
(b) => b.type === "image" && b.image_url
|
|
2854
2844
|
), r = (a = t.attachments) == null ? void 0 : a.find(
|
|
2855
2845
|
(b) => b.type === "audio" && b.asset_url
|
|
2856
|
-
), o = (
|
|
2846
|
+
), o = (N = t.attachments) == null ? void 0 : N.find(
|
|
2857
2847
|
(b) => b.type === "file" && b.asset_url
|
|
2858
2848
|
), l = s ?? n ?? r ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (r == null ? void 0 : r.asset_url) ?? (o == null ? void 0 : o.asset_url);
|
|
2859
2849
|
if (!i) return null;
|
|
@@ -2984,17 +2974,17 @@ export {
|
|
|
2984
2974
|
me as b,
|
|
2985
2975
|
ne as c,
|
|
2986
2976
|
wt as d,
|
|
2987
|
-
|
|
2977
|
+
Nt as e,
|
|
2988
2978
|
ia as f,
|
|
2989
2979
|
Ln as g,
|
|
2990
2980
|
ln as h,
|
|
2991
2981
|
ra as i,
|
|
2992
2982
|
oa as j,
|
|
2993
|
-
|
|
2983
|
+
zs as k,
|
|
2994
2984
|
Fe as l,
|
|
2995
|
-
|
|
2996
|
-
|
|
2985
|
+
Qs as m,
|
|
2986
|
+
As as n,
|
|
2997
2987
|
Ae as r,
|
|
2998
|
-
|
|
2988
|
+
on as u
|
|
2999
2989
|
};
|
|
3000
|
-
//# sourceMappingURL=index-
|
|
2990
|
+
//# sourceMappingURL=index-8ZuHtwFb.js.map
|