@linktr.ee/messaging-react 1.22.0-rc-1771906339 → 1.22.0-rc-1771907607

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
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as i, Fragment as ie } from "react/jsx-runtime";
2
2
  import D from "classnames";
3
3
  import B, { createContext as et, useContext as tt, useCallback as L, useState as I, useRef as q, useEffect as Y, useMemo as ye } from "react";
4
4
  import { StreamChatService as st } from "@linktr.ee/messaging-core";
5
- import { Chat as nt, ChannelList as rt, DateSeparator as at, useChannelStateContext as _e, useChatContext as Ae, areMessageUIPropsEqual as ot, useMessageReminder as lt, useComponentContext as it, Attachment as ct, EditMessageModal as dt, MessageBlocked as ut, MessageBouncePrompt as mt, MessageDeleted as ht, MessageIsThreadReplyInChannelButtonIndicator as ft, MessageRepliesCountButton as gt, ReminderNotification as xt, StreamedMessageText as bt, messageHasAttachments as Ct, messageHasReactions as Nt, isDateSeparatorMessage as vt, isMessageBlocked as wt, isMessageBounced as yt, MessageBounceModal as pt, Poll as Et, MessageText as _t, MessageErrorIcon as It, useMessageContext as St, useMessageComposer as Mt, useStateStore as kt, MessageInput as Dt, useMessageInputContext as Tt, useMessageComposerHasSendableData as Rt, SimpleAttachmentSelector as Ft, QuotedMessagePreview as Lt, AttachmentPreviewList as Pt, TextareaComposer as Ut, MessageTimestamp as ke, Channel as Ot, WithComponents as At, Window as Bt, MessageList as jt } from "stream-chat-react";
5
+ import { Chat as nt, ChannelList as at, DateSeparator as rt, useChannelStateContext as _e, useChatContext as Ae, areMessageUIPropsEqual as ot, useMessageReminder as lt, useComponentContext as it, Attachment as ct, EditMessageModal as dt, MessageBlocked as ut, MessageBouncePrompt as mt, MessageDeleted as ht, MessageIsThreadReplyInChannelButtonIndicator as ft, MessageRepliesCountButton as gt, ReminderNotification as xt, StreamedMessageText as bt, messageHasAttachments as Ct, messageHasReactions as Nt, isDateSeparatorMessage as vt, isMessageBlocked as wt, isMessageBounced as yt, MessageBounceModal as pt, Poll as Et, MessageText as _t, MessageErrorIcon as It, useMessageContext as St, useMessageComposer as Mt, useStateStore as kt, MessageInput as Dt, useMessageInputContext as Tt, useMessageComposerHasSendableData as Rt, SimpleAttachmentSelector as Ft, QuotedMessagePreview as Lt, AttachmentPreviewList as Pt, TextareaComposer as Ut, MessageTimestamp as ke, Channel as Ot, WithComponents as At, Window as Bt, MessageList as jt } from "stream-chat-react";
6
6
  import { GiftIcon as $t, XIcon as Ie, ArrowUpIcon as Gt, SparkleIcon as zt, ArrowLeftIcon as De, StarIcon as Te, DotsThreeIcon as Re, SpinnerGapIcon as ge, SignOutIcon as Ht, ProhibitInsetIcon as Fe, FlagIcon as Vt, MagnifyingGlassIcon as Wt, ChatCircleDotsIcon as Le } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as Pe } from "stream-chat";
8
8
  const Be = et({
@@ -19,7 +19,7 @@ const Be = et({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
- apiKey: a,
22
+ apiKey: r,
23
23
  capabilities: l = {},
24
24
  debug: d = !1
25
25
  }) => {
@@ -31,43 +31,43 @@ const Be = et({
31
31
  );
32
32
  o("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
34
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [u, g] = I(null), [f, C] = I(null), [x, w] = I(!1), [r, p] = I(!1), [S, v] = I(null), k = q(!1), N = q({
38
+ const [u, g] = I(null), [f, C] = I(null), [x, w] = I(!1), [a, p] = I(!1), [S, v] = I(null), k = q(!1), N = q({
39
39
  userId: s == null ? void 0 : s.id,
40
- apiKey: a,
40
+ apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
43
  }), m = q(0);
44
44
  m.current++, o("📊 RENDER INFO", {
45
45
  renderCount: m.current,
46
- currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
46
+ currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: N.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: N.current.apiKey !== a,
49
+ apiKeyChanged: N.current.apiKey !== r,
50
50
  serviceConfigChanged: N.current.serviceConfig !== n,
51
51
  capabilitiesChanged: N.current.capabilities !== l
52
52
  }
53
53
  }), N.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
- apiKey: a,
55
+ apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
58
  }, Y(() => {
59
59
  const c = m.current;
60
60
  if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: c,
62
- apiKey: !!a,
62
+ apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
65
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
67
  serviceConfigStable: N.current.serviceConfig === n,
68
- apiKeyStable: N.current.apiKey === a
68
+ apiKeyStable: N.current.apiKey === r
69
69
  }
70
- }), !a || !n) {
70
+ }), !r || !n) {
71
71
  o("⚠️ SERVICE INIT SKIPPED", {
72
72
  renderCount: c,
73
73
  reason: "Missing apiKey or serviceConfig"
@@ -76,12 +76,12 @@ const Be = et({
76
76
  }
77
77
  o("🚀 CREATING NEW SERVICE", {
78
78
  renderCount: c,
79
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
79
+ apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: N.current.serviceConfig !== n
81
81
  });
82
82
  const b = new st({
83
83
  ...n,
84
- apiKey: a,
84
+ apiKey: r,
85
85
  debug: d
86
86
  });
87
87
  return g(b), o("✅ SERVICE SET", {
@@ -93,7 +93,7 @@ const Be = et({
93
93
  reason: "Effect cleanup"
94
94
  }), b.disconnectUser().catch(console.error);
95
95
  };
96
- }, [a, n, d, o]);
96
+ }, [r, n, d, o]);
97
97
  const y = q(null);
98
98
  Y(() => {
99
99
  var b, A;
@@ -179,14 +179,14 @@ const Be = et({
179
179
  hasService: !!u,
180
180
  hasClient: !!f,
181
181
  isConnected: x,
182
- isLoading: r,
182
+ isLoading: a,
183
183
  hasError: !!S,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: u,
187
187
  client: f,
188
188
  isConnected: x,
189
- isLoading: r,
189
+ isLoading: a,
190
190
  error: S,
191
191
  capabilities: l,
192
192
  refreshConnection: T,
@@ -195,7 +195,7 @@ const Be = et({
195
195
  u,
196
196
  f,
197
197
  x,
198
- r,
198
+ a,
199
199
  S,
200
200
  l,
201
201
  T,
@@ -227,12 +227,12 @@ const Be = et({
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
229
  return "Just now";
230
- const a = Yt(t, s);
231
- return a === 0 ? t.toLocaleTimeString([], {
230
+ const r = Yt(t, s);
231
+ return r === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
234
234
  hour12: !0
235
- }) : a === 1 ? "Yesterday" : a < 7 ? `${a}d` : a < 28 ? `${Math.floor(a / 7)}w` : t.toLocaleDateString("en-US", {
235
+ }) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : t.toLocaleDateString("en-US", {
236
236
  month: "numeric",
237
237
  day: "numeric",
238
238
  year: "2-digit"
@@ -268,8 +268,8 @@ const Be = et({
268
268
  function Jt(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
- const a = t.charCodeAt(n);
272
- s = (s << 5) - s + a, s = s & s;
271
+ const r = t.charCodeAt(n);
272
+ s = (s << 5) - s + r, s = s & s;
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
@@ -281,7 +281,7 @@ const ee = ({
281
281
  id: t,
282
282
  image: s,
283
283
  size: n = 40,
284
- className: a,
284
+ className: r,
285
285
  shape: l = "squircle"
286
286
  }) => {
287
287
  const d = Qt(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", g = l === "circle" ? { borderRadius: "50%" } : {
@@ -291,7 +291,7 @@ const ee = ({
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: D("flex-shrink-0 overflow-hidden", a),
294
+ className: D("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
@@ -317,19 +317,20 @@ const ee = ({
317
317
  )
318
318
  }
319
319
  );
320
- }, Xt = ({ size: t = 12 }) => /* @__PURE__ */ e(
320
+ }, Xt = ({ size: t = 15 }) => /* @__PURE__ */ e(
321
321
  "svg",
322
322
  {
323
323
  width: t,
324
324
  height: t,
325
- viewBox: "0 0 10 10",
325
+ viewBox: "0 0 15 15",
326
326
  fill: "none",
327
327
  "aria-hidden": "true",
328
328
  children: /* @__PURE__ */ e(
329
329
  "path",
330
330
  {
331
- d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
332
- fill: "currentColor"
331
+ d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
332
+ fill: "currentColor",
333
+ fillOpacity: 0.55
333
334
  }
334
335
  )
335
336
  }
@@ -349,7 +350,7 @@ const ee = ({
349
350
  message: t,
350
351
  standalone: s = !1,
351
352
  isMyMessage: n = !1,
352
- hasAttachment: a = !1
353
+ hasAttachment: r = !1
353
354
  }) => {
354
355
  var x;
355
356
  const l = je(t), d = Se(t);
@@ -358,13 +359,13 @@ const ee = ({
358
359
  if (l) {
359
360
  const w = (x = t.metadata) == null ? void 0 : x.amount_text;
360
361
  if (!w) return null;
361
- const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", p = s ? `${w} tip` : `Delivered with ${w} tip`;
362
- return /* @__PURE__ */ i("div", { className: r, children: [
362
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", p = s ? `${w} tip` : `Delivered with ${w} tip`;
363
+ return /* @__PURE__ */ i("div", { className: a, children: [
363
364
  /* @__PURE__ */ e($t, { size: s ? 14 : 12 }),
364
365
  /* @__PURE__ */ e("span", { children: p })
365
366
  ] });
366
367
  }
367
- const o = n && a, u = o ? "Sent with AI" : "Sent with DM Agent", g = [
368
+ const o = n && r, u = o ? "Sent with AI" : "Sent with DM Agent", g = [
368
369
  "message-chatbot-indicator",
369
370
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
370
371
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
@@ -381,7 +382,7 @@ const ee = ({
381
382
  channel: t,
382
383
  selectedChannel: s,
383
384
  onChannelSelect: n,
384
- debug: a = !1,
385
+ debug: r = !1,
385
386
  unread: l,
386
387
  renderMessagePreview: d
387
388
  }) => {
@@ -396,13 +397,13 @@ const ee = ({
396
397
  var R, M;
397
398
  return ((R = _.user) == null ? void 0 : R.id) && _.user.id !== ((M = t == null ? void 0 : t._client) == null ? void 0 : M.userID);
398
399
  }
399
- ), x = ((T = C == null ? void 0 : C.user) == null ? void 0 : T.name) || "Conversation", w = (h = C == null ? void 0 : C.user) == null ? void 0 : h.image, r = (b = (c = t == null ? void 0 : t.state) == null ? void 0 : c.messages) == null ? void 0 : b[t.state.messages.length - 1], S = (() => {
400
+ ), x = ((T = C == null ? void 0 : C.user) == null ? void 0 : T.name) || "Conversation", w = (h = C == null ? void 0 : C.user) == null ? void 0 : h.image, a = (b = (c = t == null ? void 0 : t.state) == null ? void 0 : c.messages) == null ? void 0 : b[t.state.messages.length - 1], S = (() => {
400
401
  var R;
401
- if (r != null && r.text) return r.text;
402
- const _ = (R = r == null ? void 0 : r.attachments) == null ? void 0 : R[0];
402
+ if (a != null && a.text) return a.text;
403
+ const _ = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
403
404
  return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
404
- })(), v = r != null && r.created_at ? Zt(new Date(r.created_at)) : "", k = r ? Se(r) : !1, N = d ? d(r, S) : `${k ? "✨ " : ""}${S}`, m = l ?? 0;
405
- return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
405
+ })(), v = a != null && a.created_at ? Zt(new Date(a.created_at)) : "", k = a ? Se(a) : !1, N = d ? d(a, S) : `${k ? "✨ " : ""}${S}`, m = l ?? 0;
406
+ return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
406
407
  channelId: t == null ? void 0 : t.id,
407
408
  isSelected: o,
408
409
  participantName: x,
@@ -463,7 +464,7 @@ const Ge = B.memo(
463
464
  onChannelSelect: t,
464
465
  selectedChannel: s,
465
466
  filters: n,
466
- className: a,
467
+ className: r,
467
468
  customEmptyStateIndicator: l,
468
469
  renderMessagePreview: d
469
470
  }) => {
@@ -490,10 +491,10 @@ const Ge = B.memo(
490
491
  {
491
492
  className: D(
492
493
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
493
- a
494
+ r
494
495
  ),
495
496
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
496
- rt,
497
+ at,
497
498
  {
498
499
  filters: n,
499
500
  sort: { last_message_at: -1 },
@@ -512,7 +513,7 @@ const fe = ({
512
513
  variant: t = "default",
513
514
  className: s,
514
515
  children: n,
515
- ...a
516
+ ...r
516
517
  }) => /* @__PURE__ */ e(
517
518
  "button",
518
519
  {
@@ -522,11 +523,11 @@ const fe = ({
522
523
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
523
524
  s
524
525
  ),
525
- ...a,
526
+ ...r,
526
527
  children: n
527
528
  }
528
529
  );
529
- function ze({ label: t, className: s, children: n, ...a }) {
530
+ function ze({ label: t, className: s, children: n, ...r }) {
530
531
  return /* @__PURE__ */ i(
531
532
  "button",
532
533
  {
@@ -534,12 +535,12 @@ function ze({ label: t, className: s, children: n, ...a }) {
534
535
  className: D(
535
536
  "rounded-full p-2 transition-colors focus-ring",
536
537
  {
537
- "cursor-not-allowed opacity-50": a.disabled,
538
- "hover:bg-sand": !a.disabled
538
+ "cursor-not-allowed opacity-50": r.disabled,
539
+ "hover:bg-sand": !r.disabled
539
540
  },
540
541
  s
541
542
  ),
542
- ...a,
543
+ ...r,
543
544
  children: [
544
545
  /* @__PURE__ */ e("span", { className: "sr-only", children: t }),
545
546
  n
@@ -550,38 +551,38 @@ function ze({ label: t, className: s, children: n, ...a }) {
550
551
  function He({ onClick: t }) {
551
552
  return /* @__PURE__ */ e(ze, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Ie, { className: "h-5 w-5 text-stone", weight: "bold" }) });
552
553
  }
553
- const ss = (t) => /* @__PURE__ */ e(at, { ...t, position: "center" }), pe = "vote_up", Ee = "vote_down";
554
+ const ss = (t) => /* @__PURE__ */ e(rt, { ...t, position: "center" }), pe = "vote_up", Ee = "vote_down";
554
555
  function ns(t) {
555
556
  return t != null && t.length ? t.some((s) => s.type === Ee) ? "down" : t.some((s) => s.type === pe) ? "up" : null : null;
556
557
  }
557
- function rs(t) {
558
- const { channel: s } = _e(), { client: n } = Ae("useMessageVote"), a = ye(
558
+ function as(t) {
559
+ const { channel: s } = _e(), { client: n } = Ae("useMessageVote"), r = ye(
559
560
  () => ns(t.own_reactions),
560
561
  [t.own_reactions]
561
562
  ), l = L(async () => {
562
563
  if (n != null && n.userID)
563
564
  try {
564
- a === "up" ? await s.deleteReaction(t.id, pe) : await s.sendReaction(
565
+ r === "up" ? await s.deleteReaction(t.id, pe) : await s.sendReaction(
565
566
  t.id,
566
567
  { type: pe },
567
568
  { enforce_unique: !0, skip_push: !0 }
568
569
  );
569
570
  } catch {
570
571
  }
571
- }, [s, n == null ? void 0 : n.userID, t.id, a]), d = L(async () => {
572
+ }, [s, n == null ? void 0 : n.userID, t.id, r]), d = L(async () => {
572
573
  if (n != null && n.userID)
573
574
  try {
574
- a === "down" ? await s.deleteReaction(t.id, Ee) : await s.sendReaction(
575
+ r === "down" ? await s.deleteReaction(t.id, Ee) : await s.sendReaction(
575
576
  t.id,
576
577
  { type: Ee },
577
578
  { enforce_unique: !0, skip_push: !0 }
578
579
  );
579
580
  } catch {
580
581
  }
581
- }, [s, n == null ? void 0 : n.userID, t.id, a]);
582
- return { selected: a, voteUp: l, voteDown: d };
582
+ }, [s, n == null ? void 0 : n.userID, t.id, r]);
583
+ return { selected: r, voteUp: l, voteDown: d };
583
584
  }
584
- const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
585
+ const rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
585
586
  "path",
586
587
  {
587
588
  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",
@@ -614,7 +615,7 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
614
615
  onClick: s,
615
616
  "aria-label": "Helpful",
616
617
  "aria-pressed": t === "up",
617
- children: /* @__PURE__ */ e(as, { filled: t === "up" })
618
+ children: /* @__PURE__ */ e(rs, { filled: t === "up" })
618
619
  }
619
620
  ),
620
621
  /* @__PURE__ */ e(
@@ -633,7 +634,7 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
633
634
  const {
634
635
  additionalMessageInputProps: s,
635
636
  chatbotVotingEnabled: n,
636
- editing: a,
637
+ editing: r,
637
638
  endOfGroup: l,
638
639
  firstOfGroup: d,
639
640
  groupedByUser: o,
@@ -643,10 +644,10 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
643
644
  highlighted: C,
644
645
  isMessageAIGenerated: x,
645
646
  isMyMessage: w,
646
- message: r,
647
+ message: a,
647
648
  renderText: p,
648
649
  threadList: S
649
- } = t, { client: v } = Ae("CustomMessage"), [k, N] = I(!1), m = lt(r.id), { selected: y, voteUp: T, voteDown: h } = rs(r), {
650
+ } = t, { client: v } = Ae("CustomMessage"), [k, N] = I(!1), m = lt(a.id), { selected: y, voteUp: T, voteDown: h } = as(a), {
650
651
  Attachment: c = ct,
651
652
  EditMessageModal: b = dt,
652
653
  MessageBlocked: A = ut,
@@ -657,42 +658,42 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
657
658
  ReminderNotification: H = xt,
658
659
  StreamedMessageText: te = bt,
659
660
  PinIndicator: J
660
- } = it("CustomMessage"), se = Ct(r), ne = Nt(r), le = ye(
661
- () => x == null ? void 0 : x(r),
662
- [x, r]
661
+ } = it("CustomMessage"), se = Ct(a), ne = Nt(a), le = ye(
662
+ () => x == null ? void 0 : x(a),
663
+ [x, a]
663
664
  ), j = ye(
664
- () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
665
- [r]
665
+ () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
666
+ [a]
666
667
  );
667
- if (vt(r))
668
+ if (vt(a))
668
669
  return null;
669
- if (r.deleted_at || r.type === "deleted")
670
- return /* @__PURE__ */ e(R, { message: r });
671
- if (wt(r))
670
+ if (a.deleted_at || a.type === "deleted")
671
+ return /* @__PURE__ */ e(R, { message: a });
672
+ if (wt(a))
672
673
  return /* @__PURE__ */ e(A, {});
673
- const Q = !S && !!r.reply_count, P = !S && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((ue = r.error) == null ? void 0 : ue.status) !== 403, V = yt(r);
674
+ const Q = !S && !!a.reply_count, P = !S && a.show_in_channel && a.parent_id, U = a.status === "failed" && ((ue = a.error) == null ? void 0 : ue.status) !== 403, V = yt(a);
674
675
  let F;
675
- U ? F = () => f(r) : V && (F = () => N(!0));
676
+ U ? F = () => f(a) : V && (F = () => N(!0));
676
677
  const G = w(), ce = D(
677
678
  "str-chat__message str-chat__message-simple",
678
- `str-chat__message--${r.type}`,
679
- `str-chat__message--${r.status}`,
679
+ `str-chat__message--${a.type}`,
680
+ `str-chat__message--${a.status}`,
680
681
  G ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
681
- r.text ? "str-chat__message--has-text" : "has-no-text",
682
+ a.text ? "str-chat__message--has-text" : "has-no-text",
682
683
  {
683
684
  "str-chat__message--has-attachment": se,
684
685
  "str-chat__message--highlighted": C,
685
- "str-chat__message--pinned pinned-message": r.pinned,
686
+ "str-chat__message--pinned pinned-message": a.pinned,
686
687
  "str-chat__message--with-reactions": ne,
687
- "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((K = r == null ? void 0 : r.error) == null ? void 0 : K.status) !== 403,
688
+ "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((K = a == null ? void 0 : a.error) == null ? void 0 : K.status) !== 403,
688
689
  "str-chat__message-with-thread-link": Q || P,
689
690
  "str-chat__virtual-message__wrapper--end": l,
690
691
  "str-chat__virtual-message__wrapper--first": d,
691
692
  "str-chat__virtual-message__wrapper--group": o
692
693
  }
693
- ), Z = r.poll_id && v.polls.fromState(r.poll_id), re = ts(r), X = Se(r), ae = !!(j != null && j.length && !r.quoted_message), de = X && G && ae;
694
+ ), Z = a.poll_id && v.polls.fromState(a.poll_id), ae = ts(a), X = Se(a), re = !!(j != null && j.length && !a.quoted_message), de = X && G && re;
694
695
  return /* @__PURE__ */ i(ie, { children: [
695
- a && /* @__PURE__ */ e(
696
+ r && /* @__PURE__ */ e(
696
697
  b,
697
698
  {
698
699
  additionalMessageInputProps: s
@@ -709,13 +710,13 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
709
710
  /* @__PURE__ */ i("div", { className: ce, children: [
710
711
  J && /* @__PURE__ */ e(J, {}),
711
712
  !!m && /* @__PURE__ */ e(H, { reminder: m }),
712
- r.user && /* @__PURE__ */ e(
713
+ a.user && /* @__PURE__ */ e(
713
714
  ee,
714
715
  {
715
716
  className: "str-chat__avatar str-chat__message-sender-avatar",
716
- id: r.user.id,
717
- image: r.user.image,
718
- name: r.user.name || r.user.id
717
+ id: a.user.id,
718
+ image: a.user.image,
719
+ name: a.user.name || a.user.id
719
720
  }
720
721
  ),
721
722
  /* @__PURE__ */ e(
@@ -735,21 +736,21 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
735
736
  marginInlineEnd: 0,
736
737
  marginInlineStart: 0
737
738
  },
738
- children: re ? (
739
+ children: ae ? (
739
740
  /* Tip-only messages render as a standalone bubble */
740
- /* @__PURE__ */ e(we, { message: r, standalone: !0 })
741
+ /* @__PURE__ */ e(we, { message: a, standalone: !0 })
741
742
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
742
743
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
743
744
  X && !de && /* @__PURE__ */ e(
744
745
  we,
745
746
  {
746
- message: r,
747
- hasAttachment: ae,
747
+ message: a,
748
+ hasAttachment: re,
748
749
  isMyMessage: G
749
750
  }
750
751
  ),
751
752
  Z && /* @__PURE__ */ e(Et, { poll: Z }),
752
- j != null && j.length && !r.quoted_message ? /* @__PURE__ */ e(
753
+ j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
753
754
  c,
754
755
  {
755
756
  actionHandler: u,
@@ -759,17 +760,17 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
759
760
  le ? /* @__PURE__ */ e(
760
761
  te,
761
762
  {
762
- message: r,
763
+ message: a,
763
764
  renderText: p
764
765
  }
765
- ) : /* @__PURE__ */ e(_t, { message: r, renderText: p }),
766
+ ) : /* @__PURE__ */ e(_t, { message: a, renderText: p }),
766
767
  /* @__PURE__ */ e(It, {})
767
768
  ] }),
768
769
  (!X || de) && /* @__PURE__ */ e(
769
770
  we,
770
771
  {
771
- message: r,
772
- hasAttachment: ae,
772
+ message: a,
773
+ hasAttachment: re,
773
774
  isMyMessage: G
774
775
  }
775
776
  ),
@@ -788,11 +789,11 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
788
789
  W,
789
790
  {
790
791
  onClick: g,
791
- reply_count: r.reply_count
792
+ reply_count: a.reply_count
792
793
  }
793
794
  ),
794
795
  P && /* @__PURE__ */ e(M, {})
795
- ] }, r.id)
796
+ ] }, a.id)
796
797
  ] });
797
798
  }, cs = B.memo(
798
799
  is,
@@ -808,7 +809,7 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
808
809
  link: t,
809
810
  onDismiss: s
810
811
  }) => {
811
- const { og_scrape_url: n, title: a, image_url: l } = t;
812
+ const { og_scrape_url: n, title: r, image_url: l } = t;
812
813
  return /* @__PURE__ */ i(
813
814
  "a",
814
815
  {
@@ -821,7 +822,7 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
821
822
  "img",
822
823
  {
823
824
  src: l,
824
- alt: a || "",
825
+ alt: r || "",
825
826
  className: "h-[148px] w-full rounded-[20px] object-cover"
826
827
  }
827
828
  ),
@@ -838,7 +839,7 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
838
839
  }
839
840
  ),
840
841
  /* @__PURE__ */ i("div", { className: "p-2", children: [
841
- a && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: a }),
842
+ r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
842
843
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
843
844
  ] })
844
845
  ]
@@ -903,18 +904,18 @@ const as = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
903
904
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
904
905
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
905
906
  }, Oe = (t) => xs.includes(t), Cs = (t) => {
906
- var a;
907
- const s = (a = t.metadata) == null ? void 0 : a.custom_type;
907
+ var r;
908
+ const s = (r = t.metadata) == null ? void 0 : r.custom_type;
908
909
  if (Oe(s))
909
910
  return s;
910
911
  const n = t.dm_agent_system_type;
911
912
  if (Oe(n))
912
913
  return n;
913
914
  }, Ns = (t) => {
914
- var a;
915
+ var r;
915
916
  const s = t.message.hide_date === !0, n = Cs(t.message);
916
917
  if (n) {
917
- const l = ((a = t.message.text) == null ? void 0 : a.trim()) || bs[n];
918
+ const l = ((r = t.message.text) == null ? void 0 : r.trim()) || bs[n];
918
919
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
919
920
  /* @__PURE__ */ i(
920
921
  "div",
@@ -999,16 +1000,16 @@ const ys = ({
999
1000
  onBack: t,
1000
1001
  showBackButton: s,
1001
1002
  onShowInfo: n,
1002
- canShowInfo: a,
1003
+ canShowInfo: r,
1003
1004
  showStarButton: l = !1
1004
1005
  }) => {
1005
- var w, r, p, S, v, k;
1006
+ var w, a, p, S, v, k;
1006
1007
  const { channel: d } = _e(), o = B.useMemo(() => Object.values(d.state.members || {}).find(
1007
1008
  (m) => {
1008
1009
  var y;
1009
1010
  return ((y = m.user) == null ? void 0 : y.id) && m.user.id !== d._client.userID;
1010
1011
  }
1011
- ), [d._client.userID, d.state.members]), u = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((r = o == null ? void 0 : o.user) == null ? void 0 : r.id) || "Unknown member", g = (p = o == null ? void 0 : o.user) == null ? void 0 : p.image, [f, C] = I(
1012
+ ), [d._client.userID, d.state.members]), u = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member", g = (p = o == null ? void 0 : o.user) == null ? void 0 : p.image, [f, C] = I(
1012
1013
  !!((S = d.state.membership) != null && S.pinned_at)
1013
1014
  );
1014
1015
  Y(() => {
@@ -1134,7 +1135,7 @@ const ys = ({
1134
1135
  )
1135
1136
  }
1136
1137
  ),
1137
- a && n && /* @__PURE__ */ e(
1138
+ r && n && /* @__PURE__ */ e(
1138
1139
  "button",
1139
1140
  {
1140
1141
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
@@ -1151,7 +1152,7 @@ const ys = ({
1151
1152
  dialogRef: t,
1152
1153
  onClose: s,
1153
1154
  participant: n,
1154
- channel: a,
1155
+ channel: r,
1155
1156
  followerStatusLabel: l,
1156
1157
  onLeaveConversation: d,
1157
1158
  onBlockParticipant: o,
@@ -1162,7 +1163,7 @@ const ys = ({
1162
1163
  customChannelActions: x
1163
1164
  }) => {
1164
1165
  var te, J, se, ne, le, j, Q;
1165
- const { service: w, debug: r } = Ce(), [p, S] = I(!1), [v, k] = I(!1), [N, m] = I(!1), y = L(async () => {
1166
+ const { service: w, debug: a } = Ce(), [p, S] = I(!1), [v, k] = I(!1), [N, m] = I(!1), y = L(async () => {
1166
1167
  var P;
1167
1168
  if (!(!w || !((P = n == null ? void 0 : n.user) != null && P.id)))
1168
1169
  try {
@@ -1186,10 +1187,10 @@ const ys = ({
1186
1187
  const T = async () => {
1187
1188
  var P;
1188
1189
  if (!v) {
1189
- g == null || g(), r && console.log("[ChannelInfoDialog] Leave conversation", a.cid), k(!0);
1190
+ g == null || g(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), k(!0);
1190
1191
  try {
1191
- const U = ((P = a._client) == null ? void 0 : P.userID) ?? null;
1192
- await a.hide(U, !1), d && await d(a), s();
1192
+ const U = ((P = r._client) == null ? void 0 : P.userID) ?? null;
1193
+ await r.hide(U, !1), d && await d(r), s();
1193
1194
  } catch (U) {
1194
1195
  console.error("[ChannelInfoDialog] Failed to leave conversation", U);
1195
1196
  } finally {
@@ -1199,7 +1200,7 @@ const ys = ({
1199
1200
  }, h = async () => {
1200
1201
  var P, U, V;
1201
1202
  if (!(N || !w)) {
1202
- f == null || f(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1203
+ f == null || f(), a && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1203
1204
  try {
1204
1205
  await w.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), o && await o((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
1205
1206
  } catch (F) {
@@ -1211,7 +1212,7 @@ const ys = ({
1211
1212
  }, c = async () => {
1212
1213
  var P, U, V;
1213
1214
  if (!(N || !w)) {
1214
- f == null || f(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1215
+ f == null || f(), a && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1215
1216
  try {
1216
1217
  await w.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), o && await o((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
1217
1218
  } catch (F) {
@@ -1334,7 +1335,7 @@ const ys = ({
1334
1335
  onBack: t,
1335
1336
  showBackButton: s,
1336
1337
  renderMessageInputActions: n,
1337
- onLeaveConversation: a,
1338
+ onLeaveConversation: r,
1338
1339
  onBlockParticipant: l,
1339
1340
  showDeleteConversation: d = !0,
1340
1341
  onDeleteConversationClick: o,
@@ -1345,18 +1346,18 @@ const ys = ({
1345
1346
  renderChannelBanner: x,
1346
1347
  customChannelActions: w
1347
1348
  }) => {
1348
- const { channel: r } = _e(), p = q(null), S = B.useMemo(() => Object.values(r.state.members || {}).find(
1349
+ const { channel: a } = _e(), p = q(null), S = B.useMemo(() => Object.values(a.state.members || {}).find(
1349
1350
  (y) => {
1350
1351
  var T;
1351
- return ((T = y.user) == null ? void 0 : T.id) && y.user.id !== r._client.userID;
1352
+ return ((T = y.user) == null ? void 0 : T.id) && y.user.id !== a._client.userID;
1352
1353
  }
1353
- ), [r._client.userID, r.state.members]), v = B.useMemo(() => {
1354
- const m = r.data ?? {};
1354
+ ), [a._client.userID, a.state.members]), v = B.useMemo(() => {
1355
+ const m = a.data ?? {};
1355
1356
  if (m.followerStatus)
1356
1357
  return String(m.followerStatus);
1357
1358
  if (m.isFollower !== void 0)
1358
1359
  return m.isFollower ? "Subscribed to you" : "Not subscribed";
1359
- }, [r.data]), k = L(() => {
1360
+ }, [a.data]), k = L(() => {
1360
1361
  var m;
1361
1362
  (m = p.current) == null || m.showModal();
1362
1363
  }, []), N = L(() => {
@@ -1393,7 +1394,7 @@ const ys = ({
1393
1394
  /* @__PURE__ */ e(
1394
1395
  gs,
1395
1396
  {
1396
- renderActions: () => n == null ? void 0 : n(r)
1397
+ renderActions: () => n == null ? void 0 : n(a)
1397
1398
  }
1398
1399
  )
1399
1400
  ] })
@@ -1405,9 +1406,9 @@ const ys = ({
1405
1406
  dialogRef: p,
1406
1407
  onClose: N,
1407
1408
  participant: S,
1408
- channel: r,
1409
+ channel: a,
1409
1410
  followerStatusLabel: v,
1410
- onLeaveConversation: a,
1411
+ onLeaveConversation: r,
1411
1412
  onBlockParticipant: l,
1412
1413
  showDeleteConversation: d,
1413
1414
  onDeleteConversationClick: o,
@@ -1422,7 +1423,7 @@ const ys = ({
1422
1423
  channel: t,
1423
1424
  onBack: s,
1424
1425
  showBackButton: n = !1,
1425
- renderMessageInputActions: a,
1426
+ renderMessageInputActions: r,
1426
1427
  onLeaveConversation: l,
1427
1428
  onBlockParticipant: d,
1428
1429
  className: o,
@@ -1432,7 +1433,7 @@ const ys = ({
1432
1433
  onBlockParticipantClick: C,
1433
1434
  onReportParticipantClick: x,
1434
1435
  dmAgentEnabled: w,
1435
- messageMetadata: r,
1436
+ messageMetadata: a,
1436
1437
  onMessageSent: p,
1437
1438
  showStarButton: S = !1,
1438
1439
  chatbotVotingEnabled: v = !1,
@@ -1445,10 +1446,10 @@ const ys = ({
1445
1446
  const c = ((M = t.data) == null ? void 0 : M.chatbot_paused) === !0, b = w && !c, A = {
1446
1447
  ...T,
1447
1448
  ...b && { silent: !0 },
1448
- ...r && {
1449
+ ...a && {
1449
1450
  metadata: {
1450
1451
  ...T.metadata ?? {},
1451
- ...r
1452
+ ...a
1452
1453
  }
1453
1454
  }
1454
1455
  }, _ = {
@@ -1457,7 +1458,7 @@ const ys = ({
1457
1458
  }, R = await t.sendMessage(A, _);
1458
1459
  return p == null || p(R), R;
1459
1460
  },
1460
- [t, w, r, p]
1461
+ [t, w, a, p]
1461
1462
  );
1462
1463
  return /* @__PURE__ */ e(
1463
1464
  "div",
@@ -1480,7 +1481,7 @@ const ys = ({
1480
1481
  {
1481
1482
  onBack: s,
1482
1483
  showBackButton: n,
1483
- renderMessageInputActions: a,
1484
+ renderMessageInputActions: r,
1484
1485
  onLeaveConversation: l,
1485
1486
  onBlockParticipant: d,
1486
1487
  CustomChannelEmptyState: u,
@@ -1506,7 +1507,7 @@ function _s({
1506
1507
  setSearchQuery: s,
1507
1508
  placeholder: n
1508
1509
  }) {
1509
- const a = q(null);
1510
+ const r = q(null);
1510
1511
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1511
1512
  /* @__PURE__ */ e(
1512
1513
  Wt,
@@ -1518,7 +1519,7 @@ function _s({
1518
1519
  /* @__PURE__ */ e(
1519
1520
  "input",
1520
1521
  {
1521
- ref: a,
1522
+ ref: r,
1522
1523
  type: "text",
1523
1524
  placeholder: n,
1524
1525
  value: t,
@@ -1532,7 +1533,7 @@ function _s({
1532
1533
  label: "Clear search",
1533
1534
  onClick: () => {
1534
1535
  var l;
1535
- s(""), (l = a.current) == null || l.focus();
1536
+ s(""), (l = r.current) == null || l.focus();
1536
1537
  },
1537
1538
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1538
1539
  children: /* @__PURE__ */ e(Ie, { className: "h-4 w-4", weight: "bold" })
@@ -1544,12 +1545,12 @@ const Is = ({
1544
1545
  participantSource: t,
1545
1546
  onSelectParticipant: s,
1546
1547
  onClose: n,
1547
- existingParticipantIds: a = /* @__PURE__ */ new Set(),
1548
+ existingParticipantIds: r = /* @__PURE__ */ new Set(),
1548
1549
  participantLabel: l = "participants",
1549
1550
  searchPlaceholder: d = "Search participants...",
1550
1551
  className: o
1551
1552
  }) => {
1552
- const { debug: u } = Ce(), [g, f] = I(""), [C, x] = I([]), [w, r] = I(!1), [p, S] = I(null), [v, k] = I(
1553
+ const { debug: u } = Ce(), [g, f] = I(""), [C, x] = I([]), [w, a] = I(!1), [p, S] = I(null), [v, k] = I(
1553
1554
  null
1554
1555
  ), N = q(!1);
1555
1556
  Y(() => {
@@ -1561,7 +1562,7 @@ const Is = ({
1561
1562
  }
1562
1563
  if (N.current) return;
1563
1564
  (async () => {
1564
- u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), S(null);
1565
+ u && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), S(null);
1565
1566
  try {
1566
1567
  const c = await t.loadParticipants({
1567
1568
  search: "",
@@ -1576,11 +1577,11 @@ const Is = ({
1576
1577
  const b = c instanceof Error ? c.message : "Failed to load participants";
1577
1578
  S(b), console.error("[ParticipantPicker] Failed to load participants:", c);
1578
1579
  } finally {
1579
- r(!1);
1580
+ a(!1);
1580
1581
  }
1581
1582
  })();
1582
1583
  }, [t.loading, u]);
1583
- const m = C.filter((h) => !a.has(h.id)).filter((h) => {
1584
+ const m = C.filter((h) => !r.has(h.id)).filter((h) => {
1584
1585
  var b;
1585
1586
  if (!g) return !0;
1586
1587
  const c = g.toLowerCase();
@@ -1840,7 +1841,7 @@ const Os = ({
1840
1841
  capabilities: t = {},
1841
1842
  className: s,
1842
1843
  renderMessageInputActions: n,
1843
- onChannelSelect: a,
1844
+ onChannelSelect: r,
1844
1845
  onParticipantSelect: l,
1845
1846
  initialParticipantFilter: d,
1846
1847
  initialParticipantData: o,
@@ -1850,7 +1851,7 @@ const Os = ({
1850
1851
  channelListCustomEmptyStateIndicator: C,
1851
1852
  onDeleteConversationClick: x,
1852
1853
  onBlockParticipantClick: w,
1853
- onReportParticipantClick: r,
1854
+ onReportParticipantClick: a,
1854
1855
  dmAgentEnabled: p,
1855
1856
  messageMetadata: S,
1856
1857
  onMessageSent: v,
@@ -1868,9 +1869,9 @@ const Os = ({
1868
1869
  error: _,
1869
1870
  refreshConnection: R,
1870
1871
  debug: M
1871
- } = qt(), [W, H] = I(null), [te, J] = I(!1), [se, ne] = I(!1), [le, j] = I(!1), [Q, P] = I(/* @__PURE__ */ new Set()), [U, V] = I(0), [F, G] = I(!1), [ce, Z] = I(null), re = q(null), {
1872
+ } = qt(), [W, H] = I(null), [te, J] = I(!1), [se, ne] = I(!1), [le, j] = I(!1), [Q, P] = I(/* @__PURE__ */ new Set()), [U, V] = I(0), [F, G] = I(!1), [ce, Z] = I(null), ae = q(null), {
1872
1873
  participantSource: X,
1873
- participantLabel: ae = "participants",
1874
+ participantLabel: re = "participants",
1874
1875
  showDeleteConversation: de = !0
1875
1876
  } = t, ue = B.useMemo(() => {
1876
1877
  const E = c == null ? void 0 : c.userID;
@@ -1937,7 +1938,7 @@ const Os = ({
1937
1938
  { limit: 1 }
1938
1939
  );
1939
1940
  if (O.length > 0)
1940
- H(O[0]), G(!0), Z(null), a && a(O[0]), M && console.log(
1941
+ H(O[0]), G(!0), Z(null), r && r(O[0]), M && console.log(
1941
1942
  "[MessagingShell] Initial conversation loaded:",
1942
1943
  O[0].id
1943
1944
  );
@@ -1953,7 +1954,7 @@ const Os = ({
1953
1954
  email: o.email,
1954
1955
  phone: o.phone
1955
1956
  });
1956
- H($), G(!0), Z(null), a && a($), M && console.log(
1957
+ H($), G(!0), Z(null), r && r($), M && console.log(
1957
1958
  "[MessagingShell] Channel created and loaded:",
1958
1959
  $.id
1959
1960
  );
@@ -1984,13 +1985,13 @@ const Os = ({
1984
1985
  b,
1985
1986
  h,
1986
1987
  M,
1987
- a
1988
+ r
1988
1989
  ]);
1989
1990
  const qe = L(
1990
1991
  (E) => {
1991
- H(E), a == null || a(E);
1992
+ H(E), r == null || r(E);
1992
1993
  },
1993
- [a]
1994
+ [r]
1994
1995
  ), Ye = L(() => {
1995
1996
  F || H(null);
1996
1997
  }, [F]), Ze = L(
@@ -2013,7 +2014,7 @@ const Os = ({
2013
2014
  } catch ($) {
2014
2015
  console.warn("[MessagingShell] Failed to unhide channel:", $);
2015
2016
  }
2016
- H(O), j(!1), (z = re.current) == null || z.close(), l == null || l(E);
2017
+ H(O), j(!1), (z = ae.current) == null || z.close(), l == null || l(E);
2017
2018
  } catch (O) {
2018
2019
  console.error("[MessagingShell] Failed to start conversation:", O);
2019
2020
  }
@@ -2021,10 +2022,10 @@ const Os = ({
2021
2022
  [h, l, M]
2022
2023
  ), me = L(() => {
2023
2024
  var E;
2024
- j(!1), (E = re.current) == null || E.close();
2025
+ j(!1), (E = ae.current) == null || E.close();
2025
2026
  }, []), Je = L(
2026
2027
  (E) => {
2027
- E.target === re.current && me();
2028
+ E.target === ae.current && me();
2028
2029
  },
2029
2030
  [me]
2030
2031
  ), Qe = L(
@@ -2104,7 +2105,7 @@ const Os = ({
2104
2105
  showDeleteConversation: de,
2105
2106
  onDeleteConversationClick: x,
2106
2107
  onBlockParticipantClick: w,
2107
- onReportParticipantClick: r,
2108
+ onReportParticipantClick: a,
2108
2109
  dmAgentEnabled: p,
2109
2110
  messageMetadata: S,
2110
2111
  onMessageSent: v,
@@ -2130,7 +2131,7 @@ const Os = ({
2130
2131
  /* @__PURE__ */ e(
2131
2132
  "dialog",
2132
2133
  {
2133
- ref: re,
2134
+ ref: ae,
2134
2135
  className: "mes-dialog",
2135
2136
  onClick: Je,
2136
2137
  onClose: me,
@@ -2141,8 +2142,8 @@ const Os = ({
2141
2142
  onSelectParticipant: Ze,
2142
2143
  onClose: me,
2143
2144
  existingParticipantIds: Q,
2144
- participantLabel: ae,
2145
- searchPlaceholder: `Search ${ae}...`
2145
+ participantLabel: re,
2146
+ searchPlaceholder: `Search ${re}...`
2146
2147
  },
2147
2148
  U
2148
2149
  ) })
@@ -2155,7 +2156,7 @@ const Os = ({
2155
2156
  question: t,
2156
2157
  onClick: s,
2157
2158
  loading: n = !1,
2158
- className: a
2159
+ className: r
2159
2160
  }) => /* @__PURE__ */ e(
2160
2161
  "button",
2161
2162
  {
@@ -2169,7 +2170,7 @@ const Os = ({
2169
2170
  "hover:brightness-95 active:brightness-90": !n,
2170
2171
  "opacity-50 cursor-not-allowed": n
2171
2172
  },
2172
- a
2173
+ r
2173
2174
  ),
2174
2175
  children: t
2175
2176
  }
@@ -2177,7 +2178,7 @@ const Os = ({
2177
2178
  faqs: t,
2178
2179
  onFaqClick: s,
2179
2180
  loadingFaqId: n,
2180
- headerText: a,
2181
+ headerText: r,
2181
2182
  className: l,
2182
2183
  avatarImage: d,
2183
2184
  avatarName: o
@@ -2200,7 +2201,7 @@ const Os = ({
2200
2201
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
2201
2202
  style: { backgroundColor: "#F1F0EE" },
2202
2203
  children: [
2203
- a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
2204
+ r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2204
2205
  u.map((g) => /* @__PURE__ */ e(
2205
2206
  Ms,
2206
2207
  {
@@ -2215,26 +2216,26 @@ const Os = ({
2215
2216
  )
2216
2217
  ] }) });
2217
2218
  }, Bs = (t, s = {}) => {
2218
- const { initialSearch: n = "", pageSize: a = 20 } = s, [l, d] = I([]), [o, u] = I(!1), [g, f] = I(null), [C, x] = I(n), [w, r] = I(!0), [p, S] = I(), v = L(async (y = !1, T) => {
2219
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = I([]), [o, u] = I(!1), [g, f] = I(null), [C, x] = I(n), [w, a] = I(!0), [p, S] = I(), v = L(async (y = !1, T) => {
2219
2220
  if (o) return;
2220
2221
  const h = T !== void 0 ? T : C;
2221
2222
  u(!0), f(null);
2222
2223
  try {
2223
2224
  const c = await t.loadParticipants({
2224
2225
  search: h || void 0,
2225
- limit: a,
2226
+ limit: r,
2226
2227
  cursor: y ? void 0 : p
2227
2228
  });
2228
2229
  d(
2229
2230
  (b) => y ? c.participants : [...b, ...c.participants]
2230
- ), r(c.hasMore), S(c.nextCursor);
2231
+ ), a(c.hasMore), S(c.nextCursor);
2231
2232
  } catch (c) {
2232
2233
  const b = c instanceof Error ? c.message : "Failed to load participants";
2233
2234
  f(b), console.error("[useParticipants] Load error:", c);
2234
2235
  } finally {
2235
2236
  u(!1);
2236
2237
  }
2237
- }, [t, C, p, a, o]), k = L(() => {
2238
+ }, [t, C, p, r, o]), k = L(() => {
2238
2239
  w && !o && v(!1);
2239
2240
  }, [w, o, v]), N = L((y) => {
2240
2241
  x(y), S(void 0), v(!0, y);
@@ -2268,7 +2269,7 @@ export {
2268
2269
  Os as MessagingShell,
2269
2270
  Is as ParticipantPicker,
2270
2271
  Zt as formatRelativeTime,
2271
- rs as useMessageVote,
2272
+ as as useMessageVote,
2272
2273
  qt as useMessaging,
2273
2274
  Bs as useParticipants
2274
2275
  };