@linktr.ee/messaging-react 3.23.0-rc-1785426600 → 3.24.0
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-BiZLzRIQ.cjs → Card-CRhkz5Jp.cjs} +2 -2
- package/dist/{Card-BiZLzRIQ.cjs.map → Card-CRhkz5Jp.cjs.map} +1 -1
- package/dist/{Card-G28kYBkV.js → Card-Cgn2G-VJ.js} +2 -2
- package/dist/{Card-G28kYBkV.js.map → Card-Cgn2G-VJ.js.map} +1 -1
- package/dist/index-BwfUbPpY.cjs +2 -0
- package/dist/{index-BnBvT5FW.cjs.map → index-BwfUbPpY.cjs.map} +1 -1
- package/dist/{index-DIKyFjPC.js → index-Daw6ObfN.js} +418 -411
- package/dist/{index-DIKyFjPC.js.map → index-Daw6ObfN.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.test.tsx +66 -1
- package/src/components/ChannelView.tsx +14 -2
- package/dist/index-BnBvT5FW.cjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as s, jsxs as h, Fragment as
|
|
2
|
-
import F, { createContext as lt, useContext as ke, useCallback as
|
|
1
|
+
import { jsx as s, jsxs as h, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import F, { createContext as lt, useContext as ke, useCallback as W, useState as B, useRef as H, useEffect as Y, useId as en, useMemo as ne, Suspense as tn } from "react";
|
|
3
3
|
import { StreamChatService as sn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as nn, LinkPreviewsManager as et } from "stream-chat";
|
|
5
5
|
import { Chat as an, useChannelStateContext as he, useChatContext as Se, DateSeparator as rn, useMessageContext as fe, MessageStatus as on, MessageErrorIcon as tt, MessageText as ze, areMessageUIPropsEqual as ln, useMessageReminder as cn, useComponentContext as ds, Attachment as dn, EditMessageModal as un, MessageBlocked as mn, MessageBouncePrompt as hn, MessageDeleted as fn, MessageIsThreadReplyInChannelButtonIndicator as gn, MessageRepliesCountButton as pn, ReminderNotification as bn, StreamedMessageText as vn, messageHasAttachments as xn, messageHasReactions as _n, isDateSeparatorMessage as wn, isMessageBlocked as Nn, isMessageBounced as yn, MessageBounceModal as Cn, Poll as kn, useMessageComposer as Sn, useStateStore as En, MessageInput as Yt, useMessageInputContext as In, useMessageComposerHasSendableData as Tn, AttachmentPreviewList as An, QuotedMessagePreview as Ln, TextareaComposer as Mn, MessageTimestamp as Ge, AIStates as Ye, useTypingContext as Rn, useAIState as Dn, Channel as Pn, WithComponents as On, Window as zn, MessageList as Wt, ChannelList as Bn, InfiniteScroll as Fn } from "stream-chat-react";
|
|
@@ -26,10 +26,10 @@ const ps = lt({
|
|
|
26
26
|
debug: i = !1,
|
|
27
27
|
client: l
|
|
28
28
|
}) => {
|
|
29
|
-
var k,
|
|
30
|
-
const o =
|
|
31
|
-
(
|
|
32
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
29
|
+
var k, E;
|
|
30
|
+
const o = W(
|
|
31
|
+
(I, ...A) => {
|
|
32
|
+
i && console.log(`🔥 [MessagingProvider] ${I}`, ...A);
|
|
33
33
|
},
|
|
34
34
|
[i]
|
|
35
35
|
);
|
|
@@ -39,18 +39,18 @@ const ps = lt({
|
|
|
39
39
|
serviceConfig: !!n,
|
|
40
40
|
capabilities: Object.keys(r)
|
|
41
41
|
});
|
|
42
|
-
const [d, m] = B(null), [f, u] = B(null), [g, c] = B(!1), [x, _] = B(!1), [b, p] = B(null), v =
|
|
42
|
+
const [d, m] = B(null), [f, u] = B(null), [g, c] = B(!1), [x, _] = B(!1), [b, p] = B(null), v = H(!1), w = H(null), C = H(n);
|
|
43
43
|
C.current = n;
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const O =
|
|
44
|
+
const T = H(i);
|
|
45
|
+
T.current = i;
|
|
46
|
+
const O = H({
|
|
47
47
|
userId: t == null ? void 0 : t.id,
|
|
48
48
|
apiKey: a,
|
|
49
49
|
serviceConfig: n,
|
|
50
50
|
capabilities: r
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
renderCount:
|
|
51
|
+
}), R = H(0);
|
|
52
|
+
R.current++, o("📊 RENDER INFO", {
|
|
53
|
+
renderCount: R.current,
|
|
54
54
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
55
55
|
propChanges: {
|
|
56
56
|
userChanged: O.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -64,40 +64,40 @@ const ps = lt({
|
|
|
64
64
|
serviceConfig: n,
|
|
65
65
|
capabilities: r
|
|
66
66
|
};
|
|
67
|
-
const z =
|
|
67
|
+
const z = H(null);
|
|
68
68
|
!l && a && ((k = z.current) == null ? void 0 : k.apiKey) !== a && (z.current = { apiKey: a, client: new nn(a) });
|
|
69
|
-
const $ = l || (a ? ((
|
|
70
|
-
|
|
71
|
-
const
|
|
69
|
+
const $ = l || (a ? ((E = z.current) == null ? void 0 : E.client) ?? null : null);
|
|
70
|
+
Y(() => {
|
|
71
|
+
const I = R.current, A = C.current;
|
|
72
72
|
if (l) {
|
|
73
73
|
w.current = null, m(null), u(null), c(!1), p(null), _(!1);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
if (!a || !$ || !
|
|
76
|
+
if (!a || !$ || !A) {
|
|
77
77
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: I,
|
|
79
79
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
80
80
|
});
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
o("🚀 CREATING SERVICE", {
|
|
84
|
-
renderCount:
|
|
84
|
+
renderCount: I,
|
|
85
85
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
86
86
|
});
|
|
87
87
|
const U = new sn({
|
|
88
|
-
...
|
|
88
|
+
...A,
|
|
89
89
|
apiKey: a,
|
|
90
|
-
debug:
|
|
90
|
+
debug: T.current,
|
|
91
91
|
client: $
|
|
92
92
|
});
|
|
93
93
|
w.current = U, m(U), o("✅ SERVICE SET", {
|
|
94
|
-
renderCount:
|
|
94
|
+
renderCount: I,
|
|
95
95
|
serviceInstance: !!U
|
|
96
96
|
});
|
|
97
97
|
}, [a, $, l]);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
var
|
|
98
|
+
const L = H(null);
|
|
99
|
+
Y(() => {
|
|
100
|
+
var A, U;
|
|
101
101
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
102
|
hasService: !!d,
|
|
103
103
|
hasUser: !!t,
|
|
@@ -115,7 +115,7 @@ const ps = lt({
|
|
|
115
115
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
if (((
|
|
118
|
+
if (((A = L.current) == null ? void 0 : A.serviceId) === d && ((U = L.current) == null ? void 0 : U.userId) === t.id) {
|
|
119
119
|
o(
|
|
120
120
|
"⚠️ USER CONNECTION SKIPPED",
|
|
121
121
|
"Already connected this user with this service"
|
|
@@ -126,16 +126,16 @@ const ps = lt({
|
|
|
126
126
|
o("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, _(!0), p(null);
|
|
127
127
|
try {
|
|
128
128
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
129
|
-
const
|
|
130
|
-
u(
|
|
129
|
+
const j = await d.connectUser(t);
|
|
130
|
+
u(j), c(!0), L.current = { serviceId: d, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
131
131
|
userId: t.id,
|
|
132
|
-
clientId:
|
|
132
|
+
clientId: j.userID
|
|
133
133
|
});
|
|
134
|
-
} catch (
|
|
135
|
-
const
|
|
136
|
-
p(
|
|
134
|
+
} catch (j) {
|
|
135
|
+
const q = j instanceof Error ? j.message : "Connection failed";
|
|
136
|
+
p(q), o("❌ USER CONNECTION ERROR", {
|
|
137
137
|
userId: t.id,
|
|
138
|
-
error:
|
|
138
|
+
error: q
|
|
139
139
|
});
|
|
140
140
|
} finally {
|
|
141
141
|
_(!1), v.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
@@ -144,14 +144,14 @@ const ps = lt({
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
})();
|
|
147
|
-
}, [d, t, o, g, l]),
|
|
148
|
-
const
|
|
147
|
+
}, [d, t, o, g, l]), Y(() => {
|
|
148
|
+
const I = $;
|
|
149
149
|
return () => {
|
|
150
|
-
var
|
|
151
|
-
|
|
150
|
+
var A;
|
|
151
|
+
I && (L.current = null, (A = w.current) == null || A.disconnectUser().catch(console.error));
|
|
152
152
|
};
|
|
153
153
|
}, [$]);
|
|
154
|
-
const S =
|
|
154
|
+
const S = W(async () => {
|
|
155
155
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
156
156
|
hasService: !!d,
|
|
157
157
|
hasUser: !!t
|
|
@@ -163,19 +163,19 @@ const ps = lt({
|
|
|
163
163
|
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), _(!0);
|
|
164
164
|
try {
|
|
165
165
|
o("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
166
|
-
const
|
|
167
|
-
u(
|
|
168
|
-
} catch (
|
|
169
|
-
const
|
|
170
|
-
p(
|
|
166
|
+
const I = await d.connectUser(t);
|
|
167
|
+
u(I), c(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
168
|
+
} catch (I) {
|
|
169
|
+
const A = I instanceof Error ? I.message : "Refresh failed";
|
|
170
|
+
p(A), o("❌ CONNECTION REFRESH ERROR", {
|
|
171
171
|
userId: t.id,
|
|
172
|
-
error:
|
|
172
|
+
error: A
|
|
173
173
|
});
|
|
174
174
|
} finally {
|
|
175
175
|
_(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
}, [d, t, o, l]),
|
|
178
|
+
}, [d, t, o, l]), P = F.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!d,
|
|
180
180
|
hasClient: !!f,
|
|
181
181
|
isConnected: g,
|
|
@@ -212,10 +212,10 @@ const ps = lt({
|
|
|
212
212
|
o
|
|
213
213
|
]);
|
|
214
214
|
return o("🔄 RENDER END", {
|
|
215
|
-
renderCount:
|
|
215
|
+
renderCount: R.current,
|
|
216
216
|
willRenderChat: !!$,
|
|
217
|
-
contextValueReady: !!
|
|
218
|
-
}), /* @__PURE__ */ s(ps.Provider, { value:
|
|
217
|
+
contextValueReady: !!P
|
|
218
|
+
}), /* @__PURE__ */ s(ps.Provider, { value: P, children: $ ? /* @__PURE__ */ s(
|
|
219
219
|
an,
|
|
220
220
|
{
|
|
221
221
|
client: $,
|
|
@@ -230,7 +230,7 @@ const ps = lt({
|
|
|
230
230
|
const [t, n] = B(
|
|
231
231
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
232
232
|
);
|
|
233
|
-
return
|
|
233
|
+
return Y(() => {
|
|
234
234
|
var l;
|
|
235
235
|
if (!e) {
|
|
236
236
|
n(!1);
|
|
@@ -408,9 +408,9 @@ const _e = ({
|
|
|
408
408
|
onActionComplete: m,
|
|
409
409
|
logLabel: f = "useChannelModerationActions"
|
|
410
410
|
}) => {
|
|
411
|
-
var
|
|
412
|
-
const { service: u, debug: g } = dt(), c = (
|
|
413
|
-
return
|
|
411
|
+
var P;
|
|
412
|
+
const { service: u, debug: g } = dt(), c = (P = t == null ? void 0 : t.user) == null ? void 0 : P.id, x = !!(a && n && u && c), [_, b] = B(!1), [p, v] = B(null), [w, C] = B(!1), [T, O] = B(!1), R = x && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
|
|
413
|
+
return Y(() => {
|
|
414
414
|
if (!x || !u || !c) {
|
|
415
415
|
b(!1), v(null);
|
|
416
416
|
return;
|
|
@@ -418,15 +418,15 @@ const _e = ({
|
|
|
418
418
|
let k = !1;
|
|
419
419
|
return (async () => {
|
|
420
420
|
try {
|
|
421
|
-
const
|
|
421
|
+
const E = await u.getBlockedUsers();
|
|
422
422
|
if (k) return;
|
|
423
423
|
b(
|
|
424
|
-
|
|
425
|
-
(
|
|
424
|
+
E.some(
|
|
425
|
+
(I) => I.blocked_user_id === c
|
|
426
426
|
)
|
|
427
427
|
);
|
|
428
|
-
} catch (
|
|
429
|
-
k || console.error(`[${f}] Failed to check blocked status:`,
|
|
428
|
+
} catch (E) {
|
|
429
|
+
k || console.error(`[${f}] Failed to check blocked status:`, E);
|
|
430
430
|
} finally {
|
|
431
431
|
k || v({ participantId: c, service: u });
|
|
432
432
|
}
|
|
@@ -435,44 +435,44 @@ const _e = ({
|
|
|
435
435
|
};
|
|
436
436
|
}, [x, u, c, f]), {
|
|
437
437
|
isParticipantBlocked: _,
|
|
438
|
-
isCheckingBlockedStatus:
|
|
438
|
+
isCheckingBlockedStatus: R,
|
|
439
439
|
isLeaving: w,
|
|
440
|
-
isUpdatingBlockStatus:
|
|
440
|
+
isUpdatingBlockStatus: T,
|
|
441
441
|
handleLeaveConversation: async () => {
|
|
442
442
|
var k;
|
|
443
443
|
if (!w) {
|
|
444
444
|
l == null || l(), g && console.log(`[${f}] Leave conversation`, e.cid), C(!0);
|
|
445
445
|
try {
|
|
446
|
-
const
|
|
447
|
-
await e.hide(
|
|
448
|
-
} catch (
|
|
449
|
-
console.error(`[${f}] Failed to leave conversation`,
|
|
446
|
+
const E = ((k = e._client) == null ? void 0 : k.userID) ?? null;
|
|
447
|
+
await e.hide(E, !1), r && await r(e), m == null || m();
|
|
448
|
+
} catch (E) {
|
|
449
|
+
console.error(`[${f}] Failed to leave conversation`, E);
|
|
450
450
|
} finally {
|
|
451
451
|
C(!1);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
handleBlockUser: async () => {
|
|
456
|
-
var k,
|
|
457
|
-
if (!(
|
|
456
|
+
var k, E, I;
|
|
457
|
+
if (!(T || !u)) {
|
|
458
458
|
o == null || o(), g && console.log(`[${f}] Block member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), O(!0);
|
|
459
459
|
try {
|
|
460
|
-
await u.blockUser((
|
|
461
|
-
} catch (
|
|
462
|
-
console.error(`[${f}] Failed to block member`,
|
|
460
|
+
await u.blockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), m == null || m();
|
|
461
|
+
} catch (A) {
|
|
462
|
+
console.error(`[${f}] Failed to block member`, A);
|
|
463
463
|
} finally {
|
|
464
464
|
O(!1);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
},
|
|
468
468
|
handleUnblockUser: async () => {
|
|
469
|
-
var k,
|
|
470
|
-
if (!(
|
|
469
|
+
var k, E, I;
|
|
470
|
+
if (!(T || !u)) {
|
|
471
471
|
o == null || o(), g && console.log(`[${f}] Unblock member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), O(!0);
|
|
472
472
|
try {
|
|
473
|
-
await u.unBlockUser((
|
|
474
|
-
} catch (
|
|
475
|
-
console.error(`[${f}] Failed to unblock member`,
|
|
473
|
+
await u.unBlockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), m == null || m();
|
|
474
|
+
} catch (A) {
|
|
475
|
+
console.error(`[${f}] Failed to unblock member`, A);
|
|
476
476
|
} finally {
|
|
477
477
|
O(!1);
|
|
478
478
|
}
|
|
@@ -513,14 +513,14 @@ const _e = ({
|
|
|
513
513
|
customChannelActions: f,
|
|
514
514
|
triggerClassName: u
|
|
515
515
|
}) => {
|
|
516
|
-
const [g, c] = B(!1), x =
|
|
516
|
+
const [g, c] = B(!1), x = H(null), _ = en(), b = W(() => c(!1), []), {
|
|
517
517
|
isParticipantBlocked: p,
|
|
518
518
|
isCheckingBlockedStatus: v,
|
|
519
519
|
isLeaving: w,
|
|
520
520
|
isUpdatingBlockStatus: C,
|
|
521
|
-
handleLeaveConversation:
|
|
521
|
+
handleLeaveConversation: T,
|
|
522
522
|
handleBlockUser: O,
|
|
523
|
-
handleUnblockUser:
|
|
523
|
+
handleUnblockUser: R,
|
|
524
524
|
handleReportUser: z
|
|
525
525
|
} = Sa({
|
|
526
526
|
channel: e,
|
|
@@ -535,15 +535,15 @@ const _e = ({
|
|
|
535
535
|
onActionComplete: b,
|
|
536
536
|
logLabel: "ChannelActionsMenu"
|
|
537
537
|
});
|
|
538
|
-
return
|
|
538
|
+
return Y(() => {
|
|
539
539
|
if (!g) return;
|
|
540
|
-
const
|
|
541
|
-
x.current && !x.current.contains(
|
|
542
|
-
}, S = (
|
|
543
|
-
|
|
540
|
+
const L = (P) => {
|
|
541
|
+
x.current && !x.current.contains(P.target) && c(!1);
|
|
542
|
+
}, S = (P) => {
|
|
543
|
+
P.key === "Escape" && c(!1);
|
|
544
544
|
};
|
|
545
|
-
return document.addEventListener("mousedown",
|
|
546
|
-
document.removeEventListener("mousedown",
|
|
545
|
+
return document.addEventListener("mousedown", L), document.addEventListener("keydown", S), () => {
|
|
546
|
+
document.removeEventListener("mousedown", L), document.removeEventListener("keydown", S);
|
|
547
547
|
};
|
|
548
548
|
}, [g]), !t || !(n || a || r || !!f) ? null : /* @__PURE__ */ h("div", { ref: x, className: "relative", children: [
|
|
549
549
|
/* @__PURE__ */ h(
|
|
@@ -554,7 +554,7 @@ const _e = ({
|
|
|
554
554
|
"aria-haspopup": "true",
|
|
555
555
|
"aria-expanded": g,
|
|
556
556
|
"aria-controls": g ? _ : void 0,
|
|
557
|
-
onClick: () => c((
|
|
557
|
+
onClick: () => c((L) => !L),
|
|
558
558
|
children: [
|
|
559
559
|
/* @__PURE__ */ s($n, { className: "size-5 text-black/90" }),
|
|
560
560
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
@@ -574,7 +574,7 @@ const _e = ({
|
|
|
574
574
|
n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(
|
|
575
575
|
we,
|
|
576
576
|
{
|
|
577
|
-
onClick:
|
|
577
|
+
onClick: T,
|
|
578
578
|
disabled: w,
|
|
579
579
|
"aria-busy": w,
|
|
580
580
|
children: [
|
|
@@ -593,7 +593,7 @@ const _e = ({
|
|
|
593
593
|
) : p ? /* @__PURE__ */ h(
|
|
594
594
|
we,
|
|
595
595
|
{
|
|
596
|
-
onClick:
|
|
596
|
+
onClick: R,
|
|
597
597
|
disabled: C,
|
|
598
598
|
"aria-busy": C,
|
|
599
599
|
children: [
|
|
@@ -640,31 +640,31 @@ const _e = ({
|
|
|
640
640
|
showChannelInfo: x = !0,
|
|
641
641
|
onParticipantNameClick: _
|
|
642
642
|
}) => {
|
|
643
|
-
var S,
|
|
643
|
+
var S, P, k, E;
|
|
644
644
|
const { channel: b } = he(), { client: p } = Se(), v = F.useMemo(
|
|
645
645
|
() => {
|
|
646
|
-
var
|
|
646
|
+
var I;
|
|
647
647
|
return vs(
|
|
648
|
-
(
|
|
648
|
+
(I = b.state) == null ? void 0 : I.members,
|
|
649
649
|
p == null ? void 0 : p.userID,
|
|
650
650
|
b.type
|
|
651
651
|
);
|
|
652
652
|
},
|
|
653
653
|
[(S = b.state) == null ? void 0 : S.members, p == null ? void 0 : p.userID, b.type]
|
|
654
|
-
), w = xs(v == null ? void 0 : v.user), C = (
|
|
654
|
+
), w = xs(v == null ? void 0 : v.user), C = (P = v == null ? void 0 : v.user) == null ? void 0 : P.image, T = bs(b), O = Ta((k = b.data) == null ? void 0 : k.customer_tag) && (v == null ? void 0 : v.is_follower) === !0, R = a && T, z = O || R || !!_, $ = async () => {
|
|
655
655
|
try {
|
|
656
|
-
|
|
657
|
-
} catch (
|
|
656
|
+
T ? await b.unpin() : await b.pin();
|
|
657
|
+
} catch (I) {
|
|
658
658
|
console.error(
|
|
659
659
|
"[ChannelHeaderRedesign] Failed to update pinned status:",
|
|
660
|
-
|
|
660
|
+
I
|
|
661
661
|
);
|
|
662
662
|
}
|
|
663
|
-
},
|
|
663
|
+
}, L = /* @__PURE__ */ h(J, { children: [
|
|
664
664
|
/* @__PURE__ */ s(
|
|
665
665
|
_e,
|
|
666
666
|
{
|
|
667
|
-
id: ((
|
|
667
|
+
id: ((E = v == null ? void 0 : v.user) == null ? void 0 : E.id) || b.id || "unknown",
|
|
668
668
|
name: w,
|
|
669
669
|
image: C,
|
|
670
670
|
shape: "circle",
|
|
@@ -690,7 +690,7 @@ const _e = ({
|
|
|
690
690
|
children: /* @__PURE__ */ s(Vn, { className: "size-2.5", weight: "bold" })
|
|
691
691
|
}
|
|
692
692
|
),
|
|
693
|
-
|
|
693
|
+
R && /* @__PURE__ */ s(
|
|
694
694
|
"span",
|
|
695
695
|
{
|
|
696
696
|
"aria-label": "Starred conversation",
|
|
@@ -740,9 +740,9 @@ const _e = ({
|
|
|
740
740
|
onClick: _,
|
|
741
741
|
"aria-label": `View details for ${w}`,
|
|
742
742
|
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",
|
|
743
|
-
children:
|
|
743
|
+
children: L
|
|
744
744
|
}
|
|
745
|
-
) : /* @__PURE__ */ s("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children:
|
|
745
|
+
) : /* @__PURE__ */ s("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children: L }) }),
|
|
746
746
|
/* @__PURE__ */ h("div", { className: "flex items-start justify-end gap-2", children: [
|
|
747
747
|
a && /* @__PURE__ */ s(
|
|
748
748
|
"button",
|
|
@@ -750,16 +750,16 @@ const _e = ({
|
|
|
750
750
|
className: We,
|
|
751
751
|
onClick: $,
|
|
752
752
|
type: "button",
|
|
753
|
-
"aria-pressed":
|
|
754
|
-
"aria-label":
|
|
753
|
+
"aria-pressed": T,
|
|
754
|
+
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
755
755
|
children: /* @__PURE__ */ s(
|
|
756
756
|
st,
|
|
757
757
|
{
|
|
758
758
|
className: y("size-5", {
|
|
759
|
-
"text-[#FFD60A]":
|
|
760
|
-
"text-black/90": !
|
|
759
|
+
"text-[#FFD60A]": T,
|
|
760
|
+
"text-black/90": !T
|
|
761
761
|
}),
|
|
762
|
-
weight:
|
|
762
|
+
weight: T ? "fill" : "regular"
|
|
763
763
|
}
|
|
764
764
|
)
|
|
765
765
|
}
|
|
@@ -790,10 +790,10 @@ function Ma(e) {
|
|
|
790
790
|
return e != null && e.length ? e.some((t) => t.type === rt) ? "down" : e.some((t) => t.type === at) ? "up" : null : null;
|
|
791
791
|
}
|
|
792
792
|
function Ra(e) {
|
|
793
|
-
const { channel: t } = he(), { client: n } = Se("useMessageVote"), a =
|
|
793
|
+
const { channel: t } = he(), { client: n } = Se("useMessageVote"), a = ne(
|
|
794
794
|
() => Ma(e.own_reactions),
|
|
795
795
|
[e.own_reactions]
|
|
796
|
-
), r =
|
|
796
|
+
), r = W(async () => {
|
|
797
797
|
if (n != null && n.userID)
|
|
798
798
|
try {
|
|
799
799
|
a === "up" ? await t.deleteReaction(e.id, at) : await t.sendReaction(
|
|
@@ -803,7 +803,7 @@ function Ra(e) {
|
|
|
803
803
|
);
|
|
804
804
|
} catch {
|
|
805
805
|
}
|
|
806
|
-
}, [t, n == null ? void 0 : n.userID, e.id, a]), i =
|
|
806
|
+
}, [t, n == null ? void 0 : n.userID, e.id, a]), i = W(async () => {
|
|
807
807
|
if (n != null && n.userID)
|
|
808
808
|
try {
|
|
809
809
|
a === "down" ? await t.deleteReaction(e.id, rt) : await t.sendReaction(
|
|
@@ -905,66 +905,66 @@ const Va = (e) => {
|
|
|
905
905
|
muted: d = !1,
|
|
906
906
|
onContainerClick: m
|
|
907
907
|
}) => {
|
|
908
|
-
const f = ce(t), u =
|
|
908
|
+
const f = ce(t), u = H(null), g = H(null), c = H(null), x = H(r), [_, b] = B(a), [p, v] = B(0), [w, C] = B(!1), [T, O] = B(!1), [R, z] = B(!1), [$, L] = B(!1), [S, P] = B(!0), [k, E] = B(null), I = W(() => {
|
|
909
909
|
z(!1), b(!0);
|
|
910
|
-
}, []),
|
|
911
|
-
const
|
|
912
|
-
if (!
|
|
913
|
-
const
|
|
910
|
+
}, []), A = W((N) => {
|
|
911
|
+
const M = g.current;
|
|
912
|
+
if (!M) return 0;
|
|
913
|
+
const G = M.getBoundingClientRect();
|
|
914
914
|
return Math.max(
|
|
915
915
|
0,
|
|
916
|
-
Math.min(1, (Va(N) -
|
|
916
|
+
Math.min(1, (Va(N) - G.left) / G.width)
|
|
917
917
|
);
|
|
918
|
-
}, []), U =
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
}, []),
|
|
918
|
+
}, []), U = W((N) => {
|
|
919
|
+
const M = u.current;
|
|
920
|
+
M && M.duration && (M.currentTime = N * M.duration);
|
|
921
|
+
}, []), j = (N) => {
|
|
922
922
|
N.stopPropagation(), C(!0);
|
|
923
|
-
const
|
|
924
|
-
v(
|
|
923
|
+
const M = A(N);
|
|
924
|
+
v(M), U(M);
|
|
925
925
|
};
|
|
926
|
-
|
|
926
|
+
Y(() => {
|
|
927
927
|
r !== void 0 && r !== x.current && (x.current = r, b(r));
|
|
928
|
-
}, [r]),
|
|
928
|
+
}, [r]), Y(() => {
|
|
929
929
|
if (!_) {
|
|
930
930
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
931
931
|
return;
|
|
932
932
|
}
|
|
933
933
|
const N = () => {
|
|
934
|
-
const
|
|
935
|
-
|
|
934
|
+
const M = u.current;
|
|
935
|
+
M && M.duration && !w && v(M.currentTime / M.duration), c.current = requestAnimationFrame(N);
|
|
936
936
|
};
|
|
937
937
|
return c.current = requestAnimationFrame(N), () => {
|
|
938
938
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
939
939
|
};
|
|
940
|
-
}, [_, w]),
|
|
940
|
+
}, [_, w]), Y(() => {
|
|
941
941
|
const N = u.current;
|
|
942
|
-
N && (_ ? N.play().catch((
|
|
942
|
+
N && (_ ? N.play().catch((M) => {
|
|
943
943
|
b(!1), z(!0);
|
|
944
944
|
}) : N.pause());
|
|
945
|
-
}, [_]),
|
|
945
|
+
}, [_]), Y(() => {
|
|
946
946
|
if (!w) return;
|
|
947
|
-
const N = (
|
|
948
|
-
C(!1), U(
|
|
947
|
+
const N = (G) => v(A(G)), M = (G) => {
|
|
948
|
+
C(!1), U(A(G));
|
|
949
949
|
};
|
|
950
|
-
return window.addEventListener("mousemove", N), window.addEventListener("mouseup",
|
|
951
|
-
window.removeEventListener("mousemove", N), window.removeEventListener("mouseup",
|
|
950
|
+
return window.addEventListener("mousemove", N), window.addEventListener("mouseup", M), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", M), () => {
|
|
951
|
+
window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", M), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", M);
|
|
952
952
|
};
|
|
953
|
-
}, [w,
|
|
954
|
-
const
|
|
953
|
+
}, [w, A, U]);
|
|
954
|
+
const q = k ? { aspectRatio: String(k) } : void 0, Q = k ? "" : " aspect-video", K = Math.round(p * 100);
|
|
955
955
|
return /* @__PURE__ */ h(
|
|
956
956
|
"div",
|
|
957
957
|
{
|
|
958
958
|
role: "button",
|
|
959
959
|
tabIndex: 0,
|
|
960
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
961
|
-
style:
|
|
960
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${Q}`,
|
|
961
|
+
style: q,
|
|
962
962
|
onClick: (N) => {
|
|
963
963
|
if (m) {
|
|
964
964
|
m(N);
|
|
965
965
|
return;
|
|
966
966
|
}
|
|
967
|
-
|
|
967
|
+
R || l && b((M) => !M);
|
|
968
968
|
},
|
|
969
969
|
onKeyDown: (N) => {
|
|
970
970
|
if (!(N.key !== "Enter" && N.key !== " ")) {
|
|
@@ -972,7 +972,7 @@ const Va = (e) => {
|
|
|
972
972
|
m(N);
|
|
973
973
|
return;
|
|
974
974
|
}
|
|
975
|
-
|
|
975
|
+
R || l && b((M) => !M);
|
|
976
976
|
}
|
|
977
977
|
},
|
|
978
978
|
children: [
|
|
@@ -996,11 +996,11 @@ const Va = (e) => {
|
|
|
996
996
|
loop: i,
|
|
997
997
|
muted: d,
|
|
998
998
|
style: { width: "100%", height: "100%" },
|
|
999
|
-
onLoadStart: () =>
|
|
999
|
+
onLoadStart: () => L(!0),
|
|
1000
1000
|
onCanPlay: () => {
|
|
1001
|
-
|
|
1001
|
+
L(!1), P(!1);
|
|
1002
1002
|
},
|
|
1003
|
-
onWaiting: () =>
|
|
1003
|
+
onWaiting: () => L(!0),
|
|
1004
1004
|
onPlay: () => z(!1),
|
|
1005
1005
|
onEnded: () => {
|
|
1006
1006
|
i || (b(!1), v(0));
|
|
@@ -1016,15 +1016,15 @@ const Va = (e) => {
|
|
|
1016
1016
|
muted: d,
|
|
1017
1017
|
playsInline: !0,
|
|
1018
1018
|
style: { width: "100%", height: "100%" },
|
|
1019
|
-
onLoadStart: () =>
|
|
1019
|
+
onLoadStart: () => L(!0),
|
|
1020
1020
|
onCanPlay: () => {
|
|
1021
|
-
|
|
1021
|
+
L(!1), P(!1);
|
|
1022
1022
|
},
|
|
1023
|
-
onWaiting: () =>
|
|
1023
|
+
onWaiting: () => L(!0),
|
|
1024
1024
|
onPlay: () => z(!1),
|
|
1025
1025
|
onLoadedMetadata: () => {
|
|
1026
1026
|
const N = u.current;
|
|
1027
|
-
N instanceof HTMLVideoElement && N.videoWidth && N.videoHeight &&
|
|
1027
|
+
N instanceof HTMLVideoElement && N.videoWidth && N.videoHeight && E(N.videoWidth / N.videoHeight);
|
|
1028
1028
|
},
|
|
1029
1029
|
onEnded: () => {
|
|
1030
1030
|
i || (b(!1), v(0));
|
|
@@ -1032,14 +1032,14 @@ const Va = (e) => {
|
|
|
1032
1032
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
1033
1033
|
}
|
|
1034
1034
|
) }),
|
|
1035
|
-
$ && !
|
|
1035
|
+
$ && !R && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
1036
1036
|
ve,
|
|
1037
1037
|
{
|
|
1038
1038
|
className: "size-8 animate-spin text-white/80",
|
|
1039
1039
|
weight: "bold"
|
|
1040
1040
|
}
|
|
1041
1041
|
) }),
|
|
1042
|
-
|
|
1042
|
+
R && !l && /* @__PURE__ */ s(
|
|
1043
1043
|
"div",
|
|
1044
1044
|
{
|
|
1045
1045
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1047,10 +1047,10 @@ const Va = (e) => {
|
|
|
1047
1047
|
tabIndex: 0,
|
|
1048
1048
|
"aria-label": "Play preview",
|
|
1049
1049
|
onClick: (N) => {
|
|
1050
|
-
N.stopPropagation(),
|
|
1050
|
+
N.stopPropagation(), I();
|
|
1051
1051
|
},
|
|
1052
1052
|
onKeyDown: (N) => {
|
|
1053
|
-
N.key !== "Enter" && N.key !== " " || (N.preventDefault(), N.stopPropagation(),
|
|
1053
|
+
N.key !== "Enter" && N.key !== " " || (N.preventDefault(), N.stopPropagation(), I());
|
|
1054
1054
|
},
|
|
1055
1055
|
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(nt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1056
1056
|
}
|
|
@@ -1060,14 +1060,14 @@ const Va = (e) => {
|
|
|
1060
1060
|
{
|
|
1061
1061
|
role: "slider",
|
|
1062
1062
|
"aria-label": "Playback position",
|
|
1063
|
-
"aria-valuenow":
|
|
1063
|
+
"aria-valuenow": K,
|
|
1064
1064
|
"aria-valuemin": 0,
|
|
1065
1065
|
"aria-valuemax": 100,
|
|
1066
1066
|
tabIndex: 0,
|
|
1067
1067
|
ref: g,
|
|
1068
1068
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1069
|
-
onMouseDown:
|
|
1070
|
-
onTouchStart:
|
|
1069
|
+
onMouseDown: j,
|
|
1070
|
+
onTouchStart: j,
|
|
1071
1071
|
onClick: (N) => N.stopPropagation(),
|
|
1072
1072
|
onKeyDown: (N) => {
|
|
1073
1073
|
N.key === "ArrowRight" && U(Math.min(1, p + 0.05)), N.key === "ArrowLeft" && U(Math.max(0, p - 0.05));
|
|
@@ -1076,7 +1076,7 @@ const Va = (e) => {
|
|
|
1076
1076
|
"div",
|
|
1077
1077
|
{
|
|
1078
1078
|
className: "h-full rounded-full bg-white",
|
|
1079
|
-
style: { width: `${
|
|
1079
|
+
style: { width: `${K}%` }
|
|
1080
1080
|
}
|
|
1081
1081
|
) })
|
|
1082
1082
|
}
|
|
@@ -1087,7 +1087,7 @@ const Va = (e) => {
|
|
|
1087
1087
|
{
|
|
1088
1088
|
type: "button",
|
|
1089
1089
|
onClick: (N) => {
|
|
1090
|
-
N.stopPropagation(), b((
|
|
1090
|
+
N.stopPropagation(), b((M) => !M);
|
|
1091
1091
|
},
|
|
1092
1092
|
className: "shrink-0 text-white",
|
|
1093
1093
|
"aria-label": _ ? "Pause" : "Play",
|
|
@@ -1099,14 +1099,14 @@ const Va = (e) => {
|
|
|
1099
1099
|
{
|
|
1100
1100
|
role: "slider",
|
|
1101
1101
|
"aria-label": "Playback position",
|
|
1102
|
-
"aria-valuenow":
|
|
1102
|
+
"aria-valuenow": K,
|
|
1103
1103
|
"aria-valuemin": 0,
|
|
1104
1104
|
"aria-valuemax": 100,
|
|
1105
1105
|
tabIndex: 0,
|
|
1106
1106
|
ref: g,
|
|
1107
1107
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1108
|
-
onMouseDown:
|
|
1109
|
-
onTouchStart:
|
|
1108
|
+
onMouseDown: j,
|
|
1109
|
+
onTouchStart: j,
|
|
1110
1110
|
onClick: (N) => N.stopPropagation(),
|
|
1111
1111
|
onMouseEnter: () => O(!0),
|
|
1112
1112
|
onMouseLeave: () => O(!1),
|
|
@@ -1117,12 +1117,12 @@ const Va = (e) => {
|
|
|
1117
1117
|
/* @__PURE__ */ s(
|
|
1118
1118
|
"div",
|
|
1119
1119
|
{
|
|
1120
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
1120
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || w ? "h-1.5" : "h-1"}`,
|
|
1121
1121
|
children: /* @__PURE__ */ s(
|
|
1122
1122
|
"div",
|
|
1123
1123
|
{
|
|
1124
1124
|
className: "h-full rounded-full bg-white",
|
|
1125
|
-
style: { width: `${
|
|
1125
|
+
style: { width: `${K}%` }
|
|
1126
1126
|
}
|
|
1127
1127
|
)
|
|
1128
1128
|
}
|
|
@@ -1130,8 +1130,8 @@ const Va = (e) => {
|
|
|
1130
1130
|
/* @__PURE__ */ s(
|
|
1131
1131
|
"div",
|
|
1132
1132
|
{
|
|
1133
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
1134
|
-
style: { left: `${
|
|
1133
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1134
|
+
style: { left: `${K}%` }
|
|
1135
1135
|
}
|
|
1136
1136
|
)
|
|
1137
1137
|
]
|
|
@@ -1717,7 +1717,7 @@ function pr(e, t, n) {
|
|
|
1717
1717
|
const a = gr(e, t), r = typeof n == "number" && n > 0 ? hr(n) : void 0;
|
|
1718
1718
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1719
1719
|
}
|
|
1720
|
-
function
|
|
1720
|
+
function ae(e) {
|
|
1721
1721
|
try {
|
|
1722
1722
|
const n = new URL(e).pathname.split("/").pop();
|
|
1723
1723
|
return n && n.length > 0 ? decodeURIComponent(n) : "download";
|
|
@@ -1784,7 +1784,7 @@ const br = {
|
|
|
1784
1784
|
u
|
|
1785
1785
|
]
|
|
1786
1786
|
}
|
|
1787
|
-
) : /* @__PURE__ */ h(
|
|
1787
|
+
) : /* @__PURE__ */ h(J, { children: [
|
|
1788
1788
|
f,
|
|
1789
1789
|
u
|
|
1790
1790
|
] });
|
|
@@ -1794,7 +1794,7 @@ const br = {
|
|
|
1794
1794
|
] });
|
|
1795
1795
|
};
|
|
1796
1796
|
async function As(e, t) {
|
|
1797
|
-
const n = t ??
|
|
1797
|
+
const n = t ?? ae(e);
|
|
1798
1798
|
try {
|
|
1799
1799
|
const a = await fetch(e, { mode: "cors" });
|
|
1800
1800
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -1821,7 +1821,7 @@ const _r = ({
|
|
|
1821
1821
|
onActivate: a,
|
|
1822
1822
|
trailingAction: r
|
|
1823
1823
|
}) => {
|
|
1824
|
-
const i = t.filename ??
|
|
1824
|
+
const i = t.filename ?? ae(t.src);
|
|
1825
1825
|
return /* @__PURE__ */ s(
|
|
1826
1826
|
Ts,
|
|
1827
1827
|
{
|
|
@@ -1859,7 +1859,7 @@ const _r = ({
|
|
|
1859
1859
|
if ((m == null ? void 0 : m(b)) === !1) return;
|
|
1860
1860
|
const p = c[b];
|
|
1861
1861
|
if (!p) return;
|
|
1862
|
-
const v = p.filename ??
|
|
1862
|
+
const v = p.filename ?? ae(p.src);
|
|
1863
1863
|
As(p.src, v);
|
|
1864
1864
|
};
|
|
1865
1865
|
if (c.length === 0)
|
|
@@ -1904,7 +1904,7 @@ const _r = ({
|
|
|
1904
1904
|
onNext: t,
|
|
1905
1905
|
prevLabel: n = "Previous",
|
|
1906
1906
|
nextLabel: a = "Next"
|
|
1907
|
-
}) => /* @__PURE__ */ h(
|
|
1907
|
+
}) => /* @__PURE__ */ h(J, { children: [
|
|
1908
1908
|
/* @__PURE__ */ s(
|
|
1909
1909
|
"button",
|
|
1910
1910
|
{
|
|
@@ -1934,7 +1934,7 @@ const _r = ({
|
|
|
1934
1934
|
tone: i = "dark",
|
|
1935
1935
|
onTriggered: l
|
|
1936
1936
|
}) => {
|
|
1937
|
-
const [o, d] = B(!1), m =
|
|
1937
|
+
const [o, d] = B(!1), m = W(
|
|
1938
1938
|
(c) => {
|
|
1939
1939
|
c.stopPropagation(), !o && (d(!0), As(e, t).catch(() => {
|
|
1940
1940
|
}).finally(() => {
|
|
@@ -2016,17 +2016,17 @@ const _r = ({
|
|
|
2016
2016
|
open: n
|
|
2017
2017
|
}) => {
|
|
2018
2018
|
const a = qe(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
|
|
2019
|
-
|
|
2019
|
+
Y(() => {
|
|
2020
2020
|
n && i(qe(t, 0, Math.max(e - 1, 0)));
|
|
2021
|
-
}, [n, t, e]),
|
|
2021
|
+
}, [n, t, e]), Y(() => {
|
|
2022
2022
|
i((d) => qe(d, 0, Math.max(e - 1, 0)));
|
|
2023
2023
|
}, [e]);
|
|
2024
|
-
const l =
|
|
2024
|
+
const l = W(() => {
|
|
2025
2025
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
2026
|
-
}, [e]), o =
|
|
2026
|
+
}, [e]), o = W(() => {
|
|
2027
2027
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
2028
2028
|
}, [e]);
|
|
2029
|
-
return
|
|
2029
|
+
return Y(() => {
|
|
2030
2030
|
if (!n || e <= 1) return;
|
|
2031
2031
|
const d = (m) => {
|
|
2032
2032
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
@@ -2044,8 +2044,8 @@ const _r = ({
|
|
|
2044
2044
|
children: i,
|
|
2045
2045
|
"data-testid": l
|
|
2046
2046
|
}) => {
|
|
2047
|
-
const o =
|
|
2048
|
-
return
|
|
2047
|
+
const o = H(null), d = H(null);
|
|
2048
|
+
return Y(() => {
|
|
2049
2049
|
var g;
|
|
2050
2050
|
const u = o.current;
|
|
2051
2051
|
if (u) {
|
|
@@ -2135,8 +2135,8 @@ const _r = ({
|
|
|
2135
2135
|
length: t.length,
|
|
2136
2136
|
initialIndex: n,
|
|
2137
2137
|
open: e
|
|
2138
|
-
}), o = t[r], d =
|
|
2139
|
-
() => (o == null ? void 0 : o.filename) ?? (o ?
|
|
2138
|
+
}), o = t[r], d = ne(
|
|
2139
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "image"),
|
|
2140
2140
|
[o]
|
|
2141
2141
|
);
|
|
2142
2142
|
return o ? /* @__PURE__ */ h(
|
|
@@ -2293,12 +2293,12 @@ const _r = ({
|
|
|
2293
2293
|
}
|
|
2294
2294
|
);
|
|
2295
2295
|
}, Ae = (e) => {
|
|
2296
|
-
const [t, n] = B(!1), [a, r] = B(0), i =
|
|
2296
|
+
const [t, n] = B(!1), [a, r] = B(0), i = W(
|
|
2297
2297
|
(o) => {
|
|
2298
2298
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), n(!0));
|
|
2299
2299
|
},
|
|
2300
2300
|
[e]
|
|
2301
|
-
), l =
|
|
2301
|
+
), l = W(() => n(!1), []);
|
|
2302
2302
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
2303
2303
|
}, Lr = ({
|
|
2304
2304
|
item: e,
|
|
@@ -2463,10 +2463,10 @@ const _r = ({
|
|
|
2463
2463
|
length: t.length,
|
|
2464
2464
|
initialIndex: n,
|
|
2465
2465
|
open: e
|
|
2466
|
-
}), o = t[r], d =
|
|
2467
|
-
() => (o == null ? void 0 : o.filename) ?? (o ?
|
|
2466
|
+
}), o = t[r], d = ne(
|
|
2467
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "document"),
|
|
2468
2468
|
[o]
|
|
2469
|
-
), m =
|
|
2469
|
+
), m = ne(
|
|
2470
2470
|
() => o ? Ur(o.src) : void 0,
|
|
2471
2471
|
[o]
|
|
2472
2472
|
);
|
|
@@ -2517,7 +2517,7 @@ const _r = ({
|
|
|
2517
2517
|
onActivate: a,
|
|
2518
2518
|
trailingAction: r
|
|
2519
2519
|
}) => {
|
|
2520
|
-
const i = t.filename ??
|
|
2520
|
+
const i = t.filename ?? ae(t.src);
|
|
2521
2521
|
return /* @__PURE__ */ s(
|
|
2522
2522
|
Ts,
|
|
2523
2523
|
{
|
|
@@ -2550,7 +2550,7 @@ const _r = ({
|
|
|
2550
2550
|
return null;
|
|
2551
2551
|
const p = u.map((v) => ({
|
|
2552
2552
|
src: v.src,
|
|
2553
|
-
filename: v.filename ??
|
|
2553
|
+
filename: v.filename ?? ae(v.src)
|
|
2554
2554
|
}));
|
|
2555
2555
|
return /* @__PURE__ */ h(
|
|
2556
2556
|
Ee,
|
|
@@ -2561,7 +2561,7 @@ const _r = ({
|
|
|
2561
2561
|
"data-testid": "pdf-attachment",
|
|
2562
2562
|
children: [
|
|
2563
2563
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: u.map((v, w) => {
|
|
2564
|
-
const C = v.filename ??
|
|
2564
|
+
const C = v.filename ?? ae(v.src), T = b && w === 0 ? /* @__PURE__ */ s(Ie, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2565
2565
|
Ls,
|
|
2566
2566
|
{
|
|
2567
2567
|
url: v.src,
|
|
@@ -2578,7 +2578,7 @@ const _r = ({
|
|
|
2578
2578
|
item: v,
|
|
2579
2579
|
index: w,
|
|
2580
2580
|
onActivate: x,
|
|
2581
|
-
trailingAction:
|
|
2581
|
+
trailingAction: T
|
|
2582
2582
|
},
|
|
2583
2583
|
`${v.src}-${w}`
|
|
2584
2584
|
);
|
|
@@ -2609,8 +2609,8 @@ const _r = ({
|
|
|
2609
2609
|
length: t.length,
|
|
2610
2610
|
initialIndex: n,
|
|
2611
2611
|
open: e
|
|
2612
|
-
}), o = t[r], d =
|
|
2613
|
-
() => (o == null ? void 0 : o.filename) ?? (o ?
|
|
2612
|
+
}), o = t[r], d = ne(
|
|
2613
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "video"),
|
|
2614
2614
|
[o]
|
|
2615
2615
|
);
|
|
2616
2616
|
return o ? /* @__PURE__ */ h(
|
|
@@ -2775,7 +2775,7 @@ const _r = ({
|
|
|
2775
2775
|
function ai(e) {
|
|
2776
2776
|
return ke($s)[e] ?? ni[e];
|
|
2777
2777
|
}
|
|
2778
|
-
const ri = F.lazy(() => import("./Card-qS17qnN0.js")), ii = F.lazy(() => import("./Card-
|
|
2778
|
+
const ri = F.lazy(() => import("./Card-qS17qnN0.js")), ii = F.lazy(() => import("./Card-Cgn2G-VJ.js")), oi = () => /* @__PURE__ */ s(
|
|
2779
2779
|
"div",
|
|
2780
2780
|
{
|
|
2781
2781
|
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)]",
|
|
@@ -2843,10 +2843,10 @@ const ri = F.lazy(() => import("./Card-qS17qnN0.js")), ii = F.lazy(() => import(
|
|
|
2843
2843
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2844
2844
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2845
2845
|
].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(li, { size: l ? 12 : 15 }) });
|
|
2846
|
-
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ h(
|
|
2846
|
+
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ h(J, { children: [
|
|
2847
2847
|
m,
|
|
2848
2848
|
f
|
|
2849
|
-
] }) : /* @__PURE__ */ h(
|
|
2849
|
+
] }) : /* @__PURE__ */ h(J, { children: [
|
|
2850
2850
|
f,
|
|
2851
2851
|
m
|
|
2852
2852
|
] }) });
|
|
@@ -2893,10 +2893,10 @@ const ri = F.lazy(() => import("./Card-qS17qnN0.js")), ii = F.lazy(() => import(
|
|
|
2893
2893
|
}
|
|
2894
2894
|
})();
|
|
2895
2895
|
return e.id === n;
|
|
2896
|
-
}, Ke = () => Nt() ? /* @__PURE__ */ h(
|
|
2896
|
+
}, Ke = () => Nt() ? /* @__PURE__ */ h(J, { children: [
|
|
2897
2897
|
/* @__PURE__ */ s(la, { weight: "bold", "aria-hidden": "true" }),
|
|
2898
2898
|
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2899
|
-
] }) : null, fi = () => Nt() ? /* @__PURE__ */ h(
|
|
2899
|
+
] }) : null, fi = () => Nt() ? /* @__PURE__ */ h(J, { children: [
|
|
2900
2900
|
/* @__PURE__ */ s(
|
|
2901
2901
|
ve,
|
|
2902
2902
|
{
|
|
@@ -2911,7 +2911,7 @@ const ri = F.lazy(() => import("./Card-qS17qnN0.js")), ii = F.lazy(() => import(
|
|
|
2911
2911
|
broadcastName: t,
|
|
2912
2912
|
onBroadcastClick: n
|
|
2913
2913
|
}) => {
|
|
2914
|
-
const a = t || "Broadcast", r = /* @__PURE__ */ h(
|
|
2914
|
+
const a = t || "Broadcast", r = /* @__PURE__ */ h(J, { children: [
|
|
2915
2915
|
/* @__PURE__ */ s("span", { className: "sent-message-broadcast-badge", "aria-hidden": "true", children: /* @__PURE__ */ s(oa, { weight: "fill" }) }),
|
|
2916
2916
|
/* @__PURE__ */ s(
|
|
2917
2917
|
"span",
|
|
@@ -3056,13 +3056,13 @@ const _i = {
|
|
|
3056
3056
|
d == null && Ci[e]
|
|
3057
3057
|
), C = d ? { color: d } : void 0;
|
|
3058
3058
|
if (m) {
|
|
3059
|
-
const
|
|
3059
|
+
const T = y(
|
|
3060
3060
|
"animate-pulse rounded",
|
|
3061
3061
|
ki[e]
|
|
3062
3062
|
);
|
|
3063
3063
|
return /* @__PURE__ */ s("div", { className: "shrink-0 px-4 py-3", children: /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-[2px]", children: [
|
|
3064
|
-
/* @__PURE__ */ s("div", { className: y("h-5 w-3/4",
|
|
3065
|
-
/* @__PURE__ */ s("div", { className: y("h-4 w-1/2",
|
|
3064
|
+
/* @__PURE__ */ s("div", { className: y("h-5 w-3/4", T), "aria-hidden": !0 }),
|
|
3065
|
+
/* @__PURE__ */ s("div", { className: y("h-4 w-1/2", T), "aria-hidden": !0 })
|
|
3066
3066
|
] }) });
|
|
3067
3067
|
}
|
|
3068
3068
|
return /* @__PURE__ */ h("div", { className: "shrink-0 px-4 py-3", children: [
|
|
@@ -3222,7 +3222,7 @@ const _i = {
|
|
|
3222
3222
|
"aria-hidden": !0
|
|
3223
3223
|
}
|
|
3224
3224
|
)
|
|
3225
|
-
) : f ? /* @__PURE__ */ h(
|
|
3225
|
+
) : f ? /* @__PURE__ */ h(J, { children: [
|
|
3226
3226
|
/* @__PURE__ */ s(
|
|
3227
3227
|
"video",
|
|
3228
3228
|
{
|
|
@@ -3459,7 +3459,7 @@ const zi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
3459
3459
|
}
|
|
3460
3460
|
)
|
|
3461
3461
|
] })
|
|
3462
|
-
) : /* @__PURE__ */ s(
|
|
3462
|
+
) : /* @__PURE__ */ s(J, { children: a }), $i = ({
|
|
3463
3463
|
title: e,
|
|
3464
3464
|
description: t,
|
|
3465
3465
|
url: n,
|
|
@@ -3616,7 +3616,7 @@ const zi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
3616
3616
|
Sent: Ui,
|
|
3617
3617
|
Received: $i
|
|
3618
3618
|
};
|
|
3619
|
-
function
|
|
3619
|
+
function D(e) {
|
|
3620
3620
|
const t = e == null ? void 0 : e.trim();
|
|
3621
3621
|
return t || void 0;
|
|
3622
3622
|
}
|
|
@@ -3635,10 +3635,10 @@ function Vi(e, t) {
|
|
|
3635
3635
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3636
3636
|
}
|
|
3637
3637
|
function as(e) {
|
|
3638
|
-
const t =
|
|
3638
|
+
const t = D(e.og_scrape_url) ?? D(e.title_link), n = D(e.image_url) ?? D(e.thumb_url), a = D(e.asset_url), r = D(e.mime_type);
|
|
3639
3639
|
return {
|
|
3640
|
-
title:
|
|
3641
|
-
description:
|
|
3640
|
+
title: D(e.title),
|
|
3641
|
+
description: D(e.text),
|
|
3642
3642
|
url: t,
|
|
3643
3643
|
thumbnailUrl: me(n),
|
|
3644
3644
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
@@ -3651,7 +3651,7 @@ function as(e) {
|
|
|
3651
3651
|
// paints an identical chin without re-extracting — visitors in
|
|
3652
3652
|
// linktr.ee-profiles cannot call the extraction query at all. Absent on
|
|
3653
3653
|
// messages sent before MES-1349, which render the fallback chin.
|
|
3654
|
-
accentColor:
|
|
3654
|
+
accentColor: D(e.accent_color),
|
|
3655
3655
|
// A persisted attachment is by definition fully scraped.
|
|
3656
3656
|
status: "ready"
|
|
3657
3657
|
};
|
|
@@ -3661,7 +3661,7 @@ function ji(e) {
|
|
|
3661
3661
|
return Hs(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;
|
|
3662
3662
|
}
|
|
3663
3663
|
function Hs(e) {
|
|
3664
|
-
const t =
|
|
3664
|
+
const t = D(e.og_scrape_url);
|
|
3665
3665
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3666
3666
|
}
|
|
3667
3667
|
function Gs(e) {
|
|
@@ -3698,7 +3698,7 @@ function Gi(e, t, n) {
|
|
|
3698
3698
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3699
3699
|
}
|
|
3700
3700
|
function rs(e) {
|
|
3701
|
-
return
|
|
3701
|
+
return D(e.image_url) ?? D(e.asset_url) ?? "";
|
|
3702
3702
|
}
|
|
3703
3703
|
function Yi(e) {
|
|
3704
3704
|
switch (e) {
|
|
@@ -3721,42 +3721,42 @@ function Wi(e, t) {
|
|
|
3721
3721
|
return {
|
|
3722
3722
|
items: t.map((a) => ({
|
|
3723
3723
|
src: rs(a),
|
|
3724
|
-
alt:
|
|
3724
|
+
alt: D(a.title)
|
|
3725
3725
|
}))
|
|
3726
3726
|
};
|
|
3727
3727
|
case "video":
|
|
3728
3728
|
return {
|
|
3729
3729
|
items: t.map((a) => ({
|
|
3730
|
-
src:
|
|
3731
|
-
poster:
|
|
3730
|
+
src: D(a.asset_url) ?? "",
|
|
3731
|
+
poster: D(
|
|
3732
3732
|
a.thumb_url
|
|
3733
3733
|
),
|
|
3734
|
-
mimeType:
|
|
3734
|
+
mimeType: D(a.mime_type)
|
|
3735
3735
|
}))
|
|
3736
3736
|
};
|
|
3737
3737
|
case "audio":
|
|
3738
3738
|
return {
|
|
3739
3739
|
items: t.map((a) => ({
|
|
3740
|
-
src:
|
|
3741
|
-
mimeType:
|
|
3742
|
-
filename:
|
|
3740
|
+
src: D(a.asset_url) ?? "",
|
|
3741
|
+
mimeType: D(a.mime_type) ?? "audio/mpeg",
|
|
3742
|
+
filename: D(a.title)
|
|
3743
3743
|
}))
|
|
3744
3744
|
};
|
|
3745
3745
|
case "pdf":
|
|
3746
3746
|
return {
|
|
3747
3747
|
items: t.map((a) => ({
|
|
3748
|
-
src:
|
|
3749
|
-
filename:
|
|
3748
|
+
src: D(a.asset_url) ?? "",
|
|
3749
|
+
filename: D(a.title),
|
|
3750
3750
|
fileSize: a.file_size
|
|
3751
3751
|
}))
|
|
3752
3752
|
};
|
|
3753
3753
|
case "file":
|
|
3754
3754
|
return {
|
|
3755
3755
|
items: t.map((a) => ({
|
|
3756
|
-
src:
|
|
3757
|
-
filename:
|
|
3756
|
+
src: D(a.asset_url) ?? "",
|
|
3757
|
+
filename: D(a.title),
|
|
3758
3758
|
fileSize: a.file_size,
|
|
3759
|
-
mimeType:
|
|
3759
|
+
mimeType: D(a.mime_type) ?? "application/octet-stream"
|
|
3760
3760
|
}))
|
|
3761
3761
|
};
|
|
3762
3762
|
}
|
|
@@ -3766,34 +3766,34 @@ function Wi(e, t) {
|
|
|
3766
3766
|
case "image":
|
|
3767
3767
|
return {
|
|
3768
3768
|
src: rs(n),
|
|
3769
|
-
alt:
|
|
3769
|
+
alt: D(n.title)
|
|
3770
3770
|
};
|
|
3771
3771
|
case "video":
|
|
3772
3772
|
return {
|
|
3773
|
-
src:
|
|
3774
|
-
poster:
|
|
3773
|
+
src: D(n.asset_url) ?? "",
|
|
3774
|
+
poster: D(
|
|
3775
3775
|
n.thumb_url
|
|
3776
3776
|
),
|
|
3777
|
-
mimeType:
|
|
3777
|
+
mimeType: D(n.mime_type)
|
|
3778
3778
|
};
|
|
3779
3779
|
case "audio":
|
|
3780
3780
|
return {
|
|
3781
|
-
src:
|
|
3782
|
-
mimeType:
|
|
3783
|
-
filename:
|
|
3781
|
+
src: D(n.asset_url) ?? "",
|
|
3782
|
+
mimeType: D(n.mime_type) ?? "audio/mpeg",
|
|
3783
|
+
filename: D(n.title)
|
|
3784
3784
|
};
|
|
3785
3785
|
case "pdf":
|
|
3786
3786
|
return {
|
|
3787
|
-
src:
|
|
3788
|
-
filename:
|
|
3787
|
+
src: D(n.asset_url) ?? "",
|
|
3788
|
+
filename: D(n.title),
|
|
3789
3789
|
fileSize: n.file_size
|
|
3790
3790
|
};
|
|
3791
3791
|
case "file":
|
|
3792
3792
|
return {
|
|
3793
|
-
src:
|
|
3794
|
-
filename:
|
|
3793
|
+
src: D(n.asset_url) ?? "",
|
|
3794
|
+
filename: D(n.title),
|
|
3795
3795
|
fileSize: n.file_size,
|
|
3796
|
-
mimeType:
|
|
3796
|
+
mimeType: D(n.mime_type) ?? "application/octet-stream"
|
|
3797
3797
|
};
|
|
3798
3798
|
}
|
|
3799
3799
|
}
|
|
@@ -3905,33 +3905,33 @@ const Xi = ({
|
|
|
3905
3905
|
threadList: _,
|
|
3906
3906
|
viewerLanguage: b,
|
|
3907
3907
|
onBroadcastClick: p
|
|
3908
|
-
} = e, { client: v } = Se("CustomMessage"), { channel: w } = he("CustomMessage"), { isUnlocking: C, onUnlockClick:
|
|
3909
|
-
Attachment:
|
|
3910
|
-
EditMessageModal:
|
|
3911
|
-
MessageActions:
|
|
3908
|
+
} = e, { client: v } = Se("CustomMessage"), { channel: w } = he("CustomMessage"), { isUnlocking: C, onUnlockClick: T, onFetchSource: O, onDownloadClick: R } = ai("LockedAttachment"), [z, $] = B(!1), L = cn(c.id), { selected: S, voteUp: P, voteDown: k } = Ra(c), {
|
|
3909
|
+
Attachment: E = dn,
|
|
3910
|
+
EditMessageModal: I = un,
|
|
3911
|
+
MessageActions: A,
|
|
3912
3912
|
MessageBlocked: U = mn,
|
|
3913
|
-
MessageBouncePrompt:
|
|
3914
|
-
MessageDeleted:
|
|
3915
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
3916
|
-
MessageRepliesCountButton:
|
|
3913
|
+
MessageBouncePrompt: j = hn,
|
|
3914
|
+
MessageDeleted: q = fn,
|
|
3915
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = gn,
|
|
3916
|
+
MessageRepliesCountButton: K = pn,
|
|
3917
3917
|
ReminderNotification: N = bn,
|
|
3918
|
-
StreamedMessageText:
|
|
3919
|
-
PinIndicator:
|
|
3920
|
-
} = ds("CustomMessage"),
|
|
3918
|
+
StreamedMessageText: M = vn,
|
|
3919
|
+
PinIndicator: G
|
|
3920
|
+
} = ds("CustomMessage"), X = xn(c), se = _n(c), Z = ne(
|
|
3921
3921
|
() => u == null ? void 0 : u(c),
|
|
3922
3922
|
[u, c]
|
|
3923
|
-
), V =
|
|
3923
|
+
), V = ne(() => {
|
|
3924
3924
|
const ue = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...ue] : ue;
|
|
3925
3925
|
if (!Be(c)) return be;
|
|
3926
3926
|
const Ht = be.filter((Gt) => !("type" in Gt) || !Ss(Gt));
|
|
3927
3927
|
return Ht.length === be.length ? be : Ht;
|
|
3928
|
-
}, [c]),
|
|
3928
|
+
}, [c]), ee = ne(
|
|
3929
3929
|
() => Gs(V),
|
|
3930
3930
|
[V]
|
|
3931
|
-
), re =
|
|
3931
|
+
), re = ne(() => {
|
|
3932
3932
|
const ue = ws({ message: c, viewerLanguage: b });
|
|
3933
3933
|
return ue === c.text ? c : { ...c, text: ue };
|
|
3934
|
-
}, [c, b]), Me =
|
|
3934
|
+
}, [c, b]), Me = ee.length > 0, Re = ee.reduce(
|
|
3935
3935
|
(ue, be) => ue + be.attachments.length,
|
|
3936
3936
|
0
|
|
3937
3937
|
) === ((V == null ? void 0 : V.length) ?? 0), ie = ir({
|
|
@@ -3942,30 +3942,30 @@ const Xi = ({
|
|
|
3942
3942
|
if (wn(c))
|
|
3943
3943
|
return null;
|
|
3944
3944
|
if (c.deleted_at || c.type === "deleted")
|
|
3945
|
-
return /* @__PURE__ */ s(
|
|
3945
|
+
return /* @__PURE__ */ s(q, { message: c });
|
|
3946
3946
|
if (Nn(c))
|
|
3947
3947
|
return /* @__PURE__ */ s(U, {});
|
|
3948
3948
|
const de = !_ && !!c.reply_count, oe = !_ && c.show_in_channel && c.parent_id, It = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = yn(c);
|
|
3949
3949
|
let ge;
|
|
3950
3950
|
It ? ge = () => m(c) : Tt && (ge = () => $(!0));
|
|
3951
|
-
const
|
|
3951
|
+
const te = g(), Zs = y(
|
|
3952
3952
|
"str-chat__message str-chat__message-simple",
|
|
3953
3953
|
`str-chat__message--${c.type}`,
|
|
3954
3954
|
`str-chat__message--${c.status}`,
|
|
3955
|
-
|
|
3955
|
+
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
3956
3956
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
3957
3957
|
{
|
|
3958
|
-
"str-chat__message--has-attachment":
|
|
3958
|
+
"str-chat__message--has-attachment": X,
|
|
3959
3959
|
"str-chat__message--highlighted": f,
|
|
3960
3960
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3961
|
-
"str-chat__message--with-reactions":
|
|
3961
|
+
"str-chat__message--with-reactions": se,
|
|
3962
3962
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Pt = c == null ? void 0 : c.error) == null ? void 0 : Pt.status) !== 403,
|
|
3963
3963
|
"str-chat__message-with-thread-link": de || oe,
|
|
3964
3964
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3965
3965
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3966
3966
|
"str-chat__virtual-message__wrapper--group": l
|
|
3967
3967
|
}
|
|
3968
|
-
), je = c.poll_id && v.polls.fromState(c.poll_id), At = mi(c), pe = Be(c), Js = wt(c), He = !!(V != null && V.length && !c.quoted_message), Lt = pe &&
|
|
3968
|
+
), je = c.poll_id && v.polls.fromState(c.poll_id), At = mi(c), pe = Be(c), Js = wt(c), He = !!(V != null && V.length && !c.quoted_message), Lt = pe && te && He, Qs = Me && Re && !c.quoted_message && !je && !Z && !pe, Mt = {
|
|
3969
3969
|
contentType: "text",
|
|
3970
3970
|
amountText: (Ot = c.metadata) == null ? void 0 : Ot.amount_text,
|
|
3971
3971
|
paymentStatus: (zt = c.metadata) == null ? void 0 : zt.payment_status,
|
|
@@ -3980,9 +3980,9 @@ const Xi = ({
|
|
|
3980
3980
|
paymentStatus: (jt = c.metadata) == null ? void 0 : jt.payment_status,
|
|
3981
3981
|
onFetchSource: O ? () => O(c, w) : void 0
|
|
3982
3982
|
};
|
|
3983
|
-
return /* @__PURE__ */ h(
|
|
3983
|
+
return /* @__PURE__ */ h(J, { children: [
|
|
3984
3984
|
a && /* @__PURE__ */ s(
|
|
3985
|
-
|
|
3985
|
+
I,
|
|
3986
3986
|
{
|
|
3987
3987
|
additionalMessageInputProps: t
|
|
3988
3988
|
}
|
|
@@ -3990,7 +3990,7 @@ const Xi = ({
|
|
|
3990
3990
|
z && /* @__PURE__ */ s(
|
|
3991
3991
|
Cn,
|
|
3992
3992
|
{
|
|
3993
|
-
MessageBouncePrompt:
|
|
3993
|
+
MessageBouncePrompt: j,
|
|
3994
3994
|
onClose: () => $(!1),
|
|
3995
3995
|
open: z
|
|
3996
3996
|
}
|
|
@@ -4002,8 +4002,8 @@ const Xi = ({
|
|
|
4002
4002
|
"data-message-id": c.id,
|
|
4003
4003
|
"data-dd-privacy": "mask",
|
|
4004
4004
|
children: [
|
|
4005
|
-
|
|
4006
|
-
!!
|
|
4005
|
+
G && /* @__PURE__ */ s(G, {}),
|
|
4006
|
+
!!L && /* @__PURE__ */ s(N, { reminder: L }),
|
|
4007
4007
|
c.user && /* @__PURE__ */ s(
|
|
4008
4008
|
_e,
|
|
4009
4009
|
{
|
|
@@ -4034,8 +4034,8 @@ const Xi = ({
|
|
|
4034
4034
|
marginInlineStart: 0
|
|
4035
4035
|
},
|
|
4036
4036
|
children: At ? /* @__PURE__ */ s(Xe, { message: c, standalone: !0 }) : di(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
4037
|
-
|
|
4038
|
-
|
|
4037
|
+
te && A && /* @__PURE__ */ s(A, {}),
|
|
4038
|
+
te ? /* @__PURE__ */ s(
|
|
4039
4039
|
Pe,
|
|
4040
4040
|
{
|
|
4041
4041
|
...Mt,
|
|
@@ -4047,19 +4047,19 @@ const Xi = ({
|
|
|
4047
4047
|
...Mt,
|
|
4048
4048
|
isMine: !1,
|
|
4049
4049
|
isUnlocking: C(c.id),
|
|
4050
|
-
onUnlockClick: () =>
|
|
4050
|
+
onUnlockClick: () => T == null ? void 0 : T(c, w)
|
|
4051
4051
|
}
|
|
4052
4052
|
),
|
|
4053
|
-
!
|
|
4053
|
+
!te && A && /* @__PURE__ */ s(A, {})
|
|
4054
4054
|
] }) }) : ui(c) ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
4055
4055
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
4056
|
-
|
|
4057
|
-
|
|
4056
|
+
te && A && /* @__PURE__ */ s(A, {}),
|
|
4057
|
+
te ? /* @__PURE__ */ s(
|
|
4058
4058
|
Pe,
|
|
4059
4059
|
{
|
|
4060
4060
|
...Rt,
|
|
4061
4061
|
isMine: !0,
|
|
4062
|
-
onPreviewClick: () =>
|
|
4062
|
+
onPreviewClick: () => T ? T(c, w) : void 0
|
|
4063
4063
|
}
|
|
4064
4064
|
) : /* @__PURE__ */ s(
|
|
4065
4065
|
Pe,
|
|
@@ -4067,11 +4067,11 @@ const Xi = ({
|
|
|
4067
4067
|
...Rt,
|
|
4068
4068
|
isMine: !1,
|
|
4069
4069
|
isUnlocking: C(c.id),
|
|
4070
|
-
onUnlockClick: () =>
|
|
4071
|
-
onDownloadClick: () =>
|
|
4070
|
+
onUnlockClick: () => T ? T(c, w) : void 0,
|
|
4071
|
+
onDownloadClick: () => R ? R(c, w) : void 0
|
|
4072
4072
|
}
|
|
4073
4073
|
),
|
|
4074
|
-
!
|
|
4074
|
+
!te && A && /* @__PURE__ */ s(A, {})
|
|
4075
4075
|
] }),
|
|
4076
4076
|
c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
|
|
4077
4077
|
ze,
|
|
@@ -4084,7 +4084,7 @@ const Xi = ({
|
|
|
4084
4084
|
Xi,
|
|
4085
4085
|
{
|
|
4086
4086
|
groupPosition: ie,
|
|
4087
|
-
isMyMessage:
|
|
4087
|
+
isMyMessage: te,
|
|
4088
4088
|
message: {
|
|
4089
4089
|
...re,
|
|
4090
4090
|
attachments: V,
|
|
@@ -4101,19 +4101,19 @@ const Xi = ({
|
|
|
4101
4101
|
{
|
|
4102
4102
|
message: c,
|
|
4103
4103
|
hasAttachment: He,
|
|
4104
|
-
isMyMessage:
|
|
4104
|
+
isMyMessage: te
|
|
4105
4105
|
}
|
|
4106
4106
|
),
|
|
4107
4107
|
je && /* @__PURE__ */ s(kn, { poll: je }),
|
|
4108
4108
|
V != null && V.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
4109
|
-
|
|
4109
|
+
E,
|
|
4110
4110
|
{
|
|
4111
4111
|
actionHandler: o,
|
|
4112
4112
|
attachments: V
|
|
4113
4113
|
}
|
|
4114
4114
|
) : null,
|
|
4115
|
-
|
|
4116
|
-
|
|
4115
|
+
Z ? /* @__PURE__ */ s(
|
|
4116
|
+
M,
|
|
4117
4117
|
{
|
|
4118
4118
|
message: re,
|
|
4119
4119
|
renderText: x
|
|
@@ -4135,27 +4135,27 @@ const Xi = ({
|
|
|
4135
4135
|
{
|
|
4136
4136
|
message: c,
|
|
4137
4137
|
hasAttachment: He,
|
|
4138
|
-
isMyMessage:
|
|
4138
|
+
isMyMessage: te
|
|
4139
4139
|
}
|
|
4140
4140
|
),
|
|
4141
4141
|
n && pe && /* @__PURE__ */ s(
|
|
4142
4142
|
hi,
|
|
4143
4143
|
{
|
|
4144
4144
|
selected: S,
|
|
4145
|
-
onVoteUp:
|
|
4145
|
+
onVoteUp: P,
|
|
4146
4146
|
onVoteDown: k
|
|
4147
4147
|
}
|
|
4148
4148
|
)
|
|
4149
4149
|
] }),
|
|
4150
4150
|
/* @__PURE__ */ s(bi, { onBroadcastClick: p }),
|
|
4151
4151
|
de && /* @__PURE__ */ s(
|
|
4152
|
-
|
|
4152
|
+
K,
|
|
4153
4153
|
{
|
|
4154
4154
|
onClick: d,
|
|
4155
4155
|
reply_count: c.reply_count
|
|
4156
4156
|
}
|
|
4157
4157
|
),
|
|
4158
|
-
oe && /* @__PURE__ */ s(
|
|
4158
|
+
oe && /* @__PURE__ */ s(Q, {})
|
|
4159
4159
|
]
|
|
4160
4160
|
},
|
|
4161
4161
|
c.id
|
|
@@ -4407,7 +4407,7 @@ const Xi = ({
|
|
|
4407
4407
|
] })
|
|
4408
4408
|
]
|
|
4409
4409
|
}
|
|
4410
|
-
) : /* @__PURE__ */ h(
|
|
4410
|
+
) : /* @__PURE__ */ h(J, { children: [
|
|
4411
4411
|
t == null ? void 0 : t(),
|
|
4412
4412
|
/* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: r ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: r }) : null }),
|
|
4413
4413
|
n == null ? void 0 : n()
|
|
@@ -4495,7 +4495,7 @@ const Xi = ({
|
|
|
4495
4495
|
if (t === -1)
|
|
4496
4496
|
return e;
|
|
4497
4497
|
const n = t + Je.length;
|
|
4498
|
-
return /* @__PURE__ */ h(
|
|
4498
|
+
return /* @__PURE__ */ h(J, { children: [
|
|
4499
4499
|
e.slice(0, t),
|
|
4500
4500
|
/* @__PURE__ */ s(
|
|
4501
4501
|
"a",
|
|
@@ -4752,15 +4752,22 @@ const wo = ({
|
|
|
4752
4752
|
customChannelActions: v,
|
|
4753
4753
|
renderChannelActions: w,
|
|
4754
4754
|
renderMessage: C,
|
|
4755
|
-
viewerLanguage:
|
|
4755
|
+
viewerLanguage: T,
|
|
4756
4756
|
showChannelInfo: O = !0,
|
|
4757
|
-
onParticipantNameClick:
|
|
4757
|
+
onParticipantNameClick: R,
|
|
4758
4758
|
onBroadcastClick: z,
|
|
4759
4759
|
composerInput: $
|
|
4760
4760
|
}) => {
|
|
4761
|
-
const { channel:
|
|
4762
|
-
|
|
4763
|
-
|
|
4761
|
+
const { channel: L } = he(), S = H(z);
|
|
4762
|
+
Y(() => {
|
|
4763
|
+
S.current = z;
|
|
4764
|
+
}, [z]);
|
|
4765
|
+
const P = W((j) => {
|
|
4766
|
+
var q;
|
|
4767
|
+
(q = S.current) == null || q.call(S, j);
|
|
4768
|
+
}, []), k = z ? P : void 0, E = L.state.messages.some(
|
|
4769
|
+
(j) => j.type !== "deleted"
|
|
4770
|
+
), I = p ? /* @__PURE__ */ s(F.Fragment, { children: p() }, "lt-channel-banner") : null, A = /* @__PURE__ */ s(
|
|
4764
4771
|
Aa,
|
|
4765
4772
|
{
|
|
4766
4773
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
@@ -4778,28 +4785,28 @@ const wo = ({
|
|
|
4778
4785
|
onReportParticipantClick: f,
|
|
4779
4786
|
customChannelActions: v,
|
|
4780
4787
|
renderChannelActions: w,
|
|
4781
|
-
onParticipantNameClick:
|
|
4788
|
+
onParticipantNameClick: R
|
|
4782
4789
|
}
|
|
4783
|
-
),
|
|
4784
|
-
(
|
|
4785
|
-
const { message:
|
|
4790
|
+
), U = W(
|
|
4791
|
+
(j) => {
|
|
4792
|
+
const { message: q } = fe("ChannelView"), Q = /* @__PURE__ */ s(
|
|
4786
4793
|
Ji,
|
|
4787
4794
|
{
|
|
4788
|
-
...
|
|
4795
|
+
...j,
|
|
4789
4796
|
chatbotVotingEnabled: b,
|
|
4790
|
-
viewerLanguage:
|
|
4791
|
-
onBroadcastClick:
|
|
4797
|
+
viewerLanguage: T,
|
|
4798
|
+
onBroadcastClick: k
|
|
4792
4799
|
}
|
|
4793
4800
|
);
|
|
4794
|
-
return !C || !
|
|
4801
|
+
return !C || !q ? Q : C(Q, q);
|
|
4795
4802
|
},
|
|
4796
|
-
[b,
|
|
4803
|
+
[b, k, C, T]
|
|
4797
4804
|
);
|
|
4798
|
-
return /* @__PURE__ */ s(
|
|
4805
|
+
return /* @__PURE__ */ s(J, { children: /* @__PURE__ */ s(
|
|
4799
4806
|
On,
|
|
4800
4807
|
{
|
|
4801
4808
|
overrides: {
|
|
4802
|
-
Message:
|
|
4809
|
+
Message: U,
|
|
4803
4810
|
MessageActions: to,
|
|
4804
4811
|
UnreadMessagesNotification: () => null,
|
|
4805
4812
|
UnreadMessagesSeparator: () => null
|
|
@@ -4810,16 +4817,16 @@ const wo = ({
|
|
|
4810
4817
|
{
|
|
4811
4818
|
className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
|
|
4812
4819
|
children: [
|
|
4813
|
-
!
|
|
4814
|
-
|
|
4815
|
-
|
|
4820
|
+
!E && /* @__PURE__ */ s("div", { className: "str-chat__list", children: /* @__PURE__ */ h("div", { className: "str-chat__message-list-scroll", children: [
|
|
4821
|
+
A,
|
|
4822
|
+
I
|
|
4816
4823
|
] }) }),
|
|
4817
4824
|
/* @__PURE__ */ s(
|
|
4818
4825
|
Wt,
|
|
4819
4826
|
{
|
|
4820
|
-
head:
|
|
4821
|
-
|
|
4822
|
-
|
|
4827
|
+
head: E ? /* @__PURE__ */ h("div", { className: "sticky top-0 z-10", children: [
|
|
4828
|
+
A,
|
|
4829
|
+
I
|
|
4823
4830
|
] }) : void 0,
|
|
4824
4831
|
hideDeletedMessages: !0,
|
|
4825
4832
|
hideNewMessageSeparator: !1
|
|
@@ -4833,34 +4840,34 @@ const wo = ({
|
|
|
4833
4840
|
os,
|
|
4834
4841
|
{
|
|
4835
4842
|
...n && {
|
|
4836
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4843
|
+
renderActions: () => n == null ? void 0 : n(L)
|
|
4837
4844
|
},
|
|
4838
4845
|
...r && {
|
|
4839
|
-
renderHeader: () => r(
|
|
4846
|
+
renderHeader: () => r(L)
|
|
4840
4847
|
},
|
|
4841
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4848
|
+
renderFooter: () => a == null ? void 0 : a(L),
|
|
4842
4849
|
disabled: c,
|
|
4843
4850
|
disabledReason: x,
|
|
4844
4851
|
composerInput: $
|
|
4845
4852
|
},
|
|
4846
4853
|
"lt-channel-message-input"
|
|
4847
4854
|
)
|
|
4848
|
-
] }) : /* @__PURE__ */ h(
|
|
4855
|
+
] }) : /* @__PURE__ */ h(J, { children: [
|
|
4849
4856
|
/* @__PURE__ */ h(
|
|
4850
4857
|
"div",
|
|
4851
4858
|
{
|
|
4852
4859
|
className: "flex-1 overflow-hidden relative",
|
|
4853
4860
|
children: [
|
|
4854
|
-
!
|
|
4855
|
-
|
|
4856
|
-
|
|
4861
|
+
!E && /* @__PURE__ */ s("div", { className: "str-chat__list", children: /* @__PURE__ */ h("div", { className: "str-chat__message-list-scroll", children: [
|
|
4862
|
+
A,
|
|
4863
|
+
I
|
|
4857
4864
|
] }) }),
|
|
4858
4865
|
/* @__PURE__ */ s(
|
|
4859
4866
|
Wt,
|
|
4860
4867
|
{
|
|
4861
|
-
head:
|
|
4862
|
-
|
|
4863
|
-
|
|
4868
|
+
head: E ? /* @__PURE__ */ h("div", { className: "sticky top-0 z-10", children: [
|
|
4869
|
+
A,
|
|
4870
|
+
I
|
|
4864
4871
|
] }) : void 0,
|
|
4865
4872
|
hideDeletedMessages: !0,
|
|
4866
4873
|
hideNewMessageSeparator: !1
|
|
@@ -4870,14 +4877,14 @@ const wo = ({
|
|
|
4870
4877
|
},
|
|
4871
4878
|
"lt-channel-message-list"
|
|
4872
4879
|
),
|
|
4873
|
-
r ? /* @__PURE__ */ s(F.Fragment, { children: r(
|
|
4880
|
+
r ? /* @__PURE__ */ s(F.Fragment, { children: r(L) }, "lt-channel-conversation-footer") : null,
|
|
4874
4881
|
/* @__PURE__ */ s(
|
|
4875
4882
|
os,
|
|
4876
4883
|
{
|
|
4877
4884
|
...n && {
|
|
4878
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4885
|
+
renderActions: () => n == null ? void 0 : n(L)
|
|
4879
4886
|
},
|
|
4880
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4887
|
+
renderFooter: () => a == null ? void 0 : a(L),
|
|
4881
4888
|
disabled: c,
|
|
4882
4889
|
disabledReason: x,
|
|
4883
4890
|
composerInput: $
|
|
@@ -4910,56 +4917,56 @@ const wo = ({
|
|
|
4910
4917
|
dmAgentEnabled: v,
|
|
4911
4918
|
messageMetadata: w,
|
|
4912
4919
|
onMessageSent: C,
|
|
4913
|
-
showStarButton:
|
|
4920
|
+
showStarButton: T = !1,
|
|
4914
4921
|
chatbotVotingEnabled: O = !1,
|
|
4915
|
-
renderChannelBanner:
|
|
4922
|
+
renderChannelBanner: R,
|
|
4916
4923
|
customChannelActions: z,
|
|
4917
4924
|
renderChannelActions: $,
|
|
4918
|
-
renderMessage:
|
|
4925
|
+
renderMessage: L,
|
|
4919
4926
|
onMessageLinkClick: S,
|
|
4920
|
-
sendButton:
|
|
4927
|
+
sendButton: P,
|
|
4921
4928
|
attachmentPreviewList: k,
|
|
4922
|
-
viewerLanguage:
|
|
4923
|
-
showChannelInfo:
|
|
4924
|
-
onParticipantNameClick:
|
|
4929
|
+
viewerLanguage: E,
|
|
4930
|
+
showChannelInfo: I = !0,
|
|
4931
|
+
onParticipantNameClick: A,
|
|
4925
4932
|
onBroadcastClick: U,
|
|
4926
|
-
composerInput:
|
|
4933
|
+
composerInput: j
|
|
4927
4934
|
}) => {
|
|
4928
|
-
const
|
|
4929
|
-
async (
|
|
4930
|
-
var
|
|
4931
|
-
const
|
|
4935
|
+
const q = W(
|
|
4936
|
+
async (K, N, M) => {
|
|
4937
|
+
var ee;
|
|
4938
|
+
const G = ((ee = e.data) == null ? void 0 : ee.chatbot_paused) === !0, X = v && !G, se = {
|
|
4932
4939
|
...N,
|
|
4933
|
-
...
|
|
4940
|
+
...X && { silent: !0 },
|
|
4934
4941
|
...w && {
|
|
4935
4942
|
metadata: {
|
|
4936
4943
|
...N.metadata ?? {},
|
|
4937
4944
|
...w
|
|
4938
4945
|
}
|
|
4939
4946
|
}
|
|
4940
|
-
},
|
|
4941
|
-
...
|
|
4942
|
-
...
|
|
4943
|
-
}, V = await e.sendMessage(
|
|
4947
|
+
}, Z = {
|
|
4948
|
+
...M,
|
|
4949
|
+
...X && { skip_push: !0 }
|
|
4950
|
+
}, V = await e.sendMessage(se, Z);
|
|
4944
4951
|
return C == null || C(V), V;
|
|
4945
4952
|
},
|
|
4946
4953
|
[e, v, w, C]
|
|
4947
|
-
),
|
|
4948
|
-
return
|
|
4954
|
+
), Q = H(null);
|
|
4955
|
+
return Y(() => {
|
|
4949
4956
|
if (!S) return;
|
|
4950
|
-
const
|
|
4951
|
-
if (!
|
|
4952
|
-
const N = (
|
|
4953
|
-
const
|
|
4954
|
-
if (!
|
|
4955
|
-
const
|
|
4956
|
-
S(
|
|
4957
|
+
const K = Q.current;
|
|
4958
|
+
if (!K) return;
|
|
4959
|
+
const N = (M) => {
|
|
4960
|
+
const G = M.target, X = G == null ? void 0 : G.closest("a[href]"), se = X == null ? void 0 : X.getAttribute("href");
|
|
4961
|
+
if (!se) return;
|
|
4962
|
+
const Z = X == null ? void 0 : X.closest("[data-message-id]"), V = Z == null ? void 0 : Z.getAttribute("data-message-id"), ee = V ? e.state.messages.find((re) => re.id === V) : void 0;
|
|
4963
|
+
S(se, ee);
|
|
4957
4964
|
};
|
|
4958
|
-
return
|
|
4965
|
+
return K.addEventListener("click", N), () => K.removeEventListener("click", N);
|
|
4959
4966
|
}, [S, e]), /* @__PURE__ */ s(
|
|
4960
4967
|
"div",
|
|
4961
4968
|
{
|
|
4962
|
-
ref:
|
|
4969
|
+
ref: Q,
|
|
4963
4970
|
className: y(
|
|
4964
4971
|
"messaging-channel-view h-full flex flex-col",
|
|
4965
4972
|
d
|
|
@@ -4973,8 +4980,8 @@ const wo = ({
|
|
|
4973
4980
|
LoadingIndicator: Ve,
|
|
4974
4981
|
DateSeparator: La,
|
|
4975
4982
|
TypingIndicator: bo,
|
|
4976
|
-
doSendMessageRequest:
|
|
4977
|
-
...
|
|
4983
|
+
doSendMessageRequest: q,
|
|
4984
|
+
...P ? { SendButton: P } : {},
|
|
4978
4985
|
...k ? { AttachmentPreviewList: k } : {},
|
|
4979
4986
|
children: /* @__PURE__ */ s(
|
|
4980
4987
|
wo,
|
|
@@ -4995,17 +5002,17 @@ const wo = ({
|
|
|
4995
5002
|
showReportParticipant: _,
|
|
4996
5003
|
composerDisabled: b,
|
|
4997
5004
|
composerDisabledReason: p,
|
|
4998
|
-
showStarButton:
|
|
5005
|
+
showStarButton: T,
|
|
4999
5006
|
chatbotVotingEnabled: O,
|
|
5000
|
-
renderChannelBanner:
|
|
5007
|
+
renderChannelBanner: R,
|
|
5001
5008
|
customChannelActions: z,
|
|
5002
5009
|
renderChannelActions: $,
|
|
5003
|
-
renderMessage:
|
|
5004
|
-
viewerLanguage:
|
|
5005
|
-
showChannelInfo:
|
|
5006
|
-
onParticipantNameClick:
|
|
5010
|
+
renderMessage: L,
|
|
5011
|
+
viewerLanguage: E,
|
|
5012
|
+
showChannelInfo: I,
|
|
5013
|
+
onParticipantNameClick: A,
|
|
5007
5014
|
onBroadcastClick: U,
|
|
5008
|
-
composerInput:
|
|
5015
|
+
composerInput: j
|
|
5009
5016
|
}
|
|
5010
5017
|
)
|
|
5011
5018
|
}
|
|
@@ -5052,33 +5059,33 @@ const qo = ({
|
|
|
5052
5059
|
onBroadcastClick: v,
|
|
5053
5060
|
renderMessage: w,
|
|
5054
5061
|
onMessageLinkClick: C,
|
|
5055
|
-
showChannelInfo:
|
|
5062
|
+
showChannelInfo: T,
|
|
5056
5063
|
composerInput: O
|
|
5057
5064
|
}) => {
|
|
5058
5065
|
const {
|
|
5059
|
-
client:
|
|
5066
|
+
client: R,
|
|
5060
5067
|
isConnected: z,
|
|
5061
5068
|
isLoading: $,
|
|
5062
|
-
error:
|
|
5069
|
+
error: L,
|
|
5063
5070
|
refreshConnection: S,
|
|
5064
|
-
service:
|
|
5071
|
+
service: P,
|
|
5065
5072
|
debug: k
|
|
5066
|
-
} = xa(), [
|
|
5067
|
-
|
|
5068
|
-
const N =
|
|
5073
|
+
} = xa(), [E, I] = B(null), [A, U] = B(null), [j, q] = B(!1), { showDeleteConversation: Q = !0 } = e, K = H(l);
|
|
5074
|
+
K.current = l;
|
|
5075
|
+
const N = H(a);
|
|
5069
5076
|
N.current = a;
|
|
5070
|
-
const
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
}, [
|
|
5074
|
-
if (!
|
|
5075
|
-
const
|
|
5076
|
-
if (!
|
|
5077
|
-
const V = `${
|
|
5078
|
-
if (
|
|
5079
|
-
|
|
5080
|
-
const
|
|
5081
|
-
|
|
5077
|
+
const M = H(null), G = H(null);
|
|
5078
|
+
Y(() => {
|
|
5079
|
+
G.current = E;
|
|
5080
|
+
}, [E]), Y(() => {
|
|
5081
|
+
if (!R || !z) return;
|
|
5082
|
+
const Z = R.userID;
|
|
5083
|
+
if (!Z) return;
|
|
5084
|
+
const V = `${Z}::${i}`;
|
|
5085
|
+
if (M.current === V) return;
|
|
5086
|
+
M.current = V;
|
|
5087
|
+
const ee = () => {
|
|
5088
|
+
M.current === V && (M.current = null);
|
|
5082
5089
|
};
|
|
5083
5090
|
(async () => {
|
|
5084
5091
|
var Me, Re;
|
|
@@ -5087,36 +5094,36 @@ const qo = ({
|
|
|
5087
5094
|
"[MessagingShell] Loading initial conversation with:",
|
|
5088
5095
|
i
|
|
5089
5096
|
);
|
|
5090
|
-
const ie = await
|
|
5097
|
+
const ie = await R.queryChannels(
|
|
5091
5098
|
{
|
|
5092
5099
|
type: "messaging",
|
|
5093
|
-
members: { $eq: [
|
|
5100
|
+
members: { $eq: [Z, i] }
|
|
5094
5101
|
},
|
|
5095
5102
|
{},
|
|
5096
5103
|
{ limit: 1 }
|
|
5097
5104
|
);
|
|
5098
5105
|
if (ie.length > 0) {
|
|
5099
|
-
|
|
5106
|
+
I(ie[0]), U(null), (Me = N.current) == null || Me.call(N, ie[0]), k && console.log(
|
|
5100
5107
|
"[MessagingShell] Initial conversation loaded:",
|
|
5101
5108
|
ie[0].id
|
|
5102
5109
|
);
|
|
5103
5110
|
return;
|
|
5104
5111
|
}
|
|
5105
|
-
const de =
|
|
5106
|
-
if (!de || !
|
|
5107
|
-
|
|
5112
|
+
const de = K.current;
|
|
5113
|
+
if (!de || !P) {
|
|
5114
|
+
ee(), U("No conversation found with this account"), k && console.log(
|
|
5108
5115
|
"[MessagingShell] No conversation found for:",
|
|
5109
5116
|
i
|
|
5110
5117
|
);
|
|
5111
5118
|
return;
|
|
5112
5119
|
}
|
|
5113
5120
|
try {
|
|
5114
|
-
const oe = await
|
|
5121
|
+
const oe = await P.startChannelWithParticipant({
|
|
5115
5122
|
id: de.id,
|
|
5116
5123
|
name: de.name,
|
|
5117
5124
|
phone: de.phone
|
|
5118
5125
|
});
|
|
5119
|
-
|
|
5126
|
+
I(oe), U(null), (Re = N.current) == null || Re.call(N, oe), k && console.log(
|
|
5120
5127
|
"[MessagingShell] Channel created and loaded:",
|
|
5121
5128
|
oe.id
|
|
5122
5129
|
);
|
|
@@ -5124,39 +5131,39 @@ const qo = ({
|
|
|
5124
5131
|
console.error(
|
|
5125
5132
|
"[MessagingShell] Failed to create conversation:",
|
|
5126
5133
|
oe
|
|
5127
|
-
),
|
|
5134
|
+
), ee(), U("Failed to create conversation");
|
|
5128
5135
|
}
|
|
5129
5136
|
} catch (ie) {
|
|
5130
5137
|
console.error(
|
|
5131
5138
|
"[MessagingShell] Failed to load initial conversation:",
|
|
5132
5139
|
ie
|
|
5133
|
-
),
|
|
5140
|
+
), ee(), G.current || U("Failed to load conversation");
|
|
5134
5141
|
}
|
|
5135
5142
|
})();
|
|
5136
|
-
}, [i,
|
|
5137
|
-
const
|
|
5138
|
-
|
|
5139
|
-
const
|
|
5140
|
-
var
|
|
5141
|
-
|
|
5143
|
+
}, [i, R, z, P, k]);
|
|
5144
|
+
const X = H(r);
|
|
5145
|
+
X.current = r;
|
|
5146
|
+
const se = W(() => {
|
|
5147
|
+
var Z;
|
|
5148
|
+
I(null), q(!0), (Z = X.current) == null || Z.call(X);
|
|
5142
5149
|
}, []);
|
|
5143
|
-
return $ ? /* @__PURE__ */ s(Ve, {}) :
|
|
5150
|
+
return $ ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(ye, { message: L, onBack: S }) : !z || !R ? /* @__PURE__ */ s(
|
|
5144
5151
|
ye,
|
|
5145
5152
|
{
|
|
5146
5153
|
message: "Not connected to messaging service",
|
|
5147
5154
|
onBack: S
|
|
5148
5155
|
}
|
|
5149
|
-
) :
|
|
5156
|
+
) : A ? /* @__PURE__ */ s(ye, { message: A }) : j && !E ? /* @__PURE__ */ s(ye, { message: "Conversation ended" }) : E ? /* @__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(
|
|
5150
5157
|
Ws,
|
|
5151
5158
|
{
|
|
5152
|
-
channel:
|
|
5159
|
+
channel: E,
|
|
5153
5160
|
renderMessageInputActions: t,
|
|
5154
5161
|
renderConversationFooter: n,
|
|
5155
5162
|
renderChannelBanner: x,
|
|
5156
|
-
onLeaveConversation:
|
|
5157
|
-
onBlockParticipant:
|
|
5163
|
+
onLeaveConversation: se,
|
|
5164
|
+
onBlockParticipant: se,
|
|
5158
5165
|
CustomChannelEmptyState: o,
|
|
5159
|
-
showDeleteConversation:
|
|
5166
|
+
showDeleteConversation: Q,
|
|
5160
5167
|
onBlockParticipantClick: d,
|
|
5161
5168
|
onReportParticipantClick: m,
|
|
5162
5169
|
dmAgentEnabled: f,
|
|
@@ -5169,10 +5176,10 @@ const qo = ({
|
|
|
5169
5176
|
onBroadcastClick: v,
|
|
5170
5177
|
renderMessage: w,
|
|
5171
5178
|
onMessageLinkClick: C,
|
|
5172
|
-
showChannelInfo:
|
|
5179
|
+
showChannelInfo: T,
|
|
5173
5180
|
composerInput: O
|
|
5174
5181
|
},
|
|
5175
|
-
|
|
5182
|
+
E.id
|
|
5176
5183
|
) }) }) : /* @__PURE__ */ s(Ve, {});
|
|
5177
5184
|
};
|
|
5178
5185
|
function No(e) {
|
|
@@ -5212,7 +5219,7 @@ const qs = F.createContext({
|
|
|
5212
5219
|
});
|
|
5213
5220
|
}, Xs = F.memo(
|
|
5214
5221
|
(e) => {
|
|
5215
|
-
var z, $,
|
|
5222
|
+
var z, $, L;
|
|
5216
5223
|
const { channel: t, unread: n } = e, {
|
|
5217
5224
|
selectedChannel: a,
|
|
5218
5225
|
onChannelSelect: r,
|
|
@@ -5235,44 +5242,44 @@ const qs = F.createContext({
|
|
|
5235
5242
|
const g = () => {
|
|
5236
5243
|
t && r(t);
|
|
5237
5244
|
}, c = (S) => {
|
|
5238
|
-
const
|
|
5239
|
-
!
|
|
5245
|
+
const P = S.key === "Enter" || S.key === " ", k = S.repeat;
|
|
5246
|
+
!P || k || (S.preventDefault(), g());
|
|
5240
5247
|
}, x = vs(
|
|
5241
5248
|
(z = t == null ? void 0 : t.state) == null ? void 0 : z.members,
|
|
5242
5249
|
m == null ? void 0 : m.userID,
|
|
5243
5250
|
t == null ? void 0 : t.type
|
|
5244
5251
|
), _ = xs(x == null ? void 0 : x.user), b = ($ = x == null ? void 0 : x.user) == null ? void 0 : $.image, p = (() => {
|
|
5245
|
-
var
|
|
5246
|
-
const S = (
|
|
5252
|
+
var P;
|
|
5253
|
+
const S = (P = t == null ? void 0 : t.state) == null ? void 0 : P.messages;
|
|
5247
5254
|
if (S != null && S.length) {
|
|
5248
5255
|
for (let k = S.length - 1; k >= 0; k--)
|
|
5249
5256
|
if (S[k].type !== "system") return S[k];
|
|
5250
5257
|
}
|
|
5251
5258
|
})(), w = (() => {
|
|
5252
|
-
var
|
|
5259
|
+
var I;
|
|
5253
5260
|
const S = ws({
|
|
5254
5261
|
message: p,
|
|
5255
5262
|
viewerLanguage: d
|
|
5256
|
-
}), { custom_type:
|
|
5257
|
-
if (
|
|
5263
|
+
}), { custom_type: P, attachment_content_type: k } = (p == null ? void 0 : p.metadata) || {};
|
|
5264
|
+
if (P === le.TIP)
|
|
5258
5265
|
return S || "Sent a tip";
|
|
5259
|
-
if (
|
|
5266
|
+
if (P === le.PAID)
|
|
5260
5267
|
return S || "Sent a message";
|
|
5261
|
-
if (
|
|
5268
|
+
if (P === le.ATTACHMENT) {
|
|
5262
5269
|
if (k === "text")
|
|
5263
5270
|
return "🔒 Sent a locked message";
|
|
5264
5271
|
if (k === "media")
|
|
5265
5272
|
return "🔒 Sent a locked attachment";
|
|
5266
5273
|
}
|
|
5267
5274
|
if (S) return S;
|
|
5268
|
-
const
|
|
5269
|
-
return
|
|
5270
|
-
})(), C = p != null && p.created_at ? So(new Date(p.created_at)) : "",
|
|
5275
|
+
const E = (I = p == null ? void 0 : p.attachments) == null ? void 0 : I[0];
|
|
5276
|
+
return E ? E.og_scrape_url ? E.og_scrape_url : E.type === "image" ? "📷 Sent an image" : E.type === "video" ? "🎥 Sent a video" : E.type === "audio" ? "🎵 Sent audio" : E.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
5277
|
+
})(), C = p != null && p.created_at ? So(new Date(p.created_at)) : "", T = p ? Be(p) : !1, O = o ? o(p, w) : `${T ? "✨ " : ""}${w}`, R = n ?? 0;
|
|
5271
5278
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
5272
5279
|
channelId: t == null ? void 0 : t.id,
|
|
5273
5280
|
isSelected: f,
|
|
5274
5281
|
participantName: _,
|
|
5275
|
-
unreadCount:
|
|
5282
|
+
unreadCount: R,
|
|
5276
5283
|
hasTimestamp: !!C
|
|
5277
5284
|
}), /* @__PURE__ */ s(
|
|
5278
5285
|
"div",
|
|
@@ -5293,7 +5300,7 @@ const qs = F.createContext({
|
|
|
5293
5300
|
/* @__PURE__ */ s(
|
|
5294
5301
|
_e,
|
|
5295
5302
|
{
|
|
5296
|
-
id: ((
|
|
5303
|
+
id: ((L = x == null ? void 0 : x.user) == null ? void 0 : L.id) || t.id || "unknown",
|
|
5297
5304
|
name: _,
|
|
5298
5305
|
image: b,
|
|
5299
5306
|
size: 48,
|
|
@@ -5318,7 +5325,7 @@ const qs = F.createContext({
|
|
|
5318
5325
|
] }),
|
|
5319
5326
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
5320
5327
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: O }),
|
|
5321
|
-
|
|
5328
|
+
R > 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: R > 99 ? "99+" : R })
|
|
5322
5329
|
] })
|
|
5323
5330
|
] })
|
|
5324
5331
|
] })
|
|
@@ -5352,8 +5359,8 @@ const Eo = { last_message_at: -1 }, Io = F.memo(
|
|
|
5352
5359
|
v.current++;
|
|
5353
5360
|
const { debug: w = !1 } = dt(), C = F.useCallback(
|
|
5354
5361
|
(O) => {
|
|
5355
|
-
for (const
|
|
5356
|
-
No(
|
|
5362
|
+
for (const R of O)
|
|
5363
|
+
No(R);
|
|
5357
5364
|
return r ? r(O) : O;
|
|
5358
5365
|
},
|
|
5359
5366
|
[r]
|
|
@@ -5363,7 +5370,7 @@ const Eo = { last_message_at: -1 }, Io = F.memo(
|
|
|
5363
5370
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
5364
5371
|
filters: n
|
|
5365
5372
|
});
|
|
5366
|
-
const
|
|
5373
|
+
const T = F.useMemo(
|
|
5367
5374
|
() => ({
|
|
5368
5375
|
selectedChannel: t,
|
|
5369
5376
|
onChannelSelect: e,
|
|
@@ -5388,7 +5395,7 @@ const Eo = { last_message_at: -1 }, Io = F.memo(
|
|
|
5388
5395
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
5389
5396
|
l
|
|
5390
5397
|
),
|
|
5391
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(yo, { value:
|
|
5398
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(yo, { value: T, children: /* @__PURE__ */ s(
|
|
5392
5399
|
Bn,
|
|
5393
5400
|
{
|
|
5394
5401
|
filters: n,
|
|
@@ -5586,4 +5593,4 @@ export {
|
|
|
5586
5593
|
vs as y,
|
|
5587
5594
|
ht as z
|
|
5588
5595
|
};
|
|
5589
|
-
//# sourceMappingURL=index-
|
|
5596
|
+
//# sourceMappingURL=index-Daw6ObfN.js.map
|