@linktr.ee/messaging-react 1.28.0 → 1.29.0-rc-1776320021

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
2
2
  import L from "classnames";
3
- import F, { createContext as ft, useContext as gt, useCallback as U, useState as k, useRef as Q, useEffect as X, useMemo as Le, Suspense as je } from "react";
3
+ import F, { createContext as ft, useContext as gt, useCallback as U, useState as k, useRef as K, useEffect as Z, useMemo as Le, Suspense as je } from "react";
4
4
  import { StreamChatService as xt } from "@linktr.ee/messaging-core";
5
5
  import { Chat as bt, ChannelList as Ct, DateSeparator as Nt, useChannelStateContext as Ie, useChatContext as Ke, areMessageUIPropsEqual as pt, useMessageReminder as yt, useComponentContext as vt, Attachment as wt, EditMessageModal as _t, MessageBlocked as Et, MessageBouncePrompt as St, MessageDeleted as It, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as kt, ReminderNotification as Tt, StreamedMessageText as Dt, messageHasAttachments as Rt, messageHasReactions as At, isDateSeparatorMessage as Lt, isMessageBlocked as Ut, isMessageBounced as Pt, MessageBounceModal as Ft, MessageText as ze, Poll as Ot, MessageErrorIcon as Bt, useMessageContext as Qe, useMessageComposer as Gt, useStateStore as $t, MessageInput as jt, useMessageInputContext as zt, useMessageComposerHasSendableData as Ht, SimpleAttachmentSelector as Vt, QuotedMessagePreview as Yt, AttachmentPreviewList as Wt, TextareaComposer as qt, MessageTimestamp as De, Channel as Zt, WithComponents as Jt, Window as Xt, MessageList as Kt } from "stream-chat-react";
6
6
  import { StarIcon as Ue, GiftIcon as Qt, XIcon as Oe, SpinnerGapIcon as _e, SignOutIcon as es, ProhibitInsetIcon as He, FlagIcon as ts, ArrowUpIcon as ss, SparkleIcon as ns, ProhibitIcon as as, ArrowLeftIcon as Ve, DotsThreeIcon as Ye, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as We } from "@phosphor-icons/react";
@@ -15,7 +15,7 @@ const et = ft({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), Me = () => gt(et), ln = ({
18
+ }), Me = () => gt(et), cn = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -35,12 +35,12 @@ const et = ft({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, g] = k(null), [h, b] = k(null), [C, E] = k(!1), [m, S] = k(!1), [o, y] = k(null), M = Q(!1), N = Q({
38
+ const [c, g] = k(null), [h, b] = k(null), [C, E] = k(!1), [m, S] = k(!1), [o, y] = k(null), M = K(!1), N = K({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), v = Q(0);
43
+ }), v = K(0);
44
44
  v.current++, a("📊 RENDER INFO", {
45
45
  renderCount: v.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
@@ -55,7 +55,7 @@ const et = ft({
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
- }, X(() => {
58
+ }, Z(() => {
59
59
  const u = v.current;
60
60
  if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
@@ -94,8 +94,8 @@ const et = ft({
94
94
  }), f.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [r, n, d, a]);
97
- const w = Q(null);
98
- X(() => {
97
+ const w = K(null);
98
+ Z(() => {
99
99
  var f, _;
100
100
  if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
@@ -141,7 +141,7 @@ const et = ft({
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, a, C]), X(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, a, C]), Z(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
146
  isConnected: C
147
147
  }), () => {
@@ -227,7 +227,7 @@ const et = ft({
227
227
  const [s, n] = k(
228
228
  !!((l = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && l.pinned_at)
229
229
  );
230
- return X(() => {
230
+ return Z(() => {
231
231
  var a;
232
232
  if (!t) {
233
233
  n(!1);
@@ -563,6 +563,21 @@ const Cs = { last_message_at: -1 }, rt = F.memo(
563
563
  }
564
564
  );
565
565
  rt.displayName = "ChannelList";
566
+ function Ns(t) {
567
+ const s = K(null);
568
+ Z(() => {
569
+ const n = t.cid;
570
+ if (!n || s.current === n) return;
571
+ const r = t.state.pending_messages;
572
+ if (!(r != null && r.length)) {
573
+ s.current = n;
574
+ return;
575
+ }
576
+ for (const l of r)
577
+ t.state.addMessageSorted(l.message);
578
+ s.current = n;
579
+ }, [t]);
580
+ }
566
581
  const we = ({
567
582
  variant: t = "default",
568
583
  className: s,
@@ -605,7 +620,7 @@ function ot({ label: t, className: s, children: n, ...r }) {
605
620
  function lt({ onClick: t }) {
606
621
  return /* @__PURE__ */ e(ot, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
607
622
  }
608
- const Ns = ({
623
+ const ps = ({
609
624
  dialogRef: t,
610
625
  onClose: s,
611
626
  participant: n,
@@ -620,7 +635,7 @@ const Ns = ({
620
635
  customProfileContent: C,
621
636
  customChannelActions: E
622
637
  }) => {
623
- var Z, J, P, V, z, ie, ce;
638
+ var J, X, P, V, z, ie, ce;
624
639
  const { service: m, debug: S } = Me(), [o, y] = k(!1), [M, N] = k(!1), [v, w] = k(!1), A = U(async () => {
625
640
  var R;
626
641
  if (!(!m || !((R = n == null ? void 0 : n.user) != null && R.id)))
@@ -638,8 +653,8 @@ const Ns = ({
638
653
  O
639
654
  );
640
655
  }
641
- }, [m, (Z = n == null ? void 0 : n.user) == null ? void 0 : Z.id]);
642
- X(() => {
656
+ }, [m, (J = n == null ? void 0 : n.user) == null ? void 0 : J.id]);
657
+ Z(() => {
643
658
  A();
644
659
  }, [A]);
645
660
  const x = async () => {
@@ -687,7 +702,7 @@ const Ns = ({
687
702
  );
688
703
  };
689
704
  if (!n) return null;
690
- const p = ((J = n.user) == null ? void 0 : J.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (ie = n.user) == null ? void 0 : ie.username, $ = G || (T ? `linktr.ee/${T}` : void 0), se = ((ce = n.user) == null ? void 0 : ce.id) || "unknown";
705
+ const p = ((X = n.user) == null ? void 0 : X.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (ie = n.user) == null ? void 0 : ie.username, $ = G || (T ? `linktr.ee/${T}` : void 0), se = ((ce = n.user) == null ? void 0 : ce.id) || "unknown";
691
706
  return (
692
707
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
693
708
  /* @__PURE__ */ e(
@@ -790,13 +805,13 @@ const Ns = ({
790
805
  }
791
806
  )
792
807
  );
793
- }, ps = (t) => /* @__PURE__ */ e(Nt, { ...t, position: "center" }), Pe = "vote_up", Fe = "vote_down";
794
- function ys(t) {
808
+ }, ys = (t) => /* @__PURE__ */ e(Nt, { ...t, position: "center" }), Pe = "vote_up", Fe = "vote_down";
809
+ function vs(t) {
795
810
  return t != null && t.length ? t.some((s) => s.type === Fe) ? "down" : t.some((s) => s.type === Pe) ? "up" : null : null;
796
811
  }
797
- function vs(t) {
812
+ function ws(t) {
798
813
  const { channel: s } = Ie(), { client: n } = Ke("useMessageVote"), r = Le(
799
- () => ys(t.own_reactions),
814
+ () => vs(t.own_reactions),
800
815
  [t.own_reactions]
801
816
  ), l = U(async () => {
802
817
  if (n != null && n.userID)
@@ -821,13 +836,13 @@ function vs(t) {
821
836
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
822
837
  return { selected: r, voteUp: l, voteDown: d };
823
838
  }
824
- const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => import("./Visitor-C4WqnN8H.js")), Je = () => /* @__PURE__ */ e(
839
+ const _s = F.lazy(() => import("./Creator-VyMyIk2b.js")), Es = F.lazy(() => import("./Visitor-C4WqnN8H.js")), Je = () => /* @__PURE__ */ e(
825
840
  "div",
826
841
  {
827
842
  className: "w-[280px] min-h-[200px] animate-pulse rounded-3xl bg-black/[0.06] shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04)]",
828
843
  "aria-hidden": !0
829
844
  }
830
- ), Es = (t) => t.onUnlock != null || t.onDownload != null ? /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(_s, { ...t }) }) : /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(ws, { ...t }) }), Ss = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
845
+ ), Ss = (t) => t.onUnlock != null || t.onDownload != null ? /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(Es, { ...t }) }) : /* @__PURE__ */ e(je, { fallback: /* @__PURE__ */ e(Je, {}), children: /* @__PURE__ */ e(_s, { ...t }) }), Is = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
831
846
  "path",
832
847
  {
833
848
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -837,7 +852,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
837
852
  strokeLinejoin: "round",
838
853
  fill: t ? "currentColor" : "none"
839
854
  }
840
- ) }), Is = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
855
+ ) }), Ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
841
856
  "path",
842
857
  {
843
858
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -847,7 +862,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
847
862
  strokeLinejoin: "round",
848
863
  fill: t ? "currentColor" : "none"
849
864
  }
850
- ) }), Ms = ({
865
+ ) }), ks = ({
851
866
  selected: t,
852
867
  onVoteUp: s,
853
868
  onVoteDown: n
@@ -860,7 +875,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
860
875
  onClick: s,
861
876
  "aria-label": "Helpful",
862
877
  "aria-pressed": t === "up",
863
- children: /* @__PURE__ */ e(Ss, { filled: t === "up" })
878
+ children: /* @__PURE__ */ e(Is, { filled: t === "up" })
864
879
  }
865
880
  ),
866
881
  /* @__PURE__ */ e(
@@ -871,11 +886,11 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
871
886
  onClick: n,
872
887
  "aria-label": "Not helpful",
873
888
  "aria-pressed": t === "down",
874
- children: /* @__PURE__ */ e(Is, { filled: t === "down" })
889
+ children: /* @__PURE__ */ e(Ms, { filled: t === "down" })
875
890
  }
876
891
  )
877
- ] }), ks = (t) => {
878
- var ge, xe, be, oe, K, Ce, Ne, pe;
892
+ ] }), Ts = (t) => {
893
+ var ge, xe, be, oe, Q, Ce, Ne, pe;
879
894
  const {
880
895
  additionalMessageInputProps: s,
881
896
  chatbotVotingEnabled: n,
@@ -894,15 +909,15 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
894
909
  message: o,
895
910
  renderText: y,
896
911
  threadList: M
897
- } = t, { client: N } = Ke("CustomMessage"), { channel: v } = Ie("CustomMessage"), [w, A] = k(!1), x = yt(o.id), { selected: u, voteUp: f, voteDown: _ } = vs(o), {
912
+ } = t, { client: N } = Ke("CustomMessage"), { channel: v } = Ie("CustomMessage"), [w, A] = k(!1), x = yt(o.id), { selected: u, voteUp: f, voteDown: _ } = ws(o), {
898
913
  Attachment: p = wt,
899
914
  EditMessageModal: D = _t,
900
915
  MessageBlocked: G = Et,
901
916
  MessageBouncePrompt: T = St,
902
917
  MessageDeleted: $ = It,
903
918
  MessageIsThreadReplyInChannelButtonIndicator: se = Mt,
904
- MessageRepliesCountButton: Z = kt,
905
- ReminderNotification: J = Tt,
919
+ MessageRepliesCountButton: J = kt,
920
+ ReminderNotification: X = Tt,
906
921
  StreamedMessageText: P = Dt,
907
922
  PinIndicator: V
908
923
  } = vt("CustomMessage"), z = Rt(o), ie = At(o), ce = Le(
@@ -956,7 +971,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
956
971
  ),
957
972
  /* @__PURE__ */ i("div", { className: Ge, children: [
958
973
  V && /* @__PURE__ */ e(V, {}),
959
- !!x && /* @__PURE__ */ e(J, { reminder: x }),
974
+ !!x && /* @__PURE__ */ e(X, { reminder: x }),
960
975
  o.user && /* @__PURE__ */ e(
961
976
  le,
962
977
  {
@@ -985,11 +1000,11 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
985
1000
  },
986
1001
  children: re ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
987
1002
  /* @__PURE__ */ e(
988
- Es,
1003
+ Ss,
989
1004
  {
990
1005
  title: (be = o.metadata) == null ? void 0 : be.attachment_title,
991
1006
  mimeType: (oe = o.metadata) == null ? void 0 : oe.attachment_mime_type,
992
- thumbnail: (K = o.metadata) == null ? void 0 : K.attachment_thumbnail,
1007
+ thumbnail: (Q = o.metadata) == null ? void 0 : Q.attachment_thumbnail,
993
1008
  amountText: (Ce = o.metadata) == null ? void 0 : Ce.amount_text,
994
1009
  detail: (Ne = o.metadata) == null ? void 0 : Ne.attachment_detail,
995
1010
  paymentStatus: (pe = o.metadata) == null ? void 0 : pe.payment_status,
@@ -1037,7 +1052,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1037
1052
  }
1038
1053
  ),
1039
1054
  n && ae && /* @__PURE__ */ e(
1040
- Ms,
1055
+ ks,
1041
1056
  {
1042
1057
  selected: u,
1043
1058
  onVoteUp: f,
@@ -1048,7 +1063,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1048
1063
  }
1049
1064
  ),
1050
1065
  O && /* @__PURE__ */ e(
1051
- Z,
1066
+ J,
1052
1067
  {
1053
1068
  onClick: b,
1054
1069
  reply_count: o.reply_count
@@ -1057,17 +1072,17 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1057
1072
  Y && /* @__PURE__ */ e(se, {})
1058
1073
  ] }, o.id)
1059
1074
  ] });
1060
- }, Ts = F.memo(
1061
- ks,
1075
+ }, Ds = F.memo(
1076
+ Ts,
1062
1077
  (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlock !== s.onAttachmentUnlock || t.onAttachmentDownload !== s.onAttachmentDownload ? !1 : pt(t, s)
1063
- ), Ds = (t) => {
1078
+ ), Rs = (t) => {
1064
1079
  const s = Qe("CustomMessage");
1065
- return /* @__PURE__ */ e(Ts, { ...s, ...t });
1066
- }, Rs = (t) => ({
1080
+ return /* @__PURE__ */ e(Ds, { ...s, ...t });
1081
+ }, As = (t) => ({
1067
1082
  linkPreviews: Array.from(t.previews.values()).filter(
1068
1083
  (s) => qe.previewIsLoaded(s) || qe.previewIsLoading(s)
1069
1084
  )
1070
- }), As = ({
1085
+ }), Ls = ({
1071
1086
  link: t,
1072
1087
  onDismiss: s
1073
1088
  }) => {
@@ -1107,28 +1122,28 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1107
1122
  ]
1108
1123
  }
1109
1124
  );
1110
- }, Ls = () => {
1125
+ }, Us = () => {
1111
1126
  const { linkPreviewsManager: t } = Gt(), { linkPreviews: s } = $t(
1112
1127
  t.state,
1113
- Rs
1128
+ As
1114
1129
  ), n = (l) => {
1115
1130
  t.dismissPreview(l);
1116
1131
  };
1117
1132
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
1118
- As,
1133
+ Ls,
1119
1134
  {
1120
1135
  link: l,
1121
1136
  onDismiss: n
1122
1137
  },
1123
1138
  l.og_scrape_url
1124
1139
  )) }) : null;
1125
- }, Us = () => {
1140
+ }, Ps = () => {
1126
1141
  const { handleSubmit: t } = zt(), s = Ht();
1127
1142
  return /* @__PURE__ */ i(he, { children: [
1128
1143
  /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Vt, {}) }),
1129
1144
  /* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
1130
1145
  /* @__PURE__ */ e(Yt, {}),
1131
- /* @__PURE__ */ e(Ls, {}),
1146
+ /* @__PURE__ */ e(Us, {}),
1132
1147
  /* @__PURE__ */ e(Wt, {}),
1133
1148
  /* @__PURE__ */ i("div", { className: "flex", children: [
1134
1149
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
@@ -1154,22 +1169,22 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1154
1169
  ] })
1155
1170
  ] })
1156
1171
  ] });
1157
- }, Ps = ({
1172
+ }, Fs = ({
1158
1173
  renderActions: t
1159
1174
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
1160
1175
  t && (t == null ? void 0 : t()),
1161
- /* @__PURE__ */ e(jt, { Input: Us })
1162
- ] }), Fs = [
1176
+ /* @__PURE__ */ e(jt, { Input: Ps })
1177
+ ] }), Os = [
1163
1178
  "SYSTEM_DM_AGENT_PAUSED",
1164
1179
  "SYSTEM_DM_AGENT_RESUMED"
1165
- ], Os = {
1180
+ ], Bs = {
1166
1181
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1167
1182
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1168
- }, Bs = [
1183
+ }, Gs = [
1169
1184
  "SYSTEM_AGE_SAFETY_BLOCKED"
1170
- ], Gs = {
1185
+ ], $s = {
1171
1186
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1172
- }, Ae = "age safety guidelines.", $s = "https://linktr.ee/s/about/contact", Xe = (t) => Fs.includes(t), js = (t) => Bs.includes(t), zs = (t) => {
1187
+ }, Ae = "age safety guidelines.", js = "https://linktr.ee/s/about/contact", Xe = (t) => Os.includes(t), zs = (t) => Gs.includes(t), Hs = (t) => {
1173
1188
  var r;
1174
1189
  const s = (r = t.metadata) == null ? void 0 : r.custom_type;
1175
1190
  if (Xe(s))
@@ -1177,7 +1192,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1177
1192
  kind: "dm-agent",
1178
1193
  type: s
1179
1194
  };
1180
- if (js(s))
1195
+ if (zs(s))
1181
1196
  return {
1182
1197
  kind: "age-safety",
1183
1198
  type: s
@@ -1188,7 +1203,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1188
1203
  kind: "dm-agent",
1189
1204
  type: n
1190
1205
  };
1191
- }, Hs = (t) => {
1206
+ }, Vs = (t) => {
1192
1207
  const s = t.indexOf(Ae);
1193
1208
  if (s === -1)
1194
1209
  return t;
@@ -1198,7 +1213,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1198
1213
  /* @__PURE__ */ e(
1199
1214
  "a",
1200
1215
  {
1201
- href: $s,
1216
+ href: js,
1202
1217
  target: "_blank",
1203
1218
  rel: "noopener noreferrer",
1204
1219
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
@@ -1207,13 +1222,13 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1207
1222
  ),
1208
1223
  t.slice(n)
1209
1224
  ] });
1210
- }, Vs = (t) => {
1225
+ }, Ys = (t) => {
1211
1226
  var r, l;
1212
- const s = t.message.hide_date === !0, n = zs(
1227
+ const s = t.message.hide_date === !0, n = Hs(
1213
1228
  t.message
1214
1229
  );
1215
1230
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
1216
- const d = ((r = t.message.text) == null ? void 0 : r.trim()) || Os[n.type];
1231
+ const d = ((r = t.message.text) == null ? void 0 : r.trim()) || Bs[n.type];
1217
1232
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1218
1233
  /* @__PURE__ */ i(
1219
1234
  "div",
@@ -1239,7 +1254,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1239
1254
  ] });
1240
1255
  }
1241
1256
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1242
- const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Gs[n.type];
1257
+ const d = ((l = t.message.text) == null ? void 0 : l.trim()) || $s[n.type];
1243
1258
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1244
1259
  /* @__PURE__ */ i(
1245
1260
  "div",
@@ -1258,7 +1273,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1258
1273
  "data-testid": "age-safety-system-message-icon"
1259
1274
  }
1260
1275
  ),
1261
- /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Hs(d) }) })
1276
+ /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Vs(d) }) })
1262
1277
  ]
1263
1278
  }
1264
1279
  ),
@@ -1273,7 +1288,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1273
1288
  ] }),
1274
1289
  !s && /* @__PURE__ */ e(De, { message: t.message })
1275
1290
  ] });
1276
- }, Ys = () => null, Ws = ({ className: t, message: s }) => /* @__PURE__ */ i(
1291
+ }, Ws = () => null, qs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1277
1292
  "div",
1278
1293
  {
1279
1294
  className: L("flex items-center justify-center h-full", t),
@@ -1317,11 +1332,11 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
1317
1332
  ]
1318
1333
  }
1319
1334
  ), Se = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1320
- /* @__PURE__ */ e(Ws, { className: "w-6 h-6" }),
1335
+ /* @__PURE__ */ e(qs, { className: "w-6 h-6" }),
1321
1336
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1322
1337
  ] }) }));
1323
1338
  Se.displayName = "LoadingState";
1324
- const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", qs = ({
1339
+ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Zs = ({
1325
1340
  onBack: t,
1326
1341
  showBackButton: s,
1327
1342
  onShowInfo: n,
@@ -1459,7 +1474,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1459
1474
  ] })
1460
1475
  ] })
1461
1476
  ] });
1462
- }, Zs = ({
1477
+ }, Js = ({
1463
1478
  onBack: t,
1464
1479
  showBackButton: s,
1465
1480
  renderMessageInputActions: n,
@@ -1479,7 +1494,9 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1479
1494
  customChannelActions: y,
1480
1495
  renderMessage: M
1481
1496
  }) => {
1482
- const { channel: N } = Ie(), v = Q(null), w = F.useMemo(() => Object.values(N.state.members || {}).find(
1497
+ const { channel: N } = Ie();
1498
+ Ns(N);
1499
+ const v = K(null), w = F.useMemo(() => Object.values(N.state.members || {}).find(
1483
1500
  (_) => {
1484
1501
  var p;
1485
1502
  return ((p = _.user) == null ? void 0 : p.id) && _.user.id !== N._client.userID;
@@ -1504,7 +1521,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1504
1521
  overrides: {
1505
1522
  Message: (f) => {
1506
1523
  const { message: _ } = Qe("ChannelView"), p = /* @__PURE__ */ e(
1507
- Ds,
1524
+ Rs,
1508
1525
  {
1509
1526
  ...f,
1510
1527
  chatbotVotingEnabled: C,
@@ -1517,7 +1534,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1517
1534
  },
1518
1535
  children: /* @__PURE__ */ i(Xt, { children: [
1519
1536
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1520
- qs,
1537
+ Zs,
1521
1538
  {
1522
1539
  onBack: t,
1523
1540
  showBackButton: s,
@@ -1537,7 +1554,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1537
1554
  ) }),
1538
1555
  r == null ? void 0 : r(N),
1539
1556
  /* @__PURE__ */ e(
1540
- Ps,
1557
+ Fs,
1541
1558
  {
1542
1559
  renderActions: () => n == null ? void 0 : n(N)
1543
1560
  }
@@ -1546,7 +1563,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1546
1563
  }
1547
1564
  ),
1548
1565
  /* @__PURE__ */ e(
1549
- Ns,
1566
+ ps,
1550
1567
  {
1551
1568
  dialogRef: v,
1552
1569
  onClose: u,
@@ -1574,7 +1591,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1574
1591
  onLeaveConversation: d,
1575
1592
  onBlockParticipant: a,
1576
1593
  className: c,
1577
- CustomChannelEmptyState: g = Ys,
1594
+ CustomChannelEmptyState: g = Ws,
1578
1595
  showDeleteConversation: h = !0,
1579
1596
  onDeleteConversationClick: b,
1580
1597
  onBlockParticipantClick: C,
@@ -1593,8 +1610,8 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1593
1610
  }) => {
1594
1611
  const f = U(
1595
1612
  async (_, p, D) => {
1596
- var J;
1597
- const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, T = m && !G, $ = {
1613
+ var X;
1614
+ const G = ((X = t.data) == null ? void 0 : X.chatbot_paused) === !0, T = m && !G, $ = {
1598
1615
  ...p,
1599
1616
  ...T && { silent: !0 },
1600
1617
  ...S && {
@@ -1606,8 +1623,8 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1606
1623
  }, se = {
1607
1624
  ...D,
1608
1625
  ...T && { skip_push: !0 }
1609
- }, Z = await t.sendMessage($, se);
1610
- return o == null || o(Z), Z;
1626
+ }, J = await t.sendMessage($, se);
1627
+ return o == null || o(J), J;
1611
1628
  },
1612
1629
  [t, m, S, o]
1613
1630
  );
@@ -1622,13 +1639,13 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1622
1639
  Zt,
1623
1640
  {
1624
1641
  channel: t,
1625
- MessageSystem: Vs,
1642
+ MessageSystem: Ys,
1626
1643
  EmptyStateIndicator: g,
1627
1644
  LoadingIndicator: Se,
1628
- DateSeparator: ps,
1645
+ DateSeparator: ys,
1629
1646
  doSendMessageRequest: f,
1630
1647
  children: /* @__PURE__ */ e(
1631
- Zs,
1648
+ Js,
1632
1649
  {
1633
1650
  onBack: s,
1634
1651
  showBackButton: n,
@@ -1658,12 +1675,12 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1658
1675
  }
1659
1676
  );
1660
1677
  it.displayName = "ChannelView";
1661
- function Js({
1678
+ function Xs({
1662
1679
  searchQuery: t,
1663
1680
  setSearchQuery: s,
1664
1681
  placeholder: n
1665
1682
  }) {
1666
- const r = Q(null);
1683
+ const r = K(null);
1667
1684
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1668
1685
  /* @__PURE__ */ e(
1669
1686
  rs,
@@ -1697,7 +1714,7 @@ function Js({
1697
1714
  )
1698
1715
  ] });
1699
1716
  }
1700
- const Xs = ({
1717
+ const Ks = ({
1701
1718
  participantSource: t,
1702
1719
  onSelectParticipant: s,
1703
1720
  onClose: n,
@@ -1708,10 +1725,10 @@ const Xs = ({
1708
1725
  }) => {
1709
1726
  const { debug: c } = Me(), [g, h] = k(""), [b, C] = k([]), [E, m] = k(!1), [S, o] = k(null), [y, M] = k(
1710
1727
  null
1711
- ), N = Q(!1);
1712
- X(() => {
1728
+ ), N = K(!1);
1729
+ Z(() => {
1713
1730
  N.current = !1;
1714
- }, [t]), X(() => {
1731
+ }, [t]), Z(() => {
1715
1732
  if (t.loading) {
1716
1733
  c && console.log(
1717
1734
  "[ParticipantPicker] Waiting for participant source to finish loading..."
@@ -1774,7 +1791,7 @@ const Xs = ({
1774
1791
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1775
1792
  ] }),
1776
1793
  /* @__PURE__ */ e(
1777
- Js,
1794
+ Xs,
1778
1795
  {
1779
1796
  searchQuery: g,
1780
1797
  setSearchQuery: h,
@@ -1836,7 +1853,7 @@ const Xs = ({
1836
1853
  ] }) })
1837
1854
  ] }) })
1838
1855
  ] });
1839
- }, Ks = ({ className: t }) => /* @__PURE__ */ i(
1856
+ }, Qs = ({ className: t }) => /* @__PURE__ */ i(
1840
1857
  "svg",
1841
1858
  {
1842
1859
  width: "140",
@@ -1972,7 +1989,7 @@ const Xs = ({
1972
1989
  }
1973
1990
  ), ct = F.memo(
1974
1991
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1975
- /* @__PURE__ */ e(Ks, {}),
1992
+ /* @__PURE__ */ e(Qs, {}),
1976
1993
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1977
1994
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1978
1995
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
@@ -1995,7 +2012,7 @@ const Ee = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1995
2012
  )
1996
2013
  ] }) }));
1997
2014
  Ee.displayName = "ErrorState";
1998
- const cn = ({
2015
+ const dn = ({
1999
2016
  capabilities: t = {},
2000
2017
  className: s,
2001
2018
  renderMessageInputActions: n,
@@ -2030,10 +2047,10 @@ const cn = ({
2030
2047
  client: T,
2031
2048
  isConnected: $,
2032
2049
  isLoading: se,
2033
- error: Z,
2034
- refreshConnection: J,
2050
+ error: J,
2051
+ refreshConnection: X,
2035
2052
  debug: P
2036
- } = os(), [V, z] = k(null), [ie, ce] = k(!1), [R, O] = k(!1), [Y, W] = k(!1), [ne, ee] = k(/* @__PURE__ */ new Set()), [de, Ge] = k(0), [q, me] = k(!1), [ae, re] = k(null), te = Q(null), {
2053
+ } = os(), [V, z] = k(null), [ie, ce] = k(!1), [R, O] = k(!1), [Y, W] = k(!1), [ne, ee] = k(/* @__PURE__ */ new Set()), [de, Ge] = k(0), [q, me] = k(!1), [ae, re] = k(null), te = K(null), {
2037
2054
  participantSource: fe,
2038
2055
  participantLabel: ge = "participants",
2039
2056
  showDeleteConversation: xe = !0
@@ -2050,7 +2067,7 @@ const cn = ({
2050
2067
  },
2051
2068
  ...b
2052
2069
  };
2053
- }, [b, T == null ? void 0 : T.userID]), oe = Q(null), K = U(async () => {
2070
+ }, [b, T == null ? void 0 : T.userID]), oe = K(null), Q = U(async () => {
2054
2071
  if (!T || !$) return;
2055
2072
  const I = T.userID;
2056
2073
  if (I)
@@ -2079,11 +2096,11 @@ const cn = ({
2079
2096
  console.error("[MessagingShell] Failed to sync channels:", H);
2080
2097
  }
2081
2098
  }, [T, $, P]);
2082
- X(() => {
2099
+ Z(() => {
2083
2100
  if (!T || !$) return;
2084
2101
  const I = T.userID;
2085
- I && oe.current !== I && K();
2086
- }, [T, $, K]), X(() => {
2102
+ I && oe.current !== I && Q();
2103
+ }, [T, $, Q]), Z(() => {
2087
2104
  if (!a || !T || !$) return;
2088
2105
  (async () => {
2089
2106
  const H = T.userID;
@@ -2194,20 +2211,20 @@ const cn = ({
2194
2211
  [ye]
2195
2212
  ), mt = U(
2196
2213
  async (I) => {
2197
- P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), oe.current = null, await K();
2214
+ P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), oe.current = null, await Q();
2198
2215
  },
2199
- [K, P]
2216
+ [Q, P]
2200
2217
  ), ut = U(
2201
2218
  async (I) => {
2202
- P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), oe.current = null, await K();
2219
+ P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), oe.current = null, await Q();
2203
2220
  },
2204
- [K, P]
2221
+ [Q, P]
2205
2222
  ), ve = !!V;
2206
- return se ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : Z ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: Z, onBack: J }) }) : !$ || !T ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
2223
+ return se ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : J ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: J, onBack: X }) }) : !$ || !T ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
2207
2224
  Ee,
2208
2225
  {
2209
2226
  message: "Not connected to messaging service",
2210
- onBack: J
2227
+ onBack: X
2211
2228
  }
2212
2229
  ) }) : ae ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: ae }) }) : /* @__PURE__ */ i(
2213
2230
  "div",
@@ -2306,7 +2323,7 @@ const cn = ({
2306
2323
  onClick: dt,
2307
2324
  onClose: ye,
2308
2325
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2309
- Xs,
2326
+ Ks,
2310
2327
  {
2311
2328
  participantSource: fe,
2312
2329
  onSelectParticipant: pe,
@@ -2322,7 +2339,7 @@ const cn = ({
2322
2339
  ]
2323
2340
  }
2324
2341
  );
2325
- }, Qs = ({
2342
+ }, en = ({
2326
2343
  question: t,
2327
2344
  onClick: s,
2328
2345
  loading: n = !1,
@@ -2344,7 +2361,7 @@ const cn = ({
2344
2361
  ),
2345
2362
  children: t
2346
2363
  }
2347
- ), dn = ({
2364
+ ), mn = ({
2348
2365
  faqs: t,
2349
2366
  onFaqClick: s,
2350
2367
  loadingFaqId: n,
@@ -2373,7 +2390,7 @@ const cn = ({
2373
2390
  children: [
2374
2391
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2375
2392
  c.map((g) => /* @__PURE__ */ e(
2376
- Qs,
2393
+ en,
2377
2394
  {
2378
2395
  question: g.question,
2379
2396
  onClick: () => s(g.id),
@@ -2385,7 +2402,7 @@ const cn = ({
2385
2402
  }
2386
2403
  )
2387
2404
  ] }) });
2388
- }, mn = (t, s = {}) => {
2405
+ }, un = (t, s = {}) => {
2389
2406
  const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = k([]), [a, c] = k(!1), [g, h] = k(null), [b, C] = k(n), [E, m] = k(!0), [S, o] = k(), y = U(async (w = !1, A) => {
2390
2407
  if (a) return;
2391
2408
  const x = A !== void 0 ? A : b;
@@ -2412,7 +2429,7 @@ const cn = ({
2412
2429
  }, [y]), v = U(() => {
2413
2430
  o(void 0), y(!0);
2414
2431
  }, [y]);
2415
- return X(() => {
2432
+ return Z(() => {
2416
2433
  y(!0);
2417
2434
  }, [t.loadParticipants]), {
2418
2435
  participants: l,
@@ -2429,19 +2446,19 @@ const cn = ({
2429
2446
  export {
2430
2447
  we as ActionButton,
2431
2448
  le as Avatar,
2432
- Ys as ChannelEmptyState,
2449
+ Ws as ChannelEmptyState,
2433
2450
  rt as ChannelList,
2434
2451
  it as ChannelView,
2435
- dn as FaqList,
2436
- Qs as FaqListItem,
2437
- Es as LockedAttachment,
2438
- Ms as MessageVoteButtons,
2439
- ln as MessagingProvider,
2440
- cn as MessagingShell,
2441
- Xs as ParticipantPicker,
2452
+ mn as FaqList,
2453
+ en as FaqListItem,
2454
+ Ss as LockedAttachment,
2455
+ ks as MessageVoteButtons,
2456
+ cn as MessagingProvider,
2457
+ dn as MessagingShell,
2458
+ Ks as ParticipantPicker,
2442
2459
  ds as formatRelativeTime,
2443
- vs as useMessageVote,
2460
+ ws as useMessageVote,
2444
2461
  os as useMessaging,
2445
- mn as useParticipants
2462
+ un as useParticipants
2446
2463
  };
2447
2464
  //# sourceMappingURL=index.js.map