@linktr.ee/messaging-react 4.4.7 → 4.5.0-rc-1788297811
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/assets/index.css +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +58 -43
- package/dist/index.js +1167 -1033
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/AttachmentCard/MediaPlayer.test.tsx +9 -5
- package/src/components/AttachmentCard/Thumbnail.test.tsx +4 -0
- package/src/components/ChannelActionsMenu/ChannelActionsMenu.test.tsx +18 -10
- package/src/components/ChannelList/ChannelListContext.test.tsx +7 -5
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +7 -5
- package/src/components/ChannelList/index.test.tsx +1 -0
- package/src/components/ChannelView.test.tsx +20 -13
- package/src/components/CustomLinkPreviewList/CustomLinkPreviewList.test.tsx +4 -3
- package/src/components/CustomMessage/CustomMessage.test.tsx +6 -5
- package/src/components/CustomMessage/MessageTag.test.tsx +6 -0
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +19 -9
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +45 -5
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +6 -0
- package/src/components/CustomMessage/TipMessage/TipMessage.test.tsx +3 -0
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +16 -7
- package/src/components/FaqList/FaqList.test.tsx +20 -12
- package/src/components/LinkAttachment/LinkAttachment.test.tsx +27 -14
- package/src/components/LinkAttachment/components/_shared/BubbleTail.test.tsx +1 -0
- package/src/components/LinkAttachment/components/_shared/CardBody.test.tsx +6 -6
- package/src/components/LinkAttachment/components/_shared/CardCta.test.tsx +8 -5
- package/src/components/LinkAttachment/components/_shared/CardShell.test.tsx +7 -5
- package/src/components/LinkAttachment/components/_shared/CardThumbnail.test.tsx +3 -8
- package/src/components/MessageAttachment/Audio/AudioAttachment.stories.tsx +165 -58
- package/src/components/MessageAttachment/Audio/WaveformAudioRow.test.tsx +155 -0
- package/src/components/MessageAttachment/Audio/WaveformAudioRow.tsx +455 -0
- package/src/components/MessageAttachment/Audio/audioRowRequester.test.ts +24 -0
- package/src/components/MessageAttachment/Audio/audioRowRequester.ts +16 -0
- package/src/components/MessageAttachment/Audio/index.tsx +83 -79
- package/src/components/MessageAttachment/MessageAttachment.behavior.test.tsx +22 -15
- package/src/components/MessageAttachment/MessageAttachment.test.tsx +279 -134
- package/src/components/MessageAttachment/_shared/Bubble.test.tsx +2 -0
- package/src/components/MessageAttachment/_shared/CarouselNav.test.tsx +5 -4
- package/src/components/MessageAttachment/_shared/CompactDocumentRow.test.tsx +4 -3
- package/src/components/MessageAttachment/_shared/DismissButton.test.tsx +4 -3
- package/src/components/MessageAttachment/_shared/DownloadAction.test.tsx +8 -5
- package/src/components/MessageAttachment/_shared/ImageViewer.test.tsx +6 -3
- package/src/components/MessageAttachment/_shared/MediaStackGrid.test.tsx +11 -4
- package/src/components/MessageAttachment/_shared/PdfViewer.test.tsx +5 -3
- package/src/components/MessageAttachment/_shared/VideoViewer.test.tsx +12 -3
- package/src/components/MessageAttachment/_shared/ViewerShell.test.tsx +13 -6
- package/src/components/MessageAttachment/_shared/useCarousel.test.tsx +10 -4
- package/src/components/MessageAttachment/_shared/useIsClient.ts +23 -0
- package/src/components/MessageAttachment/index.tsx +25 -9
- package/src/components/MessageAttachment/types.ts +19 -9
- package/src/components/MessageBubble/MessageBubble.test.tsx +8 -0
- package/src/components/RichCard/RichCard.test.tsx +10 -2
- package/src/styles.css +120 -0
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { a as e, i as t, n, o as r, r as i, s as a } from "./AttachmentCard-DSekwIOA.js";
|
|
2
|
-
import o, { Suspense as s, createContext as c, useCallback as l, useContext as u, useEffect as d, useId as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { LinkPreviewsManager as
|
|
5
|
-
import { AIStates as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { MESSAGE_CUSTOM_TYPE as
|
|
8
|
-
import
|
|
9
|
-
import { ArrowLeftIcon as
|
|
10
|
-
import { DefaultDropdownActionButton as
|
|
2
|
+
import o, { Suspense as s, createContext as c, useCallback as l, useContext as u, useEffect as d, useId as f, useMemo as p, useRef as m, useState as h, useSyncExternalStore as g } from "react";
|
|
3
|
+
import { StreamChatService as _ } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { LinkPreviewsManager as v, StreamChat as y } from "stream-chat";
|
|
5
|
+
import { AIStates as b, Attachment as x, AttachmentPreviewList as S, Channel as C, ChannelList as w, Chat as T, DateSeparator as E, EditMessageModal as D, InfiniteScroll as O, MessageBlocked as k, MessageBounceModal as A, MessageBouncePrompt as j, MessageDeleted as M, MessageErrorIcon as N, MessageInput as P, MessageIsThreadReplyInChannelButtonIndicator as F, MessageList as I, MessageRepliesCountButton as L, MessageStatus as R, MessageText as z, MessageTimestamp as B, Poll as ee, QuotedMessagePreview as te, ReminderNotification as ne, StreamedMessageText as re, TextareaComposer as V, Window as ie, WithComponents as ae, areMessageUIPropsEqual as oe, displayDuration as se, isDateSeparatorMessage as ce, isMessageBlocked as le, isMessageBounced as ue, messageHasAttachments as de, messageHasReactions as fe, resampleWaveformData as pe, useAIState as me, useActiveAudioPlayer as he, useAudioPlayer as ge, useChannelStateContext as _e, useChatContext as ve, useComponentContext as ye, useMessageComposer as be, useMessageComposerHasSendableData as xe, useMessageContext as H, useMessageInputContext as U, useMessageReminder as Se, useStateStore as W, useTypingContext as Ce } from "stream-chat-react";
|
|
6
|
+
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
7
|
+
import { MESSAGE_CUSTOM_TYPE as J, OFFICIAL_SENDER_USER_ID as we, isAgeSafetySystemType as Te, isDmAgentSystemType as Ee, isOfficialChannel as Y, resolveRichCardImagePresentation as De, selectEnabledFaqs as Oe } from "@linktr.ee/messaging-taxonomy";
|
|
8
|
+
import X from "classnames";
|
|
9
|
+
import { ArrowLeftIcon as ke, ArrowUpIcon as Ae, CaretLeftIcon as je, CaretRightIcon as Me, ChecksIcon as Ne, CircleNotchIcon as Z, CurrencyDollarIcon as Pe, DotsThreeIcon as Fe, DownloadSimpleIcon as Ie, FlagIcon as Le, GiftIcon as Re, MegaphoneIcon as ze, PauseIcon as Be, PencilSimpleIcon as Ve, PlayIcon as He, ProhibitIcon as Ue, ProhibitInsetIcon as We, SignOutIcon as Ge, SparkleIcon as Ke, SpinnerGapIcon as qe, StarIcon as Je, TrashSimpleIcon as Ye, VideoCameraIcon as Xe, WarningCircleIcon as Ze, XIcon as Qe } from "@phosphor-icons/react";
|
|
10
|
+
import { DefaultDropdownActionButton as $e, MessageActions as et } from "stream-chat-react/experimental";
|
|
11
11
|
//#region src/logging/index.tsx
|
|
12
|
-
var
|
|
12
|
+
var tt = {
|
|
13
13
|
debug: (e, ...t) => console.log(e, ...t),
|
|
14
14
|
info: (e, ...t) => console.log(e, ...t),
|
|
15
15
|
warn: (e, ...t) => console.warn(e, ...t),
|
|
16
16
|
error: (e, ...t) => console.error(e, ...t)
|
|
17
|
-
},
|
|
18
|
-
debug: e?.debug ??
|
|
19
|
-
info: e?.info ??
|
|
20
|
-
warn: e?.warn ??
|
|
21
|
-
error: e?.error ??
|
|
22
|
-
}),
|
|
23
|
-
let n = p(() =>
|
|
24
|
-
return /* @__PURE__ */
|
|
17
|
+
}, nt = (e) => ({
|
|
18
|
+
debug: e?.debug ?? tt.debug,
|
|
19
|
+
info: e?.info ?? tt.info,
|
|
20
|
+
warn: e?.warn ?? tt.warn,
|
|
21
|
+
error: e?.error ?? tt.error
|
|
22
|
+
}), rt = c(tt), it = ({ logger: e, children: t }) => {
|
|
23
|
+
let n = p(() => nt(e), [e]);
|
|
24
|
+
return /* @__PURE__ */ K(rt.Provider, {
|
|
25
25
|
value: n,
|
|
26
26
|
children: t
|
|
27
27
|
});
|
|
28
|
-
},
|
|
28
|
+
}, at = () => u(rt), ot = c({
|
|
29
29
|
service: null,
|
|
30
30
|
client: null,
|
|
31
31
|
isConnected: !1,
|
|
@@ -34,7 +34,7 @@ var Xe = {
|
|
|
34
34
|
capabilities: {},
|
|
35
35
|
refreshConnection: async () => {},
|
|
36
36
|
debug: !1
|
|
37
|
-
}),
|
|
37
|
+
}), st = () => u(ot), ct = ({ children: e, user: t, serviceConfig: n, apiKey: r, capabilities: i = {}, debug: a = !1, client: s, logger: c }) => {
|
|
38
38
|
let u = l((e, ...t) => {
|
|
39
39
|
a && console.log(`🔥 [MessagingProvider] ${e}`, ...t);
|
|
40
40
|
}, [a]);
|
|
@@ -44,7 +44,7 @@ var Xe = {
|
|
|
44
44
|
serviceConfig: !!n,
|
|
45
45
|
capabilities: Object.keys(i)
|
|
46
46
|
});
|
|
47
|
-
let [f, p] = h(null), [
|
|
47
|
+
let [f, p] = h(null), [g, v] = h(null), [b, x] = h(!1), [S, C] = h(!1), [w, E] = h(null), D = m(!1), O = m(null), k = m(n);
|
|
48
48
|
k.current = n;
|
|
49
49
|
let A = m(a);
|
|
50
50
|
A.current = a;
|
|
@@ -77,13 +77,13 @@ var Xe = {
|
|
|
77
77
|
let P = m(null);
|
|
78
78
|
!s && r && P.current?.apiKey !== r && (P.current = {
|
|
79
79
|
apiKey: r,
|
|
80
|
-
client: new
|
|
80
|
+
client: new y(r)
|
|
81
81
|
});
|
|
82
82
|
let F = s || (r ? P.current?.client ?? null : null);
|
|
83
83
|
d(() => {
|
|
84
84
|
let e = N.current, t = k.current;
|
|
85
85
|
if (s) {
|
|
86
|
-
O.current = null, p(null),
|
|
86
|
+
O.current = null, p(null), v(null), x(!1), E(null), C(!1);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
if (!r || !F || !t) {
|
|
@@ -97,12 +97,12 @@ var Xe = {
|
|
|
97
97
|
renderCount: e,
|
|
98
98
|
apiKey: r?.substring(0, 8) + "..."
|
|
99
99
|
});
|
|
100
|
-
let n = new
|
|
100
|
+
let n = new _({
|
|
101
101
|
...t,
|
|
102
102
|
apiKey: r,
|
|
103
103
|
debug: A.current,
|
|
104
104
|
client: F,
|
|
105
|
-
...t.logger || !j.current ? {} : { logger:
|
|
105
|
+
...t.logger || !j.current ? {} : { logger: nt(j.current) }
|
|
106
106
|
});
|
|
107
107
|
O.current = n, p(n), u("✅ SERVICE SET", {
|
|
108
108
|
renderCount: e,
|
|
@@ -143,7 +143,7 @@ var Xe = {
|
|
|
143
143
|
try {
|
|
144
144
|
u("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
145
145
|
let e = await f.connectUser(t);
|
|
146
|
-
|
|
146
|
+
v(e), x(!0), I.current = {
|
|
147
147
|
serviceId: f,
|
|
148
148
|
userId: t.id
|
|
149
149
|
}, u("✅ USER CONNECTION SUCCESS", {
|
|
@@ -189,7 +189,7 @@ var Xe = {
|
|
|
189
189
|
try {
|
|
190
190
|
u("🔌 DISCONNECTING FOR REFRESH"), await f.disconnectUser(), u("📞 RECONNECTING FOR REFRESH");
|
|
191
191
|
let e = await f.connectUser(t);
|
|
192
|
-
|
|
192
|
+
v(e), x(!0), E(null), u("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
193
193
|
} catch (e) {
|
|
194
194
|
let n = e instanceof Error ? e.message : "Refresh failed";
|
|
195
195
|
E(n), u("❌ CONNECTION REFRESH ERROR", {
|
|
@@ -207,27 +207,27 @@ var Xe = {
|
|
|
207
207
|
s
|
|
208
208
|
]), R = o.useMemo(() => (u("💫 CONTEXT VALUE MEMOIZATION", {
|
|
209
209
|
hasService: !!f,
|
|
210
|
-
hasClient: !!
|
|
210
|
+
hasClient: !!g,
|
|
211
211
|
isConnected: b,
|
|
212
212
|
isLoading: S,
|
|
213
|
-
hasError: !!
|
|
213
|
+
hasError: !!w,
|
|
214
214
|
capabilitiesKeys: Object.keys(i)
|
|
215
215
|
}), {
|
|
216
216
|
service: s ? null : f,
|
|
217
|
-
client: s ??
|
|
217
|
+
client: s ?? g,
|
|
218
218
|
isConnected: s ? !0 : b,
|
|
219
219
|
isLoading: !s && S,
|
|
220
|
-
error: s ? null :
|
|
220
|
+
error: s ? null : w,
|
|
221
221
|
capabilities: i,
|
|
222
222
|
refreshConnection: L,
|
|
223
223
|
debug: a
|
|
224
224
|
}), [
|
|
225
225
|
f,
|
|
226
|
-
|
|
226
|
+
g,
|
|
227
227
|
s,
|
|
228
228
|
b,
|
|
229
229
|
S,
|
|
230
|
-
|
|
230
|
+
w,
|
|
231
231
|
i,
|
|
232
232
|
L,
|
|
233
233
|
a,
|
|
@@ -237,18 +237,18 @@ var Xe = {
|
|
|
237
237
|
renderCount: N.current,
|
|
238
238
|
willRenderChat: !!F,
|
|
239
239
|
contextValueReady: !!R
|
|
240
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ K(it, {
|
|
241
241
|
logger: c,
|
|
242
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ K(ot.Provider, {
|
|
243
243
|
value: R,
|
|
244
|
-
children: F ? /* @__PURE__ */
|
|
244
|
+
children: F ? /* @__PURE__ */ K(T, {
|
|
245
245
|
client: F,
|
|
246
246
|
customClasses: { channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]" },
|
|
247
247
|
children: e
|
|
248
248
|
}) : e
|
|
249
249
|
})
|
|
250
250
|
});
|
|
251
|
-
},
|
|
251
|
+
}, lt = () => st(), ut = (e) => {
|
|
252
252
|
let [t, n] = h(!!e?.state?.membership?.pinned_at);
|
|
253
253
|
return d(() => {
|
|
254
254
|
if (!e) {
|
|
@@ -266,30 +266,30 @@ var Xe = {
|
|
|
266
266
|
};
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/utils/resolveConversationParticipant.ts
|
|
269
|
-
function
|
|
269
|
+
function dt(e, t, n) {
|
|
270
270
|
let r = Object.values(e || {});
|
|
271
|
-
if (
|
|
272
|
-
let e = r.find((e) => e.user?.id ===
|
|
271
|
+
if (Y(n)) {
|
|
272
|
+
let e = r.find((e) => e.user?.id === we);
|
|
273
273
|
if (e) return e;
|
|
274
274
|
}
|
|
275
275
|
return r.find((e) => e.user?.id && e.user.id !== t);
|
|
276
276
|
}
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/utils/resolveParticipantDisplayName.ts
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var ft = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
280
|
+
function pt(e) {
|
|
281
|
+
return ft.test(e.trim());
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function mt(e, t) {
|
|
284
284
|
let n = e?.trim();
|
|
285
|
-
return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !
|
|
285
|
+
return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !pt(n);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
287
|
+
function ht(e) {
|
|
288
|
+
return mt(e?.name, e?.id) ? e.name.trim() : mt(e?.username, e?.id) ? e.username.trim() : "Unknown member";
|
|
289
289
|
}
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/components/Avatar/getAvatarEmoji.ts
|
|
292
|
-
var
|
|
292
|
+
var gt = [
|
|
293
293
|
{
|
|
294
294
|
emoji: "🍎",
|
|
295
295
|
bgColor: "#FFD1DD"
|
|
@@ -343,7 +343,7 @@ var dt = [
|
|
|
343
343
|
bgColor: "#D9F7E1"
|
|
344
344
|
}
|
|
345
345
|
];
|
|
346
|
-
function
|
|
346
|
+
function _t(e) {
|
|
347
347
|
let t = 0;
|
|
348
348
|
for (let n = 0; n < e.length; n++) {
|
|
349
349
|
let r = e.charCodeAt(n);
|
|
@@ -351,30 +351,30 @@ function ft(e) {
|
|
|
351
351
|
}
|
|
352
352
|
return Math.abs(t);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
354
|
+
function vt(e) {
|
|
355
|
+
return gt[_t(e) % gt.length];
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
357
|
+
function yt(e) {
|
|
358
|
+
return vt(e).emoji;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
360
|
+
function bt(e) {
|
|
361
|
+
return vt(e).bgColor;
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Avatar/index.tsx
|
|
365
|
-
var
|
|
366
|
-
let s =
|
|
365
|
+
var xt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape: a = "squircle", dmAgentEnabled: o = !1 }) => {
|
|
366
|
+
let s = yt(e), c = bt(e), l = n < 32 ? Math.round(n * .45) : n < 56 ? 14 : n < 120 ? 18 : 36, u = n >= 40 ? 2 : 1, d = a === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ K("div", {
|
|
367
367
|
"data-testid": "avatar-inner",
|
|
368
368
|
className: "h-full w-full overflow-hidden",
|
|
369
369
|
style: d,
|
|
370
|
-
children: t ? /* @__PURE__ */
|
|
370
|
+
children: t ? /* @__PURE__ */ K("img", {
|
|
371
371
|
src: t,
|
|
372
372
|
alt: "",
|
|
373
373
|
className: "h-full w-full object-cover"
|
|
374
|
-
}) : /* @__PURE__ */
|
|
374
|
+
}) : /* @__PURE__ */ K("div", {
|
|
375
375
|
"aria-hidden": "true",
|
|
376
376
|
"data-testid": "avatar-fallback",
|
|
377
|
-
className:
|
|
377
|
+
className: X("avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"),
|
|
378
378
|
style: {
|
|
379
379
|
fontSize: l,
|
|
380
380
|
lineHeight: 1
|
|
@@ -382,9 +382,9 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
382
382
|
children: s
|
|
383
383
|
})
|
|
384
384
|
});
|
|
385
|
-
return /* @__PURE__ */
|
|
385
|
+
return /* @__PURE__ */ q("div", {
|
|
386
386
|
"data-testid": "avatar",
|
|
387
|
-
className:
|
|
387
|
+
className: X("relative flex-shrink-0", r),
|
|
388
388
|
style: {
|
|
389
389
|
"--str-chat__avatar-size": `${n}px`,
|
|
390
390
|
width: `${n}px`,
|
|
@@ -392,17 +392,17 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
392
392
|
backgroundColor: t ? void 0 : c,
|
|
393
393
|
...d
|
|
394
394
|
},
|
|
395
|
-
children: [i && /* @__PURE__ */
|
|
395
|
+
children: [i && /* @__PURE__ */ K("div", {
|
|
396
396
|
"aria-hidden": "true",
|
|
397
397
|
"data-testid": "avatar-star",
|
|
398
398
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
399
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ K(Je, {
|
|
400
400
|
className: "size-3 text-yellow-600",
|
|
401
401
|
weight: "duotone"
|
|
402
402
|
})
|
|
403
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ K("div", {
|
|
404
404
|
"data-testid": "avatar-ring",
|
|
405
|
-
className:
|
|
405
|
+
className: X("h-full w-full", "bg-transparent"),
|
|
406
406
|
style: {
|
|
407
407
|
...d,
|
|
408
408
|
...o && {
|
|
@@ -415,8 +415,8 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
415
415
|
children: f
|
|
416
416
|
})]
|
|
417
417
|
});
|
|
418
|
-
},
|
|
419
|
-
let { service: f, debug: p } =
|
|
418
|
+
}, St = "https://linktr.ee/s/about/trust-center/report", Ct = ({ channel: e, participant: t, showBlockParticipant: n = !0, enabled: r = !0, onLeaveConversation: i, onBlockParticipant: a, onDeleteConversationClick: o, onBlockParticipantClick: s, onReportParticipantClick: c, onActionComplete: l, logLabel: u = "useChannelModerationActions" }) => {
|
|
419
|
+
let { service: f, debug: p } = st(), m = t?.user?.id, g = !!(r && n && f && m), [_, v] = h(!1), [y, b] = h(null), [x, S] = h(!1), [C, w] = h(!1), T = g && (y?.participantId !== m || y?.service !== f);
|
|
420
420
|
return d(() => {
|
|
421
421
|
if (!g || !f || !m) {
|
|
422
422
|
v(!1), b(null);
|
|
@@ -487,16 +487,16 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
487
487
|
}
|
|
488
488
|
},
|
|
489
489
|
handleReportUser: () => {
|
|
490
|
-
c?.(), l?.(), window.open(
|
|
490
|
+
c?.(), l?.(), window.open(St, "_blank", "noopener,noreferrer");
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
},
|
|
493
|
+
}, wt = ({ variant: e = "default", className: t, children: n, ...r }) => /* @__PURE__ */ K("button", {
|
|
494
494
|
type: "button",
|
|
495
|
-
className:
|
|
495
|
+
className: X("flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60", e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand", t),
|
|
496
496
|
...r,
|
|
497
497
|
children: n
|
|
498
|
-
}),
|
|
499
|
-
let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } =
|
|
498
|
+
}), Tt = ({ channel: e, participant: t, showDeleteConversation: n = !0, showBlockParticipant: r = !0, showReportParticipant: i = !0, onLeaveConversation: a, onBlockParticipant: o, onDeleteConversationClick: s, onBlockParticipantClick: c, onReportParticipantClick: u, customChannelActions: p, triggerClassName: g }) => {
|
|
499
|
+
let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } = Ct({
|
|
500
500
|
channel: e,
|
|
501
501
|
participant: t,
|
|
502
502
|
showBlockParticipant: r,
|
|
@@ -519,106 +519,106 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
519
519
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
520
520
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
521
521
|
};
|
|
522
|
-
}, [_]), !t || !(n || r || i || p) ? null : /* @__PURE__ */
|
|
522
|
+
}, [_]), !t || !(n || r || i || p) ? null : /* @__PURE__ */ q("div", {
|
|
523
523
|
ref: y,
|
|
524
524
|
className: "relative",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ q("button", {
|
|
526
526
|
className: g,
|
|
527
527
|
type: "button",
|
|
528
528
|
"aria-haspopup": "true",
|
|
529
529
|
"aria-expanded": _,
|
|
530
530
|
"aria-controls": _ ? b : void 0,
|
|
531
531
|
onClick: () => v((e) => !e),
|
|
532
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ K(Fe, { className: "size-5 text-black/90" }), /* @__PURE__ */ K("span", {
|
|
533
533
|
className: "sr-only",
|
|
534
534
|
children: "More options"
|
|
535
535
|
})]
|
|
536
|
-
}), _ && /* @__PURE__ */
|
|
536
|
+
}), _ && /* @__PURE__ */ K("div", {
|
|
537
537
|
id: b,
|
|
538
538
|
"aria-label": "Conversation options",
|
|
539
|
-
className:
|
|
540
|
-
children: /* @__PURE__ */
|
|
539
|
+
className: X("absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden", "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"),
|
|
540
|
+
children: /* @__PURE__ */ q("ul", {
|
|
541
541
|
className: "flex flex-col gap-1",
|
|
542
542
|
children: [
|
|
543
|
-
n && /* @__PURE__ */
|
|
543
|
+
n && /* @__PURE__ */ K("li", { children: /* @__PURE__ */ q(wt, {
|
|
544
544
|
onClick: T,
|
|
545
545
|
disabled: C,
|
|
546
546
|
"aria-busy": C,
|
|
547
|
-
children: [C ? /* @__PURE__ */
|
|
547
|
+
children: [C ? /* @__PURE__ */ K(qe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ K(Ge, { className: "h-5 w-5" }), /* @__PURE__ */ K("span", { children: "Delete Conversation" })]
|
|
548
548
|
}) }),
|
|
549
|
-
r && /* @__PURE__ */
|
|
549
|
+
r && /* @__PURE__ */ K("li", { children: S ? /* @__PURE__ */ q(wt, {
|
|
550
550
|
disabled: !0,
|
|
551
551
|
"aria-busy": !0,
|
|
552
|
-
children: [/* @__PURE__ */
|
|
553
|
-
}) : x ? /* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ K(qe, { className: "h-5 w-5 animate-spin" }), /* @__PURE__ */ K("span", { children: "Block" })]
|
|
553
|
+
}) : x ? /* @__PURE__ */ q(wt, {
|
|
554
554
|
onClick: D,
|
|
555
555
|
disabled: w,
|
|
556
556
|
"aria-busy": w,
|
|
557
|
-
children: [w ? /* @__PURE__ */
|
|
558
|
-
}) : /* @__PURE__ */
|
|
557
|
+
children: [w ? /* @__PURE__ */ K(qe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ K(We, { className: "h-5 w-5" }), /* @__PURE__ */ K("span", { children: "Unblock" })]
|
|
558
|
+
}) : /* @__PURE__ */ q(wt, {
|
|
559
559
|
onClick: E,
|
|
560
560
|
disabled: w,
|
|
561
561
|
"aria-busy": w,
|
|
562
|
-
children: [w ? /* @__PURE__ */
|
|
562
|
+
children: [w ? /* @__PURE__ */ K(qe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ K(We, { className: "h-5 w-5" }), /* @__PURE__ */ K("span", { children: "Block" })]
|
|
563
563
|
}) }),
|
|
564
|
-
i && /* @__PURE__ */
|
|
564
|
+
i && /* @__PURE__ */ K("li", { children: /* @__PURE__ */ q(wt, {
|
|
565
565
|
variant: "danger",
|
|
566
566
|
onClick: O,
|
|
567
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ K(Le, { className: "h-5 w-5" }), /* @__PURE__ */ K("span", { children: "Report" })]
|
|
568
568
|
}) }),
|
|
569
569
|
p
|
|
570
570
|
]
|
|
571
571
|
})
|
|
572
572
|
})]
|
|
573
573
|
});
|
|
574
|
-
},
|
|
575
|
-
let { channel: _ } =
|
|
574
|
+
}, Et = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Dt = "CUSTOMER_PAID", Ot = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Dt, kt = ({ className: e, onBack: t, showBackButton: n, showStarButton: r = !1, onLeaveConversation: i, onBlockParticipant: a, showDeleteConversation: s = !0, showBlockParticipant: c = !0, showReportParticipant: l = !0, onDeleteConversationClick: u, onBlockParticipantClick: d, onReportParticipantClick: f, customChannelActions: p, renderChannelActions: m, showChannelInfo: h = !0, onParticipantNameClick: g }) => {
|
|
575
|
+
let { channel: _ } = _e(), { client: v } = ve(), y = o.useMemo(() => dt(_.state?.members, v?.userID, _.type), [
|
|
576
576
|
_.state?.members,
|
|
577
577
|
v?.userID,
|
|
578
578
|
_.type
|
|
579
|
-
]), b =
|
|
579
|
+
]), b = ht(y?.user), x = y?.user?.image, S = ut(_), C = Ot(_.data?.customer_tag) && y?.is_follower === !0, w = r && S, T = C || w || !!g, E = async () => {
|
|
580
580
|
try {
|
|
581
581
|
S ? await _.unpin() : await _.pin();
|
|
582
582
|
} catch (e) {
|
|
583
583
|
console.error("[ChannelHeaderRedesign] Failed to update pinned status:", e);
|
|
584
584
|
}
|
|
585
|
-
}, D = /* @__PURE__ */ G
|
|
585
|
+
}, D = /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(xt, {
|
|
586
586
|
id: y?.user?.id || _.id || "unknown",
|
|
587
587
|
name: b,
|
|
588
588
|
image: x,
|
|
589
589
|
shape: "circle",
|
|
590
590
|
size: 48,
|
|
591
591
|
className: "-mb-2"
|
|
592
|
-
}), /* @__PURE__ */
|
|
593
|
-
className:
|
|
594
|
-
children: /* @__PURE__ */
|
|
592
|
+
}), /* @__PURE__ */ K("span", {
|
|
593
|
+
className: X("relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-filter duration-150 group-hover:brightness-95", T ? "pl-3 pr-2" : "px-3"),
|
|
594
|
+
children: /* @__PURE__ */ q("span", {
|
|
595
595
|
className: "flex max-w-full items-center justify-center",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ K("span", {
|
|
597
597
|
className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90",
|
|
598
598
|
children: b
|
|
599
|
-
}), T && /* @__PURE__ */
|
|
599
|
+
}), T && /* @__PURE__ */ q("span", {
|
|
600
600
|
className: "ml-2 flex gap-1",
|
|
601
601
|
children: [
|
|
602
|
-
C && /* @__PURE__ */
|
|
602
|
+
C && /* @__PURE__ */ K("span", {
|
|
603
603
|
"aria-label": "Paid customer",
|
|
604
604
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
605
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ K(Pe, {
|
|
606
606
|
className: "size-2.5",
|
|
607
607
|
weight: "bold"
|
|
608
608
|
})
|
|
609
609
|
}),
|
|
610
|
-
w && /* @__PURE__ */
|
|
610
|
+
w && /* @__PURE__ */ K("span", {
|
|
611
611
|
className: "messaging-header-star-badge flex overflow-hidden",
|
|
612
|
-
children: /* @__PURE__ */
|
|
612
|
+
children: /* @__PURE__ */ K("span", {
|
|
613
613
|
"aria-label": "Starred conversation",
|
|
614
614
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
615
|
-
children: /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ K(Je, {
|
|
616
616
|
className: "size-2.5",
|
|
617
617
|
weight: "fill"
|
|
618
618
|
})
|
|
619
619
|
})
|
|
620
620
|
}),
|
|
621
|
-
g && /* @__PURE__ */
|
|
621
|
+
g && /* @__PURE__ */ K(Me, {
|
|
622
622
|
"aria-hidden": "true",
|
|
623
623
|
className: "size-4 shrink-0 text-black/65",
|
|
624
624
|
weight: "bold"
|
|
@@ -627,51 +627,51 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
627
627
|
})]
|
|
628
628
|
})
|
|
629
629
|
})] });
|
|
630
|
-
return /* @__PURE__ */
|
|
631
|
-
className:
|
|
632
|
-
children: /* @__PURE__ */
|
|
630
|
+
return /* @__PURE__ */ K("div", {
|
|
631
|
+
className: X("@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]", e),
|
|
632
|
+
children: /* @__PURE__ */ q("div", {
|
|
633
633
|
className: "grid min-h-[100px] grid-cols-[minmax(40px,1fr)_auto_minmax(40px,1fr)] items-start pb-2 pt-5 @lg:min-h-[104px] @lg:pt-6",
|
|
634
634
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ K("div", {
|
|
636
636
|
className: "flex items-start",
|
|
637
|
-
children: n && /* @__PURE__ */
|
|
638
|
-
className:
|
|
637
|
+
children: n && /* @__PURE__ */ K("button", {
|
|
638
|
+
className: X(Et, "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"),
|
|
639
639
|
onClick: t || (() => {}),
|
|
640
640
|
type: "button",
|
|
641
641
|
"aria-label": "Back to conversations",
|
|
642
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ K(ke, { className: "size-5 text-black/90" })
|
|
643
643
|
})
|
|
644
644
|
}),
|
|
645
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ K("div", {
|
|
646
646
|
className: "flex min-w-0 justify-center",
|
|
647
647
|
"data-dd-privacy": "mask",
|
|
648
|
-
children: g ? /* @__PURE__ */
|
|
648
|
+
children: g ? /* @__PURE__ */ K("button", {
|
|
649
649
|
type: "button",
|
|
650
650
|
onClick: g,
|
|
651
651
|
"aria-label": `View details for ${b}`,
|
|
652
652
|
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
653
653
|
children: D
|
|
654
|
-
}) : /* @__PURE__ */
|
|
654
|
+
}) : /* @__PURE__ */ K("div", {
|
|
655
655
|
className: "flex min-w-0 max-w-full flex-col items-center px-2",
|
|
656
656
|
children: D
|
|
657
657
|
})
|
|
658
658
|
}),
|
|
659
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ q("div", {
|
|
660
660
|
className: "flex items-start justify-end gap-2",
|
|
661
|
-
children: [r && /* @__PURE__ */
|
|
662
|
-
className:
|
|
661
|
+
children: [r && /* @__PURE__ */ K("button", {
|
|
662
|
+
className: Et,
|
|
663
663
|
onClick: E,
|
|
664
664
|
type: "button",
|
|
665
665
|
"aria-pressed": S,
|
|
666
666
|
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
667
|
-
children: /* @__PURE__ */
|
|
668
|
-
className:
|
|
667
|
+
children: /* @__PURE__ */ K(Je, {
|
|
668
|
+
className: X("size-5", {
|
|
669
669
|
"text-[#FFD60A]": S,
|
|
670
670
|
"text-black/90": !S
|
|
671
671
|
}),
|
|
672
672
|
weight: S ? "fill" : "regular"
|
|
673
673
|
})
|
|
674
|
-
}), h && (m === void 0 ? /* @__PURE__ */
|
|
674
|
+
}), h && (m === void 0 ? /* @__PURE__ */ K(Tt, {
|
|
675
675
|
channel: _,
|
|
676
676
|
participant: y,
|
|
677
677
|
showDeleteConversation: s,
|
|
@@ -683,48 +683,48 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
683
683
|
onBlockParticipantClick: d,
|
|
684
684
|
onReportParticipantClick: f,
|
|
685
685
|
customChannelActions: p,
|
|
686
|
-
triggerClassName:
|
|
686
|
+
triggerClassName: Et
|
|
687
687
|
}) : m)]
|
|
688
688
|
})
|
|
689
689
|
]
|
|
690
690
|
})
|
|
691
691
|
});
|
|
692
|
-
},
|
|
692
|
+
}, At = (e) => /* @__PURE__ */ K(E, {
|
|
693
693
|
...e,
|
|
694
694
|
position: "center"
|
|
695
695
|
});
|
|
696
696
|
//#endregion
|
|
697
697
|
//#region src/utils/getMessageDisplayText.ts
|
|
698
|
-
function
|
|
698
|
+
function jt(e) {
|
|
699
699
|
return e?.trim().toLowerCase().split(/[-_]/)[0] || void 0;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
let n = e?.text, r =
|
|
701
|
+
function Mt({ message: e, viewerLanguage: t }) {
|
|
702
|
+
let n = e?.text, r = jt(t);
|
|
703
703
|
return r ? e?.i18n?.[`${r}_text`] ?? n : n;
|
|
704
704
|
}
|
|
705
705
|
//#endregion
|
|
706
706
|
//#region src/components/LinkAttachment/components/_shared/normalizeExternalHref.ts
|
|
707
|
-
var
|
|
707
|
+
var Nt = /^([a-z][a-z0-9+.-]*):/i, Pt = /* @__PURE__ */ new Set([
|
|
708
708
|
"http",
|
|
709
709
|
"https",
|
|
710
710
|
"mailto",
|
|
711
711
|
"tel",
|
|
712
712
|
"sms"
|
|
713
713
|
]);
|
|
714
|
-
function
|
|
714
|
+
function Ft(e) {
|
|
715
715
|
if (typeof e != "string") return;
|
|
716
716
|
let t = e.trim();
|
|
717
717
|
if (t === "") return;
|
|
718
|
-
let n =
|
|
718
|
+
let n = Nt.exec(t);
|
|
719
719
|
if (n) {
|
|
720
720
|
let e = n[1].toLowerCase();
|
|
721
|
-
return
|
|
721
|
+
return Pt.has(e) ? t : void 0;
|
|
722
722
|
}
|
|
723
723
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
724
724
|
}
|
|
725
725
|
//#endregion
|
|
726
726
|
//#region src/components/LinkAttachment/components/_shared/CardCta.tsx
|
|
727
|
-
var
|
|
727
|
+
var It = {
|
|
728
728
|
dark: {
|
|
729
729
|
primary: "bg-white text-[#121110] hover:bg-white/90",
|
|
730
730
|
secondary: "bg-white/15 text-white hover:bg-white/25"
|
|
@@ -733,12 +733,12 @@ var jt = {
|
|
|
733
733
|
primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
|
|
734
734
|
secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
|
|
735
735
|
}
|
|
736
|
-
},
|
|
737
|
-
let i = t.variant ?? "primary", a =
|
|
736
|
+
}, Lt = ({ variant: e, cta: t, fullWidth: n = !0, standalone: r = !1 }) => {
|
|
737
|
+
let i = t.variant ?? "primary", a = X("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2", It[e][i]), o = n ? t.label : /* @__PURE__ */ K("span", {
|
|
738
738
|
className: "min-w-0 truncate",
|
|
739
739
|
children: t.label
|
|
740
|
-
}), s =
|
|
741
|
-
return s ? /* @__PURE__ */
|
|
740
|
+
}), s = Ft(t.href);
|
|
741
|
+
return s ? /* @__PURE__ */ K("a", {
|
|
742
742
|
href: s,
|
|
743
743
|
target: "_blank",
|
|
744
744
|
rel: "noopener noreferrer",
|
|
@@ -747,7 +747,7 @@ var jt = {
|
|
|
747
747
|
},
|
|
748
748
|
className: `${a} no-underline`,
|
|
749
749
|
children: o
|
|
750
|
-
}) : /* @__PURE__ */
|
|
750
|
+
}) : /* @__PURE__ */ K("button", {
|
|
751
751
|
type: "button",
|
|
752
752
|
onClick: (e) => {
|
|
753
753
|
e.stopPropagation(), t.onClick?.();
|
|
@@ -755,32 +755,32 @@ var jt = {
|
|
|
755
755
|
className: a,
|
|
756
756
|
children: o
|
|
757
757
|
});
|
|
758
|
-
},
|
|
758
|
+
}, Rt = {
|
|
759
759
|
dark: "text-white",
|
|
760
760
|
light: "text-black/90"
|
|
761
|
-
},
|
|
761
|
+
}, zt = "text-white/30", Bt = {
|
|
762
762
|
dark: "text-white/55",
|
|
763
763
|
light: "text-black/55"
|
|
764
|
-
},
|
|
764
|
+
}, Vt = {
|
|
765
765
|
dark: "bg-white/25",
|
|
766
766
|
light: "bg-black/15"
|
|
767
|
-
},
|
|
767
|
+
}, Ht = ({ variant: e, ctaSurface: t, chinTextColor: n, title: r, placeholderTitle: i, description: a, descriptionLines: o = 1, url: s, appIcon: c, cta: l, trailingAction: u, isLoading: d = !1 }) => {
|
|
768
768
|
let f = e === "dark", p = r ?? (f ? i : void 0) ?? "", m = p.trim() !== "", h = a != null && a.trim() !== "", g = typeof s == "string" ? s.trim() : "", _ = g !== "", v = l != null;
|
|
769
769
|
if (!d && !m && !h && !_ && !v) return null;
|
|
770
|
-
let y =
|
|
770
|
+
let y = X("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ? zt : Rt[e])), b = X("truncate text-[12px] leading-4 tracking-[0.24px]", n == null && Bt[e]), x = X("text-[12px] leading-4 tracking-[0.24px]", o <= 1 && "truncate", n == null && Bt[e]);
|
|
771
771
|
if (d) {
|
|
772
|
-
let t =
|
|
773
|
-
return /* @__PURE__ */
|
|
772
|
+
let t = X("animate-pulse rounded", Vt[e]);
|
|
773
|
+
return /* @__PURE__ */ K("div", {
|
|
774
774
|
className: "shrink-0 px-4 py-3",
|
|
775
|
-
children: /* @__PURE__ */
|
|
775
|
+
children: /* @__PURE__ */ q("div", {
|
|
776
776
|
className: "flex min-w-0 flex-col gap-[2px]",
|
|
777
|
-
children: [/* @__PURE__ */
|
|
777
|
+
children: [/* @__PURE__ */ K("div", {
|
|
778
778
|
"data-testid": "card-body-skeleton-bar",
|
|
779
|
-
className:
|
|
779
|
+
className: X("h-5 w-3/4", t),
|
|
780
780
|
"aria-hidden": !0
|
|
781
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ K("div", {
|
|
782
782
|
"data-testid": "card-body-skeleton-bar",
|
|
783
|
-
className:
|
|
783
|
+
className: X("h-4 w-1/2", t),
|
|
784
784
|
"aria-hidden": !0
|
|
785
785
|
})]
|
|
786
786
|
})
|
|
@@ -793,56 +793,56 @@ var jt = {
|
|
|
793
793
|
WebkitLineClamp: o,
|
|
794
794
|
overflow: "hidden"
|
|
795
795
|
} : S;
|
|
796
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ q("div", {
|
|
797
797
|
className: "shrink-0 px-4 py-3",
|
|
798
|
-
children: [/* @__PURE__ */
|
|
798
|
+
children: [/* @__PURE__ */ q("div", {
|
|
799
799
|
className: "flex items-end gap-3",
|
|
800
|
-
children: [/* @__PURE__ */
|
|
800
|
+
children: [/* @__PURE__ */ q("div", {
|
|
801
801
|
className: "flex min-w-0 flex-1 flex-col gap-[2px]",
|
|
802
802
|
children: [
|
|
803
|
-
m && /* @__PURE__ */
|
|
803
|
+
m && /* @__PURE__ */ q("div", {
|
|
804
804
|
className: "flex min-w-0 items-center gap-2",
|
|
805
|
-
children: [c ? /* @__PURE__ */
|
|
805
|
+
children: [c ? /* @__PURE__ */ K("span", {
|
|
806
806
|
className: "shrink-0",
|
|
807
807
|
children: c
|
|
808
|
-
}) : null, /* @__PURE__ */
|
|
809
|
-
className:
|
|
808
|
+
}) : null, /* @__PURE__ */ K("p", {
|
|
809
|
+
className: X("min-w-0", y),
|
|
810
810
|
style: S,
|
|
811
811
|
children: p
|
|
812
812
|
})]
|
|
813
813
|
}),
|
|
814
|
-
h && /* @__PURE__ */
|
|
814
|
+
h && /* @__PURE__ */ K("p", {
|
|
815
815
|
className: x,
|
|
816
816
|
style: C,
|
|
817
817
|
children: a
|
|
818
818
|
}),
|
|
819
|
-
!v && _ && /* @__PURE__ */
|
|
819
|
+
!v && _ && /* @__PURE__ */ K("p", {
|
|
820
820
|
className: b,
|
|
821
821
|
style: S,
|
|
822
822
|
"data-testid": "link-attachment-url",
|
|
823
823
|
children: g
|
|
824
824
|
})
|
|
825
825
|
]
|
|
826
|
-
}), u && /* @__PURE__ */
|
|
826
|
+
}), u && /* @__PURE__ */ K("div", {
|
|
827
827
|
className: "shrink-0",
|
|
828
828
|
children: u
|
|
829
829
|
})]
|
|
830
|
-
}), l && /* @__PURE__ */
|
|
830
|
+
}), l && /* @__PURE__ */ K(Lt, {
|
|
831
831
|
variant: t ?? e,
|
|
832
832
|
cta: l
|
|
833
833
|
})]
|
|
834
834
|
});
|
|
835
|
-
},
|
|
836
|
-
let f =
|
|
835
|
+
}, Ut = "Loading link preview", Wt = X("relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden", "rounded-[20px]"), Gt = "flex h-[250px] flex-col", Kt = ({ variant: e, children: t, href: n, onClick: r, ariaLabel: i, rootRef: a, topRight: o, bgClassName: s, accentHex: c, fixedHeight: l = !1, busy: u = !1, "data-testid": d = "link-card" }) => {
|
|
836
|
+
let f = X("messaging-link-card", Wt, l ? Gt : "block", s ?? (e === "dark" ? "bg-[#1e2330]" : "bg-[#f1f0ee]"), n != null || r != null ? "cursor-pointer no-underline focus-ring" : null), p = u ? {
|
|
837
837
|
role: "status",
|
|
838
838
|
"aria-busy": !0,
|
|
839
|
-
"aria-label":
|
|
840
|
-
} : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */
|
|
839
|
+
"aria-label": Ut
|
|
840
|
+
} : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */ K("div", {
|
|
841
841
|
"data-testid": "card-shell-top-right",
|
|
842
842
|
className: "pointer-events-auto absolute right-3 top-3 z-10",
|
|
843
843
|
children: o
|
|
844
844
|
}) : null;
|
|
845
|
-
return n ? /* @__PURE__ */
|
|
845
|
+
return n ? /* @__PURE__ */ q("a", {
|
|
846
846
|
ref: a,
|
|
847
847
|
href: n,
|
|
848
848
|
target: "_blank",
|
|
@@ -854,18 +854,18 @@ var jt = {
|
|
|
854
854
|
style: m,
|
|
855
855
|
...p,
|
|
856
856
|
children: [t, h]
|
|
857
|
-
}) : r ? /* @__PURE__ */
|
|
857
|
+
}) : r ? /* @__PURE__ */ q("button", {
|
|
858
858
|
ref: a,
|
|
859
859
|
type: "button",
|
|
860
860
|
onClick: r,
|
|
861
861
|
"aria-label": i,
|
|
862
862
|
"data-testid": d,
|
|
863
863
|
"data-variant": e,
|
|
864
|
-
className:
|
|
864
|
+
className: X(f, "text-left"),
|
|
865
865
|
style: m,
|
|
866
866
|
...p,
|
|
867
867
|
children: [t, h]
|
|
868
|
-
}) : /* @__PURE__ */
|
|
868
|
+
}) : /* @__PURE__ */ q("div", {
|
|
869
869
|
ref: a,
|
|
870
870
|
"data-testid": d,
|
|
871
871
|
"data-variant": e,
|
|
@@ -874,38 +874,38 @@ var jt = {
|
|
|
874
874
|
...p,
|
|
875
875
|
children: [t, h]
|
|
876
876
|
});
|
|
877
|
-
},
|
|
877
|
+
}, qt = {
|
|
878
878
|
dark: "bg-white/10",
|
|
879
879
|
light: "bg-black/5"
|
|
880
|
-
},
|
|
880
|
+
}, Jt = {
|
|
881
881
|
dark: "size-16 text-white/25",
|
|
882
882
|
light: "size-16 text-black/25"
|
|
883
|
-
},
|
|
883
|
+
}, Yt = (e, n) => !!n && !!e && t(e) === "audio", Xt = (e, n) => {
|
|
884
884
|
if (!n || !e) return !1;
|
|
885
885
|
let r = t(e);
|
|
886
886
|
return r === "video" || r === "audio";
|
|
887
|
-
},
|
|
887
|
+
}, Zt = "bg-[#F2F3F4]", Qt = ({ variant: r, thumbnailUrl: i, sourceUrl: o, title: s, mimeType: c = "image/*", topLeft: l, topRight: u, isLoading: d = !1, onImageError: f }) => {
|
|
888
888
|
let p = t(c), m = !!o && p === "video", h = a(i);
|
|
889
|
-
return !d &&
|
|
889
|
+
return !d && Yt(c, o) ? /* @__PURE__ */ K("div", {
|
|
890
890
|
className: "p-3",
|
|
891
|
-
children: /* @__PURE__ */
|
|
891
|
+
children: /* @__PURE__ */ K("audio", {
|
|
892
892
|
...e,
|
|
893
893
|
"data-testid": "card-thumbnail-audio",
|
|
894
894
|
src: o,
|
|
895
895
|
controls: !0,
|
|
896
896
|
preload: "metadata",
|
|
897
897
|
className: "block w-full",
|
|
898
|
-
children: /* @__PURE__ */
|
|
898
|
+
children: /* @__PURE__ */ K("track", { kind: "captions" })
|
|
899
899
|
})
|
|
900
|
-
}) : /* @__PURE__ */
|
|
900
|
+
}) : /* @__PURE__ */ q("div", {
|
|
901
901
|
"data-testid": "card-thumbnail-hero",
|
|
902
|
-
className:
|
|
902
|
+
className: X("relative min-h-0 w-full flex-1 overflow-hidden", m && "bg-black"),
|
|
903
903
|
children: [
|
|
904
|
-
d ? /* @__PURE__ */
|
|
904
|
+
d ? /* @__PURE__ */ K("div", {
|
|
905
905
|
"data-testid": "card-thumbnail-skeleton",
|
|
906
|
-
className:
|
|
906
|
+
className: X("h-full w-full animate-pulse", qt[r]),
|
|
907
907
|
"aria-hidden": !0
|
|
908
|
-
}) : m ? /* @__PURE__ */ G
|
|
908
|
+
}) : m ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("video", {
|
|
909
909
|
"data-testid": "card-thumbnail-video",
|
|
910
910
|
src: o,
|
|
911
911
|
poster: h,
|
|
@@ -913,14 +913,14 @@ var jt = {
|
|
|
913
913
|
playsInline: !0,
|
|
914
914
|
preload: "metadata",
|
|
915
915
|
className: "absolute inset-0 h-full w-full object-contain",
|
|
916
|
-
children: /* @__PURE__ */
|
|
917
|
-
}), h && f ? /* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ K("track", { kind: "captions" })
|
|
917
|
+
}), h && f ? /* @__PURE__ */ K("img", {
|
|
918
918
|
src: h,
|
|
919
919
|
alt: "",
|
|
920
920
|
"aria-hidden": !0,
|
|
921
921
|
onError: f,
|
|
922
922
|
className: "hidden"
|
|
923
|
-
}) : null] }) : i ? /* @__PURE__ */
|
|
923
|
+
}) : null] }) : i ? /* @__PURE__ */ K("img", {
|
|
924
924
|
src: h ?? i,
|
|
925
925
|
alt: s ?? "",
|
|
926
926
|
draggable: !1,
|
|
@@ -928,45 +928,45 @@ var jt = {
|
|
|
928
928
|
decoding: "async",
|
|
929
929
|
onError: f,
|
|
930
930
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
931
|
-
}) : /* @__PURE__ */
|
|
931
|
+
}) : /* @__PURE__ */ K("div", {
|
|
932
932
|
"data-testid": "card-thumbnail-placeholder",
|
|
933
|
-
className:
|
|
933
|
+
className: X("flex h-full w-full items-center justify-center", qt[r]),
|
|
934
934
|
children: n(c, {
|
|
935
|
-
className:
|
|
935
|
+
className: Jt[r],
|
|
936
936
|
weight: "regular"
|
|
937
937
|
})
|
|
938
938
|
}),
|
|
939
|
-
l ? /* @__PURE__ */
|
|
939
|
+
l ? /* @__PURE__ */ K("div", {
|
|
940
940
|
"data-testid": "card-thumbnail-top-left",
|
|
941
941
|
className: "pointer-events-auto absolute left-3 top-3 z-10",
|
|
942
942
|
children: l
|
|
943
943
|
}) : null,
|
|
944
|
-
u ? /* @__PURE__ */
|
|
944
|
+
u ? /* @__PURE__ */ K("div", {
|
|
945
945
|
"data-testid": "card-thumbnail-top-right",
|
|
946
946
|
className: "pointer-events-auto absolute right-3 top-3 z-10",
|
|
947
947
|
children: u
|
|
948
948
|
}) : null
|
|
949
949
|
]
|
|
950
950
|
});
|
|
951
|
-
},
|
|
952
|
-
function
|
|
951
|
+
}, $t = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
952
|
+
function en(e) {
|
|
953
953
|
let t = e.trim();
|
|
954
954
|
return t.startsWith("#") ? t : `#${t}`;
|
|
955
955
|
}
|
|
956
956
|
//#endregion
|
|
957
957
|
//#region src/components/LinkAttachment/components/_shared/useChinPalette.ts
|
|
958
|
-
var
|
|
959
|
-
dark:
|
|
960
|
-
light:
|
|
958
|
+
var tn = "#FFFFFF", nn = "#040403", rn = {
|
|
959
|
+
dark: tn,
|
|
960
|
+
light: nn
|
|
961
961
|
};
|
|
962
|
-
function
|
|
962
|
+
function an({ variant: e, accentColor: t, status: n = "ready", layout: r = "featured", thumbnailUrl: i, mimeType: a, sourceUrl: s }) {
|
|
963
963
|
let [c, l] = o.useState(!1);
|
|
964
964
|
o.useEffect(() => {
|
|
965
965
|
l(!1);
|
|
966
966
|
}, [i]);
|
|
967
967
|
let u = o.useCallback(() => {
|
|
968
968
|
l(!0);
|
|
969
|
-
}, []), d =
|
|
969
|
+
}, []), d = Yt(a, s), f = r === "featured" && i && !d && !c && n === "ready" && t != null && $t.test(t.trim()) ? en(t) : void 0, p = d ? nn : rn[e];
|
|
970
970
|
return {
|
|
971
971
|
thumbnailUrl: c ? void 0 : i,
|
|
972
972
|
accentHex: f,
|
|
@@ -978,8 +978,8 @@ function $t({ variant: e, accentColor: t, status: n = "ready", layout: r = "feat
|
|
|
978
978
|
}
|
|
979
979
|
//#endregion
|
|
980
980
|
//#region src/components/LinkAttachment/components/Composer/Card.tsx
|
|
981
|
-
var
|
|
982
|
-
let g = c === "classic", _ =
|
|
981
|
+
var on = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white transition-colors duration-150 hover:bg-[#2a2928] focus-ring", sn = "relative before:absolute before:-inset-[10px] before:content-['']", cn = ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onDismiss: p, onEditClick: m, dismissLabel: h = "Dismiss attachment" }) => {
|
|
982
|
+
let g = c === "classic", _ = Yt(a, s), v = an({
|
|
983
983
|
variant: "dark",
|
|
984
984
|
accentColor: d,
|
|
985
985
|
status: f,
|
|
@@ -987,50 +987,50 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
987
987
|
thumbnailUrl: o,
|
|
988
988
|
mimeType: a,
|
|
989
989
|
sourceUrl: s
|
|
990
|
-
}), y = p ? /* @__PURE__ */
|
|
990
|
+
}), y = p ? /* @__PURE__ */ K("button", {
|
|
991
991
|
type: "button",
|
|
992
992
|
onClick: p,
|
|
993
993
|
"aria-label": h,
|
|
994
|
-
className:
|
|
995
|
-
children: /* @__PURE__ */
|
|
994
|
+
className: X(on, !_ && sn),
|
|
995
|
+
children: /* @__PURE__ */ K(Qe, {
|
|
996
996
|
className: "size-3",
|
|
997
997
|
weight: "bold"
|
|
998
998
|
})
|
|
999
|
-
}) : void 0, b = m ? /* @__PURE__ */
|
|
999
|
+
}) : void 0, b = m ? /* @__PURE__ */ K("button", {
|
|
1000
1000
|
type: "button",
|
|
1001
1001
|
onClick: m,
|
|
1002
1002
|
"aria-label": "Edit attachment",
|
|
1003
1003
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
1004
|
-
children: /* @__PURE__ */
|
|
1004
|
+
children: /* @__PURE__ */ K(Ve, {
|
|
1005
1005
|
className: "size-5",
|
|
1006
1006
|
weight: "regular"
|
|
1007
1007
|
})
|
|
1008
1008
|
}) : void 0;
|
|
1009
|
-
return _ && !v.isLoading ? /* @__PURE__ */
|
|
1009
|
+
return _ && !v.isLoading ? /* @__PURE__ */ K(Kt, {
|
|
1010
1010
|
variant: "dark",
|
|
1011
|
-
bgClassName:
|
|
1012
|
-
children: /* @__PURE__ */
|
|
1011
|
+
bgClassName: Zt,
|
|
1012
|
+
children: /* @__PURE__ */ q("div", {
|
|
1013
1013
|
className: "flex items-center gap-2 pr-3",
|
|
1014
|
-
children: [/* @__PURE__ */
|
|
1014
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1015
1015
|
className: "min-w-0 flex-1",
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ K(Qt, {
|
|
1017
1017
|
variant: "dark",
|
|
1018
1018
|
sourceUrl: s,
|
|
1019
1019
|
title: e,
|
|
1020
1020
|
mimeType: a
|
|
1021
1021
|
})
|
|
1022
|
-
}), y && /* @__PURE__ */
|
|
1022
|
+
}), y && /* @__PURE__ */ K("div", {
|
|
1023
1023
|
className: "shrink-0",
|
|
1024
1024
|
children: y
|
|
1025
1025
|
})]
|
|
1026
1026
|
})
|
|
1027
|
-
}) : /* @__PURE__ */
|
|
1027
|
+
}) : /* @__PURE__ */ q(Kt, {
|
|
1028
1028
|
variant: "dark",
|
|
1029
1029
|
fixedHeight: !g,
|
|
1030
1030
|
accentHex: v.accentHex,
|
|
1031
1031
|
busy: v.isLoading,
|
|
1032
1032
|
topRight: g ? y : void 0,
|
|
1033
|
-
children: [!g && /* @__PURE__ */
|
|
1033
|
+
children: [!g && /* @__PURE__ */ K(Qt, {
|
|
1034
1034
|
variant: "dark",
|
|
1035
1035
|
thumbnailUrl: v.thumbnailUrl,
|
|
1036
1036
|
sourceUrl: s,
|
|
@@ -1039,7 +1039,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1039
1039
|
topRight: y,
|
|
1040
1040
|
isLoading: v.isLoading,
|
|
1041
1041
|
onImageError: v.onImageError
|
|
1042
|
-
}), /* @__PURE__ */
|
|
1042
|
+
}), /* @__PURE__ */ K(Ht, {
|
|
1043
1043
|
chinTextColor: v.chinTextColor,
|
|
1044
1044
|
variant: "dark",
|
|
1045
1045
|
ctaSurface: v.surface,
|
|
@@ -1054,19 +1054,19 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1054
1054
|
isLoading: v.isLoading
|
|
1055
1055
|
})]
|
|
1056
1056
|
});
|
|
1057
|
-
},
|
|
1057
|
+
}, ln = ({ accentHex: e, side: t, visible: n, children: r }) => n ? /* @__PURE__ */ q("div", {
|
|
1058
1058
|
className: "relative isolate w-fit",
|
|
1059
|
-
children: [r, /* @__PURE__ */
|
|
1059
|
+
children: [r, /* @__PURE__ */ K("span", {
|
|
1060
1060
|
"aria-hidden": !0,
|
|
1061
1061
|
"data-testid": "link-card-tail",
|
|
1062
1062
|
"data-variant": t === "sender" ? "dark" : "light",
|
|
1063
1063
|
style: e ? { "--accent": e } : void 0,
|
|
1064
|
-
className:
|
|
1064
|
+
className: X("messaging-link-card-tail", t === "receiver" && "messaging-link-card-tail--received")
|
|
1065
1065
|
})]
|
|
1066
|
-
}) : /* @__PURE__ */
|
|
1067
|
-
Composer:
|
|
1066
|
+
}) : /* @__PURE__ */ K(G, { children: r }), un = {
|
|
1067
|
+
Composer: cn,
|
|
1068
1068
|
Sent: ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onClick: p, groupPosition: m = "single" }) => {
|
|
1069
|
-
let h =
|
|
1069
|
+
let h = Xt(a, s), g = Ft(i), _ = u == null && g != null && !h ? g : void 0, v = u == null && !h && _ != null ? p : void 0, y = f !== "loading" && Yt(a, s), b = an({
|
|
1070
1070
|
variant: "dark",
|
|
1071
1071
|
accentColor: d,
|
|
1072
1072
|
status: f,
|
|
@@ -1075,19 +1075,19 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1075
1075
|
mimeType: a,
|
|
1076
1076
|
sourceUrl: s
|
|
1077
1077
|
});
|
|
1078
|
-
return /* @__PURE__ */
|
|
1078
|
+
return /* @__PURE__ */ K(ln, {
|
|
1079
1079
|
accentHex: b.accentHex,
|
|
1080
1080
|
side: "sender",
|
|
1081
1081
|
visible: !y && (m === "single" || m === "end"),
|
|
1082
|
-
children: /* @__PURE__ */
|
|
1082
|
+
children: /* @__PURE__ */ q(Kt, {
|
|
1083
1083
|
variant: "dark",
|
|
1084
1084
|
href: _,
|
|
1085
1085
|
onClick: v,
|
|
1086
1086
|
fixedHeight: c === "featured" && !y,
|
|
1087
1087
|
accentHex: b.accentHex,
|
|
1088
1088
|
busy: b.isLoading,
|
|
1089
|
-
bgClassName: y ?
|
|
1090
|
-
children: [c === "featured" && /* @__PURE__ */
|
|
1089
|
+
bgClassName: y ? Zt : void 0,
|
|
1090
|
+
children: [c === "featured" && /* @__PURE__ */ K(Qt, {
|
|
1091
1091
|
variant: "dark",
|
|
1092
1092
|
thumbnailUrl: b.thumbnailUrl,
|
|
1093
1093
|
sourceUrl: s,
|
|
@@ -1095,7 +1095,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1095
1095
|
mimeType: a,
|
|
1096
1096
|
isLoading: b.isLoading,
|
|
1097
1097
|
onImageError: b.onImageError
|
|
1098
|
-
}), /* @__PURE__ */
|
|
1098
|
+
}), /* @__PURE__ */ K(Ht, {
|
|
1099
1099
|
chinTextColor: b.chinTextColor,
|
|
1100
1100
|
variant: "dark",
|
|
1101
1101
|
ctaSurface: b.surface,
|
|
@@ -1112,12 +1112,12 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1112
1112
|
});
|
|
1113
1113
|
},
|
|
1114
1114
|
Received: ({ title: e, description: t, descriptionLines: n, url: r, mimeType: i, thumbnailUrl: a, sourceUrl: o, layout: s = "featured", appIcon: c, cta: l, accentColor: u, status: d = "ready", onClick: f, groupPosition: p = "single" }) => {
|
|
1115
|
-
let m =
|
|
1115
|
+
let m = Xt(i, o), h = Ft(r), g = l == null && h != null && !m ? h : void 0, _ = l == null && !m ? f : void 0, v = d !== "loading" && Yt(i, o) ? Zt : void 0, y = l && f ? {
|
|
1116
1116
|
...l,
|
|
1117
1117
|
onClick: () => {
|
|
1118
1118
|
f(), l.onClick?.();
|
|
1119
1119
|
}
|
|
1120
|
-
} : l, b =
|
|
1120
|
+
} : l, b = an({
|
|
1121
1121
|
variant: "light",
|
|
1122
1122
|
accentColor: u,
|
|
1123
1123
|
status: d,
|
|
@@ -1126,11 +1126,11 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1126
1126
|
mimeType: i,
|
|
1127
1127
|
sourceUrl: o
|
|
1128
1128
|
});
|
|
1129
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ K(ln, {
|
|
1130
1130
|
accentHex: b.accentHex,
|
|
1131
1131
|
side: "receiver",
|
|
1132
1132
|
visible: v == null && (p === "single" || p === "end"),
|
|
1133
|
-
children: /* @__PURE__ */
|
|
1133
|
+
children: /* @__PURE__ */ q(Kt, {
|
|
1134
1134
|
variant: "light",
|
|
1135
1135
|
href: g,
|
|
1136
1136
|
onClick: _,
|
|
@@ -1140,7 +1140,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1140
1140
|
busy: b.isLoading,
|
|
1141
1141
|
bgClassName: v,
|
|
1142
1142
|
"data-testid": "link-attachment",
|
|
1143
|
-
children: [s === "featured" && /* @__PURE__ */
|
|
1143
|
+
children: [s === "featured" && /* @__PURE__ */ K(Qt, {
|
|
1144
1144
|
variant: "light",
|
|
1145
1145
|
thumbnailUrl: b.thumbnailUrl,
|
|
1146
1146
|
sourceUrl: o,
|
|
@@ -1148,7 +1148,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1148
1148
|
mimeType: i,
|
|
1149
1149
|
isLoading: b.isLoading,
|
|
1150
1150
|
onImageError: b.onImageError
|
|
1151
|
-
}), /* @__PURE__ */
|
|
1151
|
+
}), /* @__PURE__ */ K(Ht, {
|
|
1152
1152
|
chinTextColor: b.chinTextColor,
|
|
1153
1153
|
variant: "light",
|
|
1154
1154
|
ctaSurface: b.surface,
|
|
@@ -1166,64 +1166,64 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1166
1166
|
};
|
|
1167
1167
|
//#endregion
|
|
1168
1168
|
//#region src/components/MediaMessage/index.tsx
|
|
1169
|
-
function
|
|
1169
|
+
function dn(e) {
|
|
1170
1170
|
return e.type === "link" || !!e.og_scrape_url?.trim();
|
|
1171
1171
|
}
|
|
1172
1172
|
//#endregion
|
|
1173
1173
|
//#region src/components/CustomMessage/context.tsx
|
|
1174
|
-
var
|
|
1175
|
-
function
|
|
1176
|
-
return u(
|
|
1174
|
+
var fn = { LockedAttachment: { isUnlocking: () => !1 } }, pn = c({}), mn = pn.Provider;
|
|
1175
|
+
function hn(e) {
|
|
1176
|
+
return u(pn)[e] ?? fn[e];
|
|
1177
1177
|
}
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/components/CustomMessage/LockedAttachment/index.tsx
|
|
1180
|
-
var
|
|
1180
|
+
var gn = o.lazy(() => import("./Card-C7uLQbYz.js")), _n = o.lazy(() => import("./Card-BhwBkgxI.js")), vn = () => /* @__PURE__ */ K("div", {
|
|
1181
1181
|
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)]",
|
|
1182
1182
|
"aria-hidden": !0
|
|
1183
|
-
}),
|
|
1184
|
-
fallback: /* @__PURE__ */
|
|
1185
|
-
children: e.contentType === "text" ? /* @__PURE__ */
|
|
1186
|
-
}),
|
|
1183
|
+
}), yn = (e) => /* @__PURE__ */ K(s, {
|
|
1184
|
+
fallback: /* @__PURE__ */ K(vn, {}),
|
|
1185
|
+
children: e.contentType === "text" ? /* @__PURE__ */ K(gn, { ...e }) : /* @__PURE__ */ K(_n, { ...e })
|
|
1186
|
+
}), bn = ({ size: e = 15 }) => /* @__PURE__ */ K("svg", {
|
|
1187
1187
|
width: e,
|
|
1188
1188
|
height: e,
|
|
1189
1189
|
viewBox: "0 0 15 15",
|
|
1190
1190
|
fill: "none",
|
|
1191
1191
|
"aria-hidden": "true",
|
|
1192
|
-
children: /* @__PURE__ */
|
|
1192
|
+
children: /* @__PURE__ */ K("path", {
|
|
1193
1193
|
d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
|
|
1194
1194
|
fill: "currentColor",
|
|
1195
1195
|
fillOpacity: .55
|
|
1196
1196
|
})
|
|
1197
|
-
}),
|
|
1198
|
-
let r =
|
|
1197
|
+
}), xn = (e) => e.metadata?.custom_type === J.PAID, Sn = (e) => e.metadata?.custom_type === J.CHATBOT, Cn = (e) => e.metadata?.custom_type === J.ATTACHMENT, wn = (e) => Cn(e) && e.metadata?.attachment_content_type === "text", Tn = (e) => Cn(e) && e.metadata?.attachment_content_type !== "text", En = (e) => xn(e) && !!e.metadata?.amount_text, Dn = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
|
|
1198
|
+
let r = xn(e), i = Sn(e);
|
|
1199
1199
|
if (!r && !i) return null;
|
|
1200
1200
|
if (r) {
|
|
1201
1201
|
let t = e.metadata?.amount_text;
|
|
1202
|
-
return t ? /* @__PURE__ */
|
|
1202
|
+
return t ? /* @__PURE__ */ q("div", {
|
|
1203
1203
|
className: "message-tag--paid inline-flex items-center gap-1 text-[12px] font-medium leading-[2] text-[#016630]",
|
|
1204
|
-
children: [/* @__PURE__ */
|
|
1204
|
+
children: [/* @__PURE__ */ K(Re, { size: 12 }), /* @__PURE__ */ q("span", { children: [
|
|
1205
1205
|
"Delivered with ",
|
|
1206
1206
|
t,
|
|
1207
1207
|
" message"
|
|
1208
1208
|
] })]
|
|
1209
1209
|
}) : null;
|
|
1210
1210
|
}
|
|
1211
|
-
let a = t && n, o = a ? "Sent with AI" : "Sent by AI Assistant", s = a ? "justify-end gap-2 text-black/30" : t ? "w-full justify-start gap-1.5 mt-3 px-4 text-white/55" : "w-full justify-start gap-1.5 mt-3 px-4 text-black/30", c = /* @__PURE__ */
|
|
1211
|
+
let a = t && n, o = a ? "Sent with AI" : "Sent by AI Assistant", s = a ? "justify-end gap-2 text-black/30" : t ? "w-full justify-start gap-1.5 mt-3 px-4 text-white/55" : "w-full justify-start gap-1.5 mt-3 px-4 text-black/30", c = /* @__PURE__ */ K("span", {
|
|
1212
1212
|
className: "text-left",
|
|
1213
1213
|
children: o
|
|
1214
|
-
}), l = /* @__PURE__ */
|
|
1214
|
+
}), l = /* @__PURE__ */ K("span", {
|
|
1215
1215
|
className: "inline-flex items-center leading-none",
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1216
|
+
children: /* @__PURE__ */ K(bn, { size: a ? 12 : 15 })
|
|
1217
1217
|
});
|
|
1218
|
-
return /* @__PURE__ */
|
|
1218
|
+
return /* @__PURE__ */ K("div", {
|
|
1219
1219
|
className: `inline-flex items-center text-[10px] font-normal leading-4 tracking-[0.2px] ${s}`,
|
|
1220
1220
|
"data-testid": "message-chatbot-indicator",
|
|
1221
|
-
children: t && !a ? /* @__PURE__ */ G
|
|
1221
|
+
children: t && !a ? /* @__PURE__ */ q(G, { children: [c, l] }) : /* @__PURE__ */ q(G, { children: [l, c] })
|
|
1222
1222
|
});
|
|
1223
|
-
},
|
|
1223
|
+
}, On = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", kn = {
|
|
1224
1224
|
me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
1225
1225
|
other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
1226
|
-
},
|
|
1226
|
+
}, An = ({ side: e }) => /* @__PURE__ */ K("span", {
|
|
1227
1227
|
"aria-hidden": "true",
|
|
1228
1228
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
1229
1229
|
style: {
|
|
@@ -1231,18 +1231,18 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1231
1231
|
insetInlineStart: e === "other" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
1232
1232
|
transform: e === "other" ? "scaleX(-1)" : void 0,
|
|
1233
1233
|
transformOrigin: "center",
|
|
1234
|
-
backgroundColor:
|
|
1235
|
-
WebkitMask:
|
|
1236
|
-
mask:
|
|
1234
|
+
backgroundColor: kn[e],
|
|
1235
|
+
WebkitMask: On,
|
|
1236
|
+
mask: On
|
|
1237
1237
|
}
|
|
1238
|
-
}),
|
|
1238
|
+
}), jn = c(void 0), Mn = (e) => {
|
|
1239
1239
|
let t = e.metadata?.outbound_id;
|
|
1240
1240
|
return typeof t == "string" ? t : void 0;
|
|
1241
|
-
},
|
|
1241
|
+
}, Nn = (e, t) => {
|
|
1242
1242
|
if (!t || !e?.length) return;
|
|
1243
1243
|
let n = /* @__PURE__ */ new Set(), r;
|
|
1244
1244
|
for (let i of e) {
|
|
1245
|
-
let e =
|
|
1245
|
+
let e = Mn(i);
|
|
1246
1246
|
if (!e || n.has(e)) continue;
|
|
1247
1247
|
n.add(e);
|
|
1248
1248
|
let a = t(e);
|
|
@@ -1252,93 +1252,93 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1252
1252
|
});
|
|
1253
1253
|
}
|
|
1254
1254
|
return r;
|
|
1255
|
-
},
|
|
1255
|
+
}, Pn = (e, t) => {
|
|
1256
1256
|
if (e === t) return !0;
|
|
1257
1257
|
if (!e || !t) return !1;
|
|
1258
1258
|
let n = Object.keys(e), r = Object.keys(t);
|
|
1259
1259
|
return n.length === r.length && n.every((n) => e[n].id === t[n]?.id && e[n].name === t[n]?.name);
|
|
1260
|
-
},
|
|
1261
|
-
let n =
|
|
1262
|
-
return
|
|
1263
|
-
},
|
|
1260
|
+
}, Fn = (e, t) => {
|
|
1261
|
+
let n = Nn(e, t), [r, i] = h(n);
|
|
1262
|
+
return Pn(r, n) ? r : (i(n), n);
|
|
1263
|
+
}, In = (e) => e.metadata?.custom_type === J.TIP, Ln = ({ message: e }) => {
|
|
1264
1264
|
let t = e.metadata?.amount_text;
|
|
1265
|
-
return t ? /* @__PURE__ */
|
|
1265
|
+
return t ? /* @__PURE__ */ q("div", {
|
|
1266
1266
|
className: "message-tip-pill inline-flex items-end gap-0.5 max-w-[520px] rounded-[1.5rem] bg-[#43e660] px-4 py-3 text-white",
|
|
1267
|
-
children: [/* @__PURE__ */
|
|
1267
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1268
1268
|
className: "flex h-5 items-center text-[20px] leading-none",
|
|
1269
1269
|
"aria-hidden": "true",
|
|
1270
1270
|
children: "🎁"
|
|
1271
|
-
}), /* @__PURE__ */
|
|
1271
|
+
}), /* @__PURE__ */ q("span", {
|
|
1272
1272
|
className: "text-[14px] font-bold leading-[1.43] tracking-[0.28px] text-[rgba(4,4,3,0.9)]",
|
|
1273
1273
|
children: [t, " tip!"]
|
|
1274
1274
|
})]
|
|
1275
1275
|
}) : null;
|
|
1276
|
-
},
|
|
1277
|
-
let { message: e } = H("SentMessageDeliveryStatus"), { messages: t } =
|
|
1276
|
+
}, Rn = () => {
|
|
1277
|
+
let { message: e } = H("SentMessageDeliveryStatus"), { messages: t } = _e("SentMessageDeliveryStatus"), n = (() => {
|
|
1278
1278
|
if (t) for (let e = t.length - 1; e >= 0; --e) {
|
|
1279
1279
|
let n = t[e];
|
|
1280
1280
|
if (n.type !== "system" && n.type !== "ephemeral" && n.type !== "deleted") return n.id;
|
|
1281
1281
|
}
|
|
1282
1282
|
})();
|
|
1283
1283
|
return e.id === n;
|
|
1284
|
-
},
|
|
1284
|
+
}, zn = () => Rn() ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Ne, {
|
|
1285
1285
|
weight: "bold",
|
|
1286
1286
|
"aria-hidden": "true"
|
|
1287
|
-
}), /* @__PURE__ */
|
|
1287
|
+
}), /* @__PURE__ */ K("span", {
|
|
1288
1288
|
"data-testid": "sent-message-delivery-status",
|
|
1289
1289
|
children: "Delivered"
|
|
1290
|
-
})] }) : null,
|
|
1290
|
+
})] }) : null, Bn = () => Rn() ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Z, {
|
|
1291
1291
|
className: "sent-message-status__spinner animate-spin",
|
|
1292
1292
|
weight: "bold",
|
|
1293
1293
|
"aria-hidden": "true"
|
|
1294
|
-
}), /* @__PURE__ */
|
|
1294
|
+
}), /* @__PURE__ */ K("span", {
|
|
1295
1295
|
"data-testid": "sent-message-sending-status",
|
|
1296
1296
|
children: "Sending"
|
|
1297
|
-
})] }) : null,
|
|
1298
|
-
let n = e.name || "Broadcast", r = /* @__PURE__ */ G
|
|
1297
|
+
})] }) : null, Vn = ({ outbound: e, onOutboundClick: t }) => {
|
|
1298
|
+
let n = e.name || "Broadcast", r = /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
|
|
1299
1299
|
className: "sent-message-outbound-badge",
|
|
1300
1300
|
"aria-hidden": "true",
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1302
|
-
}), /* @__PURE__ */
|
|
1303
|
-
className:
|
|
1301
|
+
children: /* @__PURE__ */ K(ze, { weight: "fill" })
|
|
1302
|
+
}), /* @__PURE__ */ K("span", {
|
|
1303
|
+
className: X("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
|
|
1304
1304
|
"data-testid": "sent-message-outbound-status",
|
|
1305
1305
|
children: n
|
|
1306
1306
|
})] });
|
|
1307
|
-
return t ? /* @__PURE__ */
|
|
1307
|
+
return t ? /* @__PURE__ */ K("button", {
|
|
1308
1308
|
type: "button",
|
|
1309
1309
|
className: "inline-flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-inherit [font:inherit]",
|
|
1310
1310
|
"aria-label": `View broadcast ${n}`,
|
|
1311
1311
|
onClick: () => t(e),
|
|
1312
1312
|
children: r
|
|
1313
1313
|
}) : r;
|
|
1314
|
-
},
|
|
1314
|
+
}, Hn = () => /* @__PURE__ */ q("span", {
|
|
1315
1315
|
className: "str-chat__message-status sent-message-status--failed",
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1316
|
+
children: [/* @__PURE__ */ K(Ze, {
|
|
1317
1317
|
weight: "bold",
|
|
1318
1318
|
"aria-hidden": "true"
|
|
1319
|
-
}), /* @__PURE__ */
|
|
1319
|
+
}), /* @__PURE__ */ K("span", {
|
|
1320
1320
|
"data-testid": "sent-message-failed-status",
|
|
1321
1321
|
children: "Failed to send"
|
|
1322
1322
|
})]
|
|
1323
|
-
}),
|
|
1324
|
-
let { isMyMessage: n, message: r, threadList: i } = H("SentMessageDeliveryStatus"), a = n(), o =
|
|
1323
|
+
}), Un = ({ onOutboundClick: e, resolvedOutbound: t }) => {
|
|
1324
|
+
let { isMyMessage: n, message: r, threadList: i } = H("SentMessageDeliveryStatus"), a = n(), o = Rn();
|
|
1325
1325
|
if (i) return null;
|
|
1326
|
-
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */
|
|
1326
|
+
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ K(Hn, {});
|
|
1327
1327
|
if (!a) return null;
|
|
1328
|
-
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */
|
|
1328
|
+
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ K(Vn, {
|
|
1329
1329
|
outbound: t,
|
|
1330
1330
|
onOutboundClick: e
|
|
1331
|
-
}) : null, l =
|
|
1332
|
-
MessageSentStatus:
|
|
1333
|
-
MessageDeliveredStatus:
|
|
1334
|
-
MessageReadStatus:
|
|
1335
|
-
MessageSendingStatus:
|
|
1331
|
+
}) : null, l = En(r) ? null : /* @__PURE__ */ K(R, {
|
|
1332
|
+
MessageSentStatus: zn,
|
|
1333
|
+
MessageDeliveredStatus: zn,
|
|
1334
|
+
MessageReadStatus: zn,
|
|
1335
|
+
MessageSendingStatus: In(r) ? zn : Bn
|
|
1336
1336
|
});
|
|
1337
|
-
return c ? /* @__PURE__ */
|
|
1337
|
+
return c ? /* @__PURE__ */ q("span", {
|
|
1338
1338
|
className: "sent-message-status-row",
|
|
1339
1339
|
children: [
|
|
1340
1340
|
l,
|
|
1341
|
-
l && o && /* @__PURE__ */
|
|
1341
|
+
l && o && /* @__PURE__ */ K("span", {
|
|
1342
1342
|
className: "sent-message-outbound-separator",
|
|
1343
1343
|
"aria-hidden": "true",
|
|
1344
1344
|
children: "•"
|
|
@@ -1346,16 +1346,16 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1346
1346
|
c
|
|
1347
1347
|
]
|
|
1348
1348
|
}) : l;
|
|
1349
|
-
},
|
|
1349
|
+
}, Wn = {
|
|
1350
1350
|
dark: "bg-[#1e2330]",
|
|
1351
1351
|
light: "bg-[#f2f1ef]"
|
|
1352
|
-
},
|
|
1352
|
+
}, Gn = {
|
|
1353
1353
|
dark: "text-white",
|
|
1354
1354
|
light: "text-[#000000]"
|
|
1355
|
-
},
|
|
1355
|
+
}, Kn = {
|
|
1356
1356
|
dark: "border-white/[0.08]",
|
|
1357
1357
|
light: "border-black/[0.08]"
|
|
1358
|
-
},
|
|
1358
|
+
}, qn = (e) => e === "dark" ? "sender" : "receiver", Jn = {
|
|
1359
1359
|
sender: {
|
|
1360
1360
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1361
1361
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1368,91 +1368,24 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1368
1368
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
1369
1369
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
1370
1370
|
}
|
|
1371
|
-
},
|
|
1372
|
-
let u = t != null && t !== "", d = o ??
|
|
1373
|
-
return /* @__PURE__ */
|
|
1371
|
+
}, Yn = ({ variant: e, text: t, bordered: n = !0, groupPosition: r = "single", widthClassName: i = "w-[280px]", paddingClassName: a = "px-2 py-2", radiusClassName: o, className: s, children: c, "data-testid": l }) => {
|
|
1372
|
+
let u = t != null && t !== "", d = o ?? Jn[qn(e)][r];
|
|
1373
|
+
return /* @__PURE__ */ q("div", {
|
|
1374
1374
|
"data-testid": l,
|
|
1375
1375
|
"data-group-position": r,
|
|
1376
|
-
className:
|
|
1377
|
-
children: [c, u ? /* @__PURE__ */
|
|
1378
|
-
className:
|
|
1376
|
+
className: X("relative", i, "overflow-hidden", a, u && "pb-0", d, Wn[e], Gn[e], n && "border", n && Kn[e], s),
|
|
1377
|
+
children: [c, u ? /* @__PURE__ */ K("p", {
|
|
1378
|
+
className: X("whitespace-pre-wrap break-words leading-snug hyphens-manual", "pb-2 pt-2", "px-2"),
|
|
1379
1379
|
children: t
|
|
1380
1380
|
}) : null]
|
|
1381
1381
|
});
|
|
1382
|
-
},
|
|
1383
|
-
type: "button",
|
|
1384
|
-
onClick: (t) => {
|
|
1385
|
-
t.stopPropagation(), e();
|
|
1386
|
-
},
|
|
1387
|
-
"aria-label": n,
|
|
1388
|
-
className: Y("flex size-6 items-center justify-center rounded-full text-white", t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"),
|
|
1389
|
-
children: /* @__PURE__ */ W(qe, {
|
|
1390
|
-
className: "size-3",
|
|
1391
|
-
weight: "bold"
|
|
1392
|
-
})
|
|
1393
|
-
}), Kn = (e) => e === "received" ? "light" : "dark", qn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Jn = ({ src: e, mimeType: t, filename: n, items: r }) => r && r.length > 0 ? r : e ? [{
|
|
1394
|
-
src: e,
|
|
1395
|
-
mimeType: t,
|
|
1396
|
-
filename: n
|
|
1397
|
-
}] : [], Yn = ({ item: t, preload: n, trailingAction: r }) => /* @__PURE__ */ G("div", {
|
|
1398
|
-
className: "flex items-center gap-2",
|
|
1399
|
-
children: [/* @__PURE__ */ W("audio", {
|
|
1400
|
-
...e,
|
|
1401
|
-
src: t.src,
|
|
1402
|
-
controls: !0,
|
|
1403
|
-
preload: t.preload ?? n,
|
|
1404
|
-
className: "block min-w-0 flex-1",
|
|
1405
|
-
children: t.mimeType ? /* @__PURE__ */ W("source", {
|
|
1406
|
-
src: t.src,
|
|
1407
|
-
type: t.mimeType
|
|
1408
|
-
}) : null
|
|
1409
|
-
}), r ?? null]
|
|
1410
|
-
}), Xn = ({ state: e, src: t, mimeType: n, filename: r, items: i, text: a, groupPosition: o, preload: s, onDismiss: c }) => {
|
|
1411
|
-
let l = Kn(e), u = e === "composer" && !!c, d = Jn({
|
|
1412
|
-
src: t,
|
|
1413
|
-
mimeType: n,
|
|
1414
|
-
filename: r,
|
|
1415
|
-
items: i
|
|
1416
|
-
});
|
|
1417
|
-
if (d.length === 0) return null;
|
|
1418
|
-
let f = s ?? (d.length > 1 ? "none" : "metadata");
|
|
1419
|
-
return /* @__PURE__ */ W(Wn, {
|
|
1420
|
-
variant: l,
|
|
1421
|
-
text: a,
|
|
1422
|
-
groupPosition: o,
|
|
1423
|
-
"data-testid": "audio-attachment",
|
|
1424
|
-
children: /* @__PURE__ */ W("div", {
|
|
1425
|
-
className: "flex flex-col gap-2",
|
|
1426
|
-
children: d.map((e, t) => /* @__PURE__ */ W(Yn, {
|
|
1427
|
-
item: e,
|
|
1428
|
-
preload: f,
|
|
1429
|
-
trailingAction: u && t === 0 ? /* @__PURE__ */ W(Gn, {
|
|
1430
|
-
onClick: c,
|
|
1431
|
-
variant: "inline"
|
|
1432
|
-
}) : void 0
|
|
1433
|
-
}, `${e.src}-${t}`))
|
|
1434
|
-
})
|
|
1435
|
-
});
|
|
1436
|
-
}, Zn = {
|
|
1437
|
-
Composer: (e) => /* @__PURE__ */ W(Xn, {
|
|
1438
|
-
...e,
|
|
1439
|
-
state: "composer"
|
|
1440
|
-
}),
|
|
1441
|
-
Sent: (e) => /* @__PURE__ */ W(Xn, {
|
|
1442
|
-
...e,
|
|
1443
|
-
state: "sent"
|
|
1444
|
-
}),
|
|
1445
|
-
Received: (e) => /* @__PURE__ */ W(Xn, {
|
|
1446
|
-
...e,
|
|
1447
|
-
state: "received"
|
|
1448
|
-
})
|
|
1449
|
-
};
|
|
1382
|
+
}, Xn = (e) => e === "received" ? "light" : "dark", Zn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Qn = (e, t) => `${e}:${t}`;
|
|
1450
1383
|
//#endregion
|
|
1451
1384
|
//#region src/components/MessageAttachment/_shared/fileMeta.ts
|
|
1452
|
-
function
|
|
1385
|
+
function $n(e) {
|
|
1453
1386
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(2)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
|
|
1454
1387
|
}
|
|
1455
|
-
var
|
|
1388
|
+
var er = {
|
|
1456
1389
|
pdf: "PDF",
|
|
1457
1390
|
doc: "DOC",
|
|
1458
1391
|
xls: "XLS",
|
|
@@ -1462,7 +1395,7 @@ var $n = {
|
|
|
1462
1395
|
text: "TXT",
|
|
1463
1396
|
markdown: "MD"
|
|
1464
1397
|
};
|
|
1465
|
-
function
|
|
1398
|
+
function tr(e, n) {
|
|
1466
1399
|
if (n) {
|
|
1467
1400
|
let e = n.lastIndexOf(".");
|
|
1468
1401
|
if (e > 0 && e < n.length - 1) {
|
|
@@ -1472,15 +1405,15 @@ function er(e, n) {
|
|
|
1472
1405
|
}
|
|
1473
1406
|
if (!e) return;
|
|
1474
1407
|
if (t(e) === "document") {
|
|
1475
|
-
let t =
|
|
1408
|
+
let t = er[i(e)];
|
|
1476
1409
|
if (t) return t;
|
|
1477
1410
|
if (e === "application/octet-stream") return;
|
|
1478
1411
|
}
|
|
1479
1412
|
let r = e.split("/")[1];
|
|
1480
1413
|
if (!(!r || r === "*")) return r.toUpperCase();
|
|
1481
1414
|
}
|
|
1482
|
-
function
|
|
1483
|
-
return [
|
|
1415
|
+
function nr(e, t, n) {
|
|
1416
|
+
return [tr(e, t), typeof n == "number" && n > 0 ? $n(n) : void 0].filter(Boolean).join(" · ") || void 0;
|
|
1484
1417
|
}
|
|
1485
1418
|
function Q(e) {
|
|
1486
1419
|
try {
|
|
@@ -1491,75 +1424,274 @@ function Q(e) {
|
|
|
1491
1424
|
}
|
|
1492
1425
|
}
|
|
1493
1426
|
//#endregion
|
|
1494
|
-
//#region src/components/MessageAttachment/_shared/
|
|
1495
|
-
|
|
1427
|
+
//#region src/components/MessageAttachment/_shared/triggerDownload.ts
|
|
1428
|
+
async function rr(e, t) {
|
|
1429
|
+
let n = t ?? Q(e);
|
|
1430
|
+
try {
|
|
1431
|
+
let t = await fetch(e, { mode: "cors" });
|
|
1432
|
+
if (!t.ok) throw Error(`HTTP ${t.status}`);
|
|
1433
|
+
let r = await t.blob(), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
1434
|
+
a.href = i, a.download = n, a.style.display = "none", document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
|
|
1435
|
+
} catch {
|
|
1436
|
+
if (!window.open(e, "_blank", "noopener,noreferrer")) {
|
|
1437
|
+
let t = document.createElement("a");
|
|
1438
|
+
t.href = e, t.download = n, t.target = "_blank", t.rel = "noopener noreferrer", t.style.display = "none", document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
//#endregion
|
|
1443
|
+
//#region src/components/MessageAttachment/_shared/useIsClient.ts
|
|
1444
|
+
var ir = () => () => {}, ar = () => !0, or = () => !1, sr = () => g(ir, ar, or), cr = 35, lr = Object.freeze(Array(cr).fill(0)), ur = "--:--", dr = (e) => se(Math.floor(e)), fr = (e) => ({
|
|
1445
|
+
canPlayRecord: e.canPlayRecord,
|
|
1446
|
+
isPlaying: e.isPlaying,
|
|
1447
|
+
progressPercent: e.progressPercent,
|
|
1448
|
+
secondsElapsed: e.secondsElapsed
|
|
1449
|
+
}), pr = "flex size-8 shrink-0 items-center justify-center rounded-full backdrop-blur-[20px]", mr = {
|
|
1450
|
+
dark: "bg-white text-black/90 disabled:bg-white/40",
|
|
1451
|
+
light: "bg-[#040403]/90 text-white disabled:bg-[#040403]/30"
|
|
1452
|
+
}, hr = {
|
|
1453
|
+
dark: "bg-[#040403]/80 text-white hover:bg-[#040403]",
|
|
1454
|
+
light: "bg-black/10 text-black/90 hover:bg-black/20"
|
|
1455
|
+
}, gr = (e, t) => {
|
|
1456
|
+
let [n, r] = o.useState();
|
|
1457
|
+
return o.useEffect(() => {
|
|
1458
|
+
if (t != null || !e) return;
|
|
1459
|
+
let n = document.createElement("audio");
|
|
1460
|
+
n.preload = "metadata";
|
|
1461
|
+
let i = () => {
|
|
1462
|
+
Number.isFinite(n.duration) && n.duration > 0 && r(n.duration);
|
|
1463
|
+
};
|
|
1464
|
+
return n.addEventListener("loadedmetadata", i), n.src = e, () => {
|
|
1465
|
+
n.removeEventListener("loadedmetadata", i), n.removeAttribute("src"), r(void 0);
|
|
1466
|
+
};
|
|
1467
|
+
}, [e, t]), t ?? n;
|
|
1468
|
+
}, _r = (e) => sr() ? /* @__PURE__ */ K(yr, { ...e }) : /* @__PURE__ */ K(br, {
|
|
1469
|
+
...e,
|
|
1470
|
+
playback: vr
|
|
1471
|
+
}), vr = {
|
|
1472
|
+
playable: !1,
|
|
1473
|
+
showPause: !1,
|
|
1474
|
+
isStarting: !1,
|
|
1475
|
+
progress: 0,
|
|
1476
|
+
secondsElapsed: 0
|
|
1477
|
+
}, yr = (e) => {
|
|
1478
|
+
let { item: t, requester: n } = e, r = o.useRef(null), [i, a] = o.useState(!1), s = gr(t.src, t.durationSeconds), c = ge({
|
|
1479
|
+
durationSeconds: s,
|
|
1480
|
+
mimeType: t.mimeType,
|
|
1481
|
+
requester: n,
|
|
1482
|
+
src: t.src,
|
|
1483
|
+
title: t.filename
|
|
1484
|
+
}), { canPlayRecord: l = !1, isPlaying: u = !1, progressPercent: d = 0, secondsElapsed: f = 0 } = W(c?.state, fr) ?? {}, p = () => {
|
|
1485
|
+
!c || i || (a(!0), c.togglePlay().finally(() => a(!1)));
|
|
1486
|
+
}, m = (e) => {
|
|
1487
|
+
let t = r.current;
|
|
1488
|
+
if (!c || !t) return;
|
|
1489
|
+
let n = Math.min(Math.max(Number(e.target.value) / 100, 0), 1), i = t.getBoundingClientRect();
|
|
1490
|
+
c.seek({
|
|
1491
|
+
clientX: i.x + n * i.width,
|
|
1492
|
+
currentTarget: t
|
|
1493
|
+
});
|
|
1494
|
+
};
|
|
1495
|
+
return /* @__PURE__ */ K(br, {
|
|
1496
|
+
...e,
|
|
1497
|
+
playback: {
|
|
1498
|
+
playable: !!c && l,
|
|
1499
|
+
showPause: u,
|
|
1500
|
+
isStarting: i,
|
|
1501
|
+
progress: Math.min(Math.max(d, 0), 100),
|
|
1502
|
+
secondsElapsed: f,
|
|
1503
|
+
durationSeconds: s,
|
|
1504
|
+
trackRef: r,
|
|
1505
|
+
onTogglePlay: p,
|
|
1506
|
+
onSeek: m
|
|
1507
|
+
}
|
|
1508
|
+
});
|
|
1509
|
+
}, br = ({ item: e, variant: t, trailingAction: n, playback: r }) => {
|
|
1510
|
+
let { isStarting: i, onSeek: a, onTogglePlay: s, playable: c, progress: l, secondsElapsed: u, showPause: d, trackRef: f } = r, p = o.useMemo(() => {
|
|
1511
|
+
let t = e.waveformData;
|
|
1512
|
+
return !t || t.length === 0 ? lr : t.length === cr ? t : pe(t, cr);
|
|
1513
|
+
}, [e.waveformData]), m = r.durationSeconds ?? e.durationSeconds, h = m == null ? ur : dr(m), g = u > 0 ? dr(u) : h, _ = e.filename ? ` \u2014 ${e.filename}` : "";
|
|
1514
|
+
return /* @__PURE__ */ q("div", {
|
|
1515
|
+
role: "group",
|
|
1516
|
+
"aria-label": e.filename ?? "Audio attachment",
|
|
1517
|
+
className: "flex items-center",
|
|
1518
|
+
"data-testid": "audio-attachment-row",
|
|
1519
|
+
children: [
|
|
1520
|
+
/* @__PURE__ */ K("button", {
|
|
1521
|
+
type: "button",
|
|
1522
|
+
onClick: s,
|
|
1523
|
+
disabled: !c,
|
|
1524
|
+
"aria-busy": i || void 0,
|
|
1525
|
+
"aria-label": `${d ? "Pause audio" : "Play audio"}${_}`,
|
|
1526
|
+
className: X(pr, mr[t]),
|
|
1527
|
+
children: K(d ? Be : He, {
|
|
1528
|
+
className: "size-3",
|
|
1529
|
+
weight: "fill",
|
|
1530
|
+
"aria-hidden": !0
|
|
1531
|
+
})
|
|
1532
|
+
}),
|
|
1533
|
+
/* @__PURE__ */ q("div", {
|
|
1534
|
+
className: "flex min-w-0 flex-1 items-center gap-2.5 px-3",
|
|
1535
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1536
|
+
className: X("mes-audio-wave", t === "light" && "mes-audio-wave--light"),
|
|
1537
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1538
|
+
ref: f,
|
|
1539
|
+
className: "mes-audio-wave__track",
|
|
1540
|
+
"aria-hidden": !0,
|
|
1541
|
+
"data-testid": "audio-waveform-track",
|
|
1542
|
+
children: p.map((e, t) => /* @__PURE__ */ K("span", {
|
|
1543
|
+
"data-testid": "amplitude-bar",
|
|
1544
|
+
className: X("mes-audio-wave__bar", l > t / p.length * 100 && "mes-audio-wave__bar--played"),
|
|
1545
|
+
style: { "--mes-audio-wave-bar": `${Math.min(Math.max(e, 0), 1) * 100}%` }
|
|
1546
|
+
}, t))
|
|
1547
|
+
}), /* @__PURE__ */ K("input", {
|
|
1548
|
+
type: "range",
|
|
1549
|
+
className: "mes-audio-wave__seek",
|
|
1550
|
+
min: 0,
|
|
1551
|
+
max: 100,
|
|
1552
|
+
step: .1,
|
|
1553
|
+
value: l,
|
|
1554
|
+
onChange: a,
|
|
1555
|
+
disabled: !c,
|
|
1556
|
+
"aria-label": `Seek audio${_}`,
|
|
1557
|
+
"aria-valuetext": `${dr(u)} of ${h}`
|
|
1558
|
+
})]
|
|
1559
|
+
}), /* @__PURE__ */ K("span", {
|
|
1560
|
+
className: "shrink-0 text-xs leading-4 tracking-[0.24px] tabular-nums",
|
|
1561
|
+
children: g
|
|
1562
|
+
})]
|
|
1563
|
+
}),
|
|
1564
|
+
n ? /* @__PURE__ */ K("button", {
|
|
1565
|
+
type: "button",
|
|
1566
|
+
onClick: n.kind === "dismiss" ? n.onDismiss : () => {
|
|
1567
|
+
rr(e.src, e.filename);
|
|
1568
|
+
},
|
|
1569
|
+
"aria-label": n.kind === "dismiss" ? "Remove attachment" : `Download audio${_}`,
|
|
1570
|
+
className: X(pr, hr[t]),
|
|
1571
|
+
children: n.kind === "dismiss" ? /* @__PURE__ */ K(Qe, {
|
|
1572
|
+
className: "size-3",
|
|
1573
|
+
weight: "bold",
|
|
1574
|
+
"aria-hidden": !0
|
|
1575
|
+
}) : /* @__PURE__ */ K(Ie, {
|
|
1576
|
+
className: "size-3",
|
|
1577
|
+
weight: "bold",
|
|
1578
|
+
"aria-hidden": !0
|
|
1579
|
+
})
|
|
1580
|
+
}) : null
|
|
1581
|
+
]
|
|
1582
|
+
});
|
|
1583
|
+
}, xr = "w-[299px]", Sr = "py-5 pl-5 pr-3", Cr = "rounded-[20px]", wr = ({ src: e, mimeType: t, filename: n, durationSeconds: r, waveformData: i, items: a }) => a && a.length > 0 ? a : e ? [{
|
|
1584
|
+
src: e,
|
|
1585
|
+
mimeType: t,
|
|
1586
|
+
filename: n,
|
|
1587
|
+
durationSeconds: r,
|
|
1588
|
+
waveformData: i
|
|
1589
|
+
}] : [], Tr = ({ state: e, src: t, mimeType: n, filename: r, items: i, durationSeconds: a, waveformData: s, text: c, groupPosition: l, onDismiss: u }) => {
|
|
1590
|
+
let { message: d, threadList: f } = H(), p = o.useId(), m = Xn(e), h = wr({
|
|
1591
|
+
src: t,
|
|
1592
|
+
mimeType: n,
|
|
1593
|
+
filename: r,
|
|
1594
|
+
durationSeconds: a,
|
|
1595
|
+
waveformData: s,
|
|
1596
|
+
items: i
|
|
1597
|
+
});
|
|
1598
|
+
if (h.length === 0) return null;
|
|
1599
|
+
let g = d?.id ? `${f ? d.parent_id ?? d.id : ""}${d.id}` : p, _ = e === "composer" ? u ? {
|
|
1600
|
+
kind: "dismiss",
|
|
1601
|
+
onDismiss: u
|
|
1602
|
+
} : void 0 : { kind: "download" };
|
|
1603
|
+
return /* @__PURE__ */ K(Yn, {
|
|
1604
|
+
variant: m,
|
|
1605
|
+
text: c,
|
|
1606
|
+
groupPosition: l,
|
|
1607
|
+
bordered: !1,
|
|
1608
|
+
widthClassName: xr,
|
|
1609
|
+
paddingClassName: Sr,
|
|
1610
|
+
radiusClassName: Cr,
|
|
1611
|
+
"data-testid": "audio-attachment",
|
|
1612
|
+
children: /* @__PURE__ */ K("div", {
|
|
1613
|
+
className: "flex flex-col gap-2",
|
|
1614
|
+
children: h.map((e, t) => /* @__PURE__ */ K(_r, {
|
|
1615
|
+
item: e,
|
|
1616
|
+
variant: m,
|
|
1617
|
+
requester: Qn(g, t),
|
|
1618
|
+
trailingAction: _
|
|
1619
|
+
}, `${e.src}-${t}`))
|
|
1620
|
+
})
|
|
1621
|
+
});
|
|
1622
|
+
}, Er = {
|
|
1623
|
+
Composer: (e) => /* @__PURE__ */ K(Tr, {
|
|
1624
|
+
...e,
|
|
1625
|
+
state: "composer"
|
|
1626
|
+
}),
|
|
1627
|
+
Sent: (e) => /* @__PURE__ */ K(Tr, {
|
|
1628
|
+
...e,
|
|
1629
|
+
state: "sent"
|
|
1630
|
+
}),
|
|
1631
|
+
Received: (e) => /* @__PURE__ */ K(Tr, {
|
|
1632
|
+
...e,
|
|
1633
|
+
state: "received"
|
|
1634
|
+
})
|
|
1635
|
+
}, Dr = {
|
|
1496
1636
|
dark: "text-white/55",
|
|
1497
1637
|
light: "text-black/65"
|
|
1498
|
-
},
|
|
1638
|
+
}, Or = {
|
|
1499
1639
|
dark: "bg-white/10",
|
|
1500
1640
|
light: "bg-black/5"
|
|
1501
|
-
},
|
|
1641
|
+
}, kr = {
|
|
1502
1642
|
dark: "text-white/85",
|
|
1503
1643
|
light: "text-black/85"
|
|
1504
|
-
},
|
|
1505
|
-
let l = r ?? t ?? "File", u =
|
|
1506
|
-
className:
|
|
1644
|
+
}, Ar = ({ variant: e, filename: t, title: r, mimeType: i = "application/octet-stream", fileSize: a, onActivate: o, activateLabel: s, trailingAction: c }) => {
|
|
1645
|
+
let l = r ?? t ?? "File", u = nr(i, t, a), d = /* @__PURE__ */ K("div", {
|
|
1646
|
+
className: X("flex size-10 shrink-0 items-center justify-center rounded-sm", Or[e]),
|
|
1507
1647
|
"aria-hidden": !0,
|
|
1508
1648
|
children: n(i, {
|
|
1509
|
-
className:
|
|
1649
|
+
className: X("size-6", kr[e]),
|
|
1510
1650
|
weight: "regular"
|
|
1511
1651
|
})
|
|
1512
|
-
}), f = /* @__PURE__ */
|
|
1652
|
+
}), f = /* @__PURE__ */ q("div", {
|
|
1513
1653
|
className: "flex min-w-0 flex-1 flex-col text-left",
|
|
1514
|
-
children: [/* @__PURE__ */
|
|
1654
|
+
children: [/* @__PURE__ */ K("p", {
|
|
1515
1655
|
className: "truncate font-medium leading-snug",
|
|
1516
1656
|
children: l
|
|
1517
|
-
}), u ? /* @__PURE__ */
|
|
1518
|
-
className:
|
|
1657
|
+
}), u ? /* @__PURE__ */ K("p", {
|
|
1658
|
+
className: X("truncate text-xs leading-4", Dr[e]),
|
|
1519
1659
|
children: u
|
|
1520
1660
|
}) : null]
|
|
1521
|
-
}), p = o ? /* @__PURE__ */
|
|
1661
|
+
}), p = o ? /* @__PURE__ */ q("button", {
|
|
1522
1662
|
type: "button",
|
|
1523
1663
|
onClick: o,
|
|
1524
1664
|
"aria-label": s,
|
|
1525
|
-
className:
|
|
1665
|
+
className: X("flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors", e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"),
|
|
1526
1666
|
children: [d, f]
|
|
1527
|
-
}) : /* @__PURE__ */ G
|
|
1528
|
-
return /* @__PURE__ */
|
|
1667
|
+
}) : /* @__PURE__ */ q(G, { children: [d, f] });
|
|
1668
|
+
return /* @__PURE__ */ q("div", {
|
|
1529
1669
|
className: "flex items-center gap-3 px-3 py-2",
|
|
1530
|
-
children: [p, c ? /* @__PURE__ */
|
|
1670
|
+
children: [p, c ? /* @__PURE__ */ K("div", {
|
|
1531
1671
|
className: "shrink-0",
|
|
1532
1672
|
children: c
|
|
1533
1673
|
}) : null]
|
|
1534
1674
|
});
|
|
1535
|
-
}
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
let t = document.createElement("a");
|
|
1548
|
-
t.href = e, t.download = n, t.target = "_blank", t.rel = "noopener noreferrer", t.style.display = "none", document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
//#endregion
|
|
1553
|
-
//#region src/components/MessageAttachment/File/index.tsx
|
|
1554
|
-
var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
|
|
1675
|
+
}, jr = ({ onClick: e, variant: t = "overlay", ariaLabel: n = "Dismiss attachment" }) => /* @__PURE__ */ K("button", {
|
|
1676
|
+
type: "button",
|
|
1677
|
+
onClick: (t) => {
|
|
1678
|
+
t.stopPropagation(), e();
|
|
1679
|
+
},
|
|
1680
|
+
"aria-label": n,
|
|
1681
|
+
className: X("flex size-6 items-center justify-center rounded-full text-white", t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"),
|
|
1682
|
+
children: /* @__PURE__ */ K(Qe, {
|
|
1683
|
+
className: "size-3",
|
|
1684
|
+
weight: "bold"
|
|
1685
|
+
})
|
|
1686
|
+
}), Mr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
|
|
1555
1687
|
src: e,
|
|
1556
1688
|
filename: t,
|
|
1557
1689
|
fileSize: n,
|
|
1558
1690
|
mimeType: r,
|
|
1559
1691
|
title: i
|
|
1560
|
-
}] : [],
|
|
1692
|
+
}] : [], Nr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
1561
1693
|
let a = t.filename ?? Q(t.src);
|
|
1562
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ K(Ar, {
|
|
1563
1695
|
variant: e,
|
|
1564
1696
|
filename: a,
|
|
1565
1697
|
title: t.title,
|
|
@@ -1569,8 +1701,8 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1569
1701
|
activateLabel: `Download ${a}`,
|
|
1570
1702
|
trailingAction: i
|
|
1571
1703
|
});
|
|
1572
|
-
},
|
|
1573
|
-
let d =
|
|
1704
|
+
}, Pr = ({ state: e, src: t, filename: n, fileSize: r, mimeType: i, title: a, items: o, text: s, groupPosition: c, onClick: l, onDismiss: u }) => {
|
|
1705
|
+
let d = Xn(e), f = e === "composer" && !!u, p = Mr({
|
|
1574
1706
|
src: t,
|
|
1575
1707
|
filename: n,
|
|
1576
1708
|
fileSize: r,
|
|
@@ -1582,72 +1714,72 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1582
1714
|
let t = p[e];
|
|
1583
1715
|
if (!t) return;
|
|
1584
1716
|
let n = t.filename ?? Q(t.src);
|
|
1585
|
-
|
|
1717
|
+
rr(t.src, n);
|
|
1586
1718
|
};
|
|
1587
1719
|
if (p.length === 0) return null;
|
|
1588
|
-
let h = /* @__PURE__ */
|
|
1589
|
-
className:
|
|
1720
|
+
let h = /* @__PURE__ */ K("span", {
|
|
1721
|
+
className: X("flex size-8 items-center justify-center rounded-full", d === "dark" ? "text-white/70" : "text-black/70"),
|
|
1590
1722
|
"aria-hidden": !0,
|
|
1591
|
-
children: /* @__PURE__ */
|
|
1723
|
+
children: /* @__PURE__ */ K(Ie, {
|
|
1592
1724
|
className: "size-5",
|
|
1593
1725
|
weight: "bold"
|
|
1594
1726
|
})
|
|
1595
1727
|
});
|
|
1596
|
-
return /* @__PURE__ */
|
|
1728
|
+
return /* @__PURE__ */ K(Yn, {
|
|
1597
1729
|
variant: d,
|
|
1598
1730
|
text: s,
|
|
1599
1731
|
groupPosition: c,
|
|
1600
1732
|
"data-testid": "file-attachment",
|
|
1601
|
-
children: /* @__PURE__ */
|
|
1733
|
+
children: /* @__PURE__ */ K("div", {
|
|
1602
1734
|
className: "flex flex-col gap-2",
|
|
1603
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
1735
|
+
children: p.map((e, t) => /* @__PURE__ */ K(Nr, {
|
|
1604
1736
|
variant: d,
|
|
1605
1737
|
item: e,
|
|
1606
1738
|
index: t,
|
|
1607
1739
|
onActivate: m,
|
|
1608
|
-
trailingAction: f && t === 0 ? /* @__PURE__ */
|
|
1740
|
+
trailingAction: f && t === 0 ? /* @__PURE__ */ K(jr, {
|
|
1609
1741
|
onClick: u,
|
|
1610
1742
|
variant: "inline"
|
|
1611
1743
|
}) : h
|
|
1612
1744
|
}, `${e.src}-${t}`))
|
|
1613
1745
|
})
|
|
1614
1746
|
});
|
|
1615
|
-
},
|
|
1616
|
-
Composer: (e) => /* @__PURE__ */
|
|
1747
|
+
}, Fr = {
|
|
1748
|
+
Composer: (e) => /* @__PURE__ */ K(Pr, {
|
|
1617
1749
|
...e,
|
|
1618
1750
|
state: "composer"
|
|
1619
1751
|
}),
|
|
1620
|
-
Sent: (e) => /* @__PURE__ */
|
|
1752
|
+
Sent: (e) => /* @__PURE__ */ K(Pr, {
|
|
1621
1753
|
...e,
|
|
1622
1754
|
state: "sent"
|
|
1623
1755
|
}),
|
|
1624
|
-
Received: (e) => /* @__PURE__ */
|
|
1756
|
+
Received: (e) => /* @__PURE__ */ K(Pr, {
|
|
1625
1757
|
...e,
|
|
1626
1758
|
state: "received"
|
|
1627
1759
|
})
|
|
1628
|
-
},
|
|
1760
|
+
}, Ir = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", Lr = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", Rr = ({ onPrev: e, onNext: t, prevLabel: n = "Previous", nextLabel: r = "Next" }) => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("button", {
|
|
1629
1761
|
type: "button",
|
|
1630
1762
|
onClick: e,
|
|
1631
1763
|
"aria-label": n,
|
|
1632
|
-
className: `${
|
|
1633
|
-
children: /* @__PURE__ */
|
|
1764
|
+
className: `${Lr} left-4`,
|
|
1765
|
+
children: /* @__PURE__ */ K(je, {
|
|
1634
1766
|
size: 20,
|
|
1635
1767
|
weight: "bold",
|
|
1636
1768
|
"aria-hidden": !0
|
|
1637
1769
|
})
|
|
1638
|
-
}), /* @__PURE__ */
|
|
1770
|
+
}), /* @__PURE__ */ K("button", {
|
|
1639
1771
|
type: "button",
|
|
1640
1772
|
onClick: t,
|
|
1641
1773
|
"aria-label": r,
|
|
1642
|
-
className: `${
|
|
1643
|
-
children: /* @__PURE__ */
|
|
1774
|
+
className: `${Lr} right-4`,
|
|
1775
|
+
children: /* @__PURE__ */ K(Me, {
|
|
1644
1776
|
size: 20,
|
|
1645
1777
|
weight: "bold",
|
|
1646
1778
|
"aria-hidden": !0
|
|
1647
1779
|
})
|
|
1648
|
-
})] }),
|
|
1780
|
+
})] }), zr = ({ url: e, filename: t, variant: n = "pill", label: r = "Download", iconOnly: i, tone: a = "dark", onTriggered: o }) => {
|
|
1649
1781
|
let [s, c] = h(!1), u = l((n) => {
|
|
1650
|
-
n.stopPropagation(), !s && (c(!0),
|
|
1782
|
+
n.stopPropagation(), !s && (c(!0), rr(e, t).catch(() => {}).finally(() => {
|
|
1651
1783
|
c(!1), o?.();
|
|
1652
1784
|
}));
|
|
1653
1785
|
}, [
|
|
@@ -1656,63 +1788,63 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1656
1788
|
t,
|
|
1657
1789
|
o
|
|
1658
1790
|
]), d = i ?? n !== "pill", f = {
|
|
1659
|
-
className:
|
|
1791
|
+
className: X(n === "pill" ? "size-4" : "size-5", "shrink-0"),
|
|
1660
1792
|
weight: "bold"
|
|
1661
1793
|
};
|
|
1662
|
-
return n === "inline" ? /* @__PURE__ */
|
|
1794
|
+
return n === "inline" ? /* @__PURE__ */ K("button", {
|
|
1663
1795
|
type: "button",
|
|
1664
1796
|
onClick: u,
|
|
1665
1797
|
disabled: s,
|
|
1666
1798
|
"aria-label": r,
|
|
1667
|
-
className:
|
|
1799
|
+
className: X("flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70", {
|
|
1668
1800
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
1669
1801
|
light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
|
|
1670
1802
|
}[a]),
|
|
1671
|
-
children: s ? /* @__PURE__ */
|
|
1803
|
+
children: s ? /* @__PURE__ */ K(Z, {
|
|
1672
1804
|
className: "size-4 animate-spin",
|
|
1673
1805
|
weight: "bold",
|
|
1674
1806
|
"aria-hidden": !0
|
|
1675
|
-
}) : /* @__PURE__ */
|
|
1807
|
+
}) : /* @__PURE__ */ K(Ie, {
|
|
1676
1808
|
className: "size-5 shrink-0",
|
|
1677
1809
|
weight: "bold",
|
|
1678
1810
|
"aria-hidden": !0
|
|
1679
1811
|
})
|
|
1680
|
-
}) : n === "viewer" ? /* @__PURE__ */
|
|
1812
|
+
}) : n === "viewer" ? /* @__PURE__ */ K("button", {
|
|
1681
1813
|
type: "button",
|
|
1682
1814
|
onClick: u,
|
|
1683
1815
|
disabled: s,
|
|
1684
1816
|
"aria-label": r,
|
|
1685
|
-
className:
|
|
1686
|
-
children:
|
|
1817
|
+
className: Ir,
|
|
1818
|
+
children: K(s ? Z : Ie, {
|
|
1687
1819
|
size: 20,
|
|
1688
1820
|
weight: "bold",
|
|
1689
1821
|
"aria-hidden": !0
|
|
1690
1822
|
})
|
|
1691
|
-
}) : /* @__PURE__ */
|
|
1823
|
+
}) : /* @__PURE__ */ q("button", {
|
|
1692
1824
|
type: "button",
|
|
1693
1825
|
onClick: u,
|
|
1694
1826
|
disabled: s,
|
|
1695
1827
|
"aria-label": d ? r : void 0,
|
|
1696
|
-
className:
|
|
1697
|
-
children: [s ? /* @__PURE__ */
|
|
1828
|
+
className: X("mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70", a === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"),
|
|
1829
|
+
children: [s ? /* @__PURE__ */ K(Z, {
|
|
1698
1830
|
className: "size-4 animate-spin",
|
|
1699
1831
|
weight: "bold",
|
|
1700
1832
|
"aria-hidden": !0
|
|
1701
|
-
}) : /* @__PURE__ */
|
|
1833
|
+
}) : /* @__PURE__ */ K(Ie, {
|
|
1702
1834
|
...f,
|
|
1703
1835
|
"aria-hidden": !0
|
|
1704
1836
|
}), d ? null : r]
|
|
1705
1837
|
});
|
|
1706
|
-
},
|
|
1707
|
-
let r =
|
|
1838
|
+
}, Br = (e, t, n) => Math.min(Math.max(e, t), n), Vr = ({ length: e, initialIndex: t, open: n }) => {
|
|
1839
|
+
let r = Br(t, 0, Math.max(e - 1, 0)), [i, a] = h(r);
|
|
1708
1840
|
d(() => {
|
|
1709
|
-
n && a(
|
|
1841
|
+
n && a(Br(t, 0, Math.max(e - 1, 0)));
|
|
1710
1842
|
}, [
|
|
1711
1843
|
n,
|
|
1712
1844
|
t,
|
|
1713
1845
|
e
|
|
1714
1846
|
]), d(() => {
|
|
1715
|
-
a((t) =>
|
|
1847
|
+
a((t) => Br(t, 0, Math.max(e - 1, 0)));
|
|
1716
1848
|
}, [e]);
|
|
1717
1849
|
let o = l(() => {
|
|
1718
1850
|
e <= 1 || a((t) => t <= 0 ? e - 1 : t - 1);
|
|
@@ -1737,7 +1869,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1737
1869
|
prev: o,
|
|
1738
1870
|
next: s
|
|
1739
1871
|
};
|
|
1740
|
-
},
|
|
1872
|
+
}, Hr = ({ open: e, onClose: t, ariaLabel: n, counter: r, actions: i, children: a, "data-testid": o }) => {
|
|
1741
1873
|
let s = m(null), c = m(null);
|
|
1742
1874
|
return d(() => {
|
|
1743
1875
|
let t = s.current;
|
|
@@ -1773,7 +1905,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1773
1905
|
else t.removeAttribute("open");
|
|
1774
1906
|
}
|
|
1775
1907
|
}
|
|
1776
|
-
}, [e]), /* @__PURE__ */
|
|
1908
|
+
}, [e]), /* @__PURE__ */ q("dialog", {
|
|
1777
1909
|
ref: s,
|
|
1778
1910
|
className: "mes-media-viewer",
|
|
1779
1911
|
"aria-label": n ?? "Attachment viewer",
|
|
@@ -1784,63 +1916,63 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1784
1916
|
onClick: (e) => {
|
|
1785
1917
|
e.target === s.current && t();
|
|
1786
1918
|
},
|
|
1787
|
-
children: [/* @__PURE__ */
|
|
1919
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1788
1920
|
className: "pointer-events-none absolute inset-x-3 top-3 z-[1] flex items-center justify-between gap-3",
|
|
1789
|
-
children: [r ? /* @__PURE__ */
|
|
1921
|
+
children: [r ? /* @__PURE__ */ K("span", {
|
|
1790
1922
|
className: "pointer-events-auto inline-flex items-center rounded-full bg-white/[0.12] px-3 py-1.5 text-[13px] font-medium leading-none tabular-nums text-white",
|
|
1791
1923
|
children: r
|
|
1792
|
-
}) : null, /* @__PURE__ */
|
|
1924
|
+
}) : null, /* @__PURE__ */ q("div", {
|
|
1793
1925
|
className: "pointer-events-auto ml-auto inline-flex items-center gap-2",
|
|
1794
|
-
children: [i, /* @__PURE__ */
|
|
1926
|
+
children: [i, /* @__PURE__ */ K("button", {
|
|
1795
1927
|
ref: c,
|
|
1796
1928
|
type: "button",
|
|
1797
1929
|
onClick: t,
|
|
1798
1930
|
"aria-label": "Close viewer",
|
|
1799
|
-
className:
|
|
1800
|
-
children: /* @__PURE__ */
|
|
1931
|
+
className: Ir,
|
|
1932
|
+
children: /* @__PURE__ */ K(Qe, {
|
|
1801
1933
|
size: 20,
|
|
1802
1934
|
weight: "bold",
|
|
1803
1935
|
"aria-hidden": !0
|
|
1804
1936
|
})
|
|
1805
1937
|
})]
|
|
1806
1938
|
})]
|
|
1807
|
-
}), /* @__PURE__ */
|
|
1939
|
+
}), /* @__PURE__ */ K("div", {
|
|
1808
1940
|
className: "box-border flex h-full w-full items-center justify-center px-6 py-16",
|
|
1809
1941
|
children: a
|
|
1810
1942
|
})]
|
|
1811
1943
|
});
|
|
1812
|
-
},
|
|
1813
|
-
let { index: i, prev: a, next: o } =
|
|
1944
|
+
}, Ur = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
1945
|
+
let { index: i, prev: a, next: o } = Vr({
|
|
1814
1946
|
length: t.length,
|
|
1815
1947
|
initialIndex: n,
|
|
1816
1948
|
open: e
|
|
1817
1949
|
}), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "image"), [s]);
|
|
1818
|
-
return s ? /* @__PURE__ */
|
|
1950
|
+
return s ? /* @__PURE__ */ q(Hr, {
|
|
1819
1951
|
open: e,
|
|
1820
1952
|
onClose: r,
|
|
1821
1953
|
ariaLabel: c,
|
|
1822
1954
|
counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
|
|
1823
|
-
actions: /* @__PURE__ */
|
|
1955
|
+
actions: /* @__PURE__ */ K(zr, {
|
|
1824
1956
|
url: s.src,
|
|
1825
1957
|
filename: c,
|
|
1826
1958
|
variant: "viewer",
|
|
1827
1959
|
label: `Download ${c}`
|
|
1828
1960
|
}),
|
|
1829
1961
|
"data-testid": "image-viewer",
|
|
1830
|
-
children: [e ? /* @__PURE__ */
|
|
1962
|
+
children: [e ? /* @__PURE__ */ K("img", {
|
|
1831
1963
|
src: s.src,
|
|
1832
1964
|
alt: s.alt ?? c,
|
|
1833
1965
|
draggable: !1,
|
|
1834
1966
|
decoding: "async",
|
|
1835
1967
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] select-none object-contain"
|
|
1836
|
-
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */
|
|
1968
|
+
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ K(Rr, {
|
|
1837
1969
|
onPrev: a,
|
|
1838
1970
|
onNext: o,
|
|
1839
1971
|
prevLabel: "Previous image",
|
|
1840
1972
|
nextLabel: "Next image"
|
|
1841
1973
|
}) : null]
|
|
1842
1974
|
}) : null;
|
|
1843
|
-
},
|
|
1975
|
+
}, Wr = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", Gr = {
|
|
1844
1976
|
1: ["rounded-[18px]"],
|
|
1845
1977
|
2: ["rounded-l-[18px]", "rounded-r-[18px]"],
|
|
1846
1978
|
3: [
|
|
@@ -1854,55 +1986,55 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1854
1986
|
"rounded-bl-[18px]",
|
|
1855
1987
|
"rounded-br-[18px]"
|
|
1856
1988
|
]
|
|
1857
|
-
},
|
|
1989
|
+
}, Kr = "--mes-single-width-cap", qr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", Jr = 436, Yr = ({ tiles: e, onTileActivate: t, maxVisible: n = 4, singleAspectRatio: r, className: i }) => {
|
|
1858
1990
|
let a = e.length;
|
|
1859
1991
|
if (a === 0) return null;
|
|
1860
|
-
let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */
|
|
1992
|
+
let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */ q("div", {
|
|
1861
1993
|
"aria-hidden": !0,
|
|
1862
1994
|
className: "absolute inset-0 flex items-center justify-center bg-[#040403]/50 text-2xl font-bold leading-[28px] tracking-[-0.24px] text-white",
|
|
1863
1995
|
children: ["+", s]
|
|
1864
1996
|
}) : null, l = (e, n, r) => {
|
|
1865
|
-
let i =
|
|
1866
|
-
return t ? /* @__PURE__ */
|
|
1997
|
+
let i = X(Wr, "h-full w-full", Gr[o.length]?.[n]);
|
|
1998
|
+
return t ? /* @__PURE__ */ q("button", {
|
|
1867
1999
|
type: "button",
|
|
1868
2000
|
onClick: () => t(n),
|
|
1869
2001
|
"aria-label": e.ariaLabel ?? `Open media ${n + 1}`,
|
|
1870
|
-
className:
|
|
2002
|
+
className: X(i, e.cursorClassName ?? "cursor-zoom-in"),
|
|
1871
2003
|
children: [e.content, r]
|
|
1872
|
-
}, n) : /* @__PURE__ */
|
|
2004
|
+
}, n) : /* @__PURE__ */ q("div", {
|
|
1873
2005
|
className: i,
|
|
1874
2006
|
children: [e.content, r]
|
|
1875
2007
|
}, n);
|
|
1876
2008
|
}, u;
|
|
1877
2009
|
return r && (u = {
|
|
1878
2010
|
aspectRatio: r,
|
|
1879
|
-
width: `min(var(${
|
|
2011
|
+
width: `min(var(${Kr}), ${Math.round(Jr * r * 100) / 100}px)`,
|
|
1880
2012
|
maxWidth: "100%"
|
|
1881
|
-
}), o.length === 1 ? /* @__PURE__ */
|
|
1882
|
-
className:
|
|
2013
|
+
}), o.length === 1 ? /* @__PURE__ */ K("div", {
|
|
2014
|
+
className: X(r ? qr : "aspect-square w-full", i),
|
|
1883
2015
|
style: u,
|
|
1884
2016
|
children: l(o[0], 0, c)
|
|
1885
|
-
}) : o.length === 2 ? /* @__PURE__ */
|
|
1886
|
-
className:
|
|
2017
|
+
}) : o.length === 2 ? /* @__PURE__ */ K("div", {
|
|
2018
|
+
className: X("grid aspect-[16/9] w-full grid-cols-2 gap-0.5", i),
|
|
1887
2019
|
children: o.map((e, t) => l(e, t, t === o.length - 1 ? c : null))
|
|
1888
|
-
}) : o.length === 3 ? /* @__PURE__ */
|
|
1889
|
-
className:
|
|
2020
|
+
}) : o.length === 3 ? /* @__PURE__ */ q("div", {
|
|
2021
|
+
className: X("grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
|
|
1890
2022
|
children: [
|
|
1891
|
-
/* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ K("div", {
|
|
1892
2024
|
className: "row-span-2",
|
|
1893
2025
|
children: l(o[0], 0)
|
|
1894
2026
|
}),
|
|
1895
2027
|
l(o[1], 1),
|
|
1896
2028
|
l(o[2], 2, c)
|
|
1897
2029
|
]
|
|
1898
|
-
}) : /* @__PURE__ */
|
|
1899
|
-
className:
|
|
2030
|
+
}) : /* @__PURE__ */ K("div", {
|
|
2031
|
+
className: X("grid aspect-[379/286] w-full grid-cols-2 grid-rows-2 gap-0.5", i),
|
|
1900
2032
|
children: o.map((e, t) => {
|
|
1901
2033
|
let n = s > 0 && t === o.length - 1;
|
|
1902
2034
|
return l(e, t, n ? c : null);
|
|
1903
2035
|
})
|
|
1904
2036
|
});
|
|
1905
|
-
},
|
|
2037
|
+
}, Xr = ({ src: e, suppliedRatio: t, fallbackRatio: n }) => {
|
|
1906
2038
|
let [r, i] = o.useState(), a = o.useCallback((t) => {
|
|
1907
2039
|
if (!t || t.naturalWidth <= 0 || t.naturalHeight <= 0 || e === void 0) return;
|
|
1908
2040
|
let n = t.naturalWidth / t.naturalHeight;
|
|
@@ -1916,7 +2048,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1916
2048
|
imgRef: a,
|
|
1917
2049
|
onLoad: s
|
|
1918
2050
|
};
|
|
1919
|
-
},
|
|
2051
|
+
}, Zr = (e) => {
|
|
1920
2052
|
let [t, n] = h(!1), [r, i] = h(0);
|
|
1921
2053
|
return {
|
|
1922
2054
|
viewerOpen: t,
|
|
@@ -1926,9 +2058,9 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1926
2058
|
}, [e]),
|
|
1927
2059
|
closeViewer: l(() => n(!1), [])
|
|
1928
2060
|
};
|
|
1929
|
-
},
|
|
2061
|
+
}, Qr = ({ item: e, index: t, totalCount: n, fallbackLoading: r, imgRef: i, onLoad: o }) => ({
|
|
1930
2062
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
1931
|
-
content: /* @__PURE__ */
|
|
2063
|
+
content: /* @__PURE__ */ K("img", {
|
|
1932
2064
|
ref: i,
|
|
1933
2065
|
src: a(e.src) ?? e.src,
|
|
1934
2066
|
alt: e.alt ?? "",
|
|
@@ -1940,24 +2072,24 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1940
2072
|
onLoad: o,
|
|
1941
2073
|
className: "absolute inset-0 size-full object-cover"
|
|
1942
2074
|
})
|
|
1943
|
-
}),
|
|
2075
|
+
}), $r = ({ src: e, alt: t, items: n }) => n && n.length > 0 ? n : e ? [{
|
|
1944
2076
|
src: e,
|
|
1945
2077
|
alt: t
|
|
1946
|
-
}] : [],
|
|
2078
|
+
}] : [], ei = (e, t) => e.map((n, r) => ({
|
|
1947
2079
|
src: n.src,
|
|
1948
2080
|
alt: n.alt,
|
|
1949
2081
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
1950
|
-
})),
|
|
1951
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
1952
|
-
return /* @__PURE__ */
|
|
2082
|
+
})), ti = ({ src: e, alt: t, filename: n, loading: r = "lazy", onClick: i, onDismiss: o }) => {
|
|
2083
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Zr(i);
|
|
2084
|
+
return /* @__PURE__ */ q("div", {
|
|
1953
2085
|
className: "relative w-fit",
|
|
1954
2086
|
children: [
|
|
1955
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ K("button", {
|
|
1956
2088
|
type: "button",
|
|
1957
2089
|
onClick: () => l(0),
|
|
1958
2090
|
"aria-label": "Open image",
|
|
1959
2091
|
className: "block size-[280px] cursor-zoom-in overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
1960
|
-
children: /* @__PURE__ */
|
|
2092
|
+
children: /* @__PURE__ */ K("img", {
|
|
1961
2093
|
src: a(e) ?? e,
|
|
1962
2094
|
alt: t ?? "",
|
|
1963
2095
|
draggable: !1,
|
|
@@ -1966,13 +2098,13 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1966
2098
|
className: "size-full object-cover"
|
|
1967
2099
|
})
|
|
1968
2100
|
}),
|
|
1969
|
-
o ? /* @__PURE__ */
|
|
2101
|
+
o ? /* @__PURE__ */ K("div", {
|
|
1970
2102
|
className: "absolute right-2 top-2 z-10",
|
|
1971
|
-
children: /* @__PURE__ */
|
|
2103
|
+
children: /* @__PURE__ */ K(jr, { onClick: o })
|
|
1972
2104
|
}) : null,
|
|
1973
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ K(Ur, {
|
|
1974
2106
|
open: s,
|
|
1975
|
-
items:
|
|
2107
|
+
items: ei([{
|
|
1976
2108
|
src: e,
|
|
1977
2109
|
alt: t
|
|
1978
2110
|
}], n),
|
|
@@ -1981,18 +2113,18 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1981
2113
|
})
|
|
1982
2114
|
]
|
|
1983
2115
|
});
|
|
1984
|
-
},
|
|
1985
|
-
let l =
|
|
2116
|
+
}, ni = 326 / 246, ri = ({ state: e, src: t, alt: n, filename: r, items: i, text: a, groupPosition: o, loading: s = "lazy", onClick: c }) => {
|
|
2117
|
+
let l = $r({
|
|
1986
2118
|
src: t,
|
|
1987
2119
|
alt: n,
|
|
1988
2120
|
items: i
|
|
1989
|
-
}), u =
|
|
2121
|
+
}), u = Xn(e), { viewerOpen: d, viewerIndex: f, handleActivate: p, closeViewer: m } = Zr(c), h = l.length === 1, g = h ? l[0] : void 0, _ = Xr({
|
|
1990
2122
|
src: g?.src,
|
|
1991
2123
|
suppliedRatio: g?.width && g?.height ? g.width / g.height : void 0,
|
|
1992
|
-
fallbackRatio:
|
|
2124
|
+
fallbackRatio: ni
|
|
1993
2125
|
});
|
|
1994
2126
|
if (l.length === 0) return null;
|
|
1995
|
-
let v = l.map((e, t) =>
|
|
2127
|
+
let v = l.map((e, t) => Qr({
|
|
1996
2128
|
item: e,
|
|
1997
2129
|
index: t,
|
|
1998
2130
|
totalCount: l.length,
|
|
@@ -2000,7 +2132,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2000
2132
|
imgRef: h ? _.imgRef : void 0,
|
|
2001
2133
|
onLoad: h ? _.onLoad : void 0
|
|
2002
2134
|
}));
|
|
2003
|
-
return /* @__PURE__ */
|
|
2135
|
+
return /* @__PURE__ */ q(Yn, {
|
|
2004
2136
|
variant: u,
|
|
2005
2137
|
text: a,
|
|
2006
2138
|
groupPosition: o,
|
|
@@ -2009,65 +2141,65 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2009
2141
|
paddingClassName: "p-0.5",
|
|
2010
2142
|
radiusClassName: "rounded-[20px]",
|
|
2011
2143
|
"data-testid": "image-attachment",
|
|
2012
|
-
children: [/* @__PURE__ */
|
|
2144
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2013
2145
|
className: "relative",
|
|
2014
|
-
children: /* @__PURE__ */
|
|
2146
|
+
children: /* @__PURE__ */ K(Yr, {
|
|
2015
2147
|
tiles: v,
|
|
2016
2148
|
onTileActivate: p,
|
|
2017
2149
|
singleAspectRatio: h ? _.ratio : void 0
|
|
2018
2150
|
})
|
|
2019
|
-
}), /* @__PURE__ */
|
|
2151
|
+
}), /* @__PURE__ */ K(Ur, {
|
|
2020
2152
|
open: d,
|
|
2021
|
-
items:
|
|
2153
|
+
items: ei(l, r),
|
|
2022
2154
|
initialIndex: f,
|
|
2023
2155
|
onClose: m
|
|
2024
2156
|
})]
|
|
2025
2157
|
});
|
|
2026
|
-
},
|
|
2027
|
-
Composer: (e) => /* @__PURE__ */
|
|
2028
|
-
Sent: (e) => /* @__PURE__ */
|
|
2158
|
+
}, ii = {
|
|
2159
|
+
Composer: (e) => /* @__PURE__ */ K(ti, { ...e }),
|
|
2160
|
+
Sent: (e) => /* @__PURE__ */ K(ri, {
|
|
2029
2161
|
...e,
|
|
2030
2162
|
state: "sent"
|
|
2031
2163
|
}),
|
|
2032
|
-
Received: (e) => /* @__PURE__ */
|
|
2164
|
+
Received: (e) => /* @__PURE__ */ K(ri, {
|
|
2033
2165
|
...e,
|
|
2034
2166
|
state: "received"
|
|
2035
2167
|
})
|
|
2036
|
-
},
|
|
2037
|
-
let { index: i, prev: a, next: o } =
|
|
2168
|
+
}, ai = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
2169
|
+
let { index: i, prev: a, next: o } = Vr({
|
|
2038
2170
|
length: t.length,
|
|
2039
2171
|
initialIndex: n,
|
|
2040
2172
|
open: e
|
|
2041
|
-
}), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "document"), [s]), l = p(() => s ?
|
|
2042
|
-
return !s || !l ? null : /* @__PURE__ */
|
|
2173
|
+
}), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "document"), [s]), l = p(() => s ? oi(s.src) : void 0, [s]);
|
|
2174
|
+
return !s || !l ? null : /* @__PURE__ */ q(Hr, {
|
|
2043
2175
|
open: e,
|
|
2044
2176
|
onClose: r,
|
|
2045
2177
|
ariaLabel: c,
|
|
2046
2178
|
counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
|
|
2047
2179
|
"data-testid": "pdf-viewer",
|
|
2048
|
-
children: [/* @__PURE__ */
|
|
2180
|
+
children: [/* @__PURE__ */ K("iframe", {
|
|
2049
2181
|
src: l,
|
|
2050
2182
|
title: c,
|
|
2051
2183
|
className: "block h-[calc(100dvh-128px)] w-[min(96vw,1400px)] border-0 bg-white",
|
|
2052
2184
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
2053
|
-
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */
|
|
2185
|
+
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ K(Rr, {
|
|
2054
2186
|
onPrev: a,
|
|
2055
2187
|
onNext: o,
|
|
2056
2188
|
prevLabel: "Previous document",
|
|
2057
2189
|
nextLabel: "Next document"
|
|
2058
2190
|
}) : null]
|
|
2059
2191
|
});
|
|
2060
|
-
},
|
|
2192
|
+
}, oi = (e) => {
|
|
2061
2193
|
let t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1), i = new URLSearchParams(r);
|
|
2062
2194
|
return i.has("toolbar") || i.set("toolbar", "0"), i.has("navpanes") || i.set("navpanes", "0"), `${n}#${i.toString()}`;
|
|
2063
|
-
},
|
|
2195
|
+
}, si = ({ src: e, filename: t, fileSize: n, title: r, items: i }) => i && i.length > 0 ? i : e ? [{
|
|
2064
2196
|
src: e,
|
|
2065
2197
|
filename: t,
|
|
2066
2198
|
fileSize: n,
|
|
2067
2199
|
title: r
|
|
2068
|
-
}] : [],
|
|
2200
|
+
}] : [], ci = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
2069
2201
|
let a = t.filename ?? Q(t.src);
|
|
2070
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ K(Ar, {
|
|
2071
2203
|
variant: e,
|
|
2072
2204
|
filename: a,
|
|
2073
2205
|
title: t.title,
|
|
@@ -2077,38 +2209,38 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2077
2209
|
activateLabel: `Open ${a}`,
|
|
2078
2210
|
trailingAction: i
|
|
2079
2211
|
});
|
|
2080
|
-
},
|
|
2081
|
-
let u =
|
|
2212
|
+
}, li = ({ state: e, src: t, filename: n, fileSize: r, title: i, items: a, text: o, groupPosition: s, onClick: c, onDismiss: l }) => {
|
|
2213
|
+
let u = Xn(e), d = si({
|
|
2082
2214
|
src: t,
|
|
2083
2215
|
filename: n,
|
|
2084
2216
|
fileSize: r,
|
|
2085
2217
|
title: i,
|
|
2086
2218
|
items: a
|
|
2087
|
-
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } =
|
|
2219
|
+
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Zr(c), g = e === "composer" && !!l;
|
|
2088
2220
|
if (d.length === 0) return null;
|
|
2089
2221
|
let _ = d.map((e) => ({
|
|
2090
2222
|
src: e.src,
|
|
2091
2223
|
filename: e.filename ?? Q(e.src)
|
|
2092
2224
|
}));
|
|
2093
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ q(Yn, {
|
|
2094
2226
|
variant: u,
|
|
2095
2227
|
text: o,
|
|
2096
2228
|
groupPosition: s,
|
|
2097
2229
|
"data-testid": "pdf-attachment",
|
|
2098
|
-
children: [/* @__PURE__ */
|
|
2230
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2099
2231
|
className: "flex flex-col gap-2",
|
|
2100
2232
|
children: d.map((t, n) => {
|
|
2101
|
-
let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */
|
|
2233
|
+
let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */ K(jr, {
|
|
2102
2234
|
onClick: l,
|
|
2103
2235
|
variant: "inline"
|
|
2104
|
-
}) : e === "composer" ? void 0 : /* @__PURE__ */
|
|
2236
|
+
}) : e === "composer" ? void 0 : /* @__PURE__ */ K(zr, {
|
|
2105
2237
|
url: t.src,
|
|
2106
2238
|
filename: r,
|
|
2107
2239
|
variant: "inline",
|
|
2108
2240
|
label: `Download ${r}`,
|
|
2109
2241
|
tone: u
|
|
2110
2242
|
});
|
|
2111
|
-
return /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ K(ci, {
|
|
2112
2244
|
variant: u,
|
|
2113
2245
|
item: t,
|
|
2114
2246
|
index: n,
|
|
@@ -2116,32 +2248,32 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2116
2248
|
trailingAction: i
|
|
2117
2249
|
}, `${t.src}-${n}`);
|
|
2118
2250
|
})
|
|
2119
|
-
}), /* @__PURE__ */
|
|
2251
|
+
}), /* @__PURE__ */ K(ai, {
|
|
2120
2252
|
open: f,
|
|
2121
2253
|
items: _,
|
|
2122
2254
|
initialIndex: p,
|
|
2123
2255
|
onClose: h
|
|
2124
2256
|
})]
|
|
2125
2257
|
});
|
|
2126
|
-
},
|
|
2127
|
-
Composer: (e) => /* @__PURE__ */
|
|
2258
|
+
}, ui = {
|
|
2259
|
+
Composer: (e) => /* @__PURE__ */ K(li, {
|
|
2128
2260
|
...e,
|
|
2129
2261
|
state: "composer"
|
|
2130
2262
|
}),
|
|
2131
|
-
Sent: (e) => /* @__PURE__ */
|
|
2263
|
+
Sent: (e) => /* @__PURE__ */ K(li, {
|
|
2132
2264
|
...e,
|
|
2133
2265
|
state: "sent"
|
|
2134
2266
|
}),
|
|
2135
|
-
Received: (e) => /* @__PURE__ */
|
|
2267
|
+
Received: (e) => /* @__PURE__ */ K(li, {
|
|
2136
2268
|
...e,
|
|
2137
2269
|
state: "received"
|
|
2138
2270
|
})
|
|
2139
|
-
},
|
|
2140
|
-
let { index: a, prev: o, next: s } =
|
|
2271
|
+
}, di = 150, fi = ({ open: e, items: t, initialIndex: n = 0, onClose: i }) => {
|
|
2272
|
+
let { index: a, prev: o, next: s } = Vr({
|
|
2141
2273
|
length: t.length,
|
|
2142
2274
|
initialIndex: n,
|
|
2143
2275
|
open: e
|
|
2144
|
-
}), c = m(null), l =
|
|
2276
|
+
}), c = m(null), l = he();
|
|
2145
2277
|
d(() => {
|
|
2146
2278
|
e && (l?.pause(), r(c.current));
|
|
2147
2279
|
}, [e, l]);
|
|
@@ -2149,17 +2281,17 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2149
2281
|
e && !u && f(!0), d(() => {
|
|
2150
2282
|
if (e || !u) return;
|
|
2151
2283
|
c.current?.pause();
|
|
2152
|
-
let t = window.setTimeout(() => f(!1),
|
|
2284
|
+
let t = window.setTimeout(() => f(!1), di);
|
|
2153
2285
|
return () => window.clearTimeout(t);
|
|
2154
2286
|
}, [e, u]);
|
|
2155
2287
|
let g = t[a], _ = p(() => g?.filename ?? (g ? Q(g.src) : "video"), [g]);
|
|
2156
|
-
return g ? /* @__PURE__ */
|
|
2288
|
+
return g ? /* @__PURE__ */ q(Hr, {
|
|
2157
2289
|
open: e,
|
|
2158
2290
|
onClose: i,
|
|
2159
2291
|
ariaLabel: _,
|
|
2160
2292
|
counter: t.length > 1 ? `${a + 1} / ${t.length}` : void 0,
|
|
2161
2293
|
"data-testid": "video-viewer",
|
|
2162
|
-
children: [u ? /* @__PURE__ */
|
|
2294
|
+
children: [u ? /* @__PURE__ */ K("video", {
|
|
2163
2295
|
ref: c,
|
|
2164
2296
|
"data-testid": "video-viewer-media",
|
|
2165
2297
|
src: g.src,
|
|
@@ -2170,35 +2302,35 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2170
2302
|
playsInline: !0,
|
|
2171
2303
|
preload: g.preload ?? "metadata",
|
|
2172
2304
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] bg-black",
|
|
2173
|
-
children: g.mimeType ? /* @__PURE__ */
|
|
2305
|
+
children: g.mimeType ? /* @__PURE__ */ K("source", {
|
|
2174
2306
|
src: g.src,
|
|
2175
2307
|
type: g.mimeType
|
|
2176
2308
|
}) : null
|
|
2177
|
-
}, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */
|
|
2309
|
+
}, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */ K(Rr, {
|
|
2178
2310
|
onPrev: o,
|
|
2179
2311
|
onNext: s,
|
|
2180
2312
|
prevLabel: "Previous video",
|
|
2181
2313
|
nextLabel: "Next video"
|
|
2182
2314
|
}) : null]
|
|
2183
2315
|
}) : null;
|
|
2184
|
-
},
|
|
2316
|
+
}, pi = 1, mi = 4 / 5, hi = 16 / 9, gi = () => /* @__PURE__ */ K("div", {
|
|
2185
2317
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
2186
|
-
children: /* @__PURE__ */
|
|
2318
|
+
children: /* @__PURE__ */ K("span", {
|
|
2187
2319
|
className: "flex size-12 items-center justify-center rounded-full bg-black/25 text-white backdrop-blur-[20px]",
|
|
2188
|
-
children: /* @__PURE__ */
|
|
2320
|
+
children: /* @__PURE__ */ K(He, {
|
|
2189
2321
|
className: "size-6",
|
|
2190
2322
|
weight: "fill",
|
|
2191
2323
|
"aria-hidden": !0
|
|
2192
2324
|
})
|
|
2193
2325
|
})
|
|
2194
|
-
}),
|
|
2326
|
+
}), _i = (e) => {
|
|
2195
2327
|
let t = e.indexOf("#");
|
|
2196
2328
|
if (t === -1) return `${e}#t=0.001`;
|
|
2197
2329
|
let n = e.slice(t + 1);
|
|
2198
2330
|
return /(^|&)t=/.test(n) ? e : `${e}&t=0.001`;
|
|
2199
|
-
},
|
|
2331
|
+
}, vi = ({ item: e, index: t, showPlayBadge: n = !0, imgRef: r, onLoad: i }) => /* @__PURE__ */ q("div", {
|
|
2200
2332
|
className: "absolute inset-0 size-full bg-[#0d0d0d]",
|
|
2201
|
-
children: [e.poster ? /* @__PURE__ */
|
|
2333
|
+
children: [e.poster ? /* @__PURE__ */ K("img", {
|
|
2202
2334
|
ref: r,
|
|
2203
2335
|
src: e.poster,
|
|
2204
2336
|
alt: `Video ${t + 1} thumbnail`,
|
|
@@ -2207,32 +2339,32 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2207
2339
|
decoding: "async",
|
|
2208
2340
|
onLoad: i,
|
|
2209
2341
|
className: "absolute inset-0 size-full object-cover"
|
|
2210
|
-
}) : e.src && e.preload !== "none" ? /* @__PURE__ */
|
|
2211
|
-
src:
|
|
2342
|
+
}) : e.src && e.preload !== "none" ? /* @__PURE__ */ K("video", {
|
|
2343
|
+
src: _i(e.src),
|
|
2212
2344
|
muted: !0,
|
|
2213
2345
|
playsInline: !0,
|
|
2214
2346
|
preload: "metadata",
|
|
2215
2347
|
"aria-label": `Video ${t + 1} thumbnail`,
|
|
2216
2348
|
className: "absolute inset-0 size-full object-cover"
|
|
2217
|
-
}) : /* @__PURE__ */
|
|
2349
|
+
}) : /* @__PURE__ */ K("div", {
|
|
2218
2350
|
className: "absolute inset-0 flex items-center justify-center",
|
|
2219
|
-
children: /* @__PURE__ */
|
|
2351
|
+
children: /* @__PURE__ */ K(Xe, {
|
|
2220
2352
|
className: "size-16 text-white/30",
|
|
2221
2353
|
weight: "regular",
|
|
2222
2354
|
"aria-hidden": !0
|
|
2223
2355
|
})
|
|
2224
|
-
}), n ? /* @__PURE__ */
|
|
2225
|
-
}),
|
|
2356
|
+
}), n ? /* @__PURE__ */ K(gi, {}) : null]
|
|
2357
|
+
}), yi = ({ item: e, index: t, totalCount: n, isOverflowTile: r, imgRef: i, onLoad: a }) => ({
|
|
2226
2358
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2227
2359
|
cursorClassName: "cursor-pointer",
|
|
2228
|
-
content: /* @__PURE__ */
|
|
2360
|
+
content: /* @__PURE__ */ K(vi, {
|
|
2229
2361
|
item: e,
|
|
2230
2362
|
index: t,
|
|
2231
2363
|
showPlayBadge: !r,
|
|
2232
2364
|
imgRef: i,
|
|
2233
2365
|
onLoad: a
|
|
2234
2366
|
})
|
|
2235
|
-
}),
|
|
2367
|
+
}), bi = ({ src: e, poster: t, mimeType: n, preload: r, naturalAspectRatio: i, items: a }) => a && a.length > 0 ? r ? a.map((e) => ({
|
|
2236
2368
|
...e,
|
|
2237
2369
|
preload: e.preload ?? r
|
|
2238
2370
|
})) : a : e ? [{
|
|
@@ -2241,23 +2373,23 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2241
2373
|
mimeType: n,
|
|
2242
2374
|
preload: r,
|
|
2243
2375
|
naturalAspectRatio: i
|
|
2244
|
-
}] : [],
|
|
2376
|
+
}] : [], xi = (e, t) => e.map((n, r) => ({
|
|
2245
2377
|
src: n.src,
|
|
2246
2378
|
poster: n.poster,
|
|
2247
2379
|
mimeType: n.mimeType,
|
|
2248
2380
|
preload: n.preload,
|
|
2249
2381
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
2250
|
-
})),
|
|
2251
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
2252
|
-
return /* @__PURE__ */
|
|
2382
|
+
})), Si = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
|
|
2383
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Zr(a);
|
|
2384
|
+
return /* @__PURE__ */ q("div", {
|
|
2253
2385
|
className: "relative w-fit",
|
|
2254
2386
|
children: [
|
|
2255
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ K("button", {
|
|
2256
2388
|
type: "button",
|
|
2257
2389
|
onClick: () => l(0),
|
|
2258
2390
|
"aria-label": "Play video",
|
|
2259
2391
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2260
|
-
children: /* @__PURE__ */
|
|
2392
|
+
children: /* @__PURE__ */ K(vi, {
|
|
2261
2393
|
item: {
|
|
2262
2394
|
src: e,
|
|
2263
2395
|
poster: t,
|
|
@@ -2267,13 +2399,13 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2267
2399
|
index: 0
|
|
2268
2400
|
})
|
|
2269
2401
|
}),
|
|
2270
|
-
o ? /* @__PURE__ */
|
|
2402
|
+
o ? /* @__PURE__ */ K("div", {
|
|
2271
2403
|
className: "absolute right-2 top-2 z-10",
|
|
2272
|
-
children: /* @__PURE__ */
|
|
2404
|
+
children: /* @__PURE__ */ K(jr, { onClick: o })
|
|
2273
2405
|
}) : null,
|
|
2274
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ K(fi, {
|
|
2275
2407
|
open: s,
|
|
2276
|
-
items:
|
|
2408
|
+
items: xi([{
|
|
2277
2409
|
src: e,
|
|
2278
2410
|
poster: t,
|
|
2279
2411
|
mimeType: n,
|
|
@@ -2284,29 +2416,29 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2284
2416
|
})
|
|
2285
2417
|
]
|
|
2286
2418
|
});
|
|
2287
|
-
},
|
|
2288
|
-
let d =
|
|
2419
|
+
}, Ci = ({ state: e, src: t, poster: n, mimeType: r, filename: i, items: a, text: o, groupPosition: s, preload: c, naturalAspectRatio: l, onClick: u }) => {
|
|
2420
|
+
let d = bi({
|
|
2289
2421
|
src: t,
|
|
2290
2422
|
poster: n,
|
|
2291
2423
|
mimeType: r,
|
|
2292
2424
|
preload: c,
|
|
2293
2425
|
naturalAspectRatio: l,
|
|
2294
2426
|
items: a
|
|
2295
|
-
}), f =
|
|
2427
|
+
}), f = Xn(e), { viewerOpen: p, viewerIndex: m, handleActivate: h, closeViewer: g } = Zr(u), _ = d.length === 1, v = _ ? d[0] : void 0, y = Xr({
|
|
2296
2428
|
src: v?.poster,
|
|
2297
2429
|
suppliedRatio: v?.naturalAspectRatio,
|
|
2298
|
-
fallbackRatio:
|
|
2430
|
+
fallbackRatio: pi
|
|
2299
2431
|
});
|
|
2300
2432
|
if (d.length === 0) return null;
|
|
2301
|
-
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) =>
|
|
2433
|
+
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) => yi({
|
|
2302
2434
|
item: e,
|
|
2303
2435
|
index: t,
|
|
2304
2436
|
totalCount: d.length,
|
|
2305
2437
|
isOverflowTile: t === b,
|
|
2306
2438
|
imgRef: _ ? y.imgRef : void 0,
|
|
2307
2439
|
onLoad: _ ? y.onLoad : void 0
|
|
2308
|
-
})), S = Math.min(Math.max(y.ratio,
|
|
2309
|
-
return /* @__PURE__ */
|
|
2440
|
+
})), S = Math.min(Math.max(y.ratio, mi), hi);
|
|
2441
|
+
return /* @__PURE__ */ q(Yn, {
|
|
2310
2442
|
variant: f,
|
|
2311
2443
|
text: o,
|
|
2312
2444
|
groupPosition: s,
|
|
@@ -2315,75 +2447,75 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2315
2447
|
paddingClassName: "p-0.5",
|
|
2316
2448
|
radiusClassName: s && s !== "single" ? void 0 : "rounded-[20px]",
|
|
2317
2449
|
"data-testid": "video-attachment",
|
|
2318
|
-
children: [/* @__PURE__ */
|
|
2450
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2319
2451
|
className: "relative",
|
|
2320
|
-
children: /* @__PURE__ */
|
|
2452
|
+
children: /* @__PURE__ */ K(Yr, {
|
|
2321
2453
|
tiles: x,
|
|
2322
2454
|
onTileActivate: h,
|
|
2323
2455
|
singleAspectRatio: _ ? S : void 0
|
|
2324
2456
|
})
|
|
2325
|
-
}), /* @__PURE__ */
|
|
2457
|
+
}), /* @__PURE__ */ K(fi, {
|
|
2326
2458
|
open: p,
|
|
2327
|
-
items:
|
|
2459
|
+
items: xi(d, i),
|
|
2328
2460
|
initialIndex: m,
|
|
2329
2461
|
onClose: g
|
|
2330
2462
|
})]
|
|
2331
2463
|
});
|
|
2332
|
-
},
|
|
2333
|
-
Image:
|
|
2464
|
+
}, wi = {
|
|
2465
|
+
Image: ii,
|
|
2334
2466
|
Video: {
|
|
2335
|
-
Composer: (e) => /* @__PURE__ */
|
|
2336
|
-
Sent: (e) => /* @__PURE__ */
|
|
2467
|
+
Composer: (e) => /* @__PURE__ */ K(Si, { ...e }),
|
|
2468
|
+
Sent: (e) => /* @__PURE__ */ K(Ci, {
|
|
2337
2469
|
...e,
|
|
2338
2470
|
state: "sent"
|
|
2339
2471
|
}),
|
|
2340
|
-
Received: (e) => /* @__PURE__ */
|
|
2472
|
+
Received: (e) => /* @__PURE__ */ K(Ci, {
|
|
2341
2473
|
...e,
|
|
2342
2474
|
state: "received"
|
|
2343
2475
|
})
|
|
2344
2476
|
},
|
|
2345
|
-
Audio:
|
|
2346
|
-
Pdf:
|
|
2347
|
-
File:
|
|
2477
|
+
Audio: Er,
|
|
2478
|
+
Pdf: ui,
|
|
2479
|
+
File: Fr
|
|
2348
2480
|
};
|
|
2349
2481
|
//#endregion
|
|
2350
2482
|
//#region src/components/CustomMessage/StreamAttachmentMessage.tsx
|
|
2351
2483
|
function $(e) {
|
|
2352
2484
|
return e?.trim() || void 0;
|
|
2353
2485
|
}
|
|
2354
|
-
function
|
|
2486
|
+
function Ti(e) {
|
|
2355
2487
|
let { original_width: t, original_height: n } = e;
|
|
2356
2488
|
if (typeof t == "number" && typeof n == "number" && !(!Number.isFinite(t) || !Number.isFinite(n)) && !(t <= 0 || n <= 0)) return t / n;
|
|
2357
2489
|
}
|
|
2358
|
-
function
|
|
2490
|
+
function Ei(e) {
|
|
2359
2491
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
2360
2492
|
}
|
|
2361
|
-
function
|
|
2493
|
+
function Di(e, t) {
|
|
2362
2494
|
if (!e?.trim() || !t?.trim()) return !1;
|
|
2363
|
-
let n =
|
|
2495
|
+
let n = Ei(e), r = Ei(t);
|
|
2364
2496
|
if (n === r) return !0;
|
|
2365
2497
|
if (!n.includes(r)) return !1;
|
|
2366
2498
|
let i = n.split(r).join("");
|
|
2367
2499
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(i);
|
|
2368
2500
|
}
|
|
2369
|
-
function
|
|
2370
|
-
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), o = n &&
|
|
2501
|
+
function Oi(e) {
|
|
2502
|
+
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), o = n && Yt(r, i) ? void 0 : i;
|
|
2371
2503
|
return {
|
|
2372
2504
|
title: $(e.title),
|
|
2373
2505
|
description: $(e.text),
|
|
2374
2506
|
url: t,
|
|
2375
2507
|
thumbnailUrl: a(n),
|
|
2376
2508
|
sourceUrl: o,
|
|
2377
|
-
layout: n ||
|
|
2509
|
+
layout: n || Xt(r, o) ? "featured" : "classic",
|
|
2378
2510
|
mimeType: r,
|
|
2379
2511
|
accentColor: $(e.accent_color),
|
|
2380
2512
|
status: "ready"
|
|
2381
2513
|
};
|
|
2382
2514
|
}
|
|
2383
|
-
function
|
|
2384
|
-
return
|
|
2515
|
+
function ki(e) {
|
|
2516
|
+
return dn(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" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2385
2517
|
}
|
|
2386
|
-
function
|
|
2518
|
+
function Ai(e) {
|
|
2387
2519
|
if (!e?.length) return [];
|
|
2388
2520
|
let t = [], n = (e, n) => {
|
|
2389
2521
|
let r = t[t.length - 1];
|
|
@@ -2408,49 +2540,51 @@ function ai(e) {
|
|
|
2408
2540
|
});
|
|
2409
2541
|
};
|
|
2410
2542
|
for (let t of e) {
|
|
2411
|
-
if (
|
|
2543
|
+
if (dn(t)) {
|
|
2412
2544
|
r(t);
|
|
2413
2545
|
continue;
|
|
2414
2546
|
}
|
|
2415
|
-
let e =
|
|
2547
|
+
let e = ki(t);
|
|
2416
2548
|
e && n(e, t);
|
|
2417
2549
|
}
|
|
2418
2550
|
return t;
|
|
2419
2551
|
}
|
|
2420
|
-
function
|
|
2552
|
+
function ji(e) {
|
|
2421
2553
|
return e.filter((e) => e.type === "media").length;
|
|
2422
2554
|
}
|
|
2423
|
-
function
|
|
2555
|
+
function Mi(e, t, n) {
|
|
2424
2556
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
2425
2557
|
}
|
|
2426
|
-
function
|
|
2558
|
+
function Ni(e) {
|
|
2427
2559
|
return $(e.image_url) ?? $(e.asset_url) ?? "";
|
|
2428
2560
|
}
|
|
2429
|
-
function
|
|
2561
|
+
function Pi(e) {
|
|
2430
2562
|
switch (e) {
|
|
2431
|
-
case "image": return
|
|
2432
|
-
case "video": return
|
|
2433
|
-
case "audio": return
|
|
2434
|
-
case "pdf": return
|
|
2435
|
-
default: return
|
|
2563
|
+
case "image": return wi.Image;
|
|
2564
|
+
case "video": return wi.Video;
|
|
2565
|
+
case "audio": return wi.Audio;
|
|
2566
|
+
case "pdf": return wi.Pdf;
|
|
2567
|
+
default: return wi.File;
|
|
2436
2568
|
}
|
|
2437
2569
|
}
|
|
2438
|
-
function
|
|
2570
|
+
function Fi(e, t) {
|
|
2439
2571
|
switch (e) {
|
|
2440
2572
|
case "image": return {
|
|
2441
|
-
src:
|
|
2573
|
+
src: Ni(t),
|
|
2442
2574
|
alt: $(t.title)
|
|
2443
2575
|
};
|
|
2444
2576
|
case "video": return {
|
|
2445
2577
|
src: $(t.asset_url) ?? "",
|
|
2446
2578
|
poster: a(t.thumb_url),
|
|
2447
2579
|
mimeType: $(t.mime_type),
|
|
2448
|
-
naturalAspectRatio:
|
|
2580
|
+
naturalAspectRatio: Ti(t)
|
|
2449
2581
|
};
|
|
2450
2582
|
case "audio": return {
|
|
2451
2583
|
src: $(t.asset_url) ?? "",
|
|
2452
2584
|
mimeType: $(t.mime_type) ?? "audio/mpeg",
|
|
2453
|
-
filename: $(t.title)
|
|
2585
|
+
filename: $(t.title),
|
|
2586
|
+
durationSeconds: t.duration,
|
|
2587
|
+
waveformData: t.waveform_data
|
|
2454
2588
|
};
|
|
2455
2589
|
case "pdf": return {
|
|
2456
2590
|
src: $(t.asset_url) ?? "",
|
|
@@ -2465,30 +2599,30 @@ function ui(e, t) {
|
|
|
2465
2599
|
};
|
|
2466
2600
|
}
|
|
2467
2601
|
}
|
|
2468
|
-
function
|
|
2469
|
-
if (t.length > 1) return { items: t.map((t) =>
|
|
2602
|
+
function Ii(e, t) {
|
|
2603
|
+
if (t.length > 1) return { items: t.map((t) => Fi(e, t)) };
|
|
2470
2604
|
let n = t[0];
|
|
2471
|
-
return n ?
|
|
2605
|
+
return n ? Fi(e, n) : {};
|
|
2472
2606
|
}
|
|
2473
|
-
function
|
|
2474
|
-
let r =
|
|
2475
|
-
...
|
|
2607
|
+
function Li({ groupPosition: e, isMyMessage: t, segment: n }) {
|
|
2608
|
+
let r = Pi(n.kind), i = {
|
|
2609
|
+
...Ii(n.kind, n.attachments),
|
|
2476
2610
|
groupPosition: e
|
|
2477
2611
|
};
|
|
2478
|
-
return
|
|
2612
|
+
return K(t ? r.Sent : r.Received, { ...i });
|
|
2479
2613
|
}
|
|
2480
|
-
var
|
|
2481
|
-
let i =
|
|
2614
|
+
var Ri = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
2615
|
+
let i = Ai(n.attachments);
|
|
2482
2616
|
if (i.length === 0) return null;
|
|
2483
|
-
let a =
|
|
2484
|
-
let i = t ?
|
|
2485
|
-
d.push(/* @__PURE__ */
|
|
2486
|
-
...
|
|
2617
|
+
let a = ji(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? Oi(s.attachments[0] ?? {}).url : void 0, l = o && Di(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
|
|
2618
|
+
let i = t ? un.Sent : un.Received;
|
|
2619
|
+
d.push(/* @__PURE__ */ K(i, {
|
|
2620
|
+
...Oi(e),
|
|
2487
2621
|
groupPosition: r ? f : "middle"
|
|
2488
2622
|
}, n));
|
|
2489
2623
|
}, h = (n, r) => {
|
|
2490
|
-
let i =
|
|
2491
|
-
u += 1, d.push(/* @__PURE__ */
|
|
2624
|
+
let i = Mi(u, a, e);
|
|
2625
|
+
u += 1, d.push(/* @__PURE__ */ K(Li, {
|
|
2492
2626
|
groupPosition: i,
|
|
2493
2627
|
isMyMessage: t,
|
|
2494
2628
|
segment: n
|
|
@@ -2503,9 +2637,9 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2503
2637
|
return;
|
|
2504
2638
|
}
|
|
2505
2639
|
h(e, `media-${t}`);
|
|
2506
|
-
}), /* @__PURE__ */
|
|
2640
|
+
}), /* @__PURE__ */ q("div", {
|
|
2507
2641
|
className: "str-chat__message-bubble-wrapper",
|
|
2508
|
-
children: [/* @__PURE__ */
|
|
2642
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2509
2643
|
className: "str-chat__message-bubble",
|
|
2510
2644
|
"data-attachment-bubble": "true",
|
|
2511
2645
|
"data-testid": "message-attachment-bubble",
|
|
@@ -2515,35 +2649,35 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2515
2649
|
overflow: "visible",
|
|
2516
2650
|
padding: 0
|
|
2517
2651
|
},
|
|
2518
|
-
children: [/* @__PURE__ */
|
|
2652
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2519
2653
|
"data-testid": "message-attachment-rows",
|
|
2520
|
-
className:
|
|
2654
|
+
className: X("flex flex-col gap-[4px]", t ? "items-end" : "items-start"),
|
|
2521
2655
|
children: d
|
|
2522
|
-
}), !l && /* @__PURE__ */
|
|
2523
|
-
}), l ? /* @__PURE__ */
|
|
2656
|
+
}), !l && /* @__PURE__ */ K(N, {})]
|
|
2657
|
+
}), l ? /* @__PURE__ */ q("div", {
|
|
2524
2658
|
"data-testid": "message-caption-bubble",
|
|
2525
|
-
className:
|
|
2659
|
+
className: X("str-chat__message-bubble", { "relative isolate": p }),
|
|
2526
2660
|
children: [
|
|
2527
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ K(z, {
|
|
2528
2662
|
message: n,
|
|
2529
2663
|
renderText: r
|
|
2530
2664
|
}),
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
p && /* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ K(N, {}),
|
|
2666
|
+
p && /* @__PURE__ */ K(An, { side: t ? "me" : "other" })
|
|
2533
2667
|
]
|
|
2534
2668
|
}) : null]
|
|
2535
2669
|
});
|
|
2536
|
-
},
|
|
2537
|
-
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound:
|
|
2670
|
+
}, zi = o.memo((e) => {
|
|
2671
|
+
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: b } = e, { client: S } = ve("CustomMessage"), { channel: C } = _e("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: E, onDownloadClick: O } = hn("LockedAttachment"), [P, I] = h(!1), R = Se(m.id), { Attachment: B = x, EditMessageModal: te = D, MessageActions: V, MessageBlocked: ie = k, MessageBouncePrompt: ae = j, MessageDeleted: oe = M, MessageIsThreadReplyInChannelButtonIndicator: se = F, MessageRepliesCountButton: pe = L, ReminderNotification: me = ne, StreamedMessageText: he = re, PinIndicator: ge } = ye("CustomMessage"), be = de(m), xe = fe(m), H = p(() => d?.(m), [d, m]), U = p(() => {
|
|
2538
2672
|
let e = m.attachments ?? [], t = m.shared_location ? [m.shared_location, ...e] : e;
|
|
2539
|
-
if (!
|
|
2540
|
-
let n = t.filter((e) => !("type" in e) || !
|
|
2673
|
+
if (!Sn(m)) return t;
|
|
2674
|
+
let n = t.filter((e) => !("type" in e) || !dn(e));
|
|
2541
2675
|
return n.length === t.length ? t : n;
|
|
2542
|
-
}, [m]),
|
|
2676
|
+
}, [m]), W = p(() => (m.attachments ?? []).filter(dn), [m]), Ce = p(() => {
|
|
2543
2677
|
let e = m.text?.trim();
|
|
2544
|
-
return e ?
|
|
2545
|
-
}, [m,
|
|
2546
|
-
let e =
|
|
2678
|
+
return e ? Di(e, W[0] ? Oi(W[0]).url : void 0) ? void 0 : e : void 0;
|
|
2679
|
+
}, [m, W]), J = p(() => Ai(U), [U]), we = p(() => {
|
|
2680
|
+
let e = Mt({
|
|
2547
2681
|
message: m,
|
|
2548
2682
|
viewerLanguage: v
|
|
2549
2683
|
});
|
|
@@ -2551,27 +2685,27 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2551
2685
|
...m,
|
|
2552
2686
|
text: e
|
|
2553
2687
|
};
|
|
2554
|
-
}, [m, v]), Te =
|
|
2555
|
-
if (
|
|
2556
|
-
if (m.deleted_at || m.type === "deleted") return /* @__PURE__ */
|
|
2557
|
-
if (
|
|
2558
|
-
let
|
|
2559
|
-
|
|
2560
|
-
let Z = f(), Pe =
|
|
2688
|
+
}, [m, v]), Te = J.length > 0, Ee = J.reduce((e, t) => e + t.attachments.length, 0) === (U?.length ?? 0), Y = a?.[0] ?? "", De = Y === "top" ? "first" : Y === "middle" ? "middle" : Y === "bottom" ? "end" : "single", Oe = Y === "single" || Y === "bottom";
|
|
2689
|
+
if (ce(m)) return null;
|
|
2690
|
+
if (m.deleted_at || m.type === "deleted") return /* @__PURE__ */ K(oe, { message: m });
|
|
2691
|
+
if (le(m)) return /* @__PURE__ */ K(ie, {});
|
|
2692
|
+
let ke = !_ && !!m.reply_count, Ae = !_ && m.show_in_channel && m.parent_id, je = m.status === "failed" && m.error?.status !== 403, Me = ue(m), Ne;
|
|
2693
|
+
je ? Ne = () => l(m) : Me && (Ne = () => I(!0));
|
|
2694
|
+
let Z = f(), Pe = X("str-chat__message str-chat__message-simple", `str-chat__message--${m.type}`, `str-chat__message--${m.status}`, Z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other", m.text ? "str-chat__message--has-text" : "has-no-text", {
|
|
2561
2695
|
"str-chat__message--has-attachment": be,
|
|
2562
2696
|
"str-chat__message--highlighted": u,
|
|
2563
2697
|
"str-chat__message--pinned pinned-message": m.pinned,
|
|
2564
2698
|
"str-chat__message--with-reactions": xe,
|
|
2565
2699
|
"str-chat__message-send-can-be-retried": m?.status === "failed" && m?.error?.status !== 403,
|
|
2566
|
-
"str-chat__message-with-thread-link":
|
|
2700
|
+
"str-chat__message-with-thread-link": ke || Ae,
|
|
2567
2701
|
"str-chat__virtual-message__wrapper--end": r,
|
|
2568
2702
|
"str-chat__virtual-message__wrapper--first": i,
|
|
2569
2703
|
"str-chat__virtual-message__wrapper--group": o
|
|
2570
|
-
}), Fe = m.poll_id && S.polls.fromState(m.poll_id), Ie =
|
|
2704
|
+
}), Fe = m.poll_id && S.polls.fromState(m.poll_id), Ie = In(m), Le = Sn(m), Re = Cn(m), ze = !!(U?.length && !m.quoted_message), Be = Le && Z && ze, Ve = Te && Ee && !m.quoted_message && !Fe && !H && !Le, He = {
|
|
2571
2705
|
contentType: "text",
|
|
2572
2706
|
amountText: m.metadata?.amount_text,
|
|
2573
2707
|
paymentStatus: m.metadata?.payment_status,
|
|
2574
|
-
renderedText: m.text && /* @__PURE__ */
|
|
2708
|
+
renderedText: m.text && /* @__PURE__ */ K(z, {
|
|
2575
2709
|
message: we,
|
|
2576
2710
|
renderText: g
|
|
2577
2711
|
})
|
|
@@ -2583,38 +2717,38 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2583
2717
|
amountText: m.metadata?.amount_text,
|
|
2584
2718
|
detail: m.metadata?.attachment_detail,
|
|
2585
2719
|
paymentStatus: m.metadata?.payment_status,
|
|
2586
|
-
onFetchSource:
|
|
2587
|
-
}, We = /* @__PURE__ */
|
|
2588
|
-
className:
|
|
2589
|
-
children: [/* @__PURE__ */
|
|
2720
|
+
onFetchSource: E ? () => E(m, C) : void 0
|
|
2721
|
+
}, We = /* @__PURE__ */ q("div", {
|
|
2722
|
+
className: X("str-chat__message-bubble", { "relative isolate": Oe }),
|
|
2723
|
+
children: [/* @__PURE__ */ K(z, {
|
|
2590
2724
|
message: we,
|
|
2591
2725
|
renderText: g
|
|
2592
|
-
}),
|
|
2593
|
-
}), Ge =
|
|
2594
|
-
className:
|
|
2595
|
-
children:
|
|
2596
|
-
let n = Z ?
|
|
2597
|
-
return /* @__PURE__ */
|
|
2598
|
-
...
|
|
2599
|
-
groupPosition: r ?
|
|
2726
|
+
}), Oe && /* @__PURE__ */ K(An, { side: Z ? "me" : "other" })]
|
|
2727
|
+
}), Ge = W.length > 0 && /* @__PURE__ */ K("div", {
|
|
2728
|
+
className: X("flex flex-col gap-[4px]", Z ? "items-end" : "items-start"),
|
|
2729
|
+
children: W.map((e, t) => {
|
|
2730
|
+
let n = Z ? un.Sent : un.Received, r = t === W.length - 1 && !Ce;
|
|
2731
|
+
return /* @__PURE__ */ K(n, {
|
|
2732
|
+
...Oi(e),
|
|
2733
|
+
groupPosition: r ? De : "middle"
|
|
2600
2734
|
}, `locked-link-${t}`);
|
|
2601
2735
|
})
|
|
2602
2736
|
});
|
|
2603
|
-
return /* @__PURE__ */ G
|
|
2604
|
-
n && /* @__PURE__ */
|
|
2605
|
-
|
|
2606
|
-
MessageBouncePrompt:
|
|
2607
|
-
onClose: () =>
|
|
2608
|
-
open:
|
|
2737
|
+
return /* @__PURE__ */ q(G, { children: [
|
|
2738
|
+
n && /* @__PURE__ */ K(te, { additionalMessageInputProps: t }),
|
|
2739
|
+
P && /* @__PURE__ */ K(A, {
|
|
2740
|
+
MessageBouncePrompt: ae,
|
|
2741
|
+
onClose: () => I(!1),
|
|
2742
|
+
open: P
|
|
2609
2743
|
}),
|
|
2610
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ q("div", {
|
|
2611
2745
|
className: Pe,
|
|
2612
2746
|
"data-message-id": m.id,
|
|
2613
2747
|
"data-dd-privacy": "mask",
|
|
2614
2748
|
children: [
|
|
2615
|
-
|
|
2616
|
-
!!
|
|
2617
|
-
m.user && /* @__PURE__ */
|
|
2749
|
+
ge && /* @__PURE__ */ K(ge, {}),
|
|
2750
|
+
!!R && /* @__PURE__ */ K(me, { reminder: R }),
|
|
2751
|
+
m.user && /* @__PURE__ */ K(xt, {
|
|
2618
2752
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2619
2753
|
id: m.user.id,
|
|
2620
2754
|
image: m.user.image,
|
|
@@ -2623,170 +2757,170 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2623
2757
|
shape: "circle",
|
|
2624
2758
|
dmAgentEnabled: Le
|
|
2625
2759
|
}),
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
className:
|
|
2760
|
+
/* @__PURE__ */ K("div", {
|
|
2761
|
+
className: X("str-chat__message-inner", { "str-chat__simple-message--error-failed": je || Me }),
|
|
2628
2762
|
"data-testid": "message-inner",
|
|
2629
|
-
onClick:
|
|
2630
|
-
onKeyDown:
|
|
2631
|
-
role:
|
|
2632
|
-
tabIndex:
|
|
2763
|
+
onClick: Ne,
|
|
2764
|
+
onKeyDown: Ne,
|
|
2765
|
+
role: Ne ? "button" : void 0,
|
|
2766
|
+
tabIndex: Ne ? 0 : void 0,
|
|
2633
2767
|
style: {
|
|
2634
2768
|
marginInlineEnd: 0,
|
|
2635
2769
|
marginInlineStart: 0
|
|
2636
2770
|
},
|
|
2637
|
-
children: Ie ? /* @__PURE__ */
|
|
2771
|
+
children: Ie ? /* @__PURE__ */ q("div", {
|
|
2638
2772
|
className: "str-chat__message-bubble-wrapper message-tip-wrapper",
|
|
2639
|
-
children: [/* @__PURE__ */
|
|
2640
|
-
}) :
|
|
2773
|
+
children: [/* @__PURE__ */ K(Ln, { message: m }), m.text?.trim() && We]
|
|
2774
|
+
}) : wn(m) ? /* @__PURE__ */ K("div", {
|
|
2641
2775
|
className: "str-chat__message-bubble-wrapper",
|
|
2642
|
-
children: /* @__PURE__ */
|
|
2776
|
+
children: /* @__PURE__ */ q("div", {
|
|
2643
2777
|
className: "flex items-center gap-2",
|
|
2644
2778
|
children: [
|
|
2645
|
-
Z &&
|
|
2646
|
-
Z ? /* @__PURE__ */
|
|
2779
|
+
Z && V && /* @__PURE__ */ K(V, {}),
|
|
2780
|
+
Z ? /* @__PURE__ */ K(yn, {
|
|
2647
2781
|
...He,
|
|
2648
2782
|
isMine: !0
|
|
2649
|
-
}) : /* @__PURE__ */
|
|
2783
|
+
}) : /* @__PURE__ */ K(yn, {
|
|
2650
2784
|
...He,
|
|
2651
2785
|
isMine: !1,
|
|
2652
2786
|
isUnlocking: w(m.id),
|
|
2653
2787
|
onUnlockClick: () => T?.(m, C)
|
|
2654
2788
|
}),
|
|
2655
|
-
!Z &&
|
|
2789
|
+
!Z && V && /* @__PURE__ */ K(V, {})
|
|
2656
2790
|
]
|
|
2657
2791
|
})
|
|
2658
|
-
}) :
|
|
2792
|
+
}) : Tn(m) ? /* @__PURE__ */ q("div", {
|
|
2659
2793
|
className: "str-chat__message-bubble-wrapper message-locked-attachment-wrapper",
|
|
2660
2794
|
children: [
|
|
2661
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ q("div", {
|
|
2662
2796
|
className: "flex items-center gap-2",
|
|
2663
2797
|
children: [
|
|
2664
|
-
Z &&
|
|
2665
|
-
Z ? /* @__PURE__ */
|
|
2798
|
+
Z && V && /* @__PURE__ */ K(V, {}),
|
|
2799
|
+
Z ? /* @__PURE__ */ K(yn, {
|
|
2666
2800
|
...Ue,
|
|
2667
2801
|
isMine: !0,
|
|
2668
2802
|
onPreviewClick: () => T ? T(m, C) : void 0
|
|
2669
|
-
}) : /* @__PURE__ */
|
|
2803
|
+
}) : /* @__PURE__ */ K(yn, {
|
|
2670
2804
|
...Ue,
|
|
2671
2805
|
isMine: !1,
|
|
2672
2806
|
isUnlocking: w(m.id),
|
|
2673
2807
|
onUnlockClick: () => T ? T(m, C) : void 0,
|
|
2674
|
-
onDownloadClick: () =>
|
|
2808
|
+
onDownloadClick: () => O ? O(m, C) : void 0
|
|
2675
2809
|
}),
|
|
2676
|
-
!Z &&
|
|
2810
|
+
!Z && V && /* @__PURE__ */ K(V, {})
|
|
2677
2811
|
]
|
|
2678
2812
|
}),
|
|
2679
2813
|
Ge,
|
|
2680
|
-
|
|
2814
|
+
Ce && We
|
|
2681
2815
|
]
|
|
2682
|
-
}) : Ve ? /* @__PURE__ */
|
|
2683
|
-
groupPosition:
|
|
2816
|
+
}) : Ve ? /* @__PURE__ */ K(Ri, {
|
|
2817
|
+
groupPosition: De,
|
|
2684
2818
|
isMyMessage: Z,
|
|
2685
2819
|
message: {
|
|
2686
2820
|
...we,
|
|
2687
|
-
attachments:
|
|
2821
|
+
attachments: U,
|
|
2688
2822
|
i18n: void 0
|
|
2689
2823
|
},
|
|
2690
2824
|
renderText: g
|
|
2691
|
-
}) : /* @__PURE__ */
|
|
2825
|
+
}) : /* @__PURE__ */ K("div", {
|
|
2692
2826
|
className: "str-chat__message-bubble-wrapper",
|
|
2693
|
-
children: /* @__PURE__ */
|
|
2694
|
-
className:
|
|
2827
|
+
children: /* @__PURE__ */ q("div", {
|
|
2828
|
+
className: X("str-chat__message-bubble", { "relative isolate": Oe }),
|
|
2695
2829
|
children: [
|
|
2696
|
-
Le && !Be && /* @__PURE__ */
|
|
2830
|
+
Le && !Be && /* @__PURE__ */ K(Dn, {
|
|
2697
2831
|
message: m,
|
|
2698
2832
|
hasAttachment: ze,
|
|
2699
2833
|
isMyMessage: Z
|
|
2700
2834
|
}),
|
|
2701
|
-
Fe && /* @__PURE__ */
|
|
2702
|
-
|
|
2835
|
+
Fe && /* @__PURE__ */ K(ee, { poll: Fe }),
|
|
2836
|
+
U?.length && !m.quoted_message ? /* @__PURE__ */ K(B, {
|
|
2703
2837
|
actionHandler: s,
|
|
2704
|
-
attachments:
|
|
2838
|
+
attachments: U
|
|
2705
2839
|
}) : null,
|
|
2706
|
-
|
|
2840
|
+
K(H ? he : z, {
|
|
2707
2841
|
message: we,
|
|
2708
2842
|
renderText: g
|
|
2709
2843
|
}),
|
|
2710
|
-
/* @__PURE__ */
|
|
2711
|
-
|
|
2844
|
+
/* @__PURE__ */ K(N, {}),
|
|
2845
|
+
Oe && /* @__PURE__ */ K(An, { side: Z ? "me" : "other" })
|
|
2712
2846
|
]
|
|
2713
2847
|
})
|
|
2714
2848
|
})
|
|
2715
2849
|
}),
|
|
2716
|
-
!Re && !Ie && /* @__PURE__ */
|
|
2850
|
+
!Re && !Ie && /* @__PURE__ */ K("div", {
|
|
2717
2851
|
className: "str-chat__message-footer",
|
|
2718
|
-
children: (!Le || Be) && /* @__PURE__ */
|
|
2852
|
+
children: (!Le || Be) && /* @__PURE__ */ K(Dn, {
|
|
2719
2853
|
message: m,
|
|
2720
2854
|
hasAttachment: ze,
|
|
2721
2855
|
isMyMessage: Z
|
|
2722
2856
|
})
|
|
2723
2857
|
}),
|
|
2724
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ K(Un, {
|
|
2725
2859
|
onOutboundClick: y,
|
|
2726
|
-
resolvedOutbound:
|
|
2860
|
+
resolvedOutbound: b
|
|
2727
2861
|
}),
|
|
2728
|
-
|
|
2862
|
+
ke && /* @__PURE__ */ K(pe, {
|
|
2729
2863
|
onClick: c,
|
|
2730
2864
|
reply_count: m.reply_count
|
|
2731
2865
|
}),
|
|
2732
|
-
|
|
2866
|
+
Ae && /* @__PURE__ */ K(se, {})
|
|
2733
2867
|
]
|
|
2734
2868
|
}, m.id)
|
|
2735
2869
|
] });
|
|
2736
|
-
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)),
|
|
2737
|
-
let t = H("CustomMessage"), n = u(
|
|
2738
|
-
return /* @__PURE__ */
|
|
2870
|
+
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)), Bi = (e) => {
|
|
2871
|
+
let t = H("CustomMessage"), n = u(jn), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
|
|
2872
|
+
return /* @__PURE__ */ K(zi, {
|
|
2739
2873
|
...t,
|
|
2740
2874
|
...e,
|
|
2741
2875
|
resolvedOutbound: i
|
|
2742
2876
|
});
|
|
2743
|
-
},
|
|
2877
|
+
}, Vi = () => {
|
|
2744
2878
|
let { handleDelete: e, message: t } = H("CustomMessageActions");
|
|
2745
|
-
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */
|
|
2879
|
+
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ K($e, {
|
|
2746
2880
|
onClick: e,
|
|
2747
2881
|
"aria-label": "Delete",
|
|
2748
2882
|
title: "Delete",
|
|
2749
2883
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2750
|
-
children: /* @__PURE__ */
|
|
2884
|
+
children: /* @__PURE__ */ K(Ye, {
|
|
2751
2885
|
size: 16,
|
|
2752
2886
|
weight: "light",
|
|
2753
2887
|
"aria-hidden": !0
|
|
2754
2888
|
})
|
|
2755
2889
|
});
|
|
2756
|
-
},
|
|
2890
|
+
}, Hi = () => {
|
|
2757
2891
|
let { handleFlag: e } = H("CustomMessageActions");
|
|
2758
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ K($e, {
|
|
2759
2893
|
onClick: e,
|
|
2760
2894
|
"aria-label": "Report",
|
|
2761
2895
|
title: "Report",
|
|
2762
2896
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2763
|
-
children: /* @__PURE__ */
|
|
2897
|
+
children: /* @__PURE__ */ K(Le, {
|
|
2764
2898
|
size: 16,
|
|
2765
2899
|
weight: "light",
|
|
2766
2900
|
"aria-hidden": !0
|
|
2767
2901
|
})
|
|
2768
2902
|
});
|
|
2769
|
-
},
|
|
2903
|
+
}, Ui = () => {
|
|
2770
2904
|
let { message: e } = H("CustomMessageActions");
|
|
2771
|
-
return e.metadata?.custom_type ===
|
|
2772
|
-
Component:
|
|
2905
|
+
return e.metadata?.custom_type === J.ATTACHMENT ? /* @__PURE__ */ K(et, { messageActionSet: [{
|
|
2906
|
+
Component: Vi,
|
|
2773
2907
|
placement: "quick",
|
|
2774
2908
|
type: "delete"
|
|
2775
2909
|
}, {
|
|
2776
|
-
Component:
|
|
2910
|
+
Component: Hi,
|
|
2777
2911
|
placement: "quick",
|
|
2778
2912
|
type: "flag"
|
|
2779
2913
|
}] }) : null;
|
|
2780
|
-
},
|
|
2781
|
-
let { linkPreviewsManager: e } =
|
|
2914
|
+
}, Wi = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => v.previewIsLoaded(e) || v.previewIsLoading(e)) }), Gi = () => {
|
|
2915
|
+
let { linkPreviewsManager: e } = be(), { linkPreviews: t } = W(e.state, Wi), n = (t) => {
|
|
2782
2916
|
e.dismissPreview(t);
|
|
2783
2917
|
};
|
|
2784
|
-
return t.length > 0 ? /* @__PURE__ */
|
|
2918
|
+
return t.length > 0 ? /* @__PURE__ */ K("div", {
|
|
2785
2919
|
"data-testid": "link-preview-list",
|
|
2786
2920
|
className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2",
|
|
2787
2921
|
children: t.map((e) => {
|
|
2788
|
-
let t =
|
|
2789
|
-
return /* @__PURE__ */
|
|
2922
|
+
let t = v.previewIsLoading(e);
|
|
2923
|
+
return /* @__PURE__ */ K(un.Composer, {
|
|
2790
2924
|
title: e.title,
|
|
2791
2925
|
url: e.og_scrape_url,
|
|
2792
2926
|
thumbnailUrl: e.image_url,
|
|
@@ -2796,19 +2930,19 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2796
2930
|
}, e.og_scrape_url);
|
|
2797
2931
|
})
|
|
2798
2932
|
}) : null;
|
|
2799
|
-
},
|
|
2933
|
+
}, Ki = o.createContext(!1), qi = 200, Ji = () => u(Ki), Yi = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ K("button", {
|
|
2800
2934
|
...n,
|
|
2801
2935
|
type: "button",
|
|
2802
2936
|
"aria-label": "Send",
|
|
2803
2937
|
disabled: t,
|
|
2804
2938
|
onPointerDown: (e) => e.preventDefault(),
|
|
2805
2939
|
onClick: e,
|
|
2806
|
-
children: /* @__PURE__ */
|
|
2940
|
+
children: /* @__PURE__ */ K(Ae, {
|
|
2807
2941
|
weight: "bold",
|
|
2808
2942
|
className: "size-4"
|
|
2809
2943
|
})
|
|
2810
|
-
}),
|
|
2811
|
-
let e = u(
|
|
2944
|
+
}), Xi = () => {
|
|
2945
|
+
let e = u(Ki), { handleSubmit: t } = U(), n = xe(), r = e || !n, { SendButton: i = Yi, AttachmentPreviewList: a = S } = ye("CustomMessageInput"), s = o.useRef(null);
|
|
2812
2946
|
return o.useEffect(() => {
|
|
2813
2947
|
let e = s.current;
|
|
2814
2948
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -2823,23 +2957,23 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2823
2957
|
Array.from(e.clipboardData?.items ?? []).some((e) => e.kind === "file") || e.stopPropagation();
|
|
2824
2958
|
};
|
|
2825
2959
|
return e.addEventListener("paste", t), () => e.removeEventListener("paste", t);
|
|
2826
|
-
}, []), /* @__PURE__ */
|
|
2960
|
+
}, []), /* @__PURE__ */ q("div", {
|
|
2827
2961
|
ref: s,
|
|
2828
2962
|
"data-testid": "composer-card",
|
|
2829
2963
|
className: "central-container flex flex-col min-w-0 w-full max-h-[calc(var(--messaging-surface-height,100dvh)*0.5)] overflow-y-auto overscroll-contain 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)] [&>:not(.messaging-composer-previews):not(.messaging-composer-row)]:p-2",
|
|
2830
2964
|
"data-dd-privacy": "mask",
|
|
2831
|
-
children: [/* @__PURE__ */
|
|
2965
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2832
2966
|
"data-testid": "composer-previews",
|
|
2833
2967
|
className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2",
|
|
2834
2968
|
children: [
|
|
2835
|
-
/* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ K(te, {}),
|
|
2970
|
+
/* @__PURE__ */ K(Gi, {}),
|
|
2971
|
+
/* @__PURE__ */ K(a, {})
|
|
2838
2972
|
]
|
|
2839
|
-
}), /* @__PURE__ */
|
|
2973
|
+
}), /* @__PURE__ */ q("div", {
|
|
2840
2974
|
"data-testid": "composer-row",
|
|
2841
2975
|
className: "messaging-composer-row flex items-start",
|
|
2842
|
-
children: [/* @__PURE__ */
|
|
2976
|
+
children: [/* @__PURE__ */ K(V, {
|
|
2843
2977
|
"aria-disabled": e || void 0,
|
|
2844
2978
|
containerClassName: "min-w-0 flex-1 leading-[0]",
|
|
2845
2979
|
className: "w-full resize-none overflow-hidden bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -2848,10 +2982,10 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2848
2982
|
maxRows: Infinity,
|
|
2849
2983
|
readOnly: e,
|
|
2850
2984
|
tabIndex: e ? -1 : void 0
|
|
2851
|
-
}), /* @__PURE__ */
|
|
2985
|
+
}), /* @__PURE__ */ K("div", {
|
|
2852
2986
|
"data-testid": "send-button-wrapper",
|
|
2853
2987
|
className: "sticky bottom-2 mt-auto mb-2 mr-2 shrink-0 pt-2",
|
|
2854
|
-
children: /* @__PURE__ */
|
|
2988
|
+
children: /* @__PURE__ */ K(i, {
|
|
2855
2989
|
sendMessage: t,
|
|
2856
2990
|
"aria-label": "Send",
|
|
2857
2991
|
className: "str-chat__send-button relative flex justify-center items-center rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring before:absolute before:-inset-2 before:content-['']",
|
|
@@ -2862,19 +2996,19 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2862
2996
|
})]
|
|
2863
2997
|
})]
|
|
2864
2998
|
});
|
|
2865
|
-
},
|
|
2999
|
+
}, Zi = () => /* @__PURE__ */ q("div", {
|
|
2866
3000
|
className: "messaging-composer-backdrop",
|
|
2867
3001
|
"aria-hidden": "true",
|
|
2868
3002
|
children: [
|
|
2869
|
-
/* @__PURE__ */
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2873
|
-
/* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ K("div", { className: "messaging-composer-backdrop-blur" }),
|
|
3004
|
+
/* @__PURE__ */ K("div", { className: "messaging-composer-backdrop-blur" }),
|
|
3005
|
+
/* @__PURE__ */ K("div", { className: "messaging-composer-backdrop-blur" }),
|
|
3006
|
+
/* @__PURE__ */ K("div", { className: "messaging-composer-backdrop-blur" }),
|
|
3007
|
+
/* @__PURE__ */ K("div", { className: "messaging-composer-backdrop-blur" }),
|
|
3008
|
+
/* @__PURE__ */ K("div", { className: "messaging-composer-backdrop-gradient" })
|
|
2875
3009
|
]
|
|
2876
|
-
}),
|
|
2877
|
-
let { channel: s } =
|
|
3010
|
+
}), Qi = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: i, composerInput: a }) => {
|
|
3011
|
+
let { channel: s } = _e(), c = s?.data?.frozen === !0, l = !!a, u = o.useRef(null);
|
|
2878
3012
|
return o.useEffect(() => {
|
|
2879
3013
|
if (!l) return;
|
|
2880
3014
|
let e = u.current, t = e?.parentElement;
|
|
@@ -2882,7 +3016,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2882
3016
|
let n = e.offsetHeight, r = () => {
|
|
2883
3017
|
let r = e.offsetHeight, i = r > n;
|
|
2884
3018
|
n = r;
|
|
2885
|
-
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight <
|
|
3019
|
+
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight < qi : !1;
|
|
2886
3020
|
t.style.setProperty("--messaging-composer-height", `${r}px`), i && o && a && (a.scrollTop = a.scrollHeight);
|
|
2887
3021
|
};
|
|
2888
3022
|
if (r(), typeof ResizeObserver > "u") return;
|
|
@@ -2890,18 +3024,18 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2890
3024
|
return i.observe(e), () => {
|
|
2891
3025
|
i.disconnect(), t.style.removeProperty("--messaging-composer-height");
|
|
2892
3026
|
};
|
|
2893
|
-
}, [l]), r ? l ? /* @__PURE__ */
|
|
3027
|
+
}, [l]), r ? l ? /* @__PURE__ */ q("div", {
|
|
2894
3028
|
ref: u,
|
|
2895
3029
|
"data-testid": "composer-chrome",
|
|
2896
3030
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2897
|
-
children: [/* @__PURE__ */
|
|
3031
|
+
children: [/* @__PURE__ */ K(Zi, {}), /* @__PURE__ */ q("div", {
|
|
2898
3032
|
className: "relative z-10 flex flex-col",
|
|
2899
3033
|
children: [
|
|
2900
3034
|
t?.(),
|
|
2901
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ K("div", {
|
|
2902
3036
|
"data-testid": "composer-locked-panel",
|
|
2903
3037
|
className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4",
|
|
2904
|
-
children: i ? /* @__PURE__ */
|
|
3038
|
+
children: i ? /* @__PURE__ */ K("p", {
|
|
2905
3039
|
className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40",
|
|
2906
3040
|
children: i
|
|
2907
3041
|
}) : null
|
|
@@ -2909,159 +3043,159 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2909
3043
|
n?.()
|
|
2910
3044
|
]
|
|
2911
3045
|
})]
|
|
2912
|
-
}) : /* @__PURE__ */ G
|
|
3046
|
+
}) : /* @__PURE__ */ q(G, { children: [
|
|
2913
3047
|
t?.(),
|
|
2914
|
-
/* @__PURE__ */
|
|
3048
|
+
/* @__PURE__ */ K("div", {
|
|
2915
3049
|
"data-testid": "composer-locked-panel",
|
|
2916
3050
|
className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4",
|
|
2917
|
-
children: i ? /* @__PURE__ */
|
|
3051
|
+
children: i ? /* @__PURE__ */ K("p", {
|
|
2918
3052
|
className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40",
|
|
2919
3053
|
children: i
|
|
2920
3054
|
}) : null
|
|
2921
3055
|
}),
|
|
2922
3056
|
n?.()
|
|
2923
|
-
] }) : l ? /* @__PURE__ */
|
|
3057
|
+
] }) : l ? /* @__PURE__ */ q("div", {
|
|
2924
3058
|
ref: u,
|
|
2925
3059
|
"data-testid": "composer-chrome",
|
|
2926
3060
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2927
|
-
children: [/* @__PURE__ */
|
|
3061
|
+
children: [/* @__PURE__ */ K(Zi, {}), /* @__PURE__ */ q("div", {
|
|
2928
3062
|
className: "relative z-10 flex min-h-0 flex-col",
|
|
2929
|
-
children: [t?.(), /* @__PURE__ */
|
|
3063
|
+
children: [t?.(), /* @__PURE__ */ q("div", {
|
|
2930
3064
|
className: "flex min-h-0 flex-col gap-4 p-3 pb-5 md:p-5",
|
|
2931
|
-
children: [/* @__PURE__ */
|
|
3065
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2932
3066
|
inert: c ? "" : void 0,
|
|
2933
3067
|
"aria-disabled": c || void 0,
|
|
2934
3068
|
"data-testid": "message-input",
|
|
2935
3069
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
2936
|
-
children: [e && /* @__PURE__ */
|
|
3070
|
+
children: [e && /* @__PURE__ */ K("div", {
|
|
2937
3071
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2938
3072
|
children: e()
|
|
2939
|
-
}), /* @__PURE__ */
|
|
3073
|
+
}), /* @__PURE__ */ K(Ki.Provider, {
|
|
2940
3074
|
value: c,
|
|
2941
|
-
children: /* @__PURE__ */
|
|
3075
|
+
children: /* @__PURE__ */ K(P, { Input: a ?? Xi })
|
|
2942
3076
|
})]
|
|
2943
3077
|
}), n?.()]
|
|
2944
3078
|
})]
|
|
2945
3079
|
})]
|
|
2946
|
-
}) : /* @__PURE__ */
|
|
3080
|
+
}) : /* @__PURE__ */ q("div", {
|
|
2947
3081
|
className: "flex min-h-0 flex-col gap-4 p-4",
|
|
2948
3082
|
children: [
|
|
2949
3083
|
t?.(),
|
|
2950
|
-
/* @__PURE__ */
|
|
3084
|
+
/* @__PURE__ */ q("div", {
|
|
2951
3085
|
inert: c ? "" : void 0,
|
|
2952
3086
|
"aria-disabled": c || void 0,
|
|
2953
3087
|
"data-testid": "message-input",
|
|
2954
3088
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
2955
|
-
children: [e && /* @__PURE__ */
|
|
3089
|
+
children: [e && /* @__PURE__ */ K("div", {
|
|
2956
3090
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2957
3091
|
children: e()
|
|
2958
|
-
}), /* @__PURE__ */
|
|
3092
|
+
}), /* @__PURE__ */ K(Ki.Provider, {
|
|
2959
3093
|
value: c,
|
|
2960
|
-
children: /* @__PURE__ */
|
|
3094
|
+
children: /* @__PURE__ */ K(P, { Input: Xi })
|
|
2961
3095
|
})]
|
|
2962
3096
|
}),
|
|
2963
3097
|
n?.()
|
|
2964
3098
|
]
|
|
2965
3099
|
});
|
|
2966
|
-
},
|
|
3100
|
+
}, $i = {
|
|
2967
3101
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
2968
3102
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
2969
|
-
},
|
|
3103
|
+
}, ea = ["SYSTEM_AGE_SAFETY_BLOCKED"], ta = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, na = "age safety guidelines.", ra = "https://linktr.ee/s/about/contact", ia = (e) => ea.includes(e), aa = (e) => ia(e.metadata?.custom_type), oa = (e) => {
|
|
2970
3104
|
let t = e.metadata?.custom_type;
|
|
2971
|
-
if (
|
|
3105
|
+
if (Ee(t)) return {
|
|
2972
3106
|
kind: "dm-agent",
|
|
2973
3107
|
type: t
|
|
2974
3108
|
};
|
|
2975
|
-
if (
|
|
3109
|
+
if (Te(t)) return {
|
|
2976
3110
|
kind: "age-safety",
|
|
2977
3111
|
type: t
|
|
2978
3112
|
};
|
|
2979
3113
|
let n = e.dm_agent_system_type;
|
|
2980
|
-
if (
|
|
3114
|
+
if (Ee(n)) return {
|
|
2981
3115
|
kind: "dm-agent",
|
|
2982
3116
|
type: n
|
|
2983
3117
|
};
|
|
2984
|
-
},
|
|
2985
|
-
let t = e.indexOf(
|
|
3118
|
+
}, sa = (e) => {
|
|
3119
|
+
let t = e.indexOf(na);
|
|
2986
3120
|
if (t === -1) return e;
|
|
2987
3121
|
let n = t + 22;
|
|
2988
|
-
return /* @__PURE__ */ G
|
|
3122
|
+
return /* @__PURE__ */ q(G, { children: [
|
|
2989
3123
|
e.slice(0, t),
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
-
href:
|
|
3124
|
+
/* @__PURE__ */ K("a", {
|
|
3125
|
+
href: ra,
|
|
2992
3126
|
target: "_blank",
|
|
2993
3127
|
rel: "noopener noreferrer",
|
|
2994
3128
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
2995
|
-
children:
|
|
3129
|
+
children: na
|
|
2996
3130
|
}),
|
|
2997
3131
|
e.slice(n)
|
|
2998
3132
|
] });
|
|
2999
|
-
},
|
|
3000
|
-
let t = !
|
|
3133
|
+
}, ca = (e) => {
|
|
3134
|
+
let t = !aa(e.message), n = oa(e.message);
|
|
3001
3135
|
if (n?.kind === "dm-agent") {
|
|
3002
|
-
let r = e.message.text?.trim() ||
|
|
3003
|
-
return /* @__PURE__ */
|
|
3136
|
+
let r = e.message.text?.trim() || $i[n.type];
|
|
3137
|
+
return /* @__PURE__ */ q("div", {
|
|
3004
3138
|
className: "str-chat__message--system",
|
|
3005
3139
|
"data-testid": "message-system",
|
|
3006
|
-
children: [/* @__PURE__ */
|
|
3140
|
+
children: [/* @__PURE__ */ q("div", {
|
|
3007
3141
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
3008
3142
|
"data-testid": "dm-agent-system-message",
|
|
3009
3143
|
"data-dm-agent-system-type": n.type,
|
|
3010
|
-
children: [/* @__PURE__ */
|
|
3144
|
+
children: [/* @__PURE__ */ K(Ke, {
|
|
3011
3145
|
size: 16,
|
|
3012
3146
|
weight: "regular",
|
|
3013
3147
|
"aria-hidden": !0,
|
|
3014
3148
|
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
3015
|
-
}), /* @__PURE__ */
|
|
3149
|
+
}), /* @__PURE__ */ K("p", {
|
|
3016
3150
|
className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]",
|
|
3017
3151
|
children: r
|
|
3018
3152
|
})]
|
|
3019
|
-
}), !t && /* @__PURE__ */
|
|
3153
|
+
}), !t && /* @__PURE__ */ K(B, { message: e.message })]
|
|
3020
3154
|
});
|
|
3021
3155
|
}
|
|
3022
3156
|
if (n?.kind === "age-safety") {
|
|
3023
|
-
let r = e.message.text?.trim() ||
|
|
3024
|
-
return /* @__PURE__ */
|
|
3157
|
+
let r = e.message.text?.trim() || ta[n.type];
|
|
3158
|
+
return /* @__PURE__ */ q("div", {
|
|
3025
3159
|
className: "str-chat__message--system",
|
|
3026
3160
|
"data-testid": "message-system",
|
|
3027
|
-
children: [/* @__PURE__ */
|
|
3161
|
+
children: [/* @__PURE__ */ q("div", {
|
|
3028
3162
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3029
3163
|
"data-testid": "age-safety-system-message",
|
|
3030
3164
|
"data-age-safety-system-type": n.type,
|
|
3031
|
-
children: [/* @__PURE__ */
|
|
3165
|
+
children: [/* @__PURE__ */ K(Ue, {
|
|
3032
3166
|
size: 24,
|
|
3033
3167
|
weight: "duotone",
|
|
3034
3168
|
"aria-hidden": !0,
|
|
3035
3169
|
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3036
3170
|
"data-testid": "age-safety-system-message-icon"
|
|
3037
|
-
}), /* @__PURE__ */
|
|
3171
|
+
}), /* @__PURE__ */ K("div", {
|
|
3038
3172
|
className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]",
|
|
3039
|
-
children: /* @__PURE__ */
|
|
3173
|
+
children: /* @__PURE__ */ K("p", {
|
|
3040
3174
|
className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3041
|
-
children:
|
|
3175
|
+
children: sa(r)
|
|
3042
3176
|
})
|
|
3043
3177
|
})]
|
|
3044
|
-
}), !t && /* @__PURE__ */
|
|
3178
|
+
}), !t && /* @__PURE__ */ K(B, { message: e.message })]
|
|
3045
3179
|
});
|
|
3046
3180
|
}
|
|
3047
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ q("div", {
|
|
3048
3182
|
className: "str-chat__message--system",
|
|
3049
3183
|
"data-testid": "message-system",
|
|
3050
|
-
children: [/* @__PURE__ */
|
|
3184
|
+
children: [/* @__PURE__ */ q("div", {
|
|
3051
3185
|
className: "str-chat__message--system__text",
|
|
3052
3186
|
children: [
|
|
3053
|
-
/* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ K("div", { className: "str-chat__message--system__line" }),
|
|
3188
|
+
/* @__PURE__ */ K("p", { children: e.message.text }),
|
|
3189
|
+
/* @__PURE__ */ K("div", { className: "str-chat__message--system__line" })
|
|
3056
3190
|
]
|
|
3057
|
-
}), !t && /* @__PURE__ */
|
|
3191
|
+
}), !t && /* @__PURE__ */ K(B, { message: e.message })]
|
|
3058
3192
|
});
|
|
3059
|
-
},
|
|
3193
|
+
}, la = c(!1), ua = ({ cx: e, index: t }) => /* @__PURE__ */ K("circle", {
|
|
3060
3194
|
cx: e,
|
|
3061
3195
|
cy: "6.15",
|
|
3062
3196
|
r: "3.9",
|
|
3063
3197
|
fill: "#A0A0A0",
|
|
3064
|
-
children: /* @__PURE__ */
|
|
3198
|
+
children: /* @__PURE__ */ K("animateTransform", {
|
|
3065
3199
|
attributeName: "transform",
|
|
3066
3200
|
type: "translate",
|
|
3067
3201
|
values: "0 0; 0 -2.25; 0 0;",
|
|
@@ -3069,15 +3203,15 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3069
3203
|
begin: `${120 * t}ms`,
|
|
3070
3204
|
repeatCount: "indefinite"
|
|
3071
3205
|
})
|
|
3072
|
-
}),
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
]),
|
|
3077
|
-
let { channel: t, channelConfig: n, thread: r } =
|
|
3078
|
-
if (!e && s &&
|
|
3079
|
-
let e =
|
|
3080
|
-
return /* @__PURE__ */
|
|
3206
|
+
}), da = /* @__PURE__ */ new Set([
|
|
3207
|
+
b.Thinking,
|
|
3208
|
+
b.Generating,
|
|
3209
|
+
b.ExternalSources
|
|
3210
|
+
]), fa = ({ threadList: e }) => {
|
|
3211
|
+
let { channel: t, channelConfig: n, thread: r } = _e(), { client: i } = ve(), { typing: a = {} } = Ce(), { aiState: o } = me(t), s = u(la);
|
|
3212
|
+
if (!e && s && da.has(o)) {
|
|
3213
|
+
let e = ma(t, i.user?.id);
|
|
3214
|
+
return /* @__PURE__ */ K(pa, {
|
|
3081
3215
|
avatarId: e?.id ?? "ai-agent",
|
|
3082
3216
|
avatarName: e?.name ?? e?.id ?? "Agent",
|
|
3083
3217
|
avatarImage: e?.image,
|
|
@@ -3088,36 +3222,36 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3088
3222
|
let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], d = e ? l : c;
|
|
3089
3223
|
if (!d.length) return null;
|
|
3090
3224
|
let f = d[0]?.user, p = f?.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3091
|
-
return /* @__PURE__ */
|
|
3225
|
+
return /* @__PURE__ */ K(pa, {
|
|
3092
3226
|
avatarId: f?.id ?? p?.id ?? "typing-user",
|
|
3093
3227
|
avatarName: f?.name ?? p?.name ?? f?.id ?? "Typing user",
|
|
3094
3228
|
avatarImage: f?.image ?? p?.image,
|
|
3095
3229
|
testId: "typing-indicator"
|
|
3096
3230
|
});
|
|
3097
|
-
},
|
|
3231
|
+
}, pa = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ K("div", {
|
|
3098
3232
|
className: "str-chat__li str-chat__li--single str-chat__typing-indicator !static",
|
|
3099
3233
|
"data-testid": r,
|
|
3100
3234
|
style: { marginBottom: "var(--messaging-channel-input-spacer-height, 80px)" },
|
|
3101
|
-
children: /* @__PURE__ */
|
|
3235
|
+
children: /* @__PURE__ */ q("div", {
|
|
3102
3236
|
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",
|
|
3103
|
-
children: [/* @__PURE__ */
|
|
3237
|
+
children: [/* @__PURE__ */ K(xt, {
|
|
3104
3238
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3105
3239
|
id: e,
|
|
3106
3240
|
name: t,
|
|
3107
3241
|
image: n ?? void 0,
|
|
3108
3242
|
size: 24,
|
|
3109
3243
|
shape: "circle"
|
|
3110
|
-
}), /* @__PURE__ */
|
|
3244
|
+
}), /* @__PURE__ */ K("div", {
|
|
3111
3245
|
className: "str-chat__message-inner mx-0",
|
|
3112
|
-
children: /* @__PURE__ */
|
|
3246
|
+
children: /* @__PURE__ */ K("div", {
|
|
3113
3247
|
className: "str-chat__message-bubble-wrapper",
|
|
3114
|
-
children: /* @__PURE__ */
|
|
3248
|
+
children: /* @__PURE__ */ q("div", {
|
|
3115
3249
|
className: "str-chat__message-bubble relative isolate",
|
|
3116
|
-
children: [/* @__PURE__ */
|
|
3250
|
+
children: [/* @__PURE__ */ K("div", {
|
|
3117
3251
|
className: "str-chat__message-text min-h-11 flex items-center",
|
|
3118
|
-
children: /* @__PURE__ */
|
|
3252
|
+
children: /* @__PURE__ */ K("div", {
|
|
3119
3253
|
className: "str-chat__message-text-inner str-chat__message-simple-text-inner",
|
|
3120
|
-
children: /* @__PURE__ */
|
|
3254
|
+
children: /* @__PURE__ */ q("svg", {
|
|
3121
3255
|
"aria-hidden": "true",
|
|
3122
3256
|
className: "block overflow-visible",
|
|
3123
3257
|
viewBox: "0 0 32 12.3",
|
|
@@ -3125,28 +3259,28 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3125
3259
|
height: "13",
|
|
3126
3260
|
overflow: "visible",
|
|
3127
3261
|
children: [
|
|
3128
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ K(ua, {
|
|
3129
3263
|
cx: "4",
|
|
3130
3264
|
index: 0
|
|
3131
3265
|
}),
|
|
3132
|
-
/* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ K(ua, {
|
|
3133
3267
|
cx: "16",
|
|
3134
3268
|
index: 1
|
|
3135
3269
|
}),
|
|
3136
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ K(ua, {
|
|
3137
3271
|
cx: "28",
|
|
3138
3272
|
index: 2
|
|
3139
3273
|
})
|
|
3140
3274
|
]
|
|
3141
3275
|
})
|
|
3142
3276
|
})
|
|
3143
|
-
}), /* @__PURE__ */
|
|
3277
|
+
}), /* @__PURE__ */ K(An, { side: "other" })]
|
|
3144
3278
|
})
|
|
3145
3279
|
})
|
|
3146
3280
|
})]
|
|
3147
3281
|
})
|
|
3148
3282
|
});
|
|
3149
|
-
function
|
|
3283
|
+
function ma(e, t) {
|
|
3150
3284
|
let n = e?.state?.members ?? {};
|
|
3151
3285
|
for (let e of Object.values(n)) {
|
|
3152
3286
|
let n = e?.user;
|
|
@@ -3155,18 +3289,18 @@ function Ui(e, t) {
|
|
|
3155
3289
|
}
|
|
3156
3290
|
//#endregion
|
|
3157
3291
|
//#region src/components/MessagingShell/ChannelEmptyState.tsx
|
|
3158
|
-
var
|
|
3159
|
-
className:
|
|
3160
|
-
children: [/* @__PURE__ */
|
|
3292
|
+
var ha = () => null, ga = ({ className: e, message: t }) => /* @__PURE__ */ q("div", {
|
|
3293
|
+
className: X("flex items-center justify-center h-full", e),
|
|
3294
|
+
children: [/* @__PURE__ */ q("svg", {
|
|
3161
3295
|
viewBox: "0 0 100 100",
|
|
3162
3296
|
className: "size-8 fill-pebble",
|
|
3163
3297
|
stroke: "none",
|
|
3164
3298
|
children: [
|
|
3165
|
-
/* @__PURE__ */
|
|
3299
|
+
/* @__PURE__ */ K("circle", {
|
|
3166
3300
|
cx: "6",
|
|
3167
3301
|
cy: "50",
|
|
3168
3302
|
r: "6",
|
|
3169
|
-
children: /* @__PURE__ */
|
|
3303
|
+
children: /* @__PURE__ */ K("animateTransform", {
|
|
3170
3304
|
attributeName: "transform",
|
|
3171
3305
|
dur: "1s",
|
|
3172
3306
|
type: "translate",
|
|
@@ -3175,11 +3309,11 @@ var Wi = () => null, Gi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3175
3309
|
begin: "0.1"
|
|
3176
3310
|
})
|
|
3177
3311
|
}),
|
|
3178
|
-
/* @__PURE__ */
|
|
3312
|
+
/* @__PURE__ */ K("circle", {
|
|
3179
3313
|
cx: "30",
|
|
3180
3314
|
cy: "50",
|
|
3181
3315
|
r: "6",
|
|
3182
|
-
children: /* @__PURE__ */
|
|
3316
|
+
children: /* @__PURE__ */ K("animateTransform", {
|
|
3183
3317
|
attributeName: "transform",
|
|
3184
3318
|
dur: "1s",
|
|
3185
3319
|
type: "translate",
|
|
@@ -3188,11 +3322,11 @@ var Wi = () => null, Gi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3188
3322
|
begin: "0.2"
|
|
3189
3323
|
})
|
|
3190
3324
|
}),
|
|
3191
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ K("circle", {
|
|
3192
3326
|
cx: "54",
|
|
3193
3327
|
cy: "50",
|
|
3194
3328
|
r: "6",
|
|
3195
|
-
children: /* @__PURE__ */
|
|
3329
|
+
children: /* @__PURE__ */ K("animateTransform", {
|
|
3196
3330
|
attributeName: "transform",
|
|
3197
3331
|
dur: "1s",
|
|
3198
3332
|
type: "translate",
|
|
@@ -3202,31 +3336,31 @@ var Wi = () => null, Gi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3202
3336
|
})
|
|
3203
3337
|
})
|
|
3204
3338
|
]
|
|
3205
|
-
}), t && /* @__PURE__ */
|
|
3339
|
+
}), t && /* @__PURE__ */ K("span", {
|
|
3206
3340
|
className: "text-stone",
|
|
3207
3341
|
children: t
|
|
3208
3342
|
})]
|
|
3209
|
-
}),
|
|
3343
|
+
}), _a = o.memo(() => /* @__PURE__ */ K("div", {
|
|
3210
3344
|
className: "messaging-loading-state flex items-center justify-center h-full",
|
|
3211
|
-
children: /* @__PURE__ */
|
|
3345
|
+
children: /* @__PURE__ */ q("div", {
|
|
3212
3346
|
className: "flex items-center",
|
|
3213
|
-
children: [/* @__PURE__ */
|
|
3347
|
+
children: [/* @__PURE__ */ K(ga, { className: "w-6 h-6" }), /* @__PURE__ */ K("span", {
|
|
3214
3348
|
className: "text-sm text-stone",
|
|
3215
3349
|
children: "Loading messages"
|
|
3216
3350
|
})]
|
|
3217
3351
|
})
|
|
3218
3352
|
}));
|
|
3219
|
-
|
|
3353
|
+
_a.displayName = "LoadingState";
|
|
3220
3354
|
//#endregion
|
|
3221
3355
|
//#region src/components/ChannelView.tsx
|
|
3222
|
-
var
|
|
3223
|
-
let { channel: A, messages: j } =
|
|
3356
|
+
var va = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: i, onLeaveConversation: a, onBlockParticipant: s, showDeleteConversation: c = !0, onDeleteConversationClick: u, onBlockParticipantClick: f, onReportParticipantClick: p, showBlockParticipant: h = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
|
|
3357
|
+
let { channel: A, messages: j } = _e(), M = m(D);
|
|
3224
3358
|
d(() => {
|
|
3225
3359
|
M.current = D;
|
|
3226
3360
|
}, [D]);
|
|
3227
3361
|
let N = l((e) => {
|
|
3228
3362
|
M.current?.(e);
|
|
3229
|
-
}, []), P = D ? N : void 0,
|
|
3363
|
+
}, []), P = D ? N : void 0, F = Fn(j, O), L = A.state.messages.some((e) => e.type !== "deleted"), R = b ? /* @__PURE__ */ K(o.Fragment, { children: b() }, "lt-channel-banner") : null, z = /* @__PURE__ */ K(kt, {
|
|
3230
3364
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
3231
3365
|
onBack: e,
|
|
3232
3366
|
showBackButton: t,
|
|
@@ -3243,8 +3377,8 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3243
3377
|
customChannelActions: x,
|
|
3244
3378
|
renderChannelActions: S,
|
|
3245
3379
|
onParticipantNameClick: E
|
|
3246
|
-
}),
|
|
3247
|
-
let { message: t } = H("ChannelView"), n = /* @__PURE__ */
|
|
3380
|
+
}), B = l((e) => {
|
|
3381
|
+
let { message: t } = H("ChannelView"), n = /* @__PURE__ */ K(Bi, {
|
|
3248
3382
|
...e,
|
|
3249
3383
|
viewerLanguage: w,
|
|
3250
3384
|
onOutboundClick: P
|
|
@@ -3255,34 +3389,34 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3255
3389
|
C,
|
|
3256
3390
|
w
|
|
3257
3391
|
]);
|
|
3258
|
-
return /* @__PURE__ */
|
|
3259
|
-
value:
|
|
3260
|
-
children: /* @__PURE__ */
|
|
3392
|
+
return /* @__PURE__ */ K(jn.Provider, {
|
|
3393
|
+
value: F,
|
|
3394
|
+
children: /* @__PURE__ */ K(ae, {
|
|
3261
3395
|
overrides: {
|
|
3262
|
-
Message:
|
|
3263
|
-
MessageActions:
|
|
3396
|
+
Message: B,
|
|
3397
|
+
MessageActions: Ui,
|
|
3264
3398
|
UnreadMessagesNotification: () => null,
|
|
3265
3399
|
UnreadMessagesSeparator: () => null
|
|
3266
3400
|
},
|
|
3267
|
-
children: /* @__PURE__ */
|
|
3401
|
+
children: /* @__PURE__ */ K(ie, { children: k ? /* @__PURE__ */ q("div", {
|
|
3268
3402
|
className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col",
|
|
3269
|
-
children: [/* @__PURE__ */
|
|
3403
|
+
children: [/* @__PURE__ */ q("div", {
|
|
3270
3404
|
className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
|
|
3271
|
-
children: [!L && /* @__PURE__ */
|
|
3405
|
+
children: [!L && /* @__PURE__ */ K("div", {
|
|
3272
3406
|
className: "str-chat__list",
|
|
3273
|
-
children: /* @__PURE__ */
|
|
3407
|
+
children: /* @__PURE__ */ q("div", {
|
|
3274
3408
|
className: "str-chat__message-list-scroll",
|
|
3275
3409
|
children: [z, R]
|
|
3276
3410
|
})
|
|
3277
|
-
}), /* @__PURE__ */
|
|
3278
|
-
head: L ? /* @__PURE__ */
|
|
3411
|
+
}), /* @__PURE__ */ K(I, {
|
|
3412
|
+
head: L ? /* @__PURE__ */ q("div", {
|
|
3279
3413
|
className: "sticky top-0 z-10",
|
|
3280
3414
|
children: [z, R]
|
|
3281
3415
|
}) : void 0,
|
|
3282
3416
|
hideDeletedMessages: !0,
|
|
3283
3417
|
hideNewMessageSeparator: !1
|
|
3284
3418
|
})]
|
|
3285
|
-
}, "lt-channel-message-list"), /* @__PURE__ */
|
|
3419
|
+
}, "lt-channel-message-list"), /* @__PURE__ */ K(Qi, {
|
|
3286
3420
|
...n && { renderActions: () => n?.(A) },
|
|
3287
3421
|
...i && { renderHeader: () => i(A) },
|
|
3288
3422
|
renderFooter: () => r?.(A),
|
|
@@ -3290,17 +3424,17 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3290
3424
|
disabledReason: v,
|
|
3291
3425
|
composerInput: k
|
|
3292
3426
|
}, "lt-channel-message-input")]
|
|
3293
|
-
}) : /* @__PURE__ */ G
|
|
3294
|
-
/* @__PURE__ */
|
|
3427
|
+
}) : /* @__PURE__ */ q(G, { children: [
|
|
3428
|
+
/* @__PURE__ */ q("div", {
|
|
3295
3429
|
className: "flex-1 overflow-hidden relative",
|
|
3296
|
-
children: [!L && /* @__PURE__ */
|
|
3430
|
+
children: [!L && /* @__PURE__ */ K("div", {
|
|
3297
3431
|
className: "str-chat__list",
|
|
3298
|
-
children: /* @__PURE__ */
|
|
3432
|
+
children: /* @__PURE__ */ q("div", {
|
|
3299
3433
|
className: "str-chat__message-list-scroll",
|
|
3300
3434
|
children: [z, R]
|
|
3301
3435
|
})
|
|
3302
|
-
}), /* @__PURE__ */
|
|
3303
|
-
head: L ? /* @__PURE__ */
|
|
3436
|
+
}), /* @__PURE__ */ K(I, {
|
|
3437
|
+
head: L ? /* @__PURE__ */ q("div", {
|
|
3304
3438
|
className: "sticky top-0 z-10",
|
|
3305
3439
|
children: [z, R]
|
|
3306
3440
|
}) : void 0,
|
|
@@ -3308,8 +3442,8 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3308
3442
|
hideNewMessageSeparator: !1
|
|
3309
3443
|
})]
|
|
3310
3444
|
}, "lt-channel-message-list"),
|
|
3311
|
-
i ? /* @__PURE__ */
|
|
3312
|
-
/* @__PURE__ */
|
|
3445
|
+
i ? /* @__PURE__ */ K(o.Fragment, { children: i(A) }, "lt-channel-conversation-footer") : null,
|
|
3446
|
+
/* @__PURE__ */ K(Qi, {
|
|
3313
3447
|
...n && { renderActions: () => n?.(A) },
|
|
3314
3448
|
renderFooter: () => r?.(A),
|
|
3315
3449
|
disabled: _,
|
|
@@ -3319,14 +3453,14 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3319
3453
|
] }) })
|
|
3320
3454
|
})
|
|
3321
3455
|
});
|
|
3322
|
-
},
|
|
3456
|
+
}, ya = o.memo(({ channel: e, onBack: t, showBackButton: n = !1, renderMessageInputActions: r, renderMessageInputFooter: i, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: s, className: c, CustomChannelEmptyState: u = ha, showDeleteConversation: f = !0, onDeleteConversationClick: p, onBlockParticipantClick: h, onReportParticipantClick: g, showBlockParticipant: _ = !0, showReportParticipant: v = !0, composerDisabled: y = !1, composerDisabledReason: b, dmAgentEnabled: x, messageMetadata: S, onMessageSent: w, showStarButton: T = !1, renderChannelBanner: E, customChannelActions: D, renderChannelActions: O, renderMessage: k, onMessageLinkClick: A, sendButton: j, attachmentPreviewList: M, viewerLanguage: N, showChannelInfo: P = !0, onParticipantNameClick: F, onOutboundClick: I, resolveOutbound: L, composerInput: R }) => {
|
|
3323
3457
|
let z = l(async (t, n, r) => {
|
|
3324
3458
|
let i = e.data?.chatbot_paused === !0, a = x && !i, o = {
|
|
3325
3459
|
...n,
|
|
3326
3460
|
...a && { silent: !0 },
|
|
3327
|
-
...
|
|
3461
|
+
...S && { metadata: {
|
|
3328
3462
|
...n.metadata ?? {},
|
|
3329
|
-
...
|
|
3463
|
+
...S
|
|
3330
3464
|
} }
|
|
3331
3465
|
}, s = {
|
|
3332
3466
|
...r,
|
|
@@ -3336,12 +3470,12 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3336
3470
|
}, [
|
|
3337
3471
|
e,
|
|
3338
3472
|
x,
|
|
3339
|
-
|
|
3473
|
+
S,
|
|
3340
3474
|
w
|
|
3341
|
-
]),
|
|
3475
|
+
]), B = m(null);
|
|
3342
3476
|
d(() => {
|
|
3343
3477
|
if (!A) return;
|
|
3344
|
-
let t =
|
|
3478
|
+
let t = B.current;
|
|
3345
3479
|
if (!t) return;
|
|
3346
3480
|
let n = (t) => {
|
|
3347
3481
|
let n = t.target?.closest("a[href]"), r = n?.getAttribute("href");
|
|
@@ -3351,25 +3485,25 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3351
3485
|
};
|
|
3352
3486
|
return t.addEventListener("click", n), () => t.removeEventListener("click", n);
|
|
3353
3487
|
}, [A, e]);
|
|
3354
|
-
let
|
|
3355
|
-
return /* @__PURE__ */
|
|
3356
|
-
ref:
|
|
3488
|
+
let ee = Y(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
|
|
3489
|
+
return /* @__PURE__ */ K("div", {
|
|
3490
|
+
ref: B,
|
|
3357
3491
|
"data-testid": "channel-view",
|
|
3358
|
-
className:
|
|
3359
|
-
style:
|
|
3360
|
-
children: /* @__PURE__ */
|
|
3492
|
+
className: X("messaging-channel-view h-full flex flex-col", c),
|
|
3493
|
+
style: ee,
|
|
3494
|
+
children: /* @__PURE__ */ K(la.Provider, {
|
|
3361
3495
|
value: x ?? !1,
|
|
3362
|
-
children: /* @__PURE__ */
|
|
3496
|
+
children: /* @__PURE__ */ K(C, {
|
|
3363
3497
|
channel: e,
|
|
3364
|
-
MessageSystem:
|
|
3498
|
+
MessageSystem: ca,
|
|
3365
3499
|
EmptyStateIndicator: u,
|
|
3366
|
-
LoadingIndicator:
|
|
3367
|
-
DateSeparator:
|
|
3368
|
-
TypingIndicator:
|
|
3500
|
+
LoadingIndicator: _a,
|
|
3501
|
+
DateSeparator: At,
|
|
3502
|
+
TypingIndicator: fa,
|
|
3369
3503
|
doSendMessageRequest: z,
|
|
3370
3504
|
...j ? { SendButton: j } : {},
|
|
3371
3505
|
...M ? { AttachmentPreviewList: M } : {},
|
|
3372
|
-
children: /* @__PURE__ */
|
|
3506
|
+
children: /* @__PURE__ */ K(va, {
|
|
3373
3507
|
onBack: t,
|
|
3374
3508
|
showBackButton: n,
|
|
3375
3509
|
renderMessageInputActions: r,
|
|
@@ -3402,30 +3536,30 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3402
3536
|
})
|
|
3403
3537
|
});
|
|
3404
3538
|
});
|
|
3405
|
-
|
|
3539
|
+
ya.displayName = "ChannelView";
|
|
3406
3540
|
//#endregion
|
|
3407
3541
|
//#region src/components/MessagingShell/ErrorState.tsx
|
|
3408
|
-
var
|
|
3542
|
+
var ba = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ K("div", {
|
|
3409
3543
|
className: "messaging-error-state flex items-center justify-center h-full p-8",
|
|
3410
|
-
children: /* @__PURE__ */
|
|
3544
|
+
children: /* @__PURE__ */ q("div", {
|
|
3411
3545
|
className: "text-center max-w-sm",
|
|
3412
3546
|
children: [
|
|
3413
|
-
/* @__PURE__ */
|
|
3547
|
+
/* @__PURE__ */ K("div", {
|
|
3414
3548
|
className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6",
|
|
3415
|
-
children: /* @__PURE__ */
|
|
3549
|
+
children: /* @__PURE__ */ K("span", {
|
|
3416
3550
|
className: "text-4xl",
|
|
3417
3551
|
children: "⚠️"
|
|
3418
3552
|
})
|
|
3419
3553
|
}),
|
|
3420
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ K("h2", {
|
|
3421
3555
|
className: "font-semibold text-charcoal mb-2",
|
|
3422
3556
|
children: "Oops!"
|
|
3423
3557
|
}),
|
|
3424
|
-
/* @__PURE__ */
|
|
3558
|
+
/* @__PURE__ */ K("p", {
|
|
3425
3559
|
className: "text-stone text-sm mb-6",
|
|
3426
3560
|
children: e
|
|
3427
3561
|
}),
|
|
3428
|
-
t && /* @__PURE__ */
|
|
3562
|
+
t && /* @__PURE__ */ K("button", {
|
|
3429
3563
|
type: "button",
|
|
3430
3564
|
onClick: t,
|
|
3431
3565
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[#7f22fe] hover:bg-primary-alt rounded-lg transition-colors focus-ring",
|
|
@@ -3434,26 +3568,26 @@ var Yi = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ W("div", {
|
|
|
3434
3568
|
]
|
|
3435
3569
|
})
|
|
3436
3570
|
}));
|
|
3437
|
-
|
|
3571
|
+
ba.displayName = "ErrorState";
|
|
3438
3572
|
//#endregion
|
|
3439
3573
|
//#region src/components/MessagingShell/index.tsx
|
|
3440
|
-
var
|
|
3441
|
-
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } =
|
|
3442
|
-
|
|
3443
|
-
let
|
|
3444
|
-
|
|
3445
|
-
let
|
|
3574
|
+
var xa = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: s, onBlockParticipantClick: c, onReportParticipantClick: u, dmAgentEnabled: f, onMessageSent: p, viewerLanguage: g, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
|
|
3575
|
+
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = lt(), [F, I] = h(null), [L, R] = h(null), [z, B] = h(!1), { showDeleteConversation: ee = !0 } = e, te = m(o);
|
|
3576
|
+
te.current = o;
|
|
3577
|
+
let ne = m(r);
|
|
3578
|
+
ne.current = r;
|
|
3579
|
+
let re = m(null), V = m(null);
|
|
3446
3580
|
d(() => {
|
|
3447
|
-
|
|
3581
|
+
V.current = F;
|
|
3448
3582
|
}, [F]), d(() => {
|
|
3449
3583
|
if (!O || !k) return;
|
|
3450
3584
|
let e = O.userID;
|
|
3451
3585
|
if (!e) return;
|
|
3452
3586
|
let t = `${e}::${a}`;
|
|
3453
|
-
if (
|
|
3454
|
-
|
|
3587
|
+
if (re.current === t) return;
|
|
3588
|
+
re.current = t;
|
|
3455
3589
|
let n = () => {
|
|
3456
|
-
|
|
3590
|
+
re.current === t && (re.current = null);
|
|
3457
3591
|
};
|
|
3458
3592
|
(async () => {
|
|
3459
3593
|
try {
|
|
@@ -3463,10 +3597,10 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3463
3597
|
members: { $eq: [e, a] }
|
|
3464
3598
|
}, {}, { limit: 1 });
|
|
3465
3599
|
if (t.length > 0) {
|
|
3466
|
-
I(t[0]), R(null),
|
|
3600
|
+
I(t[0]), R(null), ne.current?.(t[0]), P && console.log("[MessagingShell] Initial conversation loaded:", t[0].id);
|
|
3467
3601
|
return;
|
|
3468
3602
|
}
|
|
3469
|
-
let r =
|
|
3603
|
+
let r = te.current;
|
|
3470
3604
|
if (!r || !N) {
|
|
3471
3605
|
n(), R("No conversation found with this account"), P && console.log("[MessagingShell] No conversation found for:", a);
|
|
3472
3606
|
return;
|
|
@@ -3477,12 +3611,12 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3477
3611
|
name: r.name,
|
|
3478
3612
|
phone: r.phone
|
|
3479
3613
|
});
|
|
3480
|
-
I(e), R(null),
|
|
3614
|
+
I(e), R(null), ne.current?.(e), P && console.log("[MessagingShell] Channel created and loaded:", e.id);
|
|
3481
3615
|
} catch (e) {
|
|
3482
3616
|
console.error("[MessagingShell] Failed to create conversation:", e), n(), R("Failed to create conversation");
|
|
3483
3617
|
}
|
|
3484
3618
|
} catch (e) {
|
|
3485
|
-
console.error("[MessagingShell] Failed to load initial conversation:", e), n(),
|
|
3619
|
+
console.error("[MessagingShell] Failed to load initial conversation:", e), n(), V.current || R("Failed to load conversation");
|
|
3486
3620
|
}
|
|
3487
3621
|
})();
|
|
3488
3622
|
}, [
|
|
@@ -3492,30 +3626,30 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3492
3626
|
N,
|
|
3493
3627
|
P
|
|
3494
3628
|
]);
|
|
3495
|
-
let
|
|
3496
|
-
|
|
3497
|
-
let
|
|
3498
|
-
I(null),
|
|
3629
|
+
let ie = m(i);
|
|
3630
|
+
ie.current = i;
|
|
3631
|
+
let ae = l(() => {
|
|
3632
|
+
I(null), B(!0), ie.current?.();
|
|
3499
3633
|
}, []);
|
|
3500
|
-
return A ? /* @__PURE__ */
|
|
3634
|
+
return A ? /* @__PURE__ */ K(_a, {}) : j ? /* @__PURE__ */ K(ba, {
|
|
3501
3635
|
message: j,
|
|
3502
3636
|
onBack: M
|
|
3503
|
-
}) : !k || !O ? /* @__PURE__ */
|
|
3637
|
+
}) : !k || !O ? /* @__PURE__ */ K(ba, {
|
|
3504
3638
|
message: "Not connected to messaging service",
|
|
3505
3639
|
onBack: M
|
|
3506
|
-
}) : L ? /* @__PURE__ */
|
|
3640
|
+
}) : L ? /* @__PURE__ */ K(ba, { message: L }) : z && !F ? /* @__PURE__ */ K(ba, { message: "Conversation ended" }) : F ? /* @__PURE__ */ K("div", {
|
|
3507
3641
|
className: "messaging-shell h-full bg-background-primary overflow-hidden",
|
|
3508
|
-
children: /* @__PURE__ */
|
|
3642
|
+
children: /* @__PURE__ */ K("div", {
|
|
3509
3643
|
className: "flex h-full min-h-0 flex-col",
|
|
3510
|
-
children: /* @__PURE__ */
|
|
3644
|
+
children: /* @__PURE__ */ K(ya, {
|
|
3511
3645
|
channel: F,
|
|
3512
3646
|
renderMessageInputActions: t,
|
|
3513
3647
|
renderConversationFooter: n,
|
|
3514
3648
|
renderChannelBanner: _,
|
|
3515
|
-
onLeaveConversation:
|
|
3516
|
-
onBlockParticipant:
|
|
3649
|
+
onLeaveConversation: ae,
|
|
3650
|
+
onBlockParticipant: ae,
|
|
3517
3651
|
CustomChannelEmptyState: s,
|
|
3518
|
-
showDeleteConversation:
|
|
3652
|
+
showDeleteConversation: ee,
|
|
3519
3653
|
onBlockParticipantClick: c,
|
|
3520
3654
|
onReportParticipantClick: u,
|
|
3521
3655
|
dmAgentEnabled: f,
|
|
@@ -3533,30 +3667,30 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3533
3667
|
attachmentPreviewList: D
|
|
3534
3668
|
}, F.id)
|
|
3535
3669
|
})
|
|
3536
|
-
}) : /* @__PURE__ */
|
|
3670
|
+
}) : /* @__PURE__ */ K(_a, {});
|
|
3537
3671
|
};
|
|
3538
3672
|
//#endregion
|
|
3539
3673
|
//#region src/hooks/useRestorePendingMessages.ts
|
|
3540
|
-
function
|
|
3674
|
+
function Sa(e) {
|
|
3541
3675
|
let t = e.state.pending_messages;
|
|
3542
3676
|
if (t?.length) for (let n of t) e.state.addMessageSorted(n.message);
|
|
3543
3677
|
}
|
|
3544
3678
|
//#endregion
|
|
3545
3679
|
//#region src/components/ChannelList/ChannelListContext.tsx
|
|
3546
|
-
var
|
|
3680
|
+
var Ca = o.createContext({
|
|
3547
3681
|
selectedChannel: void 0,
|
|
3548
3682
|
onChannelSelect: () => {},
|
|
3549
3683
|
debug: !1,
|
|
3550
3684
|
renderMessagePreview: void 0,
|
|
3551
3685
|
channelPreview: void 0,
|
|
3552
3686
|
viewerLanguage: void 0
|
|
3553
|
-
}),
|
|
3687
|
+
}), wa = Ca.Provider, Ta = () => o.useContext(Ca), Ea = (e, t) => {
|
|
3554
3688
|
let n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), r = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
3555
3689
|
return Math.floor((r - n) / 864e5);
|
|
3556
|
-
},
|
|
3690
|
+
}, Da = (e) => {
|
|
3557
3691
|
let t = /* @__PURE__ */ new Date();
|
|
3558
3692
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60) return "Just now";
|
|
3559
|
-
let n =
|
|
3693
|
+
let n = Ea(e, t);
|
|
3560
3694
|
return n === 0 ? e.toLocaleTimeString([], {
|
|
3561
3695
|
hour: "numeric",
|
|
3562
3696
|
minute: "2-digit",
|
|
@@ -3569,9 +3703,9 @@ var Qi = o.createContext({
|
|
|
3569
3703
|
day: "numeric",
|
|
3570
3704
|
year: "numeric"
|
|
3571
3705
|
});
|
|
3572
|
-
},
|
|
3573
|
-
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } =
|
|
3574
|
-
if (o) return /* @__PURE__ */
|
|
3706
|
+
}, Oa = o.memo((e) => {
|
|
3707
|
+
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = Ta(), { client: l } = ve(), u = r?.id === t?.id, d = ut(t);
|
|
3708
|
+
if (o) return /* @__PURE__ */ K(o, {
|
|
3575
3709
|
...e,
|
|
3576
3710
|
active: u,
|
|
3577
3711
|
selectedChannel: r,
|
|
@@ -3583,71 +3717,71 @@ var Qi = o.createContext({
|
|
|
3583
3717
|
}, p = (e) => {
|
|
3584
3718
|
let t = e.key === "Enter" || e.key === " ", n = e.repeat;
|
|
3585
3719
|
!t || n || (e.preventDefault(), f());
|
|
3586
|
-
}, m =
|
|
3720
|
+
}, m = dt(t?.state?.members, l?.userID, t?.type), h = ht(m?.user), g = m?.user?.image, _ = (() => {
|
|
3587
3721
|
let e = t?.state?.messages;
|
|
3588
3722
|
if (e?.length) {
|
|
3589
3723
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].type !== "system") return e[t];
|
|
3590
3724
|
}
|
|
3591
3725
|
})(), v = (() => {
|
|
3592
|
-
let e =
|
|
3726
|
+
let e = Mt({
|
|
3593
3727
|
message: _,
|
|
3594
3728
|
viewerLanguage: c
|
|
3595
3729
|
}), { custom_type: t, attachment_content_type: n } = _?.metadata || {};
|
|
3596
|
-
if (t ===
|
|
3597
|
-
if (t ===
|
|
3598
|
-
if (t ===
|
|
3730
|
+
if (t === J.TIP) return e || "Sent a tip";
|
|
3731
|
+
if (t === J.PAID) return e || "Sent a message";
|
|
3732
|
+
if (t === J.ATTACHMENT) {
|
|
3599
3733
|
if (n === "text") return "🔒 Sent a locked message";
|
|
3600
3734
|
if (n === "media") return "🔒 Sent a locked attachment";
|
|
3601
3735
|
}
|
|
3602
3736
|
if (e) return e;
|
|
3603
3737
|
let r = _?.attachments?.[0];
|
|
3604
3738
|
return r ? r.og_scrape_url ? r.og_scrape_url : r.type === "image" ? "📷 Sent an image" : r.type === "video" ? "🎥 Sent a video" : r.type === "audio" ? "🎵 Sent audio" : r.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
3605
|
-
})(), y = _?.created_at ?
|
|
3739
|
+
})(), y = _?.created_at ? Da(new Date(_.created_at)) : "", b = _ ? Sn(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
|
|
3606
3740
|
return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
3607
3741
|
channelId: t?.id,
|
|
3608
3742
|
isSelected: u,
|
|
3609
3743
|
participantName: h,
|
|
3610
3744
|
unreadCount: S,
|
|
3611
3745
|
hasTimestamp: !!y
|
|
3612
|
-
}), /* @__PURE__ */
|
|
3746
|
+
}), /* @__PURE__ */ K("div", {
|
|
3613
3747
|
role: "button",
|
|
3614
3748
|
tabIndex: 0,
|
|
3615
3749
|
onClick: f,
|
|
3616
3750
|
onKeyDown: p,
|
|
3617
|
-
className:
|
|
3751
|
+
className: X("group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2", {
|
|
3618
3752
|
"bg-black/[0.04]": u,
|
|
3619
3753
|
"hover:bg-black/[0.02]": !u
|
|
3620
3754
|
}),
|
|
3621
3755
|
"data-dd-privacy": "mask",
|
|
3622
|
-
children: /* @__PURE__ */
|
|
3756
|
+
children: /* @__PURE__ */ q("div", {
|
|
3623
3757
|
className: "flex items-start gap-4",
|
|
3624
|
-
children: [/* @__PURE__ */
|
|
3758
|
+
children: [/* @__PURE__ */ K(xt, {
|
|
3625
3759
|
id: m?.user?.id || t.id || "unknown",
|
|
3626
3760
|
name: h,
|
|
3627
3761
|
image: g,
|
|
3628
3762
|
size: 48,
|
|
3629
3763
|
starred: d
|
|
3630
|
-
}), /* @__PURE__ */
|
|
3764
|
+
}), /* @__PURE__ */ q("div", {
|
|
3631
3765
|
className: "flex-1 min-w-0 flex flex-col gap-1",
|
|
3632
|
-
children: [/* @__PURE__ */
|
|
3766
|
+
children: [/* @__PURE__ */ q("div", {
|
|
3633
3767
|
className: "flex items-center justify-between gap-2",
|
|
3634
|
-
children: [/* @__PURE__ */
|
|
3635
|
-
className:
|
|
3636
|
-
children: [d && /* @__PURE__ */
|
|
3768
|
+
children: [/* @__PURE__ */ q("h3", {
|
|
3769
|
+
className: X("text-sm font-medium truncate text-[#191918]"),
|
|
3770
|
+
children: [d && /* @__PURE__ */ K("span", {
|
|
3637
3771
|
className: "sr-only",
|
|
3638
3772
|
children: "Starred conversation. "
|
|
3639
3773
|
}), h]
|
|
3640
|
-
}), y && /* @__PURE__ */
|
|
3774
|
+
}), y && /* @__PURE__ */ K("span", {
|
|
3641
3775
|
"data-testid": "channel-preview-timestamp",
|
|
3642
3776
|
className: "text-xs text-[#717070] flex-shrink-0",
|
|
3643
3777
|
children: y
|
|
3644
3778
|
})]
|
|
3645
|
-
}), /* @__PURE__ */
|
|
3779
|
+
}), /* @__PURE__ */ q("div", {
|
|
3646
3780
|
className: "flex items-center justify-between gap-2 min-w-0",
|
|
3647
|
-
children: [/* @__PURE__ */
|
|
3781
|
+
children: [/* @__PURE__ */ K("p", {
|
|
3648
3782
|
className: "text-sm text-[#717070] flex-1 line-clamp-1",
|
|
3649
3783
|
children: x
|
|
3650
|
-
}), S > 0 && /* @__PURE__ */
|
|
3784
|
+
}), S > 0 && /* @__PURE__ */ K("span", {
|
|
3651
3785
|
"data-testid": "channel-preview-unread-badge",
|
|
3652
3786
|
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",
|
|
3653
3787
|
children: S > 99 ? "99+" : S
|
|
@@ -3657,14 +3791,14 @@ var Qi = o.createContext({
|
|
|
3657
3791
|
})
|
|
3658
3792
|
});
|
|
3659
3793
|
});
|
|
3660
|
-
|
|
3794
|
+
Oa.displayName = "CustomChannelPreview";
|
|
3661
3795
|
//#endregion
|
|
3662
3796
|
//#region src/components/ChannelList/index.tsx
|
|
3663
|
-
var
|
|
3797
|
+
var ka = { last_message_at: -1 }, Aa = o.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: i, sort: a = ka, className: s, customEmptyStateIndicator: c, channelListPaginator: l = O, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
|
|
3664
3798
|
let y = o.useRef(0);
|
|
3665
3799
|
y.current++;
|
|
3666
|
-
let { debug: b = !1 } =
|
|
3667
|
-
for (let t of e)
|
|
3800
|
+
let { debug: b = !1 } = st(), x = o.useCallback((e) => {
|
|
3801
|
+
for (let t of e) Sa(t);
|
|
3668
3802
|
return i ? i(e) : e;
|
|
3669
3803
|
}, [i]);
|
|
3670
3804
|
b && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
@@ -3687,13 +3821,13 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3687
3821
|
d,
|
|
3688
3822
|
f
|
|
3689
3823
|
]);
|
|
3690
|
-
return /* @__PURE__ */
|
|
3691
|
-
className:
|
|
3692
|
-
children: /* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ K("div", {
|
|
3825
|
+
className: X("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", s),
|
|
3826
|
+
children: /* @__PURE__ */ K("div", {
|
|
3693
3827
|
className: "flex-1 overflow-hidden min-w-0",
|
|
3694
|
-
children: /* @__PURE__ */
|
|
3828
|
+
children: /* @__PURE__ */ K(wa, {
|
|
3695
3829
|
value: S,
|
|
3696
|
-
children: /* @__PURE__ */
|
|
3830
|
+
children: /* @__PURE__ */ K(w, {
|
|
3697
3831
|
filters: n,
|
|
3698
3832
|
sort: a,
|
|
3699
3833
|
options: { limit: 30 },
|
|
@@ -3706,32 +3840,32 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3706
3840
|
onAddedToChannel: _,
|
|
3707
3841
|
onChannelUpdated: v,
|
|
3708
3842
|
Paginator: l,
|
|
3709
|
-
Preview:
|
|
3843
|
+
Preview: Oa,
|
|
3710
3844
|
EmptyStateIndicator: c
|
|
3711
3845
|
}, `${JSON.stringify(n)}:${JSON.stringify(a)}`)
|
|
3712
3846
|
})
|
|
3713
3847
|
})
|
|
3714
3848
|
});
|
|
3715
3849
|
});
|
|
3716
|
-
|
|
3850
|
+
Aa.displayName = "ChannelList";
|
|
3717
3851
|
//#endregion
|
|
3718
3852
|
//#region src/components/RichCard/RichCardBody.tsx
|
|
3719
|
-
var
|
|
3853
|
+
var ja = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", Ma = "text-[14px] leading-5 tracking-[0.02em]", Na = () => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("br", {}), /* @__PURE__ */ K("span", {
|
|
3720
3854
|
"aria-hidden": !0,
|
|
3721
3855
|
className: "block h-1.5"
|
|
3722
|
-
})] }),
|
|
3856
|
+
})] }), Pa = (e) => e.split(/\r?\n/).map((e, t, n) => /* @__PURE__ */ q(o.Fragment, { children: [e, t < n.length - 1 ? /* @__PURE__ */ K(Na, {}) : null] }, t)), Fa = ({ surface: e, actions: t, layout: n }) => {
|
|
3723
3857
|
if (t == null || t.length === 0) return null;
|
|
3724
3858
|
let r = n === "stacked";
|
|
3725
|
-
return /* @__PURE__ */
|
|
3726
|
-
className:
|
|
3727
|
-
children: t.map((t, n) => /* @__PURE__ */
|
|
3859
|
+
return /* @__PURE__ */ K("div", {
|
|
3860
|
+
className: X("flex gap-2", r ? "mt-4 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"),
|
|
3861
|
+
children: t.map((t, n) => /* @__PURE__ */ K(Lt, {
|
|
3728
3862
|
variant: e,
|
|
3729
3863
|
cta: t,
|
|
3730
3864
|
fullWidth: r,
|
|
3731
3865
|
standalone: !0
|
|
3732
3866
|
}, `${t.label}-${n}`))
|
|
3733
3867
|
});
|
|
3734
|
-
},
|
|
3868
|
+
}, Ia = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
|
|
3735
3869
|
let s = n != null && n.trim() !== "", c = r != null && r.trim() !== "", l = o != null && o.length > 0;
|
|
3736
3870
|
if (!s && !c && !l) return null;
|
|
3737
3871
|
let u = { color: t }, d = i > 1 ? {
|
|
@@ -3740,44 +3874,44 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3740
3874
|
WebkitBoxOrient: "vertical",
|
|
3741
3875
|
WebkitLineClamp: i,
|
|
3742
3876
|
overflow: "hidden"
|
|
3743
|
-
} : u, f = l && (o?.[0]?.variant ?? "primary") === "secondary", p = /* @__PURE__ */
|
|
3877
|
+
} : u, f = l && (o?.[0]?.variant ?? "primary") === "secondary", p = /* @__PURE__ */ q("div", {
|
|
3744
3878
|
className: "flex min-w-0 flex-1 flex-col gap-4",
|
|
3745
|
-
children: [s && /* @__PURE__ */
|
|
3879
|
+
children: [s && /* @__PURE__ */ q("div", {
|
|
3746
3880
|
className: "flex min-w-0 items-center gap-2",
|
|
3747
|
-
children: [a ? /* @__PURE__ */
|
|
3881
|
+
children: [a ? /* @__PURE__ */ K("span", {
|
|
3748
3882
|
className: "shrink-0",
|
|
3749
3883
|
children: a
|
|
3750
|
-
}) : null, /* @__PURE__ */
|
|
3751
|
-
className:
|
|
3884
|
+
}) : null, /* @__PURE__ */ K("p", {
|
|
3885
|
+
className: X("min-w-0", ja),
|
|
3752
3886
|
style: u,
|
|
3753
3887
|
children: n
|
|
3754
3888
|
})]
|
|
3755
|
-
}), c && /* @__PURE__ */
|
|
3756
|
-
className:
|
|
3889
|
+
}), c && /* @__PURE__ */ K("p", {
|
|
3890
|
+
className: X(Ma, i <= 1 && "truncate"),
|
|
3757
3891
|
style: d,
|
|
3758
|
-
children: i > 1 ?
|
|
3892
|
+
children: i > 1 ? Pa(r ?? "") : r
|
|
3759
3893
|
})]
|
|
3760
3894
|
});
|
|
3761
|
-
return /* @__PURE__ */
|
|
3895
|
+
return /* @__PURE__ */ K("div", {
|
|
3762
3896
|
className: "shrink-0 px-4 py-3",
|
|
3763
|
-
children: f ? /* @__PURE__ */
|
|
3897
|
+
children: f ? /* @__PURE__ */ q("div", {
|
|
3764
3898
|
"data-testid": "rich-card-chin-row",
|
|
3765
3899
|
className: "flex items-center justify-between gap-3",
|
|
3766
|
-
children: [p, /* @__PURE__ */
|
|
3900
|
+
children: [p, /* @__PURE__ */ K(Fa, {
|
|
3767
3901
|
surface: e,
|
|
3768
3902
|
actions: o,
|
|
3769
3903
|
layout: "row"
|
|
3770
3904
|
})]
|
|
3771
|
-
}) : /* @__PURE__ */ G
|
|
3905
|
+
}) : /* @__PURE__ */ q(G, { children: [p, /* @__PURE__ */ K(Fa, {
|
|
3772
3906
|
surface: e,
|
|
3773
3907
|
actions: o,
|
|
3774
3908
|
layout: "stacked"
|
|
3775
3909
|
})] })
|
|
3776
3910
|
});
|
|
3777
|
-
},
|
|
3911
|
+
}, La = {
|
|
3778
3912
|
dark: "bg-white/[0.06]",
|
|
3779
3913
|
light: "bg-black/[0.04]"
|
|
3780
|
-
},
|
|
3914
|
+
}, Ra = {
|
|
3781
3915
|
1: [0],
|
|
3782
3916
|
2: [-10, 10],
|
|
3783
3917
|
3: [
|
|
@@ -3785,7 +3919,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3785
3919
|
0,
|
|
3786
3920
|
13
|
|
3787
3921
|
]
|
|
3788
|
-
},
|
|
3922
|
+
}, za = {
|
|
3789
3923
|
1: [0],
|
|
3790
3924
|
2: [-26, 26],
|
|
3791
3925
|
3: [
|
|
@@ -3793,7 +3927,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3793
3927
|
0,
|
|
3794
3928
|
40
|
|
3795
3929
|
]
|
|
3796
|
-
},
|
|
3930
|
+
}, Ba = {
|
|
3797
3931
|
1: [0],
|
|
3798
3932
|
2: [0, 1],
|
|
3799
3933
|
3: [
|
|
@@ -3801,7 +3935,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3801
3935
|
3,
|
|
3802
3936
|
2
|
|
3803
3937
|
]
|
|
3804
|
-
},
|
|
3938
|
+
}, Va = {
|
|
3805
3939
|
1: [1],
|
|
3806
3940
|
2: [1, 1],
|
|
3807
3941
|
3: [
|
|
@@ -3809,16 +3943,16 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3809
3943
|
1.08,
|
|
3810
3944
|
1
|
|
3811
3945
|
]
|
|
3812
|
-
},
|
|
3946
|
+
}, Ha = ({ variant: e, images: t }) => {
|
|
3813
3947
|
let [n, r] = o.useState({}), i = t.join("\n"), [s, c] = o.useState(i);
|
|
3814
3948
|
i !== s && (c(i), r({}));
|
|
3815
3949
|
let l = t.slice(0, 3).map((e, t) => ({
|
|
3816
3950
|
src: e,
|
|
3817
3951
|
index: t
|
|
3818
|
-
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d =
|
|
3819
|
-
return /* @__PURE__ */
|
|
3820
|
-
className:
|
|
3821
|
-
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */
|
|
3952
|
+
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = Ra[u], f = za[u], p = Ba[u], m = Va[u];
|
|
3953
|
+
return /* @__PURE__ */ K("div", {
|
|
3954
|
+
className: X("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", La[e]),
|
|
3955
|
+
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */ K("img", {
|
|
3822
3956
|
src: a(e) ?? e,
|
|
3823
3957
|
alt: "",
|
|
3824
3958
|
draggable: !1,
|
|
@@ -3835,44 +3969,44 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3835
3969
|
}
|
|
3836
3970
|
}, `${e}-${t}`))
|
|
3837
3971
|
});
|
|
3838
|
-
},
|
|
3839
|
-
className:
|
|
3840
|
-
children: t === "fan" ? /* @__PURE__ */
|
|
3972
|
+
}, Ua = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", Wa = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ K("div", {
|
|
3973
|
+
className: Ua,
|
|
3974
|
+
children: t === "fan" ? /* @__PURE__ */ K(Ha, {
|
|
3841
3975
|
variant: e,
|
|
3842
3976
|
images: n
|
|
3843
|
-
}) : /* @__PURE__ */
|
|
3977
|
+
}) : /* @__PURE__ */ K(Qt, {
|
|
3844
3978
|
variant: e,
|
|
3845
3979
|
thumbnailUrl: i,
|
|
3846
3980
|
title: r,
|
|
3847
3981
|
mimeType: "image/*",
|
|
3848
3982
|
onImageError: a
|
|
3849
3983
|
})
|
|
3850
|
-
}),
|
|
3851
|
-
let u =
|
|
3984
|
+
}), Ga = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
|
|
3985
|
+
let u = De({
|
|
3852
3986
|
imagePresentation: a,
|
|
3853
3987
|
images: i
|
|
3854
|
-
}), d = i.length > 0, f = d && u === "hero", p =
|
|
3988
|
+
}), d = i.length > 0, f = d && u === "hero", p = an({
|
|
3855
3989
|
variant: e,
|
|
3856
3990
|
accentColor: c,
|
|
3857
3991
|
layout: "featured",
|
|
3858
3992
|
thumbnailUrl: f ? i[0] : void 0
|
|
3859
3993
|
}), m = l === "single" || l === "end";
|
|
3860
|
-
return /* @__PURE__ */
|
|
3994
|
+
return /* @__PURE__ */ K(ln, {
|
|
3861
3995
|
accentHex: p.accentHex,
|
|
3862
3996
|
side: e === "dark" ? "sender" : "receiver",
|
|
3863
3997
|
visible: m,
|
|
3864
|
-
children: /* @__PURE__ */
|
|
3998
|
+
children: /* @__PURE__ */ q(Kt, {
|
|
3865
3999
|
variant: e,
|
|
3866
4000
|
accentHex: p.accentHex,
|
|
3867
4001
|
"data-testid": "rich-card",
|
|
3868
|
-
children: [d && /* @__PURE__ */
|
|
4002
|
+
children: [d && /* @__PURE__ */ K(Wa, {
|
|
3869
4003
|
variant: e,
|
|
3870
4004
|
presentation: u,
|
|
3871
4005
|
images: i,
|
|
3872
4006
|
title: t,
|
|
3873
4007
|
heroUrl: f ? p.thumbnailUrl : void 0,
|
|
3874
4008
|
onHeroError: p.onImageError
|
|
3875
|
-
}), /* @__PURE__ */
|
|
4009
|
+
}), /* @__PURE__ */ K(Ia, {
|
|
3876
4010
|
ctaSurface: p.surface,
|
|
3877
4011
|
chinTextColor: p.chinTextColor,
|
|
3878
4012
|
title: t,
|
|
@@ -3883,19 +4017,19 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3883
4017
|
})]
|
|
3884
4018
|
})
|
|
3885
4019
|
});
|
|
3886
|
-
},
|
|
3887
|
-
Sent: (e) => /* @__PURE__ */
|
|
4020
|
+
}, Ka = {
|
|
4021
|
+
Sent: (e) => /* @__PURE__ */ K(Ga, {
|
|
3888
4022
|
...e,
|
|
3889
4023
|
variant: "dark"
|
|
3890
4024
|
}),
|
|
3891
|
-
Received: (e) => /* @__PURE__ */
|
|
4025
|
+
Received: (e) => /* @__PURE__ */ K(Ga, {
|
|
3892
4026
|
...e,
|
|
3893
4027
|
variant: "light"
|
|
3894
4028
|
})
|
|
3895
|
-
},
|
|
4029
|
+
}, qa = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", Ja = {
|
|
3896
4030
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3897
4031
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
3898
|
-
},
|
|
4032
|
+
}, Ya = ({ variant: e }) => /* @__PURE__ */ K("span", {
|
|
3899
4033
|
"aria-hidden": "true",
|
|
3900
4034
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
3901
4035
|
style: {
|
|
@@ -3903,11 +4037,11 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3903
4037
|
insetInlineStart: e === "received" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
3904
4038
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
3905
4039
|
transformOrigin: "center",
|
|
3906
|
-
backgroundColor:
|
|
3907
|
-
WebkitMask:
|
|
3908
|
-
mask:
|
|
4040
|
+
backgroundColor: Ja[e],
|
|
4041
|
+
WebkitMask: qa,
|
|
4042
|
+
mask: qa
|
|
3909
4043
|
}
|
|
3910
|
-
}),
|
|
4044
|
+
}), Xa = {
|
|
3911
4045
|
sent: {
|
|
3912
4046
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3913
4047
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -3916,73 +4050,73 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3916
4050
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
3917
4051
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
3918
4052
|
}
|
|
3919
|
-
},
|
|
4053
|
+
}, Za = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ q("div", {
|
|
3920
4054
|
"data-dd-privacy": "mask",
|
|
3921
|
-
className:
|
|
4055
|
+
className: X("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
|
|
3922
4056
|
style: {
|
|
3923
|
-
...
|
|
4057
|
+
...Xa[e],
|
|
3924
4058
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
3925
4059
|
isolation: "isolate"
|
|
3926
4060
|
},
|
|
3927
4061
|
children: [
|
|
3928
|
-
r != null && /* @__PURE__ */
|
|
4062
|
+
r != null && /* @__PURE__ */ K("div", {
|
|
3929
4063
|
className: "mb-1 font-medium",
|
|
3930
4064
|
"data-testid": "message-bubble-header",
|
|
3931
4065
|
children: r
|
|
3932
4066
|
}),
|
|
3933
|
-
/* @__PURE__ */
|
|
4067
|
+
/* @__PURE__ */ K("p", {
|
|
3934
4068
|
className: "m-0 whitespace-pre-wrap break-words hyphens-manual",
|
|
3935
4069
|
children: t
|
|
3936
4070
|
}),
|
|
3937
|
-
n && /* @__PURE__ */
|
|
4071
|
+
n && /* @__PURE__ */ K(Ya, { variant: e })
|
|
3938
4072
|
]
|
|
3939
|
-
}),
|
|
3940
|
-
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */
|
|
4073
|
+
}), Qa = {
|
|
4074
|
+
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ K(Za, {
|
|
3941
4075
|
variant: "sent",
|
|
3942
4076
|
text: e,
|
|
3943
4077
|
tail: t,
|
|
3944
4078
|
className: n
|
|
3945
4079
|
}),
|
|
3946
|
-
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */
|
|
4080
|
+
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ K(Za, {
|
|
3947
4081
|
variant: "received",
|
|
3948
4082
|
text: e,
|
|
3949
4083
|
tail: t,
|
|
3950
4084
|
header: n,
|
|
3951
4085
|
className: r
|
|
3952
4086
|
})
|
|
3953
|
-
},
|
|
4087
|
+
}, $a = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ K("button", {
|
|
3954
4088
|
type: "button",
|
|
3955
4089
|
onClick: t,
|
|
3956
4090
|
disabled: n,
|
|
3957
4091
|
style: { backgroundColor: "#E6E5E3" },
|
|
3958
|
-
className:
|
|
4092
|
+
className: X("w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring", {
|
|
3959
4093
|
"hover:brightness-95 active:brightness-90": !n,
|
|
3960
4094
|
"opacity-50 cursor-not-allowed": n
|
|
3961
4095
|
}, r),
|
|
3962
4096
|
children: e
|
|
3963
|
-
}),
|
|
3964
|
-
let s =
|
|
3965
|
-
return s.length === 0 ? null : /* @__PURE__ */
|
|
4097
|
+
}), eo = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
|
|
4098
|
+
let s = Oe(e);
|
|
4099
|
+
return s.length === 0 ? null : /* @__PURE__ */ K("div", {
|
|
3966
4100
|
className: i,
|
|
3967
|
-
children: /* @__PURE__ */
|
|
4101
|
+
children: /* @__PURE__ */ q("div", {
|
|
3968
4102
|
className: "flex gap-3 items-end",
|
|
3969
|
-
children: [(a || o) && /* @__PURE__ */
|
|
4103
|
+
children: [(a || o) && /* @__PURE__ */ K("div", {
|
|
3970
4104
|
className: "flex-none",
|
|
3971
|
-
children: /* @__PURE__ */
|
|
4105
|
+
children: /* @__PURE__ */ K(xt, {
|
|
3972
4106
|
id: o || "account",
|
|
3973
4107
|
name: o || "Account",
|
|
3974
4108
|
image: a,
|
|
3975
4109
|
size: 24,
|
|
3976
4110
|
shape: "circle"
|
|
3977
4111
|
})
|
|
3978
|
-
}), /* @__PURE__ */
|
|
4112
|
+
}), /* @__PURE__ */ q("div", {
|
|
3979
4113
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
3980
4114
|
style: { backgroundColor: "#F1F0EE" },
|
|
3981
|
-
children: [r && /* @__PURE__ */
|
|
4115
|
+
children: [r && /* @__PURE__ */ K("p", {
|
|
3982
4116
|
"data-testid": "faq-list-header",
|
|
3983
4117
|
className: "text-md text-charcoal mb-4",
|
|
3984
4118
|
children: r
|
|
3985
|
-
}), s.map((e) => /* @__PURE__ */
|
|
4119
|
+
}), s.map((e) => /* @__PURE__ */ K($a, {
|
|
3986
4120
|
question: e.question,
|
|
3987
4121
|
onClick: () => t(e.id),
|
|
3988
4122
|
loading: n === e.id
|
|
@@ -3992,6 +4126,6 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3992
4126
|
});
|
|
3993
4127
|
};
|
|
3994
4128
|
//#endregion
|
|
3995
|
-
export {
|
|
4129
|
+
export { wt as ActionButton, xt as Avatar, ha as ChannelEmptyState, Aa as ChannelList, ya as ChannelView, mn as CustomMessageProvider, eo as FaqList, $a as FaqListItem, un as LinkAttachment, yn as LockedAttachment, wi as MessageAttachment, Qa as MessageBubble, it as MessagingLoggerProvider, ct as MessagingProvider, xa as MessagingShell, Ka as RichCard, Ln as TipMessage, nr as buildCompactMetaLabel, $n as formatFileSize, Da as formatRelativeTime, tr as getFileExtensionLabel, Mt as getMessageDisplayText, dn as isLinkAttachment, In as isTipMessage, pt as isUuidLike, Zn as messageAttachmentGroupPositionFromStream, jt as normalizeLanguageCode, a as optimizeMessagingAttachmentUrl, dt as resolveConversationParticipant, ht as resolveParticipantDisplayName, Ji as useComposerLocked, hn as useCustomMessage, lt as useMessaging, at as useMessagingLogger };
|
|
3996
4130
|
|
|
3997
4131
|
//# sourceMappingURL=index.js.map
|