@linktr.ee/messaging-react 3.1.0 → 3.1.1

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.
Files changed (28) hide show
  1. package/dist/{Card-Cq-cN9n1.cjs → Card-Bh-xdrvU.cjs} +2 -2
  2. package/dist/{Card-Cq-cN9n1.cjs.map → Card-Bh-xdrvU.cjs.map} +1 -1
  3. package/dist/{Card-BfvsO78k.js → Card-Bm_eCczn.js} +3 -3
  4. package/dist/{Card-BfvsO78k.js.map → Card-Bm_eCczn.js.map} +1 -1
  5. package/dist/{Card-NPXVehHb.cjs → Card-C33YVsqY.cjs} +2 -2
  6. package/dist/{Card-NPXVehHb.cjs.map → Card-C33YVsqY.cjs.map} +1 -1
  7. package/dist/{Card-BhO5jeP9.js → Card-C8Q8MH6Y.js} +2 -2
  8. package/dist/{Card-BhO5jeP9.js.map → Card-C8Q8MH6Y.js.map} +1 -1
  9. package/dist/{Card-BGOWR4lW.js → Card-D8QPP3I9.js} +2 -2
  10. package/dist/{Card-BGOWR4lW.js.map → Card-D8QPP3I9.js.map} +1 -1
  11. package/dist/{Card-CRJ4l5KM.cjs → Card-DO7ipVZF.cjs} +2 -2
  12. package/dist/{Card-CRJ4l5KM.cjs.map → Card-DO7ipVZF.cjs.map} +1 -1
  13. package/dist/{LockedThumbnail-Bu9jNPUi.js → LockedThumbnail-6Ykc8JiU.js} +2 -2
  14. package/dist/{LockedThumbnail-Bu9jNPUi.js.map → LockedThumbnail-6Ykc8JiU.js.map} +1 -1
  15. package/dist/{LockedThumbnail-B8MKBVXz.cjs → LockedThumbnail-yEutwXEz.cjs} +2 -2
  16. package/dist/{LockedThumbnail-B8MKBVXz.cjs.map → LockedThumbnail-yEutwXEz.cjs.map} +1 -1
  17. package/dist/{index-CJEl_fID.js → index-Cj6b1oEe.js} +383 -373
  18. package/dist/index-Cj6b1oEe.js.map +1 -0
  19. package/dist/index-DluSX5DB.cjs +2 -0
  20. package/dist/index-DluSX5DB.cjs.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +1 -1
  23. package/package.json +1 -1
  24. package/src/components/MessagingShell/MessagingShell.test.tsx +93 -0
  25. package/src/components/MessagingShell/index.tsx +46 -4
  26. package/dist/index-CJEl_fID.js.map +0 -1
  27. package/dist/index-D-5Igybf.cjs +0 -2
  28. package/dist/index-D-5Igybf.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { jsx as n, jsxs as h, Fragment as ne } from "react/jsx-runtime";
2
- import z, { createContext as He, useContext as Se, useCallback as q, useState as O, useRef as K, useEffect as J, useMemo as te, Suspense as Ye } from "react";
1
+ import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
2
+ import z, { createContext as He, useContext as Se, useCallback as q, useState as O, useRef as X, useEffect as J, useMemo as ne, Suspense as Ye } from "react";
3
3
  import { StreamChatService as In } from "@linktr.ee/messaging-core";
4
4
  import { Chat as Sn, DateSeparator as Tn, useChannelStateContext as de, useChatContext as qe, areMessageUIPropsEqual as An, useMessageReminder as Mn, useComponentContext as Ut, Attachment as Dn, EditMessageModal as Rn, MessageBlocked as Ln, MessageBouncePrompt as Pn, MessageDeleted as On, MessageIsThreadReplyInChannelButtonIndicator as zn, MessageRepliesCountButton as Fn, ReminderNotification as $n, StreamedMessageText as Bn, messageHasAttachments as jn, messageHasReactions as Vn, isDateSeparatorMessage as Un, isMessageBlocked as Gn, isMessageBounced as Hn, MessageBounceModal as Yn, MessageText as Mt, Poll as qn, MessageErrorIcon as Wn, useMessageContext as be, useMessageComposer as Xn, useStateStore as Kn, MessageInput as Jn, useMessageInputContext as Zn, useMessageComposerHasSendableData as Qn, AttachmentPreviewList as es, QuotedMessagePreview as ts, TextareaComposer as ns, MessageTimestamp as De, AIStates as Re, useTypingContext as ss, useAIState as as, Channel as rs, WithComponents as is, Window as os, MessageList as ls, ChannelList as cs } from "stream-chat-react";
5
5
  import { StarIcon as $e, XIcon as pe, SpinnerGapIcon as Le, SignOutIcon as ds, ProhibitInsetIcon as Dt, FlagIcon as Gt, FileIcon as Ht, ImageIcon as us, SpeakerHighIcon as ms, VideoCameraIcon as Yt, FileMdIcon as hs, FileTextIcon as fs, FileZipIcon as gs, FilePptIcon as bs, FileCsvIcon as ps, FileXlsIcon as vs, FileDocIcon as xs, FilePdfIcon as ws, CircleNotchIcon as fe, PlayIcon as Be, PauseIcon as Ns, LinkIcon as _s, DownloadSimpleIcon as ge, GiftIcon as ys, ThumbsUpIcon as Cs, ThumbsDownIcon as ks, TrashSimpleIcon as Es, ArrowUpIcon as Is, SparkleIcon as je, ProhibitIcon as Ss, ArrowLeftIcon as Rt, CaretRightIcon as Ve, DotsThreeIcon as Lt, PencilSimpleIcon as Ts, CaretLeftIcon as As } from "@phosphor-icons/react";
@@ -36,14 +36,14 @@ const Wt = He({
36
36
  serviceConfig: !!s,
37
37
  capabilities: Object.keys(r)
38
38
  });
39
- const [l, d] = O(null), [m, g] = O(null), [u, f] = O(!1), [c, b] = O(!1), [N, v] = O(null), x = K(!1), w = K({
39
+ const [l, d] = O(null), [m, g] = O(null), [u, f] = O(!1), [c, p] = O(!1), [N, v] = O(null), x = X(!1), w = X({
40
40
  userId: t == null ? void 0 : t.id,
41
41
  apiKey: a,
42
42
  serviceConfig: s,
43
43
  capabilities: r
44
- }), M = K(0);
45
- M.current++, o("📊 RENDER INFO", {
46
- renderCount: M.current,
44
+ }), A = X(0);
45
+ A.current++, o("📊 RENDER INFO", {
46
+ renderCount: A.current,
47
47
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
48
48
  propChanges: {
49
49
  userChanged: w.current.userId !== (t == null ? void 0 : t.id),
@@ -57,7 +57,7 @@ const Wt = He({
57
57
  serviceConfig: s,
58
58
  capabilities: r
59
59
  }, J(() => {
60
- const I = M.current;
60
+ const I = A.current;
61
61
  if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
62
62
  renderCount: I,
63
63
  apiKey: !!a,
@@ -95,7 +95,7 @@ const Wt = He({
95
95
  }), C.disconnectUser().catch(console.error);
96
96
  };
97
97
  }, [a, s, i, o]);
98
- const A = K(null);
98
+ const T = X(null);
99
99
  J(() => {
100
100
  var C, k;
101
101
  if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
@@ -113,7 +113,7 @@ const Wt = He({
113
113
  o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
114
114
  return;
115
115
  }
116
- if (((C = A.current) == null ? void 0 : C.serviceId) === l && ((k = A.current) == null ? void 0 : k.userId) === t.id) {
116
+ if (((C = T.current) == null ? void 0 : C.serviceId) === l && ((k = T.current) == null ? void 0 : k.userId) === t.id) {
117
117
  o(
118
118
  "⚠️ USER CONNECTION SKIPPED",
119
119
  "Already connected this user with this service"
@@ -121,11 +121,11 @@ const Wt = He({
121
121
  return;
122
122
  }
123
123
  (async () => {
124
- o("🚀 STARTING USER CONNECTION", { userId: t.id }), x.current = !0, b(!0), v(null);
124
+ o("🚀 STARTING USER CONNECTION", { userId: t.id }), x.current = !0, p(!0), v(null);
125
125
  try {
126
126
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
127
127
  const E = await l.connectUser(t);
128
- g(E), f(!0), A.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
128
+ g(E), f(!0), T.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
129
129
  userId: t.id,
130
130
  clientId: E.userID
131
131
  });
@@ -136,7 +136,7 @@ const Wt = He({
136
136
  error: D
137
137
  });
138
138
  } finally {
139
- b(!1), x.current = !1, o("🔄 USER CONNECTION FINISHED", {
139
+ p(!1), x.current = !1, o("🔄 USER CONNECTION FINISHED", {
140
140
  userId: t.id,
141
141
  isConnected: u
142
142
  });
@@ -149,7 +149,7 @@ const Wt = He({
149
149
  l && u ? (o(
150
150
  "🧹 CLEANUP EFFECT TRIGGERED",
151
151
  "Cleaning up connection on unmount"
152
- ), A.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
152
+ ), T.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
153
153
  hasService: !!l,
154
154
  isConnected: u
155
155
  });
@@ -162,7 +162,7 @@ const Wt = He({
162
162
  o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
163
163
  return;
164
164
  }
165
- o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
165
+ o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), p(!0);
166
166
  try {
167
167
  o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
168
168
  const I = await l.connectUser(t);
@@ -174,9 +174,9 @@ const Wt = He({
174
174
  error: C
175
175
  });
176
176
  } finally {
177
- b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
177
+ p(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
178
178
  }
179
- }, [l, t, o]), L = z.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
179
+ }, [l, t, o]), R = z.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
180
180
  hasService: !!l,
181
181
  hasClient: !!m,
182
182
  isConnected: u,
@@ -204,10 +204,10 @@ const Wt = He({
204
204
  o
205
205
  ]);
206
206
  return o("🔄 RENDER END", {
207
- renderCount: M.current,
207
+ renderCount: A.current,
208
208
  willRenderChat: !!(m && u),
209
- contextValueReady: !!L
210
- }), /* @__PURE__ */ n(Wt.Provider, { value: L, children: m && u ? /* @__PURE__ */ n(
209
+ contextValueReady: !!R
210
+ }), /* @__PURE__ */ n(Wt.Provider, { value: R, children: m && u ? /* @__PURE__ */ n(
211
211
  Sn,
212
212
  {
213
213
  client: m,
@@ -290,7 +290,7 @@ function Os(e) {
290
290
  const s = Ps(e) % zt.length;
291
291
  return zt[s];
292
292
  }
293
- const se = ({
293
+ const ae = ({
294
294
  id: e,
295
295
  image: t,
296
296
  size: s = 40,
@@ -421,21 +421,21 @@ const $s = ({
421
421
  onDeleteConversationClick: u,
422
422
  onBlockParticipantClick: f,
423
423
  onReportParticipantClick: c,
424
- customProfileContent: b,
424
+ customProfileContent: p,
425
425
  customChannelActions: N
426
426
  }) => {
427
- var B, H, W, $;
428
- const { service: v, debug: x } = We(), [w, M] = O(!1), [A, S] = O(!1), [L, I] = O(!1), C = q(async () => {
429
- var p;
430
- if (!(!m || !v || !((p = s == null ? void 0 : s.user) != null && p.id)))
427
+ var B, H, Y, $;
428
+ const { service: v, debug: x } = We(), [w, A] = O(!1), [T, S] = O(!1), [R, I] = O(!1), C = q(async () => {
429
+ var b;
430
+ if (!(!m || !v || !((b = s == null ? void 0 : s.user) != null && b.id)))
431
431
  try {
432
- const R = (await v.getBlockedUsers()).some(
433
- (T) => {
434
- var j;
435
- return T.blocked_user_id === ((j = s == null ? void 0 : s.user) == null ? void 0 : j.id);
432
+ const L = (await v.getBlockedUsers()).some(
433
+ (M) => {
434
+ var W;
435
+ return M.blocked_user_id === ((W = s == null ? void 0 : s.user) == null ? void 0 : W.id);
436
436
  }
437
437
  );
438
- M(R);
438
+ A(L);
439
439
  } catch (_) {
440
440
  console.error(
441
441
  "[ChannelInfoDialog] Failed to check blocked status:",
@@ -447,11 +447,11 @@ const $s = ({
447
447
  C();
448
448
  }, [C]);
449
449
  const k = async () => {
450
- var p;
451
- if (!A) {
450
+ var b;
451
+ if (!T) {
452
452
  u == null || u(), x && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
453
453
  try {
454
- const _ = ((p = r._client) == null ? void 0 : p.userID) ?? null;
454
+ const _ = ((b = r._client) == null ? void 0 : b.userID) ?? null;
455
455
  await r.hide(_, !1), o && await o(r), t();
456
456
  } catch (_) {
457
457
  console.error("[ChannelInfoDialog] Failed to leave conversation", _);
@@ -460,25 +460,25 @@ const $s = ({
460
460
  }
461
461
  }
462
462
  }, E = async () => {
463
- var p, _, R;
464
- if (!(L || !v)) {
465
- f == null || f(), x && console.log("[ChannelInfoDialog] Block member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), I(!0);
463
+ var b, _, L;
464
+ if (!(R || !v)) {
465
+ f == null || f(), x && console.log("[ChannelInfoDialog] Block member", (b = s == null ? void 0 : s.user) == null ? void 0 : b.id), I(!0);
466
466
  try {
467
- await v.blockUser((_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), l && await l((R = s == null ? void 0 : s.user) == null ? void 0 : R.id), t();
468
- } catch (T) {
469
- console.error("[ChannelInfoDialog] Failed to block member", T);
467
+ await v.blockUser((_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
468
+ } catch (M) {
469
+ console.error("[ChannelInfoDialog] Failed to block member", M);
470
470
  } finally {
471
471
  I(!1);
472
472
  }
473
473
  }
474
474
  }, D = async () => {
475
- var p, _, R;
476
- if (!(L || !v)) {
477
- f == null || f(), x && console.log("[ChannelInfoDialog] Unblock member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), I(!0);
475
+ var b, _, L;
476
+ if (!(R || !v)) {
477
+ f == null || f(), x && console.log("[ChannelInfoDialog] Unblock member", (b = s == null ? void 0 : s.user) == null ? void 0 : b.id), I(!0);
478
478
  try {
479
- await v.unBlockUser((_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), l && await l((R = s == null ? void 0 : s.user) == null ? void 0 : R.id), t();
480
- } catch (T) {
481
- console.error("[ChannelInfoDialog] Failed to unblock member", T);
479
+ await v.unBlockUser((_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
480
+ } catch (M) {
481
+ console.error("[ChannelInfoDialog] Failed to unblock member", M);
482
482
  } finally {
483
483
  I(!1);
484
484
  }
@@ -491,7 +491,7 @@ const $s = ({
491
491
  );
492
492
  };
493
493
  if (!s) return null;
494
- const F = a ?? Te(s.user), X = (H = s.user) == null ? void 0 : H.image, U = (W = s.user) == null ? void 0 : W.username, G = U ? `linktr.ee/${U}` : void 0, P = (($ = s.user) == null ? void 0 : $.id) || "unknown";
494
+ const F = a ?? Te(s.user), Z = (H = s.user) == null ? void 0 : H.image, U = (Y = s.user) == null ? void 0 : Y.username, G = U ? `linktr.ee/${U}` : void 0, P = (($ = s.user) == null ? void 0 : $.id) || "unknown";
495
495
  return (
496
496
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
497
497
  /* @__PURE__ */ n(
@@ -500,8 +500,8 @@ const $s = ({
500
500
  ref: e,
501
501
  className: "mes-dialog group",
502
502
  onClose: t,
503
- onClick: (p) => {
504
- p.target === e.current && t();
503
+ onClick: (b) => {
504
+ b.target === e.current && t();
505
505
  },
506
506
  children: /* @__PURE__ */ h("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: [
507
507
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
@@ -517,11 +517,11 @@ const $s = ({
517
517
  children: [
518
518
  /* @__PURE__ */ h("div", { className: "flex items-center gap-3 w-full", children: [
519
519
  /* @__PURE__ */ n(
520
- se,
520
+ ae,
521
521
  {
522
522
  id: P,
523
523
  name: F,
524
- image: X,
524
+ image: Z,
525
525
  size: 88,
526
526
  shape: "circle"
527
527
  }
@@ -529,7 +529,7 @@ const $s = ({
529
529
  /* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 flex-1", children: [
530
530
  /* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: F }),
531
531
  G && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: G }),
532
- i && !b && /* @__PURE__ */ n(
532
+ i && !p && /* @__PURE__ */ n(
533
533
  "span",
534
534
  {
535
535
  className: "mt-1 rounded-full text-xs font-normal w-fit",
@@ -545,7 +545,7 @@ const $s = ({
545
545
  )
546
546
  ] })
547
547
  ] }),
548
- b && /* @__PURE__ */ n("div", { className: "w-full", children: b })
548
+ p && /* @__PURE__ */ n("div", { className: "w-full", children: p })
549
549
  ]
550
550
  }
551
551
  ),
@@ -554,10 +554,10 @@ const $s = ({
554
554
  ye,
555
555
  {
556
556
  onClick: k,
557
- disabled: A,
558
- "aria-busy": A,
557
+ disabled: T,
558
+ "aria-busy": T,
559
559
  children: [
560
- A ? /* @__PURE__ */ n(Le, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(ds, { className: "h-5 w-5" }),
560
+ T ? /* @__PURE__ */ n(Le, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(ds, { className: "h-5 w-5" }),
561
561
  /* @__PURE__ */ n("span", { children: "Delete Conversation" })
562
562
  ]
563
563
  }
@@ -566,10 +566,10 @@ const $s = ({
566
566
  ye,
567
567
  {
568
568
  onClick: D,
569
- disabled: L,
570
- "aria-busy": L,
569
+ disabled: R,
570
+ "aria-busy": R,
571
571
  children: [
572
- L ? /* @__PURE__ */ n(Le, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
572
+ R ? /* @__PURE__ */ n(Le, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
573
573
  /* @__PURE__ */ n("span", { children: "Unblock" })
574
574
  ]
575
575
  }
@@ -577,10 +577,10 @@ const $s = ({
577
577
  ye,
578
578
  {
579
579
  onClick: E,
580
- disabled: L,
581
- "aria-busy": L,
580
+ disabled: R,
581
+ "aria-busy": R,
582
582
  children: [
583
- L ? /* @__PURE__ */ n(Le, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
583
+ R ? /* @__PURE__ */ n(Le, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Dt, { className: "h-5 w-5" }),
584
584
  /* @__PURE__ */ n("span", { children: "Block" })
585
585
  ]
586
586
  }
@@ -601,7 +601,7 @@ function js(e) {
601
601
  return e != null && e.length ? e.some((t) => t.type === Ge) ? "down" : e.some((t) => t.type === Ue) ? "up" : null : null;
602
602
  }
603
603
  function Vs(e) {
604
- const { channel: t } = de(), { client: s } = qe("useMessageVote"), a = te(
604
+ const { channel: t } = de(), { client: s } = qe("useMessageVote"), a = ne(
605
605
  () => js(e.own_reactions),
606
606
  [e.own_reactions]
607
607
  ), r = q(async () => {
@@ -638,7 +638,7 @@ function Kt({
638
638
  const s = e == null ? void 0 : e.text, a = Us(t);
639
639
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
640
640
  }
641
- const Gs = z.lazy(() => import("./Card-BGOWR4lW.js")), Hs = z.lazy(() => import("./Card-BhO5jeP9.js")), Ys = z.lazy(() => import("./Card-BfvsO78k.js")), Xe = () => /* @__PURE__ */ n(
641
+ const Gs = z.lazy(() => import("./Card-D8QPP3I9.js")), Hs = z.lazy(() => import("./Card-C8Q8MH6Y.js")), Ys = z.lazy(() => import("./Card-Bm_eCczn.js")), Xe = () => /* @__PURE__ */ n(
642
642
  "div",
643
643
  {
644
644
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
@@ -654,7 +654,7 @@ const Gs = z.lazy(() => import("./Card-BGOWR4lW.js")), Hs = z.lazy(() => import(
654
654
  [/plain|rtf/, "text"],
655
655
  [/markdown/, "markdown"]
656
656
  ];
657
- function ae(e) {
657
+ function re(e) {
658
658
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
659
659
  }
660
660
  function Qt(e) {
@@ -680,7 +680,7 @@ const Js = {
680
680
  generic: Ht
681
681
  };
682
682
  function Qs(e) {
683
- const t = ae(e);
683
+ const t = re(e);
684
684
  return t !== "document" ? Js[t] : Zs[Qt(e)];
685
685
  }
686
686
  function ce(e, t) {
@@ -701,71 +701,71 @@ const ea = (e) => {
701
701
  muted: d = !1,
702
702
  onContainerClick: m
703
703
  }) => {
704
- const g = ae(t), u = K(null), f = K(null), c = K(null), b = K(r), [N, v] = O(a), [x, w] = O(0), [M, A] = O(!1), [S, L] = O(!1), [I, C] = O(!1), [k, E] = O(!1), [D, V] = O(!0), [F, X] = O(null), U = q(() => {
704
+ const g = re(t), u = X(null), f = X(null), c = X(null), p = X(r), [N, v] = O(a), [x, w] = O(0), [A, T] = O(!1), [S, R] = O(!1), [I, C] = O(!1), [k, E] = O(!1), [D, V] = O(!0), [F, Z] = O(null), U = q(() => {
705
705
  C(!1), v(!0);
706
- }, []), G = q((p) => {
706
+ }, []), G = q((b) => {
707
707
  const _ = f.current;
708
708
  if (!_) return 0;
709
- const R = _.getBoundingClientRect();
709
+ const L = _.getBoundingClientRect();
710
710
  return Math.max(
711
711
  0,
712
- Math.min(1, (ea(p) - R.left) / R.width)
712
+ Math.min(1, (ea(b) - L.left) / L.width)
713
713
  );
714
- }, []), P = q((p) => {
714
+ }, []), P = q((b) => {
715
715
  const _ = u.current;
716
- _ && _.duration && (_.currentTime = p * _.duration);
717
- }, []), B = (p) => {
718
- p.stopPropagation(), A(!0);
719
- const _ = G(p);
716
+ _ && _.duration && (_.currentTime = b * _.duration);
717
+ }, []), B = (b) => {
718
+ b.stopPropagation(), T(!0);
719
+ const _ = G(b);
720
720
  w(_), P(_);
721
721
  };
722
722
  J(() => {
723
- r !== void 0 && r !== b.current && (b.current = r, v(r));
723
+ r !== void 0 && r !== p.current && (p.current = r, v(r));
724
724
  }, [r]), J(() => {
725
725
  if (!N) {
726
726
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
727
727
  return;
728
728
  }
729
- const p = () => {
729
+ const b = () => {
730
730
  const _ = u.current;
731
- _ && _.duration && !M && w(_.currentTime / _.duration), c.current = requestAnimationFrame(p);
731
+ _ && _.duration && !A && w(_.currentTime / _.duration), c.current = requestAnimationFrame(b);
732
732
  };
733
- return c.current = requestAnimationFrame(p), () => {
733
+ return c.current = requestAnimationFrame(b), () => {
734
734
  c.current !== null && cancelAnimationFrame(c.current);
735
735
  };
736
- }, [N, M]), J(() => {
737
- const p = u.current;
738
- p && (N ? p.play().catch((_) => {
736
+ }, [N, A]), J(() => {
737
+ const b = u.current;
738
+ b && (N ? b.play().catch((_) => {
739
739
  v(!1), C(!0);
740
- }) : p.pause());
740
+ }) : b.pause());
741
741
  }, [N]), J(() => {
742
- if (!M) return;
743
- const p = (R) => w(G(R)), _ = (R) => {
744
- A(!1), P(G(R));
742
+ if (!A) return;
743
+ const b = (L) => w(G(L)), _ = (L) => {
744
+ T(!1), P(G(L));
745
745
  };
746
- return window.addEventListener("mousemove", p), window.addEventListener("mouseup", _), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", _), () => {
747
- window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", _), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", _);
746
+ return window.addEventListener("mousemove", b), window.addEventListener("mouseup", _), window.addEventListener("touchmove", b, { passive: !0 }), window.addEventListener("touchend", _), () => {
747
+ window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", _), window.removeEventListener("touchmove", b), window.removeEventListener("touchend", _);
748
748
  };
749
- }, [M, G, P]);
750
- const H = F ? { aspectRatio: String(F) } : void 0, W = F ? "" : " aspect-video", $ = Math.round(x * 100);
749
+ }, [A, G, P]);
750
+ const H = F ? { aspectRatio: String(F) } : void 0, Y = F ? "" : " aspect-video", $ = Math.round(x * 100);
751
751
  return /* @__PURE__ */ h(
752
752
  "div",
753
753
  {
754
754
  role: "button",
755
755
  tabIndex: 0,
756
- className: `relative cursor-pointer overflow-hidden bg-black ${W}`,
756
+ className: `relative cursor-pointer overflow-hidden bg-black ${Y}`,
757
757
  style: H,
758
- onClick: (p) => {
758
+ onClick: (b) => {
759
759
  if (m) {
760
- m(p);
760
+ m(b);
761
761
  return;
762
762
  }
763
763
  I || o && v((_) => !_);
764
764
  },
765
- onKeyDown: (p) => {
766
- if (!(p.key !== "Enter" && p.key !== " ")) {
767
- if (p.preventDefault(), m) {
768
- m(p);
765
+ onKeyDown: (b) => {
766
+ if (!(b.key !== "Enter" && b.key !== " ")) {
767
+ if (b.preventDefault(), m) {
768
+ m(b);
769
769
  return;
770
770
  }
771
771
  I || o && v((_) => !_);
@@ -819,8 +819,8 @@ const ea = (e) => {
819
819
  onWaiting: () => E(!0),
820
820
  onPlay: () => C(!1),
821
821
  onLoadedMetadata: () => {
822
- const p = u.current;
823
- p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && X(p.videoWidth / p.videoHeight);
822
+ const b = u.current;
823
+ b instanceof HTMLVideoElement && b.videoWidth && b.videoHeight && Z(b.videoWidth / b.videoHeight);
824
824
  },
825
825
  onEnded: () => {
826
826
  i || (v(!1), w(0));
@@ -842,11 +842,11 @@ const ea = (e) => {
842
842
  role: "button",
843
843
  tabIndex: 0,
844
844
  "aria-label": "Play preview",
845
- onClick: (p) => {
846
- p.stopPropagation(), U();
845
+ onClick: (b) => {
846
+ b.stopPropagation(), U();
847
847
  },
848
- onKeyDown: (p) => {
849
- p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), U());
848
+ onKeyDown: (b) => {
849
+ b.key !== "Enter" && b.key !== " " || (b.preventDefault(), b.stopPropagation(), U());
850
850
  },
851
851
  children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
852
852
  }
@@ -864,9 +864,9 @@ const ea = (e) => {
864
864
  className: "relative flex h-4 w-full cursor-pointer items-center",
865
865
  onMouseDown: B,
866
866
  onTouchStart: B,
867
- onClick: (p) => p.stopPropagation(),
868
- onKeyDown: (p) => {
869
- p.key === "ArrowRight" && P(Math.min(1, x + 0.05)), p.key === "ArrowLeft" && P(Math.max(0, x - 0.05));
867
+ onClick: (b) => b.stopPropagation(),
868
+ onKeyDown: (b) => {
869
+ b.key === "ArrowRight" && P(Math.min(1, x + 0.05)), b.key === "ArrowLeft" && P(Math.max(0, x - 0.05));
870
870
  },
871
871
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
872
872
  "div",
@@ -882,8 +882,8 @@ const ea = (e) => {
882
882
  "button",
883
883
  {
884
884
  type: "button",
885
- onClick: (p) => {
886
- p.stopPropagation(), v((_) => !_);
885
+ onClick: (b) => {
886
+ b.stopPropagation(), v((_) => !_);
887
887
  },
888
888
  className: "shrink-0 text-white",
889
889
  "aria-label": N ? "Pause" : "Play",
@@ -903,17 +903,17 @@ const ea = (e) => {
903
903
  className: "relative flex h-4 w-full cursor-pointer items-center",
904
904
  onMouseDown: B,
905
905
  onTouchStart: B,
906
- onClick: (p) => p.stopPropagation(),
907
- onMouseEnter: () => L(!0),
908
- onMouseLeave: () => L(!1),
909
- onKeyDown: (p) => {
910
- p.key === "ArrowRight" && P(Math.min(1, x + 0.05)), p.key === "ArrowLeft" && P(Math.max(0, x - 0.05));
906
+ onClick: (b) => b.stopPropagation(),
907
+ onMouseEnter: () => R(!0),
908
+ onMouseLeave: () => R(!1),
909
+ onKeyDown: (b) => {
910
+ b.key === "ArrowRight" && P(Math.min(1, x + 0.05)), b.key === "ArrowLeft" && P(Math.max(0, x - 0.05));
911
911
  },
912
912
  children: [
913
913
  /* @__PURE__ */ n(
914
914
  "div",
915
915
  {
916
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${S || M ? "h-1.5" : "h-1"}`,
916
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${S || A ? "h-1.5" : "h-1"}`,
917
917
  children: /* @__PURE__ */ n(
918
918
  "div",
919
919
  {
@@ -926,7 +926,7 @@ const ea = (e) => {
926
926
  /* @__PURE__ */ n(
927
927
  "div",
928
928
  {
929
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${S || M ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
929
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${S || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
930
930
  style: { left: `${$}%` }
931
931
  }
932
932
  )
@@ -946,7 +946,7 @@ const ea = (e) => {
946
946
  mediaPlayerProps: i,
947
947
  containedImage: o = !1
948
948
  }) => {
949
- const l = ae(e), [d, m] = O(!1);
949
+ const l = re(e), [d, m] = O(!1);
950
950
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
951
951
  ta,
952
952
  {
@@ -1031,7 +1031,7 @@ const ea = (e) => {
1031
1031
  rootRef: g,
1032
1032
  "data-testid": u
1033
1033
  }) => {
1034
- const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
1034
+ const f = e === "dark", c = f ? s ?? a : s ?? "", p = f && !s;
1035
1035
  return /* @__PURE__ */ h(
1036
1036
  "div",
1037
1037
  {
@@ -1051,8 +1051,8 @@ const ea = (e) => {
1051
1051
  {
1052
1052
  className: y("mb-0.5 truncate text-base font-medium", {
1053
1053
  "text-black": !f,
1054
- "text-white/30": f && b,
1055
- "text-white": f && !b
1054
+ "text-white/30": f && p,
1055
+ "text-white": f && !p
1056
1056
  }),
1057
1057
  children: c
1058
1058
  }
@@ -1175,14 +1175,14 @@ const ca = ({
1175
1175
  );
1176
1176
  };
1177
1177
  function Qe(e) {
1178
- var u, f, c, b;
1178
+ var u, f, c, p;
1179
1179
  const t = (u = e.attachments) == null ? void 0 : u.find(
1180
1180
  (N) => N.type === "video" && N.asset_url
1181
1181
  ), s = (f = e.attachments) == null ? void 0 : f.find(
1182
1182
  (N) => N.type === "image" && N.image_url
1183
1183
  ), a = (c = e.attachments) == null ? void 0 : c.find(
1184
1184
  (N) => N.type === "audio" && N.asset_url
1185
- ), r = (b = e.attachments) == null ? void 0 : b.find(
1185
+ ), r = (p = e.attachments) == null ? void 0 : p.find(
1186
1186
  (N) => N.type === "file" && N.asset_url
1187
1187
  ), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
1188
1188
  if (!o) return null;
@@ -1230,7 +1230,7 @@ const an = ({
1230
1230
  fileSize: a,
1231
1231
  thumbnailUrl: r
1232
1232
  }) => {
1233
- const i = ae(t), o = a !== void 0 ? nn(a) : void 0;
1233
+ const i = re(t), o = a !== void 0 ? nn(a) : void 0;
1234
1234
  return /* @__PURE__ */ n(
1235
1235
  tn,
1236
1236
  {
@@ -1259,7 +1259,7 @@ const an = ({
1259
1259
  const s = Ze(e), a = Qe(e);
1260
1260
  return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
1261
1261
  !t && e.user && /* @__PURE__ */ n(
1262
- se,
1262
+ ae,
1263
1263
  {
1264
1264
  className: "str-chat__avatar str-chat__message-sender-avatar",
1265
1265
  id: e.user.id,
@@ -1355,10 +1355,10 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1355
1355
  if (r) {
1356
1356
  const f = (u = e.metadata) == null ? void 0 : u.amount_text;
1357
1357
  if (!f) return null;
1358
- const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
1358
+ const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", p = t ? `${f} tip` : `Delivered with ${f} tip`;
1359
1359
  return /* @__PURE__ */ h("div", { className: c, children: [
1360
1360
  /* @__PURE__ */ n(ys, { size: t ? 14 : 12 }),
1361
- /* @__PURE__ */ n("span", { children: b })
1361
+ /* @__PURE__ */ n("span", { children: p })
1362
1362
  ] });
1363
1363
  }
1364
1364
  const o = s && a, l = o ? "Sent with AI" : "Sent with DM Agent", d = [
@@ -1366,10 +1366,10 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1366
1366
  s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
1367
1367
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
1368
1368
  ].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(ba, { size: o ? 12 : 15 }) });
1369
- return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(ne, { children: [
1369
+ return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(se, { children: [
1370
1370
  m,
1371
1371
  g
1372
- ] }) : /* @__PURE__ */ h(ne, { children: [
1372
+ ] }) : /* @__PURE__ */ h(se, { children: [
1373
1373
  g,
1374
1374
  m
1375
1375
  ] }) });
@@ -1422,30 +1422,30 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1422
1422
  isMessageAIGenerated: u,
1423
1423
  isMyMessage: f,
1424
1424
  message: c,
1425
- renderText: b,
1425
+ renderText: p,
1426
1426
  threadList: N,
1427
1427
  viewerLanguage: v
1428
- } = e, { client: x } = qe("CustomMessage"), { channel: w } = de("CustomMessage"), { isUnlocking: M, onUnlockClick: A, onFetchSource: S, onDownloadClick: L } = ga("LockedAttachment"), [I, C] = O(!1), k = Mn(c.id), { selected: E, voteUp: D, voteDown: V } = Vs(c), {
1428
+ } = e, { client: x } = qe("CustomMessage"), { channel: w } = de("CustomMessage"), { isUnlocking: A, onUnlockClick: T, onFetchSource: S, onDownloadClick: R } = ga("LockedAttachment"), [I, C] = O(!1), k = Mn(c.id), { selected: E, voteUp: D, voteDown: V } = Vs(c), {
1429
1429
  Attachment: F = Dn,
1430
- EditMessageModal: X = Rn,
1430
+ EditMessageModal: Z = Rn,
1431
1431
  MessageActions: U,
1432
1432
  MessageBlocked: G = Ln,
1433
1433
  MessageBouncePrompt: P = Pn,
1434
1434
  MessageDeleted: B = On,
1435
1435
  MessageIsThreadReplyInChannelButtonIndicator: H = zn,
1436
- MessageRepliesCountButton: W = Fn,
1436
+ MessageRepliesCountButton: Y = Fn,
1437
1437
  ReminderNotification: $ = $n,
1438
- StreamedMessageText: p = Bn,
1438
+ StreamedMessageText: b = Bn,
1439
1439
  PinIndicator: _
1440
- } = Ut("CustomMessage"), R = jn(c), T = Vn(c), j = te(
1440
+ } = Ut("CustomMessage"), L = jn(c), M = Vn(c), W = ne(
1441
1441
  () => u == null ? void 0 : u(c),
1442
1442
  [u, c]
1443
- ), Y = te(() => {
1443
+ ), j = ne(() => {
1444
1444
  const me = c.attachments ?? [], _e = c.shared_location ? [c.shared_location, ...me] : me;
1445
1445
  if (!Ce(c)) return _e;
1446
1446
  const Tt = _e.filter((At) => !("type" in At) || !sn(At));
1447
1447
  return Tt.length === _e.length ? _e : Tt;
1448
- }, [c]), Z = te(() => {
1448
+ }, [c]), K = ne(() => {
1449
1449
  const me = Kt({ message: c, viewerLanguage: v });
1450
1450
  return me === c.text ? c : { ...c, text: me };
1451
1451
  }, [c, v]);
@@ -1455,7 +1455,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1455
1455
  return /* @__PURE__ */ n(B, { message: c });
1456
1456
  if (Gn(c))
1457
1457
  return /* @__PURE__ */ n(G, {});
1458
- const re = !N && !!c.reply_count, ee = !N && c.show_in_channel && c.parent_id, ct = c.status === "failed" && ((gt = c.error) == null ? void 0 : gt.status) !== 403, dt = Hn(c);
1458
+ const ee = !N && !!c.reply_count, Q = !N && c.show_in_channel && c.parent_id, ct = c.status === "failed" && ((gt = c.error) == null ? void 0 : gt.status) !== 403, dt = Hn(c);
1459
1459
  let ie;
1460
1460
  ct ? ie = () => m(c) : dt && (ie = () => C(!0));
1461
1461
  const ue = f(), En = y(
@@ -1465,20 +1465,20 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1465
1465
  ue ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1466
1466
  c.text ? "str-chat__message--has-text" : "has-no-text",
1467
1467
  {
1468
- "str-chat__message--has-attachment": R,
1468
+ "str-chat__message--has-attachment": L,
1469
1469
  "str-chat__message--highlighted": g,
1470
1470
  "str-chat__message--pinned pinned-message": c.pinned,
1471
- "str-chat__message--with-reactions": T,
1471
+ "str-chat__message--with-reactions": M,
1472
1472
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((bt = c == null ? void 0 : c.error) == null ? void 0 : bt.status) !== 403,
1473
- "str-chat__message-with-thread-link": re || ee,
1473
+ "str-chat__message-with-thread-link": ee || Q,
1474
1474
  "str-chat__virtual-message__wrapper--end": r,
1475
1475
  "str-chat__virtual-message__wrapper--first": i,
1476
1476
  "str-chat__virtual-message__wrapper--group": o
1477
1477
  }
1478
- ), ut = c.poll_id && x.polls.fromState(c.poll_id), mt = wa(c), oe = Ce(c), ht = xa(c), Me = !!(Y != null && Y.length && !c.quoted_message), ft = oe && ue && Me;
1479
- return /* @__PURE__ */ h(ne, { children: [
1478
+ ), ut = c.poll_id && x.polls.fromState(c.poll_id), mt = wa(c), oe = Ce(c), ht = xa(c), Me = !!(j != null && j.length && !c.quoted_message), ft = oe && ue && Me;
1479
+ return /* @__PURE__ */ h(se, { children: [
1480
1480
  a && /* @__PURE__ */ n(
1481
- X,
1481
+ Z,
1482
1482
  {
1483
1483
  additionalMessageInputProps: t
1484
1484
  }
@@ -1500,7 +1500,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1500
1500
  _ && /* @__PURE__ */ n(_, {}),
1501
1501
  !!k && /* @__PURE__ */ n($, { reminder: k }),
1502
1502
  c.user && /* @__PURE__ */ n(
1503
- se,
1503
+ ae,
1504
1504
  {
1505
1505
  className: "str-chat__avatar str-chat__message-sender-avatar",
1506
1506
  id: c.user.id,
@@ -1540,7 +1540,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1540
1540
  amountText: (wt = c.metadata) == null ? void 0 : wt.amount_text,
1541
1541
  detail: (Nt = c.metadata) == null ? void 0 : Nt.attachment_detail,
1542
1542
  paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
1543
- onPreviewClick: () => A == null ? void 0 : A(c, w),
1543
+ onPreviewClick: () => T == null ? void 0 : T(c, w),
1544
1544
  onFetchSource: async () => await (S == null ? void 0 : S(c, w))
1545
1545
  }
1546
1546
  )
@@ -1554,10 +1554,10 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1554
1554
  amountText: (Et = c.metadata) == null ? void 0 : Et.amount_text,
1555
1555
  detail: (It = c.metadata) == null ? void 0 : It.attachment_detail,
1556
1556
  paymentStatus: (St = c.metadata) == null ? void 0 : St.payment_status,
1557
- isUnlocking: M(c.id),
1558
- onUnlockClick: () => A == null ? void 0 : A(c, w),
1557
+ isUnlocking: A(c.id),
1558
+ onUnlockClick: () => T == null ? void 0 : T(c, w),
1559
1559
  onFetchSource: async () => await (S == null ? void 0 : S(c, w)),
1560
- onDownloadClick: () => L == null ? void 0 : L(c, w)
1560
+ onDownloadClick: () => R == null ? void 0 : R(c, w)
1561
1561
  }
1562
1562
  ),
1563
1563
  U && /* @__PURE__ */ n(U, {})
@@ -1565,8 +1565,8 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1565
1565
  c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
1566
1566
  Mt,
1567
1567
  {
1568
- message: Z,
1569
- renderText: b
1568
+ message: K,
1569
+ renderText: p
1570
1570
  }
1571
1571
  ) })
1572
1572
  ] }) : mt ? (
@@ -1582,24 +1582,24 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1582
1582
  }
1583
1583
  ),
1584
1584
  ut && /* @__PURE__ */ n(qn, { poll: ut }),
1585
- Y != null && Y.length && !c.quoted_message ? /* @__PURE__ */ n(
1585
+ j != null && j.length && !c.quoted_message ? /* @__PURE__ */ n(
1586
1586
  F,
1587
1587
  {
1588
1588
  actionHandler: l,
1589
- attachments: Y
1589
+ attachments: j
1590
1590
  }
1591
1591
  ) : null,
1592
- j ? /* @__PURE__ */ n(
1593
- p,
1592
+ W ? /* @__PURE__ */ n(
1593
+ b,
1594
1594
  {
1595
- message: Z,
1596
- renderText: b
1595
+ message: K,
1596
+ renderText: p
1597
1597
  }
1598
1598
  ) : /* @__PURE__ */ n(
1599
1599
  Mt,
1600
1600
  {
1601
- message: Z,
1602
- renderText: b
1601
+ message: K,
1602
+ renderText: p
1603
1603
  }
1604
1604
  ),
1605
1605
  /* @__PURE__ */ n(Wn, {})
@@ -1624,14 +1624,14 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1624
1624
  }
1625
1625
  )
1626
1626
  ] }),
1627
- re && /* @__PURE__ */ n(
1628
- W,
1627
+ ee && /* @__PURE__ */ n(
1628
+ Y,
1629
1629
  {
1630
1630
  onClick: d,
1631
1631
  reply_count: c.reply_count
1632
1632
  }
1633
1633
  ),
1634
- ee && /* @__PURE__ */ n(H, {})
1634
+ Q && /* @__PURE__ */ n(H, {})
1635
1635
  ]
1636
1636
  },
1637
1637
  c.id
@@ -1791,7 +1791,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1791
1791
  }) => {
1792
1792
  var o;
1793
1793
  const { channel: r } = de(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
1794
- return s ? /* @__PURE__ */ h(ne, { children: [
1794
+ return s ? /* @__PURE__ */ h(se, { children: [
1795
1795
  /* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
1796
1796
  t == null ? void 0 : t()
1797
1797
  ] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
@@ -1843,7 +1843,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1843
1843
  if (t === -1)
1844
1844
  return e;
1845
1845
  const s = t + Oe.length;
1846
- return /* @__PURE__ */ h(ne, { children: [
1846
+ return /* @__PURE__ */ h(se, { children: [
1847
1847
  e.slice(0, t),
1848
1848
  /* @__PURE__ */ n(
1849
1849
  "a",
@@ -1938,10 +1938,10 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1938
1938
  Re.Generating,
1939
1939
  Re.ExternalSources
1940
1940
  ]), Ga = ({ threadList: e }) => {
1941
- var b, N;
1941
+ var p, N;
1942
1942
  const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = qe(), { typing: i = {} } = ss(), { aiState: o } = as(t), l = Se(dn);
1943
1943
  if (!e && l && Ua.has(o)) {
1944
- const v = Ha(t, (b = r.user) == null ? void 0 : b.id);
1944
+ const v = Ha(t, (p = r.user) == null ? void 0 : p.id);
1945
1945
  return /* @__PURE__ */ n(
1946
1946
  jt,
1947
1947
  {
@@ -1990,7 +1990,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1990
1990
  style: { insetInlineStart: 0, insetInlineEnd: "auto" },
1991
1991
  children: [
1992
1992
  /* @__PURE__ */ n("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ n(
1993
- se,
1993
+ ae,
1994
1994
  {
1995
1995
  id: e,
1996
1996
  name: t,
@@ -2083,17 +2083,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2083
2083
  showStarButton: r = !1,
2084
2084
  dmAgentEnabled: i = !1
2085
2085
  }) => {
2086
- var f, c, b, N, v;
2086
+ var f, c, p, N, v;
2087
2087
  const { channel: o } = de(), l = z.useMemo(() => {
2088
- var M, A;
2089
- const x = (M = o._client) == null ? void 0 : M.userID;
2090
- return x ? Object.values(((A = o.state) == null ? void 0 : A.members) || {}).find(
2088
+ var A, T;
2089
+ const x = (A = o._client) == null ? void 0 : A.userID;
2090
+ return x ? Object.values(((T = o.state) == null ? void 0 : T.members) || {}).find(
2091
2091
  (S) => {
2092
- var L;
2093
- return ((L = S.user) == null ? void 0 : L.id) && S.user.id !== x;
2092
+ var R;
2093
+ return ((R = S.user) == null ? void 0 : R.id) && S.user.id !== x;
2094
2094
  }
2095
2095
  ) : void 0;
2096
- }, [(f = o._client) == null ? void 0 : f.userID, (c = o.state) == null ? void 0 : c.members]), d = Te(l == null ? void 0 : l.user), m = (b = l == null ? void 0 : l.user) == null ? void 0 : b.image, g = Xt(o), u = async () => {
2096
+ }, [(f = o._client) == null ? void 0 : f.userID, (c = o.state) == null ? void 0 : c.members]), d = Te(l == null ? void 0 : l.user), m = (p = l == null ? void 0 : l.user) == null ? void 0 : p.image, g = Xt(o), u = async () => {
2097
2097
  try {
2098
2098
  g ? await o.unpin() : await o.pin();
2099
2099
  } catch (x) {
@@ -2121,7 +2121,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2121
2121
  ) }),
2122
2122
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
2123
2123
  /* @__PURE__ */ n(
2124
- se,
2124
+ ae,
2125
2125
  {
2126
2126
  id: ((N = l == null ? void 0 : l.user) == null ? void 0 : N.id) || o.id || "unknown",
2127
2127
  name: d,
@@ -2197,7 +2197,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2197
2197
  }
2198
2198
  ),
2199
2199
  /* @__PURE__ */ n(
2200
- se,
2200
+ ae,
2201
2201
  {
2202
2202
  id: ((v = l == null ? void 0 : l.user) == null ? void 0 : v.id) || o.id || "unknown",
2203
2203
  name: d,
@@ -2275,62 +2275,62 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2275
2275
  showBlockParticipant: u = !0,
2276
2276
  showReportParticipant: f = !0,
2277
2277
  showFollowerStatus: c = !0,
2278
- composerDisabled: b = !1,
2278
+ composerDisabled: p = !1,
2279
2279
  composerDisabledReason: N,
2280
2280
  showStarButton: v = !1,
2281
2281
  chatbotVotingEnabled: x = !1,
2282
2282
  renderChannelBanner: w,
2283
- customProfileContent: M,
2284
- customChannelActions: A,
2283
+ customProfileContent: A,
2284
+ customChannelActions: T,
2285
2285
  renderMessage: S,
2286
- dmAgentEnabled: L = !1,
2286
+ dmAgentEnabled: R = !1,
2287
2287
  viewerLanguage: I
2288
2288
  }) => {
2289
- var H, W, $, p, _, R;
2290
- const { channel: C } = de(), k = K(null), E = z.useMemo(() => {
2291
- var Y, Z;
2292
- const T = (Y = C._client) == null ? void 0 : Y.userID;
2293
- return T ? Object.values(((Z = C.state) == null ? void 0 : Z.members) || {}).find(
2294
- (re) => {
2295
- var ee;
2296
- return ((ee = re.user) == null ? void 0 : ee.id) && re.user.id !== T;
2289
+ var H, Y, $, b, _, L;
2290
+ const { channel: C } = de(), k = X(null), E = z.useMemo(() => {
2291
+ var j, K;
2292
+ const M = (j = C._client) == null ? void 0 : j.userID;
2293
+ return M ? Object.values(((K = C.state) == null ? void 0 : K.members) || {}).find(
2294
+ (ee) => {
2295
+ var Q;
2296
+ return ((Q = ee.user) == null ? void 0 : Q.id) && ee.user.id !== M;
2297
2297
  }
2298
2298
  ) : void 0;
2299
- }, [(H = C._client) == null ? void 0 : H.userID, (W = C.state) == null ? void 0 : W.members]), D = z.useMemo(() => {
2300
- var Y, Z;
2301
- const T = (Y = C._client) == null ? void 0 : Y.userID;
2302
- return T ? Object.values(((Z = C.state) == null ? void 0 : Z.members) || {}).find((re) => {
2303
- var ee;
2304
- return ((ee = re.user) == null ? void 0 : ee.id) === T;
2299
+ }, [(H = C._client) == null ? void 0 : H.userID, (Y = C.state) == null ? void 0 : Y.members]), D = z.useMemo(() => {
2300
+ var j, K;
2301
+ const M = (j = C._client) == null ? void 0 : j.userID;
2302
+ return M ? Object.values(((K = C.state) == null ? void 0 : K.members) || {}).find((ee) => {
2303
+ var Q;
2304
+ return ((Q = ee.user) == null ? void 0 : Q.id) === M;
2305
2305
  }) : void 0;
2306
- }, [($ = C._client) == null ? void 0 : $.userID, (p = C.state) == null ? void 0 : p.members]), V = ((_ = D == null ? void 0 : D.user) == null ? void 0 : _.is_account) ?? (D == null ? void 0 : D.is_account), F = ((R = E == null ? void 0 : E.user) == null ? void 0 : R.is_account) ?? (E == null ? void 0 : E.is_account), X = L && V === !1 && F === !0, U = z.useMemo(() => {
2306
+ }, [($ = C._client) == null ? void 0 : $.userID, (b = C.state) == null ? void 0 : b.members]), V = ((_ = D == null ? void 0 : D.user) == null ? void 0 : _.is_account) ?? (D == null ? void 0 : D.is_account), F = ((L = E == null ? void 0 : E.user) == null ? void 0 : L.is_account) ?? (E == null ? void 0 : E.is_account), Z = R && V === !1 && F === !0, U = z.useMemo(() => {
2307
2307
  if (!c) return;
2308
- const T = C.data ?? {};
2309
- if (T.followerStatus)
2310
- return String(T.followerStatus);
2311
- if (T.isFollower !== void 0)
2312
- return T.isFollower ? "Subscribed to you" : "Not subscribed";
2308
+ const M = C.data ?? {};
2309
+ if (M.followerStatus)
2310
+ return String(M.followerStatus);
2311
+ if (M.isFollower !== void 0)
2312
+ return M.isFollower ? "Subscribed to you" : "Not subscribed";
2313
2313
  }, [C.data, c]), G = q(() => {
2314
- var T;
2315
- (T = k.current) == null || T.showModal();
2314
+ var M;
2315
+ (M = k.current) == null || M.showModal();
2316
2316
  }, []), P = q(() => {
2317
- var T;
2318
- (T = k.current) == null || T.close();
2317
+ var M;
2318
+ (M = k.current) == null || M.close();
2319
2319
  }, []), B = q(
2320
- (T) => {
2321
- const { message: j } = be("ChannelView"), Y = /* @__PURE__ */ n(
2320
+ (M) => {
2321
+ const { message: W } = be("ChannelView"), j = /* @__PURE__ */ n(
2322
2322
  Ca,
2323
2323
  {
2324
- ...T,
2324
+ ...M,
2325
2325
  chatbotVotingEnabled: x,
2326
2326
  viewerLanguage: I
2327
2327
  }
2328
2328
  );
2329
- return !S || !j ? Y : S(Y, j);
2329
+ return !S || !W ? j : S(j, W);
2330
2330
  },
2331
2331
  [x, S, I]
2332
2332
  );
2333
- return /* @__PURE__ */ h(ne, { children: [
2333
+ return /* @__PURE__ */ h(se, { children: [
2334
2334
  /* @__PURE__ */ n(
2335
2335
  is,
2336
2336
  {
@@ -2347,7 +2347,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2347
2347
  onShowInfo: G,
2348
2348
  canShowInfo: !!E,
2349
2349
  showStarButton: v,
2350
- dmAgentEnabled: X
2350
+ dmAgentEnabled: Z
2351
2351
  }
2352
2352
  ) }, "lt-channel-header"),
2353
2353
  w ? /* @__PURE__ */ n(z.Fragment, { children: w() }, "lt-channel-banner") : null,
@@ -2371,7 +2371,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2371
2371
  {
2372
2372
  renderActions: () => s == null ? void 0 : s(C),
2373
2373
  renderFooter: () => a == null ? void 0 : a(C),
2374
- disabled: b,
2374
+ disabled: p,
2375
2375
  disabledReason: N
2376
2376
  },
2377
2377
  "lt-channel-message-input"
@@ -2396,8 +2396,8 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2396
2396
  onDeleteConversationClick: d,
2397
2397
  onBlockParticipantClick: m,
2398
2398
  onReportParticipantClick: g,
2399
- customProfileContent: M,
2400
- customChannelActions: A
2399
+ customProfileContent: A,
2400
+ customChannelActions: T
2401
2401
  }
2402
2402
  )
2403
2403
  ] });
@@ -2417,15 +2417,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2417
2417
  onDeleteConversationClick: u,
2418
2418
  onBlockParticipantClick: f,
2419
2419
  onReportParticipantClick: c,
2420
- showBlockParticipant: b = !0,
2420
+ showBlockParticipant: p = !0,
2421
2421
  showReportParticipant: N = !0,
2422
2422
  showFollowerStatus: v = !0,
2423
2423
  composerDisabled: x = !1,
2424
2424
  composerDisabledReason: w,
2425
- dmAgentEnabled: M,
2426
- messageMetadata: A,
2425
+ dmAgentEnabled: A,
2426
+ messageMetadata: T,
2427
2427
  onMessageSent: S,
2428
- showStarButton: L = !1,
2428
+ showStarButton: R = !1,
2429
2429
  chatbotVotingEnabled: I = !1,
2430
2430
  renderChannelBanner: C,
2431
2431
  customProfileContent: k,
@@ -2433,38 +2433,38 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2433
2433
  renderMessage: D,
2434
2434
  onMessageLinkClick: V,
2435
2435
  sendButton: F,
2436
- attachmentPreviewList: X,
2436
+ attachmentPreviewList: Z,
2437
2437
  viewerLanguage: U
2438
2438
  }) => {
2439
2439
  const G = q(
2440
- async (B, H, W) => {
2441
- var j;
2442
- const $ = ((j = e.data) == null ? void 0 : j.chatbot_paused) === !0, p = M && !$, _ = {
2440
+ async (B, H, Y) => {
2441
+ var W;
2442
+ const $ = ((W = e.data) == null ? void 0 : W.chatbot_paused) === !0, b = A && !$, _ = {
2443
2443
  ...H,
2444
- ...p && { silent: !0 },
2445
- ...A && {
2444
+ ...b && { silent: !0 },
2445
+ ...T && {
2446
2446
  metadata: {
2447
2447
  ...H.metadata ?? {},
2448
- ...A
2448
+ ...T
2449
2449
  }
2450
2450
  }
2451
- }, R = {
2452
- ...W,
2453
- ...p && { skip_push: !0 }
2454
- }, T = await e.sendMessage(_, R);
2455
- return S == null || S(T), T;
2451
+ }, L = {
2452
+ ...Y,
2453
+ ...b && { skip_push: !0 }
2454
+ }, M = await e.sendMessage(_, L);
2455
+ return S == null || S(M), M;
2456
2456
  },
2457
- [e, M, A, S]
2458
- ), P = K(null);
2457
+ [e, A, T, S]
2458
+ ), P = X(null);
2459
2459
  return J(() => {
2460
2460
  if (!V) return;
2461
2461
  const B = P.current;
2462
2462
  if (!B) return;
2463
- const H = (W) => {
2464
- const $ = W.target, p = $ == null ? void 0 : $.closest("a[href]"), _ = p == null ? void 0 : p.getAttribute("href");
2463
+ const H = (Y) => {
2464
+ const $ = Y.target, b = $ == null ? void 0 : $.closest("a[href]"), _ = b == null ? void 0 : b.getAttribute("href");
2465
2465
  if (!_) return;
2466
- const R = p == null ? void 0 : p.closest("[data-message-id]"), T = R == null ? void 0 : R.getAttribute("data-message-id"), j = T ? e.state.messages.find((Y) => Y.id === T) : void 0;
2467
- V(_, j);
2466
+ const L = b == null ? void 0 : b.closest("[data-message-id]"), M = L == null ? void 0 : L.getAttribute("data-message-id"), W = M ? e.state.messages.find((j) => j.id === M) : void 0;
2467
+ V(_, W);
2468
2468
  };
2469
2469
  return B.addEventListener("click", H), () => B.removeEventListener("click", H);
2470
2470
  }, [V, e]), /* @__PURE__ */ n(
@@ -2475,7 +2475,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2475
2475
  "messaging-channel-view h-full flex flex-col",
2476
2476
  d
2477
2477
  ),
2478
- children: /* @__PURE__ */ n(dn.Provider, { value: M ?? !1, children: /* @__PURE__ */ n(
2478
+ children: /* @__PURE__ */ n(dn.Provider, { value: A ?? !1, children: /* @__PURE__ */ n(
2479
2479
  rs,
2480
2480
  {
2481
2481
  channel: e,
@@ -2486,7 +2486,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2486
2486
  TypingIndicator: Ga,
2487
2487
  doSendMessageRequest: G,
2488
2488
  ...F ? { SendButton: F } : {},
2489
- ...X ? { AttachmentPreviewList: X } : {},
2489
+ ...Z ? { AttachmentPreviewList: Z } : {},
2490
2490
  children: /* @__PURE__ */ n(
2491
2491
  Xa,
2492
2492
  {
@@ -2502,13 +2502,13 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
2502
2502
  onDeleteConversationClick: u,
2503
2503
  onBlockParticipantClick: f,
2504
2504
  onReportParticipantClick: c,
2505
- showBlockParticipant: b,
2505
+ showBlockParticipant: p,
2506
2506
  showReportParticipant: N,
2507
2507
  showFollowerStatus: v,
2508
2508
  composerDisabled: x,
2509
2509
  composerDisabledReason: w,
2510
- showStarButton: L,
2511
- dmAgentEnabled: M,
2510
+ showStarButton: R,
2511
+ dmAgentEnabled: A,
2512
2512
  chatbotVotingEnabled: I,
2513
2513
  renderChannelBanner: C,
2514
2514
  customProfileContent: k,
@@ -2554,91 +2554,101 @@ const _i = ({
2554
2554
  onMessageSent: u,
2555
2555
  chatbotVotingEnabled: f = !1,
2556
2556
  viewerLanguage: c,
2557
- renderChannelBanner: b,
2557
+ renderChannelBanner: p,
2558
2558
  customChannelActions: N,
2559
2559
  renderMessage: v,
2560
2560
  onMessageLinkClick: x
2561
2561
  }) => {
2562
2562
  const {
2563
2563
  client: w,
2564
- isConnected: M,
2565
- isLoading: A,
2564
+ isConnected: A,
2565
+ isLoading: T,
2566
2566
  error: S,
2567
- refreshConnection: L,
2567
+ refreshConnection: R,
2568
2568
  service: I,
2569
2569
  debug: C
2570
- } = Ds(), [k, E] = O(null), [D, V] = O(null), [F, X] = O(!1), { showDeleteConversation: U = !0 } = e, G = K(o);
2570
+ } = Ds(), [k, E] = O(null), [D, V] = O(null), [F, Z] = O(!1), { showDeleteConversation: U = !0 } = e, G = X(o);
2571
2571
  G.current = o;
2572
- const P = K(a);
2573
- P.current = a, J(() => {
2574
- if (!w || !M) return;
2572
+ const P = X(a);
2573
+ P.current = a;
2574
+ const B = X(null), H = X(null);
2575
+ J(() => {
2576
+ H.current = k;
2577
+ }, [k]), J(() => {
2578
+ if (!w || !A) return;
2579
+ const b = w.userID;
2580
+ if (!b) return;
2581
+ const _ = `${b}::${i}`;
2582
+ if (B.current === _) return;
2583
+ B.current = _;
2584
+ const L = () => {
2585
+ B.current === _ && (B.current = null);
2586
+ };
2575
2587
  (async () => {
2576
- var p, _;
2577
- const $ = w.userID;
2578
- if ($)
2579
- try {
2580
- C && console.log(
2581
- "[MessagingShell] Loading initial conversation with:",
2588
+ var W, j;
2589
+ try {
2590
+ C && console.log(
2591
+ "[MessagingShell] Loading initial conversation with:",
2592
+ i
2593
+ );
2594
+ const K = await w.queryChannels(
2595
+ {
2596
+ type: "messaging",
2597
+ members: { $eq: [b, i] }
2598
+ },
2599
+ {},
2600
+ { limit: 1 }
2601
+ );
2602
+ if (K.length > 0) {
2603
+ E(K[0]), V(null), (W = P.current) == null || W.call(P, K[0]), C && console.log(
2604
+ "[MessagingShell] Initial conversation loaded:",
2605
+ K[0].id
2606
+ );
2607
+ return;
2608
+ }
2609
+ const ee = G.current;
2610
+ if (!ee || !I) {
2611
+ L(), V("No conversation found with this account"), C && console.log(
2612
+ "[MessagingShell] No conversation found for:",
2582
2613
  i
2583
2614
  );
2584
- const R = await w.queryChannels(
2585
- {
2586
- type: "messaging",
2587
- members: { $eq: [$, i] }
2588
- },
2589
- {},
2590
- { limit: 1 }
2615
+ return;
2616
+ }
2617
+ try {
2618
+ const Q = await I.startChannelWithParticipant({
2619
+ id: ee.id,
2620
+ name: ee.name,
2621
+ phone: ee.phone
2622
+ });
2623
+ E(Q), V(null), (j = P.current) == null || j.call(P, Q), C && console.log(
2624
+ "[MessagingShell] Channel created and loaded:",
2625
+ Q.id
2591
2626
  );
2592
- if (R.length > 0) {
2593
- E(R[0]), V(null), (p = P.current) == null || p.call(P, R[0]), C && console.log(
2594
- "[MessagingShell] Initial conversation loaded:",
2595
- R[0].id
2596
- );
2597
- return;
2598
- }
2599
- const T = G.current;
2600
- if (!T || !I) {
2601
- V("No conversation found with this account"), C && console.log(
2602
- "[MessagingShell] No conversation found for:",
2603
- i
2604
- );
2605
- return;
2606
- }
2607
- try {
2608
- const j = await I.startChannelWithParticipant({
2609
- id: T.id,
2610
- name: T.name,
2611
- phone: T.phone
2612
- });
2613
- E(j), V(null), (_ = P.current) == null || _.call(P, j), C && console.log(
2614
- "[MessagingShell] Channel created and loaded:",
2615
- j.id
2616
- );
2617
- } catch (j) {
2618
- console.error(
2619
- "[MessagingShell] Failed to create conversation:",
2620
- j
2621
- ), V("Failed to create conversation");
2622
- }
2623
- } catch (R) {
2627
+ } catch (Q) {
2624
2628
  console.error(
2625
- "[MessagingShell] Failed to load initial conversation:",
2626
- R
2627
- ), V("Failed to load conversation");
2629
+ "[MessagingShell] Failed to create conversation:",
2630
+ Q
2631
+ ), L(), V("Failed to create conversation");
2628
2632
  }
2633
+ } catch (K) {
2634
+ console.error(
2635
+ "[MessagingShell] Failed to load initial conversation:",
2636
+ K
2637
+ ), L(), H.current || V("Failed to load conversation");
2638
+ }
2629
2639
  })();
2630
- }, [i, w, M, I, C]);
2631
- const B = K(r);
2632
- B.current = r;
2633
- const H = q(() => {
2634
- var W;
2635
- E(null), X(!0), (W = B.current) == null || W.call(B);
2640
+ }, [i, w, A, I, C]);
2641
+ const Y = X(r);
2642
+ Y.current = r;
2643
+ const $ = q(() => {
2644
+ var b;
2645
+ E(null), Z(!0), (b = Y.current) == null || b.call(Y);
2636
2646
  }, []);
2637
- return A ? /* @__PURE__ */ n(ke, {}) : S ? /* @__PURE__ */ n(he, { message: S, onBack: L }) : !M || !w ? /* @__PURE__ */ n(
2647
+ return T ? /* @__PURE__ */ n(ke, {}) : S ? /* @__PURE__ */ n(he, { message: S, onBack: R }) : !A || !w ? /* @__PURE__ */ n(
2638
2648
  he,
2639
2649
  {
2640
2650
  message: "Not connected to messaging service",
2641
- onBack: L
2651
+ onBack: R
2642
2652
  }
2643
2653
  ) : D ? /* @__PURE__ */ n(he, { message: D }) : F && !k ? /* @__PURE__ */ n(he, { message: "Conversation ended" }) : k ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
2644
2654
  un,
@@ -2646,9 +2656,9 @@ const _i = ({
2646
2656
  channel: k,
2647
2657
  renderMessageInputActions: t,
2648
2658
  renderConversationFooter: s,
2649
- renderChannelBanner: b,
2650
- onLeaveConversation: H,
2651
- onBlockParticipant: H,
2659
+ renderChannelBanner: p,
2660
+ onLeaveConversation: $,
2661
+ onBlockParticipant: $,
2652
2662
  CustomChannelEmptyState: l,
2653
2663
  showDeleteConversation: U,
2654
2664
  onBlockParticipantClick: d,
@@ -2700,7 +2710,7 @@ const mn = z.createContext({
2700
2710
  });
2701
2711
  }, hn = z.memo(
2702
2712
  ({ channel: e, unread: t }) => {
2703
- var L, I, C;
2713
+ var R, I, C;
2704
2714
  const {
2705
2715
  selectedChannel: s,
2706
2716
  onChannelSelect: a,
@@ -2712,12 +2722,12 @@ const mn = z.createContext({
2712
2722
  }, m = (k) => {
2713
2723
  const E = k.key === "Enter" || k.key === " ", D = k.repeat;
2714
2724
  !E || D || (k.preventDefault(), d());
2715
- }, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
2725
+ }, u = Object.values(((R = e == null ? void 0 : e.state) == null ? void 0 : R.members) || {}).find(
2716
2726
  (k) => {
2717
2727
  var E, D;
2718
2728
  return ((E = k.user) == null ? void 0 : E.id) && k.user.id !== ((D = e == null ? void 0 : e._client) == null ? void 0 : D.userID);
2719
2729
  }
2720
- ), f = Te(u == null ? void 0 : u.user), c = (I = u == null ? void 0 : u.user) == null ? void 0 : I.image, b = (() => {
2730
+ ), f = Te(u == null ? void 0 : u.user), c = (I = u == null ? void 0 : u.user) == null ? void 0 : I.image, p = (() => {
2721
2731
  var E;
2722
2732
  const k = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
2723
2733
  if (k != null && k.length) {
@@ -2725,18 +2735,18 @@ const mn = z.createContext({
2725
2735
  if (k[D].type !== "system") return k[D];
2726
2736
  }
2727
2737
  })(), v = (() => {
2728
- var X, U, G, P;
2738
+ var Z, U, G, P;
2729
2739
  const k = Kt({
2730
- message: b,
2740
+ message: p,
2731
2741
  viewerLanguage: o
2732
2742
  });
2733
- if (((X = b == null ? void 0 : b.metadata) == null ? void 0 : X.custom_type) === "MESSAGE_TIP") return k ? `💵 ${k}` : "💵 Sent a tip";
2734
- if (((U = b == null ? void 0 : b.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_PAID") return k ? `💰 ${k}` : "💰 Sent a message";
2735
- if (((G = b == null ? void 0 : b.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_ATTACHMENT") return k ? `📎 ${k}` : "📎 Sent an attachment";
2743
+ if (((Z = p == null ? void 0 : p.metadata) == null ? void 0 : Z.custom_type) === "MESSAGE_TIP") return k ? `💵 ${k}` : "💵 Sent a tip";
2744
+ if (((U = p == null ? void 0 : p.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_PAID") return k ? `💰 ${k}` : "💰 Sent a message";
2745
+ if (((G = p == null ? void 0 : p.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_ATTACHMENT") return k ? `📎 ${k}` : "📎 Sent an attachment";
2736
2746
  if (k) return k;
2737
- const F = (P = b == null ? void 0 : b.attachments) == null ? void 0 : P[0];
2747
+ const F = (P = p == null ? void 0 : p.attachments) == null ? void 0 : P[0];
2738
2748
  return F ? F.og_scrape_url ? F.og_scrape_url : F.type === "image" ? "📷 Sent an image" : F.type === "video" ? "🎥 Sent a video" : F.type === "audio" ? "🎵 Sent audio" : F.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2739
- })(), x = b != null && b.created_at ? er(new Date(b.created_at)) : "", w = b ? Ce(b) : !1, M = i ? i(b, v) : `${w ? "✨ " : ""}${v}`, A = Xt(e), S = t ?? 0;
2749
+ })(), x = p != null && p.created_at ? er(new Date(p.created_at)) : "", w = p ? Ce(p) : !1, A = i ? i(p, v) : `${w ? "✨ " : ""}${v}`, T = Xt(e), S = t ?? 0;
2740
2750
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
2741
2751
  channelId: e == null ? void 0 : e.id,
2742
2752
  isSelected: l,
@@ -2759,13 +2769,13 @@ const mn = z.createContext({
2759
2769
  ),
2760
2770
  children: /* @__PURE__ */ h("div", { className: "flex items-start gap-3", children: [
2761
2771
  /* @__PURE__ */ n(
2762
- se,
2772
+ ae,
2763
2773
  {
2764
2774
  id: ((C = u == null ? void 0 : u.user) == null ? void 0 : C.id) || e.id || "unknown",
2765
2775
  name: f,
2766
2776
  image: c,
2767
2777
  size: 44,
2768
- starred: A,
2778
+ starred: T,
2769
2779
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
2770
2780
  }
2771
2781
  ),
@@ -2779,7 +2789,7 @@ const mn = z.createContext({
2779
2789
  l ? "text-primary" : "text-charcoal"
2780
2790
  ),
2781
2791
  children: [
2782
- A && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2792
+ T && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2783
2793
  f
2784
2794
  ]
2785
2795
  }
@@ -2787,7 +2797,7 @@ const mn = z.createContext({
2787
2797
  x && /* @__PURE__ */ n("span", { className: "text-xs text-stone flex-shrink-0", children: x })
2788
2798
  ] }),
2789
2799
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
2790
- /* @__PURE__ */ n("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: M }),
2800
+ /* @__PURE__ */ n("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: A }),
2791
2801
  S > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: S > 99 ? "99+" : S })
2792
2802
  ] })
2793
2803
  ] })
@@ -2813,10 +2823,10 @@ const tr = { last_message_at: -1 }, nr = z.memo(
2813
2823
  const g = z.useRef(0);
2814
2824
  g.current++;
2815
2825
  const { debug: u = !1 } = We(), f = z.useCallback(
2816
- (b) => {
2817
- for (const N of b)
2826
+ (p) => {
2827
+ for (const N of p)
2818
2828
  Ka(N);
2819
- return r ? r(b) : b;
2829
+ return r ? r(p) : p;
2820
2830
  },
2821
2831
  [r]
2822
2832
  );
@@ -2927,8 +2937,8 @@ const rr = {
2927
2937
  cta: o,
2928
2938
  trailingAction: l
2929
2939
  }) => {
2930
- const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = o != null;
2931
- if (!g && !u && !c && !b) return null;
2940
+ const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", p = o != null;
2941
+ if (!g && !u && !c && !p) return null;
2932
2942
  const v = y(
2933
2943
  "truncate text-base font-medium leading-6",
2934
2944
  d && !t ? lr : or[e]
@@ -2946,7 +2956,7 @@ const rr = {
2946
2956
  ] }),
2947
2957
  u && /* @__PURE__ */ n("p", { className: x, children: a })
2948
2958
  ] }),
2949
- !b && c && /* @__PURE__ */ n("p", { className: x, children: f })
2959
+ !p && c && /* @__PURE__ */ n("p", { className: x, children: f })
2950
2960
  ] }),
2951
2961
  l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
2952
2962
  ] }),
@@ -3025,9 +3035,9 @@ const rr = {
3025
3035
  }, mr = {
3026
3036
  dark: "size-16 text-white/25",
3027
3037
  light: "size-16 text-black/25"
3028
- }, Ae = (e, t) => !!t && !!e && ae(e) === "audio", fn = (e, t) => {
3038
+ }, Ae = (e, t) => !!t && !!e && re(e) === "audio", fn = (e, t) => {
3029
3039
  if (!t || !e) return !1;
3030
- const s = ae(e);
3040
+ const s = re(e);
3031
3041
  return s === "video" || s === "audio";
3032
3042
  }, nt = "bg-[#F2F3F4]", Ie = ({
3033
3043
  variant: e,
@@ -3038,7 +3048,7 @@ const rr = {
3038
3048
  topLeft: i,
3039
3049
  topRight: o
3040
3050
  }) => {
3041
- const l = ae(r), d = !!s && l === "video";
3051
+ const l = re(r), d = !!s && l === "video";
3042
3052
  return Ae(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
3043
3053
  "audio",
3044
3054
  {
@@ -3107,7 +3117,7 @@ const rr = {
3107
3117
  onDismiss: g,
3108
3118
  onEditClick: u
3109
3119
  }) => {
3110
- const f = l === "classic", c = Ae(r, o), b = g ? /* @__PURE__ */ n(
3120
+ const f = l === "classic", c = Ae(r, o), p = g ? /* @__PURE__ */ n(
3111
3121
  "button",
3112
3122
  {
3113
3123
  type: "button",
@@ -3136,12 +3146,12 @@ const rr = {
3136
3146
  mimeType: r
3137
3147
  }
3138
3148
  ) }),
3139
- b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
3149
+ p && /* @__PURE__ */ n("div", { className: "shrink-0", children: p })
3140
3150
  ] }) }) : /* @__PURE__ */ h(
3141
3151
  Ee,
3142
3152
  {
3143
3153
  variant: "dark",
3144
- topRight: f ? b : void 0,
3154
+ topRight: f ? p : void 0,
3145
3155
  children: [
3146
3156
  !f && /* @__PURE__ */ n(
3147
3157
  Ie,
@@ -3151,7 +3161,7 @@ const rr = {
3151
3161
  sourceUrl: o,
3152
3162
  title: e,
3153
3163
  mimeType: r,
3154
- topRight: b
3164
+ topRight: p
3155
3165
  }
3156
3166
  ),
3157
3167
  /* @__PURE__ */ n(
@@ -3182,7 +3192,7 @@ const rr = {
3182
3192
  cta: d,
3183
3193
  onClick: m
3184
3194
  }) => {
3185
- const g = fn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Ae(a, i) ? nt : void 0, N = d && m ? {
3195
+ const g = fn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, p = Ae(a, i) ? nt : void 0, N = d && m ? {
3186
3196
  ...d,
3187
3197
  onClick: () => {
3188
3198
  var v;
@@ -3196,7 +3206,7 @@ const rr = {
3196
3206
  href: f,
3197
3207
  onClick: c,
3198
3208
  ariaLabel: e ?? "Open attachment preview",
3199
- bgClassName: b,
3209
+ bgClassName: p,
3200
3210
  "data-testid": "link-attachment",
3201
3211
  children: [
3202
3212
  o === "featured" && /* @__PURE__ */ n(
@@ -3236,13 +3246,13 @@ const rr = {
3236
3246
  cta: m,
3237
3247
  onClick: g
3238
3248
  }) => {
3239
- const u = fn(r, o), f = et(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
3249
+ const u = fn(r, o), f = et(a), c = m == null && f != null && !u ? f : void 0, p = m == null && !u && c != null ? g : void 0;
3240
3250
  return /* @__PURE__ */ h(
3241
3251
  Ee,
3242
3252
  {
3243
3253
  variant: "dark",
3244
3254
  href: c,
3245
- onClick: b,
3255
+ onClick: p,
3246
3256
  bgClassName: Ae(r, o) ? nt : void 0,
3247
3257
  children: [
3248
3258
  l === "featured" && /* @__PURE__ */ n(
@@ -3409,7 +3419,7 @@ const rr = {
3409
3419
  text: i,
3410
3420
  groupPosition: o,
3411
3421
  "data-testid": "audio-attachment",
3412
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
3422
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, p) => /* @__PURE__ */ n(
3413
3423
  _r,
3414
3424
  {
3415
3425
  item: c,
@@ -3417,10 +3427,10 @@ const rr = {
3417
3427
  trailingAction: (
3418
3428
  // Composer only supports a single attachment, so the
3419
3429
  // dismiss control sits on the only player.
3420
- g && b === 0 ? /* @__PURE__ */ n(xe, { onClick: d, variant: "inline" }) : void 0
3430
+ g && p === 0 ? /* @__PURE__ */ n(xe, { onClick: d, variant: "inline" }) : void 0
3421
3431
  )
3422
3432
  },
3423
- `${c.src}-${b}`
3433
+ `${c.src}-${p}`
3424
3434
  )) })
3425
3435
  }
3426
3436
  );
@@ -3451,7 +3461,7 @@ function Tr(e, t) {
3451
3461
  }
3452
3462
  }
3453
3463
  if (!e) return;
3454
- if (ae(e) === "document") {
3464
+ if (re(e) === "document") {
3455
3465
  const r = Qt(e), i = Sr[r];
3456
3466
  if (i) return i;
3457
3467
  if (e === "application/octet-stream") return;
@@ -3464,7 +3474,7 @@ function Ar(e, t, s) {
3464
3474
  const a = Tr(e, t), r = typeof s == "number" && s > 0 ? Ir(s) : void 0;
3465
3475
  return [a, r].filter(Boolean).join(" · ") || void 0;
3466
3476
  }
3467
- function Q(e) {
3477
+ function te(e) {
3468
3478
  try {
3469
3479
  const s = new URL(e).pathname.split("/").pop();
3470
3480
  return s && s.length > 0 ? decodeURIComponent(s) : "download";
@@ -3531,7 +3541,7 @@ const Mr = {
3531
3541
  u
3532
3542
  ]
3533
3543
  }
3534
- ) : /* @__PURE__ */ h(ne, { children: [
3544
+ ) : /* @__PURE__ */ h(se, { children: [
3535
3545
  g,
3536
3546
  u
3537
3547
  ] });
@@ -3541,7 +3551,7 @@ const Mr = {
3541
3551
  ] });
3542
3552
  };
3543
3553
  async function bn(e, t) {
3544
- const s = t ?? Q(e);
3554
+ const s = t ?? te(e);
3545
3555
  try {
3546
3556
  const a = await fetch(e, { mode: "cors" });
3547
3557
  if (!a.ok) throw new Error(`HTTP ${a.status}`);
@@ -3568,7 +3578,7 @@ const Lr = ({
3568
3578
  onActivate: a,
3569
3579
  trailingAction: r
3570
3580
  }) => {
3571
- const i = t.filename ?? Q(t.src);
3581
+ const i = t.filename ?? te(t.src);
3572
3582
  return /* @__PURE__ */ n(
3573
3583
  gn,
3574
3584
  {
@@ -3602,11 +3612,11 @@ const Lr = ({
3602
3612
  mimeType: r,
3603
3613
  title: i,
3604
3614
  items: o
3605
- }), b = (v) => {
3615
+ }), p = (v) => {
3606
3616
  if ((m == null ? void 0 : m(v)) === !1) return;
3607
3617
  const x = c[v];
3608
3618
  if (!x) return;
3609
- const w = x.filename ?? Q(x.src);
3619
+ const w = x.filename ?? te(x.src);
3610
3620
  bn(x.src, w);
3611
3621
  };
3612
3622
  if (c.length === 0)
@@ -3635,7 +3645,7 @@ const Lr = ({
3635
3645
  variant: u,
3636
3646
  item: v,
3637
3647
  index: x,
3638
- onActivate: b,
3648
+ onActivate: p,
3639
3649
  trailingAction: f && x === 0 ? /* @__PURE__ */ n(xe, { onClick: g, variant: "inline" }) : N
3640
3650
  },
3641
3651
  `${v.src}-${x}`
@@ -3651,7 +3661,7 @@ const Lr = ({
3651
3661
  onNext: t,
3652
3662
  prevLabel: s = "Previous",
3653
3663
  nextLabel: a = "Next"
3654
- }) => /* @__PURE__ */ h(ne, { children: [
3664
+ }) => /* @__PURE__ */ h(se, { children: [
3655
3665
  /* @__PURE__ */ n(
3656
3666
  "button",
3657
3667
  {
@@ -3791,7 +3801,7 @@ const Lr = ({
3791
3801
  children: i,
3792
3802
  "data-testid": o
3793
3803
  }) => {
3794
- const l = K(null), d = K(null);
3804
+ const l = X(null), d = X(null);
3795
3805
  return J(() => {
3796
3806
  var f;
3797
3807
  const u = l.current;
@@ -3882,8 +3892,8 @@ const Lr = ({
3882
3892
  length: t.length,
3883
3893
  initialIndex: s,
3884
3894
  open: e
3885
- }), l = t[r], d = te(
3886
- () => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "image"),
3895
+ }), l = t[r], d = ne(
3896
+ () => (l == null ? void 0 : l.filename) ?? (l ? te(l.src) : "image"),
3887
3897
  [l]
3888
3898
  );
3889
3899
  return l ? /* @__PURE__ */ h(
@@ -4076,7 +4086,7 @@ const Lr = ({
4076
4086
  loading: l = "lazy",
4077
4087
  onClick: d
4078
4088
  }) => {
4079
- const m = Vr({ src: t, alt: s, items: r }), g = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ne(
4089
+ const m = Vr({ src: t, alt: s, items: r }), g = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: p } = Ne(
4080
4090
  d
4081
4091
  );
4082
4092
  if (m.length === 0)
@@ -4099,7 +4109,7 @@ const Lr = ({
4099
4109
  open: u,
4100
4110
  items: wn(m, a),
4101
4111
  initialIndex: f,
4102
- onClose: b
4112
+ onClose: p
4103
4113
  }
4104
4114
  )
4105
4115
  ]
@@ -4119,10 +4129,10 @@ const Lr = ({
4119
4129
  length: t.length,
4120
4130
  initialIndex: s,
4121
4131
  open: e
4122
- }), l = t[r], d = te(
4123
- () => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "document"),
4132
+ }), l = t[r], d = ne(
4133
+ () => (l == null ? void 0 : l.filename) ?? (l ? te(l.src) : "document"),
4124
4134
  [l]
4125
- ), m = te(
4135
+ ), m = ne(
4126
4136
  () => l ? Xr(l.src) : void 0,
4127
4137
  [l]
4128
4138
  );
@@ -4173,7 +4183,7 @@ const Lr = ({
4173
4183
  onActivate: a,
4174
4184
  trailingAction: r
4175
4185
  }) => {
4176
- const i = t.filename ?? Q(t.src);
4186
+ const i = t.filename ?? te(t.src);
4177
4187
  return /* @__PURE__ */ n(
4178
4188
  gn,
4179
4189
  {
@@ -4199,14 +4209,14 @@ const Lr = ({
4199
4209
  onClick: d,
4200
4210
  onDismiss: m
4201
4211
  }) => {
4202
- const g = we(e), u = Kr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ne(
4212
+ const g = we(e), u = Kr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: p, closeViewer: N } = Ne(
4203
4213
  d
4204
4214
  ), v = e === "composer" && !!m;
4205
4215
  if (u.length === 0)
4206
4216
  return null;
4207
4217
  const x = u.map((w) => ({
4208
4218
  src: w.src,
4209
- filename: w.filename ?? Q(w.src)
4219
+ filename: w.filename ?? te(w.src)
4210
4220
  }));
4211
4221
  return /* @__PURE__ */ h(
4212
4222
  ve,
@@ -4216,14 +4226,14 @@ const Lr = ({
4216
4226
  groupPosition: l,
4217
4227
  "data-testid": "pdf-attachment",
4218
4228
  children: [
4219
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((w, M) => {
4220
- const A = w.filename ?? Q(w.src), S = v && M === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4229
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((w, A) => {
4230
+ const T = w.filename ?? te(w.src), S = v && A === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4221
4231
  pn,
4222
4232
  {
4223
4233
  url: w.src,
4224
- filename: A,
4234
+ filename: T,
4225
4235
  variant: "inline",
4226
- label: `Download ${A}`,
4236
+ label: `Download ${T}`,
4227
4237
  tone: g
4228
4238
  }
4229
4239
  );
@@ -4232,11 +4242,11 @@ const Lr = ({
4232
4242
  {
4233
4243
  variant: g,
4234
4244
  item: w,
4235
- index: M,
4236
- onActivate: b,
4245
+ index: A,
4246
+ onActivate: p,
4237
4247
  trailingAction: S
4238
4248
  },
4239
- `${w.src}-${M}`
4249
+ `${w.src}-${A}`
4240
4250
  );
4241
4251
  }) }),
4242
4252
  /* @__PURE__ */ n(
@@ -4265,8 +4275,8 @@ const Lr = ({
4265
4275
  length: t.length,
4266
4276
  initialIndex: s,
4267
4277
  open: e
4268
- }), l = t[r], d = te(
4269
- () => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "video"),
4278
+ }), l = t[r], d = ne(
4279
+ () => (l == null ? void 0 : l.filename) ?? (l ? te(l.src) : "video"),
4270
4280
  [l]
4271
4281
  );
4272
4282
  return l ? /* @__PURE__ */ h(
@@ -4384,7 +4394,7 @@ const Lr = ({
4384
4394
  preload: d,
4385
4395
  onClick: m
4386
4396
  }) => {
4387
- const g = ai({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ne(
4397
+ const g = ai({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: p, closeViewer: N } = Ne(
4388
4398
  m
4389
4399
  );
4390
4400
  if (g.length === 0)
@@ -4404,7 +4414,7 @@ const Lr = ({
4404
4414
  xn,
4405
4415
  {
4406
4416
  tiles: v,
4407
- onTileActivate: b,
4417
+ onTileActivate: p,
4408
4418
  className: "overflow-hidden rounded-md"
4409
4419
  }
4410
4420
  ) }),
@@ -4464,7 +4474,7 @@ const Lr = ({
4464
4474
  const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
4465
4475
  return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
4466
4476
  (i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
4467
- se,
4477
+ ae,
4468
4478
  {
4469
4479
  id: o || "account",
4470
4480
  name: o || "Account",
@@ -4503,12 +4513,12 @@ export {
4503
4513
  yi as L,
4504
4514
  wi as M,
4505
4515
  ye as a,
4506
- se as b,
4516
+ ae as b,
4507
4517
  nr as c,
4508
4518
  un as d,
4509
4519
  Ni as e,
4510
4520
  di as f,
4511
- ae as g,
4521
+ re as g,
4512
4522
  Ft as h,
4513
4523
  ki as i,
4514
4524
  Na as j,
@@ -4529,4 +4539,4 @@ export {
4529
4539
  Te as y,
4530
4540
  ga as z
4531
4541
  };
4532
- //# sourceMappingURL=index-CJEl_fID.js.map
4542
+ //# sourceMappingURL=index-Cj6b1oEe.js.map