@linktr.ee/messaging-react 3.31.2 → 3.32.0-rc-1786000762

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.
@@ -2,7 +2,7 @@ import { jsx as s, jsxs as h, Fragment as J } from "react/jsx-runtime";
2
2
  import F, { createContext as Ve, useContext as _e, useCallback as q, useState as $, useRef as H, useEffect as Y, useId as Js, useMemo as ae, Suspense as Qs } from "react";
3
3
  import { StreamChatService as en } from "@linktr.ee/messaging-core";
4
4
  import { StreamChat as tn, LinkPreviewsManager as et } from "stream-chat";
5
- import { Chat as sn, useChannelStateContext as fe, useChatContext as Ee, DateSeparator as nn, useMessageContext as ge, MessageStatus as an, MessageErrorIcon as tt, MessageText as ze, areMessageUIPropsEqual as rn, useMessageReminder as on, useComponentContext as is, Attachment as ln, EditMessageModal as cn, MessageBlocked as dn, MessageBouncePrompt as un, MessageDeleted as mn, MessageIsThreadReplyInChannelButtonIndicator as hn, MessageRepliesCountButton as fn, ReminderNotification as gn, StreamedMessageText as pn, messageHasAttachments as bn, messageHasReactions as vn, isDateSeparatorMessage as xn, isMessageBlocked as wn, isMessageBounced as _n, MessageBounceModal as Nn, Poll as yn, useMessageComposer as kn, useStateStore as Cn, MessageInput as Ht, useMessageInputContext as Sn, useMessageComposerHasSendableData as En, AttachmentPreviewList as In, QuotedMessagePreview as Tn, TextareaComposer as An, MessageTimestamp as Ye, AIStates as We, useTypingContext as Ln, useAIState as Mn, Channel as Rn, WithComponents as Dn, Window as Pn, MessageList as Gt, ChannelList as On, InfiniteScroll as zn } from "stream-chat-react";
5
+ import { Chat as sn, useChannelStateContext as fe, useChatContext as Ee, DateSeparator as nn, useMessageContext as ge, MessageStatus as an, MessageErrorIcon as tt, MessageText as ze, areMessageUIPropsEqual as rn, useMessageReminder as on, useComponentContext as is, Attachment as ln, EditMessageModal as cn, MessageBlocked as dn, MessageBouncePrompt as un, MessageDeleted as mn, MessageIsThreadReplyInChannelButtonIndicator as hn, MessageRepliesCountButton as fn, ReminderNotification as gn, StreamedMessageText as pn, messageHasAttachments as bn, messageHasReactions as vn, isDateSeparatorMessage as xn, isMessageBlocked as wn, isMessageBounced as _n, MessageBounceModal as yn, Poll as Nn, useMessageComposer as kn, useStateStore as Cn, MessageInput as Ht, useMessageInputContext as Sn, useMessageComposerHasSendableData as En, AttachmentPreviewList as In, QuotedMessagePreview as Tn, TextareaComposer as An, MessageTimestamp as Ye, AIStates as We, useTypingContext as Ln, useAIState as Mn, Channel as Rn, WithComponents as Dn, Window as Pn, MessageList as Gt, ChannelList as On, InfiniteScroll as zn } from "stream-chat-react";
6
6
  import k from "classnames";
7
7
  import { StarIcon as st, DotsThreeIcon as Bn, SpinnerGapIcon as Pe, SignOutIcon as Fn, ProhibitInsetIcon as Yt, FlagIcon as os, CurrencyDollarIcon as $n, CaretRightIcon as ls, ArrowLeftIcon as Un, FileIcon as cs, ImageIcon as jn, SpeakerHighIcon as Vn, VideoCameraIcon as ds, FileMdIcon as Hn, FileTextIcon as Gn, FileZipIcon as Yn, FilePptIcon as Wn, FileCsvIcon as qn, FileXlsIcon as Xn, FileDocIcon as Kn, FilePdfIcon as Zn, CircleNotchIcon as xe, PlayIcon as nt, PauseIcon as Jn, LinkIcon as Qn, DownloadSimpleIcon as Se, XIcon as ot, CaretLeftIcon as ea, GiftIcon as ta, ThumbsUpIcon as sa, ThumbsDownIcon as na, WarningCircleIcon as aa, MegaphoneIcon as ra, ChecksIcon as ia, PencilSimpleIcon as oa, TrashSimpleIcon as la, ArrowUpIcon as ca, SparkleIcon as da, ProhibitIcon as ua } from "@phosphor-icons/react";
8
8
  import { isOfficialChannel as ma, OFFICIAL_SENDER_USER_ID as ha, MESSAGE_CUSTOM_TYPE as ce, isDmAgentSystemType as Wt, isAgeSafetySystemType as fa, selectEnabledFaqs as ga } from "@linktr.ee/messaging-taxonomy";
@@ -39,8 +39,8 @@ const ms = Ve({
39
39
  serviceConfig: !!n,
40
40
  capabilities: Object.keys(r)
41
41
  });
42
- const [d, m] = $(null), [f, u] = $(null), [g, c] = $(!1), [x, w] = $(!1), [p, b] = $(null), v = H(!1), _ = H(null), y = H(n);
43
- y.current = n;
42
+ const [d, m] = $(null), [f, u] = $(null), [g, c] = $(!1), [x, w] = $(!1), [p, b] = $(null), v = H(!1), _ = H(null), N = H(n);
43
+ N.current = n;
44
44
  const A = H(i);
45
45
  A.current = i;
46
46
  const L = H({
@@ -68,7 +68,7 @@ const ms = Ve({
68
68
  !l && a && ((S = P.current) == null ? void 0 : S.apiKey) !== a && (P.current = { apiKey: a, client: new tn(a) });
69
69
  const U = l || (a ? ((T = P.current) == null ? void 0 : T.client) ?? null : null);
70
70
  Y(() => {
71
- const E = z.current, B = y.current;
71
+ const E = z.current, B = N.current;
72
72
  if (l) {
73
73
  _.current = null, m(null), u(null), c(!1), b(null), w(!1);
74
74
  return;
@@ -319,10 +319,10 @@ function ps(e) {
319
319
  function _a(e) {
320
320
  return ps(e).emoji;
321
321
  }
322
- function Na(e) {
322
+ function ya(e) {
323
323
  return ps(e).bgColor;
324
324
  }
325
- const Ne = ({
325
+ const ye = ({
326
326
  id: e,
327
327
  image: t,
328
328
  size: n = 40,
@@ -331,7 +331,7 @@ const Ne = ({
331
331
  shape: i = "squircle",
332
332
  dmAgentEnabled: l = !1
333
333
  }) => {
334
- const o = _a(e), d = Na(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, x = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
334
+ const o = _a(e), d = ya(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, x = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
335
335
  "img",
336
336
  {
337
337
  src: t,
@@ -395,7 +395,7 @@ const Ne = ({
395
395
  ]
396
396
  }
397
397
  );
398
- }, ya = "https://linktr.ee/s/about/trust-center/report", ka = ({
398
+ }, Na = "https://linktr.ee/s/about/trust-center/report", ka = ({
399
399
  channel: e,
400
400
  participant: t,
401
401
  showBlockParticipant: n = !0,
@@ -409,7 +409,7 @@ const Ne = ({
409
409
  logLabel: f = "useChannelModerationActions"
410
410
  }) => {
411
411
  var D;
412
- const { service: u, debug: g } = lt(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, x = !!(a && n && u && c), [w, p] = $(!1), [b, v] = $(null), [_, y] = $(!1), [A, L] = $(!1), z = x && ((b == null ? void 0 : b.participantId) !== c || (b == null ? void 0 : b.service) !== u);
412
+ const { service: u, debug: g } = lt(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, x = !!(a && n && u && c), [w, p] = $(!1), [b, v] = $(null), [_, N] = $(!1), [A, L] = $(!1), z = x && ((b == null ? void 0 : b.participantId) !== c || (b == null ? void 0 : b.service) !== u);
413
413
  return Y(() => {
414
414
  if (!x || !u || !c) {
415
415
  p(!1), v(null);
@@ -441,14 +441,14 @@ const Ne = ({
441
441
  handleLeaveConversation: async () => {
442
442
  var S;
443
443
  if (!_) {
444
- l == null || l(), g && console.log(`[${f}] Leave conversation`, e.cid), y(!0);
444
+ l == null || l(), g && console.log(`[${f}] Leave conversation`, e.cid), N(!0);
445
445
  try {
446
446
  const T = ((S = e._client) == null ? void 0 : S.userID) ?? null;
447
447
  await e.hide(T, !1), r && await r(e), m == null || m();
448
448
  } catch (T) {
449
449
  console.error(`[${f}] Failed to leave conversation`, T);
450
450
  } finally {
451
- y(!1);
451
+ N(!1);
452
452
  }
453
453
  }
454
454
  },
@@ -479,10 +479,10 @@ const Ne = ({
479
479
  }
480
480
  },
481
481
  handleReportUser: () => {
482
- d == null || d(), m == null || m(), window.open(ya, "_blank", "noopener,noreferrer");
482
+ d == null || d(), m == null || m(), window.open(Na, "_blank", "noopener,noreferrer");
483
483
  }
484
484
  };
485
- }, ye = ({
485
+ }, Ne = ({
486
486
  variant: e = "default",
487
487
  className: t,
488
488
  children: n,
@@ -517,7 +517,7 @@ const Ne = ({
517
517
  isParticipantBlocked: b,
518
518
  isCheckingBlockedStatus: v,
519
519
  isLeaving: _,
520
- isUpdatingBlockStatus: y,
520
+ isUpdatingBlockStatus: N,
521
521
  handleLeaveConversation: A,
522
522
  handleBlockUser: L,
523
523
  handleUnblockUser: z,
@@ -572,7 +572,7 @@ const Ne = ({
572
572
  ),
573
573
  children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
574
574
  n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(
575
- ye,
575
+ Ne,
576
576
  {
577
577
  onClick: A,
578
578
  disabled: _,
@@ -586,34 +586,34 @@ const Ne = ({
586
586
  a && /* @__PURE__ */ s("li", { children: v ? (
587
587
  // Block status not yet resolved — show a disabled placeholder
588
588
  // so a premature click can't act on a stale block state.
589
- /* @__PURE__ */ h(ye, { disabled: !0, "aria-busy": !0, children: [
589
+ /* @__PURE__ */ h(Ne, { disabled: !0, "aria-busy": !0, children: [
590
590
  /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }),
591
591
  /* @__PURE__ */ s("span", { children: "Block" })
592
592
  ] })
593
593
  ) : b ? /* @__PURE__ */ h(
594
- ye,
594
+ Ne,
595
595
  {
596
596
  onClick: z,
597
- disabled: y,
598
- "aria-busy": y,
597
+ disabled: N,
598
+ "aria-busy": N,
599
599
  children: [
600
- y ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Yt, { className: "h-5 w-5" }),
600
+ N ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Yt, { className: "h-5 w-5" }),
601
601
  /* @__PURE__ */ s("span", { children: "Unblock" })
602
602
  ]
603
603
  }
604
604
  ) : /* @__PURE__ */ h(
605
- ye,
605
+ Ne,
606
606
  {
607
607
  onClick: L,
608
- disabled: y,
609
- "aria-busy": y,
608
+ disabled: N,
609
+ "aria-busy": N,
610
610
  children: [
611
- y ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Yt, { className: "h-5 w-5" }),
611
+ N ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Yt, { className: "h-5 w-5" }),
612
612
  /* @__PURE__ */ s("span", { children: "Block" })
613
613
  ]
614
614
  }
615
615
  ) }),
616
- r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(ye, { variant: "danger", onClick: P, children: [
616
+ r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(Ne, { variant: "danger", onClick: P, children: [
617
617
  /* @__PURE__ */ s(os, { className: "h-5 w-5" }),
618
618
  /* @__PURE__ */ s("span", { children: "Report" })
619
619
  ] }) }),
@@ -651,7 +651,7 @@ const Ne = ({
651
651
  );
652
652
  },
653
653
  [(C = p.state) == null ? void 0 : C.members, b == null ? void 0 : b.userID, p.type]
654
- ), _ = gs(v == null ? void 0 : v.user), y = (D = v == null ? void 0 : v.user) == null ? void 0 : D.image, A = hs(p), L = Ea((S = p.data) == null ? void 0 : S.customer_tag) && (v == null ? void 0 : v.is_follower) === !0, z = a && A, P = L || z || !!w, U = async () => {
654
+ ), _ = gs(v == null ? void 0 : v.user), N = (D = v == null ? void 0 : v.user) == null ? void 0 : D.image, A = hs(p), L = Ea((S = p.data) == null ? void 0 : S.customer_tag) && (v == null ? void 0 : v.is_follower) === !0, z = a && A, P = L || z || !!w, U = async () => {
655
655
  try {
656
656
  A ? await p.unpin() : await p.pin();
657
657
  } catch (E) {
@@ -662,11 +662,11 @@ const Ne = ({
662
662
  }
663
663
  }, R = /* @__PURE__ */ h(J, { children: [
664
664
  /* @__PURE__ */ s(
665
- Ne,
665
+ ye,
666
666
  {
667
667
  id: ((T = v == null ? void 0 : v.user) == null ? void 0 : T.id) || p.id || "unknown",
668
668
  name: _,
669
- image: y,
669
+ image: N,
670
670
  shape: "circle",
671
671
  size: 48,
672
672
  className: "-mb-2"
@@ -905,22 +905,22 @@ const $a = (e) => {
905
905
  muted: d = !1,
906
906
  onContainerClick: m
907
907
  }) => {
908
- const f = de(t), u = H(null), g = H(null), c = H(null), x = H(r), [w, p] = $(a), [b, v] = $(0), [_, y] = $(!1), [A, L] = $(!1), [z, P] = $(!1), [U, R] = $(!1), [C, D] = $(!0), [S, T] = $(null), E = q(() => {
908
+ const f = de(t), u = H(null), g = H(null), c = H(null), x = H(r), [w, p] = $(a), [b, v] = $(0), [_, N] = $(!1), [A, L] = $(!1), [z, P] = $(!1), [U, R] = $(!1), [C, D] = $(!0), [S, T] = $(null), E = q(() => {
909
909
  P(!1), p(!0);
910
- }, []), B = q((N) => {
910
+ }, []), B = q((y) => {
911
911
  const I = g.current;
912
912
  if (!I) return 0;
913
913
  const W = I.getBoundingClientRect();
914
914
  return Math.max(
915
915
  0,
916
- Math.min(1, ($a(N) - W.left) / W.width)
916
+ Math.min(1, ($a(y) - W.left) / W.width)
917
917
  );
918
- }, []), O = q((N) => {
918
+ }, []), O = q((y) => {
919
919
  const I = u.current;
920
- I && I.duration && (I.currentTime = N * I.duration);
921
- }, []), j = (N) => {
922
- N.stopPropagation(), y(!0);
923
- const I = B(N);
920
+ I && I.duration && (I.currentTime = y * I.duration);
921
+ }, []), j = (y) => {
922
+ y.stopPropagation(), N(!0);
923
+ const I = B(y);
924
924
  v(I), O(I);
925
925
  };
926
926
  Y(() => {
@@ -930,25 +930,25 @@ const $a = (e) => {
930
930
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
931
931
  return;
932
932
  }
933
- const N = () => {
933
+ const y = () => {
934
934
  const I = u.current;
935
- I && I.duration && !_ && v(I.currentTime / I.duration), c.current = requestAnimationFrame(N);
935
+ I && I.duration && !_ && v(I.currentTime / I.duration), c.current = requestAnimationFrame(y);
936
936
  };
937
- return c.current = requestAnimationFrame(N), () => {
937
+ return c.current = requestAnimationFrame(y), () => {
938
938
  c.current !== null && cancelAnimationFrame(c.current);
939
939
  };
940
940
  }, [w, _]), Y(() => {
941
- const N = u.current;
942
- N && (w ? N.play().catch((I) => {
941
+ const y = u.current;
942
+ y && (w ? y.play().catch((I) => {
943
943
  p(!1), P(!0);
944
- }) : N.pause());
944
+ }) : y.pause());
945
945
  }, [w]), Y(() => {
946
946
  if (!_) return;
947
- const N = (W) => v(B(W)), I = (W) => {
948
- y(!1), O(B(W));
947
+ const y = (W) => v(B(W)), I = (W) => {
948
+ N(!1), O(B(W));
949
949
  };
950
- return window.addEventListener("mousemove", N), window.addEventListener("mouseup", I), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", I), () => {
951
- window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", I);
950
+ return window.addEventListener("mousemove", y), window.addEventListener("mouseup", I), window.addEventListener("touchmove", y, { passive: !0 }), window.addEventListener("touchend", I), () => {
951
+ window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", y), window.removeEventListener("touchend", I);
952
952
  };
953
953
  }, [_, B, O]);
954
954
  const K = S ? { aspectRatio: String(S) } : void 0, se = S ? "" : " aspect-video", G = Math.round(b * 100);
@@ -959,17 +959,17 @@ const $a = (e) => {
959
959
  tabIndex: 0,
960
960
  className: `relative cursor-pointer overflow-hidden bg-black ${se}`,
961
961
  style: K,
962
- onClick: (N) => {
962
+ onClick: (y) => {
963
963
  if (m) {
964
- m(N);
964
+ m(y);
965
965
  return;
966
966
  }
967
967
  z || l && p((I) => !I);
968
968
  },
969
- onKeyDown: (N) => {
970
- if (!(N.key !== "Enter" && N.key !== " ")) {
971
- if (N.preventDefault(), m) {
972
- m(N);
969
+ onKeyDown: (y) => {
970
+ if (!(y.key !== "Enter" && y.key !== " ")) {
971
+ if (y.preventDefault(), m) {
972
+ m(y);
973
973
  return;
974
974
  }
975
975
  z || l && p((I) => !I);
@@ -1023,8 +1023,8 @@ const $a = (e) => {
1023
1023
  onWaiting: () => R(!0),
1024
1024
  onPlay: () => P(!1),
1025
1025
  onLoadedMetadata: () => {
1026
- const N = u.current;
1027
- N instanceof HTMLVideoElement && N.videoWidth && N.videoHeight && T(N.videoWidth / N.videoHeight);
1026
+ const y = u.current;
1027
+ y instanceof HTMLVideoElement && y.videoWidth && y.videoHeight && T(y.videoWidth / y.videoHeight);
1028
1028
  },
1029
1029
  onEnded: () => {
1030
1030
  i || (p(!1), v(0));
@@ -1046,11 +1046,11 @@ const $a = (e) => {
1046
1046
  role: "button",
1047
1047
  tabIndex: 0,
1048
1048
  "aria-label": "Play preview",
1049
- onClick: (N) => {
1050
- N.stopPropagation(), E();
1049
+ onClick: (y) => {
1050
+ y.stopPropagation(), E();
1051
1051
  },
1052
- onKeyDown: (N) => {
1053
- N.key !== "Enter" && N.key !== " " || (N.preventDefault(), N.stopPropagation(), E());
1052
+ onKeyDown: (y) => {
1053
+ y.key !== "Enter" && y.key !== " " || (y.preventDefault(), y.stopPropagation(), E());
1054
1054
  },
1055
1055
  children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(nt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
1056
1056
  }
@@ -1068,9 +1068,9 @@ const $a = (e) => {
1068
1068
  className: "relative flex h-4 w-full cursor-pointer items-center",
1069
1069
  onMouseDown: j,
1070
1070
  onTouchStart: j,
1071
- onClick: (N) => N.stopPropagation(),
1072
- onKeyDown: (N) => {
1073
- N.key === "ArrowRight" && O(Math.min(1, b + 0.05)), N.key === "ArrowLeft" && O(Math.max(0, b - 0.05));
1071
+ onClick: (y) => y.stopPropagation(),
1072
+ onKeyDown: (y) => {
1073
+ y.key === "ArrowRight" && O(Math.min(1, b + 0.05)), y.key === "ArrowLeft" && O(Math.max(0, b - 0.05));
1074
1074
  },
1075
1075
  children: /* @__PURE__ */ s("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ s(
1076
1076
  "div",
@@ -1086,8 +1086,8 @@ const $a = (e) => {
1086
1086
  "button",
1087
1087
  {
1088
1088
  type: "button",
1089
- onClick: (N) => {
1090
- N.stopPropagation(), p((I) => !I);
1089
+ onClick: (y) => {
1090
+ y.stopPropagation(), p((I) => !I);
1091
1091
  },
1092
1092
  className: "shrink-0 text-white",
1093
1093
  "aria-label": w ? "Pause" : "Play",
@@ -1107,11 +1107,11 @@ const $a = (e) => {
1107
1107
  className: "relative flex h-4 w-full cursor-pointer items-center",
1108
1108
  onMouseDown: j,
1109
1109
  onTouchStart: j,
1110
- onClick: (N) => N.stopPropagation(),
1110
+ onClick: (y) => y.stopPropagation(),
1111
1111
  onMouseEnter: () => L(!0),
1112
1112
  onMouseLeave: () => L(!1),
1113
- onKeyDown: (N) => {
1114
- N.key === "ArrowRight" && O(Math.min(1, b + 0.05)), N.key === "ArrowLeft" && O(Math.max(0, b - 0.05));
1113
+ onKeyDown: (y) => {
1114
+ y.key === "ArrowRight" && O(Math.min(1, b + 0.05)), y.key === "ArrowLeft" && O(Math.max(0, b - 0.05));
1115
1115
  },
1116
1116
  children: [
1117
1117
  /* @__PURE__ */ s(
@@ -1332,12 +1332,12 @@ const dt = ({ attachment: e, isMyMessage: t }) => {
1332
1332
  ] });
1333
1333
  return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
1334
1334
  };
1335
- function Ns(e) {
1335
+ function ys(e) {
1336
1336
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1337
1337
  }
1338
1338
  function ut(e) {
1339
1339
  var t;
1340
- return (t = e.attachments) == null ? void 0 : t.find(Ns);
1340
+ return (t = e.attachments) == null ? void 0 : t.find(ys);
1341
1341
  }
1342
1342
  async function qa(e, t) {
1343
1343
  let n;
@@ -1399,7 +1399,7 @@ function mt(e) {
1399
1399
  thumbnailUrl: f
1400
1400
  };
1401
1401
  }
1402
- const ys = ({
1402
+ const Ns = ({
1403
1403
  resolvedUrl: e,
1404
1404
  resolvedType: t,
1405
1405
  title: n,
@@ -1463,7 +1463,7 @@ const ys = ({
1463
1463
  const n = ut(e), a = mt(e);
1464
1464
  return !n && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
1465
1465
  !t && e.user && /* @__PURE__ */ s(
1466
- Ne,
1466
+ ye,
1467
1467
  {
1468
1468
  className: "str-chat__avatar str-chat__message-sender-avatar",
1469
1469
  id: e.user.id,
@@ -1482,7 +1482,7 @@ const ys = ({
1482
1482
  className: "str-chat__message-bubble",
1483
1483
  "data-attachment-bubble": "true",
1484
1484
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1485
- children: n ? /* @__PURE__ */ s("div", { className: ct(t), children: /* @__PURE__ */ s(dt, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(ys, { ...a }) : /* @__PURE__ */ s(ks, { ...a })
1485
+ children: n ? /* @__PURE__ */ s("div", { className: ct(t), children: /* @__PURE__ */ s(dt, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(Ns, { ...a }) : /* @__PURE__ */ s(ks, { ...a })
1486
1486
  }
1487
1487
  ) })
1488
1488
  }
@@ -1495,7 +1495,7 @@ const ys = ({
1495
1495
  if (t)
1496
1496
  return /* @__PURE__ */ s("div", { className: ct(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(dt, { attachment: t, isMyMessage: !0 }) });
1497
1497
  const n = mt(e);
1498
- return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ys, { ...n }) }) : null;
1498
+ return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(Ns, { ...n }) }) : null;
1499
1499
  }, Ja = ({
1500
1500
  message: e
1501
1501
  }) => {
@@ -1895,10 +1895,10 @@ const vr = ({
1895
1895
  )) })
1896
1896
  }
1897
1897
  );
1898
- }, wr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "composer" }), _r = (e) => /* @__PURE__ */ s(ft, { ...e, state: "sent" }), Nr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "received" }), yr = {
1898
+ }, wr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "composer" }), _r = (e) => /* @__PURE__ */ s(ft, { ...e, state: "sent" }), yr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "received" }), Nr = {
1899
1899
  Composer: wr,
1900
1900
  Sent: _r,
1901
- Received: Nr
1901
+ Received: yr
1902
1902
  }, gt = ({
1903
1903
  onPrev: e,
1904
1904
  onNext: t,
@@ -2561,13 +2561,13 @@ const vr = ({
2561
2561
  "data-testid": "pdf-attachment",
2562
2562
  children: [
2563
2563
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: u.map((v, _) => {
2564
- const y = v.filename ?? re(v.src), A = p && _ === 0 ? /* @__PURE__ */ s(Te, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2564
+ const N = v.filename ?? re(v.src), A = p && _ === 0 ? /* @__PURE__ */ s(Te, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2565
2565
  Es,
2566
2566
  {
2567
2567
  url: v.src,
2568
- filename: y,
2568
+ filename: N,
2569
2569
  variant: "inline",
2570
- label: `Download ${y}`,
2570
+ label: `Download ${N}`,
2571
2571
  tone: f
2572
2572
  }
2573
2573
  );
@@ -2766,7 +2766,7 @@ const vr = ({
2766
2766
  Video: Qr,
2767
2767
  Audio: dr,
2768
2768
  Pdf: Gr,
2769
- File: yr
2769
+ File: Nr
2770
2770
  }, Os = Ve(void 0), ei = (e) => {
2771
2771
  var n;
2772
2772
  const t = (n = e.metadata) == null ? void 0 : n.broadcast_id;
@@ -2803,7 +2803,7 @@ const vr = ({
2803
2803
  function ii(e) {
2804
2804
  return _e(zs)[e] ?? ri[e];
2805
2805
  }
2806
- const oi = F.lazy(() => import("./Card-qS17qnN0.js")), li = F.lazy(() => import("./Card-CqYFVF6m.js")), ci = () => /* @__PURE__ */ s(
2806
+ const oi = F.lazy(() => import("./Card-qS17qnN0.js")), li = F.lazy(() => import("./Card-DPKAKVEP.js")), ci = () => /* @__PURE__ */ s(
2807
2807
  "div",
2808
2808
  {
2809
2809
  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)]",
@@ -3022,36 +3022,42 @@ function _t(e) {
3022
3022
  }
3023
3023
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
3024
3024
  }
3025
- const Ni = {
3026
- dark: "bg-white text-[#121110] hover:bg-white/90",
3027
- light: "bg-[#121110] text-white hover:bg-[#2a2928]"
3028
- }, yi = ({ variant: e, cta: t }) => {
3029
- const n = k(
3025
+ const yi = {
3026
+ dark: {
3027
+ primary: "bg-white text-[#121110] hover:bg-white/90",
3028
+ secondary: "bg-white/15 text-white hover:bg-white/25"
3029
+ },
3030
+ light: {
3031
+ primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
3032
+ secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
3033
+ }
3034
+ }, Ni = ({ variant: e, cta: t }) => {
3035
+ const n = t.variant ?? "primary", a = k(
3030
3036
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
3031
- Ni[e]
3032
- ), a = _t(t.href);
3033
- return a ? /* @__PURE__ */ s(
3037
+ yi[e][n]
3038
+ ), r = _t(t.href);
3039
+ return r ? /* @__PURE__ */ s(
3034
3040
  "a",
3035
3041
  {
3036
- href: a,
3042
+ href: r,
3037
3043
  target: "_blank",
3038
3044
  rel: "noopener noreferrer",
3039
- onClick: (r) => {
3040
- var i;
3041
- r.stopPropagation(), (i = t.onClick) == null || i.call(t);
3045
+ onClick: (i) => {
3046
+ var l;
3047
+ i.stopPropagation(), (l = t.onClick) == null || l.call(t);
3042
3048
  },
3043
- className: `${n} no-underline`,
3049
+ className: `${a} no-underline`,
3044
3050
  children: t.label
3045
3051
  }
3046
3052
  ) : /* @__PURE__ */ s(
3047
3053
  "button",
3048
3054
  {
3049
3055
  type: "button",
3050
- onClick: (r) => {
3051
- var i;
3052
- r.stopPropagation(), (i = t.onClick) == null || i.call(t);
3056
+ onClick: (i) => {
3057
+ var l;
3058
+ i.stopPropagation(), (l = t.onClick) == null || l.call(t);
3053
3059
  },
3054
- className: n,
3060
+ className: a,
3055
3061
  children: t.label
3056
3062
  }
3057
3063
  );
@@ -3064,7 +3070,7 @@ const Ni = {
3064
3070
  }, Ei = {
3065
3071
  dark: "bg-white/25",
3066
3072
  light: "bg-black/15"
3067
- }, Nt = ({
3073
+ }, yt = ({
3068
3074
  variant: e,
3069
3075
  chinTextColor: t,
3070
3076
  title: n,
@@ -3096,7 +3102,7 @@ const Ni = {
3096
3102
  /* @__PURE__ */ s("div", { className: k("h-4 w-1/2", A), "aria-hidden": !0 })
3097
3103
  ] }) });
3098
3104
  }
3099
- const y = t ? { color: t } : void 0;
3105
+ const N = t ? { color: t } : void 0;
3100
3106
  return /* @__PURE__ */ h("div", { className: "shrink-0 px-4 py-3", children: [
3101
3107
  /* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
3102
3108
  /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
@@ -3106,17 +3112,17 @@ const Ni = {
3106
3112
  "p",
3107
3113
  {
3108
3114
  className: k("min-w-0", v),
3109
- style: y,
3115
+ style: N,
3110
3116
  children: u
3111
3117
  }
3112
3118
  )
3113
3119
  ] }),
3114
- c && /* @__PURE__ */ s("p", { className: _, style: y, children: r }),
3115
- !p && w && /* @__PURE__ */ s("p", { className: _, style: y, children: x })
3120
+ c && /* @__PURE__ */ s("p", { className: _, style: N, children: r }),
3121
+ !p && w && /* @__PURE__ */ s("p", { className: _, style: N, children: x })
3116
3122
  ] }),
3117
3123
  d && /* @__PURE__ */ s("div", { className: "shrink-0", children: d })
3118
3124
  ] }),
3119
- o && /* @__PURE__ */ s(yi, { variant: e, cta: o })
3125
+ o && /* @__PURE__ */ s(Ni, { variant: e, cta: o })
3120
3126
  ] });
3121
3127
  }, Ii = "Loading link preview", Ti = k(
3122
3128
  "relative w-[290px] select-none overflow-hidden",
@@ -3219,7 +3225,7 @@ const Ni = {
3219
3225
  }, Li = {
3220
3226
  dark: "size-16 text-white/25",
3221
3227
  light: "size-16 text-black/25"
3222
- }, Me = (e, t) => !!t && !!e && de(e) === "audio", yt = (e, t) => {
3228
+ }, Me = (e, t) => !!t && !!e && de(e) === "audio", Nt = (e, t) => {
3223
3229
  if (!t || !e) return !1;
3224
3230
  const n = de(e);
3225
3231
  return n === "video" || n === "audio";
@@ -3437,7 +3443,7 @@ const Oi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3437
3443
  }
3438
3444
  ),
3439
3445
  /* @__PURE__ */ s(
3440
- Nt,
3446
+ yt,
3441
3447
  {
3442
3448
  chinTextColor: b.chinTextColor,
3443
3449
  variant: "dark",
@@ -3494,11 +3500,11 @@ const Oi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3494
3500
  onClick: u,
3495
3501
  groupPosition: g = "single"
3496
3502
  }) => {
3497
- const c = yt(a, i), x = _t(n), w = d == null && x != null && !c ? x : void 0, p = d == null && !c ? u : void 0, b = f !== "loading" && Me(a, i) ? kt : void 0, v = d && u ? {
3503
+ const c = Nt(a, i), x = _t(n), w = d == null && x != null && !c ? x : void 0, p = d == null && !c ? u : void 0, b = f !== "loading" && Me(a, i) ? kt : void 0, v = d && u ? {
3498
3504
  ...d,
3499
3505
  onClick: () => {
3500
- var y;
3501
- u(), (y = d.onClick) == null || y.call(d);
3506
+ var N;
3507
+ u(), (N = d.onClick) == null || N.call(d);
3502
3508
  }
3503
3509
  } : d, _ = Ct({
3504
3510
  variant: "light",
@@ -3541,7 +3547,7 @@ const Oi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3541
3547
  }
3542
3548
  ),
3543
3549
  /* @__PURE__ */ s(
3544
- Nt,
3550
+ yt,
3545
3551
  {
3546
3552
  chinTextColor: _.chinTextColor,
3547
3553
  variant: "light",
@@ -3574,7 +3580,7 @@ const Oi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3574
3580
  onClick: g,
3575
3581
  groupPosition: c = "single"
3576
3582
  }) => {
3577
- const x = yt(r, l), w = _t(a), p = m == null && w != null && !x ? w : void 0, b = m == null && !x && p != null ? g : void 0, v = u !== "loading" && Me(r, l), _ = Ct({
3583
+ const x = Nt(r, l), w = _t(a), p = m == null && w != null && !x ? w : void 0, b = m == null && !x && p != null ? g : void 0, v = u !== "loading" && Me(r, l), _ = Ct({
3578
3584
  variant: "dark",
3579
3585
  accentColor: f,
3580
3586
  status: u,
@@ -3613,7 +3619,7 @@ const Oi = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3613
3619
  }
3614
3620
  ),
3615
3621
  /* @__PURE__ */ s(
3616
- Nt,
3622
+ yt,
3617
3623
  {
3618
3624
  chinTextColor: _.chinTextColor,
3619
3625
  variant: "dark",
@@ -3664,7 +3670,7 @@ function es(e) {
3664
3670
  // Playable clip embedded in a link preview — lets LinkAttachment render its
3665
3671
  // native video/audio player in the hero instead of a static thumbnail.
3666
3672
  sourceUrl: a,
3667
- layout: n || yt(r, a) ? "featured" : "classic",
3673
+ layout: n || Nt(r, a) ? "featured" : "classic",
3668
3674
  mimeType: r,
3669
3675
  // Dominant colour of the image, resolved by the sender at stage time and
3670
3676
  // persisted on the attachment (`stream-custom-data.ts`), so every viewer
@@ -3872,11 +3878,11 @@ const qi = ({
3872
3878
  return r.forEach((p, b) => {
3873
3879
  const v = b === r.length - 1;
3874
3880
  if (p.type === "link") {
3875
- p.attachments.forEach((_, y) => {
3881
+ p.attachments.forEach((_, N) => {
3876
3882
  c(
3877
3883
  _,
3878
- `link-${b}-${y}`,
3879
- v && y === p.attachments.length - 1
3884
+ `link-${b}-${N}`,
3885
+ v && N === p.attachments.length - 1
3880
3886
  );
3881
3887
  });
3882
3888
  return;
@@ -3926,7 +3932,7 @@ const qi = ({
3926
3932
  viewerLanguage: p,
3927
3933
  onBroadcastClick: b,
3928
3934
  resolvedBroadcastName: v
3929
- } = e, { client: _ } = Ee("CustomMessage"), { channel: y } = fe("CustomMessage"), { isUnlocking: A, onUnlockClick: L, onFetchSource: z, onDownloadClick: P } = ii("LockedAttachment"), [U, R] = $(!1), C = on(c.id), { selected: D, voteUp: S, voteDown: T } = La(c), {
3935
+ } = e, { client: _ } = Ee("CustomMessage"), { channel: N } = fe("CustomMessage"), { isUnlocking: A, onUnlockClick: L, onFetchSource: z, onDownloadClick: P } = ii("LockedAttachment"), [U, R] = $(!1), C = on(c.id), { selected: D, voteUp: S, voteDown: T } = La(c), {
3930
3936
  Attachment: E = ln,
3931
3937
  EditMessageModal: B = cn,
3932
3938
  MessageActions: O,
@@ -3934,7 +3940,7 @@ const qi = ({
3934
3940
  MessageBouncePrompt: K = un,
3935
3941
  MessageDeleted: se = mn,
3936
3942
  MessageIsThreadReplyInChannelButtonIndicator: G = hn,
3937
- MessageRepliesCountButton: N = fn,
3943
+ MessageRepliesCountButton: y = fn,
3938
3944
  ReminderNotification: I = gn,
3939
3945
  StreamedMessageText: W = pn,
3940
3946
  PinIndicator: Q
@@ -3944,7 +3950,7 @@ const qi = ({
3944
3950
  ), V = ae(() => {
3945
3951
  const me = c.attachments ?? [], ve = c.shared_location ? [c.shared_location, ...me] : me;
3946
3952
  if (!Be(c)) return ve;
3947
- const jt = ve.filter((Vt) => !("type" in Vt) || !Ns(Vt));
3953
+ const jt = ve.filter((Vt) => !("type" in Vt) || !ys(Vt));
3948
3954
  return jt.length === ve.length ? ve : jt;
3949
3955
  }, [c]), ee = ae(
3950
3956
  () => Vs(V),
@@ -3999,7 +4005,7 @@ const qi = ({
3999
4005
  amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
4000
4006
  detail: ($t = c.metadata) == null ? void 0 : $t.attachment_detail,
4001
4007
  paymentStatus: (Ut = c.metadata) == null ? void 0 : Ut.payment_status,
4002
- onFetchSource: z ? () => z(c, y) : void 0
4008
+ onFetchSource: z ? () => z(c, N) : void 0
4003
4009
  };
4004
4010
  return /* @__PURE__ */ h(J, { children: [
4005
4011
  a && /* @__PURE__ */ s(
@@ -4009,7 +4015,7 @@ const qi = ({
4009
4015
  }
4010
4016
  ),
4011
4017
  U && /* @__PURE__ */ s(
4012
- Nn,
4018
+ yn,
4013
4019
  {
4014
4020
  MessageBouncePrompt: K,
4015
4021
  onClose: () => R(!1),
@@ -4026,7 +4032,7 @@ const qi = ({
4026
4032
  Q && /* @__PURE__ */ s(Q, {}),
4027
4033
  !!C && /* @__PURE__ */ s(I, { reminder: C }),
4028
4034
  c.user && /* @__PURE__ */ s(
4029
- Ne,
4035
+ ye,
4030
4036
  {
4031
4037
  className: "str-chat__avatar str-chat__message-sender-avatar",
4032
4038
  id: c.user.id,
@@ -4068,7 +4074,7 @@ const qi = ({
4068
4074
  ...At,
4069
4075
  isMine: !1,
4070
4076
  isUnlocking: A(c.id),
4071
- onUnlockClick: () => L == null ? void 0 : L(c, y)
4077
+ onUnlockClick: () => L == null ? void 0 : L(c, N)
4072
4078
  }
4073
4079
  ),
4074
4080
  !te && O && /* @__PURE__ */ s(O, {})
@@ -4080,7 +4086,7 @@ const qi = ({
4080
4086
  {
4081
4087
  ...Lt,
4082
4088
  isMine: !0,
4083
- onPreviewClick: () => L ? L(c, y) : void 0
4089
+ onPreviewClick: () => L ? L(c, N) : void 0
4084
4090
  }
4085
4091
  ) : /* @__PURE__ */ s(
4086
4092
  Oe,
@@ -4088,8 +4094,8 @@ const qi = ({
4088
4094
  ...Lt,
4089
4095
  isMine: !1,
4090
4096
  isUnlocking: A(c.id),
4091
- onUnlockClick: () => L ? L(c, y) : void 0,
4092
- onDownloadClick: () => P ? P(c, y) : void 0
4097
+ onUnlockClick: () => L ? L(c, N) : void 0,
4098
+ onDownloadClick: () => P ? P(c, N) : void 0
4093
4099
  }
4094
4100
  ),
4095
4101
  !te && O && /* @__PURE__ */ s(O, {})
@@ -4125,7 +4131,7 @@ const qi = ({
4125
4131
  isMyMessage: te
4126
4132
  }
4127
4133
  ),
4128
- He && /* @__PURE__ */ s(yn, { poll: He }),
4134
+ He && /* @__PURE__ */ s(Nn, { poll: He }),
4129
4135
  V != null && V.length && !c.quoted_message ? /* @__PURE__ */ s(
4130
4136
  E,
4131
4137
  {
@@ -4176,7 +4182,7 @@ const qi = ({
4176
4182
  }
4177
4183
  ),
4178
4184
  ue && /* @__PURE__ */ s(
4179
- N,
4185
+ y,
4180
4186
  {
4181
4187
  onClick: d,
4182
4188
  reply_count: c.reply_count
@@ -4443,7 +4449,7 @@ const qi = ({
4443
4449
  c = p;
4444
4450
  const v = Array.from(
4445
4451
  g.querySelectorAll(".str-chat__list")
4446
- ).find((y) => y.scrollHeight > y.clientHeight) ?? null, _ = v ? v.scrollHeight - v.scrollTop - v.clientHeight < no : !1;
4452
+ ).find((N) => N.scrollHeight > N.clientHeight) ?? null, _ = v ? v.scrollHeight - v.scrollTop - v.clientHeight < no : !1;
4447
4453
  g.style.setProperty(
4448
4454
  "--messaging-composer-height",
4449
4455
  `${p}px`
@@ -4713,7 +4719,7 @@ const qi = ({
4713
4719
  },
4714
4720
  children: /* @__PURE__ */ h("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
4715
4721
  /* @__PURE__ */ s(
4716
- Ne,
4722
+ ye,
4717
4723
  {
4718
4724
  className: "str-chat__avatar str-chat__message-sender-avatar",
4719
4725
  id: e,
@@ -4820,7 +4826,7 @@ const wo = ({
4820
4826
  renderChannelBanner: b,
4821
4827
  customChannelActions: v,
4822
4828
  renderChannelActions: _,
4823
- renderMessage: y,
4829
+ renderMessage: N,
4824
4830
  viewerLanguage: A,
4825
4831
  showChannelInfo: L = !0,
4826
4832
  onParticipantNameClick: z,
@@ -4833,8 +4839,8 @@ const wo = ({
4833
4839
  S.current = P;
4834
4840
  }, [P]);
4835
4841
  const T = q((G) => {
4836
- var N;
4837
- (N = S.current) == null || N.call(S, G);
4842
+ var y;
4843
+ (y = S.current) == null || y.call(S, G);
4838
4844
  }, []), E = P ? T : void 0, B = ni(
4839
4845
  D,
4840
4846
  U
@@ -4862,7 +4868,7 @@ const wo = ({
4862
4868
  }
4863
4869
  ), se = q(
4864
4870
  (G) => {
4865
- const { message: N } = ge("ChannelView"), I = /* @__PURE__ */ s(
4871
+ const { message: y } = ge("ChannelView"), I = /* @__PURE__ */ s(
4866
4872
  Zi,
4867
4873
  {
4868
4874
  ...G,
@@ -4871,9 +4877,9 @@ const wo = ({
4871
4877
  onBroadcastClick: E
4872
4878
  }
4873
4879
  );
4874
- return !y || !N ? I : y(I, N);
4880
+ return !N || !y ? I : N(I, y);
4875
4881
  },
4876
- [p, E, y, A]
4882
+ [p, E, N, A]
4877
4883
  );
4878
4884
  return /* @__PURE__ */ s(Os.Provider, { value: B, children: /* @__PURE__ */ s(
4879
4885
  Dn,
@@ -4989,7 +4995,7 @@ const wo = ({
4989
4995
  composerDisabledReason: b,
4990
4996
  dmAgentEnabled: v,
4991
4997
  messageMetadata: _,
4992
- onMessageSent: y,
4998
+ onMessageSent: N,
4993
4999
  showStarButton: A = !1,
4994
5000
  chatbotVotingEnabled: L = !1,
4995
5001
  renderChannelBanner: z,
@@ -5007,7 +5013,7 @@ const wo = ({
5007
5013
  composerInput: K
5008
5014
  }) => {
5009
5015
  const se = q(
5010
- async (N, I, W) => {
5016
+ async (y, I, W) => {
5011
5017
  var ee;
5012
5018
  const Q = ((ee = e.data) == null ? void 0 : ee.chatbot_paused) === !0, X = v && !Q, ne = {
5013
5019
  ...I,
@@ -5022,21 +5028,21 @@ const wo = ({
5022
5028
  ...W,
5023
5029
  ...X && { skip_push: !0 }
5024
5030
  }, V = await e.sendMessage(ne, Z);
5025
- return y == null || y(V), V;
5031
+ return N == null || N(V), V;
5026
5032
  },
5027
- [e, v, _, y]
5033
+ [e, v, _, N]
5028
5034
  ), G = H(null);
5029
5035
  return Y(() => {
5030
5036
  if (!C) return;
5031
- const N = G.current;
5032
- if (!N) return;
5037
+ const y = G.current;
5038
+ if (!y) return;
5033
5039
  const I = (W) => {
5034
5040
  const Q = W.target, X = Q == null ? void 0 : Q.closest("a[href]"), ne = X == null ? void 0 : X.getAttribute("href");
5035
5041
  if (!ne) return;
5036
5042
  const Z = X == null ? void 0 : X.closest("[data-message-id]"), V = Z == null ? void 0 : Z.getAttribute("data-message-id"), ee = V ? e.state.messages.find((ie) => ie.id === V) : void 0;
5037
5043
  C(ne, ee);
5038
5044
  };
5039
- return N.addEventListener("click", I), () => N.removeEventListener("click", I);
5045
+ return y.addEventListener("click", I), () => y.removeEventListener("click", I);
5040
5046
  }, [C, e]), /* @__PURE__ */ s(
5041
5047
  "div",
5042
5048
  {
@@ -5133,7 +5139,7 @@ const Wo = ({
5133
5139
  onParticipantNameClick: b,
5134
5140
  onBroadcastClick: v,
5135
5141
  resolveBroadcastName: _,
5136
- renderMessage: y,
5142
+ renderMessage: N,
5137
5143
  onMessageLinkClick: A,
5138
5144
  showChannelInfo: L,
5139
5145
  composerInput: z
@@ -5146,8 +5152,8 @@ const Wo = ({
5146
5152
  refreshConnection: D,
5147
5153
  service: S,
5148
5154
  debug: T
5149
- } = ba(), [E, B] = $(null), [O, j] = $(null), [K, se] = $(!1), { showDeleteConversation: G = !0 } = e, N = H(l);
5150
- N.current = l;
5155
+ } = ba(), [E, B] = $(null), [O, j] = $(null), [K, se] = $(!1), { showDeleteConversation: G = !0 } = e, y = H(l);
5156
+ y.current = l;
5151
5157
  const I = H(a);
5152
5158
  I.current = a;
5153
5159
  const W = H(null), Q = H(null);
@@ -5185,7 +5191,7 @@ const Wo = ({
5185
5191
  );
5186
5192
  return;
5187
5193
  }
5188
- const ue = N.current;
5194
+ const ue = y.current;
5189
5195
  if (!ue || !S) {
5190
5196
  ee(), j("No conversation found with this account"), T && console.log(
5191
5197
  "[MessagingShell] No conversation found for:",
@@ -5251,7 +5257,7 @@ const Wo = ({
5251
5257
  onParticipantNameClick: b,
5252
5258
  onBroadcastClick: v,
5253
5259
  resolveBroadcastName: _,
5254
- renderMessage: y,
5260
+ renderMessage: N,
5255
5261
  onMessageLinkClick: A,
5256
5262
  showChannelInfo: L,
5257
5263
  composerInput: z
@@ -5273,7 +5279,7 @@ const Ys = F.createContext({
5273
5279
  renderMessagePreview: void 0,
5274
5280
  channelPreview: void 0,
5275
5281
  viewerLanguage: void 0
5276
- }), No = Ys.Provider, yo = () => F.useContext(Ys), ko = (e, t) => {
5282
+ }), yo = Ys.Provider, No = () => F.useContext(Ys), ko = (e, t) => {
5277
5283
  const n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), a = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
5278
5284
  return Math.floor((a - n) / (1e3 * 60 * 60 * 24));
5279
5285
  }, Co = (e) => {
@@ -5303,7 +5309,7 @@ const Ys = F.createContext({
5303
5309
  channelPreview: l,
5304
5310
  renderMessagePreview: o,
5305
5311
  viewerLanguage: d
5306
- } = yo(), { client: m } = Ee(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), u = hs(t);
5312
+ } = No(), { client: m } = Ee(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), u = hs(t);
5307
5313
  if (l)
5308
5314
  return /* @__PURE__ */ s(
5309
5315
  l,
@@ -5350,13 +5356,13 @@ const Ys = F.createContext({
5350
5356
  if (C) return C;
5351
5357
  const T = (E = b == null ? void 0 : b.attachments) == null ? void 0 : E[0];
5352
5358
  return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
5353
- })(), y = b != null && b.created_at ? Co(new Date(b.created_at)) : "", A = b ? Be(b) : !1, L = o ? o(b, _) : `${A ? "✨ " : ""}${_}`, z = n ?? 0;
5359
+ })(), N = b != null && b.created_at ? Co(new Date(b.created_at)) : "", A = b ? Be(b) : !1, L = o ? o(b, _) : `${A ? "✨ " : ""}${_}`, z = n ?? 0;
5354
5360
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
5355
5361
  channelId: t == null ? void 0 : t.id,
5356
5362
  isSelected: f,
5357
5363
  participantName: w,
5358
5364
  unreadCount: z,
5359
- hasTimestamp: !!y
5365
+ hasTimestamp: !!N
5360
5366
  }), /* @__PURE__ */ s(
5361
5367
  "div",
5362
5368
  {
@@ -5374,7 +5380,7 @@ const Ys = F.createContext({
5374
5380
  "data-dd-privacy": "mask",
5375
5381
  children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
5376
5382
  /* @__PURE__ */ s(
5377
- Ne,
5383
+ ye,
5378
5384
  {
5379
5385
  id: ((R = x == null ? void 0 : x.user) == null ? void 0 : R.id) || t.id || "unknown",
5380
5386
  name: w,
@@ -5397,7 +5403,7 @@ const Ys = F.createContext({
5397
5403
  ]
5398
5404
  }
5399
5405
  ),
5400
- y && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: y })
5406
+ N && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
5401
5407
  ] }),
5402
5408
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
5403
5409
  /* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: L }),
@@ -5433,7 +5439,7 @@ const So = { last_message_at: -1 }, Eo = F.memo(
5433
5439
  }) => {
5434
5440
  const v = F.useRef(0);
5435
5441
  v.current++;
5436
- const { debug: _ = !1 } = lt(), y = F.useCallback(
5442
+ const { debug: _ = !1 } = lt(), N = F.useCallback(
5437
5443
  (L) => {
5438
5444
  for (const z of L)
5439
5445
  _o(z);
@@ -5471,14 +5477,14 @@ const So = { last_message_at: -1 }, Eo = F.memo(
5471
5477
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
5472
5478
  l
5473
5479
  ),
5474
- children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(No, { value: A, children: /* @__PURE__ */ s(
5480
+ children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(yo, { value: A, children: /* @__PURE__ */ s(
5475
5481
  On,
5476
5482
  {
5477
5483
  filters: n,
5478
5484
  sort: i,
5479
5485
  options: { limit: 30 },
5480
5486
  allowNewMessagesFromUnfilteredChannels: a,
5481
- channelRenderFilterFn: y,
5487
+ channelRenderFilterFn: N,
5482
5488
  lockChannelOrder: g,
5483
5489
  onMessageNewHandler: c,
5484
5490
  onMessageNew: x,
@@ -5600,7 +5606,7 @@ const rs = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5600
5606
  const o = ga(e);
5601
5607
  return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
5602
5608
  (i || l) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
5603
- Ne,
5609
+ ye,
5604
5610
  {
5605
5611
  id: l || "account",
5606
5612
  name: l || "Account",
@@ -5642,8 +5648,8 @@ export {
5642
5648
  ba as I,
5643
5649
  it as L,
5644
5650
  Ho as M,
5645
- ye as a,
5646
- Ne as b,
5651
+ Ne as a,
5652
+ ye as b,
5647
5653
  Eo as c,
5648
5654
  Gs as d,
5649
5655
  Go as e,
@@ -5662,11 +5668,11 @@ export {
5662
5668
  we as r,
5663
5669
  hr as s,
5664
5670
  bs as t,
5665
- Ns as u,
5671
+ ys as u,
5666
5672
  xa as v,
5667
5673
  ar as w,
5668
5674
  Ma as x,
5669
5675
  fs as y,
5670
5676
  ut as z
5671
5677
  };
5672
- //# sourceMappingURL=index-ilHx7pIO.js.map
5678
+ //# sourceMappingURL=index-KC2xnb1K.js.map