@linktr.ee/messaging-react 4.4.6 → 4.4.7-rc-1788243598
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +692 -660
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CustomMessage/CustomMessage.test.tsx +255 -6
- package/src/components/CustomMessage/index.tsx +41 -1
- package/src/components/MessageAttachment/MessageAttachment.behavior.test.tsx +45 -2
- package/src/components/MessageAttachment/Video/index.tsx +24 -8
- package/src/logging/index.test.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import { StreamChatService as g } from "@linktr.ee/messaging-core";
|
|
|
4
4
|
import { LinkPreviewsManager as _, StreamChat as v } from "stream-chat";
|
|
5
5
|
import { AIStates as y, Attachment as b, AttachmentPreviewList as x, Channel as S, ChannelList as C, Chat as w, DateSeparator as T, EditMessageModal as E, InfiniteScroll as D, MessageBlocked as O, MessageBounceModal as k, MessageBouncePrompt as A, MessageDeleted as j, MessageErrorIcon as M, MessageInput as N, MessageIsThreadReplyInChannelButtonIndicator as P, MessageList as F, MessageRepliesCountButton as I, MessageStatus as L, MessageText as R, MessageTimestamp as z, Poll as ee, QuotedMessagePreview as te, ReminderNotification as ne, StreamedMessageText as re, TextareaComposer as ie, Window as B, WithComponents as ae, areMessageUIPropsEqual as oe, isDateSeparatorMessage as se, isMessageBlocked as ce, isMessageBounced as le, messageHasAttachments as ue, messageHasReactions as de, useAIState as fe, useActiveAudioPlayer as pe, useChannelStateContext as me, useChatContext as he, useComponentContext as ge, useMessageComposer as _e, useMessageComposerHasSendableData as ve, useMessageContext as V, useMessageInputContext as ye, useMessageReminder as be, useStateStore as xe, useTypingContext as Se } from "stream-chat-react";
|
|
6
6
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
|
-
import { MESSAGE_CUSTOM_TYPE as G, OFFICIAL_SENDER_USER_ID as K, isAgeSafetySystemType as
|
|
7
|
+
import { MESSAGE_CUSTOM_TYPE as G, OFFICIAL_SENDER_USER_ID as K, isAgeSafetySystemType as q, isDmAgentSystemType as Ce, isOfficialChannel as we, resolveRichCardImagePresentation as Te, selectEnabledFaqs as Ee } from "@linktr.ee/messaging-taxonomy";
|
|
8
8
|
import J from "classnames";
|
|
9
|
-
import { ArrowLeftIcon as De, ArrowUpIcon as Oe, CaretLeftIcon as ke, CaretRightIcon as Ae, ChecksIcon as je, CircleNotchIcon as Me, CurrencyDollarIcon as
|
|
9
|
+
import { ArrowLeftIcon as De, ArrowUpIcon as Oe, CaretLeftIcon as ke, CaretRightIcon as Ae, ChecksIcon as je, CircleNotchIcon as Me, CurrencyDollarIcon as Ne, DotsThreeIcon as Pe, DownloadSimpleIcon as Y, FlagIcon as X, GiftIcon as Fe, MegaphoneIcon as Ie, PencilSimpleIcon as Le, PlayIcon as Re, ProhibitIcon as ze, ProhibitInsetIcon as Be, SignOutIcon as Ve, SparkleIcon as He, SpinnerGapIcon as Ue, StarIcon as We, TrashSimpleIcon as Ge, VideoCameraIcon as Ke, WarningCircleIcon as qe, XIcon as Je } from "@phosphor-icons/react";
|
|
10
10
|
import { DefaultDropdownActionButton as Ye, MessageActions as Xe } from "stream-chat-react/experimental";
|
|
11
11
|
//#region src/logging/index.tsx
|
|
12
12
|
var Ze = {
|
|
@@ -362,7 +362,7 @@ function gt(e) {
|
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Avatar/index.tsx
|
|
365
|
-
var
|
|
365
|
+
var Z = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape: a = "squircle", dmAgentEnabled: o = !1 }) => {
|
|
366
366
|
let s = ht(e), c = gt(e), l = n < 32 ? Math.round(n * .45) : n < 56 ? 14 : n < 120 ? 18 : 36, u = n >= 40 ? 2 : 1, d = a === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ U("div", {
|
|
367
367
|
"data-testid": "avatar-inner",
|
|
368
368
|
className: "h-full w-full overflow-hidden",
|
|
@@ -415,7 +415,7 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
415
415
|
children: f
|
|
416
416
|
})]
|
|
417
417
|
});
|
|
418
|
-
},
|
|
418
|
+
}, _t = "https://linktr.ee/s/about/trust-center/report", vt = ({ channel: e, participant: t, showBlockParticipant: n = !0, enabled: r = !0, onLeaveConversation: i, onBlockParticipant: a, onDeleteConversationClick: o, onBlockParticipantClick: s, onReportParticipantClick: c, onActionComplete: l, logLabel: u = "useChannelModerationActions" }) => {
|
|
419
419
|
let { service: f, debug: p } = rt(), m = t?.user?.id, g = !!(r && n && f && m), [_, v] = h(!1), [y, b] = h(null), [x, S] = h(!1), [C, w] = h(!1), T = g && (y?.participantId !== m || y?.service !== f);
|
|
420
420
|
return d(() => {
|
|
421
421
|
if (!g || !f || !m) {
|
|
@@ -487,16 +487,16 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
487
487
|
}
|
|
488
488
|
},
|
|
489
489
|
handleReportUser: () => {
|
|
490
|
-
c?.(), l?.(), window.open(
|
|
490
|
+
c?.(), l?.(), window.open(_t, "_blank", "noopener,noreferrer");
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
},
|
|
493
|
+
}, yt = ({ variant: e = "default", className: t, children: n, ...r }) => /* @__PURE__ */ U("button", {
|
|
494
494
|
type: "button",
|
|
495
495
|
className: J("flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60", e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand", t),
|
|
496
496
|
...r,
|
|
497
497
|
children: n
|
|
498
|
-
}),
|
|
499
|
-
let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } =
|
|
498
|
+
}), bt = ({ channel: e, participant: t, showDeleteConversation: n = !0, showBlockParticipant: r = !0, showReportParticipant: i = !0, onLeaveConversation: a, onBlockParticipant: o, onDeleteConversationClick: s, onBlockParticipantClick: c, onReportParticipantClick: u, customChannelActions: p, triggerClassName: g }) => {
|
|
499
|
+
let [_, v] = h(!1), y = m(null), b = f(), { isParticipantBlocked: x, isCheckingBlockedStatus: S, isLeaving: C, isUpdatingBlockStatus: w, handleLeaveConversation: T, handleBlockUser: E, handleUnblockUser: D, handleReportUser: O } = vt({
|
|
500
500
|
channel: e,
|
|
501
501
|
participant: t,
|
|
502
502
|
showBlockParticipant: r,
|
|
@@ -529,7 +529,7 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
529
529
|
"aria-expanded": _,
|
|
530
530
|
"aria-controls": _ ? b : void 0,
|
|
531
531
|
onClick: () => v((e) => !e),
|
|
532
|
-
children: [/* @__PURE__ */ U(
|
|
532
|
+
children: [/* @__PURE__ */ U(Pe, { className: "size-5 text-black/90" }), /* @__PURE__ */ U("span", {
|
|
533
533
|
className: "sr-only",
|
|
534
534
|
children: "More options"
|
|
535
535
|
})]
|
|
@@ -540,49 +540,49 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
540
540
|
children: /* @__PURE__ */ W("ul", {
|
|
541
541
|
className: "flex flex-col gap-1",
|
|
542
542
|
children: [
|
|
543
|
-
n && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W(
|
|
543
|
+
n && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W(yt, {
|
|
544
544
|
onClick: T,
|
|
545
545
|
disabled: C,
|
|
546
546
|
"aria-busy": C,
|
|
547
547
|
children: [C ? /* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ U(Ve, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Delete Conversation" })]
|
|
548
548
|
}) }),
|
|
549
|
-
r && /* @__PURE__ */ U("li", { children: S ? /* @__PURE__ */ W(
|
|
549
|
+
r && /* @__PURE__ */ U("li", { children: S ? /* @__PURE__ */ W(yt, {
|
|
550
550
|
disabled: !0,
|
|
551
551
|
"aria-busy": !0,
|
|
552
552
|
children: [/* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }), /* @__PURE__ */ U("span", { children: "Block" })]
|
|
553
|
-
}) : x ? /* @__PURE__ */ W(
|
|
553
|
+
}) : x ? /* @__PURE__ */ W(yt, {
|
|
554
554
|
onClick: D,
|
|
555
555
|
disabled: w,
|
|
556
556
|
"aria-busy": w,
|
|
557
557
|
children: [w ? /* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ U(Be, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Unblock" })]
|
|
558
|
-
}) : /* @__PURE__ */ W(
|
|
558
|
+
}) : /* @__PURE__ */ W(yt, {
|
|
559
559
|
onClick: E,
|
|
560
560
|
disabled: w,
|
|
561
561
|
"aria-busy": w,
|
|
562
562
|
children: [w ? /* @__PURE__ */ U(Ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ U(Be, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Block" })]
|
|
563
563
|
}) }),
|
|
564
|
-
i && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W(
|
|
564
|
+
i && /* @__PURE__ */ U("li", { children: /* @__PURE__ */ W(yt, {
|
|
565
565
|
variant: "danger",
|
|
566
566
|
onClick: O,
|
|
567
|
-
children: [/* @__PURE__ */ U(
|
|
567
|
+
children: [/* @__PURE__ */ U(X, { className: "h-5 w-5" }), /* @__PURE__ */ U("span", { children: "Report" })]
|
|
568
568
|
}) }),
|
|
569
569
|
p
|
|
570
570
|
]
|
|
571
571
|
})
|
|
572
572
|
})]
|
|
573
573
|
});
|
|
574
|
-
},
|
|
574
|
+
}, xt = "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", St = "CUSTOMER_PAID", Ct = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === St, wt = ({ className: e, onBack: t, showBackButton: n, showStarButton: r = !1, onLeaveConversation: i, onBlockParticipant: a, showDeleteConversation: s = !0, showBlockParticipant: c = !0, showReportParticipant: l = !0, onDeleteConversationClick: u, onBlockParticipantClick: d, onReportParticipantClick: f, customChannelActions: p, renderChannelActions: m, showChannelInfo: h = !0, onParticipantNameClick: g }) => {
|
|
575
575
|
let { channel: _ } = me(), { client: v } = he(), y = o.useMemo(() => st(_.state?.members, v?.userID, _.type), [
|
|
576
576
|
_.state?.members,
|
|
577
577
|
v?.userID,
|
|
578
578
|
_.type
|
|
579
|
-
]), b = dt(y?.user), x = y?.user?.image, S = ot(_), C =
|
|
579
|
+
]), b = dt(y?.user), x = y?.user?.image, S = ot(_), C = Ct(_.data?.customer_tag) && y?.is_follower === !0, w = r && S, T = C || w || !!g, E = async () => {
|
|
580
580
|
try {
|
|
581
581
|
S ? await _.unpin() : await _.pin();
|
|
582
582
|
} catch (e) {
|
|
583
583
|
console.error("[ChannelHeaderRedesign] Failed to update pinned status:", e);
|
|
584
584
|
}
|
|
585
|
-
}, D = /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
585
|
+
}, D = /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(Z, {
|
|
586
586
|
id: y?.user?.id || _.id || "unknown",
|
|
587
587
|
name: b,
|
|
588
588
|
image: x,
|
|
@@ -602,7 +602,7 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
602
602
|
C && /* @__PURE__ */ U("span", {
|
|
603
603
|
"aria-label": "Paid customer",
|
|
604
604
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
605
|
-
children: /* @__PURE__ */ U(
|
|
605
|
+
children: /* @__PURE__ */ U(Ne, {
|
|
606
606
|
className: "size-2.5",
|
|
607
607
|
weight: "bold"
|
|
608
608
|
})
|
|
@@ -635,7 +635,7 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
635
635
|
/* @__PURE__ */ U("div", {
|
|
636
636
|
className: "flex items-start",
|
|
637
637
|
children: n && /* @__PURE__ */ U("button", {
|
|
638
|
-
className: J(
|
|
638
|
+
className: J(xt, "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"),
|
|
639
639
|
onClick: t || (() => {}),
|
|
640
640
|
type: "button",
|
|
641
641
|
"aria-label": "Back to conversations",
|
|
@@ -659,7 +659,7 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
659
659
|
/* @__PURE__ */ W("div", {
|
|
660
660
|
className: "flex items-start justify-end gap-2",
|
|
661
661
|
children: [r && /* @__PURE__ */ U("button", {
|
|
662
|
-
className:
|
|
662
|
+
className: xt,
|
|
663
663
|
onClick: E,
|
|
664
664
|
type: "button",
|
|
665
665
|
"aria-pressed": S,
|
|
@@ -671,7 +671,7 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
671
671
|
}),
|
|
672
672
|
weight: S ? "fill" : "regular"
|
|
673
673
|
})
|
|
674
|
-
}), h && (m === void 0 ? /* @__PURE__ */ U(
|
|
674
|
+
}), h && (m === void 0 ? /* @__PURE__ */ U(bt, {
|
|
675
675
|
channel: _,
|
|
676
676
|
participant: y,
|
|
677
677
|
showDeleteConversation: s,
|
|
@@ -683,228 +683,48 @@ var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
683
683
|
onBlockParticipantClick: d,
|
|
684
684
|
onReportParticipantClick: f,
|
|
685
685
|
customChannelActions: p,
|
|
686
|
-
triggerClassName:
|
|
686
|
+
triggerClassName: xt
|
|
687
687
|
}) : m)]
|
|
688
688
|
})
|
|
689
689
|
]
|
|
690
690
|
})
|
|
691
691
|
});
|
|
692
|
-
},
|
|
692
|
+
}, Tt = (e) => /* @__PURE__ */ U(T, {
|
|
693
693
|
...e,
|
|
694
694
|
position: "center"
|
|
695
695
|
});
|
|
696
696
|
//#endregion
|
|
697
697
|
//#region src/utils/getMessageDisplayText.ts
|
|
698
|
-
function
|
|
698
|
+
function Et(e) {
|
|
699
699
|
return e?.trim().toLowerCase().split(/[-_]/)[0] || void 0;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
let n = e?.text, r =
|
|
701
|
+
function Dt({ message: e, viewerLanguage: t }) {
|
|
702
|
+
let n = e?.text, r = Et(t);
|
|
703
703
|
return r ? e?.i18n?.[`${r}_text`] ?? n : n;
|
|
704
704
|
}
|
|
705
705
|
//#endregion
|
|
706
|
-
//#region src/components/
|
|
707
|
-
|
|
708
|
-
return e.type === "link" || !!e.og_scrape_url?.trim();
|
|
709
|
-
}
|
|
710
|
-
//#endregion
|
|
711
|
-
//#region src/components/CustomMessage/context.tsx
|
|
712
|
-
var At = { LockedAttachment: { isUnlocking: () => !1 } }, jt = c({}), Mt = jt.Provider;
|
|
713
|
-
function Nt(e) {
|
|
714
|
-
return u(jt)[e] ?? At[e];
|
|
715
|
-
}
|
|
716
|
-
//#endregion
|
|
717
|
-
//#region src/components/CustomMessage/LockedAttachment/index.tsx
|
|
718
|
-
var Pt = o.lazy(() => import("./Card-C7uLQbYz.js")), Ft = o.lazy(() => import("./Card-BhwBkgxI.js")), It = () => /* @__PURE__ */ U("div", {
|
|
719
|
-
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)]",
|
|
720
|
-
"aria-hidden": !0
|
|
721
|
-
}), Lt = (e) => /* @__PURE__ */ U(s, {
|
|
722
|
-
fallback: /* @__PURE__ */ U(It, {}),
|
|
723
|
-
children: e.contentType === "text" ? /* @__PURE__ */ U(Pt, { ...e }) : /* @__PURE__ */ U(Ft, { ...e })
|
|
724
|
-
}), Rt = ({ size: e = 15 }) => /* @__PURE__ */ U("svg", {
|
|
725
|
-
width: e,
|
|
726
|
-
height: e,
|
|
727
|
-
viewBox: "0 0 15 15",
|
|
728
|
-
fill: "none",
|
|
729
|
-
"aria-hidden": "true",
|
|
730
|
-
children: /* @__PURE__ */ U("path", {
|
|
731
|
-
d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
|
|
732
|
-
fill: "currentColor",
|
|
733
|
-
fillOpacity: .55
|
|
734
|
-
})
|
|
735
|
-
}), zt = (e) => e.metadata?.custom_type === G.PAID, Bt = (e) => e.metadata?.custom_type === G.CHATBOT, Vt = (e) => e.metadata?.custom_type === G.ATTACHMENT, Ht = (e) => Vt(e) && e.metadata?.attachment_content_type === "text", Ut = (e) => Vt(e) && e.metadata?.attachment_content_type !== "text", Wt = (e) => zt(e) && !!e.metadata?.amount_text, Gt = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
|
|
736
|
-
let r = zt(e), i = Bt(e);
|
|
737
|
-
if (!r && !i) return null;
|
|
738
|
-
if (r) {
|
|
739
|
-
let t = e.metadata?.amount_text;
|
|
740
|
-
return t ? /* @__PURE__ */ W("div", {
|
|
741
|
-
className: "message-tag--paid inline-flex items-center gap-1 text-[12px] font-medium leading-[2] text-[#016630]",
|
|
742
|
-
children: [/* @__PURE__ */ U(Fe, { size: 12 }), /* @__PURE__ */ W("span", { children: [
|
|
743
|
-
"Delivered with ",
|
|
744
|
-
t,
|
|
745
|
-
" message"
|
|
746
|
-
] })]
|
|
747
|
-
}) : null;
|
|
748
|
-
}
|
|
749
|
-
let a = t && n, o = a ? "Sent with AI" : "Sent by AI Assistant", s = a ? "justify-end gap-2 text-black/30" : t ? "w-full justify-start gap-1.5 mt-3 px-4 text-white/55" : "w-full justify-start gap-1.5 mt-3 px-4 text-black/30", c = /* @__PURE__ */ U("span", {
|
|
750
|
-
className: "text-left",
|
|
751
|
-
children: o
|
|
752
|
-
}), l = /* @__PURE__ */ U("span", {
|
|
753
|
-
className: "inline-flex items-center leading-none",
|
|
754
|
-
children: /* @__PURE__ */ U(Rt, { size: a ? 12 : 15 })
|
|
755
|
-
});
|
|
756
|
-
return /* @__PURE__ */ U("div", {
|
|
757
|
-
className: `inline-flex items-center text-[10px] font-normal leading-4 tracking-[0.2px] ${s}`,
|
|
758
|
-
"data-testid": "message-chatbot-indicator",
|
|
759
|
-
children: t && !a ? /* @__PURE__ */ W(H, { children: [c, l] }) : /* @__PURE__ */ W(H, { children: [l, c] })
|
|
760
|
-
});
|
|
761
|
-
}, Kt = "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%", qt = {
|
|
762
|
-
me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
763
|
-
other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
764
|
-
}, Jt = ({ side: e }) => /* @__PURE__ */ U("span", {
|
|
765
|
-
"aria-hidden": "true",
|
|
766
|
-
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
767
|
-
style: {
|
|
768
|
-
insetInlineEnd: e === "me" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
769
|
-
insetInlineStart: e === "other" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
770
|
-
transform: e === "other" ? "scaleX(-1)" : void 0,
|
|
771
|
-
transformOrigin: "center",
|
|
772
|
-
backgroundColor: qt[e],
|
|
773
|
-
WebkitMask: Kt,
|
|
774
|
-
mask: Kt
|
|
775
|
-
}
|
|
776
|
-
}), Yt = c(void 0), Xt = (e) => {
|
|
777
|
-
let t = e.metadata?.outbound_id;
|
|
778
|
-
return typeof t == "string" ? t : void 0;
|
|
779
|
-
}, Zt = (e, t) => {
|
|
780
|
-
if (!t || !e?.length) return;
|
|
781
|
-
let n = /* @__PURE__ */ new Set(), r;
|
|
782
|
-
for (let i of e) {
|
|
783
|
-
let e = Xt(i);
|
|
784
|
-
if (!e || n.has(e)) continue;
|
|
785
|
-
n.add(e);
|
|
786
|
-
let a = t(e);
|
|
787
|
-
a && (r ??= {}, r[e] = {
|
|
788
|
-
id: a.id,
|
|
789
|
-
...a.name === void 0 ? {} : { name: a.name }
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
return r;
|
|
793
|
-
}, Qt = (e, t) => {
|
|
794
|
-
if (e === t) return !0;
|
|
795
|
-
if (!e || !t) return !1;
|
|
796
|
-
let n = Object.keys(e), r = Object.keys(t);
|
|
797
|
-
return n.length === r.length && n.every((n) => e[n].id === t[n]?.id && e[n].name === t[n]?.name);
|
|
798
|
-
}, $t = (e, t) => {
|
|
799
|
-
let n = Zt(e, t), [r, i] = h(n);
|
|
800
|
-
return Qt(r, n) ? r : (i(n), n);
|
|
801
|
-
}, en = (e) => e.metadata?.custom_type === G.TIP, tn = ({ message: e }) => {
|
|
802
|
-
let t = e.metadata?.amount_text;
|
|
803
|
-
return t ? /* @__PURE__ */ W("div", {
|
|
804
|
-
className: "message-tip-pill inline-flex items-end gap-0.5 max-w-[520px] rounded-[1.5rem] bg-[#43e660] px-4 py-3 text-white",
|
|
805
|
-
children: [/* @__PURE__ */ U("span", {
|
|
806
|
-
className: "flex h-5 items-center text-[20px] leading-none",
|
|
807
|
-
"aria-hidden": "true",
|
|
808
|
-
children: "🎁"
|
|
809
|
-
}), /* @__PURE__ */ W("span", {
|
|
810
|
-
className: "text-[14px] font-bold leading-[1.43] tracking-[0.28px] text-[rgba(4,4,3,0.9)]",
|
|
811
|
-
children: [t, " tip!"]
|
|
812
|
-
})]
|
|
813
|
-
}) : null;
|
|
814
|
-
}, nn = () => {
|
|
815
|
-
let { message: e } = V("SentMessageDeliveryStatus"), { messages: t } = me("SentMessageDeliveryStatus"), n = (() => {
|
|
816
|
-
if (t) for (let e = t.length - 1; e >= 0; --e) {
|
|
817
|
-
let n = t[e];
|
|
818
|
-
if (n.type !== "system" && n.type !== "ephemeral" && n.type !== "deleted") return n.id;
|
|
819
|
-
}
|
|
820
|
-
})();
|
|
821
|
-
return e.id === n;
|
|
822
|
-
}, rn = () => nn() ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(je, {
|
|
823
|
-
weight: "bold",
|
|
824
|
-
"aria-hidden": "true"
|
|
825
|
-
}), /* @__PURE__ */ U("span", {
|
|
826
|
-
"data-testid": "sent-message-delivery-status",
|
|
827
|
-
children: "Delivered"
|
|
828
|
-
})] }) : null, an = () => nn() ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(Me, {
|
|
829
|
-
className: "sent-message-status__spinner animate-spin",
|
|
830
|
-
weight: "bold",
|
|
831
|
-
"aria-hidden": "true"
|
|
832
|
-
}), /* @__PURE__ */ U("span", {
|
|
833
|
-
"data-testid": "sent-message-sending-status",
|
|
834
|
-
children: "Sending"
|
|
835
|
-
})] }) : null, on = ({ outbound: e, onOutboundClick: t }) => {
|
|
836
|
-
let n = e.name || "Broadcast", r = /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("span", {
|
|
837
|
-
className: "sent-message-outbound-badge",
|
|
838
|
-
"aria-hidden": "true",
|
|
839
|
-
children: /* @__PURE__ */ U(Ie, { weight: "fill" })
|
|
840
|
-
}), /* @__PURE__ */ U("span", {
|
|
841
|
-
className: J("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
|
|
842
|
-
"data-testid": "sent-message-outbound-status",
|
|
843
|
-
children: n
|
|
844
|
-
})] });
|
|
845
|
-
return t ? /* @__PURE__ */ U("button", {
|
|
846
|
-
type: "button",
|
|
847
|
-
className: "inline-flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-inherit [font:inherit]",
|
|
848
|
-
"aria-label": `View broadcast ${n}`,
|
|
849
|
-
onClick: () => t(e),
|
|
850
|
-
children: r
|
|
851
|
-
}) : r;
|
|
852
|
-
}, sn = () => /* @__PURE__ */ W("span", {
|
|
853
|
-
className: "str-chat__message-status sent-message-status--failed",
|
|
854
|
-
children: [/* @__PURE__ */ U(qe, {
|
|
855
|
-
weight: "bold",
|
|
856
|
-
"aria-hidden": "true"
|
|
857
|
-
}), /* @__PURE__ */ U("span", {
|
|
858
|
-
"data-testid": "sent-message-failed-status",
|
|
859
|
-
children: "Failed to send"
|
|
860
|
-
})]
|
|
861
|
-
}), cn = ({ onOutboundClick: e, resolvedOutbound: t }) => {
|
|
862
|
-
let { isMyMessage: n, message: r, threadList: i } = V("SentMessageDeliveryStatus"), a = n(), o = nn();
|
|
863
|
-
if (i) return null;
|
|
864
|
-
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ U(sn, {});
|
|
865
|
-
if (!a) return null;
|
|
866
|
-
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ U(on, {
|
|
867
|
-
outbound: t,
|
|
868
|
-
onOutboundClick: e
|
|
869
|
-
}) : null, l = Wt(r) ? null : /* @__PURE__ */ U(L, {
|
|
870
|
-
MessageSentStatus: rn,
|
|
871
|
-
MessageDeliveredStatus: rn,
|
|
872
|
-
MessageReadStatus: rn,
|
|
873
|
-
MessageSendingStatus: en(r) ? rn : an
|
|
874
|
-
});
|
|
875
|
-
return c ? /* @__PURE__ */ W("span", {
|
|
876
|
-
className: "sent-message-status-row",
|
|
877
|
-
children: [
|
|
878
|
-
l,
|
|
879
|
-
l && o && /* @__PURE__ */ U("span", {
|
|
880
|
-
className: "sent-message-outbound-separator",
|
|
881
|
-
"aria-hidden": "true",
|
|
882
|
-
children: "•"
|
|
883
|
-
}),
|
|
884
|
-
c
|
|
885
|
-
]
|
|
886
|
-
}) : l;
|
|
887
|
-
}, ln = /^([a-z][a-z0-9+.-]*):/i, un = /* @__PURE__ */ new Set([
|
|
706
|
+
//#region src/components/LinkAttachment/components/_shared/normalizeExternalHref.ts
|
|
707
|
+
var Ot = /^([a-z][a-z0-9+.-]*):/i, kt = /* @__PURE__ */ new Set([
|
|
888
708
|
"http",
|
|
889
709
|
"https",
|
|
890
710
|
"mailto",
|
|
891
711
|
"tel",
|
|
892
712
|
"sms"
|
|
893
713
|
]);
|
|
894
|
-
function
|
|
714
|
+
function At(e) {
|
|
895
715
|
if (typeof e != "string") return;
|
|
896
716
|
let t = e.trim();
|
|
897
717
|
if (t === "") return;
|
|
898
|
-
let n =
|
|
718
|
+
let n = Ot.exec(t);
|
|
899
719
|
if (n) {
|
|
900
720
|
let e = n[1].toLowerCase();
|
|
901
|
-
return
|
|
721
|
+
return kt.has(e) ? t : void 0;
|
|
902
722
|
}
|
|
903
723
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
904
724
|
}
|
|
905
725
|
//#endregion
|
|
906
726
|
//#region src/components/LinkAttachment/components/_shared/CardCta.tsx
|
|
907
|
-
var
|
|
727
|
+
var jt = {
|
|
908
728
|
dark: {
|
|
909
729
|
primary: "bg-white text-[#121110] hover:bg-white/90",
|
|
910
730
|
secondary: "bg-white/15 text-white hover:bg-white/25"
|
|
@@ -913,11 +733,11 @@ var fn = {
|
|
|
913
733
|
primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
|
|
914
734
|
secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
|
|
915
735
|
}
|
|
916
|
-
},
|
|
917
|
-
let i = t.variant ?? "primary", a = J("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2",
|
|
736
|
+
}, Mt = ({ variant: e, cta: t, fullWidth: n = !0, standalone: r = !1 }) => {
|
|
737
|
+
let i = t.variant ?? "primary", a = J("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2", jt[e][i]), o = n ? t.label : /* @__PURE__ */ U("span", {
|
|
918
738
|
className: "min-w-0 truncate",
|
|
919
739
|
children: t.label
|
|
920
|
-
}), s =
|
|
740
|
+
}), s = At(t.href);
|
|
921
741
|
return s ? /* @__PURE__ */ U("a", {
|
|
922
742
|
href: s,
|
|
923
743
|
target: "_blank",
|
|
@@ -935,21 +755,21 @@ var fn = {
|
|
|
935
755
|
className: a,
|
|
936
756
|
children: o
|
|
937
757
|
});
|
|
938
|
-
},
|
|
758
|
+
}, Nt = {
|
|
939
759
|
dark: "text-white",
|
|
940
760
|
light: "text-black/90"
|
|
941
|
-
},
|
|
761
|
+
}, Pt = "text-white/30", Ft = {
|
|
942
762
|
dark: "text-white/55",
|
|
943
763
|
light: "text-black/55"
|
|
944
|
-
},
|
|
764
|
+
}, It = {
|
|
945
765
|
dark: "bg-white/25",
|
|
946
766
|
light: "bg-black/15"
|
|
947
|
-
},
|
|
767
|
+
}, Lt = ({ variant: e, ctaSurface: t, chinTextColor: n, title: r, placeholderTitle: i, description: a, descriptionLines: o = 1, url: s, appIcon: c, cta: l, trailingAction: u, isLoading: d = !1 }) => {
|
|
948
768
|
let f = e === "dark", p = r ?? (f ? i : void 0) ?? "", m = p.trim() !== "", h = a != null && a.trim() !== "", g = typeof s == "string" ? s.trim() : "", _ = g !== "", v = l != null;
|
|
949
769
|
if (!d && !m && !h && !_ && !v) return null;
|
|
950
|
-
let y = J("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ?
|
|
770
|
+
let y = J("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ? Pt : Nt[e])), b = J("truncate text-[12px] leading-4 tracking-[0.24px]", n == null && Ft[e]), x = J("text-[12px] leading-4 tracking-[0.24px]", o <= 1 && "truncate", n == null && Ft[e]);
|
|
951
771
|
if (d) {
|
|
952
|
-
let t = J("animate-pulse rounded",
|
|
772
|
+
let t = J("animate-pulse rounded", It[e]);
|
|
953
773
|
return /* @__PURE__ */ U("div", {
|
|
954
774
|
className: "shrink-0 px-4 py-3",
|
|
955
775
|
children: /* @__PURE__ */ W("div", {
|
|
@@ -1007,16 +827,16 @@ var fn = {
|
|
|
1007
827
|
className: "shrink-0",
|
|
1008
828
|
children: u
|
|
1009
829
|
})]
|
|
1010
|
-
}), l && /* @__PURE__ */ U(
|
|
830
|
+
}), l && /* @__PURE__ */ U(Mt, {
|
|
1011
831
|
variant: t ?? e,
|
|
1012
832
|
cta: l
|
|
1013
833
|
})]
|
|
1014
834
|
});
|
|
1015
|
-
},
|
|
1016
|
-
let f = J("messaging-link-card",
|
|
835
|
+
}, Rt = "Loading link preview", zt = J("relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden", "rounded-[20px]"), Bt = "flex h-[250px] flex-col", Vt = ({ variant: e, children: t, href: n, onClick: r, ariaLabel: i, rootRef: a, topRight: o, bgClassName: s, accentHex: c, fixedHeight: l = !1, busy: u = !1, "data-testid": d = "link-card" }) => {
|
|
836
|
+
let f = J("messaging-link-card", zt, l ? Bt : "block", s ?? (e === "dark" ? "bg-[#1e2330]" : "bg-[#f1f0ee]"), n != null || r != null ? "cursor-pointer no-underline focus-ring" : null), p = u ? {
|
|
1017
837
|
role: "status",
|
|
1018
838
|
"aria-busy": !0,
|
|
1019
|
-
"aria-label":
|
|
839
|
+
"aria-label": Rt
|
|
1020
840
|
} : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */ U("div", {
|
|
1021
841
|
"data-testid": "card-shell-top-right",
|
|
1022
842
|
className: "pointer-events-auto absolute right-3 top-3 z-10",
|
|
@@ -1054,19 +874,19 @@ var fn = {
|
|
|
1054
874
|
...p,
|
|
1055
875
|
children: [t, h]
|
|
1056
876
|
});
|
|
1057
|
-
},
|
|
877
|
+
}, Ht = {
|
|
1058
878
|
dark: "bg-white/10",
|
|
1059
879
|
light: "bg-black/5"
|
|
1060
|
-
},
|
|
880
|
+
}, Ut = {
|
|
1061
881
|
dark: "size-16 text-white/25",
|
|
1062
882
|
light: "size-16 text-black/25"
|
|
1063
|
-
},
|
|
883
|
+
}, Wt = (e, n) => !!n && !!e && t(e) === "audio", Gt = (e, n) => {
|
|
1064
884
|
if (!n || !e) return !1;
|
|
1065
885
|
let r = t(e);
|
|
1066
886
|
return r === "video" || r === "audio";
|
|
1067
|
-
},
|
|
887
|
+
}, Kt = "bg-[#F2F3F4]", qt = ({ variant: r, thumbnailUrl: i, sourceUrl: o, title: s, mimeType: c = "image/*", topLeft: l, topRight: u, isLoading: d = !1, onImageError: f }) => {
|
|
1068
888
|
let p = t(c), m = !!o && p === "video", h = a(i);
|
|
1069
|
-
return !d &&
|
|
889
|
+
return !d && Wt(c, o) ? /* @__PURE__ */ U("div", {
|
|
1070
890
|
className: "p-3",
|
|
1071
891
|
children: /* @__PURE__ */ U("audio", {
|
|
1072
892
|
...e,
|
|
@@ -1083,7 +903,7 @@ var fn = {
|
|
|
1083
903
|
children: [
|
|
1084
904
|
d ? /* @__PURE__ */ U("div", {
|
|
1085
905
|
"data-testid": "card-thumbnail-skeleton",
|
|
1086
|
-
className: J("h-full w-full animate-pulse",
|
|
906
|
+
className: J("h-full w-full animate-pulse", Ht[r]),
|
|
1087
907
|
"aria-hidden": !0
|
|
1088
908
|
}) : m ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("video", {
|
|
1089
909
|
"data-testid": "card-thumbnail-video",
|
|
@@ -1110,9 +930,9 @@ var fn = {
|
|
|
1110
930
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
1111
931
|
}) : /* @__PURE__ */ U("div", {
|
|
1112
932
|
"data-testid": "card-thumbnail-placeholder",
|
|
1113
|
-
className: J("flex h-full w-full items-center justify-center",
|
|
933
|
+
className: J("flex h-full w-full items-center justify-center", Ht[r]),
|
|
1114
934
|
children: n(c, {
|
|
1115
|
-
className:
|
|
935
|
+
className: Ut[r],
|
|
1116
936
|
weight: "regular"
|
|
1117
937
|
})
|
|
1118
938
|
}),
|
|
@@ -1128,25 +948,25 @@ var fn = {
|
|
|
1128
948
|
}) : null
|
|
1129
949
|
]
|
|
1130
950
|
});
|
|
1131
|
-
},
|
|
1132
|
-
function
|
|
951
|
+
}, Jt = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
952
|
+
function Yt(e) {
|
|
1133
953
|
let t = e.trim();
|
|
1134
954
|
return t.startsWith("#") ? t : `#${t}`;
|
|
1135
955
|
}
|
|
1136
956
|
//#endregion
|
|
1137
957
|
//#region src/components/LinkAttachment/components/_shared/useChinPalette.ts
|
|
1138
|
-
var
|
|
1139
|
-
dark:
|
|
1140
|
-
light:
|
|
958
|
+
var Xt = "#FFFFFF", Zt = "#040403", Qt = {
|
|
959
|
+
dark: Xt,
|
|
960
|
+
light: Zt
|
|
1141
961
|
};
|
|
1142
|
-
function
|
|
962
|
+
function $t({ variant: e, accentColor: t, status: n = "ready", layout: r = "featured", thumbnailUrl: i, mimeType: a, sourceUrl: s }) {
|
|
1143
963
|
let [c, l] = o.useState(!1);
|
|
1144
964
|
o.useEffect(() => {
|
|
1145
965
|
l(!1);
|
|
1146
966
|
}, [i]);
|
|
1147
967
|
let u = o.useCallback(() => {
|
|
1148
968
|
l(!0);
|
|
1149
|
-
}, []), d =
|
|
969
|
+
}, []), d = Wt(a, s), f = r === "featured" && i && !d && !c && n === "ready" && t != null && Jt.test(t.trim()) ? Yt(t) : void 0, p = d ? Zt : Qt[e];
|
|
1150
970
|
return {
|
|
1151
971
|
thumbnailUrl: c ? void 0 : i,
|
|
1152
972
|
accentHex: f,
|
|
@@ -1158,8 +978,8 @@ function Pn({ variant: e, accentColor: t, status: n = "ready", layout: r = "feat
|
|
|
1158
978
|
}
|
|
1159
979
|
//#endregion
|
|
1160
980
|
//#region src/components/LinkAttachment/components/Composer/Card.tsx
|
|
1161
|
-
var
|
|
1162
|
-
let g = c === "classic", _ =
|
|
981
|
+
var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white transition-colors duration-150 hover:bg-[#2a2928] focus-ring", tn = "relative before:absolute before:-inset-[10px] before:content-['']", nn = ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onDismiss: p, onEditClick: m, dismissLabel: h = "Dismiss attachment" }) => {
|
|
982
|
+
let g = c === "classic", _ = Wt(a, s), v = $t({
|
|
1163
983
|
variant: "dark",
|
|
1164
984
|
accentColor: d,
|
|
1165
985
|
status: f,
|
|
@@ -1171,7 +991,7 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1171
991
|
type: "button",
|
|
1172
992
|
onClick: p,
|
|
1173
993
|
"aria-label": h,
|
|
1174
|
-
className: J(
|
|
994
|
+
className: J(en, !_ && tn),
|
|
1175
995
|
children: /* @__PURE__ */ U(Je, {
|
|
1176
996
|
className: "size-3",
|
|
1177
997
|
weight: "bold"
|
|
@@ -1186,14 +1006,14 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1186
1006
|
weight: "regular"
|
|
1187
1007
|
})
|
|
1188
1008
|
}) : void 0;
|
|
1189
|
-
return _ && !v.isLoading ? /* @__PURE__ */ U(
|
|
1009
|
+
return _ && !v.isLoading ? /* @__PURE__ */ U(Vt, {
|
|
1190
1010
|
variant: "dark",
|
|
1191
|
-
bgClassName:
|
|
1011
|
+
bgClassName: Kt,
|
|
1192
1012
|
children: /* @__PURE__ */ W("div", {
|
|
1193
1013
|
className: "flex items-center gap-2 pr-3",
|
|
1194
1014
|
children: [/* @__PURE__ */ U("div", {
|
|
1195
1015
|
className: "min-w-0 flex-1",
|
|
1196
|
-
children: /* @__PURE__ */ U(
|
|
1016
|
+
children: /* @__PURE__ */ U(qt, {
|
|
1197
1017
|
variant: "dark",
|
|
1198
1018
|
sourceUrl: s,
|
|
1199
1019
|
title: e,
|
|
@@ -1204,13 +1024,13 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1204
1024
|
children: y
|
|
1205
1025
|
})]
|
|
1206
1026
|
})
|
|
1207
|
-
}) : /* @__PURE__ */ W(
|
|
1027
|
+
}) : /* @__PURE__ */ W(Vt, {
|
|
1208
1028
|
variant: "dark",
|
|
1209
1029
|
fixedHeight: !g,
|
|
1210
1030
|
accentHex: v.accentHex,
|
|
1211
1031
|
busy: v.isLoading,
|
|
1212
1032
|
topRight: g ? y : void 0,
|
|
1213
|
-
children: [!g && /* @__PURE__ */ U(
|
|
1033
|
+
children: [!g && /* @__PURE__ */ U(qt, {
|
|
1214
1034
|
variant: "dark",
|
|
1215
1035
|
thumbnailUrl: v.thumbnailUrl,
|
|
1216
1036
|
sourceUrl: s,
|
|
@@ -1219,7 +1039,7 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1219
1039
|
topRight: y,
|
|
1220
1040
|
isLoading: v.isLoading,
|
|
1221
1041
|
onImageError: v.onImageError
|
|
1222
|
-
}), /* @__PURE__ */ U(
|
|
1042
|
+
}), /* @__PURE__ */ U(Lt, {
|
|
1223
1043
|
chinTextColor: v.chinTextColor,
|
|
1224
1044
|
variant: "dark",
|
|
1225
1045
|
ctaSurface: v.surface,
|
|
@@ -1234,7 +1054,7 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1234
1054
|
isLoading: v.isLoading
|
|
1235
1055
|
})]
|
|
1236
1056
|
});
|
|
1237
|
-
},
|
|
1057
|
+
}, rn = ({ accentHex: e, side: t, visible: n, children: r }) => n ? /* @__PURE__ */ W("div", {
|
|
1238
1058
|
className: "relative isolate w-fit",
|
|
1239
1059
|
children: [r, /* @__PURE__ */ U("span", {
|
|
1240
1060
|
"aria-hidden": !0,
|
|
@@ -1243,10 +1063,10 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1243
1063
|
style: e ? { "--accent": e } : void 0,
|
|
1244
1064
|
className: J("messaging-link-card-tail", t === "receiver" && "messaging-link-card-tail--received")
|
|
1245
1065
|
})]
|
|
1246
|
-
}) : /* @__PURE__ */ U(H, { children: r }),
|
|
1247
|
-
Composer:
|
|
1066
|
+
}) : /* @__PURE__ */ U(H, { children: r }), an = {
|
|
1067
|
+
Composer: nn,
|
|
1248
1068
|
Sent: ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onClick: p, groupPosition: m = "single" }) => {
|
|
1249
|
-
let h =
|
|
1069
|
+
let h = Gt(a, s), g = At(i), _ = u == null && g != null && !h ? g : void 0, v = u == null && !h && _ != null ? p : void 0, y = f !== "loading" && Wt(a, s), b = $t({
|
|
1250
1070
|
variant: "dark",
|
|
1251
1071
|
accentColor: d,
|
|
1252
1072
|
status: f,
|
|
@@ -1255,19 +1075,19 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1255
1075
|
mimeType: a,
|
|
1256
1076
|
sourceUrl: s
|
|
1257
1077
|
});
|
|
1258
|
-
return /* @__PURE__ */ U(
|
|
1078
|
+
return /* @__PURE__ */ U(rn, {
|
|
1259
1079
|
accentHex: b.accentHex,
|
|
1260
1080
|
side: "sender",
|
|
1261
1081
|
visible: !y && (m === "single" || m === "end"),
|
|
1262
|
-
children: /* @__PURE__ */ W(
|
|
1082
|
+
children: /* @__PURE__ */ W(Vt, {
|
|
1263
1083
|
variant: "dark",
|
|
1264
1084
|
href: _,
|
|
1265
1085
|
onClick: v,
|
|
1266
1086
|
fixedHeight: c === "featured" && !y,
|
|
1267
1087
|
accentHex: b.accentHex,
|
|
1268
1088
|
busy: b.isLoading,
|
|
1269
|
-
bgClassName: y ?
|
|
1270
|
-
children: [c === "featured" && /* @__PURE__ */ U(
|
|
1089
|
+
bgClassName: y ? Kt : void 0,
|
|
1090
|
+
children: [c === "featured" && /* @__PURE__ */ U(qt, {
|
|
1271
1091
|
variant: "dark",
|
|
1272
1092
|
thumbnailUrl: b.thumbnailUrl,
|
|
1273
1093
|
sourceUrl: s,
|
|
@@ -1275,7 +1095,7 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1275
1095
|
mimeType: a,
|
|
1276
1096
|
isLoading: b.isLoading,
|
|
1277
1097
|
onImageError: b.onImageError
|
|
1278
|
-
}), /* @__PURE__ */ U(
|
|
1098
|
+
}), /* @__PURE__ */ U(Lt, {
|
|
1279
1099
|
chinTextColor: b.chinTextColor,
|
|
1280
1100
|
variant: "dark",
|
|
1281
1101
|
ctaSurface: b.surface,
|
|
@@ -1292,12 +1112,12 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1292
1112
|
});
|
|
1293
1113
|
},
|
|
1294
1114
|
Received: ({ title: e, description: t, descriptionLines: n, url: r, mimeType: i, thumbnailUrl: a, sourceUrl: o, layout: s = "featured", appIcon: c, cta: l, accentColor: u, status: d = "ready", onClick: f, groupPosition: p = "single" }) => {
|
|
1295
|
-
let m =
|
|
1115
|
+
let m = Gt(i, o), h = At(r), g = l == null && h != null && !m ? h : void 0, _ = l == null && !m ? f : void 0, v = d !== "loading" && Wt(i, o) ? Kt : void 0, y = l && f ? {
|
|
1296
1116
|
...l,
|
|
1297
1117
|
onClick: () => {
|
|
1298
1118
|
f(), l.onClick?.();
|
|
1299
1119
|
}
|
|
1300
|
-
} : l, b =
|
|
1120
|
+
} : l, b = $t({
|
|
1301
1121
|
variant: "light",
|
|
1302
1122
|
accentColor: u,
|
|
1303
1123
|
status: d,
|
|
@@ -1306,11 +1126,11 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1306
1126
|
mimeType: i,
|
|
1307
1127
|
sourceUrl: o
|
|
1308
1128
|
});
|
|
1309
|
-
return /* @__PURE__ */ U(
|
|
1129
|
+
return /* @__PURE__ */ U(rn, {
|
|
1310
1130
|
accentHex: b.accentHex,
|
|
1311
1131
|
side: "receiver",
|
|
1312
1132
|
visible: v == null && (p === "single" || p === "end"),
|
|
1313
|
-
children: /* @__PURE__ */ W(
|
|
1133
|
+
children: /* @__PURE__ */ W(Vt, {
|
|
1314
1134
|
variant: "light",
|
|
1315
1135
|
href: g,
|
|
1316
1136
|
onClick: _,
|
|
@@ -1320,7 +1140,7 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1320
1140
|
busy: b.isLoading,
|
|
1321
1141
|
bgClassName: v,
|
|
1322
1142
|
"data-testid": "link-attachment",
|
|
1323
|
-
children: [s === "featured" && /* @__PURE__ */ U(
|
|
1143
|
+
children: [s === "featured" && /* @__PURE__ */ U(qt, {
|
|
1324
1144
|
variant: "light",
|
|
1325
1145
|
thumbnailUrl: b.thumbnailUrl,
|
|
1326
1146
|
sourceUrl: o,
|
|
@@ -1328,7 +1148,7 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1328
1148
|
mimeType: i,
|
|
1329
1149
|
isLoading: b.isLoading,
|
|
1330
1150
|
onImageError: b.onImageError
|
|
1331
|
-
}), /* @__PURE__ */ U(
|
|
1151
|
+
}), /* @__PURE__ */ U(Lt, {
|
|
1332
1152
|
chinTextColor: b.chinTextColor,
|
|
1333
1153
|
variant: "light",
|
|
1334
1154
|
ctaSurface: b.surface,
|
|
@@ -1343,16 +1163,199 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1343
1163
|
})
|
|
1344
1164
|
});
|
|
1345
1165
|
}
|
|
1346
|
-
}
|
|
1166
|
+
};
|
|
1167
|
+
//#endregion
|
|
1168
|
+
//#region src/components/MediaMessage/index.tsx
|
|
1169
|
+
function on(e) {
|
|
1170
|
+
return e.type === "link" || !!e.og_scrape_url?.trim();
|
|
1171
|
+
}
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region src/components/CustomMessage/context.tsx
|
|
1174
|
+
var sn = { LockedAttachment: { isUnlocking: () => !1 } }, cn = c({}), ln = cn.Provider;
|
|
1175
|
+
function un(e) {
|
|
1176
|
+
return u(cn)[e] ?? sn[e];
|
|
1177
|
+
}
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region src/components/CustomMessage/LockedAttachment/index.tsx
|
|
1180
|
+
var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import("./Card-BhwBkgxI.js")), pn = () => /* @__PURE__ */ U("div", {
|
|
1181
|
+
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
1182
|
+
"aria-hidden": !0
|
|
1183
|
+
}), mn = (e) => /* @__PURE__ */ U(s, {
|
|
1184
|
+
fallback: /* @__PURE__ */ U(pn, {}),
|
|
1185
|
+
children: e.contentType === "text" ? /* @__PURE__ */ U(dn, { ...e }) : /* @__PURE__ */ U(fn, { ...e })
|
|
1186
|
+
}), hn = ({ size: e = 15 }) => /* @__PURE__ */ U("svg", {
|
|
1187
|
+
width: e,
|
|
1188
|
+
height: e,
|
|
1189
|
+
viewBox: "0 0 15 15",
|
|
1190
|
+
fill: "none",
|
|
1191
|
+
"aria-hidden": "true",
|
|
1192
|
+
children: /* @__PURE__ */ U("path", {
|
|
1193
|
+
d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
|
|
1194
|
+
fill: "currentColor",
|
|
1195
|
+
fillOpacity: .55
|
|
1196
|
+
})
|
|
1197
|
+
}), gn = (e) => e.metadata?.custom_type === G.PAID, _n = (e) => e.metadata?.custom_type === G.CHATBOT, vn = (e) => e.metadata?.custom_type === G.ATTACHMENT, yn = (e) => vn(e) && e.metadata?.attachment_content_type === "text", bn = (e) => vn(e) && e.metadata?.attachment_content_type !== "text", xn = (e) => gn(e) && !!e.metadata?.amount_text, Sn = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
|
|
1198
|
+
let r = gn(e), i = _n(e);
|
|
1199
|
+
if (!r && !i) return null;
|
|
1200
|
+
if (r) {
|
|
1201
|
+
let t = e.metadata?.amount_text;
|
|
1202
|
+
return t ? /* @__PURE__ */ W("div", {
|
|
1203
|
+
className: "message-tag--paid inline-flex items-center gap-1 text-[12px] font-medium leading-[2] text-[#016630]",
|
|
1204
|
+
children: [/* @__PURE__ */ U(Fe, { size: 12 }), /* @__PURE__ */ W("span", { children: [
|
|
1205
|
+
"Delivered with ",
|
|
1206
|
+
t,
|
|
1207
|
+
" message"
|
|
1208
|
+
] })]
|
|
1209
|
+
}) : null;
|
|
1210
|
+
}
|
|
1211
|
+
let a = t && n, o = a ? "Sent with AI" : "Sent by AI Assistant", s = a ? "justify-end gap-2 text-black/30" : t ? "w-full justify-start gap-1.5 mt-3 px-4 text-white/55" : "w-full justify-start gap-1.5 mt-3 px-4 text-black/30", c = /* @__PURE__ */ U("span", {
|
|
1212
|
+
className: "text-left",
|
|
1213
|
+
children: o
|
|
1214
|
+
}), l = /* @__PURE__ */ U("span", {
|
|
1215
|
+
className: "inline-flex items-center leading-none",
|
|
1216
|
+
children: /* @__PURE__ */ U(hn, { size: a ? 12 : 15 })
|
|
1217
|
+
});
|
|
1218
|
+
return /* @__PURE__ */ U("div", {
|
|
1219
|
+
className: `inline-flex items-center text-[10px] font-normal leading-4 tracking-[0.2px] ${s}`,
|
|
1220
|
+
"data-testid": "message-chatbot-indicator",
|
|
1221
|
+
children: t && !a ? /* @__PURE__ */ W(H, { children: [c, l] }) : /* @__PURE__ */ W(H, { children: [l, c] })
|
|
1222
|
+
});
|
|
1223
|
+
}, Cn = "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%", wn = {
|
|
1224
|
+
me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
1225
|
+
other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
1226
|
+
}, Tn = ({ side: e }) => /* @__PURE__ */ U("span", {
|
|
1227
|
+
"aria-hidden": "true",
|
|
1228
|
+
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
1229
|
+
style: {
|
|
1230
|
+
insetInlineEnd: e === "me" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
1231
|
+
insetInlineStart: e === "other" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
1232
|
+
transform: e === "other" ? "scaleX(-1)" : void 0,
|
|
1233
|
+
transformOrigin: "center",
|
|
1234
|
+
backgroundColor: wn[e],
|
|
1235
|
+
WebkitMask: Cn,
|
|
1236
|
+
mask: Cn
|
|
1237
|
+
}
|
|
1238
|
+
}), En = c(void 0), Dn = (e) => {
|
|
1239
|
+
let t = e.metadata?.outbound_id;
|
|
1240
|
+
return typeof t == "string" ? t : void 0;
|
|
1241
|
+
}, On = (e, t) => {
|
|
1242
|
+
if (!t || !e?.length) return;
|
|
1243
|
+
let n = /* @__PURE__ */ new Set(), r;
|
|
1244
|
+
for (let i of e) {
|
|
1245
|
+
let e = Dn(i);
|
|
1246
|
+
if (!e || n.has(e)) continue;
|
|
1247
|
+
n.add(e);
|
|
1248
|
+
let a = t(e);
|
|
1249
|
+
a && (r ??= {}, r[e] = {
|
|
1250
|
+
id: a.id,
|
|
1251
|
+
...a.name === void 0 ? {} : { name: a.name }
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
return r;
|
|
1255
|
+
}, kn = (e, t) => {
|
|
1256
|
+
if (e === t) return !0;
|
|
1257
|
+
if (!e || !t) return !1;
|
|
1258
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
1259
|
+
return n.length === r.length && n.every((n) => e[n].id === t[n]?.id && e[n].name === t[n]?.name);
|
|
1260
|
+
}, An = (e, t) => {
|
|
1261
|
+
let n = On(e, t), [r, i] = h(n);
|
|
1262
|
+
return kn(r, n) ? r : (i(n), n);
|
|
1263
|
+
}, jn = (e) => e.metadata?.custom_type === G.TIP, Mn = ({ message: e }) => {
|
|
1264
|
+
let t = e.metadata?.amount_text;
|
|
1265
|
+
return t ? /* @__PURE__ */ W("div", {
|
|
1266
|
+
className: "message-tip-pill inline-flex items-end gap-0.5 max-w-[520px] rounded-[1.5rem] bg-[#43e660] px-4 py-3 text-white",
|
|
1267
|
+
children: [/* @__PURE__ */ U("span", {
|
|
1268
|
+
className: "flex h-5 items-center text-[20px] leading-none",
|
|
1269
|
+
"aria-hidden": "true",
|
|
1270
|
+
children: "🎁"
|
|
1271
|
+
}), /* @__PURE__ */ W("span", {
|
|
1272
|
+
className: "text-[14px] font-bold leading-[1.43] tracking-[0.28px] text-[rgba(4,4,3,0.9)]",
|
|
1273
|
+
children: [t, " tip!"]
|
|
1274
|
+
})]
|
|
1275
|
+
}) : null;
|
|
1276
|
+
}, Nn = () => {
|
|
1277
|
+
let { message: e } = V("SentMessageDeliveryStatus"), { messages: t } = me("SentMessageDeliveryStatus"), n = (() => {
|
|
1278
|
+
if (t) for (let e = t.length - 1; e >= 0; --e) {
|
|
1279
|
+
let n = t[e];
|
|
1280
|
+
if (n.type !== "system" && n.type !== "ephemeral" && n.type !== "deleted") return n.id;
|
|
1281
|
+
}
|
|
1282
|
+
})();
|
|
1283
|
+
return e.id === n;
|
|
1284
|
+
}, Pn = () => Nn() ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(je, {
|
|
1285
|
+
weight: "bold",
|
|
1286
|
+
"aria-hidden": "true"
|
|
1287
|
+
}), /* @__PURE__ */ U("span", {
|
|
1288
|
+
"data-testid": "sent-message-delivery-status",
|
|
1289
|
+
children: "Delivered"
|
|
1290
|
+
})] }) : null, Fn = () => Nn() ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(Me, {
|
|
1291
|
+
className: "sent-message-status__spinner animate-spin",
|
|
1292
|
+
weight: "bold",
|
|
1293
|
+
"aria-hidden": "true"
|
|
1294
|
+
}), /* @__PURE__ */ U("span", {
|
|
1295
|
+
"data-testid": "sent-message-sending-status",
|
|
1296
|
+
children: "Sending"
|
|
1297
|
+
})] }) : null, In = ({ outbound: e, onOutboundClick: t }) => {
|
|
1298
|
+
let n = e.name || "Broadcast", r = /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("span", {
|
|
1299
|
+
className: "sent-message-outbound-badge",
|
|
1300
|
+
"aria-hidden": "true",
|
|
1301
|
+
children: /* @__PURE__ */ U(Ie, { weight: "fill" })
|
|
1302
|
+
}), /* @__PURE__ */ U("span", {
|
|
1303
|
+
className: J("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
|
|
1304
|
+
"data-testid": "sent-message-outbound-status",
|
|
1305
|
+
children: n
|
|
1306
|
+
})] });
|
|
1307
|
+
return t ? /* @__PURE__ */ U("button", {
|
|
1308
|
+
type: "button",
|
|
1309
|
+
className: "inline-flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-inherit [font:inherit]",
|
|
1310
|
+
"aria-label": `View broadcast ${n}`,
|
|
1311
|
+
onClick: () => t(e),
|
|
1312
|
+
children: r
|
|
1313
|
+
}) : r;
|
|
1314
|
+
}, Ln = () => /* @__PURE__ */ W("span", {
|
|
1315
|
+
className: "str-chat__message-status sent-message-status--failed",
|
|
1316
|
+
children: [/* @__PURE__ */ U(qe, {
|
|
1317
|
+
weight: "bold",
|
|
1318
|
+
"aria-hidden": "true"
|
|
1319
|
+
}), /* @__PURE__ */ U("span", {
|
|
1320
|
+
"data-testid": "sent-message-failed-status",
|
|
1321
|
+
children: "Failed to send"
|
|
1322
|
+
})]
|
|
1323
|
+
}), Rn = ({ onOutboundClick: e, resolvedOutbound: t }) => {
|
|
1324
|
+
let { isMyMessage: n, message: r, threadList: i } = V("SentMessageDeliveryStatus"), a = n(), o = Nn();
|
|
1325
|
+
if (i) return null;
|
|
1326
|
+
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ U(Ln, {});
|
|
1327
|
+
if (!a) return null;
|
|
1328
|
+
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ U(In, {
|
|
1329
|
+
outbound: t,
|
|
1330
|
+
onOutboundClick: e
|
|
1331
|
+
}) : null, l = xn(r) ? null : /* @__PURE__ */ U(L, {
|
|
1332
|
+
MessageSentStatus: Pn,
|
|
1333
|
+
MessageDeliveredStatus: Pn,
|
|
1334
|
+
MessageReadStatus: Pn,
|
|
1335
|
+
MessageSendingStatus: jn(r) ? Pn : Fn
|
|
1336
|
+
});
|
|
1337
|
+
return c ? /* @__PURE__ */ W("span", {
|
|
1338
|
+
className: "sent-message-status-row",
|
|
1339
|
+
children: [
|
|
1340
|
+
l,
|
|
1341
|
+
l && o && /* @__PURE__ */ U("span", {
|
|
1342
|
+
className: "sent-message-outbound-separator",
|
|
1343
|
+
"aria-hidden": "true",
|
|
1344
|
+
children: "•"
|
|
1345
|
+
}),
|
|
1346
|
+
c
|
|
1347
|
+
]
|
|
1348
|
+
}) : l;
|
|
1349
|
+
}, zn = {
|
|
1347
1350
|
dark: "bg-[#1e2330]",
|
|
1348
1351
|
light: "bg-[#f2f1ef]"
|
|
1349
|
-
},
|
|
1352
|
+
}, Bn = {
|
|
1350
1353
|
dark: "text-white",
|
|
1351
1354
|
light: "text-[#000000]"
|
|
1352
|
-
},
|
|
1355
|
+
}, Vn = {
|
|
1353
1356
|
dark: "border-white/[0.08]",
|
|
1354
1357
|
light: "border-black/[0.08]"
|
|
1355
|
-
},
|
|
1358
|
+
}, Hn = (e) => e === "dark" ? "sender" : "receiver", Un = {
|
|
1356
1359
|
sender: {
|
|
1357
1360
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1358
1361
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1365,18 +1368,18 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1365
1368
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
1366
1369
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
1367
1370
|
}
|
|
1368
|
-
},
|
|
1369
|
-
let u = t != null && t !== "", d = o ??
|
|
1371
|
+
}, Wn = ({ variant: e, text: t, bordered: n = !0, groupPosition: r = "single", widthClassName: i = "w-[280px]", paddingClassName: a = "px-2 py-2", radiusClassName: o, className: s, children: c, "data-testid": l }) => {
|
|
1372
|
+
let u = t != null && t !== "", d = o ?? Un[Hn(e)][r];
|
|
1370
1373
|
return /* @__PURE__ */ W("div", {
|
|
1371
1374
|
"data-testid": l,
|
|
1372
1375
|
"data-group-position": r,
|
|
1373
|
-
className: J("relative", i, "overflow-hidden", a, u && "pb-0", d,
|
|
1376
|
+
className: J("relative", i, "overflow-hidden", a, u && "pb-0", d, zn[e], Bn[e], n && "border", n && Vn[e], s),
|
|
1374
1377
|
children: [c, u ? /* @__PURE__ */ U("p", {
|
|
1375
1378
|
className: J("whitespace-pre-wrap break-words leading-snug hyphens-manual", "pb-2 pt-2", "px-2"),
|
|
1376
1379
|
children: t
|
|
1377
1380
|
}) : null]
|
|
1378
1381
|
});
|
|
1379
|
-
},
|
|
1382
|
+
}, Gn = ({ onClick: e, variant: t = "overlay", ariaLabel: n = "Dismiss attachment" }) => /* @__PURE__ */ U("button", {
|
|
1380
1383
|
type: "button",
|
|
1381
1384
|
onClick: (t) => {
|
|
1382
1385
|
t.stopPropagation(), e();
|
|
@@ -1387,11 +1390,11 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1387
1390
|
className: "size-3",
|
|
1388
1391
|
weight: "bold"
|
|
1389
1392
|
})
|
|
1390
|
-
}),
|
|
1393
|
+
}), Kn = (e) => e === "received" ? "light" : "dark", qn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Jn = ({ src: e, mimeType: t, filename: n, items: r }) => r && r.length > 0 ? r : e ? [{
|
|
1391
1394
|
src: e,
|
|
1392
1395
|
mimeType: t,
|
|
1393
1396
|
filename: n
|
|
1394
|
-
}] : [],
|
|
1397
|
+
}] : [], Yn = ({ item: t, preload: n, trailingAction: r }) => /* @__PURE__ */ W("div", {
|
|
1395
1398
|
className: "flex items-center gap-2",
|
|
1396
1399
|
children: [/* @__PURE__ */ U("audio", {
|
|
1397
1400
|
...e,
|
|
@@ -1404,8 +1407,8 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1404
1407
|
type: t.mimeType
|
|
1405
1408
|
}) : null
|
|
1406
1409
|
}), r ?? null]
|
|
1407
|
-
}),
|
|
1408
|
-
let l =
|
|
1410
|
+
}), Xn = ({ state: e, src: t, mimeType: n, filename: r, items: i, text: a, groupPosition: o, preload: s, onDismiss: c }) => {
|
|
1411
|
+
let l = Kn(e), u = e === "composer" && !!c, d = Jn({
|
|
1409
1412
|
src: t,
|
|
1410
1413
|
mimeType: n,
|
|
1411
1414
|
filename: r,
|
|
@@ -1413,43 +1416,43 @@ var Fn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1413
1416
|
});
|
|
1414
1417
|
if (d.length === 0) return null;
|
|
1415
1418
|
let f = s ?? (d.length > 1 ? "none" : "metadata");
|
|
1416
|
-
return /* @__PURE__ */ U(
|
|
1419
|
+
return /* @__PURE__ */ U(Wn, {
|
|
1417
1420
|
variant: l,
|
|
1418
1421
|
text: a,
|
|
1419
1422
|
groupPosition: o,
|
|
1420
1423
|
"data-testid": "audio-attachment",
|
|
1421
1424
|
children: /* @__PURE__ */ U("div", {
|
|
1422
1425
|
className: "flex flex-col gap-2",
|
|
1423
|
-
children: d.map((e, t) => /* @__PURE__ */ U(
|
|
1426
|
+
children: d.map((e, t) => /* @__PURE__ */ U(Yn, {
|
|
1424
1427
|
item: e,
|
|
1425
1428
|
preload: f,
|
|
1426
|
-
trailingAction: u && t === 0 ? /* @__PURE__ */ U(
|
|
1429
|
+
trailingAction: u && t === 0 ? /* @__PURE__ */ U(Gn, {
|
|
1427
1430
|
onClick: c,
|
|
1428
1431
|
variant: "inline"
|
|
1429
1432
|
}) : void 0
|
|
1430
1433
|
}, `${e.src}-${t}`))
|
|
1431
1434
|
})
|
|
1432
1435
|
});
|
|
1433
|
-
},
|
|
1434
|
-
Composer: (e) => /* @__PURE__ */ U(
|
|
1436
|
+
}, Zn = {
|
|
1437
|
+
Composer: (e) => /* @__PURE__ */ U(Xn, {
|
|
1435
1438
|
...e,
|
|
1436
1439
|
state: "composer"
|
|
1437
1440
|
}),
|
|
1438
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
1441
|
+
Sent: (e) => /* @__PURE__ */ U(Xn, {
|
|
1439
1442
|
...e,
|
|
1440
1443
|
state: "sent"
|
|
1441
1444
|
}),
|
|
1442
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
1445
|
+
Received: (e) => /* @__PURE__ */ U(Xn, {
|
|
1443
1446
|
...e,
|
|
1444
1447
|
state: "received"
|
|
1445
1448
|
})
|
|
1446
1449
|
};
|
|
1447
1450
|
//#endregion
|
|
1448
1451
|
//#region src/components/MessageAttachment/_shared/fileMeta.ts
|
|
1449
|
-
function
|
|
1452
|
+
function Qn(e) {
|
|
1450
1453
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(2)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
|
|
1451
1454
|
}
|
|
1452
|
-
var
|
|
1455
|
+
var $n = {
|
|
1453
1456
|
pdf: "PDF",
|
|
1454
1457
|
doc: "DOC",
|
|
1455
1458
|
xls: "XLS",
|
|
@@ -1459,7 +1462,7 @@ var er = {
|
|
|
1459
1462
|
text: "TXT",
|
|
1460
1463
|
markdown: "MD"
|
|
1461
1464
|
};
|
|
1462
|
-
function
|
|
1465
|
+
function er(e, n) {
|
|
1463
1466
|
if (n) {
|
|
1464
1467
|
let e = n.lastIndexOf(".");
|
|
1465
1468
|
if (e > 0 && e < n.length - 1) {
|
|
@@ -1469,17 +1472,17 @@ function tr(e, n) {
|
|
|
1469
1472
|
}
|
|
1470
1473
|
if (!e) return;
|
|
1471
1474
|
if (t(e) === "document") {
|
|
1472
|
-
let t =
|
|
1475
|
+
let t = $n[i(e)];
|
|
1473
1476
|
if (t) return t;
|
|
1474
1477
|
if (e === "application/octet-stream") return;
|
|
1475
1478
|
}
|
|
1476
1479
|
let r = e.split("/")[1];
|
|
1477
1480
|
if (!(!r || r === "*")) return r.toUpperCase();
|
|
1478
1481
|
}
|
|
1479
|
-
function
|
|
1480
|
-
return [
|
|
1482
|
+
function tr(e, t, n) {
|
|
1483
|
+
return [er(e, t), typeof n == "number" && n > 0 ? Qn(n) : void 0].filter(Boolean).join(" · ") || void 0;
|
|
1481
1484
|
}
|
|
1482
|
-
function
|
|
1485
|
+
function Q(e) {
|
|
1483
1486
|
try {
|
|
1484
1487
|
let t = new URL(e).pathname.split("/").pop();
|
|
1485
1488
|
return t && t.length > 0 ? decodeURIComponent(t) : "download";
|
|
@@ -1489,21 +1492,21 @@ function Z(e) {
|
|
|
1489
1492
|
}
|
|
1490
1493
|
//#endregion
|
|
1491
1494
|
//#region src/components/MessageAttachment/_shared/CompactDocumentRow.tsx
|
|
1492
|
-
var
|
|
1495
|
+
var nr = {
|
|
1493
1496
|
dark: "text-white/55",
|
|
1494
1497
|
light: "text-black/65"
|
|
1495
|
-
},
|
|
1498
|
+
}, rr = {
|
|
1496
1499
|
dark: "bg-white/10",
|
|
1497
1500
|
light: "bg-black/5"
|
|
1498
|
-
},
|
|
1501
|
+
}, ir = {
|
|
1499
1502
|
dark: "text-white/85",
|
|
1500
1503
|
light: "text-black/85"
|
|
1501
|
-
},
|
|
1502
|
-
let l = r ?? t ?? "File", u =
|
|
1503
|
-
className: J("flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1504
|
+
}, ar = ({ variant: e, filename: t, title: r, mimeType: i = "application/octet-stream", fileSize: a, onActivate: o, activateLabel: s, trailingAction: c }) => {
|
|
1505
|
+
let l = r ?? t ?? "File", u = tr(i, t, a), d = /* @__PURE__ */ U("div", {
|
|
1506
|
+
className: J("flex size-10 shrink-0 items-center justify-center rounded-sm", rr[e]),
|
|
1504
1507
|
"aria-hidden": !0,
|
|
1505
1508
|
children: n(i, {
|
|
1506
|
-
className: J("size-6",
|
|
1509
|
+
className: J("size-6", ir[e]),
|
|
1507
1510
|
weight: "regular"
|
|
1508
1511
|
})
|
|
1509
1512
|
}), f = /* @__PURE__ */ W("div", {
|
|
@@ -1512,7 +1515,7 @@ var rr = {
|
|
|
1512
1515
|
className: "truncate font-medium leading-snug",
|
|
1513
1516
|
children: l
|
|
1514
1517
|
}), u ? /* @__PURE__ */ U("p", {
|
|
1515
|
-
className: J("truncate text-xs leading-4",
|
|
1518
|
+
className: J("truncate text-xs leading-4", nr[e]),
|
|
1516
1519
|
children: u
|
|
1517
1520
|
}) : null]
|
|
1518
1521
|
}), p = o ? /* @__PURE__ */ W("button", {
|
|
@@ -1532,8 +1535,8 @@ var rr = {
|
|
|
1532
1535
|
};
|
|
1533
1536
|
//#endregion
|
|
1534
1537
|
//#region src/components/MessageAttachment/_shared/triggerDownload.ts
|
|
1535
|
-
async function
|
|
1536
|
-
let n = t ??
|
|
1538
|
+
async function or(e, t) {
|
|
1539
|
+
let n = t ?? Q(e);
|
|
1537
1540
|
try {
|
|
1538
1541
|
let t = await fetch(e, { mode: "cors" });
|
|
1539
1542
|
if (!t.ok) throw Error(`HTTP ${t.status}`);
|
|
@@ -1548,15 +1551,15 @@ async function sr(e, t) {
|
|
|
1548
1551
|
}
|
|
1549
1552
|
//#endregion
|
|
1550
1553
|
//#region src/components/MessageAttachment/File/index.tsx
|
|
1551
|
-
var
|
|
1554
|
+
var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
|
|
1552
1555
|
src: e,
|
|
1553
1556
|
filename: t,
|
|
1554
1557
|
fileSize: n,
|
|
1555
1558
|
mimeType: r,
|
|
1556
1559
|
title: i
|
|
1557
|
-
}] : [],
|
|
1558
|
-
let a = t.filename ??
|
|
1559
|
-
return /* @__PURE__ */ U(
|
|
1560
|
+
}] : [], cr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
1561
|
+
let a = t.filename ?? Q(t.src);
|
|
1562
|
+
return /* @__PURE__ */ U(ar, {
|
|
1560
1563
|
variant: e,
|
|
1561
1564
|
filename: a,
|
|
1562
1565
|
title: t.title,
|
|
@@ -1566,8 +1569,8 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1566
1569
|
activateLabel: `Download ${a}`,
|
|
1567
1570
|
trailingAction: i
|
|
1568
1571
|
});
|
|
1569
|
-
},
|
|
1570
|
-
let d =
|
|
1572
|
+
}, lr = ({ state: e, src: t, filename: n, fileSize: r, mimeType: i, title: a, items: o, text: s, groupPosition: c, onClick: l, onDismiss: u }) => {
|
|
1573
|
+
let d = Kn(e), f = e === "composer" && !!u, p = sr({
|
|
1571
1574
|
src: t,
|
|
1572
1575
|
filename: n,
|
|
1573
1576
|
fileSize: r,
|
|
@@ -1578,55 +1581,55 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1578
1581
|
if (l?.(e) === !1) return;
|
|
1579
1582
|
let t = p[e];
|
|
1580
1583
|
if (!t) return;
|
|
1581
|
-
let n = t.filename ??
|
|
1582
|
-
|
|
1584
|
+
let n = t.filename ?? Q(t.src);
|
|
1585
|
+
or(t.src, n);
|
|
1583
1586
|
};
|
|
1584
1587
|
if (p.length === 0) return null;
|
|
1585
1588
|
let h = /* @__PURE__ */ U("span", {
|
|
1586
1589
|
className: J("flex size-8 items-center justify-center rounded-full", d === "dark" ? "text-white/70" : "text-black/70"),
|
|
1587
1590
|
"aria-hidden": !0,
|
|
1588
|
-
children: /* @__PURE__ */ U(
|
|
1591
|
+
children: /* @__PURE__ */ U(Y, {
|
|
1589
1592
|
className: "size-5",
|
|
1590
1593
|
weight: "bold"
|
|
1591
1594
|
})
|
|
1592
1595
|
});
|
|
1593
|
-
return /* @__PURE__ */ U(
|
|
1596
|
+
return /* @__PURE__ */ U(Wn, {
|
|
1594
1597
|
variant: d,
|
|
1595
1598
|
text: s,
|
|
1596
1599
|
groupPosition: c,
|
|
1597
1600
|
"data-testid": "file-attachment",
|
|
1598
1601
|
children: /* @__PURE__ */ U("div", {
|
|
1599
1602
|
className: "flex flex-col gap-2",
|
|
1600
|
-
children: p.map((e, t) => /* @__PURE__ */ U(
|
|
1603
|
+
children: p.map((e, t) => /* @__PURE__ */ U(cr, {
|
|
1601
1604
|
variant: d,
|
|
1602
1605
|
item: e,
|
|
1603
1606
|
index: t,
|
|
1604
1607
|
onActivate: m,
|
|
1605
|
-
trailingAction: f && t === 0 ? /* @__PURE__ */ U(
|
|
1608
|
+
trailingAction: f && t === 0 ? /* @__PURE__ */ U(Gn, {
|
|
1606
1609
|
onClick: u,
|
|
1607
1610
|
variant: "inline"
|
|
1608
1611
|
}) : h
|
|
1609
1612
|
}, `${e.src}-${t}`))
|
|
1610
1613
|
})
|
|
1611
1614
|
});
|
|
1612
|
-
},
|
|
1613
|
-
Composer: (e) => /* @__PURE__ */ U(
|
|
1615
|
+
}, ur = {
|
|
1616
|
+
Composer: (e) => /* @__PURE__ */ U(lr, {
|
|
1614
1617
|
...e,
|
|
1615
1618
|
state: "composer"
|
|
1616
1619
|
}),
|
|
1617
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
1620
|
+
Sent: (e) => /* @__PURE__ */ U(lr, {
|
|
1618
1621
|
...e,
|
|
1619
1622
|
state: "sent"
|
|
1620
1623
|
}),
|
|
1621
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
1624
|
+
Received: (e) => /* @__PURE__ */ U(lr, {
|
|
1622
1625
|
...e,
|
|
1623
1626
|
state: "received"
|
|
1624
1627
|
})
|
|
1625
|
-
},
|
|
1628
|
+
}, dr = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", fr = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", pr = ({ onPrev: e, onNext: t, prevLabel: n = "Previous", nextLabel: r = "Next" }) => /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("button", {
|
|
1626
1629
|
type: "button",
|
|
1627
1630
|
onClick: e,
|
|
1628
1631
|
"aria-label": n,
|
|
1629
|
-
className: `${
|
|
1632
|
+
className: `${fr} left-4`,
|
|
1630
1633
|
children: /* @__PURE__ */ U(ke, {
|
|
1631
1634
|
size: 20,
|
|
1632
1635
|
weight: "bold",
|
|
@@ -1636,15 +1639,15 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1636
1639
|
type: "button",
|
|
1637
1640
|
onClick: t,
|
|
1638
1641
|
"aria-label": r,
|
|
1639
|
-
className: `${
|
|
1642
|
+
className: `${fr} right-4`,
|
|
1640
1643
|
children: /* @__PURE__ */ U(Ae, {
|
|
1641
1644
|
size: 20,
|
|
1642
1645
|
weight: "bold",
|
|
1643
1646
|
"aria-hidden": !0
|
|
1644
1647
|
})
|
|
1645
|
-
})] }),
|
|
1648
|
+
})] }), mr = ({ url: e, filename: t, variant: n = "pill", label: r = "Download", iconOnly: i, tone: a = "dark", onTriggered: o }) => {
|
|
1646
1649
|
let [s, c] = h(!1), u = l((n) => {
|
|
1647
|
-
n.stopPropagation(), !s && (c(!0),
|
|
1650
|
+
n.stopPropagation(), !s && (c(!0), or(e, t).catch(() => {}).finally(() => {
|
|
1648
1651
|
c(!1), o?.();
|
|
1649
1652
|
}));
|
|
1650
1653
|
}, [
|
|
@@ -1669,7 +1672,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1669
1672
|
className: "size-4 animate-spin",
|
|
1670
1673
|
weight: "bold",
|
|
1671
1674
|
"aria-hidden": !0
|
|
1672
|
-
}) : /* @__PURE__ */ U(
|
|
1675
|
+
}) : /* @__PURE__ */ U(Y, {
|
|
1673
1676
|
className: "size-5 shrink-0",
|
|
1674
1677
|
weight: "bold",
|
|
1675
1678
|
"aria-hidden": !0
|
|
@@ -1679,8 +1682,8 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1679
1682
|
onClick: u,
|
|
1680
1683
|
disabled: s,
|
|
1681
1684
|
"aria-label": r,
|
|
1682
|
-
className:
|
|
1683
|
-
children: U(s ? Me :
|
|
1685
|
+
className: dr,
|
|
1686
|
+
children: U(s ? Me : Y, {
|
|
1684
1687
|
size: 20,
|
|
1685
1688
|
weight: "bold",
|
|
1686
1689
|
"aria-hidden": !0
|
|
@@ -1695,21 +1698,21 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1695
1698
|
className: "size-4 animate-spin",
|
|
1696
1699
|
weight: "bold",
|
|
1697
1700
|
"aria-hidden": !0
|
|
1698
|
-
}) : /* @__PURE__ */ U(
|
|
1701
|
+
}) : /* @__PURE__ */ U(Y, {
|
|
1699
1702
|
...f,
|
|
1700
1703
|
"aria-hidden": !0
|
|
1701
1704
|
}), d ? null : r]
|
|
1702
1705
|
});
|
|
1703
|
-
},
|
|
1704
|
-
let r =
|
|
1706
|
+
}, hr = (e, t, n) => Math.min(Math.max(e, t), n), gr = ({ length: e, initialIndex: t, open: n }) => {
|
|
1707
|
+
let r = hr(t, 0, Math.max(e - 1, 0)), [i, a] = h(r);
|
|
1705
1708
|
d(() => {
|
|
1706
|
-
n && a(
|
|
1709
|
+
n && a(hr(t, 0, Math.max(e - 1, 0)));
|
|
1707
1710
|
}, [
|
|
1708
1711
|
n,
|
|
1709
1712
|
t,
|
|
1710
1713
|
e
|
|
1711
1714
|
]), d(() => {
|
|
1712
|
-
a((t) =>
|
|
1715
|
+
a((t) => hr(t, 0, Math.max(e - 1, 0)));
|
|
1713
1716
|
}, [e]);
|
|
1714
1717
|
let o = l(() => {
|
|
1715
1718
|
e <= 1 || a((t) => t <= 0 ? e - 1 : t - 1);
|
|
@@ -1734,7 +1737,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1734
1737
|
prev: o,
|
|
1735
1738
|
next: s
|
|
1736
1739
|
};
|
|
1737
|
-
},
|
|
1740
|
+
}, _r = ({ open: e, onClose: t, ariaLabel: n, counter: r, actions: i, children: a, "data-testid": o }) => {
|
|
1738
1741
|
let s = m(null), c = m(null);
|
|
1739
1742
|
return d(() => {
|
|
1740
1743
|
let t = s.current;
|
|
@@ -1793,7 +1796,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1793
1796
|
type: "button",
|
|
1794
1797
|
onClick: t,
|
|
1795
1798
|
"aria-label": "Close viewer",
|
|
1796
|
-
className:
|
|
1799
|
+
className: dr,
|
|
1797
1800
|
children: /* @__PURE__ */ U(Je, {
|
|
1798
1801
|
size: 20,
|
|
1799
1802
|
weight: "bold",
|
|
@@ -1806,18 +1809,18 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1806
1809
|
children: a
|
|
1807
1810
|
})]
|
|
1808
1811
|
});
|
|
1809
|
-
},
|
|
1810
|
-
let { index: i, prev: a, next: o } =
|
|
1812
|
+
}, vr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
1813
|
+
let { index: i, prev: a, next: o } = gr({
|
|
1811
1814
|
length: t.length,
|
|
1812
1815
|
initialIndex: n,
|
|
1813
1816
|
open: e
|
|
1814
|
-
}), s = t[i], c = p(() => s?.filename ?? (s ?
|
|
1815
|
-
return s ? /* @__PURE__ */ W(
|
|
1817
|
+
}), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "image"), [s]);
|
|
1818
|
+
return s ? /* @__PURE__ */ W(_r, {
|
|
1816
1819
|
open: e,
|
|
1817
1820
|
onClose: r,
|
|
1818
1821
|
ariaLabel: c,
|
|
1819
1822
|
counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
|
|
1820
|
-
actions: /* @__PURE__ */ U(
|
|
1823
|
+
actions: /* @__PURE__ */ U(mr, {
|
|
1821
1824
|
url: s.src,
|
|
1822
1825
|
filename: c,
|
|
1823
1826
|
variant: "viewer",
|
|
@@ -1830,14 +1833,14 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1830
1833
|
draggable: !1,
|
|
1831
1834
|
decoding: "async",
|
|
1832
1835
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] select-none object-contain"
|
|
1833
|
-
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ U(
|
|
1836
|
+
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ U(pr, {
|
|
1834
1837
|
onPrev: a,
|
|
1835
1838
|
onNext: o,
|
|
1836
1839
|
prevLabel: "Previous image",
|
|
1837
1840
|
nextLabel: "Next image"
|
|
1838
1841
|
}) : null]
|
|
1839
1842
|
}) : null;
|
|
1840
|
-
},
|
|
1843
|
+
}, yr = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", br = {
|
|
1841
1844
|
1: ["rounded-[18px]"],
|
|
1842
1845
|
2: ["rounded-l-[18px]", "rounded-r-[18px]"],
|
|
1843
1846
|
3: [
|
|
@@ -1851,7 +1854,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1851
1854
|
"rounded-bl-[18px]",
|
|
1852
1855
|
"rounded-br-[18px]"
|
|
1853
1856
|
]
|
|
1854
|
-
},
|
|
1857
|
+
}, xr = "--mes-single-width-cap", Sr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", Cr = 436, wr = ({ tiles: e, onTileActivate: t, maxVisible: n = 4, singleAspectRatio: r, className: i }) => {
|
|
1855
1858
|
let a = e.length;
|
|
1856
1859
|
if (a === 0) return null;
|
|
1857
1860
|
let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */ W("div", {
|
|
@@ -1859,7 +1862,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1859
1862
|
className: "absolute inset-0 flex items-center justify-center bg-[#040403]/50 text-2xl font-bold leading-[28px] tracking-[-0.24px] text-white",
|
|
1860
1863
|
children: ["+", s]
|
|
1861
1864
|
}) : null, l = (e, n, r) => {
|
|
1862
|
-
let i = J(
|
|
1865
|
+
let i = J(yr, "h-full w-full", br[o.length]?.[n]);
|
|
1863
1866
|
return t ? /* @__PURE__ */ W("button", {
|
|
1864
1867
|
type: "button",
|
|
1865
1868
|
onClick: () => t(n),
|
|
@@ -1873,10 +1876,10 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1873
1876
|
}, u;
|
|
1874
1877
|
return r && (u = {
|
|
1875
1878
|
aspectRatio: r,
|
|
1876
|
-
width: `min(var(${
|
|
1879
|
+
width: `min(var(${xr}), ${Math.round(Cr * r * 100) / 100}px)`,
|
|
1877
1880
|
maxWidth: "100%"
|
|
1878
1881
|
}), o.length === 1 ? /* @__PURE__ */ U("div", {
|
|
1879
|
-
className: J(r ?
|
|
1882
|
+
className: J(r ? Sr : "aspect-square w-full", i),
|
|
1880
1883
|
style: u,
|
|
1881
1884
|
children: l(o[0], 0, c)
|
|
1882
1885
|
}) : o.length === 2 ? /* @__PURE__ */ U("div", {
|
|
@@ -1899,7 +1902,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1899
1902
|
return l(e, t, n ? c : null);
|
|
1900
1903
|
})
|
|
1901
1904
|
});
|
|
1902
|
-
},
|
|
1905
|
+
}, Tr = ({ src: e, suppliedRatio: t, fallbackRatio: n }) => {
|
|
1903
1906
|
let [r, i] = o.useState(), a = o.useCallback((t) => {
|
|
1904
1907
|
if (!t || t.naturalWidth <= 0 || t.naturalHeight <= 0 || e === void 0) return;
|
|
1905
1908
|
let n = t.naturalWidth / t.naturalHeight;
|
|
@@ -1913,7 +1916,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1913
1916
|
imgRef: a,
|
|
1914
1917
|
onLoad: s
|
|
1915
1918
|
};
|
|
1916
|
-
},
|
|
1919
|
+
}, Er = (e) => {
|
|
1917
1920
|
let [t, n] = h(!1), [r, i] = h(0);
|
|
1918
1921
|
return {
|
|
1919
1922
|
viewerOpen: t,
|
|
@@ -1923,7 +1926,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1923
1926
|
}, [e]),
|
|
1924
1927
|
closeViewer: l(() => n(!1), [])
|
|
1925
1928
|
};
|
|
1926
|
-
},
|
|
1929
|
+
}, Dr = ({ item: e, index: t, totalCount: n, fallbackLoading: r, imgRef: i, onLoad: o }) => ({
|
|
1927
1930
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
1928
1931
|
content: /* @__PURE__ */ U("img", {
|
|
1929
1932
|
ref: i,
|
|
@@ -1937,15 +1940,15 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1937
1940
|
onLoad: o,
|
|
1938
1941
|
className: "absolute inset-0 size-full object-cover"
|
|
1939
1942
|
})
|
|
1940
|
-
}),
|
|
1943
|
+
}), Or = ({ src: e, alt: t, items: n }) => n && n.length > 0 ? n : e ? [{
|
|
1941
1944
|
src: e,
|
|
1942
1945
|
alt: t
|
|
1943
|
-
}] : [],
|
|
1946
|
+
}] : [], kr = (e, t) => e.map((n, r) => ({
|
|
1944
1947
|
src: n.src,
|
|
1945
1948
|
alt: n.alt,
|
|
1946
1949
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
1947
|
-
})),
|
|
1948
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
1950
|
+
})), Ar = ({ src: e, alt: t, filename: n, loading: r = "lazy", onClick: i, onDismiss: o }) => {
|
|
1951
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Er(i);
|
|
1949
1952
|
return /* @__PURE__ */ W("div", {
|
|
1950
1953
|
className: "relative w-fit",
|
|
1951
1954
|
children: [
|
|
@@ -1965,11 +1968,11 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1965
1968
|
}),
|
|
1966
1969
|
o ? /* @__PURE__ */ U("div", {
|
|
1967
1970
|
className: "absolute right-2 top-2 z-10",
|
|
1968
|
-
children: /* @__PURE__ */ U(
|
|
1971
|
+
children: /* @__PURE__ */ U(Gn, { onClick: o })
|
|
1969
1972
|
}) : null,
|
|
1970
|
-
/* @__PURE__ */ U(
|
|
1973
|
+
/* @__PURE__ */ U(vr, {
|
|
1971
1974
|
open: s,
|
|
1972
|
-
items:
|
|
1975
|
+
items: kr([{
|
|
1973
1976
|
src: e,
|
|
1974
1977
|
alt: t
|
|
1975
1978
|
}], n),
|
|
@@ -1978,18 +1981,18 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1978
1981
|
})
|
|
1979
1982
|
]
|
|
1980
1983
|
});
|
|
1981
|
-
},
|
|
1982
|
-
let l =
|
|
1984
|
+
}, jr = 326 / 246, Mr = ({ state: e, src: t, alt: n, filename: r, items: i, text: a, groupPosition: o, loading: s = "lazy", onClick: c }) => {
|
|
1985
|
+
let l = Or({
|
|
1983
1986
|
src: t,
|
|
1984
1987
|
alt: n,
|
|
1985
1988
|
items: i
|
|
1986
|
-
}), u =
|
|
1989
|
+
}), u = Kn(e), { viewerOpen: d, viewerIndex: f, handleActivate: p, closeViewer: m } = Er(c), h = l.length === 1, g = h ? l[0] : void 0, _ = Tr({
|
|
1987
1990
|
src: g?.src,
|
|
1988
1991
|
suppliedRatio: g?.width && g?.height ? g.width / g.height : void 0,
|
|
1989
|
-
fallbackRatio:
|
|
1992
|
+
fallbackRatio: jr
|
|
1990
1993
|
});
|
|
1991
1994
|
if (l.length === 0) return null;
|
|
1992
|
-
let v = l.map((e, t) =>
|
|
1995
|
+
let v = l.map((e, t) => Dr({
|
|
1993
1996
|
item: e,
|
|
1994
1997
|
index: t,
|
|
1995
1998
|
totalCount: l.length,
|
|
@@ -1997,7 +2000,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1997
2000
|
imgRef: h ? _.imgRef : void 0,
|
|
1998
2001
|
onLoad: h ? _.onLoad : void 0
|
|
1999
2002
|
}));
|
|
2000
|
-
return /* @__PURE__ */ W(
|
|
2003
|
+
return /* @__PURE__ */ W(Wn, {
|
|
2001
2004
|
variant: u,
|
|
2002
2005
|
text: a,
|
|
2003
2006
|
groupPosition: o,
|
|
@@ -2008,35 +2011,35 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2008
2011
|
"data-testid": "image-attachment",
|
|
2009
2012
|
children: [/* @__PURE__ */ U("div", {
|
|
2010
2013
|
className: "relative",
|
|
2011
|
-
children: /* @__PURE__ */ U(
|
|
2014
|
+
children: /* @__PURE__ */ U(wr, {
|
|
2012
2015
|
tiles: v,
|
|
2013
2016
|
onTileActivate: p,
|
|
2014
2017
|
singleAspectRatio: h ? _.ratio : void 0
|
|
2015
2018
|
})
|
|
2016
|
-
}), /* @__PURE__ */ U(
|
|
2019
|
+
}), /* @__PURE__ */ U(vr, {
|
|
2017
2020
|
open: d,
|
|
2018
|
-
items:
|
|
2021
|
+
items: kr(l, r),
|
|
2019
2022
|
initialIndex: f,
|
|
2020
2023
|
onClose: m
|
|
2021
2024
|
})]
|
|
2022
2025
|
});
|
|
2023
|
-
},
|
|
2024
|
-
Composer: (e) => /* @__PURE__ */ U(
|
|
2025
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
2026
|
+
}, Nr = {
|
|
2027
|
+
Composer: (e) => /* @__PURE__ */ U(Ar, { ...e }),
|
|
2028
|
+
Sent: (e) => /* @__PURE__ */ U(Mr, {
|
|
2026
2029
|
...e,
|
|
2027
2030
|
state: "sent"
|
|
2028
2031
|
}),
|
|
2029
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
2032
|
+
Received: (e) => /* @__PURE__ */ U(Mr, {
|
|
2030
2033
|
...e,
|
|
2031
2034
|
state: "received"
|
|
2032
2035
|
})
|
|
2033
|
-
},
|
|
2034
|
-
let { index: i, prev: a, next: o } =
|
|
2036
|
+
}, Pr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
2037
|
+
let { index: i, prev: a, next: o } = gr({
|
|
2035
2038
|
length: t.length,
|
|
2036
2039
|
initialIndex: n,
|
|
2037
2040
|
open: e
|
|
2038
|
-
}), s = t[i], c = p(() => s?.filename ?? (s ?
|
|
2039
|
-
return !s || !l ? null : /* @__PURE__ */ W(
|
|
2041
|
+
}), s = t[i], c = p(() => s?.filename ?? (s ? Q(s.src) : "document"), [s]), l = p(() => s ? Fr(s.src) : void 0, [s]);
|
|
2042
|
+
return !s || !l ? null : /* @__PURE__ */ W(_r, {
|
|
2040
2043
|
open: e,
|
|
2041
2044
|
onClose: r,
|
|
2042
2045
|
ariaLabel: c,
|
|
@@ -2047,24 +2050,24 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2047
2050
|
title: c,
|
|
2048
2051
|
className: "block h-[calc(100dvh-128px)] w-[min(96vw,1400px)] border-0 bg-white",
|
|
2049
2052
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
2050
|
-
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ U(
|
|
2053
|
+
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ U(pr, {
|
|
2051
2054
|
onPrev: a,
|
|
2052
2055
|
onNext: o,
|
|
2053
2056
|
prevLabel: "Previous document",
|
|
2054
2057
|
nextLabel: "Next document"
|
|
2055
2058
|
}) : null]
|
|
2056
2059
|
});
|
|
2057
|
-
},
|
|
2060
|
+
}, Fr = (e) => {
|
|
2058
2061
|
let t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1), i = new URLSearchParams(r);
|
|
2059
2062
|
return i.has("toolbar") || i.set("toolbar", "0"), i.has("navpanes") || i.set("navpanes", "0"), `${n}#${i.toString()}`;
|
|
2060
|
-
},
|
|
2063
|
+
}, Ir = ({ src: e, filename: t, fileSize: n, title: r, items: i }) => i && i.length > 0 ? i : e ? [{
|
|
2061
2064
|
src: e,
|
|
2062
2065
|
filename: t,
|
|
2063
2066
|
fileSize: n,
|
|
2064
2067
|
title: r
|
|
2065
|
-
}] : [],
|
|
2066
|
-
let a = t.filename ??
|
|
2067
|
-
return /* @__PURE__ */ U(
|
|
2068
|
+
}] : [], Lr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
2069
|
+
let a = t.filename ?? Q(t.src);
|
|
2070
|
+
return /* @__PURE__ */ U(ar, {
|
|
2068
2071
|
variant: e,
|
|
2069
2072
|
filename: a,
|
|
2070
2073
|
title: t.title,
|
|
@@ -2074,20 +2077,20 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2074
2077
|
activateLabel: `Open ${a}`,
|
|
2075
2078
|
trailingAction: i
|
|
2076
2079
|
});
|
|
2077
|
-
},
|
|
2078
|
-
let u =
|
|
2080
|
+
}, Rr = ({ state: e, src: t, filename: n, fileSize: r, title: i, items: a, text: o, groupPosition: s, onClick: c, onDismiss: l }) => {
|
|
2081
|
+
let u = Kn(e), d = Ir({
|
|
2079
2082
|
src: t,
|
|
2080
2083
|
filename: n,
|
|
2081
2084
|
fileSize: r,
|
|
2082
2085
|
title: i,
|
|
2083
2086
|
items: a
|
|
2084
|
-
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } =
|
|
2087
|
+
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Er(c), g = e === "composer" && !!l;
|
|
2085
2088
|
if (d.length === 0) return null;
|
|
2086
2089
|
let _ = d.map((e) => ({
|
|
2087
2090
|
src: e.src,
|
|
2088
|
-
filename: e.filename ??
|
|
2091
|
+
filename: e.filename ?? Q(e.src)
|
|
2089
2092
|
}));
|
|
2090
|
-
return /* @__PURE__ */ W(
|
|
2093
|
+
return /* @__PURE__ */ W(Wn, {
|
|
2091
2094
|
variant: u,
|
|
2092
2095
|
text: o,
|
|
2093
2096
|
groupPosition: s,
|
|
@@ -2095,17 +2098,17 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2095
2098
|
children: [/* @__PURE__ */ U("div", {
|
|
2096
2099
|
className: "flex flex-col gap-2",
|
|
2097
2100
|
children: d.map((t, n) => {
|
|
2098
|
-
let r = t.filename ??
|
|
2101
|
+
let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */ U(Gn, {
|
|
2099
2102
|
onClick: l,
|
|
2100
2103
|
variant: "inline"
|
|
2101
|
-
}) : e === "composer" ? void 0 : /* @__PURE__ */ U(
|
|
2104
|
+
}) : e === "composer" ? void 0 : /* @__PURE__ */ U(mr, {
|
|
2102
2105
|
url: t.src,
|
|
2103
2106
|
filename: r,
|
|
2104
2107
|
variant: "inline",
|
|
2105
2108
|
label: `Download ${r}`,
|
|
2106
2109
|
tone: u
|
|
2107
2110
|
});
|
|
2108
|
-
return /* @__PURE__ */ U(
|
|
2111
|
+
return /* @__PURE__ */ U(Lr, {
|
|
2109
2112
|
variant: u,
|
|
2110
2113
|
item: t,
|
|
2111
2114
|
index: n,
|
|
@@ -2113,28 +2116,28 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2113
2116
|
trailingAction: i
|
|
2114
2117
|
}, `${t.src}-${n}`);
|
|
2115
2118
|
})
|
|
2116
|
-
}), /* @__PURE__ */ U(
|
|
2119
|
+
}), /* @__PURE__ */ U(Pr, {
|
|
2117
2120
|
open: f,
|
|
2118
2121
|
items: _,
|
|
2119
2122
|
initialIndex: p,
|
|
2120
2123
|
onClose: h
|
|
2121
2124
|
})]
|
|
2122
2125
|
});
|
|
2123
|
-
},
|
|
2124
|
-
Composer: (e) => /* @__PURE__ */ U(
|
|
2126
|
+
}, zr = {
|
|
2127
|
+
Composer: (e) => /* @__PURE__ */ U(Rr, {
|
|
2125
2128
|
...e,
|
|
2126
2129
|
state: "composer"
|
|
2127
2130
|
}),
|
|
2128
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
2131
|
+
Sent: (e) => /* @__PURE__ */ U(Rr, {
|
|
2129
2132
|
...e,
|
|
2130
2133
|
state: "sent"
|
|
2131
2134
|
}),
|
|
2132
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
2135
|
+
Received: (e) => /* @__PURE__ */ U(Rr, {
|
|
2133
2136
|
...e,
|
|
2134
2137
|
state: "received"
|
|
2135
2138
|
})
|
|
2136
|
-
},
|
|
2137
|
-
let { index: a, prev: o, next: s } =
|
|
2139
|
+
}, Br = 150, Vr = ({ open: e, items: t, initialIndex: n = 0, onClose: i }) => {
|
|
2140
|
+
let { index: a, prev: o, next: s } = gr({
|
|
2138
2141
|
length: t.length,
|
|
2139
2142
|
initialIndex: n,
|
|
2140
2143
|
open: e
|
|
@@ -2146,11 +2149,11 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2146
2149
|
e && !u && f(!0), d(() => {
|
|
2147
2150
|
if (e || !u) return;
|
|
2148
2151
|
c.current?.pause();
|
|
2149
|
-
let t = window.setTimeout(() => f(!1),
|
|
2152
|
+
let t = window.setTimeout(() => f(!1), Br);
|
|
2150
2153
|
return () => window.clearTimeout(t);
|
|
2151
2154
|
}, [e, u]);
|
|
2152
|
-
let g = t[a], _ = p(() => g?.filename ?? (g ?
|
|
2153
|
-
return g ? /* @__PURE__ */ W(
|
|
2155
|
+
let g = t[a], _ = p(() => g?.filename ?? (g ? Q(g.src) : "video"), [g]);
|
|
2156
|
+
return g ? /* @__PURE__ */ W(_r, {
|
|
2154
2157
|
open: e,
|
|
2155
2158
|
onClose: i,
|
|
2156
2159
|
ariaLabel: _,
|
|
@@ -2171,14 +2174,14 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2171
2174
|
src: g.src,
|
|
2172
2175
|
type: g.mimeType
|
|
2173
2176
|
}) : null
|
|
2174
|
-
}, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */ U(
|
|
2177
|
+
}, `${a}:${g.src}`) : null, t.length > 1 ? /* @__PURE__ */ U(pr, {
|
|
2175
2178
|
onPrev: o,
|
|
2176
2179
|
onNext: s,
|
|
2177
2180
|
prevLabel: "Previous video",
|
|
2178
2181
|
nextLabel: "Next video"
|
|
2179
2182
|
}) : null]
|
|
2180
2183
|
}) : null;
|
|
2181
|
-
},
|
|
2184
|
+
}, Hr = 1, Ur = 4 / 5, Wr = 16 / 9, Gr = () => /* @__PURE__ */ U("div", {
|
|
2182
2185
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
2183
2186
|
children: /* @__PURE__ */ U("span", {
|
|
2184
2187
|
className: "flex size-12 items-center justify-center rounded-full bg-black/25 text-white backdrop-blur-[20px]",
|
|
@@ -2188,7 +2191,12 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2188
2191
|
"aria-hidden": !0
|
|
2189
2192
|
})
|
|
2190
2193
|
})
|
|
2191
|
-
}),
|
|
2194
|
+
}), Kr = (e) => {
|
|
2195
|
+
let t = e.indexOf("#");
|
|
2196
|
+
if (t === -1) return `${e}#t=0.001`;
|
|
2197
|
+
let n = e.slice(t + 1);
|
|
2198
|
+
return /(^|&)t=/.test(n) ? e : `${e}&t=0.001`;
|
|
2199
|
+
}, qr = ({ item: e, index: t, showPlayBadge: n = !0, imgRef: r, onLoad: i }) => /* @__PURE__ */ W("div", {
|
|
2192
2200
|
className: "absolute inset-0 size-full bg-[#0d0d0d]",
|
|
2193
2201
|
children: [e.poster ? /* @__PURE__ */ U("img", {
|
|
2194
2202
|
ref: r,
|
|
@@ -2199,6 +2207,13 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2199
2207
|
decoding: "async",
|
|
2200
2208
|
onLoad: i,
|
|
2201
2209
|
className: "absolute inset-0 size-full object-cover"
|
|
2210
|
+
}) : e.src && e.preload !== "none" ? /* @__PURE__ */ U("video", {
|
|
2211
|
+
src: Kr(e.src),
|
|
2212
|
+
muted: !0,
|
|
2213
|
+
playsInline: !0,
|
|
2214
|
+
preload: "metadata",
|
|
2215
|
+
"aria-label": `Video ${t + 1} thumbnail`,
|
|
2216
|
+
className: "absolute inset-0 size-full object-cover"
|
|
2202
2217
|
}) : /* @__PURE__ */ U("div", {
|
|
2203
2218
|
className: "absolute inset-0 flex items-center justify-center",
|
|
2204
2219
|
children: /* @__PURE__ */ U(Ke, {
|
|
@@ -2206,7 +2221,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2206
2221
|
weight: "regular",
|
|
2207
2222
|
"aria-hidden": !0
|
|
2208
2223
|
})
|
|
2209
|
-
}), n ? /* @__PURE__ */ U(
|
|
2224
|
+
}), n ? /* @__PURE__ */ U(Gr, {}) : null]
|
|
2210
2225
|
}), Jr = ({ item: e, index: t, totalCount: n, isOverflowTile: r, imgRef: i, onLoad: a }) => ({
|
|
2211
2226
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2212
2227
|
cursorClassName: "cursor-pointer",
|
|
@@ -2233,7 +2248,7 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2233
2248
|
preload: n.preload,
|
|
2234
2249
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
2235
2250
|
})), Zr = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
|
|
2236
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
2251
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Er(a);
|
|
2237
2252
|
return /* @__PURE__ */ W("div", {
|
|
2238
2253
|
className: "relative w-fit",
|
|
2239
2254
|
children: [
|
|
@@ -2246,16 +2261,17 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2246
2261
|
item: {
|
|
2247
2262
|
src: e,
|
|
2248
2263
|
poster: t,
|
|
2249
|
-
mimeType: n
|
|
2264
|
+
mimeType: n,
|
|
2265
|
+
preload: i
|
|
2250
2266
|
},
|
|
2251
2267
|
index: 0
|
|
2252
2268
|
})
|
|
2253
2269
|
}),
|
|
2254
2270
|
o ? /* @__PURE__ */ U("div", {
|
|
2255
2271
|
className: "absolute right-2 top-2 z-10",
|
|
2256
|
-
children: /* @__PURE__ */ U(
|
|
2272
|
+
children: /* @__PURE__ */ U(Gn, { onClick: o })
|
|
2257
2273
|
}) : null,
|
|
2258
|
-
/* @__PURE__ */ U(
|
|
2274
|
+
/* @__PURE__ */ U(Vr, {
|
|
2259
2275
|
open: s,
|
|
2260
2276
|
items: Xr([{
|
|
2261
2277
|
src: e,
|
|
@@ -2276,10 +2292,10 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2276
2292
|
preload: c,
|
|
2277
2293
|
naturalAspectRatio: l,
|
|
2278
2294
|
items: a
|
|
2279
|
-
}), f =
|
|
2295
|
+
}), f = Kn(e), { viewerOpen: p, viewerIndex: m, handleActivate: h, closeViewer: g } = Er(u), _ = d.length === 1, v = _ ? d[0] : void 0, y = Tr({
|
|
2280
2296
|
src: v?.poster,
|
|
2281
2297
|
suppliedRatio: v?.naturalAspectRatio,
|
|
2282
|
-
fallbackRatio:
|
|
2298
|
+
fallbackRatio: Hr
|
|
2283
2299
|
});
|
|
2284
2300
|
if (d.length === 0) return null;
|
|
2285
2301
|
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) => Jr({
|
|
@@ -2289,8 +2305,8 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2289
2305
|
isOverflowTile: t === b,
|
|
2290
2306
|
imgRef: _ ? y.imgRef : void 0,
|
|
2291
2307
|
onLoad: _ ? y.onLoad : void 0
|
|
2292
|
-
})), S = Math.min(Math.max(y.ratio,
|
|
2293
|
-
return /* @__PURE__ */ W(
|
|
2308
|
+
})), S = Math.min(Math.max(y.ratio, Ur), Wr);
|
|
2309
|
+
return /* @__PURE__ */ W(Wn, {
|
|
2294
2310
|
variant: f,
|
|
2295
2311
|
text: o,
|
|
2296
2312
|
groupPosition: s,
|
|
@@ -2301,20 +2317,20 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2301
2317
|
"data-testid": "video-attachment",
|
|
2302
2318
|
children: [/* @__PURE__ */ U("div", {
|
|
2303
2319
|
className: "relative",
|
|
2304
|
-
children: /* @__PURE__ */ U(
|
|
2320
|
+
children: /* @__PURE__ */ U(wr, {
|
|
2305
2321
|
tiles: x,
|
|
2306
2322
|
onTileActivate: h,
|
|
2307
2323
|
singleAspectRatio: _ ? S : void 0
|
|
2308
2324
|
})
|
|
2309
|
-
}), /* @__PURE__ */ U(
|
|
2325
|
+
}), /* @__PURE__ */ U(Vr, {
|
|
2310
2326
|
open: p,
|
|
2311
2327
|
items: Xr(d, i),
|
|
2312
2328
|
initialIndex: m,
|
|
2313
2329
|
onClose: g
|
|
2314
2330
|
})]
|
|
2315
2331
|
});
|
|
2316
|
-
},
|
|
2317
|
-
Image:
|
|
2332
|
+
}, $r = {
|
|
2333
|
+
Image: Nr,
|
|
2318
2334
|
Video: {
|
|
2319
2335
|
Composer: (e) => /* @__PURE__ */ U(Zr, { ...e }),
|
|
2320
2336
|
Sent: (e) => /* @__PURE__ */ U(Qr, {
|
|
@@ -2326,48 +2342,48 @@ var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2326
2342
|
state: "received"
|
|
2327
2343
|
})
|
|
2328
2344
|
},
|
|
2329
|
-
Audio:
|
|
2330
|
-
Pdf:
|
|
2331
|
-
File:
|
|
2345
|
+
Audio: Zn,
|
|
2346
|
+
Pdf: zr,
|
|
2347
|
+
File: ur
|
|
2332
2348
|
};
|
|
2333
2349
|
//#endregion
|
|
2334
2350
|
//#region src/components/CustomMessage/StreamAttachmentMessage.tsx
|
|
2335
2351
|
function $(e) {
|
|
2336
2352
|
return e?.trim() || void 0;
|
|
2337
2353
|
}
|
|
2338
|
-
function
|
|
2354
|
+
function ei(e) {
|
|
2339
2355
|
let { original_width: t, original_height: n } = e;
|
|
2340
2356
|
if (typeof t == "number" && typeof n == "number" && !(!Number.isFinite(t) || !Number.isFinite(n)) && !(t <= 0 || n <= 0)) return t / n;
|
|
2341
2357
|
}
|
|
2342
|
-
function
|
|
2358
|
+
function ti(e) {
|
|
2343
2359
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
2344
2360
|
}
|
|
2345
|
-
function
|
|
2361
|
+
function ni(e, t) {
|
|
2346
2362
|
if (!e?.trim() || !t?.trim()) return !1;
|
|
2347
|
-
let n =
|
|
2363
|
+
let n = ti(e), r = ti(t);
|
|
2348
2364
|
if (n === r) return !0;
|
|
2349
2365
|
if (!n.includes(r)) return !1;
|
|
2350
2366
|
let i = n.split(r).join("");
|
|
2351
2367
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(i);
|
|
2352
2368
|
}
|
|
2353
|
-
function
|
|
2354
|
-
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), o = n &&
|
|
2369
|
+
function ri(e) {
|
|
2370
|
+
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), o = n && Wt(r, i) ? void 0 : i;
|
|
2355
2371
|
return {
|
|
2356
2372
|
title: $(e.title),
|
|
2357
2373
|
description: $(e.text),
|
|
2358
2374
|
url: t,
|
|
2359
2375
|
thumbnailUrl: a(n),
|
|
2360
2376
|
sourceUrl: o,
|
|
2361
|
-
layout: n ||
|
|
2377
|
+
layout: n || Gt(r, o) ? "featured" : "classic",
|
|
2362
2378
|
mimeType: r,
|
|
2363
2379
|
accentColor: $(e.accent_color),
|
|
2364
2380
|
status: "ready"
|
|
2365
2381
|
};
|
|
2366
2382
|
}
|
|
2367
|
-
function ri(e) {
|
|
2368
|
-
return kt(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2369
|
-
}
|
|
2370
2383
|
function ii(e) {
|
|
2384
|
+
return on(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2385
|
+
}
|
|
2386
|
+
function ai(e) {
|
|
2371
2387
|
if (!e?.length) return [];
|
|
2372
2388
|
let t = [], n = (e, n) => {
|
|
2373
2389
|
let r = t[t.length - 1];
|
|
@@ -2392,44 +2408,44 @@ function ii(e) {
|
|
|
2392
2408
|
});
|
|
2393
2409
|
};
|
|
2394
2410
|
for (let t of e) {
|
|
2395
|
-
if (
|
|
2411
|
+
if (on(t)) {
|
|
2396
2412
|
r(t);
|
|
2397
2413
|
continue;
|
|
2398
2414
|
}
|
|
2399
|
-
let e =
|
|
2415
|
+
let e = ii(t);
|
|
2400
2416
|
e && n(e, t);
|
|
2401
2417
|
}
|
|
2402
2418
|
return t;
|
|
2403
2419
|
}
|
|
2404
|
-
function
|
|
2420
|
+
function oi(e) {
|
|
2405
2421
|
return e.filter((e) => e.type === "media").length;
|
|
2406
2422
|
}
|
|
2407
|
-
function
|
|
2423
|
+
function si(e, t, n) {
|
|
2408
2424
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
2409
2425
|
}
|
|
2410
|
-
function
|
|
2426
|
+
function ci(e) {
|
|
2411
2427
|
return $(e.image_url) ?? $(e.asset_url) ?? "";
|
|
2412
2428
|
}
|
|
2413
|
-
function
|
|
2429
|
+
function li(e) {
|
|
2414
2430
|
switch (e) {
|
|
2415
|
-
case "image": return
|
|
2416
|
-
case "video": return
|
|
2417
|
-
case "audio": return
|
|
2418
|
-
case "pdf": return
|
|
2419
|
-
default: return
|
|
2431
|
+
case "image": return $r.Image;
|
|
2432
|
+
case "video": return $r.Video;
|
|
2433
|
+
case "audio": return $r.Audio;
|
|
2434
|
+
case "pdf": return $r.Pdf;
|
|
2435
|
+
default: return $r.File;
|
|
2420
2436
|
}
|
|
2421
2437
|
}
|
|
2422
|
-
function
|
|
2438
|
+
function ui(e, t) {
|
|
2423
2439
|
switch (e) {
|
|
2424
2440
|
case "image": return {
|
|
2425
|
-
src:
|
|
2441
|
+
src: ci(t),
|
|
2426
2442
|
alt: $(t.title)
|
|
2427
2443
|
};
|
|
2428
2444
|
case "video": return {
|
|
2429
2445
|
src: $(t.asset_url) ?? "",
|
|
2430
2446
|
poster: a(t.thumb_url),
|
|
2431
2447
|
mimeType: $(t.mime_type),
|
|
2432
|
-
naturalAspectRatio:
|
|
2448
|
+
naturalAspectRatio: ei(t)
|
|
2433
2449
|
};
|
|
2434
2450
|
case "audio": return {
|
|
2435
2451
|
src: $(t.asset_url) ?? "",
|
|
@@ -2449,30 +2465,30 @@ function li(e, t) {
|
|
|
2449
2465
|
};
|
|
2450
2466
|
}
|
|
2451
2467
|
}
|
|
2452
|
-
function
|
|
2453
|
-
if (t.length > 1) return { items: t.map((t) =>
|
|
2468
|
+
function di(e, t) {
|
|
2469
|
+
if (t.length > 1) return { items: t.map((t) => ui(e, t)) };
|
|
2454
2470
|
let n = t[0];
|
|
2455
|
-
return n ?
|
|
2471
|
+
return n ? ui(e, n) : {};
|
|
2456
2472
|
}
|
|
2457
|
-
function
|
|
2458
|
-
let r =
|
|
2459
|
-
...
|
|
2473
|
+
function fi({ groupPosition: e, isMyMessage: t, segment: n }) {
|
|
2474
|
+
let r = li(n.kind), i = {
|
|
2475
|
+
...di(n.kind, n.attachments),
|
|
2460
2476
|
groupPosition: e
|
|
2461
2477
|
};
|
|
2462
2478
|
return U(t ? r.Sent : r.Received, { ...i });
|
|
2463
2479
|
}
|
|
2464
|
-
var
|
|
2465
|
-
let i =
|
|
2480
|
+
var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
2481
|
+
let i = ai(n.attachments);
|
|
2466
2482
|
if (i.length === 0) return null;
|
|
2467
|
-
let a =
|
|
2468
|
-
let i = t ?
|
|
2483
|
+
let a = oi(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? ri(s.attachments[0] ?? {}).url : void 0, l = o && ni(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
|
|
2484
|
+
let i = t ? an.Sent : an.Received;
|
|
2469
2485
|
d.push(/* @__PURE__ */ U(i, {
|
|
2470
|
-
...
|
|
2486
|
+
...ri(e),
|
|
2471
2487
|
groupPosition: r ? f : "middle"
|
|
2472
2488
|
}, n));
|
|
2473
2489
|
}, h = (n, r) => {
|
|
2474
|
-
let i =
|
|
2475
|
-
u += 1, d.push(/* @__PURE__ */ U(
|
|
2490
|
+
let i = si(u, a, e);
|
|
2491
|
+
u += 1, d.push(/* @__PURE__ */ U(fi, {
|
|
2476
2492
|
groupPosition: i,
|
|
2477
2493
|
isMyMessage: t,
|
|
2478
2494
|
segment: n
|
|
@@ -2513,18 +2529,21 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2513
2529
|
renderText: r
|
|
2514
2530
|
}),
|
|
2515
2531
|
/* @__PURE__ */ U(M, {}),
|
|
2516
|
-
p && /* @__PURE__ */ U(
|
|
2532
|
+
p && /* @__PURE__ */ U(Tn, { side: t ? "me" : "other" })
|
|
2517
2533
|
]
|
|
2518
2534
|
}) : null]
|
|
2519
2535
|
});
|
|
2520
|
-
},
|
|
2521
|
-
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: x } = e, { client: S } = he("CustomMessage"), { channel: C } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: D, onDownloadClick: N } =
|
|
2536
|
+
}, mi = o.memo((e) => {
|
|
2537
|
+
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: m, renderText: g, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: x } = e, { client: S } = he("CustomMessage"), { channel: C } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: D, onDownloadClick: N } = un("LockedAttachment"), [F, L] = h(!1), z = be(m.id), { Attachment: te = b, EditMessageModal: ie = E, MessageActions: B, MessageBlocked: ae = O, MessageBouncePrompt: oe = A, MessageDeleted: fe = j, MessageIsThreadReplyInChannelButtonIndicator: pe = P, MessageRepliesCountButton: _e = I, ReminderNotification: ve = ne, StreamedMessageText: V = re, PinIndicator: ye } = ge("CustomMessage"), xe = ue(m), Se = de(m), G = p(() => d?.(m), [d, m]), K = p(() => {
|
|
2522
2538
|
let e = m.attachments ?? [], t = m.shared_location ? [m.shared_location, ...e] : e;
|
|
2523
|
-
if (!
|
|
2524
|
-
let n = t.filter((e) => !("type" in e) || !
|
|
2539
|
+
if (!_n(m)) return t;
|
|
2540
|
+
let n = t.filter((e) => !("type" in e) || !on(e));
|
|
2525
2541
|
return n.length === t.length ? t : n;
|
|
2526
|
-
}, [m]),
|
|
2527
|
-
let e =
|
|
2542
|
+
}, [m]), q = p(() => (m.attachments ?? []).filter(on), [m]), Ce = p(() => {
|
|
2543
|
+
let e = m.text?.trim();
|
|
2544
|
+
return e ? ni(e, q[0] ? ri(q[0]).url : void 0) ? void 0 : e : void 0;
|
|
2545
|
+
}, [m, q]), we = p(() => ai(K), [K]), Te = p(() => {
|
|
2546
|
+
let e = Dt({
|
|
2528
2547
|
message: m,
|
|
2529
2548
|
viewerLanguage: v
|
|
2530
2549
|
});
|
|
@@ -2532,31 +2551,31 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2532
2551
|
...m,
|
|
2533
2552
|
text: e
|
|
2534
2553
|
};
|
|
2535
|
-
}, [m, v]),
|
|
2554
|
+
}, [m, v]), Ee = we.length > 0, De = we.reduce((e, t) => e + t.attachments.length, 0) === (K?.length ?? 0), Oe = a?.[0] ?? "", ke = Oe === "top" ? "first" : Oe === "middle" ? "middle" : Oe === "bottom" ? "end" : "single", Ae = Oe === "single" || Oe === "bottom";
|
|
2536
2555
|
if (se(m)) return null;
|
|
2537
2556
|
if (m.deleted_at || m.type === "deleted") return /* @__PURE__ */ U(fe, { message: m });
|
|
2538
2557
|
if (ce(m)) return /* @__PURE__ */ U(ae, {});
|
|
2539
|
-
let
|
|
2540
|
-
|
|
2541
|
-
let X = f(),
|
|
2558
|
+
let je = !_ && !!m.reply_count, Me = !_ && m.show_in_channel && m.parent_id, Ne = m.status === "failed" && m.error?.status !== 403, Pe = le(m), Y;
|
|
2559
|
+
Ne ? Y = () => l(m) : Pe && (Y = () => L(!0));
|
|
2560
|
+
let X = f(), Fe = J("str-chat__message str-chat__message-simple", `str-chat__message--${m.type}`, `str-chat__message--${m.status}`, X ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other", m.text ? "str-chat__message--has-text" : "has-no-text", {
|
|
2542
2561
|
"str-chat__message--has-attachment": xe,
|
|
2543
2562
|
"str-chat__message--highlighted": u,
|
|
2544
2563
|
"str-chat__message--pinned pinned-message": m.pinned,
|
|
2545
2564
|
"str-chat__message--with-reactions": Se,
|
|
2546
2565
|
"str-chat__message-send-can-be-retried": m?.status === "failed" && m?.error?.status !== 403,
|
|
2547
|
-
"str-chat__message-with-thread-link":
|
|
2566
|
+
"str-chat__message-with-thread-link": je || Me,
|
|
2548
2567
|
"str-chat__virtual-message__wrapper--end": r,
|
|
2549
2568
|
"str-chat__virtual-message__wrapper--first": i,
|
|
2550
2569
|
"str-chat__virtual-message__wrapper--group": o
|
|
2551
|
-
}),
|
|
2570
|
+
}), Ie = m.poll_id && S.polls.fromState(m.poll_id), Le = jn(m), Re = _n(m), ze = vn(m), Be = !!(K?.length && !m.quoted_message), Ve = Re && X && Be, He = Ee && De && !m.quoted_message && !Ie && !G && !Re, Ue = {
|
|
2552
2571
|
contentType: "text",
|
|
2553
2572
|
amountText: m.metadata?.amount_text,
|
|
2554
2573
|
paymentStatus: m.metadata?.payment_status,
|
|
2555
2574
|
renderedText: m.text && /* @__PURE__ */ U(R, {
|
|
2556
|
-
message:
|
|
2575
|
+
message: Te,
|
|
2557
2576
|
renderText: g
|
|
2558
2577
|
})
|
|
2559
|
-
},
|
|
2578
|
+
}, We = {
|
|
2560
2579
|
contentType: "media",
|
|
2561
2580
|
title: m.metadata?.attachment_title,
|
|
2562
2581
|
mimeType: m.metadata?.attachment_mime_type,
|
|
@@ -2565,12 +2584,21 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2565
2584
|
detail: m.metadata?.attachment_detail,
|
|
2566
2585
|
paymentStatus: m.metadata?.payment_status,
|
|
2567
2586
|
onFetchSource: D ? () => D(m, C) : void 0
|
|
2568
|
-
},
|
|
2569
|
-
className: J("str-chat__message-bubble", { "relative isolate":
|
|
2587
|
+
}, Ge = /* @__PURE__ */ W("div", {
|
|
2588
|
+
className: J("str-chat__message-bubble", { "relative isolate": Ae }),
|
|
2570
2589
|
children: [/* @__PURE__ */ U(R, {
|
|
2571
|
-
message:
|
|
2590
|
+
message: Te,
|
|
2572
2591
|
renderText: g
|
|
2573
|
-
}),
|
|
2592
|
+
}), Ae && /* @__PURE__ */ U(Tn, { side: X ? "me" : "other" })]
|
|
2593
|
+
}), Ke = q.length > 0 && /* @__PURE__ */ U("div", {
|
|
2594
|
+
className: J("flex flex-col gap-[4px]", X ? "items-end" : "items-start"),
|
|
2595
|
+
children: q.map((e, t) => {
|
|
2596
|
+
let n = X ? an.Sent : an.Received, r = t === q.length - 1 && !Ce;
|
|
2597
|
+
return /* @__PURE__ */ U(n, {
|
|
2598
|
+
...ri(e),
|
|
2599
|
+
groupPosition: r ? ke : "middle"
|
|
2600
|
+
}, `locked-link-${t}`);
|
|
2601
|
+
})
|
|
2574
2602
|
});
|
|
2575
2603
|
return /* @__PURE__ */ W(H, { children: [
|
|
2576
2604
|
n && /* @__PURE__ */ U(ie, { additionalMessageInputProps: t }),
|
|
@@ -2580,23 +2608,23 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2580
2608
|
open: F
|
|
2581
2609
|
}),
|
|
2582
2610
|
/* @__PURE__ */ W("div", {
|
|
2583
|
-
className:
|
|
2611
|
+
className: Fe,
|
|
2584
2612
|
"data-message-id": m.id,
|
|
2585
2613
|
"data-dd-privacy": "mask",
|
|
2586
2614
|
children: [
|
|
2587
2615
|
ye && /* @__PURE__ */ U(ye, {}),
|
|
2588
2616
|
!!z && /* @__PURE__ */ U(ve, { reminder: z }),
|
|
2589
|
-
m.user && /* @__PURE__ */ U(
|
|
2617
|
+
m.user && /* @__PURE__ */ U(Z, {
|
|
2590
2618
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2591
2619
|
id: m.user.id,
|
|
2592
2620
|
image: m.user.image,
|
|
2593
2621
|
name: m.user.name || m.user.id,
|
|
2594
2622
|
size: 24,
|
|
2595
2623
|
shape: "circle",
|
|
2596
|
-
dmAgentEnabled:
|
|
2624
|
+
dmAgentEnabled: Re
|
|
2597
2625
|
}),
|
|
2598
2626
|
/* @__PURE__ */ U("div", {
|
|
2599
|
-
className: J("str-chat__message-inner", { "str-chat__simple-message--error-failed":
|
|
2627
|
+
className: J("str-chat__message-inner", { "str-chat__simple-message--error-failed": Ne || Pe }),
|
|
2600
2628
|
"data-testid": "message-inner",
|
|
2601
2629
|
onClick: Y,
|
|
2602
2630
|
onKeyDown: Y,
|
|
@@ -2606,52 +2634,56 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2606
2634
|
marginInlineEnd: 0,
|
|
2607
2635
|
marginInlineStart: 0
|
|
2608
2636
|
},
|
|
2609
|
-
children:
|
|
2637
|
+
children: Le ? /* @__PURE__ */ W("div", {
|
|
2610
2638
|
className: "str-chat__message-bubble-wrapper message-tip-wrapper",
|
|
2611
|
-
children: [/* @__PURE__ */ U(
|
|
2612
|
-
}) :
|
|
2639
|
+
children: [/* @__PURE__ */ U(Mn, { message: m }), m.text?.trim() && Ge]
|
|
2640
|
+
}) : yn(m) ? /* @__PURE__ */ W("div", {
|
|
2613
2641
|
className: "str-chat__message-bubble-wrapper",
|
|
2614
|
-
children: /* @__PURE__ */ W("div", {
|
|
2642
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2615
2643
|
className: "flex items-center gap-2",
|
|
2616
2644
|
children: [
|
|
2617
2645
|
X && B && /* @__PURE__ */ U(B, {}),
|
|
2618
|
-
X ? /* @__PURE__ */ U(
|
|
2619
|
-
...
|
|
2646
|
+
X ? /* @__PURE__ */ U(mn, {
|
|
2647
|
+
...Ue,
|
|
2620
2648
|
isMine: !0
|
|
2621
|
-
}) : /* @__PURE__ */ U(
|
|
2622
|
-
...
|
|
2649
|
+
}) : /* @__PURE__ */ U(mn, {
|
|
2650
|
+
...Ue,
|
|
2623
2651
|
isMine: !1,
|
|
2624
2652
|
isUnlocking: w(m.id),
|
|
2625
2653
|
onUnlockClick: () => T?.(m, C)
|
|
2626
2654
|
}),
|
|
2627
2655
|
!X && B && /* @__PURE__ */ U(B, {})
|
|
2628
2656
|
]
|
|
2629
|
-
})
|
|
2630
|
-
}) :
|
|
2657
|
+
}), Ke]
|
|
2658
|
+
}) : bn(m) ? /* @__PURE__ */ W("div", {
|
|
2631
2659
|
className: "str-chat__message-bubble-wrapper message-locked-attachment-wrapper",
|
|
2632
|
-
children: [
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2660
|
+
children: [
|
|
2661
|
+
/* @__PURE__ */ W("div", {
|
|
2662
|
+
className: "flex items-center gap-2",
|
|
2663
|
+
children: [
|
|
2664
|
+
X && B && /* @__PURE__ */ U(B, {}),
|
|
2665
|
+
X ? /* @__PURE__ */ U(mn, {
|
|
2666
|
+
...We,
|
|
2667
|
+
isMine: !0,
|
|
2668
|
+
onPreviewClick: () => T ? T(m, C) : void 0
|
|
2669
|
+
}) : /* @__PURE__ */ U(mn, {
|
|
2670
|
+
...We,
|
|
2671
|
+
isMine: !1,
|
|
2672
|
+
isUnlocking: w(m.id),
|
|
2673
|
+
onUnlockClick: () => T ? T(m, C) : void 0,
|
|
2674
|
+
onDownloadClick: () => N ? N(m, C) : void 0
|
|
2675
|
+
}),
|
|
2676
|
+
!X && B && /* @__PURE__ */ U(B, {})
|
|
2677
|
+
]
|
|
2678
|
+
}),
|
|
2679
|
+
Ke,
|
|
2680
|
+
Ce && Ge
|
|
2681
|
+
]
|
|
2682
|
+
}) : He ? /* @__PURE__ */ U(pi, {
|
|
2683
|
+
groupPosition: ke,
|
|
2652
2684
|
isMyMessage: X,
|
|
2653
2685
|
message: {
|
|
2654
|
-
...
|
|
2686
|
+
...Te,
|
|
2655
2687
|
attachments: K,
|
|
2656
2688
|
i18n: void 0
|
|
2657
2689
|
},
|
|
@@ -2659,56 +2691,56 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2659
2691
|
}) : /* @__PURE__ */ U("div", {
|
|
2660
2692
|
className: "str-chat__message-bubble-wrapper",
|
|
2661
2693
|
children: /* @__PURE__ */ W("div", {
|
|
2662
|
-
className: J("str-chat__message-bubble", { "relative isolate":
|
|
2694
|
+
className: J("str-chat__message-bubble", { "relative isolate": Ae }),
|
|
2663
2695
|
children: [
|
|
2664
|
-
|
|
2696
|
+
Re && !Ve && /* @__PURE__ */ U(Sn, {
|
|
2665
2697
|
message: m,
|
|
2666
|
-
hasAttachment:
|
|
2698
|
+
hasAttachment: Be,
|
|
2667
2699
|
isMyMessage: X
|
|
2668
2700
|
}),
|
|
2669
|
-
|
|
2701
|
+
Ie && /* @__PURE__ */ U(ee, { poll: Ie }),
|
|
2670
2702
|
K?.length && !m.quoted_message ? /* @__PURE__ */ U(te, {
|
|
2671
2703
|
actionHandler: s,
|
|
2672
2704
|
attachments: K
|
|
2673
2705
|
}) : null,
|
|
2674
2706
|
U(G ? V : R, {
|
|
2675
|
-
message:
|
|
2707
|
+
message: Te,
|
|
2676
2708
|
renderText: g
|
|
2677
2709
|
}),
|
|
2678
2710
|
/* @__PURE__ */ U(M, {}),
|
|
2679
|
-
|
|
2711
|
+
Ae && /* @__PURE__ */ U(Tn, { side: X ? "me" : "other" })
|
|
2680
2712
|
]
|
|
2681
2713
|
})
|
|
2682
2714
|
})
|
|
2683
2715
|
}),
|
|
2684
|
-
!
|
|
2716
|
+
!ze && !Le && /* @__PURE__ */ U("div", {
|
|
2685
2717
|
className: "str-chat__message-footer",
|
|
2686
|
-
children: (!
|
|
2718
|
+
children: (!Re || Ve) && /* @__PURE__ */ U(Sn, {
|
|
2687
2719
|
message: m,
|
|
2688
|
-
hasAttachment:
|
|
2720
|
+
hasAttachment: Be,
|
|
2689
2721
|
isMyMessage: X
|
|
2690
2722
|
})
|
|
2691
2723
|
}),
|
|
2692
|
-
/* @__PURE__ */ U(
|
|
2724
|
+
/* @__PURE__ */ U(Rn, {
|
|
2693
2725
|
onOutboundClick: y,
|
|
2694
2726
|
resolvedOutbound: x
|
|
2695
2727
|
}),
|
|
2696
|
-
|
|
2728
|
+
je && /* @__PURE__ */ U(_e, {
|
|
2697
2729
|
onClick: c,
|
|
2698
2730
|
reply_count: m.reply_count
|
|
2699
2731
|
}),
|
|
2700
|
-
|
|
2732
|
+
Me && /* @__PURE__ */ U(pe, {})
|
|
2701
2733
|
]
|
|
2702
2734
|
}, m.id)
|
|
2703
2735
|
] });
|
|
2704
|
-
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)),
|
|
2705
|
-
let t = V("CustomMessage"), n = u(
|
|
2706
|
-
return /* @__PURE__ */ U(
|
|
2736
|
+
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)), hi = (e) => {
|
|
2737
|
+
let t = V("CustomMessage"), n = u(En), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
|
|
2738
|
+
return /* @__PURE__ */ U(mi, {
|
|
2707
2739
|
...t,
|
|
2708
2740
|
...e,
|
|
2709
2741
|
resolvedOutbound: i
|
|
2710
2742
|
});
|
|
2711
|
-
},
|
|
2743
|
+
}, gi = () => {
|
|
2712
2744
|
let { handleDelete: e, message: t } = V("CustomMessageActions");
|
|
2713
2745
|
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ U(Ye, {
|
|
2714
2746
|
onClick: e,
|
|
@@ -2721,32 +2753,32 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2721
2753
|
"aria-hidden": !0
|
|
2722
2754
|
})
|
|
2723
2755
|
});
|
|
2724
|
-
},
|
|
2756
|
+
}, _i = () => {
|
|
2725
2757
|
let { handleFlag: e } = V("CustomMessageActions");
|
|
2726
2758
|
return /* @__PURE__ */ U(Ye, {
|
|
2727
2759
|
onClick: e,
|
|
2728
2760
|
"aria-label": "Report",
|
|
2729
2761
|
title: "Report",
|
|
2730
2762
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2731
|
-
children: /* @__PURE__ */ U(
|
|
2763
|
+
children: /* @__PURE__ */ U(X, {
|
|
2732
2764
|
size: 16,
|
|
2733
2765
|
weight: "light",
|
|
2734
2766
|
"aria-hidden": !0
|
|
2735
2767
|
})
|
|
2736
2768
|
});
|
|
2737
|
-
},
|
|
2769
|
+
}, vi = () => {
|
|
2738
2770
|
let { message: e } = V("CustomMessageActions");
|
|
2739
2771
|
return e.metadata?.custom_type === G.ATTACHMENT ? /* @__PURE__ */ U(Xe, { messageActionSet: [{
|
|
2740
|
-
Component:
|
|
2772
|
+
Component: gi,
|
|
2741
2773
|
placement: "quick",
|
|
2742
2774
|
type: "delete"
|
|
2743
2775
|
}, {
|
|
2744
|
-
Component:
|
|
2776
|
+
Component: _i,
|
|
2745
2777
|
placement: "quick",
|
|
2746
2778
|
type: "flag"
|
|
2747
2779
|
}] }) : null;
|
|
2748
|
-
},
|
|
2749
|
-
let { linkPreviewsManager: e } = _e(), { linkPreviews: t } = xe(e.state,
|
|
2780
|
+
}, yi = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => _.previewIsLoaded(e) || _.previewIsLoading(e)) }), bi = () => {
|
|
2781
|
+
let { linkPreviewsManager: e } = _e(), { linkPreviews: t } = xe(e.state, yi), n = (t) => {
|
|
2750
2782
|
e.dismissPreview(t);
|
|
2751
2783
|
};
|
|
2752
2784
|
return t.length > 0 ? /* @__PURE__ */ U("div", {
|
|
@@ -2754,7 +2786,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2754
2786
|
className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2",
|
|
2755
2787
|
children: t.map((e) => {
|
|
2756
2788
|
let t = _.previewIsLoading(e);
|
|
2757
|
-
return /* @__PURE__ */ U(
|
|
2789
|
+
return /* @__PURE__ */ U(an.Composer, {
|
|
2758
2790
|
title: e.title,
|
|
2759
2791
|
url: e.og_scrape_url,
|
|
2760
2792
|
thumbnailUrl: e.image_url,
|
|
@@ -2764,7 +2796,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2764
2796
|
}, e.og_scrape_url);
|
|
2765
2797
|
})
|
|
2766
2798
|
}) : null;
|
|
2767
|
-
},
|
|
2799
|
+
}, xi = o.createContext(!1), Si = 200, Ci = () => u(xi), wi = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ U("button", {
|
|
2768
2800
|
...n,
|
|
2769
2801
|
type: "button",
|
|
2770
2802
|
"aria-label": "Send",
|
|
@@ -2775,8 +2807,8 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2775
2807
|
weight: "bold",
|
|
2776
2808
|
className: "size-4"
|
|
2777
2809
|
})
|
|
2778
|
-
}),
|
|
2779
|
-
let e = u(
|
|
2810
|
+
}), Ti = () => {
|
|
2811
|
+
let e = u(xi), { handleSubmit: t } = ye(), n = ve(), r = e || !n, { SendButton: i = wi, AttachmentPreviewList: a = x } = ge("CustomMessageInput"), s = o.useRef(null);
|
|
2780
2812
|
return o.useEffect(() => {
|
|
2781
2813
|
let e = s.current;
|
|
2782
2814
|
if (!e || typeof ResizeObserver > "u") return;
|
|
@@ -2801,7 +2833,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2801
2833
|
className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2",
|
|
2802
2834
|
children: [
|
|
2803
2835
|
/* @__PURE__ */ U(te, {}),
|
|
2804
|
-
/* @__PURE__ */ U(
|
|
2836
|
+
/* @__PURE__ */ U(bi, {}),
|
|
2805
2837
|
/* @__PURE__ */ U(a, {})
|
|
2806
2838
|
]
|
|
2807
2839
|
}), /* @__PURE__ */ W("div", {
|
|
@@ -2830,7 +2862,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2830
2862
|
})]
|
|
2831
2863
|
})]
|
|
2832
2864
|
});
|
|
2833
|
-
},
|
|
2865
|
+
}, Ei = () => /* @__PURE__ */ W("div", {
|
|
2834
2866
|
className: "messaging-composer-backdrop",
|
|
2835
2867
|
"aria-hidden": "true",
|
|
2836
2868
|
children: [
|
|
@@ -2841,7 +2873,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2841
2873
|
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2842
2874
|
/* @__PURE__ */ U("div", { className: "messaging-composer-backdrop-gradient" })
|
|
2843
2875
|
]
|
|
2844
|
-
}),
|
|
2876
|
+
}), Di = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: i, composerInput: a }) => {
|
|
2845
2877
|
let { channel: s } = me(), c = s?.data?.frozen === !0, l = !!a, u = o.useRef(null);
|
|
2846
2878
|
return o.useEffect(() => {
|
|
2847
2879
|
if (!l) return;
|
|
@@ -2850,7 +2882,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2850
2882
|
let n = e.offsetHeight, r = () => {
|
|
2851
2883
|
let r = e.offsetHeight, i = r > n;
|
|
2852
2884
|
n = r;
|
|
2853
|
-
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight <
|
|
2885
|
+
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight < Si : !1;
|
|
2854
2886
|
t.style.setProperty("--messaging-composer-height", `${r}px`), i && o && a && (a.scrollTop = a.scrollHeight);
|
|
2855
2887
|
};
|
|
2856
2888
|
if (r(), typeof ResizeObserver > "u") return;
|
|
@@ -2862,7 +2894,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2862
2894
|
ref: u,
|
|
2863
2895
|
"data-testid": "composer-chrome",
|
|
2864
2896
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2865
|
-
children: [/* @__PURE__ */ U(
|
|
2897
|
+
children: [/* @__PURE__ */ U(Ei, {}), /* @__PURE__ */ W("div", {
|
|
2866
2898
|
className: "relative z-10 flex flex-col",
|
|
2867
2899
|
children: [
|
|
2868
2900
|
t?.(),
|
|
@@ -2892,7 +2924,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2892
2924
|
ref: u,
|
|
2893
2925
|
"data-testid": "composer-chrome",
|
|
2894
2926
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2895
|
-
children: [/* @__PURE__ */ U(
|
|
2927
|
+
children: [/* @__PURE__ */ U(Ei, {}), /* @__PURE__ */ W("div", {
|
|
2896
2928
|
className: "relative z-10 flex min-h-0 flex-col",
|
|
2897
2929
|
children: [t?.(), /* @__PURE__ */ W("div", {
|
|
2898
2930
|
className: "flex min-h-0 flex-col gap-4 p-3 pb-5 md:p-5",
|
|
@@ -2904,9 +2936,9 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2904
2936
|
children: [e && /* @__PURE__ */ U("div", {
|
|
2905
2937
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2906
2938
|
children: e()
|
|
2907
|
-
}), /* @__PURE__ */ U(
|
|
2939
|
+
}), /* @__PURE__ */ U(xi.Provider, {
|
|
2908
2940
|
value: c,
|
|
2909
|
-
children: /* @__PURE__ */ U(N, { Input: a ??
|
|
2941
|
+
children: /* @__PURE__ */ U(N, { Input: a ?? Ti })
|
|
2910
2942
|
})]
|
|
2911
2943
|
}), n?.()]
|
|
2912
2944
|
})]
|
|
@@ -2923,51 +2955,51 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2923
2955
|
children: [e && /* @__PURE__ */ U("div", {
|
|
2924
2956
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2925
2957
|
children: e()
|
|
2926
|
-
}), /* @__PURE__ */ U(
|
|
2958
|
+
}), /* @__PURE__ */ U(xi.Provider, {
|
|
2927
2959
|
value: c,
|
|
2928
|
-
children: /* @__PURE__ */ U(N, { Input:
|
|
2960
|
+
children: /* @__PURE__ */ U(N, { Input: Ti })
|
|
2929
2961
|
})]
|
|
2930
2962
|
}),
|
|
2931
2963
|
n?.()
|
|
2932
2964
|
]
|
|
2933
2965
|
});
|
|
2934
|
-
},
|
|
2966
|
+
}, Oi = {
|
|
2935
2967
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
2936
2968
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
2937
|
-
},
|
|
2969
|
+
}, ki = ["SYSTEM_AGE_SAFETY_BLOCKED"], Ai = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, ji = "age safety guidelines.", Mi = "https://linktr.ee/s/about/contact", Ni = (e) => ki.includes(e), Pi = (e) => Ni(e.metadata?.custom_type), Fi = (e) => {
|
|
2938
2970
|
let t = e.metadata?.custom_type;
|
|
2939
|
-
if (
|
|
2971
|
+
if (Ce(t)) return {
|
|
2940
2972
|
kind: "dm-agent",
|
|
2941
2973
|
type: t
|
|
2942
2974
|
};
|
|
2943
|
-
if (
|
|
2975
|
+
if (q(t)) return {
|
|
2944
2976
|
kind: "age-safety",
|
|
2945
2977
|
type: t
|
|
2946
2978
|
};
|
|
2947
2979
|
let n = e.dm_agent_system_type;
|
|
2948
|
-
if (
|
|
2980
|
+
if (Ce(n)) return {
|
|
2949
2981
|
kind: "dm-agent",
|
|
2950
2982
|
type: n
|
|
2951
2983
|
};
|
|
2952
|
-
},
|
|
2953
|
-
let t = e.indexOf(
|
|
2984
|
+
}, Ii = (e) => {
|
|
2985
|
+
let t = e.indexOf(ji);
|
|
2954
2986
|
if (t === -1) return e;
|
|
2955
2987
|
let n = t + 22;
|
|
2956
2988
|
return /* @__PURE__ */ W(H, { children: [
|
|
2957
2989
|
e.slice(0, t),
|
|
2958
2990
|
/* @__PURE__ */ U("a", {
|
|
2959
|
-
href:
|
|
2991
|
+
href: Mi,
|
|
2960
2992
|
target: "_blank",
|
|
2961
2993
|
rel: "noopener noreferrer",
|
|
2962
2994
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
2963
|
-
children:
|
|
2995
|
+
children: ji
|
|
2964
2996
|
}),
|
|
2965
2997
|
e.slice(n)
|
|
2966
2998
|
] });
|
|
2967
|
-
},
|
|
2968
|
-
let t = !
|
|
2999
|
+
}, Li = (e) => {
|
|
3000
|
+
let t = !Pi(e.message), n = Fi(e.message);
|
|
2969
3001
|
if (n?.kind === "dm-agent") {
|
|
2970
|
-
let r = e.message.text?.trim() ||
|
|
3002
|
+
let r = e.message.text?.trim() || Oi[n.type];
|
|
2971
3003
|
return /* @__PURE__ */ W("div", {
|
|
2972
3004
|
className: "str-chat__message--system",
|
|
2973
3005
|
"data-testid": "message-system",
|
|
@@ -2988,7 +3020,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2988
3020
|
});
|
|
2989
3021
|
}
|
|
2990
3022
|
if (n?.kind === "age-safety") {
|
|
2991
|
-
let r = e.message.text?.trim() ||
|
|
3023
|
+
let r = e.message.text?.trim() || Ai[n.type];
|
|
2992
3024
|
return /* @__PURE__ */ W("div", {
|
|
2993
3025
|
className: "str-chat__message--system",
|
|
2994
3026
|
"data-testid": "message-system",
|
|
@@ -3006,7 +3038,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3006
3038
|
className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]",
|
|
3007
3039
|
children: /* @__PURE__ */ U("p", {
|
|
3008
3040
|
className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3009
|
-
children:
|
|
3041
|
+
children: Ii(r)
|
|
3010
3042
|
})
|
|
3011
3043
|
})]
|
|
3012
3044
|
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
@@ -3024,7 +3056,7 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3024
3056
|
]
|
|
3025
3057
|
}), !t && /* @__PURE__ */ U(z, { message: e.message })]
|
|
3026
3058
|
});
|
|
3027
|
-
},
|
|
3059
|
+
}, Ri = c(!1), zi = ({ cx: e, index: t }) => /* @__PURE__ */ U("circle", {
|
|
3028
3060
|
cx: e,
|
|
3029
3061
|
cy: "6.15",
|
|
3030
3062
|
r: "3.9",
|
|
@@ -3037,15 +3069,15 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3037
3069
|
begin: `${120 * t}ms`,
|
|
3038
3070
|
repeatCount: "indefinite"
|
|
3039
3071
|
})
|
|
3040
|
-
}),
|
|
3072
|
+
}), Bi = /* @__PURE__ */ new Set([
|
|
3041
3073
|
y.Thinking,
|
|
3042
3074
|
y.Generating,
|
|
3043
3075
|
y.ExternalSources
|
|
3044
|
-
]),
|
|
3045
|
-
let { channel: t, channelConfig: n, thread: r } = me(), { client: i } = he(), { typing: a = {} } = Se(), { aiState: o } = fe(t), s = u(
|
|
3046
|
-
if (!e && s &&
|
|
3047
|
-
let e =
|
|
3048
|
-
return /* @__PURE__ */ U(
|
|
3076
|
+
]), Vi = ({ threadList: e }) => {
|
|
3077
|
+
let { channel: t, channelConfig: n, thread: r } = me(), { client: i } = he(), { typing: a = {} } = Se(), { aiState: o } = fe(t), s = u(Ri);
|
|
3078
|
+
if (!e && s && Bi.has(o)) {
|
|
3079
|
+
let e = Ui(t, i.user?.id);
|
|
3080
|
+
return /* @__PURE__ */ U(Hi, {
|
|
3049
3081
|
avatarId: e?.id ?? "ai-agent",
|
|
3050
3082
|
avatarName: e?.name ?? e?.id ?? "Agent",
|
|
3051
3083
|
avatarImage: e?.image,
|
|
@@ -3056,19 +3088,19 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3056
3088
|
let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], d = e ? l : c;
|
|
3057
3089
|
if (!d.length) return null;
|
|
3058
3090
|
let f = d[0]?.user, p = f?.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3059
|
-
return /* @__PURE__ */ U(
|
|
3091
|
+
return /* @__PURE__ */ U(Hi, {
|
|
3060
3092
|
avatarId: f?.id ?? p?.id ?? "typing-user",
|
|
3061
3093
|
avatarName: f?.name ?? p?.name ?? f?.id ?? "Typing user",
|
|
3062
3094
|
avatarImage: f?.image ?? p?.image,
|
|
3063
3095
|
testId: "typing-indicator"
|
|
3064
3096
|
});
|
|
3065
|
-
},
|
|
3097
|
+
}, Hi = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ U("div", {
|
|
3066
3098
|
className: "str-chat__li str-chat__li--single str-chat__typing-indicator !static",
|
|
3067
3099
|
"data-testid": r,
|
|
3068
3100
|
style: { marginBottom: "var(--messaging-channel-input-spacer-height, 80px)" },
|
|
3069
3101
|
children: /* @__PURE__ */ W("div", {
|
|
3070
3102
|
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",
|
|
3071
|
-
children: [/* @__PURE__ */ U(
|
|
3103
|
+
children: [/* @__PURE__ */ U(Z, {
|
|
3072
3104
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3073
3105
|
id: e,
|
|
3074
3106
|
name: t,
|
|
@@ -3093,28 +3125,28 @@ var fi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3093
3125
|
height: "13",
|
|
3094
3126
|
overflow: "visible",
|
|
3095
3127
|
children: [
|
|
3096
|
-
/* @__PURE__ */ U(
|
|
3128
|
+
/* @__PURE__ */ U(zi, {
|
|
3097
3129
|
cx: "4",
|
|
3098
3130
|
index: 0
|
|
3099
3131
|
}),
|
|
3100
|
-
/* @__PURE__ */ U(
|
|
3132
|
+
/* @__PURE__ */ U(zi, {
|
|
3101
3133
|
cx: "16",
|
|
3102
3134
|
index: 1
|
|
3103
3135
|
}),
|
|
3104
|
-
/* @__PURE__ */ U(
|
|
3136
|
+
/* @__PURE__ */ U(zi, {
|
|
3105
3137
|
cx: "28",
|
|
3106
3138
|
index: 2
|
|
3107
3139
|
})
|
|
3108
3140
|
]
|
|
3109
3141
|
})
|
|
3110
3142
|
})
|
|
3111
|
-
}), /* @__PURE__ */ U(
|
|
3143
|
+
}), /* @__PURE__ */ U(Tn, { side: "other" })]
|
|
3112
3144
|
})
|
|
3113
3145
|
})
|
|
3114
3146
|
})]
|
|
3115
3147
|
})
|
|
3116
3148
|
});
|
|
3117
|
-
function
|
|
3149
|
+
function Ui(e, t) {
|
|
3118
3150
|
let n = e?.state?.members ?? {};
|
|
3119
3151
|
for (let e of Object.values(n)) {
|
|
3120
3152
|
let n = e?.user;
|
|
@@ -3123,7 +3155,7 @@ function Hi(e, t) {
|
|
|
3123
3155
|
}
|
|
3124
3156
|
//#endregion
|
|
3125
3157
|
//#region src/components/MessagingShell/ChannelEmptyState.tsx
|
|
3126
|
-
var
|
|
3158
|
+
var Wi = () => null, Gi = ({ className: e, message: t }) => /* @__PURE__ */ W("div", {
|
|
3127
3159
|
className: J("flex items-center justify-center h-full", e),
|
|
3128
3160
|
children: [/* @__PURE__ */ W("svg", {
|
|
3129
3161
|
viewBox: "0 0 100 100",
|
|
@@ -3174,27 +3206,27 @@ var Ui = () => null, Wi = ({ className: e, message: t }) => /* @__PURE__ */ W("d
|
|
|
3174
3206
|
className: "text-stone",
|
|
3175
3207
|
children: t
|
|
3176
3208
|
})]
|
|
3177
|
-
}),
|
|
3209
|
+
}), Ki = o.memo(() => /* @__PURE__ */ U("div", {
|
|
3178
3210
|
className: "messaging-loading-state flex items-center justify-center h-full",
|
|
3179
3211
|
children: /* @__PURE__ */ W("div", {
|
|
3180
3212
|
className: "flex items-center",
|
|
3181
|
-
children: [/* @__PURE__ */ U(
|
|
3213
|
+
children: [/* @__PURE__ */ U(Gi, { className: "w-6 h-6" }), /* @__PURE__ */ U("span", {
|
|
3182
3214
|
className: "text-sm text-stone",
|
|
3183
3215
|
children: "Loading messages"
|
|
3184
3216
|
})]
|
|
3185
3217
|
})
|
|
3186
3218
|
}));
|
|
3187
|
-
|
|
3219
|
+
Ki.displayName = "LoadingState";
|
|
3188
3220
|
//#endregion
|
|
3189
3221
|
//#region src/components/ChannelView.tsx
|
|
3190
|
-
var
|
|
3222
|
+
var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: i, onLeaveConversation: a, onBlockParticipant: s, showDeleteConversation: c = !0, onDeleteConversationClick: u, onBlockParticipantClick: f, onReportParticipantClick: p, showBlockParticipant: h = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
|
|
3191
3223
|
let { channel: A, messages: j } = me(), M = m(D);
|
|
3192
3224
|
d(() => {
|
|
3193
3225
|
M.current = D;
|
|
3194
3226
|
}, [D]);
|
|
3195
3227
|
let N = l((e) => {
|
|
3196
3228
|
M.current?.(e);
|
|
3197
|
-
}, []), P = D ? N : void 0, I =
|
|
3229
|
+
}, []), P = D ? N : void 0, I = An(j, O), L = A.state.messages.some((e) => e.type !== "deleted"), R = b ? /* @__PURE__ */ U(o.Fragment, { children: b() }, "lt-channel-banner") : null, z = /* @__PURE__ */ U(wt, {
|
|
3198
3230
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
3199
3231
|
onBack: e,
|
|
3200
3232
|
showBackButton: t,
|
|
@@ -3212,7 +3244,7 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3212
3244
|
renderChannelActions: S,
|
|
3213
3245
|
onParticipantNameClick: E
|
|
3214
3246
|
}), ee = l((e) => {
|
|
3215
|
-
let { message: t } = V("ChannelView"), n = /* @__PURE__ */ U(
|
|
3247
|
+
let { message: t } = V("ChannelView"), n = /* @__PURE__ */ U(hi, {
|
|
3216
3248
|
...e,
|
|
3217
3249
|
viewerLanguage: w,
|
|
3218
3250
|
onOutboundClick: P
|
|
@@ -3223,12 +3255,12 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3223
3255
|
C,
|
|
3224
3256
|
w
|
|
3225
3257
|
]);
|
|
3226
|
-
return /* @__PURE__ */ U(
|
|
3258
|
+
return /* @__PURE__ */ U(En.Provider, {
|
|
3227
3259
|
value: I,
|
|
3228
3260
|
children: /* @__PURE__ */ U(ae, {
|
|
3229
3261
|
overrides: {
|
|
3230
3262
|
Message: ee,
|
|
3231
|
-
MessageActions:
|
|
3263
|
+
MessageActions: vi,
|
|
3232
3264
|
UnreadMessagesNotification: () => null,
|
|
3233
3265
|
UnreadMessagesSeparator: () => null
|
|
3234
3266
|
},
|
|
@@ -3250,7 +3282,7 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3250
3282
|
hideDeletedMessages: !0,
|
|
3251
3283
|
hideNewMessageSeparator: !1
|
|
3252
3284
|
})]
|
|
3253
|
-
}, "lt-channel-message-list"), /* @__PURE__ */ U(
|
|
3285
|
+
}, "lt-channel-message-list"), /* @__PURE__ */ U(Di, {
|
|
3254
3286
|
...n && { renderActions: () => n?.(A) },
|
|
3255
3287
|
...i && { renderHeader: () => i(A) },
|
|
3256
3288
|
renderFooter: () => r?.(A),
|
|
@@ -3277,7 +3309,7 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3277
3309
|
})]
|
|
3278
3310
|
}, "lt-channel-message-list"),
|
|
3279
3311
|
i ? /* @__PURE__ */ U(o.Fragment, { children: i(A) }, "lt-channel-conversation-footer") : null,
|
|
3280
|
-
/* @__PURE__ */ U(
|
|
3312
|
+
/* @__PURE__ */ U(Di, {
|
|
3281
3313
|
...n && { renderActions: () => n?.(A) },
|
|
3282
3314
|
renderFooter: () => r?.(A),
|
|
3283
3315
|
disabled: _,
|
|
@@ -3287,7 +3319,7 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3287
3319
|
] }) })
|
|
3288
3320
|
})
|
|
3289
3321
|
});
|
|
3290
|
-
},
|
|
3322
|
+
}, Ji = o.memo(({ channel: e, onBack: t, showBackButton: n = !1, renderMessageInputActions: r, renderMessageInputFooter: i, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: s, className: c, CustomChannelEmptyState: u = Wi, showDeleteConversation: f = !0, onDeleteConversationClick: p, onBlockParticipantClick: h, onReportParticipantClick: g, showBlockParticipant: _ = !0, showReportParticipant: v = !0, composerDisabled: y = !1, composerDisabledReason: b, dmAgentEnabled: x, messageMetadata: C, onMessageSent: w, showStarButton: T = !1, renderChannelBanner: E, customChannelActions: D, renderChannelActions: O, renderMessage: k, onMessageLinkClick: A, sendButton: j, attachmentPreviewList: M, viewerLanguage: N, showChannelInfo: P = !0, onParticipantNameClick: F, onOutboundClick: I, resolveOutbound: L, composerInput: R }) => {
|
|
3291
3323
|
let z = l(async (t, n, r) => {
|
|
3292
3324
|
let i = e.data?.chatbot_paused === !0, a = x && !i, o = {
|
|
3293
3325
|
...n,
|
|
@@ -3325,19 +3357,19 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3325
3357
|
"data-testid": "channel-view",
|
|
3326
3358
|
className: J("messaging-channel-view h-full flex flex-col", c),
|
|
3327
3359
|
style: te,
|
|
3328
|
-
children: /* @__PURE__ */ U(
|
|
3360
|
+
children: /* @__PURE__ */ U(Ri.Provider, {
|
|
3329
3361
|
value: x ?? !1,
|
|
3330
3362
|
children: /* @__PURE__ */ U(S, {
|
|
3331
3363
|
channel: e,
|
|
3332
|
-
MessageSystem:
|
|
3364
|
+
MessageSystem: Li,
|
|
3333
3365
|
EmptyStateIndicator: u,
|
|
3334
|
-
LoadingIndicator:
|
|
3335
|
-
DateSeparator:
|
|
3336
|
-
TypingIndicator:
|
|
3366
|
+
LoadingIndicator: Ki,
|
|
3367
|
+
DateSeparator: Tt,
|
|
3368
|
+
TypingIndicator: Vi,
|
|
3337
3369
|
doSendMessageRequest: z,
|
|
3338
3370
|
...j ? { SendButton: j } : {},
|
|
3339
3371
|
...M ? { AttachmentPreviewList: M } : {},
|
|
3340
|
-
children: /* @__PURE__ */ U(
|
|
3372
|
+
children: /* @__PURE__ */ U(qi, {
|
|
3341
3373
|
onBack: t,
|
|
3342
3374
|
showBackButton: n,
|
|
3343
3375
|
renderMessageInputActions: r,
|
|
@@ -3370,10 +3402,10 @@ var Ki = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3370
3402
|
})
|
|
3371
3403
|
});
|
|
3372
3404
|
});
|
|
3373
|
-
|
|
3405
|
+
Ji.displayName = "ChannelView";
|
|
3374
3406
|
//#endregion
|
|
3375
3407
|
//#region src/components/MessagingShell/ErrorState.tsx
|
|
3376
|
-
var
|
|
3408
|
+
var Yi = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ U("div", {
|
|
3377
3409
|
className: "messaging-error-state flex items-center justify-center h-full p-8",
|
|
3378
3410
|
children: /* @__PURE__ */ W("div", {
|
|
3379
3411
|
className: "text-center max-w-sm",
|
|
@@ -3402,10 +3434,10 @@ var Ji = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ U("div", {
|
|
|
3402
3434
|
]
|
|
3403
3435
|
})
|
|
3404
3436
|
}));
|
|
3405
|
-
|
|
3437
|
+
Yi.displayName = "ErrorState";
|
|
3406
3438
|
//#endregion
|
|
3407
3439
|
//#region src/components/MessagingShell/index.tsx
|
|
3408
|
-
var
|
|
3440
|
+
var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: s, onBlockParticipantClick: c, onReportParticipantClick: u, dmAgentEnabled: f, onMessageSent: p, viewerLanguage: g, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
|
|
3409
3441
|
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = at(), [F, I] = h(null), [L, R] = h(null), [z, ee] = h(!1), { showDeleteConversation: te = !0 } = e, ne = m(o);
|
|
3410
3442
|
ne.current = o;
|
|
3411
3443
|
let re = m(r);
|
|
@@ -3465,17 +3497,17 @@ var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3465
3497
|
let oe = l(() => {
|
|
3466
3498
|
I(null), ee(!0), ae.current?.();
|
|
3467
3499
|
}, []);
|
|
3468
|
-
return A ? /* @__PURE__ */ U(
|
|
3500
|
+
return A ? /* @__PURE__ */ U(Ki, {}) : j ? /* @__PURE__ */ U(Yi, {
|
|
3469
3501
|
message: j,
|
|
3470
3502
|
onBack: M
|
|
3471
|
-
}) : !k || !O ? /* @__PURE__ */ U(
|
|
3503
|
+
}) : !k || !O ? /* @__PURE__ */ U(Yi, {
|
|
3472
3504
|
message: "Not connected to messaging service",
|
|
3473
3505
|
onBack: M
|
|
3474
|
-
}) : L ? /* @__PURE__ */ U(
|
|
3506
|
+
}) : L ? /* @__PURE__ */ U(Yi, { message: L }) : z && !F ? /* @__PURE__ */ U(Yi, { message: "Conversation ended" }) : F ? /* @__PURE__ */ U("div", {
|
|
3475
3507
|
className: "messaging-shell h-full bg-background-primary overflow-hidden",
|
|
3476
3508
|
children: /* @__PURE__ */ U("div", {
|
|
3477
3509
|
className: "flex h-full min-h-0 flex-col",
|
|
3478
|
-
children: /* @__PURE__ */ U(
|
|
3510
|
+
children: /* @__PURE__ */ U(Ji, {
|
|
3479
3511
|
channel: F,
|
|
3480
3512
|
renderMessageInputActions: t,
|
|
3481
3513
|
renderConversationFooter: n,
|
|
@@ -3501,30 +3533,30 @@ var Yi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3501
3533
|
attachmentPreviewList: D
|
|
3502
3534
|
}, F.id)
|
|
3503
3535
|
})
|
|
3504
|
-
}) : /* @__PURE__ */ U(
|
|
3536
|
+
}) : /* @__PURE__ */ U(Ki, {});
|
|
3505
3537
|
};
|
|
3506
3538
|
//#endregion
|
|
3507
3539
|
//#region src/hooks/useRestorePendingMessages.ts
|
|
3508
|
-
function
|
|
3540
|
+
function Zi(e) {
|
|
3509
3541
|
let t = e.state.pending_messages;
|
|
3510
3542
|
if (t?.length) for (let n of t) e.state.addMessageSorted(n.message);
|
|
3511
3543
|
}
|
|
3512
3544
|
//#endregion
|
|
3513
3545
|
//#region src/components/ChannelList/ChannelListContext.tsx
|
|
3514
|
-
var
|
|
3546
|
+
var Qi = o.createContext({
|
|
3515
3547
|
selectedChannel: void 0,
|
|
3516
3548
|
onChannelSelect: () => {},
|
|
3517
3549
|
debug: !1,
|
|
3518
3550
|
renderMessagePreview: void 0,
|
|
3519
3551
|
channelPreview: void 0,
|
|
3520
3552
|
viewerLanguage: void 0
|
|
3521
|
-
}),
|
|
3553
|
+
}), $i = Qi.Provider, ea = () => o.useContext(Qi), ta = (e, t) => {
|
|
3522
3554
|
let n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), r = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
3523
3555
|
return Math.floor((r - n) / 864e5);
|
|
3524
|
-
},
|
|
3556
|
+
}, na = (e) => {
|
|
3525
3557
|
let t = /* @__PURE__ */ new Date();
|
|
3526
3558
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60) return "Just now";
|
|
3527
|
-
let n =
|
|
3559
|
+
let n = ta(e, t);
|
|
3528
3560
|
return n === 0 ? e.toLocaleTimeString([], {
|
|
3529
3561
|
hour: "numeric",
|
|
3530
3562
|
minute: "2-digit",
|
|
@@ -3537,8 +3569,8 @@ var Zi = o.createContext({
|
|
|
3537
3569
|
day: "numeric",
|
|
3538
3570
|
year: "numeric"
|
|
3539
3571
|
});
|
|
3540
|
-
},
|
|
3541
|
-
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } =
|
|
3572
|
+
}, ra = o.memo((e) => {
|
|
3573
|
+
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = ea(), { client: l } = he(), u = r?.id === t?.id, d = ot(t);
|
|
3542
3574
|
if (o) return /* @__PURE__ */ U(o, {
|
|
3543
3575
|
...e,
|
|
3544
3576
|
active: u,
|
|
@@ -3557,7 +3589,7 @@ var Zi = o.createContext({
|
|
|
3557
3589
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].type !== "system") return e[t];
|
|
3558
3590
|
}
|
|
3559
3591
|
})(), v = (() => {
|
|
3560
|
-
let e =
|
|
3592
|
+
let e = Dt({
|
|
3561
3593
|
message: _,
|
|
3562
3594
|
viewerLanguage: c
|
|
3563
3595
|
}), { custom_type: t, attachment_content_type: n } = _?.metadata || {};
|
|
@@ -3570,7 +3602,7 @@ var Zi = o.createContext({
|
|
|
3570
3602
|
if (e) return e;
|
|
3571
3603
|
let r = _?.attachments?.[0];
|
|
3572
3604
|
return r ? r.og_scrape_url ? r.og_scrape_url : r.type === "image" ? "📷 Sent an image" : r.type === "video" ? "🎥 Sent a video" : r.type === "audio" ? "🎵 Sent audio" : r.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
3573
|
-
})(), y = _?.created_at ?
|
|
3605
|
+
})(), y = _?.created_at ? na(new Date(_.created_at)) : "", b = _ ? _n(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
|
|
3574
3606
|
return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
3575
3607
|
channelId: t?.id,
|
|
3576
3608
|
isSelected: u,
|
|
@@ -3589,7 +3621,7 @@ var Zi = o.createContext({
|
|
|
3589
3621
|
"data-dd-privacy": "mask",
|
|
3590
3622
|
children: /* @__PURE__ */ W("div", {
|
|
3591
3623
|
className: "flex items-start gap-4",
|
|
3592
|
-
children: [/* @__PURE__ */ U(
|
|
3624
|
+
children: [/* @__PURE__ */ U(Z, {
|
|
3593
3625
|
id: m?.user?.id || t.id || "unknown",
|
|
3594
3626
|
name: h,
|
|
3595
3627
|
image: g,
|
|
@@ -3625,14 +3657,14 @@ var Zi = o.createContext({
|
|
|
3625
3657
|
})
|
|
3626
3658
|
});
|
|
3627
3659
|
});
|
|
3628
|
-
|
|
3660
|
+
ra.displayName = "CustomChannelPreview";
|
|
3629
3661
|
//#endregion
|
|
3630
3662
|
//#region src/components/ChannelList/index.tsx
|
|
3631
|
-
var
|
|
3663
|
+
var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: i, sort: a = ia, className: s, customEmptyStateIndicator: c, channelListPaginator: l = D, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
|
|
3632
3664
|
let y = o.useRef(0);
|
|
3633
3665
|
y.current++;
|
|
3634
3666
|
let { debug: b = !1 } = rt(), x = o.useCallback((e) => {
|
|
3635
|
-
for (let t of e)
|
|
3667
|
+
for (let t of e) Zi(t);
|
|
3636
3668
|
return i ? i(e) : e;
|
|
3637
3669
|
}, [i]);
|
|
3638
3670
|
b && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
@@ -3659,7 +3691,7 @@ var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3659
3691
|
className: J("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", s),
|
|
3660
3692
|
children: /* @__PURE__ */ U("div", {
|
|
3661
3693
|
className: "flex-1 overflow-hidden min-w-0",
|
|
3662
|
-
children: /* @__PURE__ */ U(
|
|
3694
|
+
children: /* @__PURE__ */ U($i, {
|
|
3663
3695
|
value: S,
|
|
3664
3696
|
children: /* @__PURE__ */ U(C, {
|
|
3665
3697
|
filters: n,
|
|
@@ -3674,32 +3706,32 @@ var ra = { last_message_at: -1 }, ia = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3674
3706
|
onAddedToChannel: _,
|
|
3675
3707
|
onChannelUpdated: v,
|
|
3676
3708
|
Paginator: l,
|
|
3677
|
-
Preview:
|
|
3709
|
+
Preview: ra,
|
|
3678
3710
|
EmptyStateIndicator: c
|
|
3679
3711
|
}, `${JSON.stringify(n)}:${JSON.stringify(a)}`)
|
|
3680
3712
|
})
|
|
3681
3713
|
})
|
|
3682
3714
|
});
|
|
3683
3715
|
});
|
|
3684
|
-
|
|
3716
|
+
aa.displayName = "ChannelList";
|
|
3685
3717
|
//#endregion
|
|
3686
3718
|
//#region src/components/RichCard/RichCardBody.tsx
|
|
3687
|
-
var
|
|
3719
|
+
var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa = "text-[14px] leading-5 tracking-[0.02em]", ca = () => /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("br", {}), /* @__PURE__ */ U("span", {
|
|
3688
3720
|
"aria-hidden": !0,
|
|
3689
3721
|
className: "block h-1.5"
|
|
3690
|
-
})] }),
|
|
3722
|
+
})] }), la = (e) => e.split(/\r?\n/).map((e, t, n) => /* @__PURE__ */ W(o.Fragment, { children: [e, t < n.length - 1 ? /* @__PURE__ */ U(ca, {}) : null] }, t)), ua = ({ surface: e, actions: t, layout: n }) => {
|
|
3691
3723
|
if (t == null || t.length === 0) return null;
|
|
3692
3724
|
let r = n === "stacked";
|
|
3693
3725
|
return /* @__PURE__ */ U("div", {
|
|
3694
3726
|
className: J("flex gap-2", r ? "mt-4 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"),
|
|
3695
|
-
children: t.map((t, n) => /* @__PURE__ */ U(
|
|
3727
|
+
children: t.map((t, n) => /* @__PURE__ */ U(Mt, {
|
|
3696
3728
|
variant: e,
|
|
3697
3729
|
cta: t,
|
|
3698
3730
|
fullWidth: r,
|
|
3699
3731
|
standalone: !0
|
|
3700
3732
|
}, `${t.label}-${n}`))
|
|
3701
3733
|
});
|
|
3702
|
-
},
|
|
3734
|
+
}, da = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
|
|
3703
3735
|
let s = n != null && n.trim() !== "", c = r != null && r.trim() !== "", l = o != null && o.length > 0;
|
|
3704
3736
|
if (!s && !c && !l) return null;
|
|
3705
3737
|
let u = { color: t }, d = i > 1 ? {
|
|
@@ -3716,14 +3748,14 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3716
3748
|
className: "shrink-0",
|
|
3717
3749
|
children: a
|
|
3718
3750
|
}) : null, /* @__PURE__ */ U("p", {
|
|
3719
|
-
className: J("min-w-0",
|
|
3751
|
+
className: J("min-w-0", oa),
|
|
3720
3752
|
style: u,
|
|
3721
3753
|
children: n
|
|
3722
3754
|
})]
|
|
3723
3755
|
}), c && /* @__PURE__ */ U("p", {
|
|
3724
|
-
className: J(
|
|
3756
|
+
className: J(sa, i <= 1 && "truncate"),
|
|
3725
3757
|
style: d,
|
|
3726
|
-
children: i > 1 ?
|
|
3758
|
+
children: i > 1 ? la(r ?? "") : r
|
|
3727
3759
|
})]
|
|
3728
3760
|
});
|
|
3729
3761
|
return /* @__PURE__ */ U("div", {
|
|
@@ -3731,21 +3763,21 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3731
3763
|
children: f ? /* @__PURE__ */ W("div", {
|
|
3732
3764
|
"data-testid": "rich-card-chin-row",
|
|
3733
3765
|
className: "flex items-center justify-between gap-3",
|
|
3734
|
-
children: [p, /* @__PURE__ */ U(
|
|
3766
|
+
children: [p, /* @__PURE__ */ U(ua, {
|
|
3735
3767
|
surface: e,
|
|
3736
3768
|
actions: o,
|
|
3737
3769
|
layout: "row"
|
|
3738
3770
|
})]
|
|
3739
|
-
}) : /* @__PURE__ */ W(H, { children: [p, /* @__PURE__ */ U(
|
|
3771
|
+
}) : /* @__PURE__ */ W(H, { children: [p, /* @__PURE__ */ U(ua, {
|
|
3740
3772
|
surface: e,
|
|
3741
3773
|
actions: o,
|
|
3742
3774
|
layout: "stacked"
|
|
3743
3775
|
})] })
|
|
3744
3776
|
});
|
|
3745
|
-
},
|
|
3777
|
+
}, fa = {
|
|
3746
3778
|
dark: "bg-white/[0.06]",
|
|
3747
3779
|
light: "bg-black/[0.04]"
|
|
3748
|
-
},
|
|
3780
|
+
}, pa = {
|
|
3749
3781
|
1: [0],
|
|
3750
3782
|
2: [-10, 10],
|
|
3751
3783
|
3: [
|
|
@@ -3753,7 +3785,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3753
3785
|
0,
|
|
3754
3786
|
13
|
|
3755
3787
|
]
|
|
3756
|
-
},
|
|
3788
|
+
}, ma = {
|
|
3757
3789
|
1: [0],
|
|
3758
3790
|
2: [-26, 26],
|
|
3759
3791
|
3: [
|
|
@@ -3761,7 +3793,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3761
3793
|
0,
|
|
3762
3794
|
40
|
|
3763
3795
|
]
|
|
3764
|
-
},
|
|
3796
|
+
}, ha = {
|
|
3765
3797
|
1: [0],
|
|
3766
3798
|
2: [0, 1],
|
|
3767
3799
|
3: [
|
|
@@ -3769,7 +3801,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3769
3801
|
3,
|
|
3770
3802
|
2
|
|
3771
3803
|
]
|
|
3772
|
-
},
|
|
3804
|
+
}, ga = {
|
|
3773
3805
|
1: [1],
|
|
3774
3806
|
2: [1, 1],
|
|
3775
3807
|
3: [
|
|
@@ -3777,15 +3809,15 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3777
3809
|
1.08,
|
|
3778
3810
|
1
|
|
3779
3811
|
]
|
|
3780
|
-
},
|
|
3812
|
+
}, _a = ({ variant: e, images: t }) => {
|
|
3781
3813
|
let [n, r] = o.useState({}), i = t.join("\n"), [s, c] = o.useState(i);
|
|
3782
3814
|
i !== s && (c(i), r({}));
|
|
3783
3815
|
let l = t.slice(0, 3).map((e, t) => ({
|
|
3784
3816
|
src: e,
|
|
3785
3817
|
index: t
|
|
3786
|
-
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d =
|
|
3818
|
+
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = pa[u], f = ma[u], p = ha[u], m = ga[u];
|
|
3787
3819
|
return /* @__PURE__ */ U("div", {
|
|
3788
|
-
className: J("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden",
|
|
3820
|
+
className: J("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", fa[e]),
|
|
3789
3821
|
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */ U("img", {
|
|
3790
3822
|
src: a(e) ?? e,
|
|
3791
3823
|
alt: "",
|
|
@@ -3803,44 +3835,44 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3803
3835
|
}
|
|
3804
3836
|
}, `${e}-${t}`))
|
|
3805
3837
|
});
|
|
3806
|
-
},
|
|
3807
|
-
className:
|
|
3808
|
-
children: t === "fan" ? /* @__PURE__ */ U(
|
|
3838
|
+
}, va = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", ya = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ U("div", {
|
|
3839
|
+
className: va,
|
|
3840
|
+
children: t === "fan" ? /* @__PURE__ */ U(_a, {
|
|
3809
3841
|
variant: e,
|
|
3810
3842
|
images: n
|
|
3811
|
-
}) : /* @__PURE__ */ U(
|
|
3843
|
+
}) : /* @__PURE__ */ U(qt, {
|
|
3812
3844
|
variant: e,
|
|
3813
3845
|
thumbnailUrl: i,
|
|
3814
3846
|
title: r,
|
|
3815
3847
|
mimeType: "image/*",
|
|
3816
3848
|
onImageError: a
|
|
3817
3849
|
})
|
|
3818
|
-
}),
|
|
3850
|
+
}), ba = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
|
|
3819
3851
|
let u = Te({
|
|
3820
3852
|
imagePresentation: a,
|
|
3821
3853
|
images: i
|
|
3822
|
-
}), d = i.length > 0, f = d && u === "hero", p =
|
|
3854
|
+
}), d = i.length > 0, f = d && u === "hero", p = $t({
|
|
3823
3855
|
variant: e,
|
|
3824
3856
|
accentColor: c,
|
|
3825
3857
|
layout: "featured",
|
|
3826
3858
|
thumbnailUrl: f ? i[0] : void 0
|
|
3827
3859
|
}), m = l === "single" || l === "end";
|
|
3828
|
-
return /* @__PURE__ */ U(
|
|
3860
|
+
return /* @__PURE__ */ U(rn, {
|
|
3829
3861
|
accentHex: p.accentHex,
|
|
3830
3862
|
side: e === "dark" ? "sender" : "receiver",
|
|
3831
3863
|
visible: m,
|
|
3832
|
-
children: /* @__PURE__ */ W(
|
|
3864
|
+
children: /* @__PURE__ */ W(Vt, {
|
|
3833
3865
|
variant: e,
|
|
3834
3866
|
accentHex: p.accentHex,
|
|
3835
3867
|
"data-testid": "rich-card",
|
|
3836
|
-
children: [d && /* @__PURE__ */ U(
|
|
3868
|
+
children: [d && /* @__PURE__ */ U(ya, {
|
|
3837
3869
|
variant: e,
|
|
3838
3870
|
presentation: u,
|
|
3839
3871
|
images: i,
|
|
3840
3872
|
title: t,
|
|
3841
3873
|
heroUrl: f ? p.thumbnailUrl : void 0,
|
|
3842
3874
|
onHeroError: p.onImageError
|
|
3843
|
-
}), /* @__PURE__ */ U(
|
|
3875
|
+
}), /* @__PURE__ */ U(da, {
|
|
3844
3876
|
ctaSurface: p.surface,
|
|
3845
3877
|
chinTextColor: p.chinTextColor,
|
|
3846
3878
|
title: t,
|
|
@@ -3851,19 +3883,19 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3851
3883
|
})]
|
|
3852
3884
|
})
|
|
3853
3885
|
});
|
|
3854
|
-
},
|
|
3855
|
-
Sent: (e) => /* @__PURE__ */ U(
|
|
3886
|
+
}, xa = {
|
|
3887
|
+
Sent: (e) => /* @__PURE__ */ U(ba, {
|
|
3856
3888
|
...e,
|
|
3857
3889
|
variant: "dark"
|
|
3858
3890
|
}),
|
|
3859
|
-
Received: (e) => /* @__PURE__ */ U(
|
|
3891
|
+
Received: (e) => /* @__PURE__ */ U(ba, {
|
|
3860
3892
|
...e,
|
|
3861
3893
|
variant: "light"
|
|
3862
3894
|
})
|
|
3863
|
-
},
|
|
3895
|
+
}, Sa = "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%", Ca = {
|
|
3864
3896
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3865
3897
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
3866
|
-
},
|
|
3898
|
+
}, wa = ({ variant: e }) => /* @__PURE__ */ U("span", {
|
|
3867
3899
|
"aria-hidden": "true",
|
|
3868
3900
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
3869
3901
|
style: {
|
|
@@ -3871,11 +3903,11 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3871
3903
|
insetInlineStart: e === "received" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
3872
3904
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
3873
3905
|
transformOrigin: "center",
|
|
3874
|
-
backgroundColor:
|
|
3875
|
-
WebkitMask:
|
|
3876
|
-
mask:
|
|
3906
|
+
backgroundColor: Ca[e],
|
|
3907
|
+
WebkitMask: Sa,
|
|
3908
|
+
mask: Sa
|
|
3877
3909
|
}
|
|
3878
|
-
}),
|
|
3910
|
+
}), Ta = {
|
|
3879
3911
|
sent: {
|
|
3880
3912
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3881
3913
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -3884,11 +3916,11 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3884
3916
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
3885
3917
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
3886
3918
|
}
|
|
3887
|
-
},
|
|
3919
|
+
}, Ea = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ W("div", {
|
|
3888
3920
|
"data-dd-privacy": "mask",
|
|
3889
3921
|
className: J("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
|
|
3890
3922
|
style: {
|
|
3891
|
-
...
|
|
3923
|
+
...Ta[e],
|
|
3892
3924
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
3893
3925
|
isolation: "isolate"
|
|
3894
3926
|
},
|
|
@@ -3902,23 +3934,23 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3902
3934
|
className: "m-0 whitespace-pre-wrap break-words hyphens-manual",
|
|
3903
3935
|
children: t
|
|
3904
3936
|
}),
|
|
3905
|
-
n && /* @__PURE__ */ U(
|
|
3937
|
+
n && /* @__PURE__ */ U(wa, { variant: e })
|
|
3906
3938
|
]
|
|
3907
|
-
}),
|
|
3908
|
-
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ U(
|
|
3939
|
+
}), Da = {
|
|
3940
|
+
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ U(Ea, {
|
|
3909
3941
|
variant: "sent",
|
|
3910
3942
|
text: e,
|
|
3911
3943
|
tail: t,
|
|
3912
3944
|
className: n
|
|
3913
3945
|
}),
|
|
3914
|
-
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ U(
|
|
3946
|
+
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ U(Ea, {
|
|
3915
3947
|
variant: "received",
|
|
3916
3948
|
text: e,
|
|
3917
3949
|
tail: t,
|
|
3918
3950
|
header: n,
|
|
3919
3951
|
className: r
|
|
3920
3952
|
})
|
|
3921
|
-
},
|
|
3953
|
+
}, Oa = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ U("button", {
|
|
3922
3954
|
type: "button",
|
|
3923
3955
|
onClick: t,
|
|
3924
3956
|
disabled: n,
|
|
@@ -3928,7 +3960,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3928
3960
|
"opacity-50 cursor-not-allowed": n
|
|
3929
3961
|
}, r),
|
|
3930
3962
|
children: e
|
|
3931
|
-
}),
|
|
3963
|
+
}), ka = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
|
|
3932
3964
|
let s = Ee(e);
|
|
3933
3965
|
return s.length === 0 ? null : /* @__PURE__ */ U("div", {
|
|
3934
3966
|
className: i,
|
|
@@ -3936,7 +3968,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3936
3968
|
className: "flex gap-3 items-end",
|
|
3937
3969
|
children: [(a || o) && /* @__PURE__ */ U("div", {
|
|
3938
3970
|
className: "flex-none",
|
|
3939
|
-
children: /* @__PURE__ */ U(
|
|
3971
|
+
children: /* @__PURE__ */ U(Z, {
|
|
3940
3972
|
id: o || "account",
|
|
3941
3973
|
name: o || "Account",
|
|
3942
3974
|
image: a,
|
|
@@ -3950,7 +3982,7 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3950
3982
|
"data-testid": "faq-list-header",
|
|
3951
3983
|
className: "text-md text-charcoal mb-4",
|
|
3952
3984
|
children: r
|
|
3953
|
-
}), s.map((e) => /* @__PURE__ */ U(
|
|
3985
|
+
}), s.map((e) => /* @__PURE__ */ U(Oa, {
|
|
3954
3986
|
question: e.question,
|
|
3955
3987
|
onClick: () => t(e.id),
|
|
3956
3988
|
loading: n === e.id
|
|
@@ -3960,6 +3992,6 @@ var aa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", oa
|
|
|
3960
3992
|
});
|
|
3961
3993
|
};
|
|
3962
3994
|
//#endregion
|
|
3963
|
-
export {
|
|
3995
|
+
export { yt as ActionButton, Z as Avatar, Wi as ChannelEmptyState, aa as ChannelList, Ji as ChannelView, ln as CustomMessageProvider, ka as FaqList, Oa as FaqListItem, an as LinkAttachment, mn as LockedAttachment, $r as MessageAttachment, Da as MessageBubble, et as MessagingLoggerProvider, it as MessagingProvider, Xi as MessagingShell, xa as RichCard, Mn as TipMessage, tr as buildCompactMetaLabel, Qn as formatFileSize, na as formatRelativeTime, er as getFileExtensionLabel, Dt as getMessageDisplayText, on as isLinkAttachment, jn as isTipMessage, lt as isUuidLike, qn as messageAttachmentGroupPositionFromStream, Et as normalizeLanguageCode, a as optimizeMessagingAttachmentUrl, st as resolveConversationParticipant, dt as resolveParticipantDisplayName, Ci as useComposerLocked, un as useCustomMessage, at as useMessaging, tt as useMessagingLogger };
|
|
3964
3996
|
|
|
3965
3997
|
//# sourceMappingURL=index.js.map
|