@linktr.ee/messaging-react 4.0.4 → 4.1.0-rc-1786608731
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-D4cboQ2t.js → Card-ClyBNKoW.js} +2 -2
- package/dist/{Card-D4cboQ2t.js.map → Card-ClyBNKoW.js.map} +1 -1
- package/dist/{Card-BPJPoGox.cjs → Card-NbyEZmLk.cjs} +2 -2
- package/dist/{Card-BPJPoGox.cjs.map → Card-NbyEZmLk.cjs.map} +1 -1
- package/dist/{index-DeWGN1T5.js → index-CH6y1lmh.js} +778 -776
- package/dist/{index-DeWGN1T5.js.map → index-CH6y1lmh.js.map} +1 -1
- package/dist/{index-BOlJ4EAE.cjs → index-D1x28quP.cjs} +3 -3
- package/dist/{index-BOlJ4EAE.cjs.map → index-D1x28quP.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/MessagingShell/MessagingShell.test.tsx +20 -0
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/types.ts +1 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as n, jsxs as f, Fragment as
|
|
2
|
-
import z, { createContext as
|
|
1
|
+
import { jsx as n, jsxs as f, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import z, { createContext as He, useContext as we, useCallback as K, useState as B, useRef as V, useEffect as X, useId as as, Suspense as rs, useMemo as ie } from "react";
|
|
3
3
|
import { StreamChatService as is } from "@linktr.ee/messaging-core";
|
|
4
|
-
import { StreamChat as ls, LinkPreviewsManager as
|
|
5
|
-
import { Chat as os, useChannelStateContext as
|
|
4
|
+
import { StreamChat as ls, LinkPreviewsManager as nt } from "stream-chat";
|
|
5
|
+
import { Chat as os, useChannelStateContext as _e, useChatContext as Ve, DateSeparator as cs, useMessageContext as fe, MessageStatus as ds, MessageErrorIcon as st, MessageText as Fe, areMessageUIPropsEqual as us, useMessageReminder as ms, useComponentContext as dn, Attachment as hs, EditMessageModal as fs, MessageBlocked as gs, MessageBouncePrompt as ps, MessageDeleted as bs, MessageIsThreadReplyInChannelButtonIndicator as vs, MessageRepliesCountButton as xs, ReminderNotification as ws, StreamedMessageText as _s, messageHasAttachments as ys, messageHasReactions as Ns, isDateSeparatorMessage as ks, isMessageBlocked as Cs, isMessageBounced as Ss, MessageBounceModal as Es, Poll as Is, useMessageComposer as Ts, useStateStore as As, MessageInput as Ht, useMessageInputContext as Rs, useMessageComposerHasSendableData as Ls, AttachmentPreviewList as Ms, QuotedMessagePreview as Ds, TextareaComposer as Os, MessageTimestamp as Xe, AIStates as qe, useTypingContext as Ps, useAIState as zs, Channel as Fs, WithComponents as $s, Window as Bs, MessageList as Vt, ChannelList as Us, InfiniteScroll as js } from "stream-chat-react";
|
|
6
6
|
import k from "classnames";
|
|
7
|
-
import { StarIcon as
|
|
8
|
-
import { isOfficialChannel as ga, OFFICIAL_SENDER_USER_ID as pa, MESSAGE_CUSTOM_TYPE as
|
|
7
|
+
import { StarIcon as at, DotsThreeIcon as Hs, SpinnerGapIcon as Pe, SignOutIcon as Vs, ProhibitInsetIcon as Gt, FlagIcon as un, CurrencyDollarIcon as Gs, CaretRightIcon as mn, ArrowLeftIcon as Ys, FileIcon as hn, ImageIcon as Ws, SpeakerHighIcon as Xs, VideoCameraIcon as fn, FileMdIcon as qs, FileTextIcon as Ks, FileZipIcon as Zs, FilePptIcon as Js, FileCsvIcon as Qs, FileXlsIcon as ea, FileDocIcon as ta, FilePdfIcon as na, CircleNotchIcon as ve, PlayIcon as rt, PauseIcon as sa, LinkIcon as aa, DownloadSimpleIcon as Ee, GiftIcon as ra, WarningCircleIcon as ia, MegaphoneIcon as la, ChecksIcon as oa, XIcon as lt, PencilSimpleIcon as ca, CaretLeftIcon as da, TrashSimpleIcon as ua, ArrowUpIcon as ma, SparkleIcon as ha, ProhibitIcon as fa } from "@phosphor-icons/react";
|
|
8
|
+
import { isOfficialChannel as ga, OFFICIAL_SENDER_USER_ID as pa, MESSAGE_CUSTOM_TYPE as le, isDmAgentSystemType as Yt, isAgeSafetySystemType as ba, resolveRichCardImagePresentation as va, selectEnabledFaqs as xa } from "@linktr.ee/messaging-taxonomy";
|
|
9
9
|
import { MessageActions as wa, DefaultDropdownActionButton as gn } from "stream-chat-react/experimental";
|
|
10
|
-
const pn =
|
|
10
|
+
const pn = He({
|
|
11
11
|
service: null,
|
|
12
12
|
client: null,
|
|
13
13
|
isConnected: !1,
|
|
@@ -17,7 +17,7 @@ const pn = je({
|
|
|
17
17
|
refreshConnection: async () => {
|
|
18
18
|
},
|
|
19
19
|
debug: !1
|
|
20
|
-
}),
|
|
20
|
+
}), ot = () => we(pn), eo = ({
|
|
21
21
|
children: e,
|
|
22
22
|
user: t,
|
|
23
23
|
serviceConfig: s,
|
|
@@ -26,10 +26,10 @@ const pn = je({
|
|
|
26
26
|
debug: i = !1,
|
|
27
27
|
client: o
|
|
28
28
|
}) => {
|
|
29
|
-
var
|
|
30
|
-
const l =
|
|
31
|
-
(
|
|
32
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
29
|
+
var I, C;
|
|
30
|
+
const l = K(
|
|
31
|
+
(S, ...P) => {
|
|
32
|
+
i && console.log(`🔥 [MessagingProvider] ${S}`, ...P);
|
|
33
33
|
},
|
|
34
34
|
[i]
|
|
35
35
|
);
|
|
@@ -39,49 +39,49 @@ const pn = je({
|
|
|
39
39
|
serviceConfig: !!s,
|
|
40
40
|
capabilities: Object.keys(r)
|
|
41
41
|
});
|
|
42
|
-
const [d, u] = B(null), [h, m] = B(null), [g, c] = B(!1), [p, w] = B(!1), [v, x] = B(null), b =
|
|
42
|
+
const [d, u] = B(null), [h, m] = B(null), [g, c] = B(!1), [p, w] = B(!1), [v, x] = B(null), b = V(!1), y = V(null), _ = V(s);
|
|
43
43
|
_.current = s;
|
|
44
|
-
const T =
|
|
44
|
+
const T = V(i);
|
|
45
45
|
T.current = i;
|
|
46
|
-
const
|
|
46
|
+
const R = V({
|
|
47
47
|
userId: t == null ? void 0 : t.id,
|
|
48
48
|
apiKey: a,
|
|
49
49
|
serviceConfig: s,
|
|
50
50
|
capabilities: r
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
renderCount:
|
|
51
|
+
}), L = V(0);
|
|
52
|
+
L.current++, l("📊 RENDER INFO", {
|
|
53
|
+
renderCount: L.current,
|
|
54
54
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
55
55
|
propChanges: {
|
|
56
|
-
userChanged:
|
|
57
|
-
apiKeyChanged:
|
|
58
|
-
serviceConfigChanged:
|
|
59
|
-
capabilitiesChanged:
|
|
56
|
+
userChanged: R.current.userId !== (t == null ? void 0 : t.id),
|
|
57
|
+
apiKeyChanged: R.current.apiKey !== a,
|
|
58
|
+
serviceConfigChanged: R.current.serviceConfig !== s,
|
|
59
|
+
capabilitiesChanged: R.current.capabilities !== r
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), R.current = {
|
|
62
62
|
userId: t == null ? void 0 : t.id,
|
|
63
63
|
apiKey: a,
|
|
64
64
|
serviceConfig: s,
|
|
65
65
|
capabilities: r
|
|
66
66
|
};
|
|
67
|
-
const $ =
|
|
68
|
-
!o && a && ((
|
|
67
|
+
const $ = V(null);
|
|
68
|
+
!o && a && ((I = $.current) == null ? void 0 : I.apiKey) !== a && ($.current = { apiKey: a, client: new ls(a) });
|
|
69
69
|
const F = o || (a ? ((C = $.current) == null ? void 0 : C.client) ?? null : null);
|
|
70
|
-
|
|
71
|
-
const
|
|
70
|
+
X(() => {
|
|
71
|
+
const S = L.current, P = _.current;
|
|
72
72
|
if (o) {
|
|
73
|
-
|
|
73
|
+
y.current = null, u(null), m(null), c(!1), x(null), w(!1);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
if (!a || !F || !P) {
|
|
77
77
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: S,
|
|
79
79
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
80
80
|
});
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
l("🚀 CREATING SERVICE", {
|
|
84
|
-
renderCount:
|
|
84
|
+
renderCount: S,
|
|
85
85
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
86
86
|
});
|
|
87
87
|
const U = new is({
|
|
@@ -90,13 +90,13 @@ const pn = je({
|
|
|
90
90
|
debug: T.current,
|
|
91
91
|
client: F
|
|
92
92
|
});
|
|
93
|
-
|
|
94
|
-
renderCount:
|
|
93
|
+
y.current = U, u(U), l("✅ SERVICE SET", {
|
|
94
|
+
renderCount: S,
|
|
95
95
|
serviceInstance: !!U
|
|
96
96
|
});
|
|
97
97
|
}, [a, F, o]);
|
|
98
|
-
const
|
|
99
|
-
|
|
98
|
+
const M = V(null);
|
|
99
|
+
X(() => {
|
|
100
100
|
var P, U;
|
|
101
101
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
102
|
hasService: !!d,
|
|
@@ -115,7 +115,7 @@ const pn = je({
|
|
|
115
115
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
if (((P =
|
|
118
|
+
if (((P = M.current) == null ? void 0 : P.serviceId) === d && ((U = M.current) == null ? void 0 : U.userId) === t.id) {
|
|
119
119
|
l(
|
|
120
120
|
"⚠️ USER CONNECTION SKIPPED",
|
|
121
121
|
"Already connected this user with this service"
|
|
@@ -126,16 +126,16 @@ const pn = je({
|
|
|
126
126
|
l("🚀 STARTING USER CONNECTION", { userId: t.id }), b.current = !0, w(!0), x(null);
|
|
127
127
|
try {
|
|
128
128
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
129
|
-
const
|
|
130
|
-
m(
|
|
129
|
+
const j = await d.connectUser(t);
|
|
130
|
+
m(j), c(!0), M.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
131
131
|
userId: t.id,
|
|
132
|
-
clientId:
|
|
132
|
+
clientId: j.userID
|
|
133
133
|
});
|
|
134
|
-
} catch (
|
|
135
|
-
const
|
|
136
|
-
x(
|
|
134
|
+
} catch (j) {
|
|
135
|
+
const ee = j instanceof Error ? j.message : "Connection failed";
|
|
136
|
+
x(ee), l("❌ USER CONNECTION ERROR", {
|
|
137
137
|
userId: t.id,
|
|
138
|
-
error:
|
|
138
|
+
error: ee
|
|
139
139
|
});
|
|
140
140
|
} finally {
|
|
141
141
|
w(!1), b.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
@@ -144,14 +144,14 @@ const pn = je({
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
})();
|
|
147
|
-
}, [d, t, l, g, o]),
|
|
148
|
-
const
|
|
147
|
+
}, [d, t, l, g, o]), X(() => {
|
|
148
|
+
const S = F;
|
|
149
149
|
return () => {
|
|
150
150
|
var P;
|
|
151
|
-
|
|
151
|
+
S && (M.current = null, (P = y.current) == null || P.disconnectUser().catch(console.error));
|
|
152
152
|
};
|
|
153
153
|
}, [F]);
|
|
154
|
-
const
|
|
154
|
+
const E = K(async () => {
|
|
155
155
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
156
156
|
hasService: !!d,
|
|
157
157
|
hasUser: !!t
|
|
@@ -163,10 +163,10 @@ const pn = je({
|
|
|
163
163
|
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
|
|
164
164
|
try {
|
|
165
165
|
l("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
166
|
-
const
|
|
167
|
-
m(
|
|
168
|
-
} catch (
|
|
169
|
-
const P =
|
|
166
|
+
const S = await d.connectUser(t);
|
|
167
|
+
m(S), c(!0), x(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
168
|
+
} catch (S) {
|
|
169
|
+
const P = S instanceof Error ? S.message : "Refresh failed";
|
|
170
170
|
x(P), l("❌ CONNECTION REFRESH ERROR", {
|
|
171
171
|
userId: t.id,
|
|
172
172
|
error: P
|
|
@@ -175,7 +175,7 @@ const pn = je({
|
|
|
175
175
|
w(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
}, [d, t, l, o]),
|
|
178
|
+
}, [d, t, l, o]), D = z.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!d,
|
|
180
180
|
hasClient: !!h,
|
|
181
181
|
isConnected: g,
|
|
@@ -197,7 +197,7 @@ const pn = je({
|
|
|
197
197
|
isLoading: o ? !1 : p,
|
|
198
198
|
error: o ? null : v,
|
|
199
199
|
capabilities: r,
|
|
200
|
-
refreshConnection:
|
|
200
|
+
refreshConnection: E,
|
|
201
201
|
debug: i
|
|
202
202
|
}), [
|
|
203
203
|
d,
|
|
@@ -207,15 +207,15 @@ const pn = je({
|
|
|
207
207
|
p,
|
|
208
208
|
v,
|
|
209
209
|
r,
|
|
210
|
-
|
|
210
|
+
E,
|
|
211
211
|
i,
|
|
212
212
|
l
|
|
213
213
|
]);
|
|
214
214
|
return l("🔄 RENDER END", {
|
|
215
|
-
renderCount:
|
|
215
|
+
renderCount: L.current,
|
|
216
216
|
willRenderChat: !!F,
|
|
217
|
-
contextValueReady: !!
|
|
218
|
-
}), /* @__PURE__ */ n(pn.Provider, { value:
|
|
217
|
+
contextValueReady: !!D
|
|
218
|
+
}), /* @__PURE__ */ n(pn.Provider, { value: D, children: F ? /* @__PURE__ */ n(
|
|
219
219
|
os,
|
|
220
220
|
{
|
|
221
221
|
client: F,
|
|
@@ -225,12 +225,12 @@ const pn = je({
|
|
|
225
225
|
children: e
|
|
226
226
|
}
|
|
227
227
|
) : e });
|
|
228
|
-
}, _a = () =>
|
|
228
|
+
}, _a = () => ot(), bn = (e) => {
|
|
229
229
|
var a, r;
|
|
230
230
|
const [t, s] = B(
|
|
231
231
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
232
232
|
);
|
|
233
|
-
return
|
|
233
|
+
return X(() => {
|
|
234
234
|
var o;
|
|
235
235
|
if (!e) {
|
|
236
236
|
s(!1);
|
|
@@ -322,7 +322,7 @@ function Ca(e) {
|
|
|
322
322
|
function Sa(e) {
|
|
323
323
|
return wn(e).bgColor;
|
|
324
324
|
}
|
|
325
|
-
const
|
|
325
|
+
const ye = ({
|
|
326
326
|
id: e,
|
|
327
327
|
image: t,
|
|
328
328
|
size: s = 40,
|
|
@@ -359,7 +359,7 @@ const we = ({
|
|
|
359
359
|
{
|
|
360
360
|
"aria-hidden": "true",
|
|
361
361
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
362
|
-
children: /* @__PURE__ */ n(
|
|
362
|
+
children: /* @__PURE__ */ n(at, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
365
|
/* @__PURE__ */ n(
|
|
@@ -395,42 +395,42 @@ const we = ({
|
|
|
395
395
|
onActionComplete: u,
|
|
396
396
|
logLabel: h = "useChannelModerationActions"
|
|
397
397
|
}) => {
|
|
398
|
-
var
|
|
399
|
-
const { service: m, debug: g } =
|
|
400
|
-
return
|
|
398
|
+
var D;
|
|
399
|
+
const { service: m, debug: g } = ot(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, p = !!(a && s && m && c), [w, v] = B(!1), [x, b] = B(null), [y, _] = B(!1), [T, R] = B(!1), L = p && ((x == null ? void 0 : x.participantId) !== c || (x == null ? void 0 : x.service) !== m);
|
|
400
|
+
return X(() => {
|
|
401
401
|
if (!p || !m || !c) {
|
|
402
402
|
v(!1), b(null);
|
|
403
403
|
return;
|
|
404
404
|
}
|
|
405
|
-
let
|
|
405
|
+
let I = !1;
|
|
406
406
|
return (async () => {
|
|
407
407
|
try {
|
|
408
408
|
const C = await m.getBlockedUsers();
|
|
409
|
-
if (
|
|
409
|
+
if (I) return;
|
|
410
410
|
v(
|
|
411
411
|
C.some(
|
|
412
|
-
(
|
|
412
|
+
(S) => S.blocked_user_id === c
|
|
413
413
|
)
|
|
414
414
|
);
|
|
415
415
|
} catch (C) {
|
|
416
|
-
|
|
416
|
+
I || console.error(`[${h}] Failed to check blocked status:`, C);
|
|
417
417
|
} finally {
|
|
418
|
-
|
|
418
|
+
I || b({ participantId: c, service: m });
|
|
419
419
|
}
|
|
420
420
|
})(), () => {
|
|
421
|
-
|
|
421
|
+
I = !0;
|
|
422
422
|
};
|
|
423
423
|
}, [p, m, c, h]), {
|
|
424
424
|
isParticipantBlocked: w,
|
|
425
|
-
isCheckingBlockedStatus:
|
|
426
|
-
isLeaving:
|
|
425
|
+
isCheckingBlockedStatus: L,
|
|
426
|
+
isLeaving: y,
|
|
427
427
|
isUpdatingBlockStatus: T,
|
|
428
428
|
handleLeaveConversation: async () => {
|
|
429
|
-
var
|
|
430
|
-
if (!
|
|
429
|
+
var I;
|
|
430
|
+
if (!y) {
|
|
431
431
|
o == null || o(), g && console.log(`[${h}] Leave conversation`, e.cid), _(!0);
|
|
432
432
|
try {
|
|
433
|
-
const C = ((
|
|
433
|
+
const C = ((I = e._client) == null ? void 0 : I.userID) ?? null;
|
|
434
434
|
await e.hide(C, !1), r && await r(e), u == null || u();
|
|
435
435
|
} catch (C) {
|
|
436
436
|
console.error(`[${h}] Failed to leave conversation`, C);
|
|
@@ -440,28 +440,28 @@ const we = ({
|
|
|
440
440
|
}
|
|
441
441
|
},
|
|
442
442
|
handleBlockUser: async () => {
|
|
443
|
-
var
|
|
443
|
+
var I, C, S;
|
|
444
444
|
if (!(T || !m)) {
|
|
445
|
-
l == null || l(), g && console.log(`[${h}] Block member`, (
|
|
445
|
+
l == null || l(), g && console.log(`[${h}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), R(!0);
|
|
446
446
|
try {
|
|
447
|
-
await m.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((
|
|
447
|
+
await m.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
|
|
448
448
|
} catch (P) {
|
|
449
449
|
console.error(`[${h}] Failed to block member`, P);
|
|
450
450
|
} finally {
|
|
451
|
-
|
|
451
|
+
R(!1);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
handleUnblockUser: async () => {
|
|
456
|
-
var
|
|
456
|
+
var I, C, S;
|
|
457
457
|
if (!(T || !m)) {
|
|
458
|
-
l == null || l(), g && console.log(`[${h}] Unblock member`, (
|
|
458
|
+
l == null || l(), g && console.log(`[${h}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), R(!0);
|
|
459
459
|
try {
|
|
460
|
-
await m.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((
|
|
460
|
+
await m.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
|
|
461
461
|
} catch (P) {
|
|
462
462
|
console.error(`[${h}] Failed to unblock member`, P);
|
|
463
463
|
} finally {
|
|
464
|
-
|
|
464
|
+
R(!1);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
},
|
|
@@ -469,7 +469,7 @@ const we = ({
|
|
|
469
469
|
d == null || d(), u == null || u(), window.open(Ea, "_blank", "noopener,noreferrer");
|
|
470
470
|
}
|
|
471
471
|
};
|
|
472
|
-
},
|
|
472
|
+
}, ke = ({
|
|
473
473
|
variant: e = "default",
|
|
474
474
|
className: t,
|
|
475
475
|
children: s,
|
|
@@ -500,14 +500,14 @@ const we = ({
|
|
|
500
500
|
customChannelActions: h,
|
|
501
501
|
triggerClassName: m
|
|
502
502
|
}) => {
|
|
503
|
-
const [g, c] = B(!1), p =
|
|
503
|
+
const [g, c] = B(!1), p = V(null), w = as(), v = K(() => c(!1), []), {
|
|
504
504
|
isParticipantBlocked: x,
|
|
505
505
|
isCheckingBlockedStatus: b,
|
|
506
|
-
isLeaving:
|
|
506
|
+
isLeaving: y,
|
|
507
507
|
isUpdatingBlockStatus: _,
|
|
508
508
|
handleLeaveConversation: T,
|
|
509
|
-
handleBlockUser:
|
|
510
|
-
handleUnblockUser:
|
|
509
|
+
handleBlockUser: R,
|
|
510
|
+
handleUnblockUser: L,
|
|
511
511
|
handleReportUser: $
|
|
512
512
|
} = Ia({
|
|
513
513
|
channel: e,
|
|
@@ -522,15 +522,15 @@ const we = ({
|
|
|
522
522
|
onActionComplete: v,
|
|
523
523
|
logLabel: "ChannelActionsMenu"
|
|
524
524
|
});
|
|
525
|
-
return
|
|
525
|
+
return X(() => {
|
|
526
526
|
if (!g) return;
|
|
527
|
-
const
|
|
528
|
-
p.current && !p.current.contains(
|
|
529
|
-
},
|
|
530
|
-
|
|
527
|
+
const M = (D) => {
|
|
528
|
+
p.current && !p.current.contains(D.target) && c(!1);
|
|
529
|
+
}, E = (D) => {
|
|
530
|
+
D.key === "Escape" && c(!1);
|
|
531
531
|
};
|
|
532
|
-
return document.addEventListener("mousedown",
|
|
533
|
-
document.removeEventListener("mousedown",
|
|
532
|
+
return document.addEventListener("mousedown", M), document.addEventListener("keydown", E), () => {
|
|
533
|
+
document.removeEventListener("mousedown", M), document.removeEventListener("keydown", E);
|
|
534
534
|
};
|
|
535
535
|
}, [g]), !t || !(s || a || r || !!h) ? null : /* @__PURE__ */ f("div", { ref: p, className: "relative", children: [
|
|
536
536
|
/* @__PURE__ */ f(
|
|
@@ -541,7 +541,7 @@ const we = ({
|
|
|
541
541
|
"aria-haspopup": "true",
|
|
542
542
|
"aria-expanded": g,
|
|
543
543
|
"aria-controls": g ? w : void 0,
|
|
544
|
-
onClick: () => c((
|
|
544
|
+
onClick: () => c((M) => !M),
|
|
545
545
|
children: [
|
|
546
546
|
/* @__PURE__ */ n(Hs, { className: "size-5 text-black/90" }),
|
|
547
547
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -559,13 +559,13 @@ const we = ({
|
|
|
559
559
|
),
|
|
560
560
|
children: /* @__PURE__ */ f("ul", { className: "flex flex-col gap-1", children: [
|
|
561
561
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
|
|
562
|
-
|
|
562
|
+
ke,
|
|
563
563
|
{
|
|
564
564
|
onClick: T,
|
|
565
|
-
disabled:
|
|
566
|
-
"aria-busy":
|
|
565
|
+
disabled: y,
|
|
566
|
+
"aria-busy": y,
|
|
567
567
|
children: [
|
|
568
|
-
|
|
568
|
+
y ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Vs, { className: "h-5 w-5" }),
|
|
569
569
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
570
570
|
]
|
|
571
571
|
}
|
|
@@ -573,34 +573,34 @@ const we = ({
|
|
|
573
573
|
a && /* @__PURE__ */ n("li", { children: b ? (
|
|
574
574
|
// Block status not yet resolved — show a disabled placeholder
|
|
575
575
|
// so a premature click can't act on a stale block state.
|
|
576
|
-
/* @__PURE__ */ f(
|
|
577
|
-
/* @__PURE__ */ n(
|
|
576
|
+
/* @__PURE__ */ f(ke, { disabled: !0, "aria-busy": !0, children: [
|
|
577
|
+
/* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }),
|
|
578
578
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
579
579
|
] })
|
|
580
580
|
) : x ? /* @__PURE__ */ f(
|
|
581
|
-
|
|
581
|
+
ke,
|
|
582
582
|
{
|
|
583
|
-
onClick:
|
|
583
|
+
onClick: L,
|
|
584
584
|
disabled: _,
|
|
585
585
|
"aria-busy": _,
|
|
586
586
|
children: [
|
|
587
|
-
_ ? /* @__PURE__ */ n(
|
|
587
|
+
_ ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
588
588
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
589
589
|
]
|
|
590
590
|
}
|
|
591
591
|
) : /* @__PURE__ */ f(
|
|
592
|
-
|
|
592
|
+
ke,
|
|
593
593
|
{
|
|
594
|
-
onClick:
|
|
594
|
+
onClick: R,
|
|
595
595
|
disabled: _,
|
|
596
596
|
"aria-busy": _,
|
|
597
597
|
children: [
|
|
598
|
-
_ ? /* @__PURE__ */ n(
|
|
598
|
+
_ ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
600
600
|
]
|
|
601
601
|
}
|
|
602
602
|
) }),
|
|
603
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
|
|
603
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(ke, { variant: "danger", onClick: $, children: [
|
|
604
604
|
/* @__PURE__ */ n(un, { className: "h-5 w-5" }),
|
|
605
605
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
606
606
|
] }) }),
|
|
@@ -609,7 +609,7 @@ const we = ({
|
|
|
609
609
|
}
|
|
610
610
|
)
|
|
611
611
|
] });
|
|
612
|
-
},
|
|
612
|
+
}, Ke = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Aa = "CUSTOMER_PAID", Ra = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Aa, La = ({
|
|
613
613
|
className: e,
|
|
614
614
|
onBack: t,
|
|
615
615
|
showBackButton: s,
|
|
@@ -627,32 +627,32 @@ const we = ({
|
|
|
627
627
|
showChannelInfo: p = !0,
|
|
628
628
|
onParticipantNameClick: w
|
|
629
629
|
}) => {
|
|
630
|
-
var
|
|
631
|
-
const { channel: v } =
|
|
630
|
+
var E, D, I, C;
|
|
631
|
+
const { channel: v } = _e(), { client: x } = Ve(), b = z.useMemo(
|
|
632
632
|
() => {
|
|
633
|
-
var
|
|
633
|
+
var S;
|
|
634
634
|
return vn(
|
|
635
|
-
(
|
|
635
|
+
(S = v.state) == null ? void 0 : S.members,
|
|
636
636
|
x == null ? void 0 : x.userID,
|
|
637
637
|
v.type
|
|
638
638
|
);
|
|
639
639
|
},
|
|
640
|
-
[(
|
|
641
|
-
),
|
|
640
|
+
[(E = v.state) == null ? void 0 : E.members, x == null ? void 0 : x.userID, v.type]
|
|
641
|
+
), y = xn(b == null ? void 0 : b.user), _ = (D = b == null ? void 0 : b.user) == null ? void 0 : D.image, T = bn(v), R = Ra((I = v.data) == null ? void 0 : I.customer_tag) && (b == null ? void 0 : b.is_follower) === !0, L = a && T, $ = R || L || !!w, F = async () => {
|
|
642
642
|
try {
|
|
643
643
|
T ? await v.unpin() : await v.pin();
|
|
644
|
-
} catch (
|
|
644
|
+
} catch (S) {
|
|
645
645
|
console.error(
|
|
646
646
|
"[ChannelHeaderRedesign] Failed to update pinned status:",
|
|
647
|
-
|
|
647
|
+
S
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
|
-
},
|
|
650
|
+
}, M = /* @__PURE__ */ f(Z, { children: [
|
|
651
651
|
/* @__PURE__ */ n(
|
|
652
|
-
|
|
652
|
+
ye,
|
|
653
653
|
{
|
|
654
654
|
id: ((C = b == null ? void 0 : b.user) == null ? void 0 : C.id) || v.id || "unknown",
|
|
655
|
-
name:
|
|
655
|
+
name: y,
|
|
656
656
|
image: _,
|
|
657
657
|
shape: "circle",
|
|
658
658
|
size: 48,
|
|
@@ -667,9 +667,9 @@ const we = ({
|
|
|
667
667
|
$ ? "pl-3 pr-2" : "px-3"
|
|
668
668
|
),
|
|
669
669
|
children: /* @__PURE__ */ f("span", { className: "flex max-w-full items-center justify-center", children: [
|
|
670
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children:
|
|
670
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: y }),
|
|
671
671
|
$ && /* @__PURE__ */ f("span", { className: "ml-2 flex gap-1", children: [
|
|
672
|
-
|
|
672
|
+
R && /* @__PURE__ */ n(
|
|
673
673
|
"span",
|
|
674
674
|
{
|
|
675
675
|
"aria-label": "Paid customer",
|
|
@@ -677,12 +677,12 @@ const we = ({
|
|
|
677
677
|
children: /* @__PURE__ */ n(Gs, { className: "size-2.5", weight: "bold" })
|
|
678
678
|
}
|
|
679
679
|
),
|
|
680
|
-
|
|
680
|
+
L && /* @__PURE__ */ n("span", { className: "messaging-header-star-badge flex overflow-hidden", children: /* @__PURE__ */ n(
|
|
681
681
|
"span",
|
|
682
682
|
{
|
|
683
683
|
"aria-label": "Starred conversation",
|
|
684
684
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
685
|
-
children: /* @__PURE__ */ n(
|
|
685
|
+
children: /* @__PURE__ */ n(at, { className: "size-2.5", weight: "fill" })
|
|
686
686
|
}
|
|
687
687
|
) }),
|
|
688
688
|
w && /* @__PURE__ */ n(
|
|
@@ -710,7 +710,7 @@ const we = ({
|
|
|
710
710
|
"button",
|
|
711
711
|
{
|
|
712
712
|
className: k(
|
|
713
|
-
|
|
713
|
+
Ke,
|
|
714
714
|
"messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
|
|
715
715
|
),
|
|
716
716
|
onClick: t || (() => {
|
|
@@ -725,22 +725,22 @@ const we = ({
|
|
|
725
725
|
{
|
|
726
726
|
type: "button",
|
|
727
727
|
onClick: w,
|
|
728
|
-
"aria-label": `View details for ${
|
|
728
|
+
"aria-label": `View details for ${y}`,
|
|
729
729
|
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
730
|
-
children:
|
|
730
|
+
children: M
|
|
731
731
|
}
|
|
732
|
-
) : /* @__PURE__ */ n("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children:
|
|
732
|
+
) : /* @__PURE__ */ n("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children: M }) }),
|
|
733
733
|
/* @__PURE__ */ f("div", { className: "flex items-start justify-end gap-2", children: [
|
|
734
734
|
a && /* @__PURE__ */ n(
|
|
735
735
|
"button",
|
|
736
736
|
{
|
|
737
|
-
className:
|
|
737
|
+
className: Ke,
|
|
738
738
|
onClick: F,
|
|
739
739
|
type: "button",
|
|
740
740
|
"aria-pressed": T,
|
|
741
741
|
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
742
742
|
children: /* @__PURE__ */ n(
|
|
743
|
-
|
|
743
|
+
at,
|
|
744
744
|
{
|
|
745
745
|
className: k("size-5", {
|
|
746
746
|
"text-[#FFD60A]": T,
|
|
@@ -765,7 +765,7 @@ const we = ({
|
|
|
765
765
|
onBlockParticipantClick: h,
|
|
766
766
|
onReportParticipantClick: m,
|
|
767
767
|
customChannelActions: g,
|
|
768
|
-
triggerClassName:
|
|
768
|
+
triggerClassName: Ke
|
|
769
769
|
}
|
|
770
770
|
))
|
|
771
771
|
] })
|
|
@@ -797,7 +797,7 @@ function za(e) {
|
|
|
797
797
|
(t) => e === t || e.endsWith(`.${t}`)
|
|
798
798
|
);
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function oe(e) {
|
|
801
801
|
const t = e == null ? void 0 : e.trim();
|
|
802
802
|
if (!t) return;
|
|
803
803
|
const s = Pa(t);
|
|
@@ -815,7 +815,7 @@ const Fa = [
|
|
|
815
815
|
[/plain|rtf/, "text"],
|
|
816
816
|
[/markdown/, "markdown"]
|
|
817
817
|
];
|
|
818
|
-
function
|
|
818
|
+
function ce(e) {
|
|
819
819
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
820
820
|
}
|
|
821
821
|
function yn(e) {
|
|
@@ -841,10 +841,10 @@ const $a = {
|
|
|
841
841
|
generic: hn
|
|
842
842
|
};
|
|
843
843
|
function Ua(e) {
|
|
844
|
-
const t =
|
|
844
|
+
const t = ce(e);
|
|
845
845
|
return t !== "document" ? $a[t] : Ba[yn(e)];
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function xe(e, t) {
|
|
848
848
|
return z.createElement(Ua(e), t);
|
|
849
849
|
}
|
|
850
850
|
const ja = (e) => {
|
|
@@ -862,78 +862,78 @@ const ja = (e) => {
|
|
|
862
862
|
muted: d = !1,
|
|
863
863
|
onContainerClick: u
|
|
864
864
|
}) => {
|
|
865
|
-
const h =
|
|
865
|
+
const h = ce(t), m = V(null), g = V(null), c = V(null), p = V(r), [w, v] = B(a), [x, b] = B(0), [y, _] = B(!1), [T, R] = B(!1), [L, $] = B(!1), [F, M] = B(!1), [E, D] = B(!0), [I, C] = B(null), S = K(() => {
|
|
866
866
|
$(!1), v(!0);
|
|
867
|
-
}, []), P =
|
|
868
|
-
const
|
|
869
|
-
if (!
|
|
870
|
-
const
|
|
867
|
+
}, []), P = K((N) => {
|
|
868
|
+
const A = g.current;
|
|
869
|
+
if (!A) return 0;
|
|
870
|
+
const Y = A.getBoundingClientRect();
|
|
871
871
|
return Math.max(
|
|
872
872
|
0,
|
|
873
|
-
Math.min(1, (ja(
|
|
873
|
+
Math.min(1, (ja(N) - Y.left) / Y.width)
|
|
874
874
|
);
|
|
875
|
-
}, []), U =
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
}, []),
|
|
879
|
-
|
|
880
|
-
const
|
|
881
|
-
b(
|
|
875
|
+
}, []), U = K((N) => {
|
|
876
|
+
const A = m.current;
|
|
877
|
+
A && A.duration && (A.currentTime = N * A.duration);
|
|
878
|
+
}, []), j = (N) => {
|
|
879
|
+
N.stopPropagation(), _(!0);
|
|
880
|
+
const A = P(N);
|
|
881
|
+
b(A), U(A);
|
|
882
882
|
};
|
|
883
|
-
|
|
883
|
+
X(() => {
|
|
884
884
|
r !== void 0 && r !== p.current && (p.current = r, v(r));
|
|
885
|
-
}, [r]),
|
|
885
|
+
}, [r]), X(() => {
|
|
886
886
|
if (!w) {
|
|
887
887
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
|
-
const
|
|
891
|
-
const
|
|
892
|
-
|
|
890
|
+
const N = () => {
|
|
891
|
+
const A = m.current;
|
|
892
|
+
A && A.duration && !y && b(A.currentTime / A.duration), c.current = requestAnimationFrame(N);
|
|
893
893
|
};
|
|
894
|
-
return c.current = requestAnimationFrame(
|
|
894
|
+
return c.current = requestAnimationFrame(N), () => {
|
|
895
895
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
896
896
|
};
|
|
897
|
-
}, [w,
|
|
898
|
-
const
|
|
899
|
-
|
|
897
|
+
}, [w, y]), X(() => {
|
|
898
|
+
const N = m.current;
|
|
899
|
+
N && (w ? N.play().catch((A) => {
|
|
900
900
|
v(!1), $(!0);
|
|
901
|
-
}) :
|
|
902
|
-
}, [w]),
|
|
903
|
-
if (!
|
|
904
|
-
const
|
|
905
|
-
_(!1), U(P(
|
|
901
|
+
}) : N.pause());
|
|
902
|
+
}, [w]), X(() => {
|
|
903
|
+
if (!y) return;
|
|
904
|
+
const N = (Y) => b(P(Y)), A = (Y) => {
|
|
905
|
+
_(!1), U(P(Y));
|
|
906
906
|
};
|
|
907
|
-
return window.addEventListener("mousemove",
|
|
908
|
-
window.removeEventListener("mousemove",
|
|
907
|
+
return window.addEventListener("mousemove", N), window.addEventListener("mouseup", A), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", A), () => {
|
|
908
|
+
window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", A), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", A);
|
|
909
909
|
};
|
|
910
|
-
}, [
|
|
911
|
-
const
|
|
910
|
+
}, [y, P, U]);
|
|
911
|
+
const ee = I ? { aspectRatio: String(I) } : void 0, J = I ? "" : " aspect-video", G = Math.round(x * 100);
|
|
912
912
|
return /* @__PURE__ */ f(
|
|
913
913
|
"div",
|
|
914
914
|
{
|
|
915
915
|
role: "button",
|
|
916
916
|
tabIndex: 0,
|
|
917
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
918
|
-
style:
|
|
919
|
-
onClick: (
|
|
917
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${J}`,
|
|
918
|
+
style: ee,
|
|
919
|
+
onClick: (N) => {
|
|
920
920
|
if (u) {
|
|
921
|
-
u(
|
|
921
|
+
u(N);
|
|
922
922
|
return;
|
|
923
923
|
}
|
|
924
|
-
|
|
924
|
+
L || o && v((A) => !A);
|
|
925
925
|
},
|
|
926
|
-
onKeyDown: (
|
|
927
|
-
if (!(
|
|
928
|
-
if (
|
|
929
|
-
u(
|
|
926
|
+
onKeyDown: (N) => {
|
|
927
|
+
if (!(N.key !== "Enter" && N.key !== " ")) {
|
|
928
|
+
if (N.preventDefault(), u) {
|
|
929
|
+
u(N);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
|
|
932
|
+
L || o && v((A) => !A);
|
|
933
933
|
}
|
|
934
934
|
},
|
|
935
935
|
children: [
|
|
936
|
-
s && (h === "audio" ||
|
|
936
|
+
s && (h === "audio" || E) && /* @__PURE__ */ n(
|
|
937
937
|
"img",
|
|
938
938
|
{
|
|
939
939
|
src: s,
|
|
@@ -941,7 +941,7 @@ const ja = (e) => {
|
|
|
941
941
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
942
942
|
}
|
|
943
943
|
),
|
|
944
|
-
!s && (h === "audio" ||
|
|
944
|
+
!s && (h === "audio" || E) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: xe(t, {
|
|
945
945
|
className: "size-12 text-black/20",
|
|
946
946
|
weight: "regular"
|
|
947
947
|
}) }),
|
|
@@ -953,11 +953,11 @@ const ja = (e) => {
|
|
|
953
953
|
loop: i,
|
|
954
954
|
muted: d,
|
|
955
955
|
style: { width: "100%", height: "100%" },
|
|
956
|
-
onLoadStart: () =>
|
|
956
|
+
onLoadStart: () => M(!0),
|
|
957
957
|
onCanPlay: () => {
|
|
958
|
-
|
|
958
|
+
M(!1), D(!1);
|
|
959
959
|
},
|
|
960
|
-
onWaiting: () =>
|
|
960
|
+
onWaiting: () => M(!0),
|
|
961
961
|
onPlay: () => $(!1),
|
|
962
962
|
onEnded: () => {
|
|
963
963
|
i || (v(!1), b(0));
|
|
@@ -973,15 +973,15 @@ const ja = (e) => {
|
|
|
973
973
|
muted: d,
|
|
974
974
|
playsInline: !0,
|
|
975
975
|
style: { width: "100%", height: "100%" },
|
|
976
|
-
onLoadStart: () =>
|
|
976
|
+
onLoadStart: () => M(!0),
|
|
977
977
|
onCanPlay: () => {
|
|
978
|
-
|
|
978
|
+
M(!1), D(!1);
|
|
979
979
|
},
|
|
980
|
-
onWaiting: () =>
|
|
980
|
+
onWaiting: () => M(!0),
|
|
981
981
|
onPlay: () => $(!1),
|
|
982
982
|
onLoadedMetadata: () => {
|
|
983
|
-
const
|
|
984
|
-
|
|
983
|
+
const N = m.current;
|
|
984
|
+
N instanceof HTMLVideoElement && N.videoWidth && N.videoHeight && C(N.videoWidth / N.videoHeight);
|
|
985
985
|
},
|
|
986
986
|
onEnded: () => {
|
|
987
987
|
i || (v(!1), b(0));
|
|
@@ -989,27 +989,27 @@ const ja = (e) => {
|
|
|
989
989
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
990
990
|
}
|
|
991
991
|
) }),
|
|
992
|
-
F && !
|
|
993
|
-
|
|
992
|
+
F && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
993
|
+
ve,
|
|
994
994
|
{
|
|
995
995
|
className: "size-8 animate-spin text-white/80",
|
|
996
996
|
weight: "bold"
|
|
997
997
|
}
|
|
998
998
|
) }),
|
|
999
|
-
|
|
999
|
+
L && !o && /* @__PURE__ */ n(
|
|
1000
1000
|
"div",
|
|
1001
1001
|
{
|
|
1002
1002
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
1003
1003
|
role: "button",
|
|
1004
1004
|
tabIndex: 0,
|
|
1005
1005
|
"aria-label": "Play preview",
|
|
1006
|
-
onClick: (
|
|
1007
|
-
|
|
1006
|
+
onClick: (N) => {
|
|
1007
|
+
N.stopPropagation(), S();
|
|
1008
1008
|
},
|
|
1009
|
-
onKeyDown: (
|
|
1010
|
-
|
|
1009
|
+
onKeyDown: (N) => {
|
|
1010
|
+
N.key !== "Enter" && N.key !== " " || (N.preventDefault(), N.stopPropagation(), S());
|
|
1011
1011
|
},
|
|
1012
|
-
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(
|
|
1012
|
+
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(rt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1013
1013
|
}
|
|
1014
1014
|
),
|
|
1015
1015
|
l && !o && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
@@ -1017,23 +1017,23 @@ const ja = (e) => {
|
|
|
1017
1017
|
{
|
|
1018
1018
|
role: "slider",
|
|
1019
1019
|
"aria-label": "Playback position",
|
|
1020
|
-
"aria-valuenow":
|
|
1020
|
+
"aria-valuenow": G,
|
|
1021
1021
|
"aria-valuemin": 0,
|
|
1022
1022
|
"aria-valuemax": 100,
|
|
1023
1023
|
tabIndex: 0,
|
|
1024
1024
|
ref: g,
|
|
1025
1025
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1026
|
-
onMouseDown:
|
|
1027
|
-
onTouchStart:
|
|
1028
|
-
onClick: (
|
|
1029
|
-
onKeyDown: (
|
|
1030
|
-
|
|
1026
|
+
onMouseDown: j,
|
|
1027
|
+
onTouchStart: j,
|
|
1028
|
+
onClick: (N) => N.stopPropagation(),
|
|
1029
|
+
onKeyDown: (N) => {
|
|
1030
|
+
N.key === "ArrowRight" && U(Math.min(1, x + 0.05)), N.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
|
|
1031
1031
|
},
|
|
1032
1032
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
1035
1035
|
className: "h-full rounded-full bg-white",
|
|
1036
|
-
style: { width: `${
|
|
1036
|
+
style: { width: `${G}%` }
|
|
1037
1037
|
}
|
|
1038
1038
|
) })
|
|
1039
1039
|
}
|
|
@@ -1043,12 +1043,12 @@ const ja = (e) => {
|
|
|
1043
1043
|
"button",
|
|
1044
1044
|
{
|
|
1045
1045
|
type: "button",
|
|
1046
|
-
onClick: (
|
|
1047
|
-
|
|
1046
|
+
onClick: (N) => {
|
|
1047
|
+
N.stopPropagation(), v((A) => !A);
|
|
1048
1048
|
},
|
|
1049
1049
|
className: "shrink-0 text-white",
|
|
1050
1050
|
"aria-label": w ? "Pause" : "Play",
|
|
1051
|
-
children: w ? /* @__PURE__ */ n(sa, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(
|
|
1051
|
+
children: w ? /* @__PURE__ */ n(sa, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(rt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1052
1052
|
}
|
|
1053
1053
|
),
|
|
1054
1054
|
/* @__PURE__ */ f(
|
|
@@ -1056,30 +1056,30 @@ const ja = (e) => {
|
|
|
1056
1056
|
{
|
|
1057
1057
|
role: "slider",
|
|
1058
1058
|
"aria-label": "Playback position",
|
|
1059
|
-
"aria-valuenow":
|
|
1059
|
+
"aria-valuenow": G,
|
|
1060
1060
|
"aria-valuemin": 0,
|
|
1061
1061
|
"aria-valuemax": 100,
|
|
1062
1062
|
tabIndex: 0,
|
|
1063
1063
|
ref: g,
|
|
1064
1064
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1065
|
-
onMouseDown:
|
|
1066
|
-
onTouchStart:
|
|
1067
|
-
onClick: (
|
|
1068
|
-
onMouseEnter: () =>
|
|
1069
|
-
onMouseLeave: () =>
|
|
1070
|
-
onKeyDown: (
|
|
1071
|
-
|
|
1065
|
+
onMouseDown: j,
|
|
1066
|
+
onTouchStart: j,
|
|
1067
|
+
onClick: (N) => N.stopPropagation(),
|
|
1068
|
+
onMouseEnter: () => R(!0),
|
|
1069
|
+
onMouseLeave: () => R(!1),
|
|
1070
|
+
onKeyDown: (N) => {
|
|
1071
|
+
N.key === "ArrowRight" && U(Math.min(1, x + 0.05)), N.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
|
|
1072
1072
|
},
|
|
1073
1073
|
children: [
|
|
1074
1074
|
/* @__PURE__ */ n(
|
|
1075
1075
|
"div",
|
|
1076
1076
|
{
|
|
1077
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T ||
|
|
1077
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || y ? "h-1.5" : "h-1"}`,
|
|
1078
1078
|
children: /* @__PURE__ */ n(
|
|
1079
1079
|
"div",
|
|
1080
1080
|
{
|
|
1081
1081
|
className: "h-full rounded-full bg-white",
|
|
1082
|
-
style: { width: `${
|
|
1082
|
+
style: { width: `${G}%` }
|
|
1083
1083
|
}
|
|
1084
1084
|
)
|
|
1085
1085
|
}
|
|
@@ -1087,8 +1087,8 @@ const ja = (e) => {
|
|
|
1087
1087
|
/* @__PURE__ */ n(
|
|
1088
1088
|
"div",
|
|
1089
1089
|
{
|
|
1090
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T ||
|
|
1091
|
-
style: { left: `${
|
|
1090
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || y ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1091
|
+
style: { left: `${G}%` }
|
|
1092
1092
|
}
|
|
1093
1093
|
)
|
|
1094
1094
|
]
|
|
@@ -1107,7 +1107,7 @@ const ja = (e) => {
|
|
|
1107
1107
|
mediaPlayerProps: i,
|
|
1108
1108
|
containedImage: o = !1
|
|
1109
1109
|
}) => {
|
|
1110
|
-
const l =
|
|
1110
|
+
const l = ce(e), [d, u] = B(!1), h = oe(t), m = oe(s);
|
|
1111
1111
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
1112
1112
|
Ha,
|
|
1113
1113
|
{
|
|
@@ -1155,7 +1155,7 @@ const ja = (e) => {
|
|
|
1155
1155
|
"div",
|
|
1156
1156
|
{
|
|
1157
1157
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1158
|
-
children:
|
|
1158
|
+
children: xe(e, {
|
|
1159
1159
|
className: Kt(r),
|
|
1160
1160
|
weight: "regular"
|
|
1161
1161
|
})
|
|
@@ -1172,7 +1172,7 @@ const ja = (e) => {
|
|
|
1172
1172
|
"div",
|
|
1173
1173
|
{
|
|
1174
1174
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1175
|
-
children:
|
|
1175
|
+
children: xe(e, {
|
|
1176
1176
|
className: Kt(r),
|
|
1177
1177
|
weight: "regular"
|
|
1178
1178
|
})
|
|
@@ -1219,7 +1219,7 @@ const ja = (e) => {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
1221
1221
|
/* @__PURE__ */ f("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1222
|
-
|
|
1222
|
+
xe(r, {
|
|
1223
1223
|
className: k(
|
|
1224
1224
|
"size-5 shrink-0",
|
|
1225
1225
|
g ? "text-white/55" : "text-black/55"
|
|
@@ -1247,7 +1247,7 @@ const ja = (e) => {
|
|
|
1247
1247
|
function Cn(e) {
|
|
1248
1248
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function ct(e) {
|
|
1251
1251
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#1e2330]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1252
1252
|
}
|
|
1253
1253
|
function Ga(e) {
|
|
@@ -1265,12 +1265,12 @@ function Xa(e) {
|
|
|
1265
1265
|
function qa(e) {
|
|
1266
1266
|
return e ? "text-white/20" : "text-black/20";
|
|
1267
1267
|
}
|
|
1268
|
-
const
|
|
1268
|
+
const dt = ({ attachment: e, isMyMessage: t }) => {
|
|
1269
1269
|
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, u = /* @__PURE__ */ f(z.Fragment, { children: [
|
|
1270
1270
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1271
1271
|
"img",
|
|
1272
1272
|
{
|
|
1273
|
-
src:
|
|
1273
|
+
src: oe(r) ?? r,
|
|
1274
1274
|
alt: s ?? "",
|
|
1275
1275
|
className: "aspect-video w-full rounded-[20px] object-cover"
|
|
1276
1276
|
}
|
|
@@ -1319,7 +1319,7 @@ const ct = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1319
1319
|
function Sn(e) {
|
|
1320
1320
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function ut(e) {
|
|
1323
1323
|
var t;
|
|
1324
1324
|
return (t = e.attachments) == null ? void 0 : t.find(Sn);
|
|
1325
1325
|
}
|
|
@@ -1356,19 +1356,19 @@ const Za = ({
|
|
|
1356
1356
|
disabled: s,
|
|
1357
1357
|
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",
|
|
1358
1358
|
children: s ? /* @__PURE__ */ n(
|
|
1359
|
-
|
|
1359
|
+
ve,
|
|
1360
1360
|
{
|
|
1361
1361
|
className: "size-4 animate-spin text-white",
|
|
1362
1362
|
weight: "bold"
|
|
1363
1363
|
}
|
|
1364
1364
|
) : /* @__PURE__ */ f(z.Fragment, { children: [
|
|
1365
|
-
/* @__PURE__ */ n(
|
|
1365
|
+
/* @__PURE__ */ n(Ee, { className: "size-4 text-white", weight: "bold" }),
|
|
1366
1366
|
"Download"
|
|
1367
1367
|
] })
|
|
1368
1368
|
}
|
|
1369
1369
|
);
|
|
1370
1370
|
};
|
|
1371
|
-
function
|
|
1371
|
+
function mt(e) {
|
|
1372
1372
|
var m, g, c, p;
|
|
1373
1373
|
const t = (m = e.attachments) == null ? void 0 : m.find(
|
|
1374
1374
|
(w) => w.type === "video" && w.asset_url
|
|
@@ -1424,7 +1424,7 @@ const En = ({
|
|
|
1424
1424
|
fileSize: a,
|
|
1425
1425
|
thumbnailUrl: r
|
|
1426
1426
|
}) => {
|
|
1427
|
-
const i =
|
|
1427
|
+
const i = ce(t), o = a !== void 0 ? Cn(a) : void 0;
|
|
1428
1428
|
return /* @__PURE__ */ n(
|
|
1429
1429
|
kn,
|
|
1430
1430
|
{
|
|
@@ -1450,10 +1450,10 @@ const En = ({
|
|
|
1450
1450
|
message: e,
|
|
1451
1451
|
isMyMessage: t = !1
|
|
1452
1452
|
}) => {
|
|
1453
|
-
const s =
|
|
1453
|
+
const s = ut(e), a = mt(e);
|
|
1454
1454
|
return !s && !a ? null : /* @__PURE__ */ f("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1455
1455
|
!t && e.user && /* @__PURE__ */ n(
|
|
1456
|
-
|
|
1456
|
+
ye,
|
|
1457
1457
|
{
|
|
1458
1458
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1459
1459
|
id: e.user.id,
|
|
@@ -1477,8 +1477,8 @@ const En = ({
|
|
|
1477
1477
|
overflow: "visible",
|
|
1478
1478
|
background: "transparent"
|
|
1479
1479
|
},
|
|
1480
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1481
|
-
|
|
1480
|
+
children: s ? /* @__PURE__ */ n("div", { className: ct(t), children: /* @__PURE__ */ n(
|
|
1481
|
+
dt,
|
|
1482
1482
|
{
|
|
1483
1483
|
attachment: s,
|
|
1484
1484
|
isMyMessage: t
|
|
@@ -1492,18 +1492,18 @@ const En = ({
|
|
|
1492
1492
|
}, Qa = ({
|
|
1493
1493
|
message: e
|
|
1494
1494
|
}) => {
|
|
1495
|
-
const t =
|
|
1495
|
+
const t = ut(e);
|
|
1496
1496
|
if (t)
|
|
1497
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1498
|
-
const s =
|
|
1497
|
+
return /* @__PURE__ */ n("div", { className: ct(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(dt, { attachment: t, isMyMessage: !0 }) });
|
|
1498
|
+
const s = mt(e);
|
|
1499
1499
|
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(En, { ...s }) }) : null;
|
|
1500
1500
|
}, er = ({
|
|
1501
1501
|
message: e
|
|
1502
1502
|
}) => {
|
|
1503
|
-
const t =
|
|
1503
|
+
const t = ut(e);
|
|
1504
1504
|
if (t)
|
|
1505
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1506
|
-
const s =
|
|
1505
|
+
return /* @__PURE__ */ n("div", { className: ct(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(dt, { attachment: t, isMyMessage: !1 }) });
|
|
1506
|
+
const s = mt(e);
|
|
1507
1507
|
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(In, { ...s }) }) : null;
|
|
1508
1508
|
}, to = Object.assign(Ja, {
|
|
1509
1509
|
Creator: Qa,
|
|
@@ -1512,17 +1512,17 @@ const En = ({
|
|
|
1512
1512
|
isUnlocking: () => !1
|
|
1513
1513
|
}, nr = {
|
|
1514
1514
|
LockedAttachment: tr
|
|
1515
|
-
}, Tn =
|
|
1515
|
+
}, Tn = He({}), no = Tn.Provider;
|
|
1516
1516
|
function sr(e) {
|
|
1517
|
-
return
|
|
1517
|
+
return we(Tn)[e] ?? nr[e];
|
|
1518
1518
|
}
|
|
1519
|
-
const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import("./Card-
|
|
1519
|
+
const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import("./Card-ClyBNKoW.js")), ir = () => /* @__PURE__ */ n(
|
|
1520
1520
|
"div",
|
|
1521
1521
|
{
|
|
1522
1522
|
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)]",
|
|
1523
1523
|
"aria-hidden": !0
|
|
1524
1524
|
}
|
|
1525
|
-
),
|
|
1525
|
+
), ze = (e) => /* @__PURE__ */ n(rs, { fallback: /* @__PURE__ */ n(ir, {}), children: e.contentType === "text" ? /* @__PURE__ */ n(ar, { ...e }) : /* @__PURE__ */ n(rr, { ...e }) }), lr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1526
1526
|
"svg",
|
|
1527
1527
|
{
|
|
1528
1528
|
width: e,
|
|
@@ -1541,33 +1541,33 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1541
1541
|
}
|
|
1542
1542
|
), or = (e) => {
|
|
1543
1543
|
var t;
|
|
1544
|
-
return ((t = e.metadata) == null ? void 0 : t.custom_type) ===
|
|
1544
|
+
return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.TIP;
|
|
1545
1545
|
}, An = (e) => {
|
|
1546
1546
|
var t;
|
|
1547
|
-
return ((t = e.metadata) == null ? void 0 : t.custom_type) ===
|
|
1548
|
-
},
|
|
1547
|
+
return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.PAID;
|
|
1548
|
+
}, $e = (e) => {
|
|
1549
1549
|
var t;
|
|
1550
|
-
return ((t = e.metadata) == null ? void 0 : t.custom_type) ===
|
|
1551
|
-
},
|
|
1550
|
+
return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.CHATBOT;
|
|
1551
|
+
}, ht = (e) => {
|
|
1552
1552
|
var t;
|
|
1553
|
-
return ((t = e.metadata) == null ? void 0 : t.custom_type) ===
|
|
1553
|
+
return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.ATTACHMENT;
|
|
1554
1554
|
}, cr = (e) => {
|
|
1555
1555
|
var t;
|
|
1556
|
-
return
|
|
1556
|
+
return ht(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
|
|
1557
1557
|
}, dr = (e) => {
|
|
1558
1558
|
var t;
|
|
1559
|
-
return
|
|
1559
|
+
return ht(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
|
|
1560
1560
|
}, Rn = (e) => or(e) || An(e), ur = (e) => {
|
|
1561
1561
|
var t;
|
|
1562
1562
|
return Rn(e) && !((t = e.text) != null && t.trim());
|
|
1563
|
-
},
|
|
1563
|
+
}, Ze = ({
|
|
1564
1564
|
message: e,
|
|
1565
1565
|
standalone: t = !1,
|
|
1566
1566
|
isMyMessage: s = !1,
|
|
1567
1567
|
hasAttachment: a = !1
|
|
1568
1568
|
}) => {
|
|
1569
1569
|
var g;
|
|
1570
|
-
const r = Rn(e), i =
|
|
1570
|
+
const r = Rn(e), i = $e(e);
|
|
1571
1571
|
if (!r && !i)
|
|
1572
1572
|
return null;
|
|
1573
1573
|
if (r) {
|
|
@@ -1585,10 +1585,10 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1585
1585
|
{
|
|
1586
1586
|
className: `${d} ${u}`,
|
|
1587
1587
|
"data-testid": "message-chatbot-indicator",
|
|
1588
|
-
children: s && !o ? /* @__PURE__ */ f(
|
|
1588
|
+
children: s && !o ? /* @__PURE__ */ f(Z, { children: [
|
|
1589
1589
|
h,
|
|
1590
1590
|
m
|
|
1591
|
-
] }) : /* @__PURE__ */ f(
|
|
1591
|
+
] }) : /* @__PURE__ */ f(Z, { children: [
|
|
1592
1592
|
m,
|
|
1593
1593
|
h
|
|
1594
1594
|
] })
|
|
@@ -1597,7 +1597,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1597
1597
|
}, Zt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, mr = {
|
|
1598
1598
|
me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
1599
1599
|
other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
1600
|
-
},
|
|
1600
|
+
}, Be = ({ side: e }) => /* @__PURE__ */ n(
|
|
1601
1601
|
"span",
|
|
1602
1602
|
{
|
|
1603
1603
|
"aria-hidden": "true",
|
|
@@ -1612,7 +1612,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1612
1612
|
mask: Zt
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
|
-
), Ln =
|
|
1615
|
+
), Ln = He(
|
|
1616
1616
|
void 0
|
|
1617
1617
|
), hr = (e) => {
|
|
1618
1618
|
var s;
|
|
@@ -1650,8 +1650,8 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1650
1650
|
}, pr = (e, t) => {
|
|
1651
1651
|
const s = fr(e, t), [a, r] = B(s);
|
|
1652
1652
|
return gr(a, s) ? a : (r(s), s);
|
|
1653
|
-
},
|
|
1654
|
-
const { message: e } =
|
|
1653
|
+
}, ft = () => {
|
|
1654
|
+
const { message: e } = fe("SentMessageDeliveryStatus"), { messages: t } = _e("SentMessageDeliveryStatus"), s = (() => {
|
|
1655
1655
|
if (t)
|
|
1656
1656
|
for (let a = t.length - 1; a >= 0; a -= 1) {
|
|
1657
1657
|
const r = t[a];
|
|
@@ -1660,12 +1660,12 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1660
1660
|
}
|
|
1661
1661
|
})();
|
|
1662
1662
|
return e.id === s;
|
|
1663
|
-
},
|
|
1663
|
+
}, Je = () => ft() ? /* @__PURE__ */ f(Z, { children: [
|
|
1664
1664
|
/* @__PURE__ */ n(oa, { weight: "bold", "aria-hidden": "true" }),
|
|
1665
1665
|
/* @__PURE__ */ n("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
1666
|
-
] }) : null, br = () =>
|
|
1666
|
+
] }) : null, br = () => ft() ? /* @__PURE__ */ f(Z, { children: [
|
|
1667
1667
|
/* @__PURE__ */ n(
|
|
1668
|
-
|
|
1668
|
+
ve,
|
|
1669
1669
|
{
|
|
1670
1670
|
className: "sent-message-status__spinner animate-spin",
|
|
1671
1671
|
weight: "bold",
|
|
@@ -1677,7 +1677,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1677
1677
|
outbound: e,
|
|
1678
1678
|
onOutboundClick: t
|
|
1679
1679
|
}) => {
|
|
1680
|
-
const s = e.name || "Broadcast", r = /* @__PURE__ */ f(
|
|
1680
|
+
const s = e.name || "Broadcast", r = /* @__PURE__ */ f(Z, { children: [
|
|
1681
1681
|
/* @__PURE__ */ n("span", { className: "sent-message-outbound-badge", "aria-hidden": "true", children: /* @__PURE__ */ n(la, { weight: "fill" }) }),
|
|
1682
1682
|
/* @__PURE__ */ n(
|
|
1683
1683
|
"span",
|
|
@@ -1708,9 +1708,9 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1708
1708
|
resolvedOutbound: t
|
|
1709
1709
|
}) => {
|
|
1710
1710
|
var h;
|
|
1711
|
-
const { isMyMessage: s, message: a, threadList: r } =
|
|
1711
|
+
const { isMyMessage: s, message: a, threadList: r } = fe(
|
|
1712
1712
|
"SentMessageDeliveryStatus"
|
|
1713
|
-
), i = s(), o =
|
|
1713
|
+
), i = s(), o = ft();
|
|
1714
1714
|
if (r)
|
|
1715
1715
|
return null;
|
|
1716
1716
|
if (a.status === "failed" && i && a.type !== "error")
|
|
@@ -1726,9 +1726,9 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1726
1726
|
) : null, u = /* @__PURE__ */ n(
|
|
1727
1727
|
ds,
|
|
1728
1728
|
{
|
|
1729
|
-
MessageSentStatus:
|
|
1730
|
-
MessageDeliveredStatus:
|
|
1731
|
-
MessageReadStatus:
|
|
1729
|
+
MessageSentStatus: Je,
|
|
1730
|
+
MessageDeliveredStatus: Je,
|
|
1731
|
+
MessageReadStatus: Je,
|
|
1732
1732
|
MessageSendingStatus: br
|
|
1733
1733
|
}
|
|
1734
1734
|
);
|
|
@@ -1738,7 +1738,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1738
1738
|
d
|
|
1739
1739
|
] }) : u;
|
|
1740
1740
|
}, _r = /^([a-z][a-z0-9+.-]*):/i, yr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
1741
|
-
function
|
|
1741
|
+
function gt(e) {
|
|
1742
1742
|
if (typeof e != "string") return;
|
|
1743
1743
|
const t = e.trim();
|
|
1744
1744
|
if (t === "") return;
|
|
@@ -1769,7 +1769,7 @@ const Nr = {
|
|
|
1769
1769
|
s ? "w-full" : "min-w-0",
|
|
1770
1770
|
!a && "mt-2",
|
|
1771
1771
|
Nr[e][r]
|
|
1772
|
-
), o = s ? t.label : /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t.label }), l =
|
|
1772
|
+
), o = s ? t.label : /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t.label }), l = gt(t.href);
|
|
1773
1773
|
return l ? /* @__PURE__ */ n(
|
|
1774
1774
|
"a",
|
|
1775
1775
|
{
|
|
@@ -1804,7 +1804,7 @@ const Nr = {
|
|
|
1804
1804
|
}, Sr = {
|
|
1805
1805
|
dark: "bg-white/25",
|
|
1806
1806
|
light: "bg-black/15"
|
|
1807
|
-
},
|
|
1807
|
+
}, pt = ({
|
|
1808
1808
|
variant: e,
|
|
1809
1809
|
ctaSurface: t,
|
|
1810
1810
|
chinTextColor: s,
|
|
@@ -1821,13 +1821,13 @@ const Nr = {
|
|
|
1821
1821
|
const g = e === "dark", c = a ?? (g ? r : void 0) ?? "", p = c.trim() !== "", w = i != null && i.trim() !== "", v = typeof l == "string" ? l.trim() : "", x = v !== "", b = u != null;
|
|
1822
1822
|
if (!m && !p && !w && !x && !b)
|
|
1823
1823
|
return null;
|
|
1824
|
-
const
|
|
1824
|
+
const y = g && !a, _ = k(
|
|
1825
1825
|
"line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]",
|
|
1826
|
-
s == null && (
|
|
1826
|
+
s == null && (y ? Cr : kr[e])
|
|
1827
1827
|
), T = k(
|
|
1828
1828
|
"truncate text-[12px] leading-4 tracking-[0.24px]",
|
|
1829
1829
|
s == null && Jt[e]
|
|
1830
|
-
),
|
|
1830
|
+
), R = k(
|
|
1831
1831
|
"text-[12px] leading-4 tracking-[0.24px]",
|
|
1832
1832
|
o <= 1 && "truncate",
|
|
1833
1833
|
s == null && Jt[e]
|
|
@@ -1842,13 +1842,13 @@ const Nr = {
|
|
|
1842
1842
|
/* @__PURE__ */ n("div", { className: k("h-4 w-1/2", F), "aria-hidden": !0 })
|
|
1843
1843
|
] }) });
|
|
1844
1844
|
}
|
|
1845
|
-
const
|
|
1846
|
-
...
|
|
1845
|
+
const L = s ? { color: s } : void 0, $ = o > 1 ? {
|
|
1846
|
+
...L,
|
|
1847
1847
|
display: "-webkit-box",
|
|
1848
1848
|
WebkitBoxOrient: "vertical",
|
|
1849
1849
|
WebkitLineClamp: o,
|
|
1850
1850
|
overflow: "hidden"
|
|
1851
|
-
} :
|
|
1851
|
+
} : L;
|
|
1852
1852
|
return /* @__PURE__ */ f("div", { className: "shrink-0 px-4 py-3", children: [
|
|
1853
1853
|
/* @__PURE__ */ f("div", { className: "flex items-end gap-3", children: [
|
|
1854
1854
|
/* @__PURE__ */ f("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
@@ -1858,13 +1858,13 @@ const Nr = {
|
|
|
1858
1858
|
"p",
|
|
1859
1859
|
{
|
|
1860
1860
|
className: k("min-w-0", _),
|
|
1861
|
-
style:
|
|
1861
|
+
style: L,
|
|
1862
1862
|
children: c
|
|
1863
1863
|
}
|
|
1864
1864
|
)
|
|
1865
1865
|
] }),
|
|
1866
|
-
w && /* @__PURE__ */ n("p", { className:
|
|
1867
|
-
!b && x && /* @__PURE__ */ n("p", { className: T, style:
|
|
1866
|
+
w && /* @__PURE__ */ n("p", { className: R, style: $, children: i }),
|
|
1867
|
+
!b && x && /* @__PURE__ */ n("p", { className: T, style: L, children: v })
|
|
1868
1868
|
] }),
|
|
1869
1869
|
h && /* @__PURE__ */ n("div", { className: "shrink-0", children: h })
|
|
1870
1870
|
] }),
|
|
@@ -1875,7 +1875,7 @@ const Nr = {
|
|
|
1875
1875
|
// 20px corners — no token exists for it in the component-library preset,
|
|
1876
1876
|
// whose radius scale is sm .5rem / md 1rem / lg 1.5rem / xl 4rem.
|
|
1877
1877
|
"rounded-[20px]"
|
|
1878
|
-
), Tr = "flex h-[250px] flex-col",
|
|
1878
|
+
), Tr = "flex h-[250px] flex-col", Ie = ({
|
|
1879
1879
|
variant: e,
|
|
1880
1880
|
children: t,
|
|
1881
1881
|
href: s,
|
|
@@ -1971,11 +1971,11 @@ const Nr = {
|
|
|
1971
1971
|
}, Ar = {
|
|
1972
1972
|
dark: "size-16 text-white/25",
|
|
1973
1973
|
light: "size-16 text-black/25"
|
|
1974
|
-
},
|
|
1974
|
+
}, Ae = (e, t) => !!t && !!e && ce(e) === "audio", bt = (e, t) => {
|
|
1975
1975
|
if (!t || !e) return !1;
|
|
1976
|
-
const s =
|
|
1976
|
+
const s = ce(e);
|
|
1977
1977
|
return s === "video" || s === "audio";
|
|
1978
|
-
},
|
|
1978
|
+
}, vt = "bg-[#F2F3F4]", Te = ({
|
|
1979
1979
|
variant: e,
|
|
1980
1980
|
thumbnailUrl: t,
|
|
1981
1981
|
sourceUrl: s,
|
|
@@ -1986,8 +1986,8 @@ const Nr = {
|
|
|
1986
1986
|
isLoading: l = !1,
|
|
1987
1987
|
onImageError: d
|
|
1988
1988
|
}) => {
|
|
1989
|
-
const u =
|
|
1990
|
-
return !l &&
|
|
1989
|
+
const u = ce(r), h = !!s && u === "video", m = oe(t);
|
|
1990
|
+
return !l && Ae(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
1991
1991
|
"audio",
|
|
1992
1992
|
{
|
|
1993
1993
|
src: s,
|
|
@@ -2023,7 +2023,7 @@ const Nr = {
|
|
|
2023
2023
|
"aria-hidden": !0
|
|
2024
2024
|
}
|
|
2025
2025
|
)
|
|
2026
|
-
) : h ? /* @__PURE__ */ f(
|
|
2026
|
+
) : h ? /* @__PURE__ */ f(Z, { children: [
|
|
2027
2027
|
/* @__PURE__ */ n(
|
|
2028
2028
|
"video",
|
|
2029
2029
|
{
|
|
@@ -2064,7 +2064,7 @@ const Nr = {
|
|
|
2064
2064
|
"flex h-full w-full items-center justify-center",
|
|
2065
2065
|
Qt[e]
|
|
2066
2066
|
),
|
|
2067
|
-
children:
|
|
2067
|
+
children: xe(r, {
|
|
2068
2068
|
className: Ar[e],
|
|
2069
2069
|
weight: "regular"
|
|
2070
2070
|
})
|
|
@@ -2084,7 +2084,7 @@ const Mr = "#FFFFFF", Dn = "#040403", Dr = {
|
|
|
2084
2084
|
dark: Mr,
|
|
2085
2085
|
light: Dn
|
|
2086
2086
|
};
|
|
2087
|
-
function
|
|
2087
|
+
function Ge({
|
|
2088
2088
|
variant: e,
|
|
2089
2089
|
accentColor: t,
|
|
2090
2090
|
status: s = "ready",
|
|
@@ -2099,7 +2099,7 @@ function Ve({
|
|
|
2099
2099
|
}, [r]);
|
|
2100
2100
|
const u = z.useCallback(() => {
|
|
2101
2101
|
d(!0);
|
|
2102
|
-
}, []), h =
|
|
2102
|
+
}, []), h = Ae(i, o), c = a === "featured" && !!r && !h && !l && s === "ready" && t != null && Rr.test(t.trim()) ? Lr(t) : void 0, p = h ? Dn : Dr[e];
|
|
2103
2103
|
return {
|
|
2104
2104
|
thumbnailUrl: l ? void 0 : r,
|
|
2105
2105
|
accentHex: c,
|
|
@@ -2127,7 +2127,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2127
2127
|
onEditClick: p,
|
|
2128
2128
|
dismissLabel: w = "Dismiss attachment"
|
|
2129
2129
|
}) => {
|
|
2130
|
-
const v = d === "classic", x =
|
|
2130
|
+
const v = d === "classic", x = Ae(i, l), b = Ge({
|
|
2131
2131
|
variant: "dark",
|
|
2132
2132
|
accentColor: m,
|
|
2133
2133
|
status: g,
|
|
@@ -2135,7 +2135,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2135
2135
|
thumbnailUrl: o,
|
|
2136
2136
|
mimeType: i,
|
|
2137
2137
|
sourceUrl: l
|
|
2138
|
-
}),
|
|
2138
|
+
}), y = c ? /* @__PURE__ */ n(
|
|
2139
2139
|
"button",
|
|
2140
2140
|
{
|
|
2141
2141
|
type: "button",
|
|
@@ -2145,7 +2145,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2145
2145
|
Or,
|
|
2146
2146
|
!x && Pr
|
|
2147
2147
|
),
|
|
2148
|
-
children: /* @__PURE__ */ n(
|
|
2148
|
+
children: /* @__PURE__ */ n(lt, { className: "size-3", weight: "bold" })
|
|
2149
2149
|
}
|
|
2150
2150
|
) : void 0, _ = p ? /* @__PURE__ */ n(
|
|
2151
2151
|
"button",
|
|
@@ -2157,9 +2157,9 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2157
2157
|
children: /* @__PURE__ */ n(ca, { className: "size-5", weight: "regular" })
|
|
2158
2158
|
}
|
|
2159
2159
|
) : void 0;
|
|
2160
|
-
return x && !b.isLoading ? /* @__PURE__ */ n(
|
|
2160
|
+
return x && !b.isLoading ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
2161
2161
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
2162
|
-
|
|
2162
|
+
Te,
|
|
2163
2163
|
{
|
|
2164
2164
|
variant: "dark",
|
|
2165
2165
|
sourceUrl: l,
|
|
@@ -2167,31 +2167,31 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2167
2167
|
mimeType: i
|
|
2168
2168
|
}
|
|
2169
2169
|
) }),
|
|
2170
|
-
|
|
2170
|
+
y && /* @__PURE__ */ n("div", { className: "shrink-0", children: y })
|
|
2171
2171
|
] }) }) : /* @__PURE__ */ f(
|
|
2172
|
-
|
|
2172
|
+
Ie,
|
|
2173
2173
|
{
|
|
2174
2174
|
variant: "dark",
|
|
2175
2175
|
fixedHeight: !v,
|
|
2176
2176
|
accentHex: b.accentHex,
|
|
2177
2177
|
busy: b.isLoading,
|
|
2178
|
-
topRight: v ?
|
|
2178
|
+
topRight: v ? y : void 0,
|
|
2179
2179
|
children: [
|
|
2180
2180
|
!v && /* @__PURE__ */ n(
|
|
2181
|
-
|
|
2181
|
+
Te,
|
|
2182
2182
|
{
|
|
2183
2183
|
variant: "dark",
|
|
2184
2184
|
thumbnailUrl: b.thumbnailUrl,
|
|
2185
2185
|
sourceUrl: l,
|
|
2186
2186
|
title: e,
|
|
2187
2187
|
mimeType: i,
|
|
2188
|
-
topRight:
|
|
2188
|
+
topRight: y,
|
|
2189
2189
|
isLoading: b.isLoading,
|
|
2190
2190
|
onImageError: b.onImageError
|
|
2191
2191
|
}
|
|
2192
2192
|
),
|
|
2193
2193
|
/* @__PURE__ */ n(
|
|
2194
|
-
|
|
2194
|
+
pt,
|
|
2195
2195
|
{
|
|
2196
2196
|
chinTextColor: b.chinTextColor,
|
|
2197
2197
|
variant: "dark",
|
|
@@ -2210,7 +2210,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2210
2210
|
]
|
|
2211
2211
|
}
|
|
2212
2212
|
);
|
|
2213
|
-
},
|
|
2213
|
+
}, xt = ({
|
|
2214
2214
|
accentHex: e,
|
|
2215
2215
|
side: t,
|
|
2216
2216
|
visible: s,
|
|
@@ -2235,7 +2235,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2235
2235
|
}
|
|
2236
2236
|
)
|
|
2237
2237
|
] })
|
|
2238
|
-
) : /* @__PURE__ */ n(
|
|
2238
|
+
) : /* @__PURE__ */ n(Z, { children: a }), Fr = ({
|
|
2239
2239
|
title: e,
|
|
2240
2240
|
description: t,
|
|
2241
2241
|
descriptionLines: s,
|
|
@@ -2251,13 +2251,13 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2251
2251
|
onClick: g,
|
|
2252
2252
|
groupPosition: c = "single"
|
|
2253
2253
|
}) => {
|
|
2254
|
-
const p =
|
|
2254
|
+
const p = bt(r, o), w = gt(a), v = u == null && w != null && !p ? w : void 0, x = u == null && !p ? g : void 0, b = m !== "loading" && Ae(r, o) ? vt : void 0, y = u && g ? {
|
|
2255
2255
|
...u,
|
|
2256
2256
|
onClick: () => {
|
|
2257
2257
|
var T;
|
|
2258
2258
|
g(), (T = u.onClick) == null || T.call(u);
|
|
2259
2259
|
}
|
|
2260
|
-
} : u, _ =
|
|
2260
|
+
} : u, _ = Ge({
|
|
2261
2261
|
variant: "light",
|
|
2262
2262
|
accentColor: h,
|
|
2263
2263
|
status: m,
|
|
@@ -2267,13 +2267,13 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2267
2267
|
sourceUrl: o
|
|
2268
2268
|
});
|
|
2269
2269
|
return /* @__PURE__ */ n(
|
|
2270
|
-
|
|
2270
|
+
xt,
|
|
2271
2271
|
{
|
|
2272
2272
|
accentHex: _.accentHex,
|
|
2273
2273
|
side: "receiver",
|
|
2274
2274
|
visible: b == null && (c === "single" || c === "end"),
|
|
2275
2275
|
children: /* @__PURE__ */ f(
|
|
2276
|
-
|
|
2276
|
+
Ie,
|
|
2277
2277
|
{
|
|
2278
2278
|
variant: "light",
|
|
2279
2279
|
href: v,
|
|
@@ -2286,7 +2286,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2286
2286
|
"data-testid": "link-attachment",
|
|
2287
2287
|
children: [
|
|
2288
2288
|
l === "featured" && /* @__PURE__ */ n(
|
|
2289
|
-
|
|
2289
|
+
Te,
|
|
2290
2290
|
{
|
|
2291
2291
|
variant: "light",
|
|
2292
2292
|
thumbnailUrl: _.thumbnailUrl,
|
|
@@ -2298,7 +2298,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2298
2298
|
}
|
|
2299
2299
|
),
|
|
2300
2300
|
/* @__PURE__ */ n(
|
|
2301
|
-
|
|
2301
|
+
pt,
|
|
2302
2302
|
{
|
|
2303
2303
|
chinTextColor: _.chinTextColor,
|
|
2304
2304
|
variant: "light",
|
|
@@ -2308,7 +2308,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2308
2308
|
descriptionLines: s,
|
|
2309
2309
|
url: a,
|
|
2310
2310
|
appIcon: d,
|
|
2311
|
-
cta:
|
|
2311
|
+
cta: y,
|
|
2312
2312
|
isLoading: _.isLoading
|
|
2313
2313
|
}
|
|
2314
2314
|
)
|
|
@@ -2334,7 +2334,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2334
2334
|
onClick: c,
|
|
2335
2335
|
groupPosition: p = "single"
|
|
2336
2336
|
}) => {
|
|
2337
|
-
const w =
|
|
2337
|
+
const w = bt(i, l), v = gt(r), x = h == null && v != null && !w ? v : void 0, b = h == null && !w && x != null ? c : void 0, y = g !== "loading" && Ae(i, l), _ = Ge({
|
|
2338
2338
|
variant: "dark",
|
|
2339
2339
|
accentColor: m,
|
|
2340
2340
|
status: g,
|
|
@@ -2344,24 +2344,24 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2344
2344
|
sourceUrl: l
|
|
2345
2345
|
});
|
|
2346
2346
|
return /* @__PURE__ */ n(
|
|
2347
|
-
|
|
2347
|
+
xt,
|
|
2348
2348
|
{
|
|
2349
2349
|
accentHex: _.accentHex,
|
|
2350
2350
|
side: "sender",
|
|
2351
|
-
visible: !
|
|
2351
|
+
visible: !y && (p === "single" || p === "end"),
|
|
2352
2352
|
children: /* @__PURE__ */ f(
|
|
2353
|
-
|
|
2353
|
+
Ie,
|
|
2354
2354
|
{
|
|
2355
2355
|
variant: "dark",
|
|
2356
2356
|
href: x,
|
|
2357
2357
|
onClick: b,
|
|
2358
|
-
fixedHeight: d === "featured" && !
|
|
2358
|
+
fixedHeight: d === "featured" && !y,
|
|
2359
2359
|
accentHex: _.accentHex,
|
|
2360
2360
|
busy: _.isLoading,
|
|
2361
|
-
bgClassName:
|
|
2361
|
+
bgClassName: y ? vt : void 0,
|
|
2362
2362
|
children: [
|
|
2363
2363
|
d === "featured" && /* @__PURE__ */ n(
|
|
2364
|
-
|
|
2364
|
+
Te,
|
|
2365
2365
|
{
|
|
2366
2366
|
variant: "dark",
|
|
2367
2367
|
thumbnailUrl: _.thumbnailUrl,
|
|
@@ -2373,7 +2373,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2373
2373
|
}
|
|
2374
2374
|
),
|
|
2375
2375
|
/* @__PURE__ */ n(
|
|
2376
|
-
|
|
2376
|
+
pt,
|
|
2377
2377
|
{
|
|
2378
2378
|
chinTextColor: _.chinTextColor,
|
|
2379
2379
|
variant: "dark",
|
|
@@ -2393,7 +2393,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2393
2393
|
)
|
|
2394
2394
|
}
|
|
2395
2395
|
);
|
|
2396
|
-
},
|
|
2396
|
+
}, it = {
|
|
2397
2397
|
Composer: zr,
|
|
2398
2398
|
Sent: $r,
|
|
2399
2399
|
Received: Fr
|
|
@@ -2419,7 +2419,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2419
2419
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
2420
2420
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
2421
2421
|
}
|
|
2422
|
-
},
|
|
2422
|
+
}, Re = ({
|
|
2423
2423
|
variant: e,
|
|
2424
2424
|
text: t,
|
|
2425
2425
|
bordered: s = !0,
|
|
@@ -2491,7 +2491,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2491
2491
|
]
|
|
2492
2492
|
}
|
|
2493
2493
|
);
|
|
2494
|
-
},
|
|
2494
|
+
}, Le = ({
|
|
2495
2495
|
onClick: e,
|
|
2496
2496
|
variant: t = "overlay",
|
|
2497
2497
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -2507,9 +2507,9 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2507
2507
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
2508
2508
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
2509
2509
|
),
|
|
2510
|
-
children: /* @__PURE__ */ n(
|
|
2510
|
+
children: /* @__PURE__ */ n(lt, { className: "size-3", weight: "bold" })
|
|
2511
2511
|
}
|
|
2512
|
-
),
|
|
2512
|
+
), Me = (e) => e === "received" ? "light" : "dark", so = ({
|
|
2513
2513
|
firstOfGroup: e,
|
|
2514
2514
|
endOfGroup: t,
|
|
2515
2515
|
groupedByUser: s
|
|
@@ -2530,7 +2530,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2530
2530
|
}
|
|
2531
2531
|
),
|
|
2532
2532
|
s ?? null
|
|
2533
|
-
] }),
|
|
2533
|
+
] }), wt = ({
|
|
2534
2534
|
state: e,
|
|
2535
2535
|
src: t,
|
|
2536
2536
|
mimeType: s,
|
|
@@ -2541,12 +2541,12 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2541
2541
|
preload: l,
|
|
2542
2542
|
onDismiss: d
|
|
2543
2543
|
}) => {
|
|
2544
|
-
const u =
|
|
2544
|
+
const u = Me(e), h = e === "composer" && !!d, m = Gr({ src: t, mimeType: s, filename: a, items: r });
|
|
2545
2545
|
if (m.length === 0)
|
|
2546
2546
|
return null;
|
|
2547
2547
|
const g = l ?? (m.length > 1 ? "none" : "metadata");
|
|
2548
2548
|
return /* @__PURE__ */ n(
|
|
2549
|
-
|
|
2549
|
+
Re,
|
|
2550
2550
|
{
|
|
2551
2551
|
variant: u,
|
|
2552
2552
|
text: i,
|
|
@@ -2560,14 +2560,14 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2560
2560
|
trailingAction: (
|
|
2561
2561
|
// Composer only supports a single attachment, so the
|
|
2562
2562
|
// dismiss control sits on the only player.
|
|
2563
|
-
h && p === 0 ? /* @__PURE__ */ n(
|
|
2563
|
+
h && p === 0 ? /* @__PURE__ */ n(Le, { onClick: d, variant: "inline" }) : void 0
|
|
2564
2564
|
)
|
|
2565
2565
|
},
|
|
2566
2566
|
`${c.src}-${p}`
|
|
2567
2567
|
)) })
|
|
2568
2568
|
}
|
|
2569
2569
|
);
|
|
2570
|
-
}, Wr = (e) => /* @__PURE__ */ n(
|
|
2570
|
+
}, Wr = (e) => /* @__PURE__ */ n(wt, { ...e, state: "composer" }), Xr = (e) => /* @__PURE__ */ n(wt, { ...e, state: "sent" }), qr = (e) => /* @__PURE__ */ n(wt, { ...e, state: "received" }), Kr = {
|
|
2571
2571
|
Composer: Wr,
|
|
2572
2572
|
Sent: Xr,
|
|
2573
2573
|
Received: qr
|
|
@@ -2594,7 +2594,7 @@ function Qr(e, t) {
|
|
|
2594
2594
|
}
|
|
2595
2595
|
}
|
|
2596
2596
|
if (!e) return;
|
|
2597
|
-
if (
|
|
2597
|
+
if (ce(e) === "document") {
|
|
2598
2598
|
const r = yn(e), i = Jr[r];
|
|
2599
2599
|
if (i) return i;
|
|
2600
2600
|
if (e === "application/octet-stream") return;
|
|
@@ -2642,7 +2642,7 @@ const ti = {
|
|
|
2642
2642
|
ni[e]
|
|
2643
2643
|
),
|
|
2644
2644
|
"aria-hidden": !0,
|
|
2645
|
-
children:
|
|
2645
|
+
children: xe(a, {
|
|
2646
2646
|
className: k("size-6", si[e]),
|
|
2647
2647
|
weight: "regular"
|
|
2648
2648
|
})
|
|
@@ -2674,7 +2674,7 @@ const ti = {
|
|
|
2674
2674
|
m
|
|
2675
2675
|
]
|
|
2676
2676
|
}
|
|
2677
|
-
) : /* @__PURE__ */ f(
|
|
2677
|
+
) : /* @__PURE__ */ f(Z, { children: [
|
|
2678
2678
|
h,
|
|
2679
2679
|
m
|
|
2680
2680
|
] });
|
|
@@ -2725,7 +2725,7 @@ const ai = ({
|
|
|
2725
2725
|
trailingAction: r
|
|
2726
2726
|
}
|
|
2727
2727
|
);
|
|
2728
|
-
},
|
|
2728
|
+
}, _t = ({
|
|
2729
2729
|
state: e,
|
|
2730
2730
|
src: t,
|
|
2731
2731
|
filename: s,
|
|
@@ -2738,7 +2738,7 @@ const ai = ({
|
|
|
2738
2738
|
onClick: u,
|
|
2739
2739
|
onDismiss: h
|
|
2740
2740
|
}) => {
|
|
2741
|
-
const m =
|
|
2741
|
+
const m = Me(e), g = e === "composer" && !!h, c = ai({
|
|
2742
2742
|
src: t,
|
|
2743
2743
|
filename: s,
|
|
2744
2744
|
fileSize: a,
|
|
@@ -2762,11 +2762,11 @@ const ai = ({
|
|
|
2762
2762
|
m === "dark" ? "text-white/70" : "text-black/70"
|
|
2763
2763
|
),
|
|
2764
2764
|
"aria-hidden": !0,
|
|
2765
|
-
children: /* @__PURE__ */ n(
|
|
2765
|
+
children: /* @__PURE__ */ n(Ee, { className: "size-5", weight: "bold" })
|
|
2766
2766
|
}
|
|
2767
2767
|
);
|
|
2768
2768
|
return /* @__PURE__ */ n(
|
|
2769
|
-
|
|
2769
|
+
Re,
|
|
2770
2770
|
{
|
|
2771
2771
|
variant: m,
|
|
2772
2772
|
text: l,
|
|
@@ -2779,22 +2779,22 @@ const ai = ({
|
|
|
2779
2779
|
item: v,
|
|
2780
2780
|
index: x,
|
|
2781
2781
|
onActivate: p,
|
|
2782
|
-
trailingAction: g && x === 0 ? /* @__PURE__ */ n(
|
|
2782
|
+
trailingAction: g && x === 0 ? /* @__PURE__ */ n(Le, { onClick: h, variant: "inline" }) : w
|
|
2783
2783
|
},
|
|
2784
2784
|
`${v.src}-${x}`
|
|
2785
2785
|
)) })
|
|
2786
2786
|
}
|
|
2787
2787
|
);
|
|
2788
|
-
}, ii = (e) => /* @__PURE__ */ n(
|
|
2788
|
+
}, ii = (e) => /* @__PURE__ */ n(_t, { ...e, state: "composer" }), li = (e) => /* @__PURE__ */ n(_t, { ...e, state: "sent" }), oi = (e) => /* @__PURE__ */ n(_t, { ...e, state: "received" }), ci = {
|
|
2789
2789
|
Composer: ii,
|
|
2790
2790
|
Sent: li,
|
|
2791
2791
|
Received: oi
|
|
2792
|
-
}, zn = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", en = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none",
|
|
2792
|
+
}, zn = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", en = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", yt = ({
|
|
2793
2793
|
onPrev: e,
|
|
2794
2794
|
onNext: t,
|
|
2795
2795
|
prevLabel: s = "Previous",
|
|
2796
2796
|
nextLabel: a = "Next"
|
|
2797
|
-
}) => /* @__PURE__ */ f(
|
|
2797
|
+
}) => /* @__PURE__ */ f(Z, { children: [
|
|
2798
2798
|
/* @__PURE__ */ n(
|
|
2799
2799
|
"button",
|
|
2800
2800
|
{
|
|
@@ -2824,7 +2824,7 @@ const ai = ({
|
|
|
2824
2824
|
tone: i = "dark",
|
|
2825
2825
|
onTriggered: o
|
|
2826
2826
|
}) => {
|
|
2827
|
-
const [l, d] = B(!1), u =
|
|
2827
|
+
const [l, d] = B(!1), u = K(
|
|
2828
2828
|
(c) => {
|
|
2829
2829
|
c.stopPropagation(), !l && (d(!0), Pn(e, t).catch(() => {
|
|
2830
2830
|
}).finally(() => {
|
|
@@ -2851,14 +2851,14 @@ const ai = ({
|
|
|
2851
2851
|
}[i]
|
|
2852
2852
|
),
|
|
2853
2853
|
children: l ? /* @__PURE__ */ n(
|
|
2854
|
-
|
|
2854
|
+
ve,
|
|
2855
2855
|
{
|
|
2856
2856
|
className: "size-4 animate-spin",
|
|
2857
2857
|
weight: "bold",
|
|
2858
2858
|
"aria-hidden": !0
|
|
2859
2859
|
}
|
|
2860
2860
|
) : /* @__PURE__ */ n(
|
|
2861
|
-
|
|
2861
|
+
Ee,
|
|
2862
2862
|
{
|
|
2863
2863
|
className: "size-5 shrink-0",
|
|
2864
2864
|
weight: "bold",
|
|
@@ -2874,7 +2874,7 @@ const ai = ({
|
|
|
2874
2874
|
disabled: l,
|
|
2875
2875
|
"aria-label": a,
|
|
2876
2876
|
className: zn,
|
|
2877
|
-
children: l ? /* @__PURE__ */ n(
|
|
2877
|
+
children: l ? /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Ee, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
2878
2878
|
}
|
|
2879
2879
|
) : /* @__PURE__ */ f(
|
|
2880
2880
|
"button",
|
|
@@ -2889,34 +2889,34 @@ const ai = ({
|
|
|
2889
2889
|
),
|
|
2890
2890
|
children: [
|
|
2891
2891
|
l ? /* @__PURE__ */ n(
|
|
2892
|
-
|
|
2892
|
+
ve,
|
|
2893
2893
|
{
|
|
2894
2894
|
className: "size-4 animate-spin",
|
|
2895
2895
|
weight: "bold",
|
|
2896
2896
|
"aria-hidden": !0
|
|
2897
2897
|
}
|
|
2898
|
-
) : /* @__PURE__ */ n(
|
|
2898
|
+
) : /* @__PURE__ */ n(Ee, { ...g, "aria-hidden": !0 }),
|
|
2899
2899
|
h ? null : a
|
|
2900
2900
|
]
|
|
2901
2901
|
}
|
|
2902
2902
|
);
|
|
2903
|
-
},
|
|
2903
|
+
}, Qe = (e, t, s) => Math.min(Math.max(e, t), s), Nt = ({
|
|
2904
2904
|
length: e,
|
|
2905
2905
|
initialIndex: t,
|
|
2906
2906
|
open: s
|
|
2907
2907
|
}) => {
|
|
2908
|
-
const a =
|
|
2909
|
-
|
|
2910
|
-
s && i(
|
|
2911
|
-
}, [s, t, e]),
|
|
2912
|
-
i((d) =>
|
|
2908
|
+
const a = Qe(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
|
|
2909
|
+
X(() => {
|
|
2910
|
+
s && i(Qe(t, 0, Math.max(e - 1, 0)));
|
|
2911
|
+
}, [s, t, e]), X(() => {
|
|
2912
|
+
i((d) => Qe(d, 0, Math.max(e - 1, 0)));
|
|
2913
2913
|
}, [e]);
|
|
2914
|
-
const o =
|
|
2914
|
+
const o = K(() => {
|
|
2915
2915
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
2916
|
-
}, [e]), l =
|
|
2916
|
+
}, [e]), l = K(() => {
|
|
2917
2917
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
2918
2918
|
}, [e]);
|
|
2919
|
-
return
|
|
2919
|
+
return X(() => {
|
|
2920
2920
|
if (!s || e <= 1) return;
|
|
2921
2921
|
const d = (u) => {
|
|
2922
2922
|
if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
|
|
@@ -2925,7 +2925,7 @@ const ai = ({
|
|
|
2925
2925
|
};
|
|
2926
2926
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
2927
2927
|
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
2928
|
-
},
|
|
2928
|
+
}, kt = ({
|
|
2929
2929
|
open: e,
|
|
2930
2930
|
onClose: t,
|
|
2931
2931
|
ariaLabel: s,
|
|
@@ -2934,8 +2934,8 @@ const ai = ({
|
|
|
2934
2934
|
children: i,
|
|
2935
2935
|
"data-testid": o
|
|
2936
2936
|
}) => {
|
|
2937
|
-
const l =
|
|
2938
|
-
return
|
|
2937
|
+
const l = V(null), d = V(null);
|
|
2938
|
+
return X(() => {
|
|
2939
2939
|
var g;
|
|
2940
2940
|
const m = l.current;
|
|
2941
2941
|
if (m) {
|
|
@@ -3006,7 +3006,7 @@ const ai = ({
|
|
|
3006
3006
|
onClick: t,
|
|
3007
3007
|
"aria-label": "Close viewer",
|
|
3008
3008
|
className: zn,
|
|
3009
|
-
children: /* @__PURE__ */ n(
|
|
3009
|
+
children: /* @__PURE__ */ n(lt, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3010
3010
|
}
|
|
3011
3011
|
)
|
|
3012
3012
|
] })
|
|
@@ -3021,16 +3021,16 @@ const ai = ({
|
|
|
3021
3021
|
initialIndex: s = 0,
|
|
3022
3022
|
onClose: a
|
|
3023
3023
|
}) => {
|
|
3024
|
-
const { index: r, prev: i, next: o } =
|
|
3024
|
+
const { index: r, prev: i, next: o } = Nt({
|
|
3025
3025
|
length: t.length,
|
|
3026
3026
|
initialIndex: s,
|
|
3027
3027
|
open: e
|
|
3028
|
-
}), l = t[r], d =
|
|
3028
|
+
}), l = t[r], d = ie(
|
|
3029
3029
|
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "image"),
|
|
3030
3030
|
[l]
|
|
3031
3031
|
);
|
|
3032
3032
|
return l ? /* @__PURE__ */ f(
|
|
3033
|
-
|
|
3033
|
+
kt,
|
|
3034
3034
|
{
|
|
3035
3035
|
open: e,
|
|
3036
3036
|
onClose: a,
|
|
@@ -3059,7 +3059,7 @@ const ai = ({
|
|
|
3059
3059
|
`${r}:${l.src}`
|
|
3060
3060
|
) : null,
|
|
3061
3061
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3062
|
-
|
|
3062
|
+
yt,
|
|
3063
3063
|
{
|
|
3064
3064
|
onPrev: i,
|
|
3065
3065
|
onNext: o,
|
|
@@ -3181,13 +3181,13 @@ const ai = ({
|
|
|
3181
3181
|
})
|
|
3182
3182
|
}
|
|
3183
3183
|
);
|
|
3184
|
-
},
|
|
3185
|
-
const [t, s] = B(!1), [a, r] = B(0), i =
|
|
3184
|
+
}, De = (e) => {
|
|
3185
|
+
const [t, s] = B(!1), [a, r] = B(0), i = K(
|
|
3186
3186
|
(l) => {
|
|
3187
3187
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3188
3188
|
},
|
|
3189
3189
|
[e]
|
|
3190
|
-
), o =
|
|
3190
|
+
), o = K(() => s(!1), []);
|
|
3191
3191
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
3192
3192
|
}, gi = ({
|
|
3193
3193
|
item: e,
|
|
@@ -3205,7 +3205,7 @@ const ai = ({
|
|
|
3205
3205
|
"img",
|
|
3206
3206
|
{
|
|
3207
3207
|
ref: r,
|
|
3208
|
-
src:
|
|
3208
|
+
src: oe(e.src) ?? e.src,
|
|
3209
3209
|
alt: e.alt ?? "",
|
|
3210
3210
|
width: e.width,
|
|
3211
3211
|
height: e.height,
|
|
@@ -3226,7 +3226,7 @@ const ai = ({
|
|
|
3226
3226
|
alt: s.alt,
|
|
3227
3227
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3228
3228
|
})), bi = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
3229
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } =
|
|
3229
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = De(r);
|
|
3230
3230
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
3231
3231
|
/* @__PURE__ */ n(
|
|
3232
3232
|
"button",
|
|
@@ -3238,7 +3238,7 @@ const ai = ({
|
|
|
3238
3238
|
children: /* @__PURE__ */ n(
|
|
3239
3239
|
"img",
|
|
3240
3240
|
{
|
|
3241
|
-
src:
|
|
3241
|
+
src: oe(e) ?? e,
|
|
3242
3242
|
alt: t ?? "",
|
|
3243
3243
|
draggable: !1,
|
|
3244
3244
|
loading: a,
|
|
@@ -3248,7 +3248,7 @@ const ai = ({
|
|
|
3248
3248
|
)
|
|
3249
3249
|
}
|
|
3250
3250
|
),
|
|
3251
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
3251
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Le, { onClick: i }) }) : null,
|
|
3252
3252
|
/* @__PURE__ */ n(
|
|
3253
3253
|
$n,
|
|
3254
3254
|
{
|
|
@@ -3289,13 +3289,13 @@ const ai = ({
|
|
|
3289
3289
|
loading: l = "lazy",
|
|
3290
3290
|
onClick: d
|
|
3291
3291
|
}) => {
|
|
3292
|
-
const u = pi({ src: t, alt: s, items: r }), h =
|
|
3292
|
+
const u = pi({ src: t, alt: s, items: r }), h = Me(e), { viewerOpen: m, viewerIndex: g, handleActivate: c, closeViewer: p } = De(d), w = u.length === 1, v = xi(w ? u[0] : void 0);
|
|
3293
3293
|
if (u.length === 0)
|
|
3294
3294
|
return null;
|
|
3295
3295
|
const x = u.map(
|
|
3296
|
-
(b,
|
|
3296
|
+
(b, y) => gi({
|
|
3297
3297
|
item: b,
|
|
3298
|
-
index:
|
|
3298
|
+
index: y,
|
|
3299
3299
|
totalCount: u.length,
|
|
3300
3300
|
fallbackLoading: l,
|
|
3301
3301
|
imgRef: w ? v.imgRef : void 0,
|
|
@@ -3303,7 +3303,7 @@ const ai = ({
|
|
|
3303
3303
|
})
|
|
3304
3304
|
);
|
|
3305
3305
|
return /* @__PURE__ */ f(
|
|
3306
|
-
|
|
3306
|
+
Re,
|
|
3307
3307
|
{
|
|
3308
3308
|
variant: h,
|
|
3309
3309
|
text: i,
|
|
@@ -3344,19 +3344,19 @@ const ai = ({
|
|
|
3344
3344
|
initialIndex: s = 0,
|
|
3345
3345
|
onClose: a
|
|
3346
3346
|
}) => {
|
|
3347
|
-
const { index: r, prev: i, next: o } =
|
|
3347
|
+
const { index: r, prev: i, next: o } = Nt({
|
|
3348
3348
|
length: t.length,
|
|
3349
3349
|
initialIndex: s,
|
|
3350
3350
|
open: e
|
|
3351
|
-
}), l = t[r], d =
|
|
3351
|
+
}), l = t[r], d = ie(
|
|
3352
3352
|
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "document"),
|
|
3353
3353
|
[l]
|
|
3354
|
-
), u =
|
|
3354
|
+
), u = ie(
|
|
3355
3355
|
() => l ? Ci(l.src) : void 0,
|
|
3356
3356
|
[l]
|
|
3357
3357
|
);
|
|
3358
3358
|
return !l || !u ? null : /* @__PURE__ */ f(
|
|
3359
|
-
|
|
3359
|
+
kt,
|
|
3360
3360
|
{
|
|
3361
3361
|
open: e,
|
|
3362
3362
|
onClose: a,
|
|
@@ -3375,7 +3375,7 @@ const ai = ({
|
|
|
3375
3375
|
`${r}:${l.src}`
|
|
3376
3376
|
),
|
|
3377
3377
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3378
|
-
|
|
3378
|
+
yt,
|
|
3379
3379
|
{
|
|
3380
3380
|
onPrev: i,
|
|
3381
3381
|
onNext: o,
|
|
@@ -3416,7 +3416,7 @@ const ai = ({
|
|
|
3416
3416
|
trailingAction: r
|
|
3417
3417
|
}
|
|
3418
3418
|
);
|
|
3419
|
-
},
|
|
3419
|
+
}, Ct = ({
|
|
3420
3420
|
state: e,
|
|
3421
3421
|
src: t,
|
|
3422
3422
|
filename: s,
|
|
@@ -3428,7 +3428,7 @@ const ai = ({
|
|
|
3428
3428
|
onClick: d,
|
|
3429
3429
|
onDismiss: u
|
|
3430
3430
|
}) => {
|
|
3431
|
-
const h =
|
|
3431
|
+
const h = Me(e), m = Si({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = De(d), v = e === "composer" && !!u;
|
|
3432
3432
|
if (m.length === 0)
|
|
3433
3433
|
return null;
|
|
3434
3434
|
const x = m.map((b) => ({
|
|
@@ -3436,15 +3436,15 @@ const ai = ({
|
|
|
3436
3436
|
filename: b.filename ?? ae(b.src)
|
|
3437
3437
|
}));
|
|
3438
3438
|
return /* @__PURE__ */ f(
|
|
3439
|
-
|
|
3439
|
+
Re,
|
|
3440
3440
|
{
|
|
3441
3441
|
variant: h,
|
|
3442
3442
|
text: o,
|
|
3443
3443
|
groupPosition: l,
|
|
3444
3444
|
"data-testid": "pdf-attachment",
|
|
3445
3445
|
children: [
|
|
3446
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b,
|
|
3447
|
-
const _ = b.filename ?? ae(b.src), T = v &&
|
|
3446
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b, y) => {
|
|
3447
|
+
const _ = b.filename ?? ae(b.src), T = v && y === 0 ? /* @__PURE__ */ n(Le, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
3448
3448
|
Fn,
|
|
3449
3449
|
{
|
|
3450
3450
|
url: b.src,
|
|
@@ -3459,11 +3459,11 @@ const ai = ({
|
|
|
3459
3459
|
{
|
|
3460
3460
|
variant: h,
|
|
3461
3461
|
item: b,
|
|
3462
|
-
index:
|
|
3462
|
+
index: y,
|
|
3463
3463
|
onActivate: p,
|
|
3464
3464
|
trailingAction: T
|
|
3465
3465
|
},
|
|
3466
|
-
`${b.src}-${
|
|
3466
|
+
`${b.src}-${y}`
|
|
3467
3467
|
);
|
|
3468
3468
|
}) }),
|
|
3469
3469
|
/* @__PURE__ */ n(
|
|
@@ -3478,7 +3478,7 @@ const ai = ({
|
|
|
3478
3478
|
]
|
|
3479
3479
|
}
|
|
3480
3480
|
);
|
|
3481
|
-
}, Ii = (e) => /* @__PURE__ */ n(
|
|
3481
|
+
}, Ii = (e) => /* @__PURE__ */ n(Ct, { ...e, state: "composer" }), Ti = (e) => /* @__PURE__ */ n(Ct, { ...e, state: "sent" }), Ai = (e) => /* @__PURE__ */ n(Ct, { ...e, state: "received" }), Ri = {
|
|
3482
3482
|
Composer: Ii,
|
|
3483
3483
|
Sent: Ti,
|
|
3484
3484
|
Received: Ai
|
|
@@ -3488,16 +3488,16 @@ const ai = ({
|
|
|
3488
3488
|
initialIndex: s = 0,
|
|
3489
3489
|
onClose: a
|
|
3490
3490
|
}) => {
|
|
3491
|
-
const { index: r, prev: i, next: o } =
|
|
3491
|
+
const { index: r, prev: i, next: o } = Nt({
|
|
3492
3492
|
length: t.length,
|
|
3493
3493
|
initialIndex: s,
|
|
3494
3494
|
open: e
|
|
3495
|
-
}), l = t[r], d =
|
|
3495
|
+
}), l = t[r], d = ie(
|
|
3496
3496
|
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "video"),
|
|
3497
3497
|
[l]
|
|
3498
3498
|
);
|
|
3499
3499
|
return l ? /* @__PURE__ */ f(
|
|
3500
|
-
|
|
3500
|
+
kt,
|
|
3501
3501
|
{
|
|
3502
3502
|
open: e,
|
|
3503
3503
|
onClose: a,
|
|
@@ -3521,7 +3521,7 @@ const ai = ({
|
|
|
3521
3521
|
`${r}:${l.src}`
|
|
3522
3522
|
),
|
|
3523
3523
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3524
|
-
|
|
3524
|
+
yt,
|
|
3525
3525
|
{
|
|
3526
3526
|
onPrev: i,
|
|
3527
3527
|
onNext: o,
|
|
@@ -3532,7 +3532,7 @@ const ai = ({
|
|
|
3532
3532
|
]
|
|
3533
3533
|
}
|
|
3534
3534
|
) : null;
|
|
3535
|
-
}, Li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(
|
|
3535
|
+
}, Li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(rt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Vn = ({
|
|
3536
3536
|
item: e,
|
|
3537
3537
|
index: t
|
|
3538
3538
|
}) => /* @__PURE__ */ f("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -3571,7 +3571,7 @@ const ai = ({
|
|
|
3571
3571
|
preload: s.preload,
|
|
3572
3572
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3573
3573
|
})), Oi = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
3574
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } =
|
|
3574
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } = De(i);
|
|
3575
3575
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
3576
3576
|
/* @__PURE__ */ n(
|
|
3577
3577
|
"button",
|
|
@@ -3583,7 +3583,7 @@ const ai = ({
|
|
|
3583
3583
|
children: /* @__PURE__ */ n(Vn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
3584
3584
|
}
|
|
3585
3585
|
),
|
|
3586
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
3586
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Le, { onClick: o }) }) : null,
|
|
3587
3587
|
/* @__PURE__ */ n(
|
|
3588
3588
|
Hn,
|
|
3589
3589
|
{
|
|
@@ -3606,14 +3606,14 @@ const ai = ({
|
|
|
3606
3606
|
preload: d,
|
|
3607
3607
|
onClick: u
|
|
3608
3608
|
}) => {
|
|
3609
|
-
const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m =
|
|
3609
|
+
const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Me(e), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = De(u);
|
|
3610
3610
|
if (h.length === 0)
|
|
3611
3611
|
return null;
|
|
3612
3612
|
const v = h.map(
|
|
3613
3613
|
(x, b) => Mi(x, b, h.length)
|
|
3614
3614
|
);
|
|
3615
3615
|
return /* @__PURE__ */ f(
|
|
3616
|
-
|
|
3616
|
+
Re,
|
|
3617
3617
|
{
|
|
3618
3618
|
variant: m,
|
|
3619
3619
|
text: o,
|
|
@@ -3637,7 +3637,7 @@ const ai = ({
|
|
|
3637
3637
|
Composer: Pi,
|
|
3638
3638
|
Sent: zi,
|
|
3639
3639
|
Received: Fi
|
|
3640
|
-
},
|
|
3640
|
+
}, Ce = {
|
|
3641
3641
|
Image: Ni,
|
|
3642
3642
|
Video: $i,
|
|
3643
3643
|
Audio: Kr,
|
|
@@ -3668,11 +3668,11 @@ function nn(e) {
|
|
|
3668
3668
|
title: O(e.title),
|
|
3669
3669
|
description: O(e.text),
|
|
3670
3670
|
url: t,
|
|
3671
|
-
thumbnailUrl:
|
|
3671
|
+
thumbnailUrl: oe(s),
|
|
3672
3672
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3673
3673
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3674
3674
|
sourceUrl: a,
|
|
3675
|
-
layout: s ||
|
|
3675
|
+
layout: s || bt(r, a) ? "featured" : "classic",
|
|
3676
3676
|
mimeType: r,
|
|
3677
3677
|
// Dominant colour of the image, resolved by the sender at stage time and
|
|
3678
3678
|
// persisted on the attachment (`stream-custom-data.ts`), so every viewer
|
|
@@ -3731,15 +3731,15 @@ function sn(e) {
|
|
|
3731
3731
|
function Vi(e) {
|
|
3732
3732
|
switch (e) {
|
|
3733
3733
|
case "image":
|
|
3734
|
-
return
|
|
3734
|
+
return Ce.Image;
|
|
3735
3735
|
case "video":
|
|
3736
|
-
return
|
|
3736
|
+
return Ce.Video;
|
|
3737
3737
|
case "audio":
|
|
3738
|
-
return
|
|
3738
|
+
return Ce.Audio;
|
|
3739
3739
|
case "pdf":
|
|
3740
|
-
return
|
|
3740
|
+
return Ce.Pdf;
|
|
3741
3741
|
default:
|
|
3742
|
-
return
|
|
3742
|
+
return Ce.File;
|
|
3743
3743
|
}
|
|
3744
3744
|
}
|
|
3745
3745
|
function Gi(e, t) {
|
|
@@ -3847,20 +3847,20 @@ const Wi = ({
|
|
|
3847
3847
|
if (r.length === 0) return null;
|
|
3848
3848
|
const i = ji(r), o = (v = s.text) == null ? void 0 : v.trim(), l = r.find((x) => x.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? nn(l.attachments[0] ?? {}).url : void 0, u = o && Bi(o, d) ? void 0 : o;
|
|
3849
3849
|
let h = 0;
|
|
3850
|
-
const m = [], g = u ? "middle" : e, c = e === "single" || e === "end", p = (x, b,
|
|
3851
|
-
const _ = t ?
|
|
3850
|
+
const m = [], g = u ? "middle" : e, c = e === "single" || e === "end", p = (x, b, y) => {
|
|
3851
|
+
const _ = t ? it.Sent : it.Received;
|
|
3852
3852
|
m.push(
|
|
3853
3853
|
/* @__PURE__ */ n(
|
|
3854
3854
|
_,
|
|
3855
3855
|
{
|
|
3856
3856
|
...nn(x),
|
|
3857
|
-
groupPosition:
|
|
3857
|
+
groupPosition: y ? g : "middle"
|
|
3858
3858
|
},
|
|
3859
3859
|
b
|
|
3860
3860
|
)
|
|
3861
3861
|
);
|
|
3862
3862
|
}, w = (x, b) => {
|
|
3863
|
-
const
|
|
3863
|
+
const y = Hi(
|
|
3864
3864
|
h,
|
|
3865
3865
|
i,
|
|
3866
3866
|
e
|
|
@@ -3869,7 +3869,7 @@ const Wi = ({
|
|
|
3869
3869
|
/* @__PURE__ */ n(
|
|
3870
3870
|
Yi,
|
|
3871
3871
|
{
|
|
3872
|
-
groupPosition:
|
|
3872
|
+
groupPosition: y,
|
|
3873
3873
|
isMyMessage: t,
|
|
3874
3874
|
segment: x
|
|
3875
3875
|
},
|
|
@@ -3878,13 +3878,13 @@ const Wi = ({
|
|
|
3878
3878
|
);
|
|
3879
3879
|
};
|
|
3880
3880
|
return r.forEach((x, b) => {
|
|
3881
|
-
const
|
|
3881
|
+
const y = b === r.length - 1;
|
|
3882
3882
|
if (x.type === "link") {
|
|
3883
3883
|
x.attachments.forEach((_, T) => {
|
|
3884
3884
|
p(
|
|
3885
3885
|
_,
|
|
3886
3886
|
`link-${b}-${T}`,
|
|
3887
|
-
|
|
3887
|
+
y && T === x.attachments.length - 1
|
|
3888
3888
|
);
|
|
3889
3889
|
});
|
|
3890
3890
|
return;
|
|
@@ -3904,7 +3904,7 @@ const Wi = ({
|
|
|
3904
3904
|
},
|
|
3905
3905
|
children: [
|
|
3906
3906
|
m,
|
|
3907
|
-
!u && /* @__PURE__ */ n(
|
|
3907
|
+
!u && /* @__PURE__ */ n(st, {})
|
|
3908
3908
|
]
|
|
3909
3909
|
}
|
|
3910
3910
|
),
|
|
@@ -3915,9 +3915,9 @@ const Wi = ({
|
|
|
3915
3915
|
"relative isolate": c
|
|
3916
3916
|
}),
|
|
3917
3917
|
children: [
|
|
3918
|
-
/* @__PURE__ */ n(
|
|
3919
|
-
/* @__PURE__ */ n(
|
|
3920
|
-
c && /* @__PURE__ */ n(
|
|
3918
|
+
/* @__PURE__ */ n(Fe, { message: s, renderText: a }),
|
|
3919
|
+
/* @__PURE__ */ n(st, {}),
|
|
3920
|
+
c && /* @__PURE__ */ n(Be, { side: t ? "me" : "other" })
|
|
3921
3921
|
]
|
|
3922
3922
|
}
|
|
3923
3923
|
) : null
|
|
@@ -3943,67 +3943,67 @@ const Wi = ({
|
|
|
3943
3943
|
viewerLanguage: v,
|
|
3944
3944
|
onOutboundClick: x,
|
|
3945
3945
|
resolvedOutbound: b
|
|
3946
|
-
} = e, { client:
|
|
3947
|
-
Attachment:
|
|
3948
|
-
EditMessageModal:
|
|
3946
|
+
} = e, { client: y } = Ve("CustomMessage"), { channel: _ } = _e("CustomMessage"), { isUnlocking: T, onUnlockClick: R, onFetchSource: L, onDownloadClick: $ } = sr("LockedAttachment"), [F, M] = B(!1), E = ms(c.id), {
|
|
3947
|
+
Attachment: D = hs,
|
|
3948
|
+
EditMessageModal: I = fs,
|
|
3949
3949
|
MessageActions: C,
|
|
3950
|
-
MessageBlocked:
|
|
3950
|
+
MessageBlocked: S = gs,
|
|
3951
3951
|
MessageBouncePrompt: P = ps,
|
|
3952
3952
|
MessageDeleted: U = bs,
|
|
3953
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
3954
|
-
MessageRepliesCountButton:
|
|
3955
|
-
ReminderNotification:
|
|
3956
|
-
StreamedMessageText:
|
|
3957
|
-
PinIndicator:
|
|
3958
|
-
} = dn("CustomMessage"),
|
|
3953
|
+
MessageIsThreadReplyInChannelButtonIndicator: j = vs,
|
|
3954
|
+
MessageRepliesCountButton: ee = xs,
|
|
3955
|
+
ReminderNotification: J = ws,
|
|
3956
|
+
StreamedMessageText: G = _s,
|
|
3957
|
+
PinIndicator: N
|
|
3958
|
+
} = dn("CustomMessage"), A = ys(c), Y = Ns(c), q = ie(
|
|
3959
3959
|
() => m == null ? void 0 : m(c),
|
|
3960
3960
|
[m, c]
|
|
3961
|
-
),
|
|
3962
|
-
const
|
|
3963
|
-
if (
|
|
3964
|
-
const Ut =
|
|
3965
|
-
return Ut.length ===
|
|
3966
|
-
}, [c]),
|
|
3967
|
-
() => Xn(
|
|
3968
|
-
[
|
|
3969
|
-
),
|
|
3970
|
-
const
|
|
3971
|
-
return
|
|
3972
|
-
}, [c, v]),
|
|
3973
|
-
(
|
|
3961
|
+
), H = ie(() => {
|
|
3962
|
+
const he = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...he] : he;
|
|
3963
|
+
if (!$e(c)) return be;
|
|
3964
|
+
const Ut = be.filter((jt) => !("type" in jt) || !Sn(jt));
|
|
3965
|
+
return Ut.length === be.length ? be : Ut;
|
|
3966
|
+
}, [c]), te = ie(
|
|
3967
|
+
() => Xn(H),
|
|
3968
|
+
[H]
|
|
3969
|
+
), W = ie(() => {
|
|
3970
|
+
const he = _n({ message: c, viewerLanguage: v });
|
|
3971
|
+
return he === c.text ? c : { ...c, text: he };
|
|
3972
|
+
}, [c, v]), ne = te.length > 0, de = te.reduce(
|
|
3973
|
+
(he, be) => he + be.attachments.length,
|
|
3974
3974
|
0
|
|
3975
|
-
) === ((
|
|
3975
|
+
) === ((H == null ? void 0 : H.length) ?? 0), ge = (i == null ? void 0 : i[0]) ?? "", Oe = ge === "top" ? "first" : ge === "middle" ? "middle" : ge === "bottom" ? "end" : "single", ue = ge === "single" || ge === "bottom";
|
|
3976
3976
|
if (ks(c))
|
|
3977
3977
|
return null;
|
|
3978
3978
|
if (c.deleted_at || c.type === "deleted")
|
|
3979
3979
|
return /* @__PURE__ */ n(U, { message: c });
|
|
3980
3980
|
if (Cs(c))
|
|
3981
|
-
return /* @__PURE__ */ n(
|
|
3982
|
-
const
|
|
3983
|
-
let
|
|
3984
|
-
|
|
3985
|
-
const
|
|
3981
|
+
return /* @__PURE__ */ n(S, {});
|
|
3982
|
+
const se = !w && !!c.reply_count, me = !w && c.show_in_channel && c.parent_id, re = c.status === "failed" && ((Rt = c.error) == null ? void 0 : Rt.status) !== 403, St = Ss(c);
|
|
3983
|
+
let pe;
|
|
3984
|
+
re ? pe = () => u(c) : St && (pe = () => M(!0));
|
|
3985
|
+
const Q = g(), ts = k(
|
|
3986
3986
|
"str-chat__message str-chat__message-simple",
|
|
3987
3987
|
`str-chat__message--${c.type}`,
|
|
3988
3988
|
`str-chat__message--${c.status}`,
|
|
3989
|
-
|
|
3989
|
+
Q ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
3990
3990
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
3991
3991
|
{
|
|
3992
|
-
"str-chat__message--has-attachment":
|
|
3992
|
+
"str-chat__message--has-attachment": A,
|
|
3993
3993
|
"str-chat__message--highlighted": h,
|
|
3994
3994
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3995
|
-
"str-chat__message--with-reactions":
|
|
3995
|
+
"str-chat__message--with-reactions": Y,
|
|
3996
3996
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Lt = c == null ? void 0 : c.error) == null ? void 0 : Lt.status) !== 403,
|
|
3997
|
-
"str-chat__message-with-thread-link":
|
|
3997
|
+
"str-chat__message-with-thread-link": se || me,
|
|
3998
3998
|
"str-chat__virtual-message__wrapper--end": a,
|
|
3999
3999
|
"str-chat__virtual-message__wrapper--first": r,
|
|
4000
4000
|
"str-chat__virtual-message__wrapper--group": o
|
|
4001
4001
|
}
|
|
4002
|
-
),
|
|
4002
|
+
), Ye = c.poll_id && y.polls.fromState(c.poll_id), Et = ur(c), Ne = $e(c), ns = ht(c), We = !!(H != null && H.length && !c.quoted_message), It = Ne && Q && We, ss = ne && de && !c.quoted_message && !Ye && !q && !Ne, Tt = {
|
|
4003
4003
|
contentType: "text",
|
|
4004
4004
|
amountText: (Mt = c.metadata) == null ? void 0 : Mt.amount_text,
|
|
4005
4005
|
paymentStatus: (Dt = c.metadata) == null ? void 0 : Dt.payment_status,
|
|
4006
|
-
renderedText: c.text && /* @__PURE__ */ n(
|
|
4006
|
+
renderedText: c.text && /* @__PURE__ */ n(Fe, { message: W, renderText: p })
|
|
4007
4007
|
}, At = {
|
|
4008
4008
|
contentType: "media",
|
|
4009
4009
|
title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
|
|
@@ -4012,11 +4012,11 @@ const Wi = ({
|
|
|
4012
4012
|
amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
|
|
4013
4013
|
detail: ($t = c.metadata) == null ? void 0 : $t.attachment_detail,
|
|
4014
4014
|
paymentStatus: (Bt = c.metadata) == null ? void 0 : Bt.payment_status,
|
|
4015
|
-
onFetchSource:
|
|
4015
|
+
onFetchSource: L ? () => L(c, _) : void 0
|
|
4016
4016
|
};
|
|
4017
|
-
return /* @__PURE__ */ f(
|
|
4017
|
+
return /* @__PURE__ */ f(Z, { children: [
|
|
4018
4018
|
s && /* @__PURE__ */ n(
|
|
4019
|
-
|
|
4019
|
+
I,
|
|
4020
4020
|
{
|
|
4021
4021
|
additionalMessageInputProps: t
|
|
4022
4022
|
}
|
|
@@ -4025,7 +4025,7 @@ const Wi = ({
|
|
|
4025
4025
|
Es,
|
|
4026
4026
|
{
|
|
4027
4027
|
MessageBouncePrompt: P,
|
|
4028
|
-
onClose: () =>
|
|
4028
|
+
onClose: () => M(!1),
|
|
4029
4029
|
open: F
|
|
4030
4030
|
}
|
|
4031
4031
|
),
|
|
@@ -4036,10 +4036,10 @@ const Wi = ({
|
|
|
4036
4036
|
"data-message-id": c.id,
|
|
4037
4037
|
"data-dd-privacy": "mask",
|
|
4038
4038
|
children: [
|
|
4039
|
-
|
|
4040
|
-
!!
|
|
4039
|
+
N && /* @__PURE__ */ n(N, {}),
|
|
4040
|
+
!!E && /* @__PURE__ */ n(J, { reminder: E }),
|
|
4041
4041
|
c.user && /* @__PURE__ */ n(
|
|
4042
|
-
|
|
4042
|
+
ye,
|
|
4043
4043
|
{
|
|
4044
4044
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4045
4045
|
id: c.user.id,
|
|
@@ -4047,86 +4047,86 @@ const Wi = ({
|
|
|
4047
4047
|
name: c.user.name || c.user.id,
|
|
4048
4048
|
size: 24,
|
|
4049
4049
|
shape: "circle",
|
|
4050
|
-
dmAgentEnabled:
|
|
4050
|
+
dmAgentEnabled: Ne
|
|
4051
4051
|
}
|
|
4052
4052
|
),
|
|
4053
4053
|
/* @__PURE__ */ n(
|
|
4054
4054
|
"div",
|
|
4055
4055
|
{
|
|
4056
4056
|
className: k("str-chat__message-inner", {
|
|
4057
|
-
"str-chat__simple-message--error-failed":
|
|
4057
|
+
"str-chat__simple-message--error-failed": re || St
|
|
4058
4058
|
}),
|
|
4059
4059
|
"data-testid": "message-inner",
|
|
4060
|
-
onClick:
|
|
4061
|
-
onKeyDown:
|
|
4062
|
-
role:
|
|
4063
|
-
tabIndex:
|
|
4060
|
+
onClick: pe,
|
|
4061
|
+
onKeyDown: pe,
|
|
4062
|
+
role: pe ? "button" : void 0,
|
|
4063
|
+
tabIndex: pe ? 0 : void 0,
|
|
4064
4064
|
style: {
|
|
4065
4065
|
// Force margins to 0 to prevent hover layout shift
|
|
4066
4066
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
4067
4067
|
marginInlineEnd: 0,
|
|
4068
4068
|
marginInlineStart: 0
|
|
4069
4069
|
},
|
|
4070
|
-
children: Et ? /* @__PURE__ */ n(
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4070
|
+
children: Et ? /* @__PURE__ */ n(Ze, { message: c, standalone: !0 }) : cr(c) ? /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
4071
|
+
Q && C && /* @__PURE__ */ n(C, {}),
|
|
4072
|
+
Q ? /* @__PURE__ */ n(ze, { ...Tt, isMine: !0 }) : /* @__PURE__ */ n(
|
|
4073
|
+
ze,
|
|
4074
4074
|
{
|
|
4075
4075
|
...Tt,
|
|
4076
4076
|
isMine: !1,
|
|
4077
4077
|
isUnlocking: T(c.id),
|
|
4078
|
-
onUnlockClick: () =>
|
|
4078
|
+
onUnlockClick: () => R == null ? void 0 : R(c, _)
|
|
4079
4079
|
}
|
|
4080
4080
|
),
|
|
4081
|
-
!
|
|
4081
|
+
!Q && C && /* @__PURE__ */ n(C, {})
|
|
4082
4082
|
] }) }) : dr(c) ? /* @__PURE__ */ f("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
4083
4083
|
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4084
|
+
Q && C && /* @__PURE__ */ n(C, {}),
|
|
4085
|
+
Q ? /* @__PURE__ */ n(
|
|
4086
|
+
ze,
|
|
4087
4087
|
{
|
|
4088
4088
|
...At,
|
|
4089
4089
|
isMine: !0,
|
|
4090
|
-
onPreviewClick: () =>
|
|
4090
|
+
onPreviewClick: () => R ? R(c, _) : void 0
|
|
4091
4091
|
}
|
|
4092
4092
|
) : /* @__PURE__ */ n(
|
|
4093
|
-
|
|
4093
|
+
ze,
|
|
4094
4094
|
{
|
|
4095
4095
|
...At,
|
|
4096
4096
|
isMine: !1,
|
|
4097
4097
|
isUnlocking: T(c.id),
|
|
4098
|
-
onUnlockClick: () =>
|
|
4098
|
+
onUnlockClick: () => R ? R(c, _) : void 0,
|
|
4099
4099
|
onDownloadClick: () => $ ? $(c, _) : void 0
|
|
4100
4100
|
}
|
|
4101
4101
|
),
|
|
4102
|
-
!
|
|
4102
|
+
!Q && C && /* @__PURE__ */ n(C, {})
|
|
4103
4103
|
] }),
|
|
4104
4104
|
c.text && /* @__PURE__ */ f(
|
|
4105
4105
|
"div",
|
|
4106
4106
|
{
|
|
4107
4107
|
className: k("str-chat__message-bubble", {
|
|
4108
|
-
"relative isolate":
|
|
4108
|
+
"relative isolate": ue
|
|
4109
4109
|
}),
|
|
4110
4110
|
children: [
|
|
4111
4111
|
/* @__PURE__ */ n(
|
|
4112
|
-
|
|
4112
|
+
Fe,
|
|
4113
4113
|
{
|
|
4114
|
-
message:
|
|
4114
|
+
message: W,
|
|
4115
4115
|
renderText: p
|
|
4116
4116
|
}
|
|
4117
4117
|
),
|
|
4118
|
-
|
|
4118
|
+
ue && /* @__PURE__ */ n(Be, { side: Q ? "me" : "other" })
|
|
4119
4119
|
]
|
|
4120
4120
|
}
|
|
4121
4121
|
)
|
|
4122
4122
|
] }) : ss ? /* @__PURE__ */ n(
|
|
4123
4123
|
Wi,
|
|
4124
4124
|
{
|
|
4125
|
-
groupPosition:
|
|
4126
|
-
isMyMessage:
|
|
4125
|
+
groupPosition: Oe,
|
|
4126
|
+
isMyMessage: Q,
|
|
4127
4127
|
message: {
|
|
4128
|
-
...
|
|
4129
|
-
attachments:
|
|
4128
|
+
...W,
|
|
4129
|
+
attachments: H,
|
|
4130
4130
|
// MessageText prefers message.i18n[userLanguage_text] from
|
|
4131
4131
|
// Stream's TranslationContext over message.text. Drop i18n so
|
|
4132
4132
|
// the caption uses displayMessage.text from viewerLanguage.
|
|
@@ -4138,51 +4138,51 @@ const Wi = ({
|
|
|
4138
4138
|
"div",
|
|
4139
4139
|
{
|
|
4140
4140
|
className: k("str-chat__message-bubble", {
|
|
4141
|
-
"relative isolate":
|
|
4141
|
+
"relative isolate": ue
|
|
4142
4142
|
}),
|
|
4143
4143
|
children: [
|
|
4144
|
-
|
|
4145
|
-
|
|
4144
|
+
Ne && !It && /* @__PURE__ */ n(
|
|
4145
|
+
Ze,
|
|
4146
4146
|
{
|
|
4147
4147
|
message: c,
|
|
4148
|
-
hasAttachment:
|
|
4149
|
-
isMyMessage:
|
|
4148
|
+
hasAttachment: We,
|
|
4149
|
+
isMyMessage: Q
|
|
4150
4150
|
}
|
|
4151
4151
|
),
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4152
|
+
Ye && /* @__PURE__ */ n(Is, { poll: Ye }),
|
|
4153
|
+
H != null && H.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
4154
|
+
D,
|
|
4155
4155
|
{
|
|
4156
4156
|
actionHandler: l,
|
|
4157
|
-
attachments:
|
|
4157
|
+
attachments: H
|
|
4158
4158
|
}
|
|
4159
4159
|
) : null,
|
|
4160
|
-
|
|
4161
|
-
|
|
4160
|
+
q ? /* @__PURE__ */ n(
|
|
4161
|
+
G,
|
|
4162
4162
|
{
|
|
4163
|
-
message:
|
|
4163
|
+
message: W,
|
|
4164
4164
|
renderText: p
|
|
4165
4165
|
}
|
|
4166
4166
|
) : /* @__PURE__ */ n(
|
|
4167
|
-
|
|
4167
|
+
Fe,
|
|
4168
4168
|
{
|
|
4169
|
-
message:
|
|
4169
|
+
message: W,
|
|
4170
4170
|
renderText: p
|
|
4171
4171
|
}
|
|
4172
4172
|
),
|
|
4173
|
-
/* @__PURE__ */ n(
|
|
4174
|
-
|
|
4173
|
+
/* @__PURE__ */ n(st, {}),
|
|
4174
|
+
ue && /* @__PURE__ */ n(Be, { side: Q ? "me" : "other" })
|
|
4175
4175
|
]
|
|
4176
4176
|
}
|
|
4177
4177
|
) })
|
|
4178
4178
|
}
|
|
4179
4179
|
),
|
|
4180
|
-
!ns && !Et && /* @__PURE__ */ n("div", { className: "str-chat__message-footer", children: (!
|
|
4181
|
-
|
|
4180
|
+
!ns && !Et && /* @__PURE__ */ n("div", { className: "str-chat__message-footer", children: (!Ne || It) && /* @__PURE__ */ n(
|
|
4181
|
+
Ze,
|
|
4182
4182
|
{
|
|
4183
4183
|
message: c,
|
|
4184
|
-
hasAttachment:
|
|
4185
|
-
isMyMessage:
|
|
4184
|
+
hasAttachment: We,
|
|
4185
|
+
isMyMessage: Q
|
|
4186
4186
|
}
|
|
4187
4187
|
) }),
|
|
4188
4188
|
/* @__PURE__ */ n(
|
|
@@ -4192,14 +4192,14 @@ const Wi = ({
|
|
|
4192
4192
|
resolvedOutbound: b
|
|
4193
4193
|
}
|
|
4194
4194
|
),
|
|
4195
|
-
|
|
4196
|
-
|
|
4195
|
+
se && /* @__PURE__ */ n(
|
|
4196
|
+
ee,
|
|
4197
4197
|
{
|
|
4198
4198
|
onClick: d,
|
|
4199
4199
|
reply_count: c.reply_count
|
|
4200
4200
|
}
|
|
4201
4201
|
),
|
|
4202
|
-
|
|
4202
|
+
me && /* @__PURE__ */ n(j, {})
|
|
4203
4203
|
]
|
|
4204
4204
|
},
|
|
4205
4205
|
c.id
|
|
@@ -4213,7 +4213,7 @@ const Wi = ({
|
|
|
4213
4213
|
}
|
|
4214
4214
|
), Ki = (e) => {
|
|
4215
4215
|
var i;
|
|
4216
|
-
const t =
|
|
4216
|
+
const t = fe("CustomMessage"), s = we(Ln), a = (i = t.message.metadata) == null ? void 0 : i.outbound_id, r = typeof a == "string" ? s == null ? void 0 : s[a] : void 0;
|
|
4217
4217
|
return /* @__PURE__ */ n(
|
|
4218
4218
|
qi,
|
|
4219
4219
|
{
|
|
@@ -4224,7 +4224,7 @@ const Wi = ({
|
|
|
4224
4224
|
);
|
|
4225
4225
|
}, Zi = () => {
|
|
4226
4226
|
var s;
|
|
4227
|
-
const { handleDelete: e, message: t } =
|
|
4227
|
+
const { handleDelete: e, message: t } = fe("CustomMessageActions");
|
|
4228
4228
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
4229
4229
|
gn,
|
|
4230
4230
|
{
|
|
@@ -4236,7 +4236,7 @@ const Wi = ({
|
|
|
4236
4236
|
}
|
|
4237
4237
|
);
|
|
4238
4238
|
}, Ji = () => {
|
|
4239
|
-
const { handleFlag: e } =
|
|
4239
|
+
const { handleFlag: e } = fe("CustomMessageActions");
|
|
4240
4240
|
return /* @__PURE__ */ n(
|
|
4241
4241
|
gn,
|
|
4242
4242
|
{
|
|
@@ -4249,8 +4249,8 @@ const Wi = ({
|
|
|
4249
4249
|
);
|
|
4250
4250
|
}, Qi = () => {
|
|
4251
4251
|
var t;
|
|
4252
|
-
const { message: e } =
|
|
4253
|
-
return ((t = e.metadata) == null ? void 0 : t.custom_type) !==
|
|
4252
|
+
const { message: e } = fe("CustomMessageActions");
|
|
4253
|
+
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== le.ATTACHMENT ? null : /* @__PURE__ */ n(
|
|
4254
4254
|
wa,
|
|
4255
4255
|
{
|
|
4256
4256
|
messageActionSet: [
|
|
@@ -4261,7 +4261,7 @@ const Wi = ({
|
|
|
4261
4261
|
);
|
|
4262
4262
|
}, el = (e) => ({
|
|
4263
4263
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
4264
|
-
(t) =>
|
|
4264
|
+
(t) => nt.previewIsLoaded(t) || nt.previewIsLoading(t)
|
|
4265
4265
|
)
|
|
4266
4266
|
}), tl = () => {
|
|
4267
4267
|
const { linkPreviewsManager: e } = Ts(), { linkPreviews: t } = As(
|
|
@@ -4315,9 +4315,9 @@ const Wi = ({
|
|
|
4315
4315
|
// edge lands ~6px past the fold, reachable by scrolling. That residue
|
|
4316
4316
|
// belongs to whoever owns the mobile layout contract, not to this component.
|
|
4317
4317
|
/* @__PURE__ */ n("div", { className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2", children: t.map((r) => {
|
|
4318
|
-
const i =
|
|
4318
|
+
const i = nt.previewIsLoading(r);
|
|
4319
4319
|
return /* @__PURE__ */ n(
|
|
4320
|
-
|
|
4320
|
+
it.Composer,
|
|
4321
4321
|
{
|
|
4322
4322
|
title: r.title,
|
|
4323
4323
|
url: r.og_scrape_url,
|
|
@@ -4330,7 +4330,7 @@ const Wi = ({
|
|
|
4330
4330
|
);
|
|
4331
4331
|
}) })
|
|
4332
4332
|
) : null;
|
|
4333
|
-
},
|
|
4333
|
+
}, Ue = z.createContext(!1), nl = 200, ao = () => we(Ue), sl = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
4334
4334
|
"button",
|
|
4335
4335
|
{
|
|
4336
4336
|
...s,
|
|
@@ -4342,7 +4342,7 @@ const Wi = ({
|
|
|
4342
4342
|
children: /* @__PURE__ */ n(ma, { weight: "bold", className: "size-4" })
|
|
4343
4343
|
}
|
|
4344
4344
|
), an = () => {
|
|
4345
|
-
const e =
|
|
4345
|
+
const e = we(Ue), { handleSubmit: t } = Rs(), s = Ls(), a = e || !s, {
|
|
4346
4346
|
SendButton: r = sl,
|
|
4347
4347
|
AttachmentPreviewList: i = Ms
|
|
4348
4348
|
} = dn("CustomMessageInput"), o = z.useRef(null);
|
|
@@ -4450,7 +4450,7 @@ const Wi = ({
|
|
|
4450
4450
|
composerInput: i
|
|
4451
4451
|
}) => {
|
|
4452
4452
|
var h;
|
|
4453
|
-
const { channel: o } =
|
|
4453
|
+
const { channel: o } = _e(), l = ((h = o == null ? void 0 : o.data) == null ? void 0 : h.frozen) === !0, d = !!i, u = z.useRef(null);
|
|
4454
4454
|
return z.useEffect(() => {
|
|
4455
4455
|
if (!d)
|
|
4456
4456
|
return;
|
|
@@ -4463,11 +4463,11 @@ const Wi = ({
|
|
|
4463
4463
|
c = v;
|
|
4464
4464
|
const b = Array.from(
|
|
4465
4465
|
g.querySelectorAll(".str-chat__list")
|
|
4466
|
-
).find((_) => _.scrollHeight > _.clientHeight) ?? null,
|
|
4466
|
+
).find((_) => _.scrollHeight > _.clientHeight) ?? null, y = b ? b.scrollHeight - b.scrollTop - b.clientHeight < nl : !1;
|
|
4467
4467
|
g.style.setProperty(
|
|
4468
4468
|
"--messaging-composer-height",
|
|
4469
4469
|
`${v}px`
|
|
4470
|
-
), x &&
|
|
4470
|
+
), x && y && b && (b.scrollTop = b.scrollHeight);
|
|
4471
4471
|
};
|
|
4472
4472
|
if (p(), typeof ResizeObserver > "u")
|
|
4473
4473
|
return;
|
|
@@ -4496,7 +4496,7 @@ const Wi = ({
|
|
|
4496
4496
|
] })
|
|
4497
4497
|
]
|
|
4498
4498
|
}
|
|
4499
|
-
) : /* @__PURE__ */ f(
|
|
4499
|
+
) : /* @__PURE__ */ f(Z, { children: [
|
|
4500
4500
|
t == null ? void 0 : t(),
|
|
4501
4501
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: r ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: r }) : null }),
|
|
4502
4502
|
s == null ? void 0 : s()
|
|
@@ -4525,7 +4525,7 @@ const Wi = ({
|
|
|
4525
4525
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
4526
4526
|
children: [
|
|
4527
4527
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
4528
|
-
/* @__PURE__ */ n(
|
|
4528
|
+
/* @__PURE__ */ n(Ue.Provider, { value: l, children: /* @__PURE__ */ n(Ht, { Input: i ?? an }) })
|
|
4529
4529
|
]
|
|
4530
4530
|
}
|
|
4531
4531
|
),
|
|
@@ -4544,7 +4544,7 @@ const Wi = ({
|
|
|
4544
4544
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
4545
4545
|
children: [
|
|
4546
4546
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
4547
|
-
/* @__PURE__ */ n(
|
|
4547
|
+
/* @__PURE__ */ n(Ue.Provider, { value: l, children: /* @__PURE__ */ n(Ht, { Input: an }) })
|
|
4548
4548
|
]
|
|
4549
4549
|
}
|
|
4550
4550
|
),
|
|
@@ -4555,7 +4555,7 @@ const Wi = ({
|
|
|
4555
4555
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
4556
4556
|
}, rl = ["SYSTEM_AGE_SAFETY_BLOCKED"], il = {
|
|
4557
4557
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
4558
|
-
},
|
|
4558
|
+
}, et = "age safety guidelines.", ll = "https://linktr.ee/s/about/contact", ol = (e) => rl.includes(
|
|
4559
4559
|
e
|
|
4560
4560
|
), cl = (e) => {
|
|
4561
4561
|
var t;
|
|
@@ -4580,11 +4580,11 @@ const Wi = ({
|
|
|
4580
4580
|
type: s
|
|
4581
4581
|
};
|
|
4582
4582
|
}, ul = (e) => {
|
|
4583
|
-
const t = e.indexOf(
|
|
4583
|
+
const t = e.indexOf(et);
|
|
4584
4584
|
if (t === -1)
|
|
4585
4585
|
return e;
|
|
4586
|
-
const s = t +
|
|
4587
|
-
return /* @__PURE__ */ f(
|
|
4586
|
+
const s = t + et.length;
|
|
4587
|
+
return /* @__PURE__ */ f(Z, { children: [
|
|
4588
4588
|
e.slice(0, t),
|
|
4589
4589
|
/* @__PURE__ */ n(
|
|
4590
4590
|
"a",
|
|
@@ -4593,7 +4593,7 @@ const Wi = ({
|
|
|
4593
4593
|
target: "_blank",
|
|
4594
4594
|
rel: "noopener noreferrer",
|
|
4595
4595
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
4596
|
-
children:
|
|
4596
|
+
children: et
|
|
4597
4597
|
}
|
|
4598
4598
|
),
|
|
4599
4599
|
e.slice(s)
|
|
@@ -4626,7 +4626,7 @@ const Wi = ({
|
|
|
4626
4626
|
]
|
|
4627
4627
|
}
|
|
4628
4628
|
),
|
|
4629
|
-
!t && /* @__PURE__ */ n(
|
|
4629
|
+
!t && /* @__PURE__ */ n(Xe, { message: e.message })
|
|
4630
4630
|
] });
|
|
4631
4631
|
}
|
|
4632
4632
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
@@ -4653,7 +4653,7 @@ const Wi = ({
|
|
|
4653
4653
|
]
|
|
4654
4654
|
}
|
|
4655
4655
|
),
|
|
4656
|
-
!t && /* @__PURE__ */ n(
|
|
4656
|
+
!t && /* @__PURE__ */ n(Xe, { message: e.message })
|
|
4657
4657
|
] });
|
|
4658
4658
|
}
|
|
4659
4659
|
return /* @__PURE__ */ f("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -4662,9 +4662,9 @@ const Wi = ({
|
|
|
4662
4662
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
4663
4663
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
4664
4664
|
] }),
|
|
4665
|
-
!t && /* @__PURE__ */ n(
|
|
4665
|
+
!t && /* @__PURE__ */ n(Xe, { message: e.message })
|
|
4666
4666
|
] });
|
|
4667
|
-
}, qn =
|
|
4667
|
+
}, qn = He(!1), tt = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
4668
4668
|
"animateTransform",
|
|
4669
4669
|
{
|
|
4670
4670
|
attributeName: "transform",
|
|
@@ -4675,12 +4675,12 @@ const Wi = ({
|
|
|
4675
4675
|
repeatCount: "indefinite"
|
|
4676
4676
|
}
|
|
4677
4677
|
) }), hl = /* @__PURE__ */ new Set([
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4678
|
+
qe.Thinking,
|
|
4679
|
+
qe.Generating,
|
|
4680
|
+
qe.ExternalSources
|
|
4681
4681
|
]), fl = ({ threadList: e }) => {
|
|
4682
4682
|
var p, w;
|
|
4683
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
4683
|
+
const { channel: t, channelConfig: s, thread: a } = _e(), { client: r } = Ve(), { typing: i = {} } = Ps(), { aiState: o } = zs(t), l = we(qn);
|
|
4684
4684
|
if (!e && l && hl.has(o)) {
|
|
4685
4685
|
const v = gl(t, (p = r.user) == null ? void 0 : p.id);
|
|
4686
4686
|
return /* @__PURE__ */ n(
|
|
@@ -4733,7 +4733,7 @@ const Wi = ({
|
|
|
4733
4733
|
},
|
|
4734
4734
|
children: /* @__PURE__ */ f("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
4735
4735
|
/* @__PURE__ */ n(
|
|
4736
|
-
|
|
4736
|
+
ye,
|
|
4737
4737
|
{
|
|
4738
4738
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4739
4739
|
id: e,
|
|
@@ -4754,13 +4754,13 @@ const Wi = ({
|
|
|
4754
4754
|
height: "13",
|
|
4755
4755
|
overflow: "visible",
|
|
4756
4756
|
children: [
|
|
4757
|
-
/* @__PURE__ */ n(
|
|
4758
|
-
/* @__PURE__ */ n(
|
|
4759
|
-
/* @__PURE__ */ n(
|
|
4757
|
+
/* @__PURE__ */ n(tt, { cx: "4", index: 0 }),
|
|
4758
|
+
/* @__PURE__ */ n(tt, { cx: "16", index: 1 }),
|
|
4759
|
+
/* @__PURE__ */ n(tt, { cx: "28", index: 2 })
|
|
4760
4760
|
]
|
|
4761
4761
|
}
|
|
4762
4762
|
) }) }),
|
|
4763
|
-
/* @__PURE__ */ n(
|
|
4763
|
+
/* @__PURE__ */ n(Be, { side: "other" })
|
|
4764
4764
|
] }) }) })
|
|
4765
4765
|
] })
|
|
4766
4766
|
}
|
|
@@ -4817,11 +4817,11 @@ const pl = () => null, bl = ({ className: e, message: t }) => /* @__PURE__ */ f(
|
|
|
4817
4817
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
4818
4818
|
]
|
|
4819
4819
|
}
|
|
4820
|
-
),
|
|
4820
|
+
), je = z.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ f("div", { className: "flex items-center", children: [
|
|
4821
4821
|
/* @__PURE__ */ n(bl, { className: "w-6 h-6" }),
|
|
4822
4822
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4823
4823
|
] }) }));
|
|
4824
|
-
|
|
4824
|
+
je.displayName = "LoadingState";
|
|
4825
4825
|
const vl = ({
|
|
4826
4826
|
onBack: e,
|
|
4827
4827
|
showBackButton: t,
|
|
@@ -4842,24 +4842,24 @@ const vl = ({
|
|
|
4842
4842
|
renderChannelBanner: v,
|
|
4843
4843
|
customChannelActions: x,
|
|
4844
4844
|
renderChannelActions: b,
|
|
4845
|
-
renderMessage:
|
|
4845
|
+
renderMessage: y,
|
|
4846
4846
|
viewerLanguage: _,
|
|
4847
4847
|
showChannelInfo: T = !0,
|
|
4848
|
-
onParticipantNameClick:
|
|
4849
|
-
onOutboundClick:
|
|
4848
|
+
onParticipantNameClick: R,
|
|
4849
|
+
onOutboundClick: L,
|
|
4850
4850
|
resolveOutbound: $,
|
|
4851
4851
|
composerInput: F
|
|
4852
4852
|
}) => {
|
|
4853
|
-
const { channel:
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
}, [
|
|
4857
|
-
const
|
|
4858
|
-
var
|
|
4859
|
-
(
|
|
4860
|
-
}, []), C =
|
|
4861
|
-
(
|
|
4862
|
-
), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
4853
|
+
const { channel: M, messages: E } = _e(), D = V(L);
|
|
4854
|
+
X(() => {
|
|
4855
|
+
D.current = L;
|
|
4856
|
+
}, [L]);
|
|
4857
|
+
const I = K((J) => {
|
|
4858
|
+
var G;
|
|
4859
|
+
(G = D.current) == null || G.call(D, J);
|
|
4860
|
+
}, []), C = L ? I : void 0, S = pr(E, $), P = M.state.messages.some(
|
|
4861
|
+
(J) => J.type !== "deleted"
|
|
4862
|
+
), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null, j = /* @__PURE__ */ n(
|
|
4863
4863
|
La,
|
|
4864
4864
|
{
|
|
4865
4865
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
@@ -4877,27 +4877,27 @@ const vl = ({
|
|
|
4877
4877
|
onReportParticipantClick: h,
|
|
4878
4878
|
customChannelActions: x,
|
|
4879
4879
|
renderChannelActions: b,
|
|
4880
|
-
onParticipantNameClick:
|
|
4880
|
+
onParticipantNameClick: R
|
|
4881
4881
|
}
|
|
4882
|
-
),
|
|
4883
|
-
(
|
|
4884
|
-
const { message:
|
|
4882
|
+
), ee = K(
|
|
4883
|
+
(J) => {
|
|
4884
|
+
const { message: G } = fe("ChannelView"), N = /* @__PURE__ */ n(
|
|
4885
4885
|
Ki,
|
|
4886
4886
|
{
|
|
4887
|
-
...
|
|
4887
|
+
...J,
|
|
4888
4888
|
viewerLanguage: _,
|
|
4889
4889
|
onOutboundClick: C
|
|
4890
4890
|
}
|
|
4891
4891
|
);
|
|
4892
|
-
return !
|
|
4892
|
+
return !y || !G ? N : y(N, G);
|
|
4893
4893
|
},
|
|
4894
|
-
[C,
|
|
4894
|
+
[C, y, _]
|
|
4895
4895
|
);
|
|
4896
|
-
return /* @__PURE__ */ n(Ln.Provider, { value:
|
|
4896
|
+
return /* @__PURE__ */ n(Ln.Provider, { value: S, children: /* @__PURE__ */ n(
|
|
4897
4897
|
$s,
|
|
4898
4898
|
{
|
|
4899
4899
|
overrides: {
|
|
4900
|
-
Message:
|
|
4900
|
+
Message: ee,
|
|
4901
4901
|
MessageActions: Qi,
|
|
4902
4902
|
UnreadMessagesNotification: () => null,
|
|
4903
4903
|
UnreadMessagesSeparator: () => null
|
|
@@ -4909,14 +4909,14 @@ const vl = ({
|
|
|
4909
4909
|
className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
|
|
4910
4910
|
children: [
|
|
4911
4911
|
!P && /* @__PURE__ */ n("div", { className: "str-chat__list", children: /* @__PURE__ */ f("div", { className: "str-chat__message-list-scroll", children: [
|
|
4912
|
-
|
|
4912
|
+
j,
|
|
4913
4913
|
U
|
|
4914
4914
|
] }) }),
|
|
4915
4915
|
/* @__PURE__ */ n(
|
|
4916
4916
|
Vt,
|
|
4917
4917
|
{
|
|
4918
4918
|
head: P ? /* @__PURE__ */ f("div", { className: "sticky top-0 z-10", children: [
|
|
4919
|
-
|
|
4919
|
+
j,
|
|
4920
4920
|
U
|
|
4921
4921
|
] }) : void 0,
|
|
4922
4922
|
hideDeletedMessages: !0,
|
|
@@ -4931,33 +4931,33 @@ const vl = ({
|
|
|
4931
4931
|
rn,
|
|
4932
4932
|
{
|
|
4933
4933
|
...s && {
|
|
4934
|
-
renderActions: () => s == null ? void 0 : s(
|
|
4934
|
+
renderActions: () => s == null ? void 0 : s(M)
|
|
4935
4935
|
},
|
|
4936
4936
|
...r && {
|
|
4937
|
-
renderHeader: () => r(
|
|
4937
|
+
renderHeader: () => r(M)
|
|
4938
4938
|
},
|
|
4939
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4939
|
+
renderFooter: () => a == null ? void 0 : a(M),
|
|
4940
4940
|
disabled: c,
|
|
4941
4941
|
disabledReason: p,
|
|
4942
4942
|
composerInput: F
|
|
4943
4943
|
},
|
|
4944
4944
|
"lt-channel-message-input"
|
|
4945
4945
|
)
|
|
4946
|
-
] }) : /* @__PURE__ */ f(
|
|
4946
|
+
] }) : /* @__PURE__ */ f(Z, { children: [
|
|
4947
4947
|
/* @__PURE__ */ f(
|
|
4948
4948
|
"div",
|
|
4949
4949
|
{
|
|
4950
4950
|
className: "flex-1 overflow-hidden relative",
|
|
4951
4951
|
children: [
|
|
4952
4952
|
!P && /* @__PURE__ */ n("div", { className: "str-chat__list", children: /* @__PURE__ */ f("div", { className: "str-chat__message-list-scroll", children: [
|
|
4953
|
-
|
|
4953
|
+
j,
|
|
4954
4954
|
U
|
|
4955
4955
|
] }) }),
|
|
4956
4956
|
/* @__PURE__ */ n(
|
|
4957
4957
|
Vt,
|
|
4958
4958
|
{
|
|
4959
4959
|
head: P ? /* @__PURE__ */ f("div", { className: "sticky top-0 z-10", children: [
|
|
4960
|
-
|
|
4960
|
+
j,
|
|
4961
4961
|
U
|
|
4962
4962
|
] }) : void 0,
|
|
4963
4963
|
hideDeletedMessages: !0,
|
|
@@ -4968,14 +4968,14 @@ const vl = ({
|
|
|
4968
4968
|
},
|
|
4969
4969
|
"lt-channel-message-list"
|
|
4970
4970
|
),
|
|
4971
|
-
r ? /* @__PURE__ */ n(z.Fragment, { children: r(
|
|
4971
|
+
r ? /* @__PURE__ */ n(z.Fragment, { children: r(M) }, "lt-channel-conversation-footer") : null,
|
|
4972
4972
|
/* @__PURE__ */ n(
|
|
4973
4973
|
rn,
|
|
4974
4974
|
{
|
|
4975
4975
|
...s && {
|
|
4976
|
-
renderActions: () => s == null ? void 0 : s(
|
|
4976
|
+
renderActions: () => s == null ? void 0 : s(M)
|
|
4977
4977
|
},
|
|
4978
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4978
|
+
renderFooter: () => a == null ? void 0 : a(M),
|
|
4979
4979
|
disabled: c,
|
|
4980
4980
|
disabledReason: p,
|
|
4981
4981
|
composerInput: F
|
|
@@ -5006,58 +5006,58 @@ const vl = ({
|
|
|
5006
5006
|
composerDisabled: v = !1,
|
|
5007
5007
|
composerDisabledReason: x,
|
|
5008
5008
|
dmAgentEnabled: b,
|
|
5009
|
-
messageMetadata:
|
|
5009
|
+
messageMetadata: y,
|
|
5010
5010
|
onMessageSent: _,
|
|
5011
5011
|
showStarButton: T = !1,
|
|
5012
|
-
renderChannelBanner:
|
|
5013
|
-
customChannelActions:
|
|
5012
|
+
renderChannelBanner: R,
|
|
5013
|
+
customChannelActions: L,
|
|
5014
5014
|
renderChannelActions: $,
|
|
5015
5015
|
renderMessage: F,
|
|
5016
|
-
onMessageLinkClick:
|
|
5017
|
-
sendButton:
|
|
5018
|
-
attachmentPreviewList:
|
|
5019
|
-
viewerLanguage:
|
|
5016
|
+
onMessageLinkClick: M,
|
|
5017
|
+
sendButton: E,
|
|
5018
|
+
attachmentPreviewList: D,
|
|
5019
|
+
viewerLanguage: I,
|
|
5020
5020
|
showChannelInfo: C = !0,
|
|
5021
|
-
onParticipantNameClick:
|
|
5021
|
+
onParticipantNameClick: S,
|
|
5022
5022
|
onOutboundClick: P,
|
|
5023
5023
|
resolveOutbound: U,
|
|
5024
|
-
composerInput:
|
|
5024
|
+
composerInput: j
|
|
5025
5025
|
}) => {
|
|
5026
|
-
const
|
|
5027
|
-
async (
|
|
5028
|
-
var
|
|
5029
|
-
const
|
|
5030
|
-
...
|
|
5031
|
-
...
|
|
5032
|
-
...
|
|
5026
|
+
const ee = K(
|
|
5027
|
+
async (G, N, A) => {
|
|
5028
|
+
var ne;
|
|
5029
|
+
const Y = ((ne = e.data) == null ? void 0 : ne.chatbot_paused) === !0, q = b && !Y, H = {
|
|
5030
|
+
...N,
|
|
5031
|
+
...q && { silent: !0 },
|
|
5032
|
+
...y && {
|
|
5033
5033
|
metadata: {
|
|
5034
|
-
...
|
|
5035
|
-
...
|
|
5034
|
+
...N.metadata ?? {},
|
|
5035
|
+
...y
|
|
5036
5036
|
}
|
|
5037
5037
|
}
|
|
5038
|
-
},
|
|
5039
|
-
...
|
|
5040
|
-
...
|
|
5041
|
-
},
|
|
5042
|
-
return _ == null || _(
|
|
5038
|
+
}, te = {
|
|
5039
|
+
...A,
|
|
5040
|
+
...q && { skip_push: !0 }
|
|
5041
|
+
}, W = await e.sendMessage(H, te);
|
|
5042
|
+
return _ == null || _(W), W;
|
|
5043
5043
|
},
|
|
5044
|
-
[e, b,
|
|
5045
|
-
),
|
|
5046
|
-
return
|
|
5047
|
-
if (!
|
|
5048
|
-
const
|
|
5049
|
-
if (!
|
|
5050
|
-
const
|
|
5051
|
-
const
|
|
5052
|
-
if (!
|
|
5053
|
-
const
|
|
5054
|
-
|
|
5044
|
+
[e, b, y, _]
|
|
5045
|
+
), J = V(null);
|
|
5046
|
+
return X(() => {
|
|
5047
|
+
if (!M) return;
|
|
5048
|
+
const G = J.current;
|
|
5049
|
+
if (!G) return;
|
|
5050
|
+
const N = (A) => {
|
|
5051
|
+
const Y = A.target, q = Y == null ? void 0 : Y.closest("a[href]"), H = q == null ? void 0 : q.getAttribute("href");
|
|
5052
|
+
if (!H) return;
|
|
5053
|
+
const te = q == null ? void 0 : q.closest("[data-message-id]"), W = te == null ? void 0 : te.getAttribute("data-message-id"), ne = W ? e.state.messages.find((de) => de.id === W) : void 0;
|
|
5054
|
+
M(H, ne);
|
|
5055
5055
|
};
|
|
5056
|
-
return
|
|
5057
|
-
}, [
|
|
5056
|
+
return G.addEventListener("click", N), () => G.removeEventListener("click", N);
|
|
5057
|
+
}, [M, e]), /* @__PURE__ */ n(
|
|
5058
5058
|
"div",
|
|
5059
5059
|
{
|
|
5060
|
-
ref:
|
|
5060
|
+
ref: J,
|
|
5061
5061
|
className: k(
|
|
5062
5062
|
"messaging-channel-view h-full flex flex-col",
|
|
5063
5063
|
d
|
|
@@ -5068,12 +5068,12 @@ const vl = ({
|
|
|
5068
5068
|
channel: e,
|
|
5069
5069
|
MessageSystem: ml,
|
|
5070
5070
|
EmptyStateIndicator: u,
|
|
5071
|
-
LoadingIndicator:
|
|
5071
|
+
LoadingIndicator: je,
|
|
5072
5072
|
DateSeparator: Ma,
|
|
5073
5073
|
TypingIndicator: fl,
|
|
5074
|
-
doSendMessageRequest:
|
|
5075
|
-
...
|
|
5076
|
-
...
|
|
5074
|
+
doSendMessageRequest: ee,
|
|
5075
|
+
...E ? { SendButton: E } : {},
|
|
5076
|
+
...D ? { AttachmentPreviewList: D } : {},
|
|
5077
5077
|
children: /* @__PURE__ */ n(
|
|
5078
5078
|
vl,
|
|
5079
5079
|
{
|
|
@@ -5094,16 +5094,16 @@ const vl = ({
|
|
|
5094
5094
|
composerDisabled: v,
|
|
5095
5095
|
composerDisabledReason: x,
|
|
5096
5096
|
showStarButton: T,
|
|
5097
|
-
renderChannelBanner:
|
|
5098
|
-
customChannelActions:
|
|
5097
|
+
renderChannelBanner: R,
|
|
5098
|
+
customChannelActions: L,
|
|
5099
5099
|
renderChannelActions: $,
|
|
5100
5100
|
renderMessage: F,
|
|
5101
|
-
viewerLanguage:
|
|
5101
|
+
viewerLanguage: I,
|
|
5102
5102
|
showChannelInfo: C,
|
|
5103
|
-
onParticipantNameClick:
|
|
5103
|
+
onParticipantNameClick: S,
|
|
5104
5104
|
onOutboundClick: P,
|
|
5105
5105
|
resolveOutbound: U,
|
|
5106
|
-
composerInput:
|
|
5106
|
+
composerInput: j
|
|
5107
5107
|
}
|
|
5108
5108
|
)
|
|
5109
5109
|
}
|
|
@@ -5113,7 +5113,7 @@ const vl = ({
|
|
|
5113
5113
|
}
|
|
5114
5114
|
);
|
|
5115
5115
|
Kn.displayName = "ChannelView";
|
|
5116
|
-
const
|
|
5116
|
+
const Se = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ f("div", { className: "text-center max-w-sm", children: [
|
|
5117
5117
|
/* @__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: "⚠️" }) }),
|
|
5118
5118
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
5119
5119
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -5127,151 +5127,153 @@ const ke = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
5127
5127
|
}
|
|
5128
5128
|
)
|
|
5129
5129
|
] }) }));
|
|
5130
|
-
|
|
5130
|
+
Se.displayName = "ErrorState";
|
|
5131
5131
|
const ro = ({
|
|
5132
5132
|
capabilities: e = {},
|
|
5133
5133
|
renderMessageInputActions: t,
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5134
|
+
renderMessageInputFooter: s,
|
|
5135
|
+
renderConversationFooter: a,
|
|
5136
|
+
onChannelSelect: r,
|
|
5137
|
+
onExitConversation: i,
|
|
5138
|
+
initialParticipantFilter: o,
|
|
5139
|
+
initialParticipantData: l,
|
|
5140
|
+
CustomChannelEmptyState: d,
|
|
5141
|
+
onBlockParticipantClick: u,
|
|
5142
|
+
onReportParticipantClick: h,
|
|
5143
|
+
dmAgentEnabled: m,
|
|
5144
|
+
onMessageSent: g,
|
|
5145
|
+
viewerLanguage: c,
|
|
5146
|
+
renderChannelBanner: p,
|
|
5147
|
+
customChannelActions: w,
|
|
5148
|
+
renderChannelActions: v,
|
|
5149
|
+
onParticipantNameClick: x,
|
|
5150
|
+
onOutboundClick: b,
|
|
5151
|
+
resolveOutbound: y,
|
|
5152
|
+
renderMessage: _,
|
|
5153
|
+
onMessageLinkClick: T,
|
|
5154
|
+
showChannelInfo: R,
|
|
5154
5155
|
composerInput: L
|
|
5155
5156
|
}) => {
|
|
5156
5157
|
const {
|
|
5157
|
-
client:
|
|
5158
|
-
isConnected:
|
|
5159
|
-
isLoading:
|
|
5160
|
-
error:
|
|
5161
|
-
refreshConnection:
|
|
5162
|
-
service:
|
|
5163
|
-
debug:
|
|
5164
|
-
} = _a(), [
|
|
5165
|
-
|
|
5166
|
-
const
|
|
5167
|
-
|
|
5168
|
-
const
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
}, [
|
|
5172
|
-
if (
|
|
5173
|
-
const
|
|
5174
|
-
if (!
|
|
5175
|
-
const
|
|
5176
|
-
if (
|
|
5177
|
-
|
|
5178
|
-
const
|
|
5179
|
-
|
|
5158
|
+
client: $,
|
|
5159
|
+
isConnected: F,
|
|
5160
|
+
isLoading: M,
|
|
5161
|
+
error: E,
|
|
5162
|
+
refreshConnection: D,
|
|
5163
|
+
service: I,
|
|
5164
|
+
debug: C
|
|
5165
|
+
} = _a(), [S, P] = B(null), [U, j] = B(null), [ee, J] = B(!1), { showDeleteConversation: G = !0 } = e, N = V(l);
|
|
5166
|
+
N.current = l;
|
|
5167
|
+
const A = V(r);
|
|
5168
|
+
A.current = r;
|
|
5169
|
+
const Y = V(null), q = V(null);
|
|
5170
|
+
X(() => {
|
|
5171
|
+
q.current = S;
|
|
5172
|
+
}, [S]), X(() => {
|
|
5173
|
+
if (!$ || !F) return;
|
|
5174
|
+
const W = $.userID;
|
|
5175
|
+
if (!W) return;
|
|
5176
|
+
const ne = `${W}::${o}`;
|
|
5177
|
+
if (Y.current === ne) return;
|
|
5178
|
+
Y.current = ne;
|
|
5179
|
+
const de = () => {
|
|
5180
|
+
Y.current === ne && (Y.current = null);
|
|
5180
5181
|
};
|
|
5181
5182
|
(async () => {
|
|
5182
|
-
var
|
|
5183
|
+
var Oe, ue;
|
|
5183
5184
|
try {
|
|
5184
|
-
|
|
5185
|
+
C && console.log(
|
|
5185
5186
|
"[MessagingShell] Loading initial conversation with:",
|
|
5186
|
-
|
|
5187
|
+
o
|
|
5187
5188
|
);
|
|
5188
|
-
const
|
|
5189
|
+
const se = await $.queryChannels(
|
|
5189
5190
|
{
|
|
5190
5191
|
type: "messaging",
|
|
5191
|
-
members: { $eq: [
|
|
5192
|
+
members: { $eq: [W, o] }
|
|
5192
5193
|
},
|
|
5193
5194
|
{},
|
|
5194
5195
|
{ limit: 1 }
|
|
5195
5196
|
);
|
|
5196
|
-
if (
|
|
5197
|
-
|
|
5197
|
+
if (se.length > 0) {
|
|
5198
|
+
P(se[0]), j(null), (Oe = A.current) == null || Oe.call(A, se[0]), C && console.log(
|
|
5198
5199
|
"[MessagingShell] Initial conversation loaded:",
|
|
5199
|
-
|
|
5200
|
+
se[0].id
|
|
5200
5201
|
);
|
|
5201
5202
|
return;
|
|
5202
5203
|
}
|
|
5203
|
-
const
|
|
5204
|
-
if (!
|
|
5205
|
-
|
|
5204
|
+
const me = N.current;
|
|
5205
|
+
if (!me || !I) {
|
|
5206
|
+
de(), j("No conversation found with this account"), C && console.log(
|
|
5206
5207
|
"[MessagingShell] No conversation found for:",
|
|
5207
|
-
|
|
5208
|
+
o
|
|
5208
5209
|
);
|
|
5209
5210
|
return;
|
|
5210
5211
|
}
|
|
5211
5212
|
try {
|
|
5212
|
-
const
|
|
5213
|
-
id:
|
|
5214
|
-
name:
|
|
5215
|
-
phone:
|
|
5213
|
+
const re = await I.startChannelWithParticipant({
|
|
5214
|
+
id: me.id,
|
|
5215
|
+
name: me.name,
|
|
5216
|
+
phone: me.phone
|
|
5216
5217
|
});
|
|
5217
|
-
|
|
5218
|
+
P(re), j(null), (ue = A.current) == null || ue.call(A, re), C && console.log(
|
|
5218
5219
|
"[MessagingShell] Channel created and loaded:",
|
|
5219
|
-
|
|
5220
|
+
re.id
|
|
5220
5221
|
);
|
|
5221
|
-
} catch (
|
|
5222
|
+
} catch (re) {
|
|
5222
5223
|
console.error(
|
|
5223
5224
|
"[MessagingShell] Failed to create conversation:",
|
|
5224
|
-
|
|
5225
|
-
),
|
|
5225
|
+
re
|
|
5226
|
+
), de(), j("Failed to create conversation");
|
|
5226
5227
|
}
|
|
5227
|
-
} catch (
|
|
5228
|
+
} catch (se) {
|
|
5228
5229
|
console.error(
|
|
5229
5230
|
"[MessagingShell] Failed to load initial conversation:",
|
|
5230
|
-
|
|
5231
|
-
),
|
|
5231
|
+
se
|
|
5232
|
+
), de(), q.current || j("Failed to load conversation");
|
|
5232
5233
|
}
|
|
5233
5234
|
})();
|
|
5234
|
-
}, [
|
|
5235
|
-
const
|
|
5236
|
-
|
|
5237
|
-
const
|
|
5238
|
-
var
|
|
5239
|
-
|
|
5235
|
+
}, [o, $, F, I, C]);
|
|
5236
|
+
const H = V(i);
|
|
5237
|
+
H.current = i;
|
|
5238
|
+
const te = K(() => {
|
|
5239
|
+
var W;
|
|
5240
|
+
P(null), J(!0), (W = H.current) == null || W.call(H);
|
|
5240
5241
|
}, []);
|
|
5241
|
-
return
|
|
5242
|
-
|
|
5242
|
+
return M ? /* @__PURE__ */ n(je, {}) : E ? /* @__PURE__ */ n(Se, { message: E, onBack: D }) : !F || !$ ? /* @__PURE__ */ n(
|
|
5243
|
+
Se,
|
|
5243
5244
|
{
|
|
5244
5245
|
message: "Not connected to messaging service",
|
|
5245
|
-
onBack:
|
|
5246
|
+
onBack: D
|
|
5246
5247
|
}
|
|
5247
|
-
) :
|
|
5248
|
+
) : U ? /* @__PURE__ */ n(Se, { message: U }) : ee && !S ? /* @__PURE__ */ n(Se, { message: "Conversation ended" }) : S ? /* @__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(
|
|
5248
5249
|
Kn,
|
|
5249
5250
|
{
|
|
5250
|
-
channel:
|
|
5251
|
+
channel: S,
|
|
5251
5252
|
renderMessageInputActions: t,
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5253
|
+
renderMessageInputFooter: s,
|
|
5254
|
+
renderConversationFooter: a,
|
|
5255
|
+
renderChannelBanner: p,
|
|
5256
|
+
onLeaveConversation: te,
|
|
5257
|
+
onBlockParticipant: te,
|
|
5258
|
+
CustomChannelEmptyState: d,
|
|
5259
|
+
showDeleteConversation: G,
|
|
5260
|
+
onBlockParticipantClick: u,
|
|
5261
|
+
onReportParticipantClick: h,
|
|
5262
|
+
dmAgentEnabled: m,
|
|
5263
|
+
onMessageSent: g,
|
|
5264
|
+
viewerLanguage: c,
|
|
5265
|
+
customChannelActions: w,
|
|
5266
|
+
renderChannelActions: v,
|
|
5267
|
+
onParticipantNameClick: x,
|
|
5268
|
+
onOutboundClick: b,
|
|
5269
|
+
resolveOutbound: y,
|
|
5270
|
+
renderMessage: _,
|
|
5271
|
+
onMessageLinkClick: T,
|
|
5272
|
+
showChannelInfo: R,
|
|
5271
5273
|
composerInput: L
|
|
5272
5274
|
},
|
|
5273
|
-
|
|
5274
|
-
) }) }) : /* @__PURE__ */ n(
|
|
5275
|
+
S.id
|
|
5276
|
+
) }) }) : /* @__PURE__ */ n(je, {});
|
|
5275
5277
|
};
|
|
5276
5278
|
function xl(e) {
|
|
5277
5279
|
const t = e.state.pending_messages;
|
|
@@ -5309,7 +5311,7 @@ const Zn = z.createContext({
|
|
|
5309
5311
|
});
|
|
5310
5312
|
}, Jn = z.memo(
|
|
5311
5313
|
(e) => {
|
|
5312
|
-
var $, F,
|
|
5314
|
+
var $, F, M;
|
|
5313
5315
|
const { channel: t, unread: s } = e, {
|
|
5314
5316
|
selectedChannel: a,
|
|
5315
5317
|
onChannelSelect: r,
|
|
@@ -5317,7 +5319,7 @@ const Zn = z.createContext({
|
|
|
5317
5319
|
channelPreview: o,
|
|
5318
5320
|
renderMessagePreview: l,
|
|
5319
5321
|
viewerLanguage: d
|
|
5320
|
-
} = _l(), { client: u } =
|
|
5322
|
+
} = _l(), { client: u } = Ve(), h = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = bn(t);
|
|
5321
5323
|
if (o)
|
|
5322
5324
|
return /* @__PURE__ */ n(
|
|
5323
5325
|
o,
|
|
@@ -5331,45 +5333,45 @@ const Zn = z.createContext({
|
|
|
5331
5333
|
);
|
|
5332
5334
|
const g = () => {
|
|
5333
5335
|
t && r(t);
|
|
5334
|
-
}, c = (
|
|
5335
|
-
const
|
|
5336
|
-
!
|
|
5336
|
+
}, c = (E) => {
|
|
5337
|
+
const D = E.key === "Enter" || E.key === " ", I = E.repeat;
|
|
5338
|
+
!D || I || (E.preventDefault(), g());
|
|
5337
5339
|
}, p = vn(
|
|
5338
5340
|
($ = t == null ? void 0 : t.state) == null ? void 0 : $.members,
|
|
5339
5341
|
u == null ? void 0 : u.userID,
|
|
5340
5342
|
t == null ? void 0 : t.type
|
|
5341
5343
|
), w = xn(p == null ? void 0 : p.user), v = (F = p == null ? void 0 : p.user) == null ? void 0 : F.image, x = (() => {
|
|
5342
|
-
var
|
|
5343
|
-
const
|
|
5344
|
-
if (
|
|
5345
|
-
for (let
|
|
5346
|
-
if (I
|
|
5344
|
+
var D;
|
|
5345
|
+
const E = (D = t == null ? void 0 : t.state) == null ? void 0 : D.messages;
|
|
5346
|
+
if (E != null && E.length) {
|
|
5347
|
+
for (let I = E.length - 1; I >= 0; I--)
|
|
5348
|
+
if (E[I].type !== "system") return E[I];
|
|
5347
5349
|
}
|
|
5348
|
-
})(),
|
|
5349
|
-
var
|
|
5350
|
-
const
|
|
5350
|
+
})(), y = (() => {
|
|
5351
|
+
var S;
|
|
5352
|
+
const E = _n({
|
|
5351
5353
|
message: x,
|
|
5352
5354
|
viewerLanguage: d
|
|
5353
|
-
}), { custom_type:
|
|
5354
|
-
if (
|
|
5355
|
-
return
|
|
5356
|
-
if (
|
|
5357
|
-
return
|
|
5358
|
-
if (
|
|
5359
|
-
if (
|
|
5355
|
+
}), { custom_type: D, attachment_content_type: I } = (x == null ? void 0 : x.metadata) || {};
|
|
5356
|
+
if (D === le.TIP)
|
|
5357
|
+
return E || "Sent a tip";
|
|
5358
|
+
if (D === le.PAID)
|
|
5359
|
+
return E || "Sent a message";
|
|
5360
|
+
if (D === le.ATTACHMENT) {
|
|
5361
|
+
if (I === "text")
|
|
5360
5362
|
return "🔒 Sent a locked message";
|
|
5361
|
-
if (
|
|
5363
|
+
if (I === "media")
|
|
5362
5364
|
return "🔒 Sent a locked attachment";
|
|
5363
5365
|
}
|
|
5364
|
-
if (
|
|
5365
|
-
const C = (
|
|
5366
|
+
if (E) return E;
|
|
5367
|
+
const C = (S = x == null ? void 0 : x.attachments) == null ? void 0 : S[0];
|
|
5366
5368
|
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
5367
|
-
})(), _ = x != null && x.created_at ? Nl(new Date(x.created_at)) : "", T = x ?
|
|
5369
|
+
})(), _ = x != null && x.created_at ? Nl(new Date(x.created_at)) : "", T = x ? $e(x) : !1, R = l ? l(x, y) : `${T ? "✨ " : ""}${y}`, L = s ?? 0;
|
|
5368
5370
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
5369
5371
|
channelId: t == null ? void 0 : t.id,
|
|
5370
5372
|
isSelected: h,
|
|
5371
5373
|
participantName: w,
|
|
5372
|
-
unreadCount:
|
|
5374
|
+
unreadCount: L,
|
|
5373
5375
|
hasTimestamp: !!_
|
|
5374
5376
|
}), /* @__PURE__ */ n(
|
|
5375
5377
|
"div",
|
|
@@ -5388,9 +5390,9 @@ const Zn = z.createContext({
|
|
|
5388
5390
|
"data-dd-privacy": "mask",
|
|
5389
5391
|
children: /* @__PURE__ */ f("div", { className: "flex items-start gap-4", children: [
|
|
5390
5392
|
/* @__PURE__ */ n(
|
|
5391
|
-
|
|
5393
|
+
ye,
|
|
5392
5394
|
{
|
|
5393
|
-
id: ((
|
|
5395
|
+
id: ((M = p == null ? void 0 : p.user) == null ? void 0 : M.id) || t.id || "unknown",
|
|
5394
5396
|
name: w,
|
|
5395
5397
|
image: v,
|
|
5396
5398
|
size: 48,
|
|
@@ -5414,8 +5416,8 @@ const Zn = z.createContext({
|
|
|
5414
5416
|
_ && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: _ })
|
|
5415
5417
|
] }),
|
|
5416
5418
|
/* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
5417
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
5418
|
-
|
|
5419
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
|
|
5420
|
+
L > 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: L > 99 ? "99+" : L })
|
|
5419
5421
|
] })
|
|
5420
5422
|
] })
|
|
5421
5423
|
] })
|
|
@@ -5447,15 +5449,15 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5447
5449
|
}) => {
|
|
5448
5450
|
const b = z.useRef(0);
|
|
5449
5451
|
b.current++;
|
|
5450
|
-
const { debug:
|
|
5451
|
-
(
|
|
5452
|
-
for (const
|
|
5453
|
-
xl(
|
|
5454
|
-
return r ? r(
|
|
5452
|
+
const { debug: y = !1 } = ot(), _ = z.useCallback(
|
|
5453
|
+
(R) => {
|
|
5454
|
+
for (const L of R)
|
|
5455
|
+
xl(L);
|
|
5456
|
+
return r ? r(R) : R;
|
|
5455
5457
|
},
|
|
5456
5458
|
[r]
|
|
5457
5459
|
);
|
|
5458
|
-
|
|
5460
|
+
y && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
5459
5461
|
renderCount: b.current,
|
|
5460
5462
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
5461
5463
|
filters: s
|
|
@@ -5464,7 +5466,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5464
5466
|
() => ({
|
|
5465
5467
|
selectedChannel: t,
|
|
5466
5468
|
onChannelSelect: e,
|
|
5467
|
-
debug:
|
|
5469
|
+
debug: y,
|
|
5468
5470
|
channelPreview: u,
|
|
5469
5471
|
renderMessagePreview: h,
|
|
5470
5472
|
viewerLanguage: m
|
|
@@ -5472,7 +5474,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5472
5474
|
[
|
|
5473
5475
|
t,
|
|
5474
5476
|
e,
|
|
5475
|
-
|
|
5477
|
+
y,
|
|
5476
5478
|
u,
|
|
5477
5479
|
h,
|
|
5478
5480
|
m
|
|
@@ -5581,7 +5583,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5581
5583
|
return /* @__PURE__ */ n("div", { className: "shrink-0 px-4 py-3", children: g ? /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-3", children: [
|
|
5582
5584
|
c,
|
|
5583
5585
|
/* @__PURE__ */ n(on, { surface: e, actions: o, layout: "row" })
|
|
5584
|
-
] }) : /* @__PURE__ */ f(
|
|
5586
|
+
] }) : /* @__PURE__ */ f(Z, { children: [
|
|
5585
5587
|
c,
|
|
5586
5588
|
/* @__PURE__ */ n(
|
|
5587
5589
|
on,
|
|
@@ -5626,7 +5628,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5626
5628
|
children: l.map(({ src: c, index: p }, w) => /* @__PURE__ */ n(
|
|
5627
5629
|
"img",
|
|
5628
5630
|
{
|
|
5629
|
-
src:
|
|
5631
|
+
src: oe(c) ?? c,
|
|
5630
5632
|
alt: "",
|
|
5631
5633
|
draggable: !1,
|
|
5632
5634
|
loading: "lazy",
|
|
@@ -5654,7 +5656,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5654
5656
|
// hero image errors, so `CardThumbnail` falls through to its placeholder.
|
|
5655
5657
|
// Do NOT `?? images[0]` here — that would re-instate the failed URL.
|
|
5656
5658
|
/* @__PURE__ */ n(
|
|
5657
|
-
|
|
5659
|
+
Te,
|
|
5658
5660
|
{
|
|
5659
5661
|
variant: e,
|
|
5660
5662
|
thumbnailUrl: r,
|
|
@@ -5678,20 +5680,20 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5678
5680
|
const h = va({
|
|
5679
5681
|
imagePresentation: i,
|
|
5680
5682
|
images: r
|
|
5681
|
-
}), m = r.length > 0, g = m && h === "hero", c =
|
|
5683
|
+
}), m = r.length > 0, g = m && h === "hero", c = Ge({
|
|
5682
5684
|
variant: e,
|
|
5683
5685
|
accentColor: d,
|
|
5684
5686
|
layout: "featured",
|
|
5685
5687
|
thumbnailUrl: g ? r[0] : void 0
|
|
5686
5688
|
}), p = u === "single" || u === "end";
|
|
5687
5689
|
return /* @__PURE__ */ n(
|
|
5688
|
-
|
|
5690
|
+
xt,
|
|
5689
5691
|
{
|
|
5690
5692
|
accentHex: c.accentHex,
|
|
5691
5693
|
side: e === "dark" ? "sender" : "receiver",
|
|
5692
5694
|
visible: p,
|
|
5693
5695
|
children: /* @__PURE__ */ f(
|
|
5694
|
-
|
|
5696
|
+
Ie,
|
|
5695
5697
|
{
|
|
5696
5698
|
variant: e,
|
|
5697
5699
|
accentHex: c.accentHex,
|
|
@@ -5832,7 +5834,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5832
5834
|
const l = xa(e);
|
|
5833
5835
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ f("div", { className: "flex gap-3 items-end", children: [
|
|
5834
5836
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
5835
|
-
|
|
5837
|
+
ye,
|
|
5836
5838
|
{
|
|
5837
5839
|
id: o || "account",
|
|
5838
5840
|
name: o || "Account",
|
|
@@ -5870,34 +5872,34 @@ export {
|
|
|
5870
5872
|
sr as E,
|
|
5871
5873
|
oo as F,
|
|
5872
5874
|
_a as G,
|
|
5873
|
-
|
|
5875
|
+
it as L,
|
|
5874
5876
|
to as M,
|
|
5875
5877
|
io as R,
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
+
ke as a,
|
|
5879
|
+
ye as b,
|
|
5878
5880
|
Cl as c,
|
|
5879
5881
|
Kn as d,
|
|
5880
5882
|
no as e,
|
|
5881
5883
|
Vl as f,
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5884
|
+
ce as g,
|
|
5885
|
+
ze as h,
|
|
5886
|
+
Ce as i,
|
|
5885
5887
|
lo as j,
|
|
5886
5888
|
eo as k,
|
|
5887
5889
|
ro as l,
|
|
5888
5890
|
ei as m,
|
|
5889
5891
|
Zr as n,
|
|
5890
|
-
|
|
5892
|
+
oe as o,
|
|
5891
5893
|
Nl as p,
|
|
5892
5894
|
Qr as q,
|
|
5893
|
-
|
|
5895
|
+
xe as r,
|
|
5894
5896
|
_n as s,
|
|
5895
5897
|
Sn as t,
|
|
5896
5898
|
Na as u,
|
|
5897
5899
|
so as v,
|
|
5898
5900
|
Da as w,
|
|
5899
5901
|
vn as x,
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
+
ut as y,
|
|
5903
|
+
mt as z
|
|
5902
5904
|
};
|
|
5903
|
-
//# sourceMappingURL=index-
|
|
5905
|
+
//# sourceMappingURL=index-CH6y1lmh.js.map
|