@linktr.ee/messaging-react 1.39.0 → 1.40.0

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.
@@ -1,9 +1,9 @@
1
1
  import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
2
- import L from "classnames";
2
+ import D from "classnames";
3
3
  import O, { createContext as ot, useContext as lt, useCallback as G, useState as A, useRef as J, useEffect as Z, useMemo as Ce, Suspense as ct } from "react";
4
4
  import { StreamChatService as Tt } from "@linktr.ee/messaging-core";
5
- import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as Bt, MessageDeleted as zt, MessageIsThreadReplyInChannelButtonIndicator as $t, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as Wt, isMessageBlocked as qt, isMessageBounced as Xt, MessageBounceModal as Zt, MessageText as Xe, Poll as Jt, MessageErrorIcon as Kt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as is, TextareaComposer as os, MessageTimestamp as ve, useTypingContext as ls, Channel as cs, WithComponents as ds, Window as us, MessageList as ms } from "stream-chat-react";
6
- import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs, ArrowUpIcon as bs, SparkleIcon as Se, ProhibitIcon as ps, ArrowLeftIcon as Je, CaretRightIcon as Ke, DotsThreeIcon as Qe, FileIcon as ht, ImageIcon as xs, SpeakerHighIcon as vs, VideoCameraIcon as ws, FileMdIcon as Ns, FileTextIcon as _s, FileZipIcon as ys, FilePptIcon as Cs, FileCsvIcon as Es, FileXlsIcon as Ss, FileDocIcon as Is, FilePdfIcon as ks, CircleNotchIcon as ft, PlayIcon as et, PauseIcon as Ms, LinkIcon as Ts, DownloadSimpleIcon as Ds } from "@phosphor-icons/react";
5
+ import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as zt, MessageDeleted as Bt, MessageIsThreadReplyInChannelButtonIndicator as $t, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as qt, isMessageBlocked as Wt, isMessageBounced as Xt, MessageBounceModal as Zt, MessageText as Xe, Poll as Jt, MessageErrorIcon as Kt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as is, TextareaComposer as os, MessageTimestamp as ve, useTypingContext as ls, Channel as cs, WithComponents as ds, Window as us, MessageList as ms } from "stream-chat-react";
6
+ import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs, ThumbsUpIcon as bs, ThumbsDownIcon as ps, ArrowUpIcon as xs, SparkleIcon as Se, ProhibitIcon as vs, ArrowLeftIcon as Je, CaretRightIcon as Ke, DotsThreeIcon as Qe, FileIcon as ht, ImageIcon as ws, SpeakerHighIcon as _s, VideoCameraIcon as ys, FileMdIcon as Ns, FileTextIcon as Cs, FileZipIcon as Es, FilePptIcon as Ss, FileCsvIcon as Is, FileXlsIcon as ks, FileDocIcon as Ms, FilePdfIcon as Ts, CircleNotchIcon as ft, PlayIcon as et, PauseIcon as Ds, LinkIcon as Rs, DownloadSimpleIcon as Ls } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as tt } from "stream-chat";
8
8
  const gt = ot({
9
9
  service: null,
@@ -35,7 +35,7 @@ const gt = ot({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, y] = A(!1), [b, C] = A(null), x = J(!1), I = J({
38
+ const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, N] = A(!1), [b, C] = A(null), x = J(!1), I = J({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
@@ -120,22 +120,22 @@ const gt = ot({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0, y(!0), C(null);
123
+ i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0, N(!0), C(null);
124
124
  try {
125
125
  i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const _ = await c.connectUser(s);
127
- h(_), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
126
+ const y = await c.connectUser(s);
127
+ h(y), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: _.userID
129
+ clientId: y.userID
130
130
  });
131
- } catch (_) {
132
- const N = _ instanceof Error ? _.message : "Connection failed";
133
- C(N), i("❌ USER CONNECTION ERROR", {
131
+ } catch (y) {
132
+ const _ = y instanceof Error ? y.message : "Connection failed";
133
+ C(_), i("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: N
135
+ error: _
136
136
  });
137
137
  } finally {
138
- y(!1), x.current = !1, i("🔄 USER CONNECTION FINISHED", {
138
+ N(!1), x.current = !1, i("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
@@ -161,7 +161,7 @@ const gt = ot({
161
161
  i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
164
+ i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), N(!0);
165
165
  try {
166
166
  i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
167
167
  const k = await c.connectUser(s);
@@ -173,7 +173,7 @@ const gt = ot({
173
173
  error: T
174
174
  });
175
175
  } finally {
176
- y(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ N(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
178
  }, [c, s, i]), U = O.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
@@ -216,8 +216,8 @@ const gt = ot({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, Rs = () => Te();
220
- function Ls(t) {
219
+ }, As = () => Te();
220
+ function Fs(t) {
221
221
  const s = t.state.pending_messages;
222
222
  if (s != null && s.length)
223
223
  for (const n of s)
@@ -229,7 +229,7 @@ const bt = O.createContext({
229
229
  },
230
230
  debug: !1,
231
231
  renderMessagePreview: void 0
232
- }), As = bt.Provider, Fs = () => O.useContext(bt), pt = (t) => {
232
+ }), Os = bt.Provider, Ps = () => O.useContext(bt), pt = (t) => {
233
233
  var r, o;
234
234
  const [s, n] = A(
235
235
  !!((o = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && o.pinned_at)
@@ -251,18 +251,18 @@ const bt = O.createContext({
251
251
  t.off("member.updated", l);
252
252
  };
253
253
  }, [t]), s;
254
- }, Os = (t, s) => {
254
+ }, Us = (t, s) => {
255
255
  const n = new Date(
256
256
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
257
257
  ), o = new Date(
258
258
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
259
259
  ).getTime() - n.getTime();
260
260
  return Math.floor(o / (1e3 * 60 * 60 * 24));
261
- }, Ps = (t) => {
261
+ }, zs = (t) => {
262
262
  const s = /* @__PURE__ */ new Date();
263
263
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
264
264
  return "Just now";
265
- const r = Os(t, s);
265
+ const r = Us(t, s);
266
266
  return r === 0 ? t.toLocaleTimeString([], {
267
267
  hour: "numeric",
268
268
  minute: "2-digit",
@@ -300,7 +300,7 @@ const bt = O.createContext({
300
300
  "🍈"
301
301
  // Melon
302
302
  ];
303
- function Us(t) {
303
+ function Bs(t) {
304
304
  let s = 0;
305
305
  for (let n = 0; n < t.length; n++) {
306
306
  const r = t.charCodeAt(n);
@@ -308,8 +308,8 @@ function Us(t) {
308
308
  }
309
309
  return Math.abs(s);
310
310
  }
311
- function Bs(t) {
312
- const n = Us(t) % st.length;
311
+ function $s(t) {
312
+ const n = Bs(t) % st.length;
313
313
  return st[n];
314
314
  }
315
315
  const ne = ({
@@ -321,7 +321,7 @@ const ne = ({
321
321
  shape: l = "squircle",
322
322
  dmAgentEnabled: i = !1
323
323
  }) => {
324
- const c = Bs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
324
+ const c = $s(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
325
325
  borderRadius: "33%",
326
326
  cornerShape: "superellipse(1.3)"
327
327
  }, v = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
@@ -335,7 +335,7 @@ const ne = ({
335
335
  "div",
336
336
  {
337
337
  "aria-hidden": "true",
338
- className: L(
338
+ className: D(
339
339
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
340
340
  u
341
341
  ),
@@ -345,7 +345,7 @@ const ne = ({
345
345
  return /* @__PURE__ */ d(
346
346
  "div",
347
347
  {
348
- className: L(
348
+ className: D(
349
349
  "relative flex-shrink-0 !bg-transparent",
350
350
  r
351
351
  ),
@@ -366,7 +366,7 @@ const ne = ({
366
366
  "div",
367
367
  {
368
368
  "data-testid": "avatar-ring",
369
- className: L(
369
+ className: D(
370
370
  "h-full w-full",
371
371
  "bg-transparent"
372
372
  ),
@@ -385,7 +385,7 @@ const ne = ({
385
385
  ]
386
386
  }
387
387
  );
388
- }, zs = ({ size: t = 15 }) => /* @__PURE__ */ e(
388
+ }, js = ({ size: t = 15 }) => /* @__PURE__ */ e(
389
389
  "svg",
390
390
  {
391
391
  width: t,
@@ -402,22 +402,22 @@ const ne = ({
402
402
  }
403
403
  )
404
404
  }
405
- ), $s = (t) => {
405
+ ), Gs = (t) => {
406
406
  var s;
407
407
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
408
- }, js = (t) => {
408
+ }, Vs = (t) => {
409
409
  var s;
410
410
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
411
411
  }, De = (t) => {
412
412
  var s;
413
413
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
414
- }, Gs = (t) => {
414
+ }, Hs = (t) => {
415
415
  var s;
416
416
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
417
- }, xt = (t) => $s(t) || js(t), Vs = (t) => {
417
+ }, xt = (t) => Gs(t) || Vs(t), Ys = (t) => {
418
418
  var s;
419
419
  return xt(t) && !((s = t.text) != null && s.trim());
420
- }, Ne = ({
420
+ }, _e = ({
421
421
  message: t,
422
422
  standalone: s = !1,
423
423
  isMyMessage: n = !1,
@@ -430,17 +430,17 @@ const ne = ({
430
430
  if (o) {
431
431
  const v = (f = t.metadata) == null ? void 0 : f.amount_text;
432
432
  if (!v) return null;
433
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${v} tip` : `Delivered with ${v} tip`;
433
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", N = s ? `${v} tip` : `Delivered with ${v} tip`;
434
434
  return /* @__PURE__ */ d("div", { className: a, children: [
435
435
  /* @__PURE__ */ e(hs, { size: s ? 14 : 12 }),
436
- /* @__PURE__ */ e("span", { children: y })
436
+ /* @__PURE__ */ e("span", { children: N })
437
437
  ] });
438
438
  }
439
439
  const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", m = [
440
440
  "message-chatbot-indicator",
441
441
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
442
442
  i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
443
- ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(zs, { size: i ? 12 : 15 }) });
443
+ ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(js, { size: i ? 12 : 15 }) });
444
444
  return /* @__PURE__ */ e("div", { className: m, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(ce, { children: [
445
445
  u,
446
446
  h
@@ -451,30 +451,30 @@ const ne = ({
451
451
  }, vt = O.memo(
452
452
  ({ channel: t, unread: s }) => {
453
453
  var P, U, k, T;
454
- const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Fs(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
454
+ const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Ps(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
455
455
  t && r(t);
456
456
  }, m = (M) => {
457
- const _ = M.key === "Enter" || M.key === " ", N = M.repeat;
458
- !_ || N || (M.preventDefault(), c());
457
+ const y = M.key === "Enter" || M.key === " ", _ = M.repeat;
458
+ !y || _ || (M.preventDefault(), c());
459
459
  }, h = Object.values(((P = t == null ? void 0 : t.state) == null ? void 0 : P.members) || {}).find(
460
460
  (M) => {
461
- var _, N;
462
- return ((_ = M.user) == null ? void 0 : _.id) && M.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
461
+ var y, _;
462
+ return ((y = M.user) == null ? void 0 : y.id) && M.user.id !== ((_ = t == null ? void 0 : t._client) == null ? void 0 : _.userID);
463
463
  }
464
464
  ), f = ((U = h == null ? void 0 : h.user) == null ? void 0 : U.name) || "Conversation", v = (k = h == null ? void 0 : h.user) == null ? void 0 : k.image, a = (() => {
465
- var _;
466
- const M = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages;
465
+ var y;
466
+ const M = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
467
467
  if (M != null && M.length) {
468
- for (let N = M.length - 1; N >= 0; N--)
469
- if (M[N].type !== "system") return M[N];
468
+ for (let _ = M.length - 1; _ >= 0; _--)
469
+ if (M[_].type !== "system") return M[_];
470
470
  }
471
471
  })(), b = (() => {
472
- var N, F;
472
+ var _, F;
473
473
  if (a != null && a.text) return a.text;
474
- if (((N = a == null ? void 0 : a.metadata) == null ? void 0 : N.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
475
- const _ = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
476
- 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";
477
- })(), C = a != null && a.created_at ? Ps(new Date(a.created_at)) : "", x = a ? De(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = pt(t), E = s ?? 0;
474
+ if (((_ = a == null ? void 0 : a.metadata) == null ? void 0 : _.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
475
+ const y = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
476
+ return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
477
+ })(), C = a != null && a.created_at ? zs(new Date(a.created_at)) : "", x = a ? De(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = pt(t), E = s ?? 0;
478
478
  return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
479
479
  channelId: t == null ? void 0 : t.id,
480
480
  isSelected: i,
@@ -488,7 +488,7 @@ const ne = ({
488
488
  tabIndex: 0,
489
489
  onClick: c,
490
490
  onKeyDown: m,
491
- className: L(
491
+ className: D(
492
492
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
493
493
  {
494
494
  "bg-primary-alt/10 border-l-4 border-l-primary": i,
@@ -512,7 +512,7 @@ const ne = ({
512
512
  /* @__PURE__ */ d(
513
513
  "h3",
514
514
  {
515
- className: L(
515
+ className: D(
516
516
  "text-sm font-medium truncate",
517
517
  i ? "text-primary" : "text-charcoal"
518
518
  ),
@@ -535,7 +535,7 @@ const ne = ({
535
535
  }
536
536
  );
537
537
  vt.displayName = "CustomChannelPreview";
538
- const Hs = { last_message_at: -1 }, wt = O.memo(
538
+ const qs = { last_message_at: -1 }, wt = O.memo(
539
539
  ({
540
540
  onChannelSelect: t,
541
541
  selectedChannel: s,
@@ -544,7 +544,7 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
544
544
  onMessageNew: o,
545
545
  onAddedToChannel: l,
546
546
  channelRenderFilterFn: i,
547
- sort: c = Hs,
547
+ sort: c = qs,
548
548
  className: m,
549
549
  customEmptyStateIndicator: u,
550
550
  renderMessagePreview: h
@@ -554,7 +554,7 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
554
554
  const { debug: v = !1 } = Te(), a = O.useCallback(
555
555
  (b) => {
556
556
  for (const C of b)
557
- Ls(C);
557
+ Fs(C);
558
558
  return i ? i(b) : b;
559
559
  },
560
560
  [i]
@@ -564,7 +564,7 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
564
564
  selectedChannelId: s == null ? void 0 : s.id,
565
565
  filters: n
566
566
  });
567
- const y = O.useMemo(
567
+ const N = O.useMemo(
568
568
  () => ({
569
569
  selectedChannel: s,
570
570
  onChannelSelect: t,
@@ -576,11 +576,11 @@ const Hs = { last_message_at: -1 }, wt = O.memo(
576
576
  return /* @__PURE__ */ e(
577
577
  "div",
578
578
  {
579
- className: L(
579
+ className: D(
580
580
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
581
581
  m
582
582
  ),
583
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(As, { value: y, children: /* @__PURE__ */ e(
583
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Os, { value: N, children: /* @__PURE__ */ e(
584
584
  Rt,
585
585
  {
586
586
  filters: n,
@@ -609,7 +609,7 @@ const me = ({
609
609
  "button",
610
610
  {
611
611
  type: "button",
612
- className: L(
612
+ className: D(
613
613
  "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",
614
614
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
615
615
  s
@@ -618,12 +618,12 @@ const me = ({
618
618
  children: n
619
619
  }
620
620
  );
621
- function Ys({ label: t, className: s, children: n, ...r }) {
621
+ function Ws({ label: t, className: s, children: n, ...r }) {
622
622
  return /* @__PURE__ */ d(
623
623
  "button",
624
624
  {
625
625
  type: "button",
626
- className: L(
626
+ className: D(
627
627
  "inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
628
628
  {
629
629
  "cursor-not-allowed opacity-50": r.disabled,
@@ -639,10 +639,10 @@ function Ys({ label: t, className: s, children: n, ...r }) {
639
639
  }
640
640
  );
641
641
  }
642
- function Ws({ onClick: t }) {
643
- return /* @__PURE__ */ e(Ys, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
642
+ function Xs({ onClick: t }) {
643
+ return /* @__PURE__ */ e(Ws, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
644
644
  }
645
- const qs = ({
645
+ const Zs = ({
646
646
  dialogRef: t,
647
647
  onClose: s,
648
648
  participant: n,
@@ -657,8 +657,8 @@ const qs = ({
657
657
  customProfileContent: f,
658
658
  customChannelActions: v
659
659
  }) => {
660
- var S, $, V, ee, te, W, g;
661
- const { service: a, debug: y } = Te(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
660
+ var S, $, V, ee, te, q, g;
661
+ const { service: a, debug: N } = Te(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
662
662
  var p;
663
663
  if (!(!a || !((p = n == null ? void 0 : n.user) != null && p.id)))
664
664
  try {
@@ -669,10 +669,10 @@ const qs = ({
669
669
  }
670
670
  );
671
671
  C(j);
672
- } catch (R) {
672
+ } catch (L) {
673
673
  console.error(
674
674
  "[ChannelInfoDialog] Failed to check blocked status:",
675
- R
675
+ L
676
676
  );
677
677
  }
678
678
  }, [a, (S = n == null ? void 0 : n.user) == null ? void 0 : S.id]);
@@ -682,22 +682,22 @@ const qs = ({
682
682
  const U = async () => {
683
683
  var p;
684
684
  if (!x) {
685
- m == null || m(), y && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
685
+ m == null || m(), N && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
686
686
  try {
687
- const R = ((p = r._client) == null ? void 0 : p.userID) ?? null;
688
- await r.hide(R, !1), l && await l(r), s();
689
- } catch (R) {
690
- console.error("[ChannelInfoDialog] Failed to leave conversation", R);
687
+ const L = ((p = r._client) == null ? void 0 : p.userID) ?? null;
688
+ await r.hide(L, !1), l && await l(r), s();
689
+ } catch (L) {
690
+ console.error("[ChannelInfoDialog] Failed to leave conversation", L);
691
691
  } finally {
692
692
  I(!1);
693
693
  }
694
694
  }
695
695
  }, k = async () => {
696
- var p, R, j;
696
+ var p, L, j;
697
697
  if (!(w || !a)) {
698
- u == null || u(), y && console.log("[ChannelInfoDialog] Block member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
698
+ u == null || u(), N && console.log("[ChannelInfoDialog] Block member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
699
699
  try {
700
- await a.blockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
700
+ await a.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
701
701
  } catch (Y) {
702
702
  console.error("[ChannelInfoDialog] Failed to block member", Y);
703
703
  } finally {
@@ -705,11 +705,11 @@ const qs = ({
705
705
  }
706
706
  }
707
707
  }, T = async () => {
708
- var p, R, j;
708
+ var p, L, j;
709
709
  if (!(w || !a)) {
710
- u == null || u(), y && console.log("[ChannelInfoDialog] Unblock member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
710
+ u == null || u(), N && console.log("[ChannelInfoDialog] Unblock member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
711
711
  try {
712
- await a.unBlockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
712
+ await a.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
713
713
  } catch (Y) {
714
714
  console.error("[ChannelInfoDialog] Failed to unblock member", Y);
715
715
  } finally {
@@ -724,7 +724,7 @@ const qs = ({
724
724
  );
725
725
  };
726
726
  if (!n) return null;
727
- const _ = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", N = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (W = n.user) == null ? void 0 : W.username, D = F || (H ? `linktr.ee/${H}` : void 0), B = ((g = n.user) == null ? void 0 : g.id) || "unknown";
727
+ const y = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", _ = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (q = n.user) == null ? void 0 : q.username, R = F || (H ? `linktr.ee/${H}` : void 0), z = ((g = n.user) == null ? void 0 : g.id) || "unknown";
728
728
  return (
729
729
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
730
730
  /* @__PURE__ */ e(
@@ -739,7 +739,7 @@ const qs = ({
739
739
  children: /* @__PURE__ */ d("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: [
740
740
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
741
741
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
742
- /* @__PURE__ */ e(Ws, { onClick: s })
742
+ /* @__PURE__ */ e(Xs, { onClick: s })
743
743
  ] }),
744
744
  /* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
745
745
  /* @__PURE__ */ d(
@@ -752,16 +752,16 @@ const qs = ({
752
752
  /* @__PURE__ */ e(
753
753
  ne,
754
754
  {
755
- id: B,
756
- name: _,
757
- image: N,
755
+ id: z,
756
+ name: y,
757
+ image: _,
758
758
  size: 88,
759
759
  shape: "circle"
760
760
  }
761
761
  ),
762
762
  /* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 flex-1", children: [
763
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
764
- D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
763
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
764
+ R && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: R }),
765
765
  o && !f && /* @__PURE__ */ e(
766
766
  "span",
767
767
  {
@@ -829,13 +829,13 @@ const qs = ({
829
829
  }
830
830
  )
831
831
  );
832
- }, Xs = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ie = "vote_up", ke = "vote_down";
833
- function Zs(t) {
832
+ }, Js = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ie = "vote_up", ke = "vote_down";
833
+ function Ks(t) {
834
834
  return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Ie) ? "up" : null : null;
835
835
  }
836
- function Js(t) {
836
+ function Qs(t) {
837
837
  const { channel: s } = oe(), { client: n } = Me("useMessageVote"), r = Ce(
838
- () => Zs(t.own_reactions),
838
+ () => Ks(t.own_reactions),
839
839
  [t.own_reactions]
840
840
  ), o = G(async () => {
841
841
  if (n != null && n.userID)
@@ -860,41 +860,21 @@ function Js(t) {
860
860
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
861
861
  return { selected: r, voteUp: o, voteDown: l };
862
862
  }
863
- const Ks = O.lazy(() => import("./Card-BjTfMGsC.js")), Qs = O.lazy(() => import("./Card-D3E-WTRO.js")), Nt = () => /* @__PURE__ */ e(
863
+ const en = O.lazy(() => import("./Card-CuiPAb_A.js")), tn = O.lazy(() => import("./Card-RBVM8Gy3.js")), _t = () => /* @__PURE__ */ e(
864
864
  "div",
865
865
  {
866
866
  className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
867
867
  "aria-hidden": !0
868
868
  }
869
- ), en = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Ks, { ...t }) }), tn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Qs, { ...t }) }), nt = { Creator: en, Visitor: tn }, sn = {
869
+ ), sn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(_t, {}), children: /* @__PURE__ */ e(en, { ...t }) }), nn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(_t, {}), children: /* @__PURE__ */ e(tn, { ...t }) }), nt = { Creator: sn, Visitor: nn }, an = {
870
870
  isUnlocking: () => !1
871
- }, nn = {
872
- LockedAttachment: sn
873
- }, _t = ot({}), ia = _t.Provider;
874
- function an(t) {
875
- return lt(_t)[t] ?? nn[t];
871
+ }, rn = {
872
+ LockedAttachment: an
873
+ }, yt = ot({}), ia = yt.Provider;
874
+ function on(t) {
875
+ return lt(yt)[t] ?? rn[t];
876
876
  }
877
- const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
878
- "path",
879
- {
880
- 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",
881
- stroke: "currentColor",
882
- strokeWidth: "1.33",
883
- strokeLinecap: "round",
884
- strokeLinejoin: "round",
885
- fill: t ? "currentColor" : "none"
886
- }
887
- ) }), on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
888
- "path",
889
- {
890
- 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",
891
- stroke: "currentColor",
892
- strokeWidth: "1.33",
893
- strokeLinecap: "round",
894
- strokeLinejoin: "round",
895
- fill: t ? "currentColor" : "none"
896
- }
897
- ) }), ln = ({
877
+ const ln = ({
898
878
  selected: t,
899
879
  onVoteUp: s,
900
880
  onVoteDown: n
@@ -903,26 +883,32 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
903
883
  "button",
904
884
  {
905
885
  type: "button",
906
- className: `message-vote-button${t === "up" ? " message-vote-button--selected" : ""} focus-ring`,
886
+ className: D("message-vote-button focus-ring", {
887
+ "message-vote-button--selected": t === "up"
888
+ }),
907
889
  onClick: s,
908
- "aria-label": "Helpful",
890
+ "aria-label": "Good response",
909
891
  "aria-pressed": t === "up",
910
- children: /* @__PURE__ */ e(rn, { filled: t === "up" })
892
+ "data-tooltip": "Good response",
893
+ children: /* @__PURE__ */ e(bs, { size: 16, weight: t === "up" ? "fill" : "regular" })
911
894
  }
912
895
  ),
913
896
  /* @__PURE__ */ e(
914
897
  "button",
915
898
  {
916
899
  type: "button",
917
- className: `message-vote-button${t === "down" ? " message-vote-button--selected" : ""} focus-ring`,
900
+ className: D("message-vote-button focus-ring", {
901
+ "message-vote-button--selected": t === "down"
902
+ }),
918
903
  onClick: n,
919
- "aria-label": "Not helpful",
904
+ "aria-label": "Bad response",
920
905
  "aria-pressed": t === "down",
921
- children: /* @__PURE__ */ e(on, { filled: t === "down" })
906
+ "data-tooltip": "Bad response",
907
+ children: /* @__PURE__ */ e(ps, { size: 16, weight: t === "down" ? "fill" : "regular" })
922
908
  }
923
909
  )
924
910
  ] }), cn = (t) => {
925
- var se, Oe, Pe, Ue, Be, ze, $e, je, Ge, Ve, He, Ye, We, qe;
911
+ var se, Oe, Pe, Ue, ze, Be, $e, je, Ge, Ve, He, Ye, qe, We;
926
912
  const {
927
913
  additionalMessageInputProps: s,
928
914
  chatbotVotingEnabled: n,
@@ -937,36 +923,36 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
937
923
  isMessageAIGenerated: f,
938
924
  isMyMessage: v,
939
925
  message: a,
940
- renderText: y,
926
+ renderText: N,
941
927
  threadList: b
942
- } = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = an("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: _, voteDown: N } = Js(a), {
928
+ } = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = on("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: y, voteDown: _ } = Qs(a), {
943
929
  Attachment: F = Ot,
944
930
  EditMessageModal: H = Pt,
945
- MessageBlocked: D = Ut,
946
- MessageBouncePrompt: B = Bt,
947
- MessageDeleted: S = zt,
931
+ MessageBlocked: R = Ut,
932
+ MessageBouncePrompt: z = zt,
933
+ MessageDeleted: S = Bt,
948
934
  MessageIsThreadReplyInChannelButtonIndicator: $ = $t,
949
935
  MessageRepliesCountButton: V = jt,
950
936
  ReminderNotification: ee = Gt,
951
937
  StreamedMessageText: te = Vt,
952
- PinIndicator: W
953
- } = dt("CustomMessage"), g = Ht(a), p = Yt(a), R = Ce(
938
+ PinIndicator: q
939
+ } = dt("CustomMessage"), g = Ht(a), p = Yt(a), L = Ce(
954
940
  () => f == null ? void 0 : f(a),
955
941
  [f, a]
956
942
  ), j = Ce(
957
943
  () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
958
944
  [a]
959
945
  );
960
- if (Wt(a))
946
+ if (qt(a))
961
947
  return null;
962
948
  if (a.deleted_at || a.type === "deleted")
963
949
  return /* @__PURE__ */ e(S, { message: a });
964
- if (qt(a))
965
- return /* @__PURE__ */ e(D, {});
950
+ if (Wt(a))
951
+ return /* @__PURE__ */ e(R, {});
966
952
  const Y = !b && !!a.reply_count, ae = !b && a.show_in_channel && a.parent_id, de = a.status === "failed" && ((se = a.error) == null ? void 0 : se.status) !== 403, re = Xt(a);
967
- let q;
968
- de ? q = () => u(a) : re && (q = () => k(!0));
969
- const ie = v(), pe = L(
953
+ let W;
954
+ de ? W = () => u(a) : re && (W = () => k(!0));
955
+ const ie = v(), pe = D(
970
956
  "str-chat__message str-chat__message-simple",
971
957
  `str-chat__message--${a.type}`,
972
958
  `str-chat__message--${a.status}`,
@@ -983,7 +969,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
983
969
  "str-chat__virtual-message__wrapper--first": l,
984
970
  "str-chat__virtual-message__wrapper--group": i
985
971
  }
986
- ), ue = a.poll_id && C.polls.fromState(a.poll_id), xe = Vs(a), K = De(a), z = Gs(a), X = !!(j != null && j.length && !a.quoted_message), Q = K && ie && X;
972
+ ), ue = a.poll_id && C.polls.fromState(a.poll_id), xe = Ys(a), K = De(a), B = Hs(a), X = !!(j != null && j.length && !a.quoted_message), Q = K && ie && X;
987
973
  return /* @__PURE__ */ d(ce, { children: [
988
974
  r && /* @__PURE__ */ e(
989
975
  H,
@@ -994,13 +980,13 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
994
980
  U && /* @__PURE__ */ e(
995
981
  Zt,
996
982
  {
997
- MessageBouncePrompt: B,
983
+ MessageBouncePrompt: z,
998
984
  onClose: () => k(!1),
999
985
  open: U
1000
986
  }
1001
987
  ),
1002
988
  /* @__PURE__ */ d("div", { className: pe, children: [
1003
- W && /* @__PURE__ */ e(W, {}),
989
+ q && /* @__PURE__ */ e(q, {}),
1004
990
  !!T && /* @__PURE__ */ e(ee, { reminder: T }),
1005
991
  a.user && /* @__PURE__ */ e(
1006
992
  ne,
@@ -1014,28 +1000,28 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1014
1000
  /* @__PURE__ */ e(
1015
1001
  "div",
1016
1002
  {
1017
- className: L("str-chat__message-inner", {
1003
+ className: D("str-chat__message-inner", {
1018
1004
  "str-chat__simple-message--error-failed": de || re
1019
1005
  }),
1020
1006
  "data-testid": "message-inner",
1021
- onClick: q,
1022
- onKeyDown: q,
1023
- role: q ? "button" : void 0,
1024
- tabIndex: q ? 0 : void 0,
1007
+ onClick: W,
1008
+ onKeyDown: W,
1009
+ role: W ? "button" : void 0,
1010
+ tabIndex: W ? 0 : void 0,
1025
1011
  style: {
1026
1012
  // Force margins to 0 to prevent hover layout shift
1027
1013
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
1028
1014
  marginInlineEnd: 0,
1029
1015
  marginInlineStart: 0
1030
1016
  },
1031
- children: z ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1017
+ children: B ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1032
1018
  ie ? /* @__PURE__ */ e(
1033
1019
  nt.Creator,
1034
1020
  {
1035
1021
  title: (Pe = a.metadata) == null ? void 0 : Pe.attachment_title,
1036
1022
  mimeType: (Ue = a.metadata) == null ? void 0 : Ue.attachment_mime_type,
1037
- thumbnailUrl: (Be = a.metadata) == null ? void 0 : Be.attachment_thumbnail,
1038
- amountText: (ze = a.metadata) == null ? void 0 : ze.amount_text,
1023
+ thumbnailUrl: (ze = a.metadata) == null ? void 0 : ze.attachment_thumbnail,
1024
+ amountText: (Be = a.metadata) == null ? void 0 : Be.amount_text,
1039
1025
  detail: ($e = a.metadata) == null ? void 0 : $e.attachment_detail,
1040
1026
  paymentStatus: (je = a.metadata) == null ? void 0 : je.payment_status,
1041
1027
  isUnlocking: I(a.id),
@@ -1049,22 +1035,22 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1049
1035
  mimeType: (Ve = a.metadata) == null ? void 0 : Ve.attachment_mime_type,
1050
1036
  thumbnailUrl: (He = a.metadata) == null ? void 0 : He.attachment_thumbnail,
1051
1037
  amountText: (Ye = a.metadata) == null ? void 0 : Ye.amount_text,
1052
- detail: (We = a.metadata) == null ? void 0 : We.attachment_detail,
1053
- paymentStatus: (qe = a.metadata) == null ? void 0 : qe.payment_status,
1038
+ detail: (qe = a.metadata) == null ? void 0 : qe.attachment_detail,
1039
+ paymentStatus: (We = a.metadata) == null ? void 0 : We.payment_status,
1054
1040
  isUnlocking: I(a.id),
1055
1041
  onUnlockClick: () => w == null ? void 0 : w(a, x),
1056
1042
  onFetchSource: async () => await (E == null ? void 0 : E(a, x)),
1057
1043
  onDownloadClick: () => P == null ? void 0 : P(a, x)
1058
1044
  }
1059
1045
  ),
1060
- a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: y }) })
1046
+ a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: N }) })
1061
1047
  ] }) : xe ? (
1062
1048
  /* Tip-only messages render as a standalone bubble */
1063
- /* @__PURE__ */ e(Ne, { message: a, standalone: !0 })
1049
+ /* @__PURE__ */ e(_e, { message: a, standalone: !0 })
1064
1050
  ) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1065
1051
  /* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
1066
1052
  K && !Q && /* @__PURE__ */ e(
1067
- Ne,
1053
+ _e,
1068
1054
  {
1069
1055
  message: a,
1070
1056
  hasAttachment: X,
@@ -1079,17 +1065,17 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1079
1065
  attachments: j
1080
1066
  }
1081
1067
  ) : null,
1082
- R ? /* @__PURE__ */ e(
1068
+ L ? /* @__PURE__ */ e(
1083
1069
  te,
1084
1070
  {
1085
1071
  message: a,
1086
- renderText: y
1072
+ renderText: N
1087
1073
  }
1088
- ) : /* @__PURE__ */ e(Xe, { message: a, renderText: y }),
1074
+ ) : /* @__PURE__ */ e(Xe, { message: a, renderText: N }),
1089
1075
  /* @__PURE__ */ e(Kt, {})
1090
1076
  ] }),
1091
1077
  (!K || Q) && /* @__PURE__ */ e(
1092
- Ne,
1078
+ _e,
1093
1079
  {
1094
1080
  message: a,
1095
1081
  hasAttachment: X,
@@ -1100,8 +1086,8 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1100
1086
  ln,
1101
1087
  {
1102
1088
  selected: M,
1103
- onVoteUp: _,
1104
- onVoteDown: N
1089
+ onVoteUp: y,
1090
+ onVoteDown: _
1105
1091
  }
1106
1092
  )
1107
1093
  ] })
@@ -1190,7 +1176,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1190
1176
  "aria-label": "Send",
1191
1177
  disabled: s,
1192
1178
  onClick: t,
1193
- children: /* @__PURE__ */ e(bs, { weight: "bold", className: "size-4" })
1179
+ children: /* @__PURE__ */ e(xs, { weight: "bold", className: "size-4" })
1194
1180
  }
1195
1181
  ), bn = () => {
1196
1182
  var c;
@@ -1254,9 +1240,9 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1254
1240
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1255
1241
  }, wn = [
1256
1242
  "SYSTEM_AGE_SAFETY_BLOCKED"
1257
- ], Nn = {
1243
+ ], _n = {
1258
1244
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1259
- }, _e = "age safety guidelines.", _n = "https://linktr.ee/s/about/contact", at = (t) => xn.includes(t), yn = (t) => wn.includes(t), Cn = (t) => {
1245
+ }, ye = "age safety guidelines.", yn = "https://linktr.ee/s/about/contact", at = (t) => xn.includes(t), Nn = (t) => wn.includes(t), Cn = (t) => {
1260
1246
  var r;
1261
1247
  const s = (r = t.metadata) == null ? void 0 : r.custom_type;
1262
1248
  if (at(s))
@@ -1264,7 +1250,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1264
1250
  kind: "dm-agent",
1265
1251
  type: s
1266
1252
  };
1267
- if (yn(s))
1253
+ if (Nn(s))
1268
1254
  return {
1269
1255
  kind: "age-safety",
1270
1256
  type: s
@@ -1276,20 +1262,20 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1276
1262
  type: n
1277
1263
  };
1278
1264
  }, En = (t) => {
1279
- const s = t.indexOf(_e);
1265
+ const s = t.indexOf(ye);
1280
1266
  if (s === -1)
1281
1267
  return t;
1282
- const n = s + _e.length;
1268
+ const n = s + ye.length;
1283
1269
  return /* @__PURE__ */ d(ce, { children: [
1284
1270
  t.slice(0, s),
1285
1271
  /* @__PURE__ */ e(
1286
1272
  "a",
1287
1273
  {
1288
- href: _n,
1274
+ href: yn,
1289
1275
  target: "_blank",
1290
1276
  rel: "noopener noreferrer",
1291
1277
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1292
- children: _e
1278
+ children: ye
1293
1279
  }
1294
1280
  ),
1295
1281
  t.slice(n)
@@ -1326,7 +1312,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1326
1312
  ] });
1327
1313
  }
1328
1314
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1329
- const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Nn[n.type];
1315
+ const l = ((o = t.message.text) == null ? void 0 : o.trim()) || _n[n.type];
1330
1316
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1331
1317
  /* @__PURE__ */ d(
1332
1318
  "div",
@@ -1336,7 +1322,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1336
1322
  "data-age-safety-system-type": n.type,
1337
1323
  children: [
1338
1324
  /* @__PURE__ */ e(
1339
- ps,
1325
+ vs,
1340
1326
  {
1341
1327
  size: 24,
1342
1328
  weight: "duotone",
@@ -1360,7 +1346,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1360
1346
  ] }),
1361
1347
  !s && /* @__PURE__ */ e(ve, { message: t.message })
1362
1348
  ] });
1363
- }, ye = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
1349
+ }, Ne = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
1364
1350
  "animateTransform",
1365
1351
  {
1366
1352
  attributeName: "transform",
@@ -1371,7 +1357,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1371
1357
  repeatCount: "indefinite"
1372
1358
  }
1373
1359
  ) }), In = ({ threadList: t }) => {
1374
- var y;
1360
+ var N;
1375
1361
  const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = Me(), { typing: l = {} } = ls();
1376
1362
  if ((n == null ? void 0 : n.typing_events) === !1)
1377
1363
  return null;
@@ -1388,7 +1374,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1388
1374
  ) : [], m = t ? c : i;
1389
1375
  if (!m.length)
1390
1376
  return null;
1391
- const u = (y = m[0]) == null ? void 0 : y.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
1377
+ const u = (N = m[0]) == null ? void 0 : N.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
1392
1378
  return /* @__PURE__ */ d(
1393
1379
  "div",
1394
1380
  {
@@ -1416,9 +1402,9 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1416
1402
  height: "8",
1417
1403
  overflow: "visible",
1418
1404
  children: [
1419
- /* @__PURE__ */ e(ye, { cx: "4", index: 0 }),
1420
- /* @__PURE__ */ e(ye, { cx: "16", index: 1 }),
1421
- /* @__PURE__ */ e(ye, { cx: "28", index: 2 })
1405
+ /* @__PURE__ */ e(Ne, { cx: "4", index: 0 }),
1406
+ /* @__PURE__ */ e(Ne, { cx: "16", index: 1 }),
1407
+ /* @__PURE__ */ e(Ne, { cx: "28", index: 2 })
1422
1408
  ]
1423
1409
  }
1424
1410
  ) })
@@ -1428,7 +1414,7 @@ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1428
1414
  }, kn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ d(
1429
1415
  "div",
1430
1416
  {
1431
- className: L("flex items-center justify-center h-full", t),
1417
+ className: D("flex items-center justify-center h-full", t),
1432
1418
  children: [
1433
1419
  /* @__PURE__ */ d("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1434
1420
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1481,13 +1467,13 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1481
1467
  showStarButton: o = !1,
1482
1468
  dmAgentEnabled: l = !1
1483
1469
  }) => {
1484
- var v, a, y, b, C;
1470
+ var v, a, N, b, C;
1485
1471
  const { channel: i } = oe(), c = O.useMemo(() => Object.values(i.state.members || {}).find(
1486
1472
  (I) => {
1487
1473
  var w;
1488
1474
  return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== i._client.userID;
1489
1475
  }
1490
- ), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (y = c == null ? void 0 : c.user) == null ? void 0 : y.image, h = pt(i), f = async () => {
1476
+ ), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (N = c == null ? void 0 : c.user) == null ? void 0 : N.image, h = pt(i), f = async () => {
1491
1477
  try {
1492
1478
  h ? await i.unpin() : await i.pin();
1493
1479
  } catch (x) {
@@ -1551,7 +1537,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1551
1537
  children: /* @__PURE__ */ e(
1552
1538
  Ee,
1553
1539
  {
1554
- className: L("size-5", {
1540
+ className: D("size-5", {
1555
1541
  "text-yellow-600": h,
1556
1542
  "text-black/90": !h
1557
1543
  }),
@@ -1626,7 +1612,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1626
1612
  children: /* @__PURE__ */ e(
1627
1613
  Ee,
1628
1614
  {
1629
- className: L("size-5", {
1615
+ className: D("size-5", {
1630
1616
  "text-yellow-600": h,
1631
1617
  "text-black/90": !h
1632
1618
  }),
@@ -1663,40 +1649,40 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1663
1649
  chatbotVotingEnabled: f = !1,
1664
1650
  renderChannelBanner: v,
1665
1651
  customProfileContent: a,
1666
- customChannelActions: y,
1652
+ customChannelActions: N,
1667
1653
  renderMessage: b,
1668
1654
  dmAgentEnabled: C = !1
1669
1655
  }) => {
1670
1656
  var F, H;
1671
1657
  const { channel: x } = oe(), I = J(null), w = O.useMemo(() => Object.values(x.state.members || {}).find(
1672
- (B) => {
1658
+ (z) => {
1673
1659
  var S;
1674
- return ((S = B.user) == null ? void 0 : S.id) && B.user.id !== x._client.userID;
1660
+ return ((S = z.user) == null ? void 0 : S.id) && z.user.id !== x._client.userID;
1675
1661
  }
1676
- ), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((B) => {
1662
+ ), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((z) => {
1677
1663
  var S;
1678
- return ((S = B.user) == null ? void 0 : S.id) === x._client.userID;
1664
+ return ((S = z.user) == null ? void 0 : S.id) === x._client.userID;
1679
1665
  }), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
1680
- const D = x.data ?? {};
1681
- if (D.followerStatus)
1682
- return String(D.followerStatus);
1683
- if (D.isFollower !== void 0)
1684
- return D.isFollower ? "Subscribed to you" : "Not subscribed";
1666
+ const R = x.data ?? {};
1667
+ if (R.followerStatus)
1668
+ return String(R.followerStatus);
1669
+ if (R.isFollower !== void 0)
1670
+ return R.isFollower ? "Subscribed to you" : "Not subscribed";
1685
1671
  }, [x.data]), M = G(() => {
1686
- var D;
1687
- (D = I.current) == null || D.showModal();
1688
- }, []), _ = G(() => {
1689
- var D;
1690
- (D = I.current) == null || D.close();
1691
- }, []), N = G(
1692
- (D) => {
1693
- const { message: B } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...D, chatbotVotingEnabled: f });
1694
- return !b || !B ? S : b(S, B);
1672
+ var R;
1673
+ (R = I.current) == null || R.showModal();
1674
+ }, []), y = G(() => {
1675
+ var R;
1676
+ (R = I.current) == null || R.close();
1677
+ }, []), _ = G(
1678
+ (R) => {
1679
+ const { message: z } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...R, chatbotVotingEnabled: f });
1680
+ return !b || !z ? S : b(S, z);
1695
1681
  },
1696
1682
  [f, b]
1697
1683
  );
1698
1684
  return /* @__PURE__ */ d(ce, { children: [
1699
- /* @__PURE__ */ e(ds, { overrides: { Message: N }, children: /* @__PURE__ */ d(us, { children: [
1685
+ /* @__PURE__ */ e(ds, { overrides: { Message: _ }, children: /* @__PURE__ */ d(us, { children: [
1700
1686
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1701
1687
  Tn,
1702
1688
  {
@@ -1726,10 +1712,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1726
1712
  )
1727
1713
  ] }) }),
1728
1714
  /* @__PURE__ */ e(
1729
- qs,
1715
+ Zs,
1730
1716
  {
1731
1717
  dialogRef: I,
1732
- onClose: _,
1718
+ onClose: y,
1733
1719
  participant: w,
1734
1720
  channel: x,
1735
1721
  followerStatusLabel: T,
@@ -1740,11 +1726,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1740
1726
  onBlockParticipantClick: m,
1741
1727
  onReportParticipantClick: u,
1742
1728
  customProfileContent: a,
1743
- customChannelActions: y
1729
+ customChannelActions: N
1744
1730
  }
1745
1731
  )
1746
1732
  ] });
1747
- }, yt = O.memo(
1733
+ }, Nt = O.memo(
1748
1734
  ({
1749
1735
  channel: t,
1750
1736
  onBack: s,
@@ -1760,7 +1746,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1760
1746
  onBlockParticipantClick: f,
1761
1747
  onReportParticipantClick: v,
1762
1748
  dmAgentEnabled: a,
1763
- messageMetadata: y,
1749
+ messageMetadata: N,
1764
1750
  onMessageSent: b,
1765
1751
  showStarButton: C = !1,
1766
1752
  chatbotVotingEnabled: x = !1,
@@ -1771,29 +1757,29 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1771
1757
  sendButton: U
1772
1758
  }) => {
1773
1759
  const k = G(
1774
- async (T, M, _) => {
1760
+ async (T, M, y) => {
1775
1761
  var S;
1776
- const N = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !N, H = {
1762
+ const _ = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !_, H = {
1777
1763
  ...M,
1778
1764
  ...F && { silent: !0 },
1779
- ...y && {
1765
+ ...N && {
1780
1766
  metadata: {
1781
1767
  ...M.metadata ?? {},
1782
- ...y
1768
+ ...N
1783
1769
  }
1784
1770
  }
1785
- }, D = {
1786
- ..._,
1771
+ }, R = {
1772
+ ...y,
1787
1773
  ...F && { skip_push: !0 }
1788
- }, B = await t.sendMessage(H, D);
1789
- return b == null || b(B), B;
1774
+ }, z = await t.sendMessage(H, R);
1775
+ return b == null || b(z), z;
1790
1776
  },
1791
- [t, a, y, b]
1777
+ [t, a, N, b]
1792
1778
  );
1793
1779
  return /* @__PURE__ */ e(
1794
1780
  "div",
1795
1781
  {
1796
- className: L(
1782
+ className: D(
1797
1783
  "messaging-channel-view h-full flex flex-col",
1798
1784
  c
1799
1785
  ),
@@ -1804,7 +1790,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1804
1790
  MessageSystem: Sn,
1805
1791
  EmptyStateIndicator: m,
1806
1792
  LoadingIndicator: fe,
1807
- DateSeparator: Xs,
1793
+ DateSeparator: Js,
1808
1794
  TypingIndicator: In,
1809
1795
  doSendMessageRequest: k,
1810
1796
  ...U ? { SendButton: U } : {},
@@ -1837,7 +1823,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1837
1823
  );
1838
1824
  }
1839
1825
  );
1840
- yt.displayName = "ChannelView";
1826
+ Nt.displayName = "ChannelView";
1841
1827
  const Rn = ({ className: t }) => /* @__PURE__ */ d(
1842
1828
  "svg",
1843
1829
  {
@@ -2012,7 +1998,7 @@ const oa = ({
2012
1998
  channelListCustomEmptyStateIndicator: f,
2013
1999
  onDeleteConversationClick: v,
2014
2000
  onBlockParticipantClick: a,
2015
- onReportParticipantClick: y,
2001
+ onReportParticipantClick: N,
2016
2002
  dmAgentEnabled: b,
2017
2003
  messageMetadata: C,
2018
2004
  onMessageSent: x,
@@ -2026,64 +2012,64 @@ const oa = ({
2026
2012
  sendButton: M
2027
2013
  }) => {
2028
2014
  const {
2029
- service: _,
2030
- client: N,
2015
+ service: y,
2016
+ client: _,
2031
2017
  isConnected: F,
2032
2018
  isLoading: H,
2033
- error: D,
2034
- refreshConnection: B,
2019
+ error: R,
2020
+ refreshConnection: z,
2035
2021
  debug: S
2036
- } = Rs(), [$, V] = A(null), [ee, te] = A(!1), [W, g] = A(!1), [p, R] = A(!1), [j, Y] = A(null), {
2022
+ } = As(), [$, V] = A(null), [ee, te] = A(!1), [q, g] = A(!1), [p, L] = A(!1), [j, Y] = A(null), {
2037
2023
  showDeleteConversation: ae = !0
2038
2024
  } = t, de = O.useMemo(() => {
2039
- const z = N == null ? void 0 : N.userID;
2025
+ const B = _ == null ? void 0 : _.userID;
2040
2026
  return {
2041
2027
  ...{
2042
2028
  type: "messaging",
2043
2029
  last_message_at: { $exists: !0 },
2044
- ...z && {
2045
- members: { $in: [z] },
2030
+ ...B && {
2031
+ members: { $in: [B] },
2046
2032
  hidden: !1
2047
2033
  }
2048
2034
  },
2049
2035
  ...u
2050
2036
  };
2051
- }, [u, N == null ? void 0 : N.userID]), re = J(null), q = G(async () => {
2052
- if (!N || !F) return;
2053
- const z = N.userID;
2054
- if (z)
2037
+ }, [u, _ == null ? void 0 : _.userID]), re = J(null), W = G(async () => {
2038
+ if (!_ || !F) return;
2039
+ const B = _.userID;
2040
+ if (B)
2055
2041
  try {
2056
- S && console.log("[MessagingShell] Syncing channels for user:", z);
2057
- const X = await N.queryChannels(
2042
+ S && console.log("[MessagingShell] Syncing channels for user:", B);
2043
+ const X = await _.queryChannels(
2058
2044
  {
2059
2045
  type: "messaging",
2060
- members: { $in: [z] }
2046
+ members: { $in: [B] }
2061
2047
  },
2062
2048
  {},
2063
2049
  { limit: 100 }
2064
2050
  );
2065
- te(X.length > 0), g(!0), re.current = z, S && console.log("[MessagingShell] Channels synced successfully:", {
2051
+ te(X.length > 0), g(!0), re.current = B, S && console.log("[MessagingShell] Channels synced successfully:", {
2066
2052
  channelCount: X.length
2067
2053
  });
2068
2054
  } catch (X) {
2069
2055
  console.error("[MessagingShell] Failed to sync channels:", X);
2070
2056
  }
2071
- }, [N, F, S]);
2057
+ }, [_, F, S]);
2072
2058
  Z(() => {
2073
- if (!N || !F) return;
2074
- const z = N.userID;
2075
- z && re.current !== z && q();
2076
- }, [N, F, q]), Z(() => {
2077
- if (!l || !N || !F) return;
2059
+ if (!_ || !F) return;
2060
+ const B = _.userID;
2061
+ B && re.current !== B && W();
2062
+ }, [_, F, W]), Z(() => {
2063
+ if (!l || !_ || !F) return;
2078
2064
  (async () => {
2079
- const X = N.userID;
2065
+ const X = _.userID;
2080
2066
  if (X)
2081
2067
  try {
2082
2068
  S && console.log(
2083
2069
  "[MessagingShell] Loading initial conversation with:",
2084
2070
  l
2085
2071
  );
2086
- const Q = await N.queryChannels(
2072
+ const Q = await _.queryChannels(
2087
2073
  {
2088
2074
  type: "messaging",
2089
2075
  members: { $eq: [X, l] }
@@ -2092,23 +2078,23 @@ const oa = ({
2092
2078
  { limit: 1 }
2093
2079
  );
2094
2080
  if (Q.length > 0)
2095
- V(Q[0]), R(!0), Y(null), o && o(Q[0]), S && console.log(
2081
+ V(Q[0]), L(!0), Y(null), o && o(Q[0]), S && console.log(
2096
2082
  "[MessagingShell] Initial conversation loaded:",
2097
2083
  Q[0].id
2098
2084
  );
2099
- else if (i && _) {
2085
+ else if (i && y) {
2100
2086
  S && console.log(
2101
2087
  "[MessagingShell] No conversation found, creating one for:",
2102
2088
  i
2103
2089
  );
2104
2090
  try {
2105
- const se = await _.startChannelWithParticipant({
2091
+ const se = await y.startChannelWithParticipant({
2106
2092
  id: i.id,
2107
2093
  name: i.name,
2108
2094
  email: i.email,
2109
2095
  phone: i.phone
2110
2096
  });
2111
- V(se), R(!0), Y(null), o && o(se), S && console.log(
2097
+ V(se), L(!0), Y(null), o && o(se), S && console.log(
2112
2098
  "[MessagingShell] Channel created and loaded:",
2113
2099
  se.id
2114
2100
  );
@@ -2135,40 +2121,40 @@ const oa = ({
2135
2121
  }, [
2136
2122
  l,
2137
2123
  i,
2138
- N,
2139
- F,
2140
2124
  _,
2125
+ F,
2126
+ y,
2141
2127
  S,
2142
2128
  o
2143
2129
  ]);
2144
2130
  const ie = G(
2145
- (z) => {
2146
- V(z), o == null || o(z);
2131
+ (B) => {
2132
+ V(B), o == null || o(B);
2147
2133
  },
2148
2134
  [o]
2149
2135
  ), pe = G(() => {
2150
2136
  p || V(null);
2151
2137
  }, [p]), ue = G(
2152
- async (z) => {
2153
- S && console.log("[MessagingShell] Leaving conversation:", z.id), V(null), R(!1), re.current = null, await q();
2138
+ async (B) => {
2139
+ S && console.log("[MessagingShell] Leaving conversation:", B.id), V(null), L(!1), re.current = null, await W();
2154
2140
  },
2155
- [q, S]
2141
+ [W, S]
2156
2142
  ), xe = G(
2157
- async (z) => {
2158
- S && console.log("[MessagingShell] Blocking participant:", z), V(null), R(!1), re.current = null, await q();
2143
+ async (B) => {
2144
+ S && console.log("[MessagingShell] Blocking participant:", B), V(null), L(!1), re.current = null, await W();
2159
2145
  },
2160
- [q, S]
2146
+ [W, S]
2161
2147
  ), K = !!$;
2162
- return H ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : D ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(he, { message: D, onBack: B }) }) : !F || !N ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
2148
+ return H ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : R ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: R, onBack: z }) }) : !F || !_ ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
2163
2149
  he,
2164
2150
  {
2165
2151
  message: "Not connected to messaging service",
2166
- onBack: B
2152
+ onBack: z
2167
2153
  }
2168
- ) }) : j ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
2154
+ ) }) : j ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
2169
2155
  "div",
2170
2156
  {
2171
- className: L(
2157
+ className: D(
2172
2158
  "messaging-shell h-full bg-background-primary overflow-hidden",
2173
2159
  s
2174
2160
  ),
@@ -2176,7 +2162,7 @@ const oa = ({
2176
2162
  /* @__PURE__ */ e(
2177
2163
  "div",
2178
2164
  {
2179
- className: L(
2165
+ className: D(
2180
2166
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2181
2167
  {
2182
2168
  "!hidden": m === !1 || p,
@@ -2202,7 +2188,7 @@ const oa = ({
2202
2188
  /* @__PURE__ */ e(
2203
2189
  "div",
2204
2190
  {
2205
- className: L(
2191
+ className: D(
2206
2192
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2207
2193
  {
2208
2194
  // In direct conversation mode (or waiting for it), always show (full width)
@@ -2212,7 +2198,7 @@ const oa = ({
2212
2198
  }
2213
2199
  ),
2214
2200
  children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2215
- yt,
2201
+ Nt,
2216
2202
  {
2217
2203
  channel: $,
2218
2204
  onBack: pe,
@@ -2226,7 +2212,7 @@ const oa = ({
2226
2212
  showDeleteConversation: ae,
2227
2213
  onDeleteConversationClick: v,
2228
2214
  onBlockParticipantClick: a,
2229
- onReportParticipantClick: y,
2215
+ onReportParticipantClick: N,
2230
2216
  dmAgentEnabled: b,
2231
2217
  messageMetadata: C,
2232
2218
  onMessageSent: x,
@@ -2245,7 +2231,7 @@ const oa = ({
2245
2231
  Ct,
2246
2232
  {
2247
2233
  hasChannels: ee,
2248
- channelsLoaded: W
2234
+ channelsLoaded: q
2249
2235
  }
2250
2236
  )
2251
2237
  }
@@ -2265,7 +2251,7 @@ const oa = ({
2265
2251
  onClick: s,
2266
2252
  disabled: n,
2267
2253
  style: { backgroundColor: "#E6E5E3" },
2268
- className: L(
2254
+ className: D(
2269
2255
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
2270
2256
  {
2271
2257
  "hover:brightness-95 active:brightness-90": !n,
@@ -2336,18 +2322,18 @@ function Fn(t) {
2336
2322
  return s ? s[1] : "generic";
2337
2323
  }
2338
2324
  const On = {
2339
- video: ws,
2340
- audio: vs,
2341
- image: xs,
2325
+ video: ys,
2326
+ audio: _s,
2327
+ image: ws,
2342
2328
  document: ht
2343
2329
  }, Pn = {
2344
- pdf: ks,
2345
- doc: Is,
2346
- xls: Ss,
2347
- csv: Es,
2348
- ppt: Cs,
2349
- zip: ys,
2350
- text: _s,
2330
+ pdf: Ts,
2331
+ doc: Ms,
2332
+ xls: ks,
2333
+ csv: Is,
2334
+ ppt: Ss,
2335
+ zip: Es,
2336
+ text: Cs,
2351
2337
  markdown: Ns,
2352
2338
  generic: ht
2353
2339
  };
@@ -2358,10 +2344,10 @@ function Un(t) {
2358
2344
  function ge(t, s) {
2359
2345
  return O.createElement(Un(t), s);
2360
2346
  }
2361
- const Bn = (t) => {
2347
+ const zn = (t) => {
2362
2348
  var s, n;
2363
2349
  return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
2364
- }, zn = ({
2350
+ }, Bn = ({
2365
2351
  source: t,
2366
2352
  mimeType: s,
2367
2353
  poster: n,
@@ -2373,15 +2359,15 @@ const Bn = (t) => {
2373
2359
  muted: m = !1,
2374
2360
  onContainerClick: u
2375
2361
  }) => {
2376
- const h = be(s), f = J(null), v = J(null), a = J(null), y = J(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, _] = A(!1), [N, F] = A(!0), [H, D] = A(null), B = G(() => {
2362
+ const h = be(s), f = J(null), v = J(null), a = J(null), N = J(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, y] = A(!1), [_, F] = A(!0), [H, R] = A(null), z = G(() => {
2377
2363
  T(!1), C(!0);
2378
2364
  }, []), S = G((g) => {
2379
2365
  const p = v.current;
2380
2366
  if (!p) return 0;
2381
- const R = p.getBoundingClientRect();
2367
+ const L = p.getBoundingClientRect();
2382
2368
  return Math.max(
2383
2369
  0,
2384
- Math.min(1, (Bn(g) - R.left) / R.width)
2370
+ Math.min(1, (zn(g) - L.left) / L.width)
2385
2371
  );
2386
2372
  }, []), $ = G((g) => {
2387
2373
  const p = f.current;
@@ -2392,7 +2378,7 @@ const Bn = (t) => {
2392
2378
  I(p), $(p);
2393
2379
  };
2394
2380
  Z(() => {
2395
- o !== void 0 && o !== y.current && (y.current = o, C(o));
2381
+ o !== void 0 && o !== N.current && (N.current = o, C(o));
2396
2382
  }, [o]), Z(() => {
2397
2383
  if (!b) {
2398
2384
  a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
@@ -2412,14 +2398,14 @@ const Bn = (t) => {
2412
2398
  }) : g.pause());
2413
2399
  }, [b]), Z(() => {
2414
2400
  if (!w) return;
2415
- const g = (R) => I(S(R)), p = (R) => {
2416
- E(!1), $(S(R));
2401
+ const g = (L) => I(S(L)), p = (L) => {
2402
+ E(!1), $(S(L));
2417
2403
  };
2418
2404
  return window.addEventListener("mousemove", g), window.addEventListener("mouseup", p), window.addEventListener("touchmove", g, { passive: !0 }), window.addEventListener("touchend", p), () => {
2419
2405
  window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", p), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", p);
2420
2406
  };
2421
2407
  }, [w, S, $]);
2422
- const ee = H ? { aspectRatio: String(H) } : void 0, te = H ? "" : " aspect-video", W = Math.round(x * 100);
2408
+ const ee = H ? { aspectRatio: String(H) } : void 0, te = H ? "" : " aspect-video", q = Math.round(x * 100);
2423
2409
  return /* @__PURE__ */ d(
2424
2410
  "div",
2425
2411
  {
@@ -2444,7 +2430,7 @@ const Bn = (t) => {
2444
2430
  }
2445
2431
  },
2446
2432
  children: [
2447
- n && (h === "audio" || N) && /* @__PURE__ */ e(
2433
+ n && (h === "audio" || _) && /* @__PURE__ */ e(
2448
2434
  "img",
2449
2435
  {
2450
2436
  src: n,
@@ -2452,7 +2438,7 @@ const Bn = (t) => {
2452
2438
  className: "absolute inset-0 h-full w-full object-cover"
2453
2439
  }
2454
2440
  ),
2455
- !n && (h === "audio" || N) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(s, {
2441
+ !n && (h === "audio" || _) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(s, {
2456
2442
  className: "size-12 text-black/20",
2457
2443
  weight: "regular"
2458
2444
  }) }),
@@ -2464,11 +2450,11 @@ const Bn = (t) => {
2464
2450
  loop: l,
2465
2451
  muted: m,
2466
2452
  style: { width: "100%", height: "100%" },
2467
- onLoadStart: () => _(!0),
2453
+ onLoadStart: () => y(!0),
2468
2454
  onCanPlay: () => {
2469
- _(!1), F(!1);
2455
+ y(!1), F(!1);
2470
2456
  },
2471
- onWaiting: () => _(!0),
2457
+ onWaiting: () => y(!0),
2472
2458
  onPlay: () => T(!1),
2473
2459
  onEnded: () => {
2474
2460
  l || (C(!1), I(0));
@@ -2484,15 +2470,15 @@ const Bn = (t) => {
2484
2470
  muted: m,
2485
2471
  playsInline: !0,
2486
2472
  style: { width: "100%", height: "100%" },
2487
- onLoadStart: () => _(!0),
2473
+ onLoadStart: () => y(!0),
2488
2474
  onCanPlay: () => {
2489
- _(!1), F(!1);
2475
+ y(!1), F(!1);
2490
2476
  },
2491
- onWaiting: () => _(!0),
2477
+ onWaiting: () => y(!0),
2492
2478
  onPlay: () => T(!1),
2493
2479
  onLoadedMetadata: () => {
2494
2480
  const g = f.current;
2495
- g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && D(g.videoWidth / g.videoHeight);
2481
+ g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && R(g.videoWidth / g.videoHeight);
2496
2482
  },
2497
2483
  onEnded: () => {
2498
2484
  l || (C(!1), I(0));
@@ -2515,10 +2501,10 @@ const Bn = (t) => {
2515
2501
  tabIndex: 0,
2516
2502
  "aria-label": "Play preview",
2517
2503
  onClick: (g) => {
2518
- g.stopPropagation(), B();
2504
+ g.stopPropagation(), z();
2519
2505
  },
2520
2506
  onKeyDown: (g) => {
2521
- g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), B());
2507
+ g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), z());
2522
2508
  },
2523
2509
  children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
2524
2510
  }
@@ -2528,7 +2514,7 @@ const Bn = (t) => {
2528
2514
  {
2529
2515
  role: "slider",
2530
2516
  "aria-label": "Playback position",
2531
- "aria-valuenow": W,
2517
+ "aria-valuenow": q,
2532
2518
  "aria-valuemin": 0,
2533
2519
  "aria-valuemax": 100,
2534
2520
  tabIndex: 0,
@@ -2544,7 +2530,7 @@ const Bn = (t) => {
2544
2530
  "div",
2545
2531
  {
2546
2532
  className: "h-full rounded-full bg-white",
2547
- style: { width: `${W}%` }
2533
+ style: { width: `${q}%` }
2548
2534
  }
2549
2535
  ) })
2550
2536
  }
@@ -2559,7 +2545,7 @@ const Bn = (t) => {
2559
2545
  },
2560
2546
  className: "shrink-0 text-white",
2561
2547
  "aria-label": b ? "Pause" : "Play",
2562
- children: b ? /* @__PURE__ */ e(Ms, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
2548
+ children: b ? /* @__PURE__ */ e(Ds, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
2563
2549
  }
2564
2550
  ),
2565
2551
  /* @__PURE__ */ d(
@@ -2567,7 +2553,7 @@ const Bn = (t) => {
2567
2553
  {
2568
2554
  role: "slider",
2569
2555
  "aria-label": "Playback position",
2570
- "aria-valuenow": W,
2556
+ "aria-valuenow": q,
2571
2557
  "aria-valuemin": 0,
2572
2558
  "aria-valuemax": 100,
2573
2559
  tabIndex: 0,
@@ -2590,7 +2576,7 @@ const Bn = (t) => {
2590
2576
  "div",
2591
2577
  {
2592
2578
  className: "h-full rounded-full bg-white",
2593
- style: { width: `${W}%` }
2579
+ style: { width: `${q}%` }
2594
2580
  }
2595
2581
  )
2596
2582
  }
@@ -2599,7 +2585,7 @@ const Bn = (t) => {
2599
2585
  "div",
2600
2586
  {
2601
2587
  className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2602
- style: { left: `${W}%` }
2588
+ style: { left: `${q}%` }
2603
2589
  }
2604
2590
  )
2605
2591
  ]
@@ -2620,7 +2606,7 @@ const Bn = (t) => {
2620
2606
  }) => {
2621
2607
  const c = be(t), [m, u] = A(!1);
2622
2608
  return s && (c === "video" || c === "audio") ? /* @__PURE__ */ e(
2623
- zn,
2609
+ Bn,
2624
2610
  {
2625
2611
  source: s,
2626
2612
  mimeType: t,
@@ -2703,13 +2689,13 @@ const Bn = (t) => {
2703
2689
  rootRef: h,
2704
2690
  "data-testid": f
2705
2691
  }) => {
2706
- const v = t === "dark", a = v ? n ?? r : n ?? "", y = v && !n;
2692
+ const v = t === "dark", a = v ? n ?? r : n ?? "", N = v && !n;
2707
2693
  return /* @__PURE__ */ d(
2708
2694
  "div",
2709
2695
  {
2710
2696
  ref: h,
2711
2697
  "data-testid": f,
2712
- className: L(
2698
+ className: D(
2713
2699
  "relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
2714
2700
  v ? "bg-[#121110]" : "bg-white"
2715
2701
  ),
@@ -2721,17 +2707,17 @@ const Bn = (t) => {
2721
2707
  a.trim() !== "" && /* @__PURE__ */ e(
2722
2708
  "p",
2723
2709
  {
2724
- className: L("mb-0.5 truncate text-base font-medium", {
2710
+ className: D("mb-0.5 truncate text-base font-medium", {
2725
2711
  "text-black": !v,
2726
- "text-white/30": v && y,
2727
- "text-white": v && !y
2712
+ "text-white/30": v && N,
2713
+ "text-white": v && !N
2728
2714
  }),
2729
2715
  children: a
2730
2716
  }
2731
2717
  ),
2732
2718
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
2733
2719
  ge(o, {
2734
- className: L(
2720
+ className: D(
2735
2721
  "size-5 shrink-0",
2736
2722
  v ? "text-white/55" : "text-black/55"
2737
2723
  ),
@@ -2740,7 +2726,7 @@ const Bn = (t) => {
2740
2726
  l != null && l !== "" && /* @__PURE__ */ e(
2741
2727
  "span",
2742
2728
  {
2743
- className: L(
2729
+ className: D(
2744
2730
  "text-xs font-medium",
2745
2731
  v ? "text-white/55" : "text-black/55"
2746
2732
  ),
@@ -2789,7 +2775,7 @@ const Le = ({ attachment: t, isMyMessage: s }) => {
2789
2775
  "div",
2790
2776
  {
2791
2777
  className: `aspect-video w-full rounded-[20px] ${jn(s)} flex items-center justify-center`,
2792
- children: /* @__PURE__ */ e(Ts, { className: `size-12 ${Yn(s)}` })
2778
+ children: /* @__PURE__ */ e(Rs, { className: `size-12 ${Yn(s)}` })
2793
2779
  }
2794
2780
  ) }),
2795
2781
  /* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
@@ -2806,7 +2792,7 @@ function Ae(t) {
2806
2792
  (n) => n.type === "link" || !!n.og_scrape_url && !n.asset_url
2807
2793
  );
2808
2794
  }
2809
- async function Wn(t, s) {
2795
+ async function qn(t, s) {
2810
2796
  let n;
2811
2797
  try {
2812
2798
  n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
@@ -2818,7 +2804,7 @@ async function Wn(t, s) {
2818
2804
  const o = await r.blob(), l = URL.createObjectURL(o), i = document.createElement("a");
2819
2805
  i.href = l, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(l);
2820
2806
  }
2821
- const qn = ({
2807
+ const Wn = ({
2822
2808
  url: t,
2823
2809
  filename: s
2824
2810
  }) => {
@@ -2830,7 +2816,7 @@ const qn = ({
2830
2816
  onClick: (l) => {
2831
2817
  l.stopPropagation();
2832
2818
  const i = window.open("", "_blank", "noopener,noreferrer");
2833
- r(!0), Wn(t, s).then(() => {
2819
+ r(!0), qn(t, s).then(() => {
2834
2820
  i == null || i.close();
2835
2821
  }).catch(() => {
2836
2822
  i && (i.location.href = t);
@@ -2839,21 +2825,21 @@ const qn = ({
2839
2825
  disabled: n,
2840
2826
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
2841
2827
  children: n ? /* @__PURE__ */ e(ft, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
2842
- /* @__PURE__ */ e(Ds, { className: "size-4 text-white", weight: "bold" }),
2828
+ /* @__PURE__ */ e(Ls, { className: "size-4 text-white", weight: "bold" }),
2843
2829
  "Download"
2844
2830
  ] })
2845
2831
  }
2846
2832
  );
2847
2833
  };
2848
2834
  function Fe(t) {
2849
- var f, v, a, y;
2835
+ var f, v, a, N;
2850
2836
  const s = (f = t.attachments) == null ? void 0 : f.find(
2851
2837
  (b) => b.type === "video" && b.asset_url
2852
2838
  ), n = (v = t.attachments) == null ? void 0 : v.find(
2853
2839
  (b) => b.type === "image" && b.image_url
2854
2840
  ), r = (a = t.attachments) == null ? void 0 : a.find(
2855
2841
  (b) => b.type === "audio" && b.asset_url
2856
- ), o = (y = t.attachments) == null ? void 0 : y.find(
2842
+ ), o = (N = t.attachments) == null ? void 0 : N.find(
2857
2843
  (b) => b.type === "file" && b.asset_url
2858
2844
  ), l = s ?? n ?? r ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (r == null ? void 0 : r.asset_url) ?? (o == null ? void 0 : o.asset_url);
2859
2845
  if (!i) return null;
@@ -2920,7 +2906,7 @@ const kt = ({
2920
2906
  containedImage: l === "image" || l === "document"
2921
2907
  }
2922
2908
  ),
2923
- action: /* @__PURE__ */ e(qn, { url: t, filename: n })
2909
+ action: /* @__PURE__ */ e(Wn, { url: t, filename: n })
2924
2910
  }
2925
2911
  );
2926
2912
  }, Xn = ({
@@ -2984,17 +2970,17 @@ export {
2984
2970
  me as b,
2985
2971
  ne as c,
2986
2972
  wt as d,
2987
- yt as e,
2973
+ Nt as e,
2988
2974
  ia as f,
2989
2975
  Ln as g,
2990
2976
  ln as h,
2991
2977
  ra as i,
2992
2978
  oa as j,
2993
- Ps as k,
2979
+ zs as k,
2994
2980
  Fe as l,
2995
- Js as m,
2996
- Rs as n,
2981
+ Qs as m,
2982
+ As as n,
2997
2983
  Ae as r,
2998
- an as u
2984
+ on as u
2999
2985
  };
3000
- //# sourceMappingURL=index-j4j9UfK1.js.map
2986
+ //# sourceMappingURL=index-DY-3-rt4.js.map