@linktr.ee/messaging-react 3.4.2 → 3.4.3-rc-1782553325
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-DxroYNrS.cjs → Card-9BtSxGC1.cjs} +2 -2
- package/dist/{Card-DxroYNrS.cjs.map → Card-9BtSxGC1.cjs.map} +1 -1
- package/dist/{Card-DFy_ZvFH.cjs → Card-BTPEZadJ.cjs} +2 -2
- package/dist/{Card-DFy_ZvFH.cjs.map → Card-BTPEZadJ.cjs.map} +1 -1
- package/dist/{Card-BKalDyyu.js → Card-B_tMXmN_.js} +2 -2
- package/dist/{Card-BKalDyyu.js.map → Card-B_tMXmN_.js.map} +1 -1
- package/dist/{Card-CphU_jG-.js → Card-CGjd8b1K.js} +2 -2
- package/dist/{Card-CphU_jG-.js.map → Card-CGjd8b1K.js.map} +1 -1
- package/dist/{Card-mpVcQ8-W.js → Card-CeiUwix2.js} +3 -3
- package/dist/{Card-mpVcQ8-W.js.map → Card-CeiUwix2.js.map} +1 -1
- package/dist/{Card-V-bNUxcw.cjs → Card-Rg9QOS9o.cjs} +2 -2
- package/dist/{Card-V-bNUxcw.cjs.map → Card-Rg9QOS9o.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BD7qtcso.js → LockedThumbnail-4_S1w5SO.js} +2 -2
- package/dist/{LockedThumbnail-BD7qtcso.js.map → LockedThumbnail-4_S1w5SO.js.map} +1 -1
- package/dist/{LockedThumbnail-B3W7upHs.cjs → LockedThumbnail-BIcI8zTC.cjs} +2 -2
- package/dist/{LockedThumbnail-B3W7upHs.cjs.map → LockedThumbnail-BIcI8zTC.cjs.map} +1 -1
- package/dist/{index-CjwQ2Hj3.js → index-D9JJLtJg.js} +861 -828
- package/dist/index-D9JJLtJg.js.map +1 -0
- package/dist/index-DOw3VaHR.cjs +2 -0
- package/dist/index-DOw3VaHR.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.stories.tsx +7 -5
- package/src/components/ChannelView.test.tsx +12 -0
- package/src/components/ChannelView.tsx +95 -59
- package/dist/index-CjwQ2Hj3.js.map +0 -1
- package/dist/index-tI-4cxV1.cjs +0 -2
- package/dist/index-tI-4cxV1.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import j, { createContext as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import j, { createContext as We, useContext as _e, useCallback as J, useState as F, useRef as H, useEffect as K, useId as Sn, useMemo as re, Suspense as Xe } from "react";
|
|
3
3
|
import { StreamChatService as In } from "@linktr.ee/messaging-core";
|
|
4
|
-
import { StreamChat as Tn, LinkPreviewsManager as
|
|
5
|
-
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as
|
|
6
|
-
import { StarIcon as
|
|
4
|
+
import { StreamChat as Tn, LinkPreviewsManager as Lt } from "stream-chat";
|
|
5
|
+
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as Gt, Attachment as Dn, EditMessageModal as On, MessageBlocked as Pn, MessageBouncePrompt as zn, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Dt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as Ne, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as ze, AIStates as $e, useTypingContext as rs, useAIState as is, Channel as os, WithComponents as ls, Window as cs, MessageList as ds, ChannelList as us, InfiniteScroll as ms } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ve, DotsThreeIcon as hs, SpinnerGapIcon as Ie, SignOutIcon as fs, ProhibitInsetIcon as Ot, FlagIcon as Ht, FileIcon as Yt, ImageIcon as gs, SpeakerHighIcon as ps, VideoCameraIcon as qt, FileMdIcon as bs, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as _s, FileXlsIcon as Ns, FileDocIcon as ys, FilePdfIcon as Cs, CircleNotchIcon as xe, PlayIcon as Ge, PauseIcon as ks, LinkIcon as Es, DownloadSimpleIcon as we, GiftIcon as Ss, ThumbsUpIcon as Is, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as De, ArrowUpIcon as Ms, SparkleIcon as be, ProhibitIcon as Rs, ArrowLeftIcon as Pt, CaretRightIcon as He, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
|
|
7
7
|
import y from "classnames";
|
|
8
8
|
import { MessageActions as Os, DefaultDropdownActionButton as Wt } from "stream-chat-react/experimental";
|
|
9
|
-
const Xt =
|
|
9
|
+
const Xt = We({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Xt = qe({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), Je = () => _e(Xt), Ni = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,7 +24,7 @@ const Xt = qe({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var O,
|
|
27
|
+
var O, C;
|
|
28
28
|
const l = J(
|
|
29
29
|
(k, ...S) => {
|
|
30
30
|
i && console.log(`🔥 [MessagingProvider] ${k}`, ...S);
|
|
@@ -37,36 +37,36 @@ const Xt = qe({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] = F(null), [m, g] = F(null), [u, f] = F(!1), [c,
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
40
|
+
const [o, d] = F(null), [m, g] = F(null), [u, f] = F(!1), [c, p] = F(!1), [_, x] = F(null), b = H(!1), v = H(null), M = H(s);
|
|
41
|
+
M.current = s;
|
|
42
|
+
const I = H(i);
|
|
43
|
+
I.current = i;
|
|
44
|
+
const N = H({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), z = H(0);
|
|
50
|
+
z.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: z.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
54
|
+
userChanged: N.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: N.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: N.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: N.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), N.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((O =
|
|
67
|
-
const D = a ? ((
|
|
65
|
+
const L = H(null);
|
|
66
|
+
a && ((O = L.current) == null ? void 0 : O.apiKey) !== a && (L.current = { apiKey: a, client: new Tn(a) });
|
|
67
|
+
const D = a ? ((C = L.current) == null ? void 0 : C.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
|
-
const k =
|
|
69
|
+
const k = z.current, S = M.current;
|
|
70
70
|
if (!a || !D || !S) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: k,
|
|
@@ -78,36 +78,36 @@ const Xt = qe({
|
|
|
78
78
|
renderCount: k,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
81
|
+
const P = new In({
|
|
82
82
|
...S,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
84
|
+
debug: I.current,
|
|
85
85
|
client: D
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
v.current = P, d(P), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: k,
|
|
89
|
-
serviceInstance:
|
|
89
|
+
serviceInstance: !!P
|
|
90
90
|
});
|
|
91
91
|
}, [a, D]);
|
|
92
|
-
const E =
|
|
92
|
+
const E = H(null);
|
|
93
93
|
K(() => {
|
|
94
|
-
var S,
|
|
94
|
+
var S, P;
|
|
95
95
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!o,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: b.current,
|
|
100
100
|
isConnected: u,
|
|
101
101
|
dependencies: { service: !!o, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !o || !t) {
|
|
103
103
|
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (b.current) {
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((S = E.current) == null ? void 0 : S.serviceId) === o && ((
|
|
110
|
+
if (((S = E.current) == null ? void 0 : S.serviceId) === o && ((P = E.current) == null ? void 0 : P.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,22 +115,22 @@ const Xt = qe({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
l("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
l("🚀 STARTING USER CONNECTION", { userId: t.id }), b.current = !0, p(!0), x(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const $ = await o.connectUser(t);
|
|
122
|
+
g($), f(!0), E.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: $.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch ($) {
|
|
127
|
+
const Y = $ instanceof Error ? $.message : "Connection failed";
|
|
128
|
+
x(Y), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: Y
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
p(!1), b.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
@@ -140,10 +140,10 @@ const Xt = qe({
|
|
|
140
140
|
const k = D;
|
|
141
141
|
return () => {
|
|
142
142
|
var S;
|
|
143
|
-
k && (E.current = null, (S =
|
|
143
|
+
k && (E.current = null, (S = v.current) == null || S.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [D]);
|
|
146
|
-
const
|
|
146
|
+
const R = J(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,21 +151,21 @@ const Xt = qe({
|
|
|
151
151
|
l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
154
|
+
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), p(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
157
|
const k = await o.connectUser(t);
|
|
158
|
-
g(k), f(!0),
|
|
158
|
+
g(k), f(!0), x(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
159
|
} catch (k) {
|
|
160
160
|
const S = k instanceof Error ? k.message : "Refresh failed";
|
|
161
|
-
|
|
161
|
+
x(S), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
163
|
error: S
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
p(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]),
|
|
168
|
+
}, [o, t, l]), T = j.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
@@ -179,7 +179,7 @@ const Xt = qe({
|
|
|
179
179
|
isLoading: c,
|
|
180
180
|
error: _,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: R,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
o,
|
|
@@ -188,15 +188,15 @@ const Xt = qe({
|
|
|
188
188
|
c,
|
|
189
189
|
_,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
R,
|
|
192
192
|
i,
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
196
|
+
renderCount: z.current,
|
|
197
197
|
willRenderChat: !!D,
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(Xt.Provider, { value:
|
|
198
|
+
contextValueReady: !!T
|
|
199
|
+
}), /* @__PURE__ */ n(Xt.Provider, { value: T, children: D ? /* @__PURE__ */ n(
|
|
200
200
|
An,
|
|
201
201
|
{
|
|
202
202
|
client: D,
|
|
@@ -206,7 +206,7 @@ const Xt = qe({
|
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
}, Ps = () =>
|
|
209
|
+
}, Ps = () => Je(), Kt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
211
|
const [t, s] = F(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -232,14 +232,14 @@ const Xt = qe({
|
|
|
232
232
|
function $s(e) {
|
|
233
233
|
return zs.test(e.trim());
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function zt(e, t) {
|
|
236
236
|
const s = e == null ? void 0 : e.trim();
|
|
237
237
|
return !s || t && s === t ? !1 : !$s(s);
|
|
238
238
|
}
|
|
239
239
|
function Jt(e) {
|
|
240
|
-
return
|
|
240
|
+
return zt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : zt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
241
|
}
|
|
242
|
-
const
|
|
242
|
+
const $t = [
|
|
243
243
|
"🍎",
|
|
244
244
|
// Apple
|
|
245
245
|
"🍌",
|
|
@@ -276,10 +276,10 @@ function Fs(e) {
|
|
|
276
276
|
return Math.abs(t);
|
|
277
277
|
}
|
|
278
278
|
function Bs(e) {
|
|
279
|
-
const s = Fs(e) %
|
|
280
|
-
return
|
|
279
|
+
const s = Fs(e) % $t.length;
|
|
280
|
+
return $t[s];
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const se = ({
|
|
283
283
|
id: e,
|
|
284
284
|
image: t,
|
|
285
285
|
size: s = 40,
|
|
@@ -324,7 +324,7 @@ const oe = ({
|
|
|
324
324
|
{
|
|
325
325
|
"aria-hidden": "true",
|
|
326
326
|
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)]",
|
|
327
|
-
children: /* @__PURE__ */ n(
|
|
327
|
+
children: /* @__PURE__ */ n(Ve, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
330
|
/* @__PURE__ */ n(
|
|
@@ -364,72 +364,72 @@ const oe = ({
|
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
366
|
var O;
|
|
367
|
-
const { service: u, debug: f } =
|
|
367
|
+
const { service: u, debug: f } = Je(), c = (O = t == null ? void 0 : t.user) == null ? void 0 : O.id, p = !!(a && s && u && c), [_, x] = F(!1), [b, v] = F(null), [M, I] = F(!1), [N, z] = F(!1), L = p && ((b == null ? void 0 : b.participantId) !== c || (b == null ? void 0 : b.service) !== u);
|
|
368
368
|
return K(() => {
|
|
369
|
-
if (!
|
|
370
|
-
|
|
369
|
+
if (!p || !u || !c) {
|
|
370
|
+
x(!1), v(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let C = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
376
|
const k = await u.getBlockedUsers();
|
|
377
|
-
if (
|
|
378
|
-
|
|
377
|
+
if (C) return;
|
|
378
|
+
x(
|
|
379
379
|
k.some(
|
|
380
380
|
(S) => S.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
383
|
} catch (k) {
|
|
384
|
-
|
|
384
|
+
C || console.error(`[${g}] Failed to check blocked status:`, k);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
C || v({ participantId: c, service: u });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
C = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
391
|
+
}, [p, u, c, g]), {
|
|
392
392
|
isParticipantBlocked: _,
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
395
|
-
isUpdatingBlockStatus:
|
|
393
|
+
isCheckingBlockedStatus: L,
|
|
394
|
+
isLeaving: M,
|
|
395
|
+
isUpdatingBlockStatus: N,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
398
|
-
if (!
|
|
399
|
-
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
397
|
+
var C;
|
|
398
|
+
if (!M) {
|
|
399
|
+
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), I(!0);
|
|
400
400
|
try {
|
|
401
|
-
const k = ((
|
|
401
|
+
const k = ((C = e._client) == null ? void 0 : C.userID) ?? null;
|
|
402
402
|
await e.hide(k, !1), r && await r(e), m == null || m();
|
|
403
403
|
} catch (k) {
|
|
404
404
|
console.error(`[${g}] Failed to leave conversation`, k);
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
I(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
o == null || o(), f && console.log(`[${g}] Block member`, (
|
|
411
|
+
var C, k, S;
|
|
412
|
+
if (!(N || !u)) {
|
|
413
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), z(!0);
|
|
414
414
|
try {
|
|
415
415
|
await u.blockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
416
|
+
} catch (P) {
|
|
417
|
+
console.error(`[${g}] Failed to block member`, P);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
z(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
o == null || o(), f && console.log(`[${g}] Unblock member`, (
|
|
424
|
+
var C, k, S;
|
|
425
|
+
if (!(N || !u)) {
|
|
426
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), z(!0);
|
|
427
427
|
try {
|
|
428
428
|
await u.unBlockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
429
|
+
} catch (P) {
|
|
430
|
+
console.error(`[${g}] Failed to unblock member`, P);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
z(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
@@ -437,7 +437,7 @@ const oe = ({
|
|
|
437
437
|
d == null || d(), m == null || m(), window.open(Us, "_blank", "noopener,noreferrer");
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
},
|
|
440
|
+
}, pe = ({
|
|
441
441
|
variant: e = "default",
|
|
442
442
|
className: t,
|
|
443
443
|
children: s,
|
|
@@ -454,7 +454,7 @@ const oe = ({
|
|
|
454
454
|
...a,
|
|
455
455
|
children: s
|
|
456
456
|
}
|
|
457
|
-
),
|
|
457
|
+
), Ft = ({
|
|
458
458
|
channel: e,
|
|
459
459
|
participant: t,
|
|
460
460
|
showDeleteConversation: s = !0,
|
|
@@ -468,14 +468,14 @@ const oe = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] = F(!1),
|
|
472
|
-
isParticipantBlocked:
|
|
473
|
-
isCheckingBlockedStatus:
|
|
474
|
-
isLeaving:
|
|
475
|
-
isUpdatingBlockStatus:
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
471
|
+
const [f, c] = F(!1), p = H(null), _ = Sn(), x = J(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: b,
|
|
473
|
+
isCheckingBlockedStatus: v,
|
|
474
|
+
isLeaving: M,
|
|
475
|
+
isUpdatingBlockStatus: I,
|
|
476
|
+
handleLeaveConversation: N,
|
|
477
|
+
handleBlockUser: z,
|
|
478
|
+
handleUnblockUser: L,
|
|
479
479
|
handleReportUser: D
|
|
480
480
|
} = js({
|
|
481
481
|
channel: e,
|
|
@@ -487,20 +487,20 @@ const oe = ({
|
|
|
487
487
|
onDeleteConversationClick: o,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: m,
|
|
490
|
-
onActionComplete:
|
|
490
|
+
onActionComplete: x,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
493
|
return K(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
},
|
|
495
|
+
const R = (O) => {
|
|
496
|
+
p.current && !p.current.contains(O.target) && c(!1);
|
|
497
|
+
}, T = (O) => {
|
|
498
498
|
O.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", R), document.addEventListener("keydown", T), () => {
|
|
501
|
+
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", T);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: p, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -509,7 +509,7 @@ const oe = ({
|
|
|
509
509
|
"aria-haspopup": "true",
|
|
510
510
|
"aria-expanded": f,
|
|
511
511
|
"aria-controls": f ? _ : void 0,
|
|
512
|
-
onClick: () => c((
|
|
512
|
+
onClick: () => c((R) => !R),
|
|
513
513
|
children: [
|
|
514
514
|
/* @__PURE__ */ n(hs, { className: "size-5 text-black/90" }),
|
|
515
515
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -527,48 +527,48 @@ const oe = ({
|
|
|
527
527
|
),
|
|
528
528
|
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
|
-
|
|
530
|
+
pe,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
532
|
+
onClick: N,
|
|
533
|
+
disabled: M,
|
|
534
|
+
"aria-busy": M,
|
|
535
535
|
children: [
|
|
536
|
-
|
|
536
|
+
M ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(fs, { className: "h-5 w-5" }),
|
|
537
537
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
538
|
]
|
|
539
539
|
}
|
|
540
540
|
) }),
|
|
541
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
541
|
+
a && /* @__PURE__ */ n("li", { children: v ? (
|
|
542
542
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
543
|
// so a premature click can't act on a stale block state.
|
|
544
|
-
/* @__PURE__ */ h(
|
|
545
|
-
/* @__PURE__ */ n(
|
|
544
|
+
/* @__PURE__ */ h(pe, { disabled: !0, "aria-busy": !0, children: [
|
|
545
|
+
/* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
549
|
-
|
|
548
|
+
) : b ? /* @__PURE__ */ h(
|
|
549
|
+
pe,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
551
|
+
onClick: L,
|
|
552
|
+
disabled: I,
|
|
553
|
+
"aria-busy": I,
|
|
554
554
|
children: [
|
|
555
|
-
|
|
555
|
+
I ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Ot, { className: "h-5 w-5" }),
|
|
556
556
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
557
|
]
|
|
558
558
|
}
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
|
-
|
|
560
|
+
pe,
|
|
561
561
|
{
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
562
|
+
onClick: z,
|
|
563
|
+
disabled: I,
|
|
564
|
+
"aria-busy": I,
|
|
565
565
|
children: [
|
|
566
|
-
|
|
566
|
+
I ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Ot, { className: "h-5 w-5" }),
|
|
567
567
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
571
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(pe, { variant: "danger", onClick: D, children: [
|
|
572
572
|
/* @__PURE__ */ n(Ht, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
@@ -577,20 +577,20 @@ const oe = ({
|
|
|
577
577
|
}
|
|
578
578
|
)
|
|
579
579
|
] });
|
|
580
|
-
}, Vs = (e) => /* @__PURE__ */ n(Mn, { ...e, position: "center" }),
|
|
580
|
+
}, Vs = (e) => /* @__PURE__ */ n(Mn, { ...e, position: "center" }), Ye = "vote_up", qe = "vote_down";
|
|
581
581
|
function Gs(e) {
|
|
582
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
582
|
+
return e != null && e.length ? e.some((t) => t.type === qe) ? "down" : e.some((t) => t.type === Ye) ? "up" : null : null;
|
|
583
583
|
}
|
|
584
584
|
function Hs(e) {
|
|
585
|
-
const { channel: t } = de(), { client: s } =
|
|
585
|
+
const { channel: t } = de(), { client: s } = Ke("useMessageVote"), a = re(
|
|
586
586
|
() => Gs(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
588
|
), r = J(async () => {
|
|
589
589
|
if (s != null && s.userID)
|
|
590
590
|
try {
|
|
591
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
591
|
+
a === "up" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
|
|
592
592
|
e.id,
|
|
593
|
-
{ type:
|
|
593
|
+
{ type: Ye },
|
|
594
594
|
{ enforce_unique: !0, skip_push: !0 }
|
|
595
595
|
);
|
|
596
596
|
} catch {
|
|
@@ -598,9 +598,9 @@ function Hs(e) {
|
|
|
598
598
|
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = J(async () => {
|
|
599
599
|
if (s != null && s.userID)
|
|
600
600
|
try {
|
|
601
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
601
|
+
a === "down" ? await t.deleteReaction(e.id, qe) : await t.sendReaction(
|
|
602
602
|
e.id,
|
|
603
|
-
{ type:
|
|
603
|
+
{ type: qe },
|
|
604
604
|
{ enforce_unique: !0, skip_push: !0 }
|
|
605
605
|
);
|
|
606
606
|
} catch {
|
|
@@ -619,13 +619,13 @@ function Zt({
|
|
|
619
619
|
const s = e == null ? void 0 : e.text, a = Ys(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const qs = j.lazy(() => import("./Card-
|
|
622
|
+
const qs = j.lazy(() => import("./Card-CGjd8b1K.js")), Ws = j.lazy(() => import("./Card-B_tMXmN_.js")), Xs = j.lazy(() => import("./Card-CeiUwix2.js")), Ze = () => /* @__PURE__ */ n(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
626
626
|
"aria-hidden": !0
|
|
627
627
|
}
|
|
628
|
-
), Ks = (e) => /* @__PURE__ */ n(
|
|
628
|
+
), Ks = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Qt = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Ws, { ...e }) }), en = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Js = Qt, Zs = en, Bt = { Composer: Ks, Sent: Qt, Received: en, Creator: Js, Visitor: Zs }, Qs = [
|
|
629
629
|
[/pdf/, "pdf"],
|
|
630
630
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
631
631
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -635,7 +635,7 @@ const qs = j.lazy(() => import("./Card-CphU_jG-.js")), Ws = j.lazy(() => import(
|
|
|
635
635
|
[/plain|rtf/, "text"],
|
|
636
636
|
[/markdown/, "markdown"]
|
|
637
637
|
];
|
|
638
|
-
function
|
|
638
|
+
function ie(e) {
|
|
639
639
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
640
|
}
|
|
641
641
|
function tn(e) {
|
|
@@ -646,7 +646,7 @@ function tn(e) {
|
|
|
646
646
|
}
|
|
647
647
|
const ea = {
|
|
648
648
|
video: qt,
|
|
649
|
-
audio:
|
|
649
|
+
audio: ps,
|
|
650
650
|
image: gs,
|
|
651
651
|
document: Yt
|
|
652
652
|
}, ta = {
|
|
@@ -657,11 +657,11 @@ const ea = {
|
|
|
657
657
|
ppt: ws,
|
|
658
658
|
zip: xs,
|
|
659
659
|
text: vs,
|
|
660
|
-
markdown:
|
|
660
|
+
markdown: bs,
|
|
661
661
|
generic: Yt
|
|
662
662
|
};
|
|
663
663
|
function na(e) {
|
|
664
|
-
const t =
|
|
664
|
+
const t = ie(e);
|
|
665
665
|
return t !== "document" ? ea[t] : ta[tn(e)];
|
|
666
666
|
}
|
|
667
667
|
function ce(e, t) {
|
|
@@ -682,78 +682,78 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const g =
|
|
686
|
-
D(!1),
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const U =
|
|
685
|
+
const g = ie(t), u = H(null), f = H(null), c = H(null), p = H(r), [_, x] = F(a), [b, v] = F(0), [M, I] = F(!1), [N, z] = F(!1), [L, D] = F(!1), [E, R] = F(!1), [T, O] = F(!0), [C, k] = F(null), S = J(() => {
|
|
686
|
+
D(!1), x(!0);
|
|
687
|
+
}, []), P = J((w) => {
|
|
688
|
+
const A = f.current;
|
|
689
|
+
if (!A) return 0;
|
|
690
|
+
const U = A.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (sa(
|
|
693
|
+
Math.min(1, (sa(w) - U.left) / U.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
|
|
695
|
+
}, []), $ = J((w) => {
|
|
696
|
+
const A = u.current;
|
|
697
|
+
A && A.duration && (A.currentTime = w * A.duration);
|
|
698
|
+
}, []), Y = (w) => {
|
|
699
|
+
w.stopPropagation(), I(!0);
|
|
700
|
+
const A = P(w);
|
|
701
|
+
v(A), $(A);
|
|
702
702
|
};
|
|
703
703
|
K(() => {
|
|
704
|
-
r !== void 0 && r !==
|
|
704
|
+
r !== void 0 && r !== p.current && (p.current = r, x(r));
|
|
705
705
|
}, [r]), K(() => {
|
|
706
706
|
if (!_) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
711
|
-
const
|
|
712
|
-
|
|
710
|
+
const w = () => {
|
|
711
|
+
const A = u.current;
|
|
712
|
+
A && A.duration && !M && v(A.currentTime / A.duration), c.current = requestAnimationFrame(w);
|
|
713
713
|
};
|
|
714
|
-
return c.current = requestAnimationFrame(
|
|
714
|
+
return c.current = requestAnimationFrame(w), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [_,
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}) :
|
|
717
|
+
}, [_, M]), K(() => {
|
|
718
|
+
const w = u.current;
|
|
719
|
+
w && (_ ? w.play().catch((A) => {
|
|
720
|
+
x(!1), D(!0);
|
|
721
|
+
}) : w.pause());
|
|
722
722
|
}, [_]), K(() => {
|
|
723
|
-
if (!
|
|
724
|
-
const
|
|
725
|
-
|
|
723
|
+
if (!M) return;
|
|
724
|
+
const w = (U) => v(P(U)), A = (U) => {
|
|
725
|
+
I(!1), $(P(U));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
727
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", A), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", A), () => {
|
|
728
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", A), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", A);
|
|
729
729
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
730
|
+
}, [M, P, $]);
|
|
731
|
+
const Q = C ? { aspectRatio: String(C) } : void 0, Z = C ? "" : " aspect-video", V = Math.round(b * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
739
|
-
onClick: (
|
|
737
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
|
|
738
|
+
style: Q,
|
|
739
|
+
onClick: (w) => {
|
|
740
740
|
if (m) {
|
|
741
|
-
m(
|
|
741
|
+
m(w);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
L || l && x((A) => !A);
|
|
745
745
|
},
|
|
746
|
-
onKeyDown: (
|
|
747
|
-
if (!(
|
|
748
|
-
if (
|
|
749
|
-
m(
|
|
746
|
+
onKeyDown: (w) => {
|
|
747
|
+
if (!(w.key !== "Enter" && w.key !== " ")) {
|
|
748
|
+
if (w.preventDefault(), m) {
|
|
749
|
+
m(w);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
L || l && x((A) => !A);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || T) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,7 +761,7 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
764
|
+
!s && (g === "audio" || T) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
@@ -773,14 +773,14 @@ const sa = (e) => {
|
|
|
773
773
|
loop: i,
|
|
774
774
|
muted: d,
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
776
|
+
onLoadStart: () => R(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
R(!1), O(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
780
|
+
onWaiting: () => R(!0),
|
|
781
781
|
onPlay: () => D(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
783
|
+
i || (x(!1), v(0));
|
|
784
784
|
},
|
|
785
785
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
786
|
}
|
|
@@ -793,43 +793,43 @@ const sa = (e) => {
|
|
|
793
793
|
muted: d,
|
|
794
794
|
playsInline: !0,
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
796
|
+
onLoadStart: () => R(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
R(!1), O(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
800
|
+
onWaiting: () => R(!0),
|
|
801
801
|
onPlay: () => D(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const w = u.current;
|
|
804
|
+
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && k(w.videoWidth / w.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
807
|
+
i || (x(!1), v(0));
|
|
808
808
|
},
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
E && !
|
|
813
|
-
|
|
812
|
+
E && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
|
+
xe,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
L && !l && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
823
823
|
role: "button",
|
|
824
824
|
tabIndex: 0,
|
|
825
825
|
"aria-label": "Play preview",
|
|
826
|
-
onClick: (
|
|
827
|
-
|
|
826
|
+
onClick: (w) => {
|
|
827
|
+
w.stopPropagation(), S();
|
|
828
828
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
829
|
+
onKeyDown: (w) => {
|
|
830
|
+
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), S());
|
|
831
831
|
},
|
|
832
|
-
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(
|
|
832
|
+
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Ge, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
835
|
o && !l && /* @__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(
|
|
@@ -837,23 +837,23 @@ const sa = (e) => {
|
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
839
839
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
840
|
+
"aria-valuenow": V,
|
|
841
841
|
"aria-valuemin": 0,
|
|
842
842
|
"aria-valuemax": 100,
|
|
843
843
|
tabIndex: 0,
|
|
844
844
|
ref: f,
|
|
845
845
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
848
|
-
onClick: (
|
|
849
|
-
onKeyDown: (
|
|
850
|
-
|
|
846
|
+
onMouseDown: Y,
|
|
847
|
+
onTouchStart: Y,
|
|
848
|
+
onClick: (w) => w.stopPropagation(),
|
|
849
|
+
onKeyDown: (w) => {
|
|
850
|
+
w.key === "ArrowRight" && $(Math.min(1, b + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, b - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
854
854
|
{
|
|
855
855
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
856
|
+
style: { width: `${V}%` }
|
|
857
857
|
}
|
|
858
858
|
) })
|
|
859
859
|
}
|
|
@@ -863,12 +863,12 @@ const sa = (e) => {
|
|
|
863
863
|
"button",
|
|
864
864
|
{
|
|
865
865
|
type: "button",
|
|
866
|
-
onClick: (
|
|
867
|
-
|
|
866
|
+
onClick: (w) => {
|
|
867
|
+
w.stopPropagation(), x((A) => !A);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
870
|
"aria-label": _ ? "Pause" : "Play",
|
|
871
|
-
children: _ ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(
|
|
871
|
+
children: _ ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ge, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -876,30 +876,30 @@ const sa = (e) => {
|
|
|
876
876
|
{
|
|
877
877
|
role: "slider",
|
|
878
878
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
879
|
+
"aria-valuenow": V,
|
|
880
880
|
"aria-valuemin": 0,
|
|
881
881
|
"aria-valuemax": 100,
|
|
882
882
|
tabIndex: 0,
|
|
883
883
|
ref: f,
|
|
884
884
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
887
|
-
onClick: (
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
885
|
+
onMouseDown: Y,
|
|
886
|
+
onTouchStart: Y,
|
|
887
|
+
onClick: (w) => w.stopPropagation(),
|
|
888
|
+
onMouseEnter: () => z(!0),
|
|
889
|
+
onMouseLeave: () => z(!1),
|
|
890
|
+
onKeyDown: (w) => {
|
|
891
|
+
w.key === "ArrowRight" && $(Math.min(1, b + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, b - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
897
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${N || M ? "h-1.5" : "h-1"}`,
|
|
898
898
|
children: /* @__PURE__ */ n(
|
|
899
899
|
"div",
|
|
900
900
|
{
|
|
901
901
|
className: "h-full rounded-full bg-white",
|
|
902
|
-
style: { width: `${
|
|
902
|
+
style: { width: `${V}%` }
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
}
|
|
@@ -907,8 +907,8 @@ const sa = (e) => {
|
|
|
907
907
|
/* @__PURE__ */ n(
|
|
908
908
|
"div",
|
|
909
909
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
911
|
-
style: { left: `${
|
|
910
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${N || M ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${V}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
]
|
|
@@ -918,7 +918,7 @@ const sa = (e) => {
|
|
|
918
918
|
]
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
|
-
},
|
|
921
|
+
}, Ut = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ra = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", nn = ({
|
|
922
922
|
mimeType: e,
|
|
923
923
|
sourceUrl: t,
|
|
924
924
|
thumbnailUrl: s,
|
|
@@ -927,7 +927,7 @@ const sa = (e) => {
|
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
928
|
containedImage: l = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const o =
|
|
930
|
+
const o = ie(e), [d, m] = F(!1);
|
|
931
931
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
932
932
|
aa,
|
|
933
933
|
{
|
|
@@ -976,7 +976,7 @@ const sa = (e) => {
|
|
|
976
976
|
{
|
|
977
977
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
978
|
children: ce(e, {
|
|
979
|
-
className:
|
|
979
|
+
className: Ut(r),
|
|
980
980
|
weight: "regular"
|
|
981
981
|
})
|
|
982
982
|
}
|
|
@@ -993,7 +993,7 @@ const sa = (e) => {
|
|
|
993
993
|
{
|
|
994
994
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
995
|
children: ce(e, {
|
|
996
|
-
className:
|
|
996
|
+
className: Ut(r),
|
|
997
997
|
weight: "regular"
|
|
998
998
|
})
|
|
999
999
|
}
|
|
@@ -1012,7 +1012,7 @@ const sa = (e) => {
|
|
|
1012
1012
|
rootRef: g,
|
|
1013
1013
|
"data-testid": u
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1015
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", p = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
@@ -1032,8 +1032,8 @@ const sa = (e) => {
|
|
|
1032
1032
|
{
|
|
1033
1033
|
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1035
|
+
"text-white/30": f && p,
|
|
1036
|
+
"text-white": f && !p
|
|
1037
1037
|
}),
|
|
1038
1038
|
children: c
|
|
1039
1039
|
}
|
|
@@ -1067,7 +1067,7 @@ const sa = (e) => {
|
|
|
1067
1067
|
function an(e) {
|
|
1068
1068
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Qe(e) {
|
|
1071
1071
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1072
1072
|
}
|
|
1073
1073
|
function ia(e) {
|
|
@@ -1085,7 +1085,7 @@ function ca(e) {
|
|
|
1085
1085
|
function da(e) {
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1088
|
+
const et = ({ attachment: e, isMyMessage: t }) => {
|
|
1089
1089
|
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, m = /* @__PURE__ */ h(j.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
@@ -1112,7 +1112,7 @@ const Qe = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1112
1112
|
function rn(e) {
|
|
1113
1113
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function tt(e) {
|
|
1116
1116
|
var t;
|
|
1117
1117
|
return (t = e.attachments) == null ? void 0 : t.find(rn);
|
|
1118
1118
|
}
|
|
@@ -1148,22 +1148,22 @@ const ma = ({
|
|
|
1148
1148
|
},
|
|
1149
1149
|
disabled: s,
|
|
1150
1150
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1151
|
-
children: s ? /* @__PURE__ */ n(
|
|
1152
|
-
/* @__PURE__ */ n(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(xe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ n(we, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
|
-
function
|
|
1159
|
-
var u, f, c,
|
|
1158
|
+
function nt(e) {
|
|
1159
|
+
var u, f, c, p;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
1161
|
(_) => _.type === "video" && _.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
1163
|
(_) => _.type === "image" && _.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
1165
|
(_) => _.type === "audio" && _.asset_url
|
|
1166
|
-
), r = (
|
|
1166
|
+
), r = (p = e.attachments) == null ? void 0 : p.find(
|
|
1167
1167
|
(_) => _.type === "file" && _.asset_url
|
|
1168
1168
|
), i = t ?? s ?? a ?? r, l = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1169
|
if (!l) return null;
|
|
@@ -1211,7 +1211,7 @@ const on = ({
|
|
|
1211
1211
|
fileSize: a,
|
|
1212
1212
|
thumbnailUrl: r
|
|
1213
1213
|
}) => {
|
|
1214
|
-
const i =
|
|
1214
|
+
const i = ie(t), l = a !== void 0 ? an(a) : void 0;
|
|
1215
1215
|
return /* @__PURE__ */ n(
|
|
1216
1216
|
sn,
|
|
1217
1217
|
{
|
|
@@ -1237,10 +1237,10 @@ const on = ({
|
|
|
1237
1237
|
message: e,
|
|
1238
1238
|
isMyMessage: t = !1
|
|
1239
1239
|
}) => {
|
|
1240
|
-
const s =
|
|
1240
|
+
const s = tt(e), a = nt(e);
|
|
1241
1241
|
return !s && !a ? null : /* @__PURE__ */ h("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", children: [
|
|
1242
1242
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
|
-
|
|
1243
|
+
se,
|
|
1244
1244
|
{
|
|
1245
1245
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1246
1246
|
id: e.user.id,
|
|
@@ -1258,7 +1258,7 @@ const on = ({
|
|
|
1258
1258
|
{
|
|
1259
1259
|
className: "str-chat__message-bubble",
|
|
1260
1260
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1261
|
+
children: s ? /* @__PURE__ */ n("div", { className: Qe(t), children: /* @__PURE__ */ n(et, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(on, { ...a }) : /* @__PURE__ */ n(ln, { ...a })
|
|
1262
1262
|
}
|
|
1263
1263
|
) })
|
|
1264
1264
|
}
|
|
@@ -1267,29 +1267,29 @@ const on = ({
|
|
|
1267
1267
|
}, fa = ({
|
|
1268
1268
|
message: e
|
|
1269
1269
|
}) => {
|
|
1270
|
-
const t =
|
|
1270
|
+
const t = tt(e);
|
|
1271
1271
|
if (t)
|
|
1272
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1273
|
-
const s =
|
|
1272
|
+
return /* @__PURE__ */ n("div", { className: Qe(!0), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !0 }) });
|
|
1273
|
+
const s = nt(e);
|
|
1274
1274
|
return s ? /* @__PURE__ */ n(on, { ...s }) : null;
|
|
1275
1275
|
}, ga = ({
|
|
1276
1276
|
message: e
|
|
1277
1277
|
}) => {
|
|
1278
|
-
const t =
|
|
1278
|
+
const t = tt(e);
|
|
1279
1279
|
if (t)
|
|
1280
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1281
|
-
const s =
|
|
1280
|
+
return /* @__PURE__ */ n("div", { className: Qe(!1), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !1 }) });
|
|
1281
|
+
const s = nt(e);
|
|
1282
1282
|
return s ? /* @__PURE__ */ n(ln, { ...s }) : null;
|
|
1283
1283
|
}, yi = Object.assign(ha, {
|
|
1284
1284
|
Creator: fa,
|
|
1285
1285
|
Visitor: ga
|
|
1286
|
-
}),
|
|
1286
|
+
}), pa = {
|
|
1287
1287
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1290
|
-
}, cn =
|
|
1288
|
+
}, ba = {
|
|
1289
|
+
LockedAttachment: pa
|
|
1290
|
+
}, cn = We({}), Ci = cn.Provider;
|
|
1291
1291
|
function va(e) {
|
|
1292
|
-
return
|
|
1292
|
+
return _e(cn)[e] ?? ba[e];
|
|
1293
1293
|
}
|
|
1294
1294
|
const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1295
|
"svg",
|
|
@@ -1314,7 +1314,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1314
1314
|
}, _a = (e) => {
|
|
1315
1315
|
var t;
|
|
1316
1316
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1317
|
-
},
|
|
1317
|
+
}, Ae = (e) => {
|
|
1318
1318
|
var t;
|
|
1319
1319
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1320
1320
|
}, Na = (e) => {
|
|
@@ -1323,23 +1323,23 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1323
1323
|
}, dn = (e) => wa(e) || _a(e), ya = (e) => {
|
|
1324
1324
|
var t;
|
|
1325
1325
|
return dn(e) && !((t = e.text) != null && t.trim());
|
|
1326
|
-
},
|
|
1326
|
+
}, Fe = ({
|
|
1327
1327
|
message: e,
|
|
1328
1328
|
standalone: t = !1,
|
|
1329
1329
|
isMyMessage: s = !1,
|
|
1330
1330
|
hasAttachment: a = !1
|
|
1331
1331
|
}) => {
|
|
1332
1332
|
var u;
|
|
1333
|
-
const r = dn(e), i =
|
|
1333
|
+
const r = dn(e), i = Ae(e);
|
|
1334
1334
|
if (!r && !i)
|
|
1335
1335
|
return null;
|
|
1336
1336
|
if (r) {
|
|
1337
1337
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1338
1338
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1339
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", p = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
1341
|
/* @__PURE__ */ n(Ss, { size: t ? 14 : 12 }),
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: p })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
1345
|
const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
@@ -1347,10 +1347,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1347
1347
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1348
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
1349
|
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(xa, { size: l ? 12 : 15 }) });
|
|
1350
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(
|
|
1350
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(te, { children: [
|
|
1351
1351
|
m,
|
|
1352
1352
|
g
|
|
1353
|
-
] }) : /* @__PURE__ */ h(
|
|
1353
|
+
] }) : /* @__PURE__ */ h(te, { children: [
|
|
1354
1354
|
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
@@ -1388,7 +1388,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
1390
|
] }), ka = (e) => {
|
|
1391
|
-
var bt,
|
|
1391
|
+
var bt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St, It, Tt, At;
|
|
1392
1392
|
const {
|
|
1393
1393
|
additionalMessageInputProps: t,
|
|
1394
1394
|
chatbotVotingEnabled: s,
|
|
@@ -1403,85 +1403,85 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1403
1403
|
isMessageAIGenerated: u,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1406
|
+
renderText: p,
|
|
1407
1407
|
threadList: _,
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1408
|
+
viewerLanguage: x
|
|
1409
|
+
} = e, { client: b } = Ke("CustomMessage"), { channel: v } = de("CustomMessage"), { isUnlocking: M, onUnlockClick: I, onFetchSource: N, onDownloadClick: z } = va("LockedAttachment"), [L, D] = F(!1), E = Ln(c.id), { selected: R, voteUp: T, voteDown: O } = Hs(c), {
|
|
1410
|
+
Attachment: C = Dn,
|
|
1411
1411
|
EditMessageModal: k = On,
|
|
1412
1412
|
MessageActions: S,
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} = Gt("CustomMessage"), U = Vn(c),
|
|
1413
|
+
MessageBlocked: P = Pn,
|
|
1414
|
+
MessageBouncePrompt: $ = zn,
|
|
1415
|
+
MessageDeleted: Y = $n,
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = Fn,
|
|
1417
|
+
MessageRepliesCountButton: Z = Bn,
|
|
1418
|
+
ReminderNotification: V = Un,
|
|
1419
|
+
StreamedMessageText: w = jn,
|
|
1420
|
+
PinIndicator: A
|
|
1421
|
+
} = Gt("CustomMessage"), U = Vn(c), G = Gn(c), q = re(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
|
-
), B =
|
|
1425
|
-
const ge = c.attachments ?? [],
|
|
1426
|
-
if (!
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1429
|
-
}, [c]), W =
|
|
1430
|
-
const ge = Zt({ message: c, viewerLanguage:
|
|
1424
|
+
), B = re(() => {
|
|
1425
|
+
const ge = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...ge] : ge;
|
|
1426
|
+
if (!Ae(c)) return Se;
|
|
1427
|
+
const Mt = Se.filter((Rt) => !("type" in Rt) || !rn(Rt));
|
|
1428
|
+
return Mt.length === Se.length ? Se : Mt;
|
|
1429
|
+
}, [c]), W = re(() => {
|
|
1430
|
+
const ge = Zt({ message: c, viewerLanguage: x });
|
|
1431
1431
|
return ge === c.text ? c : { ...c, text: ge };
|
|
1432
|
-
}, [c,
|
|
1432
|
+
}, [c, x]);
|
|
1433
1433
|
if (Hn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1436
|
+
return /* @__PURE__ */ n(Y, { message: c });
|
|
1437
1437
|
if (Yn(c))
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1438
|
+
return /* @__PURE__ */ n(P, {});
|
|
1439
1439
|
const X = !_ && !!c.reply_count, ue = !_ && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((bt = c.error) == null ? void 0 : bt.status) !== 403, he = qn(c);
|
|
1440
|
-
let
|
|
1441
|
-
me ?
|
|
1442
|
-
const
|
|
1440
|
+
let ee;
|
|
1441
|
+
me ? ee = () => m(c) : he && (ee = () => D(!0));
|
|
1442
|
+
const ne = f(), oe = y(
|
|
1443
1443
|
"str-chat__message str-chat__message-simple",
|
|
1444
1444
|
`str-chat__message--${c.type}`,
|
|
1445
1445
|
`str-chat__message--${c.status}`,
|
|
1446
|
-
|
|
1446
|
+
ne ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1447
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1448
|
{
|
|
1449
1449
|
"str-chat__message--has-attachment": U,
|
|
1450
1450
|
"str-chat__message--highlighted": g,
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1453
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1452
|
+
"str-chat__message--with-reactions": G,
|
|
1453
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((vt = c == null ? void 0 : c.error) == null ? void 0 : vt.status) !== 403,
|
|
1454
1454
|
"str-chat__message-with-thread-link": X || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1457
|
"str-chat__virtual-message__wrapper--group": l
|
|
1458
1458
|
}
|
|
1459
|
-
),
|
|
1460
|
-
return /* @__PURE__ */ h(
|
|
1459
|
+
), ht = c.poll_id && b.polls.fromState(c.poll_id), ft = ya(c), fe = Ae(c), gt = Na(c), Pe = !!(B != null && B.length && !c.quoted_message), pt = fe && ne && Pe;
|
|
1460
|
+
return /* @__PURE__ */ h(te, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
1462
|
k,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1467
|
+
L && /* @__PURE__ */ n(
|
|
1468
1468
|
Wn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1470
|
+
MessageBouncePrompt: $,
|
|
1471
1471
|
onClose: () => D(!1),
|
|
1472
|
-
open:
|
|
1472
|
+
open: L
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
1476
1476
|
"div",
|
|
1477
1477
|
{
|
|
1478
|
-
className:
|
|
1478
|
+
className: oe,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
1480
|
children: [
|
|
1481
|
-
|
|
1482
|
-
!!E && /* @__PURE__ */ n(
|
|
1481
|
+
A && /* @__PURE__ */ n(A, {}),
|
|
1482
|
+
!!E && /* @__PURE__ */ n(V, { reminder: E }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
|
-
|
|
1484
|
+
se,
|
|
1485
1485
|
{
|
|
1486
1486
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1487
1487
|
id: c.user.id,
|
|
@@ -1499,120 +1499,120 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1499
1499
|
"str-chat__simple-message--error-failed": me || he
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
1502
|
-
onClick:
|
|
1503
|
-
onKeyDown:
|
|
1504
|
-
role:
|
|
1505
|
-
tabIndex:
|
|
1502
|
+
onClick: ee,
|
|
1503
|
+
onKeyDown: ee,
|
|
1504
|
+
role: ee ? "button" : void 0,
|
|
1505
|
+
tabIndex: ee ? 0 : void 0,
|
|
1506
1506
|
style: {
|
|
1507
1507
|
// Force margins to 0 to prevent hover layout shift
|
|
1508
1508
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1509
1509
|
marginInlineEnd: 0,
|
|
1510
1510
|
marginInlineStart: 0
|
|
1511
1511
|
},
|
|
1512
|
-
children:
|
|
1513
|
-
|
|
1512
|
+
children: gt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
|
+
ne ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
1514
|
S && /* @__PURE__ */ n(S, {}),
|
|
1515
1515
|
/* @__PURE__ */ n(
|
|
1516
|
-
|
|
1516
|
+
Bt.Sent,
|
|
1517
1517
|
{
|
|
1518
|
-
title: (
|
|
1519
|
-
mimeType: (
|
|
1520
|
-
thumbnailUrl: (
|
|
1521
|
-
amountText: (
|
|
1522
|
-
detail: (
|
|
1523
|
-
paymentStatus: (
|
|
1524
|
-
onPreviewClick: () =>
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1518
|
+
title: (xt = c.metadata) == null ? void 0 : xt.attachment_title,
|
|
1519
|
+
mimeType: (wt = c.metadata) == null ? void 0 : wt.attachment_mime_type,
|
|
1520
|
+
thumbnailUrl: (_t = c.metadata) == null ? void 0 : _t.attachment_thumbnail,
|
|
1521
|
+
amountText: (Nt = c.metadata) == null ? void 0 : Nt.amount_text,
|
|
1522
|
+
detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
|
|
1523
|
+
paymentStatus: (Ct = c.metadata) == null ? void 0 : Ct.payment_status,
|
|
1524
|
+
onPreviewClick: () => I == null ? void 0 : I(c, v),
|
|
1525
|
+
onFetchSource: async () => await (N == null ? void 0 : N(c, v))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1529
1529
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1530
|
+
Bt.Received,
|
|
1531
1531
|
{
|
|
1532
|
-
title: (
|
|
1533
|
-
mimeType: (
|
|
1534
|
-
thumbnailUrl: (
|
|
1535
|
-
amountText: (
|
|
1536
|
-
detail: (
|
|
1537
|
-
paymentStatus: (
|
|
1538
|
-
isUnlocking:
|
|
1539
|
-
onUnlockClick: () =>
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1541
|
-
onDownloadClick: () =>
|
|
1532
|
+
title: (kt = c.metadata) == null ? void 0 : kt.attachment_title,
|
|
1533
|
+
mimeType: (Et = c.metadata) == null ? void 0 : Et.attachment_mime_type,
|
|
1534
|
+
thumbnailUrl: (St = c.metadata) == null ? void 0 : St.attachment_thumbnail,
|
|
1535
|
+
amountText: (It = c.metadata) == null ? void 0 : It.amount_text,
|
|
1536
|
+
detail: (Tt = c.metadata) == null ? void 0 : Tt.attachment_detail,
|
|
1537
|
+
paymentStatus: (At = c.metadata) == null ? void 0 : At.payment_status,
|
|
1538
|
+
isUnlocking: M(c.id),
|
|
1539
|
+
onUnlockClick: () => I == null ? void 0 : I(c, v),
|
|
1540
|
+
onFetchSource: async () => await (N == null ? void 0 : N(c, v)),
|
|
1541
|
+
onDownloadClick: () => z == null ? void 0 : z(c, v)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
1544
|
S && /* @__PURE__ */ n(S, {})
|
|
1545
1545
|
] }),
|
|
1546
1546
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
|
-
|
|
1547
|
+
Dt,
|
|
1548
1548
|
{
|
|
1549
1549
|
message: W,
|
|
1550
|
-
renderText:
|
|
1550
|
+
renderText: p
|
|
1551
1551
|
}
|
|
1552
1552
|
) })
|
|
1553
|
-
] }) :
|
|
1553
|
+
] }) : ft ? (
|
|
1554
1554
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
|
-
/* @__PURE__ */ n(
|
|
1555
|
+
/* @__PURE__ */ n(Fe, { message: c, standalone: !0 })
|
|
1556
1556
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1557
|
-
fe && !
|
|
1558
|
-
|
|
1557
|
+
fe && !pt && /* @__PURE__ */ n(
|
|
1558
|
+
Fe,
|
|
1559
1559
|
{
|
|
1560
1560
|
message: c,
|
|
1561
|
-
hasAttachment:
|
|
1562
|
-
isMyMessage:
|
|
1561
|
+
hasAttachment: Pe,
|
|
1562
|
+
isMyMessage: ne
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
|
-
|
|
1565
|
+
ht && /* @__PURE__ */ n(Xn, { poll: ht }),
|
|
1566
1566
|
B != null && B.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
|
-
|
|
1567
|
+
C,
|
|
1568
1568
|
{
|
|
1569
1569
|
actionHandler: o,
|
|
1570
1570
|
attachments: B
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
1573
|
q ? /* @__PURE__ */ n(
|
|
1574
|
-
|
|
1574
|
+
w,
|
|
1575
1575
|
{
|
|
1576
1576
|
message: W,
|
|
1577
|
-
renderText:
|
|
1577
|
+
renderText: p
|
|
1578
1578
|
}
|
|
1579
1579
|
) : /* @__PURE__ */ n(
|
|
1580
|
-
|
|
1580
|
+
Dt,
|
|
1581
1581
|
{
|
|
1582
1582
|
message: W,
|
|
1583
|
-
renderText:
|
|
1583
|
+
renderText: p
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
1586
|
/* @__PURE__ */ n(Kn, {})
|
|
1587
1587
|
] }) })
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
|
-
!
|
|
1591
|
-
(!fe ||
|
|
1592
|
-
|
|
1590
|
+
!gt && !ft && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
+
(!fe || pt) && /* @__PURE__ */ n(
|
|
1592
|
+
Fe,
|
|
1593
1593
|
{
|
|
1594
1594
|
message: c,
|
|
1595
|
-
hasAttachment:
|
|
1596
|
-
isMyMessage:
|
|
1595
|
+
hasAttachment: Pe,
|
|
1596
|
+
isMyMessage: ne
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
1599
|
s && fe && /* @__PURE__ */ n(
|
|
1600
1600
|
Ca,
|
|
1601
1601
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1602
|
+
selected: R,
|
|
1603
|
+
onVoteUp: T,
|
|
1604
1604
|
onVoteDown: O
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
1608
1608
|
X && /* @__PURE__ */ n(
|
|
1609
|
-
|
|
1609
|
+
Z,
|
|
1610
1610
|
{
|
|
1611
1611
|
onClick: d,
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
ue && /* @__PURE__ */ n(
|
|
1615
|
+
ue && /* @__PURE__ */ n(Q, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
@@ -1622,11 +1622,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1622
1622
|
ka,
|
|
1623
1623
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Rn(e, t)
|
|
1624
1624
|
), Sa = (e) => {
|
|
1625
|
-
const t =
|
|
1625
|
+
const t = Ne("CustomMessage");
|
|
1626
1626
|
return /* @__PURE__ */ n(Ea, { ...t, ...e });
|
|
1627
1627
|
}, Ia = () => {
|
|
1628
1628
|
var s;
|
|
1629
|
-
const { handleDelete: e, message: t } =
|
|
1629
|
+
const { handleDelete: e, message: t } = Ne("CustomMessageActions");
|
|
1630
1630
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
1631
|
Wt,
|
|
1632
1632
|
{
|
|
@@ -1638,7 +1638,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1638
1638
|
}
|
|
1639
1639
|
);
|
|
1640
1640
|
}, Ta = () => {
|
|
1641
|
-
const { handleFlag: e } =
|
|
1641
|
+
const { handleFlag: e } = Ne("CustomMessageActions");
|
|
1642
1642
|
return /* @__PURE__ */ n(
|
|
1643
1643
|
Wt,
|
|
1644
1644
|
{
|
|
@@ -1651,7 +1651,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1651
1651
|
);
|
|
1652
1652
|
}, Aa = () => {
|
|
1653
1653
|
var t;
|
|
1654
|
-
const { message: e } =
|
|
1654
|
+
const { message: e } = Ne("CustomMessageActions");
|
|
1655
1655
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
1656
|
Os,
|
|
1657
1657
|
{
|
|
@@ -1691,7 +1691,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1691
1691
|
},
|
|
1692
1692
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1693
1693
|
"aria-label": "Close link preview",
|
|
1694
|
-
children: /* @__PURE__ */ n(
|
|
1694
|
+
children: /* @__PURE__ */ n(De, { className: "size-4 text-black/90" })
|
|
1695
1695
|
}
|
|
1696
1696
|
),
|
|
1697
1697
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1703,7 +1703,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1703
1703
|
);
|
|
1704
1704
|
}, Ra = (e) => ({
|
|
1705
1705
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1706
|
-
(t) =>
|
|
1706
|
+
(t) => Lt.previewIsLoaded(t) || Lt.previewIsLoading(t)
|
|
1707
1707
|
)
|
|
1708
1708
|
}), La = () => {
|
|
1709
1709
|
const { linkPreviewsManager: e } = Jn(), { linkPreviews: t } = Zn(
|
|
@@ -1720,7 +1720,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1720
1720
|
},
|
|
1721
1721
|
r.og_scrape_url
|
|
1722
1722
|
)) }) : null;
|
|
1723
|
-
},
|
|
1723
|
+
}, st = j.createContext(!1), ki = () => _e(st), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
...s,
|
|
@@ -1731,7 +1731,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1731
1731
|
children: /* @__PURE__ */ n(Ms, { weight: "bold", className: "size-4" })
|
|
1732
1732
|
}
|
|
1733
1733
|
), Oa = () => {
|
|
1734
|
-
const e =
|
|
1734
|
+
const e = _e(st), { handleSubmit: t } = es(), s = ts(), a = e || !s, {
|
|
1735
1735
|
SendButton: r = Da,
|
|
1736
1736
|
AttachmentPreviewList: i = ns
|
|
1737
1737
|
} = Gt("CustomMessageInput");
|
|
@@ -1773,7 +1773,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1773
1773
|
}) => {
|
|
1774
1774
|
var o;
|
|
1775
1775
|
const { channel: i } = de(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
1776
|
-
return s ? /* @__PURE__ */ h(
|
|
1776
|
+
return s ? /* @__PURE__ */ h(te, { children: [
|
|
1777
1777
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1778
1778
|
t == null ? void 0 : t()
|
|
1779
1779
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1785,7 +1785,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1785
1785
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1786
1786
|
children: [
|
|
1787
1787
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1788
|
-
/* @__PURE__ */ n(
|
|
1788
|
+
/* @__PURE__ */ n(st.Provider, { value: l, children: /* @__PURE__ */ n(Qn, { Input: r ?? Oa }) })
|
|
1789
1789
|
]
|
|
1790
1790
|
}
|
|
1791
1791
|
),
|
|
@@ -1801,10 +1801,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1801
1801
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1802
1802
|
], Ba = {
|
|
1803
1803
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1804
|
-
},
|
|
1804
|
+
}, Be = "age safety guidelines.", Ua = "https://linktr.ee/s/about/contact", jt = (e) => za.includes(e), ja = (e) => Fa.includes(e), Va = (e) => {
|
|
1805
1805
|
var a;
|
|
1806
1806
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1807
|
-
if (
|
|
1807
|
+
if (jt(t))
|
|
1808
1808
|
return {
|
|
1809
1809
|
kind: "dm-agent",
|
|
1810
1810
|
type: t
|
|
@@ -1815,17 +1815,17 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1815
1815
|
type: t
|
|
1816
1816
|
};
|
|
1817
1817
|
const s = e.dm_agent_system_type;
|
|
1818
|
-
if (
|
|
1818
|
+
if (jt(s))
|
|
1819
1819
|
return {
|
|
1820
1820
|
kind: "dm-agent",
|
|
1821
1821
|
type: s
|
|
1822
1822
|
};
|
|
1823
1823
|
}, Ga = (e) => {
|
|
1824
|
-
const t = e.indexOf(
|
|
1824
|
+
const t = e.indexOf(Be);
|
|
1825
1825
|
if (t === -1)
|
|
1826
1826
|
return e;
|
|
1827
|
-
const s = t +
|
|
1828
|
-
return /* @__PURE__ */ h(
|
|
1827
|
+
const s = t + Be.length;
|
|
1828
|
+
return /* @__PURE__ */ h(te, { children: [
|
|
1829
1829
|
e.slice(0, t),
|
|
1830
1830
|
/* @__PURE__ */ n(
|
|
1831
1831
|
"a",
|
|
@@ -1834,7 +1834,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1834
1834
|
target: "_blank",
|
|
1835
1835
|
rel: "noopener noreferrer",
|
|
1836
1836
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1837
|
-
children:
|
|
1837
|
+
children: Be
|
|
1838
1838
|
}
|
|
1839
1839
|
),
|
|
1840
1840
|
e.slice(s)
|
|
@@ -1855,7 +1855,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1855
1855
|
"data-dm-agent-system-type": s.type,
|
|
1856
1856
|
children: [
|
|
1857
1857
|
/* @__PURE__ */ n(
|
|
1858
|
-
|
|
1858
|
+
be,
|
|
1859
1859
|
{
|
|
1860
1860
|
size: 16,
|
|
1861
1861
|
weight: "regular",
|
|
@@ -1867,7 +1867,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1867
1867
|
]
|
|
1868
1868
|
}
|
|
1869
1869
|
),
|
|
1870
|
-
!t && /* @__PURE__ */ n(
|
|
1870
|
+
!t && /* @__PURE__ */ n(ze, { message: e.message })
|
|
1871
1871
|
] });
|
|
1872
1872
|
}
|
|
1873
1873
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
@@ -1894,7 +1894,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1894
1894
|
]
|
|
1895
1895
|
}
|
|
1896
1896
|
),
|
|
1897
|
-
!t && /* @__PURE__ */ n(
|
|
1897
|
+
!t && /* @__PURE__ */ n(ze, { message: e.message })
|
|
1898
1898
|
] });
|
|
1899
1899
|
}
|
|
1900
1900
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1903,9 +1903,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1903
1903
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
1904
1904
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
1905
1905
|
] }),
|
|
1906
|
-
!t && /* @__PURE__ */ n(
|
|
1906
|
+
!t && /* @__PURE__ */ n(ze, { message: e.message })
|
|
1907
1907
|
] });
|
|
1908
|
-
}, un =
|
|
1908
|
+
}, un = We(!1), Ue = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1909
1909
|
"animateTransform",
|
|
1910
1910
|
{
|
|
1911
1911
|
attributeName: "transform",
|
|
@@ -1916,20 +1916,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1916
1916
|
repeatCount: "indefinite"
|
|
1917
1917
|
}
|
|
1918
1918
|
) }), Ya = /* @__PURE__ */ new Set([
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1919
|
+
$e.Thinking,
|
|
1920
|
+
$e.Generating,
|
|
1921
|
+
$e.ExternalSources
|
|
1922
1922
|
]), qa = ({ threadList: e }) => {
|
|
1923
|
-
var
|
|
1924
|
-
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } =
|
|
1923
|
+
var p, _;
|
|
1924
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = rs(), { aiState: l } = is(t), o = _e(un);
|
|
1925
1925
|
if (!e && o && Ya.has(l)) {
|
|
1926
|
-
const
|
|
1926
|
+
const x = Wa(t, (p = r.user) == null ? void 0 : p.id);
|
|
1927
1927
|
return /* @__PURE__ */ n(
|
|
1928
|
-
|
|
1928
|
+
Vt,
|
|
1929
1929
|
{
|
|
1930
|
-
avatarId: (
|
|
1931
|
-
avatarName: (
|
|
1932
|
-
avatarImage:
|
|
1930
|
+
avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
|
|
1931
|
+
avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
|
|
1932
|
+
avatarImage: x == null ? void 0 : x.image,
|
|
1933
1933
|
testId: "typing-indicator-ai"
|
|
1934
1934
|
}
|
|
1935
1935
|
);
|
|
@@ -1937,21 +1937,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1937
1937
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1938
1938
|
return null;
|
|
1939
1939
|
const m = e ? [] : Object.values(i).filter(
|
|
1940
|
-
({ parent_id:
|
|
1941
|
-
var
|
|
1942
|
-
return (
|
|
1940
|
+
({ parent_id: x, user: b }) => {
|
|
1941
|
+
var v;
|
|
1942
|
+
return (b == null ? void 0 : b.id) !== ((v = r.user) == null ? void 0 : v.id) && !x;
|
|
1943
1943
|
}
|
|
1944
1944
|
), g = e ? Object.values(i).filter(
|
|
1945
|
-
({ parent_id:
|
|
1946
|
-
var
|
|
1947
|
-
return (
|
|
1945
|
+
({ parent_id: x, user: b }) => {
|
|
1946
|
+
var v;
|
|
1947
|
+
return (b == null ? void 0 : b.id) !== ((v = r.user) == null ? void 0 : v.id) && x === (a == null ? void 0 : a.id);
|
|
1948
1948
|
}
|
|
1949
1949
|
) : [], u = e ? g : m;
|
|
1950
1950
|
if (!u.length)
|
|
1951
1951
|
return null;
|
|
1952
1952
|
const f = (_ = u[0]) == null ? void 0 : _.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1953
1953
|
return /* @__PURE__ */ n(
|
|
1954
|
-
|
|
1954
|
+
Vt,
|
|
1955
1955
|
{
|
|
1956
1956
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1957
1957
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1959,7 +1959,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1959
1959
|
testId: "typing-indicator"
|
|
1960
1960
|
}
|
|
1961
1961
|
);
|
|
1962
|
-
},
|
|
1962
|
+
}, Vt = ({
|
|
1963
1963
|
avatarId: e,
|
|
1964
1964
|
avatarName: t,
|
|
1965
1965
|
avatarImage: s,
|
|
@@ -1974,7 +1974,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1974
1974
|
},
|
|
1975
1975
|
children: /* @__PURE__ */ h("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: [
|
|
1976
1976
|
/* @__PURE__ */ n(
|
|
1977
|
-
|
|
1977
|
+
se,
|
|
1978
1978
|
{
|
|
1979
1979
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1980
1980
|
id: e,
|
|
@@ -1994,9 +1994,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1994
1994
|
height: "13",
|
|
1995
1995
|
overflow: "visible",
|
|
1996
1996
|
children: [
|
|
1997
|
-
/* @__PURE__ */ n(
|
|
1998
|
-
/* @__PURE__ */ n(
|
|
1999
|
-
/* @__PURE__ */ n(
|
|
1997
|
+
/* @__PURE__ */ n(Ue, { cx: "4", index: 0 }),
|
|
1998
|
+
/* @__PURE__ */ n(Ue, { cx: "16", index: 1 }),
|
|
1999
|
+
/* @__PURE__ */ n(Ue, { cx: "28", index: 2 })
|
|
2000
2000
|
]
|
|
2001
2001
|
}
|
|
2002
2002
|
) }) }) }) }) })
|
|
@@ -2055,12 +2055,12 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2055
2055
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2056
2056
|
]
|
|
2057
2057
|
}
|
|
2058
|
-
),
|
|
2058
|
+
), Me = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2059
2059
|
/* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
|
|
2060
2060
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2061
2061
|
] }) }));
|
|
2062
|
-
|
|
2063
|
-
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
2062
|
+
Me.displayName = "LoadingState";
|
|
2063
|
+
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Te = "Replies instantly with AI assistant", Ja = ({
|
|
2064
2064
|
onBack: e,
|
|
2065
2065
|
showBackButton: t,
|
|
2066
2066
|
showStarButton: s = !1,
|
|
@@ -2075,30 +2075,33 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2075
2075
|
onReportParticipantClick: u,
|
|
2076
2076
|
customChannelActions: f,
|
|
2077
2077
|
renderChannelActions: c,
|
|
2078
|
-
showChannelInfo:
|
|
2078
|
+
showChannelInfo: p = !0,
|
|
2079
2079
|
onParticipantNameClick: _,
|
|
2080
|
-
renderHeaderTitleBadges:
|
|
2080
|
+
renderHeaderTitleBadges: x
|
|
2081
2081
|
}) => {
|
|
2082
|
-
var
|
|
2083
|
-
const { channel:
|
|
2084
|
-
var
|
|
2085
|
-
const
|
|
2086
|
-
return
|
|
2087
|
-
(
|
|
2088
|
-
var
|
|
2089
|
-
return ((
|
|
2082
|
+
var E, R, T, O, C, k, S;
|
|
2083
|
+
const { channel: b } = de(), v = j.useMemo(() => {
|
|
2084
|
+
var Y, Q;
|
|
2085
|
+
const P = (Y = b._client) == null ? void 0 : Y.userID;
|
|
2086
|
+
return P ? Object.values(((Q = b.state) == null ? void 0 : Q.members) || {}).find(
|
|
2087
|
+
(Z) => {
|
|
2088
|
+
var V;
|
|
2089
|
+
return ((V = Z.user) == null ? void 0 : V.id) && Z.user.id !== P;
|
|
2090
2090
|
}
|
|
2091
2091
|
) : void 0;
|
|
2092
|
-
}, [(
|
|
2093
|
-
channel:
|
|
2094
|
-
participant:
|
|
2095
|
-
}),
|
|
2092
|
+
}, [(E = b._client) == null ? void 0 : E.userID, (R = b.state) == null ? void 0 : R.members]), M = Jt(v == null ? void 0 : v.user), I = (T = v == null ? void 0 : v.user) == null ? void 0 : T.image, N = Kt(b), z = x == null ? void 0 : x({
|
|
2093
|
+
channel: b,
|
|
2094
|
+
participant: v
|
|
2095
|
+
}), L = /* @__PURE__ */ h(te, { children: [
|
|
2096
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: M }),
|
|
2097
|
+
z && /* @__PURE__ */ n("span", { className: "shrink-0", children: z })
|
|
2098
|
+
] }), D = async () => {
|
|
2096
2099
|
try {
|
|
2097
|
-
|
|
2098
|
-
} catch (
|
|
2100
|
+
N ? await b.unpin() : await b.pin();
|
|
2101
|
+
} catch (P) {
|
|
2099
2102
|
console.error(
|
|
2100
2103
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2101
|
-
|
|
2104
|
+
P
|
|
2102
2105
|
);
|
|
2103
2106
|
}
|
|
2104
2107
|
};
|
|
@@ -2115,68 +2118,81 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2115
2118
|
}),
|
|
2116
2119
|
type: "button",
|
|
2117
2120
|
"aria-label": "Back to conversations",
|
|
2118
|
-
children: /* @__PURE__ */ n(
|
|
2121
|
+
children: /* @__PURE__ */ n(Pt, { className: "size-5 text-black/90" })
|
|
2119
2122
|
}
|
|
2120
2123
|
) }),
|
|
2121
|
-
/* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1 items-center", children: _ ? /* @__PURE__ */ h(
|
|
2125
|
+
"button",
|
|
2126
|
+
{
|
|
2127
|
+
type: "button",
|
|
2128
|
+
onClick: _,
|
|
2129
|
+
"aria-label": `View details for ${M}`,
|
|
2130
|
+
className: "flex max-w-full flex-col items-center gap-1 appearance-none rounded-[12px] border-0 bg-transparent px-1 py-0.5 text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none",
|
|
2131
|
+
children: [
|
|
2132
|
+
/* @__PURE__ */ n(
|
|
2133
|
+
se,
|
|
2134
|
+
{
|
|
2135
|
+
id: ((O = v == null ? void 0 : v.user) == null ? void 0 : O.id) || b.id || "unknown",
|
|
2136
|
+
name: M,
|
|
2137
|
+
image: I,
|
|
2138
|
+
starred: s && N,
|
|
2139
|
+
dmAgentEnabled: a,
|
|
2140
|
+
size: 48
|
|
2141
|
+
}
|
|
2142
|
+
),
|
|
2143
|
+
/* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
2144
|
+
L,
|
|
2145
|
+
/* @__PURE__ */ n(He, { className: "size-3 shrink-0", weight: "bold" })
|
|
2146
|
+
] }),
|
|
2147
|
+
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2148
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2149
|
+
/* @__PURE__ */ n("span", { children: Te })
|
|
2150
|
+
] })
|
|
2151
|
+
]
|
|
2152
|
+
}
|
|
2153
|
+
) : /* @__PURE__ */ h(te, { children: [
|
|
2122
2154
|
/* @__PURE__ */ n(
|
|
2123
|
-
|
|
2155
|
+
se,
|
|
2124
2156
|
{
|
|
2125
|
-
id: ((
|
|
2126
|
-
name:
|
|
2127
|
-
image:
|
|
2128
|
-
starred: s &&
|
|
2157
|
+
id: ((C = v == null ? void 0 : v.user) == null ? void 0 : C.id) || b.id || "unknown",
|
|
2158
|
+
name: M,
|
|
2159
|
+
image: I,
|
|
2160
|
+
starred: s && N,
|
|
2129
2161
|
dmAgentEnabled: a,
|
|
2130
2162
|
size: 48
|
|
2131
2163
|
}
|
|
2132
2164
|
),
|
|
2133
|
-
|
|
2134
|
-
"button",
|
|
2135
|
-
{
|
|
2136
|
-
type: "button",
|
|
2137
|
-
onClick: _,
|
|
2138
|
-
"aria-label": `View details for ${A}`,
|
|
2139
|
-
className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2140
|
-
children: [
|
|
2141
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2142
|
-
R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R }),
|
|
2143
|
-
/* @__PURE__ */ n(Ge, { className: "size-3 shrink-0", weight: "bold" })
|
|
2144
|
-
]
|
|
2145
|
-
}
|
|
2146
|
-
) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
|
|
2147
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
|
|
2148
|
-
R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R })
|
|
2149
|
-
] }),
|
|
2165
|
+
/* @__PURE__ */ n("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: L }),
|
|
2150
2166
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2151
|
-
/* @__PURE__ */ n(
|
|
2152
|
-
/* @__PURE__ */ n("span", { children:
|
|
2167
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2168
|
+
/* @__PURE__ */ n("span", { children: Te })
|
|
2153
2169
|
] })
|
|
2154
|
-
] }),
|
|
2170
|
+
] }) }),
|
|
2155
2171
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
2156
2172
|
s && /* @__PURE__ */ n(
|
|
2157
2173
|
"button",
|
|
2158
2174
|
{
|
|
2159
2175
|
className: le,
|
|
2160
|
-
onClick:
|
|
2176
|
+
onClick: D,
|
|
2161
2177
|
type: "button",
|
|
2162
|
-
"aria-label":
|
|
2178
|
+
"aria-label": N ? "Unstar conversation" : "Star conversation",
|
|
2163
2179
|
children: /* @__PURE__ */ n(
|
|
2164
|
-
|
|
2180
|
+
Ve,
|
|
2165
2181
|
{
|
|
2166
2182
|
className: y("size-5", {
|
|
2167
|
-
"text-yellow-600":
|
|
2168
|
-
"text-black/90": !
|
|
2183
|
+
"text-yellow-600": N,
|
|
2184
|
+
"text-black/90": !N
|
|
2169
2185
|
}),
|
|
2170
|
-
weight:
|
|
2186
|
+
weight: N ? "duotone" : "regular"
|
|
2171
2187
|
}
|
|
2172
2188
|
)
|
|
2173
2189
|
}
|
|
2174
2190
|
),
|
|
2175
|
-
|
|
2176
|
-
|
|
2191
|
+
p && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2192
|
+
Ft,
|
|
2177
2193
|
{
|
|
2178
|
-
channel:
|
|
2179
|
-
participant:
|
|
2194
|
+
channel: b,
|
|
2195
|
+
participant: v,
|
|
2180
2196
|
showDeleteConversation: l,
|
|
2181
2197
|
showBlockParticipant: o,
|
|
2182
2198
|
showReportParticipant: d,
|
|
@@ -2203,41 +2219,58 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2203
2219
|
type: "button",
|
|
2204
2220
|
onClick: e,
|
|
2205
2221
|
"aria-label": "Back to conversations",
|
|
2206
|
-
children: /* @__PURE__ */ n(
|
|
2222
|
+
children: /* @__PURE__ */ n(Pt, { className: "size-5 text-black/90" })
|
|
2207
2223
|
}
|
|
2208
2224
|
),
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
|
|
2225
|
+
_ ? /* @__PURE__ */ h(
|
|
2226
|
+
"button",
|
|
2211
2227
|
{
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2228
|
+
type: "button",
|
|
2229
|
+
onClick: _,
|
|
2230
|
+
"aria-label": `View details for ${M}`,
|
|
2231
|
+
className: "flex min-w-0 max-w-full items-center gap-4 appearance-none rounded-[12px] border-0 bg-transparent px-1 py-0.5 text-left text-black/90 transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none",
|
|
2232
|
+
children: [
|
|
2233
|
+
/* @__PURE__ */ n(
|
|
2234
|
+
se,
|
|
2235
|
+
{
|
|
2236
|
+
id: ((k = v == null ? void 0 : v.user) == null ? void 0 : k.id) || b.id || "unknown",
|
|
2237
|
+
name: M,
|
|
2238
|
+
image: I,
|
|
2239
|
+
starred: s && N,
|
|
2240
|
+
dmAgentEnabled: a,
|
|
2241
|
+
size: 48
|
|
2242
|
+
}
|
|
2243
|
+
),
|
|
2244
|
+
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2245
|
+
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2246
|
+
L,
|
|
2247
|
+
/* @__PURE__ */ n(He, { className: "size-4 shrink-0", weight: "bold" })
|
|
2248
|
+
] }),
|
|
2249
|
+
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2250
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2251
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Te })
|
|
2252
|
+
] })
|
|
2253
|
+
] })
|
|
2254
|
+
]
|
|
2218
2255
|
}
|
|
2219
|
-
),
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
"button",
|
|
2256
|
+
) : /* @__PURE__ */ h(te, { children: [
|
|
2257
|
+
/* @__PURE__ */ n(
|
|
2258
|
+
se,
|
|
2223
2259
|
{
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R }),
|
|
2231
|
-
/* @__PURE__ */ n(Ge, { className: "size-4 shrink-0", weight: "bold" })
|
|
2232
|
-
]
|
|
2260
|
+
id: ((S = v == null ? void 0 : v.user) == null ? void 0 : S.id) || b.id || "unknown",
|
|
2261
|
+
name: M,
|
|
2262
|
+
image: I,
|
|
2263
|
+
starred: s && N,
|
|
2264
|
+
dmAgentEnabled: a,
|
|
2265
|
+
size: 48
|
|
2233
2266
|
}
|
|
2234
|
-
)
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2267
|
+
),
|
|
2268
|
+
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2269
|
+
/* @__PURE__ */ n("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: L }),
|
|
2270
|
+
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2271
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2272
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Te })
|
|
2273
|
+
] })
|
|
2241
2274
|
] })
|
|
2242
2275
|
] })
|
|
2243
2276
|
] }),
|
|
@@ -2246,26 +2279,26 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2246
2279
|
"button",
|
|
2247
2280
|
{
|
|
2248
2281
|
className: le,
|
|
2249
|
-
onClick:
|
|
2282
|
+
onClick: D,
|
|
2250
2283
|
type: "button",
|
|
2251
|
-
"aria-label":
|
|
2284
|
+
"aria-label": N ? "Unstar conversation" : "Star conversation",
|
|
2252
2285
|
children: /* @__PURE__ */ n(
|
|
2253
|
-
|
|
2286
|
+
Ve,
|
|
2254
2287
|
{
|
|
2255
2288
|
className: y("size-6", {
|
|
2256
|
-
"text-yellow-600":
|
|
2257
|
-
"text-black/90": !
|
|
2289
|
+
"text-yellow-600": N,
|
|
2290
|
+
"text-black/90": !N
|
|
2258
2291
|
}),
|
|
2259
|
-
weight:
|
|
2292
|
+
weight: N ? "duotone" : "regular"
|
|
2260
2293
|
}
|
|
2261
2294
|
)
|
|
2262
2295
|
}
|
|
2263
2296
|
),
|
|
2264
|
-
|
|
2265
|
-
|
|
2297
|
+
p && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2298
|
+
Ft,
|
|
2266
2299
|
{
|
|
2267
|
-
channel:
|
|
2268
|
-
participant:
|
|
2300
|
+
channel: b,
|
|
2301
|
+
participant: v,
|
|
2269
2302
|
showDeleteConversation: l,
|
|
2270
2303
|
showBlockParticipant: o,
|
|
2271
2304
|
showReportParticipant: d,
|
|
@@ -2296,56 +2329,56 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2296
2329
|
showBlockParticipant: u = !0,
|
|
2297
2330
|
showReportParticipant: f = !0,
|
|
2298
2331
|
composerDisabled: c = !1,
|
|
2299
|
-
composerDisabledReason:
|
|
2332
|
+
composerDisabledReason: p,
|
|
2300
2333
|
showStarButton: _ = !1,
|
|
2301
|
-
chatbotVotingEnabled:
|
|
2302
|
-
renderChannelBanner:
|
|
2303
|
-
renderHeaderTitleBadges:
|
|
2304
|
-
customChannelActions:
|
|
2305
|
-
renderChannelActions:
|
|
2306
|
-
renderMessage:
|
|
2307
|
-
dmAgentEnabled:
|
|
2308
|
-
viewerLanguage:
|
|
2334
|
+
chatbotVotingEnabled: x = !1,
|
|
2335
|
+
renderChannelBanner: b,
|
|
2336
|
+
renderHeaderTitleBadges: v,
|
|
2337
|
+
customChannelActions: M,
|
|
2338
|
+
renderChannelActions: I,
|
|
2339
|
+
renderMessage: N,
|
|
2340
|
+
dmAgentEnabled: z = !1,
|
|
2341
|
+
viewerLanguage: L,
|
|
2309
2342
|
showChannelInfo: D = !0,
|
|
2310
2343
|
onParticipantNameClick: E,
|
|
2311
|
-
composerInput:
|
|
2344
|
+
composerInput: R
|
|
2312
2345
|
}) => {
|
|
2313
|
-
var
|
|
2314
|
-
const { channel:
|
|
2346
|
+
var Y, Q, Z, V, w, A;
|
|
2347
|
+
const { channel: T } = de(), O = j.useMemo(() => {
|
|
2315
2348
|
var q, B;
|
|
2316
|
-
const U = (q =
|
|
2317
|
-
return U ? Object.values(((B =
|
|
2349
|
+
const U = (q = T._client) == null ? void 0 : q.userID;
|
|
2350
|
+
return U ? Object.values(((B = T.state) == null ? void 0 : B.members) || {}).find(
|
|
2318
2351
|
(W) => {
|
|
2319
2352
|
var X;
|
|
2320
2353
|
return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== U;
|
|
2321
2354
|
}
|
|
2322
2355
|
) : void 0;
|
|
2323
|
-
}, [(
|
|
2356
|
+
}, [(Y = T._client) == null ? void 0 : Y.userID, (Q = T.state) == null ? void 0 : Q.members]), C = j.useMemo(() => {
|
|
2324
2357
|
var q, B;
|
|
2325
|
-
const U = (q =
|
|
2326
|
-
return U ? Object.values(((B =
|
|
2358
|
+
const U = (q = T._client) == null ? void 0 : q.userID;
|
|
2359
|
+
return U ? Object.values(((B = T.state) == null ? void 0 : B.members) || {}).find((W) => {
|
|
2327
2360
|
var X;
|
|
2328
2361
|
return ((X = W.user) == null ? void 0 : X.id) === U;
|
|
2329
2362
|
}) : void 0;
|
|
2330
|
-
}, [(
|
|
2363
|
+
}, [(Z = T._client) == null ? void 0 : Z.userID, (V = T.state) == null ? void 0 : V.members]), k = ((w = C == null ? void 0 : C.user) == null ? void 0 : w.is_account) ?? (C == null ? void 0 : C.is_account), S = ((A = O == null ? void 0 : O.user) == null ? void 0 : A.is_account) ?? (O == null ? void 0 : O.is_account), P = z && k === !1 && S === !0, $ = J(
|
|
2331
2364
|
(U) => {
|
|
2332
|
-
const { message:
|
|
2365
|
+
const { message: G } = Ne("ChannelView"), q = /* @__PURE__ */ n(
|
|
2333
2366
|
Sa,
|
|
2334
2367
|
{
|
|
2335
2368
|
...U,
|
|
2336
|
-
chatbotVotingEnabled:
|
|
2337
|
-
viewerLanguage:
|
|
2369
|
+
chatbotVotingEnabled: x,
|
|
2370
|
+
viewerLanguage: L
|
|
2338
2371
|
}
|
|
2339
2372
|
);
|
|
2340
|
-
return !
|
|
2373
|
+
return !N || !G ? q : N(q, G);
|
|
2341
2374
|
},
|
|
2342
|
-
[
|
|
2375
|
+
[x, N, L]
|
|
2343
2376
|
);
|
|
2344
|
-
return /* @__PURE__ */ n(
|
|
2377
|
+
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
2345
2378
|
ls,
|
|
2346
2379
|
{
|
|
2347
2380
|
overrides: {
|
|
2348
|
-
Message:
|
|
2381
|
+
Message: $,
|
|
2349
2382
|
MessageActions: Aa
|
|
2350
2383
|
},
|
|
2351
2384
|
children: /* @__PURE__ */ h(cs, { children: [
|
|
@@ -2356,7 +2389,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2356
2389
|
showBackButton: t,
|
|
2357
2390
|
showChannelInfo: D,
|
|
2358
2391
|
showStarButton: _,
|
|
2359
|
-
dmAgentEnabled:
|
|
2392
|
+
dmAgentEnabled: P,
|
|
2360
2393
|
onLeaveConversation: i,
|
|
2361
2394
|
onBlockParticipant: l,
|
|
2362
2395
|
showDeleteConversation: o,
|
|
@@ -2365,13 +2398,13 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2365
2398
|
onDeleteConversationClick: d,
|
|
2366
2399
|
onBlockParticipantClick: m,
|
|
2367
2400
|
onReportParticipantClick: g,
|
|
2368
|
-
customChannelActions:
|
|
2369
|
-
renderChannelActions:
|
|
2401
|
+
customChannelActions: M,
|
|
2402
|
+
renderChannelActions: I,
|
|
2370
2403
|
onParticipantNameClick: E,
|
|
2371
|
-
renderHeaderTitleBadges:
|
|
2404
|
+
renderHeaderTitleBadges: v
|
|
2372
2405
|
}
|
|
2373
2406
|
) }, "lt-channel-header"),
|
|
2374
|
-
|
|
2407
|
+
b ? /* @__PURE__ */ n(j.Fragment, { children: b() }, "lt-channel-banner") : null,
|
|
2375
2408
|
/* @__PURE__ */ n(
|
|
2376
2409
|
"div",
|
|
2377
2410
|
{
|
|
@@ -2380,17 +2413,17 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2380
2413
|
},
|
|
2381
2414
|
"lt-channel-message-list"
|
|
2382
2415
|
),
|
|
2383
|
-
r ? /* @__PURE__ */ n(j.Fragment, { children: r(
|
|
2416
|
+
r ? /* @__PURE__ */ n(j.Fragment, { children: r(T) }, "lt-channel-conversation-footer") : null,
|
|
2384
2417
|
/* @__PURE__ */ n(
|
|
2385
2418
|
Pa,
|
|
2386
2419
|
{
|
|
2387
2420
|
...s && {
|
|
2388
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2421
|
+
renderActions: () => s == null ? void 0 : s(T)
|
|
2389
2422
|
},
|
|
2390
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2423
|
+
renderFooter: () => a == null ? void 0 : a(T),
|
|
2391
2424
|
disabled: c,
|
|
2392
|
-
disabledReason:
|
|
2393
|
-
composerInput:
|
|
2425
|
+
disabledReason: p,
|
|
2426
|
+
composerInput: R
|
|
2394
2427
|
},
|
|
2395
2428
|
"lt-channel-message-input"
|
|
2396
2429
|
)
|
|
@@ -2413,78 +2446,78 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2413
2446
|
onDeleteConversationClick: u,
|
|
2414
2447
|
onBlockParticipantClick: f,
|
|
2415
2448
|
onReportParticipantClick: c,
|
|
2416
|
-
showBlockParticipant:
|
|
2449
|
+
showBlockParticipant: p = !0,
|
|
2417
2450
|
showReportParticipant: _ = !0,
|
|
2418
|
-
composerDisabled:
|
|
2419
|
-
composerDisabledReason:
|
|
2420
|
-
dmAgentEnabled:
|
|
2421
|
-
messageMetadata:
|
|
2422
|
-
onMessageSent:
|
|
2423
|
-
showStarButton:
|
|
2424
|
-
chatbotVotingEnabled:
|
|
2425
|
-
renderChannelBanner:
|
|
2451
|
+
composerDisabled: x = !1,
|
|
2452
|
+
composerDisabledReason: b,
|
|
2453
|
+
dmAgentEnabled: v,
|
|
2454
|
+
messageMetadata: M,
|
|
2455
|
+
onMessageSent: I,
|
|
2456
|
+
showStarButton: N = !1,
|
|
2457
|
+
chatbotVotingEnabled: z = !1,
|
|
2458
|
+
renderChannelBanner: L,
|
|
2426
2459
|
renderHeaderTitleBadges: D,
|
|
2427
2460
|
customChannelActions: E,
|
|
2428
|
-
renderChannelActions:
|
|
2429
|
-
renderMessage:
|
|
2461
|
+
renderChannelActions: R,
|
|
2462
|
+
renderMessage: T,
|
|
2430
2463
|
onMessageLinkClick: O,
|
|
2431
|
-
sendButton:
|
|
2464
|
+
sendButton: C,
|
|
2432
2465
|
attachmentPreviewList: k,
|
|
2433
2466
|
viewerLanguage: S,
|
|
2434
|
-
showChannelInfo:
|
|
2435
|
-
onParticipantNameClick:
|
|
2436
|
-
composerInput:
|
|
2467
|
+
showChannelInfo: P = !0,
|
|
2468
|
+
onParticipantNameClick: $,
|
|
2469
|
+
composerInput: Y
|
|
2437
2470
|
}) => {
|
|
2438
|
-
const
|
|
2439
|
-
async (
|
|
2471
|
+
const Q = J(
|
|
2472
|
+
async (V, w, A) => {
|
|
2440
2473
|
var X;
|
|
2441
|
-
const U = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0,
|
|
2442
|
-
...
|
|
2443
|
-
...
|
|
2444
|
-
...
|
|
2474
|
+
const U = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0, G = v && !U, q = {
|
|
2475
|
+
...w,
|
|
2476
|
+
...G && { silent: !0 },
|
|
2477
|
+
...M && {
|
|
2445
2478
|
metadata: {
|
|
2446
|
-
...
|
|
2447
|
-
...
|
|
2479
|
+
...w.metadata ?? {},
|
|
2480
|
+
...M
|
|
2448
2481
|
}
|
|
2449
2482
|
}
|
|
2450
2483
|
}, B = {
|
|
2451
|
-
...
|
|
2452
|
-
...
|
|
2484
|
+
...A,
|
|
2485
|
+
...G && { skip_push: !0 }
|
|
2453
2486
|
}, W = await e.sendMessage(q, B);
|
|
2454
|
-
return
|
|
2487
|
+
return I == null || I(W), W;
|
|
2455
2488
|
},
|
|
2456
|
-
[e,
|
|
2457
|
-
),
|
|
2489
|
+
[e, v, M, I]
|
|
2490
|
+
), Z = H(null);
|
|
2458
2491
|
return K(() => {
|
|
2459
2492
|
if (!O) return;
|
|
2460
|
-
const
|
|
2461
|
-
if (!
|
|
2462
|
-
const
|
|
2463
|
-
const U =
|
|
2493
|
+
const V = Z.current;
|
|
2494
|
+
if (!V) return;
|
|
2495
|
+
const w = (A) => {
|
|
2496
|
+
const U = A.target, G = U == null ? void 0 : U.closest("a[href]"), q = G == null ? void 0 : G.getAttribute("href");
|
|
2464
2497
|
if (!q) return;
|
|
2465
|
-
const B =
|
|
2498
|
+
const B = G == null ? void 0 : G.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), X = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
|
|
2466
2499
|
O(q, X);
|
|
2467
2500
|
};
|
|
2468
|
-
return
|
|
2501
|
+
return V.addEventListener("click", w), () => V.removeEventListener("click", w);
|
|
2469
2502
|
}, [O, e]), /* @__PURE__ */ n(
|
|
2470
2503
|
"div",
|
|
2471
2504
|
{
|
|
2472
|
-
ref:
|
|
2505
|
+
ref: Z,
|
|
2473
2506
|
className: y(
|
|
2474
2507
|
"messaging-channel-view h-full flex flex-col",
|
|
2475
2508
|
d
|
|
2476
2509
|
),
|
|
2477
|
-
children: /* @__PURE__ */ n(un.Provider, { value:
|
|
2510
|
+
children: /* @__PURE__ */ n(un.Provider, { value: v ?? !1, children: /* @__PURE__ */ n(
|
|
2478
2511
|
os,
|
|
2479
2512
|
{
|
|
2480
2513
|
channel: e,
|
|
2481
2514
|
MessageSystem: Ha,
|
|
2482
2515
|
EmptyStateIndicator: m,
|
|
2483
|
-
LoadingIndicator:
|
|
2516
|
+
LoadingIndicator: Me,
|
|
2484
2517
|
DateSeparator: Vs,
|
|
2485
2518
|
TypingIndicator: qa,
|
|
2486
|
-
doSendMessageRequest:
|
|
2487
|
-
...
|
|
2519
|
+
doSendMessageRequest: Q,
|
|
2520
|
+
...C ? { SendButton: C } : {},
|
|
2488
2521
|
...k ? { AttachmentPreviewList: k } : {},
|
|
2489
2522
|
children: /* @__PURE__ */ n(
|
|
2490
2523
|
Za,
|
|
@@ -2501,22 +2534,22 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2501
2534
|
onDeleteConversationClick: u,
|
|
2502
2535
|
onBlockParticipantClick: f,
|
|
2503
2536
|
onReportParticipantClick: c,
|
|
2504
|
-
showBlockParticipant:
|
|
2537
|
+
showBlockParticipant: p,
|
|
2505
2538
|
showReportParticipant: _,
|
|
2506
|
-
composerDisabled:
|
|
2507
|
-
composerDisabledReason:
|
|
2508
|
-
showStarButton:
|
|
2509
|
-
dmAgentEnabled:
|
|
2510
|
-
chatbotVotingEnabled:
|
|
2511
|
-
renderChannelBanner:
|
|
2539
|
+
composerDisabled: x,
|
|
2540
|
+
composerDisabledReason: b,
|
|
2541
|
+
showStarButton: N,
|
|
2542
|
+
dmAgentEnabled: v,
|
|
2543
|
+
chatbotVotingEnabled: z,
|
|
2544
|
+
renderChannelBanner: L,
|
|
2512
2545
|
renderHeaderTitleBadges: D,
|
|
2513
2546
|
customChannelActions: E,
|
|
2514
|
-
renderChannelActions:
|
|
2515
|
-
renderMessage:
|
|
2547
|
+
renderChannelActions: R,
|
|
2548
|
+
renderMessage: T,
|
|
2516
2549
|
viewerLanguage: S,
|
|
2517
|
-
showChannelInfo:
|
|
2518
|
-
onParticipantNameClick:
|
|
2519
|
-
composerInput:
|
|
2550
|
+
showChannelInfo: P,
|
|
2551
|
+
onParticipantNameClick: $,
|
|
2552
|
+
composerInput: Y
|
|
2520
2553
|
}
|
|
2521
2554
|
)
|
|
2522
2555
|
}
|
|
@@ -2526,7 +2559,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2526
2559
|
}
|
|
2527
2560
|
);
|
|
2528
2561
|
mn.displayName = "ChannelView";
|
|
2529
|
-
const
|
|
2562
|
+
const ve = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2530
2563
|
/* @__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: "⚠️" }) }),
|
|
2531
2564
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2532
2565
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2540,7 +2573,7 @@ const pe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2540
2573
|
}
|
|
2541
2574
|
)
|
|
2542
2575
|
] }) }));
|
|
2543
|
-
|
|
2576
|
+
ve.displayName = "ErrorState";
|
|
2544
2577
|
const Ei = ({
|
|
2545
2578
|
capabilities: e = {},
|
|
2546
2579
|
renderMessageInputActions: t,
|
|
@@ -2556,49 +2589,49 @@ const Ei = ({
|
|
|
2556
2589
|
onMessageSent: u,
|
|
2557
2590
|
chatbotVotingEnabled: f = !1,
|
|
2558
2591
|
viewerLanguage: c,
|
|
2559
|
-
renderHeaderTitleBadges:
|
|
2592
|
+
renderHeaderTitleBadges: p,
|
|
2560
2593
|
renderChannelBanner: _,
|
|
2561
|
-
customChannelActions:
|
|
2562
|
-
renderChannelActions:
|
|
2563
|
-
onParticipantNameClick:
|
|
2564
|
-
renderMessage:
|
|
2565
|
-
onMessageLinkClick:
|
|
2566
|
-
showChannelInfo:
|
|
2567
|
-
composerInput:
|
|
2594
|
+
customChannelActions: x,
|
|
2595
|
+
renderChannelActions: b,
|
|
2596
|
+
onParticipantNameClick: v,
|
|
2597
|
+
renderMessage: M,
|
|
2598
|
+
onMessageLinkClick: I,
|
|
2599
|
+
showChannelInfo: N,
|
|
2600
|
+
composerInput: z
|
|
2568
2601
|
}) => {
|
|
2569
2602
|
const {
|
|
2570
|
-
client:
|
|
2603
|
+
client: L,
|
|
2571
2604
|
isConnected: D,
|
|
2572
2605
|
isLoading: E,
|
|
2573
|
-
error:
|
|
2574
|
-
refreshConnection:
|
|
2606
|
+
error: R,
|
|
2607
|
+
refreshConnection: T,
|
|
2575
2608
|
service: O,
|
|
2576
|
-
debug:
|
|
2577
|
-
} = Ps(), [k, S] = F(null), [
|
|
2578
|
-
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2581
|
-
const
|
|
2609
|
+
debug: C
|
|
2610
|
+
} = Ps(), [k, S] = F(null), [P, $] = F(null), [Y, Q] = F(!1), { showDeleteConversation: Z = !0 } = e, V = H(l);
|
|
2611
|
+
V.current = l;
|
|
2612
|
+
const w = H(a);
|
|
2613
|
+
w.current = a;
|
|
2614
|
+
const A = H(null), U = H(null);
|
|
2582
2615
|
K(() => {
|
|
2583
2616
|
U.current = k;
|
|
2584
2617
|
}, [k]), K(() => {
|
|
2585
|
-
if (!
|
|
2586
|
-
const B =
|
|
2618
|
+
if (!L || !D) return;
|
|
2619
|
+
const B = L.userID;
|
|
2587
2620
|
if (!B) return;
|
|
2588
2621
|
const W = `${B}::${i}`;
|
|
2589
|
-
if (
|
|
2590
|
-
|
|
2622
|
+
if (A.current === W) return;
|
|
2623
|
+
A.current = W;
|
|
2591
2624
|
const X = () => {
|
|
2592
|
-
|
|
2625
|
+
A.current === W && (A.current = null);
|
|
2593
2626
|
};
|
|
2594
2627
|
(async () => {
|
|
2595
2628
|
var me, he;
|
|
2596
2629
|
try {
|
|
2597
|
-
|
|
2630
|
+
C && console.log(
|
|
2598
2631
|
"[MessagingShell] Loading initial conversation with:",
|
|
2599
2632
|
i
|
|
2600
2633
|
);
|
|
2601
|
-
const
|
|
2634
|
+
const ee = await L.queryChannels(
|
|
2602
2635
|
{
|
|
2603
2636
|
type: "messaging",
|
|
2604
2637
|
members: { $eq: [B, i] }
|
|
@@ -2606,58 +2639,58 @@ const Ei = ({
|
|
|
2606
2639
|
{},
|
|
2607
2640
|
{ limit: 1 }
|
|
2608
2641
|
);
|
|
2609
|
-
if (
|
|
2610
|
-
S(
|
|
2642
|
+
if (ee.length > 0) {
|
|
2643
|
+
S(ee[0]), $(null), (me = w.current) == null || me.call(w, ee[0]), C && console.log(
|
|
2611
2644
|
"[MessagingShell] Initial conversation loaded:",
|
|
2612
|
-
|
|
2645
|
+
ee[0].id
|
|
2613
2646
|
);
|
|
2614
2647
|
return;
|
|
2615
2648
|
}
|
|
2616
|
-
const
|
|
2617
|
-
if (!
|
|
2618
|
-
X(),
|
|
2649
|
+
const ne = V.current;
|
|
2650
|
+
if (!ne || !O) {
|
|
2651
|
+
X(), $("No conversation found with this account"), C && console.log(
|
|
2619
2652
|
"[MessagingShell] No conversation found for:",
|
|
2620
2653
|
i
|
|
2621
2654
|
);
|
|
2622
2655
|
return;
|
|
2623
2656
|
}
|
|
2624
2657
|
try {
|
|
2625
|
-
const
|
|
2626
|
-
id:
|
|
2627
|
-
name:
|
|
2628
|
-
phone:
|
|
2658
|
+
const oe = await O.startChannelWithParticipant({
|
|
2659
|
+
id: ne.id,
|
|
2660
|
+
name: ne.name,
|
|
2661
|
+
phone: ne.phone
|
|
2629
2662
|
});
|
|
2630
|
-
S(
|
|
2663
|
+
S(oe), $(null), (he = w.current) == null || he.call(w, oe), C && console.log(
|
|
2631
2664
|
"[MessagingShell] Channel created and loaded:",
|
|
2632
|
-
|
|
2665
|
+
oe.id
|
|
2633
2666
|
);
|
|
2634
|
-
} catch (
|
|
2667
|
+
} catch (oe) {
|
|
2635
2668
|
console.error(
|
|
2636
2669
|
"[MessagingShell] Failed to create conversation:",
|
|
2637
|
-
|
|
2638
|
-
), X(),
|
|
2670
|
+
oe
|
|
2671
|
+
), X(), $("Failed to create conversation");
|
|
2639
2672
|
}
|
|
2640
|
-
} catch (
|
|
2673
|
+
} catch (ee) {
|
|
2641
2674
|
console.error(
|
|
2642
2675
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2643
|
-
|
|
2644
|
-
), X(), U.current ||
|
|
2676
|
+
ee
|
|
2677
|
+
), X(), U.current || $("Failed to load conversation");
|
|
2645
2678
|
}
|
|
2646
2679
|
})();
|
|
2647
|
-
}, [i,
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2680
|
+
}, [i, L, D, O, C]);
|
|
2681
|
+
const G = H(r);
|
|
2682
|
+
G.current = r;
|
|
2650
2683
|
const q = J(() => {
|
|
2651
2684
|
var B;
|
|
2652
|
-
S(null),
|
|
2685
|
+
S(null), Q(!0), (B = G.current) == null || B.call(G);
|
|
2653
2686
|
}, []);
|
|
2654
|
-
return E ? /* @__PURE__ */ n(
|
|
2655
|
-
|
|
2687
|
+
return E ? /* @__PURE__ */ n(Me, {}) : R ? /* @__PURE__ */ n(ve, { message: R, onBack: T }) : !D || !L ? /* @__PURE__ */ n(
|
|
2688
|
+
ve,
|
|
2656
2689
|
{
|
|
2657
2690
|
message: "Not connected to messaging service",
|
|
2658
|
-
onBack:
|
|
2691
|
+
onBack: T
|
|
2659
2692
|
}
|
|
2660
|
-
) :
|
|
2693
|
+
) : P ? /* @__PURE__ */ n(ve, { message: P }) : Y && !k ? /* @__PURE__ */ n(ve, { message: "Conversation ended" }) : k ? /* @__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(
|
|
2661
2694
|
mn,
|
|
2662
2695
|
{
|
|
2663
2696
|
channel: k,
|
|
@@ -2667,24 +2700,24 @@ const Ei = ({
|
|
|
2667
2700
|
onLeaveConversation: q,
|
|
2668
2701
|
onBlockParticipant: q,
|
|
2669
2702
|
CustomChannelEmptyState: o,
|
|
2670
|
-
showDeleteConversation:
|
|
2703
|
+
showDeleteConversation: Z,
|
|
2671
2704
|
onBlockParticipantClick: d,
|
|
2672
2705
|
onReportParticipantClick: m,
|
|
2673
2706
|
dmAgentEnabled: g,
|
|
2674
2707
|
onMessageSent: u,
|
|
2675
2708
|
chatbotVotingEnabled: f,
|
|
2676
2709
|
viewerLanguage: c,
|
|
2677
|
-
renderHeaderTitleBadges:
|
|
2678
|
-
customChannelActions:
|
|
2679
|
-
renderChannelActions:
|
|
2680
|
-
onParticipantNameClick:
|
|
2681
|
-
renderMessage:
|
|
2682
|
-
onMessageLinkClick:
|
|
2683
|
-
showChannelInfo:
|
|
2684
|
-
composerInput:
|
|
2710
|
+
renderHeaderTitleBadges: p,
|
|
2711
|
+
customChannelActions: x,
|
|
2712
|
+
renderChannelActions: b,
|
|
2713
|
+
onParticipantNameClick: v,
|
|
2714
|
+
renderMessage: M,
|
|
2715
|
+
onMessageLinkClick: I,
|
|
2716
|
+
showChannelInfo: N,
|
|
2717
|
+
composerInput: z
|
|
2685
2718
|
},
|
|
2686
2719
|
k.id
|
|
2687
|
-
) }) }) : /* @__PURE__ */ n(
|
|
2720
|
+
) }) }) : /* @__PURE__ */ n(Me, {});
|
|
2688
2721
|
};
|
|
2689
2722
|
function Qa(e) {
|
|
2690
2723
|
const t = e.state.pending_messages;
|
|
@@ -2722,7 +2755,7 @@ const hn = j.createContext({
|
|
|
2722
2755
|
});
|
|
2723
2756
|
}, fn = j.memo(
|
|
2724
2757
|
({ channel: e, unread: t }) => {
|
|
2725
|
-
var
|
|
2758
|
+
var z, L, D;
|
|
2726
2759
|
const {
|
|
2727
2760
|
selectedChannel: s,
|
|
2728
2761
|
onChannelSelect: a,
|
|
@@ -2732,39 +2765,39 @@ const hn = j.createContext({
|
|
|
2732
2765
|
} = tr(), o = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2733
2766
|
e && a(e);
|
|
2734
2767
|
}, m = (E) => {
|
|
2735
|
-
const
|
|
2736
|
-
!
|
|
2737
|
-
}, u = Object.values(((
|
|
2768
|
+
const R = E.key === "Enter" || E.key === " ", T = E.repeat;
|
|
2769
|
+
!R || T || (E.preventDefault(), d());
|
|
2770
|
+
}, u = Object.values(((z = e == null ? void 0 : e.state) == null ? void 0 : z.members) || {}).find(
|
|
2738
2771
|
(E) => {
|
|
2739
|
-
var
|
|
2740
|
-
return ((
|
|
2772
|
+
var R, T;
|
|
2773
|
+
return ((R = E.user) == null ? void 0 : R.id) && E.user.id !== ((T = e == null ? void 0 : e._client) == null ? void 0 : T.userID);
|
|
2741
2774
|
}
|
|
2742
|
-
), f = Jt(u == null ? void 0 : u.user), c = (
|
|
2743
|
-
var
|
|
2744
|
-
const E = (
|
|
2775
|
+
), f = Jt(u == null ? void 0 : u.user), c = (L = u == null ? void 0 : u.user) == null ? void 0 : L.image, p = (() => {
|
|
2776
|
+
var R;
|
|
2777
|
+
const E = (R = e == null ? void 0 : e.state) == null ? void 0 : R.messages;
|
|
2745
2778
|
if (E != null && E.length) {
|
|
2746
|
-
for (let
|
|
2747
|
-
if (E[
|
|
2779
|
+
for (let T = E.length - 1; T >= 0; T--)
|
|
2780
|
+
if (E[T].type !== "system") return E[T];
|
|
2748
2781
|
}
|
|
2749
|
-
})(),
|
|
2750
|
-
var k, S,
|
|
2782
|
+
})(), x = (() => {
|
|
2783
|
+
var k, S, P, $;
|
|
2751
2784
|
const E = Zt({
|
|
2752
|
-
message:
|
|
2785
|
+
message: p,
|
|
2753
2786
|
viewerLanguage: l
|
|
2754
2787
|
});
|
|
2755
|
-
if (((k =
|
|
2756
|
-
if (((S =
|
|
2757
|
-
if (((
|
|
2788
|
+
if (((k = p == null ? void 0 : p.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return E ? `💵 ${E}` : "💵 Sent a tip";
|
|
2789
|
+
if (((S = p == null ? void 0 : p.metadata) == null ? void 0 : S.custom_type) === "MESSAGE_PAID") return E ? `💰 ${E}` : "💰 Sent a message";
|
|
2790
|
+
if (((P = p == null ? void 0 : p.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_ATTACHMENT") return E ? `📎 ${E}` : "📎 Sent an attachment";
|
|
2758
2791
|
if (E) return E;
|
|
2759
|
-
const
|
|
2760
|
-
return
|
|
2761
|
-
})(),
|
|
2792
|
+
const C = ($ = p == null ? void 0 : p.attachments) == null ? void 0 : $[0];
|
|
2793
|
+
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";
|
|
2794
|
+
})(), b = p != null && p.created_at ? sr(new Date(p.created_at)) : "", v = p ? Ae(p) : !1, M = i ? i(p, x) : `${v ? "✨ " : ""}${x}`, I = Kt(e), N = t ?? 0;
|
|
2762
2795
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2763
2796
|
channelId: e == null ? void 0 : e.id,
|
|
2764
2797
|
isSelected: o,
|
|
2765
2798
|
participantName: f,
|
|
2766
|
-
unreadCount:
|
|
2767
|
-
hasTimestamp: !!
|
|
2799
|
+
unreadCount: N,
|
|
2800
|
+
hasTimestamp: !!b
|
|
2768
2801
|
}), /* @__PURE__ */ n(
|
|
2769
2802
|
"div",
|
|
2770
2803
|
{
|
|
@@ -2781,13 +2814,13 @@ const hn = j.createContext({
|
|
|
2781
2814
|
),
|
|
2782
2815
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2783
2816
|
/* @__PURE__ */ n(
|
|
2784
|
-
|
|
2817
|
+
se,
|
|
2785
2818
|
{
|
|
2786
2819
|
id: ((D = u == null ? void 0 : u.user) == null ? void 0 : D.id) || e.id || "unknown",
|
|
2787
2820
|
name: f,
|
|
2788
2821
|
image: c,
|
|
2789
2822
|
size: 48,
|
|
2790
|
-
starred:
|
|
2823
|
+
starred: I
|
|
2791
2824
|
}
|
|
2792
2825
|
),
|
|
2793
2826
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2799,16 +2832,16 @@ const hn = j.createContext({
|
|
|
2799
2832
|
"text-sm font-medium truncate text-[#191918]"
|
|
2800
2833
|
),
|
|
2801
2834
|
children: [
|
|
2802
|
-
|
|
2835
|
+
I && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2803
2836
|
f
|
|
2804
2837
|
]
|
|
2805
2838
|
}
|
|
2806
2839
|
),
|
|
2807
|
-
|
|
2840
|
+
b && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: b })
|
|
2808
2841
|
] }),
|
|
2809
2842
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2810
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2811
|
-
|
|
2843
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
2844
|
+
N > 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: N > 99 ? "99+" : N })
|
|
2812
2845
|
] })
|
|
2813
2846
|
] })
|
|
2814
2847
|
] })
|
|
@@ -2832,11 +2865,11 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2832
2865
|
}) => {
|
|
2833
2866
|
const g = j.useRef(0);
|
|
2834
2867
|
g.current++;
|
|
2835
|
-
const { debug: u = !1 } =
|
|
2836
|
-
(
|
|
2837
|
-
for (const _ of
|
|
2868
|
+
const { debug: u = !1 } = Je(), f = j.useCallback(
|
|
2869
|
+
(p) => {
|
|
2870
|
+
for (const _ of p)
|
|
2838
2871
|
Qa(_);
|
|
2839
|
-
return r ? r(
|
|
2872
|
+
return r ? r(p) : p;
|
|
2840
2873
|
},
|
|
2841
2874
|
[r]
|
|
2842
2875
|
);
|
|
@@ -2888,7 +2921,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2888
2921
|
);
|
|
2889
2922
|
rr.displayName = "ChannelList";
|
|
2890
2923
|
const ir = /^([a-z][a-z0-9+.-]*):/i, or = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2891
|
-
function
|
|
2924
|
+
function at(e) {
|
|
2892
2925
|
if (typeof e != "string") return;
|
|
2893
2926
|
const t = e.trim();
|
|
2894
2927
|
if (t === "") return;
|
|
@@ -2906,7 +2939,7 @@ const lr = {
|
|
|
2906
2939
|
const s = y(
|
|
2907
2940
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2908
2941
|
lr[e]
|
|
2909
|
-
), a =
|
|
2942
|
+
), a = at(t.href);
|
|
2910
2943
|
return a ? /* @__PURE__ */ n(
|
|
2911
2944
|
"a",
|
|
2912
2945
|
{
|
|
@@ -2938,7 +2971,7 @@ const lr = {
|
|
|
2938
2971
|
}, ur = "text-white/30", mr = {
|
|
2939
2972
|
dark: "text-white/55",
|
|
2940
2973
|
light: "text-black/55"
|
|
2941
|
-
},
|
|
2974
|
+
}, rt = ({
|
|
2942
2975
|
variant: e,
|
|
2943
2976
|
title: t,
|
|
2944
2977
|
placeholderTitle: s,
|
|
@@ -2948,12 +2981,12 @@ const lr = {
|
|
|
2948
2981
|
cta: l,
|
|
2949
2982
|
trailingAction: o
|
|
2950
2983
|
}) => {
|
|
2951
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
2952
|
-
if (!g && !u && !c && !
|
|
2953
|
-
const
|
|
2984
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", p = l != null;
|
|
2985
|
+
if (!g && !u && !c && !p) return null;
|
|
2986
|
+
const x = y(
|
|
2954
2987
|
"truncate text-base font-medium leading-6",
|
|
2955
2988
|
d && !t ? ur : dr[e]
|
|
2956
|
-
),
|
|
2989
|
+
), b = y(
|
|
2957
2990
|
"truncate text-xs leading-4",
|
|
2958
2991
|
mr[e]
|
|
2959
2992
|
);
|
|
@@ -2963,11 +2996,11 @@ const lr = {
|
|
|
2963
2996
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2964
2997
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2965
2998
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2966
|
-
/* @__PURE__ */ n("p", { className: y("min-w-0",
|
|
2999
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", x), children: m })
|
|
2967
3000
|
] }),
|
|
2968
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
3001
|
+
u && /* @__PURE__ */ n("p", { className: b, children: a })
|
|
2969
3002
|
] }),
|
|
2970
|
-
!
|
|
3003
|
+
!p && c && /* @__PURE__ */ n("p", { className: b, children: f })
|
|
2971
3004
|
] }),
|
|
2972
3005
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
2973
3006
|
] }),
|
|
@@ -2980,7 +3013,7 @@ const lr = {
|
|
|
2980
3013
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2981
3014
|
"border border-black/[0.08]",
|
|
2982
3015
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2983
|
-
),
|
|
3016
|
+
), Re = ({
|
|
2984
3017
|
variant: e,
|
|
2985
3018
|
children: t,
|
|
2986
3019
|
href: s,
|
|
@@ -3046,11 +3079,11 @@ const lr = {
|
|
|
3046
3079
|
}, gr = {
|
|
3047
3080
|
dark: "size-16 text-white/25",
|
|
3048
3081
|
light: "size-16 text-black/25"
|
|
3049
|
-
},
|
|
3082
|
+
}, Oe = (e, t) => !!t && !!e && ie(e) === "audio", gn = (e, t) => {
|
|
3050
3083
|
if (!t || !e) return !1;
|
|
3051
|
-
const s =
|
|
3084
|
+
const s = ie(e);
|
|
3052
3085
|
return s === "video" || s === "audio";
|
|
3053
|
-
},
|
|
3086
|
+
}, it = "bg-[#F2F3F4]", Le = ({
|
|
3054
3087
|
variant: e,
|
|
3055
3088
|
thumbnailUrl: t,
|
|
3056
3089
|
sourceUrl: s,
|
|
@@ -3059,8 +3092,8 @@ const lr = {
|
|
|
3059
3092
|
topLeft: i,
|
|
3060
3093
|
topRight: l
|
|
3061
3094
|
}) => {
|
|
3062
|
-
const o =
|
|
3063
|
-
return
|
|
3095
|
+
const o = ie(r), d = !!s && o === "video";
|
|
3096
|
+
return Oe(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3064
3097
|
"audio",
|
|
3065
3098
|
{
|
|
3066
3099
|
src: s,
|
|
@@ -3114,7 +3147,7 @@ const lr = {
|
|
|
3114
3147
|
]
|
|
3115
3148
|
}
|
|
3116
3149
|
);
|
|
3117
|
-
},
|
|
3150
|
+
}, pr = ({
|
|
3118
3151
|
title: e,
|
|
3119
3152
|
placeholderTitle: t,
|
|
3120
3153
|
description: s,
|
|
@@ -3128,14 +3161,14 @@ const lr = {
|
|
|
3128
3161
|
onDismiss: g,
|
|
3129
3162
|
onEditClick: u
|
|
3130
3163
|
}) => {
|
|
3131
|
-
const f = o === "classic", c =
|
|
3164
|
+
const f = o === "classic", c = Oe(r, l), p = g ? /* @__PURE__ */ n(
|
|
3132
3165
|
"button",
|
|
3133
3166
|
{
|
|
3134
3167
|
type: "button",
|
|
3135
3168
|
onClick: g,
|
|
3136
3169
|
"aria-label": "Dismiss attachment",
|
|
3137
3170
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3138
|
-
children: /* @__PURE__ */ n(
|
|
3171
|
+
children: /* @__PURE__ */ n(De, { className: "size-3", weight: "bold" })
|
|
3139
3172
|
}
|
|
3140
3173
|
) : void 0, _ = u ? /* @__PURE__ */ n(
|
|
3141
3174
|
"button",
|
|
@@ -3147,9 +3180,9 @@ const lr = {
|
|
|
3147
3180
|
children: /* @__PURE__ */ n(Ls, { className: "size-5", weight: "regular" })
|
|
3148
3181
|
}
|
|
3149
3182
|
) : void 0;
|
|
3150
|
-
return c ? /* @__PURE__ */ n(
|
|
3183
|
+
return c ? /* @__PURE__ */ n(Re, { variant: "dark", bgClassName: it, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3151
3184
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3152
|
-
|
|
3185
|
+
Le,
|
|
3153
3186
|
{
|
|
3154
3187
|
variant: "dark",
|
|
3155
3188
|
sourceUrl: l,
|
|
@@ -3157,26 +3190,26 @@ const lr = {
|
|
|
3157
3190
|
mimeType: r
|
|
3158
3191
|
}
|
|
3159
3192
|
) }),
|
|
3160
|
-
|
|
3193
|
+
p && /* @__PURE__ */ n("div", { className: "shrink-0", children: p })
|
|
3161
3194
|
] }) }) : /* @__PURE__ */ h(
|
|
3162
|
-
|
|
3195
|
+
Re,
|
|
3163
3196
|
{
|
|
3164
3197
|
variant: "dark",
|
|
3165
|
-
topRight: f ?
|
|
3198
|
+
topRight: f ? p : void 0,
|
|
3166
3199
|
children: [
|
|
3167
3200
|
!f && /* @__PURE__ */ n(
|
|
3168
|
-
|
|
3201
|
+
Le,
|
|
3169
3202
|
{
|
|
3170
3203
|
variant: "dark",
|
|
3171
3204
|
thumbnailUrl: i,
|
|
3172
3205
|
sourceUrl: l,
|
|
3173
3206
|
title: e,
|
|
3174
3207
|
mimeType: r,
|
|
3175
|
-
topRight:
|
|
3208
|
+
topRight: p
|
|
3176
3209
|
}
|
|
3177
3210
|
),
|
|
3178
3211
|
/* @__PURE__ */ n(
|
|
3179
|
-
|
|
3212
|
+
rt,
|
|
3180
3213
|
{
|
|
3181
3214
|
variant: "dark",
|
|
3182
3215
|
title: e,
|
|
@@ -3191,7 +3224,7 @@ const lr = {
|
|
|
3191
3224
|
]
|
|
3192
3225
|
}
|
|
3193
3226
|
);
|
|
3194
|
-
},
|
|
3227
|
+
}, br = ({
|
|
3195
3228
|
title: e,
|
|
3196
3229
|
description: t,
|
|
3197
3230
|
url: s,
|
|
@@ -3203,25 +3236,25 @@ const lr = {
|
|
|
3203
3236
|
cta: d,
|
|
3204
3237
|
onClick: m
|
|
3205
3238
|
}) => {
|
|
3206
|
-
const g = gn(a, i), u =
|
|
3239
|
+
const g = gn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, p = Oe(a, i) ? it : void 0, _ = d && m ? {
|
|
3207
3240
|
...d,
|
|
3208
3241
|
onClick: () => {
|
|
3209
|
-
var
|
|
3210
|
-
m(), (
|
|
3242
|
+
var x;
|
|
3243
|
+
m(), (x = d.onClick) == null || x.call(d);
|
|
3211
3244
|
}
|
|
3212
3245
|
} : d;
|
|
3213
3246
|
return /* @__PURE__ */ h(
|
|
3214
|
-
|
|
3247
|
+
Re,
|
|
3215
3248
|
{
|
|
3216
3249
|
variant: "light",
|
|
3217
3250
|
href: f,
|
|
3218
3251
|
onClick: c,
|
|
3219
3252
|
ariaLabel: e ?? "Open attachment preview",
|
|
3220
|
-
bgClassName:
|
|
3253
|
+
bgClassName: p,
|
|
3221
3254
|
"data-testid": "link-attachment",
|
|
3222
3255
|
children: [
|
|
3223
3256
|
l === "featured" && /* @__PURE__ */ n(
|
|
3224
|
-
|
|
3257
|
+
Le,
|
|
3225
3258
|
{
|
|
3226
3259
|
variant: "light",
|
|
3227
3260
|
thumbnailUrl: r,
|
|
@@ -3231,7 +3264,7 @@ const lr = {
|
|
|
3231
3264
|
}
|
|
3232
3265
|
),
|
|
3233
3266
|
/* @__PURE__ */ n(
|
|
3234
|
-
|
|
3267
|
+
rt,
|
|
3235
3268
|
{
|
|
3236
3269
|
variant: "light",
|
|
3237
3270
|
title: e,
|
|
@@ -3257,17 +3290,17 @@ const lr = {
|
|
|
3257
3290
|
cta: m,
|
|
3258
3291
|
onClick: g
|
|
3259
3292
|
}) => {
|
|
3260
|
-
const u = gn(r, l), f =
|
|
3293
|
+
const u = gn(r, l), f = at(a), c = m == null && f != null && !u ? f : void 0, p = m == null && !u && c != null ? g : void 0;
|
|
3261
3294
|
return /* @__PURE__ */ h(
|
|
3262
|
-
|
|
3295
|
+
Re,
|
|
3263
3296
|
{
|
|
3264
3297
|
variant: "dark",
|
|
3265
3298
|
href: c,
|
|
3266
|
-
onClick:
|
|
3267
|
-
bgClassName:
|
|
3299
|
+
onClick: p,
|
|
3300
|
+
bgClassName: Oe(r, l) ? it : void 0,
|
|
3268
3301
|
children: [
|
|
3269
3302
|
o === "featured" && /* @__PURE__ */ n(
|
|
3270
|
-
|
|
3303
|
+
Le,
|
|
3271
3304
|
{
|
|
3272
3305
|
variant: "dark",
|
|
3273
3306
|
thumbnailUrl: i,
|
|
@@ -3277,7 +3310,7 @@ const lr = {
|
|
|
3277
3310
|
}
|
|
3278
3311
|
),
|
|
3279
3312
|
/* @__PURE__ */ n(
|
|
3280
|
-
|
|
3313
|
+
rt,
|
|
3281
3314
|
{
|
|
3282
3315
|
variant: "dark",
|
|
3283
3316
|
title: e,
|
|
@@ -3292,9 +3325,9 @@ const lr = {
|
|
|
3292
3325
|
}
|
|
3293
3326
|
);
|
|
3294
3327
|
}, Si = {
|
|
3295
|
-
Composer:
|
|
3328
|
+
Composer: pr,
|
|
3296
3329
|
Sent: vr,
|
|
3297
|
-
Received:
|
|
3330
|
+
Received: br
|
|
3298
3331
|
}, xr = {
|
|
3299
3332
|
dark: "bg-[#121110]",
|
|
3300
3333
|
light: "bg-[#e9eaed]"
|
|
@@ -3317,7 +3350,7 @@ const lr = {
|
|
|
3317
3350
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3318
3351
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3319
3352
|
}
|
|
3320
|
-
},
|
|
3353
|
+
}, ye = ({
|
|
3321
3354
|
variant: e,
|
|
3322
3355
|
text: t,
|
|
3323
3356
|
bordered: s = !0,
|
|
@@ -3369,7 +3402,7 @@ const lr = {
|
|
|
3369
3402
|
]
|
|
3370
3403
|
}
|
|
3371
3404
|
);
|
|
3372
|
-
},
|
|
3405
|
+
}, Ce = ({
|
|
3373
3406
|
onClick: e,
|
|
3374
3407
|
variant: t = "overlay",
|
|
3375
3408
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3385,9 +3418,9 @@ const lr = {
|
|
|
3385
3418
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3386
3419
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3387
3420
|
),
|
|
3388
|
-
children: /* @__PURE__ */ n(
|
|
3421
|
+
children: /* @__PURE__ */ n(De, { className: "size-3", weight: "bold" })
|
|
3389
3422
|
}
|
|
3390
|
-
),
|
|
3423
|
+
), ke = (e) => e === "received" ? "light" : "dark", Ii = ({
|
|
3391
3424
|
firstOfGroup: e,
|
|
3392
3425
|
endOfGroup: t,
|
|
3393
3426
|
groupedByUser: s
|
|
@@ -3408,7 +3441,7 @@ const lr = {
|
|
|
3408
3441
|
}
|
|
3409
3442
|
),
|
|
3410
3443
|
s ?? null
|
|
3411
|
-
] }),
|
|
3444
|
+
] }), ot = ({
|
|
3412
3445
|
state: e,
|
|
3413
3446
|
src: t,
|
|
3414
3447
|
mimeType: s,
|
|
@@ -3419,18 +3452,18 @@ const lr = {
|
|
|
3419
3452
|
preload: o,
|
|
3420
3453
|
onDismiss: d
|
|
3421
3454
|
}) => {
|
|
3422
|
-
const m =
|
|
3455
|
+
const m = ke(e), g = e === "composer" && !!d, u = Cr({ src: t, mimeType: s, filename: a, items: r });
|
|
3423
3456
|
if (u.length === 0)
|
|
3424
3457
|
return null;
|
|
3425
3458
|
const f = o ?? (u.length > 1 ? "none" : "metadata");
|
|
3426
3459
|
return /* @__PURE__ */ n(
|
|
3427
|
-
|
|
3460
|
+
ye,
|
|
3428
3461
|
{
|
|
3429
3462
|
variant: m,
|
|
3430
3463
|
text: i,
|
|
3431
3464
|
groupPosition: l,
|
|
3432
3465
|
"data-testid": "audio-attachment",
|
|
3433
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3466
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, p) => /* @__PURE__ */ n(
|
|
3434
3467
|
kr,
|
|
3435
3468
|
{
|
|
3436
3469
|
item: c,
|
|
@@ -3438,14 +3471,14 @@ const lr = {
|
|
|
3438
3471
|
trailingAction: (
|
|
3439
3472
|
// Composer only supports a single attachment, so the
|
|
3440
3473
|
// dismiss control sits on the only player.
|
|
3441
|
-
g &&
|
|
3474
|
+
g && p === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
|
|
3442
3475
|
)
|
|
3443
3476
|
},
|
|
3444
|
-
`${c.src}-${
|
|
3477
|
+
`${c.src}-${p}`
|
|
3445
3478
|
)) })
|
|
3446
3479
|
}
|
|
3447
3480
|
);
|
|
3448
|
-
}, Er = (e) => /* @__PURE__ */ n(
|
|
3481
|
+
}, Er = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), Sr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Ir = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), Tr = {
|
|
3449
3482
|
Composer: Er,
|
|
3450
3483
|
Sent: Sr,
|
|
3451
3484
|
Received: Ir
|
|
@@ -3472,7 +3505,7 @@ function Rr(e, t) {
|
|
|
3472
3505
|
}
|
|
3473
3506
|
}
|
|
3474
3507
|
if (!e) return;
|
|
3475
|
-
if (
|
|
3508
|
+
if (ie(e) === "document") {
|
|
3476
3509
|
const r = tn(e), i = Mr[r];
|
|
3477
3510
|
if (i) return i;
|
|
3478
3511
|
if (e === "application/octet-stream") return;
|
|
@@ -3485,7 +3518,7 @@ function Lr(e, t, s) {
|
|
|
3485
3518
|
const a = Rr(e, t), r = typeof s == "number" && s > 0 ? Ar(s) : void 0;
|
|
3486
3519
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3487
3520
|
}
|
|
3488
|
-
function
|
|
3521
|
+
function ae(e) {
|
|
3489
3522
|
try {
|
|
3490
3523
|
const s = new URL(e).pathname.split("/").pop();
|
|
3491
3524
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3502,7 +3535,7 @@ const Dr = {
|
|
|
3502
3535
|
}, Pr = {
|
|
3503
3536
|
dark: "text-white/85",
|
|
3504
3537
|
light: "text-black/85"
|
|
3505
|
-
},
|
|
3538
|
+
}, pn = ({
|
|
3506
3539
|
variant: e,
|
|
3507
3540
|
filename: t,
|
|
3508
3541
|
title: s,
|
|
@@ -3552,7 +3585,7 @@ const Dr = {
|
|
|
3552
3585
|
u
|
|
3553
3586
|
]
|
|
3554
3587
|
}
|
|
3555
|
-
) : /* @__PURE__ */ h(
|
|
3588
|
+
) : /* @__PURE__ */ h(te, { children: [
|
|
3556
3589
|
g,
|
|
3557
3590
|
u
|
|
3558
3591
|
] });
|
|
@@ -3561,8 +3594,8 @@ const Dr = {
|
|
|
3561
3594
|
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
3562
3595
|
] });
|
|
3563
3596
|
};
|
|
3564
|
-
async function
|
|
3565
|
-
const s = t ??
|
|
3597
|
+
async function bn(e, t) {
|
|
3598
|
+
const s = t ?? ae(e);
|
|
3566
3599
|
try {
|
|
3567
3600
|
const a = await fetch(e, { mode: "cors" });
|
|
3568
3601
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -3589,9 +3622,9 @@ const zr = ({
|
|
|
3589
3622
|
onActivate: a,
|
|
3590
3623
|
trailingAction: r
|
|
3591
3624
|
}) => {
|
|
3592
|
-
const i = t.filename ??
|
|
3625
|
+
const i = t.filename ?? ae(t.src);
|
|
3593
3626
|
return /* @__PURE__ */ n(
|
|
3594
|
-
|
|
3627
|
+
pn,
|
|
3595
3628
|
{
|
|
3596
3629
|
variant: e,
|
|
3597
3630
|
filename: i,
|
|
@@ -3603,7 +3636,7 @@ const zr = ({
|
|
|
3603
3636
|
trailingAction: r
|
|
3604
3637
|
}
|
|
3605
3638
|
);
|
|
3606
|
-
},
|
|
3639
|
+
}, lt = ({
|
|
3607
3640
|
state: e,
|
|
3608
3641
|
src: t,
|
|
3609
3642
|
filename: s,
|
|
@@ -3616,19 +3649,19 @@ const zr = ({
|
|
|
3616
3649
|
onClick: m,
|
|
3617
3650
|
onDismiss: g
|
|
3618
3651
|
}) => {
|
|
3619
|
-
const u =
|
|
3652
|
+
const u = ke(e), f = e === "composer" && !!g, c = zr({
|
|
3620
3653
|
src: t,
|
|
3621
3654
|
filename: s,
|
|
3622
3655
|
fileSize: a,
|
|
3623
3656
|
mimeType: r,
|
|
3624
3657
|
title: i,
|
|
3625
3658
|
items: l
|
|
3626
|
-
}),
|
|
3627
|
-
if ((m == null ? void 0 : m(
|
|
3628
|
-
const
|
|
3629
|
-
if (!
|
|
3630
|
-
const
|
|
3631
|
-
|
|
3659
|
+
}), p = (x) => {
|
|
3660
|
+
if ((m == null ? void 0 : m(x)) === !1) return;
|
|
3661
|
+
const b = c[x];
|
|
3662
|
+
if (!b) return;
|
|
3663
|
+
const v = b.filename ?? ae(b.src);
|
|
3664
|
+
bn(b.src, v);
|
|
3632
3665
|
};
|
|
3633
3666
|
if (c.length === 0)
|
|
3634
3667
|
return null;
|
|
@@ -3640,39 +3673,39 @@ const zr = ({
|
|
|
3640
3673
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3641
3674
|
),
|
|
3642
3675
|
"aria-hidden": !0,
|
|
3643
|
-
children: /* @__PURE__ */ n(
|
|
3676
|
+
children: /* @__PURE__ */ n(we, { className: "size-5", weight: "bold" })
|
|
3644
3677
|
}
|
|
3645
3678
|
);
|
|
3646
3679
|
return /* @__PURE__ */ n(
|
|
3647
|
-
|
|
3680
|
+
ye,
|
|
3648
3681
|
{
|
|
3649
3682
|
variant: u,
|
|
3650
3683
|
text: o,
|
|
3651
3684
|
groupPosition: d,
|
|
3652
3685
|
"data-testid": "file-attachment",
|
|
3653
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3686
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((x, b) => /* @__PURE__ */ n(
|
|
3654
3687
|
$r,
|
|
3655
3688
|
{
|
|
3656
3689
|
variant: u,
|
|
3657
|
-
item:
|
|
3658
|
-
index:
|
|
3659
|
-
onActivate:
|
|
3660
|
-
trailingAction: f &&
|
|
3690
|
+
item: x,
|
|
3691
|
+
index: b,
|
|
3692
|
+
onActivate: p,
|
|
3693
|
+
trailingAction: f && b === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : _
|
|
3661
3694
|
},
|
|
3662
|
-
`${
|
|
3695
|
+
`${x.src}-${b}`
|
|
3663
3696
|
)) })
|
|
3664
3697
|
}
|
|
3665
3698
|
);
|
|
3666
|
-
}, Fr = (e) => /* @__PURE__ */ n(
|
|
3699
|
+
}, Fr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Br = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), Ur = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), jr = {
|
|
3667
3700
|
Composer: Fr,
|
|
3668
3701
|
Sent: Br,
|
|
3669
3702
|
Received: Ur
|
|
3670
|
-
},
|
|
3703
|
+
}, ct = ({
|
|
3671
3704
|
onPrev: e,
|
|
3672
3705
|
onNext: t,
|
|
3673
3706
|
prevLabel: s = "Previous",
|
|
3674
3707
|
nextLabel: a = "Next"
|
|
3675
|
-
}) => /* @__PURE__ */ h(
|
|
3708
|
+
}) => /* @__PURE__ */ h(te, { children: [
|
|
3676
3709
|
/* @__PURE__ */ n(
|
|
3677
3710
|
"button",
|
|
3678
3711
|
{
|
|
@@ -3690,7 +3723,7 @@ const zr = ({
|
|
|
3690
3723
|
onClick: t,
|
|
3691
3724
|
"aria-label": a,
|
|
3692
3725
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3693
|
-
children: /* @__PURE__ */ n(
|
|
3726
|
+
children: /* @__PURE__ */ n(He, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3694
3727
|
}
|
|
3695
3728
|
)
|
|
3696
3729
|
] }), vn = ({
|
|
@@ -3704,7 +3737,7 @@ const zr = ({
|
|
|
3704
3737
|
}) => {
|
|
3705
3738
|
const [o, d] = F(!1), m = J(
|
|
3706
3739
|
(c) => {
|
|
3707
|
-
c.stopPropagation(), !o && (d(!0),
|
|
3740
|
+
c.stopPropagation(), !o && (d(!0), bn(e, t).catch(() => {
|
|
3708
3741
|
}).finally(() => {
|
|
3709
3742
|
d(!1), l == null || l();
|
|
3710
3743
|
}));
|
|
@@ -3729,14 +3762,14 @@ const zr = ({
|
|
|
3729
3762
|
}[i]
|
|
3730
3763
|
),
|
|
3731
3764
|
children: o ? /* @__PURE__ */ n(
|
|
3732
|
-
|
|
3765
|
+
xe,
|
|
3733
3766
|
{
|
|
3734
3767
|
className: "size-4 animate-spin",
|
|
3735
3768
|
weight: "bold",
|
|
3736
3769
|
"aria-hidden": !0
|
|
3737
3770
|
}
|
|
3738
3771
|
) : /* @__PURE__ */ n(
|
|
3739
|
-
|
|
3772
|
+
we,
|
|
3740
3773
|
{
|
|
3741
3774
|
className: "size-5 shrink-0",
|
|
3742
3775
|
weight: "bold",
|
|
@@ -3752,7 +3785,7 @@ const zr = ({
|
|
|
3752
3785
|
disabled: o,
|
|
3753
3786
|
"aria-label": a,
|
|
3754
3787
|
className: "mes-media-viewer__action",
|
|
3755
|
-
children: o ? /* @__PURE__ */ n(
|
|
3788
|
+
children: o ? /* @__PURE__ */ n(xe, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3756
3789
|
}
|
|
3757
3790
|
) : /* @__PURE__ */ h(
|
|
3758
3791
|
"button",
|
|
@@ -3767,27 +3800,27 @@ const zr = ({
|
|
|
3767
3800
|
),
|
|
3768
3801
|
children: [
|
|
3769
3802
|
o ? /* @__PURE__ */ n(
|
|
3770
|
-
|
|
3803
|
+
xe,
|
|
3771
3804
|
{
|
|
3772
3805
|
className: "size-4 animate-spin",
|
|
3773
3806
|
weight: "bold",
|
|
3774
3807
|
"aria-hidden": !0
|
|
3775
3808
|
}
|
|
3776
|
-
) : /* @__PURE__ */ n(
|
|
3809
|
+
) : /* @__PURE__ */ n(we, { ...f, "aria-hidden": !0 }),
|
|
3777
3810
|
g ? null : a
|
|
3778
3811
|
]
|
|
3779
3812
|
}
|
|
3780
3813
|
);
|
|
3781
|
-
},
|
|
3814
|
+
}, je = (e, t, s) => Math.min(Math.max(e, t), s), dt = ({
|
|
3782
3815
|
length: e,
|
|
3783
3816
|
initialIndex: t,
|
|
3784
3817
|
open: s
|
|
3785
3818
|
}) => {
|
|
3786
|
-
const a =
|
|
3819
|
+
const a = je(t, 0, Math.max(e - 1, 0)), [r, i] = F(a);
|
|
3787
3820
|
K(() => {
|
|
3788
|
-
s && i(
|
|
3821
|
+
s && i(je(t, 0, Math.max(e - 1, 0)));
|
|
3789
3822
|
}, [s, t, e]), K(() => {
|
|
3790
|
-
i((d) =>
|
|
3823
|
+
i((d) => je(d, 0, Math.max(e - 1, 0)));
|
|
3791
3824
|
}, [e]);
|
|
3792
3825
|
const l = J(() => {
|
|
3793
3826
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
@@ -3803,7 +3836,7 @@ const zr = ({
|
|
|
3803
3836
|
};
|
|
3804
3837
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3805
3838
|
}, [s, e, l, o]), { index: r, prev: l, next: o };
|
|
3806
|
-
},
|
|
3839
|
+
}, ut = ({
|
|
3807
3840
|
open: e,
|
|
3808
3841
|
onClose: t,
|
|
3809
3842
|
ariaLabel: s,
|
|
@@ -3812,7 +3845,7 @@ const zr = ({
|
|
|
3812
3845
|
children: i,
|
|
3813
3846
|
"data-testid": l
|
|
3814
3847
|
}) => {
|
|
3815
|
-
const o =
|
|
3848
|
+
const o = H(null), d = H(null);
|
|
3816
3849
|
return K(() => {
|
|
3817
3850
|
var f;
|
|
3818
3851
|
const u = o.current;
|
|
@@ -3884,7 +3917,7 @@ const zr = ({
|
|
|
3884
3917
|
onClick: t,
|
|
3885
3918
|
"aria-label": "Close viewer",
|
|
3886
3919
|
className: "mes-media-viewer__action",
|
|
3887
|
-
children: /* @__PURE__ */ n(
|
|
3920
|
+
children: /* @__PURE__ */ n(De, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3888
3921
|
}
|
|
3889
3922
|
)
|
|
3890
3923
|
] })
|
|
@@ -3899,16 +3932,16 @@ const zr = ({
|
|
|
3899
3932
|
initialIndex: s = 0,
|
|
3900
3933
|
onClose: a
|
|
3901
3934
|
}) => {
|
|
3902
|
-
const { index: r, prev: i, next: l } =
|
|
3935
|
+
const { index: r, prev: i, next: l } = dt({
|
|
3903
3936
|
length: t.length,
|
|
3904
3937
|
initialIndex: s,
|
|
3905
3938
|
open: e
|
|
3906
|
-
}), o = t[r], d =
|
|
3907
|
-
() => (o == null ? void 0 : o.filename) ?? (o ?
|
|
3939
|
+
}), o = t[r], d = re(
|
|
3940
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "image"),
|
|
3908
3941
|
[o]
|
|
3909
3942
|
);
|
|
3910
3943
|
return o ? /* @__PURE__ */ h(
|
|
3911
|
-
|
|
3944
|
+
ut,
|
|
3912
3945
|
{
|
|
3913
3946
|
open: e,
|
|
3914
3947
|
onClose: a,
|
|
@@ -3938,7 +3971,7 @@ const zr = ({
|
|
|
3938
3971
|
`${r}:${o.src}`
|
|
3939
3972
|
),
|
|
3940
3973
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3941
|
-
|
|
3974
|
+
ct,
|
|
3942
3975
|
{
|
|
3943
3976
|
onPrev: i,
|
|
3944
3977
|
onNext: l,
|
|
@@ -4019,7 +4052,7 @@ const zr = ({
|
|
|
4019
4052
|
})
|
|
4020
4053
|
}
|
|
4021
4054
|
);
|
|
4022
|
-
},
|
|
4055
|
+
}, Ee = (e) => {
|
|
4023
4056
|
const [t, s] = F(!1), [a, r] = F(0), i = J(
|
|
4024
4057
|
(o) => {
|
|
4025
4058
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
@@ -4051,7 +4084,7 @@ const zr = ({
|
|
|
4051
4084
|
alt: s.alt,
|
|
4052
4085
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4053
4086
|
})), Yr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4054
|
-
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } =
|
|
4087
|
+
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Ee(
|
|
4055
4088
|
r
|
|
4056
4089
|
);
|
|
4057
4090
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4075,7 +4108,7 @@ const zr = ({
|
|
|
4075
4108
|
)
|
|
4076
4109
|
}
|
|
4077
4110
|
),
|
|
4078
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4111
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: i }) }) : null,
|
|
4079
4112
|
/* @__PURE__ */ n(
|
|
4080
4113
|
xn,
|
|
4081
4114
|
{
|
|
@@ -4097,16 +4130,16 @@ const zr = ({
|
|
|
4097
4130
|
loading: o = "lazy",
|
|
4098
4131
|
onClick: d
|
|
4099
4132
|
}) => {
|
|
4100
|
-
const m = Hr({ src: t, alt: s, items: r }), g =
|
|
4133
|
+
const m = Hr({ src: t, alt: s, items: r }), g = ke(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: p } = Ee(
|
|
4101
4134
|
d
|
|
4102
4135
|
);
|
|
4103
4136
|
if (m.length === 0)
|
|
4104
4137
|
return null;
|
|
4105
4138
|
const _ = m.map(
|
|
4106
|
-
(
|
|
4139
|
+
(x, b) => Gr(x, b, m.length, o)
|
|
4107
4140
|
);
|
|
4108
4141
|
return /* @__PURE__ */ h(
|
|
4109
|
-
|
|
4142
|
+
ye,
|
|
4110
4143
|
{
|
|
4111
4144
|
variant: g,
|
|
4112
4145
|
text: i,
|
|
@@ -4120,7 +4153,7 @@ const zr = ({
|
|
|
4120
4153
|
open: u,
|
|
4121
4154
|
items: _n(m, a),
|
|
4122
4155
|
initialIndex: f,
|
|
4123
|
-
onClose:
|
|
4156
|
+
onClose: p
|
|
4124
4157
|
}
|
|
4125
4158
|
)
|
|
4126
4159
|
]
|
|
@@ -4136,19 +4169,19 @@ const zr = ({
|
|
|
4136
4169
|
initialIndex: s = 0,
|
|
4137
4170
|
onClose: a
|
|
4138
4171
|
}) => {
|
|
4139
|
-
const { index: r, prev: i, next: l } =
|
|
4172
|
+
const { index: r, prev: i, next: l } = dt({
|
|
4140
4173
|
length: t.length,
|
|
4141
4174
|
initialIndex: s,
|
|
4142
4175
|
open: e
|
|
4143
|
-
}), o = t[r], d =
|
|
4144
|
-
() => (o == null ? void 0 : o.filename) ?? (o ?
|
|
4176
|
+
}), o = t[r], d = re(
|
|
4177
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "document"),
|
|
4145
4178
|
[o]
|
|
4146
|
-
), m =
|
|
4179
|
+
), m = re(
|
|
4147
4180
|
() => o ? Zr(o.src) : void 0,
|
|
4148
4181
|
[o]
|
|
4149
4182
|
);
|
|
4150
4183
|
return !o || !m ? null : /* @__PURE__ */ h(
|
|
4151
|
-
|
|
4184
|
+
ut,
|
|
4152
4185
|
{
|
|
4153
4186
|
open: e,
|
|
4154
4187
|
onClose: a,
|
|
@@ -4167,7 +4200,7 @@ const zr = ({
|
|
|
4167
4200
|
`${r}:${o.src}`
|
|
4168
4201
|
),
|
|
4169
4202
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4170
|
-
|
|
4203
|
+
ct,
|
|
4171
4204
|
{
|
|
4172
4205
|
onPrev: i,
|
|
4173
4206
|
onNext: l,
|
|
@@ -4194,9 +4227,9 @@ const zr = ({
|
|
|
4194
4227
|
onActivate: a,
|
|
4195
4228
|
trailingAction: r
|
|
4196
4229
|
}) => {
|
|
4197
|
-
const i = t.filename ??
|
|
4230
|
+
const i = t.filename ?? ae(t.src);
|
|
4198
4231
|
return /* @__PURE__ */ n(
|
|
4199
|
-
|
|
4232
|
+
pn,
|
|
4200
4233
|
{
|
|
4201
4234
|
variant: e,
|
|
4202
4235
|
filename: i,
|
|
@@ -4208,7 +4241,7 @@ const zr = ({
|
|
|
4208
4241
|
trailingAction: r
|
|
4209
4242
|
}
|
|
4210
4243
|
);
|
|
4211
|
-
},
|
|
4244
|
+
}, mt = ({
|
|
4212
4245
|
state: e,
|
|
4213
4246
|
src: t,
|
|
4214
4247
|
filename: s,
|
|
@@ -4220,31 +4253,31 @@ const zr = ({
|
|
|
4220
4253
|
onClick: d,
|
|
4221
4254
|
onDismiss: m
|
|
4222
4255
|
}) => {
|
|
4223
|
-
const g =
|
|
4256
|
+
const g = ke(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: p, closeViewer: _ } = Ee(
|
|
4224
4257
|
d
|
|
4225
|
-
),
|
|
4258
|
+
), x = e === "composer" && !!m;
|
|
4226
4259
|
if (u.length === 0)
|
|
4227
4260
|
return null;
|
|
4228
|
-
const
|
|
4229
|
-
src:
|
|
4230
|
-
filename:
|
|
4261
|
+
const b = u.map((v) => ({
|
|
4262
|
+
src: v.src,
|
|
4263
|
+
filename: v.filename ?? ae(v.src)
|
|
4231
4264
|
}));
|
|
4232
4265
|
return /* @__PURE__ */ h(
|
|
4233
|
-
|
|
4266
|
+
ye,
|
|
4234
4267
|
{
|
|
4235
4268
|
variant: g,
|
|
4236
4269
|
text: l,
|
|
4237
4270
|
groupPosition: o,
|
|
4238
4271
|
"data-testid": "pdf-attachment",
|
|
4239
4272
|
children: [
|
|
4240
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4241
|
-
const
|
|
4273
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((v, M) => {
|
|
4274
|
+
const I = v.filename ?? ae(v.src), N = x && M === 0 ? /* @__PURE__ */ n(Ce, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4242
4275
|
vn,
|
|
4243
4276
|
{
|
|
4244
|
-
url:
|
|
4245
|
-
filename:
|
|
4277
|
+
url: v.src,
|
|
4278
|
+
filename: I,
|
|
4246
4279
|
variant: "inline",
|
|
4247
|
-
label: `Download ${
|
|
4280
|
+
label: `Download ${I}`,
|
|
4248
4281
|
tone: g
|
|
4249
4282
|
}
|
|
4250
4283
|
);
|
|
@@ -4252,19 +4285,19 @@ const zr = ({
|
|
|
4252
4285
|
ei,
|
|
4253
4286
|
{
|
|
4254
4287
|
variant: g,
|
|
4255
|
-
item:
|
|
4256
|
-
index:
|
|
4257
|
-
onActivate:
|
|
4258
|
-
trailingAction:
|
|
4288
|
+
item: v,
|
|
4289
|
+
index: M,
|
|
4290
|
+
onActivate: p,
|
|
4291
|
+
trailingAction: N
|
|
4259
4292
|
},
|
|
4260
|
-
`${
|
|
4293
|
+
`${v.src}-${M}`
|
|
4261
4294
|
);
|
|
4262
4295
|
}) }),
|
|
4263
4296
|
/* @__PURE__ */ n(
|
|
4264
4297
|
Jr,
|
|
4265
4298
|
{
|
|
4266
4299
|
open: f,
|
|
4267
|
-
items:
|
|
4300
|
+
items: b,
|
|
4268
4301
|
initialIndex: c,
|
|
4269
4302
|
onClose: _
|
|
4270
4303
|
}
|
|
@@ -4272,7 +4305,7 @@ const zr = ({
|
|
|
4272
4305
|
]
|
|
4273
4306
|
}
|
|
4274
4307
|
);
|
|
4275
|
-
}, ti = (e) => /* @__PURE__ */ n(
|
|
4308
|
+
}, ti = (e) => /* @__PURE__ */ n(mt, { ...e, state: "composer" }), ni = (e) => /* @__PURE__ */ n(mt, { ...e, state: "sent" }), si = (e) => /* @__PURE__ */ n(mt, { ...e, state: "received" }), ai = {
|
|
4276
4309
|
Composer: ti,
|
|
4277
4310
|
Sent: ni,
|
|
4278
4311
|
Received: si
|
|
@@ -4282,16 +4315,16 @@ const zr = ({
|
|
|
4282
4315
|
initialIndex: s = 0,
|
|
4283
4316
|
onClose: a
|
|
4284
4317
|
}) => {
|
|
4285
|
-
const { index: r, prev: i, next: l } =
|
|
4318
|
+
const { index: r, prev: i, next: l } = dt({
|
|
4286
4319
|
length: t.length,
|
|
4287
4320
|
initialIndex: s,
|
|
4288
4321
|
open: e
|
|
4289
|
-
}), o = t[r], d =
|
|
4290
|
-
() => (o == null ? void 0 : o.filename) ?? (o ?
|
|
4322
|
+
}), o = t[r], d = re(
|
|
4323
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "video"),
|
|
4291
4324
|
[o]
|
|
4292
4325
|
);
|
|
4293
4326
|
return o ? /* @__PURE__ */ h(
|
|
4294
|
-
|
|
4327
|
+
ut,
|
|
4295
4328
|
{
|
|
4296
4329
|
open: e,
|
|
4297
4330
|
onClose: a,
|
|
@@ -4315,7 +4348,7 @@ const zr = ({
|
|
|
4315
4348
|
`${r}:${o.src}`
|
|
4316
4349
|
),
|
|
4317
4350
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4318
|
-
|
|
4351
|
+
ct,
|
|
4319
4352
|
{
|
|
4320
4353
|
onPrev: i,
|
|
4321
4354
|
onNext: l,
|
|
@@ -4326,7 +4359,7 @@ const zr = ({
|
|
|
4326
4359
|
]
|
|
4327
4360
|
}
|
|
4328
4361
|
) : null;
|
|
4329
|
-
}, ri = () => /* @__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(
|
|
4362
|
+
}, ri = () => /* @__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(Ge, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Cn = ({
|
|
4330
4363
|
item: e,
|
|
4331
4364
|
index: t
|
|
4332
4365
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4365,7 +4398,7 @@ const zr = ({
|
|
|
4365
4398
|
preload: s.preload,
|
|
4366
4399
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4367
4400
|
})), li = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4368
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } =
|
|
4401
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } = Ee(
|
|
4369
4402
|
i
|
|
4370
4403
|
);
|
|
4371
4404
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4379,7 +4412,7 @@ const zr = ({
|
|
|
4379
4412
|
children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4380
4413
|
}
|
|
4381
4414
|
),
|
|
4382
|
-
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4415
|
+
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: l }) }) : null,
|
|
4383
4416
|
/* @__PURE__ */ n(
|
|
4384
4417
|
yn,
|
|
4385
4418
|
{
|
|
@@ -4405,16 +4438,16 @@ const zr = ({
|
|
|
4405
4438
|
preload: d,
|
|
4406
4439
|
onClick: m
|
|
4407
4440
|
}) => {
|
|
4408
|
-
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u =
|
|
4441
|
+
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = ke(e), { viewerOpen: f, viewerIndex: c, handleActivate: p, closeViewer: _ } = Ee(
|
|
4409
4442
|
m
|
|
4410
4443
|
);
|
|
4411
4444
|
if (g.length === 0)
|
|
4412
4445
|
return null;
|
|
4413
|
-
const
|
|
4414
|
-
(
|
|
4446
|
+
const x = g.map(
|
|
4447
|
+
(b, v) => ii(b, v, g.length)
|
|
4415
4448
|
);
|
|
4416
4449
|
return /* @__PURE__ */ h(
|
|
4417
|
-
|
|
4450
|
+
ye,
|
|
4418
4451
|
{
|
|
4419
4452
|
variant: u,
|
|
4420
4453
|
text: l,
|
|
@@ -4424,8 +4457,8 @@ const zr = ({
|
|
|
4424
4457
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4425
4458
|
wn,
|
|
4426
4459
|
{
|
|
4427
|
-
tiles:
|
|
4428
|
-
onTileActivate:
|
|
4460
|
+
tiles: x,
|
|
4461
|
+
onTileActivate: p,
|
|
4429
4462
|
className: "overflow-hidden rounded-md"
|
|
4430
4463
|
}
|
|
4431
4464
|
) }),
|
|
@@ -4485,7 +4518,7 @@ const zr = ({
|
|
|
4485
4518
|
const o = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4486
4519
|
return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4487
4520
|
(i || l) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4488
|
-
|
|
4521
|
+
se,
|
|
4489
4522
|
{
|
|
4490
4523
|
id: l || "account",
|
|
4491
4524
|
name: l || "Account",
|
|
@@ -4524,14 +4557,14 @@ export {
|
|
|
4524
4557
|
Ai as F,
|
|
4525
4558
|
Si as L,
|
|
4526
4559
|
yi as M,
|
|
4527
|
-
|
|
4528
|
-
|
|
4560
|
+
pe as a,
|
|
4561
|
+
se as b,
|
|
4529
4562
|
rr as c,
|
|
4530
4563
|
mn as d,
|
|
4531
4564
|
Ci as e,
|
|
4532
4565
|
hi as f,
|
|
4533
|
-
|
|
4534
|
-
|
|
4566
|
+
ie as g,
|
|
4567
|
+
Bt as h,
|
|
4535
4568
|
Ti as i,
|
|
4536
4569
|
Ca as j,
|
|
4537
4570
|
Ni as k,
|
|
@@ -4546,9 +4579,9 @@ export {
|
|
|
4546
4579
|
$s as t,
|
|
4547
4580
|
Ii as u,
|
|
4548
4581
|
Ys as v,
|
|
4549
|
-
|
|
4550
|
-
|
|
4582
|
+
tt as w,
|
|
4583
|
+
nt as x,
|
|
4551
4584
|
Jt as y,
|
|
4552
4585
|
ki as z
|
|
4553
4586
|
};
|
|
4554
|
-
//# sourceMappingURL=index-
|
|
4587
|
+
//# sourceMappingURL=index-D9JJLtJg.js.map
|