@linktr.ee/messaging-react 3.5.0-rc-1782803869 → 3.5.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-CBcRaHQ4.cjs → Card-BA3RGlVC.cjs} +2 -2
- package/dist/{Card-CBcRaHQ4.cjs.map → Card-BA3RGlVC.cjs.map} +1 -1
- package/dist/{Card-BeqtdXsT.js → Card-BGF3hZJD.js} +3 -3
- package/dist/{Card-BeqtdXsT.js.map → Card-BGF3hZJD.js.map} +1 -1
- package/dist/{Card-B-NI0Nwx.cjs → Card-BvekIUnZ.cjs} +2 -2
- package/dist/{Card-B-NI0Nwx.cjs.map → Card-BvekIUnZ.cjs.map} +1 -1
- package/dist/{Card-CyXIorn2.js → Card-DBi3Jd7-.js} +2 -2
- package/dist/{Card-CyXIorn2.js.map → Card-DBi3Jd7-.js.map} +1 -1
- package/dist/{Card-CDqtjzJk.cjs → Card-DwuckVx8.cjs} +2 -2
- package/dist/{Card-CDqtjzJk.cjs.map → Card-DwuckVx8.cjs.map} +1 -1
- package/dist/{Card-CkvECMJq.js → Card-yaDKMDYI.js} +2 -2
- package/dist/{Card-CkvECMJq.js.map → Card-yaDKMDYI.js.map} +1 -1
- package/dist/{LockedThumbnail-CSDhK33t.js → LockedThumbnail-CdfkygLY.js} +2 -2
- package/dist/{LockedThumbnail-CSDhK33t.js.map → LockedThumbnail-CdfkygLY.js.map} +1 -1
- package/dist/{LockedThumbnail-DoyVJ55j.cjs → LockedThumbnail-anhR2WjV.cjs} +2 -2
- package/dist/{LockedThumbnail-DoyVJ55j.cjs.map → LockedThumbnail-anhR2WjV.cjs.map} +1 -1
- package/dist/index-BEQeC48N.cjs +2 -0
- package/dist/{index-CPzRDkJV.cjs.map → index-BEQeC48N.cjs.map} +1 -1
- package/dist/{index-MMFq_gs5.js → index-DmFR1zuQ.js} +641 -641
- package/dist/{index-MMFq_gs5.js.map → index-DmFR1zuQ.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +5 -4
- package/src/components/ChannelList/CustomChannelPreview.tsx +3 -3
- package/src/types.ts +1 -4
- package/dist/index-CPzRDkJV.cjs +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import V, { createContext as We, useContext as _e, useCallback as J, useState as $, useRef as Y, useEffect as K, useId as In, useMemo as re, Suspense as Xe } from "react";
|
|
3
3
|
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as Tn, LinkPreviewsManager as Lt } from "stream-chat";
|
|
5
5
|
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as Gt, Attachment as Dn, EditMessageModal as Pn, MessageBlocked as zn, MessageBouncePrompt as On, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Dt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as ye, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as $e, AIStates as Fe, useTypingContext as rs, useAIState as is, Channel as ls, WithComponents as os, Window as cs, MessageList as ds, ChannelList as us, InfiniteScroll as ms } from "stream-chat-react";
|
|
6
6
|
import { StarIcon as Ge, DotsThreeIcon as hs, SpinnerGapIcon as Te, SignOutIcon as fs, ProhibitInsetIcon as Pt, FlagIcon as Ht, FileIcon as Yt, ImageIcon as gs, SpeakerHighIcon as ps, VideoCameraIcon as qt, FileMdIcon as bs, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as Ns, FileXlsIcon as _s, FileDocIcon as ys, FilePdfIcon as ks, CircleNotchIcon as we, PlayIcon as He, PauseIcon as Cs, LinkIcon as Es, DownloadSimpleIcon as Ne, GiftIcon as Is, ThumbsUpIcon as Ss, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as Pe, ArrowUpIcon as Ms, SparkleIcon as be, ProhibitIcon as Rs, ArrowLeftIcon as zt, CaretRightIcon as ve, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
-
import
|
|
7
|
+
import k from "classnames";
|
|
8
8
|
import { MessageActions as Ps, DefaultDropdownActionButton as Wt } from "stream-chat-react/experimental";
|
|
9
9
|
const Xt = We({
|
|
10
10
|
service: null,
|
|
@@ -24,10 +24,10 @@ const Xt = We({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var M,
|
|
28
|
-
const l =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var M, y;
|
|
28
|
+
const l = J(
|
|
29
|
+
(I, ...C) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${I}`, ...C);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,77 +37,77 @@ const Xt = We({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] =
|
|
41
|
-
|
|
40
|
+
const [o, d] = $(null), [u, g] = $(null), [m, f] = $(!1), [c, b] = $(!1), [N, w] = $(null), p = Y(!1), v = Y(null), A = Y(s);
|
|
41
|
+
A.current = s;
|
|
42
42
|
const T = Y(i);
|
|
43
43
|
T.current = i;
|
|
44
|
-
const
|
|
44
|
+
const E = Y({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), O = Y(0);
|
|
50
|
+
O.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: O.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
54
|
+
userChanged: E.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: E.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: E.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: E.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), E.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((M =
|
|
67
|
-
const L = a ? ((
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
if (!a || !L || !
|
|
65
|
+
const R = Y(null);
|
|
66
|
+
a && ((M = R.current) == null ? void 0 : M.apiKey) !== a && (R.current = { apiKey: a, client: new Tn(a) });
|
|
67
|
+
const L = a ? ((y = R.current) == null ? void 0 : y.client) ?? null : null;
|
|
68
|
+
K(() => {
|
|
69
|
+
const I = O.current, C = A.current;
|
|
70
|
+
if (!a || !L || !C) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: I,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
l("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: I,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
81
|
+
const z = new Sn({
|
|
82
|
+
...C,
|
|
83
83
|
apiKey: a,
|
|
84
84
|
debug: T.current,
|
|
85
85
|
client: L
|
|
86
86
|
});
|
|
87
|
-
v.current =
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance:
|
|
87
|
+
v.current = z, d(z), l("✅ SERVICE SET", {
|
|
88
|
+
renderCount: I,
|
|
89
|
+
serviceInstance: !!z
|
|
90
90
|
});
|
|
91
91
|
}, [a, L]);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
var
|
|
92
|
+
const B = Y(null);
|
|
93
|
+
K(() => {
|
|
94
|
+
var C, z;
|
|
95
95
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!o,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: p.current,
|
|
100
100
|
isConnected: m,
|
|
101
101
|
dependencies: { service: !!o, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !o || !t) {
|
|
103
103
|
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (p.current) {
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((C = B.current) == null ? void 0 : C.serviceId) === o && ((z = B.current) == null ? void 0 : z.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const Xt = We({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
l("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
l("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, b(!0), w(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const D = await o.connectUser(t);
|
|
122
|
+
g(D), f(!0), B.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: D.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const j =
|
|
128
|
-
|
|
126
|
+
} catch (D) {
|
|
127
|
+
const j = D instanceof Error ? D.message : "Connection failed";
|
|
128
|
+
w(j), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
130
|
error: j
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
b(!1), p.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: m
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [o, t, l, m]),
|
|
140
|
-
const
|
|
139
|
+
}, [o, t, l, m]), K(() => {
|
|
140
|
+
const I = L;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var C;
|
|
143
|
+
I && (B.current = null, (C = v.current) == null || C.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [L]);
|
|
146
|
-
const
|
|
146
|
+
const P = J(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,52 +151,52 @@ const Xt = We({
|
|
|
151
151
|
l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
154
|
+
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
|
-
const
|
|
158
|
-
g(
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const I = await o.connectUser(t);
|
|
158
|
+
g(I), f(!0), w(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (I) {
|
|
160
|
+
const C = I instanceof Error ? I.message : "Refresh failed";
|
|
161
|
+
w(C), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: C
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]),
|
|
168
|
+
}, [o, t, l]), _ = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!u,
|
|
171
171
|
isConnected: m,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!N,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: o,
|
|
177
177
|
client: u,
|
|
178
178
|
isConnected: m,
|
|
179
179
|
isLoading: c,
|
|
180
|
-
error:
|
|
180
|
+
error: N,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: P,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
o,
|
|
186
186
|
u,
|
|
187
187
|
m,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
N,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
P,
|
|
192
192
|
i,
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
196
|
+
renderCount: O.current,
|
|
197
197
|
willRenderChat: !!L,
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(Xt.Provider, { value:
|
|
198
|
+
contextValueReady: !!_
|
|
199
|
+
}), /* @__PURE__ */ n(Xt.Provider, { value: _, children: L ? /* @__PURE__ */ n(
|
|
200
200
|
An,
|
|
201
201
|
{
|
|
202
202
|
client: L,
|
|
@@ -208,10 +208,10 @@ const Xt = We({
|
|
|
208
208
|
) : e });
|
|
209
209
|
}, zs = () => Je(), Kt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = $(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return K(() => {
|
|
215
215
|
var l;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -299,7 +299,7 @@ const ne = ({
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
302
|
+
className: k(
|
|
303
303
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
304
304
|
u
|
|
305
305
|
),
|
|
@@ -309,7 +309,7 @@ const ne = ({
|
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: k(
|
|
313
313
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
314
|
a
|
|
315
315
|
),
|
|
@@ -331,7 +331,7 @@ const ne = ({
|
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
334
|
+
className: k(
|
|
335
335
|
"h-full w-full",
|
|
336
336
|
"bg-transparent"
|
|
337
337
|
),
|
|
@@ -364,72 +364,72 @@ const ne = ({
|
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
366
|
var M;
|
|
367
|
-
const { service: m, debug: f } = Je(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.id,
|
|
368
|
-
return
|
|
369
|
-
if (!
|
|
370
|
-
|
|
367
|
+
const { service: m, debug: f } = Je(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.id, b = !!(a && s && m && c), [N, w] = $(!1), [p, v] = $(null), [A, T] = $(!1), [E, O] = $(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== m);
|
|
368
|
+
return K(() => {
|
|
369
|
+
if (!b || !m || !c) {
|
|
370
|
+
w(!1), v(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let y = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
(
|
|
376
|
+
const I = await m.getBlockedUsers();
|
|
377
|
+
if (y) return;
|
|
378
|
+
w(
|
|
379
|
+
I.some(
|
|
380
|
+
(C) => C.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
383
|
+
} catch (I) {
|
|
384
|
+
y || console.error(`[${g}] Failed to check blocked status:`, I);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
y || v({ participantId: c, service: m });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
y = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
395
|
-
isUpdatingBlockStatus:
|
|
391
|
+
}, [b, m, c, g]), {
|
|
392
|
+
isParticipantBlocked: N,
|
|
393
|
+
isCheckingBlockedStatus: R,
|
|
394
|
+
isLeaving: A,
|
|
395
|
+
isUpdatingBlockStatus: E,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
398
|
-
if (!
|
|
397
|
+
var y;
|
|
398
|
+
if (!A) {
|
|
399
399
|
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), T(!0);
|
|
400
400
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
401
|
+
const I = ((y = e._client) == null ? void 0 : y.userID) ?? null;
|
|
402
|
+
await e.hide(I, !1), r && await r(e), u == null || u();
|
|
403
|
+
} catch (I) {
|
|
404
|
+
console.error(`[${g}] Failed to leave conversation`, I);
|
|
405
405
|
} finally {
|
|
406
406
|
T(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
o == null || o(), f && console.log(`[${g}] Block member`, (
|
|
411
|
+
var y, I, C;
|
|
412
|
+
if (!(E || !m)) {
|
|
413
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), O(!0);
|
|
414
414
|
try {
|
|
415
|
-
await m.blockUser((
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
415
|
+
await m.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), u == null || u();
|
|
416
|
+
} catch (z) {
|
|
417
|
+
console.error(`[${g}] Failed to block member`, z);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
O(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
o == null || o(), f && console.log(`[${g}] Unblock member`, (
|
|
424
|
+
var y, I, C;
|
|
425
|
+
if (!(E || !m)) {
|
|
426
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), O(!0);
|
|
427
427
|
try {
|
|
428
|
-
await m.unBlockUser((
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
428
|
+
await m.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), u == null || u();
|
|
429
|
+
} catch (z) {
|
|
430
|
+
console.error(`[${g}] Failed to unblock member`, z);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
O(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
@@ -446,7 +446,7 @@ const ne = ({
|
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
449
|
-
className:
|
|
449
|
+
className: k(
|
|
450
450
|
"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",
|
|
451
451
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
452
452
|
t
|
|
@@ -468,14 +468,14 @@ const ne = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: m
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
472
|
-
isParticipantBlocked:
|
|
471
|
+
const [f, c] = $(!1), b = Y(null), N = In(), w = J(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: p,
|
|
473
473
|
isCheckingBlockedStatus: v,
|
|
474
|
-
isLeaving:
|
|
474
|
+
isLeaving: A,
|
|
475
475
|
isUpdatingBlockStatus: T,
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
476
|
+
handleLeaveConversation: E,
|
|
477
|
+
handleBlockUser: O,
|
|
478
|
+
handleUnblockUser: R,
|
|
479
479
|
handleReportUser: L
|
|
480
480
|
} = js({
|
|
481
481
|
channel: e,
|
|
@@ -487,20 +487,20 @@ const ne = ({
|
|
|
487
487
|
onDeleteConversationClick: o,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: u,
|
|
490
|
-
onActionComplete:
|
|
490
|
+
onActionComplete: w,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
|
-
return
|
|
493
|
+
return K(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
},
|
|
495
|
+
const P = (M) => {
|
|
496
|
+
b.current && !b.current.contains(M.target) && c(!1);
|
|
497
|
+
}, _ = (M) => {
|
|
498
498
|
M.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", P), document.addEventListener("keydown", _), () => {
|
|
501
|
+
document.removeEventListener("mousedown", P), document.removeEventListener("keydown", _);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -508,8 +508,8 @@ const ne = ({
|
|
|
508
508
|
type: "button",
|
|
509
509
|
"aria-haspopup": "true",
|
|
510
510
|
"aria-expanded": f,
|
|
511
|
-
"aria-controls": f ?
|
|
512
|
-
onClick: () => c((
|
|
511
|
+
"aria-controls": f ? N : void 0,
|
|
512
|
+
onClick: () => c((P) => !P),
|
|
513
513
|
children: [
|
|
514
514
|
/* @__PURE__ */ n(hs, { className: "size-5 text-black/90" }),
|
|
515
515
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -519,9 +519,9 @@ const ne = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: N,
|
|
523
523
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
524
|
+
className: k(
|
|
525
525
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
526
526
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
527
527
|
),
|
|
@@ -529,11 +529,11 @@ const ne = ({
|
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
530
|
pe,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
532
|
+
onClick: E,
|
|
533
|
+
disabled: A,
|
|
534
|
+
"aria-busy": A,
|
|
535
535
|
children: [
|
|
536
|
-
|
|
536
|
+
A ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(fs, { className: "h-5 w-5" }),
|
|
537
537
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
538
|
]
|
|
539
539
|
}
|
|
@@ -545,10 +545,10 @@ const ne = ({
|
|
|
545
545
|
/* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
548
|
+
) : p ? /* @__PURE__ */ h(
|
|
549
549
|
pe,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: R,
|
|
552
552
|
disabled: T,
|
|
553
553
|
"aria-busy": T,
|
|
554
554
|
children: [
|
|
@@ -559,7 +559,7 @@ const ne = ({
|
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
560
|
pe,
|
|
561
561
|
{
|
|
562
|
-
onClick:
|
|
562
|
+
onClick: O,
|
|
563
563
|
disabled: T,
|
|
564
564
|
"aria-busy": T,
|
|
565
565
|
children: [
|
|
@@ -585,7 +585,7 @@ function Hs(e) {
|
|
|
585
585
|
const { channel: t } = de(), { client: s } = Ke("useMessageVote"), a = re(
|
|
586
586
|
() => Gs(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
588
|
+
), r = J(async () => {
|
|
589
589
|
if (s != null && s.userID)
|
|
590
590
|
try {
|
|
591
591
|
a === "up" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
|
|
@@ -595,7 +595,7 @@ function Hs(e) {
|
|
|
595
595
|
);
|
|
596
596
|
} catch {
|
|
597
597
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
598
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = J(async () => {
|
|
599
599
|
if (s != null && s.userID)
|
|
600
600
|
try {
|
|
601
601
|
a === "down" ? await t.deleteReaction(e.id, qe) : await t.sendReaction(
|
|
@@ -619,7 +619,7 @@ function Zt({
|
|
|
619
619
|
const s = e == null ? void 0 : e.text, a = Ys(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const qs =
|
|
622
|
+
const qs = V.lazy(() => import("./Card-DBi3Jd7-.js")), Ws = V.lazy(() => import("./Card-yaDKMDYI.js")), Xs = V.lazy(() => import("./Card-BGF3hZJD.js")), Ze = () => /* @__PURE__ */ n(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
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)]",
|
|
@@ -665,7 +665,7 @@ function na(e) {
|
|
|
665
665
|
return t !== "document" ? ea[t] : ta[tn(e)];
|
|
666
666
|
}
|
|
667
667
|
function ce(e, t) {
|
|
668
|
-
return
|
|
668
|
+
return V.createElement(na(e), t);
|
|
669
669
|
}
|
|
670
670
|
const sa = (e) => {
|
|
671
671
|
var t, s;
|
|
@@ -682,9 +682,9 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: u
|
|
684
684
|
}) => {
|
|
685
|
-
const g = ie(t), m = Y(null), f = Y(null), c = Y(null),
|
|
686
|
-
L(!1),
|
|
687
|
-
}, []),
|
|
685
|
+
const g = ie(t), m = Y(null), f = Y(null), c = Y(null), b = Y(r), [N, w] = $(a), [p, v] = $(0), [A, T] = $(!1), [E, O] = $(!1), [R, L] = $(!1), [B, P] = $(!1), [_, M] = $(!0), [y, I] = $(null), C = J(() => {
|
|
686
|
+
L(!1), w(!0);
|
|
687
|
+
}, []), z = J((x) => {
|
|
688
688
|
const S = f.current;
|
|
689
689
|
if (!S) return 0;
|
|
690
690
|
const U = S.getBoundingClientRect();
|
|
@@ -692,56 +692,56 @@ const sa = (e) => {
|
|
|
692
692
|
0,
|
|
693
693
|
Math.min(1, (sa(x) - U.left) / U.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
695
|
+
}, []), D = J((x) => {
|
|
696
696
|
const S = m.current;
|
|
697
697
|
S && S.duration && (S.currentTime = x * S.duration);
|
|
698
698
|
}, []), j = (x) => {
|
|
699
699
|
x.stopPropagation(), T(!0);
|
|
700
|
-
const S =
|
|
701
|
-
v(S),
|
|
700
|
+
const S = z(x);
|
|
701
|
+
v(S), D(S);
|
|
702
702
|
};
|
|
703
|
-
|
|
704
|
-
r !== void 0 && r !==
|
|
705
|
-
}, [r]),
|
|
706
|
-
if (!
|
|
703
|
+
K(() => {
|
|
704
|
+
r !== void 0 && r !== b.current && (b.current = r, w(r));
|
|
705
|
+
}, [r]), K(() => {
|
|
706
|
+
if (!N) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
710
|
const x = () => {
|
|
711
711
|
const S = m.current;
|
|
712
|
-
S && S.duration && !
|
|
712
|
+
S && S.duration && !A && v(S.currentTime / S.duration), c.current = requestAnimationFrame(x);
|
|
713
713
|
};
|
|
714
714
|
return c.current = requestAnimationFrame(x), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [
|
|
717
|
+
}, [N, A]), K(() => {
|
|
718
718
|
const x = m.current;
|
|
719
|
-
x && (
|
|
720
|
-
|
|
719
|
+
x && (N ? x.play().catch((S) => {
|
|
720
|
+
w(!1), L(!0);
|
|
721
721
|
}) : x.pause());
|
|
722
|
-
}, [
|
|
723
|
-
if (!
|
|
724
|
-
const x = (U) => v(
|
|
725
|
-
T(!1),
|
|
722
|
+
}, [N]), K(() => {
|
|
723
|
+
if (!A) return;
|
|
724
|
+
const x = (U) => v(z(U)), S = (U) => {
|
|
725
|
+
T(!1), D(z(U));
|
|
726
726
|
};
|
|
727
727
|
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", S), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", S), () => {
|
|
728
728
|
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", S), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", S);
|
|
729
729
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
730
|
+
}, [A, z, D]);
|
|
731
|
+
const Z = y ? { aspectRatio: String(y) } : void 0, Q = y ? "" : " aspect-video", G = Math.round(p * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
737
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${Q}`,
|
|
738
|
+
style: Z,
|
|
739
739
|
onClick: (x) => {
|
|
740
740
|
if (u) {
|
|
741
741
|
u(x);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
R || l && w((S) => !S);
|
|
745
745
|
},
|
|
746
746
|
onKeyDown: (x) => {
|
|
747
747
|
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
@@ -749,11 +749,11 @@ const sa = (e) => {
|
|
|
749
749
|
u(x);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
R || l && w((S) => !S);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || _) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,7 +761,7 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
764
|
+
!s && (g === "audio" || _) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
@@ -773,14 +773,14 @@ const sa = (e) => {
|
|
|
773
773
|
loop: i,
|
|
774
774
|
muted: d,
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
776
|
+
onLoadStart: () => P(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
P(!1), M(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
780
|
+
onWaiting: () => P(!0),
|
|
781
781
|
onPlay: () => L(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
783
|
+
i || (w(!1), v(0));
|
|
784
784
|
},
|
|
785
785
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
786
|
}
|
|
@@ -793,30 +793,30 @@ const sa = (e) => {
|
|
|
793
793
|
muted: d,
|
|
794
794
|
playsInline: !0,
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
796
|
+
onLoadStart: () => P(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
P(!1), M(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
800
|
+
onWaiting: () => P(!0),
|
|
801
801
|
onPlay: () => L(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
803
|
const x = m.current;
|
|
804
|
-
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight &&
|
|
804
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && I(x.videoWidth / x.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
807
|
+
i || (w(!1), v(0));
|
|
808
808
|
},
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
|
|
812
|
+
B && !R && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
813
|
we,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
R && !l && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -824,10 +824,10 @@ const sa = (e) => {
|
|
|
824
824
|
tabIndex: 0,
|
|
825
825
|
"aria-label": "Play preview",
|
|
826
826
|
onClick: (x) => {
|
|
827
|
-
x.stopPropagation(),
|
|
827
|
+
x.stopPropagation(), C();
|
|
828
828
|
},
|
|
829
829
|
onKeyDown: (x) => {
|
|
830
|
-
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(),
|
|
830
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), C());
|
|
831
831
|
},
|
|
832
832
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(He, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
@@ -837,7 +837,7 @@ const sa = (e) => {
|
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
839
839
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
840
|
+
"aria-valuenow": G,
|
|
841
841
|
"aria-valuemin": 0,
|
|
842
842
|
"aria-valuemax": 100,
|
|
843
843
|
tabIndex: 0,
|
|
@@ -847,13 +847,13 @@ const sa = (e) => {
|
|
|
847
847
|
onTouchStart: j,
|
|
848
848
|
onClick: (x) => x.stopPropagation(),
|
|
849
849
|
onKeyDown: (x) => {
|
|
850
|
-
x.key === "ArrowRight" &&
|
|
850
|
+
x.key === "ArrowRight" && D(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && D(Math.max(0, p - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
854
854
|
{
|
|
855
855
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
856
|
+
style: { width: `${G}%` }
|
|
857
857
|
}
|
|
858
858
|
) })
|
|
859
859
|
}
|
|
@@ -864,11 +864,11 @@ const sa = (e) => {
|
|
|
864
864
|
{
|
|
865
865
|
type: "button",
|
|
866
866
|
onClick: (x) => {
|
|
867
|
-
x.stopPropagation(),
|
|
867
|
+
x.stopPropagation(), w((S) => !S);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": N ? "Pause" : "Play",
|
|
871
|
+
children: N ? /* @__PURE__ */ n(Cs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(He, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -876,7 +876,7 @@ const sa = (e) => {
|
|
|
876
876
|
{
|
|
877
877
|
role: "slider",
|
|
878
878
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
879
|
+
"aria-valuenow": G,
|
|
880
880
|
"aria-valuemin": 0,
|
|
881
881
|
"aria-valuemax": 100,
|
|
882
882
|
tabIndex: 0,
|
|
@@ -885,21 +885,21 @@ const sa = (e) => {
|
|
|
885
885
|
onMouseDown: j,
|
|
886
886
|
onTouchStart: j,
|
|
887
887
|
onClick: (x) => x.stopPropagation(),
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
888
|
+
onMouseEnter: () => O(!0),
|
|
889
|
+
onMouseLeave: () => O(!1),
|
|
890
890
|
onKeyDown: (x) => {
|
|
891
|
-
x.key === "ArrowRight" &&
|
|
891
|
+
x.key === "ArrowRight" && D(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && D(Math.max(0, p - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
897
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${E || A ? "h-1.5" : "h-1"}`,
|
|
898
898
|
children: /* @__PURE__ */ n(
|
|
899
899
|
"div",
|
|
900
900
|
{
|
|
901
901
|
className: "h-full rounded-full bg-white",
|
|
902
|
-
style: { width: `${
|
|
902
|
+
style: { width: `${G}%` }
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
}
|
|
@@ -907,8 +907,8 @@ const sa = (e) => {
|
|
|
907
907
|
/* @__PURE__ */ n(
|
|
908
908
|
"div",
|
|
909
909
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
911
|
-
style: { left: `${
|
|
910
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${E || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${G}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
]
|
|
@@ -927,7 +927,7 @@ const sa = (e) => {
|
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
928
|
containedImage: l = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const o = ie(e), [d, u] =
|
|
930
|
+
const o = ie(e), [d, u] = $(!1);
|
|
931
931
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
932
932
|
aa,
|
|
933
933
|
{
|
|
@@ -1012,13 +1012,13 @@ const sa = (e) => {
|
|
|
1012
1012
|
rootRef: g,
|
|
1013
1013
|
"data-testid": m
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1015
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
ref: g,
|
|
1020
1020
|
"data-testid": m,
|
|
1021
|
-
className:
|
|
1021
|
+
className: k(
|
|
1022
1022
|
"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)]",
|
|
1023
1023
|
f ? "bg-[#121110]" : "bg-white"
|
|
1024
1024
|
),
|
|
@@ -1030,17 +1030,17 @@ const sa = (e) => {
|
|
|
1030
1030
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1031
1031
|
"p",
|
|
1032
1032
|
{
|
|
1033
|
-
className:
|
|
1033
|
+
className: k("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1035
|
+
"text-white/30": f && b,
|
|
1036
|
+
"text-white": f && !b
|
|
1037
1037
|
}),
|
|
1038
1038
|
children: c
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
1042
|
ce(r, {
|
|
1043
|
-
className:
|
|
1043
|
+
className: k(
|
|
1044
1044
|
"size-5 shrink-0",
|
|
1045
1045
|
f ? "text-white/55" : "text-black/55"
|
|
1046
1046
|
),
|
|
@@ -1049,7 +1049,7 @@ const sa = (e) => {
|
|
|
1049
1049
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1050
1050
|
"span",
|
|
1051
1051
|
{
|
|
1052
|
-
className:
|
|
1052
|
+
className: k(
|
|
1053
1053
|
"text-xs font-medium",
|
|
1054
1054
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1055
|
),
|
|
@@ -1086,7 +1086,7 @@ function da(e) {
|
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
1088
|
const et = ({ attachment: e, isMyMessage: t }) => {
|
|
1089
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ h(
|
|
1089
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ h(V.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
1092
1092
|
{
|
|
@@ -1132,7 +1132,7 @@ const ma = ({
|
|
|
1132
1132
|
url: e,
|
|
1133
1133
|
filename: t
|
|
1134
1134
|
}) => {
|
|
1135
|
-
const [s, a] =
|
|
1135
|
+
const [s, a] = $(!1);
|
|
1136
1136
|
return /* @__PURE__ */ n(
|
|
1137
1137
|
"button",
|
|
1138
1138
|
{
|
|
@@ -1148,7 +1148,7 @@ const ma = ({
|
|
|
1148
1148
|
},
|
|
1149
1149
|
disabled: s,
|
|
1150
1150
|
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",
|
|
1151
|
-
children: s ? /* @__PURE__ */ n(we, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(we, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(V.Fragment, { children: [
|
|
1152
1152
|
/* @__PURE__ */ n(Ne, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
@@ -1156,15 +1156,15 @@ const ma = ({
|
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
1158
|
function nt(e) {
|
|
1159
|
-
var m, f, c,
|
|
1159
|
+
var m, f, c, b;
|
|
1160
1160
|
const t = (m = e.attachments) == null ? void 0 : m.find(
|
|
1161
|
-
(
|
|
1161
|
+
(N) => N.type === "video" && N.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(N) => N.type === "image" && N.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1166
|
-
), r = (
|
|
1167
|
-
(
|
|
1165
|
+
(N) => N.type === "audio" && N.asset_url
|
|
1166
|
+
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1167
|
+
(N) => N.type === "file" && N.asset_url
|
|
1168
1168
|
), i = t ?? s ?? a ?? r, l = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1169
|
if (!l) return null;
|
|
1170
1170
|
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, u = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1336,10 +1336,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1336
1336
|
if (r) {
|
|
1337
1337
|
const f = (m = e.metadata) == null ? void 0 : m.amount_text;
|
|
1338
1338
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1339
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
1341
|
/* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: b })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
1345
|
const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
@@ -1363,7 +1363,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1363
|
"button",
|
|
1364
1364
|
{
|
|
1365
1365
|
type: "button",
|
|
1366
|
-
className:
|
|
1366
|
+
className: k("message-vote-button focus-ring", {
|
|
1367
1367
|
"message-vote-button--selected": e === "up"
|
|
1368
1368
|
}),
|
|
1369
1369
|
onClick: t,
|
|
@@ -1377,7 +1377,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
1379
1379
|
type: "button",
|
|
1380
|
-
className:
|
|
1380
|
+
className: k("message-vote-button focus-ring", {
|
|
1381
1381
|
"message-vote-button--selected": e === "down"
|
|
1382
1382
|
}),
|
|
1383
1383
|
onClick: s,
|
|
@@ -1403,43 +1403,43 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1403
1403
|
isMessageAIGenerated: m,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1407
|
-
threadList:
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal:
|
|
1412
|
-
MessageActions:
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1406
|
+
renderText: b,
|
|
1407
|
+
threadList: N,
|
|
1408
|
+
viewerLanguage: w
|
|
1409
|
+
} = e, { client: p } = Ke("CustomMessage"), { channel: v } = de("CustomMessage"), { isUnlocking: A, onUnlockClick: T, onFetchSource: E, onDownloadClick: O } = va("LockedAttachment"), [R, L] = $(!1), B = Ln(c.id), { selected: P, voteUp: _, voteDown: M } = Hs(c), {
|
|
1410
|
+
Attachment: y = Dn,
|
|
1411
|
+
EditMessageModal: I = Pn,
|
|
1412
|
+
MessageActions: C,
|
|
1413
|
+
MessageBlocked: z = zn,
|
|
1414
|
+
MessageBouncePrompt: D = On,
|
|
1415
1415
|
MessageDeleted: j = $n,
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: Z = Fn,
|
|
1417
|
+
MessageRepliesCountButton: Q = Bn,
|
|
1418
|
+
ReminderNotification: G = Un,
|
|
1419
1419
|
StreamedMessageText: x = jn,
|
|
1420
1420
|
PinIndicator: S
|
|
1421
1421
|
} = Gt("CustomMessage"), U = Vn(c), H = Gn(c), q = re(
|
|
1422
1422
|
() => m == null ? void 0 : m(c),
|
|
1423
1423
|
[m, c]
|
|
1424
|
-
),
|
|
1424
|
+
), F = re(() => {
|
|
1425
1425
|
const ge = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...ge] : ge;
|
|
1426
1426
|
if (!Me(c)) return Se;
|
|
1427
1427
|
const Mt = Se.filter((Rt) => !("type" in Rt) || !rn(Rt));
|
|
1428
1428
|
return Mt.length === Se.length ? Se : Mt;
|
|
1429
1429
|
}, [c]), W = re(() => {
|
|
1430
|
-
const ge = Zt({ message: c, viewerLanguage:
|
|
1430
|
+
const ge = Zt({ message: c, viewerLanguage: w });
|
|
1431
1431
|
return ge === c.text ? c : { ...c, text: ge };
|
|
1432
|
-
}, [c,
|
|
1432
|
+
}, [c, w]);
|
|
1433
1433
|
if (Hn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
1436
|
return /* @__PURE__ */ n(j, { message: c });
|
|
1437
1437
|
if (Yn(c))
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const
|
|
1438
|
+
return /* @__PURE__ */ n(z, {});
|
|
1439
|
+
const X = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((bt = c.error) == null ? void 0 : bt.status) !== 403, he = qn(c);
|
|
1440
1440
|
let ee;
|
|
1441
1441
|
me ? ee = () => u(c) : he && (ee = () => L(!0));
|
|
1442
|
-
const te = f(), le =
|
|
1442
|
+
const te = f(), le = k(
|
|
1443
1443
|
"str-chat__message str-chat__message-simple",
|
|
1444
1444
|
`str-chat__message--${c.type}`,
|
|
1445
1445
|
`str-chat__message--${c.status}`,
|
|
@@ -1451,25 +1451,25 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
1452
|
"str-chat__message--with-reactions": H,
|
|
1453
1453
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((vt = c == null ? void 0 : c.error) == null ? void 0 : vt.status) !== 403,
|
|
1454
|
-
"str-chat__message-with-thread-link":
|
|
1454
|
+
"str-chat__message-with-thread-link": X || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1457
|
"str-chat__virtual-message__wrapper--group": l
|
|
1458
1458
|
}
|
|
1459
|
-
), ht = c.poll_id &&
|
|
1459
|
+
), ht = c.poll_id && p.polls.fromState(c.poll_id), ft = ya(c), fe = Me(c), gt = _a(c), Oe = !!(F != null && F.length && !c.quoted_message), pt = fe && te && Oe;
|
|
1460
1460
|
return /* @__PURE__ */ h(se, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
I,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1467
|
+
R && /* @__PURE__ */ n(
|
|
1468
1468
|
Wn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1470
|
+
MessageBouncePrompt: D,
|
|
1471
1471
|
onClose: () => L(!1),
|
|
1472
|
-
open:
|
|
1472
|
+
open: R
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
@@ -1480,7 +1480,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1480
1480
|
"data-dd-privacy": "mask",
|
|
1481
1481
|
children: [
|
|
1482
1482
|
S && /* @__PURE__ */ n(S, {}),
|
|
1483
|
-
!!
|
|
1483
|
+
!!B && /* @__PURE__ */ n(G, { reminder: B }),
|
|
1484
1484
|
c.user && /* @__PURE__ */ n(
|
|
1485
1485
|
ne,
|
|
1486
1486
|
{
|
|
@@ -1496,7 +1496,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1496
1496
|
/* @__PURE__ */ n(
|
|
1497
1497
|
"div",
|
|
1498
1498
|
{
|
|
1499
|
-
className:
|
|
1499
|
+
className: k("str-chat__message-inner", {
|
|
1500
1500
|
"str-chat__simple-message--error-failed": me || he
|
|
1501
1501
|
}),
|
|
1502
1502
|
"data-testid": "message-inner",
|
|
@@ -1512,7 +1512,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1512
1512
|
},
|
|
1513
1513
|
children: gt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1514
1514
|
te ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1515
|
-
|
|
1515
|
+
C && /* @__PURE__ */ n(C, {}),
|
|
1516
1516
|
/* @__PURE__ */ n(
|
|
1517
1517
|
Bt.Sent,
|
|
1518
1518
|
{
|
|
@@ -1523,7 +1523,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1523
1523
|
detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
|
|
1524
1524
|
paymentStatus: (kt = c.metadata) == null ? void 0 : kt.payment_status,
|
|
1525
1525
|
onPreviewClick: () => T == null ? void 0 : T(c, v),
|
|
1526
|
-
onFetchSource: async () => await (
|
|
1526
|
+
onFetchSource: async () => await (E == null ? void 0 : E(c, v))
|
|
1527
1527
|
}
|
|
1528
1528
|
)
|
|
1529
1529
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1536,19 +1536,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1536
1536
|
amountText: (St = c.metadata) == null ? void 0 : St.amount_text,
|
|
1537
1537
|
detail: (Tt = c.metadata) == null ? void 0 : Tt.attachment_detail,
|
|
1538
1538
|
paymentStatus: (At = c.metadata) == null ? void 0 : At.payment_status,
|
|
1539
|
-
isUnlocking:
|
|
1539
|
+
isUnlocking: A(c.id),
|
|
1540
1540
|
onUnlockClick: () => T == null ? void 0 : T(c, v),
|
|
1541
|
-
onFetchSource: async () => await (
|
|
1542
|
-
onDownloadClick: () =>
|
|
1541
|
+
onFetchSource: async () => await (E == null ? void 0 : E(c, v)),
|
|
1542
|
+
onDownloadClick: () => O == null ? void 0 : O(c, v)
|
|
1543
1543
|
}
|
|
1544
1544
|
),
|
|
1545
|
-
|
|
1545
|
+
C && /* @__PURE__ */ n(C, {})
|
|
1546
1546
|
] }),
|
|
1547
1547
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1548
1548
|
Dt,
|
|
1549
1549
|
{
|
|
1550
1550
|
message: W,
|
|
1551
|
-
renderText:
|
|
1551
|
+
renderText: b
|
|
1552
1552
|
}
|
|
1553
1553
|
) })
|
|
1554
1554
|
] }) : ft ? (
|
|
@@ -1564,24 +1564,24 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1564
1564
|
}
|
|
1565
1565
|
),
|
|
1566
1566
|
ht && /* @__PURE__ */ n(Xn, { poll: ht }),
|
|
1567
|
-
|
|
1568
|
-
|
|
1567
|
+
F != null && F.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1568
|
+
y,
|
|
1569
1569
|
{
|
|
1570
1570
|
actionHandler: o,
|
|
1571
|
-
attachments:
|
|
1571
|
+
attachments: F
|
|
1572
1572
|
}
|
|
1573
1573
|
) : null,
|
|
1574
1574
|
q ? /* @__PURE__ */ n(
|
|
1575
1575
|
x,
|
|
1576
1576
|
{
|
|
1577
1577
|
message: W,
|
|
1578
|
-
renderText:
|
|
1578
|
+
renderText: b
|
|
1579
1579
|
}
|
|
1580
1580
|
) : /* @__PURE__ */ n(
|
|
1581
1581
|
Dt,
|
|
1582
1582
|
{
|
|
1583
1583
|
message: W,
|
|
1584
|
-
renderText:
|
|
1584
|
+
renderText: b
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
1587
1587
|
/* @__PURE__ */ n(Kn, {})
|
|
@@ -1600,26 +1600,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1600
1600
|
s && fe && /* @__PURE__ */ n(
|
|
1601
1601
|
ka,
|
|
1602
1602
|
{
|
|
1603
|
-
selected:
|
|
1604
|
-
onVoteUp:
|
|
1603
|
+
selected: P,
|
|
1604
|
+
onVoteUp: _,
|
|
1605
1605
|
onVoteDown: M
|
|
1606
1606
|
}
|
|
1607
1607
|
)
|
|
1608
1608
|
] }),
|
|
1609
|
-
|
|
1610
|
-
|
|
1609
|
+
X && /* @__PURE__ */ n(
|
|
1610
|
+
Q,
|
|
1611
1611
|
{
|
|
1612
1612
|
onClick: d,
|
|
1613
1613
|
reply_count: c.reply_count
|
|
1614
1614
|
}
|
|
1615
1615
|
),
|
|
1616
|
-
ue && /* @__PURE__ */ n(
|
|
1616
|
+
ue && /* @__PURE__ */ n(Z, {})
|
|
1617
1617
|
]
|
|
1618
1618
|
},
|
|
1619
1619
|
c.id
|
|
1620
1620
|
)
|
|
1621
1621
|
] });
|
|
1622
|
-
}, Ea =
|
|
1622
|
+
}, Ea = V.memo(
|
|
1623
1623
|
Ca,
|
|
1624
1624
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Rn(e, t)
|
|
1625
1625
|
), Ia = (e) => {
|
|
@@ -1721,7 +1721,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1721
1721
|
},
|
|
1722
1722
|
r.og_scrape_url
|
|
1723
1723
|
)) }) : null;
|
|
1724
|
-
}, st =
|
|
1724
|
+
}, st = V.createContext(!1), Ci = () => _e(st), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1725
1725
|
"button",
|
|
1726
1726
|
{
|
|
1727
1727
|
...s,
|
|
@@ -1928,16 +1928,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1928
1928
|
Fe.Generating,
|
|
1929
1929
|
Fe.ExternalSources
|
|
1930
1930
|
]), qa = ({ threadList: e }) => {
|
|
1931
|
-
var
|
|
1931
|
+
var b, N;
|
|
1932
1932
|
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = rs(), { aiState: l } = is(t), o = _e(un);
|
|
1933
1933
|
if (!e && o && Ya.has(l)) {
|
|
1934
|
-
const
|
|
1934
|
+
const w = Wa(t, (b = r.user) == null ? void 0 : b.id);
|
|
1935
1935
|
return /* @__PURE__ */ n(
|
|
1936
1936
|
Vt,
|
|
1937
1937
|
{
|
|
1938
|
-
avatarId: (
|
|
1939
|
-
avatarName: (
|
|
1940
|
-
avatarImage:
|
|
1938
|
+
avatarId: (w == null ? void 0 : w.id) ?? "ai-agent",
|
|
1939
|
+
avatarName: (w == null ? void 0 : w.name) ?? (w == null ? void 0 : w.id) ?? "Agent",
|
|
1940
|
+
avatarImage: w == null ? void 0 : w.image,
|
|
1941
1941
|
testId: "typing-indicator-ai"
|
|
1942
1942
|
}
|
|
1943
1943
|
);
|
|
@@ -1945,19 +1945,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1945
1945
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1946
1946
|
return null;
|
|
1947
1947
|
const u = e ? [] : Object.values(i).filter(
|
|
1948
|
-
({ parent_id:
|
|
1948
|
+
({ parent_id: w, user: p }) => {
|
|
1949
1949
|
var v;
|
|
1950
|
-
return (
|
|
1950
|
+
return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && !w;
|
|
1951
1951
|
}
|
|
1952
1952
|
), g = e ? Object.values(i).filter(
|
|
1953
|
-
({ parent_id:
|
|
1953
|
+
({ parent_id: w, user: p }) => {
|
|
1954
1954
|
var v;
|
|
1955
|
-
return (
|
|
1955
|
+
return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && w === (a == null ? void 0 : a.id);
|
|
1956
1956
|
}
|
|
1957
1957
|
) : [], m = e ? g : u;
|
|
1958
1958
|
if (!m.length)
|
|
1959
1959
|
return null;
|
|
1960
|
-
const f = (
|
|
1960
|
+
const f = (N = m[0]) == null ? void 0 : N.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1961
1961
|
return /* @__PURE__ */ n(
|
|
1962
1962
|
Vt,
|
|
1963
1963
|
{
|
|
@@ -2023,7 +2023,7 @@ function Wa(e, t) {
|
|
|
2023
2023
|
const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2024
2024
|
"div",
|
|
2025
2025
|
{
|
|
2026
|
-
className:
|
|
2026
|
+
className: k("flex items-center justify-center h-full", e),
|
|
2027
2027
|
children: [
|
|
2028
2028
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2029
2029
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2063,7 +2063,7 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2063
2063
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2064
2064
|
]
|
|
2065
2065
|
}
|
|
2066
|
-
), Re =
|
|
2066
|
+
), Re = V.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2067
2067
|
/* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
|
|
2068
2068
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2069
2069
|
] }) }));
|
|
@@ -2083,29 +2083,29 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2083
2083
|
onReportParticipantClick: m,
|
|
2084
2084
|
customChannelActions: f,
|
|
2085
2085
|
renderChannelActions: c,
|
|
2086
|
-
showChannelInfo:
|
|
2087
|
-
onParticipantNameClick:
|
|
2088
|
-
renderHeaderTitleBadges:
|
|
2086
|
+
showChannelInfo: b = !0,
|
|
2087
|
+
onParticipantNameClick: N,
|
|
2088
|
+
renderHeaderTitleBadges: w
|
|
2089
2089
|
}) => {
|
|
2090
|
-
var
|
|
2091
|
-
const { channel:
|
|
2092
|
-
var
|
|
2093
|
-
const j = (
|
|
2094
|
-
return j ? Object.values(((
|
|
2090
|
+
var _, M, y, I, C, z, D;
|
|
2091
|
+
const { channel: p } = de(), v = V.useMemo(() => {
|
|
2092
|
+
var Q, G;
|
|
2093
|
+
const j = (Q = p._client) == null ? void 0 : Q.userID;
|
|
2094
|
+
return j ? Object.values(((G = p.state) == null ? void 0 : G.members) || {}).find(
|
|
2095
2095
|
(x) => {
|
|
2096
2096
|
var S;
|
|
2097
2097
|
return ((S = x.user) == null ? void 0 : S.id) && x.user.id !== j;
|
|
2098
2098
|
}
|
|
2099
2099
|
) : void 0;
|
|
2100
|
-
}, [(
|
|
2101
|
-
channel:
|
|
2100
|
+
}, [(_ = p._client) == null ? void 0 : _.userID, (M = p.state) == null ? void 0 : M.members]), A = Jt(v == null ? void 0 : v.user), T = (y = v == null ? void 0 : v.user) == null ? void 0 : y.image, E = Kt(p), O = w == null ? void 0 : w({
|
|
2101
|
+
channel: p,
|
|
2102
2102
|
participant: v
|
|
2103
|
-
}),
|
|
2104
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
2105
|
-
|
|
2106
|
-
] }),
|
|
2103
|
+
}), R = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", L = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", B = /* @__PURE__ */ h(se, { children: [
|
|
2104
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2105
|
+
O && /* @__PURE__ */ n("span", { className: "shrink-0", children: O })
|
|
2106
|
+
] }), P = async () => {
|
|
2107
2107
|
try {
|
|
2108
|
-
|
|
2108
|
+
E ? await p.unpin() : await p.pin();
|
|
2109
2109
|
} catch (j) {
|
|
2110
2110
|
console.error(
|
|
2111
2111
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -2118,7 +2118,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2118
2118
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2119
2119
|
"button",
|
|
2120
2120
|
{
|
|
2121
|
-
className:
|
|
2121
|
+
className: k(
|
|
2122
2122
|
oe,
|
|
2123
2123
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2124
2124
|
),
|
|
@@ -2134,30 +2134,30 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2134
2134
|
{
|
|
2135
2135
|
className: "flex flex-col gap-1 items-center",
|
|
2136
2136
|
"data-dd-privacy": "mask",
|
|
2137
|
-
children:
|
|
2137
|
+
children: N ? /* @__PURE__ */ h(
|
|
2138
2138
|
"button",
|
|
2139
2139
|
{
|
|
2140
2140
|
type: "button",
|
|
2141
|
-
onClick:
|
|
2142
|
-
"aria-label": `View details for ${
|
|
2143
|
-
className:
|
|
2144
|
-
|
|
2141
|
+
onClick: N,
|
|
2142
|
+
"aria-label": `View details for ${A}`,
|
|
2143
|
+
className: k(
|
|
2144
|
+
R,
|
|
2145
2145
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2146
2146
|
),
|
|
2147
2147
|
children: [
|
|
2148
2148
|
/* @__PURE__ */ n(
|
|
2149
2149
|
ne,
|
|
2150
2150
|
{
|
|
2151
|
-
id: ((
|
|
2152
|
-
name:
|
|
2151
|
+
id: ((I = v == null ? void 0 : v.user) == null ? void 0 : I.id) || p.id || "unknown",
|
|
2152
|
+
name: A,
|
|
2153
2153
|
image: T,
|
|
2154
|
-
starred: s &&
|
|
2154
|
+
starred: s && E,
|
|
2155
2155
|
dmAgentEnabled: a,
|
|
2156
2156
|
size: 48
|
|
2157
2157
|
}
|
|
2158
2158
|
),
|
|
2159
2159
|
/* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
2160
|
-
|
|
2160
|
+
B,
|
|
2161
2161
|
/* @__PURE__ */ n(ve, { className: "size-3 shrink-0", weight: "bold" })
|
|
2162
2162
|
] }),
|
|
2163
2163
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
@@ -2166,20 +2166,20 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2166
2166
|
] })
|
|
2167
2167
|
]
|
|
2168
2168
|
}
|
|
2169
|
-
) : /* @__PURE__ */ h("div", { className:
|
|
2169
|
+
) : /* @__PURE__ */ h("div", { className: R, children: [
|
|
2170
2170
|
/* @__PURE__ */ n(
|
|
2171
2171
|
ne,
|
|
2172
2172
|
{
|
|
2173
|
-
id: ((
|
|
2174
|
-
name:
|
|
2173
|
+
id: ((C = v == null ? void 0 : v.user) == null ? void 0 : C.id) || p.id || "unknown",
|
|
2174
|
+
name: A,
|
|
2175
2175
|
image: T,
|
|
2176
|
-
starred: s &&
|
|
2176
|
+
starred: s && E,
|
|
2177
2177
|
dmAgentEnabled: a,
|
|
2178
2178
|
size: 48
|
|
2179
2179
|
}
|
|
2180
2180
|
),
|
|
2181
2181
|
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
2182
|
-
|
|
2182
|
+
B,
|
|
2183
2183
|
/* @__PURE__ */ n(
|
|
2184
2184
|
ve,
|
|
2185
2185
|
{
|
|
@@ -2200,25 +2200,25 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2200
2200
|
"button",
|
|
2201
2201
|
{
|
|
2202
2202
|
className: oe,
|
|
2203
|
-
onClick:
|
|
2203
|
+
onClick: P,
|
|
2204
2204
|
type: "button",
|
|
2205
|
-
"aria-label":
|
|
2205
|
+
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
2206
2206
|
children: /* @__PURE__ */ n(
|
|
2207
2207
|
Ge,
|
|
2208
2208
|
{
|
|
2209
|
-
className:
|
|
2210
|
-
"text-yellow-600":
|
|
2211
|
-
"text-black/90": !
|
|
2209
|
+
className: k("size-5", {
|
|
2210
|
+
"text-yellow-600": E,
|
|
2211
|
+
"text-black/90": !E
|
|
2212
2212
|
}),
|
|
2213
|
-
weight:
|
|
2213
|
+
weight: E ? "duotone" : "regular"
|
|
2214
2214
|
}
|
|
2215
2215
|
)
|
|
2216
2216
|
}
|
|
2217
2217
|
),
|
|
2218
|
-
|
|
2218
|
+
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2219
2219
|
Ft,
|
|
2220
2220
|
{
|
|
2221
|
-
channel:
|
|
2221
|
+
channel: p,
|
|
2222
2222
|
participant: v,
|
|
2223
2223
|
showDeleteConversation: l,
|
|
2224
2224
|
showBlockParticipant: o,
|
|
@@ -2229,7 +2229,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2229
2229
|
onBlockParticipantClick: g,
|
|
2230
2230
|
onReportParticipantClick: m,
|
|
2231
2231
|
customChannelActions: f,
|
|
2232
|
-
triggerClassName:
|
|
2232
|
+
triggerClassName: k(oe, "bg-[#F1F0EE]")
|
|
2233
2233
|
}
|
|
2234
2234
|
))
|
|
2235
2235
|
] })
|
|
@@ -2239,7 +2239,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2239
2239
|
t && e && /* @__PURE__ */ n(
|
|
2240
2240
|
"button",
|
|
2241
2241
|
{
|
|
2242
|
-
className:
|
|
2242
|
+
className: k(
|
|
2243
2243
|
oe,
|
|
2244
2244
|
"messaging-channel-view-back-button-desktop"
|
|
2245
2245
|
),
|
|
@@ -2249,13 +2249,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2249
2249
|
children: /* @__PURE__ */ n(zt, { className: "size-5 text-black/90" })
|
|
2250
2250
|
}
|
|
2251
2251
|
),
|
|
2252
|
-
|
|
2252
|
+
N ? /* @__PURE__ */ h(
|
|
2253
2253
|
"button",
|
|
2254
2254
|
{
|
|
2255
2255
|
type: "button",
|
|
2256
|
-
onClick:
|
|
2257
|
-
"aria-label": `View details for ${
|
|
2258
|
-
className:
|
|
2256
|
+
onClick: N,
|
|
2257
|
+
"aria-label": `View details for ${A}`,
|
|
2258
|
+
className: k(
|
|
2259
2259
|
L,
|
|
2260
2260
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2261
2261
|
),
|
|
@@ -2263,17 +2263,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2263
2263
|
/* @__PURE__ */ n(
|
|
2264
2264
|
ne,
|
|
2265
2265
|
{
|
|
2266
|
-
id: ((
|
|
2267
|
-
name:
|
|
2266
|
+
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || p.id || "unknown",
|
|
2267
|
+
name: A,
|
|
2268
2268
|
image: T,
|
|
2269
|
-
starred: s &&
|
|
2269
|
+
starred: s && E,
|
|
2270
2270
|
dmAgentEnabled: a,
|
|
2271
2271
|
size: 48
|
|
2272
2272
|
}
|
|
2273
2273
|
),
|
|
2274
2274
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2275
2275
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2276
|
-
|
|
2276
|
+
B,
|
|
2277
2277
|
/* @__PURE__ */ n(ve, { className: "size-4 shrink-0", weight: "bold" })
|
|
2278
2278
|
] }),
|
|
2279
2279
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
@@ -2287,17 +2287,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2287
2287
|
/* @__PURE__ */ n(
|
|
2288
2288
|
ne,
|
|
2289
2289
|
{
|
|
2290
|
-
id: ((
|
|
2291
|
-
name:
|
|
2290
|
+
id: ((D = v == null ? void 0 : v.user) == null ? void 0 : D.id) || p.id || "unknown",
|
|
2291
|
+
name: A,
|
|
2292
2292
|
image: T,
|
|
2293
|
-
starred: s &&
|
|
2293
|
+
starred: s && E,
|
|
2294
2294
|
dmAgentEnabled: a,
|
|
2295
2295
|
size: 48
|
|
2296
2296
|
}
|
|
2297
2297
|
),
|
|
2298
2298
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2299
2299
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2300
|
-
|
|
2300
|
+
B,
|
|
2301
2301
|
/* @__PURE__ */ n(
|
|
2302
2302
|
ve,
|
|
2303
2303
|
{
|
|
@@ -2318,25 +2318,25 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2318
2318
|
"button",
|
|
2319
2319
|
{
|
|
2320
2320
|
className: oe,
|
|
2321
|
-
onClick:
|
|
2321
|
+
onClick: P,
|
|
2322
2322
|
type: "button",
|
|
2323
|
-
"aria-label":
|
|
2323
|
+
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
2324
2324
|
children: /* @__PURE__ */ n(
|
|
2325
2325
|
Ge,
|
|
2326
2326
|
{
|
|
2327
|
-
className:
|
|
2328
|
-
"text-yellow-600":
|
|
2329
|
-
"text-black/90": !
|
|
2327
|
+
className: k("size-6", {
|
|
2328
|
+
"text-yellow-600": E,
|
|
2329
|
+
"text-black/90": !E
|
|
2330
2330
|
}),
|
|
2331
|
-
weight:
|
|
2331
|
+
weight: E ? "duotone" : "regular"
|
|
2332
2332
|
}
|
|
2333
2333
|
)
|
|
2334
2334
|
}
|
|
2335
2335
|
),
|
|
2336
|
-
|
|
2336
|
+
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2337
2337
|
Ft,
|
|
2338
2338
|
{
|
|
2339
|
-
channel:
|
|
2339
|
+
channel: p,
|
|
2340
2340
|
participant: v,
|
|
2341
2341
|
showDeleteConversation: l,
|
|
2342
2342
|
showBlockParticipant: o,
|
|
@@ -2368,56 +2368,56 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2368
2368
|
showBlockParticipant: m = !0,
|
|
2369
2369
|
showReportParticipant: f = !0,
|
|
2370
2370
|
composerDisabled: c = !1,
|
|
2371
|
-
composerDisabledReason:
|
|
2372
|
-
showStarButton:
|
|
2373
|
-
chatbotVotingEnabled:
|
|
2374
|
-
renderChannelBanner:
|
|
2371
|
+
composerDisabledReason: b,
|
|
2372
|
+
showStarButton: N = !1,
|
|
2373
|
+
chatbotVotingEnabled: w = !1,
|
|
2374
|
+
renderChannelBanner: p,
|
|
2375
2375
|
renderHeaderTitleBadges: v,
|
|
2376
|
-
customChannelActions:
|
|
2376
|
+
customChannelActions: A,
|
|
2377
2377
|
renderChannelActions: T,
|
|
2378
|
-
renderMessage:
|
|
2379
|
-
dmAgentEnabled:
|
|
2380
|
-
viewerLanguage:
|
|
2378
|
+
renderMessage: E,
|
|
2379
|
+
dmAgentEnabled: O = !1,
|
|
2380
|
+
viewerLanguage: R,
|
|
2381
2381
|
showChannelInfo: L = !0,
|
|
2382
|
-
onParticipantNameClick:
|
|
2383
|
-
composerInput:
|
|
2382
|
+
onParticipantNameClick: B,
|
|
2383
|
+
composerInput: P
|
|
2384
2384
|
}) => {
|
|
2385
|
-
var j,
|
|
2386
|
-
const { channel:
|
|
2387
|
-
var q,
|
|
2388
|
-
const U = (q =
|
|
2389
|
-
return U ? Object.values(((
|
|
2385
|
+
var j, Z, Q, G, x, S;
|
|
2386
|
+
const { channel: _ } = de(), M = V.useMemo(() => {
|
|
2387
|
+
var q, F;
|
|
2388
|
+
const U = (q = _._client) == null ? void 0 : q.userID;
|
|
2389
|
+
return U ? Object.values(((F = _.state) == null ? void 0 : F.members) || {}).find(
|
|
2390
2390
|
(W) => {
|
|
2391
|
-
var
|
|
2392
|
-
return ((
|
|
2391
|
+
var X;
|
|
2392
|
+
return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== U;
|
|
2393
2393
|
}
|
|
2394
2394
|
) : void 0;
|
|
2395
|
-
}, [(j =
|
|
2396
|
-
var q,
|
|
2397
|
-
const U = (q =
|
|
2398
|
-
return U ? Object.values(((
|
|
2399
|
-
var
|
|
2400
|
-
return ((
|
|
2395
|
+
}, [(j = _._client) == null ? void 0 : j.userID, (Z = _.state) == null ? void 0 : Z.members]), y = V.useMemo(() => {
|
|
2396
|
+
var q, F;
|
|
2397
|
+
const U = (q = _._client) == null ? void 0 : q.userID;
|
|
2398
|
+
return U ? Object.values(((F = _.state) == null ? void 0 : F.members) || {}).find((W) => {
|
|
2399
|
+
var X;
|
|
2400
|
+
return ((X = W.user) == null ? void 0 : X.id) === U;
|
|
2401
2401
|
}) : void 0;
|
|
2402
|
-
}, [(
|
|
2402
|
+
}, [(Q = _._client) == null ? void 0 : Q.userID, (G = _.state) == null ? void 0 : G.members]), I = ((x = y == null ? void 0 : y.user) == null ? void 0 : x.is_account) ?? (y == null ? void 0 : y.is_account), C = ((S = M == null ? void 0 : M.user) == null ? void 0 : S.is_account) ?? (M == null ? void 0 : M.is_account), z = O && I === !1 && C === !0, D = J(
|
|
2403
2403
|
(U) => {
|
|
2404
2404
|
const { message: H } = ye("ChannelView"), q = /* @__PURE__ */ n(
|
|
2405
2405
|
Ia,
|
|
2406
2406
|
{
|
|
2407
2407
|
...U,
|
|
2408
|
-
chatbotVotingEnabled:
|
|
2409
|
-
viewerLanguage:
|
|
2408
|
+
chatbotVotingEnabled: w,
|
|
2409
|
+
viewerLanguage: R
|
|
2410
2410
|
}
|
|
2411
2411
|
);
|
|
2412
|
-
return !
|
|
2412
|
+
return !E || !H ? q : E(q, H);
|
|
2413
2413
|
},
|
|
2414
|
-
[
|
|
2414
|
+
[w, E, R]
|
|
2415
2415
|
);
|
|
2416
2416
|
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2417
2417
|
os,
|
|
2418
2418
|
{
|
|
2419
2419
|
overrides: {
|
|
2420
|
-
Message:
|
|
2420
|
+
Message: D,
|
|
2421
2421
|
MessageActions: Aa
|
|
2422
2422
|
},
|
|
2423
2423
|
children: /* @__PURE__ */ h(cs, { children: [
|
|
@@ -2427,8 +2427,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2427
2427
|
onBack: e,
|
|
2428
2428
|
showBackButton: t,
|
|
2429
2429
|
showChannelInfo: L,
|
|
2430
|
-
showStarButton:
|
|
2431
|
-
dmAgentEnabled:
|
|
2430
|
+
showStarButton: N,
|
|
2431
|
+
dmAgentEnabled: z,
|
|
2432
2432
|
onLeaveConversation: i,
|
|
2433
2433
|
onBlockParticipant: l,
|
|
2434
2434
|
showDeleteConversation: o,
|
|
@@ -2437,13 +2437,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2437
2437
|
onDeleteConversationClick: d,
|
|
2438
2438
|
onBlockParticipantClick: u,
|
|
2439
2439
|
onReportParticipantClick: g,
|
|
2440
|
-
customChannelActions:
|
|
2440
|
+
customChannelActions: A,
|
|
2441
2441
|
renderChannelActions: T,
|
|
2442
|
-
onParticipantNameClick:
|
|
2442
|
+
onParticipantNameClick: B,
|
|
2443
2443
|
renderHeaderTitleBadges: v
|
|
2444
2444
|
}
|
|
2445
2445
|
) }, "lt-channel-header"),
|
|
2446
|
-
|
|
2446
|
+
p ? /* @__PURE__ */ n(V.Fragment, { children: p() }, "lt-channel-banner") : null,
|
|
2447
2447
|
/* @__PURE__ */ n(
|
|
2448
2448
|
"div",
|
|
2449
2449
|
{
|
|
@@ -2452,24 +2452,24 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2452
2452
|
},
|
|
2453
2453
|
"lt-channel-message-list"
|
|
2454
2454
|
),
|
|
2455
|
-
r ? /* @__PURE__ */ n(
|
|
2455
|
+
r ? /* @__PURE__ */ n(V.Fragment, { children: r(_) }, "lt-channel-conversation-footer") : null,
|
|
2456
2456
|
/* @__PURE__ */ n(
|
|
2457
2457
|
za,
|
|
2458
2458
|
{
|
|
2459
2459
|
...s && {
|
|
2460
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2460
|
+
renderActions: () => s == null ? void 0 : s(_)
|
|
2461
2461
|
},
|
|
2462
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2462
|
+
renderFooter: () => a == null ? void 0 : a(_),
|
|
2463
2463
|
disabled: c,
|
|
2464
|
-
disabledReason:
|
|
2465
|
-
composerInput:
|
|
2464
|
+
disabledReason: b,
|
|
2465
|
+
composerInput: P
|
|
2466
2466
|
},
|
|
2467
2467
|
"lt-channel-message-input"
|
|
2468
2468
|
)
|
|
2469
2469
|
] })
|
|
2470
2470
|
}
|
|
2471
2471
|
) });
|
|
2472
|
-
}, mn =
|
|
2472
|
+
}, mn = V.memo(
|
|
2473
2473
|
({
|
|
2474
2474
|
channel: e,
|
|
2475
2475
|
onBack: t,
|
|
@@ -2485,64 +2485,64 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2485
2485
|
onDeleteConversationClick: m,
|
|
2486
2486
|
onBlockParticipantClick: f,
|
|
2487
2487
|
onReportParticipantClick: c,
|
|
2488
|
-
showBlockParticipant:
|
|
2489
|
-
showReportParticipant:
|
|
2490
|
-
composerDisabled:
|
|
2491
|
-
composerDisabledReason:
|
|
2488
|
+
showBlockParticipant: b = !0,
|
|
2489
|
+
showReportParticipant: N = !0,
|
|
2490
|
+
composerDisabled: w = !1,
|
|
2491
|
+
composerDisabledReason: p,
|
|
2492
2492
|
dmAgentEnabled: v,
|
|
2493
|
-
messageMetadata:
|
|
2493
|
+
messageMetadata: A,
|
|
2494
2494
|
onMessageSent: T,
|
|
2495
|
-
showStarButton:
|
|
2496
|
-
chatbotVotingEnabled:
|
|
2497
|
-
renderChannelBanner:
|
|
2495
|
+
showStarButton: E = !1,
|
|
2496
|
+
chatbotVotingEnabled: O = !1,
|
|
2497
|
+
renderChannelBanner: R,
|
|
2498
2498
|
renderHeaderTitleBadges: L,
|
|
2499
|
-
customChannelActions:
|
|
2500
|
-
renderChannelActions:
|
|
2501
|
-
renderMessage:
|
|
2499
|
+
customChannelActions: B,
|
|
2500
|
+
renderChannelActions: P,
|
|
2501
|
+
renderMessage: _,
|
|
2502
2502
|
onMessageLinkClick: M,
|
|
2503
|
-
sendButton:
|
|
2504
|
-
attachmentPreviewList:
|
|
2505
|
-
viewerLanguage:
|
|
2506
|
-
showChannelInfo:
|
|
2507
|
-
onParticipantNameClick:
|
|
2503
|
+
sendButton: y,
|
|
2504
|
+
attachmentPreviewList: I,
|
|
2505
|
+
viewerLanguage: C,
|
|
2506
|
+
showChannelInfo: z = !0,
|
|
2507
|
+
onParticipantNameClick: D,
|
|
2508
2508
|
composerInput: j
|
|
2509
2509
|
}) => {
|
|
2510
|
-
const
|
|
2511
|
-
async (
|
|
2512
|
-
var
|
|
2513
|
-
const U = ((
|
|
2510
|
+
const Z = J(
|
|
2511
|
+
async (G, x, S) => {
|
|
2512
|
+
var X;
|
|
2513
|
+
const U = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0, H = v && !U, q = {
|
|
2514
2514
|
...x,
|
|
2515
2515
|
...H && { silent: !0 },
|
|
2516
|
-
...
|
|
2516
|
+
...A && {
|
|
2517
2517
|
metadata: {
|
|
2518
2518
|
...x.metadata ?? {},
|
|
2519
|
-
...
|
|
2519
|
+
...A
|
|
2520
2520
|
}
|
|
2521
2521
|
}
|
|
2522
|
-
},
|
|
2522
|
+
}, F = {
|
|
2523
2523
|
...S,
|
|
2524
2524
|
...H && { skip_push: !0 }
|
|
2525
|
-
}, W = await e.sendMessage(q,
|
|
2525
|
+
}, W = await e.sendMessage(q, F);
|
|
2526
2526
|
return T == null || T(W), W;
|
|
2527
2527
|
},
|
|
2528
|
-
[e, v,
|
|
2529
|
-
),
|
|
2530
|
-
return
|
|
2528
|
+
[e, v, A, T]
|
|
2529
|
+
), Q = Y(null);
|
|
2530
|
+
return K(() => {
|
|
2531
2531
|
if (!M) return;
|
|
2532
|
-
const
|
|
2533
|
-
if (!
|
|
2532
|
+
const G = Q.current;
|
|
2533
|
+
if (!G) return;
|
|
2534
2534
|
const x = (S) => {
|
|
2535
2535
|
const U = S.target, H = U == null ? void 0 : U.closest("a[href]"), q = H == null ? void 0 : H.getAttribute("href");
|
|
2536
2536
|
if (!q) return;
|
|
2537
|
-
const
|
|
2538
|
-
M(q,
|
|
2537
|
+
const F = H == null ? void 0 : H.closest("[data-message-id]"), W = F == null ? void 0 : F.getAttribute("data-message-id"), X = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
|
|
2538
|
+
M(q, X);
|
|
2539
2539
|
};
|
|
2540
|
-
return
|
|
2540
|
+
return G.addEventListener("click", x), () => G.removeEventListener("click", x);
|
|
2541
2541
|
}, [M, e]), /* @__PURE__ */ n(
|
|
2542
2542
|
"div",
|
|
2543
2543
|
{
|
|
2544
|
-
ref:
|
|
2545
|
-
className:
|
|
2544
|
+
ref: Q,
|
|
2545
|
+
className: k(
|
|
2546
2546
|
"messaging-channel-view h-full flex flex-col",
|
|
2547
2547
|
d
|
|
2548
2548
|
),
|
|
@@ -2555,9 +2555,9 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2555
2555
|
LoadingIndicator: Re,
|
|
2556
2556
|
DateSeparator: Vs,
|
|
2557
2557
|
TypingIndicator: qa,
|
|
2558
|
-
doSendMessageRequest:
|
|
2559
|
-
...
|
|
2560
|
-
...
|
|
2558
|
+
doSendMessageRequest: Z,
|
|
2559
|
+
...y ? { SendButton: y } : {},
|
|
2560
|
+
...I ? { AttachmentPreviewList: I } : {},
|
|
2561
2561
|
children: /* @__PURE__ */ n(
|
|
2562
2562
|
Za,
|
|
2563
2563
|
{
|
|
@@ -2573,21 +2573,21 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2573
2573
|
onDeleteConversationClick: m,
|
|
2574
2574
|
onBlockParticipantClick: f,
|
|
2575
2575
|
onReportParticipantClick: c,
|
|
2576
|
-
showBlockParticipant:
|
|
2577
|
-
showReportParticipant:
|
|
2578
|
-
composerDisabled:
|
|
2579
|
-
composerDisabledReason:
|
|
2580
|
-
showStarButton:
|
|
2576
|
+
showBlockParticipant: b,
|
|
2577
|
+
showReportParticipant: N,
|
|
2578
|
+
composerDisabled: w,
|
|
2579
|
+
composerDisabledReason: p,
|
|
2580
|
+
showStarButton: E,
|
|
2581
2581
|
dmAgentEnabled: v,
|
|
2582
|
-
chatbotVotingEnabled:
|
|
2583
|
-
renderChannelBanner:
|
|
2582
|
+
chatbotVotingEnabled: O,
|
|
2583
|
+
renderChannelBanner: R,
|
|
2584
2584
|
renderHeaderTitleBadges: L,
|
|
2585
|
-
customChannelActions:
|
|
2586
|
-
renderChannelActions:
|
|
2587
|
-
renderMessage:
|
|
2588
|
-
viewerLanguage:
|
|
2589
|
-
showChannelInfo:
|
|
2590
|
-
onParticipantNameClick:
|
|
2585
|
+
customChannelActions: B,
|
|
2586
|
+
renderChannelActions: P,
|
|
2587
|
+
renderMessage: _,
|
|
2588
|
+
viewerLanguage: C,
|
|
2589
|
+
showChannelInfo: z,
|
|
2590
|
+
onParticipantNameClick: D,
|
|
2591
2591
|
composerInput: j
|
|
2592
2592
|
}
|
|
2593
2593
|
)
|
|
@@ -2598,7 +2598,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2598
2598
|
}
|
|
2599
2599
|
);
|
|
2600
2600
|
mn.displayName = "ChannelView";
|
|
2601
|
-
const xe =
|
|
2601
|
+
const xe = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2602
2602
|
/* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2603
2603
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2604
2604
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2628,66 +2628,66 @@ const Ei = ({
|
|
|
2628
2628
|
onMessageSent: m,
|
|
2629
2629
|
chatbotVotingEnabled: f = !1,
|
|
2630
2630
|
viewerLanguage: c,
|
|
2631
|
-
renderHeaderTitleBadges:
|
|
2632
|
-
renderChannelBanner:
|
|
2633
|
-
customChannelActions:
|
|
2634
|
-
renderChannelActions:
|
|
2631
|
+
renderHeaderTitleBadges: b,
|
|
2632
|
+
renderChannelBanner: N,
|
|
2633
|
+
customChannelActions: w,
|
|
2634
|
+
renderChannelActions: p,
|
|
2635
2635
|
onParticipantNameClick: v,
|
|
2636
|
-
renderMessage:
|
|
2636
|
+
renderMessage: A,
|
|
2637
2637
|
onMessageLinkClick: T,
|
|
2638
|
-
showChannelInfo:
|
|
2639
|
-
composerInput:
|
|
2638
|
+
showChannelInfo: E,
|
|
2639
|
+
composerInput: O
|
|
2640
2640
|
}) => {
|
|
2641
2641
|
const {
|
|
2642
|
-
client:
|
|
2642
|
+
client: R,
|
|
2643
2643
|
isConnected: L,
|
|
2644
|
-
isLoading:
|
|
2645
|
-
error:
|
|
2646
|
-
refreshConnection:
|
|
2644
|
+
isLoading: B,
|
|
2645
|
+
error: P,
|
|
2646
|
+
refreshConnection: _,
|
|
2647
2647
|
service: M,
|
|
2648
|
-
debug:
|
|
2649
|
-
} = zs(), [
|
|
2650
|
-
|
|
2648
|
+
debug: y
|
|
2649
|
+
} = zs(), [I, C] = $(null), [z, D] = $(null), [j, Z] = $(!1), { showDeleteConversation: Q = !0 } = e, G = Y(l);
|
|
2650
|
+
G.current = l;
|
|
2651
2651
|
const x = Y(a);
|
|
2652
2652
|
x.current = a;
|
|
2653
2653
|
const S = Y(null), U = Y(null);
|
|
2654
|
-
|
|
2655
|
-
U.current =
|
|
2656
|
-
}, [
|
|
2657
|
-
if (!
|
|
2658
|
-
const
|
|
2659
|
-
if (!
|
|
2660
|
-
const W = `${
|
|
2654
|
+
K(() => {
|
|
2655
|
+
U.current = I;
|
|
2656
|
+
}, [I]), K(() => {
|
|
2657
|
+
if (!R || !L) return;
|
|
2658
|
+
const F = R.userID;
|
|
2659
|
+
if (!F) return;
|
|
2660
|
+
const W = `${F}::${i}`;
|
|
2661
2661
|
if (S.current === W) return;
|
|
2662
2662
|
S.current = W;
|
|
2663
|
-
const
|
|
2663
|
+
const X = () => {
|
|
2664
2664
|
S.current === W && (S.current = null);
|
|
2665
2665
|
};
|
|
2666
2666
|
(async () => {
|
|
2667
2667
|
var me, he;
|
|
2668
2668
|
try {
|
|
2669
|
-
|
|
2669
|
+
y && console.log(
|
|
2670
2670
|
"[MessagingShell] Loading initial conversation with:",
|
|
2671
2671
|
i
|
|
2672
2672
|
);
|
|
2673
|
-
const ee = await
|
|
2673
|
+
const ee = await R.queryChannels(
|
|
2674
2674
|
{
|
|
2675
2675
|
type: "messaging",
|
|
2676
|
-
members: { $eq: [
|
|
2676
|
+
members: { $eq: [F, i] }
|
|
2677
2677
|
},
|
|
2678
2678
|
{},
|
|
2679
2679
|
{ limit: 1 }
|
|
2680
2680
|
);
|
|
2681
2681
|
if (ee.length > 0) {
|
|
2682
|
-
|
|
2682
|
+
C(ee[0]), D(null), (me = x.current) == null || me.call(x, ee[0]), y && console.log(
|
|
2683
2683
|
"[MessagingShell] Initial conversation loaded:",
|
|
2684
2684
|
ee[0].id
|
|
2685
2685
|
);
|
|
2686
2686
|
return;
|
|
2687
2687
|
}
|
|
2688
|
-
const te =
|
|
2688
|
+
const te = G.current;
|
|
2689
2689
|
if (!te || !M) {
|
|
2690
|
-
|
|
2690
|
+
X(), D("No conversation found with this account"), y && console.log(
|
|
2691
2691
|
"[MessagingShell] No conversation found for:",
|
|
2692
2692
|
i
|
|
2693
2693
|
);
|
|
@@ -2699,7 +2699,7 @@ const Ei = ({
|
|
|
2699
2699
|
name: te.name,
|
|
2700
2700
|
phone: te.phone
|
|
2701
2701
|
});
|
|
2702
|
-
|
|
2702
|
+
C(le), D(null), (he = x.current) == null || he.call(x, le), y && console.log(
|
|
2703
2703
|
"[MessagingShell] Channel created and loaded:",
|
|
2704
2704
|
le.id
|
|
2705
2705
|
);
|
|
@@ -2707,55 +2707,55 @@ const Ei = ({
|
|
|
2707
2707
|
console.error(
|
|
2708
2708
|
"[MessagingShell] Failed to create conversation:",
|
|
2709
2709
|
le
|
|
2710
|
-
),
|
|
2710
|
+
), X(), D("Failed to create conversation");
|
|
2711
2711
|
}
|
|
2712
2712
|
} catch (ee) {
|
|
2713
2713
|
console.error(
|
|
2714
2714
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2715
2715
|
ee
|
|
2716
|
-
),
|
|
2716
|
+
), X(), U.current || D("Failed to load conversation");
|
|
2717
2717
|
}
|
|
2718
2718
|
})();
|
|
2719
|
-
}, [i,
|
|
2719
|
+
}, [i, R, L, M, y]);
|
|
2720
2720
|
const H = Y(r);
|
|
2721
2721
|
H.current = r;
|
|
2722
|
-
const q =
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2722
|
+
const q = J(() => {
|
|
2723
|
+
var F;
|
|
2724
|
+
C(null), Z(!0), (F = H.current) == null || F.call(H);
|
|
2725
2725
|
}, []);
|
|
2726
|
-
return
|
|
2726
|
+
return B ? /* @__PURE__ */ n(Re, {}) : P ? /* @__PURE__ */ n(xe, { message: P, onBack: _ }) : !L || !R ? /* @__PURE__ */ n(
|
|
2727
2727
|
xe,
|
|
2728
2728
|
{
|
|
2729
2729
|
message: "Not connected to messaging service",
|
|
2730
|
-
onBack:
|
|
2730
|
+
onBack: _
|
|
2731
2731
|
}
|
|
2732
|
-
) :
|
|
2732
|
+
) : z ? /* @__PURE__ */ n(xe, { message: z }) : j && !I ? /* @__PURE__ */ n(xe, { message: "Conversation ended" }) : I ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2733
2733
|
mn,
|
|
2734
2734
|
{
|
|
2735
|
-
channel:
|
|
2735
|
+
channel: I,
|
|
2736
2736
|
renderMessageInputActions: t,
|
|
2737
2737
|
renderConversationFooter: s,
|
|
2738
|
-
renderChannelBanner:
|
|
2738
|
+
renderChannelBanner: N,
|
|
2739
2739
|
onLeaveConversation: q,
|
|
2740
2740
|
onBlockParticipant: q,
|
|
2741
2741
|
CustomChannelEmptyState: o,
|
|
2742
|
-
showDeleteConversation:
|
|
2742
|
+
showDeleteConversation: Q,
|
|
2743
2743
|
onBlockParticipantClick: d,
|
|
2744
2744
|
onReportParticipantClick: u,
|
|
2745
2745
|
dmAgentEnabled: g,
|
|
2746
2746
|
onMessageSent: m,
|
|
2747
2747
|
chatbotVotingEnabled: f,
|
|
2748
2748
|
viewerLanguage: c,
|
|
2749
|
-
renderHeaderTitleBadges:
|
|
2750
|
-
customChannelActions:
|
|
2751
|
-
renderChannelActions:
|
|
2749
|
+
renderHeaderTitleBadges: b,
|
|
2750
|
+
customChannelActions: w,
|
|
2751
|
+
renderChannelActions: p,
|
|
2752
2752
|
onParticipantNameClick: v,
|
|
2753
|
-
renderMessage:
|
|
2753
|
+
renderMessage: A,
|
|
2754
2754
|
onMessageLinkClick: T,
|
|
2755
|
-
showChannelInfo:
|
|
2756
|
-
composerInput:
|
|
2755
|
+
showChannelInfo: E,
|
|
2756
|
+
composerInput: O
|
|
2757
2757
|
},
|
|
2758
|
-
|
|
2758
|
+
I.id
|
|
2759
2759
|
) }) }) : /* @__PURE__ */ n(Re, {});
|
|
2760
2760
|
};
|
|
2761
2761
|
function Qa(e) {
|
|
@@ -2764,7 +2764,7 @@ function Qa(e) {
|
|
|
2764
2764
|
for (const s of t)
|
|
2765
2765
|
e.state.addMessageSorted(s.message);
|
|
2766
2766
|
}
|
|
2767
|
-
const hn =
|
|
2767
|
+
const hn = V.createContext({
|
|
2768
2768
|
selectedChannel: void 0,
|
|
2769
2769
|
onChannelSelect: () => {
|
|
2770
2770
|
},
|
|
@@ -2772,7 +2772,7 @@ const hn = G.createContext({
|
|
|
2772
2772
|
renderMessagePreview: void 0,
|
|
2773
2773
|
channelPreview: void 0,
|
|
2774
2774
|
viewerLanguage: void 0
|
|
2775
|
-
}), er = hn.Provider, tr = () =>
|
|
2775
|
+
}), er = hn.Provider, tr = () => V.useContext(hn), nr = (e, t) => {
|
|
2776
2776
|
const s = new Date(
|
|
2777
2777
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2778
2778
|
), r = new Date(
|
|
@@ -2793,77 +2793,77 @@ const hn = G.createContext({
|
|
|
2793
2793
|
day: "numeric",
|
|
2794
2794
|
year: "2-digit"
|
|
2795
2795
|
});
|
|
2796
|
-
}, fn =
|
|
2796
|
+
}, fn = V.memo(
|
|
2797
2797
|
(e) => {
|
|
2798
|
-
var
|
|
2799
|
-
const {
|
|
2800
|
-
selectedChannel:
|
|
2801
|
-
onChannelSelect:
|
|
2802
|
-
debug:
|
|
2803
|
-
channelPreview:
|
|
2804
|
-
renderMessagePreview:
|
|
2805
|
-
viewerLanguage:
|
|
2806
|
-
} = tr(),
|
|
2807
|
-
if (
|
|
2798
|
+
var L, B, P;
|
|
2799
|
+
const { channel: t, unread: s } = e, {
|
|
2800
|
+
selectedChannel: a,
|
|
2801
|
+
onChannelSelect: r,
|
|
2802
|
+
debug: i,
|
|
2803
|
+
channelPreview: l,
|
|
2804
|
+
renderMessagePreview: o,
|
|
2805
|
+
viewerLanguage: d
|
|
2806
|
+
} = tr(), u = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), g = Kt(t);
|
|
2807
|
+
if (l)
|
|
2808
2808
|
return /* @__PURE__ */ n(
|
|
2809
|
-
|
|
2809
|
+
l,
|
|
2810
2810
|
{
|
|
2811
|
-
...
|
|
2812
|
-
|
|
2813
|
-
selectedChannel:
|
|
2814
|
-
onChannelSelect:
|
|
2815
|
-
viewerLanguage:
|
|
2811
|
+
...e,
|
|
2812
|
+
active: u,
|
|
2813
|
+
selectedChannel: a,
|
|
2814
|
+
onChannelSelect: r,
|
|
2815
|
+
viewerLanguage: d
|
|
2816
2816
|
}
|
|
2817
2817
|
);
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2820
|
-
},
|
|
2821
|
-
const
|
|
2822
|
-
!
|
|
2823
|
-
},
|
|
2824
|
-
(
|
|
2825
|
-
var
|
|
2826
|
-
return ((
|
|
2818
|
+
const m = () => {
|
|
2819
|
+
t && r(t);
|
|
2820
|
+
}, f = (_) => {
|
|
2821
|
+
const M = _.key === "Enter" || _.key === " ", y = _.repeat;
|
|
2822
|
+
!M || y || (_.preventDefault(), m());
|
|
2823
|
+
}, b = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
2824
|
+
(_) => {
|
|
2825
|
+
var M, y;
|
|
2826
|
+
return ((M = _.user) == null ? void 0 : M.id) && _.user.id !== ((y = t == null ? void 0 : t._client) == null ? void 0 : y.userID);
|
|
2827
2827
|
}
|
|
2828
|
-
),
|
|
2829
|
-
var
|
|
2830
|
-
const
|
|
2831
|
-
if (
|
|
2832
|
-
for (let
|
|
2833
|
-
if (
|
|
2828
|
+
), N = Jt(b == null ? void 0 : b.user), w = (B = b == null ? void 0 : b.user) == null ? void 0 : B.image, p = (() => {
|
|
2829
|
+
var M;
|
|
2830
|
+
const _ = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
|
|
2831
|
+
if (_ != null && _.length) {
|
|
2832
|
+
for (let y = _.length - 1; y >= 0; y--)
|
|
2833
|
+
if (_[y].type !== "system") return _[y];
|
|
2834
2834
|
}
|
|
2835
|
-
})(),
|
|
2836
|
-
var
|
|
2837
|
-
const
|
|
2838
|
-
message:
|
|
2839
|
-
viewerLanguage:
|
|
2835
|
+
})(), A = (() => {
|
|
2836
|
+
var z, D, j, Z;
|
|
2837
|
+
const _ = Zt({
|
|
2838
|
+
message: p,
|
|
2839
|
+
viewerLanguage: d
|
|
2840
2840
|
});
|
|
2841
|
-
if (((
|
|
2842
|
-
if (((
|
|
2843
|
-
if (((
|
|
2844
|
-
return
|
|
2845
|
-
if (
|
|
2846
|
-
const
|
|
2847
|
-
return
|
|
2848
|
-
})(),
|
|
2849
|
-
return
|
|
2850
|
-
channelId:
|
|
2851
|
-
isSelected:
|
|
2852
|
-
participantName:
|
|
2853
|
-
unreadCount:
|
|
2854
|
-
hasTimestamp: !!
|
|
2841
|
+
if (((z = p == null ? void 0 : p.metadata) == null ? void 0 : z.custom_type) === "MESSAGE_TIP") return _ ? `💵 ${_}` : "💵 Sent a tip";
|
|
2842
|
+
if (((D = p == null ? void 0 : p.metadata) == null ? void 0 : D.custom_type) === "MESSAGE_PAID") return _ ? `💰 ${_}` : "💰 Sent a message";
|
|
2843
|
+
if (((j = p == null ? void 0 : p.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_ATTACHMENT")
|
|
2844
|
+
return _ ? `📎 ${_}` : "📎 Sent an attachment";
|
|
2845
|
+
if (_) return _;
|
|
2846
|
+
const C = (Z = p == null ? void 0 : p.attachments) == null ? void 0 : Z[0];
|
|
2847
|
+
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2848
|
+
})(), T = p != null && p.created_at ? sr(new Date(p.created_at)) : "", E = p ? Me(p) : !1, O = o ? o(p, A) : `${E ? "✨ " : ""}${A}`, R = s ?? 0;
|
|
2849
|
+
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2850
|
+
channelId: t == null ? void 0 : t.id,
|
|
2851
|
+
isSelected: u,
|
|
2852
|
+
participantName: N,
|
|
2853
|
+
unreadCount: R,
|
|
2854
|
+
hasTimestamp: !!T
|
|
2855
2855
|
}), /* @__PURE__ */ n(
|
|
2856
2856
|
"div",
|
|
2857
2857
|
{
|
|
2858
2858
|
role: "button",
|
|
2859
2859
|
tabIndex: 0,
|
|
2860
|
-
onClick:
|
|
2861
|
-
onKeyDown:
|
|
2862
|
-
className:
|
|
2860
|
+
onClick: m,
|
|
2861
|
+
onKeyDown: f,
|
|
2862
|
+
className: k(
|
|
2863
2863
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2864
2864
|
{
|
|
2865
|
-
"bg-black/[0.04]":
|
|
2866
|
-
"hover:bg-black/[0.02]": !
|
|
2865
|
+
"bg-black/[0.04]": u,
|
|
2866
|
+
"hover:bg-black/[0.02]": !u
|
|
2867
2867
|
}
|
|
2868
2868
|
),
|
|
2869
2869
|
"data-dd-privacy": "mask",
|
|
@@ -2871,11 +2871,11 @@ const hn = G.createContext({
|
|
|
2871
2871
|
/* @__PURE__ */ n(
|
|
2872
2872
|
ne,
|
|
2873
2873
|
{
|
|
2874
|
-
id: ((
|
|
2875
|
-
name:
|
|
2876
|
-
image:
|
|
2874
|
+
id: ((P = b == null ? void 0 : b.user) == null ? void 0 : P.id) || t.id || "unknown",
|
|
2875
|
+
name: N,
|
|
2876
|
+
image: w,
|
|
2877
2877
|
size: 48,
|
|
2878
|
-
starred:
|
|
2878
|
+
starred: g
|
|
2879
2879
|
}
|
|
2880
2880
|
),
|
|
2881
2881
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2883,20 +2883,20 @@ const hn = G.createContext({
|
|
|
2883
2883
|
/* @__PURE__ */ h(
|
|
2884
2884
|
"h3",
|
|
2885
2885
|
{
|
|
2886
|
-
className:
|
|
2886
|
+
className: k(
|
|
2887
2887
|
"text-sm font-medium truncate text-[#191918]"
|
|
2888
2888
|
),
|
|
2889
2889
|
children: [
|
|
2890
|
-
|
|
2891
|
-
|
|
2890
|
+
g && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2891
|
+
N
|
|
2892
2892
|
]
|
|
2893
2893
|
}
|
|
2894
2894
|
),
|
|
2895
|
-
|
|
2895
|
+
T && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: T })
|
|
2896
2896
|
] }),
|
|
2897
2897
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2898
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2899
|
-
|
|
2898
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: O }),
|
|
2899
|
+
R > 0 && /* @__PURE__ */ n("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 })
|
|
2900
2900
|
] })
|
|
2901
2901
|
] })
|
|
2902
2902
|
] })
|
|
@@ -2905,7 +2905,7 @@ const hn = G.createContext({
|
|
|
2905
2905
|
}
|
|
2906
2906
|
);
|
|
2907
2907
|
fn.displayName = "CustomChannelPreview";
|
|
2908
|
-
const ar = { last_message_at: -1 }, rr =
|
|
2908
|
+
const ar = { last_message_at: -1 }, rr = V.memo(
|
|
2909
2909
|
({
|
|
2910
2910
|
onChannelSelect: e,
|
|
2911
2911
|
selectedChannel: t,
|
|
@@ -2919,13 +2919,13 @@ const ar = { last_message_at: -1 }, rr = G.memo(
|
|
|
2919
2919
|
renderMessagePreview: u,
|
|
2920
2920
|
viewerLanguage: g
|
|
2921
2921
|
}) => {
|
|
2922
|
-
const m =
|
|
2922
|
+
const m = V.useRef(0);
|
|
2923
2923
|
m.current++;
|
|
2924
|
-
const { debug: f = !1 } = Je(), c =
|
|
2925
|
-
(
|
|
2926
|
-
for (const
|
|
2927
|
-
Qa(
|
|
2928
|
-
return r ? r(
|
|
2924
|
+
const { debug: f = !1 } = Je(), c = V.useCallback(
|
|
2925
|
+
(N) => {
|
|
2926
|
+
for (const w of N)
|
|
2927
|
+
Qa(w);
|
|
2928
|
+
return r ? r(N) : N;
|
|
2929
2929
|
},
|
|
2930
2930
|
[r]
|
|
2931
2931
|
);
|
|
@@ -2934,7 +2934,7 @@ const ar = { last_message_at: -1 }, rr = G.memo(
|
|
|
2934
2934
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2935
2935
|
filters: s
|
|
2936
2936
|
});
|
|
2937
|
-
const
|
|
2937
|
+
const b = V.useMemo(
|
|
2938
2938
|
() => ({
|
|
2939
2939
|
selectedChannel: t,
|
|
2940
2940
|
onChannelSelect: e,
|
|
@@ -2955,11 +2955,11 @@ const ar = { last_message_at: -1 }, rr = G.memo(
|
|
|
2955
2955
|
return /* @__PURE__ */ n(
|
|
2956
2956
|
"div",
|
|
2957
2957
|
{
|
|
2958
|
-
className:
|
|
2958
|
+
className: k(
|
|
2959
2959
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2960
2960
|
l
|
|
2961
2961
|
),
|
|
2962
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(er, { value:
|
|
2962
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(er, { value: b, children: /* @__PURE__ */ n(
|
|
2963
2963
|
us,
|
|
2964
2964
|
{
|
|
2965
2965
|
filters: s,
|
|
@@ -2994,7 +2994,7 @@ const or = {
|
|
|
2994
2994
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2995
2995
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2996
2996
|
}, cr = ({ variant: e, cta: t }) => {
|
|
2997
|
-
const s =
|
|
2997
|
+
const s = k(
|
|
2998
2998
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2999
2999
|
or[e]
|
|
3000
3000
|
), a = at(t.href);
|
|
@@ -3039,12 +3039,12 @@ const or = {
|
|
|
3039
3039
|
cta: l,
|
|
3040
3040
|
trailingAction: o
|
|
3041
3041
|
}) => {
|
|
3042
|
-
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", m = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
3043
|
-
if (!g && !m && !c && !
|
|
3044
|
-
const
|
|
3042
|
+
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", m = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = l != null;
|
|
3043
|
+
if (!g && !m && !c && !b) return null;
|
|
3044
|
+
const w = k(
|
|
3045
3045
|
"truncate text-base font-medium leading-6",
|
|
3046
3046
|
d && !t ? ur : dr[e]
|
|
3047
|
-
),
|
|
3047
|
+
), p = k(
|
|
3048
3048
|
"truncate text-xs leading-4",
|
|
3049
3049
|
mr[e]
|
|
3050
3050
|
);
|
|
@@ -3054,17 +3054,17 @@ const or = {
|
|
|
3054
3054
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
3055
3055
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3056
3056
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
3057
|
-
/* @__PURE__ */ n("p", { className:
|
|
3057
|
+
/* @__PURE__ */ n("p", { className: k("min-w-0", w), children: u })
|
|
3058
3058
|
] }),
|
|
3059
|
-
m && /* @__PURE__ */ n("p", { className:
|
|
3059
|
+
m && /* @__PURE__ */ n("p", { className: p, children: a })
|
|
3060
3060
|
] }),
|
|
3061
|
-
!
|
|
3061
|
+
!b && c && /* @__PURE__ */ n("p", { className: p, children: f })
|
|
3062
3062
|
] }),
|
|
3063
3063
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
3064
3064
|
] }),
|
|
3065
3065
|
l && /* @__PURE__ */ n(cr, { variant: e, cta: l })
|
|
3066
3066
|
] });
|
|
3067
|
-
}, hr =
|
|
3067
|
+
}, hr = k(
|
|
3068
3068
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
3069
3069
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
3070
3070
|
// the messaging design system's "small border around link attachments"
|
|
@@ -3082,7 +3082,7 @@ const or = {
|
|
|
3082
3082
|
bgClassName: o,
|
|
3083
3083
|
"data-testid": d
|
|
3084
3084
|
}) => {
|
|
3085
|
-
const u = s != null || a != null, g =
|
|
3085
|
+
const u = s != null || a != null, g = k(
|
|
3086
3086
|
hr,
|
|
3087
3087
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3088
3088
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -3113,7 +3113,7 @@ const or = {
|
|
|
3113
3113
|
onClick: a,
|
|
3114
3114
|
"aria-label": r,
|
|
3115
3115
|
"data-testid": d,
|
|
3116
|
-
className:
|
|
3116
|
+
className: k(g, "text-left"),
|
|
3117
3117
|
children: [
|
|
3118
3118
|
t,
|
|
3119
3119
|
m
|
|
@@ -3163,7 +3163,7 @@ const or = {
|
|
|
3163
3163
|
) }) : /* @__PURE__ */ h(
|
|
3164
3164
|
"div",
|
|
3165
3165
|
{
|
|
3166
|
-
className:
|
|
3166
|
+
className: k(
|
|
3167
3167
|
"relative h-[180px] w-full overflow-hidden",
|
|
3168
3168
|
d && "bg-black"
|
|
3169
3169
|
),
|
|
@@ -3190,7 +3190,7 @@ const or = {
|
|
|
3190
3190
|
) : /* @__PURE__ */ n(
|
|
3191
3191
|
"div",
|
|
3192
3192
|
{
|
|
3193
|
-
className:
|
|
3193
|
+
className: k(
|
|
3194
3194
|
"flex h-full w-full items-center justify-center",
|
|
3195
3195
|
fr[e]
|
|
3196
3196
|
),
|
|
@@ -3219,7 +3219,7 @@ const or = {
|
|
|
3219
3219
|
onDismiss: g,
|
|
3220
3220
|
onEditClick: m
|
|
3221
3221
|
}) => {
|
|
3222
|
-
const f = o === "classic", c = ze(r, l),
|
|
3222
|
+
const f = o === "classic", c = ze(r, l), b = g ? /* @__PURE__ */ n(
|
|
3223
3223
|
"button",
|
|
3224
3224
|
{
|
|
3225
3225
|
type: "button",
|
|
@@ -3228,7 +3228,7 @@ const or = {
|
|
|
3228
3228
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3229
3229
|
children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
|
|
3230
3230
|
}
|
|
3231
|
-
) : void 0,
|
|
3231
|
+
) : void 0, N = m ? /* @__PURE__ */ n(
|
|
3232
3232
|
"button",
|
|
3233
3233
|
{
|
|
3234
3234
|
type: "button",
|
|
@@ -3248,12 +3248,12 @@ const or = {
|
|
|
3248
3248
|
mimeType: r
|
|
3249
3249
|
}
|
|
3250
3250
|
) }),
|
|
3251
|
-
|
|
3251
|
+
b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
|
|
3252
3252
|
] }) }) : /* @__PURE__ */ h(
|
|
3253
3253
|
Le,
|
|
3254
3254
|
{
|
|
3255
3255
|
variant: "dark",
|
|
3256
|
-
topRight: f ?
|
|
3256
|
+
topRight: f ? b : void 0,
|
|
3257
3257
|
children: [
|
|
3258
3258
|
!f && /* @__PURE__ */ n(
|
|
3259
3259
|
De,
|
|
@@ -3263,7 +3263,7 @@ const or = {
|
|
|
3263
3263
|
sourceUrl: l,
|
|
3264
3264
|
title: e,
|
|
3265
3265
|
mimeType: r,
|
|
3266
|
-
topRight:
|
|
3266
|
+
topRight: b
|
|
3267
3267
|
}
|
|
3268
3268
|
),
|
|
3269
3269
|
/* @__PURE__ */ n(
|
|
@@ -3276,7 +3276,7 @@ const or = {
|
|
|
3276
3276
|
url: a,
|
|
3277
3277
|
appIcon: d,
|
|
3278
3278
|
cta: u,
|
|
3279
|
-
trailingAction:
|
|
3279
|
+
trailingAction: N
|
|
3280
3280
|
}
|
|
3281
3281
|
)
|
|
3282
3282
|
]
|
|
@@ -3294,11 +3294,11 @@ const or = {
|
|
|
3294
3294
|
cta: d,
|
|
3295
3295
|
onClick: u
|
|
3296
3296
|
}) => {
|
|
3297
|
-
const g = gn(a, i), m = at(s), f = d == null && m != null && !g ? m : void 0, c = d == null && !g ? u : void 0,
|
|
3297
|
+
const g = gn(a, i), m = at(s), f = d == null && m != null && !g ? m : void 0, c = d == null && !g ? u : void 0, b = ze(a, i) ? it : void 0, N = d && u ? {
|
|
3298
3298
|
...d,
|
|
3299
3299
|
onClick: () => {
|
|
3300
|
-
var
|
|
3301
|
-
u(), (
|
|
3300
|
+
var w;
|
|
3301
|
+
u(), (w = d.onClick) == null || w.call(d);
|
|
3302
3302
|
}
|
|
3303
3303
|
} : d;
|
|
3304
3304
|
return /* @__PURE__ */ h(
|
|
@@ -3308,7 +3308,7 @@ const or = {
|
|
|
3308
3308
|
href: f,
|
|
3309
3309
|
onClick: c,
|
|
3310
3310
|
ariaLabel: e ?? "Open attachment preview",
|
|
3311
|
-
bgClassName:
|
|
3311
|
+
bgClassName: b,
|
|
3312
3312
|
"data-testid": "link-attachment",
|
|
3313
3313
|
children: [
|
|
3314
3314
|
l === "featured" && /* @__PURE__ */ n(
|
|
@@ -3329,7 +3329,7 @@ const or = {
|
|
|
3329
3329
|
description: t,
|
|
3330
3330
|
url: s,
|
|
3331
3331
|
appIcon: o,
|
|
3332
|
-
cta:
|
|
3332
|
+
cta: N
|
|
3333
3333
|
}
|
|
3334
3334
|
)
|
|
3335
3335
|
]
|
|
@@ -3348,13 +3348,13 @@ const or = {
|
|
|
3348
3348
|
cta: u,
|
|
3349
3349
|
onClick: g
|
|
3350
3350
|
}) => {
|
|
3351
|
-
const m = gn(r, l), f = at(a), c = u == null && f != null && !m ? f : void 0,
|
|
3351
|
+
const m = gn(r, l), f = at(a), c = u == null && f != null && !m ? f : void 0, b = u == null && !m && c != null ? g : void 0;
|
|
3352
3352
|
return /* @__PURE__ */ h(
|
|
3353
3353
|
Le,
|
|
3354
3354
|
{
|
|
3355
3355
|
variant: "dark",
|
|
3356
3356
|
href: c,
|
|
3357
|
-
onClick:
|
|
3357
|
+
onClick: b,
|
|
3358
3358
|
bgClassName: ze(r, l) ? it : void 0,
|
|
3359
3359
|
children: [
|
|
3360
3360
|
o === "featured" && /* @__PURE__ */ n(
|
|
@@ -3423,7 +3423,7 @@ const or = {
|
|
|
3423
3423
|
{
|
|
3424
3424
|
"data-testid": l,
|
|
3425
3425
|
"data-group-position": a,
|
|
3426
|
-
className:
|
|
3426
|
+
className: k(
|
|
3427
3427
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3428
3428
|
// and keeps the document / image / audio bubbles visually
|
|
3429
3429
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3443,7 +3443,7 @@ const or = {
|
|
|
3443
3443
|
o ? /* @__PURE__ */ n(
|
|
3444
3444
|
"p",
|
|
3445
3445
|
{
|
|
3446
|
-
className:
|
|
3446
|
+
className: k(
|
|
3447
3447
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3448
3448
|
// the same font family + size as `.str-chat__message-text`
|
|
3449
3449
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3472,7 +3472,7 @@ const or = {
|
|
|
3472
3472
|
a.stopPropagation(), e();
|
|
3473
3473
|
},
|
|
3474
3474
|
"aria-label": s,
|
|
3475
|
-
className:
|
|
3475
|
+
className: k(
|
|
3476
3476
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3477
3477
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3478
3478
|
),
|
|
@@ -3521,7 +3521,7 @@ const or = {
|
|
|
3521
3521
|
text: i,
|
|
3522
3522
|
groupPosition: l,
|
|
3523
3523
|
"data-testid": "audio-attachment",
|
|
3524
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((c,
|
|
3524
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((c, b) => /* @__PURE__ */ n(
|
|
3525
3525
|
Cr,
|
|
3526
3526
|
{
|
|
3527
3527
|
item: c,
|
|
@@ -3529,10 +3529,10 @@ const or = {
|
|
|
3529
3529
|
trailingAction: (
|
|
3530
3530
|
// Composer only supports a single attachment, so the
|
|
3531
3531
|
// dismiss control sits on the only player.
|
|
3532
|
-
g &&
|
|
3532
|
+
g && b === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
|
|
3533
3533
|
)
|
|
3534
3534
|
},
|
|
3535
|
-
`${c.src}-${
|
|
3535
|
+
`${c.src}-${b}`
|
|
3536
3536
|
)) })
|
|
3537
3537
|
}
|
|
3538
3538
|
);
|
|
@@ -3606,13 +3606,13 @@ const Dr = {
|
|
|
3606
3606
|
const d = s ?? t ?? "File", u = Lr(a, t, r), g = /* @__PURE__ */ n(
|
|
3607
3607
|
"div",
|
|
3608
3608
|
{
|
|
3609
|
-
className:
|
|
3609
|
+
className: k(
|
|
3610
3610
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3611
3611
|
Pr[e]
|
|
3612
3612
|
),
|
|
3613
3613
|
"aria-hidden": !0,
|
|
3614
3614
|
children: ce(a, {
|
|
3615
|
-
className:
|
|
3615
|
+
className: k("size-6", zr[e]),
|
|
3616
3616
|
weight: "regular"
|
|
3617
3617
|
})
|
|
3618
3618
|
}
|
|
@@ -3621,7 +3621,7 @@ const Dr = {
|
|
|
3621
3621
|
u ? /* @__PURE__ */ n(
|
|
3622
3622
|
"p",
|
|
3623
3623
|
{
|
|
3624
|
-
className:
|
|
3624
|
+
className: k(
|
|
3625
3625
|
"truncate text-xs leading-4",
|
|
3626
3626
|
Dr[e]
|
|
3627
3627
|
),
|
|
@@ -3634,7 +3634,7 @@ const Dr = {
|
|
|
3634
3634
|
type: "button",
|
|
3635
3635
|
onClick: i,
|
|
3636
3636
|
"aria-label": l,
|
|
3637
|
-
className:
|
|
3637
|
+
className: k(
|
|
3638
3638
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3639
3639
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3640
3640
|
),
|
|
@@ -3714,19 +3714,19 @@ const Or = ({
|
|
|
3714
3714
|
mimeType: r,
|
|
3715
3715
|
title: i,
|
|
3716
3716
|
items: l
|
|
3717
|
-
}),
|
|
3718
|
-
if ((u == null ? void 0 : u(
|
|
3719
|
-
const
|
|
3720
|
-
if (!
|
|
3721
|
-
const v =
|
|
3722
|
-
bn(
|
|
3717
|
+
}), b = (w) => {
|
|
3718
|
+
if ((u == null ? void 0 : u(w)) === !1) return;
|
|
3719
|
+
const p = c[w];
|
|
3720
|
+
if (!p) return;
|
|
3721
|
+
const v = p.filename ?? ae(p.src);
|
|
3722
|
+
bn(p.src, v);
|
|
3723
3723
|
};
|
|
3724
3724
|
if (c.length === 0)
|
|
3725
3725
|
return null;
|
|
3726
|
-
const
|
|
3726
|
+
const N = /* @__PURE__ */ n(
|
|
3727
3727
|
"span",
|
|
3728
3728
|
{
|
|
3729
|
-
className:
|
|
3729
|
+
className: k(
|
|
3730
3730
|
"flex size-8 items-center justify-center rounded-full",
|
|
3731
3731
|
m === "dark" ? "text-white/70" : "text-black/70"
|
|
3732
3732
|
),
|
|
@@ -3741,16 +3741,16 @@ const Or = ({
|
|
|
3741
3741
|
text: o,
|
|
3742
3742
|
groupPosition: d,
|
|
3743
3743
|
"data-testid": "file-attachment",
|
|
3744
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3744
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w, p) => /* @__PURE__ */ n(
|
|
3745
3745
|
$r,
|
|
3746
3746
|
{
|
|
3747
3747
|
variant: m,
|
|
3748
|
-
item:
|
|
3749
|
-
index:
|
|
3750
|
-
onActivate:
|
|
3751
|
-
trailingAction: f &&
|
|
3748
|
+
item: w,
|
|
3749
|
+
index: p,
|
|
3750
|
+
onActivate: b,
|
|
3751
|
+
trailingAction: f && p === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : N
|
|
3752
3752
|
},
|
|
3753
|
-
`${
|
|
3753
|
+
`${w.src}-${p}`
|
|
3754
3754
|
)) })
|
|
3755
3755
|
}
|
|
3756
3756
|
);
|
|
@@ -3793,7 +3793,7 @@ const Or = ({
|
|
|
3793
3793
|
tone: i = "dark",
|
|
3794
3794
|
onTriggered: l
|
|
3795
3795
|
}) => {
|
|
3796
|
-
const [o, d] =
|
|
3796
|
+
const [o, d] = $(!1), u = J(
|
|
3797
3797
|
(c) => {
|
|
3798
3798
|
c.stopPropagation(), !o && (d(!0), bn(e, t).catch(() => {
|
|
3799
3799
|
}).finally(() => {
|
|
@@ -3801,7 +3801,7 @@ const Or = ({
|
|
|
3801
3801
|
}));
|
|
3802
3802
|
},
|
|
3803
3803
|
[o, e, t, l]
|
|
3804
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3804
|
+
), g = r ?? s !== "pill", f = { className: k(
|
|
3805
3805
|
s === "pill" ? "size-4" : "size-5",
|
|
3806
3806
|
"shrink-0"
|
|
3807
3807
|
), weight: "bold" };
|
|
@@ -3812,7 +3812,7 @@ const Or = ({
|
|
|
3812
3812
|
onClick: u,
|
|
3813
3813
|
disabled: o,
|
|
3814
3814
|
"aria-label": a,
|
|
3815
|
-
className:
|
|
3815
|
+
className: k(
|
|
3816
3816
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3817
3817
|
{
|
|
3818
3818
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3852,7 +3852,7 @@ const Or = ({
|
|
|
3852
3852
|
onClick: u,
|
|
3853
3853
|
disabled: o,
|
|
3854
3854
|
"aria-label": g ? a : void 0,
|
|
3855
|
-
className:
|
|
3855
|
+
className: k(
|
|
3856
3856
|
"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
|
|
3857
3857
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3858
3858
|
),
|
|
@@ -3874,18 +3874,18 @@ const Or = ({
|
|
|
3874
3874
|
initialIndex: t,
|
|
3875
3875
|
open: s
|
|
3876
3876
|
}) => {
|
|
3877
|
-
const a = Ve(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3878
|
-
|
|
3877
|
+
const a = Ve(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
|
|
3878
|
+
K(() => {
|
|
3879
3879
|
s && i(Ve(t, 0, Math.max(e - 1, 0)));
|
|
3880
|
-
}, [s, t, e]),
|
|
3880
|
+
}, [s, t, e]), K(() => {
|
|
3881
3881
|
i((d) => Ve(d, 0, Math.max(e - 1, 0)));
|
|
3882
3882
|
}, [e]);
|
|
3883
|
-
const l =
|
|
3883
|
+
const l = J(() => {
|
|
3884
3884
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3885
|
-
}, [e]), o =
|
|
3885
|
+
}, [e]), o = J(() => {
|
|
3886
3886
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3887
3887
|
}, [e]);
|
|
3888
|
-
return
|
|
3888
|
+
return K(() => {
|
|
3889
3889
|
if (!s || e <= 1) return;
|
|
3890
3890
|
const d = (u) => {
|
|
3891
3891
|
if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
|
|
@@ -3904,7 +3904,7 @@ const Or = ({
|
|
|
3904
3904
|
"data-testid": l
|
|
3905
3905
|
}) => {
|
|
3906
3906
|
const o = Y(null), d = Y(null);
|
|
3907
|
-
return
|
|
3907
|
+
return K(() => {
|
|
3908
3908
|
var f;
|
|
3909
3909
|
const m = o.current;
|
|
3910
3910
|
if (m) {
|
|
@@ -4049,14 +4049,14 @@ const Or = ({
|
|
|
4049
4049
|
const r = e.length;
|
|
4050
4050
|
if (r === 0) return null;
|
|
4051
4051
|
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, u, g) => {
|
|
4052
|
-
const m =
|
|
4052
|
+
const m = k(Vr, "h-full w-full");
|
|
4053
4053
|
return t ? /* @__PURE__ */ h(
|
|
4054
4054
|
"button",
|
|
4055
4055
|
{
|
|
4056
4056
|
type: "button",
|
|
4057
4057
|
onClick: () => t(u),
|
|
4058
4058
|
"aria-label": d.ariaLabel ?? `Open media ${u + 1}`,
|
|
4059
|
-
className:
|
|
4059
|
+
className: k(m, "cursor-zoom-in"),
|
|
4060
4060
|
children: [
|
|
4061
4061
|
d.content,
|
|
4062
4062
|
g
|
|
@@ -4068,10 +4068,10 @@ const Or = ({
|
|
|
4068
4068
|
g
|
|
4069
4069
|
] }, u);
|
|
4070
4070
|
};
|
|
4071
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
4071
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: k("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
4072
4072
|
"div",
|
|
4073
4073
|
{
|
|
4074
|
-
className:
|
|
4074
|
+
className: k(
|
|
4075
4075
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
4076
4076
|
a
|
|
4077
4077
|
),
|
|
@@ -4080,7 +4080,7 @@ const Or = ({
|
|
|
4080
4080
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
4081
4081
|
"div",
|
|
4082
4082
|
{
|
|
4083
|
-
className:
|
|
4083
|
+
className: k(
|
|
4084
4084
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4085
4085
|
a
|
|
4086
4086
|
),
|
|
@@ -4093,7 +4093,7 @@ const Or = ({
|
|
|
4093
4093
|
) : /* @__PURE__ */ n(
|
|
4094
4094
|
"div",
|
|
4095
4095
|
{
|
|
4096
|
-
className:
|
|
4096
|
+
className: k(
|
|
4097
4097
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4098
4098
|
a
|
|
4099
4099
|
),
|
|
@@ -4111,12 +4111,12 @@ const Or = ({
|
|
|
4111
4111
|
}
|
|
4112
4112
|
);
|
|
4113
4113
|
}, Ie = (e) => {
|
|
4114
|
-
const [t, s] =
|
|
4114
|
+
const [t, s] = $(!1), [a, r] = $(0), i = J(
|
|
4115
4115
|
(o) => {
|
|
4116
4116
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
4117
4117
|
},
|
|
4118
4118
|
[e]
|
|
4119
|
-
), l =
|
|
4119
|
+
), l = J(() => s(!1), []);
|
|
4120
4120
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
4121
4121
|
}, Gr = (e, t, s, a) => ({
|
|
4122
4122
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
@@ -4188,13 +4188,13 @@ const Or = ({
|
|
|
4188
4188
|
loading: o = "lazy",
|
|
4189
4189
|
onClick: d
|
|
4190
4190
|
}) => {
|
|
4191
|
-
const u = Hr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: m, viewerIndex: f, handleActivate: c, closeViewer:
|
|
4191
|
+
const u = Hr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: m, viewerIndex: f, handleActivate: c, closeViewer: b } = Ie(
|
|
4192
4192
|
d
|
|
4193
4193
|
);
|
|
4194
4194
|
if (u.length === 0)
|
|
4195
4195
|
return null;
|
|
4196
|
-
const
|
|
4197
|
-
(
|
|
4196
|
+
const N = u.map(
|
|
4197
|
+
(w, p) => Gr(w, p, u.length, o)
|
|
4198
4198
|
);
|
|
4199
4199
|
return /* @__PURE__ */ h(
|
|
4200
4200
|
ke,
|
|
@@ -4204,14 +4204,14 @@ const Or = ({
|
|
|
4204
4204
|
groupPosition: l,
|
|
4205
4205
|
"data-testid": "image-attachment",
|
|
4206
4206
|
children: [
|
|
4207
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles:
|
|
4207
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles: N, onTileActivate: c }) }),
|
|
4208
4208
|
/* @__PURE__ */ n(
|
|
4209
4209
|
xn,
|
|
4210
4210
|
{
|
|
4211
4211
|
open: m,
|
|
4212
4212
|
items: Nn(u, a),
|
|
4213
4213
|
initialIndex: f,
|
|
4214
|
-
onClose:
|
|
4214
|
+
onClose: b
|
|
4215
4215
|
}
|
|
4216
4216
|
)
|
|
4217
4217
|
]
|
|
@@ -4311,12 +4311,12 @@ const Or = ({
|
|
|
4311
4311
|
onClick: d,
|
|
4312
4312
|
onDismiss: u
|
|
4313
4313
|
}) => {
|
|
4314
|
-
const g = Ee(e), m = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate:
|
|
4314
|
+
const g = Ee(e), m = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ie(
|
|
4315
4315
|
d
|
|
4316
|
-
),
|
|
4316
|
+
), w = e === "composer" && !!u;
|
|
4317
4317
|
if (m.length === 0)
|
|
4318
4318
|
return null;
|
|
4319
|
-
const
|
|
4319
|
+
const p = m.map((v) => ({
|
|
4320
4320
|
src: v.src,
|
|
4321
4321
|
filename: v.filename ?? ae(v.src)
|
|
4322
4322
|
}));
|
|
@@ -4328,8 +4328,8 @@ const Or = ({
|
|
|
4328
4328
|
groupPosition: o,
|
|
4329
4329
|
"data-testid": "pdf-attachment",
|
|
4330
4330
|
children: [
|
|
4331
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((v,
|
|
4332
|
-
const T = v.filename ?? ae(v.src),
|
|
4331
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((v, A) => {
|
|
4332
|
+
const T = v.filename ?? ae(v.src), E = w && A === 0 ? /* @__PURE__ */ n(Ce, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4333
4333
|
vn,
|
|
4334
4334
|
{
|
|
4335
4335
|
url: v.src,
|
|
@@ -4344,20 +4344,20 @@ const Or = ({
|
|
|
4344
4344
|
{
|
|
4345
4345
|
variant: g,
|
|
4346
4346
|
item: v,
|
|
4347
|
-
index:
|
|
4348
|
-
onActivate:
|
|
4349
|
-
trailingAction:
|
|
4347
|
+
index: A,
|
|
4348
|
+
onActivate: b,
|
|
4349
|
+
trailingAction: E
|
|
4350
4350
|
},
|
|
4351
|
-
`${v.src}-${
|
|
4351
|
+
`${v.src}-${A}`
|
|
4352
4352
|
);
|
|
4353
4353
|
}) }),
|
|
4354
4354
|
/* @__PURE__ */ n(
|
|
4355
4355
|
Jr,
|
|
4356
4356
|
{
|
|
4357
4357
|
open: f,
|
|
4358
|
-
items:
|
|
4358
|
+
items: p,
|
|
4359
4359
|
initialIndex: c,
|
|
4360
|
-
onClose:
|
|
4360
|
+
onClose: N
|
|
4361
4361
|
}
|
|
4362
4362
|
)
|
|
4363
4363
|
]
|
|
@@ -4496,13 +4496,13 @@ const Or = ({
|
|
|
4496
4496
|
preload: d,
|
|
4497
4497
|
onClick: u
|
|
4498
4498
|
}) => {
|
|
4499
|
-
const g = li({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate:
|
|
4499
|
+
const g = li({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ie(
|
|
4500
4500
|
u
|
|
4501
4501
|
);
|
|
4502
4502
|
if (g.length === 0)
|
|
4503
4503
|
return null;
|
|
4504
|
-
const
|
|
4505
|
-
(
|
|
4504
|
+
const w = g.map(
|
|
4505
|
+
(p, v) => ii(p, v, g.length)
|
|
4506
4506
|
);
|
|
4507
4507
|
return /* @__PURE__ */ h(
|
|
4508
4508
|
ke,
|
|
@@ -4515,8 +4515,8 @@ const Or = ({
|
|
|
4515
4515
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4516
4516
|
wn,
|
|
4517
4517
|
{
|
|
4518
|
-
tiles:
|
|
4519
|
-
onTileActivate:
|
|
4518
|
+
tiles: w,
|
|
4519
|
+
onTileActivate: b,
|
|
4520
4520
|
className: "overflow-hidden rounded-md"
|
|
4521
4521
|
}
|
|
4522
4522
|
) }),
|
|
@@ -4526,7 +4526,7 @@ const Or = ({
|
|
|
4526
4526
|
open: f,
|
|
4527
4527
|
items: Cn(g, r),
|
|
4528
4528
|
initialIndex: c,
|
|
4529
|
-
onClose:
|
|
4529
|
+
onClose: N
|
|
4530
4530
|
}
|
|
4531
4531
|
)
|
|
4532
4532
|
]
|
|
@@ -4554,7 +4554,7 @@ const Or = ({
|
|
|
4554
4554
|
onClick: t,
|
|
4555
4555
|
disabled: s,
|
|
4556
4556
|
style: { backgroundColor: "#E6E5E3" },
|
|
4557
|
-
className:
|
|
4557
|
+
className: k(
|
|
4558
4558
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4559
4559
|
{
|
|
4560
4560
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4642,4 +4642,4 @@ export {
|
|
|
4642
4642
|
Jt as y,
|
|
4643
4643
|
Ci as z
|
|
4644
4644
|
};
|
|
4645
|
-
//# sourceMappingURL=index-
|
|
4645
|
+
//# sourceMappingURL=index-DmFR1zuQ.js.map
|