@linktr.ee/messaging-react 3.6.2-rc-1783307602 → 3.6.2-rc-1783311731
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Card-CS_6M9I_.js → Card-0wf8lj5n.js} +2 -2
- package/dist/{Card-CS_6M9I_.js.map → Card-0wf8lj5n.js.map} +1 -1
- package/dist/{Card-DQGYnsjO.cjs → Card-4UyBK3XO.cjs} +2 -2
- package/dist/{Card-DQGYnsjO.cjs.map → Card-4UyBK3XO.cjs.map} +1 -1
- package/dist/{Card-Dlb_74PT.cjs → Card-6b4Ws9rn.cjs} +2 -2
- package/dist/{Card-Dlb_74PT.cjs.map → Card-6b4Ws9rn.cjs.map} +1 -1
- package/dist/{Card-bm6JeM03.cjs → Card-DsQhJjj0.cjs} +2 -2
- package/dist/{Card-bm6JeM03.cjs.map → Card-DsQhJjj0.cjs.map} +1 -1
- package/dist/{Card-CYD26x1-.js → Card-RZ6C_IkE.js} +3 -3
- package/dist/{Card-CYD26x1-.js.map → Card-RZ6C_IkE.js.map} +1 -1
- package/dist/{Card-BqePrWk0.js → Card-iGNcxybY.js} +2 -2
- package/dist/{Card-BqePrWk0.js.map → Card-iGNcxybY.js.map} +1 -1
- package/dist/{LockedThumbnail-DC782hvV.js → LockedThumbnail-Do9udNMm.js} +2 -2
- package/dist/{LockedThumbnail-DC782hvV.js.map → LockedThumbnail-Do9udNMm.js.map} +1 -1
- package/dist/{LockedThumbnail-C3kgiGFK.cjs → LockedThumbnail-N0pNOO3D.cjs} +2 -2
- package/dist/{LockedThumbnail-C3kgiGFK.cjs.map → LockedThumbnail-N0pNOO3D.cjs.map} +1 -1
- package/dist/index-B3ZJaqJY.cjs +2 -0
- package/dist/index-B3ZJaqJY.cjs.map +1 -0
- package/dist/{index-DaF1G1q2.js → index-wFe1UO9t.js} +600 -591
- package/dist/index-wFe1UO9t.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +74 -21
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +65 -28
- package/src/components/CustomMessage/index.tsx +0 -7
- package/dist/index-DaF1G1q2.js.map +0 -1
- package/dist/index-eVxxkfK6.cjs +0 -2
- package/dist/index-eVxxkfK6.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as s, jsxs as m, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import U, { createContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
2
|
+
import U, { createContext as rt, useContext as Ie, useCallback as J, useState as B, useRef as G, useEffect as K, useId as Gs, useMemo as se, Suspense as it } from "react";
|
|
3
|
+
import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Ys, LinkPreviewsManager as Yt } from "stream-chat";
|
|
5
|
+
import { Chat as qs, useChannelStateContext as le, useChatContext as oe, DateSeparator as Ws, MessageStatus as Xs, useMessageContext as _e, areMessageUIPropsEqual as Ks, useMessageReminder as Js, useComponentContext as is, Attachment as Zs, EditMessageModal as Qs, MessageBlocked as en, MessageBouncePrompt as tn, MessageDeleted as sn, MessageIsThreadReplyInChannelButtonIndicator as nn, MessageRepliesCountButton as an, ReminderNotification as rn, StreamedMessageText as ln, messageHasAttachments as on, messageHasReactions as cn, isDateSeparatorMessage as dn, isMessageBlocked as un, isMessageBounced as mn, MessageBounceModal as hn, MessageText as qt, MessageErrorIcon as Wt, Poll as fn, useMessageComposer as gn, useStateStore as pn, MessageInput as bn, useMessageInputContext as vn, useMessageComposerHasSendableData as xn, AttachmentPreviewList as wn, QuotedMessagePreview as _n, TextareaComposer as Nn, MessageTimestamp as Ye, AIStates as qe, useTypingContext as yn, useAIState as kn, Channel as Cn, WithComponents as Sn, Window as En, MessageList as In, ChannelList as Tn, InfiniteScroll as An } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, DotsThreeIcon as Mn, SpinnerGapIcon as ze, SignOutIcon as Rn, ProhibitInsetIcon as Xt, FlagIcon as ls, ArrowLeftIcon as et, CurrencyDollarIcon as Dn, CaretRightIcon as ve, SparkleIcon as xe, FileIcon as os, ImageIcon as Ln, SpeakerHighIcon as zn, VideoCameraIcon as cs, FileMdIcon as Pn, FileTextIcon as Fn, FileZipIcon as On, FilePptIcon as $n, FileCsvIcon as jn, FileXlsIcon as Bn, FileDocIcon as Un, FilePdfIcon as Vn, CircleNotchIcon as Ce, PlayIcon as tt, PauseIcon as Gn, LinkIcon as Hn, DownloadSimpleIcon as Se, XIcon as Be, CaretLeftIcon as Yn, GiftIcon as qn, ThumbsUpIcon as Wn, ThumbsDownIcon as Xn, ChecksIcon as Kn, PencilSimpleIcon as Jn, TrashSimpleIcon as Zn, ArrowUpIcon as Qn, ProhibitIcon as ea } from "@phosphor-icons/react";
|
|
7
7
|
import k from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as ta, DefaultDropdownActionButton as ds } from "stream-chat-react/experimental";
|
|
9
|
+
const us = rt({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const ds = at({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), lt = () => Ie(us), dl = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -62,12 +62,12 @@ const ds = at({
|
|
|
62
62
|
serviceConfig: n,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((A =
|
|
67
|
-
const
|
|
65
|
+
const L = G(null);
|
|
66
|
+
a && ((A = L.current) == null ? void 0 : A.apiKey) !== a && (L.current = { apiKey: a, client: new Ys(a) });
|
|
67
|
+
const D = a ? ((E = L.current) == null ? void 0 : E.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
69
|
const C = M.current, I = N.current;
|
|
70
|
-
if (!a || !
|
|
70
|
+
if (!a || !D || !I) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: C,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,17 +78,17 @@ const ds = at({
|
|
|
78
78
|
renderCount: C,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const $ = new
|
|
81
|
+
const $ = new Hs({
|
|
82
82
|
...I,
|
|
83
83
|
apiKey: a,
|
|
84
84
|
debug: S.current,
|
|
85
|
-
client:
|
|
85
|
+
client: D
|
|
86
86
|
});
|
|
87
87
|
x.current = $, d($), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: C,
|
|
89
89
|
serviceInstance: !!$
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
91
|
+
}, [a, D]);
|
|
92
92
|
const O = G(null);
|
|
93
93
|
K(() => {
|
|
94
94
|
var I, $;
|
|
@@ -137,12 +137,12 @@ const ds = at({
|
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
139
|
}, [o, t, l, h]), K(() => {
|
|
140
|
-
const C =
|
|
140
|
+
const C = D;
|
|
141
141
|
return () => {
|
|
142
142
|
var I;
|
|
143
143
|
C && (O.current = null, (I = x.current) == null || I.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
145
|
+
}, [D]);
|
|
146
146
|
const z = J(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
@@ -194,19 +194,19 @@ const ds = at({
|
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
196
|
renderCount: M.current,
|
|
197
|
-
willRenderChat: !!
|
|
197
|
+
willRenderChat: !!D,
|
|
198
198
|
contextValueReady: !!y
|
|
199
|
-
}), /* @__PURE__ */ s(
|
|
200
|
-
|
|
199
|
+
}), /* @__PURE__ */ s(us.Provider, { value: y, children: D ? /* @__PURE__ */ s(
|
|
200
|
+
qs,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: D,
|
|
203
203
|
customClasses: {
|
|
204
204
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
205
|
},
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, sa = () => lt(), ot = (e) => {
|
|
210
210
|
var a, r;
|
|
211
211
|
const [t, n] = B(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -228,14 +228,14 @@ const ds = at({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
231
|
+
}, na = "linktree-official", aa = "linktree-official-sender";
|
|
232
232
|
function Ue(e, t, n) {
|
|
233
233
|
const a = Object.values(e || {});
|
|
234
|
-
if (n ===
|
|
234
|
+
if (n === na) {
|
|
235
235
|
const r = a.find(
|
|
236
236
|
(i) => {
|
|
237
237
|
var l;
|
|
238
|
-
return ((l = i.user) == null ? void 0 : l.id) ===
|
|
238
|
+
return ((l = i.user) == null ? void 0 : l.id) === aa;
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
if (r) return r;
|
|
@@ -247,18 +247,18 @@ function Ue(e, t, n) {
|
|
|
247
247
|
}
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
function
|
|
252
|
-
return
|
|
250
|
+
const ra = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
251
|
+
function ia(e) {
|
|
252
|
+
return ra.test(e.trim());
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Kt(e, t) {
|
|
255
255
|
const n = e == null ? void 0 : e.trim();
|
|
256
|
-
return !n || t && n === t ? !1 : !
|
|
256
|
+
return !n || t && n === t ? !1 : !ia(n);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
function ct(e) {
|
|
259
|
+
return Kt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Kt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
260
260
|
}
|
|
261
|
-
const
|
|
261
|
+
const Jt = [
|
|
262
262
|
{ emoji: "🍎", bgColor: "#FFD1DD" },
|
|
263
263
|
// Apple
|
|
264
264
|
{ emoji: "🍌", bgColor: "#FFF1C9" },
|
|
@@ -286,7 +286,7 @@ const Kt = [
|
|
|
286
286
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
287
287
|
// Melon
|
|
288
288
|
];
|
|
289
|
-
function
|
|
289
|
+
function la(e) {
|
|
290
290
|
let t = 0;
|
|
291
291
|
for (let n = 0; n < e.length; n++) {
|
|
292
292
|
const a = e.charCodeAt(n);
|
|
@@ -294,16 +294,16 @@ function ia(e) {
|
|
|
294
294
|
}
|
|
295
295
|
return Math.abs(t);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
return
|
|
299
|
-
}
|
|
300
|
-
function la(e) {
|
|
301
|
-
return us(e).emoji;
|
|
297
|
+
function ms(e) {
|
|
298
|
+
return Jt[la(e) % Jt.length];
|
|
302
299
|
}
|
|
303
300
|
function oa(e) {
|
|
304
|
-
return
|
|
301
|
+
return ms(e).emoji;
|
|
302
|
+
}
|
|
303
|
+
function ca(e) {
|
|
304
|
+
return ms(e).bgColor;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const ne = ({
|
|
307
307
|
id: e,
|
|
308
308
|
image: t,
|
|
309
309
|
size: n = 40,
|
|
@@ -312,7 +312,7 @@ const se = ({
|
|
|
312
312
|
shape: i = "squircle",
|
|
313
313
|
dmAgentEnabled: l = !1
|
|
314
314
|
}) => {
|
|
315
|
-
const o =
|
|
315
|
+
const o = oa(e), d = ca(e), u = 0.45, h = n < 32 ? Math.round(n * u) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
316
316
|
"img",
|
|
317
317
|
{
|
|
318
318
|
src: t,
|
|
@@ -350,7 +350,7 @@ const se = ({
|
|
|
350
350
|
{
|
|
351
351
|
"aria-hidden": "true",
|
|
352
352
|
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)]",
|
|
353
|
-
children: /* @__PURE__ */ s(
|
|
353
|
+
children: /* @__PURE__ */ s(Ee, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
354
354
|
}
|
|
355
355
|
),
|
|
356
356
|
/* @__PURE__ */ s(
|
|
@@ -376,7 +376,7 @@ const se = ({
|
|
|
376
376
|
]
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
|
-
},
|
|
379
|
+
}, da = "https://linktr.ee/s/about/trust-center/report", ua = ({
|
|
380
380
|
channel: e,
|
|
381
381
|
participant: t,
|
|
382
382
|
showBlockParticipant: n = !0,
|
|
@@ -390,7 +390,7 @@ const se = ({
|
|
|
390
390
|
logLabel: p = "useChannelModerationActions"
|
|
391
391
|
}) => {
|
|
392
392
|
var A;
|
|
393
|
-
const { service: h, debug: g } =
|
|
393
|
+
const { service: h, debug: g } = lt(), c = (A = t == null ? void 0 : t.user) == null ? void 0 : A.id, v = !!(a && n && h && c), [w, b] = B(!1), [f, x] = B(null), [N, S] = B(!1), [T, M] = B(!1), L = v && ((f == null ? void 0 : f.participantId) !== c || (f == null ? void 0 : f.service) !== h);
|
|
394
394
|
return K(() => {
|
|
395
395
|
if (!v || !h || !c) {
|
|
396
396
|
b(!1), x(null);
|
|
@@ -416,7 +416,7 @@ const se = ({
|
|
|
416
416
|
};
|
|
417
417
|
}, [v, h, c, p]), {
|
|
418
418
|
isParticipantBlocked: w,
|
|
419
|
-
isCheckingBlockedStatus:
|
|
419
|
+
isCheckingBlockedStatus: L,
|
|
420
420
|
isLeaving: N,
|
|
421
421
|
isUpdatingBlockStatus: T,
|
|
422
422
|
handleLeaveConversation: async () => {
|
|
@@ -460,10 +460,10 @@ const se = ({
|
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
handleReportUser: () => {
|
|
463
|
-
d == null || d(), u == null || u(), window.open(
|
|
463
|
+
d == null || d(), u == null || u(), window.open(da, "_blank", "noopener,noreferrer");
|
|
464
464
|
}
|
|
465
465
|
};
|
|
466
|
-
},
|
|
466
|
+
}, Ne = ({
|
|
467
467
|
variant: e = "default",
|
|
468
468
|
className: t,
|
|
469
469
|
children: n,
|
|
@@ -480,7 +480,7 @@ const se = ({
|
|
|
480
480
|
...a,
|
|
481
481
|
children: n
|
|
482
482
|
}
|
|
483
|
-
),
|
|
483
|
+
), st = ({
|
|
484
484
|
channel: e,
|
|
485
485
|
participant: t,
|
|
486
486
|
showDeleteConversation: n = !0,
|
|
@@ -494,16 +494,16 @@ const se = ({
|
|
|
494
494
|
customChannelActions: p,
|
|
495
495
|
triggerClassName: h
|
|
496
496
|
}) => {
|
|
497
|
-
const [g, c] = B(!1), v = G(null), w =
|
|
497
|
+
const [g, c] = B(!1), v = G(null), w = Gs(), b = J(() => c(!1), []), {
|
|
498
498
|
isParticipantBlocked: f,
|
|
499
499
|
isCheckingBlockedStatus: x,
|
|
500
500
|
isLeaving: N,
|
|
501
501
|
isUpdatingBlockStatus: S,
|
|
502
502
|
handleLeaveConversation: T,
|
|
503
503
|
handleBlockUser: M,
|
|
504
|
-
handleUnblockUser:
|
|
505
|
-
handleReportUser:
|
|
506
|
-
} =
|
|
504
|
+
handleUnblockUser: L,
|
|
505
|
+
handleReportUser: D
|
|
506
|
+
} = ua({
|
|
507
507
|
channel: e,
|
|
508
508
|
participant: t,
|
|
509
509
|
showBlockParticipant: a,
|
|
@@ -537,7 +537,7 @@ const se = ({
|
|
|
537
537
|
"aria-controls": g ? w : void 0,
|
|
538
538
|
onClick: () => c((z) => !z),
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */ s(
|
|
540
|
+
/* @__PURE__ */ s(Mn, { className: "size-5 text-black/90" }),
|
|
541
541
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
542
542
|
]
|
|
543
543
|
}
|
|
@@ -553,13 +553,13 @@ const se = ({
|
|
|
553
553
|
),
|
|
554
554
|
children: /* @__PURE__ */ m("ul", { className: "flex flex-col gap-1", children: [
|
|
555
555
|
n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
556
|
-
|
|
556
|
+
Ne,
|
|
557
557
|
{
|
|
558
558
|
onClick: T,
|
|
559
559
|
disabled: N,
|
|
560
560
|
"aria-busy": N,
|
|
561
561
|
children: [
|
|
562
|
-
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
562
|
+
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Rn, { className: "h-5 w-5" }),
|
|
563
563
|
/* @__PURE__ */ s("span", { children: "Delete Conversation" })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
@@ -567,35 +567,35 @@ const se = ({
|
|
|
567
567
|
a && /* @__PURE__ */ s("li", { children: x ? (
|
|
568
568
|
// Block status not yet resolved — show a disabled placeholder
|
|
569
569
|
// so a premature click can't act on a stale block state.
|
|
570
|
-
/* @__PURE__ */ m(
|
|
570
|
+
/* @__PURE__ */ m(Ne, { disabled: !0, "aria-busy": !0, children: [
|
|
571
571
|
/* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }),
|
|
572
572
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
573
573
|
] })
|
|
574
574
|
) : f ? /* @__PURE__ */ m(
|
|
575
|
-
|
|
575
|
+
Ne,
|
|
576
576
|
{
|
|
577
|
-
onClick:
|
|
577
|
+
onClick: L,
|
|
578
578
|
disabled: S,
|
|
579
579
|
"aria-busy": S,
|
|
580
580
|
children: [
|
|
581
|
-
S ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
581
|
+
S ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
|
|
582
582
|
/* @__PURE__ */ s("span", { children: "Unblock" })
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) : /* @__PURE__ */ m(
|
|
586
|
-
|
|
586
|
+
Ne,
|
|
587
587
|
{
|
|
588
588
|
onClick: M,
|
|
589
589
|
disabled: S,
|
|
590
590
|
"aria-busy": S,
|
|
591
591
|
children: [
|
|
592
|
-
S ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
592
|
+
S ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
|
|
593
593
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
594
594
|
]
|
|
595
595
|
}
|
|
596
596
|
) }),
|
|
597
|
-
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
598
|
-
/* @__PURE__ */ s(
|
|
597
|
+
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(Ne, { variant: "danger", onClick: D, children: [
|
|
598
|
+
/* @__PURE__ */ s(ls, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ s("span", { children: "Report" })
|
|
600
600
|
] }) }),
|
|
601
601
|
p
|
|
@@ -603,10 +603,10 @@ const se = ({
|
|
|
603
603
|
}
|
|
604
604
|
)
|
|
605
605
|
] });
|
|
606
|
-
}, We = "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",
|
|
606
|
+
}, We = "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", ma = "CUSTOMER_PAID", ha = "Replies instantly with AI assistant", fa = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ma, ga = (e) => {
|
|
607
607
|
const t = e;
|
|
608
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(
|
|
609
|
-
},
|
|
608
|
+
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(fa);
|
|
609
|
+
}, pa = ({
|
|
610
610
|
onBack: e,
|
|
611
611
|
showBackButton: t,
|
|
612
612
|
showStarButton: n = !1,
|
|
@@ -624,8 +624,8 @@ const se = ({
|
|
|
624
624
|
showChannelInfo: v = !0,
|
|
625
625
|
onParticipantNameClick: w
|
|
626
626
|
}) => {
|
|
627
|
-
var
|
|
628
|
-
const { channel: b } =
|
|
627
|
+
var D, O, z;
|
|
628
|
+
const { channel: b } = le(), { client: f } = oe(), x = U.useMemo(
|
|
629
629
|
() => {
|
|
630
630
|
var y;
|
|
631
631
|
return Ue(
|
|
@@ -634,8 +634,8 @@ const se = ({
|
|
|
634
634
|
b.type
|
|
635
635
|
);
|
|
636
636
|
},
|
|
637
|
-
[(
|
|
638
|
-
), N =
|
|
637
|
+
[(D = b.state) == null ? void 0 : D.members, f == null ? void 0 : f.userID, b.type]
|
|
638
|
+
), N = ct(x == null ? void 0 : x.user), S = (O = x == null ? void 0 : x.user) == null ? void 0 : O.image, T = ot(b), M = ga(x), L = async () => {
|
|
639
639
|
try {
|
|
640
640
|
T ? await b.unpin() : await b.pin();
|
|
641
641
|
} catch (y) {
|
|
@@ -657,7 +657,7 @@ const se = ({
|
|
|
657
657
|
}),
|
|
658
658
|
type: "button",
|
|
659
659
|
"aria-label": "Back to conversations",
|
|
660
|
-
children: /* @__PURE__ */ s(
|
|
660
|
+
children: /* @__PURE__ */ s(et, { className: "size-5 text-black/90" })
|
|
661
661
|
}
|
|
662
662
|
) }),
|
|
663
663
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: /* @__PURE__ */ m(
|
|
@@ -669,7 +669,7 @@ const se = ({
|
|
|
669
669
|
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",
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ s(
|
|
672
|
-
|
|
672
|
+
ne,
|
|
673
673
|
{
|
|
674
674
|
id: ((z = x == null ? void 0 : x.user) == null ? void 0 : z.id) || b.id || "unknown",
|
|
675
675
|
name: N,
|
|
@@ -689,7 +689,7 @@ const se = ({
|
|
|
689
689
|
{
|
|
690
690
|
"aria-label": "Paid customer",
|
|
691
691
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
692
|
-
children: /* @__PURE__ */ s(
|
|
692
|
+
children: /* @__PURE__ */ s(Dn, { className: "size-2.5", weight: "bold" })
|
|
693
693
|
}
|
|
694
694
|
),
|
|
695
695
|
n && T && /* @__PURE__ */ s(
|
|
@@ -697,7 +697,7 @@ const se = ({
|
|
|
697
697
|
{
|
|
698
698
|
"aria-label": "Starred conversation",
|
|
699
699
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
700
|
-
children: /* @__PURE__ */ s(
|
|
700
|
+
children: /* @__PURE__ */ s(Ee, { className: "size-2.5", weight: "fill" })
|
|
701
701
|
}
|
|
702
702
|
),
|
|
703
703
|
/* @__PURE__ */ s(
|
|
@@ -712,7 +712,7 @@ const se = ({
|
|
|
712
712
|
] }),
|
|
713
713
|
a && /* @__PURE__ */ m("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
714
714
|
/* @__PURE__ */ s(xe, { className: "size-3 shrink-0 text-black/55" }),
|
|
715
|
-
/* @__PURE__ */ s("span", { children:
|
|
715
|
+
/* @__PURE__ */ s("span", { children: ha })
|
|
716
716
|
] })
|
|
717
717
|
] })
|
|
718
718
|
]
|
|
@@ -723,12 +723,12 @@ const se = ({
|
|
|
723
723
|
"button",
|
|
724
724
|
{
|
|
725
725
|
className: We,
|
|
726
|
-
onClick:
|
|
726
|
+
onClick: L,
|
|
727
727
|
type: "button",
|
|
728
728
|
"aria-pressed": T,
|
|
729
729
|
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
730
730
|
children: /* @__PURE__ */ s(
|
|
731
|
-
|
|
731
|
+
Ee,
|
|
732
732
|
{
|
|
733
733
|
className: k("size-5", {
|
|
734
734
|
"text-[#FFD60A]": T,
|
|
@@ -740,7 +740,7 @@ const se = ({
|
|
|
740
740
|
}
|
|
741
741
|
),
|
|
742
742
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
743
|
-
|
|
743
|
+
st,
|
|
744
744
|
{
|
|
745
745
|
channel: b,
|
|
746
746
|
participant: x,
|
|
@@ -758,20 +758,20 @@ const se = ({
|
|
|
758
758
|
))
|
|
759
759
|
] })
|
|
760
760
|
] }) });
|
|
761
|
-
},
|
|
762
|
-
function ba(e) {
|
|
763
|
-
return e != null && e.length ? e.some((t) => t.type === nt) ? "down" : e.some((t) => t.type === st) ? "up" : null : null;
|
|
764
|
-
}
|
|
761
|
+
}, ba = (e) => /* @__PURE__ */ s(Ws, { ...e, position: "center" }), nt = "vote_up", at = "vote_down";
|
|
765
762
|
function va(e) {
|
|
766
|
-
|
|
767
|
-
|
|
763
|
+
return e != null && e.length ? e.some((t) => t.type === at) ? "down" : e.some((t) => t.type === nt) ? "up" : null : null;
|
|
764
|
+
}
|
|
765
|
+
function xa(e) {
|
|
766
|
+
const { channel: t } = le(), { client: n } = oe("useMessageVote"), a = se(
|
|
767
|
+
() => va(e.own_reactions),
|
|
768
768
|
[e.own_reactions]
|
|
769
769
|
), r = J(async () => {
|
|
770
770
|
if (n != null && n.userID)
|
|
771
771
|
try {
|
|
772
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
772
|
+
a === "up" ? await t.deleteReaction(e.id, nt) : await t.sendReaction(
|
|
773
773
|
e.id,
|
|
774
|
-
{ type:
|
|
774
|
+
{ type: nt },
|
|
775
775
|
{ enforce_unique: !0, skip_push: !0 }
|
|
776
776
|
);
|
|
777
777
|
} catch {
|
|
@@ -779,9 +779,9 @@ function va(e) {
|
|
|
779
779
|
}, [t, n == null ? void 0 : n.userID, e.id, a]), i = J(async () => {
|
|
780
780
|
if (n != null && n.userID)
|
|
781
781
|
try {
|
|
782
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
782
|
+
a === "down" ? await t.deleteReaction(e.id, at) : await t.sendReaction(
|
|
783
783
|
e.id,
|
|
784
|
-
{ type:
|
|
784
|
+
{ type: at },
|
|
785
785
|
{ enforce_unique: !0, skip_push: !0 }
|
|
786
786
|
);
|
|
787
787
|
} catch {
|
|
@@ -789,24 +789,24 @@ function va(e) {
|
|
|
789
789
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
790
790
|
return { selected: a, voteUp: r, voteDown: i };
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function wa(e) {
|
|
793
793
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function hs({
|
|
796
796
|
message: e,
|
|
797
797
|
viewerLanguage: t
|
|
798
798
|
}) {
|
|
799
799
|
var r;
|
|
800
|
-
const n = e == null ? void 0 : e.text, a =
|
|
800
|
+
const n = e == null ? void 0 : e.text, a = wa(t);
|
|
801
801
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
802
802
|
}
|
|
803
|
-
const
|
|
803
|
+
const _a = U.lazy(() => import("./Card-iGNcxybY.js")), Na = U.lazy(() => import("./Card-0wf8lj5n.js")), ya = U.lazy(() => import("./Card-RZ6C_IkE.js")), dt = () => /* @__PURE__ */ s(
|
|
804
804
|
"div",
|
|
805
805
|
{
|
|
806
806
|
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)]",
|
|
807
807
|
"aria-hidden": !0
|
|
808
808
|
}
|
|
809
|
-
),
|
|
809
|
+
), ka = (e) => /* @__PURE__ */ s(it, { fallback: /* @__PURE__ */ s(dt, {}), children: /* @__PURE__ */ s(_a, { ...e }) }), fs = (e) => /* @__PURE__ */ s(it, { fallback: /* @__PURE__ */ s(dt, {}), children: /* @__PURE__ */ s(Na, { ...e }) }), gs = (e) => /* @__PURE__ */ s(it, { fallback: /* @__PURE__ */ s(dt, {}), children: /* @__PURE__ */ s(ya, { ...e }) }), Ca = fs, Sa = gs, Zt = { Composer: ka, Sent: fs, Received: gs, Creator: Ca, Visitor: Sa }, Ea = [
|
|
810
810
|
[/pdf/, "pdf"],
|
|
811
811
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
812
812
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -816,42 +816,42 @@ const wa = U.lazy(() => import("./Card-BqePrWk0.js")), _a = U.lazy(() => import(
|
|
|
816
816
|
[/plain|rtf/, "text"],
|
|
817
817
|
[/markdown/, "markdown"]
|
|
818
818
|
];
|
|
819
|
-
function
|
|
819
|
+
function ce(e) {
|
|
820
820
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
const t =
|
|
822
|
+
function ps(e) {
|
|
823
|
+
const t = Ea.find(
|
|
824
824
|
([n]) => n.test(e)
|
|
825
825
|
);
|
|
826
826
|
return t ? t[1] : "generic";
|
|
827
827
|
}
|
|
828
|
-
const
|
|
829
|
-
video:
|
|
830
|
-
audio:
|
|
828
|
+
const Ia = {
|
|
829
|
+
video: cs,
|
|
830
|
+
audio: zn,
|
|
831
831
|
image: Ln,
|
|
832
|
-
document:
|
|
833
|
-
},
|
|
834
|
-
pdf:
|
|
835
|
-
doc:
|
|
836
|
-
xls:
|
|
837
|
-
csv:
|
|
838
|
-
ppt:
|
|
839
|
-
zip:
|
|
840
|
-
text:
|
|
841
|
-
markdown:
|
|
842
|
-
generic:
|
|
832
|
+
document: os
|
|
833
|
+
}, Ta = {
|
|
834
|
+
pdf: Vn,
|
|
835
|
+
doc: Un,
|
|
836
|
+
xls: Bn,
|
|
837
|
+
csv: jn,
|
|
838
|
+
ppt: $n,
|
|
839
|
+
zip: On,
|
|
840
|
+
text: Fn,
|
|
841
|
+
markdown: Pn,
|
|
842
|
+
generic: os
|
|
843
843
|
};
|
|
844
|
-
function
|
|
845
|
-
const t =
|
|
846
|
-
return t !== "document" ?
|
|
844
|
+
function Aa(e) {
|
|
845
|
+
const t = ce(e);
|
|
846
|
+
return t !== "document" ? Ia[t] : Ta[ps(e)];
|
|
847
847
|
}
|
|
848
848
|
function we(e, t) {
|
|
849
|
-
return U.createElement(
|
|
849
|
+
return U.createElement(Aa(e), t);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
851
|
+
const Ma = (e) => {
|
|
852
852
|
var t, n;
|
|
853
853
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
|
|
854
|
-
},
|
|
854
|
+
}, Ra = ({
|
|
855
855
|
source: e,
|
|
856
856
|
mimeType: t,
|
|
857
857
|
poster: n,
|
|
@@ -863,15 +863,15 @@ const Aa = (e) => {
|
|
|
863
863
|
muted: d = !1,
|
|
864
864
|
onContainerClick: u
|
|
865
865
|
}) => {
|
|
866
|
-
const p =
|
|
867
|
-
|
|
866
|
+
const p = ce(t), h = G(null), g = G(null), c = G(null), v = G(r), [w, b] = B(a), [f, x] = B(0), [N, S] = B(!1), [T, M] = B(!1), [L, D] = B(!1), [O, z] = B(!1), [y, A] = B(!0), [E, C] = B(null), I = J(() => {
|
|
867
|
+
D(!1), b(!0);
|
|
868
868
|
}, []), $ = J((_) => {
|
|
869
869
|
const R = g.current;
|
|
870
870
|
if (!R) return 0;
|
|
871
871
|
const H = R.getBoundingClientRect();
|
|
872
872
|
return Math.max(
|
|
873
873
|
0,
|
|
874
|
-
Math.min(1, (
|
|
874
|
+
Math.min(1, (Ma(_) - H.left) / H.width)
|
|
875
875
|
);
|
|
876
876
|
}, []), F = J((_) => {
|
|
877
877
|
const R = h.current;
|
|
@@ -898,7 +898,7 @@ const Aa = (e) => {
|
|
|
898
898
|
}, [w, N]), K(() => {
|
|
899
899
|
const _ = h.current;
|
|
900
900
|
_ && (w ? _.play().catch((R) => {
|
|
901
|
-
b(!1),
|
|
901
|
+
b(!1), D(!0);
|
|
902
902
|
}) : _.pause());
|
|
903
903
|
}, [w]), K(() => {
|
|
904
904
|
if (!N) return;
|
|
@@ -922,7 +922,7 @@ const Aa = (e) => {
|
|
|
922
922
|
u(_);
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
L || l && b((R) => !R);
|
|
926
926
|
},
|
|
927
927
|
onKeyDown: (_) => {
|
|
928
928
|
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
@@ -930,7 +930,7 @@ const Aa = (e) => {
|
|
|
930
930
|
u(_);
|
|
931
931
|
return;
|
|
932
932
|
}
|
|
933
|
-
|
|
933
|
+
L || l && b((R) => !R);
|
|
934
934
|
}
|
|
935
935
|
},
|
|
936
936
|
children: [
|
|
@@ -959,7 +959,7 @@ const Aa = (e) => {
|
|
|
959
959
|
z(!1), A(!1);
|
|
960
960
|
},
|
|
961
961
|
onWaiting: () => z(!0),
|
|
962
|
-
onPlay: () =>
|
|
962
|
+
onPlay: () => D(!1),
|
|
963
963
|
onEnded: () => {
|
|
964
964
|
i || (b(!1), x(0));
|
|
965
965
|
},
|
|
@@ -979,7 +979,7 @@ const Aa = (e) => {
|
|
|
979
979
|
z(!1), A(!1);
|
|
980
980
|
},
|
|
981
981
|
onWaiting: () => z(!0),
|
|
982
|
-
onPlay: () =>
|
|
982
|
+
onPlay: () => D(!1),
|
|
983
983
|
onLoadedMetadata: () => {
|
|
984
984
|
const _ = h.current;
|
|
985
985
|
_ instanceof HTMLVideoElement && _.videoWidth && _.videoHeight && C(_.videoWidth / _.videoHeight);
|
|
@@ -990,14 +990,14 @@ const Aa = (e) => {
|
|
|
990
990
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
991
991
|
}
|
|
992
992
|
) }),
|
|
993
|
-
O && !
|
|
994
|
-
|
|
993
|
+
O && !L && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
994
|
+
Ce,
|
|
995
995
|
{
|
|
996
996
|
className: "size-8 animate-spin text-white/80",
|
|
997
997
|
weight: "bold"
|
|
998
998
|
}
|
|
999
999
|
) }),
|
|
1000
|
-
|
|
1000
|
+
L && !l && /* @__PURE__ */ s(
|
|
1001
1001
|
"div",
|
|
1002
1002
|
{
|
|
1003
1003
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1010,7 +1010,7 @@ const Aa = (e) => {
|
|
|
1010
1010
|
onKeyDown: (_) => {
|
|
1011
1011
|
_.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), I());
|
|
1012
1012
|
},
|
|
1013
|
-
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(
|
|
1013
|
+
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(tt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1014
1014
|
}
|
|
1015
1015
|
),
|
|
1016
1016
|
o && !l && /* @__PURE__ */ s("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ s(
|
|
@@ -1049,7 +1049,7 @@ const Aa = (e) => {
|
|
|
1049
1049
|
},
|
|
1050
1050
|
className: "shrink-0 text-white",
|
|
1051
1051
|
"aria-label": w ? "Pause" : "Play",
|
|
1052
|
-
children: w ? /* @__PURE__ */ s(
|
|
1052
|
+
children: w ? /* @__PURE__ */ s(Gn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(tt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1053
1053
|
}
|
|
1054
1054
|
),
|
|
1055
1055
|
/* @__PURE__ */ m(
|
|
@@ -1099,7 +1099,7 @@ const Aa = (e) => {
|
|
|
1099
1099
|
]
|
|
1100
1100
|
}
|
|
1101
1101
|
);
|
|
1102
|
-
},
|
|
1102
|
+
}, Qt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Da = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", bs = ({
|
|
1103
1103
|
mimeType: e,
|
|
1104
1104
|
sourceUrl: t,
|
|
1105
1105
|
thumbnailUrl: n,
|
|
@@ -1108,9 +1108,9 @@ const Aa = (e) => {
|
|
|
1108
1108
|
mediaPlayerProps: i,
|
|
1109
1109
|
containedImage: l = !1
|
|
1110
1110
|
}) => {
|
|
1111
|
-
const o =
|
|
1111
|
+
const o = ce(e), [d, u] = B(!1);
|
|
1112
1112
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ s(
|
|
1113
|
-
|
|
1113
|
+
Ra,
|
|
1114
1114
|
{
|
|
1115
1115
|
source: t,
|
|
1116
1116
|
mimeType: e,
|
|
@@ -1157,11 +1157,11 @@ const Aa = (e) => {
|
|
|
1157
1157
|
{
|
|
1158
1158
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1159
1159
|
children: we(e, {
|
|
1160
|
-
className:
|
|
1160
|
+
className: Qt(r),
|
|
1161
1161
|
weight: "regular"
|
|
1162
1162
|
})
|
|
1163
1163
|
}
|
|
1164
|
-
) : n ? /* @__PURE__ */ s("div", { className: `relative ${
|
|
1164
|
+
) : n ? /* @__PURE__ */ s("div", { className: `relative ${Da(r)}`, children: /* @__PURE__ */ s(
|
|
1165
1165
|
"img",
|
|
1166
1166
|
{
|
|
1167
1167
|
src: n,
|
|
@@ -1174,12 +1174,12 @@ const Aa = (e) => {
|
|
|
1174
1174
|
{
|
|
1175
1175
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1176
1176
|
children: we(e, {
|
|
1177
|
-
className:
|
|
1177
|
+
className: Qt(r),
|
|
1178
1178
|
weight: "regular"
|
|
1179
1179
|
})
|
|
1180
1180
|
}
|
|
1181
1181
|
);
|
|
1182
|
-
},
|
|
1182
|
+
}, vs = ({
|
|
1183
1183
|
variant: e,
|
|
1184
1184
|
thumbnail: t,
|
|
1185
1185
|
title: n,
|
|
@@ -1245,28 +1245,28 @@ const Aa = (e) => {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
);
|
|
1247
1247
|
};
|
|
1248
|
-
function
|
|
1248
|
+
function xs(e) {
|
|
1249
1249
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1250
1250
|
}
|
|
1251
|
-
function
|
|
1251
|
+
function ut(e) {
|
|
1252
1252
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1253
1253
|
}
|
|
1254
1254
|
function La(e) {
|
|
1255
1255
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function za(e) {
|
|
1258
1258
|
return e ? "text-white" : "text-black";
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function Pa(e) {
|
|
1261
1261
|
return e ? "text-white/55" : "text-black/55";
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function Fa(e) {
|
|
1264
1264
|
return e ? "text-white/40" : "text-black/40";
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Oa(e) {
|
|
1267
1267
|
return e ? "text-white/20" : "text-black/20";
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const mt = ({ attachment: e, isMyMessage: t }) => {
|
|
1270
1270
|
const { title: n, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ m(U.Fragment, { children: [
|
|
1271
1271
|
/* @__PURE__ */ s("div", { className: "p-2", children: r ? /* @__PURE__ */ s(
|
|
1272
1272
|
"img",
|
|
@@ -1279,25 +1279,25 @@ const ut = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1279
1279
|
"div",
|
|
1280
1280
|
{
|
|
1281
1281
|
className: `aspect-video w-full rounded-[20px] ${La(t)} flex items-center justify-center`,
|
|
1282
|
-
children: /* @__PURE__ */ s(
|
|
1282
|
+
children: /* @__PURE__ */ s(Hn, { className: `size-12 ${Oa(t)}` })
|
|
1283
1283
|
}
|
|
1284
1284
|
) }),
|
|
1285
1285
|
/* @__PURE__ */ m("div", { className: "px-3 pb-3", children: [
|
|
1286
|
-
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1287
|
-
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${
|
|
1288
|
-
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1286
|
+
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${za(t)}`, children: n }),
|
|
1287
|
+
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Pa(t)}`, children: a }),
|
|
1288
|
+
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Fa(t)}`, children: d })
|
|
1289
1289
|
] })
|
|
1290
1290
|
] });
|
|
1291
1291
|
return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ s("div", { className: "block", children: u });
|
|
1292
1292
|
};
|
|
1293
|
-
function
|
|
1293
|
+
function ws(e) {
|
|
1294
1294
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function ht(e) {
|
|
1297
1297
|
var t;
|
|
1298
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1298
|
+
return (t = e.attachments) == null ? void 0 : t.find(ws);
|
|
1299
1299
|
}
|
|
1300
|
-
async function
|
|
1300
|
+
async function $a(e, t) {
|
|
1301
1301
|
let n;
|
|
1302
1302
|
try {
|
|
1303
1303
|
n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1309,7 +1309,7 @@ async function Oa(e, t) {
|
|
|
1309
1309
|
const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
1310
1310
|
l.href = i, l.download = n, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1312
|
+
const ja = ({
|
|
1313
1313
|
url: e,
|
|
1314
1314
|
filename: t
|
|
1315
1315
|
}) => {
|
|
@@ -1321,7 +1321,7 @@ const $a = ({
|
|
|
1321
1321
|
onClick: (i) => {
|
|
1322
1322
|
i.stopPropagation();
|
|
1323
1323
|
const l = window.open("", "_blank", "noopener,noreferrer");
|
|
1324
|
-
a(!0),
|
|
1324
|
+
a(!0), $a(e, t).then(() => {
|
|
1325
1325
|
l == null || l.close();
|
|
1326
1326
|
}).catch(() => {
|
|
1327
1327
|
l && (l.location.href = e);
|
|
@@ -1329,14 +1329,14 @@ const $a = ({
|
|
|
1329
1329
|
},
|
|
1330
1330
|
disabled: n,
|
|
1331
1331
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1332
|
-
children: n ? /* @__PURE__ */ s(
|
|
1333
|
-
/* @__PURE__ */ s(
|
|
1332
|
+
children: n ? /* @__PURE__ */ s(Ce, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(U.Fragment, { children: [
|
|
1333
|
+
/* @__PURE__ */ s(Se, { className: "size-4 text-white", weight: "bold" }),
|
|
1334
1334
|
"Download"
|
|
1335
1335
|
] })
|
|
1336
1336
|
}
|
|
1337
1337
|
);
|
|
1338
1338
|
};
|
|
1339
|
-
function
|
|
1339
|
+
function ft(e) {
|
|
1340
1340
|
var h, g, c, v;
|
|
1341
1341
|
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1342
1342
|
(w) => w.type === "video" && w.asset_url
|
|
@@ -1357,16 +1357,16 @@ function ht(e) {
|
|
|
1357
1357
|
thumbnailUrl: p
|
|
1358
1358
|
};
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1360
|
+
const _s = ({
|
|
1361
1361
|
resolvedUrl: e,
|
|
1362
1362
|
resolvedType: t,
|
|
1363
1363
|
title: n,
|
|
1364
1364
|
fileSize: a,
|
|
1365
1365
|
thumbnailUrl: r
|
|
1366
1366
|
}) => {
|
|
1367
|
-
const i = a !== void 0 ?
|
|
1367
|
+
const i = a !== void 0 ? xs(a) : void 0;
|
|
1368
1368
|
return /* @__PURE__ */ s(
|
|
1369
|
-
|
|
1369
|
+
vs,
|
|
1370
1370
|
{
|
|
1371
1371
|
variant: "dark",
|
|
1372
1372
|
title: n,
|
|
@@ -1374,7 +1374,7 @@ const ws = ({
|
|
|
1374
1374
|
mimeType: t,
|
|
1375
1375
|
detail: i,
|
|
1376
1376
|
thumbnail: /* @__PURE__ */ s(
|
|
1377
|
-
|
|
1377
|
+
bs,
|
|
1378
1378
|
{
|
|
1379
1379
|
mimeType: t,
|
|
1380
1380
|
sourceUrl: e,
|
|
@@ -1385,23 +1385,23 @@ const ws = ({
|
|
|
1385
1385
|
)
|
|
1386
1386
|
}
|
|
1387
1387
|
);
|
|
1388
|
-
},
|
|
1388
|
+
}, Ns = ({
|
|
1389
1389
|
resolvedUrl: e,
|
|
1390
1390
|
resolvedType: t,
|
|
1391
1391
|
title: n,
|
|
1392
1392
|
fileSize: a,
|
|
1393
1393
|
thumbnailUrl: r
|
|
1394
1394
|
}) => {
|
|
1395
|
-
const i =
|
|
1395
|
+
const i = ce(t), l = a !== void 0 ? xs(a) : void 0;
|
|
1396
1396
|
return /* @__PURE__ */ s(
|
|
1397
|
-
|
|
1397
|
+
vs,
|
|
1398
1398
|
{
|
|
1399
1399
|
variant: "light",
|
|
1400
1400
|
title: n,
|
|
1401
1401
|
mimeType: t,
|
|
1402
1402
|
detail: l,
|
|
1403
1403
|
thumbnail: /* @__PURE__ */ s(
|
|
1404
|
-
|
|
1404
|
+
bs,
|
|
1405
1405
|
{
|
|
1406
1406
|
mimeType: t,
|
|
1407
1407
|
sourceUrl: e,
|
|
@@ -1411,17 +1411,17 @@ const ws = ({
|
|
|
1411
1411
|
containedImage: i === "image" || i === "document"
|
|
1412
1412
|
}
|
|
1413
1413
|
),
|
|
1414
|
-
action: /* @__PURE__ */ s(
|
|
1414
|
+
action: /* @__PURE__ */ s(ja, { url: e, filename: n })
|
|
1415
1415
|
}
|
|
1416
1416
|
);
|
|
1417
|
-
},
|
|
1417
|
+
}, Ba = ({
|
|
1418
1418
|
message: e,
|
|
1419
1419
|
isMyMessage: t = !1
|
|
1420
1420
|
}) => {
|
|
1421
|
-
const n =
|
|
1421
|
+
const n = ht(e), a = ft(e);
|
|
1422
1422
|
return !n && !a ? null : /* @__PURE__ */ m("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1423
1423
|
!t && e.user && /* @__PURE__ */ s(
|
|
1424
|
-
|
|
1424
|
+
ne,
|
|
1425
1425
|
{
|
|
1426
1426
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1427
1427
|
id: e.user.id,
|
|
@@ -1439,41 +1439,41 @@ const ws = ({
|
|
|
1439
1439
|
{
|
|
1440
1440
|
className: "str-chat__message-bubble",
|
|
1441
1441
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1442
|
-
children: n ? /* @__PURE__ */ s("div", { className:
|
|
1442
|
+
children: n ? /* @__PURE__ */ s("div", { className: ut(t), children: /* @__PURE__ */ s(mt, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(_s, { ...a }) : /* @__PURE__ */ s(Ns, { ...a })
|
|
1443
1443
|
}
|
|
1444
1444
|
) })
|
|
1445
1445
|
}
|
|
1446
1446
|
)
|
|
1447
1447
|
] });
|
|
1448
|
-
},
|
|
1448
|
+
}, Ua = ({
|
|
1449
1449
|
message: e
|
|
1450
1450
|
}) => {
|
|
1451
|
-
const t =
|
|
1451
|
+
const t = ht(e);
|
|
1452
1452
|
if (t)
|
|
1453
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1454
|
-
const n =
|
|
1455
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1456
|
-
},
|
|
1453
|
+
return /* @__PURE__ */ s("div", { className: ut(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(mt, { attachment: t, isMyMessage: !0 }) });
|
|
1454
|
+
const n = ft(e);
|
|
1455
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(_s, { ...n }) }) : null;
|
|
1456
|
+
}, Va = ({
|
|
1457
1457
|
message: e
|
|
1458
1458
|
}) => {
|
|
1459
|
-
const t =
|
|
1459
|
+
const t = ht(e);
|
|
1460
1460
|
if (t)
|
|
1461
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1462
|
-
const n =
|
|
1463
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1464
|
-
}, ul = Object.assign(
|
|
1465
|
-
Creator:
|
|
1466
|
-
Visitor:
|
|
1467
|
-
}),
|
|
1461
|
+
return /* @__PURE__ */ s("div", { className: ut(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(mt, { attachment: t, isMyMessage: !1 }) });
|
|
1462
|
+
const n = ft(e);
|
|
1463
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(Ns, { ...n }) }) : null;
|
|
1464
|
+
}, ul = Object.assign(Ba, {
|
|
1465
|
+
Creator: Ua,
|
|
1466
|
+
Visitor: Va
|
|
1467
|
+
}), Ga = {
|
|
1468
1468
|
dark: "bg-[#121110]",
|
|
1469
1469
|
light: "bg-[#e9eaed]"
|
|
1470
|
-
},
|
|
1470
|
+
}, Ha = {
|
|
1471
1471
|
dark: "text-white",
|
|
1472
1472
|
light: "text-[#080707]"
|
|
1473
|
-
},
|
|
1473
|
+
}, Ya = {
|
|
1474
1474
|
dark: "border-white/[0.08]",
|
|
1475
1475
|
light: "border-black/[0.08]"
|
|
1476
|
-
},
|
|
1476
|
+
}, qa = (e) => e === "dark" ? "sender" : "receiver", Wa = {
|
|
1477
1477
|
sender: {
|
|
1478
1478
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1479
1479
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1495,7 +1495,7 @@ const ws = ({
|
|
|
1495
1495
|
children: i,
|
|
1496
1496
|
"data-testid": l
|
|
1497
1497
|
}) => {
|
|
1498
|
-
const o = t != null && t !== "", d = qa
|
|
1498
|
+
const o = t != null && t !== "", d = Wa[qa(e)][a];
|
|
1499
1499
|
return /* @__PURE__ */ m(
|
|
1500
1500
|
"div",
|
|
1501
1501
|
{
|
|
@@ -1510,10 +1510,10 @@ const ws = ({
|
|
|
1510
1510
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1511
1511
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1512
1512
|
d,
|
|
1513
|
-
Va[e],
|
|
1514
1513
|
Ga[e],
|
|
1514
|
+
Ha[e],
|
|
1515
1515
|
n && "border",
|
|
1516
|
-
n &&
|
|
1516
|
+
n && Ya[e],
|
|
1517
1517
|
r
|
|
1518
1518
|
),
|
|
1519
1519
|
children: [
|
|
@@ -1556,16 +1556,16 @@ const ws = ({
|
|
|
1556
1556
|
),
|
|
1557
1557
|
children: /* @__PURE__ */ s(Be, { className: "size-3", weight: "bold" })
|
|
1558
1558
|
}
|
|
1559
|
-
), Me = (e) => e === "received" ? "light" : "dark",
|
|
1559
|
+
), Me = (e) => e === "received" ? "light" : "dark", Xa = ({
|
|
1560
1560
|
firstOfGroup: e,
|
|
1561
1561
|
endOfGroup: t,
|
|
1562
1562
|
groupedByUser: n
|
|
1563
|
-
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1563
|
+
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ka = ({
|
|
1564
1564
|
src: e,
|
|
1565
1565
|
mimeType: t,
|
|
1566
1566
|
filename: n,
|
|
1567
1567
|
items: a
|
|
1568
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [],
|
|
1568
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Ja = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1569
1569
|
/* @__PURE__ */ s(
|
|
1570
1570
|
"audio",
|
|
1571
1571
|
{
|
|
@@ -1577,7 +1577,7 @@ const ws = ({
|
|
|
1577
1577
|
}
|
|
1578
1578
|
),
|
|
1579
1579
|
n ?? null
|
|
1580
|
-
] }),
|
|
1580
|
+
] }), gt = ({
|
|
1581
1581
|
state: e,
|
|
1582
1582
|
src: t,
|
|
1583
1583
|
mimeType: n,
|
|
@@ -1588,7 +1588,7 @@ const ws = ({
|
|
|
1588
1588
|
preload: o,
|
|
1589
1589
|
onDismiss: d
|
|
1590
1590
|
}) => {
|
|
1591
|
-
const u = Me(e), p = e === "composer" && !!d, h =
|
|
1591
|
+
const u = Me(e), p = e === "composer" && !!d, h = Ka({ src: t, mimeType: n, filename: a, items: r });
|
|
1592
1592
|
if (h.length === 0)
|
|
1593
1593
|
return null;
|
|
1594
1594
|
const g = o ?? (h.length > 1 ? "none" : "metadata");
|
|
@@ -1600,7 +1600,7 @@ const ws = ({
|
|
|
1600
1600
|
groupPosition: l,
|
|
1601
1601
|
"data-testid": "audio-attachment",
|
|
1602
1602
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, v) => /* @__PURE__ */ s(
|
|
1603
|
-
|
|
1603
|
+
Ja,
|
|
1604
1604
|
{
|
|
1605
1605
|
item: c,
|
|
1606
1606
|
preload: g,
|
|
@@ -1614,15 +1614,15 @@ const ws = ({
|
|
|
1614
1614
|
)) })
|
|
1615
1615
|
}
|
|
1616
1616
|
);
|
|
1617
|
-
},
|
|
1618
|
-
Composer:
|
|
1619
|
-
Sent:
|
|
1620
|
-
Received:
|
|
1617
|
+
}, Za = (e) => /* @__PURE__ */ s(gt, { ...e, state: "composer" }), Qa = (e) => /* @__PURE__ */ s(gt, { ...e, state: "sent" }), er = (e) => /* @__PURE__ */ s(gt, { ...e, state: "received" }), tr = {
|
|
1618
|
+
Composer: Za,
|
|
1619
|
+
Sent: Qa,
|
|
1620
|
+
Received: er
|
|
1621
1621
|
};
|
|
1622
|
-
function
|
|
1622
|
+
function sr(e) {
|
|
1623
1623
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1625
|
+
const nr = {
|
|
1626
1626
|
pdf: "PDF",
|
|
1627
1627
|
doc: "DOC",
|
|
1628
1628
|
xls: "XLS",
|
|
@@ -1632,7 +1632,7 @@ const sr = {
|
|
|
1632
1632
|
text: "TXT",
|
|
1633
1633
|
markdown: "MD"
|
|
1634
1634
|
};
|
|
1635
|
-
function
|
|
1635
|
+
function ar(e, t) {
|
|
1636
1636
|
if (t) {
|
|
1637
1637
|
const r = t.lastIndexOf(".");
|
|
1638
1638
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1641,8 +1641,8 @@ function nr(e, t) {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
if (!e) return;
|
|
1644
|
-
if (
|
|
1645
|
-
const r =
|
|
1644
|
+
if (ce(e) === "document") {
|
|
1645
|
+
const r = ps(e), i = nr[r];
|
|
1646
1646
|
if (i) return i;
|
|
1647
1647
|
if (e === "application/octet-stream") return;
|
|
1648
1648
|
}
|
|
@@ -1650,8 +1650,8 @@ function nr(e, t) {
|
|
|
1650
1650
|
if (!(!a || a === "*"))
|
|
1651
1651
|
return a.toUpperCase();
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1654
|
-
const a =
|
|
1653
|
+
function rr(e, t, n) {
|
|
1654
|
+
const a = ar(e, t), r = typeof n == "number" && n > 0 ? sr(n) : void 0;
|
|
1655
1655
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1656
1656
|
}
|
|
1657
1657
|
function re(e) {
|
|
@@ -1662,16 +1662,16 @@ function re(e) {
|
|
|
1662
1662
|
return "download";
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
|
-
const
|
|
1665
|
+
const ir = {
|
|
1666
1666
|
dark: "text-white/55",
|
|
1667
1667
|
light: "text-black/65"
|
|
1668
|
-
},
|
|
1668
|
+
}, lr = {
|
|
1669
1669
|
dark: "bg-white/10",
|
|
1670
1670
|
light: "bg-black/5"
|
|
1671
|
-
},
|
|
1671
|
+
}, or = {
|
|
1672
1672
|
dark: "text-white/85",
|
|
1673
1673
|
light: "text-black/85"
|
|
1674
|
-
},
|
|
1674
|
+
}, ys = ({
|
|
1675
1675
|
variant: e,
|
|
1676
1676
|
filename: t,
|
|
1677
1677
|
title: n,
|
|
@@ -1681,16 +1681,16 @@ const rr = {
|
|
|
1681
1681
|
activateLabel: l,
|
|
1682
1682
|
trailingAction: o
|
|
1683
1683
|
}) => {
|
|
1684
|
-
const d = n ?? t ?? "File", u =
|
|
1684
|
+
const d = n ?? t ?? "File", u = rr(a, t, r), p = /* @__PURE__ */ s(
|
|
1685
1685
|
"div",
|
|
1686
1686
|
{
|
|
1687
1687
|
className: k(
|
|
1688
1688
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1689
|
-
|
|
1689
|
+
lr[e]
|
|
1690
1690
|
),
|
|
1691
1691
|
"aria-hidden": !0,
|
|
1692
1692
|
children: we(a, {
|
|
1693
|
-
className: k("size-6",
|
|
1693
|
+
className: k("size-6", or[e]),
|
|
1694
1694
|
weight: "regular"
|
|
1695
1695
|
})
|
|
1696
1696
|
}
|
|
@@ -1701,7 +1701,7 @@ const rr = {
|
|
|
1701
1701
|
{
|
|
1702
1702
|
className: k(
|
|
1703
1703
|
"truncate text-xs leading-4",
|
|
1704
|
-
|
|
1704
|
+
ir[e]
|
|
1705
1705
|
),
|
|
1706
1706
|
children: u
|
|
1707
1707
|
}
|
|
@@ -1730,7 +1730,7 @@ const rr = {
|
|
|
1730
1730
|
o ? /* @__PURE__ */ s("div", { className: "shrink-0", children: o }) : null
|
|
1731
1731
|
] });
|
|
1732
1732
|
};
|
|
1733
|
-
async function
|
|
1733
|
+
async function ks(e, t) {
|
|
1734
1734
|
const n = t ?? re(e);
|
|
1735
1735
|
try {
|
|
1736
1736
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -1744,14 +1744,14 @@ async function ys(e, t) {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
|
-
const
|
|
1747
|
+
const cr = ({
|
|
1748
1748
|
src: e,
|
|
1749
1749
|
filename: t,
|
|
1750
1750
|
fileSize: n,
|
|
1751
1751
|
mimeType: a,
|
|
1752
1752
|
title: r,
|
|
1753
1753
|
items: i
|
|
1754
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [],
|
|
1754
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], dr = ({
|
|
1755
1755
|
variant: e,
|
|
1756
1756
|
item: t,
|
|
1757
1757
|
index: n,
|
|
@@ -1760,7 +1760,7 @@ const or = ({
|
|
|
1760
1760
|
}) => {
|
|
1761
1761
|
const i = t.filename ?? re(t.src);
|
|
1762
1762
|
return /* @__PURE__ */ s(
|
|
1763
|
-
|
|
1763
|
+
ys,
|
|
1764
1764
|
{
|
|
1765
1765
|
variant: e,
|
|
1766
1766
|
filename: i,
|
|
@@ -1772,7 +1772,7 @@ const or = ({
|
|
|
1772
1772
|
trailingAction: r
|
|
1773
1773
|
}
|
|
1774
1774
|
);
|
|
1775
|
-
},
|
|
1775
|
+
}, pt = ({
|
|
1776
1776
|
state: e,
|
|
1777
1777
|
src: t,
|
|
1778
1778
|
filename: n,
|
|
@@ -1785,7 +1785,7 @@ const or = ({
|
|
|
1785
1785
|
onClick: u,
|
|
1786
1786
|
onDismiss: p
|
|
1787
1787
|
}) => {
|
|
1788
|
-
const h = Me(e), g = e === "composer" && !!p, c =
|
|
1788
|
+
const h = Me(e), g = e === "composer" && !!p, c = cr({
|
|
1789
1789
|
src: t,
|
|
1790
1790
|
filename: n,
|
|
1791
1791
|
fileSize: a,
|
|
@@ -1797,7 +1797,7 @@ const or = ({
|
|
|
1797
1797
|
const f = c[b];
|
|
1798
1798
|
if (!f) return;
|
|
1799
1799
|
const x = f.filename ?? re(f.src);
|
|
1800
|
-
|
|
1800
|
+
ks(f.src, x);
|
|
1801
1801
|
};
|
|
1802
1802
|
if (c.length === 0)
|
|
1803
1803
|
return null;
|
|
@@ -1809,7 +1809,7 @@ const or = ({
|
|
|
1809
1809
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1810
1810
|
),
|
|
1811
1811
|
"aria-hidden": !0,
|
|
1812
|
-
children: /* @__PURE__ */ s(
|
|
1812
|
+
children: /* @__PURE__ */ s(Se, { className: "size-5", weight: "bold" })
|
|
1813
1813
|
}
|
|
1814
1814
|
);
|
|
1815
1815
|
return /* @__PURE__ */ s(
|
|
@@ -1820,7 +1820,7 @@ const or = ({
|
|
|
1820
1820
|
groupPosition: d,
|
|
1821
1821
|
"data-testid": "file-attachment",
|
|
1822
1822
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((b, f) => /* @__PURE__ */ s(
|
|
1823
|
-
|
|
1823
|
+
dr,
|
|
1824
1824
|
{
|
|
1825
1825
|
variant: h,
|
|
1826
1826
|
item: b,
|
|
@@ -1832,11 +1832,11 @@ const or = ({
|
|
|
1832
1832
|
)) })
|
|
1833
1833
|
}
|
|
1834
1834
|
);
|
|
1835
|
-
},
|
|
1836
|
-
Composer:
|
|
1837
|
-
Sent:
|
|
1838
|
-
Received:
|
|
1839
|
-
},
|
|
1835
|
+
}, ur = (e) => /* @__PURE__ */ s(pt, { ...e, state: "composer" }), mr = (e) => /* @__PURE__ */ s(pt, { ...e, state: "sent" }), hr = (e) => /* @__PURE__ */ s(pt, { ...e, state: "received" }), fr = {
|
|
1836
|
+
Composer: ur,
|
|
1837
|
+
Sent: mr,
|
|
1838
|
+
Received: hr
|
|
1839
|
+
}, bt = ({
|
|
1840
1840
|
onPrev: e,
|
|
1841
1841
|
onNext: t,
|
|
1842
1842
|
prevLabel: n = "Previous",
|
|
@@ -1849,7 +1849,7 @@ const or = ({
|
|
|
1849
1849
|
onClick: e,
|
|
1850
1850
|
"aria-label": n,
|
|
1851
1851
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1852
|
-
children: /* @__PURE__ */ s(
|
|
1852
|
+
children: /* @__PURE__ */ s(Yn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1853
1853
|
}
|
|
1854
1854
|
),
|
|
1855
1855
|
/* @__PURE__ */ s(
|
|
@@ -1862,7 +1862,7 @@ const or = ({
|
|
|
1862
1862
|
children: /* @__PURE__ */ s(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1863
1863
|
}
|
|
1864
1864
|
)
|
|
1865
|
-
] }),
|
|
1865
|
+
] }), Cs = ({
|
|
1866
1866
|
url: e,
|
|
1867
1867
|
filename: t,
|
|
1868
1868
|
variant: n = "pill",
|
|
@@ -1873,7 +1873,7 @@ const or = ({
|
|
|
1873
1873
|
}) => {
|
|
1874
1874
|
const [o, d] = B(!1), u = J(
|
|
1875
1875
|
(c) => {
|
|
1876
|
-
c.stopPropagation(), !o && (d(!0),
|
|
1876
|
+
c.stopPropagation(), !o && (d(!0), ks(e, t).catch(() => {
|
|
1877
1877
|
}).finally(() => {
|
|
1878
1878
|
d(!1), l == null || l();
|
|
1879
1879
|
}));
|
|
@@ -1898,14 +1898,14 @@ const or = ({
|
|
|
1898
1898
|
}[i]
|
|
1899
1899
|
),
|
|
1900
1900
|
children: o ? /* @__PURE__ */ s(
|
|
1901
|
-
|
|
1901
|
+
Ce,
|
|
1902
1902
|
{
|
|
1903
1903
|
className: "size-4 animate-spin",
|
|
1904
1904
|
weight: "bold",
|
|
1905
1905
|
"aria-hidden": !0
|
|
1906
1906
|
}
|
|
1907
1907
|
) : /* @__PURE__ */ s(
|
|
1908
|
-
|
|
1908
|
+
Se,
|
|
1909
1909
|
{
|
|
1910
1910
|
className: "size-5 shrink-0",
|
|
1911
1911
|
weight: "bold",
|
|
@@ -1921,7 +1921,7 @@ const or = ({
|
|
|
1921
1921
|
disabled: o,
|
|
1922
1922
|
"aria-label": a,
|
|
1923
1923
|
className: "mes-media-viewer__action",
|
|
1924
|
-
children: o ? /* @__PURE__ */ s(
|
|
1924
|
+
children: o ? /* @__PURE__ */ s(Ce, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Se, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1925
1925
|
}
|
|
1926
1926
|
) : /* @__PURE__ */ m(
|
|
1927
1927
|
"button",
|
|
@@ -1936,18 +1936,18 @@ const or = ({
|
|
|
1936
1936
|
),
|
|
1937
1937
|
children: [
|
|
1938
1938
|
o ? /* @__PURE__ */ s(
|
|
1939
|
-
|
|
1939
|
+
Ce,
|
|
1940
1940
|
{
|
|
1941
1941
|
className: "size-4 animate-spin",
|
|
1942
1942
|
weight: "bold",
|
|
1943
1943
|
"aria-hidden": !0
|
|
1944
1944
|
}
|
|
1945
|
-
) : /* @__PURE__ */ s(
|
|
1945
|
+
) : /* @__PURE__ */ s(Se, { ...g, "aria-hidden": !0 }),
|
|
1946
1946
|
p ? null : a
|
|
1947
1947
|
]
|
|
1948
1948
|
}
|
|
1949
1949
|
);
|
|
1950
|
-
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n),
|
|
1950
|
+
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n), vt = ({
|
|
1951
1951
|
length: e,
|
|
1952
1952
|
initialIndex: t,
|
|
1953
1953
|
open: n
|
|
@@ -1972,7 +1972,7 @@ const or = ({
|
|
|
1972
1972
|
};
|
|
1973
1973
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
1974
1974
|
}, [n, e, l, o]), { index: r, prev: l, next: o };
|
|
1975
|
-
},
|
|
1975
|
+
}, xt = ({
|
|
1976
1976
|
open: e,
|
|
1977
1977
|
onClose: t,
|
|
1978
1978
|
ariaLabel: n,
|
|
@@ -2062,29 +2062,29 @@ const or = ({
|
|
|
2062
2062
|
]
|
|
2063
2063
|
}
|
|
2064
2064
|
);
|
|
2065
|
-
},
|
|
2065
|
+
}, Ss = ({
|
|
2066
2066
|
open: e,
|
|
2067
2067
|
items: t,
|
|
2068
2068
|
initialIndex: n = 0,
|
|
2069
2069
|
onClose: a
|
|
2070
2070
|
}) => {
|
|
2071
|
-
const { index: r, prev: i, next: l } =
|
|
2071
|
+
const { index: r, prev: i, next: l } = vt({
|
|
2072
2072
|
length: t.length,
|
|
2073
2073
|
initialIndex: n,
|
|
2074
2074
|
open: e
|
|
2075
|
-
}), o = t[r], d =
|
|
2075
|
+
}), o = t[r], d = se(
|
|
2076
2076
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "image"),
|
|
2077
2077
|
[o]
|
|
2078
2078
|
);
|
|
2079
2079
|
return o ? /* @__PURE__ */ m(
|
|
2080
|
-
|
|
2080
|
+
xt,
|
|
2081
2081
|
{
|
|
2082
2082
|
open: e,
|
|
2083
2083
|
onClose: a,
|
|
2084
2084
|
ariaLabel: d,
|
|
2085
2085
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
2086
2086
|
actions: /* @__PURE__ */ s(
|
|
2087
|
-
|
|
2087
|
+
Cs,
|
|
2088
2088
|
{
|
|
2089
2089
|
url: o.src,
|
|
2090
2090
|
filename: d,
|
|
@@ -2107,7 +2107,7 @@ const or = ({
|
|
|
2107
2107
|
`${r}:${o.src}`
|
|
2108
2108
|
),
|
|
2109
2109
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2110
|
-
|
|
2110
|
+
bt,
|
|
2111
2111
|
{
|
|
2112
2112
|
onPrev: i,
|
|
2113
2113
|
onNext: l,
|
|
@@ -2118,7 +2118,7 @@ const or = ({
|
|
|
2118
2118
|
]
|
|
2119
2119
|
}
|
|
2120
2120
|
) : null;
|
|
2121
|
-
},
|
|
2121
|
+
}, gr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", Es = ({
|
|
2122
2122
|
tiles: e,
|
|
2123
2123
|
onTileActivate: t,
|
|
2124
2124
|
maxVisible: n = 4,
|
|
@@ -2127,7 +2127,7 @@ const or = ({
|
|
|
2127
2127
|
const r = e.length;
|
|
2128
2128
|
if (r === 0) return null;
|
|
2129
2129
|
const i = e.slice(0, Math.min(r, n)), l = r - i.length, o = (d, u, p) => {
|
|
2130
|
-
const h = k(
|
|
2130
|
+
const h = k(gr, "h-full w-full");
|
|
2131
2131
|
return t ? /* @__PURE__ */ m(
|
|
2132
2132
|
"button",
|
|
2133
2133
|
{
|
|
@@ -2196,7 +2196,7 @@ const or = ({
|
|
|
2196
2196
|
[e]
|
|
2197
2197
|
), l = J(() => n(!1), []);
|
|
2198
2198
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
2199
|
-
},
|
|
2199
|
+
}, pr = (e, t, n, a) => ({
|
|
2200
2200
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
2201
2201
|
content: /* @__PURE__ */ s(
|
|
2202
2202
|
"img",
|
|
@@ -2211,15 +2211,15 @@ const or = ({
|
|
|
2211
2211
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2212
2212
|
}
|
|
2213
2213
|
)
|
|
2214
|
-
}),
|
|
2214
|
+
}), br = ({
|
|
2215
2215
|
src: e,
|
|
2216
2216
|
alt: t,
|
|
2217
2217
|
items: n
|
|
2218
|
-
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [],
|
|
2218
|
+
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Is = (e, t) => e.map((n, a) => ({
|
|
2219
2219
|
src: n.src,
|
|
2220
2220
|
alt: n.alt,
|
|
2221
2221
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2222
|
-
})),
|
|
2222
|
+
})), vr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2223
2223
|
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: u } = Re(
|
|
2224
2224
|
r
|
|
2225
2225
|
);
|
|
@@ -2246,16 +2246,16 @@ const or = ({
|
|
|
2246
2246
|
),
|
|
2247
2247
|
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
|
|
2248
2248
|
/* @__PURE__ */ s(
|
|
2249
|
-
|
|
2249
|
+
Ss,
|
|
2250
2250
|
{
|
|
2251
2251
|
open: l,
|
|
2252
|
-
items:
|
|
2252
|
+
items: Is([{ src: e, alt: t }], n),
|
|
2253
2253
|
initialIndex: o,
|
|
2254
2254
|
onClose: u
|
|
2255
2255
|
}
|
|
2256
2256
|
)
|
|
2257
2257
|
] });
|
|
2258
|
-
},
|
|
2258
|
+
}, Ts = ({
|
|
2259
2259
|
state: e,
|
|
2260
2260
|
src: t,
|
|
2261
2261
|
alt: n,
|
|
@@ -2266,13 +2266,13 @@ const or = ({
|
|
|
2266
2266
|
loading: o = "lazy",
|
|
2267
2267
|
onClick: d
|
|
2268
2268
|
}) => {
|
|
2269
|
-
const u =
|
|
2269
|
+
const u = br({ src: t, alt: n, items: r }), p = Me(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: v } = Re(
|
|
2270
2270
|
d
|
|
2271
2271
|
);
|
|
2272
2272
|
if (u.length === 0)
|
|
2273
2273
|
return null;
|
|
2274
2274
|
const w = u.map(
|
|
2275
|
-
(b, f) =>
|
|
2275
|
+
(b, f) => pr(b, f, u.length, o)
|
|
2276
2276
|
);
|
|
2277
2277
|
return /* @__PURE__ */ m(
|
|
2278
2278
|
Te,
|
|
@@ -2282,12 +2282,12 @@ const or = ({
|
|
|
2282
2282
|
groupPosition: l,
|
|
2283
2283
|
"data-testid": "image-attachment",
|
|
2284
2284
|
children: [
|
|
2285
|
-
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
|
|
2285
|
+
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Es, { tiles: w, onTileActivate: c }) }),
|
|
2286
2286
|
/* @__PURE__ */ s(
|
|
2287
|
-
|
|
2287
|
+
Ss,
|
|
2288
2288
|
{
|
|
2289
2289
|
open: h,
|
|
2290
|
-
items:
|
|
2290
|
+
items: Is(u, a),
|
|
2291
2291
|
initialIndex: g,
|
|
2292
2292
|
onClose: v
|
|
2293
2293
|
}
|
|
@@ -2295,29 +2295,29 @@ const or = ({
|
|
|
2295
2295
|
]
|
|
2296
2296
|
}
|
|
2297
2297
|
);
|
|
2298
|
-
},
|
|
2299
|
-
Composer:
|
|
2300
|
-
Sent:
|
|
2301
|
-
Received:
|
|
2302
|
-
},
|
|
2298
|
+
}, xr = (e) => /* @__PURE__ */ s(vr, { ...e }), wr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "sent" }), _r = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "received" }), Nr = {
|
|
2299
|
+
Composer: xr,
|
|
2300
|
+
Sent: wr,
|
|
2301
|
+
Received: _r
|
|
2302
|
+
}, yr = ({
|
|
2303
2303
|
open: e,
|
|
2304
2304
|
items: t,
|
|
2305
2305
|
initialIndex: n = 0,
|
|
2306
2306
|
onClose: a
|
|
2307
2307
|
}) => {
|
|
2308
|
-
const { index: r, prev: i, next: l } =
|
|
2308
|
+
const { index: r, prev: i, next: l } = vt({
|
|
2309
2309
|
length: t.length,
|
|
2310
2310
|
initialIndex: n,
|
|
2311
2311
|
open: e
|
|
2312
|
-
}), o = t[r], d =
|
|
2312
|
+
}), o = t[r], d = se(
|
|
2313
2313
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "document"),
|
|
2314
2314
|
[o]
|
|
2315
|
-
), u =
|
|
2316
|
-
() => o ?
|
|
2315
|
+
), u = se(
|
|
2316
|
+
() => o ? kr(o.src) : void 0,
|
|
2317
2317
|
[o]
|
|
2318
2318
|
);
|
|
2319
2319
|
return !o || !u ? null : /* @__PURE__ */ m(
|
|
2320
|
-
|
|
2320
|
+
xt,
|
|
2321
2321
|
{
|
|
2322
2322
|
open: e,
|
|
2323
2323
|
onClose: a,
|
|
@@ -2336,7 +2336,7 @@ const or = ({
|
|
|
2336
2336
|
`${r}:${o.src}`
|
|
2337
2337
|
),
|
|
2338
2338
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2339
|
-
|
|
2339
|
+
bt,
|
|
2340
2340
|
{
|
|
2341
2341
|
onPrev: i,
|
|
2342
2342
|
onNext: l,
|
|
@@ -2347,16 +2347,16 @@ const or = ({
|
|
|
2347
2347
|
]
|
|
2348
2348
|
}
|
|
2349
2349
|
);
|
|
2350
|
-
},
|
|
2350
|
+
}, kr = (e) => {
|
|
2351
2351
|
const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2352
2352
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
|
|
2353
|
-
},
|
|
2353
|
+
}, Cr = ({
|
|
2354
2354
|
src: e,
|
|
2355
2355
|
filename: t,
|
|
2356
2356
|
fileSize: n,
|
|
2357
2357
|
title: a,
|
|
2358
2358
|
items: r
|
|
2359
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [],
|
|
2359
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], Sr = ({
|
|
2360
2360
|
variant: e,
|
|
2361
2361
|
item: t,
|
|
2362
2362
|
index: n,
|
|
@@ -2365,7 +2365,7 @@ const or = ({
|
|
|
2365
2365
|
}) => {
|
|
2366
2366
|
const i = t.filename ?? re(t.src);
|
|
2367
2367
|
return /* @__PURE__ */ s(
|
|
2368
|
-
|
|
2368
|
+
ys,
|
|
2369
2369
|
{
|
|
2370
2370
|
variant: e,
|
|
2371
2371
|
filename: i,
|
|
@@ -2377,7 +2377,7 @@ const or = ({
|
|
|
2377
2377
|
trailingAction: r
|
|
2378
2378
|
}
|
|
2379
2379
|
);
|
|
2380
|
-
},
|
|
2380
|
+
}, wt = ({
|
|
2381
2381
|
state: e,
|
|
2382
2382
|
src: t,
|
|
2383
2383
|
filename: n,
|
|
@@ -2389,7 +2389,7 @@ const or = ({
|
|
|
2389
2389
|
onClick: d,
|
|
2390
2390
|
onDismiss: u
|
|
2391
2391
|
}) => {
|
|
2392
|
-
const p = Me(e), h =
|
|
2392
|
+
const p = Me(e), h = Cr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2393
2393
|
d
|
|
2394
2394
|
), b = e === "composer" && !!u;
|
|
2395
2395
|
if (h.length === 0)
|
|
@@ -2408,7 +2408,7 @@ const or = ({
|
|
|
2408
2408
|
children: [
|
|
2409
2409
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((x, N) => {
|
|
2410
2410
|
const S = x.filename ?? re(x.src), T = b && N === 0 ? /* @__PURE__ */ s(Ae, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2411
|
-
|
|
2411
|
+
Cs,
|
|
2412
2412
|
{
|
|
2413
2413
|
url: x.src,
|
|
2414
2414
|
filename: S,
|
|
@@ -2418,7 +2418,7 @@ const or = ({
|
|
|
2418
2418
|
}
|
|
2419
2419
|
);
|
|
2420
2420
|
return /* @__PURE__ */ s(
|
|
2421
|
-
|
|
2421
|
+
Sr,
|
|
2422
2422
|
{
|
|
2423
2423
|
variant: p,
|
|
2424
2424
|
item: x,
|
|
@@ -2430,7 +2430,7 @@ const or = ({
|
|
|
2430
2430
|
);
|
|
2431
2431
|
}) }),
|
|
2432
2432
|
/* @__PURE__ */ s(
|
|
2433
|
-
|
|
2433
|
+
yr,
|
|
2434
2434
|
{
|
|
2435
2435
|
open: g,
|
|
2436
2436
|
items: f,
|
|
@@ -2441,26 +2441,26 @@ const or = ({
|
|
|
2441
2441
|
]
|
|
2442
2442
|
}
|
|
2443
2443
|
);
|
|
2444
|
-
},
|
|
2445
|
-
Composer:
|
|
2446
|
-
Sent:
|
|
2447
|
-
Received:
|
|
2448
|
-
},
|
|
2444
|
+
}, Er = (e) => /* @__PURE__ */ s(wt, { ...e, state: "composer" }), Ir = (e) => /* @__PURE__ */ s(wt, { ...e, state: "sent" }), Tr = (e) => /* @__PURE__ */ s(wt, { ...e, state: "received" }), Ar = {
|
|
2445
|
+
Composer: Er,
|
|
2446
|
+
Sent: Ir,
|
|
2447
|
+
Received: Tr
|
|
2448
|
+
}, As = ({
|
|
2449
2449
|
open: e,
|
|
2450
2450
|
items: t,
|
|
2451
2451
|
initialIndex: n = 0,
|
|
2452
2452
|
onClose: a
|
|
2453
2453
|
}) => {
|
|
2454
|
-
const { index: r, prev: i, next: l } =
|
|
2454
|
+
const { index: r, prev: i, next: l } = vt({
|
|
2455
2455
|
length: t.length,
|
|
2456
2456
|
initialIndex: n,
|
|
2457
2457
|
open: e
|
|
2458
|
-
}), o = t[r], d =
|
|
2458
|
+
}), o = t[r], d = se(
|
|
2459
2459
|
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "video"),
|
|
2460
2460
|
[o]
|
|
2461
2461
|
);
|
|
2462
2462
|
return o ? /* @__PURE__ */ m(
|
|
2463
|
-
|
|
2463
|
+
xt,
|
|
2464
2464
|
{
|
|
2465
2465
|
open: e,
|
|
2466
2466
|
onClose: a,
|
|
@@ -2484,7 +2484,7 @@ const or = ({
|
|
|
2484
2484
|
`${r}:${o.src}`
|
|
2485
2485
|
),
|
|
2486
2486
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2487
|
-
|
|
2487
|
+
bt,
|
|
2488
2488
|
{
|
|
2489
2489
|
onPrev: i,
|
|
2490
2490
|
onNext: l,
|
|
@@ -2495,7 +2495,7 @@ const or = ({
|
|
|
2495
2495
|
]
|
|
2496
2496
|
}
|
|
2497
2497
|
) : null;
|
|
2498
|
-
},
|
|
2498
|
+
}, Mr = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(tt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Ms = ({
|
|
2499
2499
|
item: e,
|
|
2500
2500
|
index: t
|
|
2501
2501
|
}) => /* @__PURE__ */ m("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2510,24 +2510,24 @@ const or = ({
|
|
|
2510
2510
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2511
2511
|
}
|
|
2512
2512
|
) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
2513
|
-
|
|
2513
|
+
cs,
|
|
2514
2514
|
{
|
|
2515
2515
|
className: "size-16 rounded-md text-white/30",
|
|
2516
2516
|
weight: "regular",
|
|
2517
2517
|
"aria-hidden": !0
|
|
2518
2518
|
}
|
|
2519
2519
|
) }),
|
|
2520
|
-
/* @__PURE__ */ s(
|
|
2521
|
-
] }),
|
|
2520
|
+
/* @__PURE__ */ s(Mr, {})
|
|
2521
|
+
] }), Rr = (e, t, n) => ({
|
|
2522
2522
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2523
|
-
content: /* @__PURE__ */ s(
|
|
2524
|
-
}),
|
|
2523
|
+
content: /* @__PURE__ */ s(Ms, { item: e, index: t })
|
|
2524
|
+
}), Dr = ({
|
|
2525
2525
|
src: e,
|
|
2526
2526
|
poster: t,
|
|
2527
2527
|
mimeType: n,
|
|
2528
2528
|
preload: a,
|
|
2529
2529
|
items: r
|
|
2530
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [],
|
|
2530
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Rs = (e, t) => e.map((n, a) => ({
|
|
2531
2531
|
src: n.src,
|
|
2532
2532
|
poster: n.poster,
|
|
2533
2533
|
mimeType: n.mimeType,
|
|
@@ -2545,15 +2545,15 @@ const or = ({
|
|
|
2545
2545
|
onClick: () => u(0),
|
|
2546
2546
|
"aria-label": "Play video",
|
|
2547
2547
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2548
|
-
children: /* @__PURE__ */ s(
|
|
2548
|
+
children: /* @__PURE__ */ s(Ms, { item: { src: e, poster: t, mimeType: n }, index: 0 })
|
|
2549
2549
|
}
|
|
2550
2550
|
),
|
|
2551
2551
|
l ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: l }) }) : null,
|
|
2552
2552
|
/* @__PURE__ */ s(
|
|
2553
|
-
|
|
2553
|
+
As,
|
|
2554
2554
|
{
|
|
2555
2555
|
open: o,
|
|
2556
|
-
items:
|
|
2556
|
+
items: Rs(
|
|
2557
2557
|
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2558
2558
|
a
|
|
2559
2559
|
),
|
|
@@ -2562,7 +2562,7 @@ const or = ({
|
|
|
2562
2562
|
}
|
|
2563
2563
|
)
|
|
2564
2564
|
] });
|
|
2565
|
-
},
|
|
2565
|
+
}, Ds = ({
|
|
2566
2566
|
state: e,
|
|
2567
2567
|
src: t,
|
|
2568
2568
|
poster: n,
|
|
@@ -2574,13 +2574,13 @@ const or = ({
|
|
|
2574
2574
|
preload: d,
|
|
2575
2575
|
onClick: u
|
|
2576
2576
|
}) => {
|
|
2577
|
-
const p =
|
|
2577
|
+
const p = Dr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Me(e), { viewerOpen: g, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2578
2578
|
u
|
|
2579
2579
|
);
|
|
2580
2580
|
if (p.length === 0)
|
|
2581
2581
|
return null;
|
|
2582
2582
|
const b = p.map(
|
|
2583
|
-
(f, x) =>
|
|
2583
|
+
(f, x) => Rr(f, x, p.length)
|
|
2584
2584
|
);
|
|
2585
2585
|
return /* @__PURE__ */ m(
|
|
2586
2586
|
Te,
|
|
@@ -2591,7 +2591,7 @@ const or = ({
|
|
|
2591
2591
|
"data-testid": "video-attachment",
|
|
2592
2592
|
children: [
|
|
2593
2593
|
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
|
|
2594
|
-
|
|
2594
|
+
Es,
|
|
2595
2595
|
{
|
|
2596
2596
|
tiles: b,
|
|
2597
2597
|
onTileActivate: v,
|
|
@@ -2599,10 +2599,10 @@ const or = ({
|
|
|
2599
2599
|
}
|
|
2600
2600
|
) }),
|
|
2601
2601
|
/* @__PURE__ */ s(
|
|
2602
|
-
|
|
2602
|
+
As,
|
|
2603
2603
|
{
|
|
2604
2604
|
open: g,
|
|
2605
|
-
items:
|
|
2605
|
+
items: Rs(p, r),
|
|
2606
2606
|
initialIndex: c,
|
|
2607
2607
|
onClose: w
|
|
2608
2608
|
}
|
|
@@ -2610,25 +2610,25 @@ const or = ({
|
|
|
2610
2610
|
]
|
|
2611
2611
|
}
|
|
2612
2612
|
);
|
|
2613
|
-
},
|
|
2614
|
-
Composer:
|
|
2615
|
-
Sent:
|
|
2616
|
-
Received:
|
|
2617
|
-
},
|
|
2618
|
-
Image:
|
|
2619
|
-
Video:
|
|
2620
|
-
Audio:
|
|
2621
|
-
Pdf:
|
|
2622
|
-
File:
|
|
2623
|
-
}, Or = {
|
|
2624
|
-
isUnlocking: () => !1
|
|
2613
|
+
}, zr = (e) => /* @__PURE__ */ s(Lr, { ...e }), Pr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "received" }), Or = {
|
|
2614
|
+
Composer: zr,
|
|
2615
|
+
Sent: Pr,
|
|
2616
|
+
Received: Fr
|
|
2617
|
+
}, ye = {
|
|
2618
|
+
Image: Nr,
|
|
2619
|
+
Video: Or,
|
|
2620
|
+
Audio: tr,
|
|
2621
|
+
Pdf: Ar,
|
|
2622
|
+
File: fr
|
|
2625
2623
|
}, $r = {
|
|
2626
|
-
|
|
2627
|
-
},
|
|
2628
|
-
|
|
2629
|
-
|
|
2624
|
+
isUnlocking: () => !1
|
|
2625
|
+
}, jr = {
|
|
2626
|
+
LockedAttachment: $r
|
|
2627
|
+
}, Ls = rt({}), ml = Ls.Provider;
|
|
2628
|
+
function Br(e) {
|
|
2629
|
+
return Ie(Ls)[e] ?? jr[e];
|
|
2630
2630
|
}
|
|
2631
|
-
const
|
|
2631
|
+
const Ur = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2632
2632
|
"svg",
|
|
2633
2633
|
{
|
|
2634
2634
|
width: e,
|
|
@@ -2645,21 +2645,21 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2645
2645
|
}
|
|
2646
2646
|
)
|
|
2647
2647
|
}
|
|
2648
|
-
),
|
|
2648
|
+
), Vr = (e) => {
|
|
2649
2649
|
var t;
|
|
2650
2650
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2651
|
-
},
|
|
2651
|
+
}, Gr = (e) => {
|
|
2652
2652
|
var t;
|
|
2653
2653
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2654
2654
|
}, Fe = (e) => {
|
|
2655
2655
|
var t;
|
|
2656
2656
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2657
|
-
},
|
|
2657
|
+
}, Hr = (e) => {
|
|
2658
2658
|
var t;
|
|
2659
2659
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2660
|
-
},
|
|
2660
|
+
}, zs = (e) => Vr(e) || Gr(e), Yr = (e) => {
|
|
2661
2661
|
var t;
|
|
2662
|
-
return
|
|
2662
|
+
return zs(e) && !((t = e.text) != null && t.trim());
|
|
2663
2663
|
}, Ke = ({
|
|
2664
2664
|
message: e,
|
|
2665
2665
|
standalone: t = !1,
|
|
@@ -2667,7 +2667,7 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2667
2667
|
hasAttachment: a = !1
|
|
2668
2668
|
}) => {
|
|
2669
2669
|
var h;
|
|
2670
|
-
const r =
|
|
2670
|
+
const r = zs(e), i = Fe(e);
|
|
2671
2671
|
if (!r && !i)
|
|
2672
2672
|
return null;
|
|
2673
2673
|
if (r) {
|
|
@@ -2675,7 +2675,7 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2675
2675
|
if (!g) return null;
|
|
2676
2676
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${g} tip` : `Delivered with ${g} tip`;
|
|
2677
2677
|
return /* @__PURE__ */ m("div", { className: c, children: [
|
|
2678
|
-
/* @__PURE__ */ s(
|
|
2678
|
+
/* @__PURE__ */ s(qn, { size: t ? 14 : 12 }),
|
|
2679
2679
|
/* @__PURE__ */ s("span", { children: v })
|
|
2680
2680
|
] });
|
|
2681
2681
|
}
|
|
@@ -2683,7 +2683,7 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2683
2683
|
"message-chatbot-indicator",
|
|
2684
2684
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2685
2685
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2686
|
-
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(
|
|
2686
|
+
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(Ur, { size: l ? 12 : 15 }) });
|
|
2687
2687
|
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ m(ee, { children: [
|
|
2688
2688
|
u,
|
|
2689
2689
|
p
|
|
@@ -2691,7 +2691,7 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2691
2691
|
p,
|
|
2692
2692
|
u
|
|
2693
2693
|
] }) });
|
|
2694
|
-
},
|
|
2694
|
+
}, qr = ({
|
|
2695
2695
|
selected: e,
|
|
2696
2696
|
onVoteUp: t,
|
|
2697
2697
|
onVoteDown: n
|
|
@@ -2707,7 +2707,7 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2707
2707
|
"aria-label": "Good response",
|
|
2708
2708
|
"aria-pressed": e === "up",
|
|
2709
2709
|
"data-tooltip": "Good response",
|
|
2710
|
-
children: /* @__PURE__ */ s(
|
|
2710
|
+
children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2711
2711
|
}
|
|
2712
2712
|
),
|
|
2713
2713
|
/* @__PURE__ */ s(
|
|
@@ -2721,20 +2721,32 @@ const Br = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2721
2721
|
"aria-label": "Bad response",
|
|
2722
2722
|
"aria-pressed": e === "down",
|
|
2723
2723
|
"data-tooltip": "Bad response",
|
|
2724
|
-
children: /* @__PURE__ */ s(
|
|
2724
|
+
children: /* @__PURE__ */ s(Xn, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2725
2725
|
}
|
|
2726
2726
|
)
|
|
2727
|
-
] }),
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2727
|
+
] }), Je = () => {
|
|
2728
|
+
var i;
|
|
2729
|
+
const { message: e } = _e("SentMessageDeliveryStatus"), { messages: t } = le("SentMessageDeliveryStatus"), { client: n } = oe("SentMessageDeliveryStatus"), a = (i = n.user) == null ? void 0 : i.id, r = se(() => {
|
|
2730
|
+
var l;
|
|
2731
|
+
if (!(!a || !t)) {
|
|
2732
|
+
for (let o = t.length - 1; o >= 0; o -= 1)
|
|
2733
|
+
if (((l = t[o].user) == null ? void 0 : l.id) === a) return t[o].id;
|
|
2734
|
+
}
|
|
2735
|
+
}, [t, a]);
|
|
2736
|
+
return e.id !== r ? null : /* @__PURE__ */ m(ee, { children: [
|
|
2737
|
+
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2738
|
+
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2739
|
+
] });
|
|
2740
|
+
}, Wr = () => null, Xr = () => /* @__PURE__ */ s(
|
|
2741
|
+
Xs,
|
|
2732
2742
|
{
|
|
2733
|
-
MessageSentStatus:
|
|
2743
|
+
MessageSentStatus: Je,
|
|
2744
|
+
MessageDeliveredStatus: Je,
|
|
2745
|
+
MessageReadStatus: Je,
|
|
2734
2746
|
MessageSendingStatus: Wr
|
|
2735
2747
|
}
|
|
2736
2748
|
), Kr = /^([a-z][a-z0-9+.-]*):/i, Jr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2737
|
-
function
|
|
2749
|
+
function _t(e) {
|
|
2738
2750
|
if (typeof e != "string") return;
|
|
2739
2751
|
const t = e.trim();
|
|
2740
2752
|
if (t === "") return;
|
|
@@ -2752,7 +2764,7 @@ const Zr = {
|
|
|
2752
2764
|
const n = k(
|
|
2753
2765
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2754
2766
|
Zr[e]
|
|
2755
|
-
), a =
|
|
2767
|
+
), a = _t(t.href);
|
|
2756
2768
|
return a ? /* @__PURE__ */ s(
|
|
2757
2769
|
"a",
|
|
2758
2770
|
{
|
|
@@ -2784,7 +2796,7 @@ const Zr = {
|
|
|
2784
2796
|
}, ti = "text-white/30", si = {
|
|
2785
2797
|
dark: "text-white/55",
|
|
2786
2798
|
light: "text-black/55"
|
|
2787
|
-
},
|
|
2799
|
+
}, Nt = ({
|
|
2788
2800
|
variant: e,
|
|
2789
2801
|
title: t,
|
|
2790
2802
|
placeholderTitle: n,
|
|
@@ -2892,11 +2904,11 @@ const Zr = {
|
|
|
2892
2904
|
}, ri = {
|
|
2893
2905
|
dark: "size-16 text-white/25",
|
|
2894
2906
|
light: "size-16 text-black/25"
|
|
2895
|
-
}, Ve = (e, t) => !!t && !!e &&
|
|
2907
|
+
}, Ve = (e, t) => !!t && !!e && ce(e) === "audio", yt = (e, t) => {
|
|
2896
2908
|
if (!t || !e) return !1;
|
|
2897
|
-
const n =
|
|
2909
|
+
const n = ce(e);
|
|
2898
2910
|
return n === "video" || n === "audio";
|
|
2899
|
-
},
|
|
2911
|
+
}, kt = "bg-[#F2F3F4]", $e = ({
|
|
2900
2912
|
variant: e,
|
|
2901
2913
|
thumbnailUrl: t,
|
|
2902
2914
|
sourceUrl: n,
|
|
@@ -2905,7 +2917,7 @@ const Zr = {
|
|
|
2905
2917
|
topLeft: i,
|
|
2906
2918
|
topRight: l
|
|
2907
2919
|
}) => {
|
|
2908
|
-
const o =
|
|
2920
|
+
const o = ce(r), d = !!n && o === "video";
|
|
2909
2921
|
return Ve(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
|
|
2910
2922
|
"audio",
|
|
2911
2923
|
{
|
|
@@ -2990,10 +3002,10 @@ const Zr = {
|
|
|
2990
3002
|
onClick: h,
|
|
2991
3003
|
"aria-label": "Edit attachment",
|
|
2992
3004
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
2993
|
-
children: /* @__PURE__ */ s(
|
|
3005
|
+
children: /* @__PURE__ */ s(Jn, { className: "size-5", weight: "regular" })
|
|
2994
3006
|
}
|
|
2995
3007
|
) : void 0;
|
|
2996
|
-
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName:
|
|
3008
|
+
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName: kt, children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
2997
3009
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
2998
3010
|
$e,
|
|
2999
3011
|
{
|
|
@@ -3022,7 +3034,7 @@ const Zr = {
|
|
|
3022
3034
|
}
|
|
3023
3035
|
),
|
|
3024
3036
|
/* @__PURE__ */ s(
|
|
3025
|
-
|
|
3037
|
+
Nt,
|
|
3026
3038
|
{
|
|
3027
3039
|
variant: "dark",
|
|
3028
3040
|
title: e,
|
|
@@ -3049,7 +3061,7 @@ const Zr = {
|
|
|
3049
3061
|
cta: d,
|
|
3050
3062
|
onClick: u
|
|
3051
3063
|
}) => {
|
|
3052
|
-
const p =
|
|
3064
|
+
const p = yt(a, i), h = _t(n), g = d == null && h != null && !p ? h : void 0, c = d == null && !p ? u : void 0, v = Ve(a, i) ? kt : void 0, w = d && u ? {
|
|
3053
3065
|
...d,
|
|
3054
3066
|
onClick: () => {
|
|
3055
3067
|
var b;
|
|
@@ -3077,7 +3089,7 @@ const Zr = {
|
|
|
3077
3089
|
}
|
|
3078
3090
|
),
|
|
3079
3091
|
/* @__PURE__ */ s(
|
|
3080
|
-
|
|
3092
|
+
Nt,
|
|
3081
3093
|
{
|
|
3082
3094
|
variant: "light",
|
|
3083
3095
|
title: e,
|
|
@@ -3103,14 +3115,14 @@ const Zr = {
|
|
|
3103
3115
|
cta: u,
|
|
3104
3116
|
onClick: p
|
|
3105
3117
|
}) => {
|
|
3106
|
-
const h =
|
|
3118
|
+
const h = yt(r, l), g = _t(a), c = u == null && g != null && !h ? g : void 0, v = u == null && !h && c != null ? p : void 0;
|
|
3107
3119
|
return /* @__PURE__ */ m(
|
|
3108
3120
|
Oe,
|
|
3109
3121
|
{
|
|
3110
3122
|
variant: "dark",
|
|
3111
3123
|
href: c,
|
|
3112
3124
|
onClick: v,
|
|
3113
|
-
bgClassName: Ve(r, l) ?
|
|
3125
|
+
bgClassName: Ve(r, l) ? kt : void 0,
|
|
3114
3126
|
children: [
|
|
3115
3127
|
o === "featured" && /* @__PURE__ */ s(
|
|
3116
3128
|
$e,
|
|
@@ -3123,7 +3135,7 @@ const Zr = {
|
|
|
3123
3135
|
}
|
|
3124
3136
|
),
|
|
3125
3137
|
/* @__PURE__ */ s(
|
|
3126
|
-
|
|
3138
|
+
Nt,
|
|
3127
3139
|
{
|
|
3128
3140
|
variant: "dark",
|
|
3129
3141
|
title: e,
|
|
@@ -3137,7 +3149,7 @@ const Zr = {
|
|
|
3137
3149
|
]
|
|
3138
3150
|
}
|
|
3139
3151
|
);
|
|
3140
|
-
},
|
|
3152
|
+
}, es = {
|
|
3141
3153
|
Composer: ii,
|
|
3142
3154
|
Sent: oi,
|
|
3143
3155
|
Received: li
|
|
@@ -3146,13 +3158,13 @@ function P(e) {
|
|
|
3146
3158
|
const t = e == null ? void 0 : e.trim();
|
|
3147
3159
|
return t || void 0;
|
|
3148
3160
|
}
|
|
3149
|
-
function
|
|
3161
|
+
function ts(e) {
|
|
3150
3162
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3151
3163
|
}
|
|
3152
3164
|
function ui(e, t) {
|
|
3153
3165
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3154
3166
|
return !1;
|
|
3155
|
-
const n =
|
|
3167
|
+
const n = ts(e), a = ts(t);
|
|
3156
3168
|
if (n === a)
|
|
3157
3169
|
return !0;
|
|
3158
3170
|
if (!n.includes(a))
|
|
@@ -3160,7 +3172,7 @@ function ui(e, t) {
|
|
|
3160
3172
|
const r = n.split(a).join("");
|
|
3161
3173
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3162
3174
|
}
|
|
3163
|
-
function
|
|
3175
|
+
function ss(e) {
|
|
3164
3176
|
const t = P(e.og_scrape_url) ?? P(e.title_link), n = P(e.image_url) ?? P(e.thumb_url), a = P(e.asset_url), r = P(e.mime_type);
|
|
3165
3177
|
return {
|
|
3166
3178
|
title: P(e.title),
|
|
@@ -3170,19 +3182,19 @@ function ts(e) {
|
|
|
3170
3182
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3171
3183
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3172
3184
|
sourceUrl: a,
|
|
3173
|
-
layout: n ||
|
|
3185
|
+
layout: n || yt(r, a) ? "featured" : "classic",
|
|
3174
3186
|
mimeType: r
|
|
3175
3187
|
};
|
|
3176
3188
|
}
|
|
3177
3189
|
function mi(e) {
|
|
3178
3190
|
var t;
|
|
3179
|
-
return
|
|
3191
|
+
return Ps(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3180
3192
|
}
|
|
3181
|
-
function
|
|
3193
|
+
function Ps(e) {
|
|
3182
3194
|
const t = P(e.og_scrape_url);
|
|
3183
3195
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3184
3196
|
}
|
|
3185
|
-
function
|
|
3197
|
+
function Fs(e) {
|
|
3186
3198
|
if (!(e != null && e.length)) return [];
|
|
3187
3199
|
const t = [], n = (r, i) => {
|
|
3188
3200
|
const l = t[t.length - 1];
|
|
@@ -3200,7 +3212,7 @@ function Ps(e) {
|
|
|
3200
3212
|
t.push({ type: "link", attachments: [r] });
|
|
3201
3213
|
};
|
|
3202
3214
|
for (const r of e) {
|
|
3203
|
-
if (
|
|
3215
|
+
if (Ps(r)) {
|
|
3204
3216
|
a(r);
|
|
3205
3217
|
continue;
|
|
3206
3218
|
}
|
|
@@ -3221,21 +3233,21 @@ function fi(e) {
|
|
|
3221
3233
|
function gi(e, t, n) {
|
|
3222
3234
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3223
3235
|
}
|
|
3224
|
-
function
|
|
3236
|
+
function ns(e) {
|
|
3225
3237
|
return P(e.image_url) ?? P(e.asset_url) ?? "";
|
|
3226
3238
|
}
|
|
3227
3239
|
function pi(e) {
|
|
3228
3240
|
switch (e) {
|
|
3229
3241
|
case "image":
|
|
3230
|
-
return
|
|
3242
|
+
return ye.Image;
|
|
3231
3243
|
case "video":
|
|
3232
|
-
return
|
|
3244
|
+
return ye.Video;
|
|
3233
3245
|
case "audio":
|
|
3234
|
-
return
|
|
3246
|
+
return ye.Audio;
|
|
3235
3247
|
case "pdf":
|
|
3236
|
-
return
|
|
3248
|
+
return ye.Pdf;
|
|
3237
3249
|
default:
|
|
3238
|
-
return
|
|
3250
|
+
return ye.File;
|
|
3239
3251
|
}
|
|
3240
3252
|
}
|
|
3241
3253
|
function bi(e, t) {
|
|
@@ -3244,7 +3256,7 @@ function bi(e, t) {
|
|
|
3244
3256
|
case "image":
|
|
3245
3257
|
return {
|
|
3246
3258
|
items: t.map((a) => ({
|
|
3247
|
-
src:
|
|
3259
|
+
src: ns(a),
|
|
3248
3260
|
alt: P(a.title)
|
|
3249
3261
|
}))
|
|
3250
3262
|
};
|
|
@@ -3295,7 +3307,7 @@ function bi(e, t) {
|
|
|
3295
3307
|
switch (e) {
|
|
3296
3308
|
case "image":
|
|
3297
3309
|
return {
|
|
3298
|
-
src:
|
|
3310
|
+
src: ns(n),
|
|
3299
3311
|
alt: P(n.title)
|
|
3300
3312
|
};
|
|
3301
3313
|
case "video":
|
|
@@ -3344,17 +3356,17 @@ const xi = ({
|
|
|
3344
3356
|
message: n
|
|
3345
3357
|
}) => {
|
|
3346
3358
|
var w;
|
|
3347
|
-
const a =
|
|
3359
|
+
const a = Fs(n.attachments);
|
|
3348
3360
|
if (a.length === 0) return null;
|
|
3349
|
-
const r = hi(a), i = fi(a), l = (w = n.text) == null ? void 0 : w.trim(), o = a.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ?
|
|
3361
|
+
const r = hi(a), i = fi(a), l = (w = n.text) == null ? void 0 : w.trim(), o = a.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? ss(o.attachments[0] ?? {}).url : void 0, u = l && ui(l, d) ? void 0 : l;
|
|
3350
3362
|
let p = 0, h = 0;
|
|
3351
3363
|
const g = [], c = (b, f) => {
|
|
3352
3364
|
const x = p === r - 1;
|
|
3353
3365
|
p += 1;
|
|
3354
|
-
const N = t ?
|
|
3366
|
+
const N = t ? es.Sent : es.Received;
|
|
3355
3367
|
g.push(
|
|
3356
3368
|
/* @__PURE__ */ m(U.Fragment, { children: [
|
|
3357
|
-
/* @__PURE__ */ s(N, { ...
|
|
3369
|
+
/* @__PURE__ */ s(N, { ...ss(b) }),
|
|
3358
3370
|
x && u ? /* @__PURE__ */ s("div", { className: t ? ci : di, children: u }) : null
|
|
3359
3371
|
] }, f)
|
|
3360
3372
|
);
|
|
@@ -3387,7 +3399,7 @@ const xi = ({
|
|
|
3387
3399
|
v(b, `media-${f}`);
|
|
3388
3400
|
}), /* @__PURE__ */ s(ee, { children: g });
|
|
3389
3401
|
}, wi = (e) => {
|
|
3390
|
-
var
|
|
3402
|
+
var At, Mt, Rt, Dt, Lt, zt, Pt, Ft, Ot, $t, jt, Bt, Ut, Vt;
|
|
3391
3403
|
const {
|
|
3392
3404
|
additionalMessageInputProps: t,
|
|
3393
3405
|
chatbotVotingEnabled: n,
|
|
@@ -3405,52 +3417,52 @@ const xi = ({
|
|
|
3405
3417
|
renderText: v,
|
|
3406
3418
|
threadList: w,
|
|
3407
3419
|
viewerLanguage: b
|
|
3408
|
-
} = e, { client: f } =
|
|
3409
|
-
Attachment: E =
|
|
3410
|
-
EditMessageModal: C =
|
|
3420
|
+
} = e, { client: f } = oe("CustomMessage"), { channel: x } = le("CustomMessage"), { isUnlocking: N, onUnlockClick: S, onFetchSource: T, onDownloadClick: M } = Br("LockedAttachment"), [L, D] = B(!1), O = Js(c.id), { selected: z, voteUp: y, voteDown: A } = xa(c), {
|
|
3421
|
+
Attachment: E = Zs,
|
|
3422
|
+
EditMessageModal: C = Qs,
|
|
3411
3423
|
MessageActions: I,
|
|
3412
|
-
MessageBlocked: $ =
|
|
3413
|
-
MessageBouncePrompt: F =
|
|
3414
|
-
MessageDeleted: V =
|
|
3415
|
-
MessageIsThreadReplyInChannelButtonIndicator: Q =
|
|
3416
|
-
MessageRepliesCountButton: te =
|
|
3417
|
-
ReminderNotification: X =
|
|
3418
|
-
StreamedMessageText: _ =
|
|
3424
|
+
MessageBlocked: $ = en,
|
|
3425
|
+
MessageBouncePrompt: F = tn,
|
|
3426
|
+
MessageDeleted: V = sn,
|
|
3427
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = nn,
|
|
3428
|
+
MessageRepliesCountButton: te = an,
|
|
3429
|
+
ReminderNotification: X = rn,
|
|
3430
|
+
StreamedMessageText: _ = ln,
|
|
3419
3431
|
PinIndicator: R
|
|
3420
|
-
} =
|
|
3432
|
+
} = is("CustomMessage"), H = on(c), q = cn(c), Y = se(
|
|
3421
3433
|
() => h == null ? void 0 : h(c),
|
|
3422
3434
|
[h, c]
|
|
3423
|
-
), j =
|
|
3424
|
-
const
|
|
3435
|
+
), j = se(() => {
|
|
3436
|
+
const me = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...me] : me;
|
|
3425
3437
|
if (!Fe(c)) return pe;
|
|
3426
|
-
const
|
|
3427
|
-
return
|
|
3428
|
-
}, [c]), W =
|
|
3429
|
-
() =>
|
|
3438
|
+
const Gt = pe.filter((Ht) => !("type" in Ht) || !ws(Ht));
|
|
3439
|
+
return Gt.length === pe.length ? pe : Gt;
|
|
3440
|
+
}, [c]), W = se(
|
|
3441
|
+
() => Fs(j),
|
|
3430
3442
|
[j]
|
|
3431
|
-
), Z =
|
|
3432
|
-
const
|
|
3433
|
-
return
|
|
3434
|
-
}, [c, b]),
|
|
3435
|
-
(
|
|
3443
|
+
), Z = se(() => {
|
|
3444
|
+
const me = hs({ message: c, viewerLanguage: b });
|
|
3445
|
+
return me === c.text ? c : { ...c, text: me };
|
|
3446
|
+
}, [c, b]), de = W.length > 0, De = W.reduce(
|
|
3447
|
+
(me, pe) => me + pe.attachments.length,
|
|
3436
3448
|
0
|
|
3437
|
-
) === ((j == null ? void 0 : j.length) ?? 0),
|
|
3449
|
+
) === ((j == null ? void 0 : j.length) ?? 0), Le = Xa(
|
|
3438
3450
|
{
|
|
3439
3451
|
endOfGroup: r,
|
|
3440
3452
|
firstOfGroup: i,
|
|
3441
3453
|
groupedByUser: l
|
|
3442
3454
|
}
|
|
3443
3455
|
);
|
|
3444
|
-
if (
|
|
3456
|
+
if (dn(c))
|
|
3445
3457
|
return null;
|
|
3446
3458
|
if (c.deleted_at || c.type === "deleted")
|
|
3447
3459
|
return /* @__PURE__ */ s(V, { message: c });
|
|
3448
|
-
if (
|
|
3460
|
+
if (un(c))
|
|
3449
3461
|
return /* @__PURE__ */ s($, {});
|
|
3450
|
-
const
|
|
3462
|
+
const ae = !w && !!c.reply_count, ue = !w && c.show_in_channel && c.parent_id, ie = c.status === "failed" && ((At = c.error) == null ? void 0 : At.status) !== 403, St = mn(c);
|
|
3451
3463
|
let he;
|
|
3452
|
-
ie ? he = () => u(c) :
|
|
3453
|
-
const fe = g(),
|
|
3464
|
+
ie ? he = () => u(c) : St && (he = () => D(!0));
|
|
3465
|
+
const fe = g(), Us = k(
|
|
3454
3466
|
"str-chat__message str-chat__message-simple",
|
|
3455
3467
|
`str-chat__message--${c.type}`,
|
|
3456
3468
|
`str-chat__message--${c.status}`,
|
|
@@ -3461,13 +3473,13 @@ const xi = ({
|
|
|
3461
3473
|
"str-chat__message--highlighted": p,
|
|
3462
3474
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3463
3475
|
"str-chat__message--with-reactions": q,
|
|
3464
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3465
|
-
"str-chat__message-with-thread-link":
|
|
3476
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Mt = c == null ? void 0 : c.error) == null ? void 0 : Mt.status) !== 403,
|
|
3477
|
+
"str-chat__message-with-thread-link": ae || ue,
|
|
3466
3478
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3467
3479
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3468
3480
|
"str-chat__virtual-message__wrapper--group": l
|
|
3469
3481
|
}
|
|
3470
|
-
), Ge = c.poll_id && f.polls.fromState(c.poll_id),
|
|
3482
|
+
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Et = Yr(c), ge = Fe(c), It = Hr(c), He = !!(j != null && j.length && !c.quoted_message), Tt = ge && fe && He, Vs = de && De && !c.quoted_message && !Ge && !Y && !ge;
|
|
3471
3483
|
return /* @__PURE__ */ m(ee, { children: [
|
|
3472
3484
|
a && /* @__PURE__ */ s(
|
|
3473
3485
|
C,
|
|
@@ -3475,25 +3487,25 @@ const xi = ({
|
|
|
3475
3487
|
additionalMessageInputProps: t
|
|
3476
3488
|
}
|
|
3477
3489
|
),
|
|
3478
|
-
|
|
3479
|
-
|
|
3490
|
+
L && /* @__PURE__ */ s(
|
|
3491
|
+
hn,
|
|
3480
3492
|
{
|
|
3481
3493
|
MessageBouncePrompt: F,
|
|
3482
|
-
onClose: () =>
|
|
3483
|
-
open:
|
|
3494
|
+
onClose: () => D(!1),
|
|
3495
|
+
open: L
|
|
3484
3496
|
}
|
|
3485
3497
|
),
|
|
3486
3498
|
/* @__PURE__ */ m(
|
|
3487
3499
|
"div",
|
|
3488
3500
|
{
|
|
3489
|
-
className:
|
|
3501
|
+
className: Us,
|
|
3490
3502
|
"data-message-id": c.id,
|
|
3491
3503
|
"data-dd-privacy": "mask",
|
|
3492
3504
|
children: [
|
|
3493
3505
|
R && /* @__PURE__ */ s(R, {}),
|
|
3494
3506
|
!!O && /* @__PURE__ */ s(X, { reminder: O }),
|
|
3495
3507
|
c.user && /* @__PURE__ */ s(
|
|
3496
|
-
|
|
3508
|
+
ne,
|
|
3497
3509
|
{
|
|
3498
3510
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3499
3511
|
id: c.user.id,
|
|
@@ -3508,7 +3520,7 @@ const xi = ({
|
|
|
3508
3520
|
"div",
|
|
3509
3521
|
{
|
|
3510
3522
|
className: k("str-chat__message-inner", {
|
|
3511
|
-
"str-chat__simple-message--error-failed": ie ||
|
|
3523
|
+
"str-chat__simple-message--error-failed": ie || St
|
|
3512
3524
|
}),
|
|
3513
3525
|
"data-testid": "message-inner",
|
|
3514
3526
|
onClick: he,
|
|
@@ -3521,32 +3533,32 @@ const xi = ({
|
|
|
3521
3533
|
marginInlineEnd: 0,
|
|
3522
3534
|
marginInlineStart: 0
|
|
3523
3535
|
},
|
|
3524
|
-
children:
|
|
3536
|
+
children: It ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3525
3537
|
fe ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3526
3538
|
I && /* @__PURE__ */ s(I, {}),
|
|
3527
3539
|
/* @__PURE__ */ s(
|
|
3528
|
-
|
|
3540
|
+
Zt.Sent,
|
|
3529
3541
|
{
|
|
3530
|
-
title: (
|
|
3531
|
-
mimeType: (
|
|
3542
|
+
title: (Rt = c.metadata) == null ? void 0 : Rt.attachment_title,
|
|
3543
|
+
mimeType: (Dt = c.metadata) == null ? void 0 : Dt.attachment_mime_type,
|
|
3532
3544
|
thumbnailUrl: (Lt = c.metadata) == null ? void 0 : Lt.attachment_thumbnail,
|
|
3533
|
-
amountText: (
|
|
3534
|
-
detail: (
|
|
3535
|
-
paymentStatus: (
|
|
3545
|
+
amountText: (zt = c.metadata) == null ? void 0 : zt.amount_text,
|
|
3546
|
+
detail: (Pt = c.metadata) == null ? void 0 : Pt.attachment_detail,
|
|
3547
|
+
paymentStatus: (Ft = c.metadata) == null ? void 0 : Ft.payment_status,
|
|
3536
3548
|
onPreviewClick: () => S == null ? void 0 : S(c, x),
|
|
3537
3549
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x))
|
|
3538
3550
|
}
|
|
3539
3551
|
)
|
|
3540
3552
|
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3541
3553
|
/* @__PURE__ */ s(
|
|
3542
|
-
|
|
3554
|
+
Zt.Received,
|
|
3543
3555
|
{
|
|
3544
|
-
title: (
|
|
3545
|
-
mimeType: (
|
|
3546
|
-
thumbnailUrl: (
|
|
3547
|
-
amountText: (
|
|
3548
|
-
detail: (
|
|
3549
|
-
paymentStatus: (
|
|
3556
|
+
title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
|
|
3557
|
+
mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
|
|
3558
|
+
thumbnailUrl: (jt = c.metadata) == null ? void 0 : jt.attachment_thumbnail,
|
|
3559
|
+
amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
|
|
3560
|
+
detail: (Ut = c.metadata) == null ? void 0 : Ut.attachment_detail,
|
|
3561
|
+
paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
|
|
3550
3562
|
isUnlocking: N(c.id),
|
|
3551
3563
|
onUnlockClick: () => S == null ? void 0 : S(c, x),
|
|
3552
3564
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x)),
|
|
@@ -3556,16 +3568,16 @@ const xi = ({
|
|
|
3556
3568
|
I && /* @__PURE__ */ s(I, {})
|
|
3557
3569
|
] }),
|
|
3558
3570
|
c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
|
|
3559
|
-
|
|
3571
|
+
qt,
|
|
3560
3572
|
{
|
|
3561
3573
|
message: Z,
|
|
3562
3574
|
renderText: v
|
|
3563
3575
|
}
|
|
3564
3576
|
) })
|
|
3565
|
-
] }) :
|
|
3577
|
+
] }) : Et ? (
|
|
3566
3578
|
/* Tip-only messages render as a standalone bubble */
|
|
3567
3579
|
/* @__PURE__ */ s(Ke, { message: c, standalone: !0 })
|
|
3568
|
-
) :
|
|
3580
|
+
) : Vs ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m(
|
|
3569
3581
|
"div",
|
|
3570
3582
|
{
|
|
3571
3583
|
className: "str-chat__message-bubble",
|
|
@@ -3579,7 +3591,7 @@ const xi = ({
|
|
|
3579
3591
|
/* @__PURE__ */ s(
|
|
3580
3592
|
xi,
|
|
3581
3593
|
{
|
|
3582
|
-
groupPosition:
|
|
3594
|
+
groupPosition: Le,
|
|
3583
3595
|
isMyMessage: fe,
|
|
3584
3596
|
message: {
|
|
3585
3597
|
attachments: j,
|
|
@@ -3587,11 +3599,11 @@ const xi = ({
|
|
|
3587
3599
|
}
|
|
3588
3600
|
}
|
|
3589
3601
|
),
|
|
3590
|
-
/* @__PURE__ */ s(
|
|
3602
|
+
/* @__PURE__ */ s(Wt, {})
|
|
3591
3603
|
]
|
|
3592
3604
|
}
|
|
3593
3605
|
) }) : /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m("div", { className: "str-chat__message-bubble", children: [
|
|
3594
|
-
ge && !
|
|
3606
|
+
ge && !Tt && /* @__PURE__ */ s(
|
|
3595
3607
|
Ke,
|
|
3596
3608
|
{
|
|
3597
3609
|
message: c,
|
|
@@ -3599,7 +3611,7 @@ const xi = ({
|
|
|
3599
3611
|
isMyMessage: fe
|
|
3600
3612
|
}
|
|
3601
3613
|
),
|
|
3602
|
-
Ge && /* @__PURE__ */ s(
|
|
3614
|
+
Ge && /* @__PURE__ */ s(fn, { poll: Ge }),
|
|
3603
3615
|
j != null && j.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3604
3616
|
E,
|
|
3605
3617
|
{
|
|
@@ -3614,18 +3626,18 @@ const xi = ({
|
|
|
3614
3626
|
renderText: v
|
|
3615
3627
|
}
|
|
3616
3628
|
) : /* @__PURE__ */ s(
|
|
3617
|
-
|
|
3629
|
+
qt,
|
|
3618
3630
|
{
|
|
3619
3631
|
message: Z,
|
|
3620
3632
|
renderText: v
|
|
3621
3633
|
}
|
|
3622
3634
|
),
|
|
3623
|
-
/* @__PURE__ */ s(
|
|
3635
|
+
/* @__PURE__ */ s(Wt, {})
|
|
3624
3636
|
] }) })
|
|
3625
3637
|
}
|
|
3626
3638
|
),
|
|
3627
|
-
!
|
|
3628
|
-
(!ge ||
|
|
3639
|
+
!It && !Et && /* @__PURE__ */ m("div", { className: "str-chat__message-footer", children: [
|
|
3640
|
+
(!ge || Tt) && /* @__PURE__ */ s(
|
|
3629
3641
|
Ke,
|
|
3630
3642
|
{
|
|
3631
3643
|
message: c,
|
|
@@ -3634,7 +3646,7 @@ const xi = ({
|
|
|
3634
3646
|
}
|
|
3635
3647
|
),
|
|
3636
3648
|
n && ge && /* @__PURE__ */ s(
|
|
3637
|
-
|
|
3649
|
+
qr,
|
|
3638
3650
|
{
|
|
3639
3651
|
selected: z,
|
|
3640
3652
|
onVoteUp: y,
|
|
@@ -3643,14 +3655,14 @@ const xi = ({
|
|
|
3643
3655
|
)
|
|
3644
3656
|
] }),
|
|
3645
3657
|
/* @__PURE__ */ s(Xr, {}),
|
|
3646
|
-
|
|
3658
|
+
ae && /* @__PURE__ */ s(
|
|
3647
3659
|
te,
|
|
3648
3660
|
{
|
|
3649
3661
|
onClick: d,
|
|
3650
3662
|
reply_count: c.reply_count
|
|
3651
3663
|
}
|
|
3652
3664
|
),
|
|
3653
|
-
|
|
3665
|
+
ue && /* @__PURE__ */ s(Q, {})
|
|
3654
3666
|
]
|
|
3655
3667
|
},
|
|
3656
3668
|
c.id
|
|
@@ -3658,43 +3670,40 @@ const xi = ({
|
|
|
3658
3670
|
] });
|
|
3659
3671
|
}, _i = U.memo(
|
|
3660
3672
|
wi,
|
|
3661
|
-
(e, t) =>
|
|
3662
|
-
var n, a;
|
|
3663
|
-
return e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage || ((n = e.lastOwnMessage) == null ? void 0 : n.id) !== ((a = t.lastOwnMessage) == null ? void 0 : a.id) ? !1 : Xs(e, t);
|
|
3664
|
-
}
|
|
3673
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ks(e, t)
|
|
3665
3674
|
), Ni = (e) => {
|
|
3666
|
-
const t =
|
|
3675
|
+
const t = _e("CustomMessage");
|
|
3667
3676
|
return /* @__PURE__ */ s(_i, { ...t, ...e });
|
|
3668
3677
|
}, yi = () => {
|
|
3669
3678
|
var n;
|
|
3670
|
-
const { handleDelete: e, message: t } =
|
|
3679
|
+
const { handleDelete: e, message: t } = _e("CustomMessageActions");
|
|
3671
3680
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
3672
|
-
|
|
3681
|
+
ds,
|
|
3673
3682
|
{
|
|
3674
3683
|
onClick: e,
|
|
3675
3684
|
"aria-label": "Delete",
|
|
3676
3685
|
title: "Delete",
|
|
3677
3686
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3678
|
-
children: /* @__PURE__ */ s(
|
|
3687
|
+
children: /* @__PURE__ */ s(Zn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3679
3688
|
}
|
|
3680
3689
|
);
|
|
3681
3690
|
}, ki = () => {
|
|
3682
|
-
const { handleFlag: e } =
|
|
3691
|
+
const { handleFlag: e } = _e("CustomMessageActions");
|
|
3683
3692
|
return /* @__PURE__ */ s(
|
|
3684
|
-
|
|
3693
|
+
ds,
|
|
3685
3694
|
{
|
|
3686
3695
|
onClick: e,
|
|
3687
3696
|
"aria-label": "Report",
|
|
3688
3697
|
title: "Report",
|
|
3689
3698
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3690
|
-
children: /* @__PURE__ */ s(
|
|
3699
|
+
children: /* @__PURE__ */ s(ls, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3691
3700
|
}
|
|
3692
3701
|
);
|
|
3693
3702
|
}, Ci = () => {
|
|
3694
3703
|
var t;
|
|
3695
|
-
const { message: e } =
|
|
3704
|
+
const { message: e } = _e("CustomMessageActions");
|
|
3696
3705
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3697
|
-
|
|
3706
|
+
ta,
|
|
3698
3707
|
{
|
|
3699
3708
|
messageActionSet: [
|
|
3700
3709
|
{ Component: yi, placement: "quick", type: "delete" },
|
|
@@ -3744,10 +3753,10 @@ const xi = ({
|
|
|
3744
3753
|
);
|
|
3745
3754
|
}, Ei = (e) => ({
|
|
3746
3755
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3747
|
-
(t) =>
|
|
3756
|
+
(t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
|
|
3748
3757
|
)
|
|
3749
3758
|
}), Ii = () => {
|
|
3750
|
-
const { linkPreviewsManager: e } =
|
|
3759
|
+
const { linkPreviewsManager: e } = gn(), { linkPreviews: t } = pn(
|
|
3751
3760
|
e.state,
|
|
3752
3761
|
Ei
|
|
3753
3762
|
), n = (r) => {
|
|
@@ -3764,7 +3773,7 @@ const xi = ({
|
|
|
3764
3773
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3765
3774
|
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(Si, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3766
3775
|
) : null;
|
|
3767
|
-
},
|
|
3776
|
+
}, Ct = U.createContext(!1), hl = () => Ie(Ct), Ti = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3768
3777
|
"button",
|
|
3769
3778
|
{
|
|
3770
3779
|
...n,
|
|
@@ -3772,13 +3781,13 @@ const xi = ({
|
|
|
3772
3781
|
"aria-label": "Send",
|
|
3773
3782
|
disabled: t,
|
|
3774
3783
|
onClick: e,
|
|
3775
|
-
children: /* @__PURE__ */ s(
|
|
3784
|
+
children: /* @__PURE__ */ s(Qn, { weight: "bold", className: "size-4" })
|
|
3776
3785
|
}
|
|
3777
3786
|
), Ai = () => {
|
|
3778
|
-
const e =
|
|
3787
|
+
const e = Ie(Ct), { handleSubmit: t } = vn(), n = xn(), a = e || !n, {
|
|
3779
3788
|
SendButton: r = Ti,
|
|
3780
|
-
AttachmentPreviewList: i =
|
|
3781
|
-
} =
|
|
3789
|
+
AttachmentPreviewList: i = wn
|
|
3790
|
+
} = is("CustomMessageInput");
|
|
3782
3791
|
return (
|
|
3783
3792
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3784
3793
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3794,12 +3803,12 @@ const xi = ({
|
|
|
3794
3803
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
3795
3804
|
"data-dd-privacy": "mask",
|
|
3796
3805
|
children: [
|
|
3797
|
-
/* @__PURE__ */ s(
|
|
3806
|
+
/* @__PURE__ */ s(_n, {}),
|
|
3798
3807
|
/* @__PURE__ */ s(Ii, {}),
|
|
3799
3808
|
/* @__PURE__ */ s(i, {}),
|
|
3800
3809
|
/* @__PURE__ */ m("div", { className: "flex shrink-0", children: [
|
|
3801
3810
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
3802
|
-
|
|
3811
|
+
Nn,
|
|
3803
3812
|
{
|
|
3804
3813
|
"aria-disabled": e || void 0,
|
|
3805
3814
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3833,7 +3842,7 @@ const xi = ({
|
|
|
3833
3842
|
composerInput: r
|
|
3834
3843
|
}) => {
|
|
3835
3844
|
var o;
|
|
3836
|
-
const { channel: i } =
|
|
3845
|
+
const { channel: i } = le(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
3837
3846
|
return n ? /* @__PURE__ */ m(ee, { children: [
|
|
3838
3847
|
/* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
3839
3848
|
t == null ? void 0 : t()
|
|
@@ -3846,7 +3855,7 @@ const xi = ({
|
|
|
3846
3855
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3847
3856
|
children: [
|
|
3848
3857
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3849
|
-
/* @__PURE__ */ s(
|
|
3858
|
+
/* @__PURE__ */ s(Ct.Provider, { value: l, children: /* @__PURE__ */ s(bn, { Input: r ?? Ai }) })
|
|
3850
3859
|
]
|
|
3851
3860
|
}
|
|
3852
3861
|
),
|
|
@@ -3855,17 +3864,17 @@ const xi = ({
|
|
|
3855
3864
|
}, Ri = [
|
|
3856
3865
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3857
3866
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3858
|
-
],
|
|
3867
|
+
], Di = {
|
|
3859
3868
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3860
3869
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3861
|
-
},
|
|
3870
|
+
}, Li = [
|
|
3862
3871
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3863
3872
|
], zi = {
|
|
3864
3873
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3865
|
-
},
|
|
3874
|
+
}, Ze = "age safety guidelines.", Pi = "https://linktr.ee/s/about/contact", as = (e) => Ri.includes(e), Fi = (e) => Li.includes(e), Oi = (e) => {
|
|
3866
3875
|
var a;
|
|
3867
3876
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3868
|
-
if (
|
|
3877
|
+
if (as(t))
|
|
3869
3878
|
return {
|
|
3870
3879
|
kind: "dm-agent",
|
|
3871
3880
|
type: t
|
|
@@ -3876,16 +3885,16 @@ const xi = ({
|
|
|
3876
3885
|
type: t
|
|
3877
3886
|
};
|
|
3878
3887
|
const n = e.dm_agent_system_type;
|
|
3879
|
-
if (
|
|
3888
|
+
if (as(n))
|
|
3880
3889
|
return {
|
|
3881
3890
|
kind: "dm-agent",
|
|
3882
3891
|
type: n
|
|
3883
3892
|
};
|
|
3884
3893
|
}, $i = (e) => {
|
|
3885
|
-
const t = e.indexOf(
|
|
3894
|
+
const t = e.indexOf(Ze);
|
|
3886
3895
|
if (t === -1)
|
|
3887
3896
|
return e;
|
|
3888
|
-
const n = t +
|
|
3897
|
+
const n = t + Ze.length;
|
|
3889
3898
|
return /* @__PURE__ */ m(ee, { children: [
|
|
3890
3899
|
e.slice(0, t),
|
|
3891
3900
|
/* @__PURE__ */ s(
|
|
@@ -3895,7 +3904,7 @@ const xi = ({
|
|
|
3895
3904
|
target: "_blank",
|
|
3896
3905
|
rel: "noopener noreferrer",
|
|
3897
3906
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
3898
|
-
children:
|
|
3907
|
+
children: Ze
|
|
3899
3908
|
}
|
|
3900
3909
|
),
|
|
3901
3910
|
e.slice(n)
|
|
@@ -3906,7 +3915,7 @@ const xi = ({
|
|
|
3906
3915
|
e.message
|
|
3907
3916
|
);
|
|
3908
3917
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
3909
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3918
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Di[n.type];
|
|
3910
3919
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3911
3920
|
/* @__PURE__ */ m(
|
|
3912
3921
|
"div",
|
|
@@ -3942,7 +3951,7 @@ const xi = ({
|
|
|
3942
3951
|
"data-age-safety-system-type": n.type,
|
|
3943
3952
|
children: [
|
|
3944
3953
|
/* @__PURE__ */ s(
|
|
3945
|
-
|
|
3954
|
+
ea,
|
|
3946
3955
|
{
|
|
3947
3956
|
size: 24,
|
|
3948
3957
|
weight: "duotone",
|
|
@@ -3966,7 +3975,7 @@ const xi = ({
|
|
|
3966
3975
|
] }),
|
|
3967
3976
|
!t && /* @__PURE__ */ s(Ye, { message: e.message })
|
|
3968
3977
|
] });
|
|
3969
|
-
},
|
|
3978
|
+
}, Os = rt(!1), Qe = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
|
|
3970
3979
|
"animateTransform",
|
|
3971
3980
|
{
|
|
3972
3981
|
attributeName: "transform",
|
|
@@ -3982,11 +3991,11 @@ const xi = ({
|
|
|
3982
3991
|
qe.ExternalSources
|
|
3983
3992
|
]), Ui = ({ threadList: e }) => {
|
|
3984
3993
|
var v, w;
|
|
3985
|
-
const { channel: t, channelConfig: n, thread: a } =
|
|
3994
|
+
const { channel: t, channelConfig: n, thread: a } = le(), { client: r } = oe(), { typing: i = {} } = yn(), { aiState: l } = kn(t), o = Ie(Os);
|
|
3986
3995
|
if (!e && o && Bi.has(l)) {
|
|
3987
3996
|
const b = Vi(t, (v = r.user) == null ? void 0 : v.id);
|
|
3988
3997
|
return /* @__PURE__ */ s(
|
|
3989
|
-
|
|
3998
|
+
rs,
|
|
3990
3999
|
{
|
|
3991
4000
|
avatarId: (b == null ? void 0 : b.id) ?? "ai-agent",
|
|
3992
4001
|
avatarName: (b == null ? void 0 : b.name) ?? (b == null ? void 0 : b.id) ?? "Agent",
|
|
@@ -4012,7 +4021,7 @@ const xi = ({
|
|
|
4012
4021
|
return null;
|
|
4013
4022
|
const g = (w = h[0]) == null ? void 0 : w.user, c = g != null && g.id && t.state.members[g.id] ? t.state.members[g.id].user : void 0;
|
|
4014
4023
|
return /* @__PURE__ */ s(
|
|
4015
|
-
|
|
4024
|
+
rs,
|
|
4016
4025
|
{
|
|
4017
4026
|
avatarId: (g == null ? void 0 : g.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
4018
4027
|
avatarName: (g == null ? void 0 : g.name) ?? (c == null ? void 0 : c.name) ?? (g == null ? void 0 : g.id) ?? "Typing user",
|
|
@@ -4020,7 +4029,7 @@ const xi = ({
|
|
|
4020
4029
|
testId: "typing-indicator"
|
|
4021
4030
|
}
|
|
4022
4031
|
);
|
|
4023
|
-
},
|
|
4032
|
+
}, rs = ({
|
|
4024
4033
|
avatarId: e,
|
|
4025
4034
|
avatarName: t,
|
|
4026
4035
|
avatarImage: n,
|
|
@@ -4035,7 +4044,7 @@ const xi = ({
|
|
|
4035
4044
|
},
|
|
4036
4045
|
children: /* @__PURE__ */ m("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
4037
4046
|
/* @__PURE__ */ s(
|
|
4038
|
-
|
|
4047
|
+
ne,
|
|
4039
4048
|
{
|
|
4040
4049
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4041
4050
|
id: e,
|
|
@@ -4055,9 +4064,9 @@ const xi = ({
|
|
|
4055
4064
|
height: "13",
|
|
4056
4065
|
overflow: "visible",
|
|
4057
4066
|
children: [
|
|
4058
|
-
/* @__PURE__ */ s(
|
|
4059
|
-
/* @__PURE__ */ s(
|
|
4060
|
-
/* @__PURE__ */ s(
|
|
4067
|
+
/* @__PURE__ */ s(Qe, { cx: "4", index: 0 }),
|
|
4068
|
+
/* @__PURE__ */ s(Qe, { cx: "16", index: 1 }),
|
|
4069
|
+
/* @__PURE__ */ s(Qe, { cx: "28", index: 2 })
|
|
4061
4070
|
]
|
|
4062
4071
|
}
|
|
4063
4072
|
) }) }) }) }) })
|
|
@@ -4141,7 +4150,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4141
4150
|
renderHeaderTitleBadges: b
|
|
4142
4151
|
}) => {
|
|
4143
4152
|
var A, E, C, I, $, F;
|
|
4144
|
-
const { channel: f } =
|
|
4153
|
+
const { channel: f } = le(), { client: x } = oe(), N = U.useMemo(
|
|
4145
4154
|
() => {
|
|
4146
4155
|
var V;
|
|
4147
4156
|
return Ue(
|
|
@@ -4151,12 +4160,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4151
4160
|
);
|
|
4152
4161
|
},
|
|
4153
4162
|
[(A = f.state) == null ? void 0 : A.members, x == null ? void 0 : x.userID, f.type]
|
|
4154
|
-
), S =
|
|
4163
|
+
), S = ct(N == null ? void 0 : N.user), T = (E = N == null ? void 0 : N.user) == null ? void 0 : E.image, M = ot(f), L = b == null ? void 0 : b({
|
|
4155
4164
|
channel: f,
|
|
4156
4165
|
participant: N
|
|
4157
|
-
}),
|
|
4166
|
+
}), D = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", O = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ m(ee, { children: [
|
|
4158
4167
|
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: S }),
|
|
4159
|
-
|
|
4168
|
+
L && /* @__PURE__ */ s("span", { className: "shrink-0", children: L })
|
|
4160
4169
|
] }), y = async () => {
|
|
4161
4170
|
try {
|
|
4162
4171
|
M ? await f.unpin() : await f.pin();
|
|
@@ -4180,7 +4189,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4180
4189
|
}),
|
|
4181
4190
|
type: "button",
|
|
4182
4191
|
"aria-label": "Back to conversations",
|
|
4183
|
-
children: /* @__PURE__ */ s(
|
|
4192
|
+
children: /* @__PURE__ */ s(et, { className: "size-5 text-black/90" })
|
|
4184
4193
|
}
|
|
4185
4194
|
) }),
|
|
4186
4195
|
/* @__PURE__ */ s(
|
|
@@ -4195,12 +4204,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4195
4204
|
onClick: w,
|
|
4196
4205
|
"aria-label": `View details for ${S}`,
|
|
4197
4206
|
className: k(
|
|
4198
|
-
|
|
4207
|
+
D,
|
|
4199
4208
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4200
4209
|
),
|
|
4201
4210
|
children: [
|
|
4202
4211
|
/* @__PURE__ */ s(
|
|
4203
|
-
|
|
4212
|
+
ne,
|
|
4204
4213
|
{
|
|
4205
4214
|
id: ((C = N == null ? void 0 : N.user) == null ? void 0 : C.id) || f.id || "unknown",
|
|
4206
4215
|
name: S,
|
|
@@ -4220,9 +4229,9 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4220
4229
|
] })
|
|
4221
4230
|
]
|
|
4222
4231
|
}
|
|
4223
|
-
) : /* @__PURE__ */ m("div", { className:
|
|
4232
|
+
) : /* @__PURE__ */ m("div", { className: D, children: [
|
|
4224
4233
|
/* @__PURE__ */ s(
|
|
4225
|
-
|
|
4234
|
+
ne,
|
|
4226
4235
|
{
|
|
4227
4236
|
id: ((I = N == null ? void 0 : N.user) == null ? void 0 : I.id) || f.id || "unknown",
|
|
4228
4237
|
name: S,
|
|
@@ -4258,7 +4267,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4258
4267
|
type: "button",
|
|
4259
4268
|
"aria-label": M ? "Unstar conversation" : "Star conversation",
|
|
4260
4269
|
children: /* @__PURE__ */ s(
|
|
4261
|
-
|
|
4270
|
+
Ee,
|
|
4262
4271
|
{
|
|
4263
4272
|
className: k("size-5", {
|
|
4264
4273
|
"text-yellow-600": M,
|
|
@@ -4270,7 +4279,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4270
4279
|
}
|
|
4271
4280
|
),
|
|
4272
4281
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4273
|
-
|
|
4282
|
+
st,
|
|
4274
4283
|
{
|
|
4275
4284
|
channel: f,
|
|
4276
4285
|
participant: N,
|
|
@@ -4300,7 +4309,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4300
4309
|
type: "button",
|
|
4301
4310
|
onClick: e,
|
|
4302
4311
|
"aria-label": "Back to conversations",
|
|
4303
|
-
children: /* @__PURE__ */ s(
|
|
4312
|
+
children: /* @__PURE__ */ s(et, { className: "size-5 text-black/90" })
|
|
4304
4313
|
}
|
|
4305
4314
|
),
|
|
4306
4315
|
w ? /* @__PURE__ */ m(
|
|
@@ -4315,7 +4324,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4315
4324
|
),
|
|
4316
4325
|
children: [
|
|
4317
4326
|
/* @__PURE__ */ s(
|
|
4318
|
-
|
|
4327
|
+
ne,
|
|
4319
4328
|
{
|
|
4320
4329
|
id: (($ = N == null ? void 0 : N.user) == null ? void 0 : $.id) || f.id || "unknown",
|
|
4321
4330
|
name: S,
|
|
@@ -4339,7 +4348,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4339
4348
|
}
|
|
4340
4349
|
) : /* @__PURE__ */ m("div", { className: O, children: [
|
|
4341
4350
|
/* @__PURE__ */ s(
|
|
4342
|
-
|
|
4351
|
+
ne,
|
|
4343
4352
|
{
|
|
4344
4353
|
id: ((F = N == null ? void 0 : N.user) == null ? void 0 : F.id) || f.id || "unknown",
|
|
4345
4354
|
name: S,
|
|
@@ -4376,7 +4385,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4376
4385
|
type: "button",
|
|
4377
4386
|
"aria-label": M ? "Unstar conversation" : "Star conversation",
|
|
4378
4387
|
children: /* @__PURE__ */ s(
|
|
4379
|
-
|
|
4388
|
+
Ee,
|
|
4380
4389
|
{
|
|
4381
4390
|
className: k("size-6", {
|
|
4382
4391
|
"text-yellow-600": M,
|
|
@@ -4388,7 +4397,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4388
4397
|
}
|
|
4389
4398
|
),
|
|
4390
4399
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4391
|
-
|
|
4400
|
+
st,
|
|
4392
4401
|
{
|
|
4393
4402
|
channel: f,
|
|
4394
4403
|
participant: N,
|
|
@@ -4431,13 +4440,13 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4431
4440
|
renderChannelActions: S,
|
|
4432
4441
|
renderMessage: T,
|
|
4433
4442
|
dmAgentEnabled: M = !1,
|
|
4434
|
-
viewerLanguage:
|
|
4435
|
-
showChannelInfo:
|
|
4443
|
+
viewerLanguage: L,
|
|
4444
|
+
showChannelInfo: D = !0,
|
|
4436
4445
|
onParticipantNameClick: O,
|
|
4437
4446
|
composerInput: z
|
|
4438
4447
|
}) => {
|
|
4439
4448
|
var _, R, H, q;
|
|
4440
|
-
const { channel: y } =
|
|
4449
|
+
const { channel: y } = le(), { client: A } = oe(), E = U.useMemo(
|
|
4441
4450
|
() => {
|
|
4442
4451
|
var Y;
|
|
4443
4452
|
return Ue(
|
|
@@ -4451,17 +4460,17 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4451
4460
|
var W;
|
|
4452
4461
|
const Y = A == null ? void 0 : A.userID;
|
|
4453
4462
|
return Y ? Object.values(((W = y.state) == null ? void 0 : W.members) || {}).find((Z) => {
|
|
4454
|
-
var
|
|
4455
|
-
return ((
|
|
4463
|
+
var de;
|
|
4464
|
+
return ((de = Z.user) == null ? void 0 : de.id) === Y;
|
|
4456
4465
|
}) : void 0;
|
|
4457
4466
|
}, [A == null ? void 0 : A.userID, (R = y.state) == null ? void 0 : R.members]), I = ((H = C == null ? void 0 : C.user) == null ? void 0 : H.is_account) ?? (C == null ? void 0 : C.is_account), $ = ((q = E == null ? void 0 : E.user) == null ? void 0 : q.is_account) ?? (E == null ? void 0 : E.is_account), F = M && I === !1 && $ === !0, V = y.state.messages.some(
|
|
4458
4467
|
(Y) => Y.type !== "deleted"
|
|
4459
4468
|
), Q = f ? /* @__PURE__ */ s(U.Fragment, { children: f() }, "lt-channel-banner") : null, te = O ? /* @__PURE__ */ s(
|
|
4460
|
-
|
|
4469
|
+
pa,
|
|
4461
4470
|
{
|
|
4462
4471
|
onBack: e,
|
|
4463
4472
|
showBackButton: t,
|
|
4464
|
-
showChannelInfo:
|
|
4473
|
+
showChannelInfo: D,
|
|
4465
4474
|
showStarButton: w,
|
|
4466
4475
|
dmAgentEnabled: F,
|
|
4467
4476
|
onLeaveConversation: i,
|
|
@@ -4478,33 +4487,33 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4478
4487
|
}
|
|
4479
4488
|
) : null, X = J(
|
|
4480
4489
|
(Y) => {
|
|
4481
|
-
const { message: j } =
|
|
4490
|
+
const { message: j } = _e("ChannelView"), W = /* @__PURE__ */ s(
|
|
4482
4491
|
Ni,
|
|
4483
4492
|
{
|
|
4484
4493
|
...Y,
|
|
4485
4494
|
chatbotVotingEnabled: b,
|
|
4486
|
-
viewerLanguage:
|
|
4495
|
+
viewerLanguage: L
|
|
4487
4496
|
}
|
|
4488
4497
|
);
|
|
4489
4498
|
return !T || !j ? W : T(W, j);
|
|
4490
4499
|
},
|
|
4491
|
-
[b, T,
|
|
4500
|
+
[b, T, L]
|
|
4492
4501
|
);
|
|
4493
4502
|
return /* @__PURE__ */ s(ee, { children: /* @__PURE__ */ s(
|
|
4494
|
-
|
|
4503
|
+
Sn,
|
|
4495
4504
|
{
|
|
4496
4505
|
overrides: {
|
|
4497
4506
|
Message: X,
|
|
4498
4507
|
MessageActions: Ci
|
|
4499
4508
|
},
|
|
4500
|
-
children: /* @__PURE__ */ m(
|
|
4509
|
+
children: /* @__PURE__ */ m(En, { children: [
|
|
4501
4510
|
!O && /* @__PURE__ */ m(ee, { children: [
|
|
4502
4511
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4503
4512
|
Yi,
|
|
4504
4513
|
{
|
|
4505
4514
|
onBack: e,
|
|
4506
4515
|
showBackButton: t,
|
|
4507
|
-
showChannelInfo:
|
|
4516
|
+
showChannelInfo: D,
|
|
4508
4517
|
showStarButton: w,
|
|
4509
4518
|
dmAgentEnabled: F,
|
|
4510
4519
|
onLeaveConversation: i,
|
|
@@ -4531,7 +4540,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4531
4540
|
{
|
|
4532
4541
|
className: "flex-1 overflow-hidden relative",
|
|
4533
4542
|
children: /* @__PURE__ */ s(
|
|
4534
|
-
|
|
4543
|
+
In,
|
|
4535
4544
|
{
|
|
4536
4545
|
head: O && V ? /* @__PURE__ */ m("div", { className: "sticky top-0 z-10", children: [
|
|
4537
4546
|
te,
|
|
@@ -4561,7 +4570,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4561
4570
|
] })
|
|
4562
4571
|
}
|
|
4563
4572
|
) });
|
|
4564
|
-
},
|
|
4573
|
+
}, $s = U.memo(
|
|
4565
4574
|
({
|
|
4566
4575
|
channel: e,
|
|
4567
4576
|
onBack: t,
|
|
@@ -4586,8 +4595,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4586
4595
|
onMessageSent: S,
|
|
4587
4596
|
showStarButton: T = !1,
|
|
4588
4597
|
chatbotVotingEnabled: M = !1,
|
|
4589
|
-
renderChannelBanner:
|
|
4590
|
-
renderHeaderTitleBadges:
|
|
4598
|
+
renderChannelBanner: L,
|
|
4599
|
+
renderHeaderTitleBadges: D,
|
|
4591
4600
|
customChannelActions: O,
|
|
4592
4601
|
renderChannelActions: z,
|
|
4593
4602
|
renderMessage: y,
|
|
@@ -4626,7 +4635,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4626
4635
|
const _ = (R) => {
|
|
4627
4636
|
const H = R.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4628
4637
|
if (!Y) return;
|
|
4629
|
-
const j = q == null ? void 0 : q.closest("[data-message-id]"), W = j == null ? void 0 : j.getAttribute("data-message-id"), Z = W ? e.state.messages.find((
|
|
4638
|
+
const j = q == null ? void 0 : q.closest("[data-message-id]"), W = j == null ? void 0 : j.getAttribute("data-message-id"), Z = W ? e.state.messages.find((de) => de.id === W) : void 0;
|
|
4630
4639
|
A(Y, Z);
|
|
4631
4640
|
};
|
|
4632
4641
|
return X.addEventListener("click", _), () => X.removeEventListener("click", _);
|
|
@@ -4638,14 +4647,14 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4638
4647
|
"messaging-channel-view h-full flex flex-col",
|
|
4639
4648
|
d
|
|
4640
4649
|
),
|
|
4641
|
-
children: /* @__PURE__ */ s(
|
|
4642
|
-
|
|
4650
|
+
children: /* @__PURE__ */ s(Os.Provider, { value: x ?? !1, children: /* @__PURE__ */ s(
|
|
4651
|
+
Cn,
|
|
4643
4652
|
{
|
|
4644
4653
|
channel: e,
|
|
4645
4654
|
MessageSystem: ji,
|
|
4646
4655
|
EmptyStateIndicator: u,
|
|
4647
4656
|
LoadingIndicator: je,
|
|
4648
|
-
DateSeparator:
|
|
4657
|
+
DateSeparator: ba,
|
|
4649
4658
|
TypingIndicator: Ui,
|
|
4650
4659
|
doSendMessageRequest: Q,
|
|
4651
4660
|
...E ? { SendButton: E } : {},
|
|
@@ -4672,8 +4681,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4672
4681
|
showStarButton: T,
|
|
4673
4682
|
dmAgentEnabled: x,
|
|
4674
4683
|
chatbotVotingEnabled: M,
|
|
4675
|
-
renderChannelBanner:
|
|
4676
|
-
renderHeaderTitleBadges:
|
|
4684
|
+
renderChannelBanner: L,
|
|
4685
|
+
renderHeaderTitleBadges: D,
|
|
4677
4686
|
customChannelActions: O,
|
|
4678
4687
|
renderChannelActions: z,
|
|
4679
4688
|
renderMessage: y,
|
|
@@ -4689,8 +4698,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4689
4698
|
);
|
|
4690
4699
|
}
|
|
4691
4700
|
);
|
|
4692
|
-
|
|
4693
|
-
const
|
|
4701
|
+
$s.displayName = "ChannelView";
|
|
4702
|
+
const ke = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ m("div", { className: "text-center max-w-sm", children: [
|
|
4694
4703
|
/* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
4695
4704
|
/* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4696
4705
|
/* @__PURE__ */ s("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4704,7 +4713,7 @@ const ye = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4704
4713
|
}
|
|
4705
4714
|
)
|
|
4706
4715
|
] }) }));
|
|
4707
|
-
|
|
4716
|
+
ke.displayName = "ErrorState";
|
|
4708
4717
|
const fl = ({
|
|
4709
4718
|
capabilities: e = {},
|
|
4710
4719
|
renderMessageInputActions: t,
|
|
@@ -4731,14 +4740,14 @@ const fl = ({
|
|
|
4731
4740
|
composerInput: M
|
|
4732
4741
|
}) => {
|
|
4733
4742
|
const {
|
|
4734
|
-
client:
|
|
4735
|
-
isConnected:
|
|
4743
|
+
client: L,
|
|
4744
|
+
isConnected: D,
|
|
4736
4745
|
isLoading: O,
|
|
4737
4746
|
error: z,
|
|
4738
4747
|
refreshConnection: y,
|
|
4739
4748
|
service: A,
|
|
4740
4749
|
debug: E
|
|
4741
|
-
} =
|
|
4750
|
+
} = sa(), [C, I] = B(null), [$, F] = B(null), [V, Q] = B(!1), { showDeleteConversation: te = !0 } = e, X = G(l);
|
|
4742
4751
|
X.current = l;
|
|
4743
4752
|
const _ = G(a);
|
|
4744
4753
|
_.current = a;
|
|
@@ -4746,8 +4755,8 @@ const fl = ({
|
|
|
4746
4755
|
K(() => {
|
|
4747
4756
|
H.current = C;
|
|
4748
4757
|
}, [C]), K(() => {
|
|
4749
|
-
if (!
|
|
4750
|
-
const j =
|
|
4758
|
+
if (!L || !D) return;
|
|
4759
|
+
const j = L.userID;
|
|
4751
4760
|
if (!j) return;
|
|
4752
4761
|
const W = `${j}::${i}`;
|
|
4753
4762
|
if (R.current === W) return;
|
|
@@ -4756,13 +4765,13 @@ const fl = ({
|
|
|
4756
4765
|
R.current === W && (R.current = null);
|
|
4757
4766
|
};
|
|
4758
4767
|
(async () => {
|
|
4759
|
-
var
|
|
4768
|
+
var De, Le;
|
|
4760
4769
|
try {
|
|
4761
4770
|
E && console.log(
|
|
4762
4771
|
"[MessagingShell] Loading initial conversation with:",
|
|
4763
4772
|
i
|
|
4764
4773
|
);
|
|
4765
|
-
const
|
|
4774
|
+
const ae = await L.queryChannels(
|
|
4766
4775
|
{
|
|
4767
4776
|
type: "messaging",
|
|
4768
4777
|
members: { $eq: [j, i] }
|
|
@@ -4770,15 +4779,15 @@ const fl = ({
|
|
|
4770
4779
|
{},
|
|
4771
4780
|
{ limit: 1 }
|
|
4772
4781
|
);
|
|
4773
|
-
if (
|
|
4774
|
-
I(
|
|
4782
|
+
if (ae.length > 0) {
|
|
4783
|
+
I(ae[0]), F(null), (De = _.current) == null || De.call(_, ae[0]), E && console.log(
|
|
4775
4784
|
"[MessagingShell] Initial conversation loaded:",
|
|
4776
|
-
|
|
4785
|
+
ae[0].id
|
|
4777
4786
|
);
|
|
4778
4787
|
return;
|
|
4779
4788
|
}
|
|
4780
|
-
const
|
|
4781
|
-
if (!
|
|
4789
|
+
const ue = X.current;
|
|
4790
|
+
if (!ue || !A) {
|
|
4782
4791
|
Z(), F("No conversation found with this account"), E && console.log(
|
|
4783
4792
|
"[MessagingShell] No conversation found for:",
|
|
4784
4793
|
i
|
|
@@ -4787,11 +4796,11 @@ const fl = ({
|
|
|
4787
4796
|
}
|
|
4788
4797
|
try {
|
|
4789
4798
|
const ie = await A.startChannelWithParticipant({
|
|
4790
|
-
id:
|
|
4791
|
-
name:
|
|
4792
|
-
phone:
|
|
4799
|
+
id: ue.id,
|
|
4800
|
+
name: ue.name,
|
|
4801
|
+
phone: ue.phone
|
|
4793
4802
|
});
|
|
4794
|
-
I(ie), F(null), (
|
|
4803
|
+
I(ie), F(null), (Le = _.current) == null || Le.call(_, ie), E && console.log(
|
|
4795
4804
|
"[MessagingShell] Channel created and loaded:",
|
|
4796
4805
|
ie.id
|
|
4797
4806
|
);
|
|
@@ -4801,28 +4810,28 @@ const fl = ({
|
|
|
4801
4810
|
ie
|
|
4802
4811
|
), Z(), F("Failed to create conversation");
|
|
4803
4812
|
}
|
|
4804
|
-
} catch (
|
|
4813
|
+
} catch (ae) {
|
|
4805
4814
|
console.error(
|
|
4806
4815
|
"[MessagingShell] Failed to load initial conversation:",
|
|
4807
|
-
|
|
4816
|
+
ae
|
|
4808
4817
|
), Z(), H.current || F("Failed to load conversation");
|
|
4809
4818
|
}
|
|
4810
4819
|
})();
|
|
4811
|
-
}, [i,
|
|
4820
|
+
}, [i, L, D, A, E]);
|
|
4812
4821
|
const q = G(r);
|
|
4813
4822
|
q.current = r;
|
|
4814
4823
|
const Y = J(() => {
|
|
4815
4824
|
var j;
|
|
4816
4825
|
I(null), Q(!0), (j = q.current) == null || j.call(q);
|
|
4817
4826
|
}, []);
|
|
4818
|
-
return O ? /* @__PURE__ */ s(je, {}) : z ? /* @__PURE__ */ s(
|
|
4819
|
-
|
|
4827
|
+
return O ? /* @__PURE__ */ s(je, {}) : z ? /* @__PURE__ */ s(ke, { message: z, onBack: y }) : !D || !L ? /* @__PURE__ */ s(
|
|
4828
|
+
ke,
|
|
4820
4829
|
{
|
|
4821
4830
|
message: "Not connected to messaging service",
|
|
4822
4831
|
onBack: y
|
|
4823
4832
|
}
|
|
4824
|
-
) : $ ? /* @__PURE__ */ s(
|
|
4825
|
-
|
|
4833
|
+
) : $ ? /* @__PURE__ */ s(ke, { message: $ }) : V && !C ? /* @__PURE__ */ s(ke, { message: "Conversation ended" }) : C ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
|
|
4834
|
+
$s,
|
|
4826
4835
|
{
|
|
4827
4836
|
channel: C,
|
|
4828
4837
|
renderMessageInputActions: t,
|
|
@@ -4856,7 +4865,7 @@ function Wi(e) {
|
|
|
4856
4865
|
for (const n of t)
|
|
4857
4866
|
e.state.addMessageSorted(n.message);
|
|
4858
4867
|
}
|
|
4859
|
-
const
|
|
4868
|
+
const js = U.createContext({
|
|
4860
4869
|
selectedChannel: void 0,
|
|
4861
4870
|
onChannelSelect: () => {
|
|
4862
4871
|
},
|
|
@@ -4864,7 +4873,7 @@ const $s = U.createContext({
|
|
|
4864
4873
|
renderMessagePreview: void 0,
|
|
4865
4874
|
channelPreview: void 0,
|
|
4866
4875
|
viewerLanguage: void 0
|
|
4867
|
-
}), Xi =
|
|
4876
|
+
}), Xi = js.Provider, Ki = () => U.useContext(js), Ji = (e, t) => {
|
|
4868
4877
|
const n = new Date(
|
|
4869
4878
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4870
4879
|
), r = new Date(
|
|
@@ -4885,9 +4894,9 @@ const $s = U.createContext({
|
|
|
4885
4894
|
day: "numeric",
|
|
4886
4895
|
year: "2-digit"
|
|
4887
4896
|
});
|
|
4888
|
-
},
|
|
4897
|
+
}, Bs = U.memo(
|
|
4889
4898
|
(e) => {
|
|
4890
|
-
var
|
|
4899
|
+
var D, O, z;
|
|
4891
4900
|
const { channel: t, unread: n } = e, {
|
|
4892
4901
|
selectedChannel: a,
|
|
4893
4902
|
onChannelSelect: r,
|
|
@@ -4895,7 +4904,7 @@ const $s = U.createContext({
|
|
|
4895
4904
|
channelPreview: l,
|
|
4896
4905
|
renderMessagePreview: o,
|
|
4897
4906
|
viewerLanguage: d
|
|
4898
|
-
} = Ki(), { client: u } =
|
|
4907
|
+
} = Ki(), { client: u } = oe(), p = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = ot(t);
|
|
4899
4908
|
if (l)
|
|
4900
4909
|
return /* @__PURE__ */ s(
|
|
4901
4910
|
l,
|
|
@@ -4913,10 +4922,10 @@ const $s = U.createContext({
|
|
|
4913
4922
|
const A = y.key === "Enter" || y.key === " ", E = y.repeat;
|
|
4914
4923
|
!A || E || (y.preventDefault(), g());
|
|
4915
4924
|
}, v = Ue(
|
|
4916
|
-
(
|
|
4925
|
+
(D = t == null ? void 0 : t.state) == null ? void 0 : D.members,
|
|
4917
4926
|
u == null ? void 0 : u.userID,
|
|
4918
4927
|
t == null ? void 0 : t.type
|
|
4919
|
-
), w =
|
|
4928
|
+
), w = ct(v == null ? void 0 : v.user), b = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, f = (() => {
|
|
4920
4929
|
var A;
|
|
4921
4930
|
const y = (A = t == null ? void 0 : t.state) == null ? void 0 : A.messages;
|
|
4922
4931
|
if (y != null && y.length) {
|
|
@@ -4925,7 +4934,7 @@ const $s = U.createContext({
|
|
|
4925
4934
|
}
|
|
4926
4935
|
})(), N = (() => {
|
|
4927
4936
|
var $, F, V, Q;
|
|
4928
|
-
const y =
|
|
4937
|
+
const y = hs({
|
|
4929
4938
|
message: f,
|
|
4930
4939
|
viewerLanguage: d
|
|
4931
4940
|
});
|
|
@@ -4936,12 +4945,12 @@ const $s = U.createContext({
|
|
|
4936
4945
|
if (y) return y;
|
|
4937
4946
|
const I = (Q = f == null ? void 0 : f.attachments) == null ? void 0 : Q[0];
|
|
4938
4947
|
return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4939
|
-
})(), S = f != null && f.created_at ? Zi(new Date(f.created_at)) : "", T = f ? Fe(f) : !1, M = o ? o(f, N) : `${T ? "✨ " : ""}${N}`,
|
|
4948
|
+
})(), S = f != null && f.created_at ? Zi(new Date(f.created_at)) : "", T = f ? Fe(f) : !1, M = o ? o(f, N) : `${T ? "✨ " : ""}${N}`, L = n ?? 0;
|
|
4940
4949
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4941
4950
|
channelId: t == null ? void 0 : t.id,
|
|
4942
4951
|
isSelected: p,
|
|
4943
4952
|
participantName: w,
|
|
4944
|
-
unreadCount:
|
|
4953
|
+
unreadCount: L,
|
|
4945
4954
|
hasTimestamp: !!S
|
|
4946
4955
|
}), /* @__PURE__ */ s(
|
|
4947
4956
|
"div",
|
|
@@ -4960,7 +4969,7 @@ const $s = U.createContext({
|
|
|
4960
4969
|
"data-dd-privacy": "mask",
|
|
4961
4970
|
children: /* @__PURE__ */ m("div", { className: "flex items-start gap-4", children: [
|
|
4962
4971
|
/* @__PURE__ */ s(
|
|
4963
|
-
|
|
4972
|
+
ne,
|
|
4964
4973
|
{
|
|
4965
4974
|
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || t.id || "unknown",
|
|
4966
4975
|
name: w,
|
|
@@ -4987,7 +4996,7 @@ const $s = U.createContext({
|
|
|
4987
4996
|
] }),
|
|
4988
4997
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4989
4998
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
4990
|
-
|
|
4999
|
+
L > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: L > 99 ? "99+" : L })
|
|
4991
5000
|
] })
|
|
4992
5001
|
] })
|
|
4993
5002
|
] })
|
|
@@ -4995,7 +5004,7 @@ const $s = U.createContext({
|
|
|
4995
5004
|
);
|
|
4996
5005
|
}
|
|
4997
5006
|
);
|
|
4998
|
-
|
|
5007
|
+
Bs.displayName = "CustomChannelPreview";
|
|
4999
5008
|
const Qi = { last_message_at: -1 }, el = U.memo(
|
|
5000
5009
|
({
|
|
5001
5010
|
onChannelSelect: e,
|
|
@@ -5006,14 +5015,14 @@ const Qi = { last_message_at: -1 }, el = U.memo(
|
|
|
5006
5015
|
sort: i = Qi,
|
|
5007
5016
|
className: l,
|
|
5008
5017
|
customEmptyStateIndicator: o,
|
|
5009
|
-
channelListPaginator: d =
|
|
5018
|
+
channelListPaginator: d = An,
|
|
5010
5019
|
channelPreview: u,
|
|
5011
5020
|
renderMessagePreview: p,
|
|
5012
5021
|
viewerLanguage: h
|
|
5013
5022
|
}) => {
|
|
5014
5023
|
const g = U.useRef(0);
|
|
5015
5024
|
g.current++;
|
|
5016
|
-
const { debug: c = !1 } =
|
|
5025
|
+
const { debug: c = !1 } = lt(), v = U.useCallback(
|
|
5017
5026
|
(b) => {
|
|
5018
5027
|
for (const f of b)
|
|
5019
5028
|
Wi(f);
|
|
@@ -5052,7 +5061,7 @@ const Qi = { last_message_at: -1 }, el = U.memo(
|
|
|
5052
5061
|
l
|
|
5053
5062
|
),
|
|
5054
5063
|
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Xi, { value: w, children: /* @__PURE__ */ s(
|
|
5055
|
-
|
|
5064
|
+
Tn,
|
|
5056
5065
|
{
|
|
5057
5066
|
filters: n,
|
|
5058
5067
|
sort: i,
|
|
@@ -5060,7 +5069,7 @@ const Qi = { last_message_at: -1 }, el = U.memo(
|
|
|
5060
5069
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
5061
5070
|
channelRenderFilterFn: v,
|
|
5062
5071
|
Paginator: d,
|
|
5063
|
-
Preview:
|
|
5072
|
+
Preview: Bs,
|
|
5064
5073
|
EmptyStateIndicator: o
|
|
5065
5074
|
},
|
|
5066
5075
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -5104,7 +5113,7 @@ const tl = ({
|
|
|
5104
5113
|
const o = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
|
|
5105
5114
|
return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ m("div", { className: "flex gap-3 items-end", children: [
|
|
5106
5115
|
(i || l) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
|
|
5107
|
-
|
|
5116
|
+
ne,
|
|
5108
5117
|
{
|
|
5109
5118
|
id: l || "account",
|
|
5110
5119
|
name: l || "Account",
|
|
@@ -5135,40 +5144,40 @@ const tl = ({
|
|
|
5135
5144
|
] }) });
|
|
5136
5145
|
};
|
|
5137
5146
|
export {
|
|
5138
|
-
|
|
5147
|
+
bs as A,
|
|
5139
5148
|
hl as B,
|
|
5140
5149
|
Gi as C,
|
|
5141
|
-
|
|
5142
|
-
|
|
5150
|
+
Br as D,
|
|
5151
|
+
xa as E,
|
|
5143
5152
|
gl as F,
|
|
5144
|
-
|
|
5145
|
-
|
|
5153
|
+
sa as G,
|
|
5154
|
+
es as L,
|
|
5146
5155
|
ul as M,
|
|
5147
|
-
|
|
5148
|
-
|
|
5156
|
+
Ne as a,
|
|
5157
|
+
ne as b,
|
|
5149
5158
|
el as c,
|
|
5150
|
-
|
|
5159
|
+
$s as d,
|
|
5151
5160
|
ml as e,
|
|
5152
5161
|
tl as f,
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5162
|
+
ce as g,
|
|
5163
|
+
Zt as h,
|
|
5164
|
+
ye as i,
|
|
5165
|
+
qr as j,
|
|
5157
5166
|
dl as k,
|
|
5158
5167
|
fl as l,
|
|
5159
|
-
|
|
5160
|
-
|
|
5168
|
+
rr as m,
|
|
5169
|
+
sr as n,
|
|
5161
5170
|
Zi as o,
|
|
5162
|
-
|
|
5163
|
-
|
|
5171
|
+
ar as p,
|
|
5172
|
+
hs as q,
|
|
5164
5173
|
we as r,
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5174
|
+
ws as s,
|
|
5175
|
+
ia as t,
|
|
5176
|
+
Xa as u,
|
|
5177
|
+
wa as v,
|
|
5169
5178
|
Ue as w,
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5179
|
+
ht as x,
|
|
5180
|
+
ft as y,
|
|
5181
|
+
ct as z
|
|
5173
5182
|
};
|
|
5174
|
-
//# sourceMappingURL=index-
|
|
5183
|
+
//# sourceMappingURL=index-wFe1UO9t.js.map
|