@linktr.ee/messaging-react 1.19.1 โ†’ 1.19.3

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,5 +1,5 @@
1
1
  import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
2
- import F from "classnames";
2
+ import D from "classnames";
3
3
  import B, { createContext as We, useContext as qe, useCallback as L, useState as S, useRef as G, useEffect as H, useMemo as be } from "react";
4
4
  import { StreamChatService as Ze } from "@linktr.ee/messaging-core";
5
5
  import { Chat as Ye, ChannelList as Je, DateSeparator as Qe, areMessageUIPropsEqual as Xe, useChatContext as Ke, useMessageReminder as es, useComponentContext as ss, Attachment as ts, EditMessageModal as ns, MessageBlocked as rs, MessageBouncePrompt as as, MessageDeleted as ls, MessageIsThreadReplyInChannelButtonIndicator as os, MessageRepliesCountButton as is, ReminderNotification as cs, StreamedMessageText as ds, messageHasAttachments as us, messageHasReactions as ms, isDateSeparatorMessage as hs, isMessageBlocked as fs, isMessageBounced as gs, MessageBounceModal as xs, Poll as Cs, MessageText as bs, MessageErrorIcon as Ns, useMessageContext as vs, useMessageComposer as ws, useStateStore as ys, MessageInput as ps, useMessageInputContext as Es, useMessageComposerHasSendableData as Is, SimpleAttachmentSelector as _s, QuotedMessagePreview as Ss, AttachmentPreviewList as Ms, TextareaComposer as ks, MessageTimestamp as Rs, Channel as Ds, useChannelStateContext as Se, WithComponents as Ts, Window as Fs, MessageList as Ls } from "stream-chat-react";
@@ -35,7 +35,7 @@ const Me = We({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [d, x] = S(null), [h, C] = S(null), [N, a] = S(!1), [M, I] = S(!1), [_, f] = S(null), p = G(!1), b = G({
38
+ const [d, x] = S(null), [m, C] = S(null), [N, a] = S(!1), [M, I] = S(!1), [_, f] = S(null), p = G(!1), b = G({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: l,
41
41
  serviceConfig: n,
@@ -94,7 +94,7 @@ const Me = We({
94
94
  }), w.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [l, n, c, r]);
97
- const m = G(null);
97
+ const h = G(null);
98
98
  H(() => {
99
99
  var w, v;
100
100
  if (r("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
@@ -112,7 +112,7 @@ const Me = We({
112
112
  r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((w = m.current) == null ? void 0 : w.serviceId) === d && ((v = m.current) == null ? void 0 : v.userId) === s.id) {
115
+ if (((w = h.current) == null ? void 0 : w.serviceId) === d && ((v = h.current) == null ? void 0 : v.userId) === s.id) {
116
116
  r(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -123,13 +123,13 @@ const Me = We({
123
123
  r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), p.current = !0, I(!0), f(null);
124
124
  try {
125
125
  r("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const D = await d.connectUser(s);
127
- C(D), a(!0), m.current = { serviceId: d, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
126
+ const T = await d.connectUser(s);
127
+ C(T), a(!0), h.current = { serviceId: d, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: D.userID
129
+ clientId: T.userID
130
130
  });
131
- } catch (D) {
132
- const P = D instanceof Error ? D.message : "Connection failed";
131
+ } catch (T) {
132
+ const P = T instanceof Error ? T.message : "Connection failed";
133
133
  f(P), r("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
135
  error: P
@@ -148,7 +148,7 @@ const Me = We({
148
148
  d && N ? (r(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), m.current = null, d.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
151
+ ), h.current = null, d.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!d,
153
153
  isConnected: N
154
154
  });
@@ -177,14 +177,14 @@ const Me = We({
177
177
  }
178
178
  }, [d, s, r]), g = B.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!d,
180
- hasClient: !!h,
180
+ hasClient: !!m,
181
181
  isConnected: N,
182
182
  isLoading: M,
183
183
  hasError: !!_,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
186
  service: d,
187
- client: h,
187
+ client: m,
188
188
  isConnected: N,
189
189
  isLoading: M,
190
190
  error: _,
@@ -193,7 +193,7 @@ const Me = We({
193
193
  debug: c
194
194
  }), [
195
195
  d,
196
- h,
196
+ m,
197
197
  N,
198
198
  M,
199
199
  _,
@@ -204,12 +204,12 @@ const Me = We({
204
204
  ]);
205
205
  return r("๐Ÿ”„ RENDER END", {
206
206
  renderCount: y.current,
207
- willRenderChat: !!(h && N),
207
+ willRenderChat: !!(m && N),
208
208
  contextValueReady: !!g
209
- }), /* @__PURE__ */ e(Me.Provider, { value: g, children: h && N ? /* @__PURE__ */ e(
209
+ }), /* @__PURE__ */ e(Me.Provider, { value: g, children: m && N ? /* @__PURE__ */ e(
210
210
  Ye,
211
211
  {
212
- client: h,
212
+ client: m,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
@@ -284,14 +284,14 @@ const X = ({
284
284
  className: l,
285
285
  shape: o = "squircle"
286
286
  }) => {
287
- const c = Hs(t), d = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", x = o === "circle" ? { borderRadius: "50%" } : {
287
+ const c = Hs(t), d = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", x = o === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: F("flex-shrink-0 overflow-hidden", l),
294
+ className: D("flex-shrink-0 overflow-hidden", l),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
@@ -308,7 +308,7 @@ const X = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: F(
311
+ className: D(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
313
  d
314
314
  ),
@@ -365,18 +365,18 @@ const X = ({
365
365
  unread: o,
366
366
  renderMessagePreview: c
367
367
  }) => {
368
- var y, m, k, g, u, w;
368
+ var y, h, k, g, u, w;
369
369
  const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), d = () => {
370
370
  t && n(t);
371
- }, h = Object.values(((y = t == null ? void 0 : t.state) == null ? void 0 : y.members) || {}).find(
371
+ }, m = Object.values(((y = t == null ? void 0 : t.state) == null ? void 0 : y.members) || {}).find(
372
372
  (v) => {
373
- var D, P;
374
- return ((D = v.user) == null ? void 0 : D.id) && v.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
373
+ var T, P;
374
+ return ((T = v.user) == null ? void 0 : T.id) && v.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
375
375
  }
376
- ), C = ((m = h == null ? void 0 : h.user) == null ? void 0 : m.name) || "Conversation", N = (k = h == null ? void 0 : h.user) == null ? void 0 : k.image, a = (u = (g = t == null ? void 0 : t.state) == null ? void 0 : g.messages) == null ? void 0 : u[t.state.messages.length - 1], I = (() => {
377
- var D;
376
+ ), C = ((h = m == null ? void 0 : m.user) == null ? void 0 : h.name) || "Conversation", N = (k = m == null ? void 0 : m.user) == null ? void 0 : k.image, a = (u = (g = t == null ? void 0 : t.state) == null ? void 0 : g.messages) == null ? void 0 : u[t.state.messages.length - 1], I = (() => {
377
+ var T;
378
378
  if (a != null && a.text) return a.text;
379
- const v = (D = a == null ? void 0 : a.attachments) == null ? void 0 : D[0];
379
+ const v = (T = a == null ? void 0 : a.attachments) == null ? void 0 : T[0];
380
380
  return v ? v.og_scrape_url ? v.og_scrape_url : v.type === "image" ? "๐Ÿ“ท Sent an image" : v.type === "video" ? "๐ŸŽฅ Sent a video" : v.type === "audio" ? "๐ŸŽต Sent audio" : v.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
381
381
  })(), _ = a != null && a.created_at ? zs(new Date(a.created_at)) : "", f = a ? ke(a) : !1, p = c ? c(a, I) : `${f ? "โœจ " : ""}${I}`, b = o ?? 0;
382
382
  return l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
@@ -390,7 +390,7 @@ const X = ({
390
390
  {
391
391
  type: "button",
392
392
  onClick: d,
393
- className: F(
393
+ className: D(
394
394
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
395
395
  {
396
396
  "bg-primary-alt/10 border-l-4 border-l-primary": r,
@@ -401,7 +401,7 @@ const X = ({
401
401
  /* @__PURE__ */ e(
402
402
  X,
403
403
  {
404
- id: ((w = h == null ? void 0 : h.user) == null ? void 0 : w.id) || t.id || "unknown",
404
+ id: ((w = m == null ? void 0 : m.user) == null ? void 0 : w.id) || t.id || "unknown",
405
405
  name: C,
406
406
  image: N,
407
407
  size: 44,
@@ -413,7 +413,7 @@ const X = ({
413
413
  /* @__PURE__ */ e(
414
414
  "h3",
415
415
  {
416
- className: F(
416
+ className: D(
417
417
  "text-sm font-medium truncate",
418
418
  r ? "text-primary" : "text-charcoal"
419
419
  ),
@@ -463,7 +463,7 @@ const Te = B.memo(
463
463
  return /* @__PURE__ */ e(
464
464
  "div",
465
465
  {
466
- className: F(
466
+ className: D(
467
467
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
468
468
  l
469
469
  ),
@@ -492,7 +492,7 @@ const le = ({
492
492
  "button",
493
493
  {
494
494
  type: "button",
495
- className: F(
495
+ className: D(
496
496
  "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",
497
497
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
498
498
  s
@@ -506,7 +506,7 @@ function Fe({ label: t, className: s, children: n, ...l }) {
506
506
  "button",
507
507
  {
508
508
  type: "button",
509
- className: F(
509
+ className: D(
510
510
  "rounded-full p-2 transition-colors focus-ring",
511
511
  {
512
512
  "cursor-not-allowed opacity-50": l.disabled,
@@ -536,7 +536,7 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
536
536
  handleAction: r,
537
537
  handleOpenThread: d,
538
538
  handleRetry: x,
539
- highlighted: h,
539
+ highlighted: m,
540
540
  isMessageAIGenerated: C,
541
541
  isMyMessage: N,
542
542
  message: a,
@@ -544,13 +544,13 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
544
544
  threadList: I
545
545
  } = t, { client: _ } = Ke("CustomMessage"), [f, p] = S(!1), b = es(a.id), {
546
546
  Attachment: y = ts,
547
- EditMessageModal: m = ns,
547
+ EditMessageModal: h = ns,
548
548
  MessageBlocked: k = rs,
549
549
  MessageBouncePrompt: g = as,
550
550
  MessageDeleted: u = ls,
551
551
  MessageIsThreadReplyInChannelButtonIndicator: w = os,
552
552
  MessageRepliesCountButton: v = is,
553
- ReminderNotification: D = cs,
553
+ ReminderNotification: T = cs,
554
554
  StreamedMessageText: P = ds,
555
555
  PinIndicator: q
556
556
  } = ss("CustomMessage"), te = us(a), K = ms(a), ee = be(
@@ -567,9 +567,9 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
567
567
  if (fs(a))
568
568
  return /* @__PURE__ */ e(k, {});
569
569
  const W = !I && !!a.reply_count, Z = !I && a.show_in_channel && a.parent_id, Y = a.status === "failed" && (($ = a.error) == null ? void 0 : $.status) !== 403, J = gs(a);
570
- let T;
571
- Y ? T = () => x(a) : J && (T = () => p(!0));
572
- const R = F(
570
+ let F;
571
+ Y ? F = () => x(a) : J && (F = () => p(!0));
572
+ const R = D(
573
573
  "str-chat__message str-chat__message-simple",
574
574
  `str-chat__message--${a.type}`,
575
575
  `str-chat__message--${a.status}`,
@@ -577,7 +577,7 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
577
577
  a.text ? "str-chat__message--has-text" : "has-no-text",
578
578
  {
579
579
  "str-chat__message--has-attachment": te,
580
- "str-chat__message--highlighted": h,
580
+ "str-chat__message--highlighted": m,
581
581
  "str-chat__message--pinned pinned-message": a.pinned,
582
582
  "str-chat__message--with-reactions": K,
583
583
  "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((Q = a == null ? void 0 : a.error) == null ? void 0 : Q.status) !== 403,
@@ -589,7 +589,7 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
589
589
  ), U = a.poll_id && _.polls.fromState(a.poll_id), z = Zs(a);
590
590
  return /* @__PURE__ */ i(he, { children: [
591
591
  n && /* @__PURE__ */ e(
592
- m,
592
+ h,
593
593
  {
594
594
  additionalMessageInputProps: s
595
595
  }
@@ -604,7 +604,7 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
604
604
  ),
605
605
  /* @__PURE__ */ i("div", { className: R, children: [
606
606
  q && /* @__PURE__ */ e(q, {}),
607
- !!b && /* @__PURE__ */ e(D, { reminder: b }),
607
+ !!b && /* @__PURE__ */ e(T, { reminder: b }),
608
608
  a.user && /* @__PURE__ */ e(
609
609
  X,
610
610
  {
@@ -617,14 +617,14 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
617
617
  /* @__PURE__ */ e(
618
618
  "div",
619
619
  {
620
- className: F("str-chat__message-inner", {
620
+ className: D("str-chat__message-inner", {
621
621
  "str-chat__simple-message--error-failed": Y || J
622
622
  }),
623
623
  "data-testid": "message-inner",
624
- onClick: T,
625
- onKeyDown: T,
626
- role: T ? "button" : void 0,
627
- tabIndex: T ? 0 : void 0,
624
+ onClick: F,
625
+ onKeyDown: F,
626
+ role: F ? "button" : void 0,
627
+ tabIndex: F ? 0 : void 0,
628
628
  style: {
629
629
  // Force margins to 0 to prevent hover layout shift
630
630
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
@@ -782,7 +782,7 @@ const Ys = (t) => /* @__PURE__ */ e(Qe, { ...t, position: "center" }), Js = (t)
782
782
  }, at = () => null, lt = ({ className: t, message: s }) => /* @__PURE__ */ i(
783
783
  "div",
784
784
  {
785
- className: F("flex items-center justify-center h-full", t),
785
+ className: D("flex items-center justify-center h-full", t),
786
786
  children: [
787
787
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
788
788
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -837,17 +837,17 @@ const ot = ({
837
837
  var a, M, I, _, f, p;
838
838
  const { channel: c } = Se(), r = B.useMemo(() => Object.values(c.state.members || {}).find(
839
839
  (y) => {
840
- var m;
841
- return ((m = y.user) == null ? void 0 : m.id) && y.user.id !== c._client.userID;
840
+ var h;
841
+ return ((h = y.user) == null ? void 0 : h.id) && y.user.id !== c._client.userID;
842
842
  }
843
- ), [c._client.userID, c.state.members]), d = ((a = r == null ? void 0 : r.user) == null ? void 0 : a.name) || ((M = r == null ? void 0 : r.user) == null ? void 0 : M.id) || "Unknown member", x = (I = r == null ? void 0 : r.user) == null ? void 0 : I.image, [h, C] = S(
843
+ ), [c._client.userID, c.state.members]), d = ((a = r == null ? void 0 : r.user) == null ? void 0 : a.name) || ((M = r == null ? void 0 : r.user) == null ? void 0 : M.id) || "Unknown member", x = (I = r == null ? void 0 : r.user) == null ? void 0 : I.image, [m, C] = S(
844
844
  !!((_ = c.state.membership) != null && _.pinned_at)
845
845
  );
846
846
  H(() => {
847
847
  const b = (y) => {
848
- var m;
848
+ var h;
849
849
  C(
850
- y != null && y.member ? !!y.member.pinned_at : !!((m = c.state.membership) != null && m.pinned_at)
850
+ y != null && y.member ? !!y.member.pinned_at : !!((h = c.state.membership) != null && h.pinned_at)
851
851
  );
852
852
  };
853
853
  return c.on("member.updated", b), () => {
@@ -856,7 +856,7 @@ const ot = ({
856
856
  }, [c]);
857
857
  const N = async () => {
858
858
  try {
859
- h ? await c.unpin() : await c.pin();
859
+ m ? await c.unpin() : await c.pin();
860
860
  } catch (b) {
861
861
  console.error(
862
862
  "[CustomChannelHeader] Failed to update pinned status:",
@@ -869,7 +869,7 @@ const ot = ({
869
869
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
870
870
  "button",
871
871
  {
872
- className: F(
872
+ className: D(
873
873
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
874
874
  ),
875
875
  onClick: t || (() => {
@@ -898,12 +898,15 @@ const ot = ({
898
898
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
899
899
  onClick: N,
900
900
  type: "button",
901
- "aria-label": h ? "Unstar conversation" : "Star conversation",
901
+ "aria-label": m ? "Unstar conversation" : "Star conversation",
902
902
  children: /* @__PURE__ */ e(
903
903
  ve,
904
904
  {
905
- className: "size-5 text-black/90",
906
- weight: h ? "fill" : "regular"
905
+ className: D("size-5", {
906
+ "text-yellow-600": m,
907
+ "text-black/90": !m
908
+ }),
909
+ weight: m ? "duotone" : "regular"
907
910
  }
908
911
  )
909
912
  }
@@ -950,12 +953,15 @@ const ot = ({
950
953
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
951
954
  onClick: N,
952
955
  type: "button",
953
- "aria-label": h ? "Unstar conversation" : "Star conversation",
956
+ "aria-label": m ? "Unstar conversation" : "Star conversation",
954
957
  children: /* @__PURE__ */ e(
955
958
  ve,
956
959
  {
957
- className: "size-5 text-black/90",
958
- weight: h ? "fill" : "regular"
960
+ className: D("size-5", {
961
+ "text-yellow-600": m,
962
+ "text-black/90": !m
963
+ }),
964
+ weight: m ? "duotone" : "regular"
959
965
  }
960
966
  )
961
967
  }
@@ -983,13 +989,13 @@ const ot = ({
983
989
  onBlockParticipant: r,
984
990
  showDeleteConversation: d = !0,
985
991
  onDeleteConversationClick: x,
986
- onBlockParticipantClick: h,
992
+ onBlockParticipantClick: m,
987
993
  onReportParticipantClick: C
988
994
  }) => {
989
995
  var K, ee, V, W, Z, Y, J;
990
996
  const { service: N, debug: a } = de(), [M, I] = S(!1), [_, f] = S(!1), [p, b] = S(!1), y = L(async () => {
991
- var T;
992
- if (!(!N || !((T = n == null ? void 0 : n.user) != null && T.id)))
997
+ var F;
998
+ if (!(!N || !((F = n == null ? void 0 : n.user) != null && F.id)))
993
999
  try {
994
1000
  const U = (await N.getBlockedUsers()).some(
995
1001
  (z) => {
@@ -1008,12 +1014,12 @@ const ot = ({
1008
1014
  H(() => {
1009
1015
  y();
1010
1016
  }, [y]);
1011
- const m = async () => {
1012
- var T;
1017
+ const h = async () => {
1018
+ var F;
1013
1019
  if (!_) {
1014
1020
  x == null || x(), a && console.log("[ChannelInfoDialog] Leave conversation", l.cid), f(!0);
1015
1021
  try {
1016
- const R = ((T = l._client) == null ? void 0 : T.userID) ?? null;
1022
+ const R = ((F = l._client) == null ? void 0 : F.userID) ?? null;
1017
1023
  await l.hide(R, !1), c && await c(l), s();
1018
1024
  } catch (R) {
1019
1025
  console.error("[ChannelInfoDialog] Failed to leave conversation", R);
@@ -1022,9 +1028,9 @@ const ot = ({
1022
1028
  }
1023
1029
  }
1024
1030
  }, k = async () => {
1025
- var T, R, U;
1031
+ var F, R, U;
1026
1032
  if (!(p || !N)) {
1027
- h == null || h(), a && console.log("[ChannelInfoDialog] Block member", (T = n == null ? void 0 : n.user) == null ? void 0 : T.id), b(!0);
1033
+ m == null || m(), a && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
1028
1034
  try {
1029
1035
  await N.blockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), r && await r((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
1030
1036
  } catch (z) {
@@ -1034,9 +1040,9 @@ const ot = ({
1034
1040
  }
1035
1041
  }
1036
1042
  }, g = async () => {
1037
- var T, R, U;
1043
+ var F, R, U;
1038
1044
  if (!(p || !N)) {
1039
- h == null || h(), a && console.log("[ChannelInfoDialog] Unblock member", (T = n == null ? void 0 : n.user) == null ? void 0 : T.id), b(!0);
1045
+ m == null || m(), a && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
1040
1046
  try {
1041
1047
  await N.unBlockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), r && await r((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
1042
1048
  } catch (z) {
@@ -1053,7 +1059,7 @@ const ot = ({
1053
1059
  );
1054
1060
  };
1055
1061
  if (!n) return null;
1056
- const w = ((ee = n.user) == null ? void 0 : ee.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", v = (W = n.user) == null ? void 0 : W.image, D = (Z = n.user) == null ? void 0 : Z.email, P = (Y = n.user) == null ? void 0 : Y.username, q = D || (P ? `linktr.ee/${P}` : void 0), te = ((J = n.user) == null ? void 0 : J.id) || "unknown";
1062
+ const w = ((ee = n.user) == null ? void 0 : ee.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", v = (W = n.user) == null ? void 0 : W.image, T = (Z = n.user) == null ? void 0 : Z.email, P = (Y = n.user) == null ? void 0 : Y.username, q = T || (P ? `linktr.ee/${P}` : void 0), te = ((J = n.user) == null ? void 0 : J.id) || "unknown";
1057
1063
  return (
1058
1064
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1059
1065
  /* @__PURE__ */ e(
@@ -1062,8 +1068,8 @@ const ot = ({
1062
1068
  ref: t,
1063
1069
  className: "mes-dialog group",
1064
1070
  onClose: s,
1065
- onClick: (T) => {
1066
- T.target === t.current && s();
1071
+ onClick: (F) => {
1072
+ F.target === t.current && s();
1067
1073
  },
1068
1074
  children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
1069
1075
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
@@ -1112,7 +1118,7 @@ const ot = ({
1112
1118
  d && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1113
1119
  le,
1114
1120
  {
1115
- onClick: m,
1121
+ onClick: h,
1116
1122
  disabled: _,
1117
1123
  "aria-busy": _,
1118
1124
  children: [
@@ -1164,7 +1170,7 @@ const ot = ({
1164
1170
  onDeleteConversationClick: r,
1165
1171
  onBlockParticipantClick: d,
1166
1172
  onReportParticipantClick: x,
1167
- showStarButton: h = !1
1173
+ showStarButton: m = !1
1168
1174
  }) => {
1169
1175
  const { channel: C } = Se(), N = G(null), a = B.useMemo(() => Object.values(C.state.members || {}).find(
1170
1176
  (p) => {
@@ -1199,7 +1205,7 @@ const ot = ({
1199
1205
  showBackButton: s,
1200
1206
  onShowInfo: I,
1201
1207
  canShowInfo: !!a,
1202
- showStarButton: h
1208
+ showStarButton: m
1203
1209
  }
1204
1210
  ) }),
1205
1211
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
@@ -1247,7 +1253,7 @@ const ot = ({
1247
1253
  className: r,
1248
1254
  CustomChannelEmptyState: d = at,
1249
1255
  showDeleteConversation: x = !0,
1250
- onDeleteConversationClick: h,
1256
+ onDeleteConversationClick: m,
1251
1257
  onBlockParticipantClick: C,
1252
1258
  onReportParticipantClick: N,
1253
1259
  dmAgentEnabled: a,
@@ -1258,7 +1264,7 @@ const ot = ({
1258
1264
  const f = L(
1259
1265
  async (p, b, y) => {
1260
1266
  var v;
1261
- const m = ((v = t.data) == null ? void 0 : v.chatbot_paused) === !0, k = a && !m, g = {
1267
+ const h = ((v = t.data) == null ? void 0 : v.chatbot_paused) === !0, k = a && !h, g = {
1262
1268
  ...b,
1263
1269
  ...k && { silent: !0 },
1264
1270
  ...M && {
@@ -1278,7 +1284,7 @@ const ot = ({
1278
1284
  return /* @__PURE__ */ e(
1279
1285
  "div",
1280
1286
  {
1281
- className: F(
1287
+ className: D(
1282
1288
  "messaging-channel-view h-full flex flex-col",
1283
1289
  r
1284
1290
  ),
@@ -1301,7 +1307,7 @@ const ot = ({
1301
1307
  onBlockParticipant: c,
1302
1308
  CustomChannelEmptyState: d,
1303
1309
  showDeleteConversation: x,
1304
- onDeleteConversationClick: h,
1310
+ onDeleteConversationClick: m,
1305
1311
  onBlockParticipantClick: C,
1306
1312
  onReportParticipantClick: N,
1307
1313
  showStarButton: _
@@ -1362,7 +1368,7 @@ const ut = ({
1362
1368
  searchPlaceholder: c = "Search participants...",
1363
1369
  className: r
1364
1370
  }) => {
1365
- const { debug: d } = de(), [x, h] = S(""), [C, N] = S([]), [a, M] = S(!1), [I, _] = S(null), [f, p] = S(
1371
+ const { debug: d } = de(), [x, m] = S(""), [C, N] = S([]), [a, M] = S(!1), [I, _] = S(null), [f, p] = S(
1366
1372
  null
1367
1373
  ), b = G(!1);
1368
1374
  H(() => {
@@ -1398,7 +1404,7 @@ const ut = ({
1398
1404
  if (!x) return !0;
1399
1405
  const u = x.toLowerCase();
1400
1406
  return g.name.toLowerCase().includes(u) || ((w = g.email) == null ? void 0 : w.toLowerCase().includes(u)) || !1;
1401
- }), m = L(
1407
+ }), h = L(
1402
1408
  async (g) => {
1403
1409
  if (!f) {
1404
1410
  p(g.id);
@@ -1411,9 +1417,9 @@ const ut = ({
1411
1417
  },
1412
1418
  [s, f]
1413
1419
  ), k = (g, u) => {
1414
- (g.key === "Enter" || g.key === " ") && (g.preventDefault(), m(u));
1420
+ (g.key === "Enter" || g.key === " ") && (g.preventDefault(), h(u));
1415
1421
  };
1416
- return /* @__PURE__ */ i("div", { className: F("flex flex-col h-full", r), children: [
1422
+ return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1417
1423
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1418
1424
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1419
1425
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
@@ -1431,7 +1437,7 @@ const ut = ({
1431
1437
  dt,
1432
1438
  {
1433
1439
  searchQuery: x,
1434
- setSearchQuery: h,
1440
+ setSearchQuery: m,
1435
1441
  placeholder: c
1436
1442
  }
1437
1443
  )
@@ -1460,7 +1466,7 @@ const ut = ({
1460
1466
  "button",
1461
1467
  {
1462
1468
  type: "button",
1463
- onClick: () => m(g),
1469
+ onClick: () => h(g),
1464
1470
  onKeyDown: (v) => k(v, g),
1465
1471
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
1466
1472
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
@@ -1659,7 +1665,7 @@ const yt = ({
1659
1665
  initialParticipantData: r,
1660
1666
  CustomChannelEmptyState: d,
1661
1667
  showChannelList: x = !0,
1662
- filters: h,
1668
+ filters: m,
1663
1669
  channelListCustomEmptyStateIndicator: C,
1664
1670
  onDeleteConversationClick: N,
1665
1671
  onBlockParticipantClick: a,
@@ -1672,18 +1678,18 @@ const yt = ({
1672
1678
  }) => {
1673
1679
  const {
1674
1680
  service: y,
1675
- client: m,
1681
+ client: h,
1676
1682
  isConnected: k,
1677
1683
  isLoading: g,
1678
1684
  error: u,
1679
1685
  refreshConnection: w,
1680
1686
  debug: v
1681
- } = As(), [D, P] = S(null), [q, te] = S(!1), [K, ee] = S(!1), [V, W] = S(!1), [Z, Y] = S(/* @__PURE__ */ new Set()), [J, T] = S(0), [R, U] = S(!1), [z, $] = S(null), Q = G(null), {
1687
+ } = As(), [T, P] = S(null), [q, te] = S(!1), [K, ee] = S(!1), [V, W] = S(!1), [Z, Y] = S(/* @__PURE__ */ new Set()), [J, F] = S(0), [R, U] = S(!1), [z, $] = S(null), Q = G(null), {
1682
1688
  participantSource: ge,
1683
1689
  participantLabel: xe = "participants",
1684
1690
  showDeleteConversation: Ue = !0
1685
1691
  } = t, Be = B.useMemo(() => {
1686
- const E = m == null ? void 0 : m.userID;
1692
+ const E = h == null ? void 0 : h.userID;
1687
1693
  return {
1688
1694
  ...{
1689
1695
  type: "messaging",
@@ -1693,15 +1699,15 @@ const yt = ({
1693
1699
  hidden: !1
1694
1700
  }
1695
1701
  },
1696
- ...h
1702
+ ...m
1697
1703
  };
1698
- }, [h, m == null ? void 0 : m.userID]), ne = G(null), se = L(async () => {
1699
- if (!m || !k) return;
1700
- const E = m.userID;
1704
+ }, [m, h == null ? void 0 : h.userID]), ne = G(null), se = L(async () => {
1705
+ if (!h || !k) return;
1706
+ const E = h.userID;
1701
1707
  if (E)
1702
1708
  try {
1703
1709
  v && console.log("[MessagingShell] Syncing channels for user:", E);
1704
- const A = await m.queryChannels(
1710
+ const A = await h.queryChannels(
1705
1711
  {
1706
1712
  type: "messaging",
1707
1713
  members: { $in: [E] }
@@ -1723,22 +1729,22 @@ const yt = ({
1723
1729
  } catch (A) {
1724
1730
  console.error("[MessagingShell] Failed to sync channels:", A);
1725
1731
  }
1726
- }, [m, k, v]);
1732
+ }, [h, k, v]);
1727
1733
  H(() => {
1728
- if (!m || !k) return;
1729
- const E = m.userID;
1734
+ if (!h || !k) return;
1735
+ const E = h.userID;
1730
1736
  E && ne.current !== E && se();
1731
- }, [m, k, se]), H(() => {
1732
- if (!c || !m || !k) return;
1737
+ }, [h, k, se]), H(() => {
1738
+ if (!c || !h || !k) return;
1733
1739
  (async () => {
1734
- const A = m.userID;
1740
+ const A = h.userID;
1735
1741
  if (A)
1736
1742
  try {
1737
1743
  v && console.log(
1738
1744
  "[MessagingShell] Loading initial conversation with:",
1739
1745
  c
1740
1746
  );
1741
- const O = await m.queryChannels(
1747
+ const O = await h.queryChannels(
1742
1748
  {
1743
1749
  type: "messaging",
1744
1750
  members: { $eq: [A, c] }
@@ -1790,7 +1796,7 @@ const yt = ({
1790
1796
  }, [
1791
1797
  c,
1792
1798
  r,
1793
- m,
1799
+ h,
1794
1800
  k,
1795
1801
  y,
1796
1802
  v,
@@ -1847,17 +1853,17 @@ const yt = ({
1847
1853
  v && console.log("[MessagingShell] Blocking participant:", E), P(null), U(!1), ne.current = null, await se();
1848
1854
  },
1849
1855
  [se, v]
1850
- ), ae = !!D;
1851
- return g ? /* @__PURE__ */ e("div", { className: F("h-full", s), children: /* @__PURE__ */ e(ce, {}) }) : u ? /* @__PURE__ */ e("div", { className: F("h-full", s), children: /* @__PURE__ */ e(ie, { message: u, onBack: w }) }) : !k || !m ? /* @__PURE__ */ e("div", { className: F("h-full", s), children: /* @__PURE__ */ e(
1856
+ ), ae = !!T;
1857
+ return g ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(ce, {}) }) : u ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(ie, { message: u, onBack: w }) }) : !k || !h ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1852
1858
  ie,
1853
1859
  {
1854
1860
  message: "Not connected to messaging service",
1855
1861
  onBack: w
1856
1862
  }
1857
- ) }) : z ? /* @__PURE__ */ e("div", { className: F("h-full", s), children: /* @__PURE__ */ e(ie, { message: z }) }) : /* @__PURE__ */ i(
1863
+ ) }) : z ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(ie, { message: z }) }) : /* @__PURE__ */ i(
1858
1864
  "div",
1859
1865
  {
1860
- className: F(
1866
+ className: D(
1861
1867
  "messaging-shell h-full bg-background-primary overflow-hidden",
1862
1868
  s
1863
1869
  ),
@@ -1866,7 +1872,7 @@ const yt = ({
1866
1872
  /* @__PURE__ */ e(
1867
1873
  "div",
1868
1874
  {
1869
- className: F(
1875
+ className: D(
1870
1876
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1871
1877
  {
1872
1878
  "!hidden": x === !1 || R,
@@ -1880,7 +1886,7 @@ const yt = ({
1880
1886
  Te,
1881
1887
  {
1882
1888
  onChannelSelect: je,
1883
- selectedChannel: D || void 0,
1889
+ selectedChannel: T || void 0,
1884
1890
  filters: Be,
1885
1891
  customEmptyStateIndicator: C,
1886
1892
  renderMessagePreview: b
@@ -1891,7 +1897,7 @@ const yt = ({
1891
1897
  /* @__PURE__ */ e(
1892
1898
  "div",
1893
1899
  {
1894
- className: F(
1900
+ className: D(
1895
1901
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1896
1902
  {
1897
1903
  // In direct conversation mode (or waiting for it), always show (full width)
@@ -1900,10 +1906,10 @@ const yt = ({
1900
1906
  "hidden lg:flex": !R && !ae && !c
1901
1907
  }
1902
1908
  ),
1903
- children: D ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1909
+ children: T ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1904
1910
  Pe,
1905
1911
  {
1906
- channel: D,
1912
+ channel: T,
1907
1913
  onBack: Ae,
1908
1914
  showBackButton: !R,
1909
1915
  renderMessageInputActions: n,
@@ -1919,7 +1925,7 @@ const yt = ({
1919
1925
  onMessageSent: f,
1920
1926
  showStarButton: p
1921
1927
  },
1922
- D.id
1928
+ T.id
1923
1929
  ) }) : c ? (
1924
1930
  // Show loading while creating/loading direct conversation channel
1925
1931
  /* @__PURE__ */ e(ce, {})
@@ -1970,7 +1976,7 @@ const yt = ({
1970
1976
  onClick: s,
1971
1977
  disabled: n,
1972
1978
  style: { backgroundColor: "#E6E5E3" },
1973
- className: F(
1979
+ className: D(
1974
1980
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1975
1981
  {
1976
1982
  "hover:brightness-95 active:brightness-90": !n,
@@ -1989,7 +1995,7 @@ const yt = ({
1989
1995
  avatarImage: c,
1990
1996
  avatarName: r
1991
1997
  }) => {
1992
- const d = t.filter((x) => x.enabled).sort((x, h) => (x.order ?? 0) - (h.order ?? 0));
1998
+ const d = t.filter((x) => x.enabled).sort((x, m) => (x.order ?? 0) - (m.order ?? 0));
1993
1999
  return d.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1994
2000
  (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1995
2001
  X,
@@ -2022,29 +2028,29 @@ const yt = ({
2022
2028
  )
2023
2029
  ] }) });
2024
2030
  }, Et = (t, s = {}) => {
2025
- const { initialSearch: n = "", pageSize: l = 20 } = s, [o, c] = S([]), [r, d] = S(!1), [x, h] = S(null), [C, N] = S(n), [a, M] = S(!0), [I, _] = S(), f = L(async (m = !1, k) => {
2031
+ const { initialSearch: n = "", pageSize: l = 20 } = s, [o, c] = S([]), [r, d] = S(!1), [x, m] = S(null), [C, N] = S(n), [a, M] = S(!0), [I, _] = S(), f = L(async (h = !1, k) => {
2026
2032
  if (r) return;
2027
2033
  const g = k !== void 0 ? k : C;
2028
- d(!0), h(null);
2034
+ d(!0), m(null);
2029
2035
  try {
2030
2036
  const u = await t.loadParticipants({
2031
2037
  search: g || void 0,
2032
2038
  limit: l,
2033
- cursor: m ? void 0 : I
2039
+ cursor: h ? void 0 : I
2034
2040
  });
2035
2041
  c(
2036
- (w) => m ? u.participants : [...w, ...u.participants]
2042
+ (w) => h ? u.participants : [...w, ...u.participants]
2037
2043
  ), M(u.hasMore), _(u.nextCursor);
2038
2044
  } catch (u) {
2039
2045
  const w = u instanceof Error ? u.message : "Failed to load participants";
2040
- h(w), console.error("[useParticipants] Load error:", u);
2046
+ m(w), console.error("[useParticipants] Load error:", u);
2041
2047
  } finally {
2042
2048
  d(!1);
2043
2049
  }
2044
2050
  }, [t, C, I, l, r]), p = L(() => {
2045
2051
  a && !r && f(!1);
2046
- }, [a, r, f]), b = L((m) => {
2047
- N(m), _(void 0), f(!0, m);
2052
+ }, [a, r, f]), b = L((h) => {
2053
+ N(h), _(void 0), f(!0, h);
2048
2054
  }, [f]), y = L(() => {
2049
2055
  _(void 0), f(!0);
2050
2056
  }, [f]);