@linktr.ee/messaging-react 3.2.0 → 3.3.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.
Files changed (36) hide show
  1. package/dist/{Card-bdnjL_4d.js → Card-BAc2cgtn.js} +3 -3
  2. package/dist/{Card-bdnjL_4d.js.map → Card-BAc2cgtn.js.map} +1 -1
  3. package/dist/{Card-CO089n1e.cjs → Card-Cn1cBVnr.cjs} +2 -2
  4. package/dist/{Card-CO089n1e.cjs.map → Card-Cn1cBVnr.cjs.map} +1 -1
  5. package/dist/{Card-B5TCecD6.cjs → Card-DAyszUxa.cjs} +2 -2
  6. package/dist/{Card-B5TCecD6.cjs.map → Card-DAyszUxa.cjs.map} +1 -1
  7. package/dist/{Card-DQYLHbDI.js → Card-D_2VQScd.js} +2 -2
  8. package/dist/{Card-DQYLHbDI.js.map → Card-D_2VQScd.js.map} +1 -1
  9. package/dist/{Card-DTaHgygz.js → Card-D_G8133I.js} +2 -2
  10. package/dist/{Card-DTaHgygz.js.map → Card-D_G8133I.js.map} +1 -1
  11. package/dist/{Card-aO1qZWDU.cjs → Card-gYxPXe_W.cjs} +2 -2
  12. package/dist/{Card-aO1qZWDU.cjs.map → Card-gYxPXe_W.cjs.map} +1 -1
  13. package/dist/{LockedThumbnail-nsFA3DjA.js → LockedThumbnail-C7tWpOQr.js} +2 -2
  14. package/dist/{LockedThumbnail-nsFA3DjA.js.map → LockedThumbnail-C7tWpOQr.js.map} +1 -1
  15. package/dist/{LockedThumbnail-CWVybsBb.cjs → LockedThumbnail-DtOTZl3l.cjs} +2 -2
  16. package/dist/{LockedThumbnail-CWVybsBb.cjs.map → LockedThumbnail-DtOTZl3l.cjs.map} +1 -1
  17. package/dist/{index-DJKFVBkP.js → index-C_NFzAB9.js} +1356 -1382
  18. package/dist/index-C_NFzAB9.js.map +1 -0
  19. package/dist/index-_Se6ovQm.cjs +2 -0
  20. package/dist/index-_Se6ovQm.cjs.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +20 -15
  23. package/dist/index.js +1 -1
  24. package/package.json +3 -3
  25. package/src/components/ChannelActionsMenu/ChannelActionsMenu.test.tsx +305 -0
  26. package/src/components/ChannelActionsMenu/index.tsx +221 -0
  27. package/src/components/ChannelView.stories.tsx +3 -73
  28. package/src/components/ChannelView.test.tsx +30 -57
  29. package/src/components/ChannelView.tsx +66 -115
  30. package/src/hooks/useChannelModerationActions.ts +227 -0
  31. package/src/types.ts +20 -15
  32. package/dist/index-BO2VfA-M.cjs +0 -2
  33. package/dist/index-BO2VfA-M.cjs.map +0 -1
  34. package/dist/index-DJKFVBkP.js.map +0 -1
  35. package/src/components/ChannelInfoDialog/ChannelInfoDialog.test.tsx +0 -333
  36. package/src/components/ChannelInfoDialog/index.tsx +0 -336
@@ -1,12 +1,12 @@
1
- import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
2
- import z, { createContext as He, useContext as Te, useCallback as W, useState as O, useRef as K, useEffect as J, useMemo as se, Suspense as Ye } from "react";
3
- import { StreamChatService as En } from "@linktr.ee/messaging-core";
4
- import { Chat as In, DateSeparator as Sn, useChannelStateContext as de, useChatContext as qe, areMessageUIPropsEqual as Tn, useMessageReminder as An, useComponentContext as Ut, Attachment as Mn, EditMessageModal as Dn, MessageBlocked as Rn, MessageBouncePrompt as Ln, MessageDeleted as Pn, MessageIsThreadReplyInChannelButtonIndicator as On, MessageRepliesCountButton as zn, ReminderNotification as Fn, StreamedMessageText as $n, messageHasAttachments as Bn, messageHasReactions as jn, isDateSeparatorMessage as Un, isMessageBlocked as Vn, isMessageBounced as Gn, MessageBounceModal as Hn, MessageText as At, Poll as Yn, MessageErrorIcon as qn, useMessageContext as pe, useMessageComposer as Wn, useStateStore as Xn, MessageInput as Kn, useMessageInputContext as Jn, useMessageComposerHasSendableData as Zn, AttachmentPreviewList as Qn, QuotedMessagePreview as es, TextareaComposer as ts, MessageTimestamp as Re, AIStates as Le, useTypingContext as ns, useAIState as ss, Channel as as, WithComponents as rs, Window as is, MessageList as os, ChannelList as ls } from "stream-chat-react";
5
- import { StarIcon as Be, XIcon as ve, SpinnerGapIcon as Pe, SignOutIcon as cs, ProhibitInsetIcon as Mt, FlagIcon as Vt, FileIcon as Gt, ImageIcon as ds, SpeakerHighIcon as us, VideoCameraIcon as Ht, FileMdIcon as ms, FileTextIcon as hs, FileZipIcon as fs, FilePptIcon as gs, FileCsvIcon as bs, FileXlsIcon as ps, FileDocIcon as vs, FilePdfIcon as xs, CircleNotchIcon as ge, PlayIcon as je, PauseIcon as ws, LinkIcon as Ns, DownloadSimpleIcon as be, GiftIcon as _s, ThumbsUpIcon as ys, ThumbsDownIcon as Cs, TrashSimpleIcon as ks, ArrowUpIcon as Es, SparkleIcon as Ue, ProhibitIcon as Is, ArrowLeftIcon as Dt, DotsThreeIcon as Rt, PencilSimpleIcon as Ss, CaretLeftIcon as Ts, CaretRightIcon as As } from "@phosphor-icons/react";
1
+ import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
2
+ import z, { createContext as Ge, useContext as Te, useCallback as W, useState as D, useRef as H, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
3
+ import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
4
+ import { Chat as In, DateSeparator as Tn, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as An, useMessageReminder as Mn, useComponentContext as Ut, Attachment as Rn, EditMessageModal as Ln, MessageBlocked as Dn, MessageBouncePrompt as Pn, MessageDeleted as On, MessageIsThreadReplyInChannelButtonIndicator as zn, MessageRepliesCountButton as $n, ReminderNotification as Fn, StreamedMessageText as Bn, messageHasAttachments as Un, messageHasReactions as jn, isDateSeparatorMessage as Vn, isMessageBlocked as Gn, isMessageBounced as Hn, MessageBounceModal as Yn, MessageText as Tt, Poll as qn, MessageErrorIcon as Wn, useMessageContext as pe, 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 Le, AIStates as De, 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
+ import { StarIcon as Fe, DotsThreeIcon as ds, SpinnerGapIcon as Ce, SignOutIcon as us, ProhibitInsetIcon as At, FlagIcon as jt, FileIcon as Vt, ImageIcon as ms, SpeakerHighIcon as hs, VideoCameraIcon as Gt, FileMdIcon as fs, FileTextIcon as gs, FileZipIcon as bs, FilePptIcon as ps, FileCsvIcon as vs, FileXlsIcon as xs, FileDocIcon as ws, FilePdfIcon as Ns, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as _s, LinkIcon as ys, DownloadSimpleIcon as be, GiftIcon as Cs, ThumbsUpIcon as ks, ThumbsDownIcon as Es, TrashSimpleIcon as Ss, XIcon as Ae, ArrowUpIcon as Is, SparkleIcon as Ue, ProhibitIcon as Ts, ArrowLeftIcon as Mt, PencilSimpleIcon as As, CaretLeftIcon as Ms, CaretRightIcon as Rs } from "@phosphor-icons/react";
6
6
  import C from "classnames";
7
- import { MessageActions as Ms, DefaultDropdownActionButton as Yt } from "stream-chat-react/experimental";
8
- import { LinkPreviewsManager as Lt } from "stream-chat";
9
- const qt = He({
7
+ import { MessageActions as Ls, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
8
+ import { LinkPreviewsManager as Rt } from "stream-chat";
9
+ const Yt = Ge({
10
10
  service: null,
11
11
  client: null,
12
12
  isConnected: !1,
@@ -16,7 +16,7 @@ const qt = He({
16
16
  refreshConnection: async () => {
17
17
  },
18
18
  debug: !1
19
- }), We = () => Te(qt), xi = ({
19
+ }), qe = () => Te(Yt), wi = ({
20
20
  children: e,
21
21
  user: t,
22
22
  serviceConfig: s,
@@ -25,8 +25,8 @@ const qt = He({
25
25
  debug: i = !1
26
26
  }) => {
27
27
  const o = W(
28
- (T, ...M) => {
29
- i && console.log(`🔥 [MessagingProvider] ${T}`, ...M);
28
+ (E, ...A) => {
29
+ i && console.log(`🔥 [MessagingProvider] ${E}`, ...A);
30
30
  },
31
31
  [i]
32
32
  );
@@ -36,84 +36,84 @@ const qt = 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), [_, v] = O(null), w = K(!1), y = K({
39
+ const [l, d] = D(null), [m, b] = D(null), [u, f] = D(!1), [c, g] = D(!1), [v, p] = D(null), N = H(!1), x = H({
40
40
  userId: t == null ? void 0 : t.id,
41
41
  apiKey: a,
42
42
  serviceConfig: s,
43
43
  capabilities: r
44
- }), S = K(0);
45
- S.current++, o("📊 RENDER INFO", {
46
- renderCount: S.current,
44
+ }), T = H(0);
45
+ T.current++, o("📊 RENDER INFO", {
46
+ renderCount: T.current,
47
47
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
48
48
  propChanges: {
49
- userChanged: y.current.userId !== (t == null ? void 0 : t.id),
50
- apiKeyChanged: y.current.apiKey !== a,
51
- serviceConfigChanged: y.current.serviceConfig !== s,
52
- capabilitiesChanged: y.current.capabilities !== r
49
+ userChanged: x.current.userId !== (t == null ? void 0 : t.id),
50
+ apiKeyChanged: x.current.apiKey !== a,
51
+ serviceConfigChanged: x.current.serviceConfig !== s,
52
+ capabilitiesChanged: x.current.capabilities !== r
53
53
  }
54
- }), y.current = {
54
+ }), x.current = {
55
55
  userId: t == null ? void 0 : t.id,
56
56
  apiKey: a,
57
57
  serviceConfig: s,
58
58
  capabilities: r
59
- }, J(() => {
60
- const T = S.current;
59
+ }, Y(() => {
60
+ const E = T.current;
61
61
  if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
62
- renderCount: T,
62
+ renderCount: E,
63
63
  apiKey: !!a,
64
64
  serviceConfig: !!s,
65
65
  dependencies: {
66
66
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
67
67
  serviceConfigRef: s,
68
- serviceConfigStable: y.current.serviceConfig === s,
69
- apiKeyStable: y.current.apiKey === a
68
+ serviceConfigStable: x.current.serviceConfig === s,
69
+ apiKeyStable: x.current.apiKey === a
70
70
  }
71
71
  }), !a || !s) {
72
72
  o("⚠️ SERVICE INIT SKIPPED", {
73
- renderCount: T,
73
+ renderCount: E,
74
74
  reason: "Missing apiKey or serviceConfig"
75
75
  });
76
76
  return;
77
77
  }
78
78
  o("🚀 CREATING NEW SERVICE", {
79
- renderCount: T,
79
+ renderCount: E,
80
80
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
81
- serviceConfigChanged: y.current.serviceConfig !== s
81
+ serviceConfigChanged: x.current.serviceConfig !== s
82
82
  });
83
- const M = new En({
83
+ const A = new Sn({
84
84
  ...s,
85
85
  apiKey: a,
86
86
  debug: i
87
87
  });
88
- return d(M), o("✅ SERVICE SET", {
89
- renderCount: T,
90
- serviceInstance: !!M
88
+ return d(A), o("✅ SERVICE SET", {
89
+ renderCount: E,
90
+ serviceInstance: !!A
91
91
  }), () => {
92
92
  o("🧹 SERVICE CLEANUP", {
93
- renderCount: T,
93
+ renderCount: E,
94
94
  reason: "Effect cleanup"
95
- }), M.disconnectUser().catch(console.error);
95
+ }), A.disconnectUser().catch(console.error);
96
96
  };
97
97
  }, [a, s, i, o]);
98
- const k = K(null);
99
- J(() => {
100
- var M, N;
98
+ const S = H(null);
99
+ Y(() => {
100
+ var A, y;
101
101
  if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
102
102
  hasService: !!l,
103
103
  hasUser: !!t,
104
104
  userId: t == null ? void 0 : t.id,
105
- isConnecting: w.current,
105
+ isConnecting: N.current,
106
106
  isConnected: u,
107
107
  dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
108
108
  }), !l || !t) {
109
109
  o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
110
110
  return;
111
111
  }
112
- if (w.current) {
112
+ if (N.current) {
113
113
  o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
114
114
  return;
115
115
  }
116
- if (((M = k.current) == null ? void 0 : M.serviceId) === l && ((N = k.current) == null ? void 0 : N.userId) === t.id) {
116
+ if (((A = S.current) == null ? void 0 : A.serviceId) === l && ((y = S.current) == null ? void 0 : y.userId) === t.id) {
117
117
  o(
118
118
  "⚠️ USER CONNECTION SKIPPED",
119
119
  "Already connected this user with this service"
@@ -121,40 +121,40 @@ const qt = He({
121
121
  return;
122
122
  }
123
123
  (async () => {
124
- o("🚀 STARTING USER CONNECTION", { userId: t.id }), w.current = !0, b(!0), v(null);
124
+ o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0), p(null);
125
125
  try {
126
126
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
127
- const E = await l.connectUser(t);
128
- g(E), f(!0), k.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
127
+ const _ = await l.connectUser(t);
128
+ b(_), f(!0), S.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
129
129
  userId: t.id,
130
- clientId: E.userID
130
+ clientId: _.userID
131
131
  });
132
- } catch (E) {
133
- const I = E instanceof Error ? E.message : "Connection failed";
134
- v(I), o("❌ USER CONNECTION ERROR", {
132
+ } catch (_) {
133
+ const I = _ instanceof Error ? _.message : "Connection failed";
134
+ p(I), o("❌ USER CONNECTION ERROR", {
135
135
  userId: t.id,
136
136
  error: I
137
137
  });
138
138
  } finally {
139
- b(!1), w.current = !1, o("🔄 USER CONNECTION FINISHED", {
139
+ g(!1), N.current = !1, o("🔄 USER CONNECTION FINISHED", {
140
140
  userId: t.id,
141
141
  isConnected: u
142
142
  });
143
143
  }
144
144
  })();
145
- }, [l, t, o, u]), J(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
145
+ }, [l, t, o, u]), Y(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
146
146
  hasService: !!l,
147
147
  isConnected: u
148
148
  }), () => {
149
149
  l && u ? (o(
150
150
  "🧹 CLEANUP EFFECT TRIGGERED",
151
151
  "Cleaning up connection on unmount"
152
- ), k.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
152
+ ), S.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
153
153
  hasService: !!l,
154
154
  isConnected: u
155
155
  });
156
156
  }), [l, u, o]);
157
- const A = W(async () => {
157
+ const R = W(async () => {
158
158
  if (o("🔄 REFRESH CONNECTION CALLED", {
159
159
  hasService: !!l,
160
160
  hasUser: !!t
@@ -162,52 +162,52 @@ const qt = 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 }), g(!0);
166
166
  try {
167
167
  o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
168
- const T = await l.connectUser(t);
169
- g(T), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
170
- } catch (T) {
171
- const M = T instanceof Error ? T.message : "Refresh failed";
172
- v(M), o("❌ CONNECTION REFRESH ERROR", {
168
+ const E = await l.connectUser(t);
169
+ b(E), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
170
+ } catch (E) {
171
+ const A = E instanceof Error ? E.message : "Refresh failed";
172
+ p(A), o("❌ CONNECTION REFRESH ERROR", {
173
173
  userId: t.id,
174
- error: M
174
+ error: A
175
175
  });
176
176
  } finally {
177
- b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
177
+ g(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
178
178
  }
179
- }, [l, t, o]), D = z.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
179
+ }, [l, t, o]), O = z.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
180
180
  hasService: !!l,
181
181
  hasClient: !!m,
182
182
  isConnected: u,
183
183
  isLoading: c,
184
- hasError: !!_,
184
+ hasError: !!v,
185
185
  capabilitiesKeys: Object.keys(r)
186
186
  }), {
187
187
  service: l,
188
188
  client: m,
189
189
  isConnected: u,
190
190
  isLoading: c,
191
- error: _,
191
+ error: v,
192
192
  capabilities: r,
193
- refreshConnection: A,
193
+ refreshConnection: R,
194
194
  debug: i
195
195
  }), [
196
196
  l,
197
197
  m,
198
198
  u,
199
199
  c,
200
- _,
200
+ v,
201
201
  r,
202
- A,
202
+ R,
203
203
  i,
204
204
  o
205
205
  ]);
206
206
  return o("🔄 RENDER END", {
207
- renderCount: S.current,
207
+ renderCount: T.current,
208
208
  willRenderChat: !!(m && u),
209
- contextValueReady: !!D
210
- }), /* @__PURE__ */ n(qt.Provider, { value: D, children: m && u ? /* @__PURE__ */ n(
209
+ contextValueReady: !!O
210
+ }), /* @__PURE__ */ n(Yt.Provider, { value: O, children: m && u ? /* @__PURE__ */ n(
211
211
  In,
212
212
  {
213
213
  client: m,
@@ -217,12 +217,12 @@ const qt = He({
217
217
  children: e
218
218
  }
219
219
  ) : e });
220
- }, Ds = () => We(), Wt = (e) => {
220
+ }, Ds = () => qe(), qt = (e) => {
221
221
  var a, r;
222
- const [t, s] = O(
222
+ const [t, s] = D(
223
223
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
224
224
  );
225
- return J(() => {
225
+ return Y(() => {
226
226
  var o;
227
227
  if (!e) {
228
228
  s(!1);
@@ -239,18 +239,18 @@ const qt = He({
239
239
  e.off("member.updated", i);
240
240
  };
241
241
  }, [e]), t;
242
- }, Rs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
243
- function Ls(e) {
244
- return Rs.test(e.trim());
242
+ }, Ps = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
243
+ function Os(e) {
244
+ return Ps.test(e.trim());
245
245
  }
246
- function Pt(e, t) {
246
+ function Lt(e, t) {
247
247
  const s = e == null ? void 0 : e.trim();
248
- return !s || t && s === t ? !1 : !Ls(s);
248
+ return !s || t && s === t ? !1 : !Os(s);
249
249
  }
250
- function Ae(e) {
251
- return Pt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Pt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
250
+ function Wt(e) {
251
+ return Lt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Lt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
252
252
  }
253
- const Ot = [
253
+ const Dt = [
254
254
  "🍎",
255
255
  // Apple
256
256
  "🍌",
@@ -278,7 +278,7 @@ const Ot = [
278
278
  "🍈"
279
279
  // Melon
280
280
  ];
281
- function Ps(e) {
281
+ function zs(e) {
282
282
  let t = 0;
283
283
  for (let s = 0; s < e.length; s++) {
284
284
  const a = e.charCodeAt(s);
@@ -286,11 +286,11 @@ function Ps(e) {
286
286
  }
287
287
  return Math.abs(t);
288
288
  }
289
- function Os(e) {
290
- const s = Ps(e) % Ot.length;
291
- return Ot[s];
289
+ function $s(e) {
290
+ const s = zs(e) % Dt.length;
291
+ return Dt[s];
292
292
  }
293
- const re = ({
293
+ const ae = ({
294
294
  id: e,
295
295
  image: t,
296
296
  size: s = 40,
@@ -299,7 +299,7 @@ const re = ({
299
299
  shape: i = "squircle",
300
300
  dmAgentEnabled: o = !1
301
301
  }) => {
302
- const l = Os(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
302
+ const l = $s(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", b = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
303
303
  "img",
304
304
  {
305
305
  src: t,
@@ -335,7 +335,7 @@ const re = ({
335
335
  {
336
336
  "aria-hidden": "true",
337
337
  className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
338
- children: /* @__PURE__ */ n(Be, { className: "size-3 text-yellow-600", weight: "duotone" })
338
+ children: /* @__PURE__ */ n(Fe, { className: "size-3 text-yellow-600", weight: "duotone" })
339
339
  }
340
340
  ),
341
341
  /* @__PURE__ */ n(
@@ -349,7 +349,7 @@ const re = ({
349
349
  style: {
350
350
  ...u,
351
351
  ...o && {
352
- borderWidth: `${g}px`,
352
+ borderWidth: `${b}px`,
353
353
  borderStyle: "solid",
354
354
  borderColor: "var(--AI-Gradient, #7F22FE)",
355
355
  boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
@@ -361,7 +361,96 @@ const re = ({
361
361
  ]
362
362
  }
363
363
  );
364
- }, Ce = ({
364
+ }, Fs = "https://linktr.ee/s/about/trust-center/report", Bs = ({
365
+ channel: e,
366
+ participant: t,
367
+ showBlockParticipant: s = !0,
368
+ enabled: a = !0,
369
+ onLeaveConversation: r,
370
+ onBlockParticipant: i,
371
+ onDeleteConversationClick: o,
372
+ onBlockParticipantClick: l,
373
+ onReportParticipantClick: d,
374
+ onActionComplete: m,
375
+ logLabel: b = "useChannelModerationActions"
376
+ }) => {
377
+ var y;
378
+ const { service: u, debug: f } = qe(), [c, g] = D(!1), [v, p] = D(!1), [N, x] = D(!1), [T, S] = D(!1);
379
+ return Y(() => {
380
+ var L;
381
+ if (!a || !s || !u || !((L = t == null ? void 0 : t.user) != null && L.id)) {
382
+ g(!1), p(!1);
383
+ return;
384
+ }
385
+ let _ = !1;
386
+ const I = t.user.id;
387
+ return p(!0), (async () => {
388
+ try {
389
+ const M = await u.getBlockedUsers();
390
+ if (_) return;
391
+ g(
392
+ M.some(
393
+ (j) => j.blocked_user_id === I
394
+ )
395
+ );
396
+ } catch (M) {
397
+ _ || console.error(`[${b}] Failed to check blocked status:`, M);
398
+ } finally {
399
+ _ || p(!1);
400
+ }
401
+ })(), () => {
402
+ _ = !0;
403
+ };
404
+ }, [a, u, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id, s, b]), {
405
+ isParticipantBlocked: c,
406
+ isCheckingBlockedStatus: v,
407
+ isLeaving: N,
408
+ isUpdatingBlockStatus: T,
409
+ handleLeaveConversation: async () => {
410
+ var _;
411
+ if (!N) {
412
+ o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), x(!0);
413
+ try {
414
+ const I = ((_ = e._client) == null ? void 0 : _.userID) ?? null;
415
+ await e.hide(I, !1), r && await r(e), m == null || m();
416
+ } catch (I) {
417
+ console.error(`[${b}] Failed to leave conversation`, I);
418
+ } finally {
419
+ x(!1);
420
+ }
421
+ }
422
+ },
423
+ handleBlockUser: async () => {
424
+ var _, I, L;
425
+ if (!(T || !u)) {
426
+ l == null || l(), f && console.log(`[${b}] Block member`, (_ = t == null ? void 0 : t.user) == null ? void 0 : _.id), S(!0);
427
+ try {
428
+ await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), m == null || m();
429
+ } catch (M) {
430
+ console.error(`[${b}] Failed to block member`, M);
431
+ } finally {
432
+ S(!1);
433
+ }
434
+ }
435
+ },
436
+ handleUnblockUser: async () => {
437
+ var _, I, L;
438
+ if (!(T || !u)) {
439
+ l == null || l(), f && console.log(`[${b}] Unblock member`, (_ = t == null ? void 0 : t.user) == null ? void 0 : _.id), S(!0);
440
+ try {
441
+ await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), m == null || m();
442
+ } catch (M) {
443
+ console.error(`[${b}] Failed to unblock member`, M);
444
+ } finally {
445
+ S(!1);
446
+ }
447
+ }
448
+ },
449
+ handleReportUser: () => {
450
+ d == null || d(), m == null || m(), window.open(Fs, "_blank", "noopener,noreferrer");
451
+ }
452
+ };
453
+ }, he = ({
365
454
  variant: e = "default",
366
455
  className: t,
367
456
  children: s,
@@ -378,235 +467,143 @@ const re = ({
378
467
  ...a,
379
468
  children: s
380
469
  }
381
- );
382
- function zs({ label: e, className: t, children: s, ...a }) {
383
- return /* @__PURE__ */ h(
384
- "button",
385
- {
386
- type: "button",
387
- className: C(
388
- "inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
389
- {
390
- "cursor-not-allowed opacity-50": a.disabled,
391
- "hover:bg-sand": !a.disabled
392
- },
393
- t
394
- ),
395
- ...a,
396
- children: [
397
- /* @__PURE__ */ n("span", { className: "sr-only", children: e }),
398
- s
399
- ]
400
- }
401
- );
402
- }
403
- function Fs({ onClick: e }) {
404
- return /* @__PURE__ */ n(zs, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(ve, { className: "h-5 w-5 text-stone", weight: "bold" }) });
405
- }
406
- const $s = ({
407
- dialogRef: e,
408
- onClose: t,
409
- participant: s,
410
- participantDisplayName: a,
411
- channel: r,
412
- followerStatusLabel: i,
413
- onLeaveConversation: o,
414
- onBlockParticipant: l,
415
- showDeleteConversation: d = !0,
416
- showBlockParticipant: m = !0,
417
- showReportParticipant: g = !0,
418
- onDeleteConversationClick: u,
419
- onBlockParticipantClick: f,
420
- onReportParticipantClick: c,
421
- customProfileContent: b,
422
- customChannelActions: _
470
+ ), Pt = ({
471
+ channel: e,
472
+ participant: t,
473
+ showDeleteConversation: s = !0,
474
+ showBlockParticipant: a = !0,
475
+ showReportParticipant: r = !0,
476
+ onLeaveConversation: i,
477
+ onBlockParticipant: o,
478
+ onDeleteConversationClick: l,
479
+ onBlockParticipantClick: d,
480
+ onReportParticipantClick: m,
481
+ customChannelActions: b,
482
+ triggerClassName: u
423
483
  }) => {
424
- var F, Y, q, $;
425
- const { service: v, debug: w } = We(), [y, S] = O(!1), [k, A] = O(!1), [D, T] = O(!1), M = W(async () => {
426
- var p;
427
- if (!(!m || !v || !((p = s == null ? void 0 : s.user) != null && p.id)))
428
- try {
429
- const L = (await v.getBlockedUsers()).some(
430
- (U) => {
431
- var R;
432
- return U.blocked_user_id === ((R = s == null ? void 0 : s.user) == null ? void 0 : R.id);
433
- }
434
- );
435
- S(L);
436
- } catch (x) {
437
- console.error(
438
- "[ChannelInfoDialog] Failed to check blocked status:",
439
- x
440
- );
441
- }
442
- }, [v, (F = s == null ? void 0 : s.user) == null ? void 0 : F.id, m]);
443
- J(() => {
444
- M();
445
- }, [M]);
446
- const N = async () => {
447
- var p;
448
- if (!k) {
449
- u == null || u(), w && console.log("[ChannelInfoDialog] Leave conversation", r.cid), A(!0);
450
- try {
451
- const x = ((p = r._client) == null ? void 0 : p.userID) ?? null;
452
- await r.hide(x, !1), o && await o(r), t();
453
- } catch (x) {
454
- console.error("[ChannelInfoDialog] Failed to leave conversation", x);
455
- } finally {
456
- A(!1);
457
- }
458
- }
459
- }, E = async () => {
460
- var p, x, L;
461
- if (!(D || !v)) {
462
- f == null || f(), w && console.log("[ChannelInfoDialog] Block member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), T(!0);
463
- try {
464
- await v.blockUser((x = s == null ? void 0 : s.user) == null ? void 0 : x.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
465
- } catch (U) {
466
- console.error("[ChannelInfoDialog] Failed to block member", U);
467
- } finally {
468
- T(!1);
469
- }
470
- }
471
- }, I = async () => {
472
- var p, x, L;
473
- if (!(D || !v)) {
474
- f == null || f(), w && console.log("[ChannelInfoDialog] Unblock member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), T(!0);
475
- try {
476
- await v.unBlockUser((x = s == null ? void 0 : s.user) == null ? void 0 : x.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
477
- } catch (U) {
478
- console.error("[ChannelInfoDialog] Failed to unblock member", U);
479
- } finally {
480
- T(!1);
484
+ const [f, c] = D(!1), g = H(null), v = En(), p = W(() => c(!1), []), {
485
+ isParticipantBlocked: N,
486
+ isCheckingBlockedStatus: x,
487
+ isLeaving: T,
488
+ isUpdatingBlockStatus: S,
489
+ handleLeaveConversation: R,
490
+ handleBlockUser: O,
491
+ handleUnblockUser: E,
492
+ handleReportUser: A
493
+ } = Bs({
494
+ channel: e,
495
+ participant: t,
496
+ showBlockParticipant: a,
497
+ enabled: f,
498
+ onLeaveConversation: i,
499
+ onBlockParticipant: o,
500
+ onDeleteConversationClick: l,
501
+ onBlockParticipantClick: d,
502
+ onReportParticipantClick: m,
503
+ onActionComplete: p,
504
+ logLabel: "ChannelActionsMenu"
505
+ });
506
+ return Y(() => {
507
+ if (!f) return;
508
+ const _ = (L) => {
509
+ g.current && !g.current.contains(L.target) && c(!1);
510
+ }, I = (L) => {
511
+ L.key === "Escape" && c(!1);
512
+ };
513
+ return document.addEventListener("mousedown", _), document.addEventListener("keydown", I), () => {
514
+ document.removeEventListener("mousedown", _), document.removeEventListener("keydown", I);
515
+ };
516
+ }, [f]), !t || !(s || a || r || !!b) ? null : /* @__PURE__ */ h("div", { ref: g, className: "relative", children: [
517
+ /* @__PURE__ */ h(
518
+ "button",
519
+ {
520
+ className: u,
521
+ type: "button",
522
+ "aria-haspopup": "true",
523
+ "aria-expanded": f,
524
+ "aria-controls": f ? v : void 0,
525
+ onClick: () => c((_) => !_),
526
+ children: [
527
+ /* @__PURE__ */ n(ds, { className: "size-5 text-black/90" }),
528
+ /* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
529
+ ]
481
530
  }
482
- }
483
- }, B = () => {
484
- c == null || c(), t(), window.open(
485
- "https://linktr.ee/s/about/trust-center/report",
486
- "_blank",
487
- "noopener,noreferrer"
488
- );
489
- };
490
- if (!s) return null;
491
- const P = a ?? Ae(s.user), Z = (Y = s.user) == null ? void 0 : Y.image, G = (q = s.user) == null ? void 0 : q.username, H = G ? `linktr.ee/${G}` : void 0, j = (($ = s.user) == null ? void 0 : $.id) || "unknown";
492
- return (
493
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
494
- /* @__PURE__ */ n(
495
- "dialog",
531
+ ),
532
+ f && /* @__PURE__ */ n(
533
+ "div",
496
534
  {
497
- ref: e,
498
- className: "mes-dialog group",
499
- onClose: t,
500
- onClick: (p) => {
501
- p.target === e.current && t();
502
- },
503
- 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: [
504
- /* @__PURE__ */ h("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
505
- /* @__PURE__ */ n("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
506
- /* @__PURE__ */ n(Fs, { onClick: t })
507
- ] }),
508
- /* @__PURE__ */ h("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
509
- /* @__PURE__ */ h(
510
- "div",
511
- {
512
- className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
513
- style: { backgroundColor: "#FBFAF9" },
514
- children: [
515
- /* @__PURE__ */ h("div", { className: "flex items-center gap-3 w-full", children: [
516
- /* @__PURE__ */ n(
517
- re,
518
- {
519
- id: j,
520
- name: P,
521
- image: Z,
522
- size: 88,
523
- shape: "circle"
524
- }
525
- ),
526
- /* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 flex-1", children: [
527
- /* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: P }),
528
- H && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: H }),
529
- i && !b && /* @__PURE__ */ n(
530
- "span",
531
- {
532
- className: "mt-1 rounded-full text-xs font-normal w-fit",
533
- style: {
534
- padding: "4px 8px",
535
- backgroundColor: i === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
536
- color: i === "Subscribed to you" ? "#008236" : "#78716C",
537
- lineHeight: "133.333%",
538
- letterSpacing: "0.21px"
539
- },
540
- children: i
541
- }
542
- )
543
- ] })
544
- ] }),
545
- b && /* @__PURE__ */ n("div", { className: "w-full", children: b })
546
- ]
547
- }
548
- ),
549
- /* @__PURE__ */ h("ul", { className: "flex flex-col gap-2 mt-2", children: [
550
- d && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
551
- Ce,
552
- {
553
- onClick: N,
554
- disabled: k,
555
- "aria-busy": k,
556
- children: [
557
- k ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(cs, { className: "h-5 w-5" }),
558
- /* @__PURE__ */ n("span", { children: "Delete Conversation" })
559
- ]
560
- }
561
- ) }),
562
- m && /* @__PURE__ */ n("li", { children: y ? /* @__PURE__ */ h(
563
- Ce,
564
- {
565
- onClick: I,
566
- disabled: D,
567
- "aria-busy": D,
568
- children: [
569
- D ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
570
- /* @__PURE__ */ n("span", { children: "Unblock" })
571
- ]
572
- }
573
- ) : /* @__PURE__ */ h(
574
- Ce,
575
- {
576
- onClick: E,
577
- disabled: D,
578
- "aria-busy": D,
579
- children: [
580
- D ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
581
- /* @__PURE__ */ n("span", { children: "Block" })
582
- ]
583
- }
584
- ) }),
585
- g && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(Ce, { variant: "danger", onClick: B, children: [
586
- /* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
587
- /* @__PURE__ */ n("span", { children: "Report" })
588
- ] }) }),
589
- _
535
+ id: v,
536
+ "aria-label": "Conversation options",
537
+ className: C(
538
+ "absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
539
+ "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
540
+ ),
541
+ children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
542
+ s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
543
+ he,
544
+ {
545
+ onClick: R,
546
+ disabled: T,
547
+ "aria-busy": T,
548
+ children: [
549
+ T ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(us, { className: "h-5 w-5" }),
550
+ /* @__PURE__ */ n("span", { children: "Delete Conversation" })
551
+ ]
552
+ }
553
+ ) }),
554
+ a && /* @__PURE__ */ n("li", { children: x ? (
555
+ // Block status not yet resolved — show a disabled placeholder
556
+ // so a premature click can't act on a stale block state.
557
+ /* @__PURE__ */ h(he, { disabled: !0, "aria-busy": !0, children: [
558
+ /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }),
559
+ /* @__PURE__ */ n("span", { children: "Block" })
590
560
  ] })
591
- ] })
561
+ ) : N ? /* @__PURE__ */ h(
562
+ he,
563
+ {
564
+ onClick: E,
565
+ disabled: S,
566
+ "aria-busy": S,
567
+ children: [
568
+ S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
569
+ /* @__PURE__ */ n("span", { children: "Unblock" })
570
+ ]
571
+ }
572
+ ) : /* @__PURE__ */ h(
573
+ he,
574
+ {
575
+ onClick: O,
576
+ disabled: S,
577
+ "aria-busy": S,
578
+ children: [
579
+ S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
580
+ /* @__PURE__ */ n("span", { children: "Block" })
581
+ ]
582
+ }
583
+ ) }),
584
+ r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: A, children: [
585
+ /* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
586
+ /* @__PURE__ */ n("span", { children: "Report" })
587
+ ] }) }),
588
+ b
592
589
  ] })
593
590
  }
594
591
  )
595
- );
596
- }, Bs = (e) => /* @__PURE__ */ n(Sn, { ...e, position: "center" }), Ve = "vote_up", Ge = "vote_down";
592
+ ] });
593
+ }, Us = (e) => /* @__PURE__ */ n(Tn, { ...e, position: "center" }), je = "vote_up", Ve = "vote_down";
597
594
  function js(e) {
598
- return e != null && e.length ? e.some((t) => t.type === Ge) ? "down" : e.some((t) => t.type === Ve) ? "up" : null : null;
595
+ return e != null && e.length ? e.some((t) => t.type === Ve) ? "down" : e.some((t) => t.type === je) ? "up" : null : null;
599
596
  }
600
- function Us(e) {
601
- const { channel: t } = de(), { client: s } = qe("useMessageVote"), a = se(
597
+ function Vs(e) {
598
+ const { channel: t } = ce(), { client: s } = Ye("useMessageVote"), a = ee(
602
599
  () => js(e.own_reactions),
603
600
  [e.own_reactions]
604
601
  ), r = W(async () => {
605
602
  if (s != null && s.userID)
606
603
  try {
607
- a === "up" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
604
+ a === "up" ? await t.deleteReaction(e.id, je) : await t.sendReaction(
608
605
  e.id,
609
- { type: Ve },
606
+ { type: je },
610
607
  { enforce_unique: !0, skip_push: !0 }
611
608
  );
612
609
  } catch {
@@ -614,9 +611,9 @@ function Us(e) {
614
611
  }, [t, s == null ? void 0 : s.userID, e.id, a]), i = W(async () => {
615
612
  if (s != null && s.userID)
616
613
  try {
617
- a === "down" ? await t.deleteReaction(e.id, Ge) : await t.sendReaction(
614
+ a === "down" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
618
615
  e.id,
619
- { type: Ge },
616
+ { type: Ve },
620
617
  { enforce_unique: !0, skip_push: !0 }
621
618
  );
622
619
  } catch {
@@ -624,7 +621,7 @@ function Us(e) {
624
621
  }, [t, s == null ? void 0 : s.userID, e.id, a]);
625
622
  return { selected: a, voteUp: r, voteDown: i };
626
623
  }
627
- function Vs(e) {
624
+ function Gs(e) {
628
625
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
629
626
  }
630
627
  function Xt({
@@ -632,16 +629,16 @@ function Xt({
632
629
  viewerLanguage: t
633
630
  }) {
634
631
  var r;
635
- const s = e == null ? void 0 : e.text, a = Vs(t);
632
+ const s = e == null ? void 0 : e.text, a = Gs(t);
636
633
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
637
634
  }
638
- const Gs = z.lazy(() => import("./Card-DQYLHbDI.js")), Hs = z.lazy(() => import("./Card-DTaHgygz.js")), Ys = z.lazy(() => import("./Card-bdnjL_4d.js")), Xe = () => /* @__PURE__ */ n(
635
+ const Hs = z.lazy(() => import("./Card-D_2VQScd.js")), Ys = z.lazy(() => import("./Card-D_G8133I.js")), qs = z.lazy(() => import("./Card-BAc2cgtn.js")), We = () => /* @__PURE__ */ n(
639
636
  "div",
640
637
  {
641
638
  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)]",
642
639
  "aria-hidden": !0
643
640
  }
644
- ), qs = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Gs, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Hs, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(Ye, { fallback: /* @__PURE__ */ n(Xe, {}), children: /* @__PURE__ */ n(Ys, { ...e }) }), Ws = Kt, Xs = Jt, zt = { Composer: qs, Sent: Kt, Received: Jt, Creator: Ws, Visitor: Xs }, Ks = [
641
+ ), Ws = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Hs, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Ys, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Xs = Kt, Ks = Jt, Ot = { Composer: Ws, Sent: Kt, Received: Jt, Creator: Xs, Visitor: Ks }, Js = [
645
642
  [/pdf/, "pdf"],
646
643
  [/wordprocessingml|msword|\.doc/, "doc"],
647
644
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -651,42 +648,42 @@ const Gs = z.lazy(() => import("./Card-DQYLHbDI.js")), Hs = z.lazy(() => import(
651
648
  [/plain|rtf/, "text"],
652
649
  [/markdown/, "markdown"]
653
650
  ];
654
- function ie(e) {
651
+ function ne(e) {
655
652
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
656
653
  }
657
654
  function Zt(e) {
658
- const t = Ks.find(
655
+ const t = Js.find(
659
656
  ([s]) => s.test(e)
660
657
  );
661
658
  return t ? t[1] : "generic";
662
659
  }
663
- const Js = {
664
- video: Ht,
665
- audio: us,
666
- image: ds,
667
- document: Gt
668
- }, Zs = {
669
- pdf: xs,
670
- doc: vs,
671
- xls: ps,
672
- csv: bs,
673
- ppt: gs,
674
- zip: fs,
675
- text: hs,
676
- markdown: ms,
677
- generic: Gt
660
+ const Zs = {
661
+ video: Gt,
662
+ audio: hs,
663
+ image: ms,
664
+ document: Vt
665
+ }, Qs = {
666
+ pdf: Ns,
667
+ doc: ws,
668
+ xls: xs,
669
+ csv: vs,
670
+ ppt: ps,
671
+ zip: bs,
672
+ text: gs,
673
+ markdown: fs,
674
+ generic: Vt
678
675
  };
679
- function Qs(e) {
680
- const t = ie(e);
681
- return t !== "document" ? Js[t] : Zs[Zt(e)];
676
+ function ea(e) {
677
+ const t = ne(e);
678
+ return t !== "document" ? Zs[t] : Qs[Zt(e)];
682
679
  }
683
- function ce(e, t) {
684
- return z.createElement(Qs(e), t);
680
+ function le(e, t) {
681
+ return z.createElement(ea(e), t);
685
682
  }
686
- const ea = (e) => {
683
+ const ta = (e) => {
687
684
  var t, s;
688
685
  return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
689
- }, ta = ({
686
+ }, na = ({
690
687
  source: e,
691
688
  mimeType: t,
692
689
  poster: s,
@@ -698,78 +695,78 @@ const ea = (e) => {
698
695
  muted: d = !1,
699
696
  onContainerClick: m
700
697
  }) => {
701
- const g = ie(t), u = K(null), f = K(null), c = K(null), b = K(r), [_, v] = O(a), [w, y] = O(0), [S, k] = O(!1), [A, D] = O(!1), [T, M] = O(!1), [N, E] = O(!1), [I, B] = O(!0), [P, Z] = O(null), G = W(() => {
702
- M(!1), v(!0);
703
- }, []), H = W((p) => {
704
- const x = f.current;
705
- if (!x) return 0;
706
- const L = x.getBoundingClientRect();
698
+ const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [v, p] = D(a), [N, x] = D(0), [T, S] = D(!1), [R, O] = D(!1), [E, A] = D(!1), [y, _] = D(!1), [I, L] = D(!0), [M, j] = D(null), V = W(() => {
699
+ A(!1), p(!0);
700
+ }, []), G = W((w) => {
701
+ const k = f.current;
702
+ if (!k) return 0;
703
+ const B = k.getBoundingClientRect();
707
704
  return Math.max(
708
705
  0,
709
- Math.min(1, (ea(p) - L.left) / L.width)
706
+ Math.min(1, (ta(w) - B.left) / B.width)
710
707
  );
711
- }, []), j = W((p) => {
712
- const x = u.current;
713
- x && x.duration && (x.currentTime = p * x.duration);
714
- }, []), F = (p) => {
715
- p.stopPropagation(), k(!0);
716
- const x = H(p);
717
- y(x), j(x);
708
+ }, []), $ = W((w) => {
709
+ const k = u.current;
710
+ k && k.duration && (k.currentTime = w * k.duration);
711
+ }, []), F = (w) => {
712
+ w.stopPropagation(), S(!0);
713
+ const k = G(w);
714
+ x(k), $(k);
718
715
  };
719
- J(() => {
720
- r !== void 0 && r !== b.current && (b.current = r, v(r));
721
- }, [r]), J(() => {
722
- if (!_) {
716
+ Y(() => {
717
+ r !== void 0 && r !== g.current && (g.current = r, p(r));
718
+ }, [r]), Y(() => {
719
+ if (!v) {
723
720
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
724
721
  return;
725
722
  }
726
- const p = () => {
727
- const x = u.current;
728
- x && x.duration && !S && y(x.currentTime / x.duration), c.current = requestAnimationFrame(p);
723
+ const w = () => {
724
+ const k = u.current;
725
+ k && k.duration && !T && x(k.currentTime / k.duration), c.current = requestAnimationFrame(w);
729
726
  };
730
- return c.current = requestAnimationFrame(p), () => {
727
+ return c.current = requestAnimationFrame(w), () => {
731
728
  c.current !== null && cancelAnimationFrame(c.current);
732
729
  };
733
- }, [_, S]), J(() => {
734
- const p = u.current;
735
- p && (_ ? p.play().catch((x) => {
736
- v(!1), M(!0);
737
- }) : p.pause());
738
- }, [_]), J(() => {
739
- if (!S) return;
740
- const p = (L) => y(H(L)), x = (L) => {
741
- k(!1), j(H(L));
730
+ }, [v, T]), Y(() => {
731
+ const w = u.current;
732
+ w && (v ? w.play().catch((k) => {
733
+ p(!1), A(!0);
734
+ }) : w.pause());
735
+ }, [v]), Y(() => {
736
+ if (!T) return;
737
+ const w = (B) => x(G(B)), k = (B) => {
738
+ S(!1), $(G(B));
742
739
  };
743
- return window.addEventListener("mousemove", p), window.addEventListener("mouseup", x), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", x), () => {
744
- window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", x), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", x);
740
+ return window.addEventListener("mousemove", w), window.addEventListener("mouseup", k), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", k), () => {
741
+ window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", k);
745
742
  };
746
- }, [S, H, j]);
747
- const Y = P ? { aspectRatio: String(P) } : void 0, q = P ? "" : " aspect-video", $ = Math.round(w * 100);
743
+ }, [T, G, $]);
744
+ const X = M ? { aspectRatio: String(M) } : void 0, U = M ? "" : " aspect-video", P = Math.round(N * 100);
748
745
  return /* @__PURE__ */ h(
749
746
  "div",
750
747
  {
751
748
  role: "button",
752
749
  tabIndex: 0,
753
- className: `relative cursor-pointer overflow-hidden bg-black ${q}`,
754
- style: Y,
755
- onClick: (p) => {
750
+ className: `relative cursor-pointer overflow-hidden bg-black ${U}`,
751
+ style: X,
752
+ onClick: (w) => {
756
753
  if (m) {
757
- m(p);
754
+ m(w);
758
755
  return;
759
756
  }
760
- T || o && v((x) => !x);
757
+ E || o && p((k) => !k);
761
758
  },
762
- onKeyDown: (p) => {
763
- if (!(p.key !== "Enter" && p.key !== " ")) {
764
- if (p.preventDefault(), m) {
765
- m(p);
759
+ onKeyDown: (w) => {
760
+ if (!(w.key !== "Enter" && w.key !== " ")) {
761
+ if (w.preventDefault(), m) {
762
+ m(w);
766
763
  return;
767
764
  }
768
- T || o && v((x) => !x);
765
+ E || o && p((k) => !k);
769
766
  }
770
767
  },
771
768
  children: [
772
- s && (g === "audio" || I) && /* @__PURE__ */ n(
769
+ s && (b === "audio" || I) && /* @__PURE__ */ n(
773
770
  "img",
774
771
  {
775
772
  src: s,
@@ -777,11 +774,11 @@ const ea = (e) => {
777
774
  className: "absolute inset-0 h-full w-full object-cover"
778
775
  }
779
776
  ),
780
- !s && (g === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
777
+ !s && (b === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
781
778
  className: "size-12 text-black/20",
782
779
  weight: "regular"
783
780
  }) }),
784
- /* @__PURE__ */ n("div", { className: "absolute inset-0", children: g === "audio" ? /* @__PURE__ */ n(
781
+ /* @__PURE__ */ n("div", { className: "absolute inset-0", children: b === "audio" ? /* @__PURE__ */ n(
785
782
  "audio",
786
783
  {
787
784
  ref: u,
@@ -789,14 +786,14 @@ const ea = (e) => {
789
786
  loop: i,
790
787
  muted: d,
791
788
  style: { width: "100%", height: "100%" },
792
- onLoadStart: () => E(!0),
789
+ onLoadStart: () => _(!0),
793
790
  onCanPlay: () => {
794
- E(!1), B(!1);
791
+ _(!1), L(!1);
795
792
  },
796
- onWaiting: () => E(!0),
797
- onPlay: () => M(!1),
793
+ onWaiting: () => _(!0),
794
+ onPlay: () => A(!1),
798
795
  onEnded: () => {
799
- i || (v(!1), y(0));
796
+ i || (p(!1), x(0));
800
797
  },
801
798
  children: /* @__PURE__ */ n("track", { kind: "captions" })
802
799
  }
@@ -809,43 +806,43 @@ const ea = (e) => {
809
806
  muted: d,
810
807
  playsInline: !0,
811
808
  style: { width: "100%", height: "100%" },
812
- onLoadStart: () => E(!0),
809
+ onLoadStart: () => _(!0),
813
810
  onCanPlay: () => {
814
- E(!1), B(!1);
811
+ _(!1), L(!1);
815
812
  },
816
- onWaiting: () => E(!0),
817
- onPlay: () => M(!1),
813
+ onWaiting: () => _(!0),
814
+ onPlay: () => A(!1),
818
815
  onLoadedMetadata: () => {
819
- const p = u.current;
820
- p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && Z(p.videoWidth / p.videoHeight);
816
+ const w = u.current;
817
+ w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && j(w.videoWidth / w.videoHeight);
821
818
  },
822
819
  onEnded: () => {
823
- i || (v(!1), y(0));
820
+ i || (p(!1), x(0));
824
821
  },
825
822
  children: /* @__PURE__ */ n("track", { kind: "captions" })
826
823
  }
827
824
  ) }),
828
- N && !T && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
825
+ y && !E && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
829
826
  ge,
830
827
  {
831
828
  className: "size-8 animate-spin text-white/80",
832
829
  weight: "bold"
833
830
  }
834
831
  ) }),
835
- T && !o && /* @__PURE__ */ n(
832
+ E && !o && /* @__PURE__ */ n(
836
833
  "div",
837
834
  {
838
835
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
839
836
  role: "button",
840
837
  tabIndex: 0,
841
838
  "aria-label": "Play preview",
842
- onClick: (p) => {
843
- p.stopPropagation(), G();
839
+ onClick: (w) => {
840
+ w.stopPropagation(), V();
844
841
  },
845
- onKeyDown: (p) => {
846
- p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), G());
842
+ onKeyDown: (w) => {
843
+ w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), V());
847
844
  },
848
- 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(je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
845
+ 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" }) })
849
846
  }
850
847
  ),
851
848
  l && !o && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
@@ -853,7 +850,7 @@ const ea = (e) => {
853
850
  {
854
851
  role: "slider",
855
852
  "aria-label": "Playback position",
856
- "aria-valuenow": $,
853
+ "aria-valuenow": P,
857
854
  "aria-valuemin": 0,
858
855
  "aria-valuemax": 100,
859
856
  tabIndex: 0,
@@ -861,15 +858,15 @@ const ea = (e) => {
861
858
  className: "relative flex h-4 w-full cursor-pointer items-center",
862
859
  onMouseDown: F,
863
860
  onTouchStart: F,
864
- onClick: (p) => p.stopPropagation(),
865
- onKeyDown: (p) => {
866
- p.key === "ArrowRight" && j(Math.min(1, w + 0.05)), p.key === "ArrowLeft" && j(Math.max(0, w - 0.05));
861
+ onClick: (w) => w.stopPropagation(),
862
+ onKeyDown: (w) => {
863
+ w.key === "ArrowRight" && $(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, N - 0.05));
867
864
  },
868
865
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
869
866
  "div",
870
867
  {
871
868
  className: "h-full rounded-full bg-white",
872
- style: { width: `${$}%` }
869
+ style: { width: `${P}%` }
873
870
  }
874
871
  ) })
875
872
  }
@@ -879,12 +876,12 @@ const ea = (e) => {
879
876
  "button",
880
877
  {
881
878
  type: "button",
882
- onClick: (p) => {
883
- p.stopPropagation(), v((x) => !x);
879
+ onClick: (w) => {
880
+ w.stopPropagation(), p((k) => !k);
884
881
  },
885
882
  className: "shrink-0 text-white",
886
- "aria-label": _ ? "Pause" : "Play",
887
- children: _ ? /* @__PURE__ */ n(ws, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(je, { className: "size-5 translate-x-px", weight: "fill" })
883
+ "aria-label": v ? "Pause" : "Play",
884
+ children: v ? /* @__PURE__ */ n(_s, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Be, { className: "size-5 translate-x-px", weight: "fill" })
888
885
  }
889
886
  ),
890
887
  /* @__PURE__ */ h(
@@ -892,7 +889,7 @@ const ea = (e) => {
892
889
  {
893
890
  role: "slider",
894
891
  "aria-label": "Playback position",
895
- "aria-valuenow": $,
892
+ "aria-valuenow": P,
896
893
  "aria-valuemin": 0,
897
894
  "aria-valuemax": 100,
898
895
  tabIndex: 0,
@@ -900,22 +897,22 @@ const ea = (e) => {
900
897
  className: "relative flex h-4 w-full cursor-pointer items-center",
901
898
  onMouseDown: F,
902
899
  onTouchStart: F,
903
- onClick: (p) => p.stopPropagation(),
904
- onMouseEnter: () => D(!0),
905
- onMouseLeave: () => D(!1),
906
- onKeyDown: (p) => {
907
- p.key === "ArrowRight" && j(Math.min(1, w + 0.05)), p.key === "ArrowLeft" && j(Math.max(0, w - 0.05));
900
+ onClick: (w) => w.stopPropagation(),
901
+ onMouseEnter: () => O(!0),
902
+ onMouseLeave: () => O(!1),
903
+ onKeyDown: (w) => {
904
+ w.key === "ArrowRight" && $(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, N - 0.05));
908
905
  },
909
906
  children: [
910
907
  /* @__PURE__ */ n(
911
908
  "div",
912
909
  {
913
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${A || S ? "h-1.5" : "h-1"}`,
910
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${R || T ? "h-1.5" : "h-1"}`,
914
911
  children: /* @__PURE__ */ n(
915
912
  "div",
916
913
  {
917
914
  className: "h-full rounded-full bg-white",
918
- style: { width: `${$}%` }
915
+ style: { width: `${P}%` }
919
916
  }
920
917
  )
921
918
  }
@@ -923,8 +920,8 @@ const ea = (e) => {
923
920
  /* @__PURE__ */ n(
924
921
  "div",
925
922
  {
926
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${A || S ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
927
- style: { left: `${$}%` }
923
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${R || T ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
924
+ style: { left: `${P}%` }
928
925
  }
929
926
  )
930
927
  ]
@@ -934,7 +931,7 @@ const ea = (e) => {
934
931
  ]
935
932
  }
936
933
  );
937
- }, Ft = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", na = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Qt = ({
934
+ }, zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", sa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Qt = ({
938
935
  mimeType: e,
939
936
  sourceUrl: t,
940
937
  thumbnailUrl: s,
@@ -943,9 +940,9 @@ const ea = (e) => {
943
940
  mediaPlayerProps: i,
944
941
  containedImage: o = !1
945
942
  }) => {
946
- const l = ie(e), [d, m] = O(!1);
943
+ const l = ne(e), [d, m] = D(!1);
947
944
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
948
- ta,
945
+ na,
949
946
  {
950
947
  source: t,
951
948
  mimeType: e,
@@ -991,12 +988,12 @@ const ea = (e) => {
991
988
  "div",
992
989
  {
993
990
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
994
- children: ce(e, {
995
- className: Ft(r),
991
+ children: le(e, {
992
+ className: zt(r),
996
993
  weight: "regular"
997
994
  })
998
995
  }
999
- ) : s ? /* @__PURE__ */ n("div", { className: `relative ${na(r)}`, children: /* @__PURE__ */ n(
996
+ ) : s ? /* @__PURE__ */ n("div", { className: `relative ${sa(r)}`, children: /* @__PURE__ */ n(
1000
997
  "img",
1001
998
  {
1002
999
  src: s,
@@ -1008,8 +1005,8 @@ const ea = (e) => {
1008
1005
  "div",
1009
1006
  {
1010
1007
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1011
- children: ce(e, {
1012
- className: Ft(r),
1008
+ children: le(e, {
1009
+ className: zt(r),
1013
1010
  weight: "regular"
1014
1011
  })
1015
1012
  }
@@ -1025,14 +1022,14 @@ const ea = (e) => {
1025
1022
  action: l,
1026
1023
  topLeft: d,
1027
1024
  topRight: m,
1028
- rootRef: g,
1025
+ rootRef: b,
1029
1026
  "data-testid": u
1030
1027
  }) => {
1031
- const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
1028
+ const f = e === "dark", c = f ? s ?? a : s ?? "", g = f && !s;
1032
1029
  return /* @__PURE__ */ h(
1033
1030
  "div",
1034
1031
  {
1035
- ref: g,
1032
+ ref: b,
1036
1033
  "data-testid": u,
1037
1034
  className: C(
1038
1035
  "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)]",
@@ -1048,14 +1045,14 @@ const ea = (e) => {
1048
1045
  {
1049
1046
  className: C("mb-0.5 truncate text-base font-medium", {
1050
1047
  "text-black": !f,
1051
- "text-white/30": f && b,
1052
- "text-white": f && !b
1048
+ "text-white/30": f && g,
1049
+ "text-white": f && !g
1053
1050
  }),
1054
1051
  children: c
1055
1052
  }
1056
1053
  ),
1057
1054
  /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
1058
- ce(r, {
1055
+ le(r, {
1059
1056
  className: C(
1060
1057
  "size-5 shrink-0",
1061
1058
  f ? "text-white/55" : "text-black/55"
@@ -1083,25 +1080,25 @@ const ea = (e) => {
1083
1080
  function tn(e) {
1084
1081
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1085
1082
  }
1086
- function Ke(e) {
1083
+ function Xe(e) {
1087
1084
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
1088
1085
  }
1089
- function sa(e) {
1086
+ function aa(e) {
1090
1087
  return e ? "bg-white/10" : "bg-black/5";
1091
1088
  }
1092
- function aa(e) {
1089
+ function ra(e) {
1093
1090
  return e ? "text-white" : "text-black";
1094
1091
  }
1095
- function ra(e) {
1092
+ function ia(e) {
1096
1093
  return e ? "text-white/55" : "text-black/55";
1097
1094
  }
1098
- function ia(e) {
1095
+ function oa(e) {
1099
1096
  return e ? "text-white/40" : "text-black/40";
1100
1097
  }
1101
- function oa(e) {
1098
+ function la(e) {
1102
1099
  return e ? "text-white/20" : "text-black/20";
1103
1100
  }
1104
- const Je = ({ attachment: e, isMyMessage: t }) => {
1101
+ const Ke = ({ attachment: e, isMyMessage: t }) => {
1105
1102
  const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(z.Fragment, { children: [
1106
1103
  /* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
1107
1104
  "img",
@@ -1113,14 +1110,14 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
1113
1110
  ) : /* @__PURE__ */ n(
1114
1111
  "div",
1115
1112
  {
1116
- className: `aspect-video w-full rounded-[20px] ${sa(t)} flex items-center justify-center`,
1117
- children: /* @__PURE__ */ n(Ns, { className: `size-12 ${oa(t)}` })
1113
+ className: `aspect-video w-full rounded-[20px] ${aa(t)} flex items-center justify-center`,
1114
+ children: /* @__PURE__ */ n(ys, { className: `size-12 ${la(t)}` })
1118
1115
  }
1119
1116
  ) }),
1120
1117
  /* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
1121
- s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${aa(t)}`, children: s }),
1122
- a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${ra(t)}`, children: a }),
1123
- d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ia(t)}`, children: d })
1118
+ s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${ra(t)}`, children: s }),
1119
+ a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${ia(t)}`, children: a }),
1120
+ d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${oa(t)}`, children: d })
1124
1121
  ] })
1125
1122
  ] });
1126
1123
  return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
@@ -1128,11 +1125,11 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
1128
1125
  function nn(e) {
1129
1126
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1130
1127
  }
1131
- function Ze(e) {
1128
+ function Je(e) {
1132
1129
  var t;
1133
1130
  return (t = e.attachments) == null ? void 0 : t.find(nn);
1134
1131
  }
1135
- async function la(e, t) {
1132
+ async function ca(e, t) {
1136
1133
  let s;
1137
1134
  try {
1138
1135
  s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
@@ -1144,11 +1141,11 @@ async function la(e, t) {
1144
1141
  const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
1145
1142
  o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
1146
1143
  }
1147
- const ca = ({
1144
+ const da = ({
1148
1145
  url: e,
1149
1146
  filename: t
1150
1147
  }) => {
1151
- const [s, a] = O(!1);
1148
+ const [s, a] = D(!1);
1152
1149
  return /* @__PURE__ */ n(
1153
1150
  "button",
1154
1151
  {
@@ -1156,7 +1153,7 @@ const ca = ({
1156
1153
  onClick: (i) => {
1157
1154
  i.stopPropagation();
1158
1155
  const o = window.open("", "_blank", "noopener,noreferrer");
1159
- a(!0), la(e, t).then(() => {
1156
+ a(!0), ca(e, t).then(() => {
1160
1157
  o == null || o.close();
1161
1158
  }).catch(() => {
1162
1159
  o && (o.location.href = e);
@@ -1171,25 +1168,25 @@ const ca = ({
1171
1168
  }
1172
1169
  );
1173
1170
  };
1174
- function Qe(e) {
1175
- var u, f, c, b;
1171
+ function Ze(e) {
1172
+ var u, f, c, g;
1176
1173
  const t = (u = e.attachments) == null ? void 0 : u.find(
1177
- (_) => _.type === "video" && _.asset_url
1174
+ (v) => v.type === "video" && v.asset_url
1178
1175
  ), s = (f = e.attachments) == null ? void 0 : f.find(
1179
- (_) => _.type === "image" && _.image_url
1176
+ (v) => v.type === "image" && v.image_url
1180
1177
  ), a = (c = e.attachments) == null ? void 0 : c.find(
1181
- (_) => _.type === "audio" && _.asset_url
1182
- ), r = (b = e.attachments) == null ? void 0 : b.find(
1183
- (_) => _.type === "file" && _.asset_url
1178
+ (v) => v.type === "audio" && v.asset_url
1179
+ ), r = (g = e.attachments) == null ? void 0 : g.find(
1180
+ (v) => v.type === "file" && v.asset_url
1184
1181
  ), 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);
1185
1182
  if (!o) return null;
1186
- const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
1183
+ const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, b = t == null ? void 0 : t.thumb_url;
1187
1184
  return {
1188
1185
  resolvedUrl: o,
1189
1186
  resolvedType: l,
1190
1187
  title: d,
1191
1188
  fileSize: m,
1192
- thumbnailUrl: g
1189
+ thumbnailUrl: b
1193
1190
  };
1194
1191
  }
1195
1192
  const sn = ({
@@ -1227,7 +1224,7 @@ const sn = ({
1227
1224
  fileSize: a,
1228
1225
  thumbnailUrl: r
1229
1226
  }) => {
1230
- const i = ie(t), o = a !== void 0 ? tn(a) : void 0;
1227
+ const i = ne(t), o = a !== void 0 ? tn(a) : void 0;
1231
1228
  return /* @__PURE__ */ n(
1232
1229
  en,
1233
1230
  {
@@ -1246,17 +1243,17 @@ const sn = ({
1246
1243
  containedImage: i === "image" || i === "document"
1247
1244
  }
1248
1245
  ),
1249
- action: /* @__PURE__ */ n(ca, { url: e, filename: s })
1246
+ action: /* @__PURE__ */ n(da, { url: e, filename: s })
1250
1247
  }
1251
1248
  );
1252
- }, da = ({
1249
+ }, ua = ({
1253
1250
  message: e,
1254
1251
  isMyMessage: t = !1
1255
1252
  }) => {
1256
- const s = Ze(e), a = Qe(e);
1253
+ const s = Je(e), a = Ze(e);
1257
1254
  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: [
1258
1255
  !t && e.user && /* @__PURE__ */ n(
1259
- re,
1256
+ ae,
1260
1257
  {
1261
1258
  className: "str-chat__avatar str-chat__message-sender-avatar",
1262
1259
  id: e.user.id,
@@ -1274,40 +1271,40 @@ const sn = ({
1274
1271
  {
1275
1272
  className: "str-chat__message-bubble",
1276
1273
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1277
- children: s ? /* @__PURE__ */ n("div", { className: Ke(t), children: /* @__PURE__ */ n(Je, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
1274
+ children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(Ke, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
1278
1275
  }
1279
1276
  ) })
1280
1277
  }
1281
1278
  )
1282
1279
  ] });
1283
- }, ua = ({
1280
+ }, ma = ({
1284
1281
  message: e
1285
1282
  }) => {
1286
- const t = Ze(e);
1283
+ const t = Je(e);
1287
1284
  if (t)
1288
- return /* @__PURE__ */ n("div", { className: Ke(!0), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !0 }) });
1289
- const s = Qe(e);
1285
+ return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !0 }) });
1286
+ const s = Ze(e);
1290
1287
  return s ? /* @__PURE__ */ n(sn, { ...s }) : null;
1291
- }, ma = ({
1288
+ }, ha = ({
1292
1289
  message: e
1293
1290
  }) => {
1294
- const t = Ze(e);
1291
+ const t = Je(e);
1295
1292
  if (t)
1296
- return /* @__PURE__ */ n("div", { className: Ke(!1), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !1 }) });
1297
- const s = Qe(e);
1293
+ return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !1 }) });
1294
+ const s = Ze(e);
1298
1295
  return s ? /* @__PURE__ */ n(an, { ...s }) : null;
1299
- }, wi = Object.assign(da, {
1300
- Creator: ua,
1301
- Visitor: ma
1302
- }), ha = {
1296
+ }, Ni = Object.assign(ua, {
1297
+ Creator: ma,
1298
+ Visitor: ha
1299
+ }), fa = {
1303
1300
  isUnlocking: () => !1
1304
- }, fa = {
1305
- LockedAttachment: ha
1306
- }, rn = He({}), Ni = rn.Provider;
1307
- function ga(e) {
1308
- return Te(rn)[e] ?? fa[e];
1301
+ }, ga = {
1302
+ LockedAttachment: fa
1303
+ }, rn = Ge({}), _i = rn.Provider;
1304
+ function ba(e) {
1305
+ return Te(rn)[e] ?? ga[e];
1309
1306
  }
1310
- const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1307
+ const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1311
1308
  "svg",
1312
1309
  {
1313
1310
  width: e,
@@ -1324,22 +1321,22 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1324
1321
  }
1325
1322
  )
1326
1323
  }
1327
- ), pa = (e) => {
1324
+ ), va = (e) => {
1328
1325
  var t;
1329
1326
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
1330
- }, va = (e) => {
1327
+ }, xa = (e) => {
1331
1328
  var t;
1332
1329
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
1333
1330
  }, ke = (e) => {
1334
1331
  var t;
1335
1332
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
1336
- }, xa = (e) => {
1333
+ }, wa = (e) => {
1337
1334
  var t;
1338
1335
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
1339
- }, on = (e) => pa(e) || va(e), wa = (e) => {
1336
+ }, on = (e) => va(e) || xa(e), Na = (e) => {
1340
1337
  var t;
1341
1338
  return on(e) && !((t = e.text) != null && t.trim());
1342
- }, Oe = ({
1339
+ }, Pe = ({
1343
1340
  message: e,
1344
1341
  standalone: t = !1,
1345
1342
  isMyMessage: s = !1,
@@ -1352,25 +1349,25 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1352
1349
  if (r) {
1353
1350
  const f = (u = e.metadata) == null ? void 0 : u.amount_text;
1354
1351
  if (!f) return null;
1355
- const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
1352
+ const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", g = t ? `${f} tip` : `Delivered with ${f} tip`;
1356
1353
  return /* @__PURE__ */ h("div", { className: c, children: [
1357
- /* @__PURE__ */ n(_s, { size: t ? 14 : 12 }),
1358
- /* @__PURE__ */ n("span", { children: b })
1354
+ /* @__PURE__ */ n(Cs, { size: t ? 14 : 12 }),
1355
+ /* @__PURE__ */ n("span", { children: g })
1359
1356
  ] });
1360
1357
  }
1361
1358
  const o = s && a, l = o ? "Sent with AI" : "Sent with DM Agent", d = [
1362
1359
  "message-chatbot-indicator",
1363
1360
  s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
1364
1361
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
1365
- ].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 }) });
1366
- return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(ae, { children: [
1362
+ ].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), b = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(pa, { size: o ? 12 : 15 }) });
1363
+ return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(te, { children: [
1367
1364
  m,
1368
- g
1369
- ] }) : /* @__PURE__ */ h(ae, { children: [
1370
- g,
1365
+ b
1366
+ ] }) : /* @__PURE__ */ h(te, { children: [
1367
+ b,
1371
1368
  m
1372
1369
  ] }) });
1373
- }, Na = ({
1370
+ }, _a = ({
1374
1371
  selected: e,
1375
1372
  onVoteUp: t,
1376
1373
  onVoteDown: s
@@ -1386,7 +1383,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1386
1383
  "aria-label": "Good response",
1387
1384
  "aria-pressed": e === "up",
1388
1385
  "data-tooltip": "Good response",
1389
- children: /* @__PURE__ */ n(ys, { size: 16, weight: e === "up" ? "fill" : "regular" })
1386
+ children: /* @__PURE__ */ n(ks, { size: 16, weight: e === "up" ? "fill" : "regular" })
1390
1387
  }
1391
1388
  ),
1392
1389
  /* @__PURE__ */ n(
@@ -1400,11 +1397,11 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1400
1397
  "aria-label": "Bad response",
1401
1398
  "aria-pressed": e === "down",
1402
1399
  "data-tooltip": "Bad response",
1403
- children: /* @__PURE__ */ n(Cs, { size: 16, weight: e === "down" ? "fill" : "regular" })
1400
+ children: /* @__PURE__ */ n(Es, { size: 16, weight: e === "down" ? "fill" : "regular" })
1404
1401
  }
1405
1402
  )
1406
- ] }), _a = (e) => {
1407
- var ft, gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et, It;
1403
+ ] }), ya = (e) => {
1404
+ var ht, ft, gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et;
1408
1405
  const {
1409
1406
  additionalMessageInputProps: t,
1410
1407
  chatbotVotingEnabled: s,
@@ -1415,77 +1412,77 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1415
1412
  handleAction: l,
1416
1413
  handleOpenThread: d,
1417
1414
  handleRetry: m,
1418
- highlighted: g,
1415
+ highlighted: b,
1419
1416
  isMessageAIGenerated: u,
1420
1417
  isMyMessage: f,
1421
1418
  message: c,
1422
- renderText: b,
1423
- threadList: _,
1424
- viewerLanguage: v
1425
- } = e, { client: w } = qe("CustomMessage"), { channel: y } = de("CustomMessage"), { isUnlocking: S, onUnlockClick: k, onFetchSource: A, onDownloadClick: D } = ga("LockedAttachment"), [T, M] = O(!1), N = An(c.id), { selected: E, voteUp: I, voteDown: B } = Us(c), {
1426
- Attachment: P = Mn,
1427
- EditMessageModal: Z = Dn,
1428
- MessageActions: G,
1429
- MessageBlocked: H = Rn,
1430
- MessageBouncePrompt: j = Ln,
1431
- MessageDeleted: F = Pn,
1432
- MessageIsThreadReplyInChannelButtonIndicator: Y = On,
1433
- MessageRepliesCountButton: q = zn,
1434
- ReminderNotification: $ = Fn,
1435
- StreamedMessageText: p = $n,
1436
- PinIndicator: x
1437
- } = Ut("CustomMessage"), L = Bn(c), U = jn(c), R = se(
1419
+ renderText: g,
1420
+ threadList: v,
1421
+ viewerLanguage: p
1422
+ } = e, { client: N } = Ye("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking: T, onUnlockClick: S, onFetchSource: R, onDownloadClick: O } = ba("LockedAttachment"), [E, A] = D(!1), y = Mn(c.id), { selected: _, voteUp: I, voteDown: L } = Vs(c), {
1423
+ Attachment: M = Rn,
1424
+ EditMessageModal: j = Ln,
1425
+ MessageActions: V,
1426
+ MessageBlocked: G = Dn,
1427
+ MessageBouncePrompt: $ = Pn,
1428
+ MessageDeleted: F = On,
1429
+ MessageIsThreadReplyInChannelButtonIndicator: X = zn,
1430
+ MessageRepliesCountButton: U = $n,
1431
+ ReminderNotification: P = Fn,
1432
+ StreamedMessageText: w = Bn,
1433
+ PinIndicator: k
1434
+ } = Ut("CustomMessage"), B = Un(c), q = jn(c), _e = ee(
1438
1435
  () => u == null ? void 0 : u(c),
1439
1436
  [u, c]
1440
- ), V = se(() => {
1441
- const he = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...he] : he;
1437
+ ), K = ee(() => {
1438
+ const me = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...me] : me;
1442
1439
  if (!ke(c)) return ye;
1443
- const St = ye.filter((Tt) => !("type" in Tt) || !nn(Tt));
1440
+ const St = ye.filter((It) => !("type" in It) || !nn(It));
1444
1441
  return St.length === ye.length ? ye : St;
1445
- }, [c]), X = se(() => {
1446
- const he = Xt({ message: c, viewerLanguage: v });
1447
- return he === c.text ? c : { ...c, text: he };
1448
- }, [c, v]);
1449
- if (Un(c))
1442
+ }, [c]), re = ee(() => {
1443
+ const me = Xt({ message: c, viewerLanguage: p });
1444
+ return me === c.text ? c : { ...c, text: me };
1445
+ }, [c, p]);
1446
+ if (Vn(c))
1450
1447
  return null;
1451
1448
  if (c.deleted_at || c.type === "deleted")
1452
1449
  return /* @__PURE__ */ n(F, { message: c });
1453
- if (Vn(c))
1454
- return /* @__PURE__ */ n(H, {});
1455
- const Q = !_ && !!c.reply_count, te = !_ && c.show_in_channel && c.parent_id, ee = c.status === "failed" && ((ft = c.error) == null ? void 0 : ft.status) !== 403, ct = Gn(c);
1456
- let oe;
1457
- ee ? oe = () => m(c) : ct && (oe = () => M(!0));
1458
- const ue = f(), kn = C(
1450
+ if (Gn(c))
1451
+ return /* @__PURE__ */ n(G, {});
1452
+ const J = !v && !!c.reply_count, se = !v && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Hn(c);
1453
+ let ie;
1454
+ Q ? ie = () => m(c) : lt && (ie = () => A(!0));
1455
+ const de = f(), kn = C(
1459
1456
  "str-chat__message str-chat__message-simple",
1460
1457
  `str-chat__message--${c.type}`,
1461
1458
  `str-chat__message--${c.status}`,
1462
- ue ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1459
+ de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1463
1460
  c.text ? "str-chat__message--has-text" : "has-no-text",
1464
1461
  {
1465
- "str-chat__message--has-attachment": L,
1466
- "str-chat__message--highlighted": g,
1462
+ "str-chat__message--has-attachment": B,
1463
+ "str-chat__message--highlighted": b,
1467
1464
  "str-chat__message--pinned pinned-message": c.pinned,
1468
- "str-chat__message--with-reactions": U,
1469
- "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((gt = c == null ? void 0 : c.error) == null ? void 0 : gt.status) !== 403,
1470
- "str-chat__message-with-thread-link": Q || te,
1465
+ "str-chat__message--with-reactions": q,
1466
+ "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((ft = c == null ? void 0 : c.error) == null ? void 0 : ft.status) !== 403,
1467
+ "str-chat__message-with-thread-link": J || se,
1471
1468
  "str-chat__virtual-message__wrapper--end": r,
1472
1469
  "str-chat__virtual-message__wrapper--first": i,
1473
1470
  "str-chat__virtual-message__wrapper--group": o
1474
1471
  }
1475
- ), dt = c.poll_id && w.polls.fromState(c.poll_id), ut = wa(c), me = ke(c), mt = xa(c), De = !!(V != null && V.length && !c.quoted_message), ht = me && ue && De;
1476
- return /* @__PURE__ */ h(ae, { children: [
1472
+ ), ct = c.poll_id && N.polls.fromState(c.poll_id), dt = Na(c), ue = ke(c), ut = wa(c), Re = !!(K != null && K.length && !c.quoted_message), mt = ue && de && Re;
1473
+ return /* @__PURE__ */ h(te, { children: [
1477
1474
  a && /* @__PURE__ */ n(
1478
- Z,
1475
+ j,
1479
1476
  {
1480
1477
  additionalMessageInputProps: t
1481
1478
  }
1482
1479
  ),
1483
- T && /* @__PURE__ */ n(
1484
- Hn,
1480
+ E && /* @__PURE__ */ n(
1481
+ Yn,
1485
1482
  {
1486
- MessageBouncePrompt: j,
1487
- onClose: () => M(!1),
1488
- open: T
1483
+ MessageBouncePrompt: $,
1484
+ onClose: () => A(!1),
1485
+ open: E
1489
1486
  }
1490
1487
  ),
1491
1488
  /* @__PURE__ */ h(
@@ -1494,10 +1491,10 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1494
1491
  className: kn,
1495
1492
  "data-message-id": c.id,
1496
1493
  children: [
1497
- x && /* @__PURE__ */ n(x, {}),
1498
- !!N && /* @__PURE__ */ n($, { reminder: N }),
1494
+ k && /* @__PURE__ */ n(k, {}),
1495
+ !!y && /* @__PURE__ */ n(P, { reminder: y }),
1499
1496
  c.user && /* @__PURE__ */ n(
1500
- re,
1497
+ ae,
1501
1498
  {
1502
1499
  className: "str-chat__avatar str-chat__message-sender-avatar",
1503
1500
  id: c.user.id,
@@ -1505,183 +1502,183 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1505
1502
  name: c.user.name || c.user.id,
1506
1503
  size: 24,
1507
1504
  shape: "circle",
1508
- dmAgentEnabled: me
1505
+ dmAgentEnabled: ue
1509
1506
  }
1510
1507
  ),
1511
1508
  /* @__PURE__ */ n(
1512
1509
  "div",
1513
1510
  {
1514
1511
  className: C("str-chat__message-inner", {
1515
- "str-chat__simple-message--error-failed": ee || ct
1512
+ "str-chat__simple-message--error-failed": Q || lt
1516
1513
  }),
1517
1514
  "data-testid": "message-inner",
1518
- onClick: oe,
1519
- onKeyDown: oe,
1520
- role: oe ? "button" : void 0,
1521
- tabIndex: oe ? 0 : void 0,
1515
+ onClick: ie,
1516
+ onKeyDown: ie,
1517
+ role: ie ? "button" : void 0,
1518
+ tabIndex: ie ? 0 : void 0,
1522
1519
  style: {
1523
1520
  // Force margins to 0 to prevent hover layout shift
1524
1521
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
1525
1522
  marginInlineEnd: 0,
1526
1523
  marginInlineStart: 0
1527
1524
  },
1528
- children: mt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1529
- ue ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1530
- G && /* @__PURE__ */ n(G, {}),
1525
+ children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1526
+ de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1527
+ V && /* @__PURE__ */ n(V, {}),
1531
1528
  /* @__PURE__ */ n(
1532
- zt.Sent,
1529
+ Ot.Sent,
1533
1530
  {
1534
- title: (bt = c.metadata) == null ? void 0 : bt.attachment_title,
1535
- mimeType: (pt = c.metadata) == null ? void 0 : pt.attachment_mime_type,
1536
- thumbnailUrl: (vt = c.metadata) == null ? void 0 : vt.attachment_thumbnail,
1537
- amountText: (xt = c.metadata) == null ? void 0 : xt.amount_text,
1538
- detail: (wt = c.metadata) == null ? void 0 : wt.attachment_detail,
1539
- paymentStatus: (Nt = c.metadata) == null ? void 0 : Nt.payment_status,
1540
- onPreviewClick: () => k == null ? void 0 : k(c, y),
1541
- onFetchSource: async () => await (A == null ? void 0 : A(c, y))
1531
+ title: (gt = c.metadata) == null ? void 0 : gt.attachment_title,
1532
+ mimeType: (bt = c.metadata) == null ? void 0 : bt.attachment_mime_type,
1533
+ thumbnailUrl: (pt = c.metadata) == null ? void 0 : pt.attachment_thumbnail,
1534
+ amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
1535
+ detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
1536
+ paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
1537
+ onPreviewClick: () => S == null ? void 0 : S(c, x),
1538
+ onFetchSource: async () => await (R == null ? void 0 : R(c, x))
1542
1539
  }
1543
1540
  )
1544
1541
  ] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1545
1542
  /* @__PURE__ */ n(
1546
- zt.Received,
1543
+ Ot.Received,
1547
1544
  {
1548
- title: (_t = c.metadata) == null ? void 0 : _t.attachment_title,
1549
- mimeType: (yt = c.metadata) == null ? void 0 : yt.attachment_mime_type,
1550
- thumbnailUrl: (Ct = c.metadata) == null ? void 0 : Ct.attachment_thumbnail,
1551
- amountText: (kt = c.metadata) == null ? void 0 : kt.amount_text,
1552
- detail: (Et = c.metadata) == null ? void 0 : Et.attachment_detail,
1553
- paymentStatus: (It = c.metadata) == null ? void 0 : It.payment_status,
1554
- isUnlocking: S(c.id),
1555
- onUnlockClick: () => k == null ? void 0 : k(c, y),
1556
- onFetchSource: async () => await (A == null ? void 0 : A(c, y)),
1557
- onDownloadClick: () => D == null ? void 0 : D(c, y)
1545
+ title: (Nt = c.metadata) == null ? void 0 : Nt.attachment_title,
1546
+ mimeType: (_t = c.metadata) == null ? void 0 : _t.attachment_mime_type,
1547
+ thumbnailUrl: (yt = c.metadata) == null ? void 0 : yt.attachment_thumbnail,
1548
+ amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
1549
+ detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
1550
+ paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
1551
+ isUnlocking: T(c.id),
1552
+ onUnlockClick: () => S == null ? void 0 : S(c, x),
1553
+ onFetchSource: async () => await (R == null ? void 0 : R(c, x)),
1554
+ onDownloadClick: () => O == null ? void 0 : O(c, x)
1558
1555
  }
1559
1556
  ),
1560
- G && /* @__PURE__ */ n(G, {})
1557
+ V && /* @__PURE__ */ n(V, {})
1561
1558
  ] }),
1562
1559
  c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
1563
- At,
1560
+ Tt,
1564
1561
  {
1565
- message: X,
1566
- renderText: b
1562
+ message: re,
1563
+ renderText: g
1567
1564
  }
1568
1565
  ) })
1569
- ] }) : ut ? (
1566
+ ] }) : dt ? (
1570
1567
  /* Tip-only messages render as a standalone bubble */
1571
- /* @__PURE__ */ n(Oe, { message: c, standalone: !0 })
1568
+ /* @__PURE__ */ n(Pe, { message: c, standalone: !0 })
1572
1569
  ) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
1573
- me && !ht && /* @__PURE__ */ n(
1574
- Oe,
1570
+ ue && !mt && /* @__PURE__ */ n(
1571
+ Pe,
1575
1572
  {
1576
1573
  message: c,
1577
- hasAttachment: De,
1578
- isMyMessage: ue
1574
+ hasAttachment: Re,
1575
+ isMyMessage: de
1579
1576
  }
1580
1577
  ),
1581
- dt && /* @__PURE__ */ n(Yn, { poll: dt }),
1582
- V != null && V.length && !c.quoted_message ? /* @__PURE__ */ n(
1583
- P,
1578
+ ct && /* @__PURE__ */ n(qn, { poll: ct }),
1579
+ K != null && K.length && !c.quoted_message ? /* @__PURE__ */ n(
1580
+ M,
1584
1581
  {
1585
1582
  actionHandler: l,
1586
- attachments: V
1583
+ attachments: K
1587
1584
  }
1588
1585
  ) : null,
1589
- R ? /* @__PURE__ */ n(
1590
- p,
1586
+ _e ? /* @__PURE__ */ n(
1587
+ w,
1591
1588
  {
1592
- message: X,
1593
- renderText: b
1589
+ message: re,
1590
+ renderText: g
1594
1591
  }
1595
1592
  ) : /* @__PURE__ */ n(
1596
- At,
1593
+ Tt,
1597
1594
  {
1598
- message: X,
1599
- renderText: b
1595
+ message: re,
1596
+ renderText: g
1600
1597
  }
1601
1598
  ),
1602
- /* @__PURE__ */ n(qn, {})
1599
+ /* @__PURE__ */ n(Wn, {})
1603
1600
  ] }) })
1604
1601
  }
1605
1602
  ),
1606
- !mt && !ut && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
1607
- (!me || ht) && /* @__PURE__ */ n(
1608
- Oe,
1603
+ !ut && !dt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
1604
+ (!ue || mt) && /* @__PURE__ */ n(
1605
+ Pe,
1609
1606
  {
1610
1607
  message: c,
1611
- hasAttachment: De,
1612
- isMyMessage: ue
1608
+ hasAttachment: Re,
1609
+ isMyMessage: de
1613
1610
  }
1614
1611
  ),
1615
- s && me && /* @__PURE__ */ n(
1616
- Na,
1612
+ s && ue && /* @__PURE__ */ n(
1613
+ _a,
1617
1614
  {
1618
- selected: E,
1615
+ selected: _,
1619
1616
  onVoteUp: I,
1620
- onVoteDown: B
1617
+ onVoteDown: L
1621
1618
  }
1622
1619
  )
1623
1620
  ] }),
1624
- Q && /* @__PURE__ */ n(
1625
- q,
1621
+ J && /* @__PURE__ */ n(
1622
+ U,
1626
1623
  {
1627
1624
  onClick: d,
1628
1625
  reply_count: c.reply_count
1629
1626
  }
1630
1627
  ),
1631
- te && /* @__PURE__ */ n(Y, {})
1628
+ se && /* @__PURE__ */ n(X, {})
1632
1629
  ]
1633
1630
  },
1634
1631
  c.id
1635
1632
  )
1636
1633
  ] });
1637
- }, ya = z.memo(
1638
- _a,
1639
- (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Tn(e, t)
1640
- ), Ca = (e) => {
1634
+ }, Ca = z.memo(
1635
+ ya,
1636
+ (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : An(e, t)
1637
+ ), ka = (e) => {
1641
1638
  const t = pe("CustomMessage");
1642
- return /* @__PURE__ */ n(ya, { ...t, ...e });
1643
- }, ka = () => {
1639
+ return /* @__PURE__ */ n(Ca, { ...t, ...e });
1640
+ }, Ea = () => {
1644
1641
  var s;
1645
1642
  const { handleDelete: e, message: t } = pe("CustomMessageActions");
1646
1643
  return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
1647
- Yt,
1644
+ Ht,
1648
1645
  {
1649
1646
  onClick: e,
1650
1647
  "aria-label": "Delete",
1651
1648
  title: "Delete",
1652
1649
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
1653
- children: /* @__PURE__ */ n(ks, { size: 16, weight: "light", "aria-hidden": !0 })
1650
+ children: /* @__PURE__ */ n(Ss, { size: 16, weight: "light", "aria-hidden": !0 })
1654
1651
  }
1655
1652
  );
1656
- }, Ea = () => {
1653
+ }, Sa = () => {
1657
1654
  const { handleFlag: e } = pe("CustomMessageActions");
1658
1655
  return /* @__PURE__ */ n(
1659
- Yt,
1656
+ Ht,
1660
1657
  {
1661
1658
  onClick: e,
1662
1659
  "aria-label": "Report",
1663
1660
  title: "Report",
1664
1661
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
1665
- children: /* @__PURE__ */ n(Vt, { size: 16, weight: "light", "aria-hidden": !0 })
1662
+ children: /* @__PURE__ */ n(jt, { size: 16, weight: "light", "aria-hidden": !0 })
1666
1663
  }
1667
1664
  );
1668
1665
  }, Ia = () => {
1669
1666
  var t;
1670
1667
  const { message: e } = pe("CustomMessageActions");
1671
1668
  return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
1672
- Ms,
1669
+ Ls,
1673
1670
  {
1674
1671
  messageActionSet: [
1675
- { Component: ka, placement: "quick", type: "delete" },
1676
- { Component: Ea, placement: "quick", type: "flag" }
1672
+ { Component: Ea, placement: "quick", type: "delete" },
1673
+ { Component: Sa, placement: "quick", type: "flag" }
1677
1674
  ]
1678
1675
  }
1679
1676
  );
1680
- }, Sa = (e) => ({
1677
+ }, Ta = (e) => ({
1681
1678
  linkPreviews: Array.from(e.previews.values()).filter(
1682
- (t) => Lt.previewIsLoaded(t) || Lt.previewIsLoading(t)
1679
+ (t) => Rt.previewIsLoaded(t) || Rt.previewIsLoading(t)
1683
1680
  )
1684
- }), Ta = ({
1681
+ }), Aa = ({
1685
1682
  link: e,
1686
1683
  onDismiss: t
1687
1684
  }) => {
@@ -1711,7 +1708,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1711
1708
  },
1712
1709
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
1713
1710
  "aria-label": "Close link preview",
1714
- children: /* @__PURE__ */ n(ve, { className: "size-4 text-black/90" })
1711
+ children: /* @__PURE__ */ n(Ae, { className: "size-4 text-black/90" })
1715
1712
  }
1716
1713
  ),
1717
1714
  /* @__PURE__ */ h("div", { className: "p-2", children: [
@@ -1721,22 +1718,22 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1721
1718
  ]
1722
1719
  }
1723
1720
  );
1724
- }, Aa = () => {
1725
- const { linkPreviewsManager: e } = Wn(), { linkPreviews: t } = Xn(
1721
+ }, Ma = () => {
1722
+ const { linkPreviewsManager: e } = Xn(), { linkPreviews: t } = Kn(
1726
1723
  e.state,
1727
- Sa
1724
+ Ta
1728
1725
  ), s = (r) => {
1729
1726
  e.dismissPreview(r);
1730
1727
  };
1731
1728
  return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
1732
- Ta,
1729
+ Aa,
1733
1730
  {
1734
1731
  link: r,
1735
1732
  onDismiss: s
1736
1733
  },
1737
1734
  r.og_scrape_url
1738
1735
  )) }) : null;
1739
- }, ln = z.createContext(!1), Ma = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1736
+ }, ln = z.createContext(!1), Ra = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1740
1737
  "button",
1741
1738
  {
1742
1739
  ...s,
@@ -1744,20 +1741,20 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1744
1741
  "aria-label": "Send",
1745
1742
  disabled: t,
1746
1743
  onClick: e,
1747
- children: /* @__PURE__ */ n(Es, { weight: "bold", className: "size-4" })
1744
+ children: /* @__PURE__ */ n(Is, { weight: "bold", className: "size-4" })
1748
1745
  }
1749
- ), Da = () => {
1750
- const e = Te(ln), { handleSubmit: t } = Jn(), s = Zn(), a = e || !s, {
1751
- SendButton: r = Ma,
1752
- AttachmentPreviewList: i = Qn
1746
+ ), La = () => {
1747
+ const e = Te(ln), { handleSubmit: t } = Zn(), s = Qn(), a = e || !s, {
1748
+ SendButton: r = Ra,
1749
+ AttachmentPreviewList: i = es
1753
1750
  } = Ut("CustomMessageInput");
1754
1751
  return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
1755
- /* @__PURE__ */ n(es, {}),
1756
- /* @__PURE__ */ n(Aa, {}),
1752
+ /* @__PURE__ */ n(ts, {}),
1753
+ /* @__PURE__ */ n(Ma, {}),
1757
1754
  /* @__PURE__ */ n(i, {}),
1758
1755
  /* @__PURE__ */ h("div", { className: "flex", children: [
1759
1756
  /* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
1760
- ts,
1757
+ ns,
1761
1758
  {
1762
1759
  "aria-disabled": e || void 0,
1763
1760
  className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
@@ -1780,15 +1777,15 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1780
1777
  )
1781
1778
  ] })
1782
1779
  ] });
1783
- }, Ra = ({
1780
+ }, Da = ({
1784
1781
  renderActions: e,
1785
1782
  renderFooter: t,
1786
1783
  disabled: s = !1,
1787
1784
  disabledReason: a
1788
1785
  }) => {
1789
1786
  var o;
1790
- const { channel: r } = de(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
1791
- return s ? /* @__PURE__ */ h(ae, { children: [
1787
+ const { channel: r } = ce(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
1788
+ return s ? /* @__PURE__ */ h(te, { children: [
1792
1789
  /* @__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 }),
1793
1790
  t == null ? void 0 : t()
1794
1791
  ] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
@@ -1800,23 +1797,23 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1800
1797
  className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
1801
1798
  children: [
1802
1799
  e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
1803
- /* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(Kn, { Input: Da }) })
1800
+ /* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(Jn, { Input: La }) })
1804
1801
  ]
1805
1802
  }
1806
1803
  ),
1807
1804
  t == null ? void 0 : t()
1808
1805
  ] });
1809
- }, La = [
1806
+ }, Pa = [
1810
1807
  "SYSTEM_DM_AGENT_PAUSED",
1811
1808
  "SYSTEM_DM_AGENT_RESUMED"
1812
- ], Pa = {
1809
+ ], Oa = {
1813
1810
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1814
1811
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1815
- }, Oa = [
1812
+ }, za = [
1816
1813
  "SYSTEM_AGE_SAFETY_BLOCKED"
1817
- ], za = {
1814
+ ], $a = {
1818
1815
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1819
- }, ze = "age safety guidelines.", Fa = "https://linktr.ee/s/about/contact", $t = (e) => La.includes(e), $a = (e) => Oa.includes(e), Ba = (e) => {
1816
+ }, Oe = "age safety guidelines.", Fa = "https://linktr.ee/s/about/contact", $t = (e) => Pa.includes(e), Ba = (e) => za.includes(e), Ua = (e) => {
1820
1817
  var a;
1821
1818
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
1822
1819
  if ($t(t))
@@ -1824,7 +1821,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1824
1821
  kind: "dm-agent",
1825
1822
  type: t
1826
1823
  };
1827
- if ($a(t))
1824
+ if (Ba(t))
1828
1825
  return {
1829
1826
  kind: "age-safety",
1830
1827
  type: t
@@ -1836,11 +1833,11 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1836
1833
  type: s
1837
1834
  };
1838
1835
  }, ja = (e) => {
1839
- const t = e.indexOf(ze);
1836
+ const t = e.indexOf(Oe);
1840
1837
  if (t === -1)
1841
1838
  return e;
1842
- const s = t + ze.length;
1843
- return /* @__PURE__ */ h(ae, { children: [
1839
+ const s = t + Oe.length;
1840
+ return /* @__PURE__ */ h(te, { children: [
1844
1841
  e.slice(0, t),
1845
1842
  /* @__PURE__ */ n(
1846
1843
  "a",
@@ -1849,18 +1846,18 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1849
1846
  target: "_blank",
1850
1847
  rel: "noopener noreferrer",
1851
1848
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1852
- children: ze
1849
+ children: Oe
1853
1850
  }
1854
1851
  ),
1855
1852
  e.slice(s)
1856
1853
  ] });
1857
- }, Ua = (e) => {
1854
+ }, Va = (e) => {
1858
1855
  var a, r;
1859
- const t = e.message.hide_date === !0, s = Ba(
1856
+ const t = e.message.hide_date === !0, s = Ua(
1860
1857
  e.message
1861
1858
  );
1862
1859
  if ((s == null ? void 0 : s.kind) === "dm-agent") {
1863
- const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Pa[s.type];
1860
+ const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Oa[s.type];
1864
1861
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1865
1862
  /* @__PURE__ */ h(
1866
1863
  "div",
@@ -1882,11 +1879,11 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1882
1879
  ]
1883
1880
  }
1884
1881
  ),
1885
- !t && /* @__PURE__ */ n(Re, { message: e.message })
1882
+ !t && /* @__PURE__ */ n(Le, { message: e.message })
1886
1883
  ] });
1887
1884
  }
1888
1885
  if ((s == null ? void 0 : s.kind) === "age-safety") {
1889
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || za[s.type];
1886
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || $a[s.type];
1890
1887
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1891
1888
  /* @__PURE__ */ h(
1892
1889
  "div",
@@ -1896,7 +1893,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1896
1893
  "data-age-safety-system-type": s.type,
1897
1894
  children: [
1898
1895
  /* @__PURE__ */ n(
1899
- Is,
1896
+ Ts,
1900
1897
  {
1901
1898
  size: 24,
1902
1899
  weight: "duotone",
@@ -1909,7 +1906,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1909
1906
  ]
1910
1907
  }
1911
1908
  ),
1912
- !t && /* @__PURE__ */ n(Re, { message: e.message })
1909
+ !t && /* @__PURE__ */ n(Le, { message: e.message })
1913
1910
  ] });
1914
1911
  }
1915
1912
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1918,9 +1915,9 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1918
1915
  /* @__PURE__ */ n("p", { children: e.message.text }),
1919
1916
  /* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
1920
1917
  ] }),
1921
- !t && /* @__PURE__ */ n(Re, { message: e.message })
1918
+ !t && /* @__PURE__ */ n(Le, { message: e.message })
1922
1919
  ] });
1923
- }, cn = He(!1), Fe = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
1920
+ }, cn = Ge(!1), ze = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
1924
1921
  "animateTransform",
1925
1922
  {
1926
1923
  attributeName: "transform",
@@ -1930,21 +1927,21 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1930
1927
  begin: `${120 * t}ms`,
1931
1928
  repeatCount: "indefinite"
1932
1929
  }
1933
- ) }), Va = /* @__PURE__ */ new Set([
1934
- Le.Thinking,
1935
- Le.Generating,
1936
- Le.ExternalSources
1937
- ]), Ga = ({ threadList: e }) => {
1938
- var b, _;
1939
- const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = qe(), { typing: i = {} } = ns(), { aiState: o } = ss(t), l = Te(cn);
1940
- if (!e && l && Va.has(o)) {
1941
- const v = Ha(t, (b = r.user) == null ? void 0 : b.id);
1930
+ ) }), Ga = /* @__PURE__ */ new Set([
1931
+ De.Thinking,
1932
+ De.Generating,
1933
+ De.ExternalSources
1934
+ ]), Ha = ({ threadList: e }) => {
1935
+ var g, v;
1936
+ const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Ye(), { typing: i = {} } = ss(), { aiState: o } = as(t), l = Te(cn);
1937
+ if (!e && l && Ga.has(o)) {
1938
+ const p = Ya(t, (g = r.user) == null ? void 0 : g.id);
1942
1939
  return /* @__PURE__ */ n(
1943
- Bt,
1940
+ Ft,
1944
1941
  {
1945
- avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
1946
- avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
1947
- avatarImage: v == null ? void 0 : v.image,
1942
+ avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
1943
+ avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
1944
+ avatarImage: p == null ? void 0 : p.image,
1948
1945
  testId: "typing-indicator-ai"
1949
1946
  }
1950
1947
  );
@@ -1952,21 +1949,21 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1952
1949
  if ((s == null ? void 0 : s.typing_events) === !1)
1953
1950
  return null;
1954
1951
  const m = e ? [] : Object.values(i).filter(
1955
- ({ parent_id: v, user: w }) => {
1956
- var y;
1957
- return (w == null ? void 0 : w.id) !== ((y = r.user) == null ? void 0 : y.id) && !v;
1952
+ ({ parent_id: p, user: N }) => {
1953
+ var x;
1954
+ return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && !p;
1958
1955
  }
1959
- ), g = e ? Object.values(i).filter(
1960
- ({ parent_id: v, user: w }) => {
1961
- var y;
1962
- return (w == null ? void 0 : w.id) !== ((y = r.user) == null ? void 0 : y.id) && v === (a == null ? void 0 : a.id);
1956
+ ), b = e ? Object.values(i).filter(
1957
+ ({ parent_id: p, user: N }) => {
1958
+ var x;
1959
+ return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && p === (a == null ? void 0 : a.id);
1963
1960
  }
1964
- ) : [], u = e ? g : m;
1961
+ ) : [], u = e ? b : m;
1965
1962
  if (!u.length)
1966
1963
  return null;
1967
- const f = (_ = u[0]) == null ? void 0 : _.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1964
+ const f = (v = u[0]) == null ? void 0 : v.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1968
1965
  return /* @__PURE__ */ n(
1969
- Bt,
1966
+ Ft,
1970
1967
  {
1971
1968
  avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
1972
1969
  avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
@@ -1974,7 +1971,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1974
1971
  testId: "typing-indicator"
1975
1972
  }
1976
1973
  );
1977
- }, Bt = ({
1974
+ }, Ft = ({
1978
1975
  avatarId: e,
1979
1976
  avatarName: t,
1980
1977
  avatarImage: s,
@@ -1987,7 +1984,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
1987
1984
  style: { insetInlineStart: 0, insetInlineEnd: "auto" },
1988
1985
  children: [
1989
1986
  /* @__PURE__ */ n("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ n(
1990
- re,
1987
+ ae,
1991
1988
  {
1992
1989
  id: e,
1993
1990
  name: t,
@@ -2006,16 +2003,16 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
2006
2003
  height: "8",
2007
2004
  overflow: "visible",
2008
2005
  children: [
2009
- /* @__PURE__ */ n(Fe, { cx: "4", index: 0 }),
2010
- /* @__PURE__ */ n(Fe, { cx: "16", index: 1 }),
2011
- /* @__PURE__ */ n(Fe, { cx: "28", index: 2 })
2006
+ /* @__PURE__ */ n(ze, { cx: "4", index: 0 }),
2007
+ /* @__PURE__ */ n(ze, { cx: "16", index: 1 }),
2008
+ /* @__PURE__ */ n(ze, { cx: "28", index: 2 })
2012
2009
  ]
2013
2010
  }
2014
2011
  ) })
2015
2012
  ]
2016
2013
  }
2017
2014
  );
2018
- function Ha(e, t) {
2015
+ function Ya(e, t) {
2019
2016
  var a;
2020
2017
  const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
2021
2018
  for (const r of Object.values(s)) {
@@ -2024,7 +2021,7 @@ function Ha(e, t) {
2024
2021
  return i;
2025
2022
  }
2026
2023
  }
2027
- const Ya = () => null, qa = ({ className: e, message: t }) => /* @__PURE__ */ h(
2024
+ const qa = () => null, Wa = ({ className: e, message: t }) => /* @__PURE__ */ h(
2028
2025
  "div",
2029
2026
  {
2030
2027
  className: C("flex items-center justify-center h-full", e),
@@ -2068,35 +2065,43 @@ const Ya = () => null, qa = ({ className: e, message: t }) => /* @__PURE__ */ h(
2068
2065
  ]
2069
2066
  }
2070
2067
  ), Ee = z.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2071
- /* @__PURE__ */ n(qa, { className: "w-6 h-6" }),
2068
+ /* @__PURE__ */ n(Wa, { className: "w-6 h-6" }),
2072
2069
  /* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
2073
2070
  ] }) }));
2074
2071
  Ee.displayName = "LoadingState";
2075
- const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", jt = "Replies instantly with AI assistant", Wa = ({
2072
+ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bt = "Replies instantly with AI assistant", Xa = ({
2076
2073
  onBack: e,
2077
2074
  showBackButton: t,
2078
- onShowInfo: s,
2079
- canShowInfo: a,
2080
- showStarButton: r = !1,
2081
- dmAgentEnabled: i = !1
2075
+ showStarButton: s = !1,
2076
+ dmAgentEnabled: a = !1,
2077
+ onLeaveConversation: r,
2078
+ onBlockParticipant: i,
2079
+ showDeleteConversation: o = !0,
2080
+ showBlockParticipant: l = !0,
2081
+ showReportParticipant: d = !0,
2082
+ onDeleteConversationClick: m,
2083
+ onBlockParticipantClick: b,
2084
+ onReportParticipantClick: u,
2085
+ customChannelActions: f,
2086
+ showActionsMenu: c = !0
2082
2087
  }) => {
2083
- var f, c, b, _, v;
2084
- const { channel: o } = de(), l = z.useMemo(() => {
2085
- var S, k;
2086
- const w = (S = o._client) == null ? void 0 : S.userID;
2087
- return w ? Object.values(((k = o.state) == null ? void 0 : k.members) || {}).find(
2088
- (A) => {
2089
- var D;
2090
- return ((D = A.user) == null ? void 0 : D.id) && A.user.id !== w;
2088
+ var S, R, O, E, A;
2089
+ const { channel: g } = ce(), v = z.useMemo(() => {
2090
+ var I, L;
2091
+ const y = (I = g._client) == null ? void 0 : I.userID;
2092
+ return y ? Object.values(((L = g.state) == null ? void 0 : L.members) || {}).find(
2093
+ (M) => {
2094
+ var j;
2095
+ return ((j = M.user) == null ? void 0 : j.id) && M.user.id !== y;
2091
2096
  }
2092
2097
  ) : void 0;
2093
- }, [(f = o._client) == null ? void 0 : f.userID, (c = o.state) == null ? void 0 : c.members]), d = Ae(l == null ? void 0 : l.user), m = (b = l == null ? void 0 : l.user) == null ? void 0 : b.image, g = Wt(o), u = async () => {
2098
+ }, [(S = g._client) == null ? void 0 : S.userID, (R = g.state) == null ? void 0 : R.members]), p = Wt(v == null ? void 0 : v.user), N = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, x = qt(g), T = async () => {
2094
2099
  try {
2095
- g ? await o.unpin() : await o.pin();
2096
- } catch (w) {
2100
+ x ? await g.unpin() : await g.pin();
2101
+ } catch (y) {
2097
2102
  console.error(
2098
2103
  "[CustomChannelHeader] Failed to update pinned status:",
2099
- w
2104
+ y
2100
2105
  );
2101
2106
  }
2102
2107
  };
@@ -2106,62 +2111,69 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2106
2111
  "button",
2107
2112
  {
2108
2113
  className: C(
2109
- le,
2114
+ oe,
2110
2115
  "messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
2111
2116
  ),
2112
2117
  onClick: e || (() => {
2113
2118
  }),
2114
2119
  type: "button",
2115
2120
  "aria-label": "Back to conversations",
2116
- children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
2121
+ children: /* @__PURE__ */ n(Mt, { className: "size-5 text-black/90" })
2117
2122
  }
2118
2123
  ) }),
2119
2124
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
2120
2125
  /* @__PURE__ */ n(
2121
- re,
2126
+ ae,
2122
2127
  {
2123
- id: ((_ = l == null ? void 0 : l.user) == null ? void 0 : _.id) || o.id || "unknown",
2124
- name: d,
2125
- image: m,
2126
- starred: r && g,
2127
- dmAgentEnabled: i,
2128
+ id: ((E = v == null ? void 0 : v.user) == null ? void 0 : E.id) || g.id || "unknown",
2129
+ name: p,
2130
+ image: N,
2131
+ starred: s && x,
2132
+ dmAgentEnabled: a,
2128
2133
  size: 48
2129
2134
  }
2130
2135
  ),
2131
- /* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: d }),
2132
- i && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2136
+ /* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: p }),
2137
+ a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2133
2138
  /* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
2134
- /* @__PURE__ */ n("span", { children: jt })
2139
+ /* @__PURE__ */ n("span", { children: Bt })
2135
2140
  ] })
2136
2141
  ] }),
2137
2142
  /* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
2138
- r && /* @__PURE__ */ n(
2143
+ s && /* @__PURE__ */ n(
2139
2144
  "button",
2140
2145
  {
2141
- className: le,
2142
- onClick: u,
2146
+ className: oe,
2147
+ onClick: T,
2143
2148
  type: "button",
2144
- "aria-label": g ? "Unstar conversation" : "Star conversation",
2149
+ "aria-label": x ? "Unstar conversation" : "Star conversation",
2145
2150
  children: /* @__PURE__ */ n(
2146
- Be,
2151
+ Fe,
2147
2152
  {
2148
2153
  className: C("size-5", {
2149
- "text-yellow-600": g,
2150
- "text-black/90": !g
2154
+ "text-yellow-600": x,
2155
+ "text-black/90": !x
2151
2156
  }),
2152
- weight: g ? "duotone" : "regular"
2157
+ weight: x ? "duotone" : "regular"
2153
2158
  }
2154
2159
  )
2155
2160
  }
2156
2161
  ),
2157
- a && /* @__PURE__ */ n(
2158
- "button",
2162
+ c && /* @__PURE__ */ n(
2163
+ Pt,
2159
2164
  {
2160
- className: C(le, "bg-[#F1F0EE]"),
2161
- onClick: s,
2162
- type: "button",
2163
- "aria-label": "Show info",
2164
- children: /* @__PURE__ */ n(Rt, { className: "size-5 text-black/90" })
2165
+ channel: g,
2166
+ participant: v,
2167
+ showDeleteConversation: o,
2168
+ showBlockParticipant: l,
2169
+ showReportParticipant: d,
2170
+ onLeaveConversation: r,
2171
+ onBlockParticipant: i,
2172
+ onDeleteConversationClick: m,
2173
+ onBlockParticipantClick: b,
2174
+ onReportParticipantClick: u,
2175
+ customChannelActions: f,
2176
+ triggerClassName: C(oe, "bg-[#F1F0EE]")
2165
2177
  }
2166
2178
  )
2167
2179
  ] })
@@ -2172,77 +2184,75 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2172
2184
  "button",
2173
2185
  {
2174
2186
  className: C(
2175
- le,
2187
+ oe,
2176
2188
  "messaging-channel-view-back-button-desktop"
2177
2189
  ),
2178
2190
  type: "button",
2179
2191
  onClick: e,
2180
2192
  "aria-label": "Back to conversations",
2181
- children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
2193
+ children: /* @__PURE__ */ n(Mt, { className: "size-5 text-black/90" })
2182
2194
  }
2183
2195
  ),
2184
2196
  /* @__PURE__ */ n(
2185
- re,
2197
+ ae,
2186
2198
  {
2187
- id: ((v = l == null ? void 0 : l.user) == null ? void 0 : v.id) || o.id || "unknown",
2188
- name: d,
2189
- image: m,
2190
- starred: r && g,
2191
- dmAgentEnabled: i,
2199
+ id: ((A = v == null ? void 0 : v.user) == null ? void 0 : A.id) || g.id || "unknown",
2200
+ name: p,
2201
+ image: N,
2202
+ starred: s && x,
2203
+ dmAgentEnabled: a,
2192
2204
  size: 48
2193
2205
  }
2194
2206
  ),
2195
2207
  /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2196
- a ? /* @__PURE__ */ n(
2197
- "button",
2198
- {
2199
- type: "button",
2200
- onClick: s,
2201
- className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
2202
- "aria-label": `View info for ${d}`,
2203
- children: /* @__PURE__ */ n("span", { className: "truncate", children: d })
2204
- }
2205
- ) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: d }),
2206
- i && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2208
+ /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: p }),
2209
+ a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2207
2210
  /* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
2208
- /* @__PURE__ */ n("span", { className: "truncate", children: jt })
2211
+ /* @__PURE__ */ n("span", { className: "truncate", children: Bt })
2209
2212
  ] })
2210
2213
  ] })
2211
2214
  ] }),
2212
2215
  /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
2213
- r && /* @__PURE__ */ n(
2216
+ s && /* @__PURE__ */ n(
2214
2217
  "button",
2215
2218
  {
2216
- className: le,
2217
- onClick: u,
2219
+ className: oe,
2220
+ onClick: T,
2218
2221
  type: "button",
2219
- "aria-label": g ? "Unstar conversation" : "Star conversation",
2222
+ "aria-label": x ? "Unstar conversation" : "Star conversation",
2220
2223
  children: /* @__PURE__ */ n(
2221
- Be,
2224
+ Fe,
2222
2225
  {
2223
2226
  className: C("size-6", {
2224
- "text-yellow-600": g,
2225
- "text-black/90": !g
2227
+ "text-yellow-600": x,
2228
+ "text-black/90": !x
2226
2229
  }),
2227
- weight: g ? "duotone" : "regular"
2230
+ weight: x ? "duotone" : "regular"
2228
2231
  }
2229
2232
  )
2230
2233
  }
2231
2234
  ),
2232
- a && s && /* @__PURE__ */ n(
2233
- "button",
2235
+ c && /* @__PURE__ */ n(
2236
+ Pt,
2234
2237
  {
2235
- className: le,
2236
- onClick: s,
2237
- type: "button",
2238
- "aria-label": "Show info",
2239
- children: /* @__PURE__ */ n(Rt, { className: "size-6 text-black/90" })
2238
+ channel: g,
2239
+ participant: v,
2240
+ showDeleteConversation: o,
2241
+ showBlockParticipant: l,
2242
+ showReportParticipant: d,
2243
+ onLeaveConversation: r,
2244
+ onBlockParticipant: i,
2245
+ onDeleteConversationClick: m,
2246
+ onBlockParticipantClick: b,
2247
+ onReportParticipantClick: u,
2248
+ customChannelActions: f,
2249
+ triggerClassName: oe
2240
2250
  }
2241
2251
  )
2242
2252
  ] })
2243
2253
  ] })
2244
2254
  ] });
2245
- }, Xa = ({
2255
+ }, Ka = ({
2246
2256
  onBack: e,
2247
2257
  showBackButton: t,
2248
2258
  renderMessageInputActions: s,
@@ -2253,135 +2263,103 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2253
2263
  showDeleteConversation: l = !0,
2254
2264
  onDeleteConversationClick: d,
2255
2265
  onBlockParticipantClick: m,
2256
- onReportParticipantClick: g,
2266
+ onReportParticipantClick: b,
2257
2267
  showBlockParticipant: u = !0,
2258
2268
  showReportParticipant: f = !0,
2259
- showFollowerStatus: c = !0,
2260
- composerDisabled: b = !1,
2261
- composerDisabledReason: _,
2269
+ composerDisabled: c = !1,
2270
+ composerDisabledReason: g,
2262
2271
  showStarButton: v = !1,
2263
- chatbotVotingEnabled: w = !1,
2264
- renderChannelBanner: y,
2265
- customProfileContent: S,
2266
- customChannelActions: k,
2267
- renderMessage: A,
2268
- dmAgentEnabled: D = !1,
2269
- viewerLanguage: T,
2270
- showChannelInfo: M = !0
2272
+ chatbotVotingEnabled: p = !1,
2273
+ renderChannelBanner: N,
2274
+ customChannelActions: x,
2275
+ renderMessage: T,
2276
+ dmAgentEnabled: S = !1,
2277
+ viewerLanguage: R,
2278
+ showChannelInfo: O = !0
2271
2279
  }) => {
2272
- var q, $, p, x, L, U;
2273
- const { channel: N } = de(), E = K(null), I = z.useMemo(() => {
2274
- var X, Q;
2275
- const R = (X = N._client) == null ? void 0 : X.userID;
2276
- return R ? Object.values(((Q = N.state) == null ? void 0 : Q.members) || {}).find(
2277
- (te) => {
2278
- var ee;
2279
- return ((ee = te.user) == null ? void 0 : ee.id) && te.user.id !== R;
2280
+ var j, V, G, $, F, X;
2281
+ const { channel: E } = ce(), A = z.useMemo(() => {
2282
+ var w, k;
2283
+ const U = (w = E._client) == null ? void 0 : w.userID;
2284
+ return U ? Object.values(((k = E.state) == null ? void 0 : k.members) || {}).find(
2285
+ (B) => {
2286
+ var q;
2287
+ return ((q = B.user) == null ? void 0 : q.id) && B.user.id !== U;
2280
2288
  }
2281
2289
  ) : void 0;
2282
- }, [(q = N._client) == null ? void 0 : q.userID, ($ = N.state) == null ? void 0 : $.members]), B = z.useMemo(() => {
2283
- var X, Q;
2284
- const R = (X = N._client) == null ? void 0 : X.userID;
2285
- return R ? Object.values(((Q = N.state) == null ? void 0 : Q.members) || {}).find((te) => {
2286
- var ee;
2287
- return ((ee = te.user) == null ? void 0 : ee.id) === R;
2290
+ }, [(j = E._client) == null ? void 0 : j.userID, (V = E.state) == null ? void 0 : V.members]), y = z.useMemo(() => {
2291
+ var w, k;
2292
+ const U = (w = E._client) == null ? void 0 : w.userID;
2293
+ return U ? Object.values(((k = E.state) == null ? void 0 : k.members) || {}).find((B) => {
2294
+ var q;
2295
+ return ((q = B.user) == null ? void 0 : q.id) === U;
2288
2296
  }) : void 0;
2289
- }, [(p = N._client) == null ? void 0 : p.userID, (x = N.state) == null ? void 0 : x.members]), P = ((L = B == null ? void 0 : B.user) == null ? void 0 : L.is_account) ?? (B == null ? void 0 : B.is_account), Z = ((U = I == null ? void 0 : I.user) == null ? void 0 : U.is_account) ?? (I == null ? void 0 : I.is_account), G = D && P === !1 && Z === !0, H = z.useMemo(() => {
2290
- if (!c) return;
2291
- const R = N.data ?? {};
2292
- if (R.followerStatus)
2293
- return String(R.followerStatus);
2294
- if (R.isFollower !== void 0)
2295
- return R.isFollower ? "Subscribed to you" : "Not subscribed";
2296
- }, [N.data, c]), j = W(() => {
2297
- var R;
2298
- (R = E.current) == null || R.showModal();
2299
- }, []), F = W(() => {
2300
- var R;
2301
- (R = E.current) == null || R.close();
2302
- }, []), Y = W(
2303
- (R) => {
2304
- const { message: V } = pe("ChannelView"), X = /* @__PURE__ */ n(
2305
- Ca,
2297
+ }, [(G = E._client) == null ? void 0 : G.userID, ($ = E.state) == null ? void 0 : $.members]), _ = ((F = y == null ? void 0 : y.user) == null ? void 0 : F.is_account) ?? (y == null ? void 0 : y.is_account), I = ((X = A == null ? void 0 : A.user) == null ? void 0 : X.is_account) ?? (A == null ? void 0 : A.is_account), L = S && _ === !1 && I === !0, M = W(
2298
+ (U) => {
2299
+ const { message: P } = pe("ChannelView"), w = /* @__PURE__ */ n(
2300
+ ka,
2306
2301
  {
2307
- ...R,
2308
- chatbotVotingEnabled: w,
2309
- viewerLanguage: T
2302
+ ...U,
2303
+ chatbotVotingEnabled: p,
2304
+ viewerLanguage: R
2310
2305
  }
2311
2306
  );
2312
- return !A || !V ? X : A(X, V);
2307
+ return !T || !P ? w : T(w, P);
2313
2308
  },
2314
- [w, A, T]
2309
+ [p, T, R]
2315
2310
  );
2316
- return /* @__PURE__ */ h(ae, { children: [
2317
- /* @__PURE__ */ n(
2318
- rs,
2319
- {
2320
- overrides: {
2321
- Message: Y,
2322
- MessageActions: Ia
2323
- },
2324
- children: /* @__PURE__ */ h(is, { children: [
2325
- /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
2326
- Wa,
2327
- {
2328
- onBack: e,
2329
- showBackButton: t,
2330
- onShowInfo: j,
2331
- canShowInfo: M && !!I,
2332
- showStarButton: v,
2333
- dmAgentEnabled: G
2334
- }
2335
- ) }, "lt-channel-header"),
2336
- y ? /* @__PURE__ */ n(z.Fragment, { children: y() }, "lt-channel-banner") : null,
2337
- /* @__PURE__ */ n(
2338
- "div",
2339
- {
2340
- className: "flex-1 overflow-hidden relative",
2341
- children: /* @__PURE__ */ n(os, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
2342
- },
2343
- "lt-channel-message-list"
2344
- ),
2345
- r ? /* @__PURE__ */ n(z.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
2346
- /* @__PURE__ */ n(
2347
- Ra,
2348
- {
2349
- ...s && {
2350
- renderActions: () => s == null ? void 0 : s(N)
2351
- },
2352
- renderFooter: () => a == null ? void 0 : a(N),
2353
- disabled: b,
2354
- disabledReason: _
2355
- },
2356
- "lt-channel-message-input"
2357
- )
2358
- ] })
2359
- }
2360
- ),
2361
- M && /* @__PURE__ */ n(
2362
- $s,
2363
- {
2364
- dialogRef: E,
2365
- onClose: F,
2366
- participant: I,
2367
- participantDisplayName: Ae(
2368
- I == null ? void 0 : I.user
2311
+ return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
2312
+ is,
2313
+ {
2314
+ overrides: {
2315
+ Message: M,
2316
+ MessageActions: Ia
2317
+ },
2318
+ children: /* @__PURE__ */ h(os, { children: [
2319
+ /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
2320
+ Xa,
2321
+ {
2322
+ onBack: e,
2323
+ showBackButton: t,
2324
+ showActionsMenu: O,
2325
+ showStarButton: v,
2326
+ dmAgentEnabled: L,
2327
+ onLeaveConversation: i,
2328
+ onBlockParticipant: o,
2329
+ showDeleteConversation: l,
2330
+ showBlockParticipant: u,
2331
+ showReportParticipant: f,
2332
+ onDeleteConversationClick: d,
2333
+ onBlockParticipantClick: m,
2334
+ onReportParticipantClick: b,
2335
+ customChannelActions: x
2336
+ }
2337
+ ) }, "lt-channel-header"),
2338
+ N ? /* @__PURE__ */ n(z.Fragment, { children: N() }, "lt-channel-banner") : null,
2339
+ /* @__PURE__ */ n(
2340
+ "div",
2341
+ {
2342
+ className: "flex-1 overflow-hidden relative",
2343
+ children: /* @__PURE__ */ n(ls, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
2344
+ },
2345
+ "lt-channel-message-list"
2369
2346
  ),
2370
- channel: N,
2371
- followerStatusLabel: H,
2372
- onLeaveConversation: i,
2373
- onBlockParticipant: o,
2374
- showDeleteConversation: l,
2375
- showBlockParticipant: u,
2376
- showReportParticipant: f,
2377
- onDeleteConversationClick: d,
2378
- onBlockParticipantClick: m,
2379
- onReportParticipantClick: g,
2380
- customProfileContent: S,
2381
- customChannelActions: k
2382
- }
2383
- )
2384
- ] });
2347
+ r ? /* @__PURE__ */ n(z.Fragment, { children: r(E) }, "lt-channel-conversation-footer") : null,
2348
+ /* @__PURE__ */ n(
2349
+ Da,
2350
+ {
2351
+ ...s && {
2352
+ renderActions: () => s == null ? void 0 : s(E)
2353
+ },
2354
+ renderFooter: () => a == null ? void 0 : a(E),
2355
+ disabled: c,
2356
+ disabledReason: g
2357
+ },
2358
+ "lt-channel-message-input"
2359
+ )
2360
+ ] })
2361
+ }
2362
+ ) });
2385
2363
  }, dn = z.memo(
2386
2364
  ({
2387
2365
  channel: e,
@@ -2393,84 +2371,82 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2393
2371
  onLeaveConversation: o,
2394
2372
  onBlockParticipant: l,
2395
2373
  className: d,
2396
- CustomChannelEmptyState: m = Ya,
2397
- showDeleteConversation: g = !0,
2374
+ CustomChannelEmptyState: m = qa,
2375
+ showDeleteConversation: b = !0,
2398
2376
  onDeleteConversationClick: u,
2399
2377
  onBlockParticipantClick: f,
2400
2378
  onReportParticipantClick: c,
2401
- showBlockParticipant: b = !0,
2402
- showReportParticipant: _ = !0,
2403
- showFollowerStatus: v = !0,
2404
- composerDisabled: w = !1,
2405
- composerDisabledReason: y,
2406
- dmAgentEnabled: S,
2407
- messageMetadata: k,
2408
- onMessageSent: A,
2409
- showStarButton: D = !1,
2410
- chatbotVotingEnabled: T = !1,
2411
- renderChannelBanner: M,
2412
- customProfileContent: N,
2413
- customChannelActions: E,
2414
- renderMessage: I,
2415
- onMessageLinkClick: B,
2416
- sendButton: P,
2417
- attachmentPreviewList: Z,
2418
- viewerLanguage: G,
2419
- showChannelInfo: H = !0
2379
+ showBlockParticipant: g = !0,
2380
+ showReportParticipant: v = !0,
2381
+ composerDisabled: p = !1,
2382
+ composerDisabledReason: N,
2383
+ dmAgentEnabled: x,
2384
+ messageMetadata: T,
2385
+ onMessageSent: S,
2386
+ showStarButton: R = !1,
2387
+ chatbotVotingEnabled: O = !1,
2388
+ renderChannelBanner: E,
2389
+ customChannelActions: A,
2390
+ renderMessage: y,
2391
+ onMessageLinkClick: _,
2392
+ sendButton: I,
2393
+ attachmentPreviewList: L,
2394
+ viewerLanguage: M,
2395
+ showChannelInfo: j = !0
2420
2396
  }) => {
2421
- const j = W(
2422
- async (Y, q, $) => {
2423
- var V;
2424
- const p = ((V = e.data) == null ? void 0 : V.chatbot_paused) === !0, x = S && !p, L = {
2425
- ...q,
2426
- ...x && { silent: !0 },
2427
- ...k && {
2397
+ const V = W(
2398
+ async ($, F, X) => {
2399
+ var q;
2400
+ const U = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, P = x && !U, w = {
2401
+ ...F,
2402
+ ...P && { silent: !0 },
2403
+ ...T && {
2428
2404
  metadata: {
2429
- ...q.metadata ?? {},
2430
- ...k
2405
+ ...F.metadata ?? {},
2406
+ ...T
2431
2407
  }
2432
2408
  }
2433
- }, U = {
2434
- ...$,
2435
- ...x && { skip_push: !0 }
2436
- }, R = await e.sendMessage(L, U);
2437
- return A == null || A(R), R;
2409
+ }, k = {
2410
+ ...X,
2411
+ ...P && { skip_push: !0 }
2412
+ }, B = await e.sendMessage(w, k);
2413
+ return S == null || S(B), B;
2438
2414
  },
2439
- [e, S, k, A]
2440
- ), F = K(null);
2441
- return J(() => {
2442
- if (!B) return;
2443
- const Y = F.current;
2444
- if (!Y) return;
2445
- const q = ($) => {
2446
- const p = $.target, x = p == null ? void 0 : p.closest("a[href]"), L = x == null ? void 0 : x.getAttribute("href");
2447
- if (!L) return;
2448
- const U = x == null ? void 0 : x.closest("[data-message-id]"), R = U == null ? void 0 : U.getAttribute("data-message-id"), V = R ? e.state.messages.find((X) => X.id === R) : void 0;
2449
- B(L, V);
2415
+ [e, x, T, S]
2416
+ ), G = H(null);
2417
+ return Y(() => {
2418
+ if (!_) return;
2419
+ const $ = G.current;
2420
+ if (!$) return;
2421
+ const F = (X) => {
2422
+ const U = X.target, P = U == null ? void 0 : U.closest("a[href]"), w = P == null ? void 0 : P.getAttribute("href");
2423
+ if (!w) return;
2424
+ const k = P == null ? void 0 : P.closest("[data-message-id]"), B = k == null ? void 0 : k.getAttribute("data-message-id"), q = B ? e.state.messages.find((_e) => _e.id === B) : void 0;
2425
+ _(w, q);
2450
2426
  };
2451
- return Y.addEventListener("click", q), () => Y.removeEventListener("click", q);
2452
- }, [B, e]), /* @__PURE__ */ n(
2427
+ return $.addEventListener("click", F), () => $.removeEventListener("click", F);
2428
+ }, [_, e]), /* @__PURE__ */ n(
2453
2429
  "div",
2454
2430
  {
2455
- ref: F,
2431
+ ref: G,
2456
2432
  className: C(
2457
2433
  "messaging-channel-view h-full flex flex-col",
2458
2434
  d
2459
2435
  ),
2460
- children: /* @__PURE__ */ n(cn.Provider, { value: S ?? !1, children: /* @__PURE__ */ n(
2461
- as,
2436
+ children: /* @__PURE__ */ n(cn.Provider, { value: x ?? !1, children: /* @__PURE__ */ n(
2437
+ rs,
2462
2438
  {
2463
2439
  channel: e,
2464
- MessageSystem: Ua,
2440
+ MessageSystem: Va,
2465
2441
  EmptyStateIndicator: m,
2466
2442
  LoadingIndicator: Ee,
2467
- DateSeparator: Bs,
2468
- TypingIndicator: Ga,
2469
- doSendMessageRequest: j,
2470
- ...P ? { SendButton: P } : {},
2471
- ...Z ? { AttachmentPreviewList: Z } : {},
2443
+ DateSeparator: Us,
2444
+ TypingIndicator: Ha,
2445
+ doSendMessageRequest: V,
2446
+ ...I ? { SendButton: I } : {},
2447
+ ...L ? { AttachmentPreviewList: L } : {},
2472
2448
  children: /* @__PURE__ */ n(
2473
- Xa,
2449
+ Ka,
2474
2450
  {
2475
2451
  onBack: t,
2476
2452
  showBackButton: s,
@@ -2480,24 +2456,22 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2480
2456
  onLeaveConversation: o,
2481
2457
  onBlockParticipant: l,
2482
2458
  CustomChannelEmptyState: m,
2483
- showDeleteConversation: g,
2459
+ showDeleteConversation: b,
2484
2460
  onDeleteConversationClick: u,
2485
2461
  onBlockParticipantClick: f,
2486
2462
  onReportParticipantClick: c,
2487
- showBlockParticipant: b,
2488
- showReportParticipant: _,
2489
- showFollowerStatus: v,
2490
- composerDisabled: w,
2491
- composerDisabledReason: y,
2492
- showStarButton: D,
2493
- dmAgentEnabled: S,
2494
- chatbotVotingEnabled: T,
2495
- renderChannelBanner: M,
2496
- customProfileContent: N,
2497
- customChannelActions: E,
2498
- renderMessage: I,
2499
- viewerLanguage: G,
2500
- showChannelInfo: H
2463
+ showBlockParticipant: g,
2464
+ showReportParticipant: v,
2465
+ composerDisabled: p,
2466
+ composerDisabledReason: N,
2467
+ showStarButton: R,
2468
+ dmAgentEnabled: x,
2469
+ chatbotVotingEnabled: O,
2470
+ renderChannelBanner: E,
2471
+ customChannelActions: A,
2472
+ renderMessage: y,
2473
+ viewerLanguage: M,
2474
+ showChannelInfo: j
2501
2475
  }
2502
2476
  )
2503
2477
  }
@@ -2522,7 +2496,7 @@ const fe = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
2522
2496
  )
2523
2497
  ] }) }));
2524
2498
  fe.displayName = "ErrorState";
2525
- const _i = ({
2499
+ const yi = ({
2526
2500
  capabilities: e = {},
2527
2501
  renderMessageInputActions: t,
2528
2502
  renderConversationFooter: s,
@@ -2533,133 +2507,133 @@ const _i = ({
2533
2507
  CustomChannelEmptyState: l,
2534
2508
  onBlockParticipantClick: d,
2535
2509
  onReportParticipantClick: m,
2536
- dmAgentEnabled: g,
2510
+ dmAgentEnabled: b,
2537
2511
  onMessageSent: u,
2538
2512
  chatbotVotingEnabled: f = !1,
2539
2513
  viewerLanguage: c,
2540
- renderChannelBanner: b,
2541
- customChannelActions: _,
2542
- renderMessage: v,
2543
- onMessageLinkClick: w,
2544
- showChannelInfo: y
2514
+ renderChannelBanner: g,
2515
+ customChannelActions: v,
2516
+ renderMessage: p,
2517
+ onMessageLinkClick: N,
2518
+ showChannelInfo: x
2545
2519
  }) => {
2546
2520
  const {
2547
- client: S,
2548
- isConnected: k,
2549
- isLoading: A,
2550
- error: D,
2551
- refreshConnection: T,
2552
- service: M,
2553
- debug: N
2554
- } = Ds(), [E, I] = O(null), [B, P] = O(null), [Z, G] = O(!1), { showDeleteConversation: H = !0 } = e, j = K(o);
2555
- j.current = o;
2556
- const F = K(a);
2521
+ client: T,
2522
+ isConnected: S,
2523
+ isLoading: R,
2524
+ error: O,
2525
+ refreshConnection: E,
2526
+ service: A,
2527
+ debug: y
2528
+ } = Ds(), [_, I] = D(null), [L, M] = D(null), [j, V] = D(!1), { showDeleteConversation: G = !0 } = e, $ = H(o);
2529
+ $.current = o;
2530
+ const F = H(a);
2557
2531
  F.current = a;
2558
- const Y = K(null), q = K(null);
2559
- J(() => {
2560
- q.current = E;
2561
- }, [E]), J(() => {
2562
- if (!S || !k) return;
2563
- const x = S.userID;
2564
- if (!x) return;
2565
- const L = `${x}::${i}`;
2566
- if (Y.current === L) return;
2567
- Y.current = L;
2568
- const U = () => {
2569
- Y.current === L && (Y.current = null);
2532
+ const X = H(null), U = H(null);
2533
+ Y(() => {
2534
+ U.current = _;
2535
+ }, [_]), Y(() => {
2536
+ if (!T || !S) return;
2537
+ const k = T.userID;
2538
+ if (!k) return;
2539
+ const B = `${k}::${i}`;
2540
+ if (X.current === B) return;
2541
+ X.current = B;
2542
+ const q = () => {
2543
+ X.current === B && (X.current = null);
2570
2544
  };
2571
2545
  (async () => {
2572
- var V, X;
2546
+ var K, re;
2573
2547
  try {
2574
- N && console.log(
2548
+ y && console.log(
2575
2549
  "[MessagingShell] Loading initial conversation with:",
2576
2550
  i
2577
2551
  );
2578
- const Q = await S.queryChannels(
2552
+ const J = await T.queryChannels(
2579
2553
  {
2580
2554
  type: "messaging",
2581
- members: { $eq: [x, i] }
2555
+ members: { $eq: [k, i] }
2582
2556
  },
2583
2557
  {},
2584
2558
  { limit: 1 }
2585
2559
  );
2586
- if (Q.length > 0) {
2587
- I(Q[0]), P(null), (V = F.current) == null || V.call(F, Q[0]), N && console.log(
2560
+ if (J.length > 0) {
2561
+ I(J[0]), M(null), (K = F.current) == null || K.call(F, J[0]), y && console.log(
2588
2562
  "[MessagingShell] Initial conversation loaded:",
2589
- Q[0].id
2563
+ J[0].id
2590
2564
  );
2591
2565
  return;
2592
2566
  }
2593
- const te = j.current;
2594
- if (!te || !M) {
2595
- U(), P("No conversation found with this account"), N && console.log(
2567
+ const se = $.current;
2568
+ if (!se || !A) {
2569
+ q(), M("No conversation found with this account"), y && console.log(
2596
2570
  "[MessagingShell] No conversation found for:",
2597
2571
  i
2598
2572
  );
2599
2573
  return;
2600
2574
  }
2601
2575
  try {
2602
- const ee = await M.startChannelWithParticipant({
2603
- id: te.id,
2604
- name: te.name,
2605
- phone: te.phone
2576
+ const Q = await A.startChannelWithParticipant({
2577
+ id: se.id,
2578
+ name: se.name,
2579
+ phone: se.phone
2606
2580
  });
2607
- I(ee), P(null), (X = F.current) == null || X.call(F, ee), N && console.log(
2581
+ I(Q), M(null), (re = F.current) == null || re.call(F, Q), y && console.log(
2608
2582
  "[MessagingShell] Channel created and loaded:",
2609
- ee.id
2583
+ Q.id
2610
2584
  );
2611
- } catch (ee) {
2585
+ } catch (Q) {
2612
2586
  console.error(
2613
2587
  "[MessagingShell] Failed to create conversation:",
2614
- ee
2615
- ), U(), P("Failed to create conversation");
2588
+ Q
2589
+ ), q(), M("Failed to create conversation");
2616
2590
  }
2617
- } catch (Q) {
2591
+ } catch (J) {
2618
2592
  console.error(
2619
2593
  "[MessagingShell] Failed to load initial conversation:",
2620
- Q
2621
- ), U(), q.current || P("Failed to load conversation");
2594
+ J
2595
+ ), q(), U.current || M("Failed to load conversation");
2622
2596
  }
2623
2597
  })();
2624
- }, [i, S, k, M, N]);
2625
- const $ = K(r);
2626
- $.current = r;
2627
- const p = W(() => {
2628
- var x;
2629
- I(null), G(!0), (x = $.current) == null || x.call($);
2598
+ }, [i, T, S, A, y]);
2599
+ const P = H(r);
2600
+ P.current = r;
2601
+ const w = W(() => {
2602
+ var k;
2603
+ I(null), V(!0), (k = P.current) == null || k.call(P);
2630
2604
  }, []);
2631
- return A ? /* @__PURE__ */ n(Ee, {}) : D ? /* @__PURE__ */ n(fe, { message: D, onBack: T }) : !k || !S ? /* @__PURE__ */ n(
2605
+ return R ? /* @__PURE__ */ n(Ee, {}) : O ? /* @__PURE__ */ n(fe, { message: O, onBack: E }) : !S || !T ? /* @__PURE__ */ n(
2632
2606
  fe,
2633
2607
  {
2634
2608
  message: "Not connected to messaging service",
2635
- onBack: T
2609
+ onBack: E
2636
2610
  }
2637
- ) : B ? /* @__PURE__ */ n(fe, { message: B }) : Z && !E ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : E ? /* @__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(
2611
+ ) : L ? /* @__PURE__ */ n(fe, { message: L }) : j && !_ ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : _ ? /* @__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(
2638
2612
  dn,
2639
2613
  {
2640
- channel: E,
2614
+ channel: _,
2641
2615
  renderMessageInputActions: t,
2642
2616
  renderConversationFooter: s,
2643
- renderChannelBanner: b,
2644
- onLeaveConversation: p,
2645
- onBlockParticipant: p,
2617
+ renderChannelBanner: g,
2618
+ onLeaveConversation: w,
2619
+ onBlockParticipant: w,
2646
2620
  CustomChannelEmptyState: l,
2647
- showDeleteConversation: H,
2621
+ showDeleteConversation: G,
2648
2622
  onBlockParticipantClick: d,
2649
2623
  onReportParticipantClick: m,
2650
- dmAgentEnabled: g,
2624
+ dmAgentEnabled: b,
2651
2625
  onMessageSent: u,
2652
2626
  chatbotVotingEnabled: f,
2653
2627
  viewerLanguage: c,
2654
- customChannelActions: _,
2655
- renderMessage: v,
2656
- onMessageLinkClick: w,
2657
- showChannelInfo: y
2628
+ customChannelActions: v,
2629
+ renderMessage: p,
2630
+ onMessageLinkClick: N,
2631
+ showChannelInfo: x
2658
2632
  },
2659
- E.id
2633
+ _.id
2660
2634
  ) }) }) : /* @__PURE__ */ n(Ee, {});
2661
2635
  };
2662
- function Ka(e) {
2636
+ function Ja(e) {
2663
2637
  const t = e.state.pending_messages;
2664
2638
  if (t != null && t.length)
2665
2639
  for (const s of t)
@@ -2672,18 +2646,18 @@ const un = z.createContext({
2672
2646
  debug: !1,
2673
2647
  renderMessagePreview: void 0,
2674
2648
  viewerLanguage: void 0
2675
- }), Ja = un.Provider, Za = () => z.useContext(un), Qa = (e, t) => {
2649
+ }), Za = un.Provider, Qa = () => z.useContext(un), er = (e, t) => {
2676
2650
  const s = new Date(
2677
2651
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
2678
2652
  ), r = new Date(
2679
2653
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
2680
2654
  ).getTime() - s.getTime();
2681
2655
  return Math.floor(r / (1e3 * 60 * 60 * 24));
2682
- }, er = (e) => {
2656
+ }, tr = (e) => {
2683
2657
  const t = /* @__PURE__ */ new Date();
2684
2658
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
2685
2659
  return "Just now";
2686
- const a = Qa(e, t);
2660
+ const a = er(e, t);
2687
2661
  return a === 0 ? e.toLocaleTimeString([], {
2688
2662
  hour: "numeric",
2689
2663
  minute: "2-digit",
@@ -2695,49 +2669,49 @@ const un = z.createContext({
2695
2669
  });
2696
2670
  }, mn = z.memo(
2697
2671
  ({ channel: e, unread: t }) => {
2698
- var D, T, M;
2672
+ var O, E, A;
2699
2673
  const {
2700
2674
  selectedChannel: s,
2701
2675
  onChannelSelect: a,
2702
2676
  debug: r,
2703
2677
  renderMessagePreview: i,
2704
2678
  viewerLanguage: o
2705
- } = Za(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2679
+ } = Qa(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2706
2680
  e && a(e);
2707
- }, m = (N) => {
2708
- const E = N.key === "Enter" || N.key === " ", I = N.repeat;
2709
- !E || I || (N.preventDefault(), d());
2710
- }, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
2711
- (N) => {
2712
- var E, I;
2713
- return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== ((I = e == null ? void 0 : e._client) == null ? void 0 : I.userID);
2681
+ }, m = (y) => {
2682
+ const _ = y.key === "Enter" || y.key === " ", I = y.repeat;
2683
+ !_ || I || (y.preventDefault(), d());
2684
+ }, u = Object.values(((O = e == null ? void 0 : e.state) == null ? void 0 : O.members) || {}).find(
2685
+ (y) => {
2686
+ var _, I;
2687
+ return ((_ = y.user) == null ? void 0 : _.id) && y.user.id !== ((I = e == null ? void 0 : e._client) == null ? void 0 : I.userID);
2714
2688
  }
2715
- ), f = Ae(u == null ? void 0 : u.user), c = (T = u == null ? void 0 : u.user) == null ? void 0 : T.image, b = (() => {
2716
- var E;
2717
- const N = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
2718
- if (N != null && N.length) {
2719
- for (let I = N.length - 1; I >= 0; I--)
2720
- if (N[I].type !== "system") return N[I];
2689
+ ), f = Wt(u == null ? void 0 : u.user), c = (E = u == null ? void 0 : u.user) == null ? void 0 : E.image, g = (() => {
2690
+ var _;
2691
+ const y = (_ = e == null ? void 0 : e.state) == null ? void 0 : _.messages;
2692
+ if (y != null && y.length) {
2693
+ for (let I = y.length - 1; I >= 0; I--)
2694
+ if (y[I].type !== "system") return y[I];
2721
2695
  }
2722
- })(), v = (() => {
2723
- var Z, G, H, j;
2724
- const N = Xt({
2725
- message: b,
2696
+ })(), p = (() => {
2697
+ var j, V, G, $;
2698
+ const y = Xt({
2699
+ message: g,
2726
2700
  viewerLanguage: o
2727
2701
  });
2728
- if (((Z = b == null ? void 0 : b.metadata) == null ? void 0 : Z.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
2729
- if (((G = b == null ? void 0 : b.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
2730
- if (((H = b == null ? void 0 : b.metadata) == null ? void 0 : H.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
2731
- if (N) return N;
2732
- const P = (j = b == null ? void 0 : b.attachments) == null ? void 0 : j[0];
2733
- return P ? P.og_scrape_url ? P.og_scrape_url : P.type === "image" ? "📷 Sent an image" : P.type === "video" ? "🎥 Sent a video" : P.type === "audio" ? "🎵 Sent audio" : P.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2734
- })(), w = b != null && b.created_at ? er(new Date(b.created_at)) : "", y = b ? ke(b) : !1, S = i ? i(b, v) : `${y ? "✨ " : ""}${v}`, k = Wt(e), A = t ?? 0;
2702
+ if (((j = g == null ? void 0 : g.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_TIP") return y ? `💵 ${y}` : "💵 Sent a tip";
2703
+ if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_PAID") return y ? `💰 ${y}` : "💰 Sent a message";
2704
+ if (((G = g == null ? void 0 : g.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_ATTACHMENT") return y ? `📎 ${y}` : "📎 Sent an attachment";
2705
+ if (y) return y;
2706
+ const M = ($ = g == null ? void 0 : g.attachments) == null ? void 0 : $[0];
2707
+ return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2708
+ })(), N = g != null && g.created_at ? tr(new Date(g.created_at)) : "", x = g ? ke(g) : !1, T = i ? i(g, p) : `${x ? "✨ " : ""}${p}`, S = qt(e), R = t ?? 0;
2735
2709
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
2736
2710
  channelId: e == null ? void 0 : e.id,
2737
2711
  isSelected: l,
2738
2712
  participantName: f,
2739
- unreadCount: A,
2740
- hasTimestamp: !!w
2713
+ unreadCount: R,
2714
+ hasTimestamp: !!N
2741
2715
  }), /* @__PURE__ */ n(
2742
2716
  "div",
2743
2717
  {
@@ -2754,13 +2728,13 @@ const un = z.createContext({
2754
2728
  ),
2755
2729
  children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
2756
2730
  /* @__PURE__ */ n(
2757
- re,
2731
+ ae,
2758
2732
  {
2759
- id: ((M = u == null ? void 0 : u.user) == null ? void 0 : M.id) || e.id || "unknown",
2733
+ id: ((A = u == null ? void 0 : u.user) == null ? void 0 : A.id) || e.id || "unknown",
2760
2734
  name: f,
2761
2735
  image: c,
2762
2736
  size: 48,
2763
- starred: k
2737
+ starred: S
2764
2738
  }
2765
2739
  ),
2766
2740
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
@@ -2772,16 +2746,16 @@ const un = z.createContext({
2772
2746
  "text-sm font-medium truncate text-[#191918]"
2773
2747
  ),
2774
2748
  children: [
2775
- k && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2749
+ S && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2776
2750
  f
2777
2751
  ]
2778
2752
  }
2779
2753
  ),
2780
- w && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: w })
2754
+ N && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
2781
2755
  ] }),
2782
2756
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
2783
- /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: S }),
2784
- A > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: A > 99 ? "99+" : A })
2757
+ /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: T }),
2758
+ R > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: R > 99 ? "99+" : R })
2785
2759
  ] })
2786
2760
  ] })
2787
2761
  ] })
@@ -2790,31 +2764,31 @@ const un = z.createContext({
2790
2764
  }
2791
2765
  );
2792
2766
  mn.displayName = "CustomChannelPreview";
2793
- const tr = { last_message_at: -1 }, nr = z.memo(
2767
+ const nr = { last_message_at: -1 }, sr = z.memo(
2794
2768
  ({
2795
2769
  onChannelSelect: e,
2796
2770
  selectedChannel: t,
2797
2771
  filters: s,
2798
2772
  allowNewMessagesFromUnfilteredChannels: a = !1,
2799
2773
  channelRenderFilterFn: r,
2800
- sort: i = tr,
2774
+ sort: i = nr,
2801
2775
  className: o,
2802
2776
  customEmptyStateIndicator: l,
2803
2777
  renderMessagePreview: d,
2804
2778
  viewerLanguage: m
2805
2779
  }) => {
2806
- const g = z.useRef(0);
2807
- g.current++;
2808
- const { debug: u = !1 } = We(), f = z.useCallback(
2809
- (b) => {
2810
- for (const _ of b)
2811
- Ka(_);
2812
- return r ? r(b) : b;
2780
+ const b = z.useRef(0);
2781
+ b.current++;
2782
+ const { debug: u = !1 } = qe(), f = z.useCallback(
2783
+ (g) => {
2784
+ for (const v of g)
2785
+ Ja(v);
2786
+ return r ? r(g) : g;
2813
2787
  },
2814
2788
  [r]
2815
2789
  );
2816
2790
  u && console.log("📺 [ChannelList] 🔄 RENDER START", {
2817
- renderCount: g.current,
2791
+ renderCount: b.current,
2818
2792
  selectedChannelId: t == null ? void 0 : t.id,
2819
2793
  filters: s
2820
2794
  });
@@ -2841,8 +2815,8 @@ const tr = { last_message_at: -1 }, nr = z.memo(
2841
2815
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
2842
2816
  o
2843
2817
  ),
2844
- children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Ja, { value: c, children: /* @__PURE__ */ n(
2845
- ls,
2818
+ children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Za, { value: c, children: /* @__PURE__ */ n(
2819
+ cs,
2846
2820
  {
2847
2821
  filters: s,
2848
2822
  sort: i,
@@ -2858,27 +2832,27 @@ const tr = { last_message_at: -1 }, nr = z.memo(
2858
2832
  );
2859
2833
  }
2860
2834
  );
2861
- nr.displayName = "ChannelList";
2862
- const sr = /^([a-z][a-z0-9+.-]*):/i, ar = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2863
- function et(e) {
2835
+ sr.displayName = "ChannelList";
2836
+ const ar = /^([a-z][a-z0-9+.-]*):/i, rr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2837
+ function Qe(e) {
2864
2838
  if (typeof e != "string") return;
2865
2839
  const t = e.trim();
2866
2840
  if (t === "") return;
2867
- const s = sr.exec(t);
2841
+ const s = ar.exec(t);
2868
2842
  if (s) {
2869
2843
  const a = s[1].toLowerCase();
2870
- return ar.has(a) ? t : void 0;
2844
+ return rr.has(a) ? t : void 0;
2871
2845
  }
2872
2846
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
2873
2847
  }
2874
- const rr = {
2848
+ const ir = {
2875
2849
  dark: "bg-white text-[#121110] hover:bg-white/90",
2876
2850
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2877
- }, ir = ({ variant: e, cta: t }) => {
2851
+ }, or = ({ variant: e, cta: t }) => {
2878
2852
  const s = C(
2879
2853
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2880
- rr[e]
2881
- ), a = et(t.href);
2854
+ ir[e]
2855
+ ), a = Qe(t.href);
2882
2856
  return a ? /* @__PURE__ */ n(
2883
2857
  "a",
2884
2858
  {
@@ -2904,13 +2878,13 @@ const rr = {
2904
2878
  children: t.label
2905
2879
  }
2906
2880
  );
2907
- }, or = {
2881
+ }, lr = {
2908
2882
  dark: "text-white",
2909
2883
  light: "text-black/90"
2910
- }, lr = "text-white/30", cr = {
2884
+ }, cr = "text-white/30", dr = {
2911
2885
  dark: "text-white/55",
2912
2886
  light: "text-black/55"
2913
- }, tt = ({
2887
+ }, et = ({
2914
2888
  variant: e,
2915
2889
  title: t,
2916
2890
  placeholderTitle: s,
@@ -2920,39 +2894,39 @@ const rr = {
2920
2894
  cta: o,
2921
2895
  trailingAction: l
2922
2896
  }) => {
2923
- 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;
2924
- if (!g && !u && !c && !b) return null;
2925
- const v = C(
2897
+ const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", b = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", g = o != null;
2898
+ if (!b && !u && !c && !g) return null;
2899
+ const p = C(
2926
2900
  "truncate text-base font-medium leading-6",
2927
- d && !t ? lr : or[e]
2928
- ), w = C(
2901
+ d && !t ? cr : lr[e]
2902
+ ), N = C(
2929
2903
  "truncate text-xs leading-4",
2930
- cr[e]
2904
+ dr[e]
2931
2905
  );
2932
2906
  return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
2933
2907
  /* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
2934
2908
  /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
2935
2909
  /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
2936
- g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
2910
+ b && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
2937
2911
  i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
2938
- /* @__PURE__ */ n("p", { className: C("min-w-0", v), children: m })
2912
+ /* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
2939
2913
  ] }),
2940
- u && /* @__PURE__ */ n("p", { className: w, children: a })
2914
+ u && /* @__PURE__ */ n("p", { className: N, children: a })
2941
2915
  ] }),
2942
- !b && c && /* @__PURE__ */ n("p", { className: w, children: f })
2916
+ !g && c && /* @__PURE__ */ n("p", { className: N, children: f })
2943
2917
  ] }),
2944
2918
  l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
2945
2919
  ] }),
2946
- o && /* @__PURE__ */ n(ir, { variant: e, cta: o })
2920
+ o && /* @__PURE__ */ n(or, { variant: e, cta: o })
2947
2921
  ] });
2948
- }, dr = C(
2922
+ }, ur = C(
2949
2923
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2950
2924
  // 1px hairline border that sits flush with the card chrome — matches
2951
2925
  // the messaging design system's "small border around link attachments"
2952
2926
  // treatment from the mobile spec. The drop shadow remains for depth.
2953
2927
  "border border-black/[0.08]",
2954
2928
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2955
- ), Ie = ({
2929
+ ), Se = ({
2956
2930
  variant: e,
2957
2931
  children: t,
2958
2932
  href: s,
@@ -2963,8 +2937,8 @@ const rr = {
2963
2937
  bgClassName: l,
2964
2938
  "data-testid": d
2965
2939
  }) => {
2966
- const m = s != null || a != null, g = C(
2967
- dr,
2940
+ const m = s != null || a != null, b = C(
2941
+ ur,
2968
2942
  l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
2969
2943
  // `focus-ring` is a design-system utility from the component-library
2970
2944
  // tailwind preset — outline-none + a black 2px focus-visible ring
@@ -2980,7 +2954,7 @@ const rr = {
2980
2954
  rel: "noopener noreferrer",
2981
2955
  onClick: a,
2982
2956
  "data-testid": d,
2983
- className: g,
2957
+ className: b,
2984
2958
  children: [
2985
2959
  t,
2986
2960
  u
@@ -2994,7 +2968,7 @@ const rr = {
2994
2968
  onClick: a,
2995
2969
  "aria-label": r,
2996
2970
  "data-testid": d,
2997
- className: C(g, "text-left"),
2971
+ className: C(b, "text-left"),
2998
2972
  children: [
2999
2973
  t,
3000
2974
  u
@@ -3005,24 +2979,24 @@ const rr = {
3005
2979
  {
3006
2980
  ref: i,
3007
2981
  "data-testid": d,
3008
- className: g,
2982
+ className: b,
3009
2983
  children: [
3010
2984
  t,
3011
2985
  u
3012
2986
  ]
3013
2987
  }
3014
2988
  );
3015
- }, ur = {
2989
+ }, mr = {
3016
2990
  dark: "bg-white/10",
3017
2991
  light: "bg-black/5"
3018
- }, mr = {
2992
+ }, hr = {
3019
2993
  dark: "size-16 text-white/25",
3020
2994
  light: "size-16 text-black/25"
3021
- }, Me = (e, t) => !!t && !!e && ie(e) === "audio", hn = (e, t) => {
2995
+ }, Me = (e, t) => !!t && !!e && ne(e) === "audio", hn = (e, t) => {
3022
2996
  if (!t || !e) return !1;
3023
- const s = ie(e);
2997
+ const s = ne(e);
3024
2998
  return s === "video" || s === "audio";
3025
- }, nt = "bg-[#F2F3F4]", Se = ({
2999
+ }, tt = "bg-[#F2F3F4]", Ie = ({
3026
3000
  variant: e,
3027
3001
  thumbnailUrl: t,
3028
3002
  sourceUrl: s,
@@ -3031,7 +3005,7 @@ const rr = {
3031
3005
  topLeft: i,
3032
3006
  topRight: o
3033
3007
  }) => {
3034
- const l = ie(r), d = !!s && l === "video";
3008
+ const l = ne(r), d = !!s && l === "video";
3035
3009
  return Me(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
3036
3010
  "audio",
3037
3011
  {
@@ -3073,10 +3047,10 @@ const rr = {
3073
3047
  {
3074
3048
  className: C(
3075
3049
  "flex h-full w-full items-center justify-center",
3076
- ur[e]
3050
+ mr[e]
3077
3051
  ),
3078
- children: ce(r, {
3079
- className: mr[e],
3052
+ children: le(r, {
3053
+ className: hr[e],
3080
3054
  weight: "regular"
3081
3055
  })
3082
3056
  }
@@ -3086,7 +3060,7 @@ const rr = {
3086
3060
  ]
3087
3061
  }
3088
3062
  );
3089
- }, hr = ({
3063
+ }, fr = ({
3090
3064
  title: e,
3091
3065
  placeholderTitle: t,
3092
3066
  description: s,
@@ -3097,31 +3071,31 @@ const rr = {
3097
3071
  layout: l = "featured",
3098
3072
  appIcon: d,
3099
3073
  cta: m,
3100
- onDismiss: g,
3074
+ onDismiss: b,
3101
3075
  onEditClick: u
3102
3076
  }) => {
3103
- const f = l === "classic", c = Me(r, o), b = g ? /* @__PURE__ */ n(
3077
+ const f = l === "classic", c = Me(r, o), g = b ? /* @__PURE__ */ n(
3104
3078
  "button",
3105
3079
  {
3106
3080
  type: "button",
3107
- onClick: g,
3081
+ onClick: b,
3108
3082
  "aria-label": "Dismiss attachment",
3109
3083
  className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
3110
- children: /* @__PURE__ */ n(ve, { className: "size-3", weight: "bold" })
3084
+ children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
3111
3085
  }
3112
- ) : void 0, _ = u ? /* @__PURE__ */ n(
3086
+ ) : void 0, v = u ? /* @__PURE__ */ n(
3113
3087
  "button",
3114
3088
  {
3115
3089
  type: "button",
3116
3090
  onClick: u,
3117
3091
  "aria-label": "Edit attachment",
3118
3092
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
3119
- children: /* @__PURE__ */ n(Ss, { className: "size-5", weight: "regular" })
3093
+ children: /* @__PURE__ */ n(As, { className: "size-5", weight: "regular" })
3120
3094
  }
3121
3095
  ) : void 0;
3122
- return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: nt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3096
+ return c ? /* @__PURE__ */ n(Se, { variant: "dark", bgClassName: tt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3123
3097
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
3124
- Se,
3098
+ Ie,
3125
3099
  {
3126
3100
  variant: "dark",
3127
3101
  sourceUrl: o,
@@ -3129,26 +3103,26 @@ const rr = {
3129
3103
  mimeType: r
3130
3104
  }
3131
3105
  ) }),
3132
- b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
3106
+ g && /* @__PURE__ */ n("div", { className: "shrink-0", children: g })
3133
3107
  ] }) }) : /* @__PURE__ */ h(
3134
- Ie,
3108
+ Se,
3135
3109
  {
3136
3110
  variant: "dark",
3137
- topRight: f ? b : void 0,
3111
+ topRight: f ? g : void 0,
3138
3112
  children: [
3139
3113
  !f && /* @__PURE__ */ n(
3140
- Se,
3114
+ Ie,
3141
3115
  {
3142
3116
  variant: "dark",
3143
3117
  thumbnailUrl: i,
3144
3118
  sourceUrl: o,
3145
3119
  title: e,
3146
3120
  mimeType: r,
3147
- topRight: b
3121
+ topRight: g
3148
3122
  }
3149
3123
  ),
3150
3124
  /* @__PURE__ */ n(
3151
- tt,
3125
+ et,
3152
3126
  {
3153
3127
  variant: "dark",
3154
3128
  title: e,
@@ -3157,13 +3131,13 @@ const rr = {
3157
3131
  url: a,
3158
3132
  appIcon: d,
3159
3133
  cta: m,
3160
- trailingAction: _
3134
+ trailingAction: v
3161
3135
  }
3162
3136
  )
3163
3137
  ]
3164
3138
  }
3165
3139
  );
3166
- }, fr = ({
3140
+ }, gr = ({
3167
3141
  title: e,
3168
3142
  description: t,
3169
3143
  url: s,
@@ -3175,25 +3149,25 @@ const rr = {
3175
3149
  cta: d,
3176
3150
  onClick: m
3177
3151
  }) => {
3178
- const g = hn(a, i), u = et(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Me(a, i) ? nt : void 0, _ = d && m ? {
3152
+ const b = hn(a, i), u = Qe(s), f = d == null && u != null && !b ? u : void 0, c = d == null && !b ? m : void 0, g = Me(a, i) ? tt : void 0, v = d && m ? {
3179
3153
  ...d,
3180
3154
  onClick: () => {
3181
- var v;
3182
- m(), (v = d.onClick) == null || v.call(d);
3155
+ var p;
3156
+ m(), (p = d.onClick) == null || p.call(d);
3183
3157
  }
3184
3158
  } : d;
3185
3159
  return /* @__PURE__ */ h(
3186
- Ie,
3160
+ Se,
3187
3161
  {
3188
3162
  variant: "light",
3189
3163
  href: f,
3190
3164
  onClick: c,
3191
3165
  ariaLabel: e ?? "Open attachment preview",
3192
- bgClassName: b,
3166
+ bgClassName: g,
3193
3167
  "data-testid": "link-attachment",
3194
3168
  children: [
3195
3169
  o === "featured" && /* @__PURE__ */ n(
3196
- Se,
3170
+ Ie,
3197
3171
  {
3198
3172
  variant: "light",
3199
3173
  thumbnailUrl: r,
@@ -3203,20 +3177,20 @@ const rr = {
3203
3177
  }
3204
3178
  ),
3205
3179
  /* @__PURE__ */ n(
3206
- tt,
3180
+ et,
3207
3181
  {
3208
3182
  variant: "light",
3209
3183
  title: e,
3210
3184
  description: t,
3211
3185
  url: s,
3212
3186
  appIcon: l,
3213
- cta: _
3187
+ cta: v
3214
3188
  }
3215
3189
  )
3216
3190
  ]
3217
3191
  }
3218
3192
  );
3219
- }, gr = ({
3193
+ }, br = ({
3220
3194
  title: e,
3221
3195
  placeholderTitle: t,
3222
3196
  description: s,
@@ -3227,19 +3201,19 @@ const rr = {
3227
3201
  layout: l = "featured",
3228
3202
  appIcon: d,
3229
3203
  cta: m,
3230
- onClick: g
3204
+ onClick: b
3231
3205
  }) => {
3232
- const u = hn(r, o), f = et(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
3206
+ const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0, g = m == null && !u && c != null ? b : void 0;
3233
3207
  return /* @__PURE__ */ h(
3234
- Ie,
3208
+ Se,
3235
3209
  {
3236
3210
  variant: "dark",
3237
3211
  href: c,
3238
- onClick: b,
3239
- bgClassName: Me(r, o) ? nt : void 0,
3212
+ onClick: g,
3213
+ bgClassName: Me(r, o) ? tt : void 0,
3240
3214
  children: [
3241
3215
  l === "featured" && /* @__PURE__ */ n(
3242
- Se,
3216
+ Ie,
3243
3217
  {
3244
3218
  variant: "dark",
3245
3219
  thumbnailUrl: i,
@@ -3249,7 +3223,7 @@ const rr = {
3249
3223
  }
3250
3224
  ),
3251
3225
  /* @__PURE__ */ n(
3252
- tt,
3226
+ et,
3253
3227
  {
3254
3228
  variant: "dark",
3255
3229
  title: e,
@@ -3263,20 +3237,20 @@ const rr = {
3263
3237
  ]
3264
3238
  }
3265
3239
  );
3266
- }, yi = {
3267
- Composer: hr,
3268
- Sent: gr,
3269
- Received: fr
3270
- }, br = {
3240
+ }, Ci = {
3241
+ Composer: fr,
3242
+ Sent: br,
3243
+ Received: gr
3244
+ }, pr = {
3271
3245
  dark: "bg-[#121110]",
3272
3246
  light: "bg-[#e9eaed]"
3273
- }, pr = {
3247
+ }, vr = {
3274
3248
  dark: "text-white",
3275
3249
  light: "text-[#080707]"
3276
- }, vr = {
3250
+ }, xr = {
3277
3251
  dark: "border-white/[0.08]",
3278
3252
  light: "border-black/[0.08]"
3279
- }, xr = (e) => e === "dark" ? "sender" : "receiver", wr = {
3253
+ }, wr = (e) => e === "dark" ? "sender" : "receiver", Nr = {
3280
3254
  sender: {
3281
3255
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
3282
3256
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -3289,7 +3263,7 @@ const rr = {
3289
3263
  middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
3290
3264
  end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
3291
3265
  }
3292
- }, xe = ({
3266
+ }, ve = ({
3293
3267
  variant: e,
3294
3268
  text: t,
3295
3269
  bordered: s = !0,
@@ -3298,7 +3272,7 @@ const rr = {
3298
3272
  children: i,
3299
3273
  "data-testid": o
3300
3274
  }) => {
3301
- const l = t != null && t !== "", d = wr[xr(e)][a];
3275
+ const l = t != null && t !== "", d = Nr[wr(e)][a];
3302
3276
  return /* @__PURE__ */ h(
3303
3277
  "div",
3304
3278
  {
@@ -3313,10 +3287,10 @@ const rr = {
3313
3287
  // as the surrounding `CustomMessage` text bubbles.
3314
3288
  "relative w-[280px] overflow-hidden px-2 py-2",
3315
3289
  d,
3316
- br[e],
3317
3290
  pr[e],
3291
+ vr[e],
3318
3292
  s && "border",
3319
- s && vr[e],
3293
+ s && xr[e],
3320
3294
  r
3321
3295
  ),
3322
3296
  children: [
@@ -3341,7 +3315,7 @@ const rr = {
3341
3315
  ]
3342
3316
  }
3343
3317
  );
3344
- }, we = ({
3318
+ }, xe = ({
3345
3319
  onClick: e,
3346
3320
  variant: t = "overlay",
3347
3321
  ariaLabel: s = "Dismiss attachment"
@@ -3357,18 +3331,18 @@ const rr = {
3357
3331
  "flex size-6 items-center justify-center rounded-full text-white",
3358
3332
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
3359
3333
  ),
3360
- children: /* @__PURE__ */ n(ve, { className: "size-3", weight: "bold" })
3334
+ children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
3361
3335
  }
3362
- ), Ne = (e) => e === "received" ? "light" : "dark", Ci = ({
3336
+ ), we = (e) => e === "received" ? "light" : "dark", ki = ({
3363
3337
  firstOfGroup: e,
3364
3338
  endOfGroup: t,
3365
3339
  groupedByUser: s
3366
- }) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Nr = ({
3340
+ }) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", _r = ({
3367
3341
  src: e,
3368
3342
  mimeType: t,
3369
3343
  filename: s,
3370
3344
  items: a
3371
- }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], _r = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3345
+ }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], yr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3372
3346
  /* @__PURE__ */ n(
3373
3347
  "audio",
3374
3348
  {
@@ -3380,7 +3354,7 @@ const rr = {
3380
3354
  }
3381
3355
  ),
3382
3356
  s ?? null
3383
- ] }), st = ({
3357
+ ] }), nt = ({
3384
3358
  state: e,
3385
3359
  src: t,
3386
3360
  mimeType: s,
@@ -3391,41 +3365,41 @@ const rr = {
3391
3365
  preload: l,
3392
3366
  onDismiss: d
3393
3367
  }) => {
3394
- const m = Ne(e), g = e === "composer" && !!d, u = Nr({ src: t, mimeType: s, filename: a, items: r });
3368
+ const m = we(e), b = e === "composer" && !!d, u = _r({ src: t, mimeType: s, filename: a, items: r });
3395
3369
  if (u.length === 0)
3396
3370
  return null;
3397
3371
  const f = l ?? (u.length > 1 ? "none" : "metadata");
3398
3372
  return /* @__PURE__ */ n(
3399
- xe,
3373
+ ve,
3400
3374
  {
3401
3375
  variant: m,
3402
3376
  text: i,
3403
3377
  groupPosition: o,
3404
3378
  "data-testid": "audio-attachment",
3405
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
3406
- _r,
3379
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, g) => /* @__PURE__ */ n(
3380
+ yr,
3407
3381
  {
3408
3382
  item: c,
3409
3383
  preload: f,
3410
3384
  trailingAction: (
3411
3385
  // Composer only supports a single attachment, so the
3412
3386
  // dismiss control sits on the only player.
3413
- g && b === 0 ? /* @__PURE__ */ n(we, { onClick: d, variant: "inline" }) : void 0
3387
+ b && g === 0 ? /* @__PURE__ */ n(xe, { onClick: d, variant: "inline" }) : void 0
3414
3388
  )
3415
3389
  },
3416
- `${c.src}-${b}`
3390
+ `${c.src}-${g}`
3417
3391
  )) })
3418
3392
  }
3419
3393
  );
3420
- }, yr = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), Cr = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), kr = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), Er = {
3421
- Composer: yr,
3422
- Sent: Cr,
3423
- Received: kr
3394
+ }, Cr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "composer" }), kr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "sent" }), Er = (e) => /* @__PURE__ */ n(nt, { ...e, state: "received" }), Sr = {
3395
+ Composer: Cr,
3396
+ Sent: kr,
3397
+ Received: Er
3424
3398
  };
3425
3399
  function Ir(e) {
3426
3400
  return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
3427
3401
  }
3428
- const Sr = {
3402
+ const Tr = {
3429
3403
  pdf: "PDF",
3430
3404
  doc: "DOC",
3431
3405
  xls: "XLS",
@@ -3435,7 +3409,7 @@ const Sr = {
3435
3409
  text: "TXT",
3436
3410
  markdown: "MD"
3437
3411
  };
3438
- function Tr(e, t) {
3412
+ function Ar(e, t) {
3439
3413
  if (t) {
3440
3414
  const r = t.lastIndexOf(".");
3441
3415
  if (r > 0 && r < t.length - 1) {
@@ -3444,8 +3418,8 @@ function Tr(e, t) {
3444
3418
  }
3445
3419
  }
3446
3420
  if (!e) return;
3447
- if (ie(e) === "document") {
3448
- const r = Zt(e), i = Sr[r];
3421
+ if (ne(e) === "document") {
3422
+ const r = Zt(e), i = Tr[r];
3449
3423
  if (i) return i;
3450
3424
  if (e === "application/octet-stream") return;
3451
3425
  }
@@ -3453,11 +3427,11 @@ function Tr(e, t) {
3453
3427
  if (!(!a || a === "*"))
3454
3428
  return a.toUpperCase();
3455
3429
  }
3456
- function Ar(e, t, s) {
3457
- const a = Tr(e, t), r = typeof s == "number" && s > 0 ? Ir(s) : void 0;
3430
+ function Mr(e, t, s) {
3431
+ const a = Ar(e, t), r = typeof s == "number" && s > 0 ? Ir(s) : void 0;
3458
3432
  return [a, r].filter(Boolean).join(" · ") || void 0;
3459
3433
  }
3460
- function ne(e) {
3434
+ function Z(e) {
3461
3435
  try {
3462
3436
  const s = new URL(e).pathname.split("/").pop();
3463
3437
  return s && s.length > 0 ? decodeURIComponent(s) : "download";
@@ -3465,13 +3439,13 @@ function ne(e) {
3465
3439
  return "download";
3466
3440
  }
3467
3441
  }
3468
- const Mr = {
3442
+ const Rr = {
3469
3443
  dark: "text-white/55",
3470
3444
  light: "text-black/65"
3471
- }, Dr = {
3445
+ }, Lr = {
3472
3446
  dark: "bg-white/10",
3473
3447
  light: "bg-black/5"
3474
- }, Rr = {
3448
+ }, Dr = {
3475
3449
  dark: "text-white/85",
3476
3450
  light: "text-black/85"
3477
3451
  }, fn = ({
@@ -3484,16 +3458,16 @@ const Mr = {
3484
3458
  activateLabel: o,
3485
3459
  trailingAction: l
3486
3460
  }) => {
3487
- const d = s ?? t ?? "File", m = Ar(a, t, r), g = /* @__PURE__ */ n(
3461
+ const d = s ?? t ?? "File", m = Mr(a, t, r), b = /* @__PURE__ */ n(
3488
3462
  "div",
3489
3463
  {
3490
3464
  className: C(
3491
3465
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
3492
- Dr[e]
3466
+ Lr[e]
3493
3467
  ),
3494
3468
  "aria-hidden": !0,
3495
- children: ce(a, {
3496
- className: C("size-6", Rr[e]),
3469
+ children: le(a, {
3470
+ className: C("size-6", Dr[e]),
3497
3471
  weight: "regular"
3498
3472
  })
3499
3473
  }
@@ -3504,7 +3478,7 @@ const Mr = {
3504
3478
  {
3505
3479
  className: C(
3506
3480
  "truncate text-xs leading-4",
3507
- Mr[e]
3481
+ Rr[e]
3508
3482
  ),
3509
3483
  children: m
3510
3484
  }
@@ -3520,12 +3494,12 @@ const Mr = {
3520
3494
  e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
3521
3495
  ),
3522
3496
  children: [
3523
- g,
3497
+ b,
3524
3498
  u
3525
3499
  ]
3526
3500
  }
3527
- ) : /* @__PURE__ */ h(ae, { children: [
3528
- g,
3501
+ ) : /* @__PURE__ */ h(te, { children: [
3502
+ b,
3529
3503
  u
3530
3504
  ] });
3531
3505
  return /* @__PURE__ */ h("div", { className: "flex items-center gap-3 px-3 py-2", children: [
@@ -3534,7 +3508,7 @@ const Mr = {
3534
3508
  ] });
3535
3509
  };
3536
3510
  async function gn(e, t) {
3537
- const s = t ?? ne(e);
3511
+ const s = t ?? Z(e);
3538
3512
  try {
3539
3513
  const a = await fetch(e, { mode: "cors" });
3540
3514
  if (!a.ok) throw new Error(`HTTP ${a.status}`);
@@ -3547,21 +3521,21 @@ async function gn(e, t) {
3547
3521
  }
3548
3522
  }
3549
3523
  }
3550
- const Lr = ({
3524
+ const Pr = ({
3551
3525
  src: e,
3552
3526
  filename: t,
3553
3527
  fileSize: s,
3554
3528
  mimeType: a,
3555
3529
  title: r,
3556
3530
  items: i
3557
- }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Pr = ({
3531
+ }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Or = ({
3558
3532
  variant: e,
3559
3533
  item: t,
3560
3534
  index: s,
3561
3535
  onActivate: a,
3562
3536
  trailingAction: r
3563
3537
  }) => {
3564
- const i = t.filename ?? ne(t.src);
3538
+ const i = t.filename ?? Z(t.src);
3565
3539
  return /* @__PURE__ */ n(
3566
3540
  fn,
3567
3541
  {
@@ -3575,7 +3549,7 @@ const Lr = ({
3575
3549
  trailingAction: r
3576
3550
  }
3577
3551
  );
3578
- }, at = ({
3552
+ }, st = ({
3579
3553
  state: e,
3580
3554
  src: t,
3581
3555
  filename: s,
@@ -3586,25 +3560,25 @@ const Lr = ({
3586
3560
  text: l,
3587
3561
  groupPosition: d,
3588
3562
  onClick: m,
3589
- onDismiss: g
3563
+ onDismiss: b
3590
3564
  }) => {
3591
- const u = Ne(e), f = e === "composer" && !!g, c = Lr({
3565
+ const u = we(e), f = e === "composer" && !!b, c = Pr({
3592
3566
  src: t,
3593
3567
  filename: s,
3594
3568
  fileSize: a,
3595
3569
  mimeType: r,
3596
3570
  title: i,
3597
3571
  items: o
3598
- }), b = (v) => {
3599
- if ((m == null ? void 0 : m(v)) === !1) return;
3600
- const w = c[v];
3601
- if (!w) return;
3602
- const y = w.filename ?? ne(w.src);
3603
- gn(w.src, y);
3572
+ }), g = (p) => {
3573
+ if ((m == null ? void 0 : m(p)) === !1) return;
3574
+ const N = c[p];
3575
+ if (!N) return;
3576
+ const x = N.filename ?? Z(N.src);
3577
+ gn(N.src, x);
3604
3578
  };
3605
3579
  if (c.length === 0)
3606
3580
  return null;
3607
- const _ = /* @__PURE__ */ n(
3581
+ const v = /* @__PURE__ */ n(
3608
3582
  "span",
3609
3583
  {
3610
3584
  className: C(
@@ -3616,35 +3590,35 @@ const Lr = ({
3616
3590
  }
3617
3591
  );
3618
3592
  return /* @__PURE__ */ n(
3619
- xe,
3593
+ ve,
3620
3594
  {
3621
3595
  variant: u,
3622
3596
  text: l,
3623
3597
  groupPosition: d,
3624
3598
  "data-testid": "file-attachment",
3625
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, w) => /* @__PURE__ */ n(
3626
- Pr,
3599
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, N) => /* @__PURE__ */ n(
3600
+ Or,
3627
3601
  {
3628
3602
  variant: u,
3629
- item: v,
3630
- index: w,
3631
- onActivate: b,
3632
- trailingAction: f && w === 0 ? /* @__PURE__ */ n(we, { onClick: g, variant: "inline" }) : _
3603
+ item: p,
3604
+ index: N,
3605
+ onActivate: g,
3606
+ trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : v
3633
3607
  },
3634
- `${v.src}-${w}`
3608
+ `${p.src}-${N}`
3635
3609
  )) })
3636
3610
  }
3637
3611
  );
3638
- }, Or = (e) => /* @__PURE__ */ n(at, { ...e, state: "composer" }), zr = (e) => /* @__PURE__ */ n(at, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ n(at, { ...e, state: "received" }), $r = {
3639
- Composer: Or,
3640
- Sent: zr,
3612
+ }, zr = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), $r = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), Br = {
3613
+ Composer: zr,
3614
+ Sent: $r,
3641
3615
  Received: Fr
3642
- }, rt = ({
3616
+ }, at = ({
3643
3617
  onPrev: e,
3644
3618
  onNext: t,
3645
3619
  prevLabel: s = "Previous",
3646
3620
  nextLabel: a = "Next"
3647
- }) => /* @__PURE__ */ h(ae, { children: [
3621
+ }) => /* @__PURE__ */ h(te, { children: [
3648
3622
  /* @__PURE__ */ n(
3649
3623
  "button",
3650
3624
  {
@@ -3652,7 +3626,7 @@ const Lr = ({
3652
3626
  onClick: e,
3653
3627
  "aria-label": s,
3654
3628
  className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
3655
- children: /* @__PURE__ */ n(Ts, { size: 20, weight: "bold", "aria-hidden": !0 })
3629
+ children: /* @__PURE__ */ n(Ms, { size: 20, weight: "bold", "aria-hidden": !0 })
3656
3630
  }
3657
3631
  ),
3658
3632
  /* @__PURE__ */ n(
@@ -3662,7 +3636,7 @@ const Lr = ({
3662
3636
  onClick: t,
3663
3637
  "aria-label": a,
3664
3638
  className: "mes-media-viewer__nav mes-media-viewer__nav--next",
3665
- children: /* @__PURE__ */ n(As, { size: 20, weight: "bold", "aria-hidden": !0 })
3639
+ children: /* @__PURE__ */ n(Rs, { size: 20, weight: "bold", "aria-hidden": !0 })
3666
3640
  }
3667
3641
  )
3668
3642
  ] }), bn = ({
@@ -3674,7 +3648,7 @@ const Lr = ({
3674
3648
  tone: i = "dark",
3675
3649
  onTriggered: o
3676
3650
  }) => {
3677
- const [l, d] = O(!1), m = W(
3651
+ const [l, d] = D(!1), m = W(
3678
3652
  (c) => {
3679
3653
  c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
3680
3654
  }).finally(() => {
@@ -3682,7 +3656,7 @@ const Lr = ({
3682
3656
  }));
3683
3657
  },
3684
3658
  [l, e, t, o]
3685
- ), g = r ?? s !== "pill", f = { className: C(
3659
+ ), b = r ?? s !== "pill", f = { className: C(
3686
3660
  s === "pill" ? "size-4" : "size-5",
3687
3661
  "shrink-0"
3688
3662
  ), weight: "bold" };
@@ -3732,7 +3706,7 @@ const Lr = ({
3732
3706
  type: "button",
3733
3707
  onClick: m,
3734
3708
  disabled: l,
3735
- "aria-label": g ? a : void 0,
3709
+ "aria-label": b ? a : void 0,
3736
3710
  className: C(
3737
3711
  "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
3738
3712
  i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
@@ -3746,19 +3720,19 @@ const Lr = ({
3746
3720
  "aria-hidden": !0
3747
3721
  }
3748
3722
  ) : /* @__PURE__ */ n(be, { ...f, "aria-hidden": !0 }),
3749
- g ? null : a
3723
+ b ? null : a
3750
3724
  ]
3751
3725
  }
3752
3726
  );
3753
- }, $e = (e, t, s) => Math.min(Math.max(e, t), s), it = ({
3727
+ }, $e = (e, t, s) => Math.min(Math.max(e, t), s), rt = ({
3754
3728
  length: e,
3755
3729
  initialIndex: t,
3756
3730
  open: s
3757
3731
  }) => {
3758
- const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = O(a);
3759
- J(() => {
3732
+ const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = D(a);
3733
+ Y(() => {
3760
3734
  s && i($e(t, 0, Math.max(e - 1, 0)));
3761
- }, [s, t, e]), J(() => {
3735
+ }, [s, t, e]), Y(() => {
3762
3736
  i((d) => $e(d, 0, Math.max(e - 1, 0)));
3763
3737
  }, [e]);
3764
3738
  const o = W(() => {
@@ -3766,16 +3740,16 @@ const Lr = ({
3766
3740
  }, [e]), l = W(() => {
3767
3741
  e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
3768
3742
  }, [e]);
3769
- return J(() => {
3743
+ return Y(() => {
3770
3744
  if (!s || e <= 1) return;
3771
3745
  const d = (m) => {
3772
3746
  if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
3773
- const g = document.activeElement;
3774
- g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
3747
+ const b = document.activeElement;
3748
+ b && (b.tagName === "VIDEO" || b.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
3775
3749
  };
3776
3750
  return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
3777
3751
  }, [s, e, o, l]), { index: r, prev: o, next: l };
3778
- }, ot = ({
3752
+ }, it = ({
3779
3753
  open: e,
3780
3754
  onClose: t,
3781
3755
  ariaLabel: s,
@@ -3784,8 +3758,8 @@ const Lr = ({
3784
3758
  children: i,
3785
3759
  "data-testid": o
3786
3760
  }) => {
3787
- const l = K(null), d = K(null);
3788
- return J(() => {
3761
+ const l = H(null), d = H(null);
3762
+ return Y(() => {
3789
3763
  var f;
3790
3764
  const u = l.current;
3791
3765
  if (u) {
@@ -3856,7 +3830,7 @@ const Lr = ({
3856
3830
  onClick: t,
3857
3831
  "aria-label": "Close viewer",
3858
3832
  className: "mes-media-viewer__action",
3859
- children: /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
3833
+ children: /* @__PURE__ */ n(Ae, { size: 20, weight: "bold", "aria-hidden": !0 })
3860
3834
  }
3861
3835
  )
3862
3836
  ] })
@@ -3871,16 +3845,16 @@ const Lr = ({
3871
3845
  initialIndex: s = 0,
3872
3846
  onClose: a
3873
3847
  }) => {
3874
- const { index: r, prev: i, next: o } = it({
3848
+ const { index: r, prev: i, next: o } = rt({
3875
3849
  length: t.length,
3876
3850
  initialIndex: s,
3877
3851
  open: e
3878
- }), l = t[r], d = se(
3879
- () => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "image"),
3852
+ }), l = t[r], d = ee(
3853
+ () => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "image"),
3880
3854
  [l]
3881
3855
  );
3882
3856
  return l ? /* @__PURE__ */ h(
3883
- ot,
3857
+ it,
3884
3858
  {
3885
3859
  open: e,
3886
3860
  onClose: a,
@@ -3910,7 +3884,7 @@ const Lr = ({
3910
3884
  `${r}:${l.src}`
3911
3885
  ),
3912
3886
  t.length > 1 ? /* @__PURE__ */ n(
3913
- rt,
3887
+ at,
3914
3888
  {
3915
3889
  onPrev: i,
3916
3890
  onNext: o,
@@ -3921,7 +3895,7 @@ const Lr = ({
3921
3895
  ]
3922
3896
  }
3923
3897
  ) : null;
3924
- }, Br = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", vn = ({
3898
+ }, Ur = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", vn = ({
3925
3899
  tiles: e,
3926
3900
  onTileActivate: t,
3927
3901
  maxVisible: s = 4,
@@ -3929,8 +3903,8 @@ const Lr = ({
3929
3903
  }) => {
3930
3904
  const r = e.length;
3931
3905
  if (r === 0) return null;
3932
- const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
3933
- const u = C(Br, "h-full w-full");
3906
+ const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, b) => {
3907
+ const u = C(Ur, "h-full w-full");
3934
3908
  return t ? /* @__PURE__ */ h(
3935
3909
  "button",
3936
3910
  {
@@ -3940,13 +3914,13 @@ const Lr = ({
3940
3914
  className: C(u, "cursor-zoom-in"),
3941
3915
  children: [
3942
3916
  d.content,
3943
- g
3917
+ b
3944
3918
  ]
3945
3919
  },
3946
3920
  m
3947
3921
  ) : /* @__PURE__ */ h("div", { className: u, children: [
3948
3922
  d.content,
3949
- g
3923
+ b
3950
3924
  ] }, m);
3951
3925
  };
3952
3926
  return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
@@ -3979,11 +3953,11 @@ const Lr = ({
3979
3953
  a
3980
3954
  ),
3981
3955
  children: i.map((d, m) => {
3982
- const g = o > 0 && m === i.length - 1;
3956
+ const b = o > 0 && m === i.length - 1;
3983
3957
  return l(
3984
3958
  d,
3985
3959
  m,
3986
- g ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
3960
+ b ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
3987
3961
  "+",
3988
3962
  o
3989
3963
  ] }) : null
@@ -3991,8 +3965,8 @@ const Lr = ({
3991
3965
  })
3992
3966
  }
3993
3967
  );
3994
- }, _e = (e) => {
3995
- const [t, s] = O(!1), [a, r] = O(0), i = W(
3968
+ }, Ne = (e) => {
3969
+ const [t, s] = D(!1), [a, r] = D(0), i = W(
3996
3970
  (l) => {
3997
3971
  (e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
3998
3972
  },
@@ -4014,7 +3988,7 @@ const Lr = ({
4014
3988
  className: "absolute inset-0 size-full rounded-md object-cover"
4015
3989
  }
4016
3990
  )
4017
- }), Ur = ({
3991
+ }), Vr = ({
4018
3992
  src: e,
4019
3993
  alt: t,
4020
3994
  items: s
@@ -4022,8 +3996,8 @@ const Lr = ({
4022
3996
  src: s.src,
4023
3997
  alt: s.alt,
4024
3998
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
4025
- })), Vr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
4026
- const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = _e(
3999
+ })), Gr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
4000
+ const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ne(
4027
4001
  r
4028
4002
  );
4029
4003
  return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
@@ -4047,7 +4021,7 @@ const Lr = ({
4047
4021
  )
4048
4022
  }
4049
4023
  ),
4050
- i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(we, { onClick: i }) }) : null,
4024
+ i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: i }) }) : null,
4051
4025
  /* @__PURE__ */ n(
4052
4026
  pn,
4053
4027
  {
@@ -4069,58 +4043,58 @@ const Lr = ({
4069
4043
  loading: l = "lazy",
4070
4044
  onClick: d
4071
4045
  }) => {
4072
- const m = Ur({ src: t, alt: s, items: r }), g = Ne(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = _e(
4046
+ const m = Vr({ src: t, alt: s, items: r }), b = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: g } = Ne(
4073
4047
  d
4074
4048
  );
4075
4049
  if (m.length === 0)
4076
4050
  return null;
4077
- const _ = m.map(
4078
- (v, w) => jr(v, w, m.length, l)
4051
+ const v = m.map(
4052
+ (p, N) => jr(p, N, m.length, l)
4079
4053
  );
4080
4054
  return /* @__PURE__ */ h(
4081
- xe,
4055
+ ve,
4082
4056
  {
4083
- variant: g,
4057
+ variant: b,
4084
4058
  text: i,
4085
4059
  groupPosition: o,
4086
4060
  "data-testid": "image-attachment",
4087
4061
  children: [
4088
- /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: _, onTileActivate: c }) }),
4062
+ /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: v, onTileActivate: c }) }),
4089
4063
  /* @__PURE__ */ n(
4090
4064
  pn,
4091
4065
  {
4092
4066
  open: u,
4093
4067
  items: xn(m, a),
4094
4068
  initialIndex: f,
4095
- onClose: b
4069
+ onClose: g
4096
4070
  }
4097
4071
  )
4098
4072
  ]
4099
4073
  }
4100
4074
  );
4101
- }, Gr = (e) => /* @__PURE__ */ n(Vr, { ...e }), Hr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), Yr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), qr = {
4102
- Composer: Gr,
4103
- Sent: Hr,
4104
- Received: Yr
4105
- }, Wr = ({
4075
+ }, Hr = (e) => /* @__PURE__ */ n(Gr, { ...e }), Yr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), qr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), Wr = {
4076
+ Composer: Hr,
4077
+ Sent: Yr,
4078
+ Received: qr
4079
+ }, Xr = ({
4106
4080
  open: e,
4107
4081
  items: t,
4108
4082
  initialIndex: s = 0,
4109
4083
  onClose: a
4110
4084
  }) => {
4111
- const { index: r, prev: i, next: o } = it({
4085
+ const { index: r, prev: i, next: o } = rt({
4112
4086
  length: t.length,
4113
4087
  initialIndex: s,
4114
4088
  open: e
4115
- }), l = t[r], d = se(
4116
- () => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "document"),
4089
+ }), l = t[r], d = ee(
4090
+ () => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "document"),
4117
4091
  [l]
4118
- ), m = se(
4119
- () => l ? Xr(l.src) : void 0,
4092
+ ), m = ee(
4093
+ () => l ? Kr(l.src) : void 0,
4120
4094
  [l]
4121
4095
  );
4122
4096
  return !l || !m ? null : /* @__PURE__ */ h(
4123
- ot,
4097
+ it,
4124
4098
  {
4125
4099
  open: e,
4126
4100
  onClose: a,
@@ -4139,7 +4113,7 @@ const Lr = ({
4139
4113
  `${r}:${l.src}`
4140
4114
  ),
4141
4115
  t.length > 1 ? /* @__PURE__ */ n(
4142
- rt,
4116
+ at,
4143
4117
  {
4144
4118
  onPrev: i,
4145
4119
  onNext: o,
@@ -4150,23 +4124,23 @@ const Lr = ({
4150
4124
  ]
4151
4125
  }
4152
4126
  );
4153
- }, Xr = (e) => {
4127
+ }, Kr = (e) => {
4154
4128
  const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
4155
4129
  return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
4156
- }, Kr = ({
4130
+ }, Jr = ({
4157
4131
  src: e,
4158
4132
  filename: t,
4159
4133
  fileSize: s,
4160
4134
  title: a,
4161
4135
  items: r
4162
- }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], Jr = ({
4136
+ }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], Zr = ({
4163
4137
  variant: e,
4164
4138
  item: t,
4165
4139
  index: s,
4166
4140
  onActivate: a,
4167
4141
  trailingAction: r
4168
4142
  }) => {
4169
- const i = t.filename ?? ne(t.src);
4143
+ const i = t.filename ?? Z(t.src);
4170
4144
  return /* @__PURE__ */ n(
4171
4145
  fn,
4172
4146
  {
@@ -4180,7 +4154,7 @@ const Lr = ({
4180
4154
  trailingAction: r
4181
4155
  }
4182
4156
  );
4183
- }, lt = ({
4157
+ }, ot = ({
4184
4158
  state: e,
4185
4159
  src: t,
4186
4160
  filename: s,
@@ -4192,78 +4166,78 @@ const Lr = ({
4192
4166
  onClick: d,
4193
4167
  onDismiss: m
4194
4168
  }) => {
4195
- const g = Ne(e), u = Kr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = _e(
4169
+ const b = we(e), u = Jr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: v } = Ne(
4196
4170
  d
4197
- ), v = e === "composer" && !!m;
4171
+ ), p = e === "composer" && !!m;
4198
4172
  if (u.length === 0)
4199
4173
  return null;
4200
- const w = u.map((y) => ({
4201
- src: y.src,
4202
- filename: y.filename ?? ne(y.src)
4174
+ const N = u.map((x) => ({
4175
+ src: x.src,
4176
+ filename: x.filename ?? Z(x.src)
4203
4177
  }));
4204
4178
  return /* @__PURE__ */ h(
4205
- xe,
4179
+ ve,
4206
4180
  {
4207
- variant: g,
4181
+ variant: b,
4208
4182
  text: o,
4209
4183
  groupPosition: l,
4210
4184
  "data-testid": "pdf-attachment",
4211
4185
  children: [
4212
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((y, S) => {
4213
- const k = y.filename ?? ne(y.src), A = v && S === 0 ? /* @__PURE__ */ n(we, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4186
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x, T) => {
4187
+ const S = x.filename ?? Z(x.src), R = p && T === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4214
4188
  bn,
4215
4189
  {
4216
- url: y.src,
4217
- filename: k,
4190
+ url: x.src,
4191
+ filename: S,
4218
4192
  variant: "inline",
4219
- label: `Download ${k}`,
4220
- tone: g
4193
+ label: `Download ${S}`,
4194
+ tone: b
4221
4195
  }
4222
4196
  );
4223
4197
  return /* @__PURE__ */ n(
4224
- Jr,
4198
+ Zr,
4225
4199
  {
4226
- variant: g,
4227
- item: y,
4228
- index: S,
4229
- onActivate: b,
4230
- trailingAction: A
4200
+ variant: b,
4201
+ item: x,
4202
+ index: T,
4203
+ onActivate: g,
4204
+ trailingAction: R
4231
4205
  },
4232
- `${y.src}-${S}`
4206
+ `${x.src}-${T}`
4233
4207
  );
4234
4208
  }) }),
4235
4209
  /* @__PURE__ */ n(
4236
- Wr,
4210
+ Xr,
4237
4211
  {
4238
4212
  open: f,
4239
- items: w,
4213
+ items: N,
4240
4214
  initialIndex: c,
4241
- onClose: _
4215
+ onClose: v
4242
4216
  }
4243
4217
  )
4244
4218
  ]
4245
4219
  }
4246
4220
  );
4247
- }, Zr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Qr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), ei = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), ti = {
4248
- Composer: Zr,
4249
- Sent: Qr,
4250
- Received: ei
4221
+ }, Qr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), ei = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), ti = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), ni = {
4222
+ Composer: Qr,
4223
+ Sent: ei,
4224
+ Received: ti
4251
4225
  }, Nn = ({
4252
4226
  open: e,
4253
4227
  items: t,
4254
4228
  initialIndex: s = 0,
4255
4229
  onClose: a
4256
4230
  }) => {
4257
- const { index: r, prev: i, next: o } = it({
4231
+ const { index: r, prev: i, next: o } = rt({
4258
4232
  length: t.length,
4259
4233
  initialIndex: s,
4260
4234
  open: e
4261
- }), l = t[r], d = se(
4262
- () => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "video"),
4235
+ }), l = t[r], d = ee(
4236
+ () => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "video"),
4263
4237
  [l]
4264
4238
  );
4265
4239
  return l ? /* @__PURE__ */ h(
4266
- ot,
4240
+ it,
4267
4241
  {
4268
4242
  open: e,
4269
4243
  onClose: a,
@@ -4287,7 +4261,7 @@ const Lr = ({
4287
4261
  `${r}:${l.src}`
4288
4262
  ),
4289
4263
  t.length > 1 ? /* @__PURE__ */ n(
4290
- rt,
4264
+ at,
4291
4265
  {
4292
4266
  onPrev: i,
4293
4267
  onNext: o,
@@ -4298,7 +4272,7 @@ const Lr = ({
4298
4272
  ]
4299
4273
  }
4300
4274
  ) : null;
4301
- }, ni = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), _n = ({
4275
+ }, si = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(Be, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), _n = ({
4302
4276
  item: e,
4303
4277
  index: t
4304
4278
  }) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -4313,18 +4287,18 @@ const Lr = ({
4313
4287
  className: "absolute inset-0 size-full rounded-md object-cover"
4314
4288
  }
4315
4289
  ) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
4316
- Ht,
4290
+ Gt,
4317
4291
  {
4318
4292
  className: "size-16 rounded-md text-white/30",
4319
4293
  weight: "regular",
4320
4294
  "aria-hidden": !0
4321
4295
  }
4322
4296
  ) }),
4323
- /* @__PURE__ */ n(ni, {})
4324
- ] }), si = (e, t, s) => ({
4297
+ /* @__PURE__ */ n(si, {})
4298
+ ] }), ai = (e, t, s) => ({
4325
4299
  ariaLabel: `Play video ${t + 1} of ${s}`,
4326
4300
  content: /* @__PURE__ */ n(_n, { item: e, index: t })
4327
- }), ai = ({
4301
+ }), ri = ({
4328
4302
  src: e,
4329
4303
  poster: t,
4330
4304
  mimeType: s,
@@ -4336,8 +4310,8 @@ const Lr = ({
4336
4310
  mimeType: s.mimeType,
4337
4311
  preload: s.preload,
4338
4312
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
4339
- })), ri = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
4340
- const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = _e(
4313
+ })), ii = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
4314
+ const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: b } = Ne(
4341
4315
  i
4342
4316
  );
4343
4317
  return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
@@ -4351,7 +4325,7 @@ const Lr = ({
4351
4325
  children: /* @__PURE__ */ n(_n, { item: { src: e, poster: t, mimeType: s }, index: 0 })
4352
4326
  }
4353
4327
  ),
4354
- o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(we, { onClick: o }) }) : null,
4328
+ o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: o }) }) : null,
4355
4329
  /* @__PURE__ */ n(
4356
4330
  Nn,
4357
4331
  {
@@ -4361,7 +4335,7 @@ const Lr = ({
4361
4335
  a
4362
4336
  ),
4363
4337
  initialIndex: d,
4364
- onClose: g
4338
+ onClose: b
4365
4339
  }
4366
4340
  )
4367
4341
  ] });
@@ -4377,16 +4351,16 @@ const Lr = ({
4377
4351
  preload: d,
4378
4352
  onClick: m
4379
4353
  }) => {
4380
- const g = ai({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = _e(
4354
+ const b = ri({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: v } = Ne(
4381
4355
  m
4382
4356
  );
4383
- if (g.length === 0)
4357
+ if (b.length === 0)
4384
4358
  return null;
4385
- const v = g.map(
4386
- (w, y) => si(w, y, g.length)
4359
+ const p = b.map(
4360
+ (N, x) => ai(N, x, b.length)
4387
4361
  );
4388
4362
  return /* @__PURE__ */ h(
4389
- xe,
4363
+ ve,
4390
4364
  {
4391
4365
  variant: u,
4392
4366
  text: o,
@@ -4396,8 +4370,8 @@ const Lr = ({
4396
4370
  /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
4397
4371
  vn,
4398
4372
  {
4399
- tiles: v,
4400
- onTileActivate: b,
4373
+ tiles: p,
4374
+ onTileActivate: g,
4401
4375
  className: "overflow-hidden rounded-md"
4402
4376
  }
4403
4377
  ) }),
@@ -4405,25 +4379,25 @@ const Lr = ({
4405
4379
  Nn,
4406
4380
  {
4407
4381
  open: f,
4408
- items: yn(g, r),
4382
+ items: yn(b, r),
4409
4383
  initialIndex: c,
4410
- onClose: _
4384
+ onClose: v
4411
4385
  }
4412
4386
  )
4413
4387
  ]
4414
4388
  }
4415
4389
  );
4416
- }, ii = (e) => /* @__PURE__ */ n(ri, { ...e }), oi = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "sent" }), li = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "received" }), ci = {
4417
- Composer: ii,
4418
- Sent: oi,
4419
- Received: li
4420
- }, ki = {
4421
- Image: qr,
4422
- Video: ci,
4423
- Audio: Er,
4424
- Pdf: ti,
4425
- File: $r
4426
- }, di = ({
4390
+ }, oi = (e) => /* @__PURE__ */ n(ii, { ...e }), li = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "sent" }), ci = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "received" }), di = {
4391
+ Composer: oi,
4392
+ Sent: li,
4393
+ Received: ci
4394
+ }, Ei = {
4395
+ Image: Wr,
4396
+ Video: di,
4397
+ Audio: Sr,
4398
+ Pdf: ni,
4399
+ File: Br
4400
+ }, ui = ({
4427
4401
  question: e,
4428
4402
  onClick: t,
4429
4403
  loading: s = !1,
@@ -4445,7 +4419,7 @@ const Lr = ({
4445
4419
  ),
4446
4420
  children: e
4447
4421
  }
4448
- ), Ei = ({
4422
+ ), Si = ({
4449
4423
  faqs: e,
4450
4424
  onFaqClick: t,
4451
4425
  loadingFaqId: s,
@@ -4457,7 +4431,7 @@ const Lr = ({
4457
4431
  const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
4458
4432
  return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
4459
4433
  (i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
4460
- re,
4434
+ ae,
4461
4435
  {
4462
4436
  id: o || "account",
4463
4437
  name: o || "Account",
@@ -4474,7 +4448,7 @@ const Lr = ({
4474
4448
  children: [
4475
4449
  a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
4476
4450
  l.map((d) => /* @__PURE__ */ n(
4477
- di,
4451
+ ui,
4478
4452
  {
4479
4453
  question: d.question,
4480
4454
  onClick: () => t(d.id),
@@ -4489,37 +4463,37 @@ const Lr = ({
4489
4463
  };
4490
4464
  export {
4491
4465
  Qt as A,
4492
- Us as B,
4493
- Ya as C,
4466
+ Vs as B,
4467
+ qa as C,
4494
4468
  Ds as D,
4495
- Ei as F,
4496
- yi as L,
4497
- wi as M,
4498
- Ce as a,
4499
- re as b,
4500
- nr as c,
4469
+ Si as F,
4470
+ Ci as L,
4471
+ Ni as M,
4472
+ he as a,
4473
+ ae as b,
4474
+ sr as c,
4501
4475
  dn as d,
4502
- Ni as e,
4503
- di as f,
4504
- ie as g,
4505
- zt as h,
4506
- ki as i,
4507
- Na as j,
4508
- xi as k,
4509
- _i as l,
4510
- Ar as m,
4476
+ _i as e,
4477
+ ui as f,
4478
+ ne as g,
4479
+ Ot as h,
4480
+ Ei as i,
4481
+ _a as j,
4482
+ wi as k,
4483
+ yi as l,
4484
+ Mr as m,
4511
4485
  Ir as n,
4512
- er as o,
4513
- Tr as p,
4486
+ tr as o,
4487
+ Ar as p,
4514
4488
  Xt as q,
4515
- ce as r,
4489
+ le as r,
4516
4490
  nn as s,
4517
- Ls as t,
4518
- Ci as u,
4519
- Vs as v,
4520
- Ze as w,
4521
- Qe as x,
4522
- Ae as y,
4523
- ga as z
4491
+ Os as t,
4492
+ ki as u,
4493
+ Gs as v,
4494
+ Je as w,
4495
+ Ze as x,
4496
+ Wt as y,
4497
+ ba as z
4524
4498
  };
4525
- //# sourceMappingURL=index-DJKFVBkP.js.map
4499
+ //# sourceMappingURL=index-C_NFzAB9.js.map