@linktr.ee/messaging-react 3.6.0 → 3.6.1-rc-1783305041
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-J8f28GLS.js → Card-BF8hqtLR.js} +3 -3
- package/dist/{Card-J8f28GLS.js.map → Card-BF8hqtLR.js.map} +1 -1
- package/dist/{Card-DzT94KFC.cjs → Card-BJrIwVBx.cjs} +2 -2
- package/dist/{Card-DzT94KFC.cjs.map → Card-BJrIwVBx.cjs.map} +1 -1
- package/dist/{Card-DmjLrV64.cjs → Card-Cavq6QXu.cjs} +2 -2
- package/dist/{Card-DmjLrV64.cjs.map → Card-Cavq6QXu.cjs.map} +1 -1
- package/dist/{Card-ra-g17Ur.js → Card-CsPLNSTP.js} +2 -2
- package/dist/{Card-ra-g17Ur.js.map → Card-CsPLNSTP.js.map} +1 -1
- package/dist/{Card-Cb4yfxFK.cjs → Card-HcMDKbWd.cjs} +2 -2
- package/dist/{Card-Cb4yfxFK.cjs.map → Card-HcMDKbWd.cjs.map} +1 -1
- package/dist/{Card-COTwOzVb.js → Card-_SSVVgkv.js} +2 -2
- package/dist/{Card-COTwOzVb.js.map → Card-_SSVVgkv.js.map} +1 -1
- package/dist/{LockedThumbnail-CVq5LPXE.js → LockedThumbnail-Bqz_Fq66.js} +2 -2
- package/dist/{LockedThumbnail-CVq5LPXE.js.map → LockedThumbnail-Bqz_Fq66.js.map} +1 -1
- package/dist/{LockedThumbnail-Ds_vBmYm.cjs → LockedThumbnail-DN3UoQvw.cjs} +2 -2
- package/dist/{LockedThumbnail-Ds_vBmYm.cjs.map → LockedThumbnail-DN3UoQvw.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/index-BoB8DqqZ.cjs +2 -0
- package/dist/index-BoB8DqqZ.cjs.map +1 -0
- package/dist/{index-D1XVCH1o.js → index-C4ipGbuZ.js} +1216 -1190
- package/dist/index-C4ipGbuZ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +35 -0
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +72 -0
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +49 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +33 -0
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +9 -3
- package/src/components/CustomMessage/index.tsx +18 -4
- package/src/styles.css +19 -1
- package/dist/index-D1XVCH1o.js.map +0 -1
- package/dist/index-hvrSZScU.cjs +0 -2
- package/dist/index-hvrSZScU.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ke, DotsThreeIcon as
|
|
2
|
+
import B, { createContext as et, useContext as Se, useCallback as K, useState as $, useRef as Y, useEffect as X, useId as Gn, useMemo as ne, Suspense as tt } from "react";
|
|
3
|
+
import { StreamChatService as Hn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Yn, LinkPreviewsManager as jt } from "stream-chat";
|
|
5
|
+
import { Chat as qn, DateSeparator as Wn, useChannelStateContext as be, useChatContext as ve, areMessageUIPropsEqual as Xn, useMessageReminder as Kn, useComponentContext as sn, Attachment as Jn, EditMessageModal as Zn, MessageBlocked as Qn, MessageBouncePrompt as es, MessageDeleted as ts, MessageIsThreadReplyInChannelButtonIndicator as ns, MessageRepliesCountButton as ss, ReminderNotification as as, StreamedMessageText as rs, messageHasAttachments as is, messageHasReactions as os, isDateSeparatorMessage as ls, isMessageBlocked as cs, isMessageBounced as ds, MessageBounceModal as us, MessageText as Ut, MessageErrorIcon as Vt, Poll as ms, useMessageContext as Ee, useMessageComposer as hs, useStateStore as fs, MessageInput as gs, useMessageInputContext as ps, useMessageComposerHasSendableData as bs, AttachmentPreviewList as vs, QuotedMessagePreview as xs, TextareaComposer as ws, MessageTimestamp as Ge, AIStates as He, useTypingContext as _s, useAIState as Ns, Channel as ys, WithComponents as Cs, Window as ks, MessageList as Ss, ChannelList as Es, InfiniteScroll as Is } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ke, DotsThreeIcon as Ts, SpinnerGapIcon as De, SignOutIcon as As, ProhibitInsetIcon as Gt, FlagIcon as an, FileIcon as rn, ImageIcon as Ms, SpeakerHighIcon as Ls, VideoCameraIcon as on, FileMdIcon as Rs, FileTextIcon as Ds, FileZipIcon as Ps, FilePptIcon as zs, FileCsvIcon as Os, FileXlsIcon as Fs, FileDocIcon as $s, FilePdfIcon as Bs, CircleNotchIcon as Ce, PlayIcon as Je, PauseIcon as js, LinkIcon as Us, DownloadSimpleIcon as ke, XIcon as Be, CaretLeftIcon as Vs, CaretRightIcon as _e, GiftIcon as Gs, ThumbsUpIcon as Hs, ThumbsDownIcon as Ys, ChecksIcon as qs, PencilSimpleIcon as Ws, TrashSimpleIcon as Xs, ArrowUpIcon as Ks, SparkleIcon as Ne, ProhibitIcon as Js, ArrowLeftIcon as Ht } from "@phosphor-icons/react";
|
|
7
7
|
import C from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as Zs, DefaultDropdownActionButton as ln } from "stream-chat-react/experimental";
|
|
9
|
+
const cn = et({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const on = et({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), nt = () =>
|
|
19
|
+
}), nt = () => Se(cn), to = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,10 +24,10 @@ const on = et({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const o =
|
|
29
|
-
(y, ...
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${y}`, ...
|
|
27
|
+
var T, S;
|
|
28
|
+
const o = K(
|
|
29
|
+
(y, ...I) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${y}`, ...I);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,37 +37,37 @@ const on = et({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [l, d] =
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
40
|
+
const [l, d] = $(null), [u, g] = $(null), [m, f] = $(!1), [b, c] = $(!1), [w, v] = $(null), p = Y(!1), N = Y(null), _ = Y(s);
|
|
41
|
+
_.current = s;
|
|
42
|
+
const M = Y(i);
|
|
43
|
+
M.current = i;
|
|
44
|
+
const L = Y({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), A = Y(0);
|
|
50
|
+
A.current++, o("📊 RENDER INFO", {
|
|
51
|
+
renderCount: A.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: L.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: L.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: L.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: L.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), L.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 && ((
|
|
67
|
-
const P = a ? ((
|
|
68
|
-
|
|
69
|
-
const y =
|
|
70
|
-
if (!a || !P || !
|
|
65
|
+
const R = Y(null);
|
|
66
|
+
a && ((T = R.current) == null ? void 0 : T.apiKey) !== a && (R.current = { apiKey: a, client: new Yn(a) });
|
|
67
|
+
const P = a ? ((S = R.current) == null ? void 0 : S.client) ?? null : null;
|
|
68
|
+
X(() => {
|
|
69
|
+
const y = A.current, I = _.current;
|
|
70
|
+
if (!a || !P || !I) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: y,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,20 +78,20 @@ const on = et({
|
|
|
78
78
|
renderCount: y,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
81
|
+
const O = new Hn({
|
|
82
|
+
...I,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
84
|
+
debug: M.current,
|
|
85
85
|
client: P
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
N.current = O, d(O), o("✅ SERVICE SET", {
|
|
88
88
|
renderCount: y,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!O
|
|
90
90
|
});
|
|
91
91
|
}, [a, P]);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
var
|
|
92
|
+
const j = Y(null);
|
|
93
|
+
X(() => {
|
|
94
|
+
var I, O;
|
|
95
95
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!l,
|
|
97
97
|
hasUser: !!t,
|
|
@@ -107,7 +107,7 @@ const on = et({
|
|
|
107
107
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((I = j.current) == null ? void 0 : I.serviceId) === l && ((O = j.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
111
|
o(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const on = et({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0,
|
|
118
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, c(!0), v(null);
|
|
119
119
|
try {
|
|
120
120
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const F = await l.connectUser(t);
|
|
122
|
+
g(F), f(!0), j.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: F.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch (F) {
|
|
127
|
+
const U = F instanceof Error ? F.message : "Connection failed";
|
|
128
|
+
v(U), o("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: U
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
c(!1), p.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: m
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [l, t, o, m]),
|
|
139
|
+
}, [l, t, o, m]), X(() => {
|
|
140
140
|
const y = P;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
y && (
|
|
142
|
+
var I;
|
|
143
|
+
y && (j.current = null, (I = N.current) == null || I.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [P]);
|
|
146
|
-
const z =
|
|
146
|
+
const z = K(async () => {
|
|
147
147
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!l,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,32 +151,32 @@ const on = et({
|
|
|
151
151
|
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
154
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), c(!0);
|
|
155
155
|
try {
|
|
156
156
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
157
157
|
const y = await l.connectUser(t);
|
|
158
|
-
g(y), f(!0),
|
|
158
|
+
g(y), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
159
|
} catch (y) {
|
|
160
|
-
const
|
|
161
|
-
|
|
160
|
+
const I = y instanceof Error ? y.message : "Refresh failed";
|
|
161
|
+
v(I), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: I
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
c(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [l, t, o]), k =
|
|
168
|
+
}, [l, t, o]), k = B.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!l,
|
|
170
170
|
hasClient: !!u,
|
|
171
171
|
isConnected: m,
|
|
172
|
-
isLoading:
|
|
172
|
+
isLoading: b,
|
|
173
173
|
hasError: !!w,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: l,
|
|
177
177
|
client: u,
|
|
178
178
|
isConnected: m,
|
|
179
|
-
isLoading:
|
|
179
|
+
isLoading: b,
|
|
180
180
|
error: w,
|
|
181
181
|
capabilities: r,
|
|
182
182
|
refreshConnection: z,
|
|
@@ -185,7 +185,7 @@ const on = et({
|
|
|
185
185
|
l,
|
|
186
186
|
u,
|
|
187
187
|
m,
|
|
188
|
-
|
|
188
|
+
b,
|
|
189
189
|
w,
|
|
190
190
|
r,
|
|
191
191
|
z,
|
|
@@ -193,11 +193,11 @@ const on = et({
|
|
|
193
193
|
o
|
|
194
194
|
]);
|
|
195
195
|
return o("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
196
|
+
renderCount: A.current,
|
|
197
197
|
willRenderChat: !!P,
|
|
198
198
|
contextValueReady: !!k
|
|
199
|
-
}), /* @__PURE__ */ n(
|
|
200
|
-
|
|
199
|
+
}), /* @__PURE__ */ n(cn.Provider, { value: k, children: P ? /* @__PURE__ */ n(
|
|
200
|
+
qn,
|
|
201
201
|
{
|
|
202
202
|
client: P,
|
|
203
203
|
customClasses: {
|
|
@@ -206,12 +206,12 @@ const on = et({
|
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, Qs = () => nt(), dn = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = $(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return X(() => {
|
|
215
215
|
var o;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -228,14 +228,14 @@ const on = et({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
231
|
+
}, ea = "linktree-official", ta = "linktree-official-sender";
|
|
232
232
|
function st(e, t, s) {
|
|
233
233
|
const a = Object.values(e || {});
|
|
234
|
-
if (s ===
|
|
234
|
+
if (s === ea) {
|
|
235
235
|
const r = a.find(
|
|
236
236
|
(i) => {
|
|
237
237
|
var o;
|
|
238
|
-
return ((o = i.user) == null ? void 0 : o.id) ===
|
|
238
|
+
return ((o = i.user) == null ? void 0 : o.id) === ta;
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
if (r) return r;
|
|
@@ -247,18 +247,18 @@ function st(e, t, s) {
|
|
|
247
247
|
}
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
function
|
|
252
|
-
return
|
|
250
|
+
const na = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
251
|
+
function sa(e) {
|
|
252
|
+
return na.test(e.trim());
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Yt(e, t) {
|
|
255
255
|
const s = e == null ? void 0 : e.trim();
|
|
256
|
-
return !s || t && s === t ? !1 : !
|
|
256
|
+
return !s || t && s === t ? !1 : !sa(s);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
function un(e) {
|
|
259
|
+
return Yt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Yt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
260
260
|
}
|
|
261
|
-
const
|
|
261
|
+
const qt = [
|
|
262
262
|
{ emoji: "🍎", bgColor: "#FFD1DD" },
|
|
263
263
|
// Apple
|
|
264
264
|
{ emoji: "🍌", bgColor: "#FFF1C9" },
|
|
@@ -286,7 +286,7 @@ const Ht = [
|
|
|
286
286
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
287
287
|
// Melon
|
|
288
288
|
];
|
|
289
|
-
function
|
|
289
|
+
function aa(e) {
|
|
290
290
|
let t = 0;
|
|
291
291
|
for (let s = 0; s < e.length; s++) {
|
|
292
292
|
const a = e.charCodeAt(s);
|
|
@@ -294,16 +294,16 @@ function na(e) {
|
|
|
294
294
|
}
|
|
295
295
|
return Math.abs(t);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
297
|
+
function mn(e) {
|
|
298
|
+
return qt[aa(e) % qt.length];
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
return
|
|
300
|
+
function ra(e) {
|
|
301
|
+
return mn(e).emoji;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return
|
|
303
|
+
function ia(e) {
|
|
304
|
+
return mn(e).bgColor;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const se = ({
|
|
307
307
|
id: e,
|
|
308
308
|
image: t,
|
|
309
309
|
size: s = 40,
|
|
@@ -312,7 +312,7 @@ const ae = ({
|
|
|
312
312
|
shape: i = "squircle",
|
|
313
313
|
dmAgentEnabled: o = !1
|
|
314
314
|
}) => {
|
|
315
|
-
const l =
|
|
315
|
+
const l = ra(e), d = ia(e), u = 0.45, m = s < 32 ? Math.round(s * u) : s < 56 ? 14 : s < 120 ? 18 : 36, f = s >= 40 ? 2 : 1, b = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, c = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: b, children: t ? /* @__PURE__ */ n(
|
|
316
316
|
"img",
|
|
317
317
|
{
|
|
318
318
|
src: t,
|
|
@@ -342,7 +342,7 @@ const ae = ({
|
|
|
342
342
|
width: `${s}px`,
|
|
343
343
|
height: `${s}px`,
|
|
344
344
|
backgroundColor: t ? void 0 : d,
|
|
345
|
-
...
|
|
345
|
+
...b
|
|
346
346
|
},
|
|
347
347
|
children: [
|
|
348
348
|
r && /* @__PURE__ */ n(
|
|
@@ -362,7 +362,7 @@ const ae = ({
|
|
|
362
362
|
"bg-transparent"
|
|
363
363
|
),
|
|
364
364
|
style: {
|
|
365
|
-
...
|
|
365
|
+
...b,
|
|
366
366
|
...o && {
|
|
367
367
|
borderWidth: `${f}px`,
|
|
368
368
|
borderStyle: "solid",
|
|
@@ -370,13 +370,13 @@ const ae = ({
|
|
|
370
370
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
|
-
children:
|
|
373
|
+
children: c
|
|
374
374
|
}
|
|
375
375
|
)
|
|
376
376
|
]
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
|
-
},
|
|
379
|
+
}, oa = "https://linktr.ee/s/about/trust-center/report", la = ({
|
|
380
380
|
channel: e,
|
|
381
381
|
participant: t,
|
|
382
382
|
showBlockParticipant: s = !0,
|
|
@@ -389,81 +389,81 @@ const ae = ({
|
|
|
389
389
|
onActionComplete: u,
|
|
390
390
|
logLabel: g = "useChannelModerationActions"
|
|
391
391
|
}) => {
|
|
392
|
-
var
|
|
393
|
-
const { service: m, debug: f } = nt(),
|
|
394
|
-
return
|
|
395
|
-
if (!
|
|
396
|
-
|
|
392
|
+
var T;
|
|
393
|
+
const { service: m, debug: f } = nt(), b = (T = t == null ? void 0 : t.user) == null ? void 0 : T.id, c = !!(a && s && m && b), [w, v] = $(!1), [p, N] = $(null), [_, M] = $(!1), [L, A] = $(!1), R = c && ((p == null ? void 0 : p.participantId) !== b || (p == null ? void 0 : p.service) !== m);
|
|
394
|
+
return X(() => {
|
|
395
|
+
if (!c || !m || !b) {
|
|
396
|
+
v(!1), N(null);
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
|
-
let
|
|
399
|
+
let S = !1;
|
|
400
400
|
return (async () => {
|
|
401
401
|
try {
|
|
402
402
|
const y = await m.getBlockedUsers();
|
|
403
|
-
if (
|
|
404
|
-
|
|
403
|
+
if (S) return;
|
|
404
|
+
v(
|
|
405
405
|
y.some(
|
|
406
|
-
(
|
|
406
|
+
(I) => I.blocked_user_id === b
|
|
407
407
|
)
|
|
408
408
|
);
|
|
409
409
|
} catch (y) {
|
|
410
|
-
|
|
410
|
+
S || console.error(`[${g}] Failed to check blocked status:`, y);
|
|
411
411
|
} finally {
|
|
412
|
-
|
|
412
|
+
S || N({ participantId: b, service: m });
|
|
413
413
|
}
|
|
414
414
|
})(), () => {
|
|
415
|
-
|
|
415
|
+
S = !0;
|
|
416
416
|
};
|
|
417
|
-
}, [
|
|
417
|
+
}, [c, m, b, g]), {
|
|
418
418
|
isParticipantBlocked: w,
|
|
419
|
-
isCheckingBlockedStatus:
|
|
420
|
-
isLeaving:
|
|
421
|
-
isUpdatingBlockStatus:
|
|
419
|
+
isCheckingBlockedStatus: R,
|
|
420
|
+
isLeaving: _,
|
|
421
|
+
isUpdatingBlockStatus: L,
|
|
422
422
|
handleLeaveConversation: async () => {
|
|
423
|
-
var
|
|
424
|
-
if (!
|
|
425
|
-
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
423
|
+
var S;
|
|
424
|
+
if (!_) {
|
|
425
|
+
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), M(!0);
|
|
426
426
|
try {
|
|
427
|
-
const y = ((
|
|
427
|
+
const y = ((S = e._client) == null ? void 0 : S.userID) ?? null;
|
|
428
428
|
await e.hide(y, !1), r && await r(e), u == null || u();
|
|
429
429
|
} catch (y) {
|
|
430
430
|
console.error(`[${g}] Failed to leave conversation`, y);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
M(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
handleBlockUser: async () => {
|
|
437
|
-
var
|
|
438
|
-
if (!(
|
|
439
|
-
l == null || l(), f && console.log(`[${g}] Block member`, (
|
|
437
|
+
var S, y, I;
|
|
438
|
+
if (!(L || !m)) {
|
|
439
|
+
l == null || l(), f && console.log(`[${g}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), A(!0);
|
|
440
440
|
try {
|
|
441
|
-
await m.blockUser((y = t == null ? void 0 : t.user) == null ? void 0 : y.id), i && await i((
|
|
442
|
-
} catch (
|
|
443
|
-
console.error(`[${g}] Failed to block member`,
|
|
441
|
+
await m.blockUser((y = t == null ? void 0 : t.user) == null ? void 0 : y.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), u == null || u();
|
|
442
|
+
} catch (O) {
|
|
443
|
+
console.error(`[${g}] Failed to block member`, O);
|
|
444
444
|
} finally {
|
|
445
|
-
|
|
445
|
+
A(!1);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
handleUnblockUser: async () => {
|
|
450
|
-
var
|
|
451
|
-
if (!(
|
|
452
|
-
l == null || l(), f && console.log(`[${g}] Unblock member`, (
|
|
450
|
+
var S, y, I;
|
|
451
|
+
if (!(L || !m)) {
|
|
452
|
+
l == null || l(), f && console.log(`[${g}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), A(!0);
|
|
453
453
|
try {
|
|
454
|
-
await m.unBlockUser((y = t == null ? void 0 : t.user) == null ? void 0 : y.id), i && await i((
|
|
455
|
-
} catch (
|
|
456
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
454
|
+
await m.unBlockUser((y = t == null ? void 0 : t.user) == null ? void 0 : y.id), i && await i((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), u == null || u();
|
|
455
|
+
} catch (O) {
|
|
456
|
+
console.error(`[${g}] Failed to unblock member`, O);
|
|
457
457
|
} finally {
|
|
458
|
-
|
|
458
|
+
A(!1);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
handleReportUser: () => {
|
|
463
|
-
d == null || d(), u == null || u(), window.open(
|
|
463
|
+
d == null || d(), u == null || u(), window.open(oa, "_blank", "noopener,noreferrer");
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
|
-
},
|
|
466
|
+
}, xe = ({
|
|
467
467
|
variant: e = "default",
|
|
468
468
|
className: t,
|
|
469
469
|
children: s,
|
|
@@ -480,7 +480,7 @@ const ae = ({
|
|
|
480
480
|
...a,
|
|
481
481
|
children: s
|
|
482
482
|
}
|
|
483
|
-
),
|
|
483
|
+
), Wt = ({
|
|
484
484
|
channel: e,
|
|
485
485
|
participant: t,
|
|
486
486
|
showDeleteConversation: s = !0,
|
|
@@ -494,16 +494,16 @@ const ae = ({
|
|
|
494
494
|
customChannelActions: g,
|
|
495
495
|
triggerClassName: m
|
|
496
496
|
}) => {
|
|
497
|
-
const [f,
|
|
497
|
+
const [f, b] = $(!1), c = Y(null), w = Gn(), v = K(() => b(!1), []), {
|
|
498
498
|
isParticipantBlocked: p,
|
|
499
|
-
isCheckingBlockedStatus:
|
|
500
|
-
isLeaving:
|
|
501
|
-
isUpdatingBlockStatus:
|
|
502
|
-
handleLeaveConversation:
|
|
503
|
-
handleBlockUser:
|
|
504
|
-
handleUnblockUser:
|
|
499
|
+
isCheckingBlockedStatus: N,
|
|
500
|
+
isLeaving: _,
|
|
501
|
+
isUpdatingBlockStatus: M,
|
|
502
|
+
handleLeaveConversation: L,
|
|
503
|
+
handleBlockUser: A,
|
|
504
|
+
handleUnblockUser: R,
|
|
505
505
|
handleReportUser: P
|
|
506
|
-
} =
|
|
506
|
+
} = la({
|
|
507
507
|
channel: e,
|
|
508
508
|
participant: t,
|
|
509
509
|
showBlockParticipant: a,
|
|
@@ -513,20 +513,20 @@ const ae = ({
|
|
|
513
513
|
onDeleteConversationClick: l,
|
|
514
514
|
onBlockParticipantClick: d,
|
|
515
515
|
onReportParticipantClick: u,
|
|
516
|
-
onActionComplete:
|
|
516
|
+
onActionComplete: v,
|
|
517
517
|
logLabel: "ChannelActionsMenu"
|
|
518
518
|
});
|
|
519
|
-
return
|
|
519
|
+
return X(() => {
|
|
520
520
|
if (!f) return;
|
|
521
|
-
const z = (
|
|
522
|
-
|
|
523
|
-
}, k = (
|
|
524
|
-
|
|
521
|
+
const z = (T) => {
|
|
522
|
+
c.current && !c.current.contains(T.target) && b(!1);
|
|
523
|
+
}, k = (T) => {
|
|
524
|
+
T.key === "Escape" && b(!1);
|
|
525
525
|
};
|
|
526
526
|
return document.addEventListener("mousedown", z), document.addEventListener("keydown", k), () => {
|
|
527
527
|
document.removeEventListener("mousedown", z), document.removeEventListener("keydown", k);
|
|
528
528
|
};
|
|
529
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
529
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: c, className: "relative", children: [
|
|
530
530
|
/* @__PURE__ */ h(
|
|
531
531
|
"button",
|
|
532
532
|
{
|
|
@@ -535,9 +535,9 @@ const ae = ({
|
|
|
535
535
|
"aria-haspopup": "true",
|
|
536
536
|
"aria-expanded": f,
|
|
537
537
|
"aria-controls": f ? w : void 0,
|
|
538
|
-
onClick: () =>
|
|
538
|
+
onClick: () => b((z) => !z),
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */ n(
|
|
540
|
+
/* @__PURE__ */ n(Ts, { className: "size-5 text-black/90" }),
|
|
541
541
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
542
542
|
]
|
|
543
543
|
}
|
|
@@ -553,49 +553,49 @@ const ae = ({
|
|
|
553
553
|
),
|
|
554
554
|
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
555
555
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
556
|
-
|
|
556
|
+
xe,
|
|
557
557
|
{
|
|
558
|
-
onClick:
|
|
559
|
-
disabled:
|
|
560
|
-
"aria-busy":
|
|
558
|
+
onClick: L,
|
|
559
|
+
disabled: _,
|
|
560
|
+
"aria-busy": _,
|
|
561
561
|
children: [
|
|
562
|
-
|
|
562
|
+
_ ? /* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(As, { className: "h-5 w-5" }),
|
|
563
563
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
566
566
|
) }),
|
|
567
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
567
|
+
a && /* @__PURE__ */ n("li", { children: N ? (
|
|
568
568
|
// Block status not yet resolved — show a disabled placeholder
|
|
569
569
|
// so a premature click can't act on a stale block state.
|
|
570
|
-
/* @__PURE__ */ h(
|
|
570
|
+
/* @__PURE__ */ h(xe, { disabled: !0, "aria-busy": !0, children: [
|
|
571
571
|
/* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }),
|
|
572
572
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
573
573
|
] })
|
|
574
574
|
) : p ? /* @__PURE__ */ h(
|
|
575
|
-
|
|
575
|
+
xe,
|
|
576
576
|
{
|
|
577
|
-
onClick:
|
|
578
|
-
disabled:
|
|
579
|
-
"aria-busy":
|
|
577
|
+
onClick: R,
|
|
578
|
+
disabled: M,
|
|
579
|
+
"aria-busy": M,
|
|
580
580
|
children: [
|
|
581
|
-
|
|
581
|
+
M ? /* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
582
582
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) : /* @__PURE__ */ h(
|
|
586
|
-
|
|
586
|
+
xe,
|
|
587
587
|
{
|
|
588
|
-
onClick:
|
|
589
|
-
disabled:
|
|
590
|
-
"aria-busy":
|
|
588
|
+
onClick: A,
|
|
589
|
+
disabled: M,
|
|
590
|
+
"aria-busy": M,
|
|
591
591
|
children: [
|
|
592
|
-
|
|
592
|
+
M ? /* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
|
|
593
593
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
) }),
|
|
597
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
598
|
-
/* @__PURE__ */ n(
|
|
597
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(xe, { variant: "danger", onClick: P, children: [
|
|
598
|
+
/* @__PURE__ */ n(an, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
600
600
|
] }) }),
|
|
601
601
|
g
|
|
@@ -603,15 +603,15 @@ const ae = ({
|
|
|
603
603
|
}
|
|
604
604
|
)
|
|
605
605
|
] });
|
|
606
|
-
},
|
|
607
|
-
function
|
|
606
|
+
}, ca = (e) => /* @__PURE__ */ n(Wn, { ...e, position: "center" }), Ze = "vote_up", Qe = "vote_down";
|
|
607
|
+
function da(e) {
|
|
608
608
|
return e != null && e.length ? e.some((t) => t.type === Qe) ? "down" : e.some((t) => t.type === Ze) ? "up" : null : null;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
const { channel: t } =
|
|
612
|
-
() =>
|
|
610
|
+
function ua(e) {
|
|
611
|
+
const { channel: t } = be(), { client: s } = ve("useMessageVote"), a = ne(
|
|
612
|
+
() => da(e.own_reactions),
|
|
613
613
|
[e.own_reactions]
|
|
614
|
-
), r =
|
|
614
|
+
), r = K(async () => {
|
|
615
615
|
if (s != null && s.userID)
|
|
616
616
|
try {
|
|
617
617
|
a === "up" ? await t.deleteReaction(e.id, Ze) : await t.sendReaction(
|
|
@@ -621,7 +621,7 @@ function ca(e) {
|
|
|
621
621
|
);
|
|
622
622
|
} catch {
|
|
623
623
|
}
|
|
624
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
624
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
|
|
625
625
|
if (s != null && s.userID)
|
|
626
626
|
try {
|
|
627
627
|
a === "down" ? await t.deleteReaction(e.id, Qe) : await t.sendReaction(
|
|
@@ -634,24 +634,24 @@ function ca(e) {
|
|
|
634
634
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
635
635
|
return { selected: a, voteUp: r, voteDown: i };
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function ma(e) {
|
|
638
638
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function hn({
|
|
641
641
|
message: e,
|
|
642
642
|
viewerLanguage: t
|
|
643
643
|
}) {
|
|
644
644
|
var r;
|
|
645
|
-
const s = e == null ? void 0 : e.text, a =
|
|
645
|
+
const s = e == null ? void 0 : e.text, a = ma(t);
|
|
646
646
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
647
647
|
}
|
|
648
|
-
const
|
|
648
|
+
const ha = B.lazy(() => import("./Card-_SSVVgkv.js")), fa = B.lazy(() => import("./Card-CsPLNSTP.js")), ga = B.lazy(() => import("./Card-BF8hqtLR.js")), at = () => /* @__PURE__ */ n(
|
|
649
649
|
"div",
|
|
650
650
|
{
|
|
651
651
|
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)]",
|
|
652
652
|
"aria-hidden": !0
|
|
653
653
|
}
|
|
654
|
-
),
|
|
654
|
+
), pa = (e) => /* @__PURE__ */ n(tt, { fallback: /* @__PURE__ */ n(at, {}), children: /* @__PURE__ */ n(ha, { ...e }) }), fn = (e) => /* @__PURE__ */ n(tt, { fallback: /* @__PURE__ */ n(at, {}), children: /* @__PURE__ */ n(fa, { ...e }) }), gn = (e) => /* @__PURE__ */ n(tt, { fallback: /* @__PURE__ */ n(at, {}), children: /* @__PURE__ */ n(ga, { ...e }) }), ba = fn, va = gn, Xt = { Composer: pa, Sent: fn, Received: gn, Creator: ba, Visitor: va }, xa = [
|
|
655
655
|
[/pdf/, "pdf"],
|
|
656
656
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
657
657
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -664,39 +664,39 @@ const ua = j.lazy(() => import("./Card-COTwOzVb.js")), ma = j.lazy(() => import(
|
|
|
664
664
|
function oe(e) {
|
|
665
665
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
666
666
|
}
|
|
667
|
-
function
|
|
668
|
-
const t =
|
|
667
|
+
function pn(e) {
|
|
668
|
+
const t = xa.find(
|
|
669
669
|
([s]) => s.test(e)
|
|
670
670
|
);
|
|
671
671
|
return t ? t[1] : "generic";
|
|
672
672
|
}
|
|
673
|
-
const
|
|
674
|
-
video:
|
|
675
|
-
audio:
|
|
676
|
-
image:
|
|
677
|
-
document:
|
|
678
|
-
},
|
|
679
|
-
pdf:
|
|
680
|
-
doc:
|
|
681
|
-
xls:
|
|
682
|
-
csv:
|
|
683
|
-
ppt:
|
|
684
|
-
zip:
|
|
685
|
-
text:
|
|
673
|
+
const wa = {
|
|
674
|
+
video: on,
|
|
675
|
+
audio: Ls,
|
|
676
|
+
image: Ms,
|
|
677
|
+
document: rn
|
|
678
|
+
}, _a = {
|
|
679
|
+
pdf: Bs,
|
|
680
|
+
doc: $s,
|
|
681
|
+
xls: Fs,
|
|
682
|
+
csv: Os,
|
|
683
|
+
ppt: zs,
|
|
684
|
+
zip: Ps,
|
|
685
|
+
text: Ds,
|
|
686
686
|
markdown: Rs,
|
|
687
|
-
generic:
|
|
687
|
+
generic: rn
|
|
688
688
|
};
|
|
689
|
-
function
|
|
689
|
+
function Na(e) {
|
|
690
690
|
const t = oe(e);
|
|
691
|
-
return t !== "document" ?
|
|
691
|
+
return t !== "document" ? wa[t] : _a[pn(e)];
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
return
|
|
693
|
+
function pe(e, t) {
|
|
694
|
+
return B.createElement(Na(e), t);
|
|
695
695
|
}
|
|
696
|
-
const
|
|
696
|
+
const ya = (e) => {
|
|
697
697
|
var t, s;
|
|
698
698
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
699
|
-
},
|
|
699
|
+
}, Ca = ({
|
|
700
700
|
source: e,
|
|
701
701
|
mimeType: t,
|
|
702
702
|
poster: s,
|
|
@@ -708,66 +708,66 @@ const _a = (e) => {
|
|
|
708
708
|
muted: d = !1,
|
|
709
709
|
onContainerClick: u
|
|
710
710
|
}) => {
|
|
711
|
-
const g = oe(t), m = Y(null), f = Y(null),
|
|
712
|
-
P(!1),
|
|
713
|
-
}, []),
|
|
714
|
-
const
|
|
715
|
-
if (!
|
|
716
|
-
const
|
|
711
|
+
const g = oe(t), m = Y(null), f = Y(null), b = Y(null), c = Y(r), [w, v] = $(a), [p, N] = $(0), [_, M] = $(!1), [L, A] = $(!1), [R, P] = $(!1), [j, z] = $(!1), [k, T] = $(!0), [S, y] = $(null), I = K(() => {
|
|
712
|
+
P(!1), v(!0);
|
|
713
|
+
}, []), O = K((x) => {
|
|
714
|
+
const E = f.current;
|
|
715
|
+
if (!E) return 0;
|
|
716
|
+
const G = E.getBoundingClientRect();
|
|
717
717
|
return Math.max(
|
|
718
718
|
0,
|
|
719
|
-
Math.min(1, (
|
|
719
|
+
Math.min(1, (ya(x) - G.left) / G.width)
|
|
720
720
|
);
|
|
721
|
-
}, []),
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
}, []),
|
|
725
|
-
x.stopPropagation(),
|
|
726
|
-
const
|
|
727
|
-
|
|
721
|
+
}, []), F = K((x) => {
|
|
722
|
+
const E = m.current;
|
|
723
|
+
E && E.duration && (E.currentTime = x * E.duration);
|
|
724
|
+
}, []), U = (x) => {
|
|
725
|
+
x.stopPropagation(), M(!0);
|
|
726
|
+
const E = O(x);
|
|
727
|
+
N(E), F(E);
|
|
728
728
|
};
|
|
729
|
-
|
|
730
|
-
r !== void 0 && r !==
|
|
731
|
-
}, [r]),
|
|
729
|
+
X(() => {
|
|
730
|
+
r !== void 0 && r !== c.current && (c.current = r, v(r));
|
|
731
|
+
}, [r]), X(() => {
|
|
732
732
|
if (!w) {
|
|
733
|
-
|
|
733
|
+
b.current !== null && (cancelAnimationFrame(b.current), b.current = null);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
736
|
const x = () => {
|
|
737
|
-
const
|
|
738
|
-
|
|
737
|
+
const E = m.current;
|
|
738
|
+
E && E.duration && !_ && N(E.currentTime / E.duration), b.current = requestAnimationFrame(x);
|
|
739
739
|
};
|
|
740
|
-
return
|
|
741
|
-
|
|
740
|
+
return b.current = requestAnimationFrame(x), () => {
|
|
741
|
+
b.current !== null && cancelAnimationFrame(b.current);
|
|
742
742
|
};
|
|
743
|
-
}, [w,
|
|
743
|
+
}, [w, _]), X(() => {
|
|
744
744
|
const x = m.current;
|
|
745
|
-
x && (w ? x.play().catch((
|
|
746
|
-
|
|
745
|
+
x && (w ? x.play().catch((E) => {
|
|
746
|
+
v(!1), P(!0);
|
|
747
747
|
}) : x.pause());
|
|
748
|
-
}, [w]),
|
|
749
|
-
if (!
|
|
750
|
-
const x = (
|
|
751
|
-
|
|
748
|
+
}, [w]), X(() => {
|
|
749
|
+
if (!_) return;
|
|
750
|
+
const x = (G) => N(O(G)), E = (G) => {
|
|
751
|
+
M(!1), F(O(G));
|
|
752
752
|
};
|
|
753
|
-
return window.addEventListener("mousemove", x), window.addEventListener("mouseup",
|
|
754
|
-
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup",
|
|
753
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", E), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", E), () => {
|
|
754
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", E), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", E);
|
|
755
755
|
};
|
|
756
|
-
}, [
|
|
757
|
-
const
|
|
756
|
+
}, [_, O, F]);
|
|
757
|
+
const J = S ? { aspectRatio: String(S) } : void 0, Z = S ? "" : " aspect-video", q = Math.round(p * 100);
|
|
758
758
|
return /* @__PURE__ */ h(
|
|
759
759
|
"div",
|
|
760
760
|
{
|
|
761
761
|
role: "button",
|
|
762
762
|
tabIndex: 0,
|
|
763
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
764
|
-
style:
|
|
763
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
|
|
764
|
+
style: J,
|
|
765
765
|
onClick: (x) => {
|
|
766
766
|
if (u) {
|
|
767
767
|
u(x);
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
|
-
|
|
770
|
+
R || o && v((E) => !E);
|
|
771
771
|
},
|
|
772
772
|
onKeyDown: (x) => {
|
|
773
773
|
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
@@ -775,7 +775,7 @@ const _a = (e) => {
|
|
|
775
775
|
u(x);
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
|
|
778
|
+
R || o && v((E) => !E);
|
|
779
779
|
}
|
|
780
780
|
},
|
|
781
781
|
children: [
|
|
@@ -787,7 +787,7 @@ const _a = (e) => {
|
|
|
787
787
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
788
788
|
}
|
|
789
789
|
),
|
|
790
|
-
!s && (g === "audio" || k) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children:
|
|
790
|
+
!s && (g === "audio" || k) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: pe(t, {
|
|
791
791
|
className: "size-12 text-black/20",
|
|
792
792
|
weight: "regular"
|
|
793
793
|
}) }),
|
|
@@ -801,12 +801,12 @@ const _a = (e) => {
|
|
|
801
801
|
style: { width: "100%", height: "100%" },
|
|
802
802
|
onLoadStart: () => z(!0),
|
|
803
803
|
onCanPlay: () => {
|
|
804
|
-
z(!1),
|
|
804
|
+
z(!1), T(!1);
|
|
805
805
|
},
|
|
806
806
|
onWaiting: () => z(!0),
|
|
807
807
|
onPlay: () => P(!1),
|
|
808
808
|
onEnded: () => {
|
|
809
|
-
i || (
|
|
809
|
+
i || (v(!1), N(0));
|
|
810
810
|
},
|
|
811
811
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
812
812
|
}
|
|
@@ -821,7 +821,7 @@ const _a = (e) => {
|
|
|
821
821
|
style: { width: "100%", height: "100%" },
|
|
822
822
|
onLoadStart: () => z(!0),
|
|
823
823
|
onCanPlay: () => {
|
|
824
|
-
z(!1),
|
|
824
|
+
z(!1), T(!1);
|
|
825
825
|
},
|
|
826
826
|
onWaiting: () => z(!0),
|
|
827
827
|
onPlay: () => P(!1),
|
|
@@ -830,19 +830,19 @@ const _a = (e) => {
|
|
|
830
830
|
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && y(x.videoWidth / x.videoHeight);
|
|
831
831
|
},
|
|
832
832
|
onEnded: () => {
|
|
833
|
-
i || (
|
|
833
|
+
i || (v(!1), N(0));
|
|
834
834
|
},
|
|
835
835
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
836
836
|
}
|
|
837
837
|
) }),
|
|
838
|
-
|
|
839
|
-
|
|
838
|
+
j && !R && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
839
|
+
Ce,
|
|
840
840
|
{
|
|
841
841
|
className: "size-8 animate-spin text-white/80",
|
|
842
842
|
weight: "bold"
|
|
843
843
|
}
|
|
844
844
|
) }),
|
|
845
|
-
|
|
845
|
+
R && !o && /* @__PURE__ */ n(
|
|
846
846
|
"div",
|
|
847
847
|
{
|
|
848
848
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -850,10 +850,10 @@ const _a = (e) => {
|
|
|
850
850
|
tabIndex: 0,
|
|
851
851
|
"aria-label": "Play preview",
|
|
852
852
|
onClick: (x) => {
|
|
853
|
-
x.stopPropagation(),
|
|
853
|
+
x.stopPropagation(), I();
|
|
854
854
|
},
|
|
855
855
|
onKeyDown: (x) => {
|
|
856
|
-
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(),
|
|
856
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), I());
|
|
857
857
|
},
|
|
858
858
|
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(Je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
859
859
|
}
|
|
@@ -869,11 +869,11 @@ const _a = (e) => {
|
|
|
869
869
|
tabIndex: 0,
|
|
870
870
|
ref: f,
|
|
871
871
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
872
|
-
onMouseDown:
|
|
873
|
-
onTouchStart:
|
|
872
|
+
onMouseDown: U,
|
|
873
|
+
onTouchStart: U,
|
|
874
874
|
onClick: (x) => x.stopPropagation(),
|
|
875
875
|
onKeyDown: (x) => {
|
|
876
|
-
x.key === "ArrowRight" &&
|
|
876
|
+
x.key === "ArrowRight" && F(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
|
|
877
877
|
},
|
|
878
878
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
879
879
|
"div",
|
|
@@ -890,11 +890,11 @@ const _a = (e) => {
|
|
|
890
890
|
{
|
|
891
891
|
type: "button",
|
|
892
892
|
onClick: (x) => {
|
|
893
|
-
x.stopPropagation(),
|
|
893
|
+
x.stopPropagation(), v((E) => !E);
|
|
894
894
|
},
|
|
895
895
|
className: "shrink-0 text-white",
|
|
896
896
|
"aria-label": w ? "Pause" : "Play",
|
|
897
|
-
children: w ? /* @__PURE__ */ n(
|
|
897
|
+
children: w ? /* @__PURE__ */ n(js, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Je, { className: "size-5 translate-x-px", weight: "fill" })
|
|
898
898
|
}
|
|
899
899
|
),
|
|
900
900
|
/* @__PURE__ */ h(
|
|
@@ -908,19 +908,19 @@ const _a = (e) => {
|
|
|
908
908
|
tabIndex: 0,
|
|
909
909
|
ref: f,
|
|
910
910
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
911
|
-
onMouseDown:
|
|
912
|
-
onTouchStart:
|
|
911
|
+
onMouseDown: U,
|
|
912
|
+
onTouchStart: U,
|
|
913
913
|
onClick: (x) => x.stopPropagation(),
|
|
914
|
-
onMouseEnter: () =>
|
|
915
|
-
onMouseLeave: () =>
|
|
914
|
+
onMouseEnter: () => A(!0),
|
|
915
|
+
onMouseLeave: () => A(!1),
|
|
916
916
|
onKeyDown: (x) => {
|
|
917
|
-
x.key === "ArrowRight" &&
|
|
917
|
+
x.key === "ArrowRight" && F(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
|
|
918
918
|
},
|
|
919
919
|
children: [
|
|
920
920
|
/* @__PURE__ */ n(
|
|
921
921
|
"div",
|
|
922
922
|
{
|
|
923
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
923
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || _ ? "h-1.5" : "h-1"}`,
|
|
924
924
|
children: /* @__PURE__ */ n(
|
|
925
925
|
"div",
|
|
926
926
|
{
|
|
@@ -933,7 +933,7 @@ const _a = (e) => {
|
|
|
933
933
|
/* @__PURE__ */ n(
|
|
934
934
|
"div",
|
|
935
935
|
{
|
|
936
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
936
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || _ ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
937
937
|
style: { left: `${q}%` }
|
|
938
938
|
}
|
|
939
939
|
)
|
|
@@ -944,7 +944,7 @@ const _a = (e) => {
|
|
|
944
944
|
]
|
|
945
945
|
}
|
|
946
946
|
);
|
|
947
|
-
},
|
|
947
|
+
}, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ka = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", bn = ({
|
|
948
948
|
mimeType: e,
|
|
949
949
|
sourceUrl: t,
|
|
950
950
|
thumbnailUrl: s,
|
|
@@ -953,9 +953,9 @@ const _a = (e) => {
|
|
|
953
953
|
mediaPlayerProps: i,
|
|
954
954
|
containedImage: o = !1
|
|
955
955
|
}) => {
|
|
956
|
-
const l = oe(e), [d, u] =
|
|
956
|
+
const l = oe(e), [d, u] = $(!1);
|
|
957
957
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
958
|
-
|
|
958
|
+
Ca,
|
|
959
959
|
{
|
|
960
960
|
source: t,
|
|
961
961
|
mimeType: e,
|
|
@@ -1001,12 +1001,12 @@ const _a = (e) => {
|
|
|
1001
1001
|
"div",
|
|
1002
1002
|
{
|
|
1003
1003
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1004
|
-
children:
|
|
1005
|
-
className:
|
|
1004
|
+
children: pe(e, {
|
|
1005
|
+
className: Kt(r),
|
|
1006
1006
|
weight: "regular"
|
|
1007
1007
|
})
|
|
1008
1008
|
}
|
|
1009
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
1009
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${ka(r)}`, children: /* @__PURE__ */ n(
|
|
1010
1010
|
"img",
|
|
1011
1011
|
{
|
|
1012
1012
|
src: s,
|
|
@@ -1018,13 +1018,13 @@ const _a = (e) => {
|
|
|
1018
1018
|
"div",
|
|
1019
1019
|
{
|
|
1020
1020
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1021
|
-
children:
|
|
1022
|
-
className:
|
|
1021
|
+
children: pe(e, {
|
|
1022
|
+
className: Kt(r),
|
|
1023
1023
|
weight: "regular"
|
|
1024
1024
|
})
|
|
1025
1025
|
}
|
|
1026
1026
|
);
|
|
1027
|
-
},
|
|
1027
|
+
}, vn = ({
|
|
1028
1028
|
variant: e,
|
|
1029
1029
|
thumbnail: t,
|
|
1030
1030
|
title: s,
|
|
@@ -1038,7 +1038,7 @@ const _a = (e) => {
|
|
|
1038
1038
|
rootRef: g,
|
|
1039
1039
|
"data-testid": m
|
|
1040
1040
|
}) => {
|
|
1041
|
-
const f = e === "dark",
|
|
1041
|
+
const f = e === "dark", b = f ? s ?? a : s ?? "", c = f && !s;
|
|
1042
1042
|
return /* @__PURE__ */ h(
|
|
1043
1043
|
"div",
|
|
1044
1044
|
{
|
|
@@ -1053,19 +1053,19 @@ const _a = (e) => {
|
|
|
1053
1053
|
u ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
|
|
1054
1054
|
t,
|
|
1055
1055
|
/* @__PURE__ */ h("div", { className: "px-4 pb-3 pt-3", children: [
|
|
1056
|
-
|
|
1056
|
+
b.trim() !== "" && /* @__PURE__ */ n(
|
|
1057
1057
|
"p",
|
|
1058
1058
|
{
|
|
1059
1059
|
className: C("mb-0.5 truncate text-base font-medium", {
|
|
1060
1060
|
"text-black": !f,
|
|
1061
|
-
"text-white/30": f &&
|
|
1062
|
-
"text-white": f && !
|
|
1061
|
+
"text-white/30": f && c,
|
|
1062
|
+
"text-white": f && !c
|
|
1063
1063
|
}),
|
|
1064
|
-
children:
|
|
1064
|
+
children: b
|
|
1065
1065
|
}
|
|
1066
1066
|
),
|
|
1067
1067
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1068
|
-
|
|
1068
|
+
pe(r, {
|
|
1069
1069
|
className: C(
|
|
1070
1070
|
"size-5 shrink-0",
|
|
1071
1071
|
f ? "text-white/55" : "text-black/55"
|
|
@@ -1090,29 +1090,29 @@ const _a = (e) => {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
);
|
|
1092
1092
|
};
|
|
1093
|
-
function
|
|
1093
|
+
function xn(e) {
|
|
1094
1094
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1095
1095
|
}
|
|
1096
1096
|
function rt(e) {
|
|
1097
1097
|
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)]`;
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Sa(e) {
|
|
1100
1100
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Ea(e) {
|
|
1103
1103
|
return e ? "text-white" : "text-black";
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Ia(e) {
|
|
1106
1106
|
return e ? "text-white/55" : "text-black/55";
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Ta(e) {
|
|
1109
1109
|
return e ? "text-white/40" : "text-black/40";
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Aa(e) {
|
|
1112
1112
|
return e ? "text-white/20" : "text-black/20";
|
|
1113
1113
|
}
|
|
1114
1114
|
const it = ({ attachment: e, isMyMessage: t }) => {
|
|
1115
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, u = /* @__PURE__ */ h(
|
|
1115
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, u = /* @__PURE__ */ h(B.Fragment, { children: [
|
|
1116
1116
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1117
1117
|
"img",
|
|
1118
1118
|
{
|
|
@@ -1123,26 +1123,26 @@ const it = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1123
1123
|
) : /* @__PURE__ */ n(
|
|
1124
1124
|
"div",
|
|
1125
1125
|
{
|
|
1126
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1127
|
-
children: /* @__PURE__ */ n(
|
|
1126
|
+
className: `aspect-video w-full rounded-[20px] ${Sa(t)} flex items-center justify-center`,
|
|
1127
|
+
children: /* @__PURE__ */ n(Us, { className: `size-12 ${Aa(t)}` })
|
|
1128
1128
|
}
|
|
1129
1129
|
) }),
|
|
1130
1130
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1131
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1132
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1133
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1131
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${Ea(t)}`, children: s }),
|
|
1132
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${Ia(t)}`, children: a }),
|
|
1133
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${Ta(t)}`, children: d })
|
|
1134
1134
|
] })
|
|
1135
1135
|
] });
|
|
1136
1136
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ n("div", { className: "block", children: u });
|
|
1137
1137
|
};
|
|
1138
|
-
function
|
|
1138
|
+
function wn(e) {
|
|
1139
1139
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1140
1140
|
}
|
|
1141
1141
|
function ot(e) {
|
|
1142
1142
|
var t;
|
|
1143
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1143
|
+
return (t = e.attachments) == null ? void 0 : t.find(wn);
|
|
1144
1144
|
}
|
|
1145
|
-
async function
|
|
1145
|
+
async function Ma(e, t) {
|
|
1146
1146
|
let s;
|
|
1147
1147
|
try {
|
|
1148
1148
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1154,11 +1154,11 @@ async function Ta(e, t) {
|
|
|
1154
1154
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1155
1155
|
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1156
1156
|
}
|
|
1157
|
-
const
|
|
1157
|
+
const La = ({
|
|
1158
1158
|
url: e,
|
|
1159
1159
|
filename: t
|
|
1160
1160
|
}) => {
|
|
1161
|
-
const [s, a] =
|
|
1161
|
+
const [s, a] = $(!1);
|
|
1162
1162
|
return /* @__PURE__ */ n(
|
|
1163
1163
|
"button",
|
|
1164
1164
|
{
|
|
@@ -1166,7 +1166,7 @@ const Aa = ({
|
|
|
1166
1166
|
onClick: (i) => {
|
|
1167
1167
|
i.stopPropagation();
|
|
1168
1168
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1169
|
-
a(!0),
|
|
1169
|
+
a(!0), Ma(e, t).then(() => {
|
|
1170
1170
|
o == null || o.close();
|
|
1171
1171
|
}).catch(() => {
|
|
1172
1172
|
o && (o.location.href = e);
|
|
@@ -1174,22 +1174,22 @@ const Aa = ({
|
|
|
1174
1174
|
},
|
|
1175
1175
|
disabled: s,
|
|
1176
1176
|
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",
|
|
1177
|
-
children: s ? /* @__PURE__ */ n(
|
|
1178
|
-
/* @__PURE__ */ n(
|
|
1177
|
+
children: s ? /* @__PURE__ */ n(Ce, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(B.Fragment, { children: [
|
|
1178
|
+
/* @__PURE__ */ n(ke, { className: "size-4 text-white", weight: "bold" }),
|
|
1179
1179
|
"Download"
|
|
1180
1180
|
] })
|
|
1181
1181
|
}
|
|
1182
1182
|
);
|
|
1183
1183
|
};
|
|
1184
1184
|
function lt(e) {
|
|
1185
|
-
var m, f,
|
|
1185
|
+
var m, f, b, c;
|
|
1186
1186
|
const t = (m = e.attachments) == null ? void 0 : m.find(
|
|
1187
1187
|
(w) => w.type === "video" && w.asset_url
|
|
1188
1188
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1189
1189
|
(w) => w.type === "image" && w.image_url
|
|
1190
|
-
), a = (
|
|
1190
|
+
), a = (b = e.attachments) == null ? void 0 : b.find(
|
|
1191
1191
|
(w) => w.type === "audio" && w.asset_url
|
|
1192
|
-
), r = (
|
|
1192
|
+
), r = (c = e.attachments) == null ? void 0 : c.find(
|
|
1193
1193
|
(w) => w.type === "file" && w.asset_url
|
|
1194
1194
|
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1195
1195
|
if (!o) return null;
|
|
@@ -1202,16 +1202,16 @@ function lt(e) {
|
|
|
1202
1202
|
thumbnailUrl: g
|
|
1203
1203
|
};
|
|
1204
1204
|
}
|
|
1205
|
-
const
|
|
1205
|
+
const _n = ({
|
|
1206
1206
|
resolvedUrl: e,
|
|
1207
1207
|
resolvedType: t,
|
|
1208
1208
|
title: s,
|
|
1209
1209
|
fileSize: a,
|
|
1210
1210
|
thumbnailUrl: r
|
|
1211
1211
|
}) => {
|
|
1212
|
-
const i = a !== void 0 ?
|
|
1212
|
+
const i = a !== void 0 ? xn(a) : void 0;
|
|
1213
1213
|
return /* @__PURE__ */ n(
|
|
1214
|
-
|
|
1214
|
+
vn,
|
|
1215
1215
|
{
|
|
1216
1216
|
variant: "dark",
|
|
1217
1217
|
title: s,
|
|
@@ -1219,7 +1219,7 @@ const xn = ({
|
|
|
1219
1219
|
mimeType: t,
|
|
1220
1220
|
detail: i,
|
|
1221
1221
|
thumbnail: /* @__PURE__ */ n(
|
|
1222
|
-
|
|
1222
|
+
bn,
|
|
1223
1223
|
{
|
|
1224
1224
|
mimeType: t,
|
|
1225
1225
|
sourceUrl: e,
|
|
@@ -1230,23 +1230,23 @@ const xn = ({
|
|
|
1230
1230
|
)
|
|
1231
1231
|
}
|
|
1232
1232
|
);
|
|
1233
|
-
},
|
|
1233
|
+
}, Nn = ({
|
|
1234
1234
|
resolvedUrl: e,
|
|
1235
1235
|
resolvedType: t,
|
|
1236
1236
|
title: s,
|
|
1237
1237
|
fileSize: a,
|
|
1238
1238
|
thumbnailUrl: r
|
|
1239
1239
|
}) => {
|
|
1240
|
-
const i = oe(t), o = a !== void 0 ?
|
|
1240
|
+
const i = oe(t), o = a !== void 0 ? xn(a) : void 0;
|
|
1241
1241
|
return /* @__PURE__ */ n(
|
|
1242
|
-
|
|
1242
|
+
vn,
|
|
1243
1243
|
{
|
|
1244
1244
|
variant: "light",
|
|
1245
1245
|
title: s,
|
|
1246
1246
|
mimeType: t,
|
|
1247
1247
|
detail: o,
|
|
1248
1248
|
thumbnail: /* @__PURE__ */ n(
|
|
1249
|
-
|
|
1249
|
+
bn,
|
|
1250
1250
|
{
|
|
1251
1251
|
mimeType: t,
|
|
1252
1252
|
sourceUrl: e,
|
|
@@ -1256,17 +1256,17 @@ const xn = ({
|
|
|
1256
1256
|
containedImage: i === "image" || i === "document"
|
|
1257
1257
|
}
|
|
1258
1258
|
),
|
|
1259
|
-
action: /* @__PURE__ */ n(
|
|
1259
|
+
action: /* @__PURE__ */ n(La, { url: e, filename: s })
|
|
1260
1260
|
}
|
|
1261
1261
|
);
|
|
1262
|
-
},
|
|
1262
|
+
}, Ra = ({
|
|
1263
1263
|
message: e,
|
|
1264
1264
|
isMyMessage: t = !1
|
|
1265
1265
|
}) => {
|
|
1266
1266
|
const s = ot(e), a = lt(e);
|
|
1267
1267
|
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", "data-dd-privacy": "mask", children: [
|
|
1268
1268
|
!t && e.user && /* @__PURE__ */ n(
|
|
1269
|
-
|
|
1269
|
+
se,
|
|
1270
1270
|
{
|
|
1271
1271
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1272
1272
|
id: e.user.id,
|
|
@@ -1284,41 +1284,41 @@ const xn = ({
|
|
|
1284
1284
|
{
|
|
1285
1285
|
className: "str-chat__message-bubble",
|
|
1286
1286
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1287
|
-
children: s ? /* @__PURE__ */ n("div", { className: rt(t), children: /* @__PURE__ */ n(it, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(
|
|
1287
|
+
children: s ? /* @__PURE__ */ n("div", { className: rt(t), children: /* @__PURE__ */ n(it, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(_n, { ...a }) : /* @__PURE__ */ n(Nn, { ...a })
|
|
1288
1288
|
}
|
|
1289
1289
|
) })
|
|
1290
1290
|
}
|
|
1291
1291
|
)
|
|
1292
1292
|
] });
|
|
1293
|
-
},
|
|
1293
|
+
}, Da = ({
|
|
1294
1294
|
message: e
|
|
1295
1295
|
}) => {
|
|
1296
1296
|
const t = ot(e);
|
|
1297
1297
|
if (t)
|
|
1298
1298
|
return /* @__PURE__ */ n("div", { className: rt(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(it, { attachment: t, isMyMessage: !0 }) });
|
|
1299
1299
|
const s = lt(e);
|
|
1300
|
-
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(
|
|
1301
|
-
},
|
|
1300
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(_n, { ...s }) }) : null;
|
|
1301
|
+
}, Pa = ({
|
|
1302
1302
|
message: e
|
|
1303
1303
|
}) => {
|
|
1304
1304
|
const t = ot(e);
|
|
1305
1305
|
if (t)
|
|
1306
1306
|
return /* @__PURE__ */ n("div", { className: rt(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(it, { attachment: t, isMyMessage: !1 }) });
|
|
1307
1307
|
const s = lt(e);
|
|
1308
|
-
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(
|
|
1309
|
-
},
|
|
1310
|
-
Creator:
|
|
1311
|
-
Visitor:
|
|
1312
|
-
}),
|
|
1308
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(Nn, { ...s }) }) : null;
|
|
1309
|
+
}, no = Object.assign(Ra, {
|
|
1310
|
+
Creator: Da,
|
|
1311
|
+
Visitor: Pa
|
|
1312
|
+
}), za = {
|
|
1313
1313
|
dark: "bg-[#121110]",
|
|
1314
1314
|
light: "bg-[#e9eaed]"
|
|
1315
|
-
},
|
|
1315
|
+
}, Oa = {
|
|
1316
1316
|
dark: "text-white",
|
|
1317
1317
|
light: "text-[#080707]"
|
|
1318
|
-
},
|
|
1318
|
+
}, Fa = {
|
|
1319
1319
|
dark: "border-white/[0.08]",
|
|
1320
1320
|
light: "border-black/[0.08]"
|
|
1321
|
-
},
|
|
1321
|
+
}, $a = (e) => e === "dark" ? "sender" : "receiver", Ba = {
|
|
1322
1322
|
sender: {
|
|
1323
1323
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1324
1324
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1331,7 +1331,7 @@ const xn = ({
|
|
|
1331
1331
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
1332
1332
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
1333
1333
|
}
|
|
1334
|
-
},
|
|
1334
|
+
}, Ie = ({
|
|
1335
1335
|
variant: e,
|
|
1336
1336
|
text: t,
|
|
1337
1337
|
bordered: s = !0,
|
|
@@ -1340,7 +1340,7 @@ const xn = ({
|
|
|
1340
1340
|
children: i,
|
|
1341
1341
|
"data-testid": o
|
|
1342
1342
|
}) => {
|
|
1343
|
-
const l = t != null && t !== "", d =
|
|
1343
|
+
const l = t != null && t !== "", d = Ba[$a(e)][a];
|
|
1344
1344
|
return /* @__PURE__ */ h(
|
|
1345
1345
|
"div",
|
|
1346
1346
|
{
|
|
@@ -1355,10 +1355,10 @@ const xn = ({
|
|
|
1355
1355
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1356
1356
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1357
1357
|
d,
|
|
1358
|
-
|
|
1359
|
-
|
|
1358
|
+
za[e],
|
|
1359
|
+
Oa[e],
|
|
1360
1360
|
s && "border",
|
|
1361
|
-
s &&
|
|
1361
|
+
s && Fa[e],
|
|
1362
1362
|
r
|
|
1363
1363
|
),
|
|
1364
1364
|
children: [
|
|
@@ -1383,7 +1383,7 @@ const xn = ({
|
|
|
1383
1383
|
]
|
|
1384
1384
|
}
|
|
1385
1385
|
);
|
|
1386
|
-
},
|
|
1386
|
+
}, Te = ({
|
|
1387
1387
|
onClick: e,
|
|
1388
1388
|
variant: t = "overlay",
|
|
1389
1389
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -1401,16 +1401,16 @@ const xn = ({
|
|
|
1401
1401
|
),
|
|
1402
1402
|
children: /* @__PURE__ */ n(Be, { className: "size-3", weight: "bold" })
|
|
1403
1403
|
}
|
|
1404
|
-
),
|
|
1404
|
+
), Ae = (e) => e === "received" ? "light" : "dark", ja = ({
|
|
1405
1405
|
firstOfGroup: e,
|
|
1406
1406
|
endOfGroup: t,
|
|
1407
1407
|
groupedByUser: s
|
|
1408
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1408
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ua = ({
|
|
1409
1409
|
src: e,
|
|
1410
1410
|
mimeType: t,
|
|
1411
1411
|
filename: s,
|
|
1412
1412
|
items: a
|
|
1413
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
1413
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Va = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1414
1414
|
/* @__PURE__ */ n(
|
|
1415
1415
|
"audio",
|
|
1416
1416
|
{
|
|
@@ -1433,41 +1433,41 @@ const xn = ({
|
|
|
1433
1433
|
preload: l,
|
|
1434
1434
|
onDismiss: d
|
|
1435
1435
|
}) => {
|
|
1436
|
-
const u =
|
|
1436
|
+
const u = Ae(e), g = e === "composer" && !!d, m = Ua({ src: t, mimeType: s, filename: a, items: r });
|
|
1437
1437
|
if (m.length === 0)
|
|
1438
1438
|
return null;
|
|
1439
1439
|
const f = l ?? (m.length > 1 ? "none" : "metadata");
|
|
1440
1440
|
return /* @__PURE__ */ n(
|
|
1441
|
-
|
|
1441
|
+
Ie,
|
|
1442
1442
|
{
|
|
1443
1443
|
variant: u,
|
|
1444
1444
|
text: i,
|
|
1445
1445
|
groupPosition: o,
|
|
1446
1446
|
"data-testid": "audio-attachment",
|
|
1447
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((
|
|
1448
|
-
|
|
1447
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b, c) => /* @__PURE__ */ n(
|
|
1448
|
+
Va,
|
|
1449
1449
|
{
|
|
1450
|
-
item:
|
|
1450
|
+
item: b,
|
|
1451
1451
|
preload: f,
|
|
1452
1452
|
trailingAction: (
|
|
1453
1453
|
// Composer only supports a single attachment, so the
|
|
1454
1454
|
// dismiss control sits on the only player.
|
|
1455
|
-
g &&
|
|
1455
|
+
g && c === 0 ? /* @__PURE__ */ n(Te, { onClick: d, variant: "inline" }) : void 0
|
|
1456
1456
|
)
|
|
1457
1457
|
},
|
|
1458
|
-
`${
|
|
1458
|
+
`${b.src}-${c}`
|
|
1459
1459
|
)) })
|
|
1460
1460
|
}
|
|
1461
1461
|
);
|
|
1462
|
-
},
|
|
1463
|
-
Composer:
|
|
1464
|
-
Sent:
|
|
1465
|
-
Received:
|
|
1462
|
+
}, Ga = (e) => /* @__PURE__ */ n(ct, { ...e, state: "composer" }), Ha = (e) => /* @__PURE__ */ n(ct, { ...e, state: "sent" }), Ya = (e) => /* @__PURE__ */ n(ct, { ...e, state: "received" }), qa = {
|
|
1463
|
+
Composer: Ga,
|
|
1464
|
+
Sent: Ha,
|
|
1465
|
+
Received: Ya
|
|
1466
1466
|
};
|
|
1467
|
-
function
|
|
1467
|
+
function Wa(e) {
|
|
1468
1468
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
1469
1469
|
}
|
|
1470
|
-
const
|
|
1470
|
+
const Xa = {
|
|
1471
1471
|
pdf: "PDF",
|
|
1472
1472
|
doc: "DOC",
|
|
1473
1473
|
xls: "XLS",
|
|
@@ -1477,7 +1477,7 @@ const qa = {
|
|
|
1477
1477
|
text: "TXT",
|
|
1478
1478
|
markdown: "MD"
|
|
1479
1479
|
};
|
|
1480
|
-
function
|
|
1480
|
+
function Ka(e, t) {
|
|
1481
1481
|
if (t) {
|
|
1482
1482
|
const r = t.lastIndexOf(".");
|
|
1483
1483
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1487,7 +1487,7 @@ function Wa(e, t) {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
if (!e) return;
|
|
1489
1489
|
if (oe(e) === "document") {
|
|
1490
|
-
const r =
|
|
1490
|
+
const r = pn(e), i = Xa[r];
|
|
1491
1491
|
if (i) return i;
|
|
1492
1492
|
if (e === "application/octet-stream") return;
|
|
1493
1493
|
}
|
|
@@ -1495,11 +1495,11 @@ function Wa(e, t) {
|
|
|
1495
1495
|
if (!(!a || a === "*"))
|
|
1496
1496
|
return a.toUpperCase();
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1499
|
-
const a =
|
|
1498
|
+
function Ja(e, t, s) {
|
|
1499
|
+
const a = Ka(e, t), r = typeof s == "number" && s > 0 ? Wa(s) : void 0;
|
|
1500
1500
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1502
|
+
function ae(e) {
|
|
1503
1503
|
try {
|
|
1504
1504
|
const s = new URL(e).pathname.split("/").pop();
|
|
1505
1505
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -1507,16 +1507,16 @@ function re(e) {
|
|
|
1507
1507
|
return "download";
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
|
-
const
|
|
1510
|
+
const Za = {
|
|
1511
1511
|
dark: "text-white/55",
|
|
1512
1512
|
light: "text-black/65"
|
|
1513
|
-
},
|
|
1513
|
+
}, Qa = {
|
|
1514
1514
|
dark: "bg-white/10",
|
|
1515
1515
|
light: "bg-black/5"
|
|
1516
|
-
},
|
|
1516
|
+
}, er = {
|
|
1517
1517
|
dark: "text-white/85",
|
|
1518
1518
|
light: "text-black/85"
|
|
1519
|
-
},
|
|
1519
|
+
}, yn = ({
|
|
1520
1520
|
variant: e,
|
|
1521
1521
|
filename: t,
|
|
1522
1522
|
title: s,
|
|
@@ -1526,16 +1526,16 @@ const Ka = {
|
|
|
1526
1526
|
activateLabel: o,
|
|
1527
1527
|
trailingAction: l
|
|
1528
1528
|
}) => {
|
|
1529
|
-
const d = s ?? t ?? "File", u =
|
|
1529
|
+
const d = s ?? t ?? "File", u = Ja(a, t, r), g = /* @__PURE__ */ n(
|
|
1530
1530
|
"div",
|
|
1531
1531
|
{
|
|
1532
1532
|
className: C(
|
|
1533
1533
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1534
|
-
|
|
1534
|
+
Qa[e]
|
|
1535
1535
|
),
|
|
1536
1536
|
"aria-hidden": !0,
|
|
1537
|
-
children:
|
|
1538
|
-
className: C("size-6",
|
|
1537
|
+
children: pe(a, {
|
|
1538
|
+
className: C("size-6", er[e]),
|
|
1539
1539
|
weight: "regular"
|
|
1540
1540
|
})
|
|
1541
1541
|
}
|
|
@@ -1546,7 +1546,7 @@ const Ka = {
|
|
|
1546
1546
|
{
|
|
1547
1547
|
className: C(
|
|
1548
1548
|
"truncate text-xs leading-4",
|
|
1549
|
-
|
|
1549
|
+
Za[e]
|
|
1550
1550
|
),
|
|
1551
1551
|
children: u
|
|
1552
1552
|
}
|
|
@@ -1575,8 +1575,8 @@ const Ka = {
|
|
|
1575
1575
|
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
1576
1576
|
] });
|
|
1577
1577
|
};
|
|
1578
|
-
async function
|
|
1579
|
-
const s = t ??
|
|
1578
|
+
async function Cn(e, t) {
|
|
1579
|
+
const s = t ?? ae(e);
|
|
1580
1580
|
try {
|
|
1581
1581
|
const a = await fetch(e, { mode: "cors" });
|
|
1582
1582
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -1589,23 +1589,23 @@ async function Nn(e, t) {
|
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
|
-
const
|
|
1592
|
+
const tr = ({
|
|
1593
1593
|
src: e,
|
|
1594
1594
|
filename: t,
|
|
1595
1595
|
fileSize: s,
|
|
1596
1596
|
mimeType: a,
|
|
1597
1597
|
title: r,
|
|
1598
1598
|
items: i
|
|
1599
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
1599
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], nr = ({
|
|
1600
1600
|
variant: e,
|
|
1601
1601
|
item: t,
|
|
1602
1602
|
index: s,
|
|
1603
1603
|
onActivate: a,
|
|
1604
1604
|
trailingAction: r
|
|
1605
1605
|
}) => {
|
|
1606
|
-
const i = t.filename ??
|
|
1606
|
+
const i = t.filename ?? ae(t.src);
|
|
1607
1607
|
return /* @__PURE__ */ n(
|
|
1608
|
-
|
|
1608
|
+
yn,
|
|
1609
1609
|
{
|
|
1610
1610
|
variant: e,
|
|
1611
1611
|
filename: i,
|
|
@@ -1630,21 +1630,21 @@ const Qa = ({
|
|
|
1630
1630
|
onClick: u,
|
|
1631
1631
|
onDismiss: g
|
|
1632
1632
|
}) => {
|
|
1633
|
-
const m =
|
|
1633
|
+
const m = Ae(e), f = e === "composer" && !!g, b = tr({
|
|
1634
1634
|
src: t,
|
|
1635
1635
|
filename: s,
|
|
1636
1636
|
fileSize: a,
|
|
1637
1637
|
mimeType: r,
|
|
1638
1638
|
title: i,
|
|
1639
1639
|
items: o
|
|
1640
|
-
}),
|
|
1641
|
-
if ((u == null ? void 0 : u(
|
|
1642
|
-
const p =
|
|
1640
|
+
}), c = (v) => {
|
|
1641
|
+
if ((u == null ? void 0 : u(v)) === !1) return;
|
|
1642
|
+
const p = b[v];
|
|
1643
1643
|
if (!p) return;
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1644
|
+
const N = p.filename ?? ae(p.src);
|
|
1645
|
+
Cn(p.src, N);
|
|
1646
1646
|
};
|
|
1647
|
-
if (
|
|
1647
|
+
if (b.length === 0)
|
|
1648
1648
|
return null;
|
|
1649
1649
|
const w = /* @__PURE__ */ n(
|
|
1650
1650
|
"span",
|
|
@@ -1654,33 +1654,33 @@ const Qa = ({
|
|
|
1654
1654
|
m === "dark" ? "text-white/70" : "text-black/70"
|
|
1655
1655
|
),
|
|
1656
1656
|
"aria-hidden": !0,
|
|
1657
|
-
children: /* @__PURE__ */ n(
|
|
1657
|
+
children: /* @__PURE__ */ n(ke, { className: "size-5", weight: "bold" })
|
|
1658
1658
|
}
|
|
1659
1659
|
);
|
|
1660
1660
|
return /* @__PURE__ */ n(
|
|
1661
|
-
|
|
1661
|
+
Ie,
|
|
1662
1662
|
{
|
|
1663
1663
|
variant: m,
|
|
1664
1664
|
text: l,
|
|
1665
1665
|
groupPosition: d,
|
|
1666
1666
|
"data-testid": "file-attachment",
|
|
1667
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children:
|
|
1668
|
-
|
|
1667
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: b.map((v, p) => /* @__PURE__ */ n(
|
|
1668
|
+
nr,
|
|
1669
1669
|
{
|
|
1670
1670
|
variant: m,
|
|
1671
|
-
item:
|
|
1671
|
+
item: v,
|
|
1672
1672
|
index: p,
|
|
1673
|
-
onActivate:
|
|
1674
|
-
trailingAction: f && p === 0 ? /* @__PURE__ */ n(
|
|
1673
|
+
onActivate: c,
|
|
1674
|
+
trailingAction: f && p === 0 ? /* @__PURE__ */ n(Te, { onClick: g, variant: "inline" }) : w
|
|
1675
1675
|
},
|
|
1676
|
-
`${
|
|
1676
|
+
`${v.src}-${p}`
|
|
1677
1677
|
)) })
|
|
1678
1678
|
}
|
|
1679
1679
|
);
|
|
1680
|
-
},
|
|
1681
|
-
Composer:
|
|
1682
|
-
Sent:
|
|
1683
|
-
Received:
|
|
1680
|
+
}, sr = (e) => /* @__PURE__ */ n(dt, { ...e, state: "composer" }), ar = (e) => /* @__PURE__ */ n(dt, { ...e, state: "sent" }), rr = (e) => /* @__PURE__ */ n(dt, { ...e, state: "received" }), ir = {
|
|
1681
|
+
Composer: sr,
|
|
1682
|
+
Sent: ar,
|
|
1683
|
+
Received: rr
|
|
1684
1684
|
}, ut = ({
|
|
1685
1685
|
onPrev: e,
|
|
1686
1686
|
onNext: t,
|
|
@@ -1694,7 +1694,7 @@ const Qa = ({
|
|
|
1694
1694
|
onClick: e,
|
|
1695
1695
|
"aria-label": s,
|
|
1696
1696
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1697
|
-
children: /* @__PURE__ */ n(
|
|
1697
|
+
children: /* @__PURE__ */ n(Vs, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1698
1698
|
}
|
|
1699
1699
|
),
|
|
1700
1700
|
/* @__PURE__ */ n(
|
|
@@ -1704,10 +1704,10 @@ const Qa = ({
|
|
|
1704
1704
|
onClick: t,
|
|
1705
1705
|
"aria-label": a,
|
|
1706
1706
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
1707
|
-
children: /* @__PURE__ */ n(
|
|
1707
|
+
children: /* @__PURE__ */ n(_e, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1708
1708
|
}
|
|
1709
1709
|
)
|
|
1710
|
-
] }),
|
|
1710
|
+
] }), kn = ({
|
|
1711
1711
|
url: e,
|
|
1712
1712
|
filename: t,
|
|
1713
1713
|
variant: s = "pill",
|
|
@@ -1716,9 +1716,9 @@ const Qa = ({
|
|
|
1716
1716
|
tone: i = "dark",
|
|
1717
1717
|
onTriggered: o
|
|
1718
1718
|
}) => {
|
|
1719
|
-
const [l, d] =
|
|
1720
|
-
(
|
|
1721
|
-
|
|
1719
|
+
const [l, d] = $(!1), u = K(
|
|
1720
|
+
(b) => {
|
|
1721
|
+
b.stopPropagation(), !l && (d(!0), Cn(e, t).catch(() => {
|
|
1722
1722
|
}).finally(() => {
|
|
1723
1723
|
d(!1), o == null || o();
|
|
1724
1724
|
}));
|
|
@@ -1743,14 +1743,14 @@ const Qa = ({
|
|
|
1743
1743
|
}[i]
|
|
1744
1744
|
),
|
|
1745
1745
|
children: l ? /* @__PURE__ */ n(
|
|
1746
|
-
|
|
1746
|
+
Ce,
|
|
1747
1747
|
{
|
|
1748
1748
|
className: "size-4 animate-spin",
|
|
1749
1749
|
weight: "bold",
|
|
1750
1750
|
"aria-hidden": !0
|
|
1751
1751
|
}
|
|
1752
1752
|
) : /* @__PURE__ */ n(
|
|
1753
|
-
|
|
1753
|
+
ke,
|
|
1754
1754
|
{
|
|
1755
1755
|
className: "size-5 shrink-0",
|
|
1756
1756
|
weight: "bold",
|
|
@@ -1766,7 +1766,7 @@ const Qa = ({
|
|
|
1766
1766
|
disabled: l,
|
|
1767
1767
|
"aria-label": a,
|
|
1768
1768
|
className: "mes-media-viewer__action",
|
|
1769
|
-
children: l ? /* @__PURE__ */ n(
|
|
1769
|
+
children: l ? /* @__PURE__ */ n(Ce, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(ke, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1770
1770
|
}
|
|
1771
1771
|
) : /* @__PURE__ */ h(
|
|
1772
1772
|
"button",
|
|
@@ -1781,13 +1781,13 @@ const Qa = ({
|
|
|
1781
1781
|
),
|
|
1782
1782
|
children: [
|
|
1783
1783
|
l ? /* @__PURE__ */ n(
|
|
1784
|
-
|
|
1784
|
+
Ce,
|
|
1785
1785
|
{
|
|
1786
1786
|
className: "size-4 animate-spin",
|
|
1787
1787
|
weight: "bold",
|
|
1788
1788
|
"aria-hidden": !0
|
|
1789
1789
|
}
|
|
1790
|
-
) : /* @__PURE__ */ n(
|
|
1790
|
+
) : /* @__PURE__ */ n(ke, { ...f, "aria-hidden": !0 }),
|
|
1791
1791
|
g ? null : a
|
|
1792
1792
|
]
|
|
1793
1793
|
}
|
|
@@ -1797,18 +1797,18 @@ const Qa = ({
|
|
|
1797
1797
|
initialIndex: t,
|
|
1798
1798
|
open: s
|
|
1799
1799
|
}) => {
|
|
1800
|
-
const a = Ye(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
1801
|
-
|
|
1800
|
+
const a = Ye(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
|
|
1801
|
+
X(() => {
|
|
1802
1802
|
s && i(Ye(t, 0, Math.max(e - 1, 0)));
|
|
1803
|
-
}, [s, t, e]),
|
|
1803
|
+
}, [s, t, e]), X(() => {
|
|
1804
1804
|
i((d) => Ye(d, 0, Math.max(e - 1, 0)));
|
|
1805
1805
|
}, [e]);
|
|
1806
|
-
const o =
|
|
1806
|
+
const o = K(() => {
|
|
1807
1807
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
1808
|
-
}, [e]), l =
|
|
1808
|
+
}, [e]), l = K(() => {
|
|
1809
1809
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
1810
1810
|
}, [e]);
|
|
1811
|
-
return
|
|
1811
|
+
return X(() => {
|
|
1812
1812
|
if (!s || e <= 1) return;
|
|
1813
1813
|
const d = (u) => {
|
|
1814
1814
|
if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
|
|
@@ -1827,7 +1827,7 @@ const Qa = ({
|
|
|
1827
1827
|
"data-testid": o
|
|
1828
1828
|
}) => {
|
|
1829
1829
|
const l = Y(null), d = Y(null);
|
|
1830
|
-
return
|
|
1830
|
+
return X(() => {
|
|
1831
1831
|
var f;
|
|
1832
1832
|
const m = l.current;
|
|
1833
1833
|
if (m) {
|
|
@@ -1841,7 +1841,7 @@ const Qa = ({
|
|
|
1841
1841
|
}
|
|
1842
1842
|
else
|
|
1843
1843
|
m.setAttribute("open", "");
|
|
1844
|
-
const
|
|
1844
|
+
const b = typeof document < "u" ? document.activeElement : null;
|
|
1845
1845
|
return (f = d.current) == null || f.focus(), () => {
|
|
1846
1846
|
if (m.open)
|
|
1847
1847
|
if (typeof m.close == "function")
|
|
@@ -1852,7 +1852,7 @@ const Qa = ({
|
|
|
1852
1852
|
}
|
|
1853
1853
|
else
|
|
1854
1854
|
m.removeAttribute("open");
|
|
1855
|
-
|
|
1855
|
+
b && document.body.contains(b) && b.focus();
|
|
1856
1856
|
};
|
|
1857
1857
|
}
|
|
1858
1858
|
if (m.open)
|
|
@@ -1907,7 +1907,7 @@ const Qa = ({
|
|
|
1907
1907
|
]
|
|
1908
1908
|
}
|
|
1909
1909
|
);
|
|
1910
|
-
},
|
|
1910
|
+
}, Sn = ({
|
|
1911
1911
|
open: e,
|
|
1912
1912
|
items: t,
|
|
1913
1913
|
initialIndex: s = 0,
|
|
@@ -1917,8 +1917,8 @@ const Qa = ({
|
|
|
1917
1917
|
length: t.length,
|
|
1918
1918
|
initialIndex: s,
|
|
1919
1919
|
open: e
|
|
1920
|
-
}), l = t[r], d =
|
|
1921
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
1920
|
+
}), l = t[r], d = ne(
|
|
1921
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "image"),
|
|
1922
1922
|
[l]
|
|
1923
1923
|
);
|
|
1924
1924
|
return l ? /* @__PURE__ */ h(
|
|
@@ -1929,7 +1929,7 @@ const Qa = ({
|
|
|
1929
1929
|
ariaLabel: d,
|
|
1930
1930
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
1931
1931
|
actions: /* @__PURE__ */ n(
|
|
1932
|
-
|
|
1932
|
+
kn,
|
|
1933
1933
|
{
|
|
1934
1934
|
url: l.src,
|
|
1935
1935
|
filename: d,
|
|
@@ -1963,7 +1963,7 @@ const Qa = ({
|
|
|
1963
1963
|
]
|
|
1964
1964
|
}
|
|
1965
1965
|
) : null;
|
|
1966
|
-
},
|
|
1966
|
+
}, or = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", En = ({
|
|
1967
1967
|
tiles: e,
|
|
1968
1968
|
onTileActivate: t,
|
|
1969
1969
|
maxVisible: s = 4,
|
|
@@ -1972,7 +1972,7 @@ const Qa = ({
|
|
|
1972
1972
|
const r = e.length;
|
|
1973
1973
|
if (r === 0) return null;
|
|
1974
1974
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, u, g) => {
|
|
1975
|
-
const m = C(
|
|
1975
|
+
const m = C(or, "h-full w-full");
|
|
1976
1976
|
return t ? /* @__PURE__ */ h(
|
|
1977
1977
|
"button",
|
|
1978
1978
|
{
|
|
@@ -2033,15 +2033,15 @@ const Qa = ({
|
|
|
2033
2033
|
})
|
|
2034
2034
|
}
|
|
2035
2035
|
);
|
|
2036
|
-
},
|
|
2037
|
-
const [t, s] =
|
|
2036
|
+
}, Me = (e) => {
|
|
2037
|
+
const [t, s] = $(!1), [a, r] = $(0), i = K(
|
|
2038
2038
|
(l) => {
|
|
2039
2039
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
2040
2040
|
},
|
|
2041
2041
|
[e]
|
|
2042
|
-
), o =
|
|
2042
|
+
), o = K(() => s(!1), []);
|
|
2043
2043
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
2044
|
-
},
|
|
2044
|
+
}, lr = (e, t, s, a) => ({
|
|
2045
2045
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
2046
2046
|
content: /* @__PURE__ */ n(
|
|
2047
2047
|
"img",
|
|
@@ -2056,16 +2056,16 @@ const Qa = ({
|
|
|
2056
2056
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2057
2057
|
}
|
|
2058
2058
|
)
|
|
2059
|
-
}),
|
|
2059
|
+
}), cr = ({
|
|
2060
2060
|
src: e,
|
|
2061
2061
|
alt: t,
|
|
2062
2062
|
items: s
|
|
2063
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
2063
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], In = (e, t) => e.map((s, a) => ({
|
|
2064
2064
|
src: s.src,
|
|
2065
2065
|
alt: s.alt,
|
|
2066
2066
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2067
|
-
})),
|
|
2068
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } =
|
|
2067
|
+
})), dr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2068
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = Me(
|
|
2069
2069
|
r
|
|
2070
2070
|
);
|
|
2071
2071
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -2089,18 +2089,18 @@ const Qa = ({
|
|
|
2089
2089
|
)
|
|
2090
2090
|
}
|
|
2091
2091
|
),
|
|
2092
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
2092
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Te, { onClick: i }) }) : null,
|
|
2093
2093
|
/* @__PURE__ */ n(
|
|
2094
|
-
|
|
2094
|
+
Sn,
|
|
2095
2095
|
{
|
|
2096
2096
|
open: o,
|
|
2097
|
-
items:
|
|
2097
|
+
items: In([{ src: e, alt: t }], s),
|
|
2098
2098
|
initialIndex: l,
|
|
2099
2099
|
onClose: u
|
|
2100
2100
|
}
|
|
2101
2101
|
)
|
|
2102
2102
|
] });
|
|
2103
|
-
},
|
|
2103
|
+
}, Tn = ({
|
|
2104
2104
|
state: e,
|
|
2105
2105
|
src: t,
|
|
2106
2106
|
alt: s,
|
|
@@ -2111,40 +2111,40 @@ const Qa = ({
|
|
|
2111
2111
|
loading: l = "lazy",
|
|
2112
2112
|
onClick: d
|
|
2113
2113
|
}) => {
|
|
2114
|
-
const u =
|
|
2114
|
+
const u = cr({ src: t, alt: s, items: r }), g = Ae(e), { viewerOpen: m, viewerIndex: f, handleActivate: b, closeViewer: c } = Me(
|
|
2115
2115
|
d
|
|
2116
2116
|
);
|
|
2117
2117
|
if (u.length === 0)
|
|
2118
2118
|
return null;
|
|
2119
2119
|
const w = u.map(
|
|
2120
|
-
(
|
|
2120
|
+
(v, p) => lr(v, p, u.length, l)
|
|
2121
2121
|
);
|
|
2122
2122
|
return /* @__PURE__ */ h(
|
|
2123
|
-
|
|
2123
|
+
Ie,
|
|
2124
2124
|
{
|
|
2125
2125
|
variant: g,
|
|
2126
2126
|
text: i,
|
|
2127
2127
|
groupPosition: o,
|
|
2128
2128
|
"data-testid": "image-attachment",
|
|
2129
2129
|
children: [
|
|
2130
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
2130
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(En, { tiles: w, onTileActivate: b }) }),
|
|
2131
2131
|
/* @__PURE__ */ n(
|
|
2132
|
-
|
|
2132
|
+
Sn,
|
|
2133
2133
|
{
|
|
2134
2134
|
open: m,
|
|
2135
|
-
items:
|
|
2135
|
+
items: In(u, a),
|
|
2136
2136
|
initialIndex: f,
|
|
2137
|
-
onClose:
|
|
2137
|
+
onClose: c
|
|
2138
2138
|
}
|
|
2139
2139
|
)
|
|
2140
2140
|
]
|
|
2141
2141
|
}
|
|
2142
2142
|
);
|
|
2143
|
-
},
|
|
2144
|
-
Composer:
|
|
2145
|
-
Sent:
|
|
2146
|
-
Received:
|
|
2147
|
-
},
|
|
2143
|
+
}, ur = (e) => /* @__PURE__ */ n(dr, { ...e }), mr = (e) => /* @__PURE__ */ n(Tn, { ...e, state: "sent" }), hr = (e) => /* @__PURE__ */ n(Tn, { ...e, state: "received" }), fr = {
|
|
2144
|
+
Composer: ur,
|
|
2145
|
+
Sent: mr,
|
|
2146
|
+
Received: hr
|
|
2147
|
+
}, gr = ({
|
|
2148
2148
|
open: e,
|
|
2149
2149
|
items: t,
|
|
2150
2150
|
initialIndex: s = 0,
|
|
@@ -2154,11 +2154,11 @@ const Qa = ({
|
|
|
2154
2154
|
length: t.length,
|
|
2155
2155
|
initialIndex: s,
|
|
2156
2156
|
open: e
|
|
2157
|
-
}), l = t[r], d =
|
|
2158
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
2157
|
+
}), l = t[r], d = ne(
|
|
2158
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "document"),
|
|
2159
2159
|
[l]
|
|
2160
|
-
), u =
|
|
2161
|
-
() => l ?
|
|
2160
|
+
), u = ne(
|
|
2161
|
+
() => l ? pr(l.src) : void 0,
|
|
2162
2162
|
[l]
|
|
2163
2163
|
);
|
|
2164
2164
|
return !l || !u ? null : /* @__PURE__ */ h(
|
|
@@ -2192,25 +2192,25 @@ const Qa = ({
|
|
|
2192
2192
|
]
|
|
2193
2193
|
}
|
|
2194
2194
|
);
|
|
2195
|
-
},
|
|
2195
|
+
}, pr = (e) => {
|
|
2196
2196
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2197
2197
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
2198
|
-
},
|
|
2198
|
+
}, br = ({
|
|
2199
2199
|
src: e,
|
|
2200
2200
|
filename: t,
|
|
2201
2201
|
fileSize: s,
|
|
2202
2202
|
title: a,
|
|
2203
2203
|
items: r
|
|
2204
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
2204
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], vr = ({
|
|
2205
2205
|
variant: e,
|
|
2206
2206
|
item: t,
|
|
2207
2207
|
index: s,
|
|
2208
2208
|
onActivate: a,
|
|
2209
2209
|
trailingAction: r
|
|
2210
2210
|
}) => {
|
|
2211
|
-
const i = t.filename ??
|
|
2211
|
+
const i = t.filename ?? ae(t.src);
|
|
2212
2212
|
return /* @__PURE__ */ n(
|
|
2213
|
-
|
|
2213
|
+
yn,
|
|
2214
2214
|
{
|
|
2215
2215
|
variant: e,
|
|
2216
2216
|
filename: i,
|
|
@@ -2234,63 +2234,63 @@ const Qa = ({
|
|
|
2234
2234
|
onClick: d,
|
|
2235
2235
|
onDismiss: u
|
|
2236
2236
|
}) => {
|
|
2237
|
-
const g =
|
|
2237
|
+
const g = Ae(e), m = br({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: b, handleActivate: c, closeViewer: w } = Me(
|
|
2238
2238
|
d
|
|
2239
|
-
),
|
|
2239
|
+
), v = e === "composer" && !!u;
|
|
2240
2240
|
if (m.length === 0)
|
|
2241
2241
|
return null;
|
|
2242
|
-
const p = m.map((
|
|
2243
|
-
src:
|
|
2244
|
-
filename:
|
|
2242
|
+
const p = m.map((N) => ({
|
|
2243
|
+
src: N.src,
|
|
2244
|
+
filename: N.filename ?? ae(N.src)
|
|
2245
2245
|
}));
|
|
2246
2246
|
return /* @__PURE__ */ h(
|
|
2247
|
-
|
|
2247
|
+
Ie,
|
|
2248
2248
|
{
|
|
2249
2249
|
variant: g,
|
|
2250
2250
|
text: o,
|
|
2251
2251
|
groupPosition: l,
|
|
2252
2252
|
"data-testid": "pdf-attachment",
|
|
2253
2253
|
children: [
|
|
2254
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2254
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((N, _) => {
|
|
2255
|
+
const M = N.filename ?? ae(N.src), L = v && _ === 0 ? /* @__PURE__ */ n(Te, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
2256
|
+
kn,
|
|
2257
2257
|
{
|
|
2258
|
-
url:
|
|
2259
|
-
filename:
|
|
2258
|
+
url: N.src,
|
|
2259
|
+
filename: M,
|
|
2260
2260
|
variant: "inline",
|
|
2261
|
-
label: `Download ${
|
|
2261
|
+
label: `Download ${M}`,
|
|
2262
2262
|
tone: g
|
|
2263
2263
|
}
|
|
2264
2264
|
);
|
|
2265
2265
|
return /* @__PURE__ */ n(
|
|
2266
|
-
|
|
2266
|
+
vr,
|
|
2267
2267
|
{
|
|
2268
2268
|
variant: g,
|
|
2269
|
-
item:
|
|
2270
|
-
index:
|
|
2271
|
-
onActivate:
|
|
2272
|
-
trailingAction:
|
|
2269
|
+
item: N,
|
|
2270
|
+
index: _,
|
|
2271
|
+
onActivate: c,
|
|
2272
|
+
trailingAction: L
|
|
2273
2273
|
},
|
|
2274
|
-
`${
|
|
2274
|
+
`${N.src}-${_}`
|
|
2275
2275
|
);
|
|
2276
2276
|
}) }),
|
|
2277
2277
|
/* @__PURE__ */ n(
|
|
2278
|
-
|
|
2278
|
+
gr,
|
|
2279
2279
|
{
|
|
2280
2280
|
open: f,
|
|
2281
2281
|
items: p,
|
|
2282
|
-
initialIndex:
|
|
2282
|
+
initialIndex: b,
|
|
2283
2283
|
onClose: w
|
|
2284
2284
|
}
|
|
2285
2285
|
)
|
|
2286
2286
|
]
|
|
2287
2287
|
}
|
|
2288
2288
|
);
|
|
2289
|
-
},
|
|
2290
|
-
Composer:
|
|
2291
|
-
Sent:
|
|
2292
|
-
Received:
|
|
2293
|
-
},
|
|
2289
|
+
}, xr = (e) => /* @__PURE__ */ n(ft, { ...e, state: "composer" }), wr = (e) => /* @__PURE__ */ n(ft, { ...e, state: "sent" }), _r = (e) => /* @__PURE__ */ n(ft, { ...e, state: "received" }), Nr = {
|
|
2290
|
+
Composer: xr,
|
|
2291
|
+
Sent: wr,
|
|
2292
|
+
Received: _r
|
|
2293
|
+
}, An = ({
|
|
2294
2294
|
open: e,
|
|
2295
2295
|
items: t,
|
|
2296
2296
|
initialIndex: s = 0,
|
|
@@ -2300,8 +2300,8 @@ const Qa = ({
|
|
|
2300
2300
|
length: t.length,
|
|
2301
2301
|
initialIndex: s,
|
|
2302
2302
|
open: e
|
|
2303
|
-
}), l = t[r], d =
|
|
2304
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
2303
|
+
}), l = t[r], d = ne(
|
|
2304
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "video"),
|
|
2305
2305
|
[l]
|
|
2306
2306
|
);
|
|
2307
2307
|
return l ? /* @__PURE__ */ h(
|
|
@@ -2340,7 +2340,7 @@ const Qa = ({
|
|
|
2340
2340
|
]
|
|
2341
2341
|
}
|
|
2342
2342
|
) : null;
|
|
2343
|
-
},
|
|
2343
|
+
}, yr = () => /* @__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(Je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Mn = ({
|
|
2344
2344
|
item: e,
|
|
2345
2345
|
index: t
|
|
2346
2346
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2355,31 +2355,31 @@ const Qa = ({
|
|
|
2355
2355
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2356
2356
|
}
|
|
2357
2357
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
2358
|
-
|
|
2358
|
+
on,
|
|
2359
2359
|
{
|
|
2360
2360
|
className: "size-16 rounded-md text-white/30",
|
|
2361
2361
|
weight: "regular",
|
|
2362
2362
|
"aria-hidden": !0
|
|
2363
2363
|
}
|
|
2364
2364
|
) }),
|
|
2365
|
-
/* @__PURE__ */ n(
|
|
2366
|
-
] }),
|
|
2365
|
+
/* @__PURE__ */ n(yr, {})
|
|
2366
|
+
] }), Cr = (e, t, s) => ({
|
|
2367
2367
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
2368
|
-
content: /* @__PURE__ */ n(
|
|
2369
|
-
}),
|
|
2368
|
+
content: /* @__PURE__ */ n(Mn, { item: e, index: t })
|
|
2369
|
+
}), kr = ({
|
|
2370
2370
|
src: e,
|
|
2371
2371
|
poster: t,
|
|
2372
2372
|
mimeType: s,
|
|
2373
2373
|
preload: a,
|
|
2374
2374
|
items: r
|
|
2375
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
2375
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Ln = (e, t) => e.map((s, a) => ({
|
|
2376
2376
|
src: s.src,
|
|
2377
2377
|
poster: s.poster,
|
|
2378
2378
|
mimeType: s.mimeType,
|
|
2379
2379
|
preload: s.preload,
|
|
2380
2380
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2381
|
-
})),
|
|
2382
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: g } =
|
|
2381
|
+
})), Sr = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
2382
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: g } = Me(
|
|
2383
2383
|
i
|
|
2384
2384
|
);
|
|
2385
2385
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -2390,15 +2390,15 @@ const Qa = ({
|
|
|
2390
2390
|
onClick: () => u(0),
|
|
2391
2391
|
"aria-label": "Play video",
|
|
2392
2392
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2393
|
-
children: /* @__PURE__ */ n(
|
|
2393
|
+
children: /* @__PURE__ */ n(Mn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
2394
2394
|
}
|
|
2395
2395
|
),
|
|
2396
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
2396
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Te, { onClick: o }) }) : null,
|
|
2397
2397
|
/* @__PURE__ */ n(
|
|
2398
|
-
|
|
2398
|
+
An,
|
|
2399
2399
|
{
|
|
2400
2400
|
open: l,
|
|
2401
|
-
items:
|
|
2401
|
+
items: Ln(
|
|
2402
2402
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
2403
2403
|
a
|
|
2404
2404
|
),
|
|
@@ -2407,7 +2407,7 @@ const Qa = ({
|
|
|
2407
2407
|
}
|
|
2408
2408
|
)
|
|
2409
2409
|
] });
|
|
2410
|
-
},
|
|
2410
|
+
}, Rn = ({
|
|
2411
2411
|
state: e,
|
|
2412
2412
|
src: t,
|
|
2413
2413
|
poster: s,
|
|
@@ -2419,16 +2419,16 @@ const Qa = ({
|
|
|
2419
2419
|
preload: d,
|
|
2420
2420
|
onClick: u
|
|
2421
2421
|
}) => {
|
|
2422
|
-
const g =
|
|
2422
|
+
const g = kr({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Ae(e), { viewerOpen: f, viewerIndex: b, handleActivate: c, closeViewer: w } = Me(
|
|
2423
2423
|
u
|
|
2424
2424
|
);
|
|
2425
2425
|
if (g.length === 0)
|
|
2426
2426
|
return null;
|
|
2427
|
-
const
|
|
2428
|
-
(p,
|
|
2427
|
+
const v = g.map(
|
|
2428
|
+
(p, N) => Cr(p, N, g.length)
|
|
2429
2429
|
);
|
|
2430
2430
|
return /* @__PURE__ */ h(
|
|
2431
|
-
|
|
2431
|
+
Ie,
|
|
2432
2432
|
{
|
|
2433
2433
|
variant: m,
|
|
2434
2434
|
text: o,
|
|
@@ -2436,44 +2436,44 @@ const Qa = ({
|
|
|
2436
2436
|
"data-testid": "video-attachment",
|
|
2437
2437
|
children: [
|
|
2438
2438
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
2439
|
-
|
|
2439
|
+
En,
|
|
2440
2440
|
{
|
|
2441
|
-
tiles:
|
|
2442
|
-
onTileActivate:
|
|
2441
|
+
tiles: v,
|
|
2442
|
+
onTileActivate: c,
|
|
2443
2443
|
className: "overflow-hidden rounded-md"
|
|
2444
2444
|
}
|
|
2445
2445
|
) }),
|
|
2446
2446
|
/* @__PURE__ */ n(
|
|
2447
|
-
|
|
2447
|
+
An,
|
|
2448
2448
|
{
|
|
2449
2449
|
open: f,
|
|
2450
|
-
items:
|
|
2451
|
-
initialIndex:
|
|
2450
|
+
items: Ln(g, r),
|
|
2451
|
+
initialIndex: b,
|
|
2452
2452
|
onClose: w
|
|
2453
2453
|
}
|
|
2454
2454
|
)
|
|
2455
2455
|
]
|
|
2456
2456
|
}
|
|
2457
2457
|
);
|
|
2458
|
-
},
|
|
2459
|
-
Composer:
|
|
2460
|
-
Sent:
|
|
2461
|
-
Received:
|
|
2462
|
-
},
|
|
2463
|
-
Image:
|
|
2464
|
-
Video:
|
|
2465
|
-
Audio:
|
|
2466
|
-
Pdf:
|
|
2467
|
-
File:
|
|
2468
|
-
},
|
|
2458
|
+
}, Er = (e) => /* @__PURE__ */ n(Sr, { ...e }), Ir = (e) => /* @__PURE__ */ n(Rn, { ...e, state: "sent" }), Tr = (e) => /* @__PURE__ */ n(Rn, { ...e, state: "received" }), Ar = {
|
|
2459
|
+
Composer: Er,
|
|
2460
|
+
Sent: Ir,
|
|
2461
|
+
Received: Tr
|
|
2462
|
+
}, we = {
|
|
2463
|
+
Image: fr,
|
|
2464
|
+
Video: Ar,
|
|
2465
|
+
Audio: qa,
|
|
2466
|
+
Pdf: Nr,
|
|
2467
|
+
File: ir
|
|
2468
|
+
}, Mr = {
|
|
2469
2469
|
isUnlocking: () => !1
|
|
2470
|
-
},
|
|
2471
|
-
LockedAttachment:
|
|
2472
|
-
},
|
|
2473
|
-
function
|
|
2474
|
-
return
|
|
2470
|
+
}, Lr = {
|
|
2471
|
+
LockedAttachment: Mr
|
|
2472
|
+
}, Dn = et({}), so = Dn.Provider;
|
|
2473
|
+
function Rr(e) {
|
|
2474
|
+
return Se(Dn)[e] ?? Lr[e];
|
|
2475
2475
|
}
|
|
2476
|
-
const
|
|
2476
|
+
const Dr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
2477
2477
|
"svg",
|
|
2478
2478
|
{
|
|
2479
2479
|
width: e,
|
|
@@ -2490,21 +2490,21 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2490
2490
|
}
|
|
2491
2491
|
)
|
|
2492
2492
|
}
|
|
2493
|
-
),
|
|
2493
|
+
), Pr = (e) => {
|
|
2494
2494
|
var t;
|
|
2495
2495
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2496
|
-
},
|
|
2496
|
+
}, zr = (e) => {
|
|
2497
2497
|
var t;
|
|
2498
2498
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2499
2499
|
}, ze = (e) => {
|
|
2500
2500
|
var t;
|
|
2501
2501
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2502
|
-
},
|
|
2502
|
+
}, Or = (e) => {
|
|
2503
2503
|
var t;
|
|
2504
2504
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2505
|
-
},
|
|
2505
|
+
}, Pn = (e) => Pr(e) || zr(e), Fr = (e) => {
|
|
2506
2506
|
var t;
|
|
2507
|
-
return
|
|
2507
|
+
return Pn(e) && !((t = e.text) != null && t.trim());
|
|
2508
2508
|
}, qe = ({
|
|
2509
2509
|
message: e,
|
|
2510
2510
|
standalone: t = !1,
|
|
@@ -2512,23 +2512,23 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2512
2512
|
hasAttachment: a = !1
|
|
2513
2513
|
}) => {
|
|
2514
2514
|
var m;
|
|
2515
|
-
const r =
|
|
2515
|
+
const r = Pn(e), i = ze(e);
|
|
2516
2516
|
if (!r && !i)
|
|
2517
2517
|
return null;
|
|
2518
2518
|
if (r) {
|
|
2519
2519
|
const f = (m = e.metadata) == null ? void 0 : m.amount_text;
|
|
2520
2520
|
if (!f) return null;
|
|
2521
|
-
const
|
|
2522
|
-
return /* @__PURE__ */ h("div", { className:
|
|
2523
|
-
/* @__PURE__ */ n(
|
|
2524
|
-
/* @__PURE__ */ n("span", { children:
|
|
2521
|
+
const b = t ? "message-tip-standalone" : "message-tag message-tag--tip", c = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
2522
|
+
return /* @__PURE__ */ h("div", { className: b, children: [
|
|
2523
|
+
/* @__PURE__ */ n(Gs, { size: t ? 14 : 12 }),
|
|
2524
|
+
/* @__PURE__ */ n("span", { children: c })
|
|
2525
2525
|
] });
|
|
2526
2526
|
}
|
|
2527
2527
|
const o = s && a, l = o ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
2528
2528
|
"message-chatbot-indicator",
|
|
2529
2529
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2530
2530
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2531
|
-
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
2531
|
+
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(Dr, { size: o ? 12 : 15 }) });
|
|
2532
2532
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(te, { children: [
|
|
2533
2533
|
u,
|
|
2534
2534
|
g
|
|
@@ -2536,7 +2536,7 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2536
2536
|
g,
|
|
2537
2537
|
u
|
|
2538
2538
|
] }) });
|
|
2539
|
-
},
|
|
2539
|
+
}, $r = ({
|
|
2540
2540
|
selected: e,
|
|
2541
2541
|
onVoteUp: t,
|
|
2542
2542
|
onVoteDown: s
|
|
@@ -2552,7 +2552,7 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2552
2552
|
"aria-label": "Good response",
|
|
2553
2553
|
"aria-pressed": e === "up",
|
|
2554
2554
|
"data-tooltip": "Good response",
|
|
2555
|
-
children: /* @__PURE__ */ n(
|
|
2555
|
+
children: /* @__PURE__ */ n(Hs, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2556
2556
|
}
|
|
2557
2557
|
),
|
|
2558
2558
|
/* @__PURE__ */ n(
|
|
@@ -2566,28 +2566,42 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2566
2566
|
"aria-label": "Bad response",
|
|
2567
2567
|
"aria-pressed": e === "down",
|
|
2568
2568
|
"data-tooltip": "Bad response",
|
|
2569
|
-
children: /* @__PURE__ */ n(
|
|
2569
|
+
children: /* @__PURE__ */ n(Ys, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2570
2570
|
}
|
|
2571
2571
|
)
|
|
2572
|
-
] }),
|
|
2572
|
+
] }), Br = ({
|
|
2573
|
+
message: e,
|
|
2574
|
+
isMyMessage: t,
|
|
2575
|
+
lastOwnMessageId: s
|
|
2576
|
+
}) => !(t && e.type !== "error" && s === e.id) || e.status !== "received" ? null : /* @__PURE__ */ h(
|
|
2577
|
+
"div",
|
|
2578
|
+
{
|
|
2579
|
+
className: "str-chat__message-delivery-status",
|
|
2580
|
+
"data-testid": "sent-message-delivery-status",
|
|
2581
|
+
children: [
|
|
2582
|
+
/* @__PURE__ */ n(qs, { size: 14, weight: "bold", "aria-hidden": "true" }),
|
|
2583
|
+
/* @__PURE__ */ n("span", { children: "Delivered" })
|
|
2584
|
+
]
|
|
2585
|
+
}
|
|
2586
|
+
), jr = /^([a-z][a-z0-9+.-]*):/i, Ur = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2573
2587
|
function gt(e) {
|
|
2574
2588
|
if (typeof e != "string") return;
|
|
2575
2589
|
const t = e.trim();
|
|
2576
2590
|
if (t === "") return;
|
|
2577
|
-
const s =
|
|
2591
|
+
const s = jr.exec(t);
|
|
2578
2592
|
if (s) {
|
|
2579
2593
|
const a = s[1].toLowerCase();
|
|
2580
|
-
return
|
|
2594
|
+
return Ur.has(a) ? t : void 0;
|
|
2581
2595
|
}
|
|
2582
2596
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2583
2597
|
}
|
|
2584
|
-
const
|
|
2598
|
+
const Vr = {
|
|
2585
2599
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2586
2600
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2587
|
-
},
|
|
2601
|
+
}, Gr = ({ variant: e, cta: t }) => {
|
|
2588
2602
|
const s = C(
|
|
2589
2603
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2590
|
-
|
|
2604
|
+
Vr[e]
|
|
2591
2605
|
), a = gt(t.href);
|
|
2592
2606
|
return a ? /* @__PURE__ */ n(
|
|
2593
2607
|
"a",
|
|
@@ -2614,10 +2628,10 @@ const Br = {
|
|
|
2614
2628
|
children: t.label
|
|
2615
2629
|
}
|
|
2616
2630
|
);
|
|
2617
|
-
},
|
|
2631
|
+
}, Hr = {
|
|
2618
2632
|
dark: "text-white",
|
|
2619
2633
|
light: "text-black/90"
|
|
2620
|
-
},
|
|
2634
|
+
}, Yr = "text-white/30", qr = {
|
|
2621
2635
|
dark: "text-white/55",
|
|
2622
2636
|
light: "text-black/55"
|
|
2623
2637
|
}, pt = ({
|
|
@@ -2630,14 +2644,14 @@ const Br = {
|
|
|
2630
2644
|
cta: o,
|
|
2631
2645
|
trailingAction: l
|
|
2632
2646
|
}) => {
|
|
2633
|
-
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", m = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "",
|
|
2634
|
-
if (!g && !m && !
|
|
2635
|
-
const
|
|
2647
|
+
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", m = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", b = f !== "", c = o != null;
|
|
2648
|
+
if (!g && !m && !b && !c) return null;
|
|
2649
|
+
const v = C(
|
|
2636
2650
|
"truncate text-base font-medium leading-6",
|
|
2637
|
-
d && !t ?
|
|
2651
|
+
d && !t ? Yr : Hr[e]
|
|
2638
2652
|
), p = C(
|
|
2639
2653
|
"truncate text-xs leading-4",
|
|
2640
|
-
|
|
2654
|
+
qr[e]
|
|
2641
2655
|
);
|
|
2642
2656
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2643
2657
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2645,17 +2659,17 @@ const Br = {
|
|
|
2645
2659
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2646
2660
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2647
2661
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2648
|
-
/* @__PURE__ */ n("p", { className: C("min-w-0",
|
|
2662
|
+
/* @__PURE__ */ n("p", { className: C("min-w-0", v), children: u })
|
|
2649
2663
|
] }),
|
|
2650
2664
|
m && /* @__PURE__ */ n("p", { className: p, children: a })
|
|
2651
2665
|
] }),
|
|
2652
|
-
!
|
|
2666
|
+
!c && b && /* @__PURE__ */ n("p", { className: p, children: f })
|
|
2653
2667
|
] }),
|
|
2654
2668
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2655
2669
|
] }),
|
|
2656
|
-
o && /* @__PURE__ */ n(
|
|
2670
|
+
o && /* @__PURE__ */ n(Gr, { variant: e, cta: o })
|
|
2657
2671
|
] });
|
|
2658
|
-
},
|
|
2672
|
+
}, Wr = C(
|
|
2659
2673
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2660
2674
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2661
2675
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2674,7 +2688,7 @@ const Br = {
|
|
|
2674
2688
|
"data-testid": d
|
|
2675
2689
|
}) => {
|
|
2676
2690
|
const u = s != null || a != null, g = C(
|
|
2677
|
-
|
|
2691
|
+
Wr,
|
|
2678
2692
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2679
2693
|
// `focus-ring` is a design-system utility from the component-library
|
|
2680
2694
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2722,17 +2736,17 @@ const Br = {
|
|
|
2722
2736
|
]
|
|
2723
2737
|
}
|
|
2724
2738
|
);
|
|
2725
|
-
},
|
|
2739
|
+
}, Xr = {
|
|
2726
2740
|
dark: "bg-white/10",
|
|
2727
2741
|
light: "bg-black/5"
|
|
2728
|
-
},
|
|
2742
|
+
}, Kr = {
|
|
2729
2743
|
dark: "size-16 text-white/25",
|
|
2730
2744
|
light: "size-16 text-black/25"
|
|
2731
|
-
}, je = (e, t) => !!t && !!e && oe(e) === "audio",
|
|
2745
|
+
}, je = (e, t) => !!t && !!e && oe(e) === "audio", bt = (e, t) => {
|
|
2732
2746
|
if (!t || !e) return !1;
|
|
2733
2747
|
const s = oe(e);
|
|
2734
2748
|
return s === "video" || s === "audio";
|
|
2735
|
-
},
|
|
2749
|
+
}, vt = "bg-[#F2F3F4]", Fe = ({
|
|
2736
2750
|
variant: e,
|
|
2737
2751
|
thumbnailUrl: t,
|
|
2738
2752
|
sourceUrl: s,
|
|
@@ -2783,10 +2797,10 @@ const Br = {
|
|
|
2783
2797
|
{
|
|
2784
2798
|
className: C(
|
|
2785
2799
|
"flex h-full w-full items-center justify-center",
|
|
2786
|
-
|
|
2800
|
+
Xr[e]
|
|
2787
2801
|
),
|
|
2788
|
-
children:
|
|
2789
|
-
className:
|
|
2802
|
+
children: pe(r, {
|
|
2803
|
+
className: Kr[e],
|
|
2790
2804
|
weight: "regular"
|
|
2791
2805
|
})
|
|
2792
2806
|
}
|
|
@@ -2796,7 +2810,7 @@ const Br = {
|
|
|
2796
2810
|
]
|
|
2797
2811
|
}
|
|
2798
2812
|
);
|
|
2799
|
-
},
|
|
2813
|
+
}, Jr = ({
|
|
2800
2814
|
title: e,
|
|
2801
2815
|
placeholderTitle: t,
|
|
2802
2816
|
description: s,
|
|
@@ -2810,7 +2824,7 @@ const Br = {
|
|
|
2810
2824
|
onDismiss: g,
|
|
2811
2825
|
onEditClick: m
|
|
2812
2826
|
}) => {
|
|
2813
|
-
const f = l === "classic",
|
|
2827
|
+
const f = l === "classic", b = je(r, o), c = g ? /* @__PURE__ */ n(
|
|
2814
2828
|
"button",
|
|
2815
2829
|
{
|
|
2816
2830
|
type: "button",
|
|
@@ -2826,10 +2840,10 @@ const Br = {
|
|
|
2826
2840
|
onClick: m,
|
|
2827
2841
|
"aria-label": "Edit attachment",
|
|
2828
2842
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
2829
|
-
children: /* @__PURE__ */ n(
|
|
2843
|
+
children: /* @__PURE__ */ n(Ws, { className: "size-5", weight: "regular" })
|
|
2830
2844
|
}
|
|
2831
2845
|
) : void 0;
|
|
2832
|
-
return
|
|
2846
|
+
return b ? /* @__PURE__ */ n(Oe, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
2833
2847
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
2834
2848
|
Fe,
|
|
2835
2849
|
{
|
|
@@ -2839,12 +2853,12 @@ const Br = {
|
|
|
2839
2853
|
mimeType: r
|
|
2840
2854
|
}
|
|
2841
2855
|
) }),
|
|
2842
|
-
|
|
2856
|
+
c && /* @__PURE__ */ n("div", { className: "shrink-0", children: c })
|
|
2843
2857
|
] }) }) : /* @__PURE__ */ h(
|
|
2844
2858
|
Oe,
|
|
2845
2859
|
{
|
|
2846
2860
|
variant: "dark",
|
|
2847
|
-
topRight: f ?
|
|
2861
|
+
topRight: f ? c : void 0,
|
|
2848
2862
|
children: [
|
|
2849
2863
|
!f && /* @__PURE__ */ n(
|
|
2850
2864
|
Fe,
|
|
@@ -2854,7 +2868,7 @@ const Br = {
|
|
|
2854
2868
|
sourceUrl: o,
|
|
2855
2869
|
title: e,
|
|
2856
2870
|
mimeType: r,
|
|
2857
|
-
topRight:
|
|
2871
|
+
topRight: c
|
|
2858
2872
|
}
|
|
2859
2873
|
),
|
|
2860
2874
|
/* @__PURE__ */ n(
|
|
@@ -2873,7 +2887,7 @@ const Br = {
|
|
|
2873
2887
|
]
|
|
2874
2888
|
}
|
|
2875
2889
|
);
|
|
2876
|
-
},
|
|
2890
|
+
}, Zr = ({
|
|
2877
2891
|
title: e,
|
|
2878
2892
|
description: t,
|
|
2879
2893
|
url: s,
|
|
@@ -2885,11 +2899,11 @@ const Br = {
|
|
|
2885
2899
|
cta: d,
|
|
2886
2900
|
onClick: u
|
|
2887
2901
|
}) => {
|
|
2888
|
-
const g =
|
|
2902
|
+
const g = bt(a, i), m = gt(s), f = d == null && m != null && !g ? m : void 0, b = d == null && !g ? u : void 0, c = je(a, i) ? vt : void 0, w = d && u ? {
|
|
2889
2903
|
...d,
|
|
2890
2904
|
onClick: () => {
|
|
2891
|
-
var
|
|
2892
|
-
u(), (
|
|
2905
|
+
var v;
|
|
2906
|
+
u(), (v = d.onClick) == null || v.call(d);
|
|
2893
2907
|
}
|
|
2894
2908
|
} : d;
|
|
2895
2909
|
return /* @__PURE__ */ h(
|
|
@@ -2897,9 +2911,9 @@ const Br = {
|
|
|
2897
2911
|
{
|
|
2898
2912
|
variant: "light",
|
|
2899
2913
|
href: f,
|
|
2900
|
-
onClick:
|
|
2914
|
+
onClick: b,
|
|
2901
2915
|
ariaLabel: e ?? "Open attachment preview",
|
|
2902
|
-
bgClassName:
|
|
2916
|
+
bgClassName: c,
|
|
2903
2917
|
"data-testid": "link-attachment",
|
|
2904
2918
|
children: [
|
|
2905
2919
|
o === "featured" && /* @__PURE__ */ n(
|
|
@@ -2926,7 +2940,7 @@ const Br = {
|
|
|
2926
2940
|
]
|
|
2927
2941
|
}
|
|
2928
2942
|
);
|
|
2929
|
-
},
|
|
2943
|
+
}, Qr = ({
|
|
2930
2944
|
title: e,
|
|
2931
2945
|
placeholderTitle: t,
|
|
2932
2946
|
description: s,
|
|
@@ -2939,14 +2953,14 @@ const Br = {
|
|
|
2939
2953
|
cta: u,
|
|
2940
2954
|
onClick: g
|
|
2941
2955
|
}) => {
|
|
2942
|
-
const m =
|
|
2956
|
+
const m = bt(r, o), f = gt(a), b = u == null && f != null && !m ? f : void 0, c = u == null && !m && b != null ? g : void 0;
|
|
2943
2957
|
return /* @__PURE__ */ h(
|
|
2944
2958
|
Oe,
|
|
2945
2959
|
{
|
|
2946
2960
|
variant: "dark",
|
|
2947
|
-
href:
|
|
2948
|
-
onClick:
|
|
2949
|
-
bgClassName: je(r, o) ?
|
|
2961
|
+
href: b,
|
|
2962
|
+
onClick: c,
|
|
2963
|
+
bgClassName: je(r, o) ? vt : void 0,
|
|
2950
2964
|
children: [
|
|
2951
2965
|
l === "featured" && /* @__PURE__ */ n(
|
|
2952
2966
|
Fe,
|
|
@@ -2973,22 +2987,22 @@ const Br = {
|
|
|
2973
2987
|
]
|
|
2974
2988
|
}
|
|
2975
2989
|
);
|
|
2976
|
-
},
|
|
2977
|
-
Composer:
|
|
2978
|
-
Sent:
|
|
2979
|
-
Received:
|
|
2980
|
-
},
|
|
2981
|
-
function
|
|
2990
|
+
}, Jt = {
|
|
2991
|
+
Composer: Jr,
|
|
2992
|
+
Sent: Qr,
|
|
2993
|
+
Received: Zr
|
|
2994
|
+
}, ei = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#121110] px-4 py-2 text-white", ti = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#e9eaed] px-4 py-2 text-[#080707]";
|
|
2995
|
+
function D(e) {
|
|
2982
2996
|
const t = e == null ? void 0 : e.trim();
|
|
2983
2997
|
return t || void 0;
|
|
2984
2998
|
}
|
|
2985
|
-
function
|
|
2999
|
+
function Zt(e) {
|
|
2986
3000
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
2987
3001
|
}
|
|
2988
|
-
function
|
|
3002
|
+
function ni(e, t) {
|
|
2989
3003
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
2990
3004
|
return !1;
|
|
2991
|
-
const s =
|
|
3005
|
+
const s = Zt(e), a = Zt(t);
|
|
2992
3006
|
if (s === a)
|
|
2993
3007
|
return !0;
|
|
2994
3008
|
if (!s.includes(a))
|
|
@@ -2996,29 +3010,29 @@ function Qr(e, t) {
|
|
|
2996
3010
|
const r = s.split(a).join("");
|
|
2997
3011
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
2998
3012
|
}
|
|
2999
|
-
function
|
|
3000
|
-
const t =
|
|
3013
|
+
function Qt(e) {
|
|
3014
|
+
const t = D(e.og_scrape_url) ?? D(e.title_link), s = D(e.image_url) ?? D(e.thumb_url), a = D(e.asset_url), r = D(e.mime_type);
|
|
3001
3015
|
return {
|
|
3002
|
-
title:
|
|
3003
|
-
description:
|
|
3016
|
+
title: D(e.title),
|
|
3017
|
+
description: D(e.text),
|
|
3004
3018
|
url: t,
|
|
3005
3019
|
thumbnailUrl: s,
|
|
3006
3020
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3007
3021
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3008
|
-
sourceUrl:
|
|
3009
|
-
layout: s ? "featured" : "classic",
|
|
3010
|
-
mimeType:
|
|
3022
|
+
sourceUrl: a,
|
|
3023
|
+
layout: s || bt(r, a) ? "featured" : "classic",
|
|
3024
|
+
mimeType: r
|
|
3011
3025
|
};
|
|
3012
3026
|
}
|
|
3013
|
-
function
|
|
3027
|
+
function si(e) {
|
|
3014
3028
|
var t;
|
|
3015
|
-
return
|
|
3029
|
+
return zn(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3016
3030
|
}
|
|
3017
|
-
function
|
|
3018
|
-
const t =
|
|
3031
|
+
function zn(e) {
|
|
3032
|
+
const t = D(e.og_scrape_url);
|
|
3019
3033
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3020
3034
|
}
|
|
3021
|
-
function
|
|
3035
|
+
function On(e) {
|
|
3022
3036
|
if (!(e != null && e.length)) return [];
|
|
3023
3037
|
const t = [], s = (r, i) => {
|
|
3024
3038
|
const o = t[t.length - 1];
|
|
@@ -3036,70 +3050,70 @@ function zn(e) {
|
|
|
3036
3050
|
t.push({ type: "link", attachments: [r] });
|
|
3037
3051
|
};
|
|
3038
3052
|
for (const r of e) {
|
|
3039
|
-
if (
|
|
3053
|
+
if (zn(r)) {
|
|
3040
3054
|
a(r);
|
|
3041
3055
|
continue;
|
|
3042
3056
|
}
|
|
3043
|
-
const i =
|
|
3057
|
+
const i = si(r);
|
|
3044
3058
|
i && s(i, r);
|
|
3045
3059
|
}
|
|
3046
3060
|
return t;
|
|
3047
3061
|
}
|
|
3048
|
-
function
|
|
3062
|
+
function ai(e) {
|
|
3049
3063
|
let t = 0;
|
|
3050
3064
|
for (const s of e)
|
|
3051
3065
|
t += s.type === "link" ? s.attachments.length : 1;
|
|
3052
3066
|
return t;
|
|
3053
3067
|
}
|
|
3054
|
-
function
|
|
3068
|
+
function ri(e) {
|
|
3055
3069
|
return e.filter((t) => t.type === "media").length;
|
|
3056
3070
|
}
|
|
3057
|
-
function
|
|
3071
|
+
function ii(e, t, s) {
|
|
3058
3072
|
return t <= 1 ? s : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3059
3073
|
}
|
|
3060
|
-
function
|
|
3061
|
-
return
|
|
3074
|
+
function en(e) {
|
|
3075
|
+
return D(e.image_url) ?? D(e.asset_url) ?? "";
|
|
3062
3076
|
}
|
|
3063
|
-
function
|
|
3077
|
+
function oi(e) {
|
|
3064
3078
|
switch (e) {
|
|
3065
3079
|
case "image":
|
|
3066
|
-
return
|
|
3080
|
+
return we.Image;
|
|
3067
3081
|
case "video":
|
|
3068
|
-
return
|
|
3082
|
+
return we.Video;
|
|
3069
3083
|
case "audio":
|
|
3070
|
-
return
|
|
3084
|
+
return we.Audio;
|
|
3071
3085
|
case "pdf":
|
|
3072
|
-
return
|
|
3086
|
+
return we.Pdf;
|
|
3073
3087
|
default:
|
|
3074
|
-
return
|
|
3088
|
+
return we.File;
|
|
3075
3089
|
}
|
|
3076
3090
|
}
|
|
3077
|
-
function
|
|
3091
|
+
function li(e, t) {
|
|
3078
3092
|
if (t.length > 1)
|
|
3079
3093
|
switch (e) {
|
|
3080
3094
|
case "image":
|
|
3081
3095
|
return {
|
|
3082
3096
|
items: t.map((a) => ({
|
|
3083
|
-
src:
|
|
3084
|
-
alt:
|
|
3097
|
+
src: en(a),
|
|
3098
|
+
alt: D(a.title)
|
|
3085
3099
|
}))
|
|
3086
3100
|
};
|
|
3087
3101
|
case "video":
|
|
3088
3102
|
return {
|
|
3089
3103
|
items: t.map((a) => ({
|
|
3090
|
-
src:
|
|
3091
|
-
poster:
|
|
3104
|
+
src: D(a.asset_url) ?? "",
|
|
3105
|
+
poster: D(
|
|
3092
3106
|
a.thumb_url
|
|
3093
3107
|
),
|
|
3094
|
-
mimeType:
|
|
3108
|
+
mimeType: D(a.mime_type)
|
|
3095
3109
|
}))
|
|
3096
3110
|
};
|
|
3097
3111
|
case "audio":
|
|
3098
3112
|
return {
|
|
3099
3113
|
items: t.map((a) => ({
|
|
3100
|
-
src:
|
|
3101
|
-
mimeType:
|
|
3102
|
-
filename:
|
|
3114
|
+
src: D(a.asset_url) ?? "",
|
|
3115
|
+
mimeType: D(a.mime_type) ?? "audio/mpeg",
|
|
3116
|
+
filename: D(
|
|
3103
3117
|
a.title
|
|
3104
3118
|
)
|
|
3105
3119
|
}))
|
|
@@ -3107,8 +3121,8 @@ function ri(e, t) {
|
|
|
3107
3121
|
case "pdf":
|
|
3108
3122
|
return {
|
|
3109
3123
|
items: t.map((a) => ({
|
|
3110
|
-
src:
|
|
3111
|
-
filename:
|
|
3124
|
+
src: D(a.asset_url) ?? "",
|
|
3125
|
+
filename: D(
|
|
3112
3126
|
a.title
|
|
3113
3127
|
),
|
|
3114
3128
|
fileSize: a.file_size
|
|
@@ -3117,12 +3131,12 @@ function ri(e, t) {
|
|
|
3117
3131
|
case "file":
|
|
3118
3132
|
return {
|
|
3119
3133
|
items: t.map((a) => ({
|
|
3120
|
-
src:
|
|
3121
|
-
filename:
|
|
3134
|
+
src: D(a.asset_url) ?? "",
|
|
3135
|
+
filename: D(
|
|
3122
3136
|
a.title
|
|
3123
3137
|
),
|
|
3124
3138
|
fileSize: a.file_size,
|
|
3125
|
-
mimeType:
|
|
3139
|
+
mimeType: D(a.mime_type) ?? "application/octet-stream"
|
|
3126
3140
|
}))
|
|
3127
3141
|
};
|
|
3128
3142
|
}
|
|
@@ -3131,99 +3145,99 @@ function ri(e, t) {
|
|
|
3131
3145
|
switch (e) {
|
|
3132
3146
|
case "image":
|
|
3133
3147
|
return {
|
|
3134
|
-
src:
|
|
3135
|
-
alt:
|
|
3148
|
+
src: en(s),
|
|
3149
|
+
alt: D(s.title)
|
|
3136
3150
|
};
|
|
3137
3151
|
case "video":
|
|
3138
3152
|
return {
|
|
3139
|
-
src:
|
|
3140
|
-
poster:
|
|
3141
|
-
mimeType:
|
|
3153
|
+
src: D(s.asset_url) ?? "",
|
|
3154
|
+
poster: D(s.thumb_url),
|
|
3155
|
+
mimeType: D(s.mime_type)
|
|
3142
3156
|
};
|
|
3143
3157
|
case "audio":
|
|
3144
3158
|
return {
|
|
3145
|
-
src:
|
|
3146
|
-
mimeType:
|
|
3147
|
-
filename:
|
|
3159
|
+
src: D(s.asset_url) ?? "",
|
|
3160
|
+
mimeType: D(s.mime_type) ?? "audio/mpeg",
|
|
3161
|
+
filename: D(s.title)
|
|
3148
3162
|
};
|
|
3149
3163
|
case "pdf":
|
|
3150
3164
|
return {
|
|
3151
|
-
src:
|
|
3152
|
-
filename:
|
|
3165
|
+
src: D(s.asset_url) ?? "",
|
|
3166
|
+
filename: D(s.title),
|
|
3153
3167
|
fileSize: s.file_size
|
|
3154
3168
|
};
|
|
3155
3169
|
case "file":
|
|
3156
3170
|
return {
|
|
3157
|
-
src:
|
|
3158
|
-
filename:
|
|
3171
|
+
src: D(s.asset_url) ?? "",
|
|
3172
|
+
filename: D(s.title),
|
|
3159
3173
|
fileSize: s.file_size,
|
|
3160
|
-
mimeType:
|
|
3174
|
+
mimeType: D(s.mime_type) ?? "application/octet-stream"
|
|
3161
3175
|
};
|
|
3162
3176
|
}
|
|
3163
3177
|
}
|
|
3164
|
-
function
|
|
3178
|
+
function ci({
|
|
3165
3179
|
groupPosition: e,
|
|
3166
3180
|
isMyMessage: t,
|
|
3167
3181
|
segment: s,
|
|
3168
3182
|
text: a
|
|
3169
3183
|
}) {
|
|
3170
|
-
const r =
|
|
3171
|
-
...
|
|
3184
|
+
const r = oi(s.kind), i = {
|
|
3185
|
+
...li(s.kind, s.attachments),
|
|
3172
3186
|
groupPosition: e,
|
|
3173
3187
|
...a ? { text: a } : {}
|
|
3174
3188
|
};
|
|
3175
3189
|
return t ? /* @__PURE__ */ n(r.Sent, { ...i }) : /* @__PURE__ */ n(r.Received, { ...i });
|
|
3176
3190
|
}
|
|
3177
|
-
const
|
|
3191
|
+
const di = ({
|
|
3178
3192
|
groupPosition: e,
|
|
3179
3193
|
isMyMessage: t,
|
|
3180
3194
|
message: s
|
|
3181
3195
|
}) => {
|
|
3182
3196
|
var w;
|
|
3183
|
-
const a =
|
|
3197
|
+
const a = On(s.attachments);
|
|
3184
3198
|
if (a.length === 0) return null;
|
|
3185
|
-
const r =
|
|
3199
|
+
const r = ai(a), i = ri(a), o = (w = s.text) == null ? void 0 : w.trim(), l = a.find((v) => v.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? Qt(l.attachments[0] ?? {}).url : void 0, u = o && ni(o, d) ? void 0 : o;
|
|
3186
3200
|
let g = 0, m = 0;
|
|
3187
|
-
const f = [],
|
|
3188
|
-
const
|
|
3201
|
+
const f = [], b = (v, p) => {
|
|
3202
|
+
const N = g === r - 1;
|
|
3189
3203
|
g += 1;
|
|
3190
|
-
const
|
|
3204
|
+
const _ = t ? Jt.Sent : Jt.Received;
|
|
3191
3205
|
f.push(
|
|
3192
|
-
/* @__PURE__ */ h(
|
|
3193
|
-
/* @__PURE__ */ n(
|
|
3194
|
-
|
|
3206
|
+
/* @__PURE__ */ h(B.Fragment, { children: [
|
|
3207
|
+
/* @__PURE__ */ n(_, { ...Qt(v) }),
|
|
3208
|
+
N && u ? /* @__PURE__ */ n("div", { className: t ? ei : ti, children: u }) : null
|
|
3195
3209
|
] }, p)
|
|
3196
3210
|
);
|
|
3197
|
-
},
|
|
3198
|
-
const
|
|
3211
|
+
}, c = (v, p) => {
|
|
3212
|
+
const N = g === r - 1, _ = ii(
|
|
3199
3213
|
m,
|
|
3200
3214
|
i,
|
|
3201
3215
|
e
|
|
3202
3216
|
);
|
|
3203
3217
|
g += 1, m += 1, f.push(
|
|
3204
3218
|
/* @__PURE__ */ n(
|
|
3205
|
-
|
|
3219
|
+
ci,
|
|
3206
3220
|
{
|
|
3207
|
-
groupPosition:
|
|
3221
|
+
groupPosition: _,
|
|
3208
3222
|
isMyMessage: t,
|
|
3209
|
-
segment:
|
|
3210
|
-
text:
|
|
3223
|
+
segment: v,
|
|
3224
|
+
text: N ? u : void 0
|
|
3211
3225
|
},
|
|
3212
3226
|
p
|
|
3213
3227
|
)
|
|
3214
3228
|
);
|
|
3215
3229
|
};
|
|
3216
|
-
return a.forEach((
|
|
3217
|
-
if (
|
|
3218
|
-
|
|
3219
|
-
|
|
3230
|
+
return a.forEach((v, p) => {
|
|
3231
|
+
if (v.type === "link") {
|
|
3232
|
+
v.attachments.forEach((N, _) => {
|
|
3233
|
+
b(N, `link-${p}-${_}`);
|
|
3220
3234
|
});
|
|
3221
3235
|
return;
|
|
3222
3236
|
}
|
|
3223
|
-
v
|
|
3237
|
+
c(v, `media-${p}`);
|
|
3224
3238
|
}), /* @__PURE__ */ n(te, { children: f });
|
|
3225
|
-
},
|
|
3226
|
-
var
|
|
3239
|
+
}, ui = (e) => {
|
|
3240
|
+
var kt, St, Et, It, Tt, At, Mt, Lt, Rt, Dt, Pt, zt, Ot, Ft;
|
|
3227
3241
|
const {
|
|
3228
3242
|
additionalMessageInputProps: t,
|
|
3229
3243
|
chatbotVotingEnabled: s,
|
|
@@ -3237,99 +3251,100 @@ const oi = ({
|
|
|
3237
3251
|
highlighted: g,
|
|
3238
3252
|
isMessageAIGenerated: m,
|
|
3239
3253
|
isMyMessage: f,
|
|
3254
|
+
lastOwnMessage: b,
|
|
3240
3255
|
message: c,
|
|
3241
|
-
renderText:
|
|
3242
|
-
threadList:
|
|
3243
|
-
viewerLanguage:
|
|
3244
|
-
} = e, { client:
|
|
3245
|
-
Attachment:
|
|
3246
|
-
EditMessageModal:
|
|
3247
|
-
MessageActions:
|
|
3248
|
-
MessageBlocked: F =
|
|
3249
|
-
MessageBouncePrompt:
|
|
3250
|
-
MessageDeleted:
|
|
3251
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
3252
|
-
MessageRepliesCountButton:
|
|
3253
|
-
ReminderNotification:
|
|
3254
|
-
StreamedMessageText:
|
|
3255
|
-
PinIndicator:
|
|
3256
|
-
} =
|
|
3256
|
+
renderText: w,
|
|
3257
|
+
threadList: v,
|
|
3258
|
+
viewerLanguage: p
|
|
3259
|
+
} = e, { client: N } = ve("CustomMessage"), { channel: _ } = be("CustomMessage"), { isUnlocking: M, onUnlockClick: L, onFetchSource: A, onDownloadClick: R } = Rr("LockedAttachment"), [P, j] = $(!1), z = Kn(c.id), { selected: k, voteUp: T, voteDown: S } = ua(c), {
|
|
3260
|
+
Attachment: y = Jn,
|
|
3261
|
+
EditMessageModal: I = Zn,
|
|
3262
|
+
MessageActions: O,
|
|
3263
|
+
MessageBlocked: F = Qn,
|
|
3264
|
+
MessageBouncePrompt: U = es,
|
|
3265
|
+
MessageDeleted: J = ts,
|
|
3266
|
+
MessageIsThreadReplyInChannelButtonIndicator: Z = ns,
|
|
3267
|
+
MessageRepliesCountButton: q = ss,
|
|
3268
|
+
ReminderNotification: x = as,
|
|
3269
|
+
StreamedMessageText: E = rs,
|
|
3270
|
+
PinIndicator: G
|
|
3271
|
+
} = sn("CustomMessage"), H = is(c), Q = os(c), W = ne(
|
|
3257
3272
|
() => m == null ? void 0 : m(c),
|
|
3258
3273
|
[m, c]
|
|
3259
|
-
),
|
|
3260
|
-
const
|
|
3261
|
-
if (!ze(c)) return
|
|
3262
|
-
const
|
|
3263
|
-
return
|
|
3264
|
-
}, [c]),
|
|
3265
|
-
() =>
|
|
3266
|
-
[
|
|
3267
|
-
),
|
|
3268
|
-
const
|
|
3269
|
-
return
|
|
3270
|
-
}, [c,
|
|
3271
|
-
(
|
|
3274
|
+
), V = ne(() => {
|
|
3275
|
+
const ue = c.attachments ?? [], fe = c.shared_location ? [c.shared_location, ...ue] : ue;
|
|
3276
|
+
if (!ze(c)) return fe;
|
|
3277
|
+
const $t = fe.filter((Bt) => !("type" in Bt) || !wn(Bt));
|
|
3278
|
+
return $t.length === fe.length ? fe : $t;
|
|
3279
|
+
}, [c]), ee = ne(
|
|
3280
|
+
() => On(V),
|
|
3281
|
+
[V]
|
|
3282
|
+
), le = ne(() => {
|
|
3283
|
+
const ue = hn({ message: c, viewerLanguage: p });
|
|
3284
|
+
return ue === c.text ? c : { ...c, text: ue };
|
|
3285
|
+
}, [c, p]), Le = ee.length > 0, Re = ee.reduce(
|
|
3286
|
+
(ue, fe) => ue + fe.attachments.length,
|
|
3272
3287
|
0
|
|
3273
|
-
) === ((
|
|
3288
|
+
) === ((V == null ? void 0 : V.length) ?? 0), re = ja(
|
|
3274
3289
|
{
|
|
3275
3290
|
endOfGroup: r,
|
|
3276
3291
|
firstOfGroup: i,
|
|
3277
3292
|
groupedByUser: o
|
|
3278
3293
|
}
|
|
3279
3294
|
);
|
|
3280
|
-
if (
|
|
3295
|
+
if (ls(c))
|
|
3281
3296
|
return null;
|
|
3282
3297
|
if (c.deleted_at || c.type === "deleted")
|
|
3283
|
-
return /* @__PURE__ */ n(
|
|
3284
|
-
if (
|
|
3298
|
+
return /* @__PURE__ */ n(J, { message: c });
|
|
3299
|
+
if (cs(c))
|
|
3285
3300
|
return /* @__PURE__ */ n(F, {});
|
|
3286
|
-
const
|
|
3287
|
-
let
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3301
|
+
const ce = !v && !!c.reply_count, ie = !v && c.show_in_channel && c.parent_id, wt = c.status === "failed" && ((kt = c.error) == null ? void 0 : kt.status) !== 403, _t = ds(c);
|
|
3302
|
+
let me;
|
|
3303
|
+
wt ? me = () => u(c) : _t && (me = () => j(!0));
|
|
3304
|
+
const de = f(), Un = C(
|
|
3290
3305
|
"str-chat__message str-chat__message-simple",
|
|
3291
3306
|
`str-chat__message--${c.type}`,
|
|
3292
3307
|
`str-chat__message--${c.status}`,
|
|
3293
|
-
|
|
3308
|
+
de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
3294
3309
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
3295
3310
|
{
|
|
3296
3311
|
"str-chat__message--has-attachment": H,
|
|
3297
3312
|
"str-chat__message--highlighted": g,
|
|
3298
3313
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3299
|
-
"str-chat__message--with-reactions":
|
|
3300
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3301
|
-
"str-chat__message-with-thread-link":
|
|
3314
|
+
"str-chat__message--with-reactions": Q,
|
|
3315
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((St = c == null ? void 0 : c.error) == null ? void 0 : St.status) !== 403,
|
|
3316
|
+
"str-chat__message-with-thread-link": ce || ie,
|
|
3302
3317
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3303
3318
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3304
3319
|
"str-chat__virtual-message__wrapper--group": o
|
|
3305
3320
|
}
|
|
3306
|
-
), Ue = c.poll_id &&
|
|
3321
|
+
), Ue = c.poll_id && N.polls.fromState(c.poll_id), Nt = Fr(c), he = ze(c), yt = Or(c), Ve = !!(V != null && V.length && !c.quoted_message), Ct = he && de && Ve, Vn = Le && Re && !c.quoted_message && !Ue && !W && !he;
|
|
3307
3322
|
return /* @__PURE__ */ h(te, { children: [
|
|
3308
3323
|
a && /* @__PURE__ */ n(
|
|
3309
|
-
|
|
3324
|
+
I,
|
|
3310
3325
|
{
|
|
3311
3326
|
additionalMessageInputProps: t
|
|
3312
3327
|
}
|
|
3313
3328
|
),
|
|
3314
|
-
|
|
3315
|
-
|
|
3329
|
+
P && /* @__PURE__ */ n(
|
|
3330
|
+
us,
|
|
3316
3331
|
{
|
|
3317
|
-
MessageBouncePrompt:
|
|
3318
|
-
onClose: () =>
|
|
3319
|
-
open:
|
|
3332
|
+
MessageBouncePrompt: U,
|
|
3333
|
+
onClose: () => j(!1),
|
|
3334
|
+
open: P
|
|
3320
3335
|
}
|
|
3321
3336
|
),
|
|
3322
3337
|
/* @__PURE__ */ h(
|
|
3323
3338
|
"div",
|
|
3324
3339
|
{
|
|
3325
|
-
className:
|
|
3340
|
+
className: Un,
|
|
3326
3341
|
"data-message-id": c.id,
|
|
3327
3342
|
"data-dd-privacy": "mask",
|
|
3328
3343
|
children: [
|
|
3329
|
-
|
|
3330
|
-
!!
|
|
3344
|
+
G && /* @__PURE__ */ n(G, {}),
|
|
3345
|
+
!!z && /* @__PURE__ */ n(x, { reminder: z }),
|
|
3331
3346
|
c.user && /* @__PURE__ */ n(
|
|
3332
|
-
|
|
3347
|
+
se,
|
|
3333
3348
|
{
|
|
3334
3349
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3335
3350
|
id: c.user.id,
|
|
@@ -3337,71 +3352,71 @@ const oi = ({
|
|
|
3337
3352
|
name: c.user.name || c.user.id,
|
|
3338
3353
|
size: 24,
|
|
3339
3354
|
shape: "circle",
|
|
3340
|
-
dmAgentEnabled:
|
|
3355
|
+
dmAgentEnabled: he
|
|
3341
3356
|
}
|
|
3342
3357
|
),
|
|
3343
3358
|
/* @__PURE__ */ n(
|
|
3344
3359
|
"div",
|
|
3345
3360
|
{
|
|
3346
3361
|
className: C("str-chat__message-inner", {
|
|
3347
|
-
"str-chat__simple-message--error-failed":
|
|
3362
|
+
"str-chat__simple-message--error-failed": wt || _t
|
|
3348
3363
|
}),
|
|
3349
3364
|
"data-testid": "message-inner",
|
|
3350
|
-
onClick:
|
|
3351
|
-
onKeyDown:
|
|
3352
|
-
role:
|
|
3353
|
-
tabIndex:
|
|
3365
|
+
onClick: me,
|
|
3366
|
+
onKeyDown: me,
|
|
3367
|
+
role: me ? "button" : void 0,
|
|
3368
|
+
tabIndex: me ? 0 : void 0,
|
|
3354
3369
|
style: {
|
|
3355
3370
|
// Force margins to 0 to prevent hover layout shift
|
|
3356
3371
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
3357
3372
|
marginInlineEnd: 0,
|
|
3358
3373
|
marginInlineStart: 0
|
|
3359
3374
|
},
|
|
3360
|
-
children:
|
|
3361
|
-
|
|
3362
|
-
|
|
3375
|
+
children: yt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3376
|
+
de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3377
|
+
O && /* @__PURE__ */ n(O, {}),
|
|
3363
3378
|
/* @__PURE__ */ n(
|
|
3364
|
-
|
|
3379
|
+
Xt.Sent,
|
|
3365
3380
|
{
|
|
3366
|
-
title: (
|
|
3367
|
-
mimeType: (
|
|
3368
|
-
thumbnailUrl: (
|
|
3369
|
-
amountText: (
|
|
3370
|
-
detail: (
|
|
3371
|
-
paymentStatus: (
|
|
3372
|
-
onPreviewClick: () =>
|
|
3373
|
-
onFetchSource: async () => await (
|
|
3381
|
+
title: (Et = c.metadata) == null ? void 0 : Et.attachment_title,
|
|
3382
|
+
mimeType: (It = c.metadata) == null ? void 0 : It.attachment_mime_type,
|
|
3383
|
+
thumbnailUrl: (Tt = c.metadata) == null ? void 0 : Tt.attachment_thumbnail,
|
|
3384
|
+
amountText: (At = c.metadata) == null ? void 0 : At.amount_text,
|
|
3385
|
+
detail: (Mt = c.metadata) == null ? void 0 : Mt.attachment_detail,
|
|
3386
|
+
paymentStatus: (Lt = c.metadata) == null ? void 0 : Lt.payment_status,
|
|
3387
|
+
onPreviewClick: () => L == null ? void 0 : L(c, _),
|
|
3388
|
+
onFetchSource: async () => await (A == null ? void 0 : A(c, _))
|
|
3374
3389
|
}
|
|
3375
3390
|
)
|
|
3376
3391
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3377
3392
|
/* @__PURE__ */ n(
|
|
3378
|
-
|
|
3393
|
+
Xt.Received,
|
|
3379
3394
|
{
|
|
3380
|
-
title: (
|
|
3381
|
-
mimeType: (
|
|
3382
|
-
thumbnailUrl: (
|
|
3383
|
-
amountText: (
|
|
3384
|
-
detail: (
|
|
3385
|
-
paymentStatus: (
|
|
3386
|
-
isUnlocking:
|
|
3387
|
-
onUnlockClick: () =>
|
|
3388
|
-
onFetchSource: async () => await (
|
|
3389
|
-
onDownloadClick: () =>
|
|
3395
|
+
title: (Rt = c.metadata) == null ? void 0 : Rt.attachment_title,
|
|
3396
|
+
mimeType: (Dt = c.metadata) == null ? void 0 : Dt.attachment_mime_type,
|
|
3397
|
+
thumbnailUrl: (Pt = c.metadata) == null ? void 0 : Pt.attachment_thumbnail,
|
|
3398
|
+
amountText: (zt = c.metadata) == null ? void 0 : zt.amount_text,
|
|
3399
|
+
detail: (Ot = c.metadata) == null ? void 0 : Ot.attachment_detail,
|
|
3400
|
+
paymentStatus: (Ft = c.metadata) == null ? void 0 : Ft.payment_status,
|
|
3401
|
+
isUnlocking: M(c.id),
|
|
3402
|
+
onUnlockClick: () => L == null ? void 0 : L(c, _),
|
|
3403
|
+
onFetchSource: async () => await (A == null ? void 0 : A(c, _)),
|
|
3404
|
+
onDownloadClick: () => R == null ? void 0 : R(c, _)
|
|
3390
3405
|
}
|
|
3391
3406
|
),
|
|
3392
|
-
|
|
3407
|
+
O && /* @__PURE__ */ n(O, {})
|
|
3393
3408
|
] }),
|
|
3394
3409
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
3395
|
-
|
|
3410
|
+
Ut,
|
|
3396
3411
|
{
|
|
3397
|
-
message:
|
|
3398
|
-
renderText:
|
|
3412
|
+
message: le,
|
|
3413
|
+
renderText: w
|
|
3399
3414
|
}
|
|
3400
3415
|
) })
|
|
3401
|
-
] }) :
|
|
3416
|
+
] }) : Nt ? (
|
|
3402
3417
|
/* Tip-only messages render as a standalone bubble */
|
|
3403
3418
|
/* @__PURE__ */ n(qe, { message: c, standalone: !0 })
|
|
3404
|
-
) :
|
|
3419
|
+
) : Vn ? /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h(
|
|
3405
3420
|
"div",
|
|
3406
3421
|
{
|
|
3407
3422
|
className: "str-chat__message-bubble",
|
|
@@ -3413,128 +3428,139 @@ const oi = ({
|
|
|
3413
3428
|
},
|
|
3414
3429
|
children: [
|
|
3415
3430
|
/* @__PURE__ */ n(
|
|
3416
|
-
|
|
3431
|
+
di,
|
|
3417
3432
|
{
|
|
3418
|
-
groupPosition:
|
|
3419
|
-
isMyMessage:
|
|
3433
|
+
groupPosition: re,
|
|
3434
|
+
isMyMessage: de,
|
|
3420
3435
|
message: {
|
|
3421
|
-
attachments:
|
|
3422
|
-
text:
|
|
3436
|
+
attachments: V,
|
|
3437
|
+
text: le.text
|
|
3423
3438
|
}
|
|
3424
3439
|
}
|
|
3425
3440
|
),
|
|
3426
|
-
/* @__PURE__ */ n(
|
|
3441
|
+
/* @__PURE__ */ n(Vt, {})
|
|
3427
3442
|
]
|
|
3428
3443
|
}
|
|
3429
3444
|
) }) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
3430
|
-
|
|
3445
|
+
he && !Ct && /* @__PURE__ */ n(
|
|
3431
3446
|
qe,
|
|
3432
3447
|
{
|
|
3433
3448
|
message: c,
|
|
3434
3449
|
hasAttachment: Ve,
|
|
3435
|
-
isMyMessage:
|
|
3450
|
+
isMyMessage: de
|
|
3436
3451
|
}
|
|
3437
3452
|
),
|
|
3438
|
-
Ue && /* @__PURE__ */ n(
|
|
3439
|
-
|
|
3440
|
-
|
|
3453
|
+
Ue && /* @__PURE__ */ n(ms, { poll: Ue }),
|
|
3454
|
+
V != null && V.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
3455
|
+
y,
|
|
3441
3456
|
{
|
|
3442
3457
|
actionHandler: l,
|
|
3443
|
-
attachments:
|
|
3458
|
+
attachments: V
|
|
3444
3459
|
}
|
|
3445
3460
|
) : null,
|
|
3446
|
-
|
|
3447
|
-
|
|
3461
|
+
W ? /* @__PURE__ */ n(
|
|
3462
|
+
E,
|
|
3448
3463
|
{
|
|
3449
|
-
message:
|
|
3450
|
-
renderText:
|
|
3464
|
+
message: le,
|
|
3465
|
+
renderText: w
|
|
3451
3466
|
}
|
|
3452
3467
|
) : /* @__PURE__ */ n(
|
|
3453
|
-
|
|
3468
|
+
Ut,
|
|
3454
3469
|
{
|
|
3455
|
-
message:
|
|
3456
|
-
renderText:
|
|
3470
|
+
message: le,
|
|
3471
|
+
renderText: w
|
|
3457
3472
|
}
|
|
3458
3473
|
),
|
|
3459
|
-
/* @__PURE__ */ n(
|
|
3474
|
+
/* @__PURE__ */ n(Vt, {})
|
|
3460
3475
|
] }) })
|
|
3461
3476
|
}
|
|
3462
3477
|
),
|
|
3463
|
-
!
|
|
3464
|
-
(!
|
|
3478
|
+
!yt && !Nt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
3479
|
+
(!he || Ct) && /* @__PURE__ */ n(
|
|
3465
3480
|
qe,
|
|
3466
3481
|
{
|
|
3467
3482
|
message: c,
|
|
3468
3483
|
hasAttachment: Ve,
|
|
3469
|
-
isMyMessage:
|
|
3484
|
+
isMyMessage: de
|
|
3470
3485
|
}
|
|
3471
3486
|
),
|
|
3472
|
-
s &&
|
|
3473
|
-
|
|
3487
|
+
s && he && /* @__PURE__ */ n(
|
|
3488
|
+
$r,
|
|
3474
3489
|
{
|
|
3475
|
-
selected:
|
|
3476
|
-
onVoteUp:
|
|
3477
|
-
onVoteDown:
|
|
3490
|
+
selected: k,
|
|
3491
|
+
onVoteUp: T,
|
|
3492
|
+
onVoteDown: S
|
|
3478
3493
|
}
|
|
3479
3494
|
)
|
|
3480
3495
|
] }),
|
|
3481
|
-
|
|
3482
|
-
|
|
3496
|
+
/* @__PURE__ */ n(
|
|
3497
|
+
Br,
|
|
3498
|
+
{
|
|
3499
|
+
message: c,
|
|
3500
|
+
isMyMessage: de,
|
|
3501
|
+
lastOwnMessageId: b == null ? void 0 : b.id
|
|
3502
|
+
}
|
|
3503
|
+
),
|
|
3504
|
+
ce && /* @__PURE__ */ n(
|
|
3505
|
+
q,
|
|
3483
3506
|
{
|
|
3484
3507
|
onClick: d,
|
|
3485
3508
|
reply_count: c.reply_count
|
|
3486
3509
|
}
|
|
3487
3510
|
),
|
|
3488
|
-
|
|
3511
|
+
ie && /* @__PURE__ */ n(Z, {})
|
|
3489
3512
|
]
|
|
3490
3513
|
},
|
|
3491
3514
|
c.id
|
|
3492
3515
|
)
|
|
3493
3516
|
] });
|
|
3494
|
-
},
|
|
3495
|
-
|
|
3496
|
-
(e, t) =>
|
|
3497
|
-
|
|
3517
|
+
}, mi = B.memo(
|
|
3518
|
+
ui,
|
|
3519
|
+
(e, t) => {
|
|
3520
|
+
var s, a;
|
|
3521
|
+
return e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage || ((s = e.lastOwnMessage) == null ? void 0 : s.id) !== ((a = t.lastOwnMessage) == null ? void 0 : a.id) ? !1 : Xn(e, t);
|
|
3522
|
+
}
|
|
3523
|
+
), hi = (e) => {
|
|
3498
3524
|
const t = Ee("CustomMessage");
|
|
3499
|
-
return /* @__PURE__ */ n(
|
|
3500
|
-
},
|
|
3525
|
+
return /* @__PURE__ */ n(mi, { ...t, ...e });
|
|
3526
|
+
}, fi = () => {
|
|
3501
3527
|
var s;
|
|
3502
3528
|
const { handleDelete: e, message: t } = Ee("CustomMessageActions");
|
|
3503
3529
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
3504
|
-
|
|
3530
|
+
ln,
|
|
3505
3531
|
{
|
|
3506
3532
|
onClick: e,
|
|
3507
3533
|
"aria-label": "Delete",
|
|
3508
3534
|
title: "Delete",
|
|
3509
3535
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3510
|
-
children: /* @__PURE__ */ n(
|
|
3536
|
+
children: /* @__PURE__ */ n(Xs, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3511
3537
|
}
|
|
3512
3538
|
);
|
|
3513
|
-
},
|
|
3539
|
+
}, gi = () => {
|
|
3514
3540
|
const { handleFlag: e } = Ee("CustomMessageActions");
|
|
3515
3541
|
return /* @__PURE__ */ n(
|
|
3516
|
-
|
|
3542
|
+
ln,
|
|
3517
3543
|
{
|
|
3518
3544
|
onClick: e,
|
|
3519
3545
|
"aria-label": "Report",
|
|
3520
3546
|
title: "Report",
|
|
3521
3547
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3522
|
-
children: /* @__PURE__ */ n(
|
|
3548
|
+
children: /* @__PURE__ */ n(an, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3523
3549
|
}
|
|
3524
3550
|
);
|
|
3525
|
-
},
|
|
3551
|
+
}, pi = () => {
|
|
3526
3552
|
var t;
|
|
3527
3553
|
const { message: e } = Ee("CustomMessageActions");
|
|
3528
3554
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
3529
|
-
|
|
3555
|
+
Zs,
|
|
3530
3556
|
{
|
|
3531
3557
|
messageActionSet: [
|
|
3532
|
-
{ Component:
|
|
3533
|
-
{ Component:
|
|
3558
|
+
{ Component: fi, placement: "quick", type: "delete" },
|
|
3559
|
+
{ Component: gi, placement: "quick", type: "flag" }
|
|
3534
3560
|
]
|
|
3535
3561
|
}
|
|
3536
3562
|
);
|
|
3537
|
-
},
|
|
3563
|
+
}, bi = ({
|
|
3538
3564
|
link: e,
|
|
3539
3565
|
onDismiss: t
|
|
3540
3566
|
}) => {
|
|
@@ -3574,14 +3600,14 @@ const oi = ({
|
|
|
3574
3600
|
]
|
|
3575
3601
|
}
|
|
3576
3602
|
);
|
|
3577
|
-
},
|
|
3603
|
+
}, vi = (e) => ({
|
|
3578
3604
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3579
|
-
(t) =>
|
|
3605
|
+
(t) => jt.previewIsLoaded(t) || jt.previewIsLoading(t)
|
|
3580
3606
|
)
|
|
3581
|
-
}),
|
|
3582
|
-
const { linkPreviewsManager: e } =
|
|
3607
|
+
}), xi = () => {
|
|
3608
|
+
const { linkPreviewsManager: e } = hs(), { linkPreviews: t } = fs(
|
|
3583
3609
|
e.state,
|
|
3584
|
-
|
|
3610
|
+
vi
|
|
3585
3611
|
), s = (r) => {
|
|
3586
3612
|
e.dismissPreview(r);
|
|
3587
3613
|
};
|
|
@@ -3594,9 +3620,9 @@ const oi = ({
|
|
|
3594
3620
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3595
3621
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3596
3622
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3597
|
-
/* @__PURE__ */ n("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ n("div", { className: "w-full shrink-0", children: /* @__PURE__ */ n(
|
|
3623
|
+
/* @__PURE__ */ n("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ n("div", { className: "w-full shrink-0", children: /* @__PURE__ */ n(bi, { link: r, onDismiss: s }) }, r.og_scrape_url)) })
|
|
3598
3624
|
) : null;
|
|
3599
|
-
},
|
|
3625
|
+
}, xt = B.createContext(!1), ao = () => Se(xt), wi = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
3600
3626
|
"button",
|
|
3601
3627
|
{
|
|
3602
3628
|
...s,
|
|
@@ -3604,13 +3630,13 @@ const oi = ({
|
|
|
3604
3630
|
"aria-label": "Send",
|
|
3605
3631
|
disabled: t,
|
|
3606
3632
|
onClick: e,
|
|
3607
|
-
children: /* @__PURE__ */ n(
|
|
3633
|
+
children: /* @__PURE__ */ n(Ks, { weight: "bold", className: "size-4" })
|
|
3608
3634
|
}
|
|
3609
|
-
),
|
|
3610
|
-
const e =
|
|
3611
|
-
SendButton: r =
|
|
3612
|
-
AttachmentPreviewList: i =
|
|
3613
|
-
} =
|
|
3635
|
+
), _i = () => {
|
|
3636
|
+
const e = Se(xt), { handleSubmit: t } = ps(), s = bs(), a = e || !s, {
|
|
3637
|
+
SendButton: r = wi,
|
|
3638
|
+
AttachmentPreviewList: i = vs
|
|
3639
|
+
} = sn("CustomMessageInput");
|
|
3614
3640
|
return (
|
|
3615
3641
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3616
3642
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3626,12 +3652,12 @@ const oi = ({
|
|
|
3626
3652
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
3627
3653
|
"data-dd-privacy": "mask",
|
|
3628
3654
|
children: [
|
|
3629
|
-
/* @__PURE__ */ n(
|
|
3630
|
-
/* @__PURE__ */ n(
|
|
3655
|
+
/* @__PURE__ */ n(xs, {}),
|
|
3656
|
+
/* @__PURE__ */ n(xi, {}),
|
|
3631
3657
|
/* @__PURE__ */ n(i, {}),
|
|
3632
3658
|
/* @__PURE__ */ h("div", { className: "flex shrink-0", children: [
|
|
3633
3659
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
3634
|
-
|
|
3660
|
+
ws,
|
|
3635
3661
|
{
|
|
3636
3662
|
"aria-disabled": e || void 0,
|
|
3637
3663
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3657,7 +3683,7 @@ const oi = ({
|
|
|
3657
3683
|
}
|
|
3658
3684
|
)
|
|
3659
3685
|
);
|
|
3660
|
-
},
|
|
3686
|
+
}, Ni = ({
|
|
3661
3687
|
renderActions: e,
|
|
3662
3688
|
renderFooter: t,
|
|
3663
3689
|
disabled: s = !1,
|
|
@@ -3665,7 +3691,7 @@ const oi = ({
|
|
|
3665
3691
|
composerInput: r
|
|
3666
3692
|
}) => {
|
|
3667
3693
|
var l;
|
|
3668
|
-
const { channel: i } =
|
|
3694
|
+
const { channel: i } = be(), o = ((l = i == null ? void 0 : i.data) == null ? void 0 : l.frozen) === !0;
|
|
3669
3695
|
return s ? /* @__PURE__ */ h(te, { children: [
|
|
3670
3696
|
/* @__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 }),
|
|
3671
3697
|
t == null ? void 0 : t()
|
|
@@ -3678,42 +3704,42 @@ const oi = ({
|
|
|
3678
3704
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3679
3705
|
children: [
|
|
3680
3706
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3681
|
-
/* @__PURE__ */ n(
|
|
3707
|
+
/* @__PURE__ */ n(xt.Provider, { value: o, children: /* @__PURE__ */ n(gs, { Input: r ?? _i }) })
|
|
3682
3708
|
]
|
|
3683
3709
|
}
|
|
3684
3710
|
),
|
|
3685
3711
|
t == null ? void 0 : t()
|
|
3686
3712
|
] });
|
|
3687
|
-
},
|
|
3713
|
+
}, yi = [
|
|
3688
3714
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3689
3715
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3690
|
-
],
|
|
3716
|
+
], Ci = {
|
|
3691
3717
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3692
3718
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3693
|
-
},
|
|
3719
|
+
}, ki = [
|
|
3694
3720
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3695
|
-
],
|
|
3721
|
+
], Si = {
|
|
3696
3722
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3697
|
-
}, We = "age safety guidelines.",
|
|
3723
|
+
}, We = "age safety guidelines.", Ei = "https://linktr.ee/s/about/contact", tn = (e) => yi.includes(e), Ii = (e) => ki.includes(e), Ti = (e) => {
|
|
3698
3724
|
var a;
|
|
3699
3725
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3700
|
-
if (
|
|
3726
|
+
if (tn(t))
|
|
3701
3727
|
return {
|
|
3702
3728
|
kind: "dm-agent",
|
|
3703
3729
|
type: t
|
|
3704
3730
|
};
|
|
3705
|
-
if (
|
|
3731
|
+
if (Ii(t))
|
|
3706
3732
|
return {
|
|
3707
3733
|
kind: "age-safety",
|
|
3708
3734
|
type: t
|
|
3709
3735
|
};
|
|
3710
3736
|
const s = e.dm_agent_system_type;
|
|
3711
|
-
if (
|
|
3737
|
+
if (tn(s))
|
|
3712
3738
|
return {
|
|
3713
3739
|
kind: "dm-agent",
|
|
3714
3740
|
type: s
|
|
3715
3741
|
};
|
|
3716
|
-
},
|
|
3742
|
+
}, Ai = (e) => {
|
|
3717
3743
|
const t = e.indexOf(We);
|
|
3718
3744
|
if (t === -1)
|
|
3719
3745
|
return e;
|
|
@@ -3723,7 +3749,7 @@ const oi = ({
|
|
|
3723
3749
|
/* @__PURE__ */ n(
|
|
3724
3750
|
"a",
|
|
3725
3751
|
{
|
|
3726
|
-
href:
|
|
3752
|
+
href: Ei,
|
|
3727
3753
|
target: "_blank",
|
|
3728
3754
|
rel: "noopener noreferrer",
|
|
3729
3755
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -3732,13 +3758,13 @@ const oi = ({
|
|
|
3732
3758
|
),
|
|
3733
3759
|
e.slice(s)
|
|
3734
3760
|
] });
|
|
3735
|
-
},
|
|
3761
|
+
}, Mi = (e) => {
|
|
3736
3762
|
var a, r;
|
|
3737
|
-
const t = e.message.hide_date === !0, s =
|
|
3763
|
+
const t = e.message.hide_date === !0, s = Ti(
|
|
3738
3764
|
e.message
|
|
3739
3765
|
);
|
|
3740
3766
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
3741
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3767
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ci[s.type];
|
|
3742
3768
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3743
3769
|
/* @__PURE__ */ h(
|
|
3744
3770
|
"div",
|
|
@@ -3748,7 +3774,7 @@ const oi = ({
|
|
|
3748
3774
|
"data-dm-agent-system-type": s.type,
|
|
3749
3775
|
children: [
|
|
3750
3776
|
/* @__PURE__ */ n(
|
|
3751
|
-
|
|
3777
|
+
Ne,
|
|
3752
3778
|
{
|
|
3753
3779
|
size: 16,
|
|
3754
3780
|
weight: "regular",
|
|
@@ -3764,7 +3790,7 @@ const oi = ({
|
|
|
3764
3790
|
] });
|
|
3765
3791
|
}
|
|
3766
3792
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
3767
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
3793
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Si[s.type];
|
|
3768
3794
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3769
3795
|
/* @__PURE__ */ h(
|
|
3770
3796
|
"div",
|
|
@@ -3774,7 +3800,7 @@ const oi = ({
|
|
|
3774
3800
|
"data-age-safety-system-type": s.type,
|
|
3775
3801
|
children: [
|
|
3776
3802
|
/* @__PURE__ */ n(
|
|
3777
|
-
|
|
3803
|
+
Js,
|
|
3778
3804
|
{
|
|
3779
3805
|
size: 24,
|
|
3780
3806
|
weight: "duotone",
|
|
@@ -3783,7 +3809,7 @@ const oi = ({
|
|
|
3783
3809
|
"data-testid": "age-safety-system-message-icon"
|
|
3784
3810
|
}
|
|
3785
3811
|
),
|
|
3786
|
-
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
3812
|
+
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ai(i) }) })
|
|
3787
3813
|
]
|
|
3788
3814
|
}
|
|
3789
3815
|
),
|
|
@@ -3798,7 +3824,7 @@ const oi = ({
|
|
|
3798
3824
|
] }),
|
|
3799
3825
|
!t && /* @__PURE__ */ n(Ge, { message: e.message })
|
|
3800
3826
|
] });
|
|
3801
|
-
},
|
|
3827
|
+
}, Fn = et(!1), Xe = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
3802
3828
|
"animateTransform",
|
|
3803
3829
|
{
|
|
3804
3830
|
attributeName: "transform",
|
|
@@ -3808,21 +3834,21 @@ const oi = ({
|
|
|
3808
3834
|
begin: `${120 * t}ms`,
|
|
3809
3835
|
repeatCount: "indefinite"
|
|
3810
3836
|
}
|
|
3811
|
-
) }),
|
|
3837
|
+
) }), Li = /* @__PURE__ */ new Set([
|
|
3812
3838
|
He.Thinking,
|
|
3813
3839
|
He.Generating,
|
|
3814
3840
|
He.ExternalSources
|
|
3815
|
-
]),
|
|
3816
|
-
var
|
|
3817
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
3818
|
-
if (!e && l &&
|
|
3819
|
-
const
|
|
3841
|
+
]), Ri = ({ threadList: e }) => {
|
|
3842
|
+
var c, w;
|
|
3843
|
+
const { channel: t, channelConfig: s, thread: a } = be(), { client: r } = ve(), { typing: i = {} } = _s(), { aiState: o } = Ns(t), l = Se(Fn);
|
|
3844
|
+
if (!e && l && Li.has(o)) {
|
|
3845
|
+
const v = Di(t, (c = r.user) == null ? void 0 : c.id);
|
|
3820
3846
|
return /* @__PURE__ */ n(
|
|
3821
|
-
|
|
3847
|
+
nn,
|
|
3822
3848
|
{
|
|
3823
|
-
avatarId: (
|
|
3824
|
-
avatarName: (
|
|
3825
|
-
avatarImage:
|
|
3849
|
+
avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
|
|
3850
|
+
avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
|
|
3851
|
+
avatarImage: v == null ? void 0 : v.image,
|
|
3826
3852
|
testId: "typing-indicator-ai"
|
|
3827
3853
|
}
|
|
3828
3854
|
);
|
|
@@ -3830,29 +3856,29 @@ const oi = ({
|
|
|
3830
3856
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
3831
3857
|
return null;
|
|
3832
3858
|
const u = e ? [] : Object.values(i).filter(
|
|
3833
|
-
({ parent_id:
|
|
3834
|
-
var
|
|
3835
|
-
return (p == null ? void 0 : p.id) !== ((
|
|
3859
|
+
({ parent_id: v, user: p }) => {
|
|
3860
|
+
var N;
|
|
3861
|
+
return (p == null ? void 0 : p.id) !== ((N = r.user) == null ? void 0 : N.id) && !v;
|
|
3836
3862
|
}
|
|
3837
3863
|
), g = e ? Object.values(i).filter(
|
|
3838
|
-
({ parent_id:
|
|
3839
|
-
var
|
|
3840
|
-
return (p == null ? void 0 : p.id) !== ((
|
|
3864
|
+
({ parent_id: v, user: p }) => {
|
|
3865
|
+
var N;
|
|
3866
|
+
return (p == null ? void 0 : p.id) !== ((N = r.user) == null ? void 0 : N.id) && v === (a == null ? void 0 : a.id);
|
|
3841
3867
|
}
|
|
3842
3868
|
) : [], m = e ? g : u;
|
|
3843
3869
|
if (!m.length)
|
|
3844
3870
|
return null;
|
|
3845
|
-
const f = (w = m[0]) == null ? void 0 : w.user,
|
|
3871
|
+
const f = (w = m[0]) == null ? void 0 : w.user, b = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3846
3872
|
return /* @__PURE__ */ n(
|
|
3847
|
-
|
|
3873
|
+
nn,
|
|
3848
3874
|
{
|
|
3849
|
-
avatarId: (f == null ? void 0 : f.id) ?? (
|
|
3850
|
-
avatarName: (f == null ? void 0 : f.name) ?? (
|
|
3851
|
-
avatarImage: (f == null ? void 0 : f.image) ?? (
|
|
3875
|
+
avatarId: (f == null ? void 0 : f.id) ?? (b == null ? void 0 : b.id) ?? "typing-user",
|
|
3876
|
+
avatarName: (f == null ? void 0 : f.name) ?? (b == null ? void 0 : b.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
3877
|
+
avatarImage: (f == null ? void 0 : f.image) ?? (b == null ? void 0 : b.image),
|
|
3852
3878
|
testId: "typing-indicator"
|
|
3853
3879
|
}
|
|
3854
3880
|
);
|
|
3855
|
-
},
|
|
3881
|
+
}, nn = ({
|
|
3856
3882
|
avatarId: e,
|
|
3857
3883
|
avatarName: t,
|
|
3858
3884
|
avatarImage: s,
|
|
@@ -3867,7 +3893,7 @@ const oi = ({
|
|
|
3867
3893
|
},
|
|
3868
3894
|
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: [
|
|
3869
3895
|
/* @__PURE__ */ n(
|
|
3870
|
-
|
|
3896
|
+
se,
|
|
3871
3897
|
{
|
|
3872
3898
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3873
3899
|
id: e,
|
|
@@ -3896,7 +3922,7 @@ const oi = ({
|
|
|
3896
3922
|
] })
|
|
3897
3923
|
}
|
|
3898
3924
|
);
|
|
3899
|
-
function
|
|
3925
|
+
function Di(e, t) {
|
|
3900
3926
|
var a;
|
|
3901
3927
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
3902
3928
|
for (const r of Object.values(s)) {
|
|
@@ -3905,7 +3931,7 @@ function Mi(e, t) {
|
|
|
3905
3931
|
return i;
|
|
3906
3932
|
}
|
|
3907
3933
|
}
|
|
3908
|
-
const
|
|
3934
|
+
const Pi = () => null, zi = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
3909
3935
|
"div",
|
|
3910
3936
|
{
|
|
3911
3937
|
className: C("flex items-center justify-center h-full", e),
|
|
@@ -3948,12 +3974,12 @@ const Ri = () => null, Li = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
3948
3974
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
3949
3975
|
]
|
|
3950
3976
|
}
|
|
3951
|
-
), $e =
|
|
3952
|
-
/* @__PURE__ */ n(
|
|
3977
|
+
), $e = B.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
3978
|
+
/* @__PURE__ */ n(zi, { className: "w-6 h-6" }),
|
|
3953
3979
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
3954
3980
|
] }) }));
|
|
3955
3981
|
$e.displayName = "LoadingState";
|
|
3956
|
-
const
|
|
3982
|
+
const ge = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant", Oi = ({
|
|
3957
3983
|
onBack: e,
|
|
3958
3984
|
showBackButton: t,
|
|
3959
3985
|
showStarButton: s = !1,
|
|
@@ -3967,35 +3993,35 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
3967
3993
|
onBlockParticipantClick: g,
|
|
3968
3994
|
onReportParticipantClick: m,
|
|
3969
3995
|
customChannelActions: f,
|
|
3970
|
-
renderChannelActions:
|
|
3971
|
-
showChannelInfo:
|
|
3996
|
+
renderChannelActions: b,
|
|
3997
|
+
showChannelInfo: c = !0,
|
|
3972
3998
|
onParticipantNameClick: w,
|
|
3973
|
-
renderHeaderTitleBadges:
|
|
3999
|
+
renderHeaderTitleBadges: v
|
|
3974
4000
|
}) => {
|
|
3975
|
-
var
|
|
3976
|
-
const { channel: p } =
|
|
4001
|
+
var T, S, y, I, O, F;
|
|
4002
|
+
const { channel: p } = be(), { client: N } = ve(), _ = B.useMemo(
|
|
3977
4003
|
() => {
|
|
3978
|
-
var
|
|
4004
|
+
var U;
|
|
3979
4005
|
return st(
|
|
3980
|
-
(
|
|
3981
|
-
|
|
4006
|
+
(U = p.state) == null ? void 0 : U.members,
|
|
4007
|
+
N == null ? void 0 : N.userID,
|
|
3982
4008
|
p.type
|
|
3983
4009
|
);
|
|
3984
4010
|
},
|
|
3985
|
-
[(
|
|
3986
|
-
),
|
|
4011
|
+
[(T = p.state) == null ? void 0 : T.members, N == null ? void 0 : N.userID, p.type]
|
|
4012
|
+
), M = un(_ == null ? void 0 : _.user), L = (S = _ == null ? void 0 : _.user) == null ? void 0 : S.image, A = dn(p), R = v == null ? void 0 : v({
|
|
3987
4013
|
channel: p,
|
|
3988
|
-
participant:
|
|
3989
|
-
}), P = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90",
|
|
3990
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
3991
|
-
|
|
4014
|
+
participant: _
|
|
4015
|
+
}), P = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", j = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ h(te, { children: [
|
|
4016
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: M }),
|
|
4017
|
+
R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R })
|
|
3992
4018
|
] }), k = async () => {
|
|
3993
4019
|
try {
|
|
3994
|
-
|
|
3995
|
-
} catch (
|
|
4020
|
+
A ? await p.unpin() : await p.pin();
|
|
4021
|
+
} catch (U) {
|
|
3996
4022
|
console.error(
|
|
3997
4023
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
3998
|
-
|
|
4024
|
+
U
|
|
3999
4025
|
);
|
|
4000
4026
|
}
|
|
4001
4027
|
};
|
|
@@ -4005,14 +4031,14 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4005
4031
|
"button",
|
|
4006
4032
|
{
|
|
4007
4033
|
className: C(
|
|
4008
|
-
|
|
4034
|
+
ge,
|
|
4009
4035
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
4010
4036
|
),
|
|
4011
4037
|
onClick: e || (() => {
|
|
4012
4038
|
}),
|
|
4013
4039
|
type: "button",
|
|
4014
4040
|
"aria-label": "Back to conversations",
|
|
4015
|
-
children: /* @__PURE__ */ n(
|
|
4041
|
+
children: /* @__PURE__ */ n(Ht, { className: "size-5 text-black/90" })
|
|
4016
4042
|
}
|
|
4017
4043
|
) }),
|
|
4018
4044
|
/* @__PURE__ */ n(
|
|
@@ -4025,41 +4051,41 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4025
4051
|
{
|
|
4026
4052
|
type: "button",
|
|
4027
4053
|
onClick: w,
|
|
4028
|
-
"aria-label": `View details for ${
|
|
4054
|
+
"aria-label": `View details for ${M}`,
|
|
4029
4055
|
className: C(
|
|
4030
4056
|
P,
|
|
4031
4057
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4032
4058
|
),
|
|
4033
4059
|
children: [
|
|
4034
4060
|
/* @__PURE__ */ n(
|
|
4035
|
-
|
|
4061
|
+
se,
|
|
4036
4062
|
{
|
|
4037
|
-
id: ((y =
|
|
4038
|
-
name:
|
|
4039
|
-
image:
|
|
4040
|
-
starred: s &&
|
|
4063
|
+
id: ((y = _ == null ? void 0 : _.user) == null ? void 0 : y.id) || p.id || "unknown",
|
|
4064
|
+
name: M,
|
|
4065
|
+
image: L,
|
|
4066
|
+
starred: s && A,
|
|
4041
4067
|
dmAgentEnabled: a,
|
|
4042
4068
|
size: 48
|
|
4043
4069
|
}
|
|
4044
4070
|
),
|
|
4045
4071
|
/* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
4046
4072
|
z,
|
|
4047
|
-
/* @__PURE__ */ n(
|
|
4073
|
+
/* @__PURE__ */ n(_e, { className: "size-3 shrink-0", weight: "bold" })
|
|
4048
4074
|
] }),
|
|
4049
4075
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4050
|
-
/* @__PURE__ */ n(
|
|
4076
|
+
/* @__PURE__ */ n(Ne, { className: "size-3 shrink-0 text-black/55" }),
|
|
4051
4077
|
/* @__PURE__ */ n("span", { children: Pe })
|
|
4052
4078
|
] })
|
|
4053
4079
|
]
|
|
4054
4080
|
}
|
|
4055
4081
|
) : /* @__PURE__ */ h("div", { className: P, children: [
|
|
4056
4082
|
/* @__PURE__ */ n(
|
|
4057
|
-
|
|
4083
|
+
se,
|
|
4058
4084
|
{
|
|
4059
|
-
id: ((
|
|
4060
|
-
name:
|
|
4061
|
-
image:
|
|
4062
|
-
starred: s &&
|
|
4085
|
+
id: ((I = _ == null ? void 0 : _.user) == null ? void 0 : I.id) || p.id || "unknown",
|
|
4086
|
+
name: M,
|
|
4087
|
+
image: L,
|
|
4088
|
+
starred: s && A,
|
|
4063
4089
|
dmAgentEnabled: a,
|
|
4064
4090
|
size: 48
|
|
4065
4091
|
}
|
|
@@ -4067,7 +4093,7 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4067
4093
|
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
4068
4094
|
z,
|
|
4069
4095
|
/* @__PURE__ */ n(
|
|
4070
|
-
|
|
4096
|
+
_e,
|
|
4071
4097
|
{
|
|
4072
4098
|
className: "invisible size-3 shrink-0",
|
|
4073
4099
|
weight: "bold"
|
|
@@ -4075,7 +4101,7 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4075
4101
|
)
|
|
4076
4102
|
] }),
|
|
4077
4103
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4078
|
-
/* @__PURE__ */ n(
|
|
4104
|
+
/* @__PURE__ */ n(Ne, { className: "size-3 shrink-0 text-black/55" }),
|
|
4079
4105
|
/* @__PURE__ */ n("span", { children: Pe })
|
|
4080
4106
|
] })
|
|
4081
4107
|
] })
|
|
@@ -4085,27 +4111,27 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4085
4111
|
s && /* @__PURE__ */ n(
|
|
4086
4112
|
"button",
|
|
4087
4113
|
{
|
|
4088
|
-
className:
|
|
4114
|
+
className: ge,
|
|
4089
4115
|
onClick: k,
|
|
4090
4116
|
type: "button",
|
|
4091
|
-
"aria-label":
|
|
4117
|
+
"aria-label": A ? "Unstar conversation" : "Star conversation",
|
|
4092
4118
|
children: /* @__PURE__ */ n(
|
|
4093
4119
|
Ke,
|
|
4094
4120
|
{
|
|
4095
4121
|
className: C("size-5", {
|
|
4096
|
-
"text-yellow-600":
|
|
4097
|
-
"text-black/90": !
|
|
4122
|
+
"text-yellow-600": A,
|
|
4123
|
+
"text-black/90": !A
|
|
4098
4124
|
}),
|
|
4099
|
-
weight:
|
|
4125
|
+
weight: A ? "duotone" : "regular"
|
|
4100
4126
|
}
|
|
4101
4127
|
)
|
|
4102
4128
|
}
|
|
4103
4129
|
),
|
|
4104
|
-
|
|
4105
|
-
|
|
4130
|
+
c && (b !== void 0 ? b : /* @__PURE__ */ n(
|
|
4131
|
+
Wt,
|
|
4106
4132
|
{
|
|
4107
4133
|
channel: p,
|
|
4108
|
-
participant:
|
|
4134
|
+
participant: _,
|
|
4109
4135
|
showDeleteConversation: o,
|
|
4110
4136
|
showBlockParticipant: l,
|
|
4111
4137
|
showReportParticipant: d,
|
|
@@ -4115,7 +4141,7 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4115
4141
|
onBlockParticipantClick: g,
|
|
4116
4142
|
onReportParticipantClick: m,
|
|
4117
4143
|
customChannelActions: f,
|
|
4118
|
-
triggerClassName: C(
|
|
4144
|
+
triggerClassName: C(ge, "bg-[#F1F0EE]")
|
|
4119
4145
|
}
|
|
4120
4146
|
))
|
|
4121
4147
|
] })
|
|
@@ -4126,13 +4152,13 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4126
4152
|
"button",
|
|
4127
4153
|
{
|
|
4128
4154
|
className: C(
|
|
4129
|
-
|
|
4155
|
+
ge,
|
|
4130
4156
|
"messaging-channel-view-back-button-desktop"
|
|
4131
4157
|
),
|
|
4132
4158
|
type: "button",
|
|
4133
4159
|
onClick: e,
|
|
4134
4160
|
"aria-label": "Back to conversations",
|
|
4135
|
-
children: /* @__PURE__ */ n(
|
|
4161
|
+
children: /* @__PURE__ */ n(Ht, { className: "size-5 text-black/90" })
|
|
4136
4162
|
}
|
|
4137
4163
|
),
|
|
4138
4164
|
w ? /* @__PURE__ */ h(
|
|
@@ -4140,19 +4166,19 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4140
4166
|
{
|
|
4141
4167
|
type: "button",
|
|
4142
4168
|
onClick: w,
|
|
4143
|
-
"aria-label": `View details for ${
|
|
4169
|
+
"aria-label": `View details for ${M}`,
|
|
4144
4170
|
className: C(
|
|
4145
|
-
|
|
4171
|
+
j,
|
|
4146
4172
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4147
4173
|
),
|
|
4148
4174
|
children: [
|
|
4149
4175
|
/* @__PURE__ */ n(
|
|
4150
|
-
|
|
4176
|
+
se,
|
|
4151
4177
|
{
|
|
4152
|
-
id: ((
|
|
4153
|
-
name:
|
|
4154
|
-
image:
|
|
4155
|
-
starred: s &&
|
|
4178
|
+
id: ((O = _ == null ? void 0 : _.user) == null ? void 0 : O.id) || p.id || "unknown",
|
|
4179
|
+
name: M,
|
|
4180
|
+
image: L,
|
|
4181
|
+
starred: s && A,
|
|
4156
4182
|
dmAgentEnabled: a,
|
|
4157
4183
|
size: 48
|
|
4158
4184
|
}
|
|
@@ -4160,23 +4186,23 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4160
4186
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
4161
4187
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4162
4188
|
z,
|
|
4163
|
-
/* @__PURE__ */ n(
|
|
4189
|
+
/* @__PURE__ */ n(_e, { className: "size-4 shrink-0", weight: "bold" })
|
|
4164
4190
|
] }),
|
|
4165
4191
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4166
|
-
/* @__PURE__ */ n(
|
|
4192
|
+
/* @__PURE__ */ n(Ne, { className: "size-3 shrink-0 text-black/55" }),
|
|
4167
4193
|
/* @__PURE__ */ n("span", { className: "truncate", children: Pe })
|
|
4168
4194
|
] })
|
|
4169
4195
|
] })
|
|
4170
4196
|
]
|
|
4171
4197
|
}
|
|
4172
|
-
) : /* @__PURE__ */ h("div", { className:
|
|
4198
|
+
) : /* @__PURE__ */ h("div", { className: j, children: [
|
|
4173
4199
|
/* @__PURE__ */ n(
|
|
4174
|
-
|
|
4200
|
+
se,
|
|
4175
4201
|
{
|
|
4176
|
-
id: ((
|
|
4177
|
-
name:
|
|
4178
|
-
image:
|
|
4179
|
-
starred: s &&
|
|
4202
|
+
id: ((F = _ == null ? void 0 : _.user) == null ? void 0 : F.id) || p.id || "unknown",
|
|
4203
|
+
name: M,
|
|
4204
|
+
image: L,
|
|
4205
|
+
starred: s && A,
|
|
4180
4206
|
dmAgentEnabled: a,
|
|
4181
4207
|
size: 48
|
|
4182
4208
|
}
|
|
@@ -4185,7 +4211,7 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4185
4211
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4186
4212
|
z,
|
|
4187
4213
|
/* @__PURE__ */ n(
|
|
4188
|
-
|
|
4214
|
+
_e,
|
|
4189
4215
|
{
|
|
4190
4216
|
className: "invisible size-4 shrink-0",
|
|
4191
4217
|
weight: "bold"
|
|
@@ -4193,7 +4219,7 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4193
4219
|
)
|
|
4194
4220
|
] }),
|
|
4195
4221
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4196
|
-
/* @__PURE__ */ n(
|
|
4222
|
+
/* @__PURE__ */ n(Ne, { className: "size-3 shrink-0 text-black/55" }),
|
|
4197
4223
|
/* @__PURE__ */ n("span", { className: "truncate", children: Pe })
|
|
4198
4224
|
] })
|
|
4199
4225
|
] })
|
|
@@ -4203,27 +4229,27 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4203
4229
|
s && /* @__PURE__ */ n(
|
|
4204
4230
|
"button",
|
|
4205
4231
|
{
|
|
4206
|
-
className:
|
|
4232
|
+
className: ge,
|
|
4207
4233
|
onClick: k,
|
|
4208
4234
|
type: "button",
|
|
4209
|
-
"aria-label":
|
|
4235
|
+
"aria-label": A ? "Unstar conversation" : "Star conversation",
|
|
4210
4236
|
children: /* @__PURE__ */ n(
|
|
4211
4237
|
Ke,
|
|
4212
4238
|
{
|
|
4213
4239
|
className: C("size-6", {
|
|
4214
|
-
"text-yellow-600":
|
|
4215
|
-
"text-black/90": !
|
|
4240
|
+
"text-yellow-600": A,
|
|
4241
|
+
"text-black/90": !A
|
|
4216
4242
|
}),
|
|
4217
|
-
weight:
|
|
4243
|
+
weight: A ? "duotone" : "regular"
|
|
4218
4244
|
}
|
|
4219
4245
|
)
|
|
4220
4246
|
}
|
|
4221
4247
|
),
|
|
4222
|
-
|
|
4223
|
-
|
|
4248
|
+
c && (b !== void 0 ? b : /* @__PURE__ */ n(
|
|
4249
|
+
Wt,
|
|
4224
4250
|
{
|
|
4225
4251
|
channel: p,
|
|
4226
|
-
participant:
|
|
4252
|
+
participant: _,
|
|
4227
4253
|
showDeleteConversation: o,
|
|
4228
4254
|
showBlockParticipant: l,
|
|
4229
4255
|
showReportParticipant: d,
|
|
@@ -4233,13 +4259,13 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4233
4259
|
onBlockParticipantClick: g,
|
|
4234
4260
|
onReportParticipantClick: m,
|
|
4235
4261
|
customChannelActions: f,
|
|
4236
|
-
triggerClassName:
|
|
4262
|
+
triggerClassName: ge
|
|
4237
4263
|
}
|
|
4238
4264
|
))
|
|
4239
4265
|
] })
|
|
4240
4266
|
] })
|
|
4241
4267
|
] });
|
|
4242
|
-
},
|
|
4268
|
+
}, Fi = ({
|
|
4243
4269
|
onBack: e,
|
|
4244
4270
|
showBackButton: t,
|
|
4245
4271
|
renderMessageInputActions: s,
|
|
@@ -4253,69 +4279,69 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4253
4279
|
onReportParticipantClick: g,
|
|
4254
4280
|
showBlockParticipant: m = !0,
|
|
4255
4281
|
showReportParticipant: f = !0,
|
|
4256
|
-
composerDisabled:
|
|
4257
|
-
composerDisabledReason:
|
|
4282
|
+
composerDisabled: b = !1,
|
|
4283
|
+
composerDisabledReason: c,
|
|
4258
4284
|
showStarButton: w = !1,
|
|
4259
|
-
chatbotVotingEnabled:
|
|
4285
|
+
chatbotVotingEnabled: v = !1,
|
|
4260
4286
|
renderChannelBanner: p,
|
|
4261
|
-
renderHeaderTitleBadges:
|
|
4262
|
-
customChannelActions:
|
|
4263
|
-
renderChannelActions:
|
|
4264
|
-
renderMessage:
|
|
4265
|
-
dmAgentEnabled:
|
|
4266
|
-
viewerLanguage:
|
|
4287
|
+
renderHeaderTitleBadges: N,
|
|
4288
|
+
customChannelActions: _,
|
|
4289
|
+
renderChannelActions: M,
|
|
4290
|
+
renderMessage: L,
|
|
4291
|
+
dmAgentEnabled: A = !1,
|
|
4292
|
+
viewerLanguage: R,
|
|
4267
4293
|
showChannelInfo: P = !0,
|
|
4268
|
-
onParticipantNameClick:
|
|
4294
|
+
onParticipantNameClick: j,
|
|
4269
4295
|
composerInput: z
|
|
4270
4296
|
}) => {
|
|
4271
|
-
var
|
|
4272
|
-
const { channel: k } =
|
|
4297
|
+
var J, Z, q, x;
|
|
4298
|
+
const { channel: k } = be(), { client: T } = ve(), S = B.useMemo(
|
|
4273
4299
|
() => {
|
|
4274
|
-
var
|
|
4300
|
+
var E;
|
|
4275
4301
|
return st(
|
|
4276
|
-
(
|
|
4277
|
-
|
|
4302
|
+
(E = k.state) == null ? void 0 : E.members,
|
|
4303
|
+
T == null ? void 0 : T.userID,
|
|
4278
4304
|
k.type
|
|
4279
4305
|
);
|
|
4280
4306
|
},
|
|
4281
|
-
[(
|
|
4282
|
-
), y =
|
|
4283
|
-
var
|
|
4284
|
-
const
|
|
4285
|
-
return
|
|
4286
|
-
var
|
|
4287
|
-
return ((
|
|
4307
|
+
[(J = k.state) == null ? void 0 : J.members, T == null ? void 0 : T.userID, k.type]
|
|
4308
|
+
), y = B.useMemo(() => {
|
|
4309
|
+
var H;
|
|
4310
|
+
const E = T == null ? void 0 : T.userID;
|
|
4311
|
+
return E ? Object.values(((H = k.state) == null ? void 0 : H.members) || {}).find((Q) => {
|
|
4312
|
+
var W;
|
|
4313
|
+
return ((W = Q.user) == null ? void 0 : W.id) === E;
|
|
4288
4314
|
}) : void 0;
|
|
4289
|
-
}, [
|
|
4290
|
-
(
|
|
4291
|
-
const { message:
|
|
4292
|
-
|
|
4315
|
+
}, [T == null ? void 0 : T.userID, (Z = k.state) == null ? void 0 : Z.members]), I = ((q = y == null ? void 0 : y.user) == null ? void 0 : q.is_account) ?? (y == null ? void 0 : y.is_account), O = ((x = S == null ? void 0 : S.user) == null ? void 0 : x.is_account) ?? (S == null ? void 0 : S.is_account), F = A && I === !1 && O === !0, U = K(
|
|
4316
|
+
(E) => {
|
|
4317
|
+
const { message: G } = Ee("ChannelView"), H = /* @__PURE__ */ n(
|
|
4318
|
+
hi,
|
|
4293
4319
|
{
|
|
4294
|
-
...
|
|
4295
|
-
chatbotVotingEnabled:
|
|
4296
|
-
viewerLanguage:
|
|
4320
|
+
...E,
|
|
4321
|
+
chatbotVotingEnabled: v,
|
|
4322
|
+
viewerLanguage: R
|
|
4297
4323
|
}
|
|
4298
4324
|
);
|
|
4299
|
-
return !
|
|
4325
|
+
return !L || !G ? H : L(H, G);
|
|
4300
4326
|
},
|
|
4301
|
-
[
|
|
4327
|
+
[v, L, R]
|
|
4302
4328
|
);
|
|
4303
4329
|
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
4304
|
-
|
|
4330
|
+
Cs,
|
|
4305
4331
|
{
|
|
4306
4332
|
overrides: {
|
|
4307
|
-
Message:
|
|
4308
|
-
MessageActions:
|
|
4333
|
+
Message: U,
|
|
4334
|
+
MessageActions: pi
|
|
4309
4335
|
},
|
|
4310
|
-
children: /* @__PURE__ */ h(
|
|
4336
|
+
children: /* @__PURE__ */ h(ks, { children: [
|
|
4311
4337
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
4312
|
-
|
|
4338
|
+
Oi,
|
|
4313
4339
|
{
|
|
4314
4340
|
onBack: e,
|
|
4315
4341
|
showBackButton: t,
|
|
4316
4342
|
showChannelInfo: P,
|
|
4317
4343
|
showStarButton: w,
|
|
4318
|
-
dmAgentEnabled:
|
|
4344
|
+
dmAgentEnabled: F,
|
|
4319
4345
|
onLeaveConversation: i,
|
|
4320
4346
|
onBlockParticipant: o,
|
|
4321
4347
|
showDeleteConversation: l,
|
|
@@ -4324,31 +4350,31 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4324
4350
|
onDeleteConversationClick: d,
|
|
4325
4351
|
onBlockParticipantClick: u,
|
|
4326
4352
|
onReportParticipantClick: g,
|
|
4327
|
-
customChannelActions:
|
|
4328
|
-
renderChannelActions:
|
|
4329
|
-
onParticipantNameClick:
|
|
4330
|
-
renderHeaderTitleBadges:
|
|
4353
|
+
customChannelActions: _,
|
|
4354
|
+
renderChannelActions: M,
|
|
4355
|
+
onParticipantNameClick: j,
|
|
4356
|
+
renderHeaderTitleBadges: N
|
|
4331
4357
|
}
|
|
4332
4358
|
) }, "lt-channel-header"),
|
|
4333
|
-
p ? /* @__PURE__ */ n(
|
|
4359
|
+
p ? /* @__PURE__ */ n(B.Fragment, { children: p() }, "lt-channel-banner") : null,
|
|
4334
4360
|
/* @__PURE__ */ n(
|
|
4335
4361
|
"div",
|
|
4336
4362
|
{
|
|
4337
4363
|
className: "flex-1 overflow-hidden relative",
|
|
4338
|
-
children: /* @__PURE__ */ n(
|
|
4364
|
+
children: /* @__PURE__ */ n(Ss, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
4339
4365
|
},
|
|
4340
4366
|
"lt-channel-message-list"
|
|
4341
4367
|
),
|
|
4342
|
-
r ? /* @__PURE__ */ n(
|
|
4368
|
+
r ? /* @__PURE__ */ n(B.Fragment, { children: r(k) }, "lt-channel-conversation-footer") : null,
|
|
4343
4369
|
/* @__PURE__ */ n(
|
|
4344
|
-
|
|
4370
|
+
Ni,
|
|
4345
4371
|
{
|
|
4346
4372
|
...s && {
|
|
4347
4373
|
renderActions: () => s == null ? void 0 : s(k)
|
|
4348
4374
|
},
|
|
4349
4375
|
renderFooter: () => a == null ? void 0 : a(k),
|
|
4350
|
-
disabled:
|
|
4351
|
-
disabledReason:
|
|
4376
|
+
disabled: b,
|
|
4377
|
+
disabledReason: c,
|
|
4352
4378
|
composerInput: z
|
|
4353
4379
|
},
|
|
4354
4380
|
"lt-channel-message-input"
|
|
@@ -4356,7 +4382,7 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4356
4382
|
] })
|
|
4357
4383
|
}
|
|
4358
4384
|
) });
|
|
4359
|
-
},
|
|
4385
|
+
}, $n = B.memo(
|
|
4360
4386
|
({
|
|
4361
4387
|
channel: e,
|
|
4362
4388
|
onBack: t,
|
|
@@ -4367,86 +4393,86 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4367
4393
|
onLeaveConversation: o,
|
|
4368
4394
|
onBlockParticipant: l,
|
|
4369
4395
|
className: d,
|
|
4370
|
-
CustomChannelEmptyState: u =
|
|
4396
|
+
CustomChannelEmptyState: u = Pi,
|
|
4371
4397
|
showDeleteConversation: g = !0,
|
|
4372
4398
|
onDeleteConversationClick: m,
|
|
4373
4399
|
onBlockParticipantClick: f,
|
|
4374
|
-
onReportParticipantClick:
|
|
4375
|
-
showBlockParticipant:
|
|
4400
|
+
onReportParticipantClick: b,
|
|
4401
|
+
showBlockParticipant: c = !0,
|
|
4376
4402
|
showReportParticipant: w = !0,
|
|
4377
|
-
composerDisabled:
|
|
4403
|
+
composerDisabled: v = !1,
|
|
4378
4404
|
composerDisabledReason: p,
|
|
4379
|
-
dmAgentEnabled:
|
|
4380
|
-
messageMetadata:
|
|
4381
|
-
onMessageSent:
|
|
4382
|
-
showStarButton:
|
|
4383
|
-
chatbotVotingEnabled:
|
|
4384
|
-
renderChannelBanner:
|
|
4405
|
+
dmAgentEnabled: N,
|
|
4406
|
+
messageMetadata: _,
|
|
4407
|
+
onMessageSent: M,
|
|
4408
|
+
showStarButton: L = !1,
|
|
4409
|
+
chatbotVotingEnabled: A = !1,
|
|
4410
|
+
renderChannelBanner: R,
|
|
4385
4411
|
renderHeaderTitleBadges: P,
|
|
4386
|
-
customChannelActions:
|
|
4412
|
+
customChannelActions: j,
|
|
4387
4413
|
renderChannelActions: z,
|
|
4388
4414
|
renderMessage: k,
|
|
4389
|
-
onMessageLinkClick:
|
|
4390
|
-
sendButton:
|
|
4415
|
+
onMessageLinkClick: T,
|
|
4416
|
+
sendButton: S,
|
|
4391
4417
|
attachmentPreviewList: y,
|
|
4392
|
-
viewerLanguage:
|
|
4393
|
-
showChannelInfo:
|
|
4394
|
-
onParticipantNameClick:
|
|
4395
|
-
composerInput:
|
|
4418
|
+
viewerLanguage: I,
|
|
4419
|
+
showChannelInfo: O = !0,
|
|
4420
|
+
onParticipantNameClick: F,
|
|
4421
|
+
composerInput: U
|
|
4396
4422
|
}) => {
|
|
4397
|
-
const
|
|
4398
|
-
async (q, x,
|
|
4399
|
-
var
|
|
4400
|
-
const
|
|
4423
|
+
const J = K(
|
|
4424
|
+
async (q, x, E) => {
|
|
4425
|
+
var ee;
|
|
4426
|
+
const G = ((ee = e.data) == null ? void 0 : ee.chatbot_paused) === !0, H = N && !G, Q = {
|
|
4401
4427
|
...x,
|
|
4402
|
-
...
|
|
4403
|
-
...
|
|
4428
|
+
...H && { silent: !0 },
|
|
4429
|
+
..._ && {
|
|
4404
4430
|
metadata: {
|
|
4405
4431
|
...x.metadata ?? {},
|
|
4406
|
-
...
|
|
4432
|
+
..._
|
|
4407
4433
|
}
|
|
4408
4434
|
}
|
|
4409
|
-
},
|
|
4410
|
-
...
|
|
4411
|
-
...
|
|
4412
|
-
},
|
|
4413
|
-
return
|
|
4435
|
+
}, W = {
|
|
4436
|
+
...E,
|
|
4437
|
+
...H && { skip_push: !0 }
|
|
4438
|
+
}, V = await e.sendMessage(Q, W);
|
|
4439
|
+
return M == null || M(V), V;
|
|
4414
4440
|
},
|
|
4415
|
-
[e,
|
|
4416
|
-
),
|
|
4417
|
-
return
|
|
4418
|
-
if (!
|
|
4419
|
-
const q =
|
|
4441
|
+
[e, N, _, M]
|
|
4442
|
+
), Z = Y(null);
|
|
4443
|
+
return X(() => {
|
|
4444
|
+
if (!T) return;
|
|
4445
|
+
const q = Z.current;
|
|
4420
4446
|
if (!q) return;
|
|
4421
|
-
const x = (
|
|
4422
|
-
const
|
|
4423
|
-
if (!
|
|
4424
|
-
const
|
|
4425
|
-
|
|
4447
|
+
const x = (E) => {
|
|
4448
|
+
const G = E.target, H = G == null ? void 0 : G.closest("a[href]"), Q = H == null ? void 0 : H.getAttribute("href");
|
|
4449
|
+
if (!Q) return;
|
|
4450
|
+
const W = H == null ? void 0 : H.closest("[data-message-id]"), V = W == null ? void 0 : W.getAttribute("data-message-id"), ee = V ? e.state.messages.find((le) => le.id === V) : void 0;
|
|
4451
|
+
T(Q, ee);
|
|
4426
4452
|
};
|
|
4427
4453
|
return q.addEventListener("click", x), () => q.removeEventListener("click", x);
|
|
4428
|
-
}, [
|
|
4454
|
+
}, [T, e]), /* @__PURE__ */ n(
|
|
4429
4455
|
"div",
|
|
4430
4456
|
{
|
|
4431
|
-
ref:
|
|
4457
|
+
ref: Z,
|
|
4432
4458
|
className: C(
|
|
4433
4459
|
"messaging-channel-view h-full flex flex-col",
|
|
4434
4460
|
d
|
|
4435
4461
|
),
|
|
4436
|
-
children: /* @__PURE__ */ n(
|
|
4437
|
-
|
|
4462
|
+
children: /* @__PURE__ */ n(Fn.Provider, { value: N ?? !1, children: /* @__PURE__ */ n(
|
|
4463
|
+
ys,
|
|
4438
4464
|
{
|
|
4439
4465
|
channel: e,
|
|
4440
|
-
MessageSystem:
|
|
4466
|
+
MessageSystem: Mi,
|
|
4441
4467
|
EmptyStateIndicator: u,
|
|
4442
4468
|
LoadingIndicator: $e,
|
|
4443
|
-
DateSeparator:
|
|
4444
|
-
TypingIndicator:
|
|
4445
|
-
doSendMessageRequest:
|
|
4446
|
-
...
|
|
4469
|
+
DateSeparator: ca,
|
|
4470
|
+
TypingIndicator: Ri,
|
|
4471
|
+
doSendMessageRequest: J,
|
|
4472
|
+
...S ? { SendButton: S } : {},
|
|
4447
4473
|
...y ? { AttachmentPreviewList: y } : {},
|
|
4448
4474
|
children: /* @__PURE__ */ n(
|
|
4449
|
-
|
|
4475
|
+
Fi,
|
|
4450
4476
|
{
|
|
4451
4477
|
onBack: t,
|
|
4452
4478
|
showBackButton: s,
|
|
@@ -4459,23 +4485,23 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4459
4485
|
showDeleteConversation: g,
|
|
4460
4486
|
onDeleteConversationClick: m,
|
|
4461
4487
|
onBlockParticipantClick: f,
|
|
4462
|
-
onReportParticipantClick:
|
|
4463
|
-
showBlockParticipant:
|
|
4488
|
+
onReportParticipantClick: b,
|
|
4489
|
+
showBlockParticipant: c,
|
|
4464
4490
|
showReportParticipant: w,
|
|
4465
|
-
composerDisabled:
|
|
4491
|
+
composerDisabled: v,
|
|
4466
4492
|
composerDisabledReason: p,
|
|
4467
|
-
showStarButton:
|
|
4468
|
-
dmAgentEnabled:
|
|
4469
|
-
chatbotVotingEnabled:
|
|
4470
|
-
renderChannelBanner:
|
|
4493
|
+
showStarButton: L,
|
|
4494
|
+
dmAgentEnabled: N,
|
|
4495
|
+
chatbotVotingEnabled: A,
|
|
4496
|
+
renderChannelBanner: R,
|
|
4471
4497
|
renderHeaderTitleBadges: P,
|
|
4472
|
-
customChannelActions:
|
|
4498
|
+
customChannelActions: j,
|
|
4473
4499
|
renderChannelActions: z,
|
|
4474
4500
|
renderMessage: k,
|
|
4475
|
-
viewerLanguage:
|
|
4476
|
-
showChannelInfo:
|
|
4477
|
-
onParticipantNameClick:
|
|
4478
|
-
composerInput:
|
|
4501
|
+
viewerLanguage: I,
|
|
4502
|
+
showChannelInfo: O,
|
|
4503
|
+
onParticipantNameClick: F,
|
|
4504
|
+
composerInput: U
|
|
4479
4505
|
}
|
|
4480
4506
|
)
|
|
4481
4507
|
}
|
|
@@ -4484,8 +4510,8 @@ const he = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4484
4510
|
);
|
|
4485
4511
|
}
|
|
4486
4512
|
);
|
|
4487
|
-
|
|
4488
|
-
const
|
|
4513
|
+
$n.displayName = "ChannelView";
|
|
4514
|
+
const ye = B.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: [
|
|
4489
4515
|
/* @__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: "⚠️" }) }),
|
|
4490
4516
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4491
4517
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4499,8 +4525,8 @@ const Ne = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
4499
4525
|
}
|
|
4500
4526
|
)
|
|
4501
4527
|
] }) }));
|
|
4502
|
-
|
|
4503
|
-
const
|
|
4528
|
+
ye.displayName = "ErrorState";
|
|
4529
|
+
const ro = ({
|
|
4504
4530
|
capabilities: e = {},
|
|
4505
4531
|
renderMessageInputActions: t,
|
|
4506
4532
|
renderConversationFooter: s,
|
|
@@ -4514,79 +4540,79 @@ const no = ({
|
|
|
4514
4540
|
dmAgentEnabled: g,
|
|
4515
4541
|
onMessageSent: m,
|
|
4516
4542
|
chatbotVotingEnabled: f = !1,
|
|
4517
|
-
viewerLanguage:
|
|
4518
|
-
renderHeaderTitleBadges:
|
|
4543
|
+
viewerLanguage: b,
|
|
4544
|
+
renderHeaderTitleBadges: c,
|
|
4519
4545
|
renderChannelBanner: w,
|
|
4520
|
-
customChannelActions:
|
|
4546
|
+
customChannelActions: v,
|
|
4521
4547
|
renderChannelActions: p,
|
|
4522
|
-
onParticipantNameClick:
|
|
4523
|
-
renderMessage:
|
|
4524
|
-
onMessageLinkClick:
|
|
4525
|
-
showChannelInfo:
|
|
4526
|
-
composerInput:
|
|
4548
|
+
onParticipantNameClick: N,
|
|
4549
|
+
renderMessage: _,
|
|
4550
|
+
onMessageLinkClick: M,
|
|
4551
|
+
showChannelInfo: L,
|
|
4552
|
+
composerInput: A
|
|
4527
4553
|
}) => {
|
|
4528
4554
|
const {
|
|
4529
|
-
client:
|
|
4555
|
+
client: R,
|
|
4530
4556
|
isConnected: P,
|
|
4531
|
-
isLoading:
|
|
4557
|
+
isLoading: j,
|
|
4532
4558
|
error: z,
|
|
4533
4559
|
refreshConnection: k,
|
|
4534
|
-
service:
|
|
4535
|
-
debug:
|
|
4536
|
-
} =
|
|
4560
|
+
service: T,
|
|
4561
|
+
debug: S
|
|
4562
|
+
} = Qs(), [y, I] = $(null), [O, F] = $(null), [U, J] = $(!1), { showDeleteConversation: Z = !0 } = e, q = Y(o);
|
|
4537
4563
|
q.current = o;
|
|
4538
4564
|
const x = Y(a);
|
|
4539
4565
|
x.current = a;
|
|
4540
|
-
const
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
}, [y]),
|
|
4544
|
-
if (!
|
|
4545
|
-
const
|
|
4546
|
-
if (
|
|
4547
|
-
const
|
|
4548
|
-
if (
|
|
4549
|
-
|
|
4550
|
-
const
|
|
4551
|
-
|
|
4566
|
+
const E = Y(null), G = Y(null);
|
|
4567
|
+
X(() => {
|
|
4568
|
+
G.current = y;
|
|
4569
|
+
}, [y]), X(() => {
|
|
4570
|
+
if (!R || !P) return;
|
|
4571
|
+
const W = R.userID;
|
|
4572
|
+
if (!W) return;
|
|
4573
|
+
const V = `${W}::${i}`;
|
|
4574
|
+
if (E.current === V) return;
|
|
4575
|
+
E.current = V;
|
|
4576
|
+
const ee = () => {
|
|
4577
|
+
E.current === V && (E.current = null);
|
|
4552
4578
|
};
|
|
4553
4579
|
(async () => {
|
|
4554
|
-
var
|
|
4580
|
+
var Le, Re;
|
|
4555
4581
|
try {
|
|
4556
|
-
|
|
4582
|
+
S && console.log(
|
|
4557
4583
|
"[MessagingShell] Loading initial conversation with:",
|
|
4558
4584
|
i
|
|
4559
4585
|
);
|
|
4560
|
-
const
|
|
4586
|
+
const re = await R.queryChannels(
|
|
4561
4587
|
{
|
|
4562
4588
|
type: "messaging",
|
|
4563
|
-
members: { $eq: [
|
|
4589
|
+
members: { $eq: [W, i] }
|
|
4564
4590
|
},
|
|
4565
4591
|
{},
|
|
4566
4592
|
{ limit: 1 }
|
|
4567
4593
|
);
|
|
4568
|
-
if (
|
|
4569
|
-
|
|
4594
|
+
if (re.length > 0) {
|
|
4595
|
+
I(re[0]), F(null), (Le = x.current) == null || Le.call(x, re[0]), S && console.log(
|
|
4570
4596
|
"[MessagingShell] Initial conversation loaded:",
|
|
4571
|
-
|
|
4597
|
+
re[0].id
|
|
4572
4598
|
);
|
|
4573
4599
|
return;
|
|
4574
4600
|
}
|
|
4575
|
-
const
|
|
4576
|
-
if (!
|
|
4577
|
-
|
|
4601
|
+
const ce = q.current;
|
|
4602
|
+
if (!ce || !T) {
|
|
4603
|
+
ee(), F("No conversation found with this account"), S && console.log(
|
|
4578
4604
|
"[MessagingShell] No conversation found for:",
|
|
4579
4605
|
i
|
|
4580
4606
|
);
|
|
4581
4607
|
return;
|
|
4582
4608
|
}
|
|
4583
4609
|
try {
|
|
4584
|
-
const ie = await
|
|
4585
|
-
id:
|
|
4586
|
-
name:
|
|
4587
|
-
phone:
|
|
4610
|
+
const ie = await T.startChannelWithParticipant({
|
|
4611
|
+
id: ce.id,
|
|
4612
|
+
name: ce.name,
|
|
4613
|
+
phone: ce.phone
|
|
4588
4614
|
});
|
|
4589
|
-
|
|
4615
|
+
I(ie), F(null), (Re = x.current) == null || Re.call(x, ie), S && console.log(
|
|
4590
4616
|
"[MessagingShell] Channel created and loaded:",
|
|
4591
4617
|
ie.id
|
|
4592
4618
|
);
|
|
@@ -4594,64 +4620,64 @@ const no = ({
|
|
|
4594
4620
|
console.error(
|
|
4595
4621
|
"[MessagingShell] Failed to create conversation:",
|
|
4596
4622
|
ie
|
|
4597
|
-
),
|
|
4623
|
+
), ee(), F("Failed to create conversation");
|
|
4598
4624
|
}
|
|
4599
|
-
} catch (
|
|
4625
|
+
} catch (re) {
|
|
4600
4626
|
console.error(
|
|
4601
4627
|
"[MessagingShell] Failed to load initial conversation:",
|
|
4602
|
-
|
|
4603
|
-
),
|
|
4628
|
+
re
|
|
4629
|
+
), ee(), G.current || F("Failed to load conversation");
|
|
4604
4630
|
}
|
|
4605
4631
|
})();
|
|
4606
|
-
}, [i,
|
|
4607
|
-
const
|
|
4608
|
-
|
|
4609
|
-
const
|
|
4610
|
-
var
|
|
4611
|
-
|
|
4632
|
+
}, [i, R, P, T, S]);
|
|
4633
|
+
const H = Y(r);
|
|
4634
|
+
H.current = r;
|
|
4635
|
+
const Q = K(() => {
|
|
4636
|
+
var W;
|
|
4637
|
+
I(null), J(!0), (W = H.current) == null || W.call(H);
|
|
4612
4638
|
}, []);
|
|
4613
|
-
return
|
|
4614
|
-
|
|
4639
|
+
return j ? /* @__PURE__ */ n($e, {}) : z ? /* @__PURE__ */ n(ye, { message: z, onBack: k }) : !P || !R ? /* @__PURE__ */ n(
|
|
4640
|
+
ye,
|
|
4615
4641
|
{
|
|
4616
4642
|
message: "Not connected to messaging service",
|
|
4617
4643
|
onBack: k
|
|
4618
4644
|
}
|
|
4619
|
-
) :
|
|
4620
|
-
|
|
4645
|
+
) : O ? /* @__PURE__ */ n(ye, { message: O }) : U && !y ? /* @__PURE__ */ n(ye, { message: "Conversation ended" }) : y ? /* @__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(
|
|
4646
|
+
$n,
|
|
4621
4647
|
{
|
|
4622
4648
|
channel: y,
|
|
4623
4649
|
renderMessageInputActions: t,
|
|
4624
4650
|
renderConversationFooter: s,
|
|
4625
4651
|
renderChannelBanner: w,
|
|
4626
|
-
onLeaveConversation:
|
|
4627
|
-
onBlockParticipant:
|
|
4652
|
+
onLeaveConversation: Q,
|
|
4653
|
+
onBlockParticipant: Q,
|
|
4628
4654
|
CustomChannelEmptyState: l,
|
|
4629
|
-
showDeleteConversation:
|
|
4655
|
+
showDeleteConversation: Z,
|
|
4630
4656
|
onBlockParticipantClick: d,
|
|
4631
4657
|
onReportParticipantClick: u,
|
|
4632
4658
|
dmAgentEnabled: g,
|
|
4633
4659
|
onMessageSent: m,
|
|
4634
4660
|
chatbotVotingEnabled: f,
|
|
4635
|
-
viewerLanguage:
|
|
4636
|
-
renderHeaderTitleBadges:
|
|
4637
|
-
customChannelActions:
|
|
4661
|
+
viewerLanguage: b,
|
|
4662
|
+
renderHeaderTitleBadges: c,
|
|
4663
|
+
customChannelActions: v,
|
|
4638
4664
|
renderChannelActions: p,
|
|
4639
|
-
onParticipantNameClick:
|
|
4640
|
-
renderMessage:
|
|
4641
|
-
onMessageLinkClick:
|
|
4642
|
-
showChannelInfo:
|
|
4643
|
-
composerInput:
|
|
4665
|
+
onParticipantNameClick: N,
|
|
4666
|
+
renderMessage: _,
|
|
4667
|
+
onMessageLinkClick: M,
|
|
4668
|
+
showChannelInfo: L,
|
|
4669
|
+
composerInput: A
|
|
4644
4670
|
},
|
|
4645
4671
|
y.id
|
|
4646
4672
|
) }) }) : /* @__PURE__ */ n($e, {});
|
|
4647
4673
|
};
|
|
4648
|
-
function
|
|
4674
|
+
function $i(e) {
|
|
4649
4675
|
const t = e.state.pending_messages;
|
|
4650
4676
|
if (t != null && t.length)
|
|
4651
4677
|
for (const s of t)
|
|
4652
4678
|
e.state.addMessageSorted(s.message);
|
|
4653
4679
|
}
|
|
4654
|
-
const
|
|
4680
|
+
const Bn = B.createContext({
|
|
4655
4681
|
selectedChannel: void 0,
|
|
4656
4682
|
onChannelSelect: () => {
|
|
4657
4683
|
},
|
|
@@ -4659,18 +4685,18 @@ const $n = j.createContext({
|
|
|
4659
4685
|
renderMessagePreview: void 0,
|
|
4660
4686
|
channelPreview: void 0,
|
|
4661
4687
|
viewerLanguage: void 0
|
|
4662
|
-
}),
|
|
4688
|
+
}), Bi = Bn.Provider, ji = () => B.useContext(Bn), Ui = (e, t) => {
|
|
4663
4689
|
const s = new Date(
|
|
4664
4690
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4665
4691
|
), r = new Date(
|
|
4666
4692
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4667
4693
|
).getTime() - s.getTime();
|
|
4668
4694
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4669
|
-
},
|
|
4695
|
+
}, Vi = (e) => {
|
|
4670
4696
|
const t = /* @__PURE__ */ new Date();
|
|
4671
4697
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4672
4698
|
return "Just now";
|
|
4673
|
-
const a =
|
|
4699
|
+
const a = Ui(e, t);
|
|
4674
4700
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4675
4701
|
hour: "numeric",
|
|
4676
4702
|
minute: "2-digit",
|
|
@@ -4680,9 +4706,9 @@ const $n = j.createContext({
|
|
|
4680
4706
|
day: "numeric",
|
|
4681
4707
|
year: "2-digit"
|
|
4682
4708
|
});
|
|
4683
|
-
},
|
|
4709
|
+
}, jn = B.memo(
|
|
4684
4710
|
(e) => {
|
|
4685
|
-
var P,
|
|
4711
|
+
var P, j, z;
|
|
4686
4712
|
const { channel: t, unread: s } = e, {
|
|
4687
4713
|
selectedChannel: a,
|
|
4688
4714
|
onChannelSelect: r,
|
|
@@ -4690,7 +4716,7 @@ const $n = j.createContext({
|
|
|
4690
4716
|
channelPreview: o,
|
|
4691
4717
|
renderMessagePreview: l,
|
|
4692
4718
|
viewerLanguage: d
|
|
4693
|
-
} =
|
|
4719
|
+
} = ji(), { client: u } = ve(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = dn(t);
|
|
4694
4720
|
if (o)
|
|
4695
4721
|
return /* @__PURE__ */ n(
|
|
4696
4722
|
o,
|
|
@@ -4704,47 +4730,47 @@ const $n = j.createContext({
|
|
|
4704
4730
|
);
|
|
4705
4731
|
const f = () => {
|
|
4706
4732
|
t && r(t);
|
|
4707
|
-
},
|
|
4708
|
-
const
|
|
4709
|
-
!
|
|
4710
|
-
},
|
|
4733
|
+
}, b = (k) => {
|
|
4734
|
+
const T = k.key === "Enter" || k.key === " ", S = k.repeat;
|
|
4735
|
+
!T || S || (k.preventDefault(), f());
|
|
4736
|
+
}, c = st(
|
|
4711
4737
|
(P = t == null ? void 0 : t.state) == null ? void 0 : P.members,
|
|
4712
4738
|
u == null ? void 0 : u.userID,
|
|
4713
4739
|
t == null ? void 0 : t.type
|
|
4714
|
-
), w =
|
|
4715
|
-
var
|
|
4716
|
-
const k = (
|
|
4740
|
+
), w = un(c == null ? void 0 : c.user), v = (j = c == null ? void 0 : c.user) == null ? void 0 : j.image, p = (() => {
|
|
4741
|
+
var T;
|
|
4742
|
+
const k = (T = t == null ? void 0 : t.state) == null ? void 0 : T.messages;
|
|
4717
4743
|
if (k != null && k.length) {
|
|
4718
|
-
for (let
|
|
4719
|
-
if (k[
|
|
4744
|
+
for (let S = k.length - 1; S >= 0; S--)
|
|
4745
|
+
if (k[S].type !== "system") return k[S];
|
|
4720
4746
|
}
|
|
4721
|
-
})(),
|
|
4722
|
-
var
|
|
4723
|
-
const k =
|
|
4747
|
+
})(), _ = (() => {
|
|
4748
|
+
var O, F, U, J;
|
|
4749
|
+
const k = hn({
|
|
4724
4750
|
message: p,
|
|
4725
4751
|
viewerLanguage: d
|
|
4726
4752
|
});
|
|
4727
|
-
if (((
|
|
4728
|
-
if (((
|
|
4729
|
-
if (((
|
|
4753
|
+
if (((O = p == null ? void 0 : p.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_TIP") return k ? `💵 ${k}` : "💵 Sent a tip";
|
|
4754
|
+
if (((F = p == null ? void 0 : p.metadata) == null ? void 0 : F.custom_type) === "MESSAGE_PAID") return k ? `💰 ${k}` : "💰 Sent a message";
|
|
4755
|
+
if (((U = p == null ? void 0 : p.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_ATTACHMENT")
|
|
4730
4756
|
return k ? `📎 ${k}` : "📎 Sent an attachment";
|
|
4731
4757
|
if (k) return k;
|
|
4732
|
-
const
|
|
4733
|
-
return
|
|
4734
|
-
})(),
|
|
4758
|
+
const I = (J = p == null ? void 0 : p.attachments) == null ? void 0 : J[0];
|
|
4759
|
+
return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4760
|
+
})(), M = p != null && p.created_at ? Vi(new Date(p.created_at)) : "", L = p ? ze(p) : !1, A = l ? l(p, _) : `${L ? "✨ " : ""}${_}`, R = s ?? 0;
|
|
4735
4761
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4736
4762
|
channelId: t == null ? void 0 : t.id,
|
|
4737
4763
|
isSelected: g,
|
|
4738
4764
|
participantName: w,
|
|
4739
|
-
unreadCount:
|
|
4740
|
-
hasTimestamp: !!
|
|
4765
|
+
unreadCount: R,
|
|
4766
|
+
hasTimestamp: !!M
|
|
4741
4767
|
}), /* @__PURE__ */ n(
|
|
4742
4768
|
"div",
|
|
4743
4769
|
{
|
|
4744
4770
|
role: "button",
|
|
4745
4771
|
tabIndex: 0,
|
|
4746
4772
|
onClick: f,
|
|
4747
|
-
onKeyDown:
|
|
4773
|
+
onKeyDown: b,
|
|
4748
4774
|
className: C(
|
|
4749
4775
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
4750
4776
|
{
|
|
@@ -4755,11 +4781,11 @@ const $n = j.createContext({
|
|
|
4755
4781
|
"data-dd-privacy": "mask",
|
|
4756
4782
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
4757
4783
|
/* @__PURE__ */ n(
|
|
4758
|
-
|
|
4784
|
+
se,
|
|
4759
4785
|
{
|
|
4760
|
-
id: ((z =
|
|
4786
|
+
id: ((z = c == null ? void 0 : c.user) == null ? void 0 : z.id) || t.id || "unknown",
|
|
4761
4787
|
name: w,
|
|
4762
|
-
image:
|
|
4788
|
+
image: v,
|
|
4763
4789
|
size: 48,
|
|
4764
4790
|
starred: m
|
|
4765
4791
|
}
|
|
@@ -4778,11 +4804,11 @@ const $n = j.createContext({
|
|
|
4778
4804
|
]
|
|
4779
4805
|
}
|
|
4780
4806
|
),
|
|
4781
|
-
|
|
4807
|
+
M && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: M })
|
|
4782
4808
|
] }),
|
|
4783
4809
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4784
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
4785
|
-
|
|
4810
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
|
|
4811
|
+
R > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: R > 99 ? "99+" : R })
|
|
4786
4812
|
] })
|
|
4787
4813
|
] })
|
|
4788
4814
|
] })
|
|
@@ -4790,42 +4816,42 @@ const $n = j.createContext({
|
|
|
4790
4816
|
);
|
|
4791
4817
|
}
|
|
4792
4818
|
);
|
|
4793
|
-
|
|
4794
|
-
const
|
|
4819
|
+
jn.displayName = "CustomChannelPreview";
|
|
4820
|
+
const Gi = { last_message_at: -1 }, Hi = B.memo(
|
|
4795
4821
|
({
|
|
4796
4822
|
onChannelSelect: e,
|
|
4797
4823
|
selectedChannel: t,
|
|
4798
4824
|
filters: s,
|
|
4799
4825
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
4800
4826
|
channelRenderFilterFn: r,
|
|
4801
|
-
sort: i =
|
|
4827
|
+
sort: i = Gi,
|
|
4802
4828
|
className: o,
|
|
4803
4829
|
customEmptyStateIndicator: l,
|
|
4804
|
-
channelListPaginator: d =
|
|
4830
|
+
channelListPaginator: d = Is,
|
|
4805
4831
|
channelPreview: u,
|
|
4806
4832
|
renderMessagePreview: g,
|
|
4807
4833
|
viewerLanguage: m
|
|
4808
4834
|
}) => {
|
|
4809
|
-
const f =
|
|
4835
|
+
const f = B.useRef(0);
|
|
4810
4836
|
f.current++;
|
|
4811
|
-
const { debug:
|
|
4812
|
-
(
|
|
4813
|
-
for (const p of
|
|
4814
|
-
|
|
4815
|
-
return r ? r(
|
|
4837
|
+
const { debug: b = !1 } = nt(), c = B.useCallback(
|
|
4838
|
+
(v) => {
|
|
4839
|
+
for (const p of v)
|
|
4840
|
+
$i(p);
|
|
4841
|
+
return r ? r(v) : v;
|
|
4816
4842
|
},
|
|
4817
4843
|
[r]
|
|
4818
4844
|
);
|
|
4819
|
-
|
|
4845
|
+
b && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
4820
4846
|
renderCount: f.current,
|
|
4821
4847
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
4822
4848
|
filters: s
|
|
4823
4849
|
});
|
|
4824
|
-
const w =
|
|
4850
|
+
const w = B.useMemo(
|
|
4825
4851
|
() => ({
|
|
4826
4852
|
selectedChannel: t,
|
|
4827
4853
|
onChannelSelect: e,
|
|
4828
|
-
debug:
|
|
4854
|
+
debug: b,
|
|
4829
4855
|
channelPreview: u,
|
|
4830
4856
|
renderMessagePreview: g,
|
|
4831
4857
|
viewerLanguage: m
|
|
@@ -4833,7 +4859,7 @@ const ji = { last_message_at: -1 }, Ui = j.memo(
|
|
|
4833
4859
|
[
|
|
4834
4860
|
t,
|
|
4835
4861
|
e,
|
|
4836
|
-
|
|
4862
|
+
b,
|
|
4837
4863
|
u,
|
|
4838
4864
|
g,
|
|
4839
4865
|
m
|
|
@@ -4846,16 +4872,16 @@ const ji = { last_message_at: -1 }, Ui = j.memo(
|
|
|
4846
4872
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
4847
4873
|
o
|
|
4848
4874
|
),
|
|
4849
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
4875
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Bi, { value: w, children: /* @__PURE__ */ n(
|
|
4850
4876
|
Es,
|
|
4851
4877
|
{
|
|
4852
4878
|
filters: s,
|
|
4853
4879
|
sort: i,
|
|
4854
4880
|
options: { limit: 30 },
|
|
4855
4881
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
4856
|
-
channelRenderFilterFn:
|
|
4882
|
+
channelRenderFilterFn: c,
|
|
4857
4883
|
Paginator: d,
|
|
4858
|
-
Preview:
|
|
4884
|
+
Preview: jn,
|
|
4859
4885
|
EmptyStateIndicator: l
|
|
4860
4886
|
},
|
|
4861
4887
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
@@ -4864,8 +4890,8 @@ const ji = { last_message_at: -1 }, Ui = j.memo(
|
|
|
4864
4890
|
);
|
|
4865
4891
|
}
|
|
4866
4892
|
);
|
|
4867
|
-
|
|
4868
|
-
const
|
|
4893
|
+
Hi.displayName = "ChannelList";
|
|
4894
|
+
const Yi = ({
|
|
4869
4895
|
question: e,
|
|
4870
4896
|
onClick: t,
|
|
4871
4897
|
loading: s = !1,
|
|
@@ -4887,7 +4913,7 @@ const Vi = ({
|
|
|
4887
4913
|
),
|
|
4888
4914
|
children: e
|
|
4889
4915
|
}
|
|
4890
|
-
),
|
|
4916
|
+
), io = ({
|
|
4891
4917
|
faqs: e,
|
|
4892
4918
|
onFaqClick: t,
|
|
4893
4919
|
loadingFaqId: s,
|
|
@@ -4899,7 +4925,7 @@ const Vi = ({
|
|
|
4899
4925
|
const l = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
|
|
4900
4926
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4901
4927
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4902
|
-
|
|
4928
|
+
se,
|
|
4903
4929
|
{
|
|
4904
4930
|
id: o || "account",
|
|
4905
4931
|
name: o || "Account",
|
|
@@ -4916,7 +4942,7 @@ const Vi = ({
|
|
|
4916
4942
|
children: [
|
|
4917
4943
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4918
4944
|
l.map((d) => /* @__PURE__ */ n(
|
|
4919
|
-
|
|
4945
|
+
Yi,
|
|
4920
4946
|
{
|
|
4921
4947
|
question: d.question,
|
|
4922
4948
|
onClick: () => t(d.id),
|
|
@@ -4930,40 +4956,40 @@ const Vi = ({
|
|
|
4930
4956
|
] }) });
|
|
4931
4957
|
};
|
|
4932
4958
|
export {
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4959
|
+
bn as A,
|
|
4960
|
+
ao as B,
|
|
4961
|
+
Pi as C,
|
|
4962
|
+
Rr as D,
|
|
4963
|
+
ua as E,
|
|
4964
|
+
io as F,
|
|
4965
|
+
Qs as G,
|
|
4966
|
+
Jt as L,
|
|
4967
|
+
no as M,
|
|
4968
|
+
xe as a,
|
|
4969
|
+
se as b,
|
|
4970
|
+
Hi as c,
|
|
4971
|
+
$n as d,
|
|
4972
|
+
so as e,
|
|
4973
|
+
Yi as f,
|
|
4948
4974
|
oe as g,
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4975
|
+
Xt as h,
|
|
4976
|
+
we as i,
|
|
4977
|
+
$r as j,
|
|
4978
|
+
to as k,
|
|
4979
|
+
ro as l,
|
|
4980
|
+
Ja as m,
|
|
4981
|
+
Wa as n,
|
|
4982
|
+
Vi as o,
|
|
4983
|
+
Ka as p,
|
|
4984
|
+
hn as q,
|
|
4985
|
+
pe as r,
|
|
4986
|
+
wn as s,
|
|
4987
|
+
sa as t,
|
|
4988
|
+
ja as u,
|
|
4989
|
+
ma as v,
|
|
4964
4990
|
st as w,
|
|
4965
4991
|
ot as x,
|
|
4966
4992
|
lt as y,
|
|
4967
|
-
|
|
4993
|
+
un as z
|
|
4968
4994
|
};
|
|
4969
|
-
//# sourceMappingURL=index-
|
|
4995
|
+
//# sourceMappingURL=index-C4ipGbuZ.js.map
|