@linktr.ee/messaging-react 3.15.0 → 3.15.1-rc-1784866707
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-U1PmVIQ9.cjs → Card-BZ5QF2gm.cjs} +2 -2
- package/dist/{Card-U1PmVIQ9.cjs.map → Card-BZ5QF2gm.cjs.map} +1 -1
- package/dist/{Card-CjyK4Spa.js → Card-DldMwIcO.js} +2 -2
- package/dist/{Card-CjyK4Spa.js.map → Card-DldMwIcO.js.map} +1 -1
- package/dist/{index-DdVzOymJ.js → index-BOThiuy9.js} +161 -157
- package/dist/index-BOThiuy9.js.map +1 -0
- package/dist/{index-NcnnPWrl.cjs → index-stv1fd7v.cjs} +2 -2
- package/dist/index-stv1fd7v.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessageInput/index.tsx +11 -2
- package/src/utils/isIOS.test.ts +54 -0
- package/src/utils/isIOS.ts +19 -0
- package/dist/index-DdVzOymJ.js.map +0 -1
- package/dist/index-NcnnPWrl.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as s, jsxs as h, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import j, { createContext as st, useContext as ye, useCallback as W, useState as F, useRef as G, useEffect as Y, useId as js, useMemo as se, Suspense as Vs } from "react";
|
|
3
3
|
import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
|
|
4
|
-
import { StreamChat as Hs, LinkPreviewsManager as
|
|
4
|
+
import { StreamChat as Hs, LinkPreviewsManager as zt } from "stream-chat";
|
|
5
5
|
import { Chat as Ys, useChannelStateContext as ue, useChatContext as ke, DateSeparator as qs, MessageStatus as Ws, useMessageContext as pe, MessageErrorIcon as Ze, MessageText as Le, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as es, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as on, messageHasReactions as ln, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as Ft, useMessageInputContext as pn, useMessageComposerHasSendableData as bn, AttachmentPreviewList as vn, QuotedMessagePreview as xn, TextareaComposer as wn, MessageTimestamp as Ve, AIStates as Ge, useTypingContext as _n, useAIState as Nn, Channel as yn, WithComponents as kn, Window as Cn, MessageList as Bt, ChannelList as Sn, InfiniteScroll as En } from "stream-chat-react";
|
|
6
6
|
import y from "classnames";
|
|
7
|
-
import { StarIcon as Je, DotsThreeIcon as In, SpinnerGapIcon as Ae, SignOutIcon as Tn, ProhibitInsetIcon as $t, FlagIcon as ts, CurrencyDollarIcon as Mn, CaretRightIcon as ss, ArrowLeftIcon as An, FileIcon as ns, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as as, FileMdIcon as Dn, FileTextIcon as Pn, FileZipIcon as
|
|
7
|
+
import { StarIcon as Je, DotsThreeIcon as In, SpinnerGapIcon as Ae, SignOutIcon as Tn, ProhibitInsetIcon as $t, FlagIcon as ts, CurrencyDollarIcon as Mn, CaretRightIcon as ss, ArrowLeftIcon as An, FileIcon as ns, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as as, FileMdIcon as Dn, FileTextIcon as Pn, FileZipIcon as On, FilePptIcon as zn, FileCsvIcon as Fn, FileXlsIcon as Bn, FileDocIcon as $n, FilePdfIcon as Un, CircleNotchIcon as _e, PlayIcon as Qe, PauseIcon as jn, LinkIcon as Vn, DownloadSimpleIcon as Ne, XIcon as Be, CaretLeftIcon as Gn, GiftIcon as Hn, ThumbsUpIcon as Yn, ThumbsDownIcon as qn, ChecksIcon as Wn, PencilSimpleIcon as Xn, TrashSimpleIcon as Kn, ArrowUpIcon as Zn, SparkleIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
|
|
8
8
|
import { MessageActions as ea, DefaultDropdownActionButton as rs } from "stream-chat-react/experimental";
|
|
9
9
|
const is = st({
|
|
10
10
|
service: null,
|
|
@@ -16,7 +16,7 @@ const is = st({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), nt = () => ye(is),
|
|
19
|
+
}), nt = () => ye(is), go = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -47,9 +47,9 @@ const is = st({
|
|
|
47
47
|
apiKey: a,
|
|
48
48
|
serviceConfig: n,
|
|
49
49
|
capabilities: r
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
renderCount:
|
|
50
|
+
}), z = G(0);
|
|
51
|
+
z.current++, o("📊 RENDER INFO", {
|
|
52
|
+
renderCount: z.current,
|
|
53
53
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
54
54
|
propChanges: {
|
|
55
55
|
userChanged: A.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -65,14 +65,14 @@ const is = st({
|
|
|
65
65
|
};
|
|
66
66
|
const B = G(null);
|
|
67
67
|
!l && a && ((N = B.current) == null ? void 0 : N.apiKey) !== a && (B.current = { apiKey: a, client: new Hs(a) });
|
|
68
|
-
const
|
|
68
|
+
const O = l || (a ? ((M = B.current) == null ? void 0 : M.client) ?? null : null);
|
|
69
69
|
Y(() => {
|
|
70
|
-
const E =
|
|
70
|
+
const E = z.current, D = k.current;
|
|
71
71
|
if (l) {
|
|
72
72
|
S.current = null, u(null), m(null), c(!1), b(null), w(!1);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (!a || !
|
|
75
|
+
if (!a || !O || !D) {
|
|
76
76
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
77
77
|
renderCount: E,
|
|
78
78
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -87,13 +87,13 @@ const is = st({
|
|
|
87
87
|
...D,
|
|
88
88
|
apiKey: a,
|
|
89
89
|
debug: R.current,
|
|
90
|
-
client:
|
|
90
|
+
client: O
|
|
91
91
|
});
|
|
92
92
|
S.current = H, u(H), o("✅ SERVICE SET", {
|
|
93
93
|
renderCount: E,
|
|
94
94
|
serviceInstance: !!H
|
|
95
95
|
});
|
|
96
|
-
}, [a,
|
|
96
|
+
}, [a, O, l]);
|
|
97
97
|
const L = G(null);
|
|
98
98
|
Y(() => {
|
|
99
99
|
var D, H;
|
|
@@ -144,12 +144,12 @@ const is = st({
|
|
|
144
144
|
}
|
|
145
145
|
})();
|
|
146
146
|
}, [d, t, o, f, l]), Y(() => {
|
|
147
|
-
const E =
|
|
147
|
+
const E = O;
|
|
148
148
|
return () => {
|
|
149
149
|
var D;
|
|
150
150
|
E && (L.current = null, (D = S.current) == null || D.disconnectUser().catch(console.error));
|
|
151
151
|
};
|
|
152
|
-
}, [
|
|
152
|
+
}, [O]);
|
|
153
153
|
const C = W(async () => {
|
|
154
154
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
155
155
|
hasService: !!d,
|
|
@@ -211,13 +211,13 @@ const is = st({
|
|
|
211
211
|
o
|
|
212
212
|
]);
|
|
213
213
|
return o("🔄 RENDER END", {
|
|
214
|
-
renderCount:
|
|
215
|
-
willRenderChat: !!
|
|
214
|
+
renderCount: z.current,
|
|
215
|
+
willRenderChat: !!O,
|
|
216
216
|
contextValueReady: !!I
|
|
217
|
-
}), /* @__PURE__ */ s(is.Provider, { value: I, children:
|
|
217
|
+
}), /* @__PURE__ */ s(is.Provider, { value: I, children: O ? /* @__PURE__ */ s(
|
|
218
218
|
Ys,
|
|
219
219
|
{
|
|
220
|
-
client:
|
|
220
|
+
client: O,
|
|
221
221
|
customClasses: {
|
|
222
222
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
223
223
|
},
|
|
@@ -408,7 +408,7 @@ const be = ({
|
|
|
408
408
|
logLabel: g = "useChannelModerationActions"
|
|
409
409
|
}) => {
|
|
410
410
|
var I;
|
|
411
|
-
const { service: m, debug: f } = nt(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, v = !!(a && n && m && c), [w, p] = F(!1), [b, x] = F(null), [S, k] = F(!1), [R, A] = F(!1),
|
|
411
|
+
const { service: m, debug: f } = nt(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, v = !!(a && n && m && c), [w, p] = F(!1), [b, x] = F(null), [S, k] = F(!1), [R, A] = F(!1), z = v && ((b == null ? void 0 : b.participantId) !== c || (b == null ? void 0 : b.service) !== m);
|
|
412
412
|
return Y(() => {
|
|
413
413
|
if (!v || !m || !c) {
|
|
414
414
|
p(!1), x(null);
|
|
@@ -434,7 +434,7 @@ const be = ({
|
|
|
434
434
|
};
|
|
435
435
|
}, [v, m, c, g]), {
|
|
436
436
|
isParticipantBlocked: w,
|
|
437
|
-
isCheckingBlockedStatus:
|
|
437
|
+
isCheckingBlockedStatus: z,
|
|
438
438
|
isLeaving: S,
|
|
439
439
|
isUpdatingBlockStatus: R,
|
|
440
440
|
handleLeaveConversation: async () => {
|
|
@@ -519,7 +519,7 @@ const be = ({
|
|
|
519
519
|
isUpdatingBlockStatus: k,
|
|
520
520
|
handleLeaveConversation: R,
|
|
521
521
|
handleBlockUser: A,
|
|
522
|
-
handleUnblockUser:
|
|
522
|
+
handleUnblockUser: z,
|
|
523
523
|
handleReportUser: B
|
|
524
524
|
} = da({
|
|
525
525
|
channel: e,
|
|
@@ -592,7 +592,7 @@ const be = ({
|
|
|
592
592
|
) : b ? /* @__PURE__ */ h(
|
|
593
593
|
ve,
|
|
594
594
|
{
|
|
595
|
-
onClick:
|
|
595
|
+
onClick: z,
|
|
596
596
|
disabled: k,
|
|
597
597
|
"aria-busy": k,
|
|
598
598
|
children: [
|
|
@@ -639,7 +639,7 @@ const be = ({
|
|
|
639
639
|
showChannelInfo: v = !0,
|
|
640
640
|
onParticipantNameClick: w
|
|
641
641
|
}) => {
|
|
642
|
-
var
|
|
642
|
+
var O, L, C, I;
|
|
643
643
|
const { channel: p } = ue(), { client: b } = ke(), x = j.useMemo(
|
|
644
644
|
() => {
|
|
645
645
|
var N;
|
|
@@ -649,8 +649,8 @@ const be = ({
|
|
|
649
649
|
p.type
|
|
650
650
|
);
|
|
651
651
|
},
|
|
652
|
-
[(
|
|
653
|
-
), S = cs(x == null ? void 0 : x.user), k = (L = x == null ? void 0 : x.user) == null ? void 0 : L.image, R = os(p), A = ha((C = p.data) == null ? void 0 : C.customer_tag) && (x == null ? void 0 : x.is_follower) === !0,
|
|
652
|
+
[(O = p.state) == null ? void 0 : O.members, b == null ? void 0 : b.userID, p.type]
|
|
653
|
+
), S = cs(x == null ? void 0 : x.user), k = (L = x == null ? void 0 : x.user) == null ? void 0 : L.image, R = os(p), A = ha((C = p.data) == null ? void 0 : C.customer_tag) && (x == null ? void 0 : x.is_follower) === !0, z = async () => {
|
|
654
654
|
try {
|
|
655
655
|
R ? await p.unpin() : await p.pin();
|
|
656
656
|
} catch (N) {
|
|
@@ -738,7 +738,7 @@ const be = ({
|
|
|
738
738
|
"button",
|
|
739
739
|
{
|
|
740
740
|
className: He,
|
|
741
|
-
onClick:
|
|
741
|
+
onClick: z,
|
|
742
742
|
type: "button",
|
|
743
743
|
"aria-pressed": R,
|
|
744
744
|
"aria-label": R ? "Unstar conversation" : "Star conversation",
|
|
@@ -867,8 +867,8 @@ const ya = {
|
|
|
867
867
|
doc: $n,
|
|
868
868
|
xls: Bn,
|
|
869
869
|
csv: Fn,
|
|
870
|
-
ppt:
|
|
871
|
-
zip:
|
|
870
|
+
ppt: zn,
|
|
871
|
+
zip: On,
|
|
872
872
|
text: Pn,
|
|
873
873
|
markdown: Dn,
|
|
874
874
|
generic: ns
|
|
@@ -895,7 +895,7 @@ const Sa = (e) => {
|
|
|
895
895
|
muted: d = !1,
|
|
896
896
|
onContainerClick: u
|
|
897
897
|
}) => {
|
|
898
|
-
const g = oe(t), m = G(null), f = G(null), c = G(null), v = G(r), [w, p] = F(a), [b, x] = F(0), [S, k] = F(!1), [R, A] = F(!1), [
|
|
898
|
+
const g = oe(t), m = G(null), f = G(null), c = G(null), v = G(r), [w, p] = F(a), [b, x] = F(0), [S, k] = F(!1), [R, A] = F(!1), [z, B] = F(!1), [O, L] = F(!1), [C, I] = F(!0), [N, M] = F(null), E = W(() => {
|
|
899
899
|
B(!1), p(!0);
|
|
900
900
|
}, []), D = W((_) => {
|
|
901
901
|
const T = f.current;
|
|
@@ -954,7 +954,7 @@ const Sa = (e) => {
|
|
|
954
954
|
u(_);
|
|
955
955
|
return;
|
|
956
956
|
}
|
|
957
|
-
|
|
957
|
+
z || l && p((T) => !T);
|
|
958
958
|
},
|
|
959
959
|
onKeyDown: (_) => {
|
|
960
960
|
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
@@ -962,7 +962,7 @@ const Sa = (e) => {
|
|
|
962
962
|
u(_);
|
|
963
963
|
return;
|
|
964
964
|
}
|
|
965
|
-
|
|
965
|
+
z || l && p((T) => !T);
|
|
966
966
|
}
|
|
967
967
|
},
|
|
968
968
|
children: [
|
|
@@ -1022,14 +1022,14 @@ const Sa = (e) => {
|
|
|
1022
1022
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
1023
1023
|
}
|
|
1024
1024
|
) }),
|
|
1025
|
-
|
|
1025
|
+
O && !z && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
1026
1026
|
_e,
|
|
1027
1027
|
{
|
|
1028
1028
|
className: "size-8 animate-spin text-white/80",
|
|
1029
1029
|
weight: "bold"
|
|
1030
1030
|
}
|
|
1031
1031
|
) }),
|
|
1032
|
-
|
|
1032
|
+
z && !l && /* @__PURE__ */ s(
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
1035
1035
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1446,7 +1446,7 @@ const bs = ({
|
|
|
1446
1446
|
action: /* @__PURE__ */ s(Pa, { url: e, filename: n })
|
|
1447
1447
|
}
|
|
1448
1448
|
);
|
|
1449
|
-
},
|
|
1449
|
+
}, Oa = ({
|
|
1450
1450
|
message: e,
|
|
1451
1451
|
isMyMessage: t = !1
|
|
1452
1452
|
}) => {
|
|
@@ -1478,7 +1478,7 @@ const bs = ({
|
|
|
1478
1478
|
}
|
|
1479
1479
|
)
|
|
1480
1480
|
] });
|
|
1481
|
-
},
|
|
1481
|
+
}, za = ({
|
|
1482
1482
|
message: e
|
|
1483
1483
|
}) => {
|
|
1484
1484
|
const t = it(e);
|
|
@@ -1494,8 +1494,8 @@ const bs = ({
|
|
|
1494
1494
|
return /* @__PURE__ */ s("div", { className: at(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(rt, { attachment: t, isMyMessage: !1 }) });
|
|
1495
1495
|
const n = ot(e);
|
|
1496
1496
|
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
|
|
1497
|
-
},
|
|
1498
|
-
Creator:
|
|
1497
|
+
}, po = Object.assign(Oa, {
|
|
1498
|
+
Creator: za,
|
|
1499
1499
|
Visitor: Fa
|
|
1500
1500
|
}), Ba = {
|
|
1501
1501
|
dark: "bg-[#1e2330]",
|
|
@@ -2657,17 +2657,17 @@ const ar = ({
|
|
|
2657
2657
|
isUnlocking: () => !1
|
|
2658
2658
|
}, Pr = {
|
|
2659
2659
|
LockedAttachment: Dr
|
|
2660
|
-
}, Ms = st({}),
|
|
2661
|
-
function
|
|
2660
|
+
}, Ms = st({}), bo = Ms.Provider;
|
|
2661
|
+
function Or(e) {
|
|
2662
2662
|
return ye(Ms)[e] ?? Pr[e];
|
|
2663
2663
|
}
|
|
2664
|
-
const
|
|
2664
|
+
const zr = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import("./Card-DldMwIcO.js")), Br = () => /* @__PURE__ */ s(
|
|
2665
2665
|
"div",
|
|
2666
2666
|
{
|
|
2667
2667
|
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)]",
|
|
2668
2668
|
"aria-hidden": !0
|
|
2669
2669
|
}
|
|
2670
|
-
), Re = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(
|
|
2670
|
+
), Re = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(zr, { ...e }) : /* @__PURE__ */ s(Fr, { ...e }) }), $r = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2671
2671
|
"svg",
|
|
2672
2672
|
{
|
|
2673
2673
|
width: e,
|
|
@@ -2953,7 +2953,7 @@ const Zr = {
|
|
|
2953
2953
|
if (!t || !e) return !1;
|
|
2954
2954
|
const n = oe(e);
|
|
2955
2955
|
return n === "video" || n === "audio";
|
|
2956
|
-
}, vt = "bg-[#F2F3F4]",
|
|
2956
|
+
}, vt = "bg-[#F2F3F4]", Oe = ({
|
|
2957
2957
|
variant: e,
|
|
2958
2958
|
thumbnailUrl: t,
|
|
2959
2959
|
sourceUrl: n,
|
|
@@ -3052,7 +3052,7 @@ const Zr = {
|
|
|
3052
3052
|
) : void 0;
|
|
3053
3053
|
return c ? /* @__PURE__ */ s(Pe, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3054
3054
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3055
|
-
|
|
3055
|
+
Oe,
|
|
3056
3056
|
{
|
|
3057
3057
|
variant: "dark",
|
|
3058
3058
|
sourceUrl: l,
|
|
@@ -3068,7 +3068,7 @@ const Zr = {
|
|
|
3068
3068
|
topRight: f ? v : void 0,
|
|
3069
3069
|
children: [
|
|
3070
3070
|
!f && /* @__PURE__ */ s(
|
|
3071
|
-
|
|
3071
|
+
Oe,
|
|
3072
3072
|
{
|
|
3073
3073
|
variant: "dark",
|
|
3074
3074
|
thumbnailUrl: i,
|
|
@@ -3124,7 +3124,7 @@ const Zr = {
|
|
|
3124
3124
|
"data-testid": "link-attachment",
|
|
3125
3125
|
children: [
|
|
3126
3126
|
l === "featured" && /* @__PURE__ */ s(
|
|
3127
|
-
|
|
3127
|
+
Oe,
|
|
3128
3128
|
{
|
|
3129
3129
|
variant: "light",
|
|
3130
3130
|
thumbnailUrl: r,
|
|
@@ -3170,7 +3170,7 @@ const Zr = {
|
|
|
3170
3170
|
bgClassName: $e(r, l) ? vt : void 0,
|
|
3171
3171
|
children: [
|
|
3172
3172
|
o === "featured" && /* @__PURE__ */ s(
|
|
3173
|
-
|
|
3173
|
+
Oe,
|
|
3174
3174
|
{
|
|
3175
3175
|
variant: "dark",
|
|
3176
3176
|
thumbnailUrl: i,
|
|
@@ -3477,7 +3477,7 @@ const gi = ({
|
|
|
3477
3477
|
renderText: v,
|
|
3478
3478
|
threadList: w,
|
|
3479
3479
|
viewerLanguage: p
|
|
3480
|
-
} = e, { client: b } = ke("CustomMessage"), { channel: x } = ue("CustomMessage"), { isUnlocking: S, onUnlockClick: k, onFetchSource: R, onDownloadClick: A } =
|
|
3480
|
+
} = e, { client: b } = ke("CustomMessage"), { channel: x } = ue("CustomMessage"), { isUnlocking: S, onUnlockClick: k, onFetchSource: R, onDownloadClick: A } = Or("LockedAttachment"), [z, B] = F(!1), O = Ks(c.id), { selected: L, voteUp: C, voteDown: I } = ba(c), {
|
|
3481
3481
|
Attachment: N = Zs,
|
|
3482
3482
|
EditMessageModal: M = Js,
|
|
3483
3483
|
MessageActions: E,
|
|
@@ -3495,7 +3495,7 @@ const gi = ({
|
|
|
3495
3495
|
), U = se(() => {
|
|
3496
3496
|
const ce = c.attachments ?? [], fe = c.shared_location ? [c.shared_location, ...ce] : ce;
|
|
3497
3497
|
if (!De(c)) return fe;
|
|
3498
|
-
const Pt = fe.filter((
|
|
3498
|
+
const Pt = fe.filter((Ot) => !("type" in Ot) || !ps(Ot));
|
|
3499
3499
|
return Pt.length === fe.length ? fe : Pt;
|
|
3500
3500
|
}, [c]), J = se(
|
|
3501
3501
|
() => Ls(U),
|
|
@@ -3559,12 +3559,12 @@ const gi = ({
|
|
|
3559
3559
|
additionalMessageInputProps: t
|
|
3560
3560
|
}
|
|
3561
3561
|
),
|
|
3562
|
-
|
|
3562
|
+
z && /* @__PURE__ */ s(
|
|
3563
3563
|
mn,
|
|
3564
3564
|
{
|
|
3565
3565
|
MessageBouncePrompt: H,
|
|
3566
3566
|
onClose: () => B(!1),
|
|
3567
|
-
open:
|
|
3567
|
+
open: z
|
|
3568
3568
|
}
|
|
3569
3569
|
),
|
|
3570
3570
|
/* @__PURE__ */ h(
|
|
@@ -3575,7 +3575,7 @@ const gi = ({
|
|
|
3575
3575
|
"data-dd-privacy": "mask",
|
|
3576
3576
|
children: [
|
|
3577
3577
|
T && /* @__PURE__ */ s(T, {}),
|
|
3578
|
-
!!
|
|
3578
|
+
!!O && /* @__PURE__ */ s(V, { reminder: O }),
|
|
3579
3579
|
c.user && /* @__PURE__ */ s(
|
|
3580
3580
|
be,
|
|
3581
3581
|
{
|
|
@@ -3776,7 +3776,11 @@ const gi = ({
|
|
|
3776
3776
|
]
|
|
3777
3777
|
}
|
|
3778
3778
|
);
|
|
3779
|
-
}
|
|
3779
|
+
};
|
|
3780
|
+
function Ni() {
|
|
3781
|
+
return typeof navigator > "u" ? !1 : /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
3782
|
+
}
|
|
3783
|
+
const yi = ({
|
|
3780
3784
|
link: e,
|
|
3781
3785
|
onDismiss: t
|
|
3782
3786
|
}) => {
|
|
@@ -3816,14 +3820,14 @@ const gi = ({
|
|
|
3816
3820
|
]
|
|
3817
3821
|
}
|
|
3818
3822
|
);
|
|
3819
|
-
},
|
|
3823
|
+
}, ki = (e) => ({
|
|
3820
3824
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3821
|
-
(t) =>
|
|
3825
|
+
(t) => zt.previewIsLoaded(t) || zt.previewIsLoading(t)
|
|
3822
3826
|
)
|
|
3823
|
-
}),
|
|
3827
|
+
}), Ci = () => {
|
|
3824
3828
|
const { linkPreviewsManager: e } = fn(), { linkPreviews: t } = gn(
|
|
3825
3829
|
e.state,
|
|
3826
|
-
|
|
3830
|
+
ki
|
|
3827
3831
|
), n = (r) => {
|
|
3828
3832
|
e.dismissPreview(r);
|
|
3829
3833
|
};
|
|
@@ -3836,9 +3840,9 @@ const gi = ({
|
|
|
3836
3840
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3837
3841
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3838
3842
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3839
|
-
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(
|
|
3843
|
+
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(yi, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3840
3844
|
) : null;
|
|
3841
|
-
},
|
|
3845
|
+
}, ze = j.createContext(!1), Si = 200, Ei = Ni(), vo = () => ye(ze), Ii = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3842
3846
|
"button",
|
|
3843
3847
|
{
|
|
3844
3848
|
...n,
|
|
@@ -3849,8 +3853,8 @@ const gi = ({
|
|
|
3849
3853
|
children: /* @__PURE__ */ s(Zn, { weight: "bold", className: "size-4" })
|
|
3850
3854
|
}
|
|
3851
3855
|
), Xt = () => {
|
|
3852
|
-
const e = ye(
|
|
3853
|
-
SendButton: r =
|
|
3856
|
+
const e = ye(ze), { handleSubmit: t } = pn(), n = bn(), a = e || !n, {
|
|
3857
|
+
SendButton: r = Ii,
|
|
3854
3858
|
AttachmentPreviewList: i = vn
|
|
3855
3859
|
} = es("CustomMessageInput");
|
|
3856
3860
|
return (
|
|
@@ -3883,7 +3887,7 @@ const gi = ({
|
|
|
3883
3887
|
children: [
|
|
3884
3888
|
/* @__PURE__ */ h("div", { className: "messaging-composer-previews empty:hidden flex min-h-0 flex-col gap-2 px-2 pt-2", children: [
|
|
3885
3889
|
/* @__PURE__ */ s(xn, {}),
|
|
3886
|
-
/* @__PURE__ */ s(
|
|
3890
|
+
/* @__PURE__ */ s(Ci, {}),
|
|
3887
3891
|
/* @__PURE__ */ s(i, {})
|
|
3888
3892
|
] }),
|
|
3889
3893
|
/* @__PURE__ */ h("div", { className: "messaging-composer-row flex shrink-0 items-start", children: [
|
|
@@ -3893,7 +3897,7 @@ const gi = ({
|
|
|
3893
3897
|
"aria-disabled": e || void 0,
|
|
3894
3898
|
containerClassName: "min-w-0 flex-1 leading-[0]",
|
|
3895
3899
|
className: "w-full resize-none bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
3896
|
-
autoFocus: !e,
|
|
3900
|
+
autoFocus: !e && !Ei,
|
|
3897
3901
|
enterKeyHint: "send",
|
|
3898
3902
|
maxRows: 4,
|
|
3899
3903
|
readOnly: e,
|
|
@@ -3938,7 +3942,7 @@ const gi = ({
|
|
|
3938
3942
|
c = p;
|
|
3939
3943
|
const x = Array.from(
|
|
3940
3944
|
f.querySelectorAll(".str-chat__list")
|
|
3941
|
-
).find((k) => k.scrollHeight > k.clientHeight) ?? null, S = x ? x.scrollHeight - x.scrollTop - x.clientHeight <
|
|
3945
|
+
).find((k) => k.scrollHeight > k.clientHeight) ?? null, S = x ? x.scrollHeight - x.scrollTop - x.clientHeight < Si : !1;
|
|
3942
3946
|
f.style.setProperty(
|
|
3943
3947
|
"--messaging-composer-height",
|
|
3944
3948
|
`${p}px`
|
|
@@ -4000,7 +4004,7 @@ const gi = ({
|
|
|
4000
4004
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
4001
4005
|
children: [
|
|
4002
4006
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
4003
|
-
/* @__PURE__ */ s(
|
|
4007
|
+
/* @__PURE__ */ s(ze.Provider, { value: o, children: /* @__PURE__ */ s(Ft, { Input: i ?? Xt }) })
|
|
4004
4008
|
]
|
|
4005
4009
|
}
|
|
4006
4010
|
),
|
|
@@ -4019,28 +4023,28 @@ const gi = ({
|
|
|
4019
4023
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
4020
4024
|
children: [
|
|
4021
4025
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
4022
|
-
/* @__PURE__ */ s(
|
|
4026
|
+
/* @__PURE__ */ s(ze.Provider, { value: o, children: /* @__PURE__ */ s(Ft, { Input: Xt }) })
|
|
4023
4027
|
]
|
|
4024
4028
|
}
|
|
4025
4029
|
),
|
|
4026
4030
|
n == null ? void 0 : n()
|
|
4027
4031
|
] });
|
|
4028
|
-
},
|
|
4032
|
+
}, Ti = [
|
|
4029
4033
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
4030
4034
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
4031
|
-
],
|
|
4035
|
+
], Mi = {
|
|
4032
4036
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
4033
4037
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
4034
|
-
},
|
|
4038
|
+
}, Ai = [
|
|
4035
4039
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
4036
|
-
],
|
|
4040
|
+
], Ri = ["SYSTEM_AGE_SAFETY_BLOCKED"], Li = {
|
|
4037
4041
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
4038
|
-
}, Xe = "age safety guidelines.",
|
|
4042
|
+
}, Xe = "age safety guidelines.", Di = "https://linktr.ee/s/about/contact", Zt = (e) => Ti.includes(e), Pi = (e) => Ai.includes(e), Oi = (e) => Ri.includes(
|
|
4039
4043
|
e
|
|
4040
|
-
),
|
|
4044
|
+
), zi = (e) => {
|
|
4041
4045
|
var t;
|
|
4042
|
-
return
|
|
4043
|
-
},
|
|
4046
|
+
return Oi((t = e.metadata) == null ? void 0 : t.custom_type);
|
|
4047
|
+
}, Fi = (e) => {
|
|
4044
4048
|
var a;
|
|
4045
4049
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
4046
4050
|
if (Zt(t))
|
|
@@ -4048,7 +4052,7 @@ const gi = ({
|
|
|
4048
4052
|
kind: "dm-agent",
|
|
4049
4053
|
type: t
|
|
4050
4054
|
};
|
|
4051
|
-
if (
|
|
4055
|
+
if (Pi(t))
|
|
4052
4056
|
return {
|
|
4053
4057
|
kind: "age-safety",
|
|
4054
4058
|
type: t
|
|
@@ -4059,7 +4063,7 @@ const gi = ({
|
|
|
4059
4063
|
kind: "dm-agent",
|
|
4060
4064
|
type: n
|
|
4061
4065
|
};
|
|
4062
|
-
},
|
|
4066
|
+
}, Bi = (e) => {
|
|
4063
4067
|
const t = e.indexOf(Xe);
|
|
4064
4068
|
if (t === -1)
|
|
4065
4069
|
return e;
|
|
@@ -4069,7 +4073,7 @@ const gi = ({
|
|
|
4069
4073
|
/* @__PURE__ */ s(
|
|
4070
4074
|
"a",
|
|
4071
4075
|
{
|
|
4072
|
-
href:
|
|
4076
|
+
href: Di,
|
|
4073
4077
|
target: "_blank",
|
|
4074
4078
|
rel: "noopener noreferrer",
|
|
4075
4079
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -4078,13 +4082,13 @@ const gi = ({
|
|
|
4078
4082
|
),
|
|
4079
4083
|
e.slice(n)
|
|
4080
4084
|
] });
|
|
4081
|
-
},
|
|
4085
|
+
}, $i = (e) => {
|
|
4082
4086
|
var a, r;
|
|
4083
|
-
const t = !
|
|
4087
|
+
const t = !zi(e.message), n = Fi(
|
|
4084
4088
|
e.message
|
|
4085
4089
|
);
|
|
4086
4090
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
4087
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
4091
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Mi[n.type];
|
|
4088
4092
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
4089
4093
|
/* @__PURE__ */ h(
|
|
4090
4094
|
"div",
|
|
@@ -4110,7 +4114,7 @@ const gi = ({
|
|
|
4110
4114
|
] });
|
|
4111
4115
|
}
|
|
4112
4116
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
4113
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
4117
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Li[n.type];
|
|
4114
4118
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
4115
4119
|
/* @__PURE__ */ h(
|
|
4116
4120
|
"div",
|
|
@@ -4129,7 +4133,7 @@ const gi = ({
|
|
|
4129
4133
|
"data-testid": "age-safety-system-message-icon"
|
|
4130
4134
|
}
|
|
4131
4135
|
),
|
|
4132
|
-
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
4136
|
+
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Bi(i) }) })
|
|
4133
4137
|
]
|
|
4134
4138
|
}
|
|
4135
4139
|
),
|
|
@@ -4154,15 +4158,15 @@ const gi = ({
|
|
|
4154
4158
|
begin: `${120 * t}ms`,
|
|
4155
4159
|
repeatCount: "indefinite"
|
|
4156
4160
|
}
|
|
4157
|
-
) }),
|
|
4161
|
+
) }), Ui = /* @__PURE__ */ new Set([
|
|
4158
4162
|
Ge.Thinking,
|
|
4159
4163
|
Ge.Generating,
|
|
4160
4164
|
Ge.ExternalSources
|
|
4161
|
-
]),
|
|
4165
|
+
]), ji = ({ threadList: e }) => {
|
|
4162
4166
|
var v, w;
|
|
4163
4167
|
const { channel: t, channelConfig: n, thread: a } = ue(), { client: r } = ke(), { typing: i = {} } = _n(), { aiState: l } = Nn(t), o = ye(Ds);
|
|
4164
|
-
if (!e && o &&
|
|
4165
|
-
const p =
|
|
4168
|
+
if (!e && o && Ui.has(l)) {
|
|
4169
|
+
const p = Vi(t, (v = r.user) == null ? void 0 : v.id);
|
|
4166
4170
|
return /* @__PURE__ */ s(
|
|
4167
4171
|
Jt,
|
|
4168
4172
|
{
|
|
@@ -4242,7 +4246,7 @@ const gi = ({
|
|
|
4242
4246
|
] })
|
|
4243
4247
|
}
|
|
4244
4248
|
);
|
|
4245
|
-
function
|
|
4249
|
+
function Vi(e, t) {
|
|
4246
4250
|
var a;
|
|
4247
4251
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4248
4252
|
for (const r of Object.values(n)) {
|
|
@@ -4251,7 +4255,7 @@ function Ui(e, t) {
|
|
|
4251
4255
|
return i;
|
|
4252
4256
|
}
|
|
4253
4257
|
}
|
|
4254
|
-
const
|
|
4258
|
+
const Gi = () => null, Hi = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
4255
4259
|
"div",
|
|
4256
4260
|
{
|
|
4257
4261
|
className: y("flex items-center justify-center h-full", e),
|
|
@@ -4295,11 +4299,11 @@ const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
4295
4299
|
]
|
|
4296
4300
|
}
|
|
4297
4301
|
), Fe = j.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
4298
|
-
/* @__PURE__ */ s(
|
|
4302
|
+
/* @__PURE__ */ s(Hi, { className: "w-6 h-6" }),
|
|
4299
4303
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4300
4304
|
] }) }));
|
|
4301
4305
|
Fe.displayName = "LoadingState";
|
|
4302
|
-
const
|
|
4306
|
+
const Yi = ({
|
|
4303
4307
|
onBack: e,
|
|
4304
4308
|
showBackButton: t,
|
|
4305
4309
|
renderMessageInputActions: n,
|
|
@@ -4323,10 +4327,10 @@ const Gi = ({
|
|
|
4323
4327
|
renderMessage: k,
|
|
4324
4328
|
viewerLanguage: R,
|
|
4325
4329
|
showChannelInfo: A = !0,
|
|
4326
|
-
onParticipantNameClick:
|
|
4330
|
+
onParticipantNameClick: z,
|
|
4327
4331
|
composerInput: B
|
|
4328
4332
|
}) => {
|
|
4329
|
-
const { channel:
|
|
4333
|
+
const { channel: O } = ue(), L = O.state.messages.some(
|
|
4330
4334
|
(M) => M.type !== "deleted"
|
|
4331
4335
|
), C = b ? /* @__PURE__ */ s(j.Fragment, { children: b() }, "lt-channel-banner") : null, I = /* @__PURE__ */ s(
|
|
4332
4336
|
fa,
|
|
@@ -4346,7 +4350,7 @@ const Gi = ({
|
|
|
4346
4350
|
onReportParticipantClick: g,
|
|
4347
4351
|
customChannelActions: x,
|
|
4348
4352
|
renderChannelActions: S,
|
|
4349
|
-
onParticipantNameClick:
|
|
4353
|
+
onParticipantNameClick: z
|
|
4350
4354
|
}
|
|
4351
4355
|
), N = W(
|
|
4352
4356
|
(M) => {
|
|
@@ -4400,12 +4404,12 @@ const Gi = ({
|
|
|
4400
4404
|
Kt,
|
|
4401
4405
|
{
|
|
4402
4406
|
...n && {
|
|
4403
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4407
|
+
renderActions: () => n == null ? void 0 : n(O)
|
|
4404
4408
|
},
|
|
4405
4409
|
...r && {
|
|
4406
|
-
renderHeader: () => r(
|
|
4410
|
+
renderHeader: () => r(O)
|
|
4407
4411
|
},
|
|
4408
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4412
|
+
renderFooter: () => a == null ? void 0 : a(O),
|
|
4409
4413
|
disabled: c,
|
|
4410
4414
|
disabledReason: v,
|
|
4411
4415
|
composerInput: B
|
|
@@ -4437,14 +4441,14 @@ const Gi = ({
|
|
|
4437
4441
|
},
|
|
4438
4442
|
"lt-channel-message-list"
|
|
4439
4443
|
),
|
|
4440
|
-
r ? /* @__PURE__ */ s(j.Fragment, { children: r(
|
|
4444
|
+
r ? /* @__PURE__ */ s(j.Fragment, { children: r(O) }, "lt-channel-conversation-footer") : null,
|
|
4441
4445
|
/* @__PURE__ */ s(
|
|
4442
4446
|
Kt,
|
|
4443
4447
|
{
|
|
4444
4448
|
...n && {
|
|
4445
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4449
|
+
renderActions: () => n == null ? void 0 : n(O)
|
|
4446
4450
|
},
|
|
4447
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4451
|
+
renderFooter: () => a == null ? void 0 : a(O),
|
|
4448
4452
|
disabled: c,
|
|
4449
4453
|
disabledReason: v,
|
|
4450
4454
|
composerInput: B
|
|
@@ -4465,7 +4469,7 @@ const Gi = ({
|
|
|
4465
4469
|
onLeaveConversation: l,
|
|
4466
4470
|
onBlockParticipant: o,
|
|
4467
4471
|
className: d,
|
|
4468
|
-
CustomChannelEmptyState: u =
|
|
4472
|
+
CustomChannelEmptyState: u = Gi,
|
|
4469
4473
|
showDeleteConversation: g = !0,
|
|
4470
4474
|
onDeleteConversationClick: m,
|
|
4471
4475
|
onBlockParticipantClick: f,
|
|
@@ -4479,9 +4483,9 @@ const Gi = ({
|
|
|
4479
4483
|
onMessageSent: k,
|
|
4480
4484
|
showStarButton: R = !1,
|
|
4481
4485
|
chatbotVotingEnabled: A = !1,
|
|
4482
|
-
renderChannelBanner:
|
|
4486
|
+
renderChannelBanner: z,
|
|
4483
4487
|
customChannelActions: B,
|
|
4484
|
-
renderChannelActions:
|
|
4488
|
+
renderChannelActions: O,
|
|
4485
4489
|
renderMessage: L,
|
|
4486
4490
|
onMessageLinkClick: C,
|
|
4487
4491
|
sendButton: I,
|
|
@@ -4534,16 +4538,16 @@ const Gi = ({
|
|
|
4534
4538
|
yn,
|
|
4535
4539
|
{
|
|
4536
4540
|
channel: e,
|
|
4537
|
-
MessageSystem:
|
|
4541
|
+
MessageSystem: $i,
|
|
4538
4542
|
EmptyStateIndicator: u,
|
|
4539
4543
|
LoadingIndicator: Fe,
|
|
4540
4544
|
DateSeparator: ga,
|
|
4541
|
-
TypingIndicator:
|
|
4545
|
+
TypingIndicator: ji,
|
|
4542
4546
|
doSendMessageRequest: q,
|
|
4543
4547
|
...I ? { SendButton: I } : {},
|
|
4544
4548
|
...N ? { AttachmentPreviewList: N } : {},
|
|
4545
4549
|
children: /* @__PURE__ */ s(
|
|
4546
|
-
|
|
4550
|
+
Yi,
|
|
4547
4551
|
{
|
|
4548
4552
|
onBack: t,
|
|
4549
4553
|
showBackButton: n,
|
|
@@ -4563,9 +4567,9 @@ const Gi = ({
|
|
|
4563
4567
|
composerDisabledReason: b,
|
|
4564
4568
|
showStarButton: R,
|
|
4565
4569
|
chatbotVotingEnabled: A,
|
|
4566
|
-
renderChannelBanner:
|
|
4570
|
+
renderChannelBanner: z,
|
|
4567
4571
|
customChannelActions: B,
|
|
4568
|
-
renderChannelActions:
|
|
4572
|
+
renderChannelActions: O,
|
|
4569
4573
|
renderMessage: L,
|
|
4570
4574
|
viewerLanguage: M,
|
|
4571
4575
|
showChannelInfo: E,
|
|
@@ -4595,7 +4599,7 @@ const we = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4595
4599
|
)
|
|
4596
4600
|
] }) }));
|
|
4597
4601
|
we.displayName = "ErrorState";
|
|
4598
|
-
const
|
|
4602
|
+
const xo = ({
|
|
4599
4603
|
capabilities: e = {},
|
|
4600
4604
|
renderMessageInputActions: t,
|
|
4601
4605
|
renderConversationFooter: n,
|
|
@@ -4621,9 +4625,9 @@ const bo = ({
|
|
|
4621
4625
|
}) => {
|
|
4622
4626
|
const {
|
|
4623
4627
|
client: A,
|
|
4624
|
-
isConnected:
|
|
4628
|
+
isConnected: z,
|
|
4625
4629
|
isLoading: B,
|
|
4626
|
-
error:
|
|
4630
|
+
error: O,
|
|
4627
4631
|
refreshConnection: L,
|
|
4628
4632
|
service: C,
|
|
4629
4633
|
debug: I
|
|
@@ -4635,7 +4639,7 @@ const bo = ({
|
|
|
4635
4639
|
Y(() => {
|
|
4636
4640
|
T.current = N;
|
|
4637
4641
|
}, [N]), Y(() => {
|
|
4638
|
-
if (!A || !
|
|
4642
|
+
if (!A || !z) return;
|
|
4639
4643
|
const X = A.userID;
|
|
4640
4644
|
if (!X) return;
|
|
4641
4645
|
const U = `${X}::${i}`;
|
|
@@ -4697,14 +4701,14 @@ const bo = ({
|
|
|
4697
4701
|
), J(), T.current || D("Failed to load conversation");
|
|
4698
4702
|
}
|
|
4699
4703
|
})();
|
|
4700
|
-
}, [i, A,
|
|
4704
|
+
}, [i, A, z, C, I]);
|
|
4701
4705
|
const $ = G(r);
|
|
4702
4706
|
$.current = r;
|
|
4703
4707
|
const te = W(() => {
|
|
4704
4708
|
var X;
|
|
4705
4709
|
M(null), q(!0), (X = $.current) == null || X.call($);
|
|
4706
4710
|
}, []);
|
|
4707
|
-
return B ? /* @__PURE__ */ s(Fe, {}) :
|
|
4711
|
+
return B ? /* @__PURE__ */ s(Fe, {}) : O ? /* @__PURE__ */ s(we, { message: O, onBack: L }) : !z || !A ? /* @__PURE__ */ s(
|
|
4708
4712
|
we,
|
|
4709
4713
|
{
|
|
4710
4714
|
message: "Not connected to messaging service",
|
|
@@ -4738,13 +4742,13 @@ const bo = ({
|
|
|
4738
4742
|
N.id
|
|
4739
4743
|
) }) }) : /* @__PURE__ */ s(Fe, {});
|
|
4740
4744
|
};
|
|
4741
|
-
function
|
|
4745
|
+
function qi(e) {
|
|
4742
4746
|
const t = e.state.pending_messages;
|
|
4743
4747
|
if (t != null && t.length)
|
|
4744
4748
|
for (const n of t)
|
|
4745
4749
|
e.state.addMessageSorted(n.message);
|
|
4746
4750
|
}
|
|
4747
|
-
const
|
|
4751
|
+
const Os = j.createContext({
|
|
4748
4752
|
selectedChannel: void 0,
|
|
4749
4753
|
onChannelSelect: () => {
|
|
4750
4754
|
},
|
|
@@ -4752,18 +4756,18 @@ const zs = j.createContext({
|
|
|
4752
4756
|
renderMessagePreview: void 0,
|
|
4753
4757
|
channelPreview: void 0,
|
|
4754
4758
|
viewerLanguage: void 0
|
|
4755
|
-
}),
|
|
4759
|
+
}), Wi = Os.Provider, Xi = () => j.useContext(Os), Ki = (e, t) => {
|
|
4756
4760
|
const n = new Date(
|
|
4757
4761
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4758
4762
|
), r = new Date(
|
|
4759
4763
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4760
4764
|
).getTime() - n.getTime();
|
|
4761
4765
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4762
|
-
},
|
|
4766
|
+
}, Zi = (e) => {
|
|
4763
4767
|
const t = /* @__PURE__ */ new Date();
|
|
4764
4768
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4765
4769
|
return "Just now";
|
|
4766
|
-
const a =
|
|
4770
|
+
const a = Ki(e, t);
|
|
4767
4771
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4768
4772
|
hour: "numeric",
|
|
4769
4773
|
minute: "2-digit",
|
|
@@ -4773,9 +4777,9 @@ const zs = j.createContext({
|
|
|
4773
4777
|
month: "short",
|
|
4774
4778
|
year: "2-digit"
|
|
4775
4779
|
});
|
|
4776
|
-
},
|
|
4780
|
+
}, zs = j.memo(
|
|
4777
4781
|
(e) => {
|
|
4778
|
-
var B,
|
|
4782
|
+
var B, O, L;
|
|
4779
4783
|
const { channel: t, unread: n } = e, {
|
|
4780
4784
|
selectedChannel: a,
|
|
4781
4785
|
onChannelSelect: r,
|
|
@@ -4783,7 +4787,7 @@ const zs = j.createContext({
|
|
|
4783
4787
|
channelPreview: l,
|
|
4784
4788
|
renderMessagePreview: o,
|
|
4785
4789
|
viewerLanguage: d
|
|
4786
|
-
} =
|
|
4790
|
+
} = Xi(), { client: u } = ke(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = os(t);
|
|
4787
4791
|
if (l)
|
|
4788
4792
|
return /* @__PURE__ */ s(
|
|
4789
4793
|
l,
|
|
@@ -4804,7 +4808,7 @@ const zs = j.createContext({
|
|
|
4804
4808
|
(B = t == null ? void 0 : t.state) == null ? void 0 : B.members,
|
|
4805
4809
|
u == null ? void 0 : u.userID,
|
|
4806
4810
|
t == null ? void 0 : t.type
|
|
4807
|
-
), w = cs(v == null ? void 0 : v.user), p = (
|
|
4811
|
+
), w = cs(v == null ? void 0 : v.user), p = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, b = (() => {
|
|
4808
4812
|
var I;
|
|
4809
4813
|
const C = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
|
|
4810
4814
|
if (C != null && C.length) {
|
|
@@ -4830,12 +4834,12 @@ const zs = j.createContext({
|
|
|
4830
4834
|
if (C) return C;
|
|
4831
4835
|
const M = (E = b == null ? void 0 : b.attachments) == null ? void 0 : E[0];
|
|
4832
4836
|
return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4833
|
-
})(), k = b != null && b.created_at ?
|
|
4837
|
+
})(), k = b != null && b.created_at ? Zi(new Date(b.created_at)) : "", R = b ? De(b) : !1, A = o ? o(b, S) : `${R ? "✨ " : ""}${S}`, z = n ?? 0;
|
|
4834
4838
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4835
4839
|
channelId: t == null ? void 0 : t.id,
|
|
4836
4840
|
isSelected: g,
|
|
4837
4841
|
participantName: w,
|
|
4838
|
-
unreadCount:
|
|
4842
|
+
unreadCount: z,
|
|
4839
4843
|
hasTimestamp: !!k
|
|
4840
4844
|
}), /* @__PURE__ */ s(
|
|
4841
4845
|
"div",
|
|
@@ -4881,7 +4885,7 @@ const zs = j.createContext({
|
|
|
4881
4885
|
] }),
|
|
4882
4886
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4883
4887
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
|
|
4884
|
-
|
|
4888
|
+
z > 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: z > 99 ? "99+" : z })
|
|
4885
4889
|
] })
|
|
4886
4890
|
] })
|
|
4887
4891
|
] })
|
|
@@ -4889,15 +4893,15 @@ const zs = j.createContext({
|
|
|
4889
4893
|
);
|
|
4890
4894
|
}
|
|
4891
4895
|
);
|
|
4892
|
-
|
|
4893
|
-
const
|
|
4896
|
+
zs.displayName = "CustomChannelPreview";
|
|
4897
|
+
const Ji = { last_message_at: -1 }, Qi = j.memo(
|
|
4894
4898
|
({
|
|
4895
4899
|
onChannelSelect: e,
|
|
4896
4900
|
selectedChannel: t,
|
|
4897
4901
|
filters: n,
|
|
4898
4902
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
4899
4903
|
channelRenderFilterFn: r,
|
|
4900
|
-
sort: i =
|
|
4904
|
+
sort: i = Ji,
|
|
4901
4905
|
className: l,
|
|
4902
4906
|
customEmptyStateIndicator: o,
|
|
4903
4907
|
channelListPaginator: d = En,
|
|
@@ -4915,8 +4919,8 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
|
|
|
4915
4919
|
x.current++;
|
|
4916
4920
|
const { debug: S = !1 } = nt(), k = j.useCallback(
|
|
4917
4921
|
(A) => {
|
|
4918
|
-
for (const
|
|
4919
|
-
|
|
4922
|
+
for (const z of A)
|
|
4923
|
+
qi(z);
|
|
4920
4924
|
return r ? r(A) : A;
|
|
4921
4925
|
},
|
|
4922
4926
|
[r]
|
|
@@ -4951,7 +4955,7 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
|
|
|
4951
4955
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
4952
4956
|
l
|
|
4953
4957
|
),
|
|
4954
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
4958
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Wi, { value: R, children: /* @__PURE__ */ s(
|
|
4955
4959
|
Sn,
|
|
4956
4960
|
{
|
|
4957
4961
|
filters: n,
|
|
@@ -4966,7 +4970,7 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
|
|
|
4966
4970
|
onAddedToChannel: p,
|
|
4967
4971
|
onChannelUpdated: b,
|
|
4968
4972
|
Paginator: d,
|
|
4969
|
-
Preview:
|
|
4973
|
+
Preview: zs,
|
|
4970
4974
|
EmptyStateIndicator: o
|
|
4971
4975
|
},
|
|
4972
4976
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -4975,11 +4979,11 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
|
|
|
4975
4979
|
);
|
|
4976
4980
|
}
|
|
4977
4981
|
);
|
|
4978
|
-
|
|
4979
|
-
const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`,
|
|
4982
|
+
Qi.displayName = "ChannelList";
|
|
4983
|
+
const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, eo = {
|
|
4980
4984
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
4981
4985
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
4982
|
-
},
|
|
4986
|
+
}, to = ({ variant: e }) => /* @__PURE__ */ s(
|
|
4983
4987
|
"span",
|
|
4984
4988
|
{
|
|
4985
4989
|
"aria-hidden": "true",
|
|
@@ -4989,12 +4993,12 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
4989
4993
|
insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
|
|
4990
4994
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
4991
4995
|
transformOrigin: "center",
|
|
4992
|
-
backgroundColor:
|
|
4996
|
+
backgroundColor: eo[e],
|
|
4993
4997
|
WebkitMask: Qt,
|
|
4994
4998
|
mask: Qt
|
|
4995
4999
|
}
|
|
4996
5000
|
}
|
|
4997
|
-
),
|
|
5001
|
+
), so = {
|
|
4998
5002
|
sent: {
|
|
4999
5003
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5000
5004
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -5019,17 +5023,17 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5019
5023
|
r
|
|
5020
5024
|
),
|
|
5021
5025
|
style: {
|
|
5022
|
-
...
|
|
5026
|
+
...so[e],
|
|
5023
5027
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
5024
5028
|
isolation: "isolate"
|
|
5025
5029
|
},
|
|
5026
5030
|
children: [
|
|
5027
5031
|
a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
|
|
5028
5032
|
/* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
|
|
5029
|
-
n && /* @__PURE__ */ s(
|
|
5033
|
+
n && /* @__PURE__ */ s(to, { variant: e })
|
|
5030
5034
|
]
|
|
5031
5035
|
}
|
|
5032
|
-
),
|
|
5036
|
+
), no = ({
|
|
5033
5037
|
text: e,
|
|
5034
5038
|
tail: t,
|
|
5035
5039
|
header: n,
|
|
@@ -5043,10 +5047,10 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5043
5047
|
header: n,
|
|
5044
5048
|
className: a
|
|
5045
5049
|
}
|
|
5046
|
-
),
|
|
5047
|
-
Sent:
|
|
5048
|
-
Received:
|
|
5049
|
-
},
|
|
5050
|
+
), ao = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Fs, { variant: "sent", text: e, tail: t, className: n }), wo = {
|
|
5051
|
+
Sent: ao,
|
|
5052
|
+
Received: no
|
|
5053
|
+
}, ro = ({
|
|
5050
5054
|
question: e,
|
|
5051
5055
|
onClick: t,
|
|
5052
5056
|
loading: n = !1,
|
|
@@ -5068,7 +5072,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5068
5072
|
),
|
|
5069
5073
|
children: e
|
|
5070
5074
|
}
|
|
5071
|
-
),
|
|
5075
|
+
), _o = ({
|
|
5072
5076
|
faqs: e,
|
|
5073
5077
|
onFaqClick: t,
|
|
5074
5078
|
loadingFaqId: n,
|
|
@@ -5097,7 +5101,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5097
5101
|
children: [
|
|
5098
5102
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5099
5103
|
o.map((d) => /* @__PURE__ */ s(
|
|
5100
|
-
|
|
5104
|
+
ro,
|
|
5101
5105
|
{
|
|
5102
5106
|
question: d.question,
|
|
5103
5107
|
onClick: () => t(d.id),
|
|
@@ -5113,32 +5117,32 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5113
5117
|
export {
|
|
5114
5118
|
hs as A,
|
|
5115
5119
|
ot as B,
|
|
5116
|
-
|
|
5120
|
+
Gi as C,
|
|
5117
5121
|
cs as D,
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5122
|
+
vo as E,
|
|
5123
|
+
_o as F,
|
|
5124
|
+
Or as G,
|
|
5121
5125
|
ba as H,
|
|
5122
5126
|
ta as I,
|
|
5123
5127
|
Ht as L,
|
|
5124
|
-
|
|
5128
|
+
po as M,
|
|
5125
5129
|
ve as a,
|
|
5126
5130
|
be as b,
|
|
5127
|
-
|
|
5131
|
+
Qi as c,
|
|
5128
5132
|
Ps as d,
|
|
5129
|
-
|
|
5130
|
-
|
|
5133
|
+
bo as e,
|
|
5134
|
+
ro as f,
|
|
5131
5135
|
oe as g,
|
|
5132
5136
|
Re as h,
|
|
5133
5137
|
xe as i,
|
|
5134
|
-
|
|
5138
|
+
wo as j,
|
|
5135
5139
|
Yr as k,
|
|
5136
|
-
|
|
5137
|
-
|
|
5140
|
+
go as l,
|
|
5141
|
+
xo as m,
|
|
5138
5142
|
er as n,
|
|
5139
5143
|
de as o,
|
|
5140
5144
|
Za as p,
|
|
5141
|
-
|
|
5145
|
+
Zi as q,
|
|
5142
5146
|
ge as r,
|
|
5143
5147
|
Qa as s,
|
|
5144
5148
|
us as t,
|
|
@@ -5149,4 +5153,4 @@ export {
|
|
|
5149
5153
|
ls as y,
|
|
5150
5154
|
it as z
|
|
5151
5155
|
};
|
|
5152
|
-
//# sourceMappingURL=index-
|
|
5156
|
+
//# sourceMappingURL=index-BOThiuy9.js.map
|