@linktr.ee/messaging-react 3.3.3 → 3.3.5
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-B7AF5uOB.js → Card-B9QrjooN.js} +3 -3
- package/dist/{Card-B7AF5uOB.js.map → Card-B9QrjooN.js.map} +1 -1
- package/dist/{Card-0BgubwgM.cjs → Card-BRRlz4kq.cjs} +2 -2
- package/dist/{Card-0BgubwgM.cjs.map → Card-BRRlz4kq.cjs.map} +1 -1
- package/dist/{Card-DLmUSU4A.cjs → Card-C-FCwjGa.cjs} +2 -2
- package/dist/{Card-DLmUSU4A.cjs.map → Card-C-FCwjGa.cjs.map} +1 -1
- package/dist/{Card-DchJqvYq.js → Card-CVZzYmYW.js} +2 -2
- package/dist/{Card-DchJqvYq.js.map → Card-CVZzYmYW.js.map} +1 -1
- package/dist/{Card-CvBbAoUo.cjs → Card-D_oLlfPw.cjs} +2 -2
- package/dist/{Card-CvBbAoUo.cjs.map → Card-D_oLlfPw.cjs.map} +1 -1
- package/dist/{Card-DmPpcrSU.js → Card-DzjYyrie.js} +2 -2
- package/dist/{Card-DmPpcrSU.js.map → Card-DzjYyrie.js.map} +1 -1
- package/dist/{LockedThumbnail-BQjA4HaB.js → LockedThumbnail-CJfXY_Ut.js} +2 -2
- package/dist/{LockedThumbnail-BQjA4HaB.js.map → LockedThumbnail-CJfXY_Ut.js.map} +1 -1
- package/dist/{LockedThumbnail-D9fSb4N-.cjs → LockedThumbnail-Cth1yWnH.cjs} +2 -2
- package/dist/{LockedThumbnail-D9fSb4N-.cjs.map → LockedThumbnail-Cth1yWnH.cjs.map} +1 -1
- package/dist/index-CBtOPvxW.cjs +2 -0
- package/dist/index-CBtOPvxW.cjs.map +1 -0
- package/dist/{index-BcHUpyyw.js → index-D7eRkXoG.js} +535 -537
- package/dist/index-D7eRkXoG.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/AttachmentCard/AttachmentCard.stories.tsx +104 -0
- package/src/components/ChannelActionsMenu/ChannelActionsMenu.test.tsx +33 -8
- package/src/components/ChannelList/CustomChannelPreview.stories.tsx +55 -47
- package/src/components/ChannelView.stories.tsx +8 -7
- package/src/components/CloseButton/CloseButton.stories.tsx +31 -0
- package/src/components/CustomDateSeparator/CustomDateSeparator.stories.tsx +33 -0
- package/src/components/CustomLinkPreviewList/CustomLinkPreviewCard.stories.tsx +63 -0
- package/src/components/CustomLinkPreviewList/CustomLinkPreviewCard.tsx +57 -0
- package/src/components/CustomLinkPreviewList/index.tsx +2 -54
- package/src/components/CustomMessage/CustomMessage.stories.tsx +3 -2
- package/src/components/CustomMessage/MessageTag.stories.tsx +4 -2
- package/src/components/MediaMessage/MediaMessage.stories.tsx +4 -2
- package/src/hooks/useChannelModerationActions.ts +32 -14
- package/src/index.ts +6 -1
- package/src/stories/decorators/storyTime.ts +31 -0
- package/src/stream-custom-data.ts +28 -0
- package/dist/index-BcHUpyyw.js.map +0 -1
- package/dist/index-DTZNltUC.cjs +0 -2
- package/dist/index-DTZNltUC.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import $, { createContext as Ge, useContext as Te, useCallback as W, useState as P, useRef as H, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
|
|
3
3
|
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { Chat as In, DateSeparator as Tn, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as An, useMessageReminder as Mn, useComponentContext as Ut, Attachment as Rn, EditMessageModal as Ln, MessageBlocked as Dn, MessageBouncePrompt as Pn, MessageDeleted as On, MessageIsThreadReplyInChannelButtonIndicator as zn, MessageRepliesCountButton as $n, ReminderNotification as Fn, StreamedMessageText as Bn, messageHasAttachments as Un, messageHasReactions as jn, isDateSeparatorMessage as Vn, isMessageBlocked as Gn, isMessageBounced as Hn, MessageBounceModal as Yn, MessageText as Tt, Poll as qn, MessageErrorIcon as Wn, useMessageContext as pe, useMessageComposer as Xn, useStateStore as Kn, MessageInput as Jn, useMessageInputContext as Zn, useMessageComposerHasSendableData as Qn, AttachmentPreviewList as es, QuotedMessagePreview as ts, TextareaComposer as ns, MessageTimestamp as Le, AIStates as De, useTypingContext as ss, useAIState as as, Channel as rs, WithComponents as is, Window as os, MessageList as ls, ChannelList as cs } from "stream-chat-react";
|
|
5
5
|
import { StarIcon as Fe, DotsThreeIcon as ds, SpinnerGapIcon as Ce, SignOutIcon as us, ProhibitInsetIcon as At, FlagIcon as jt, FileIcon as Vt, ImageIcon as ms, SpeakerHighIcon as hs, VideoCameraIcon as Gt, FileMdIcon as fs, FileTextIcon as gs, FileZipIcon as bs, FilePptIcon as ps, FileCsvIcon as vs, FileXlsIcon as xs, FileDocIcon as ws, FilePdfIcon as Ns, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as _s, LinkIcon as ys, DownloadSimpleIcon as be, GiftIcon as Cs, ThumbsUpIcon as ks, ThumbsDownIcon as Es, TrashSimpleIcon as Ss, XIcon as Ae, ArrowUpIcon as Is, SparkleIcon as Ue, ProhibitIcon as Ts, ArrowLeftIcon as Mt, PencilSimpleIcon as As, CaretLeftIcon as Ms, CaretRightIcon as Rs } from "@phosphor-icons/react";
|
|
6
|
-
import
|
|
6
|
+
import y from "classnames";
|
|
7
7
|
import { MessageActions as Ls, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
|
|
8
8
|
import { LinkPreviewsManager as Rt } from "stream-chat";
|
|
9
9
|
const Yt = Ge({
|
|
@@ -25,8 +25,8 @@ const Yt = Ge({
|
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
27
|
const o = W(
|
|
28
|
-
(
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
28
|
+
(k, ...T) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${k}`, ...T);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
@@ -36,14 +36,14 @@ const Yt = Ge({
|
|
|
36
36
|
serviceConfig: !!s,
|
|
37
37
|
capabilities: Object.keys(r)
|
|
38
38
|
});
|
|
39
|
-
const [l, d] =
|
|
39
|
+
const [l, d] = P(null), [m, b] = P(null), [u, f] = P(!1), [c, g] = P(!1), [p, v] = P(null), N = H(!1), x = H({
|
|
40
40
|
userId: t == null ? void 0 : t.id,
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
renderCount:
|
|
44
|
+
}), S = H(0);
|
|
45
|
+
S.current++, o("📊 RENDER INFO", {
|
|
46
|
+
renderCount: S.current,
|
|
47
47
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
48
48
|
propChanges: {
|
|
49
49
|
userChanged: x.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -57,9 +57,9 @@ const Yt = Ge({
|
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
59
|
}, Y(() => {
|
|
60
|
-
const
|
|
60
|
+
const k = S.current;
|
|
61
61
|
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
|
-
renderCount:
|
|
62
|
+
renderCount: k,
|
|
63
63
|
apiKey: !!a,
|
|
64
64
|
serviceConfig: !!s,
|
|
65
65
|
dependencies: {
|
|
@@ -70,34 +70,34 @@ const Yt = Ge({
|
|
|
70
70
|
}
|
|
71
71
|
}), !a || !s) {
|
|
72
72
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
73
|
-
renderCount:
|
|
73
|
+
renderCount: k,
|
|
74
74
|
reason: "Missing apiKey or serviceConfig"
|
|
75
75
|
});
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
o("🚀 CREATING NEW SERVICE", {
|
|
79
|
-
renderCount:
|
|
79
|
+
renderCount: k,
|
|
80
80
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
81
|
serviceConfigChanged: x.current.serviceConfig !== s
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const T = new Sn({
|
|
84
84
|
...s,
|
|
85
85
|
apiKey: a,
|
|
86
86
|
debug: i
|
|
87
87
|
});
|
|
88
|
-
return d(
|
|
89
|
-
renderCount:
|
|
90
|
-
serviceInstance: !!
|
|
88
|
+
return d(T), o("✅ SERVICE SET", {
|
|
89
|
+
renderCount: k,
|
|
90
|
+
serviceInstance: !!T
|
|
91
91
|
}), () => {
|
|
92
92
|
o("🧹 SERVICE CLEANUP", {
|
|
93
|
-
renderCount:
|
|
93
|
+
renderCount: k,
|
|
94
94
|
reason: "Effect cleanup"
|
|
95
|
-
}),
|
|
95
|
+
}), T.disconnectUser().catch(console.error);
|
|
96
96
|
};
|
|
97
97
|
}, [a, s, i, o]);
|
|
98
|
-
const
|
|
98
|
+
const E = H(null);
|
|
99
99
|
Y(() => {
|
|
100
|
-
var
|
|
100
|
+
var T, _;
|
|
101
101
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
102
|
hasService: !!l,
|
|
103
103
|
hasUser: !!t,
|
|
@@ -113,7 +113,7 @@ const Yt = Ge({
|
|
|
113
113
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (((
|
|
116
|
+
if (((T = E.current) == null ? void 0 : T.serviceId) === l && ((_ = E.current) == null ? void 0 : _.userId) === t.id) {
|
|
117
117
|
o(
|
|
118
118
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
119
|
"Already connected this user with this service"
|
|
@@ -121,19 +121,19 @@ const Yt = Ge({
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
(async () => {
|
|
124
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0),
|
|
124
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0), v(null);
|
|
125
125
|
try {
|
|
126
126
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
-
const
|
|
128
|
-
b(
|
|
127
|
+
const I = await l.connectUser(t);
|
|
128
|
+
b(I), f(!0), E.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
130
|
+
clientId: I.userID
|
|
131
131
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const
|
|
134
|
-
|
|
132
|
+
} catch (I) {
|
|
133
|
+
const R = I instanceof Error ? I.message : "Connection failed";
|
|
134
|
+
v(R), o("❌ USER CONNECTION ERROR", {
|
|
135
135
|
userId: t.id,
|
|
136
|
-
error:
|
|
136
|
+
error: R
|
|
137
137
|
});
|
|
138
138
|
} finally {
|
|
139
139
|
g(!1), N.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
@@ -149,12 +149,12 @@ const Yt = Ge({
|
|
|
149
149
|
l && u ? (o(
|
|
150
150
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
151
151
|
"Cleaning up connection on unmount"
|
|
152
|
-
),
|
|
152
|
+
), E.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
|
|
153
153
|
hasService: !!l,
|
|
154
154
|
isConnected: u
|
|
155
155
|
});
|
|
156
156
|
}), [l, u, o]);
|
|
157
|
-
const
|
|
157
|
+
const M = W(async () => {
|
|
158
158
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
159
159
|
hasService: !!l,
|
|
160
160
|
hasUser: !!t
|
|
@@ -165,49 +165,49 @@ const Yt = Ge({
|
|
|
165
165
|
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), g(!0);
|
|
166
166
|
try {
|
|
167
167
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
168
|
-
const
|
|
169
|
-
b(
|
|
170
|
-
} catch (
|
|
171
|
-
const
|
|
172
|
-
|
|
168
|
+
const k = await l.connectUser(t);
|
|
169
|
+
b(k), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
170
|
+
} catch (k) {
|
|
171
|
+
const T = k instanceof Error ? k.message : "Refresh failed";
|
|
172
|
+
v(T), o("❌ CONNECTION REFRESH ERROR", {
|
|
173
173
|
userId: t.id,
|
|
174
|
-
error:
|
|
174
|
+
error: T
|
|
175
175
|
});
|
|
176
176
|
} finally {
|
|
177
177
|
g(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
178
|
}
|
|
179
|
-
}, [l, t, o]),
|
|
179
|
+
}, [l, t, o]), D = $.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
180
180
|
hasService: !!l,
|
|
181
181
|
hasClient: !!m,
|
|
182
182
|
isConnected: u,
|
|
183
183
|
isLoading: c,
|
|
184
|
-
hasError: !!
|
|
184
|
+
hasError: !!p,
|
|
185
185
|
capabilitiesKeys: Object.keys(r)
|
|
186
186
|
}), {
|
|
187
187
|
service: l,
|
|
188
188
|
client: m,
|
|
189
189
|
isConnected: u,
|
|
190
190
|
isLoading: c,
|
|
191
|
-
error:
|
|
191
|
+
error: p,
|
|
192
192
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
193
|
+
refreshConnection: M,
|
|
194
194
|
debug: i
|
|
195
195
|
}), [
|
|
196
196
|
l,
|
|
197
197
|
m,
|
|
198
198
|
u,
|
|
199
199
|
c,
|
|
200
|
-
|
|
200
|
+
p,
|
|
201
201
|
r,
|
|
202
|
-
|
|
202
|
+
M,
|
|
203
203
|
i,
|
|
204
204
|
o
|
|
205
205
|
]);
|
|
206
206
|
return o("🔄 RENDER END", {
|
|
207
|
-
renderCount:
|
|
207
|
+
renderCount: S.current,
|
|
208
208
|
willRenderChat: !!(m && u),
|
|
209
|
-
contextValueReady: !!
|
|
210
|
-
}), /* @__PURE__ */ n(Yt.Provider, { value:
|
|
209
|
+
contextValueReady: !!D
|
|
210
|
+
}), /* @__PURE__ */ n(Yt.Provider, { value: D, children: m && u ? /* @__PURE__ */ n(
|
|
211
211
|
In,
|
|
212
212
|
{
|
|
213
213
|
client: m,
|
|
@@ -219,7 +219,7 @@ const Yt = Ge({
|
|
|
219
219
|
) : e });
|
|
220
220
|
}, Ds = () => qe(), qt = (e) => {
|
|
221
221
|
var a, r;
|
|
222
|
-
const [t, s] =
|
|
222
|
+
const [t, s] = P(
|
|
223
223
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
224
224
|
);
|
|
225
225
|
return Y(() => {
|
|
@@ -310,7 +310,7 @@ const ae = ({
|
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
312
|
"aria-hidden": "true",
|
|
313
|
-
className:
|
|
313
|
+
className: y(
|
|
314
314
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
315
315
|
m
|
|
316
316
|
),
|
|
@@ -320,7 +320,7 @@ const ae = ({
|
|
|
320
320
|
return /* @__PURE__ */ h(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: y(
|
|
324
324
|
"relative flex-shrink-0 !bg-transparent",
|
|
325
325
|
a
|
|
326
326
|
),
|
|
@@ -342,7 +342,7 @@ const ae = ({
|
|
|
342
342
|
"div",
|
|
343
343
|
{
|
|
344
344
|
"data-testid": "avatar-ring",
|
|
345
|
-
className:
|
|
345
|
+
className: y(
|
|
346
346
|
"h-full w-full",
|
|
347
347
|
"bg-transparent"
|
|
348
348
|
),
|
|
@@ -374,75 +374,73 @@ const ae = ({
|
|
|
374
374
|
onActionComplete: m,
|
|
375
375
|
logLabel: b = "useChannelModerationActions"
|
|
376
376
|
}) => {
|
|
377
|
-
var
|
|
378
|
-
const { service: u, debug: f } = qe(),
|
|
377
|
+
var F;
|
|
378
|
+
const { service: u, debug: f } = qe(), c = (F = t == null ? void 0 : t.user) == null ? void 0 : F.id, g = !!(a && s && u && c), [p, v] = P(!1), [N, x] = P(null), [S, E] = P(!1), [M, D] = P(!1), k = g && ((N == null ? void 0 : N.participantId) !== c || (N == null ? void 0 : N.service) !== u);
|
|
379
379
|
return Y(() => {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
g(!1), p(!1);
|
|
380
|
+
if (!g || !u || !c) {
|
|
381
|
+
v(!1), x(null);
|
|
383
382
|
return;
|
|
384
383
|
}
|
|
385
|
-
let
|
|
386
|
-
|
|
387
|
-
return p(!0), (async () => {
|
|
384
|
+
let A = !1;
|
|
385
|
+
return (async () => {
|
|
388
386
|
try {
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
(
|
|
387
|
+
const L = await u.getBlockedUsers();
|
|
388
|
+
if (A) return;
|
|
389
|
+
v(
|
|
390
|
+
L.some(
|
|
391
|
+
(z) => z.blocked_user_id === c
|
|
394
392
|
)
|
|
395
393
|
);
|
|
396
|
-
} catch (
|
|
397
|
-
|
|
394
|
+
} catch (L) {
|
|
395
|
+
A || console.error(`[${b}] Failed to check blocked status:`, L);
|
|
398
396
|
} finally {
|
|
399
|
-
|
|
397
|
+
A || x({ participantId: c, service: u });
|
|
400
398
|
}
|
|
401
399
|
})(), () => {
|
|
402
|
-
|
|
400
|
+
A = !0;
|
|
403
401
|
};
|
|
404
|
-
}, [
|
|
405
|
-
isParticipantBlocked:
|
|
406
|
-
isCheckingBlockedStatus:
|
|
407
|
-
isLeaving:
|
|
408
|
-
isUpdatingBlockStatus:
|
|
402
|
+
}, [g, u, c, b]), {
|
|
403
|
+
isParticipantBlocked: p,
|
|
404
|
+
isCheckingBlockedStatus: k,
|
|
405
|
+
isLeaving: S,
|
|
406
|
+
isUpdatingBlockStatus: M,
|
|
409
407
|
handleLeaveConversation: async () => {
|
|
410
|
-
var
|
|
411
|
-
if (!
|
|
412
|
-
o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid),
|
|
408
|
+
var A;
|
|
409
|
+
if (!S) {
|
|
410
|
+
o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), E(!0);
|
|
413
411
|
try {
|
|
414
|
-
const
|
|
415
|
-
await e.hide(
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${b}] Failed to leave conversation`,
|
|
412
|
+
const L = ((A = e._client) == null ? void 0 : A.userID) ?? null;
|
|
413
|
+
await e.hide(L, !1), r && await r(e), m == null || m();
|
|
414
|
+
} catch (L) {
|
|
415
|
+
console.error(`[${b}] Failed to leave conversation`, L);
|
|
418
416
|
} finally {
|
|
419
|
-
|
|
417
|
+
E(!1);
|
|
420
418
|
}
|
|
421
419
|
}
|
|
422
420
|
},
|
|
423
421
|
handleBlockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
l == null || l(), f && console.log(`[${b}] Block member`, (
|
|
422
|
+
var A, L, z;
|
|
423
|
+
if (!(M || !u)) {
|
|
424
|
+
l == null || l(), f && console.log(`[${b}] Block member`, (A = t == null ? void 0 : t.user) == null ? void 0 : A.id), D(!0);
|
|
427
425
|
try {
|
|
428
|
-
await u.blockUser((
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${b}] Failed to block member`,
|
|
426
|
+
await u.blockUser((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), i && await i((z = t == null ? void 0 : t.user) == null ? void 0 : z.id), m == null || m();
|
|
427
|
+
} catch (V) {
|
|
428
|
+
console.error(`[${b}] Failed to block member`, V);
|
|
431
429
|
} finally {
|
|
432
|
-
|
|
430
|
+
D(!1);
|
|
433
431
|
}
|
|
434
432
|
}
|
|
435
433
|
},
|
|
436
434
|
handleUnblockUser: async () => {
|
|
437
|
-
var
|
|
438
|
-
if (!(
|
|
439
|
-
l == null || l(), f && console.log(`[${b}] Unblock member`, (
|
|
435
|
+
var A, L, z;
|
|
436
|
+
if (!(M || !u)) {
|
|
437
|
+
l == null || l(), f && console.log(`[${b}] Unblock member`, (A = t == null ? void 0 : t.user) == null ? void 0 : A.id), D(!0);
|
|
440
438
|
try {
|
|
441
|
-
await u.unBlockUser((
|
|
442
|
-
} catch (
|
|
443
|
-
console.error(`[${b}] Failed to unblock member`,
|
|
439
|
+
await u.unBlockUser((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), i && await i((z = t == null ? void 0 : t.user) == null ? void 0 : z.id), m == null || m();
|
|
440
|
+
} catch (V) {
|
|
441
|
+
console.error(`[${b}] Failed to unblock member`, V);
|
|
444
442
|
} finally {
|
|
445
|
-
|
|
443
|
+
D(!1);
|
|
446
444
|
}
|
|
447
445
|
}
|
|
448
446
|
},
|
|
@@ -459,7 +457,7 @@ const ae = ({
|
|
|
459
457
|
"button",
|
|
460
458
|
{
|
|
461
459
|
type: "button",
|
|
462
|
-
className:
|
|
460
|
+
className: y(
|
|
463
461
|
"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",
|
|
464
462
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
465
463
|
t
|
|
@@ -481,15 +479,15 @@ const ae = ({
|
|
|
481
479
|
customChannelActions: b,
|
|
482
480
|
triggerClassName: u
|
|
483
481
|
}) => {
|
|
484
|
-
const [f, c] =
|
|
482
|
+
const [f, c] = P(!1), g = H(null), p = En(), v = W(() => c(!1), []), {
|
|
485
483
|
isParticipantBlocked: N,
|
|
486
484
|
isCheckingBlockedStatus: x,
|
|
487
|
-
isLeaving:
|
|
488
|
-
isUpdatingBlockStatus:
|
|
489
|
-
handleLeaveConversation:
|
|
490
|
-
handleBlockUser:
|
|
491
|
-
handleUnblockUser:
|
|
492
|
-
handleReportUser:
|
|
485
|
+
isLeaving: S,
|
|
486
|
+
isUpdatingBlockStatus: E,
|
|
487
|
+
handleLeaveConversation: M,
|
|
488
|
+
handleBlockUser: D,
|
|
489
|
+
handleUnblockUser: k,
|
|
490
|
+
handleReportUser: T
|
|
493
491
|
} = Bs({
|
|
494
492
|
channel: e,
|
|
495
493
|
participant: t,
|
|
@@ -500,18 +498,18 @@ const ae = ({
|
|
|
500
498
|
onDeleteConversationClick: l,
|
|
501
499
|
onBlockParticipantClick: d,
|
|
502
500
|
onReportParticipantClick: m,
|
|
503
|
-
onActionComplete:
|
|
501
|
+
onActionComplete: v,
|
|
504
502
|
logLabel: "ChannelActionsMenu"
|
|
505
503
|
});
|
|
506
504
|
return Y(() => {
|
|
507
505
|
if (!f) return;
|
|
508
|
-
const
|
|
509
|
-
g.current && !g.current.contains(
|
|
510
|
-
},
|
|
511
|
-
|
|
506
|
+
const I = (F) => {
|
|
507
|
+
g.current && !g.current.contains(F.target) && c(!1);
|
|
508
|
+
}, R = (F) => {
|
|
509
|
+
F.key === "Escape" && c(!1);
|
|
512
510
|
};
|
|
513
|
-
return document.addEventListener("mousedown",
|
|
514
|
-
document.removeEventListener("mousedown",
|
|
511
|
+
return document.addEventListener("mousedown", I), document.addEventListener("keydown", R), () => {
|
|
512
|
+
document.removeEventListener("mousedown", I), document.removeEventListener("keydown", R);
|
|
515
513
|
};
|
|
516
514
|
}, [f]), !t || !(s || a || r || !!b) ? null : /* @__PURE__ */ h("div", { ref: g, className: "relative", children: [
|
|
517
515
|
/* @__PURE__ */ h(
|
|
@@ -521,8 +519,8 @@ const ae = ({
|
|
|
521
519
|
type: "button",
|
|
522
520
|
"aria-haspopup": "true",
|
|
523
521
|
"aria-expanded": f,
|
|
524
|
-
"aria-controls": f ?
|
|
525
|
-
onClick: () => c((
|
|
522
|
+
"aria-controls": f ? p : void 0,
|
|
523
|
+
onClick: () => c((I) => !I),
|
|
526
524
|
children: [
|
|
527
525
|
/* @__PURE__ */ n(ds, { className: "size-5 text-black/90" }),
|
|
528
526
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -532,9 +530,9 @@ const ae = ({
|
|
|
532
530
|
f && /* @__PURE__ */ n(
|
|
533
531
|
"div",
|
|
534
532
|
{
|
|
535
|
-
id:
|
|
533
|
+
id: p,
|
|
536
534
|
"aria-label": "Conversation options",
|
|
537
|
-
className:
|
|
535
|
+
className: y(
|
|
538
536
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
539
537
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
540
538
|
),
|
|
@@ -542,11 +540,11 @@ const ae = ({
|
|
|
542
540
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
543
541
|
he,
|
|
544
542
|
{
|
|
545
|
-
onClick:
|
|
546
|
-
disabled:
|
|
547
|
-
"aria-busy":
|
|
543
|
+
onClick: M,
|
|
544
|
+
disabled: S,
|
|
545
|
+
"aria-busy": S,
|
|
548
546
|
children: [
|
|
549
|
-
|
|
547
|
+
S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(us, { className: "h-5 w-5" }),
|
|
550
548
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
551
549
|
]
|
|
552
550
|
}
|
|
@@ -561,27 +559,27 @@ const ae = ({
|
|
|
561
559
|
) : N ? /* @__PURE__ */ h(
|
|
562
560
|
he,
|
|
563
561
|
{
|
|
564
|
-
onClick:
|
|
565
|
-
disabled:
|
|
566
|
-
"aria-busy":
|
|
562
|
+
onClick: k,
|
|
563
|
+
disabled: E,
|
|
564
|
+
"aria-busy": E,
|
|
567
565
|
children: [
|
|
568
|
-
|
|
566
|
+
E ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
|
|
569
567
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
570
568
|
]
|
|
571
569
|
}
|
|
572
570
|
) : /* @__PURE__ */ h(
|
|
573
571
|
he,
|
|
574
572
|
{
|
|
575
|
-
onClick:
|
|
576
|
-
disabled:
|
|
577
|
-
"aria-busy":
|
|
573
|
+
onClick: D,
|
|
574
|
+
disabled: E,
|
|
575
|
+
"aria-busy": E,
|
|
578
576
|
children: [
|
|
579
|
-
|
|
577
|
+
E ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
|
|
580
578
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
581
579
|
]
|
|
582
580
|
}
|
|
583
581
|
) }),
|
|
584
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick:
|
|
582
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: T, children: [
|
|
585
583
|
/* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
|
|
586
584
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
587
585
|
] }) }),
|
|
@@ -632,7 +630,7 @@ function Xt({
|
|
|
632
630
|
const s = e == null ? void 0 : e.text, a = Gs(t);
|
|
633
631
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
634
632
|
}
|
|
635
|
-
const Hs =
|
|
633
|
+
const Hs = $.lazy(() => import("./Card-CVZzYmYW.js")), Ys = $.lazy(() => import("./Card-DzjYyrie.js")), qs = $.lazy(() => import("./Card-B9QrjooN.js")), We = () => /* @__PURE__ */ n(
|
|
636
634
|
"div",
|
|
637
635
|
{
|
|
638
636
|
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)]",
|
|
@@ -678,7 +676,7 @@ function ea(e) {
|
|
|
678
676
|
return t !== "document" ? Zs[t] : Qs[Zt(e)];
|
|
679
677
|
}
|
|
680
678
|
function le(e, t) {
|
|
681
|
-
return
|
|
679
|
+
return $.createElement(ea(e), t);
|
|
682
680
|
}
|
|
683
681
|
const ta = (e) => {
|
|
684
682
|
var t, s;
|
|
@@ -695,66 +693,66 @@ const ta = (e) => {
|
|
|
695
693
|
muted: d = !1,
|
|
696
694
|
onContainerClick: m
|
|
697
695
|
}) => {
|
|
698
|
-
const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [
|
|
699
|
-
|
|
700
|
-
}, []),
|
|
701
|
-
const
|
|
702
|
-
if (!
|
|
703
|
-
const
|
|
696
|
+
const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [p, v] = P(a), [N, x] = P(0), [S, E] = P(!1), [M, D] = P(!1), [k, T] = P(!1), [_, I] = P(!1), [R, F] = P(!0), [A, L] = P(null), z = W(() => {
|
|
697
|
+
T(!1), v(!0);
|
|
698
|
+
}, []), V = W((w) => {
|
|
699
|
+
const C = f.current;
|
|
700
|
+
if (!C) return 0;
|
|
701
|
+
const j = C.getBoundingClientRect();
|
|
704
702
|
return Math.max(
|
|
705
703
|
0,
|
|
706
|
-
Math.min(1, (ta(w) -
|
|
704
|
+
Math.min(1, (ta(w) - j.left) / j.width)
|
|
707
705
|
);
|
|
708
|
-
}, []),
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
}, []),
|
|
712
|
-
w.stopPropagation(),
|
|
713
|
-
const
|
|
714
|
-
x(
|
|
706
|
+
}, []), B = W((w) => {
|
|
707
|
+
const C = u.current;
|
|
708
|
+
C && C.duration && (C.currentTime = w * C.duration);
|
|
709
|
+
}, []), U = (w) => {
|
|
710
|
+
w.stopPropagation(), E(!0);
|
|
711
|
+
const C = V(w);
|
|
712
|
+
x(C), B(C);
|
|
715
713
|
};
|
|
716
714
|
Y(() => {
|
|
717
|
-
r !== void 0 && r !== g.current && (g.current = r,
|
|
715
|
+
r !== void 0 && r !== g.current && (g.current = r, v(r));
|
|
718
716
|
}, [r]), Y(() => {
|
|
719
|
-
if (!
|
|
717
|
+
if (!p) {
|
|
720
718
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
721
719
|
return;
|
|
722
720
|
}
|
|
723
721
|
const w = () => {
|
|
724
|
-
const
|
|
725
|
-
|
|
722
|
+
const C = u.current;
|
|
723
|
+
C && C.duration && !S && x(C.currentTime / C.duration), c.current = requestAnimationFrame(w);
|
|
726
724
|
};
|
|
727
725
|
return c.current = requestAnimationFrame(w), () => {
|
|
728
726
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
729
727
|
};
|
|
730
|
-
}, [
|
|
728
|
+
}, [p, S]), Y(() => {
|
|
731
729
|
const w = u.current;
|
|
732
|
-
w && (
|
|
733
|
-
|
|
730
|
+
w && (p ? w.play().catch((C) => {
|
|
731
|
+
v(!1), T(!0);
|
|
734
732
|
}) : w.pause());
|
|
735
|
-
}, [
|
|
736
|
-
if (!
|
|
737
|
-
const w = (
|
|
738
|
-
|
|
733
|
+
}, [p]), Y(() => {
|
|
734
|
+
if (!S) return;
|
|
735
|
+
const w = (j) => x(V(j)), C = (j) => {
|
|
736
|
+
E(!1), B(V(j));
|
|
739
737
|
};
|
|
740
|
-
return window.addEventListener("mousemove", w), window.addEventListener("mouseup",
|
|
741
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup",
|
|
738
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", C), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", C), () => {
|
|
739
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", C);
|
|
742
740
|
};
|
|
743
|
-
}, [
|
|
744
|
-
const X =
|
|
741
|
+
}, [S, V, B]);
|
|
742
|
+
const X = A ? { aspectRatio: String(A) } : void 0, G = A ? "" : " aspect-video", O = Math.round(N * 100);
|
|
745
743
|
return /* @__PURE__ */ h(
|
|
746
744
|
"div",
|
|
747
745
|
{
|
|
748
746
|
role: "button",
|
|
749
747
|
tabIndex: 0,
|
|
750
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
748
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${G}`,
|
|
751
749
|
style: X,
|
|
752
750
|
onClick: (w) => {
|
|
753
751
|
if (m) {
|
|
754
752
|
m(w);
|
|
755
753
|
return;
|
|
756
754
|
}
|
|
757
|
-
|
|
755
|
+
k || o && v((C) => !C);
|
|
758
756
|
},
|
|
759
757
|
onKeyDown: (w) => {
|
|
760
758
|
if (!(w.key !== "Enter" && w.key !== " ")) {
|
|
@@ -762,11 +760,11 @@ const ta = (e) => {
|
|
|
762
760
|
m(w);
|
|
763
761
|
return;
|
|
764
762
|
}
|
|
765
|
-
|
|
763
|
+
k || o && v((C) => !C);
|
|
766
764
|
}
|
|
767
765
|
},
|
|
768
766
|
children: [
|
|
769
|
-
s && (b === "audio" ||
|
|
767
|
+
s && (b === "audio" || R) && /* @__PURE__ */ n(
|
|
770
768
|
"img",
|
|
771
769
|
{
|
|
772
770
|
src: s,
|
|
@@ -774,7 +772,7 @@ const ta = (e) => {
|
|
|
774
772
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
775
773
|
}
|
|
776
774
|
),
|
|
777
|
-
!s && (b === "audio" ||
|
|
775
|
+
!s && (b === "audio" || R) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
|
|
778
776
|
className: "size-12 text-black/20",
|
|
779
777
|
weight: "regular"
|
|
780
778
|
}) }),
|
|
@@ -786,14 +784,14 @@ const ta = (e) => {
|
|
|
786
784
|
loop: i,
|
|
787
785
|
muted: d,
|
|
788
786
|
style: { width: "100%", height: "100%" },
|
|
789
|
-
onLoadStart: () =>
|
|
787
|
+
onLoadStart: () => I(!0),
|
|
790
788
|
onCanPlay: () => {
|
|
791
|
-
|
|
789
|
+
I(!1), F(!1);
|
|
792
790
|
},
|
|
793
|
-
onWaiting: () =>
|
|
794
|
-
onPlay: () =>
|
|
791
|
+
onWaiting: () => I(!0),
|
|
792
|
+
onPlay: () => T(!1),
|
|
795
793
|
onEnded: () => {
|
|
796
|
-
i || (
|
|
794
|
+
i || (v(!1), x(0));
|
|
797
795
|
},
|
|
798
796
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
799
797
|
}
|
|
@@ -806,30 +804,30 @@ const ta = (e) => {
|
|
|
806
804
|
muted: d,
|
|
807
805
|
playsInline: !0,
|
|
808
806
|
style: { width: "100%", height: "100%" },
|
|
809
|
-
onLoadStart: () =>
|
|
807
|
+
onLoadStart: () => I(!0),
|
|
810
808
|
onCanPlay: () => {
|
|
811
|
-
|
|
809
|
+
I(!1), F(!1);
|
|
812
810
|
},
|
|
813
|
-
onWaiting: () =>
|
|
814
|
-
onPlay: () =>
|
|
811
|
+
onWaiting: () => I(!0),
|
|
812
|
+
onPlay: () => T(!1),
|
|
815
813
|
onLoadedMetadata: () => {
|
|
816
814
|
const w = u.current;
|
|
817
|
-
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight &&
|
|
815
|
+
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && L(w.videoWidth / w.videoHeight);
|
|
818
816
|
},
|
|
819
817
|
onEnded: () => {
|
|
820
|
-
i || (
|
|
818
|
+
i || (v(!1), x(0));
|
|
821
819
|
},
|
|
822
820
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
823
821
|
}
|
|
824
822
|
) }),
|
|
825
|
-
|
|
823
|
+
_ && !k && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
826
824
|
ge,
|
|
827
825
|
{
|
|
828
826
|
className: "size-8 animate-spin text-white/80",
|
|
829
827
|
weight: "bold"
|
|
830
828
|
}
|
|
831
829
|
) }),
|
|
832
|
-
|
|
830
|
+
k && !o && /* @__PURE__ */ n(
|
|
833
831
|
"div",
|
|
834
832
|
{
|
|
835
833
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -837,10 +835,10 @@ const ta = (e) => {
|
|
|
837
835
|
tabIndex: 0,
|
|
838
836
|
"aria-label": "Play preview",
|
|
839
837
|
onClick: (w) => {
|
|
840
|
-
w.stopPropagation(),
|
|
838
|
+
w.stopPropagation(), z();
|
|
841
839
|
},
|
|
842
840
|
onKeyDown: (w) => {
|
|
843
|
-
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(),
|
|
841
|
+
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), z());
|
|
844
842
|
},
|
|
845
843
|
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(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
846
844
|
}
|
|
@@ -850,23 +848,23 @@ const ta = (e) => {
|
|
|
850
848
|
{
|
|
851
849
|
role: "slider",
|
|
852
850
|
"aria-label": "Playback position",
|
|
853
|
-
"aria-valuenow":
|
|
851
|
+
"aria-valuenow": O,
|
|
854
852
|
"aria-valuemin": 0,
|
|
855
853
|
"aria-valuemax": 100,
|
|
856
854
|
tabIndex: 0,
|
|
857
855
|
ref: f,
|
|
858
856
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
859
|
-
onMouseDown:
|
|
860
|
-
onTouchStart:
|
|
857
|
+
onMouseDown: U,
|
|
858
|
+
onTouchStart: U,
|
|
861
859
|
onClick: (w) => w.stopPropagation(),
|
|
862
860
|
onKeyDown: (w) => {
|
|
863
|
-
w.key === "ArrowRight" &&
|
|
861
|
+
w.key === "ArrowRight" && B(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && B(Math.max(0, N - 0.05));
|
|
864
862
|
},
|
|
865
863
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
866
864
|
"div",
|
|
867
865
|
{
|
|
868
866
|
className: "h-full rounded-full bg-white",
|
|
869
|
-
style: { width: `${
|
|
867
|
+
style: { width: `${O}%` }
|
|
870
868
|
}
|
|
871
869
|
) })
|
|
872
870
|
}
|
|
@@ -877,11 +875,11 @@ const ta = (e) => {
|
|
|
877
875
|
{
|
|
878
876
|
type: "button",
|
|
879
877
|
onClick: (w) => {
|
|
880
|
-
w.stopPropagation(),
|
|
878
|
+
w.stopPropagation(), v((C) => !C);
|
|
881
879
|
},
|
|
882
880
|
className: "shrink-0 text-white",
|
|
883
|
-
"aria-label":
|
|
884
|
-
children:
|
|
881
|
+
"aria-label": p ? "Pause" : "Play",
|
|
882
|
+
children: p ? /* @__PURE__ */ n(_s, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Be, { className: "size-5 translate-x-px", weight: "fill" })
|
|
885
883
|
}
|
|
886
884
|
),
|
|
887
885
|
/* @__PURE__ */ h(
|
|
@@ -889,30 +887,30 @@ const ta = (e) => {
|
|
|
889
887
|
{
|
|
890
888
|
role: "slider",
|
|
891
889
|
"aria-label": "Playback position",
|
|
892
|
-
"aria-valuenow":
|
|
890
|
+
"aria-valuenow": O,
|
|
893
891
|
"aria-valuemin": 0,
|
|
894
892
|
"aria-valuemax": 100,
|
|
895
893
|
tabIndex: 0,
|
|
896
894
|
ref: f,
|
|
897
895
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
898
|
-
onMouseDown:
|
|
899
|
-
onTouchStart:
|
|
896
|
+
onMouseDown: U,
|
|
897
|
+
onTouchStart: U,
|
|
900
898
|
onClick: (w) => w.stopPropagation(),
|
|
901
|
-
onMouseEnter: () =>
|
|
902
|
-
onMouseLeave: () =>
|
|
899
|
+
onMouseEnter: () => D(!0),
|
|
900
|
+
onMouseLeave: () => D(!1),
|
|
903
901
|
onKeyDown: (w) => {
|
|
904
|
-
w.key === "ArrowRight" &&
|
|
902
|
+
w.key === "ArrowRight" && B(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && B(Math.max(0, N - 0.05));
|
|
905
903
|
},
|
|
906
904
|
children: [
|
|
907
905
|
/* @__PURE__ */ n(
|
|
908
906
|
"div",
|
|
909
907
|
{
|
|
910
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
908
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${M || S ? "h-1.5" : "h-1"}`,
|
|
911
909
|
children: /* @__PURE__ */ n(
|
|
912
910
|
"div",
|
|
913
911
|
{
|
|
914
912
|
className: "h-full rounded-full bg-white",
|
|
915
|
-
style: { width: `${
|
|
913
|
+
style: { width: `${O}%` }
|
|
916
914
|
}
|
|
917
915
|
)
|
|
918
916
|
}
|
|
@@ -920,8 +918,8 @@ const ta = (e) => {
|
|
|
920
918
|
/* @__PURE__ */ n(
|
|
921
919
|
"div",
|
|
922
920
|
{
|
|
923
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
924
|
-
style: { left: `${
|
|
921
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${M || S ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
922
|
+
style: { left: `${O}%` }
|
|
925
923
|
}
|
|
926
924
|
)
|
|
927
925
|
]
|
|
@@ -940,7 +938,7 @@ const ta = (e) => {
|
|
|
940
938
|
mediaPlayerProps: i,
|
|
941
939
|
containedImage: o = !1
|
|
942
940
|
}) => {
|
|
943
|
-
const l = ne(e), [d, m] =
|
|
941
|
+
const l = ne(e), [d, m] = P(!1);
|
|
944
942
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
945
943
|
na,
|
|
946
944
|
{
|
|
@@ -1031,7 +1029,7 @@ const ta = (e) => {
|
|
|
1031
1029
|
{
|
|
1032
1030
|
ref: b,
|
|
1033
1031
|
"data-testid": u,
|
|
1034
|
-
className:
|
|
1032
|
+
className: y(
|
|
1035
1033
|
"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)]",
|
|
1036
1034
|
f ? "bg-[#121110]" : "bg-white"
|
|
1037
1035
|
),
|
|
@@ -1043,7 +1041,7 @@ const ta = (e) => {
|
|
|
1043
1041
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1044
1042
|
"p",
|
|
1045
1043
|
{
|
|
1046
|
-
className:
|
|
1044
|
+
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1047
1045
|
"text-black": !f,
|
|
1048
1046
|
"text-white/30": f && g,
|
|
1049
1047
|
"text-white": f && !g
|
|
@@ -1053,7 +1051,7 @@ const ta = (e) => {
|
|
|
1053
1051
|
),
|
|
1054
1052
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1055
1053
|
le(r, {
|
|
1056
|
-
className:
|
|
1054
|
+
className: y(
|
|
1057
1055
|
"size-5 shrink-0",
|
|
1058
1056
|
f ? "text-white/55" : "text-black/55"
|
|
1059
1057
|
),
|
|
@@ -1062,7 +1060,7 @@ const ta = (e) => {
|
|
|
1062
1060
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1063
1061
|
"span",
|
|
1064
1062
|
{
|
|
1065
|
-
className:
|
|
1063
|
+
className: y(
|
|
1066
1064
|
"text-xs font-medium",
|
|
1067
1065
|
f ? "text-white/55" : "text-black/55"
|
|
1068
1066
|
),
|
|
@@ -1099,7 +1097,7 @@ function la(e) {
|
|
|
1099
1097
|
return e ? "text-white/20" : "text-black/20";
|
|
1100
1098
|
}
|
|
1101
1099
|
const Ke = ({ attachment: e, isMyMessage: t }) => {
|
|
1102
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(
|
|
1100
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h($.Fragment, { children: [
|
|
1103
1101
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1104
1102
|
"img",
|
|
1105
1103
|
{
|
|
@@ -1145,7 +1143,7 @@ const da = ({
|
|
|
1145
1143
|
url: e,
|
|
1146
1144
|
filename: t
|
|
1147
1145
|
}) => {
|
|
1148
|
-
const [s, a] =
|
|
1146
|
+
const [s, a] = P(!1);
|
|
1149
1147
|
return /* @__PURE__ */ n(
|
|
1150
1148
|
"button",
|
|
1151
1149
|
{
|
|
@@ -1161,7 +1159,7 @@ const da = ({
|
|
|
1161
1159
|
},
|
|
1162
1160
|
disabled: s,
|
|
1163
1161
|
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",
|
|
1164
|
-
children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(
|
|
1162
|
+
children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h($.Fragment, { children: [
|
|
1165
1163
|
/* @__PURE__ */ n(be, { className: "size-4 text-white", weight: "bold" }),
|
|
1166
1164
|
"Download"
|
|
1167
1165
|
] })
|
|
@@ -1171,13 +1169,13 @@ const da = ({
|
|
|
1171
1169
|
function Ze(e) {
|
|
1172
1170
|
var u, f, c, g;
|
|
1173
1171
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1174
|
-
(
|
|
1172
|
+
(p) => p.type === "video" && p.asset_url
|
|
1175
1173
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1176
|
-
(
|
|
1174
|
+
(p) => p.type === "image" && p.image_url
|
|
1177
1175
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1178
|
-
(
|
|
1176
|
+
(p) => p.type === "audio" && p.asset_url
|
|
1179
1177
|
), r = (g = e.attachments) == null ? void 0 : g.find(
|
|
1180
|
-
(
|
|
1178
|
+
(p) => p.type === "file" && p.asset_url
|
|
1181
1179
|
), i = t ?? s ?? a ?? r, o = (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);
|
|
1182
1180
|
if (!o) return null;
|
|
1183
1181
|
const l = (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, m = i == null ? void 0 : i.file_size, b = t == null ? void 0 : t.thumb_url;
|
|
@@ -1376,7 +1374,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1376
1374
|
"button",
|
|
1377
1375
|
{
|
|
1378
1376
|
type: "button",
|
|
1379
|
-
className:
|
|
1377
|
+
className: y("message-vote-button focus-ring", {
|
|
1380
1378
|
"message-vote-button--selected": e === "up"
|
|
1381
1379
|
}),
|
|
1382
1380
|
onClick: t,
|
|
@@ -1390,7 +1388,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1390
1388
|
"button",
|
|
1391
1389
|
{
|
|
1392
1390
|
type: "button",
|
|
1393
|
-
className:
|
|
1391
|
+
className: y("message-vote-button focus-ring", {
|
|
1394
1392
|
"message-vote-button--selected": e === "down"
|
|
1395
1393
|
}),
|
|
1396
1394
|
onClick: s,
|
|
@@ -1417,21 +1415,21 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1417
1415
|
isMyMessage: f,
|
|
1418
1416
|
message: c,
|
|
1419
1417
|
renderText: g,
|
|
1420
|
-
threadList:
|
|
1421
|
-
viewerLanguage:
|
|
1422
|
-
} = e, { client: N } = Ye("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking:
|
|
1423
|
-
Attachment:
|
|
1424
|
-
EditMessageModal:
|
|
1425
|
-
MessageActions:
|
|
1426
|
-
MessageBlocked:
|
|
1427
|
-
MessageBouncePrompt:
|
|
1428
|
-
MessageDeleted:
|
|
1418
|
+
threadList: p,
|
|
1419
|
+
viewerLanguage: v
|
|
1420
|
+
} = e, { client: N } = Ye("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking: S, onUnlockClick: E, onFetchSource: M, onDownloadClick: D } = ba("LockedAttachment"), [k, T] = P(!1), _ = Mn(c.id), { selected: I, voteUp: R, voteDown: F } = Vs(c), {
|
|
1421
|
+
Attachment: A = Rn,
|
|
1422
|
+
EditMessageModal: L = Ln,
|
|
1423
|
+
MessageActions: z,
|
|
1424
|
+
MessageBlocked: V = Dn,
|
|
1425
|
+
MessageBouncePrompt: B = Pn,
|
|
1426
|
+
MessageDeleted: U = On,
|
|
1429
1427
|
MessageIsThreadReplyInChannelButtonIndicator: X = zn,
|
|
1430
|
-
MessageRepliesCountButton:
|
|
1431
|
-
ReminderNotification:
|
|
1428
|
+
MessageRepliesCountButton: G = $n,
|
|
1429
|
+
ReminderNotification: O = Fn,
|
|
1432
1430
|
StreamedMessageText: w = Bn,
|
|
1433
|
-
PinIndicator:
|
|
1434
|
-
} = Ut("CustomMessage"),
|
|
1431
|
+
PinIndicator: C
|
|
1432
|
+
} = Ut("CustomMessage"), j = Un(c), q = jn(c), _e = ee(
|
|
1435
1433
|
() => u == null ? void 0 : u(c),
|
|
1436
1434
|
[u, c]
|
|
1437
1435
|
), K = ee(() => {
|
|
@@ -1440,26 +1438,26 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1440
1438
|
const St = ye.filter((It) => !("type" in It) || !nn(It));
|
|
1441
1439
|
return St.length === ye.length ? ye : St;
|
|
1442
1440
|
}, [c]), re = ee(() => {
|
|
1443
|
-
const me = Xt({ message: c, viewerLanguage:
|
|
1441
|
+
const me = Xt({ message: c, viewerLanguage: v });
|
|
1444
1442
|
return me === c.text ? c : { ...c, text: me };
|
|
1445
|
-
}, [c,
|
|
1443
|
+
}, [c, v]);
|
|
1446
1444
|
if (Vn(c))
|
|
1447
1445
|
return null;
|
|
1448
1446
|
if (c.deleted_at || c.type === "deleted")
|
|
1449
|
-
return /* @__PURE__ */ n(
|
|
1447
|
+
return /* @__PURE__ */ n(U, { message: c });
|
|
1450
1448
|
if (Gn(c))
|
|
1451
|
-
return /* @__PURE__ */ n(
|
|
1452
|
-
const J = !
|
|
1449
|
+
return /* @__PURE__ */ n(V, {});
|
|
1450
|
+
const J = !p && !!c.reply_count, se = !p && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Hn(c);
|
|
1453
1451
|
let ie;
|
|
1454
|
-
Q ? ie = () => m(c) : lt && (ie = () =>
|
|
1455
|
-
const de = f(), kn =
|
|
1452
|
+
Q ? ie = () => m(c) : lt && (ie = () => T(!0));
|
|
1453
|
+
const de = f(), kn = y(
|
|
1456
1454
|
"str-chat__message str-chat__message-simple",
|
|
1457
1455
|
`str-chat__message--${c.type}`,
|
|
1458
1456
|
`str-chat__message--${c.status}`,
|
|
1459
1457
|
de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1460
1458
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1461
1459
|
{
|
|
1462
|
-
"str-chat__message--has-attachment":
|
|
1460
|
+
"str-chat__message--has-attachment": j,
|
|
1463
1461
|
"str-chat__message--highlighted": b,
|
|
1464
1462
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1465
1463
|
"str-chat__message--with-reactions": q,
|
|
@@ -1472,17 +1470,17 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1472
1470
|
), ct = c.poll_id && N.polls.fromState(c.poll_id), dt = Na(c), ue = ke(c), ut = wa(c), Re = !!(K != null && K.length && !c.quoted_message), mt = ue && de && Re;
|
|
1473
1471
|
return /* @__PURE__ */ h(te, { children: [
|
|
1474
1472
|
a && /* @__PURE__ */ n(
|
|
1475
|
-
|
|
1473
|
+
L,
|
|
1476
1474
|
{
|
|
1477
1475
|
additionalMessageInputProps: t
|
|
1478
1476
|
}
|
|
1479
1477
|
),
|
|
1480
|
-
|
|
1478
|
+
k && /* @__PURE__ */ n(
|
|
1481
1479
|
Yn,
|
|
1482
1480
|
{
|
|
1483
|
-
MessageBouncePrompt:
|
|
1484
|
-
onClose: () =>
|
|
1485
|
-
open:
|
|
1481
|
+
MessageBouncePrompt: B,
|
|
1482
|
+
onClose: () => T(!1),
|
|
1483
|
+
open: k
|
|
1486
1484
|
}
|
|
1487
1485
|
),
|
|
1488
1486
|
/* @__PURE__ */ h(
|
|
@@ -1491,8 +1489,8 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1491
1489
|
className: kn,
|
|
1492
1490
|
"data-message-id": c.id,
|
|
1493
1491
|
children: [
|
|
1494
|
-
|
|
1495
|
-
!!
|
|
1492
|
+
C && /* @__PURE__ */ n(C, {}),
|
|
1493
|
+
!!_ && /* @__PURE__ */ n(O, { reminder: _ }),
|
|
1496
1494
|
c.user && /* @__PURE__ */ n(
|
|
1497
1495
|
ae,
|
|
1498
1496
|
{
|
|
@@ -1508,7 +1506,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1508
1506
|
/* @__PURE__ */ n(
|
|
1509
1507
|
"div",
|
|
1510
1508
|
{
|
|
1511
|
-
className:
|
|
1509
|
+
className: y("str-chat__message-inner", {
|
|
1512
1510
|
"str-chat__simple-message--error-failed": Q || lt
|
|
1513
1511
|
}),
|
|
1514
1512
|
"data-testid": "message-inner",
|
|
@@ -1524,7 +1522,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1524
1522
|
},
|
|
1525
1523
|
children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1526
1524
|
de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1527
|
-
|
|
1525
|
+
z && /* @__PURE__ */ n(z, {}),
|
|
1528
1526
|
/* @__PURE__ */ n(
|
|
1529
1527
|
Ot.Sent,
|
|
1530
1528
|
{
|
|
@@ -1534,8 +1532,8 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1534
1532
|
amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
|
|
1535
1533
|
detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
|
|
1536
1534
|
paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
|
|
1537
|
-
onPreviewClick: () =>
|
|
1538
|
-
onFetchSource: async () => await (
|
|
1535
|
+
onPreviewClick: () => E == null ? void 0 : E(c, x),
|
|
1536
|
+
onFetchSource: async () => await (M == null ? void 0 : M(c, x))
|
|
1539
1537
|
}
|
|
1540
1538
|
)
|
|
1541
1539
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1548,13 +1546,13 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1548
1546
|
amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
|
|
1549
1547
|
detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
|
|
1550
1548
|
paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
|
|
1551
|
-
isUnlocking:
|
|
1552
|
-
onUnlockClick: () =>
|
|
1553
|
-
onFetchSource: async () => await (
|
|
1554
|
-
onDownloadClick: () =>
|
|
1549
|
+
isUnlocking: S(c.id),
|
|
1550
|
+
onUnlockClick: () => E == null ? void 0 : E(c, x),
|
|
1551
|
+
onFetchSource: async () => await (M == null ? void 0 : M(c, x)),
|
|
1552
|
+
onDownloadClick: () => D == null ? void 0 : D(c, x)
|
|
1555
1553
|
}
|
|
1556
1554
|
),
|
|
1557
|
-
|
|
1555
|
+
z && /* @__PURE__ */ n(z, {})
|
|
1558
1556
|
] }),
|
|
1559
1557
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1560
1558
|
Tt,
|
|
@@ -1577,7 +1575,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1577
1575
|
),
|
|
1578
1576
|
ct && /* @__PURE__ */ n(qn, { poll: ct }),
|
|
1579
1577
|
K != null && K.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1580
|
-
|
|
1578
|
+
A,
|
|
1581
1579
|
{
|
|
1582
1580
|
actionHandler: l,
|
|
1583
1581
|
attachments: K
|
|
@@ -1612,14 +1610,14 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1612
1610
|
s && ue && /* @__PURE__ */ n(
|
|
1613
1611
|
_a,
|
|
1614
1612
|
{
|
|
1615
|
-
selected:
|
|
1616
|
-
onVoteUp:
|
|
1617
|
-
onVoteDown:
|
|
1613
|
+
selected: I,
|
|
1614
|
+
onVoteUp: R,
|
|
1615
|
+
onVoteDown: F
|
|
1618
1616
|
}
|
|
1619
1617
|
)
|
|
1620
1618
|
] }),
|
|
1621
1619
|
J && /* @__PURE__ */ n(
|
|
1622
|
-
|
|
1620
|
+
G,
|
|
1623
1621
|
{
|
|
1624
1622
|
onClick: d,
|
|
1625
1623
|
reply_count: c.reply_count
|
|
@@ -1631,7 +1629,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1631
1629
|
c.id
|
|
1632
1630
|
)
|
|
1633
1631
|
] });
|
|
1634
|
-
}, Ca =
|
|
1632
|
+
}, Ca = $.memo(
|
|
1635
1633
|
ya,
|
|
1636
1634
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : An(e, t)
|
|
1637
1635
|
), ka = (e) => {
|
|
@@ -1674,11 +1672,7 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1674
1672
|
]
|
|
1675
1673
|
}
|
|
1676
1674
|
);
|
|
1677
|
-
}, Ta = (
|
|
1678
|
-
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1679
|
-
(t) => Rt.previewIsLoaded(t) || Rt.previewIsLoading(t)
|
|
1680
|
-
)
|
|
1681
|
-
}), Aa = ({
|
|
1675
|
+
}, Ta = ({
|
|
1682
1676
|
link: e,
|
|
1683
1677
|
onDismiss: t
|
|
1684
1678
|
}) => {
|
|
@@ -1718,22 +1712,26 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1718
1712
|
]
|
|
1719
1713
|
}
|
|
1720
1714
|
);
|
|
1721
|
-
},
|
|
1715
|
+
}, Aa = (e) => ({
|
|
1716
|
+
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1717
|
+
(t) => Rt.previewIsLoaded(t) || Rt.previewIsLoading(t)
|
|
1718
|
+
)
|
|
1719
|
+
}), Ma = () => {
|
|
1722
1720
|
const { linkPreviewsManager: e } = Xn(), { linkPreviews: t } = Kn(
|
|
1723
1721
|
e.state,
|
|
1724
|
-
|
|
1722
|
+
Aa
|
|
1725
1723
|
), s = (r) => {
|
|
1726
1724
|
e.dismissPreview(r);
|
|
1727
1725
|
};
|
|
1728
1726
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1729
|
-
|
|
1727
|
+
Ta,
|
|
1730
1728
|
{
|
|
1731
1729
|
link: r,
|
|
1732
1730
|
onDismiss: s
|
|
1733
1731
|
},
|
|
1734
1732
|
r.og_scrape_url
|
|
1735
1733
|
)) }) : null;
|
|
1736
|
-
}, ln =
|
|
1734
|
+
}, ln = $.createContext(!1), Ra = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1737
1735
|
"button",
|
|
1738
1736
|
{
|
|
1739
1737
|
...s,
|
|
@@ -1932,16 +1930,16 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1932
1930
|
De.Generating,
|
|
1933
1931
|
De.ExternalSources
|
|
1934
1932
|
]), Ha = ({ threadList: e }) => {
|
|
1935
|
-
var g,
|
|
1933
|
+
var g, p;
|
|
1936
1934
|
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Ye(), { typing: i = {} } = ss(), { aiState: o } = as(t), l = Te(cn);
|
|
1937
1935
|
if (!e && l && Ga.has(o)) {
|
|
1938
|
-
const
|
|
1936
|
+
const v = Ya(t, (g = r.user) == null ? void 0 : g.id);
|
|
1939
1937
|
return /* @__PURE__ */ n(
|
|
1940
1938
|
Ft,
|
|
1941
1939
|
{
|
|
1942
|
-
avatarId: (
|
|
1943
|
-
avatarName: (
|
|
1944
|
-
avatarImage:
|
|
1940
|
+
avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
|
|
1941
|
+
avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
|
|
1942
|
+
avatarImage: v == null ? void 0 : v.image,
|
|
1945
1943
|
testId: "typing-indicator-ai"
|
|
1946
1944
|
}
|
|
1947
1945
|
);
|
|
@@ -1949,19 +1947,19 @@ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1949
1947
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1950
1948
|
return null;
|
|
1951
1949
|
const m = e ? [] : Object.values(i).filter(
|
|
1952
|
-
({ parent_id:
|
|
1950
|
+
({ parent_id: v, user: N }) => {
|
|
1953
1951
|
var x;
|
|
1954
|
-
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && !
|
|
1952
|
+
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && !v;
|
|
1955
1953
|
}
|
|
1956
1954
|
), b = e ? Object.values(i).filter(
|
|
1957
|
-
({ parent_id:
|
|
1955
|
+
({ parent_id: v, user: N }) => {
|
|
1958
1956
|
var x;
|
|
1959
|
-
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) &&
|
|
1957
|
+
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && v === (a == null ? void 0 : a.id);
|
|
1960
1958
|
}
|
|
1961
1959
|
) : [], u = e ? b : m;
|
|
1962
1960
|
if (!u.length)
|
|
1963
1961
|
return null;
|
|
1964
|
-
const f = (
|
|
1962
|
+
const f = (p = u[0]) == null ? void 0 : p.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1965
1963
|
return /* @__PURE__ */ n(
|
|
1966
1964
|
Ft,
|
|
1967
1965
|
{
|
|
@@ -2024,7 +2022,7 @@ function Ya(e, t) {
|
|
|
2024
2022
|
const qa = () => null, Wa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2025
2023
|
"div",
|
|
2026
2024
|
{
|
|
2027
|
-
className:
|
|
2025
|
+
className: y("flex items-center justify-center h-full", e),
|
|
2028
2026
|
children: [
|
|
2029
2027
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2030
2028
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2064,7 +2062,7 @@ const qa = () => null, Wa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2064
2062
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2065
2063
|
]
|
|
2066
2064
|
}
|
|
2067
|
-
), Ee =
|
|
2065
|
+
), Ee = $.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2068
2066
|
/* @__PURE__ */ n(Wa, { className: "w-6 h-6" }),
|
|
2069
2067
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2070
2068
|
] }) }));
|
|
@@ -2085,23 +2083,23 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2085
2083
|
customChannelActions: f,
|
|
2086
2084
|
showActionsMenu: c = !0
|
|
2087
2085
|
}) => {
|
|
2088
|
-
var
|
|
2089
|
-
const { channel: g } = ce(),
|
|
2090
|
-
var
|
|
2091
|
-
const
|
|
2092
|
-
return
|
|
2093
|
-
(
|
|
2094
|
-
var
|
|
2095
|
-
return ((
|
|
2086
|
+
var E, M, D, k, T;
|
|
2087
|
+
const { channel: g } = ce(), p = $.useMemo(() => {
|
|
2088
|
+
var R, F;
|
|
2089
|
+
const _ = (R = g._client) == null ? void 0 : R.userID;
|
|
2090
|
+
return _ ? Object.values(((F = g.state) == null ? void 0 : F.members) || {}).find(
|
|
2091
|
+
(A) => {
|
|
2092
|
+
var L;
|
|
2093
|
+
return ((L = A.user) == null ? void 0 : L.id) && A.user.id !== _;
|
|
2096
2094
|
}
|
|
2097
2095
|
) : void 0;
|
|
2098
|
-
}, [(
|
|
2096
|
+
}, [(E = g._client) == null ? void 0 : E.userID, (M = g.state) == null ? void 0 : M.members]), v = Wt(p == null ? void 0 : p.user), N = (D = p == null ? void 0 : p.user) == null ? void 0 : D.image, x = qt(g), S = async () => {
|
|
2099
2097
|
try {
|
|
2100
2098
|
x ? await g.unpin() : await g.pin();
|
|
2101
|
-
} catch (
|
|
2099
|
+
} catch (_) {
|
|
2102
2100
|
console.error(
|
|
2103
2101
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2104
|
-
|
|
2102
|
+
_
|
|
2105
2103
|
);
|
|
2106
2104
|
}
|
|
2107
2105
|
};
|
|
@@ -2110,7 +2108,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2110
2108
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2111
2109
|
"button",
|
|
2112
2110
|
{
|
|
2113
|
-
className:
|
|
2111
|
+
className: y(
|
|
2114
2112
|
oe,
|
|
2115
2113
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2116
2114
|
),
|
|
@@ -2125,15 +2123,15 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2125
2123
|
/* @__PURE__ */ n(
|
|
2126
2124
|
ae,
|
|
2127
2125
|
{
|
|
2128
|
-
id: ((
|
|
2129
|
-
name:
|
|
2126
|
+
id: ((k = p == null ? void 0 : p.user) == null ? void 0 : k.id) || g.id || "unknown",
|
|
2127
|
+
name: v,
|
|
2130
2128
|
image: N,
|
|
2131
2129
|
starred: s && x,
|
|
2132
2130
|
dmAgentEnabled: a,
|
|
2133
2131
|
size: 48
|
|
2134
2132
|
}
|
|
2135
2133
|
),
|
|
2136
|
-
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children:
|
|
2134
|
+
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: v }),
|
|
2137
2135
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2138
2136
|
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2139
2137
|
/* @__PURE__ */ n("span", { children: Bt })
|
|
@@ -2144,13 +2142,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2144
2142
|
"button",
|
|
2145
2143
|
{
|
|
2146
2144
|
className: oe,
|
|
2147
|
-
onClick:
|
|
2145
|
+
onClick: S,
|
|
2148
2146
|
type: "button",
|
|
2149
2147
|
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
2150
2148
|
children: /* @__PURE__ */ n(
|
|
2151
2149
|
Fe,
|
|
2152
2150
|
{
|
|
2153
|
-
className:
|
|
2151
|
+
className: y("size-5", {
|
|
2154
2152
|
"text-yellow-600": x,
|
|
2155
2153
|
"text-black/90": !x
|
|
2156
2154
|
}),
|
|
@@ -2163,7 +2161,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2163
2161
|
Pt,
|
|
2164
2162
|
{
|
|
2165
2163
|
channel: g,
|
|
2166
|
-
participant:
|
|
2164
|
+
participant: p,
|
|
2167
2165
|
showDeleteConversation: o,
|
|
2168
2166
|
showBlockParticipant: l,
|
|
2169
2167
|
showReportParticipant: d,
|
|
@@ -2173,7 +2171,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2173
2171
|
onBlockParticipantClick: b,
|
|
2174
2172
|
onReportParticipantClick: u,
|
|
2175
2173
|
customChannelActions: f,
|
|
2176
|
-
triggerClassName:
|
|
2174
|
+
triggerClassName: y(oe, "bg-[#F1F0EE]")
|
|
2177
2175
|
}
|
|
2178
2176
|
)
|
|
2179
2177
|
] })
|
|
@@ -2183,7 +2181,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2183
2181
|
t && e && /* @__PURE__ */ n(
|
|
2184
2182
|
"button",
|
|
2185
2183
|
{
|
|
2186
|
-
className:
|
|
2184
|
+
className: y(
|
|
2187
2185
|
oe,
|
|
2188
2186
|
"messaging-channel-view-back-button-desktop"
|
|
2189
2187
|
),
|
|
@@ -2196,8 +2194,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2196
2194
|
/* @__PURE__ */ n(
|
|
2197
2195
|
ae,
|
|
2198
2196
|
{
|
|
2199
|
-
id: ((
|
|
2200
|
-
name:
|
|
2197
|
+
id: ((T = p == null ? void 0 : p.user) == null ? void 0 : T.id) || g.id || "unknown",
|
|
2198
|
+
name: v,
|
|
2201
2199
|
image: N,
|
|
2202
2200
|
starred: s && x,
|
|
2203
2201
|
dmAgentEnabled: a,
|
|
@@ -2205,7 +2203,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2205
2203
|
}
|
|
2206
2204
|
),
|
|
2207
2205
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2208
|
-
/* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children:
|
|
2206
|
+
/* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: v }),
|
|
2209
2207
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2210
2208
|
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2211
2209
|
/* @__PURE__ */ n("span", { className: "truncate", children: Bt })
|
|
@@ -2217,13 +2215,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2217
2215
|
"button",
|
|
2218
2216
|
{
|
|
2219
2217
|
className: oe,
|
|
2220
|
-
onClick:
|
|
2218
|
+
onClick: S,
|
|
2221
2219
|
type: "button",
|
|
2222
2220
|
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
2223
2221
|
children: /* @__PURE__ */ n(
|
|
2224
2222
|
Fe,
|
|
2225
2223
|
{
|
|
2226
|
-
className:
|
|
2224
|
+
className: y("size-6", {
|
|
2227
2225
|
"text-yellow-600": x,
|
|
2228
2226
|
"text-black/90": !x
|
|
2229
2227
|
}),
|
|
@@ -2236,7 +2234,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2236
2234
|
Pt,
|
|
2237
2235
|
{
|
|
2238
2236
|
channel: g,
|
|
2239
|
-
participant:
|
|
2237
|
+
participant: p,
|
|
2240
2238
|
showDeleteConversation: o,
|
|
2241
2239
|
showBlockParticipant: l,
|
|
2242
2240
|
showReportParticipant: d,
|
|
@@ -2268,51 +2266,51 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2268
2266
|
showReportParticipant: f = !0,
|
|
2269
2267
|
composerDisabled: c = !1,
|
|
2270
2268
|
composerDisabledReason: g,
|
|
2271
|
-
showStarButton:
|
|
2272
|
-
chatbotVotingEnabled:
|
|
2269
|
+
showStarButton: p = !1,
|
|
2270
|
+
chatbotVotingEnabled: v = !1,
|
|
2273
2271
|
renderChannelBanner: N,
|
|
2274
2272
|
customChannelActions: x,
|
|
2275
|
-
renderMessage:
|
|
2276
|
-
dmAgentEnabled:
|
|
2277
|
-
viewerLanguage:
|
|
2278
|
-
showChannelInfo:
|
|
2273
|
+
renderMessage: S,
|
|
2274
|
+
dmAgentEnabled: E = !1,
|
|
2275
|
+
viewerLanguage: M,
|
|
2276
|
+
showChannelInfo: D = !0
|
|
2279
2277
|
}) => {
|
|
2280
|
-
var
|
|
2281
|
-
const { channel:
|
|
2282
|
-
var w,
|
|
2283
|
-
const
|
|
2284
|
-
return
|
|
2285
|
-
(
|
|
2278
|
+
var L, z, V, B, U, X;
|
|
2279
|
+
const { channel: k } = ce(), T = $.useMemo(() => {
|
|
2280
|
+
var w, C;
|
|
2281
|
+
const G = (w = k._client) == null ? void 0 : w.userID;
|
|
2282
|
+
return G ? Object.values(((C = k.state) == null ? void 0 : C.members) || {}).find(
|
|
2283
|
+
(j) => {
|
|
2286
2284
|
var q;
|
|
2287
|
-
return ((q =
|
|
2285
|
+
return ((q = j.user) == null ? void 0 : q.id) && j.user.id !== G;
|
|
2288
2286
|
}
|
|
2289
2287
|
) : void 0;
|
|
2290
|
-
}, [(
|
|
2291
|
-
var w,
|
|
2292
|
-
const
|
|
2293
|
-
return
|
|
2288
|
+
}, [(L = k._client) == null ? void 0 : L.userID, (z = k.state) == null ? void 0 : z.members]), _ = $.useMemo(() => {
|
|
2289
|
+
var w, C;
|
|
2290
|
+
const G = (w = k._client) == null ? void 0 : w.userID;
|
|
2291
|
+
return G ? Object.values(((C = k.state) == null ? void 0 : C.members) || {}).find((j) => {
|
|
2294
2292
|
var q;
|
|
2295
|
-
return ((q =
|
|
2293
|
+
return ((q = j.user) == null ? void 0 : q.id) === G;
|
|
2296
2294
|
}) : void 0;
|
|
2297
|
-
}, [(
|
|
2298
|
-
(
|
|
2299
|
-
const { message:
|
|
2295
|
+
}, [(V = k._client) == null ? void 0 : V.userID, (B = k.state) == null ? void 0 : B.members]), I = ((U = _ == null ? void 0 : _.user) == null ? void 0 : U.is_account) ?? (_ == null ? void 0 : _.is_account), R = ((X = T == null ? void 0 : T.user) == null ? void 0 : X.is_account) ?? (T == null ? void 0 : T.is_account), F = E && I === !1 && R === !0, A = W(
|
|
2296
|
+
(G) => {
|
|
2297
|
+
const { message: O } = pe("ChannelView"), w = /* @__PURE__ */ n(
|
|
2300
2298
|
ka,
|
|
2301
2299
|
{
|
|
2302
|
-
...
|
|
2303
|
-
chatbotVotingEnabled:
|
|
2304
|
-
viewerLanguage:
|
|
2300
|
+
...G,
|
|
2301
|
+
chatbotVotingEnabled: v,
|
|
2302
|
+
viewerLanguage: M
|
|
2305
2303
|
}
|
|
2306
2304
|
);
|
|
2307
|
-
return !
|
|
2305
|
+
return !S || !O ? w : S(w, O);
|
|
2308
2306
|
},
|
|
2309
|
-
[
|
|
2307
|
+
[v, S, M]
|
|
2310
2308
|
);
|
|
2311
2309
|
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
2312
2310
|
is,
|
|
2313
2311
|
{
|
|
2314
2312
|
overrides: {
|
|
2315
|
-
Message:
|
|
2313
|
+
Message: A,
|
|
2316
2314
|
MessageActions: Ia
|
|
2317
2315
|
},
|
|
2318
2316
|
children: /* @__PURE__ */ h(os, { children: [
|
|
@@ -2321,9 +2319,9 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2321
2319
|
{
|
|
2322
2320
|
onBack: e,
|
|
2323
2321
|
showBackButton: t,
|
|
2324
|
-
showActionsMenu:
|
|
2325
|
-
showStarButton:
|
|
2326
|
-
dmAgentEnabled:
|
|
2322
|
+
showActionsMenu: D,
|
|
2323
|
+
showStarButton: p,
|
|
2324
|
+
dmAgentEnabled: F,
|
|
2327
2325
|
onLeaveConversation: i,
|
|
2328
2326
|
onBlockParticipant: o,
|
|
2329
2327
|
showDeleteConversation: l,
|
|
@@ -2335,7 +2333,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2335
2333
|
customChannelActions: x
|
|
2336
2334
|
}
|
|
2337
2335
|
) }, "lt-channel-header"),
|
|
2338
|
-
N ? /* @__PURE__ */ n(
|
|
2336
|
+
N ? /* @__PURE__ */ n($.Fragment, { children: N() }, "lt-channel-banner") : null,
|
|
2339
2337
|
/* @__PURE__ */ n(
|
|
2340
2338
|
"div",
|
|
2341
2339
|
{
|
|
@@ -2344,14 +2342,14 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2344
2342
|
},
|
|
2345
2343
|
"lt-channel-message-list"
|
|
2346
2344
|
),
|
|
2347
|
-
r ? /* @__PURE__ */ n(
|
|
2345
|
+
r ? /* @__PURE__ */ n($.Fragment, { children: r(k) }, "lt-channel-conversation-footer") : null,
|
|
2348
2346
|
/* @__PURE__ */ n(
|
|
2349
2347
|
Da,
|
|
2350
2348
|
{
|
|
2351
2349
|
...s && {
|
|
2352
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2350
|
+
renderActions: () => s == null ? void 0 : s(k)
|
|
2353
2351
|
},
|
|
2354
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2352
|
+
renderFooter: () => a == null ? void 0 : a(k),
|
|
2355
2353
|
disabled: c,
|
|
2356
2354
|
disabledReason: g
|
|
2357
2355
|
},
|
|
@@ -2360,7 +2358,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2360
2358
|
] })
|
|
2361
2359
|
}
|
|
2362
2360
|
) });
|
|
2363
|
-
}, dn =
|
|
2361
|
+
}, dn = $.memo(
|
|
2364
2362
|
({
|
|
2365
2363
|
channel: e,
|
|
2366
2364
|
onBack: t,
|
|
@@ -2377,59 +2375,59 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2377
2375
|
onBlockParticipantClick: f,
|
|
2378
2376
|
onReportParticipantClick: c,
|
|
2379
2377
|
showBlockParticipant: g = !0,
|
|
2380
|
-
showReportParticipant:
|
|
2381
|
-
composerDisabled:
|
|
2378
|
+
showReportParticipant: p = !0,
|
|
2379
|
+
composerDisabled: v = !1,
|
|
2382
2380
|
composerDisabledReason: N,
|
|
2383
2381
|
dmAgentEnabled: x,
|
|
2384
|
-
messageMetadata:
|
|
2385
|
-
onMessageSent:
|
|
2386
|
-
showStarButton:
|
|
2387
|
-
chatbotVotingEnabled:
|
|
2388
|
-
renderChannelBanner:
|
|
2389
|
-
customChannelActions:
|
|
2390
|
-
renderMessage:
|
|
2391
|
-
onMessageLinkClick:
|
|
2392
|
-
sendButton:
|
|
2393
|
-
attachmentPreviewList:
|
|
2394
|
-
viewerLanguage:
|
|
2395
|
-
showChannelInfo:
|
|
2382
|
+
messageMetadata: S,
|
|
2383
|
+
onMessageSent: E,
|
|
2384
|
+
showStarButton: M = !1,
|
|
2385
|
+
chatbotVotingEnabled: D = !1,
|
|
2386
|
+
renderChannelBanner: k,
|
|
2387
|
+
customChannelActions: T,
|
|
2388
|
+
renderMessage: _,
|
|
2389
|
+
onMessageLinkClick: I,
|
|
2390
|
+
sendButton: R,
|
|
2391
|
+
attachmentPreviewList: F,
|
|
2392
|
+
viewerLanguage: A,
|
|
2393
|
+
showChannelInfo: L = !0
|
|
2396
2394
|
}) => {
|
|
2397
|
-
const
|
|
2398
|
-
async (
|
|
2395
|
+
const z = W(
|
|
2396
|
+
async (B, U, X) => {
|
|
2399
2397
|
var q;
|
|
2400
|
-
const
|
|
2401
|
-
...
|
|
2402
|
-
...
|
|
2403
|
-
...
|
|
2398
|
+
const G = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, O = x && !G, w = {
|
|
2399
|
+
...U,
|
|
2400
|
+
...O && { silent: !0 },
|
|
2401
|
+
...S && {
|
|
2404
2402
|
metadata: {
|
|
2405
|
-
...
|
|
2406
|
-
...
|
|
2403
|
+
...U.metadata ?? {},
|
|
2404
|
+
...S
|
|
2407
2405
|
}
|
|
2408
2406
|
}
|
|
2409
|
-
},
|
|
2407
|
+
}, C = {
|
|
2410
2408
|
...X,
|
|
2411
|
-
...
|
|
2412
|
-
},
|
|
2413
|
-
return
|
|
2409
|
+
...O && { skip_push: !0 }
|
|
2410
|
+
}, j = await e.sendMessage(w, C);
|
|
2411
|
+
return E == null || E(j), j;
|
|
2414
2412
|
},
|
|
2415
|
-
[e, x,
|
|
2416
|
-
),
|
|
2413
|
+
[e, x, S, E]
|
|
2414
|
+
), V = H(null);
|
|
2417
2415
|
return Y(() => {
|
|
2418
|
-
if (!
|
|
2419
|
-
const
|
|
2420
|
-
if (
|
|
2421
|
-
const
|
|
2422
|
-
const
|
|
2416
|
+
if (!I) return;
|
|
2417
|
+
const B = V.current;
|
|
2418
|
+
if (!B) return;
|
|
2419
|
+
const U = (X) => {
|
|
2420
|
+
const G = X.target, O = G == null ? void 0 : G.closest("a[href]"), w = O == null ? void 0 : O.getAttribute("href");
|
|
2423
2421
|
if (!w) return;
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2422
|
+
const C = O == null ? void 0 : O.closest("[data-message-id]"), j = C == null ? void 0 : C.getAttribute("data-message-id"), q = j ? e.state.messages.find((_e) => _e.id === j) : void 0;
|
|
2423
|
+
I(w, q);
|
|
2426
2424
|
};
|
|
2427
|
-
return
|
|
2428
|
-
}, [
|
|
2425
|
+
return B.addEventListener("click", U), () => B.removeEventListener("click", U);
|
|
2426
|
+
}, [I, e]), /* @__PURE__ */ n(
|
|
2429
2427
|
"div",
|
|
2430
2428
|
{
|
|
2431
|
-
ref:
|
|
2432
|
-
className:
|
|
2429
|
+
ref: V,
|
|
2430
|
+
className: y(
|
|
2433
2431
|
"messaging-channel-view h-full flex flex-col",
|
|
2434
2432
|
d
|
|
2435
2433
|
),
|
|
@@ -2442,9 +2440,9 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2442
2440
|
LoadingIndicator: Ee,
|
|
2443
2441
|
DateSeparator: Us,
|
|
2444
2442
|
TypingIndicator: Ha,
|
|
2445
|
-
doSendMessageRequest:
|
|
2446
|
-
...
|
|
2447
|
-
...
|
|
2443
|
+
doSendMessageRequest: z,
|
|
2444
|
+
...R ? { SendButton: R } : {},
|
|
2445
|
+
...F ? { AttachmentPreviewList: F } : {},
|
|
2448
2446
|
children: /* @__PURE__ */ n(
|
|
2449
2447
|
Ka,
|
|
2450
2448
|
{
|
|
@@ -2461,17 +2459,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2461
2459
|
onBlockParticipantClick: f,
|
|
2462
2460
|
onReportParticipantClick: c,
|
|
2463
2461
|
showBlockParticipant: g,
|
|
2464
|
-
showReportParticipant:
|
|
2465
|
-
composerDisabled:
|
|
2462
|
+
showReportParticipant: p,
|
|
2463
|
+
composerDisabled: v,
|
|
2466
2464
|
composerDisabledReason: N,
|
|
2467
|
-
showStarButton:
|
|
2465
|
+
showStarButton: M,
|
|
2468
2466
|
dmAgentEnabled: x,
|
|
2469
|
-
chatbotVotingEnabled:
|
|
2470
|
-
renderChannelBanner:
|
|
2471
|
-
customChannelActions:
|
|
2472
|
-
renderMessage:
|
|
2473
|
-
viewerLanguage:
|
|
2474
|
-
showChannelInfo:
|
|
2467
|
+
chatbotVotingEnabled: D,
|
|
2468
|
+
renderChannelBanner: k,
|
|
2469
|
+
customChannelActions: T,
|
|
2470
|
+
renderMessage: _,
|
|
2471
|
+
viewerLanguage: A,
|
|
2472
|
+
showChannelInfo: L
|
|
2475
2473
|
}
|
|
2476
2474
|
)
|
|
2477
2475
|
}
|
|
@@ -2481,7 +2479,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2481
2479
|
}
|
|
2482
2480
|
);
|
|
2483
2481
|
dn.displayName = "ChannelView";
|
|
2484
|
-
const fe =
|
|
2482
|
+
const fe = $.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: [
|
|
2485
2483
|
/* @__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: "⚠️" }) }),
|
|
2486
2484
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2487
2485
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2512,73 +2510,73 @@ const yi = ({
|
|
|
2512
2510
|
chatbotVotingEnabled: f = !1,
|
|
2513
2511
|
viewerLanguage: c,
|
|
2514
2512
|
renderChannelBanner: g,
|
|
2515
|
-
customChannelActions:
|
|
2516
|
-
renderMessage:
|
|
2513
|
+
customChannelActions: p,
|
|
2514
|
+
renderMessage: v,
|
|
2517
2515
|
onMessageLinkClick: N,
|
|
2518
2516
|
showChannelInfo: x
|
|
2519
2517
|
}) => {
|
|
2520
2518
|
const {
|
|
2521
|
-
client:
|
|
2522
|
-
isConnected:
|
|
2523
|
-
isLoading:
|
|
2524
|
-
error:
|
|
2525
|
-
refreshConnection:
|
|
2526
|
-
service:
|
|
2527
|
-
debug:
|
|
2528
|
-
} = Ds(), [
|
|
2529
|
-
|
|
2530
|
-
const
|
|
2531
|
-
|
|
2532
|
-
const X = H(null),
|
|
2519
|
+
client: S,
|
|
2520
|
+
isConnected: E,
|
|
2521
|
+
isLoading: M,
|
|
2522
|
+
error: D,
|
|
2523
|
+
refreshConnection: k,
|
|
2524
|
+
service: T,
|
|
2525
|
+
debug: _
|
|
2526
|
+
} = Ds(), [I, R] = P(null), [F, A] = P(null), [L, z] = P(!1), { showDeleteConversation: V = !0 } = e, B = H(o);
|
|
2527
|
+
B.current = o;
|
|
2528
|
+
const U = H(a);
|
|
2529
|
+
U.current = a;
|
|
2530
|
+
const X = H(null), G = H(null);
|
|
2533
2531
|
Y(() => {
|
|
2534
|
-
|
|
2535
|
-
}, [
|
|
2536
|
-
if (!
|
|
2537
|
-
const
|
|
2538
|
-
if (!
|
|
2539
|
-
const
|
|
2540
|
-
if (X.current ===
|
|
2541
|
-
X.current =
|
|
2532
|
+
G.current = I;
|
|
2533
|
+
}, [I]), Y(() => {
|
|
2534
|
+
if (!S || !E) return;
|
|
2535
|
+
const C = S.userID;
|
|
2536
|
+
if (!C) return;
|
|
2537
|
+
const j = `${C}::${i}`;
|
|
2538
|
+
if (X.current === j) return;
|
|
2539
|
+
X.current = j;
|
|
2542
2540
|
const q = () => {
|
|
2543
|
-
X.current ===
|
|
2541
|
+
X.current === j && (X.current = null);
|
|
2544
2542
|
};
|
|
2545
2543
|
(async () => {
|
|
2546
2544
|
var K, re;
|
|
2547
2545
|
try {
|
|
2548
|
-
|
|
2546
|
+
_ && console.log(
|
|
2549
2547
|
"[MessagingShell] Loading initial conversation with:",
|
|
2550
2548
|
i
|
|
2551
2549
|
);
|
|
2552
|
-
const J = await
|
|
2550
|
+
const J = await S.queryChannels(
|
|
2553
2551
|
{
|
|
2554
2552
|
type: "messaging",
|
|
2555
|
-
members: { $eq: [
|
|
2553
|
+
members: { $eq: [C, i] }
|
|
2556
2554
|
},
|
|
2557
2555
|
{},
|
|
2558
2556
|
{ limit: 1 }
|
|
2559
2557
|
);
|
|
2560
2558
|
if (J.length > 0) {
|
|
2561
|
-
|
|
2559
|
+
R(J[0]), A(null), (K = U.current) == null || K.call(U, J[0]), _ && console.log(
|
|
2562
2560
|
"[MessagingShell] Initial conversation loaded:",
|
|
2563
2561
|
J[0].id
|
|
2564
2562
|
);
|
|
2565
2563
|
return;
|
|
2566
2564
|
}
|
|
2567
|
-
const se =
|
|
2568
|
-
if (!se || !
|
|
2569
|
-
q(),
|
|
2565
|
+
const se = B.current;
|
|
2566
|
+
if (!se || !T) {
|
|
2567
|
+
q(), A("No conversation found with this account"), _ && console.log(
|
|
2570
2568
|
"[MessagingShell] No conversation found for:",
|
|
2571
2569
|
i
|
|
2572
2570
|
);
|
|
2573
2571
|
return;
|
|
2574
2572
|
}
|
|
2575
2573
|
try {
|
|
2576
|
-
const Q = await
|
|
2574
|
+
const Q = await T.startChannelWithParticipant({
|
|
2577
2575
|
id: se.id,
|
|
2578
2576
|
name: se.name,
|
|
2579
2577
|
phone: se.phone
|
|
2580
2578
|
});
|
|
2581
|
-
|
|
2579
|
+
R(Q), A(null), (re = U.current) == null || re.call(U, Q), _ && console.log(
|
|
2582
2580
|
"[MessagingShell] Channel created and loaded:",
|
|
2583
2581
|
Q.id
|
|
2584
2582
|
);
|
|
@@ -2586,51 +2584,51 @@ const yi = ({
|
|
|
2586
2584
|
console.error(
|
|
2587
2585
|
"[MessagingShell] Failed to create conversation:",
|
|
2588
2586
|
Q
|
|
2589
|
-
), q(),
|
|
2587
|
+
), q(), A("Failed to create conversation");
|
|
2590
2588
|
}
|
|
2591
2589
|
} catch (J) {
|
|
2592
2590
|
console.error(
|
|
2593
2591
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2594
2592
|
J
|
|
2595
|
-
), q(),
|
|
2593
|
+
), q(), G.current || A("Failed to load conversation");
|
|
2596
2594
|
}
|
|
2597
2595
|
})();
|
|
2598
|
-
}, [i,
|
|
2599
|
-
const
|
|
2600
|
-
|
|
2596
|
+
}, [i, S, E, T, _]);
|
|
2597
|
+
const O = H(r);
|
|
2598
|
+
O.current = r;
|
|
2601
2599
|
const w = W(() => {
|
|
2602
|
-
var
|
|
2603
|
-
|
|
2600
|
+
var C;
|
|
2601
|
+
R(null), z(!0), (C = O.current) == null || C.call(O);
|
|
2604
2602
|
}, []);
|
|
2605
|
-
return
|
|
2603
|
+
return M ? /* @__PURE__ */ n(Ee, {}) : D ? /* @__PURE__ */ n(fe, { message: D, onBack: k }) : !E || !S ? /* @__PURE__ */ n(
|
|
2606
2604
|
fe,
|
|
2607
2605
|
{
|
|
2608
2606
|
message: "Not connected to messaging service",
|
|
2609
|
-
onBack:
|
|
2607
|
+
onBack: k
|
|
2610
2608
|
}
|
|
2611
|
-
) :
|
|
2609
|
+
) : F ? /* @__PURE__ */ n(fe, { message: F }) : L && !I ? /* @__PURE__ */ n(fe, { 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(
|
|
2612
2610
|
dn,
|
|
2613
2611
|
{
|
|
2614
|
-
channel:
|
|
2612
|
+
channel: I,
|
|
2615
2613
|
renderMessageInputActions: t,
|
|
2616
2614
|
renderConversationFooter: s,
|
|
2617
2615
|
renderChannelBanner: g,
|
|
2618
2616
|
onLeaveConversation: w,
|
|
2619
2617
|
onBlockParticipant: w,
|
|
2620
2618
|
CustomChannelEmptyState: l,
|
|
2621
|
-
showDeleteConversation:
|
|
2619
|
+
showDeleteConversation: V,
|
|
2622
2620
|
onBlockParticipantClick: d,
|
|
2623
2621
|
onReportParticipantClick: m,
|
|
2624
2622
|
dmAgentEnabled: b,
|
|
2625
2623
|
onMessageSent: u,
|
|
2626
2624
|
chatbotVotingEnabled: f,
|
|
2627
2625
|
viewerLanguage: c,
|
|
2628
|
-
customChannelActions:
|
|
2629
|
-
renderMessage:
|
|
2626
|
+
customChannelActions: p,
|
|
2627
|
+
renderMessage: v,
|
|
2630
2628
|
onMessageLinkClick: N,
|
|
2631
2629
|
showChannelInfo: x
|
|
2632
2630
|
},
|
|
2633
|
-
|
|
2631
|
+
I.id
|
|
2634
2632
|
) }) }) : /* @__PURE__ */ n(Ee, {});
|
|
2635
2633
|
};
|
|
2636
2634
|
function Ja(e) {
|
|
@@ -2639,14 +2637,14 @@ function Ja(e) {
|
|
|
2639
2637
|
for (const s of t)
|
|
2640
2638
|
e.state.addMessageSorted(s.message);
|
|
2641
2639
|
}
|
|
2642
|
-
const un =
|
|
2640
|
+
const un = $.createContext({
|
|
2643
2641
|
selectedChannel: void 0,
|
|
2644
2642
|
onChannelSelect: () => {
|
|
2645
2643
|
},
|
|
2646
2644
|
debug: !1,
|
|
2647
2645
|
renderMessagePreview: void 0,
|
|
2648
2646
|
viewerLanguage: void 0
|
|
2649
|
-
}), Za = un.Provider, Qa = () =>
|
|
2647
|
+
}), Za = un.Provider, Qa = () => $.useContext(un), er = (e, t) => {
|
|
2650
2648
|
const s = new Date(
|
|
2651
2649
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2652
2650
|
), r = new Date(
|
|
@@ -2667,9 +2665,9 @@ const un = z.createContext({
|
|
|
2667
2665
|
day: "numeric",
|
|
2668
2666
|
year: "2-digit"
|
|
2669
2667
|
});
|
|
2670
|
-
}, mn =
|
|
2668
|
+
}, mn = $.memo(
|
|
2671
2669
|
({ channel: e, unread: t }) => {
|
|
2672
|
-
var
|
|
2670
|
+
var D, k, T;
|
|
2673
2671
|
const {
|
|
2674
2672
|
selectedChannel: s,
|
|
2675
2673
|
onChannelSelect: a,
|
|
@@ -2678,39 +2676,39 @@ const un = z.createContext({
|
|
|
2678
2676
|
viewerLanguage: o
|
|
2679
2677
|
} = Qa(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2680
2678
|
e && a(e);
|
|
2681
|
-
}, m = (
|
|
2682
|
-
const
|
|
2683
|
-
!
|
|
2684
|
-
}, u = Object.values(((
|
|
2685
|
-
(
|
|
2686
|
-
var
|
|
2687
|
-
return ((
|
|
2679
|
+
}, m = (_) => {
|
|
2680
|
+
const I = _.key === "Enter" || _.key === " ", R = _.repeat;
|
|
2681
|
+
!I || R || (_.preventDefault(), d());
|
|
2682
|
+
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
2683
|
+
(_) => {
|
|
2684
|
+
var I, R;
|
|
2685
|
+
return ((I = _.user) == null ? void 0 : I.id) && _.user.id !== ((R = e == null ? void 0 : e._client) == null ? void 0 : R.userID);
|
|
2688
2686
|
}
|
|
2689
|
-
), f = Wt(u == null ? void 0 : u.user), c = (
|
|
2690
|
-
var
|
|
2691
|
-
const
|
|
2692
|
-
if (
|
|
2693
|
-
for (let
|
|
2694
|
-
if (
|
|
2687
|
+
), f = Wt(u == null ? void 0 : u.user), c = (k = u == null ? void 0 : u.user) == null ? void 0 : k.image, g = (() => {
|
|
2688
|
+
var I;
|
|
2689
|
+
const _ = (I = e == null ? void 0 : e.state) == null ? void 0 : I.messages;
|
|
2690
|
+
if (_ != null && _.length) {
|
|
2691
|
+
for (let R = _.length - 1; R >= 0; R--)
|
|
2692
|
+
if (_[R].type !== "system") return _[R];
|
|
2695
2693
|
}
|
|
2696
|
-
})(),
|
|
2697
|
-
var
|
|
2698
|
-
const
|
|
2694
|
+
})(), v = (() => {
|
|
2695
|
+
var L, z, V, B;
|
|
2696
|
+
const _ = Xt({
|
|
2699
2697
|
message: g,
|
|
2700
2698
|
viewerLanguage: o
|
|
2701
2699
|
});
|
|
2702
|
-
if (((
|
|
2703
|
-
if (((
|
|
2704
|
-
if (((
|
|
2705
|
-
if (
|
|
2706
|
-
const
|
|
2707
|
-
return
|
|
2708
|
-
})(), N = g != null && g.created_at ? tr(new Date(g.created_at)) : "", x = g ? ke(g) : !1,
|
|
2700
|
+
if (((L = g == null ? void 0 : g.metadata) == null ? void 0 : L.custom_type) === "MESSAGE_TIP") return _ ? `💵 ${_}` : "💵 Sent a tip";
|
|
2701
|
+
if (((z = g == null ? void 0 : g.metadata) == null ? void 0 : z.custom_type) === "MESSAGE_PAID") return _ ? `💰 ${_}` : "💰 Sent a message";
|
|
2702
|
+
if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_ATTACHMENT") return _ ? `📎 ${_}` : "📎 Sent an attachment";
|
|
2703
|
+
if (_) return _;
|
|
2704
|
+
const A = (B = g == null ? void 0 : g.attachments) == null ? void 0 : B[0];
|
|
2705
|
+
return A ? A.og_scrape_url ? A.og_scrape_url : A.type === "image" ? "📷 Sent an image" : A.type === "video" ? "🎥 Sent a video" : A.type === "audio" ? "🎵 Sent audio" : A.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2706
|
+
})(), N = g != null && g.created_at ? tr(new Date(g.created_at)) : "", x = g ? ke(g) : !1, S = i ? i(g, v) : `${x ? "✨ " : ""}${v}`, E = qt(e), M = t ?? 0;
|
|
2709
2707
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2710
2708
|
channelId: e == null ? void 0 : e.id,
|
|
2711
2709
|
isSelected: l,
|
|
2712
2710
|
participantName: f,
|
|
2713
|
-
unreadCount:
|
|
2711
|
+
unreadCount: M,
|
|
2714
2712
|
hasTimestamp: !!N
|
|
2715
2713
|
}), /* @__PURE__ */ n(
|
|
2716
2714
|
"div",
|
|
@@ -2719,7 +2717,7 @@ const un = z.createContext({
|
|
|
2719
2717
|
tabIndex: 0,
|
|
2720
2718
|
onClick: d,
|
|
2721
2719
|
onKeyDown: m,
|
|
2722
|
-
className:
|
|
2720
|
+
className: y(
|
|
2723
2721
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2724
2722
|
{
|
|
2725
2723
|
"bg-black/[0.04]": l,
|
|
@@ -2730,11 +2728,11 @@ const un = z.createContext({
|
|
|
2730
2728
|
/* @__PURE__ */ n(
|
|
2731
2729
|
ae,
|
|
2732
2730
|
{
|
|
2733
|
-
id: ((
|
|
2731
|
+
id: ((T = u == null ? void 0 : u.user) == null ? void 0 : T.id) || e.id || "unknown",
|
|
2734
2732
|
name: f,
|
|
2735
2733
|
image: c,
|
|
2736
2734
|
size: 48,
|
|
2737
|
-
starred:
|
|
2735
|
+
starred: E
|
|
2738
2736
|
}
|
|
2739
2737
|
),
|
|
2740
2738
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2742,11 +2740,11 @@ const un = z.createContext({
|
|
|
2742
2740
|
/* @__PURE__ */ h(
|
|
2743
2741
|
"h3",
|
|
2744
2742
|
{
|
|
2745
|
-
className:
|
|
2743
|
+
className: y(
|
|
2746
2744
|
"text-sm font-medium truncate text-[#191918]"
|
|
2747
2745
|
),
|
|
2748
2746
|
children: [
|
|
2749
|
-
|
|
2747
|
+
E && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2750
2748
|
f
|
|
2751
2749
|
]
|
|
2752
2750
|
}
|
|
@@ -2754,8 +2752,8 @@ const un = z.createContext({
|
|
|
2754
2752
|
N && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
|
|
2755
2753
|
] }),
|
|
2756
2754
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2757
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2758
|
-
|
|
2755
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: S }),
|
|
2756
|
+
M > 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: M > 99 ? "99+" : M })
|
|
2759
2757
|
] })
|
|
2760
2758
|
] })
|
|
2761
2759
|
] })
|
|
@@ -2764,7 +2762,7 @@ const un = z.createContext({
|
|
|
2764
2762
|
}
|
|
2765
2763
|
);
|
|
2766
2764
|
mn.displayName = "CustomChannelPreview";
|
|
2767
|
-
const nr = { last_message_at: -1 }, sr =
|
|
2765
|
+
const nr = { last_message_at: -1 }, sr = $.memo(
|
|
2768
2766
|
({
|
|
2769
2767
|
onChannelSelect: e,
|
|
2770
2768
|
selectedChannel: t,
|
|
@@ -2777,12 +2775,12 @@ const nr = { last_message_at: -1 }, sr = z.memo(
|
|
|
2777
2775
|
renderMessagePreview: d,
|
|
2778
2776
|
viewerLanguage: m
|
|
2779
2777
|
}) => {
|
|
2780
|
-
const b =
|
|
2778
|
+
const b = $.useRef(0);
|
|
2781
2779
|
b.current++;
|
|
2782
|
-
const { debug: u = !1 } = qe(), f =
|
|
2780
|
+
const { debug: u = !1 } = qe(), f = $.useCallback(
|
|
2783
2781
|
(g) => {
|
|
2784
|
-
for (const
|
|
2785
|
-
Ja(
|
|
2782
|
+
for (const p of g)
|
|
2783
|
+
Ja(p);
|
|
2786
2784
|
return r ? r(g) : g;
|
|
2787
2785
|
},
|
|
2788
2786
|
[r]
|
|
@@ -2792,7 +2790,7 @@ const nr = { last_message_at: -1 }, sr = z.memo(
|
|
|
2792
2790
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2793
2791
|
filters: s
|
|
2794
2792
|
});
|
|
2795
|
-
const c =
|
|
2793
|
+
const c = $.useMemo(
|
|
2796
2794
|
() => ({
|
|
2797
2795
|
selectedChannel: t,
|
|
2798
2796
|
onChannelSelect: e,
|
|
@@ -2811,7 +2809,7 @@ const nr = { last_message_at: -1 }, sr = z.memo(
|
|
|
2811
2809
|
return /* @__PURE__ */ n(
|
|
2812
2810
|
"div",
|
|
2813
2811
|
{
|
|
2814
|
-
className:
|
|
2812
|
+
className: y(
|
|
2815
2813
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2816
2814
|
o
|
|
2817
2815
|
),
|
|
@@ -2849,7 +2847,7 @@ const ir = {
|
|
|
2849
2847
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2850
2848
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2851
2849
|
}, or = ({ variant: e, cta: t }) => {
|
|
2852
|
-
const s =
|
|
2850
|
+
const s = y(
|
|
2853
2851
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2854
2852
|
ir[e]
|
|
2855
2853
|
), a = Qe(t.href);
|
|
@@ -2896,10 +2894,10 @@ const ir = {
|
|
|
2896
2894
|
}) => {
|
|
2897
2895
|
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", b = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", g = o != null;
|
|
2898
2896
|
if (!b && !u && !c && !g) return null;
|
|
2899
|
-
const
|
|
2897
|
+
const v = y(
|
|
2900
2898
|
"truncate text-base font-medium leading-6",
|
|
2901
2899
|
d && !t ? cr : lr[e]
|
|
2902
|
-
), N =
|
|
2900
|
+
), N = y(
|
|
2903
2901
|
"truncate text-xs leading-4",
|
|
2904
2902
|
dr[e]
|
|
2905
2903
|
);
|
|
@@ -2909,7 +2907,7 @@ const ir = {
|
|
|
2909
2907
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2910
2908
|
b && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2911
2909
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2912
|
-
/* @__PURE__ */ n("p", { className:
|
|
2910
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", v), children: m })
|
|
2913
2911
|
] }),
|
|
2914
2912
|
u && /* @__PURE__ */ n("p", { className: N, children: a })
|
|
2915
2913
|
] }),
|
|
@@ -2919,7 +2917,7 @@ const ir = {
|
|
|
2919
2917
|
] }),
|
|
2920
2918
|
o && /* @__PURE__ */ n(or, { variant: e, cta: o })
|
|
2921
2919
|
] });
|
|
2922
|
-
}, ur =
|
|
2920
|
+
}, ur = y(
|
|
2923
2921
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2924
2922
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2925
2923
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2937,7 +2935,7 @@ const ir = {
|
|
|
2937
2935
|
bgClassName: l,
|
|
2938
2936
|
"data-testid": d
|
|
2939
2937
|
}) => {
|
|
2940
|
-
const m = s != null || a != null, b =
|
|
2938
|
+
const m = s != null || a != null, b = y(
|
|
2941
2939
|
ur,
|
|
2942
2940
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2943
2941
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -2968,7 +2966,7 @@ const ir = {
|
|
|
2968
2966
|
onClick: a,
|
|
2969
2967
|
"aria-label": r,
|
|
2970
2968
|
"data-testid": d,
|
|
2971
|
-
className:
|
|
2969
|
+
className: y(b, "text-left"),
|
|
2972
2970
|
children: [
|
|
2973
2971
|
t,
|
|
2974
2972
|
u
|
|
@@ -3018,7 +3016,7 @@ const ir = {
|
|
|
3018
3016
|
) }) : /* @__PURE__ */ h(
|
|
3019
3017
|
"div",
|
|
3020
3018
|
{
|
|
3021
|
-
className:
|
|
3019
|
+
className: y(
|
|
3022
3020
|
"relative h-[180px] w-full overflow-hidden",
|
|
3023
3021
|
d && "bg-black"
|
|
3024
3022
|
),
|
|
@@ -3045,7 +3043,7 @@ const ir = {
|
|
|
3045
3043
|
) : /* @__PURE__ */ n(
|
|
3046
3044
|
"div",
|
|
3047
3045
|
{
|
|
3048
|
-
className:
|
|
3046
|
+
className: y(
|
|
3049
3047
|
"flex h-full w-full items-center justify-center",
|
|
3050
3048
|
mr[e]
|
|
3051
3049
|
),
|
|
@@ -3083,7 +3081,7 @@ const ir = {
|
|
|
3083
3081
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3084
3082
|
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3085
3083
|
}
|
|
3086
|
-
) : void 0,
|
|
3084
|
+
) : void 0, p = u ? /* @__PURE__ */ n(
|
|
3087
3085
|
"button",
|
|
3088
3086
|
{
|
|
3089
3087
|
type: "button",
|
|
@@ -3131,7 +3129,7 @@ const ir = {
|
|
|
3131
3129
|
url: a,
|
|
3132
3130
|
appIcon: d,
|
|
3133
3131
|
cta: m,
|
|
3134
|
-
trailingAction:
|
|
3132
|
+
trailingAction: p
|
|
3135
3133
|
}
|
|
3136
3134
|
)
|
|
3137
3135
|
]
|
|
@@ -3149,11 +3147,11 @@ const ir = {
|
|
|
3149
3147
|
cta: d,
|
|
3150
3148
|
onClick: m
|
|
3151
3149
|
}) => {
|
|
3152
|
-
const b = hn(a, i), u = Qe(s), f = d == null && u != null && !b ? u : void 0, c = d == null && !b ? m : void 0, g = Me(a, i) ? tt : void 0,
|
|
3150
|
+
const b = hn(a, i), u = Qe(s), f = d == null && u != null && !b ? u : void 0, c = d == null && !b ? m : void 0, g = Me(a, i) ? tt : void 0, p = d && m ? {
|
|
3153
3151
|
...d,
|
|
3154
3152
|
onClick: () => {
|
|
3155
|
-
var
|
|
3156
|
-
m(), (
|
|
3153
|
+
var v;
|
|
3154
|
+
m(), (v = d.onClick) == null || v.call(d);
|
|
3157
3155
|
}
|
|
3158
3156
|
} : d;
|
|
3159
3157
|
return /* @__PURE__ */ h(
|
|
@@ -3184,7 +3182,7 @@ const ir = {
|
|
|
3184
3182
|
description: t,
|
|
3185
3183
|
url: s,
|
|
3186
3184
|
appIcon: l,
|
|
3187
|
-
cta:
|
|
3185
|
+
cta: p
|
|
3188
3186
|
}
|
|
3189
3187
|
)
|
|
3190
3188
|
]
|
|
@@ -3278,7 +3276,7 @@ const ir = {
|
|
|
3278
3276
|
{
|
|
3279
3277
|
"data-testid": o,
|
|
3280
3278
|
"data-group-position": a,
|
|
3281
|
-
className:
|
|
3279
|
+
className: y(
|
|
3282
3280
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3283
3281
|
// and keeps the document / image / audio bubbles visually
|
|
3284
3282
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3298,7 +3296,7 @@ const ir = {
|
|
|
3298
3296
|
l ? /* @__PURE__ */ n(
|
|
3299
3297
|
"p",
|
|
3300
3298
|
{
|
|
3301
|
-
className:
|
|
3299
|
+
className: y(
|
|
3302
3300
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3303
3301
|
// the same font family + size as `.str-chat__message-text`
|
|
3304
3302
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3327,7 +3325,7 @@ const ir = {
|
|
|
3327
3325
|
a.stopPropagation(), e();
|
|
3328
3326
|
},
|
|
3329
3327
|
"aria-label": s,
|
|
3330
|
-
className:
|
|
3328
|
+
className: y(
|
|
3331
3329
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3332
3330
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3333
3331
|
),
|
|
@@ -3461,13 +3459,13 @@ const Rr = {
|
|
|
3461
3459
|
const d = s ?? t ?? "File", m = Mr(a, t, r), b = /* @__PURE__ */ n(
|
|
3462
3460
|
"div",
|
|
3463
3461
|
{
|
|
3464
|
-
className:
|
|
3462
|
+
className: y(
|
|
3465
3463
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3466
3464
|
Lr[e]
|
|
3467
3465
|
),
|
|
3468
3466
|
"aria-hidden": !0,
|
|
3469
3467
|
children: le(a, {
|
|
3470
|
-
className:
|
|
3468
|
+
className: y("size-6", Dr[e]),
|
|
3471
3469
|
weight: "regular"
|
|
3472
3470
|
})
|
|
3473
3471
|
}
|
|
@@ -3476,7 +3474,7 @@ const Rr = {
|
|
|
3476
3474
|
m ? /* @__PURE__ */ n(
|
|
3477
3475
|
"p",
|
|
3478
3476
|
{
|
|
3479
|
-
className:
|
|
3477
|
+
className: y(
|
|
3480
3478
|
"truncate text-xs leading-4",
|
|
3481
3479
|
Rr[e]
|
|
3482
3480
|
),
|
|
@@ -3489,7 +3487,7 @@ const Rr = {
|
|
|
3489
3487
|
type: "button",
|
|
3490
3488
|
onClick: i,
|
|
3491
3489
|
"aria-label": o,
|
|
3492
|
-
className:
|
|
3490
|
+
className: y(
|
|
3493
3491
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3494
3492
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3495
3493
|
),
|
|
@@ -3569,19 +3567,19 @@ const Pr = ({
|
|
|
3569
3567
|
mimeType: r,
|
|
3570
3568
|
title: i,
|
|
3571
3569
|
items: o
|
|
3572
|
-
}), g = (
|
|
3573
|
-
if ((m == null ? void 0 : m(
|
|
3574
|
-
const N = c[
|
|
3570
|
+
}), g = (v) => {
|
|
3571
|
+
if ((m == null ? void 0 : m(v)) === !1) return;
|
|
3572
|
+
const N = c[v];
|
|
3575
3573
|
if (!N) return;
|
|
3576
3574
|
const x = N.filename ?? Z(N.src);
|
|
3577
3575
|
gn(N.src, x);
|
|
3578
3576
|
};
|
|
3579
3577
|
if (c.length === 0)
|
|
3580
3578
|
return null;
|
|
3581
|
-
const
|
|
3579
|
+
const p = /* @__PURE__ */ n(
|
|
3582
3580
|
"span",
|
|
3583
3581
|
{
|
|
3584
|
-
className:
|
|
3582
|
+
className: y(
|
|
3585
3583
|
"flex size-8 items-center justify-center rounded-full",
|
|
3586
3584
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3587
3585
|
),
|
|
@@ -3596,16 +3594,16 @@ const Pr = ({
|
|
|
3596
3594
|
text: l,
|
|
3597
3595
|
groupPosition: d,
|
|
3598
3596
|
"data-testid": "file-attachment",
|
|
3599
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3597
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, N) => /* @__PURE__ */ n(
|
|
3600
3598
|
Or,
|
|
3601
3599
|
{
|
|
3602
3600
|
variant: u,
|
|
3603
|
-
item:
|
|
3601
|
+
item: v,
|
|
3604
3602
|
index: N,
|
|
3605
3603
|
onActivate: g,
|
|
3606
|
-
trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) :
|
|
3604
|
+
trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : p
|
|
3607
3605
|
},
|
|
3608
|
-
`${
|
|
3606
|
+
`${v.src}-${N}`
|
|
3609
3607
|
)) })
|
|
3610
3608
|
}
|
|
3611
3609
|
);
|
|
@@ -3648,7 +3646,7 @@ const Pr = ({
|
|
|
3648
3646
|
tone: i = "dark",
|
|
3649
3647
|
onTriggered: o
|
|
3650
3648
|
}) => {
|
|
3651
|
-
const [l, d] =
|
|
3649
|
+
const [l, d] = P(!1), m = W(
|
|
3652
3650
|
(c) => {
|
|
3653
3651
|
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3654
3652
|
}).finally(() => {
|
|
@@ -3656,7 +3654,7 @@ const Pr = ({
|
|
|
3656
3654
|
}));
|
|
3657
3655
|
},
|
|
3658
3656
|
[l, e, t, o]
|
|
3659
|
-
), b = r ?? s !== "pill", f = { className:
|
|
3657
|
+
), b = r ?? s !== "pill", f = { className: y(
|
|
3660
3658
|
s === "pill" ? "size-4" : "size-5",
|
|
3661
3659
|
"shrink-0"
|
|
3662
3660
|
), weight: "bold" };
|
|
@@ -3667,7 +3665,7 @@ const Pr = ({
|
|
|
3667
3665
|
onClick: m,
|
|
3668
3666
|
disabled: l,
|
|
3669
3667
|
"aria-label": a,
|
|
3670
|
-
className:
|
|
3668
|
+
className: y(
|
|
3671
3669
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3672
3670
|
{
|
|
3673
3671
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3707,7 +3705,7 @@ const Pr = ({
|
|
|
3707
3705
|
onClick: m,
|
|
3708
3706
|
disabled: l,
|
|
3709
3707
|
"aria-label": b ? a : void 0,
|
|
3710
|
-
className:
|
|
3708
|
+
className: y(
|
|
3711
3709
|
"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",
|
|
3712
3710
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3713
3711
|
),
|
|
@@ -3729,7 +3727,7 @@ const Pr = ({
|
|
|
3729
3727
|
initialIndex: t,
|
|
3730
3728
|
open: s
|
|
3731
3729
|
}) => {
|
|
3732
|
-
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3730
|
+
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = P(a);
|
|
3733
3731
|
Y(() => {
|
|
3734
3732
|
s && i($e(t, 0, Math.max(e - 1, 0)));
|
|
3735
3733
|
}, [s, t, e]), Y(() => {
|
|
@@ -3904,14 +3902,14 @@ const Pr = ({
|
|
|
3904
3902
|
const r = e.length;
|
|
3905
3903
|
if (r === 0) return null;
|
|
3906
3904
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, b) => {
|
|
3907
|
-
const u =
|
|
3905
|
+
const u = y(Ur, "h-full w-full");
|
|
3908
3906
|
return t ? /* @__PURE__ */ h(
|
|
3909
3907
|
"button",
|
|
3910
3908
|
{
|
|
3911
3909
|
type: "button",
|
|
3912
3910
|
onClick: () => t(m),
|
|
3913
3911
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3914
|
-
className:
|
|
3912
|
+
className: y(u, "cursor-zoom-in"),
|
|
3915
3913
|
children: [
|
|
3916
3914
|
d.content,
|
|
3917
3915
|
b
|
|
@@ -3923,10 +3921,10 @@ const Pr = ({
|
|
|
3923
3921
|
b
|
|
3924
3922
|
] }, m);
|
|
3925
3923
|
};
|
|
3926
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3924
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3927
3925
|
"div",
|
|
3928
3926
|
{
|
|
3929
|
-
className:
|
|
3927
|
+
className: y(
|
|
3930
3928
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3931
3929
|
a
|
|
3932
3930
|
),
|
|
@@ -3935,7 +3933,7 @@ const Pr = ({
|
|
|
3935
3933
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3936
3934
|
"div",
|
|
3937
3935
|
{
|
|
3938
|
-
className:
|
|
3936
|
+
className: y(
|
|
3939
3937
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3940
3938
|
a
|
|
3941
3939
|
),
|
|
@@ -3948,7 +3946,7 @@ const Pr = ({
|
|
|
3948
3946
|
) : /* @__PURE__ */ n(
|
|
3949
3947
|
"div",
|
|
3950
3948
|
{
|
|
3951
|
-
className:
|
|
3949
|
+
className: y(
|
|
3952
3950
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3953
3951
|
a
|
|
3954
3952
|
),
|
|
@@ -3966,7 +3964,7 @@ const Pr = ({
|
|
|
3966
3964
|
}
|
|
3967
3965
|
);
|
|
3968
3966
|
}, Ne = (e) => {
|
|
3969
|
-
const [t, s] =
|
|
3967
|
+
const [t, s] = P(!1), [a, r] = P(0), i = W(
|
|
3970
3968
|
(l) => {
|
|
3971
3969
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3972
3970
|
},
|
|
@@ -4048,8 +4046,8 @@ const Pr = ({
|
|
|
4048
4046
|
);
|
|
4049
4047
|
if (m.length === 0)
|
|
4050
4048
|
return null;
|
|
4051
|
-
const
|
|
4052
|
-
(
|
|
4049
|
+
const p = m.map(
|
|
4050
|
+
(v, N) => jr(v, N, m.length, l)
|
|
4053
4051
|
);
|
|
4054
4052
|
return /* @__PURE__ */ h(
|
|
4055
4053
|
ve,
|
|
@@ -4059,7 +4057,7 @@ const Pr = ({
|
|
|
4059
4057
|
groupPosition: o,
|
|
4060
4058
|
"data-testid": "image-attachment",
|
|
4061
4059
|
children: [
|
|
4062
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles:
|
|
4060
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: p, onTileActivate: c }) }),
|
|
4063
4061
|
/* @__PURE__ */ n(
|
|
4064
4062
|
pn,
|
|
4065
4063
|
{
|
|
@@ -4166,9 +4164,9 @@ const Pr = ({
|
|
|
4166
4164
|
onClick: d,
|
|
4167
4165
|
onDismiss: m
|
|
4168
4166
|
}) => {
|
|
4169
|
-
const b = we(e), u = Jr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer:
|
|
4167
|
+
const b = we(e), u = Jr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: p } = Ne(
|
|
4170
4168
|
d
|
|
4171
|
-
),
|
|
4169
|
+
), v = e === "composer" && !!m;
|
|
4172
4170
|
if (u.length === 0)
|
|
4173
4171
|
return null;
|
|
4174
4172
|
const N = u.map((x) => ({
|
|
@@ -4183,14 +4181,14 @@ const Pr = ({
|
|
|
4183
4181
|
groupPosition: l,
|
|
4184
4182
|
"data-testid": "pdf-attachment",
|
|
4185
4183
|
children: [
|
|
4186
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x,
|
|
4187
|
-
const
|
|
4184
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x, S) => {
|
|
4185
|
+
const E = x.filename ?? Z(x.src), M = v && S === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4188
4186
|
bn,
|
|
4189
4187
|
{
|
|
4190
4188
|
url: x.src,
|
|
4191
|
-
filename:
|
|
4189
|
+
filename: E,
|
|
4192
4190
|
variant: "inline",
|
|
4193
|
-
label: `Download ${
|
|
4191
|
+
label: `Download ${E}`,
|
|
4194
4192
|
tone: b
|
|
4195
4193
|
}
|
|
4196
4194
|
);
|
|
@@ -4199,11 +4197,11 @@ const Pr = ({
|
|
|
4199
4197
|
{
|
|
4200
4198
|
variant: b,
|
|
4201
4199
|
item: x,
|
|
4202
|
-
index:
|
|
4200
|
+
index: S,
|
|
4203
4201
|
onActivate: g,
|
|
4204
|
-
trailingAction:
|
|
4202
|
+
trailingAction: M
|
|
4205
4203
|
},
|
|
4206
|
-
`${x.src}-${
|
|
4204
|
+
`${x.src}-${S}`
|
|
4207
4205
|
);
|
|
4208
4206
|
}) }),
|
|
4209
4207
|
/* @__PURE__ */ n(
|
|
@@ -4212,7 +4210,7 @@ const Pr = ({
|
|
|
4212
4210
|
open: f,
|
|
4213
4211
|
items: N,
|
|
4214
4212
|
initialIndex: c,
|
|
4215
|
-
onClose:
|
|
4213
|
+
onClose: p
|
|
4216
4214
|
}
|
|
4217
4215
|
)
|
|
4218
4216
|
]
|
|
@@ -4351,12 +4349,12 @@ const Pr = ({
|
|
|
4351
4349
|
preload: d,
|
|
4352
4350
|
onClick: m
|
|
4353
4351
|
}) => {
|
|
4354
|
-
const b = ri({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer:
|
|
4352
|
+
const b = ri({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: p } = Ne(
|
|
4355
4353
|
m
|
|
4356
4354
|
);
|
|
4357
4355
|
if (b.length === 0)
|
|
4358
4356
|
return null;
|
|
4359
|
-
const
|
|
4357
|
+
const v = b.map(
|
|
4360
4358
|
(N, x) => ai(N, x, b.length)
|
|
4361
4359
|
);
|
|
4362
4360
|
return /* @__PURE__ */ h(
|
|
@@ -4370,7 +4368,7 @@ const Pr = ({
|
|
|
4370
4368
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4371
4369
|
vn,
|
|
4372
4370
|
{
|
|
4373
|
-
tiles:
|
|
4371
|
+
tiles: v,
|
|
4374
4372
|
onTileActivate: g,
|
|
4375
4373
|
className: "overflow-hidden rounded-md"
|
|
4376
4374
|
}
|
|
@@ -4381,7 +4379,7 @@ const Pr = ({
|
|
|
4381
4379
|
open: f,
|
|
4382
4380
|
items: yn(b, r),
|
|
4383
4381
|
initialIndex: c,
|
|
4384
|
-
onClose:
|
|
4382
|
+
onClose: p
|
|
4385
4383
|
}
|
|
4386
4384
|
)
|
|
4387
4385
|
]
|
|
@@ -4409,7 +4407,7 @@ const Pr = ({
|
|
|
4409
4407
|
onClick: t,
|
|
4410
4408
|
disabled: s,
|
|
4411
4409
|
style: { backgroundColor: "#E6E5E3" },
|
|
4412
|
-
className:
|
|
4410
|
+
className: y(
|
|
4413
4411
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4414
4412
|
{
|
|
4415
4413
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4496,4 +4494,4 @@ export {
|
|
|
4496
4494
|
Wt as y,
|
|
4497
4495
|
ba as z
|
|
4498
4496
|
};
|
|
4499
|
-
//# sourceMappingURL=index-
|
|
4497
|
+
//# sourceMappingURL=index-D7eRkXoG.js.map
|