@linktr.ee/messaging-react 1.38.0-rc-1777583423 → 1.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as d, Fragment as fe } from "react/jsx-runtime";
2
- import A from "classnames";
3
- import j, { createContext as mt, useContext as ht, useCallback as U, useState as M, useRef as Q, useEffect as K, useMemo as ze, Suspense as ft } from "react";
4
- import { StreamChatService as Ot } from "@linktr.ee/messaging-core";
5
- import { Chat as Ut, ChannelList as $t, DateSeparator as zt, useChannelStateContext as ue, useChatContext as He, areMessageUIPropsEqual as jt, useMessageReminder as Bt, useComponentContext as gt, Attachment as Gt, EditMessageModal as Vt, MessageBlocked as Ht, MessageBouncePrompt as Yt, MessageDeleted as Wt, MessageIsThreadReplyInChannelButtonIndicator as qt, MessageRepliesCountButton as Xt, ReminderNotification as Zt, StreamedMessageText as Kt, messageHasAttachments as Jt, messageHasReactions as Qt, isDateSeparatorMessage as es, isMessageBlocked as ts, isMessageBounced as ss, MessageBounceModal as ns, MessageText as Qe, Poll as as, MessageErrorIcon as rs, useMessageContext as bt, useMessageComposer as is, useStateStore as os, MessageInput as ls, useMessageInputContext as cs, useMessageComposerHasSendableData as ds, SimpleAttachmentSelector as us, QuotedMessagePreview as ms, AttachmentPreviewList as hs, TextareaComposer as fs, MessageTimestamp as Fe, useTypingContext as gs, Channel as bs, WithComponents as xs, Window as ps, MessageList as vs } from "stream-chat-react";
6
- import { StarIcon as je, GiftIcon as ws, XIcon as Ye, SpinnerGapIcon as Se, SignOutIcon as ys, ProhibitInsetIcon as et, FlagIcon as Ns, ArrowUpIcon as Cs, SparkleIcon as Be, ProhibitIcon as _s, ArrowLeftIcon as tt, CaretRightIcon as st, DotsThreeIcon as nt, MagnifyingGlassIcon as Es, ChatCircleDotsIcon as at, FileIcon as xt, ImageIcon as ks, SpeakerHighIcon as Ss, VideoCameraIcon as Is, FileMdIcon as Ms, FileTextIcon as Ts, FileZipIcon as Ds, FilePptIcon as Rs, FileCsvIcon as Ls, FileXlsIcon as Ps, FileDocIcon as As, FilePdfIcon as Fs, CircleNotchIcon as pt, PlayIcon as rt, PauseIcon as Os, LinkIcon as Us, DownloadSimpleIcon as $s } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as it } from "stream-chat";
8
- const vt = mt({
1
+ import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
2
+ import L from "classnames";
3
+ import O, { createContext as ot, useContext as lt, useCallback as G, useState as A, useRef as J, useEffect as Z, useMemo as Ce, Suspense as ct } from "react";
4
+ import { StreamChatService as Tt } from "@linktr.ee/messaging-core";
5
+ import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as oe, useChatContext as Me, areMessageUIPropsEqual as At, useMessageReminder as Ft, useComponentContext as dt, Attachment as Ot, EditMessageModal as Pt, MessageBlocked as Ut, MessageBouncePrompt as Bt, MessageDeleted as zt, MessageIsThreadReplyInChannelButtonIndicator as $t, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as Wt, isMessageBlocked as qt, isMessageBounced as Xt, MessageBounceModal as Zt, MessageText as Xe, Poll as Jt, MessageErrorIcon as Kt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as is, TextareaComposer as os, MessageTimestamp as ve, useTypingContext as ls, Channel as cs, WithComponents as ds, Window as us, MessageList as ms } from "stream-chat-react";
6
+ import { StarIcon as Ee, GiftIcon as hs, XIcon as mt, SpinnerGapIcon as we, SignOutIcon as fs, ProhibitInsetIcon as Ze, FlagIcon as gs, ArrowUpIcon as bs, SparkleIcon as Se, ProhibitIcon as ps, ArrowLeftIcon as Je, CaretRightIcon as Ke, DotsThreeIcon as Qe, FileIcon as ht, ImageIcon as xs, SpeakerHighIcon as vs, VideoCameraIcon as ws, FileMdIcon as Ns, FileTextIcon as _s, FileZipIcon as ys, FilePptIcon as Cs, FileCsvIcon as Es, FileXlsIcon as Ss, FileDocIcon as Is, FilePdfIcon as ks, CircleNotchIcon as ft, PlayIcon as et, PauseIcon as Ms, LinkIcon as Ts, DownloadSimpleIcon as Ds } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as tt } from "stream-chat";
8
+ const gt = ot({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const vt = mt({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), De = () => ht(vt), ha = ({
18
+ }), Te = () => lt(gt), ra = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -23,9 +23,9 @@ const vt = mt({
23
23
  capabilities: o = {},
24
24
  debug: l = !1
25
25
  }) => {
26
- const i = U(
27
- (b, ...k) => {
28
- l && console.log(`🔥 [MessagingProvider] ${b}`, ...k);
26
+ const i = G(
27
+ (k, ...T) => {
28
+ l && console.log(`🔥 [MessagingProvider] ${k}`, ...T);
29
29
  },
30
30
  [l]
31
31
  );
@@ -35,84 +35,84 @@ const vt = mt({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(o)
37
37
  });
38
- const [c, h] = M(null), [u, m] = M(null), [f, v] = M(!1), [a, C] = M(!1), [g, y] = M(null), p = Q(!1), S = Q({
38
+ const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, y] = A(!1), [b, C] = A(null), x = J(!1), I = J({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: o
43
- }), w = Q(0);
43
+ }), w = J(0);
44
44
  w.current++, i("📊 RENDER INFO", {
45
45
  renderCount: w.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: S.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: S.current.apiKey !== r,
50
- serviceConfigChanged: S.current.serviceConfig !== n,
51
- capabilitiesChanged: S.current.capabilities !== o
48
+ userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: I.current.apiKey !== r,
50
+ serviceConfigChanged: I.current.serviceConfig !== n,
51
+ capabilitiesChanged: I.current.capabilities !== o
52
52
  }
53
- }), S.current = {
53
+ }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
57
  capabilities: o
58
- }, K(() => {
59
- const b = w.current;
58
+ }, Z(() => {
59
+ const k = w.current;
60
60
  if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: b,
61
+ renderCount: k,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: S.current.serviceConfig === n,
68
- apiKeyStable: S.current.apiKey === r
67
+ serviceConfigStable: I.current.serviceConfig === n,
68
+ apiKeyStable: I.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
71
  i("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: b,
72
+ renderCount: k,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  i("🚀 CREATING NEW SERVICE", {
78
- renderCount: b,
78
+ renderCount: k,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
- serviceConfigChanged: S.current.serviceConfig !== n
80
+ serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const k = new Ot({
82
+ const T = new Tt({
83
83
  ...n,
84
84
  apiKey: r,
85
85
  debug: l
86
86
  });
87
- return h(k), i("✅ SERVICE SET", {
88
- renderCount: b,
89
- serviceInstance: !!k
87
+ return m(T), i("✅ SERVICE SET", {
88
+ renderCount: k,
89
+ serviceInstance: !!T
90
90
  }), () => {
91
91
  i("🧹 SERVICE CLEANUP", {
92
- renderCount: b,
92
+ renderCount: k,
93
93
  reason: "Effect cleanup"
94
- }), k.disconnectUser().catch(console.error);
94
+ }), T.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [r, n, l, i]);
97
- const E = Q(null);
98
- K(() => {
99
- var k, R;
97
+ const E = J(null);
98
+ Z(() => {
99
+ var T, M;
100
100
  if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: p.current,
104
+ isConnecting: x.current,
105
105
  isConnected: f,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
108
  i("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (p.current) {
111
+ if (x.current) {
112
112
  i("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((k = E.current) == null ? void 0 : k.serviceId) === c && ((R = E.current) == null ? void 0 : R.userId) === s.id) {
115
+ if (((T = E.current) == null ? void 0 : T.serviceId) === c && ((M = E.current) == null ? void 0 : M.userId) === s.id) {
116
116
  i(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,28 +120,28 @@ const vt = mt({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- i("🚀 STARTING USER CONNECTION", { userId: s.id }), p.current = !0, C(!0), y(null);
123
+ i("🚀 STARTING USER CONNECTION", { userId: s.id }), x.current = !0, y(!0), C(null);
124
124
  try {
125
125
  i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const I = await c.connectUser(s);
127
- m(I), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
126
+ const _ = await c.connectUser(s);
127
+ h(_), v(!0), E.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: I.userID
129
+ clientId: _.userID
130
130
  });
131
- } catch (I) {
132
- const L = I instanceof Error ? I.message : "Connection failed";
133
- y(L), i("❌ USER CONNECTION ERROR", {
131
+ } catch (_) {
132
+ const N = _ instanceof Error ? _.message : "Connection failed";
133
+ C(N), i("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: L
135
+ error: N
136
136
  });
137
137
  } finally {
138
- C(!1), p.current = !1, i("🔄 USER CONNECTION FINISHED", {
138
+ y(!1), x.current = !1, i("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, i, f]), K(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, i, f]), Z(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
146
  isConnected: f
147
147
  }), () => {
@@ -153,7 +153,7 @@ const vt = mt({
153
153
  isConnected: f
154
154
  });
155
155
  }), [c, f, i]);
156
- const F = U(async () => {
156
+ const P = G(async () => {
157
157
  if (i("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
@@ -161,53 +161,53 @@ const vt = mt({
161
161
  i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), C(!0);
164
+ i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
165
165
  try {
166
166
  i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
167
- const b = await c.connectUser(s);
168
- m(b), v(!0), y(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (b) {
170
- const k = b instanceof Error ? b.message : "Refresh failed";
171
- y(k), i("❌ CONNECTION REFRESH ERROR", {
167
+ const k = await c.connectUser(s);
168
+ h(k), v(!0), C(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (k) {
170
+ const T = k instanceof Error ? k.message : "Refresh failed";
171
+ C(T), i("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: k
173
+ error: T
174
174
  });
175
175
  } finally {
176
- C(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ y(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, i]), N = j.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, i]), U = O.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
180
  hasClient: !!u,
181
181
  isConnected: f,
182
182
  isLoading: a,
183
- hasError: !!g,
183
+ hasError: !!b,
184
184
  capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
186
  service: c,
187
187
  client: u,
188
188
  isConnected: f,
189
189
  isLoading: a,
190
- error: g,
190
+ error: b,
191
191
  capabilities: o,
192
- refreshConnection: F,
192
+ refreshConnection: P,
193
193
  debug: l
194
194
  }), [
195
195
  c,
196
196
  u,
197
197
  f,
198
198
  a,
199
- g,
199
+ b,
200
200
  o,
201
- F,
201
+ P,
202
202
  l,
203
203
  i
204
204
  ]);
205
205
  return i("🔄 RENDER END", {
206
206
  renderCount: w.current,
207
207
  willRenderChat: !!(u && f),
208
- contextValueReady: !!N
209
- }), /* @__PURE__ */ e(vt.Provider, { value: N, children: u && f ? /* @__PURE__ */ e(
210
- Ut,
208
+ contextValueReady: !!U
209
+ }), /* @__PURE__ */ e(gt.Provider, { value: U, children: u && f ? /* @__PURE__ */ e(
210
+ Dt,
211
211
  {
212
212
  client: u,
213
213
  customClasses: {
@@ -216,25 +216,25 @@ const vt = mt({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, zs = () => De();
220
- function js(t) {
219
+ }, Rs = () => Te();
220
+ function Ls(t) {
221
221
  const s = t.state.pending_messages;
222
222
  if (s != null && s.length)
223
223
  for (const n of s)
224
224
  t.state.addMessageSorted(n.message);
225
225
  }
226
- const wt = j.createContext({
226
+ const bt = O.createContext({
227
227
  selectedChannel: void 0,
228
228
  onChannelSelect: () => {
229
229
  },
230
230
  debug: !1,
231
231
  renderMessagePreview: void 0
232
- }), Bs = wt.Provider, Gs = () => j.useContext(wt), yt = (t) => {
232
+ }), As = bt.Provider, Fs = () => O.useContext(bt), pt = (t) => {
233
233
  var r, o;
234
- const [s, n] = M(
234
+ const [s, n] = A(
235
235
  !!((o = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && o.pinned_at)
236
236
  );
237
- return K(() => {
237
+ return Z(() => {
238
238
  var i;
239
239
  if (!t) {
240
240
  n(!1);
@@ -242,27 +242,27 @@ const wt = j.createContext({
242
242
  }
243
243
  n(!!((i = t.state.membership) != null && i.pinned_at));
244
244
  const l = (c) => {
245
- var h;
245
+ var m;
246
246
  n(
247
- c != null && c.member ? !!c.member.pinned_at : !!((h = t.state.membership) != null && h.pinned_at)
247
+ c != null && c.member ? !!c.member.pinned_at : !!((m = t.state.membership) != null && m.pinned_at)
248
248
  );
249
249
  };
250
250
  return t.on("member.updated", l), () => {
251
251
  t.off("member.updated", l);
252
252
  };
253
253
  }, [t]), s;
254
- }, Vs = (t, s) => {
254
+ }, Os = (t, s) => {
255
255
  const n = new Date(
256
256
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
257
257
  ), o = new Date(
258
258
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
259
259
  ).getTime() - n.getTime();
260
260
  return Math.floor(o / (1e3 * 60 * 60 * 24));
261
- }, Hs = (t) => {
261
+ }, Ps = (t) => {
262
262
  const s = /* @__PURE__ */ new Date();
263
263
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
264
264
  return "Just now";
265
- const r = Vs(t, s);
265
+ const r = Os(t, s);
266
266
  return r === 0 ? t.toLocaleTimeString([], {
267
267
  hour: "numeric",
268
268
  minute: "2-digit",
@@ -272,7 +272,7 @@ const wt = j.createContext({
272
272
  day: "numeric",
273
273
  year: "2-digit"
274
274
  });
275
- }, ot = [
275
+ }, st = [
276
276
  "🍎",
277
277
  // Apple
278
278
  "🍌",
@@ -300,7 +300,7 @@ const wt = j.createContext({
300
300
  "🍈"
301
301
  // Melon
302
302
  ];
303
- function Ys(t) {
303
+ function Us(t) {
304
304
  let s = 0;
305
305
  for (let n = 0; n < t.length; n++) {
306
306
  const r = t.charCodeAt(n);
@@ -308,9 +308,9 @@ function Ys(t) {
308
308
  }
309
309
  return Math.abs(s);
310
310
  }
311
- function Ws(t) {
312
- const n = Ys(t) % ot.length;
313
- return ot[n];
311
+ function Bs(t) {
312
+ const n = Us(t) % st.length;
313
+ return st[n];
314
314
  }
315
315
  const ne = ({
316
316
  id: t,
@@ -321,7 +321,7 @@ const ne = ({
321
321
  shape: l = "squircle",
322
322
  dmAgentEnabled: i = !1
323
323
  }) => {
324
- const c = Ws(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", m = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
324
+ const c = Bs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
325
325
  borderRadius: "33%",
326
326
  cornerShape: "superellipse(1.3)"
327
327
  }, v = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
@@ -335,7 +335,7 @@ const ne = ({
335
335
  "div",
336
336
  {
337
337
  "aria-hidden": "true",
338
- className: A(
338
+ className: L(
339
339
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
340
340
  u
341
341
  ),
@@ -345,7 +345,7 @@ const ne = ({
345
345
  return /* @__PURE__ */ d(
346
346
  "div",
347
347
  {
348
- className: A(
348
+ className: L(
349
349
  "relative flex-shrink-0 !bg-transparent",
350
350
  r
351
351
  ),
@@ -359,21 +359,21 @@ const ne = ({
359
359
  {
360
360
  "aria-hidden": "true",
361
361
  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)]",
362
- children: /* @__PURE__ */ e(je, { className: "size-3 text-yellow-600", weight: "duotone" })
362
+ children: /* @__PURE__ */ e(Ee, { className: "size-3 text-yellow-600", weight: "duotone" })
363
363
  }
364
364
  ),
365
365
  /* @__PURE__ */ e(
366
366
  "div",
367
367
  {
368
368
  "data-testid": "avatar-ring",
369
- className: A(
369
+ className: L(
370
370
  "h-full w-full",
371
371
  "bg-transparent"
372
372
  ),
373
373
  style: {
374
374
  ...f,
375
375
  ...i && {
376
- borderWidth: `${m}px`,
376
+ borderWidth: `${h}px`,
377
377
  borderStyle: "solid",
378
378
  borderColor: "var(--AI-Gradient, #7F22FE)",
379
379
  boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
@@ -385,7 +385,7 @@ const ne = ({
385
385
  ]
386
386
  }
387
387
  );
388
- }, qs = ({ size: t = 15 }) => /* @__PURE__ */ e(
388
+ }, zs = ({ size: t = 15 }) => /* @__PURE__ */ e(
389
389
  "svg",
390
390
  {
391
391
  width: t,
@@ -402,93 +402,93 @@ const ne = ({
402
402
  }
403
403
  )
404
404
  }
405
- ), Xs = (t) => {
405
+ ), $s = (t) => {
406
406
  var s;
407
407
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
408
- }, Zs = (t) => {
408
+ }, js = (t) => {
409
409
  var s;
410
410
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
411
- }, We = (t) => {
411
+ }, De = (t) => {
412
412
  var s;
413
413
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
414
- }, Ks = (t) => {
414
+ }, Gs = (t) => {
415
415
  var s;
416
416
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
417
- }, Nt = (t) => Xs(t) || Zs(t), Js = (t) => {
417
+ }, xt = (t) => $s(t) || js(t), Vs = (t) => {
418
418
  var s;
419
- return Nt(t) && !((s = t.text) != null && s.trim());
420
- }, Oe = ({
419
+ return xt(t) && !((s = t.text) != null && s.trim());
420
+ }, Ne = ({
421
421
  message: t,
422
422
  standalone: s = !1,
423
423
  isMyMessage: n = !1,
424
424
  hasAttachment: r = !1
425
425
  }) => {
426
426
  var f;
427
- const o = Nt(t), l = We(t);
427
+ const o = xt(t), l = De(t);
428
428
  if (!o && !l)
429
429
  return null;
430
430
  if (o) {
431
431
  const v = (f = t.metadata) == null ? void 0 : f.amount_text;
432
432
  if (!v) return null;
433
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", C = s ? `${v} tip` : `Delivered with ${v} tip`;
433
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${v} tip` : `Delivered with ${v} tip`;
434
434
  return /* @__PURE__ */ d("div", { className: a, children: [
435
- /* @__PURE__ */ e(ws, { size: s ? 14 : 12 }),
436
- /* @__PURE__ */ e("span", { children: C })
435
+ /* @__PURE__ */ e(hs, { size: s ? 14 : 12 }),
436
+ /* @__PURE__ */ e("span", { children: y })
437
437
  ] });
438
438
  }
439
- const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", h = [
439
+ const i = n && r, c = i ? "Sent with AI" : "Sent with DM Agent", m = [
440
440
  "message-chatbot-indicator",
441
441
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
442
442
  i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
443
- ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), m = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(qs, { size: i ? 12 : 15 }) });
444
- return /* @__PURE__ */ e("div", { className: h, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(fe, { children: [
443
+ ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(zs, { size: i ? 12 : 15 }) });
444
+ return /* @__PURE__ */ e("div", { className: m, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(ce, { children: [
445
445
  u,
446
- m
447
- ] }) : /* @__PURE__ */ d(fe, { children: [
448
- m,
446
+ h
447
+ ] }) : /* @__PURE__ */ d(ce, { children: [
448
+ h,
449
449
  u
450
450
  ] }) });
451
- }, Ct = j.memo(
451
+ }, vt = O.memo(
452
452
  ({ channel: t, unread: s }) => {
453
- var F, N, b, k;
454
- const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Gs(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
453
+ var P, U, k, T;
454
+ const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = Fs(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
455
455
  t && r(t);
456
- }, h = (R) => {
457
- const I = R.key === "Enter" || R.key === " ", L = R.repeat;
458
- !I || L || (R.preventDefault(), c());
459
- }, m = Object.values(((F = t == null ? void 0 : t.state) == null ? void 0 : F.members) || {}).find(
460
- (R) => {
461
- var I, L;
462
- return ((I = R.user) == null ? void 0 : I.id) && R.user.id !== ((L = t == null ? void 0 : t._client) == null ? void 0 : L.userID);
456
+ }, m = (M) => {
457
+ const _ = M.key === "Enter" || M.key === " ", N = M.repeat;
458
+ !_ || N || (M.preventDefault(), c());
459
+ }, h = Object.values(((P = t == null ? void 0 : t.state) == null ? void 0 : P.members) || {}).find(
460
+ (M) => {
461
+ var _, N;
462
+ return ((_ = M.user) == null ? void 0 : _.id) && M.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
463
463
  }
464
- ), f = ((N = m == null ? void 0 : m.user) == null ? void 0 : N.name) || "Conversation", v = (b = m == null ? void 0 : m.user) == null ? void 0 : b.image, a = (() => {
465
- var I;
466
- const R = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
467
- if (R != null && R.length) {
468
- for (let L = R.length - 1; L >= 0; L--)
469
- if (R[L].type !== "system") return R[L];
464
+ ), f = ((U = h == null ? void 0 : h.user) == null ? void 0 : U.name) || "Conversation", v = (k = h == null ? void 0 : h.user) == null ? void 0 : k.image, a = (() => {
465
+ var _;
466
+ const M = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages;
467
+ if (M != null && M.length) {
468
+ for (let N = M.length - 1; N >= 0; N--)
469
+ if (M[N].type !== "system") return M[N];
470
470
  }
471
- })(), g = (() => {
472
- var L, T;
471
+ })(), b = (() => {
472
+ var N, F;
473
473
  if (a != null && a.text) return a.text;
474
- if (((L = a == null ? void 0 : a.metadata) == null ? void 0 : L.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
475
- const I = (T = a == null ? void 0 : a.attachments) == null ? void 0 : T[0];
476
- return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
477
- })(), y = a != null && a.created_at ? Hs(new Date(a.created_at)) : "", p = a ? We(a) : !1, S = l ? l(a, g) : `${p ? "✨ " : ""}${g}`, w = yt(t), E = s ?? 0;
474
+ if (((N = a == null ? void 0 : a.metadata) == null ? void 0 : N.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
475
+ const _ = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
476
+ return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
477
+ })(), C = a != null && a.created_at ? Ps(new Date(a.created_at)) : "", x = a ? De(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = pt(t), E = s ?? 0;
478
478
  return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
479
479
  channelId: t == null ? void 0 : t.id,
480
480
  isSelected: i,
481
481
  participantName: f,
482
482
  unreadCount: E,
483
- hasTimestamp: !!y
483
+ hasTimestamp: !!C
484
484
  }), /* @__PURE__ */ e(
485
485
  "div",
486
486
  {
487
487
  role: "button",
488
488
  tabIndex: 0,
489
489
  onClick: c,
490
- onKeyDown: h,
491
- className: A(
490
+ onKeyDown: m,
491
+ className: L(
492
492
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
493
493
  {
494
494
  "bg-primary-alt/10 border-l-4 border-l-primary": i,
@@ -499,7 +499,7 @@ const ne = ({
499
499
  /* @__PURE__ */ e(
500
500
  ne,
501
501
  {
502
- id: ((k = m == null ? void 0 : m.user) == null ? void 0 : k.id) || t.id || "unknown",
502
+ id: ((T = h == null ? void 0 : h.user) == null ? void 0 : T.id) || t.id || "unknown",
503
503
  name: f,
504
504
  image: v,
505
505
  size: 44,
@@ -512,7 +512,7 @@ const ne = ({
512
512
  /* @__PURE__ */ d(
513
513
  "h3",
514
514
  {
515
- className: A(
515
+ className: L(
516
516
  "text-sm font-medium truncate",
517
517
  i ? "text-primary" : "text-charcoal"
518
518
  ),
@@ -522,10 +522,10 @@ const ne = ({
522
522
  ]
523
523
  }
524
524
  ),
525
- y && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: y })
525
+ C && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: C })
526
526
  ] }),
527
527
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
528
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
528
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
529
529
  E > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: E > 99 ? "99+" : E })
530
530
  ] })
531
531
  ] })
@@ -534,8 +534,8 @@ const ne = ({
534
534
  );
535
535
  }
536
536
  );
537
- Ct.displayName = "CustomChannelPreview";
538
- const Qs = { last_message_at: -1 }, _t = j.memo(
537
+ vt.displayName = "CustomChannelPreview";
538
+ const Hs = { last_message_at: -1 }, wt = O.memo(
539
539
  ({
540
540
  onChannelSelect: t,
541
541
  selectedChannel: s,
@@ -544,18 +544,18 @@ const Qs = { last_message_at: -1 }, _t = j.memo(
544
544
  onMessageNew: o,
545
545
  onAddedToChannel: l,
546
546
  channelRenderFilterFn: i,
547
- sort: c = Qs,
548
- className: h,
547
+ sort: c = Hs,
548
+ className: m,
549
549
  customEmptyStateIndicator: u,
550
- renderMessagePreview: m
550
+ renderMessagePreview: h
551
551
  }) => {
552
- const f = j.useRef(0);
552
+ const f = O.useRef(0);
553
553
  f.current++;
554
- const { debug: v = !1 } = De(), a = j.useCallback(
555
- (g) => {
556
- for (const y of g)
557
- js(y);
558
- return i ? i(g) : g;
554
+ const { debug: v = !1 } = Te(), a = O.useCallback(
555
+ (b) => {
556
+ for (const C of b)
557
+ Ls(C);
558
+ return i ? i(b) : b;
559
559
  },
560
560
  [i]
561
561
  );
@@ -564,24 +564,24 @@ const Qs = { last_message_at: -1 }, _t = j.memo(
564
564
  selectedChannelId: s == null ? void 0 : s.id,
565
565
  filters: n
566
566
  });
567
- const C = j.useMemo(
567
+ const y = O.useMemo(
568
568
  () => ({
569
569
  selectedChannel: s,
570
570
  onChannelSelect: t,
571
571
  debug: v,
572
- renderMessagePreview: m
572
+ renderMessagePreview: h
573
573
  }),
574
- [s, t, v, m]
574
+ [s, t, v, h]
575
575
  );
576
576
  return /* @__PURE__ */ e(
577
577
  "div",
578
578
  {
579
- className: A(
579
+ className: L(
580
580
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
581
- h
581
+ m
582
582
  ),
583
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Bs, { value: C, children: /* @__PURE__ */ e(
584
- $t,
583
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(As, { value: y, children: /* @__PURE__ */ e(
584
+ Rt,
585
585
  {
586
586
  filters: n,
587
587
  sort: c,
@@ -590,7 +590,7 @@ const Qs = { last_message_at: -1 }, _t = j.memo(
590
590
  onMessageNew: o,
591
591
  onAddedToChannel: l,
592
592
  channelRenderFilterFn: a,
593
- Preview: Ct,
593
+ Preview: vt,
594
594
  EmptyStateIndicator: u
595
595
  },
596
596
  `${JSON.stringify(n)}:${JSON.stringify(c)}`
@@ -599,8 +599,8 @@ const Qs = { last_message_at: -1 }, _t = j.memo(
599
599
  );
600
600
  }
601
601
  );
602
- _t.displayName = "ChannelList";
603
- const ke = ({
602
+ wt.displayName = "ChannelList";
603
+ const me = ({
604
604
  variant: t = "default",
605
605
  className: s,
606
606
  children: n,
@@ -609,7 +609,7 @@ const ke = ({
609
609
  "button",
610
610
  {
611
611
  type: "button",
612
- className: A(
612
+ className: L(
613
613
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
614
614
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
615
615
  s
@@ -618,12 +618,12 @@ const ke = ({
618
618
  children: n
619
619
  }
620
620
  );
621
- function Et({ label: t, className: s, children: n, ...r }) {
621
+ function Ys({ label: t, className: s, children: n, ...r }) {
622
622
  return /* @__PURE__ */ d(
623
623
  "button",
624
624
  {
625
625
  type: "button",
626
- className: A(
626
+ className: L(
627
627
  "inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
628
628
  {
629
629
  "cursor-not-allowed opacity-50": r.disabled,
@@ -639,10 +639,10 @@ function Et({ label: t, className: s, children: n, ...r }) {
639
639
  }
640
640
  );
641
641
  }
642
- function kt({ onClick: t }) {
643
- return /* @__PURE__ */ e(Et, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Ye, { className: "h-5 w-5 text-stone", weight: "bold" }) });
642
+ function Ws({ onClick: t }) {
643
+ return /* @__PURE__ */ e(Ys, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
644
644
  }
645
- const en = ({
645
+ const qs = ({
646
646
  dialogRef: t,
647
647
  onClose: s,
648
648
  participant: n,
@@ -651,80 +651,80 @@ const en = ({
651
651
  onLeaveConversation: l,
652
652
  onBlockParticipant: i,
653
653
  showDeleteConversation: c = !0,
654
- onDeleteConversationClick: h,
654
+ onDeleteConversationClick: m,
655
655
  onBlockParticipantClick: u,
656
- onReportParticipantClick: m,
656
+ onReportParticipantClick: h,
657
657
  customProfileContent: f,
658
658
  customChannelActions: v
659
659
  }) => {
660
- var $, P, W, Z, ae, J, x;
661
- const { service: a, debug: C } = De(), [g, y] = M(!1), [p, S] = M(!1), [w, E] = M(!1), F = U(async () => {
662
- var _;
663
- if (!(!a || !((_ = n == null ? void 0 : n.user) != null && _.id)))
660
+ var S, $, V, ee, te, W, g;
661
+ const { service: a, debug: y } = Te(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
662
+ var p;
663
+ if (!(!a || !((p = n == null ? void 0 : n.user) != null && p.id)))
664
664
  try {
665
- const H = (await a.getBlockedUsers()).some(
666
- (ee) => {
667
- var ie;
668
- return ee.blocked_user_id === ((ie = n == null ? void 0 : n.user) == null ? void 0 : ie.id);
665
+ const j = (await a.getBlockedUsers()).some(
666
+ (Y) => {
667
+ var ae;
668
+ return Y.blocked_user_id === ((ae = n == null ? void 0 : n.user) == null ? void 0 : ae.id);
669
669
  }
670
670
  );
671
- y(H);
672
- } catch (z) {
671
+ C(j);
672
+ } catch (R) {
673
673
  console.error(
674
674
  "[ChannelInfoDialog] Failed to check blocked status:",
675
- z
675
+ R
676
676
  );
677
677
  }
678
- }, [a, ($ = n == null ? void 0 : n.user) == null ? void 0 : $.id]);
679
- K(() => {
680
- F();
681
- }, [F]);
682
- const N = async () => {
683
- var _;
684
- if (!p) {
685
- h == null || h(), C && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
678
+ }, [a, (S = n == null ? void 0 : n.user) == null ? void 0 : S.id]);
679
+ Z(() => {
680
+ P();
681
+ }, [P]);
682
+ const U = async () => {
683
+ var p;
684
+ if (!x) {
685
+ m == null || m(), y && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
686
686
  try {
687
- const z = ((_ = r._client) == null ? void 0 : _.userID) ?? null;
688
- await r.hide(z, !1), l && await l(r), s();
689
- } catch (z) {
690
- console.error("[ChannelInfoDialog] Failed to leave conversation", z);
687
+ const R = ((p = r._client) == null ? void 0 : p.userID) ?? null;
688
+ await r.hide(R, !1), l && await l(r), s();
689
+ } catch (R) {
690
+ console.error("[ChannelInfoDialog] Failed to leave conversation", R);
691
691
  } finally {
692
- S(!1);
692
+ I(!1);
693
693
  }
694
694
  }
695
- }, b = async () => {
696
- var _, z, H;
695
+ }, k = async () => {
696
+ var p, R, j;
697
697
  if (!(w || !a)) {
698
- u == null || u(), C && console.log("[ChannelInfoDialog] Block member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), E(!0);
698
+ u == null || u(), y && console.log("[ChannelInfoDialog] Block member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
699
699
  try {
700
- await a.blockUser((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), i && await i((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
701
- } catch (ee) {
702
- console.error("[ChannelInfoDialog] Failed to block member", ee);
700
+ await a.blockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
701
+ } catch (Y) {
702
+ console.error("[ChannelInfoDialog] Failed to block member", Y);
703
703
  } finally {
704
704
  E(!1);
705
705
  }
706
706
  }
707
- }, k = async () => {
708
- var _, z, H;
707
+ }, T = async () => {
708
+ var p, R, j;
709
709
  if (!(w || !a)) {
710
- u == null || u(), C && console.log("[ChannelInfoDialog] Unblock member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), E(!0);
710
+ u == null || u(), y && console.log("[ChannelInfoDialog] Unblock member", (p = n == null ? void 0 : n.user) == null ? void 0 : p.id), E(!0);
711
711
  try {
712
- await a.unBlockUser((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), i && await i((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
713
- } catch (ee) {
714
- console.error("[ChannelInfoDialog] Failed to unblock member", ee);
712
+ await a.unBlockUser((R = n == null ? void 0 : n.user) == null ? void 0 : R.id), i && await i((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
713
+ } catch (Y) {
714
+ console.error("[ChannelInfoDialog] Failed to unblock member", Y);
715
715
  } finally {
716
716
  E(!1);
717
717
  }
718
718
  }
719
- }, R = () => {
720
- m == null || m(), s(), window.open(
719
+ }, M = () => {
720
+ h == null || h(), s(), window.open(
721
721
  "https://linktr.ee/s/about/trust-center/report",
722
722
  "_blank",
723
723
  "noopener,noreferrer"
724
724
  );
725
725
  };
726
726
  if (!n) return null;
727
- const I = ((P = n.user) == null ? void 0 : P.name) || ((W = n.user) == null ? void 0 : W.id) || "Unknown member", L = (Z = n.user) == null ? void 0 : Z.image, T = (ae = n.user) == null ? void 0 : ae.email, B = (J = n.user) == null ? void 0 : J.username, O = T || (B ? `linktr.ee/${B}` : void 0), G = ((x = n.user) == null ? void 0 : x.id) || "unknown";
727
+ const _ = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", N = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (W = n.user) == null ? void 0 : W.username, D = F || (H ? `linktr.ee/${H}` : void 0), B = ((g = n.user) == null ? void 0 : g.id) || "unknown";
728
728
  return (
729
729
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
730
730
  /* @__PURE__ */ e(
@@ -733,13 +733,13 @@ const en = ({
733
733
  ref: t,
734
734
  className: "mes-dialog group",
735
735
  onClose: s,
736
- onClick: (_) => {
737
- _.target === t.current && s();
736
+ onClick: (p) => {
737
+ p.target === t.current && s();
738
738
  },
739
739
  children: /* @__PURE__ */ d("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
740
740
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
741
741
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
742
- /* @__PURE__ */ e(kt, { onClick: s })
742
+ /* @__PURE__ */ e(Ws, { onClick: s })
743
743
  ] }),
744
744
  /* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
745
745
  /* @__PURE__ */ d(
@@ -752,16 +752,16 @@ const en = ({
752
752
  /* @__PURE__ */ e(
753
753
  ne,
754
754
  {
755
- id: G,
756
- name: I,
757
- image: L,
755
+ id: B,
756
+ name: _,
757
+ image: N,
758
758
  size: 88,
759
759
  shape: "circle"
760
760
  }
761
761
  ),
762
762
  /* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 flex-1", children: [
763
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: I }),
764
- O && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: O }),
763
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
764
+ D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
765
765
  o && !f && /* @__PURE__ */ e(
766
766
  "span",
767
767
  {
@@ -784,42 +784,42 @@ const en = ({
784
784
  ),
785
785
  /* @__PURE__ */ d("ul", { className: "flex flex-col gap-2 mt-2", children: [
786
786
  c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
787
- ke,
787
+ me,
788
788
  {
789
- onClick: N,
790
- disabled: p,
791
- "aria-busy": p,
789
+ onClick: U,
790
+ disabled: x,
791
+ "aria-busy": x,
792
792
  children: [
793
- p ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ys, { className: "h-5 w-5" }),
793
+ x ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(fs, { className: "h-5 w-5" }),
794
794
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
795
795
  ]
796
796
  }
797
797
  ) }),
798
- /* @__PURE__ */ e("li", { children: g ? /* @__PURE__ */ d(
799
- ke,
798
+ /* @__PURE__ */ e("li", { children: b ? /* @__PURE__ */ d(
799
+ me,
800
800
  {
801
- onClick: k,
801
+ onClick: T,
802
802
  disabled: w,
803
803
  "aria-busy": w,
804
804
  children: [
805
- w ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5" }),
805
+ w ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
806
806
  /* @__PURE__ */ e("span", { children: "Unblock" })
807
807
  ]
808
808
  }
809
809
  ) : /* @__PURE__ */ d(
810
- ke,
810
+ me,
811
811
  {
812
- onClick: b,
812
+ onClick: k,
813
813
  disabled: w,
814
814
  "aria-busy": w,
815
815
  children: [
816
- w ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5" }),
816
+ w ? /* @__PURE__ */ e(we, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
817
817
  /* @__PURE__ */ e("span", { children: "Block" })
818
818
  ]
819
819
  }
820
820
  ) }),
821
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(ke, { variant: "danger", onClick: R, children: [
822
- /* @__PURE__ */ e(Ns, { className: "h-5 w-5" }),
821
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(me, { variant: "danger", onClick: M, children: [
822
+ /* @__PURE__ */ e(gs, { className: "h-5 w-5" }),
823
823
  /* @__PURE__ */ e("span", { children: "Report" })
824
824
  ] }) }),
825
825
  v
@@ -829,30 +829,30 @@ const en = ({
829
829
  }
830
830
  )
831
831
  );
832
- }, tn = (t) => /* @__PURE__ */ e(zt, { ...t, position: "center" }), Ge = "vote_up", Ve = "vote_down";
833
- function sn(t) {
834
- return t != null && t.length ? t.some((s) => s.type === Ve) ? "down" : t.some((s) => s.type === Ge) ? "up" : null : null;
832
+ }, Xs = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ie = "vote_up", ke = "vote_down";
833
+ function Zs(t) {
834
+ return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Ie) ? "up" : null : null;
835
835
  }
836
- function nn(t) {
837
- const { channel: s } = ue(), { client: n } = He("useMessageVote"), r = ze(
838
- () => sn(t.own_reactions),
836
+ function Js(t) {
837
+ const { channel: s } = oe(), { client: n } = Me("useMessageVote"), r = Ce(
838
+ () => Zs(t.own_reactions),
839
839
  [t.own_reactions]
840
- ), o = U(async () => {
840
+ ), o = G(async () => {
841
841
  if (n != null && n.userID)
842
842
  try {
843
- r === "up" ? await s.deleteReaction(t.id, Ge) : await s.sendReaction(
843
+ r === "up" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
844
844
  t.id,
845
- { type: Ge },
845
+ { type: Ie },
846
846
  { enforce_unique: !0, skip_push: !0 }
847
847
  );
848
848
  } catch {
849
849
  }
850
- }, [s, n == null ? void 0 : n.userID, t.id, r]), l = U(async () => {
850
+ }, [s, n == null ? void 0 : n.userID, t.id, r]), l = G(async () => {
851
851
  if (n != null && n.userID)
852
852
  try {
853
- r === "down" ? await s.deleteReaction(t.id, Ve) : await s.sendReaction(
853
+ r === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
854
854
  t.id,
855
- { type: Ve },
855
+ { type: ke },
856
856
  { enforce_unique: !0, skip_push: !0 }
857
857
  );
858
858
  } catch {
@@ -860,21 +860,21 @@ function nn(t) {
860
860
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
861
861
  return { selected: r, voteUp: o, voteDown: l };
862
862
  }
863
- const an = j.lazy(() => import("./Card-DoNJA-jg.js")), rn = j.lazy(() => import("./Card-BlXnKGaR.js")), St = () => /* @__PURE__ */ e(
863
+ const Ks = O.lazy(() => import("./Card-BjTfMGsC.js")), Qs = O.lazy(() => import("./Card-D3E-WTRO.js")), Nt = () => /* @__PURE__ */ e(
864
864
  "div",
865
865
  {
866
866
  className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
867
867
  "aria-hidden": !0
868
868
  }
869
- ), on = (t) => /* @__PURE__ */ e(ft, { fallback: /* @__PURE__ */ e(St, {}), children: /* @__PURE__ */ e(an, { ...t }) }), ln = (t) => /* @__PURE__ */ e(ft, { fallback: /* @__PURE__ */ e(St, {}), children: /* @__PURE__ */ e(rn, { ...t }) }), lt = { Creator: on, Visitor: ln }, cn = {
869
+ ), en = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Ks, { ...t }) }), tn = (t) => /* @__PURE__ */ e(ct, { fallback: /* @__PURE__ */ e(Nt, {}), children: /* @__PURE__ */ e(Qs, { ...t }) }), nt = { Creator: en, Visitor: tn }, sn = {
870
870
  isUnlocking: () => !1
871
- }, dn = {
872
- LockedAttachment: cn
873
- }, It = mt({}), fa = It.Provider;
874
- function un(t) {
875
- return ht(It)[t] ?? dn[t];
871
+ }, nn = {
872
+ LockedAttachment: sn
873
+ }, _t = ot({}), ia = _t.Provider;
874
+ function an(t) {
875
+ return lt(_t)[t] ?? nn[t];
876
876
  }
877
- const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
877
+ const rn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
878
878
  "path",
879
879
  {
880
880
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -884,7 +884,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
884
884
  strokeLinejoin: "round",
885
885
  fill: t ? "currentColor" : "none"
886
886
  }
887
- ) }), hn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
887
+ ) }), on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
888
888
  "path",
889
889
  {
890
890
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -894,7 +894,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
894
894
  strokeLinejoin: "round",
895
895
  fill: t ? "currentColor" : "none"
896
896
  }
897
- ) }), fn = ({
897
+ ) }), ln = ({
898
898
  selected: t,
899
899
  onVoteUp: s,
900
900
  onVoteDown: n
@@ -907,7 +907,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
907
907
  onClick: s,
908
908
  "aria-label": "Helpful",
909
909
  "aria-pressed": t === "up",
910
- children: /* @__PURE__ */ e(mn, { filled: t === "up" })
910
+ children: /* @__PURE__ */ e(rn, { filled: t === "up" })
911
911
  }
912
912
  ),
913
913
  /* @__PURE__ */ e(
@@ -918,11 +918,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
918
918
  onClick: n,
919
919
  "aria-label": "Not helpful",
920
920
  "aria-pressed": t === "down",
921
- children: /* @__PURE__ */ e(hn, { filled: t === "down" })
921
+ children: /* @__PURE__ */ e(on, { filled: t === "down" })
922
922
  }
923
923
  )
924
- ] }), gn = (t) => {
925
- var le, se, we, ye, Ne, ce, Ce, _e, Ee, de, D, X, V, Y;
924
+ ] }), cn = (t) => {
925
+ var se, Oe, Pe, Ue, Be, ze, $e, je, Ge, Ve, He, Ye, We, qe;
926
926
  const {
927
927
  additionalMessageInputProps: s,
928
928
  chatbotVotingEnabled: n,
@@ -931,77 +931,77 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
931
931
  firstOfGroup: l,
932
932
  groupedByUser: i,
933
933
  handleAction: c,
934
- handleOpenThread: h,
934
+ handleOpenThread: m,
935
935
  handleRetry: u,
936
- highlighted: m,
936
+ highlighted: h,
937
937
  isMessageAIGenerated: f,
938
938
  isMyMessage: v,
939
939
  message: a,
940
- renderText: C,
941
- threadList: g
942
- } = t, { client: y } = He("CustomMessage"), { channel: p } = ue("CustomMessage"), { isUnlocking: S, onUnlockClick: w, onFetchSource: E, onDownloadClick: F } = un("LockedAttachment"), [N, b] = M(!1), k = Bt(a.id), { selected: R, voteUp: I, voteDown: L } = nn(a), {
943
- Attachment: T = Gt,
944
- EditMessageModal: B = Vt,
945
- MessageBlocked: O = Ht,
946
- MessageBouncePrompt: G = Yt,
947
- MessageDeleted: $ = Wt,
948
- MessageIsThreadReplyInChannelButtonIndicator: P = qt,
949
- MessageRepliesCountButton: W = Xt,
950
- ReminderNotification: Z = Zt,
951
- StreamedMessageText: ae = Kt,
952
- PinIndicator: J
953
- } = gt("CustomMessage"), x = Jt(a), _ = Qt(a), z = ze(
940
+ renderText: y,
941
+ threadList: b
942
+ } = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = an("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: _, voteDown: N } = Js(a), {
943
+ Attachment: F = Ot,
944
+ EditMessageModal: H = Pt,
945
+ MessageBlocked: D = Ut,
946
+ MessageBouncePrompt: B = Bt,
947
+ MessageDeleted: S = zt,
948
+ MessageIsThreadReplyInChannelButtonIndicator: $ = $t,
949
+ MessageRepliesCountButton: V = jt,
950
+ ReminderNotification: ee = Gt,
951
+ StreamedMessageText: te = Vt,
952
+ PinIndicator: W
953
+ } = dt("CustomMessage"), g = Ht(a), p = Yt(a), R = Ce(
954
954
  () => f == null ? void 0 : f(a),
955
955
  [f, a]
956
- ), H = ze(
956
+ ), j = Ce(
957
957
  () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
958
958
  [a]
959
959
  );
960
- if (es(a))
960
+ if (Wt(a))
961
961
  return null;
962
962
  if (a.deleted_at || a.type === "deleted")
963
- return /* @__PURE__ */ e($, { message: a });
964
- if (ts(a))
965
- return /* @__PURE__ */ e(O, {});
966
- const ee = !g && !!a.reply_count, ie = !g && a.show_in_channel && a.parent_id, be = a.status === "failed" && ((le = a.error) == null ? void 0 : le.status) !== 403, Le = ss(a);
963
+ return /* @__PURE__ */ e(S, { message: a });
964
+ if (qt(a))
965
+ return /* @__PURE__ */ e(D, {});
966
+ const Y = !b && !!a.reply_count, ae = !b && a.show_in_channel && a.parent_id, de = a.status === "failed" && ((se = a.error) == null ? void 0 : se.status) !== 403, re = Xt(a);
967
967
  let q;
968
- be ? q = () => u(a) : Le && (q = () => b(!0));
969
- const te = v(), xe = A(
968
+ de ? q = () => u(a) : re && (q = () => k(!0));
969
+ const ie = v(), pe = L(
970
970
  "str-chat__message str-chat__message-simple",
971
971
  `str-chat__message--${a.type}`,
972
972
  `str-chat__message--${a.status}`,
973
- te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
973
+ ie ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
974
974
  a.text ? "str-chat__message--has-text" : "has-no-text",
975
975
  {
976
- "str-chat__message--has-attachment": x,
977
- "str-chat__message--highlighted": m,
976
+ "str-chat__message--has-attachment": g,
977
+ "str-chat__message--highlighted": h,
978
978
  "str-chat__message--pinned pinned-message": a.pinned,
979
- "str-chat__message--with-reactions": _,
980
- "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((se = a == null ? void 0 : a.error) == null ? void 0 : se.status) !== 403,
981
- "str-chat__message-with-thread-link": ee || ie,
979
+ "str-chat__message--with-reactions": p,
980
+ "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((Oe = a == null ? void 0 : a.error) == null ? void 0 : Oe.status) !== 403,
981
+ "str-chat__message-with-thread-link": Y || ae,
982
982
  "str-chat__virtual-message__wrapper--end": o,
983
983
  "str-chat__virtual-message__wrapper--first": l,
984
984
  "str-chat__virtual-message__wrapper--group": i
985
985
  }
986
- ), re = a.poll_id && y.polls.fromState(a.poll_id), me = Js(a), oe = We(a), pe = Ks(a), ge = !!(H != null && H.length && !a.quoted_message), ve = oe && te && ge;
987
- return /* @__PURE__ */ d(fe, { children: [
986
+ ), ue = a.poll_id && C.polls.fromState(a.poll_id), xe = Vs(a), K = De(a), z = Gs(a), X = !!(j != null && j.length && !a.quoted_message), Q = K && ie && X;
987
+ return /* @__PURE__ */ d(ce, { children: [
988
988
  r && /* @__PURE__ */ e(
989
- B,
989
+ H,
990
990
  {
991
991
  additionalMessageInputProps: s
992
992
  }
993
993
  ),
994
- N && /* @__PURE__ */ e(
995
- ns,
994
+ U && /* @__PURE__ */ e(
995
+ Zt,
996
996
  {
997
- MessageBouncePrompt: G,
998
- onClose: () => b(!1),
999
- open: N
997
+ MessageBouncePrompt: B,
998
+ onClose: () => k(!1),
999
+ open: U
1000
1000
  }
1001
1001
  ),
1002
- /* @__PURE__ */ d("div", { className: xe, children: [
1003
- J && /* @__PURE__ */ e(J, {}),
1004
- !!k && /* @__PURE__ */ e(Z, { reminder: k }),
1002
+ /* @__PURE__ */ d("div", { className: pe, children: [
1003
+ W && /* @__PURE__ */ e(W, {}),
1004
+ !!T && /* @__PURE__ */ e(ee, { reminder: T }),
1005
1005
  a.user && /* @__PURE__ */ e(
1006
1006
  ne,
1007
1007
  {
@@ -1014,8 +1014,8 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1014
1014
  /* @__PURE__ */ e(
1015
1015
  "div",
1016
1016
  {
1017
- className: A("str-chat__message-inner", {
1018
- "str-chat__simple-message--error-failed": be || Le
1017
+ className: L("str-chat__message-inner", {
1018
+ "str-chat__simple-message--error-failed": de || re
1019
1019
  }),
1020
1020
  "data-testid": "message-inner",
1021
1021
  onClick: q,
@@ -1028,106 +1028,106 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1028
1028
  marginInlineEnd: 0,
1029
1029
  marginInlineStart: 0
1030
1030
  },
1031
- children: pe ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1032
- te ? /* @__PURE__ */ e(
1033
- lt.Creator,
1031
+ children: z ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1032
+ ie ? /* @__PURE__ */ e(
1033
+ nt.Creator,
1034
1034
  {
1035
- title: (we = a.metadata) == null ? void 0 : we.attachment_title,
1036
- mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
1037
- thumbnailUrl: (Ne = a.metadata) == null ? void 0 : Ne.attachment_thumbnail,
1038
- amountText: (ce = a.metadata) == null ? void 0 : ce.amount_text,
1039
- detail: (Ce = a.metadata) == null ? void 0 : Ce.attachment_detail,
1040
- paymentStatus: (_e = a.metadata) == null ? void 0 : _e.payment_status,
1041
- isUnlocking: S(a.id),
1042
- onPreviewClick: () => w == null ? void 0 : w(a, p),
1043
- onFetchSource: async () => await (E == null ? void 0 : E(a, p))
1035
+ title: (Pe = a.metadata) == null ? void 0 : Pe.attachment_title,
1036
+ mimeType: (Ue = a.metadata) == null ? void 0 : Ue.attachment_mime_type,
1037
+ thumbnailUrl: (Be = a.metadata) == null ? void 0 : Be.attachment_thumbnail,
1038
+ amountText: (ze = a.metadata) == null ? void 0 : ze.amount_text,
1039
+ detail: ($e = a.metadata) == null ? void 0 : $e.attachment_detail,
1040
+ paymentStatus: (je = a.metadata) == null ? void 0 : je.payment_status,
1041
+ isUnlocking: I(a.id),
1042
+ onPreviewClick: () => w == null ? void 0 : w(a, x),
1043
+ onFetchSource: async () => await (E == null ? void 0 : E(a, x))
1044
1044
  }
1045
1045
  ) : /* @__PURE__ */ e(
1046
- lt.Visitor,
1046
+ nt.Visitor,
1047
1047
  {
1048
- title: (Ee = a.metadata) == null ? void 0 : Ee.attachment_title,
1049
- mimeType: (de = a.metadata) == null ? void 0 : de.attachment_mime_type,
1050
- thumbnailUrl: (D = a.metadata) == null ? void 0 : D.attachment_thumbnail,
1051
- amountText: (X = a.metadata) == null ? void 0 : X.amount_text,
1052
- detail: (V = a.metadata) == null ? void 0 : V.attachment_detail,
1053
- paymentStatus: (Y = a.metadata) == null ? void 0 : Y.payment_status,
1054
- isUnlocking: S(a.id),
1055
- onUnlockClick: () => w == null ? void 0 : w(a, p),
1056
- onFetchSource: async () => await (E == null ? void 0 : E(a, p)),
1057
- onDownloadClick: () => F == null ? void 0 : F(a, p)
1048
+ title: (Ge = a.metadata) == null ? void 0 : Ge.attachment_title,
1049
+ mimeType: (Ve = a.metadata) == null ? void 0 : Ve.attachment_mime_type,
1050
+ thumbnailUrl: (He = a.metadata) == null ? void 0 : He.attachment_thumbnail,
1051
+ amountText: (Ye = a.metadata) == null ? void 0 : Ye.amount_text,
1052
+ detail: (We = a.metadata) == null ? void 0 : We.attachment_detail,
1053
+ paymentStatus: (qe = a.metadata) == null ? void 0 : qe.payment_status,
1054
+ isUnlocking: I(a.id),
1055
+ onUnlockClick: () => w == null ? void 0 : w(a, x),
1056
+ onFetchSource: async () => await (E == null ? void 0 : E(a, x)),
1057
+ onDownloadClick: () => P == null ? void 0 : P(a, x)
1058
1058
  }
1059
1059
  ),
1060
- a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Qe, { message: a, renderText: C }) })
1061
- ] }) : me ? (
1060
+ a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: y }) })
1061
+ ] }) : xe ? (
1062
1062
  /* Tip-only messages render as a standalone bubble */
1063
- /* @__PURE__ */ e(Oe, { message: a, standalone: !0 })
1063
+ /* @__PURE__ */ e(Ne, { message: a, standalone: !0 })
1064
1064
  ) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
1065
1065
  /* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
1066
- oe && !ve && /* @__PURE__ */ e(
1067
- Oe,
1066
+ K && !Q && /* @__PURE__ */ e(
1067
+ Ne,
1068
1068
  {
1069
1069
  message: a,
1070
- hasAttachment: ge,
1071
- isMyMessage: te
1070
+ hasAttachment: X,
1071
+ isMyMessage: ie
1072
1072
  }
1073
1073
  ),
1074
- re && /* @__PURE__ */ e(as, { poll: re }),
1075
- H != null && H.length && !a.quoted_message ? /* @__PURE__ */ e(
1076
- T,
1074
+ ue && /* @__PURE__ */ e(Jt, { poll: ue }),
1075
+ j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
1076
+ F,
1077
1077
  {
1078
1078
  actionHandler: c,
1079
- attachments: H
1079
+ attachments: j
1080
1080
  }
1081
1081
  ) : null,
1082
- z ? /* @__PURE__ */ e(
1083
- ae,
1082
+ R ? /* @__PURE__ */ e(
1083
+ te,
1084
1084
  {
1085
1085
  message: a,
1086
- renderText: C
1086
+ renderText: y
1087
1087
  }
1088
- ) : /* @__PURE__ */ e(Qe, { message: a, renderText: C }),
1089
- /* @__PURE__ */ e(rs, {})
1088
+ ) : /* @__PURE__ */ e(Xe, { message: a, renderText: y }),
1089
+ /* @__PURE__ */ e(Kt, {})
1090
1090
  ] }),
1091
- (!oe || ve) && /* @__PURE__ */ e(
1092
- Oe,
1091
+ (!K || Q) && /* @__PURE__ */ e(
1092
+ Ne,
1093
1093
  {
1094
1094
  message: a,
1095
- hasAttachment: ge,
1096
- isMyMessage: te
1095
+ hasAttachment: X,
1096
+ isMyMessage: ie
1097
1097
  }
1098
1098
  ),
1099
- n && oe && /* @__PURE__ */ e(
1100
- fn,
1099
+ n && K && /* @__PURE__ */ e(
1100
+ ln,
1101
1101
  {
1102
- selected: R,
1103
- onVoteUp: I,
1104
- onVoteDown: L
1102
+ selected: M,
1103
+ onVoteUp: _,
1104
+ onVoteDown: N
1105
1105
  }
1106
1106
  )
1107
1107
  ] })
1108
1108
  }
1109
1109
  ),
1110
- ee && /* @__PURE__ */ e(
1111
- W,
1110
+ Y && /* @__PURE__ */ e(
1111
+ V,
1112
1112
  {
1113
- onClick: h,
1113
+ onClick: m,
1114
1114
  reply_count: a.reply_count
1115
1115
  }
1116
1116
  ),
1117
- ie && /* @__PURE__ */ e(P, {})
1117
+ ae && /* @__PURE__ */ e($, {})
1118
1118
  ] }, a.id)
1119
1119
  ] });
1120
- }, bn = j.memo(
1121
- gn,
1122
- (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : jt(t, s)
1123
- ), xn = (t) => {
1124
- const s = bt("CustomMessage");
1125
- return /* @__PURE__ */ e(bn, { ...s, ...t });
1126
- }, pn = (t) => ({
1120
+ }, dn = O.memo(
1121
+ cn,
1122
+ (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : At(t, s)
1123
+ ), un = (t) => {
1124
+ const s = ut("CustomMessage");
1125
+ return /* @__PURE__ */ e(dn, { ...s, ...t });
1126
+ }, mn = (t) => ({
1127
1127
  linkPreviews: Array.from(t.previews.values()).filter(
1128
- (s) => it.previewIsLoaded(s) || it.previewIsLoading(s)
1128
+ (s) => tt.previewIsLoaded(s) || tt.previewIsLoading(s)
1129
1129
  )
1130
- }), vn = ({
1130
+ }), hn = ({
1131
1131
  link: t,
1132
1132
  onDismiss: s
1133
1133
  }) => {
@@ -1157,7 +1157,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1157
1157
  },
1158
1158
  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",
1159
1159
  "aria-label": "Close link preview",
1160
- children: /* @__PURE__ */ e(Ye, { className: "size-4 text-black/90" })
1160
+ children: /* @__PURE__ */ e(mt, { className: "size-4 text-black/90" })
1161
1161
  }
1162
1162
  ),
1163
1163
  /* @__PURE__ */ d("div", { className: "p-2", children: [
@@ -1167,22 +1167,22 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1167
1167
  ]
1168
1168
  }
1169
1169
  );
1170
- }, wn = () => {
1171
- const { linkPreviewsManager: t } = is(), { linkPreviews: s } = os(
1170
+ }, fn = () => {
1171
+ const { linkPreviewsManager: t } = Qt(), { linkPreviews: s } = es(
1172
1172
  t.state,
1173
- pn
1173
+ mn
1174
1174
  ), n = (o) => {
1175
1175
  t.dismissPreview(o);
1176
1176
  };
1177
1177
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
1178
- vn,
1178
+ hn,
1179
1179
  {
1180
1180
  link: o,
1181
1181
  onDismiss: n
1182
1182
  },
1183
1183
  o.og_scrape_url
1184
1184
  )) }) : null;
1185
- }, yn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
1185
+ }, gn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
1186
1186
  "button",
1187
1187
  {
1188
1188
  ...n,
@@ -1190,22 +1190,22 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1190
1190
  "aria-label": "Send",
1191
1191
  disabled: s,
1192
1192
  onClick: t,
1193
- children: /* @__PURE__ */ e(Cs, { weight: "bold", className: "size-4" })
1193
+ children: /* @__PURE__ */ e(bs, { weight: "bold", className: "size-4" })
1194
1194
  }
1195
- ), Nn = () => {
1195
+ ), bn = () => {
1196
1196
  var c;
1197
- const { channel: t } = ue(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = cs(), { SendButton: r } = gt(
1197
+ const { channel: t } = oe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = ss(), { SendButton: r } = dt(
1198
1198
  "CustomMessageInput"
1199
- ), o = r ?? yn, l = ds();
1200
- return /* @__PURE__ */ d(fe, { children: [
1201
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(us, {}) }),
1199
+ ), o = r ?? gn, l = ns();
1200
+ return /* @__PURE__ */ d(ce, { children: [
1201
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(as, {}) }),
1202
1202
  /* @__PURE__ */ d("div", { className: "central-container 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: [
1203
- /* @__PURE__ */ e(ms, {}),
1204
- /* @__PURE__ */ e(wn, {}),
1205
- /* @__PURE__ */ e(hs, {}),
1203
+ /* @__PURE__ */ e(rs, {}),
1204
+ /* @__PURE__ */ e(fn, {}),
1205
+ /* @__PURE__ */ e(is, {}),
1206
1206
  /* @__PURE__ */ d("div", { className: "flex", children: [
1207
1207
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1208
- fs,
1208
+ os,
1209
1209
  {
1210
1210
  "aria-disabled": s || void 0,
1211
1211
  className: "w-full resize-none outline-none leading-6",
@@ -1229,11 +1229,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1229
1229
  ] })
1230
1230
  ] })
1231
1231
  ] });
1232
- }, Cn = ({
1232
+ }, pn = ({
1233
1233
  renderActions: t
1234
1234
  }) => {
1235
1235
  var r;
1236
- const { channel: s } = ue(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
1236
+ const { channel: s } = oe(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
1237
1237
  return /* @__PURE__ */ d(
1238
1238
  "div",
1239
1239
  {
@@ -1242,65 +1242,65 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1242
1242
  className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
1243
1243
  children: [
1244
1244
  t == null ? void 0 : t(),
1245
- /* @__PURE__ */ e(ls, { Input: Nn })
1245
+ /* @__PURE__ */ e(ts, { Input: bn })
1246
1246
  ]
1247
1247
  }
1248
1248
  );
1249
- }, _n = [
1249
+ }, xn = [
1250
1250
  "SYSTEM_DM_AGENT_PAUSED",
1251
1251
  "SYSTEM_DM_AGENT_RESUMED"
1252
- ], En = {
1252
+ ], vn = {
1253
1253
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1254
1254
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1255
- }, kn = [
1255
+ }, wn = [
1256
1256
  "SYSTEM_AGE_SAFETY_BLOCKED"
1257
- ], Sn = {
1257
+ ], Nn = {
1258
1258
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1259
- }, Ue = "age safety guidelines.", In = "https://linktr.ee/s/about/contact", ct = (t) => _n.includes(t), Mn = (t) => kn.includes(t), Tn = (t) => {
1259
+ }, _e = "age safety guidelines.", _n = "https://linktr.ee/s/about/contact", at = (t) => xn.includes(t), yn = (t) => wn.includes(t), Cn = (t) => {
1260
1260
  var r;
1261
1261
  const s = (r = t.metadata) == null ? void 0 : r.custom_type;
1262
- if (ct(s))
1262
+ if (at(s))
1263
1263
  return {
1264
1264
  kind: "dm-agent",
1265
1265
  type: s
1266
1266
  };
1267
- if (Mn(s))
1267
+ if (yn(s))
1268
1268
  return {
1269
1269
  kind: "age-safety",
1270
1270
  type: s
1271
1271
  };
1272
1272
  const n = t.dm_agent_system_type;
1273
- if (ct(n))
1273
+ if (at(n))
1274
1274
  return {
1275
1275
  kind: "dm-agent",
1276
1276
  type: n
1277
1277
  };
1278
- }, Dn = (t) => {
1279
- const s = t.indexOf(Ue);
1278
+ }, En = (t) => {
1279
+ const s = t.indexOf(_e);
1280
1280
  if (s === -1)
1281
1281
  return t;
1282
- const n = s + Ue.length;
1283
- return /* @__PURE__ */ d(fe, { children: [
1282
+ const n = s + _e.length;
1283
+ return /* @__PURE__ */ d(ce, { children: [
1284
1284
  t.slice(0, s),
1285
1285
  /* @__PURE__ */ e(
1286
1286
  "a",
1287
1287
  {
1288
- href: In,
1288
+ href: _n,
1289
1289
  target: "_blank",
1290
1290
  rel: "noopener noreferrer",
1291
1291
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1292
- children: Ue
1292
+ children: _e
1293
1293
  }
1294
1294
  ),
1295
1295
  t.slice(n)
1296
1296
  ] });
1297
- }, Rn = (t) => {
1297
+ }, Sn = (t) => {
1298
1298
  var r, o;
1299
- const s = t.message.hide_date === !0, n = Tn(
1299
+ const s = t.message.hide_date === !0, n = Cn(
1300
1300
  t.message
1301
1301
  );
1302
1302
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
1303
- const l = ((r = t.message.text) == null ? void 0 : r.trim()) || En[n.type];
1303
+ const l = ((r = t.message.text) == null ? void 0 : r.trim()) || vn[n.type];
1304
1304
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1305
1305
  /* @__PURE__ */ d(
1306
1306
  "div",
@@ -1310,7 +1310,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1310
1310
  "data-dm-agent-system-type": n.type,
1311
1311
  children: [
1312
1312
  /* @__PURE__ */ e(
1313
- Be,
1313
+ Se,
1314
1314
  {
1315
1315
  size: 16,
1316
1316
  weight: "regular",
@@ -1322,11 +1322,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1322
1322
  ]
1323
1323
  }
1324
1324
  ),
1325
- !s && /* @__PURE__ */ e(Fe, { message: t.message })
1325
+ !s && /* @__PURE__ */ e(ve, { message: t.message })
1326
1326
  ] });
1327
1327
  }
1328
1328
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1329
- const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Sn[n.type];
1329
+ const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Nn[n.type];
1330
1330
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1331
1331
  /* @__PURE__ */ d(
1332
1332
  "div",
@@ -1336,7 +1336,7 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1336
1336
  "data-age-safety-system-type": n.type,
1337
1337
  children: [
1338
1338
  /* @__PURE__ */ e(
1339
- _s,
1339
+ ps,
1340
1340
  {
1341
1341
  size: 24,
1342
1342
  weight: "duotone",
@@ -1345,11 +1345,11 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1345
1345
  "data-testid": "age-safety-system-message-icon"
1346
1346
  }
1347
1347
  ),
1348
- /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Dn(l) }) })
1348
+ /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: En(l) }) })
1349
1349
  ]
1350
1350
  }
1351
1351
  ),
1352
- !s && /* @__PURE__ */ e(Fe, { message: t.message })
1352
+ !s && /* @__PURE__ */ e(ve, { message: t.message })
1353
1353
  ] });
1354
1354
  }
1355
1355
  return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1358,9 +1358,9 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1358
1358
  /* @__PURE__ */ e("p", { children: t.message.text }),
1359
1359
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1360
1360
  ] }),
1361
- !s && /* @__PURE__ */ e(Fe, { message: t.message })
1361
+ !s && /* @__PURE__ */ e(ve, { message: t.message })
1362
1362
  ] });
1363
- }, $e = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
1363
+ }, ye = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
1364
1364
  "animateTransform",
1365
1365
  {
1366
1366
  attributeName: "transform",
@@ -1370,25 +1370,25 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1370
1370
  begin: `${120 * s}ms`,
1371
1371
  repeatCount: "indefinite"
1372
1372
  }
1373
- ) }), Ln = ({ threadList: t }) => {
1374
- var C;
1375
- const { channel: s, channelConfig: n, thread: r } = ue(), { client: o } = He(), { typing: l = {} } = gs();
1373
+ ) }), In = ({ threadList: t }) => {
1374
+ var y;
1375
+ const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = Me(), { typing: l = {} } = ls();
1376
1376
  if ((n == null ? void 0 : n.typing_events) === !1)
1377
1377
  return null;
1378
1378
  const i = t ? [] : Object.values(l).filter(
1379
- ({ parent_id: g, user: y }) => {
1380
- var p;
1381
- return (y == null ? void 0 : y.id) !== ((p = o.user) == null ? void 0 : p.id) && !g;
1379
+ ({ parent_id: b, user: C }) => {
1380
+ var x;
1381
+ return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && !b;
1382
1382
  }
1383
1383
  ), c = t ? Object.values(l).filter(
1384
- ({ parent_id: g, user: y }) => {
1385
- var p;
1386
- return (y == null ? void 0 : y.id) !== ((p = o.user) == null ? void 0 : p.id) && g === (r == null ? void 0 : r.id);
1384
+ ({ parent_id: b, user: C }) => {
1385
+ var x;
1386
+ return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && b === (r == null ? void 0 : r.id);
1387
1387
  }
1388
- ) : [], h = t ? c : i;
1389
- if (!h.length)
1388
+ ) : [], m = t ? c : i;
1389
+ if (!m.length)
1390
1390
  return null;
1391
- const u = (C = h[0]) == null ? void 0 : C.user, m = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (m == null ? void 0 : m.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (m == null ? void 0 : m.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (m == null ? void 0 : m.image);
1391
+ const u = (y = m[0]) == null ? void 0 : y.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
1392
1392
  return /* @__PURE__ */ d(
1393
1393
  "div",
1394
1394
  {
@@ -1416,19 +1416,19 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1416
1416
  height: "8",
1417
1417
  overflow: "visible",
1418
1418
  children: [
1419
- /* @__PURE__ */ e($e, { cx: "4", index: 0 }),
1420
- /* @__PURE__ */ e($e, { cx: "16", index: 1 }),
1421
- /* @__PURE__ */ e($e, { cx: "28", index: 2 })
1419
+ /* @__PURE__ */ e(ye, { cx: "4", index: 0 }),
1420
+ /* @__PURE__ */ e(ye, { cx: "16", index: 1 }),
1421
+ /* @__PURE__ */ e(ye, { cx: "28", index: 2 })
1422
1422
  ]
1423
1423
  }
1424
1424
  ) })
1425
1425
  ]
1426
1426
  }
1427
1427
  );
1428
- }, Pn = () => null, An = ({ className: t, message: s }) => /* @__PURE__ */ d(
1428
+ }, kn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ d(
1429
1429
  "div",
1430
1430
  {
1431
- className: A("flex items-center justify-center h-full", t),
1431
+ className: L("flex items-center justify-center h-full", t),
1432
1432
  children: [
1433
1433
  /* @__PURE__ */ d("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1434
1434
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1468,12 +1468,12 @@ const mn = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1468
1468
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1469
1469
  ]
1470
1470
  }
1471
- ), Me = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1472
- /* @__PURE__ */ e(An, { className: "w-6 h-6" }),
1471
+ ), fe = O.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1472
+ /* @__PURE__ */ e(Mn, { className: "w-6 h-6" }),
1473
1473
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1474
1474
  ] }) }));
1475
- Me.displayName = "LoadingState";
1476
- const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", dt = "Replies instantly with AI assistant", Fn = ({
1475
+ fe.displayName = "LoadingState";
1476
+ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", rt = "Replies instantly with AI assistant", Tn = ({
1477
1477
  onBack: t,
1478
1478
  showBackButton: s,
1479
1479
  onShowInfo: n,
@@ -1481,19 +1481,19 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1481
1481
  showStarButton: o = !1,
1482
1482
  dmAgentEnabled: l = !1
1483
1483
  }) => {
1484
- var v, a, C, g, y;
1485
- const { channel: i } = ue(), c = j.useMemo(() => Object.values(i.state.members || {}).find(
1486
- (S) => {
1484
+ var v, a, y, b, C;
1485
+ const { channel: i } = oe(), c = O.useMemo(() => Object.values(i.state.members || {}).find(
1486
+ (I) => {
1487
1487
  var w;
1488
- return ((w = S.user) == null ? void 0 : w.id) && S.user.id !== i._client.userID;
1488
+ return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== i._client.userID;
1489
1489
  }
1490
- ), [i._client.userID, i.state.members]), h = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (C = c == null ? void 0 : c.user) == null ? void 0 : C.image, m = yt(i), f = async () => {
1490
+ ), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (y = c == null ? void 0 : c.user) == null ? void 0 : y.image, h = pt(i), f = async () => {
1491
1491
  try {
1492
- m ? await i.unpin() : await i.pin();
1493
- } catch (p) {
1492
+ h ? await i.unpin() : await i.pin();
1493
+ } catch (x) {
1494
1494
  console.error(
1495
1495
  "[CustomChannelHeader] Failed to update pinned status:",
1496
- p
1496
+ x
1497
1497
  );
1498
1498
  }
1499
1499
  };
@@ -1502,22 +1502,22 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1502
1502
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
1503
1503
  "button",
1504
1504
  {
1505
- className: he,
1505
+ className: le,
1506
1506
  onClick: t || (() => {
1507
1507
  }),
1508
1508
  type: "button",
1509
1509
  "aria-label": "Back to conversations",
1510
- children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
1510
+ children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
1511
1511
  }
1512
1512
  ) }),
1513
1513
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 items-center", children: [
1514
1514
  /* @__PURE__ */ e(
1515
1515
  ne,
1516
1516
  {
1517
- id: ((g = c == null ? void 0 : c.user) == null ? void 0 : g.id) || i.id || "unknown",
1518
- name: h,
1517
+ id: ((b = c == null ? void 0 : c.user) == null ? void 0 : b.id) || i.id || "unknown",
1518
+ name: m,
1519
1519
  image: u,
1520
- starred: o && m,
1520
+ starred: o && h,
1521
1521
  dmAgentEnabled: l,
1522
1522
  size: 40
1523
1523
  }
@@ -1528,34 +1528,34 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1528
1528
  type: "button",
1529
1529
  onClick: n,
1530
1530
  className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
1531
- "aria-label": `View info for ${h}`,
1531
+ "aria-label": `View info for ${m}`,
1532
1532
  children: [
1533
- h,
1534
- /* @__PURE__ */ e(st, { className: "size-3 shrink-0" })
1533
+ m,
1534
+ /* @__PURE__ */ e(Ke, { className: "size-3 shrink-0" })
1535
1535
  ]
1536
1536
  }
1537
1537
  ),
1538
1538
  l && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
1539
- /* @__PURE__ */ e(Be, { className: "size-3 shrink-0 text-black/55" }),
1540
- /* @__PURE__ */ e("span", { children: dt })
1539
+ /* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
1540
+ /* @__PURE__ */ e("span", { children: rt })
1541
1541
  ] })
1542
1542
  ] }),
1543
1543
  /* @__PURE__ */ d("div", { className: "flex justify-end items-center gap-2", children: [
1544
1544
  o && /* @__PURE__ */ e(
1545
1545
  "button",
1546
1546
  {
1547
- className: he,
1547
+ className: le,
1548
1548
  onClick: f,
1549
1549
  type: "button",
1550
- "aria-label": m ? "Unstar conversation" : "Star conversation",
1550
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1551
1551
  children: /* @__PURE__ */ e(
1552
- je,
1552
+ Ee,
1553
1553
  {
1554
- className: A("size-5", {
1555
- "text-yellow-600": m,
1556
- "text-black/90": !m
1554
+ className: L("size-5", {
1555
+ "text-yellow-600": h,
1556
+ "text-black/90": !h
1557
1557
  }),
1558
- weight: m ? "duotone" : "regular"
1558
+ weight: h ? "duotone" : "regular"
1559
1559
  }
1560
1560
  )
1561
1561
  }
@@ -1563,11 +1563,11 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1563
1563
  /* @__PURE__ */ e(
1564
1564
  "button",
1565
1565
  {
1566
- className: he,
1566
+ className: le,
1567
1567
  onClick: n,
1568
1568
  type: "button",
1569
1569
  "aria-label": "Show info",
1570
- children: /* @__PURE__ */ e(nt, { className: "size-5 text-black/90" })
1570
+ children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
1571
1571
  }
1572
1572
  )
1573
1573
  ] })
@@ -1579,18 +1579,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1579
1579
  {
1580
1580
  type: "button",
1581
1581
  onClick: t,
1582
- className: he,
1582
+ className: le,
1583
1583
  "aria-label": "Back to conversations",
1584
- children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
1584
+ children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
1585
1585
  }
1586
1586
  ),
1587
1587
  /* @__PURE__ */ e(
1588
1588
  ne,
1589
1589
  {
1590
- id: ((y = c == null ? void 0 : c.user) == null ? void 0 : y.id) || i.id || "unknown",
1591
- name: h,
1590
+ id: ((C = c == null ? void 0 : c.user) == null ? void 0 : C.id) || i.id || "unknown",
1591
+ name: m,
1592
1592
  image: u,
1593
- starred: o && m,
1593
+ starred: o && h,
1594
1594
  dmAgentEnabled: l,
1595
1595
  size: 40
1596
1596
  }
@@ -1602,16 +1602,16 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1602
1602
  type: "button",
1603
1603
  onClick: n,
1604
1604
  className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
1605
- "aria-label": `View info for ${h}`,
1605
+ "aria-label": `View info for ${m}`,
1606
1606
  children: [
1607
- /* @__PURE__ */ e("span", { className: "truncate", children: h }),
1608
- /* @__PURE__ */ e(st, { className: "size-4 shrink-0" })
1607
+ /* @__PURE__ */ e("span", { className: "truncate", children: m }),
1608
+ /* @__PURE__ */ e(Ke, { className: "size-4 shrink-0" })
1609
1609
  ]
1610
1610
  }
1611
- ) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: h }),
1611
+ ) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: m }),
1612
1612
  l && /* @__PURE__ */ d("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
1613
- /* @__PURE__ */ e(Be, { className: "size-3 shrink-0 text-black/55" }),
1614
- /* @__PURE__ */ e("span", { className: "truncate", children: dt })
1613
+ /* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
1614
+ /* @__PURE__ */ e("span", { className: "truncate", children: rt })
1615
1615
  ] })
1616
1616
  ] })
1617
1617
  ] }),
@@ -1619,18 +1619,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1619
1619
  o && /* @__PURE__ */ e(
1620
1620
  "button",
1621
1621
  {
1622
- className: he,
1622
+ className: le,
1623
1623
  onClick: f,
1624
1624
  type: "button",
1625
- "aria-label": m ? "Unstar conversation" : "Star conversation",
1625
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1626
1626
  children: /* @__PURE__ */ e(
1627
- je,
1627
+ Ee,
1628
1628
  {
1629
- className: A("size-5", {
1630
- "text-yellow-600": m,
1631
- "text-black/90": !m
1629
+ className: L("size-5", {
1630
+ "text-yellow-600": h,
1631
+ "text-black/90": !h
1632
1632
  }),
1633
- weight: m ? "duotone" : "regular"
1633
+ weight: h ? "duotone" : "regular"
1634
1634
  }
1635
1635
  )
1636
1636
  }
@@ -1638,17 +1638,17 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1638
1638
  r && n && /* @__PURE__ */ e(
1639
1639
  "button",
1640
1640
  {
1641
- className: he,
1641
+ className: le,
1642
1642
  onClick: n,
1643
1643
  type: "button",
1644
1644
  "aria-label": "Show info",
1645
- children: /* @__PURE__ */ e(nt, { className: "size-5 text-black/90" })
1645
+ children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
1646
1646
  }
1647
1647
  )
1648
1648
  ] })
1649
1649
  ] })
1650
1650
  ] });
1651
- }, On = ({
1651
+ }, Dn = ({
1652
1652
  onBack: t,
1653
1653
  showBackButton: s,
1654
1654
  renderMessageInputActions: n,
@@ -1657,94 +1657,94 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1657
1657
  onBlockParticipant: l,
1658
1658
  showDeleteConversation: i = !0,
1659
1659
  onDeleteConversationClick: c,
1660
- onBlockParticipantClick: h,
1660
+ onBlockParticipantClick: m,
1661
1661
  onReportParticipantClick: u,
1662
- showStarButton: m = !1,
1662
+ showStarButton: h = !1,
1663
1663
  chatbotVotingEnabled: f = !1,
1664
1664
  renderChannelBanner: v,
1665
1665
  customProfileContent: a,
1666
- customChannelActions: C,
1667
- renderMessage: g,
1668
- dmAgentEnabled: y = !1
1666
+ customChannelActions: y,
1667
+ renderMessage: b,
1668
+ dmAgentEnabled: C = !1
1669
1669
  }) => {
1670
- var T, B;
1671
- const { channel: p } = ue(), S = Q(null), w = j.useMemo(() => Object.values(p.state.members || {}).find(
1672
- (G) => {
1673
- var $;
1674
- return (($ = G.user) == null ? void 0 : $.id) && G.user.id !== p._client.userID;
1670
+ var F, H;
1671
+ const { channel: x } = oe(), I = J(null), w = O.useMemo(() => Object.values(x.state.members || {}).find(
1672
+ (B) => {
1673
+ var S;
1674
+ return ((S = B.user) == null ? void 0 : S.id) && B.user.id !== x._client.userID;
1675
1675
  }
1676
- ), [p._client.userID, p.state.members]), E = j.useMemo(() => Object.values(p.state.members || {}).find((G) => {
1677
- var $;
1678
- return (($ = G.user) == null ? void 0 : $.id) === p._client.userID;
1679
- }), [p._client.userID, p.state.members]), F = ((T = E == null ? void 0 : E.user) == null ? void 0 : T.is_account) ?? (E == null ? void 0 : E.is_account), N = ((B = w == null ? void 0 : w.user) == null ? void 0 : B.is_account) ?? (w == null ? void 0 : w.is_account), b = y && F === !1 && N === !0, k = j.useMemo(() => {
1680
- const O = p.data ?? {};
1681
- if (O.followerStatus)
1682
- return String(O.followerStatus);
1683
- if (O.isFollower !== void 0)
1684
- return O.isFollower ? "Subscribed to you" : "Not subscribed";
1685
- }, [p.data]), R = U(() => {
1686
- var O;
1687
- (O = S.current) == null || O.showModal();
1688
- }, []), I = U(() => {
1689
- var O;
1690
- (O = S.current) == null || O.close();
1691
- }, []), L = U(
1692
- (O) => {
1693
- const { message: G } = bt("ChannelView"), $ = /* @__PURE__ */ e(xn, { ...O, chatbotVotingEnabled: f });
1694
- return !g || !G ? $ : g($, G);
1676
+ ), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((B) => {
1677
+ var S;
1678
+ return ((S = B.user) == null ? void 0 : S.id) === x._client.userID;
1679
+ }), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
1680
+ const D = x.data ?? {};
1681
+ if (D.followerStatus)
1682
+ return String(D.followerStatus);
1683
+ if (D.isFollower !== void 0)
1684
+ return D.isFollower ? "Subscribed to you" : "Not subscribed";
1685
+ }, [x.data]), M = G(() => {
1686
+ var D;
1687
+ (D = I.current) == null || D.showModal();
1688
+ }, []), _ = G(() => {
1689
+ var D;
1690
+ (D = I.current) == null || D.close();
1691
+ }, []), N = G(
1692
+ (D) => {
1693
+ const { message: B } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...D, chatbotVotingEnabled: f });
1694
+ return !b || !B ? S : b(S, B);
1695
1695
  },
1696
- [f, g]
1696
+ [f, b]
1697
1697
  );
1698
- return /* @__PURE__ */ d(fe, { children: [
1699
- /* @__PURE__ */ e(xs, { overrides: { Message: L }, children: /* @__PURE__ */ d(ps, { children: [
1698
+ return /* @__PURE__ */ d(ce, { children: [
1699
+ /* @__PURE__ */ e(ds, { overrides: { Message: N }, children: /* @__PURE__ */ d(us, { children: [
1700
1700
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1701
- Fn,
1701
+ Tn,
1702
1702
  {
1703
1703
  onBack: t,
1704
1704
  showBackButton: s,
1705
- onShowInfo: R,
1705
+ onShowInfo: M,
1706
1706
  canShowInfo: !!w,
1707
- showStarButton: m,
1708
- dmAgentEnabled: b
1707
+ showStarButton: h,
1708
+ dmAgentEnabled: k
1709
1709
  }
1710
1710
  ) }),
1711
1711
  v == null ? void 0 : v(),
1712
1712
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1713
- vs,
1713
+ ms,
1714
1714
  {
1715
1715
  hideDeletedMessages: !0,
1716
1716
  hideNewMessageSeparator: !1,
1717
1717
  messageActions: void 0
1718
1718
  }
1719
1719
  ) }),
1720
- r == null ? void 0 : r(p),
1720
+ r == null ? void 0 : r(x),
1721
1721
  /* @__PURE__ */ e(
1722
- Cn,
1722
+ pn,
1723
1723
  {
1724
- renderActions: () => n == null ? void 0 : n(p)
1724
+ renderActions: () => n == null ? void 0 : n(x)
1725
1725
  }
1726
1726
  )
1727
1727
  ] }) }),
1728
1728
  /* @__PURE__ */ e(
1729
- en,
1729
+ qs,
1730
1730
  {
1731
- dialogRef: S,
1732
- onClose: I,
1731
+ dialogRef: I,
1732
+ onClose: _,
1733
1733
  participant: w,
1734
- channel: p,
1735
- followerStatusLabel: k,
1734
+ channel: x,
1735
+ followerStatusLabel: T,
1736
1736
  onLeaveConversation: o,
1737
1737
  onBlockParticipant: l,
1738
1738
  showDeleteConversation: i,
1739
1739
  onDeleteConversationClick: c,
1740
- onBlockParticipantClick: h,
1740
+ onBlockParticipantClick: m,
1741
1741
  onReportParticipantClick: u,
1742
1742
  customProfileContent: a,
1743
- customChannelActions: C
1743
+ customChannelActions: y
1744
1744
  }
1745
1745
  )
1746
1746
  ] });
1747
- }, Mt = j.memo(
1747
+ }, yt = O.memo(
1748
1748
  ({
1749
1749
  channel: t,
1750
1750
  onBack: s,
@@ -1754,62 +1754,62 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1754
1754
  onLeaveConversation: l,
1755
1755
  onBlockParticipant: i,
1756
1756
  className: c,
1757
- CustomChannelEmptyState: h = Pn,
1757
+ CustomChannelEmptyState: m = kn,
1758
1758
  showDeleteConversation: u = !0,
1759
- onDeleteConversationClick: m,
1759
+ onDeleteConversationClick: h,
1760
1760
  onBlockParticipantClick: f,
1761
1761
  onReportParticipantClick: v,
1762
1762
  dmAgentEnabled: a,
1763
- messageMetadata: C,
1764
- onMessageSent: g,
1765
- showStarButton: y = !1,
1766
- chatbotVotingEnabled: p = !1,
1767
- renderChannelBanner: S,
1763
+ messageMetadata: y,
1764
+ onMessageSent: b,
1765
+ showStarButton: C = !1,
1766
+ chatbotVotingEnabled: x = !1,
1767
+ renderChannelBanner: I,
1768
1768
  customProfileContent: w,
1769
1769
  customChannelActions: E,
1770
- renderMessage: F,
1771
- sendButton: N
1770
+ renderMessage: P,
1771
+ sendButton: U
1772
1772
  }) => {
1773
- const b = U(
1774
- async (k, R, I) => {
1775
- var $;
1776
- const L = (($ = t.data) == null ? void 0 : $.chatbot_paused) === !0, T = a && !L, B = {
1777
- ...R,
1778
- ...T && { silent: !0 },
1779
- ...C && {
1773
+ const k = G(
1774
+ async (T, M, _) => {
1775
+ var S;
1776
+ const N = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !N, H = {
1777
+ ...M,
1778
+ ...F && { silent: !0 },
1779
+ ...y && {
1780
1780
  metadata: {
1781
- ...R.metadata ?? {},
1782
- ...C
1781
+ ...M.metadata ?? {},
1782
+ ...y
1783
1783
  }
1784
1784
  }
1785
- }, O = {
1786
- ...I,
1787
- ...T && { skip_push: !0 }
1788
- }, G = await t.sendMessage(B, O);
1789
- return g == null || g(G), G;
1785
+ }, D = {
1786
+ ..._,
1787
+ ...F && { skip_push: !0 }
1788
+ }, B = await t.sendMessage(H, D);
1789
+ return b == null || b(B), B;
1790
1790
  },
1791
- [t, a, C, g]
1791
+ [t, a, y, b]
1792
1792
  );
1793
1793
  return /* @__PURE__ */ e(
1794
1794
  "div",
1795
1795
  {
1796
- className: A(
1796
+ className: L(
1797
1797
  "messaging-channel-view h-full flex flex-col",
1798
1798
  c
1799
1799
  ),
1800
1800
  children: /* @__PURE__ */ e(
1801
- bs,
1801
+ cs,
1802
1802
  {
1803
1803
  channel: t,
1804
- MessageSystem: Rn,
1805
- EmptyStateIndicator: h,
1806
- LoadingIndicator: Me,
1807
- DateSeparator: tn,
1808
- TypingIndicator: Ln,
1809
- doSendMessageRequest: b,
1810
- ...N ? { SendButton: N } : {},
1804
+ MessageSystem: Sn,
1805
+ EmptyStateIndicator: m,
1806
+ LoadingIndicator: fe,
1807
+ DateSeparator: Xs,
1808
+ TypingIndicator: In,
1809
+ doSendMessageRequest: k,
1810
+ ...U ? { SendButton: U } : {},
1811
1811
  children: /* @__PURE__ */ e(
1812
- On,
1812
+ Dn,
1813
1813
  {
1814
1814
  onBack: s,
1815
1815
  showBackButton: n,
@@ -1817,18 +1817,18 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1817
1817
  renderConversationFooter: o,
1818
1818
  onLeaveConversation: l,
1819
1819
  onBlockParticipant: i,
1820
- CustomChannelEmptyState: h,
1820
+ CustomChannelEmptyState: m,
1821
1821
  showDeleteConversation: u,
1822
- onDeleteConversationClick: m,
1822
+ onDeleteConversationClick: h,
1823
1823
  onBlockParticipantClick: f,
1824
1824
  onReportParticipantClick: v,
1825
- showStarButton: y,
1825
+ showStarButton: C,
1826
1826
  dmAgentEnabled: a,
1827
- chatbotVotingEnabled: p,
1828
- renderChannelBanner: S,
1827
+ chatbotVotingEnabled: x,
1828
+ renderChannelBanner: I,
1829
1829
  customProfileContent: w,
1830
1830
  customChannelActions: E,
1831
- renderMessage: F
1831
+ renderMessage: P
1832
1832
  }
1833
1833
  )
1834
1834
  }
@@ -1837,186 +1837,8 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1837
1837
  );
1838
1838
  }
1839
1839
  );
1840
- Mt.displayName = "ChannelView";
1841
- function Un({
1842
- searchQuery: t,
1843
- setSearchQuery: s,
1844
- placeholder: n
1845
- }) {
1846
- const r = Q(null);
1847
- return /* @__PURE__ */ d("div", { className: "relative", children: [
1848
- /* @__PURE__ */ e(
1849
- Es,
1850
- {
1851
- className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1852
- weight: "bold"
1853
- }
1854
- ),
1855
- /* @__PURE__ */ e(
1856
- "input",
1857
- {
1858
- ref: r,
1859
- type: "text",
1860
- placeholder: n,
1861
- value: t,
1862
- onChange: (o) => s(o.target.value),
1863
- className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
1864
- }
1865
- ),
1866
- t && /* @__PURE__ */ e(
1867
- Et,
1868
- {
1869
- label: "Clear search",
1870
- onClick: () => {
1871
- var o;
1872
- s(""), (o = r.current) == null || o.focus();
1873
- },
1874
- className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1875
- children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4", weight: "bold" })
1876
- }
1877
- )
1878
- ] });
1879
- }
1880
- const $n = ({
1881
- participantSource: t,
1882
- onSelectParticipant: s,
1883
- onClose: n,
1884
- existingParticipantIds: r = /* @__PURE__ */ new Set(),
1885
- participantLabel: o = "participants",
1886
- searchPlaceholder: l = "Search participants...",
1887
- className: i
1888
- }) => {
1889
- const { debug: c } = De(), [h, u] = M(""), [m, f] = M([]), [v, a] = M(!1), [C, g] = M(null), [y, p] = M(
1890
- null
1891
- ), S = Q(!1);
1892
- K(() => {
1893
- S.current = !1;
1894
- }, [t]), K(() => {
1895
- if (t.loading) {
1896
- c && console.log(
1897
- "[ParticipantPicker] Waiting for participant source to finish loading..."
1898
- );
1899
- return;
1900
- }
1901
- if (S.current) return;
1902
- (async () => {
1903
- c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), g(null);
1904
- try {
1905
- const b = await t.loadParticipants({
1906
- search: "",
1907
- // Load all participants initially
1908
- limit: 100
1909
- });
1910
- f(b.participants), S.current = !0, c && console.log(
1911
- "[ParticipantPicker] Participants loaded successfully:",
1912
- b.participants.length
1913
- );
1914
- } catch (b) {
1915
- const k = b instanceof Error ? b.message : "Failed to load participants";
1916
- g(k), console.error("[ParticipantPicker] Failed to load participants:", b);
1917
- } finally {
1918
- a(!1);
1919
- }
1920
- })();
1921
- }, [t, c]);
1922
- const w = m.filter((N) => !r.has(N.id)).filter((N) => {
1923
- var k;
1924
- if (!h) return !0;
1925
- const b = h.toLowerCase();
1926
- return N.name.toLowerCase().includes(b) || ((k = N.email) == null ? void 0 : k.toLowerCase().includes(b)) || !1;
1927
- }), E = U(
1928
- async (N) => {
1929
- if (!y) {
1930
- p(N.id);
1931
- try {
1932
- await s(N);
1933
- } catch (b) {
1934
- console.error("[ParticipantPicker] Failed to start chat:", b), p(null);
1935
- }
1936
- }
1937
- },
1938
- [s, y]
1939
- ), F = (N, b) => {
1940
- (N.key === "Enter" || N.key === " ") && (N.preventDefault(), E(b));
1941
- };
1942
- return /* @__PURE__ */ d("div", { className: A("flex flex-col h-full", i), children: [
1943
- /* @__PURE__ */ d("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1944
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-3", children: [
1945
- /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1946
- /* @__PURE__ */ e(kt, { onClick: n })
1947
- ] }),
1948
- /* @__PURE__ */ d("p", { className: "text-xs text-stone mb-3", children: [
1949
- "Select a ",
1950
- o.slice(0, -1),
1951
- " to start messaging (",
1952
- w.length,
1953
- " available)",
1954
- t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
1955
- ] }),
1956
- /* @__PURE__ */ e(
1957
- Un,
1958
- {
1959
- searchQuery: h,
1960
- setSearchQuery: u,
1961
- placeholder: l
1962
- }
1963
- )
1964
- ] }),
1965
- C && /* @__PURE__ */ d("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1966
- "Error loading ",
1967
- o,
1968
- ": ",
1969
- C
1970
- ] }),
1971
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && w.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1972
- /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1973
- /* @__PURE__ */ d("span", { className: "text-sm text-stone", children: [
1974
- "Loading ",
1975
- o,
1976
- "..."
1977
- ] })
1978
- ] }) }) : w.length === 0 ? /* @__PURE__ */ d("div", { className: "p-6 text-center", children: [
1979
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(at, { className: "h-8 w-8 text-charcoal" }) }),
1980
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${o} found` : m.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1981
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : m.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1982
- ] }) : /* @__PURE__ */ d("ul", { className: "space-y-0", children: [
1983
- w.map((N) => {
1984
- const b = N.name || N.email || N.id, k = N.email && N.name ? N.email : N.phone;
1985
- return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1986
- "button",
1987
- {
1988
- type: "button",
1989
- onClick: () => E(N),
1990
- onKeyDown: (R) => F(R, N),
1991
- className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1992
- children: /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
1993
- /* @__PURE__ */ d("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1994
- /* @__PURE__ */ e(
1995
- ne,
1996
- {
1997
- id: N.id,
1998
- name: b,
1999
- image: N.image,
2000
- size: 40
2001
- }
2002
- ),
2003
- /* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
2004
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: b }),
2005
- k && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: k })
2006
- ] })
2007
- ] }),
2008
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === N.id ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(at, { className: "h-5 w-5 text-stone" }) })
2009
- ] })
2010
- }
2011
- ) }, N.id);
2012
- }),
2013
- v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
2014
- /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
2015
- /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
2016
- ] }) })
2017
- ] }) })
2018
- ] });
2019
- }, zn = ({ className: t }) => /* @__PURE__ */ d(
1840
+ yt.displayName = "ChannelView";
1841
+ const Rn = ({ className: t }) => /* @__PURE__ */ d(
2020
1842
  "svg",
2021
1843
  {
2022
1844
  width: "140",
@@ -2150,17 +1972,17 @@ const $n = ({
2150
1972
  ] })
2151
1973
  ]
2152
1974
  }
2153
- ), Tt = j.memo(
1975
+ ), Ct = O.memo(
2154
1976
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
2155
- /* @__PURE__ */ e(zn, {}),
1977
+ /* @__PURE__ */ e(Rn, {}),
2156
1978
  s && !t && /* @__PURE__ */ d("div", { className: "mt-8", children: [
2157
1979
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
2158
1980
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
2159
1981
  ] })
2160
1982
  ] }) })
2161
1983
  );
2162
- Tt.displayName = "EmptyState";
2163
- const Ie = j.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
1984
+ Ct.displayName = "EmptyState";
1985
+ const he = O.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
2164
1986
  /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
2165
1987
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2166
1988
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -2174,333 +1996,264 @@ const Ie = j.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
2174
1996
  }
2175
1997
  )
2176
1998
  ] }) }));
2177
- Ie.displayName = "ErrorState";
2178
- const ga = ({
1999
+ he.displayName = "ErrorState";
2000
+ const oa = ({
2179
2001
  capabilities: t = {},
2180
2002
  className: s,
2181
2003
  renderMessageInputActions: n,
2182
2004
  renderConversationFooter: r,
2183
2005
  onChannelSelect: o,
2184
- onParticipantSelect: l,
2185
- initialParticipantFilter: i,
2186
- initialParticipantData: c,
2187
- CustomChannelEmptyState: h,
2188
- showChannelList: u = !0,
2189
- filters: m,
2190
- channelRenderFilterFn: f,
2191
- channelListCustomEmptyStateIndicator: v,
2192
- onDeleteConversationClick: a,
2193
- onBlockParticipantClick: C,
2194
- onReportParticipantClick: g,
2195
- dmAgentEnabled: y,
2196
- messageMetadata: p,
2197
- onMessageSent: S,
2198
- showStarButton: w = !1,
2199
- chatbotVotingEnabled: E = !1,
2200
- renderMessagePreview: F,
2201
- renderChannelBanner: N,
2202
- customProfileContent: b,
2006
+ initialParticipantFilter: l,
2007
+ initialParticipantData: i,
2008
+ CustomChannelEmptyState: c,
2009
+ showChannelList: m = !0,
2010
+ filters: u,
2011
+ channelRenderFilterFn: h,
2012
+ channelListCustomEmptyStateIndicator: f,
2013
+ onDeleteConversationClick: v,
2014
+ onBlockParticipantClick: a,
2015
+ onReportParticipantClick: y,
2016
+ dmAgentEnabled: b,
2017
+ messageMetadata: C,
2018
+ onMessageSent: x,
2019
+ showStarButton: I = !1,
2020
+ chatbotVotingEnabled: w = !1,
2021
+ renderMessagePreview: E,
2022
+ renderChannelBanner: P,
2023
+ customProfileContent: U,
2203
2024
  customChannelActions: k,
2204
- renderMessage: R,
2205
- sendButton: I
2025
+ renderMessage: T,
2026
+ sendButton: M
2206
2027
  }) => {
2207
2028
  const {
2208
- service: L,
2209
- client: T,
2210
- isConnected: B,
2211
- isLoading: O,
2212
- error: G,
2213
- refreshConnection: $,
2214
- debug: P
2215
- } = zs(), [W, Z] = M(null), [ae, J] = M(!1), [x, _] = M(!1), [z, H] = M(!1), [ee, ie] = M(/* @__PURE__ */ new Set()), [be, Le] = M(0), [q, te] = M(!1), [xe, re] = M(null), me = Q(null), {
2216
- participantSource: oe,
2217
- participantLabel: pe = "participants",
2218
- showDeleteConversation: ge = !0
2219
- } = t, ve = j.useMemo(() => {
2220
- const D = T == null ? void 0 : T.userID;
2029
+ service: _,
2030
+ client: N,
2031
+ isConnected: F,
2032
+ isLoading: H,
2033
+ error: D,
2034
+ refreshConnection: B,
2035
+ debug: S
2036
+ } = Rs(), [$, V] = A(null), [ee, te] = A(!1), [W, g] = A(!1), [p, R] = A(!1), [j, Y] = A(null), {
2037
+ showDeleteConversation: ae = !0
2038
+ } = t, de = O.useMemo(() => {
2039
+ const z = N == null ? void 0 : N.userID;
2221
2040
  return {
2222
2041
  ...{
2223
2042
  type: "messaging",
2224
2043
  last_message_at: { $exists: !0 },
2225
- ...D && {
2226
- members: { $in: [D] },
2044
+ ...z && {
2045
+ members: { $in: [z] },
2227
2046
  hidden: !1
2228
2047
  }
2229
2048
  },
2230
- ...m
2049
+ ...u
2231
2050
  };
2232
- }, [m, T == null ? void 0 : T.userID]), le = Q(null), se = U(async () => {
2233
- if (!T || !B) return;
2234
- const D = T.userID;
2235
- if (D)
2051
+ }, [u, N == null ? void 0 : N.userID]), re = J(null), q = G(async () => {
2052
+ if (!N || !F) return;
2053
+ const z = N.userID;
2054
+ if (z)
2236
2055
  try {
2237
- P && console.log("[MessagingShell] Syncing channels for user:", D);
2238
- const X = await T.queryChannels(
2056
+ S && console.log("[MessagingShell] Syncing channels for user:", z);
2057
+ const X = await N.queryChannels(
2239
2058
  {
2240
2059
  type: "messaging",
2241
- members: { $in: [D] }
2060
+ members: { $in: [z] }
2242
2061
  },
2243
2062
  {},
2244
2063
  { limit: 100 }
2245
- ), V = /* @__PURE__ */ new Set();
2246
- X.forEach((Y) => {
2247
- const Pe = Y.state.members;
2248
- Object.values(Pe).forEach((Ft) => {
2249
- var Je;
2250
- const Ae = (Je = Ft.user) == null ? void 0 : Je.id;
2251
- Ae && Ae !== D && V.add(Ae);
2252
- });
2253
- }), ie((Y) => Y.size === V.size && [...Y].every((Pe) => V.has(Pe)) ? Y : V), J(X.length > 0), _(!0), le.current = D, P && console.log("[MessagingShell] Channels synced successfully:", {
2254
- channelCount: X.length,
2255
- memberCount: V.size
2064
+ );
2065
+ te(X.length > 0), g(!0), re.current = z, S && console.log("[MessagingShell] Channels synced successfully:", {
2066
+ channelCount: X.length
2256
2067
  });
2257
2068
  } catch (X) {
2258
2069
  console.error("[MessagingShell] Failed to sync channels:", X);
2259
2070
  }
2260
- }, [T, B, P]);
2261
- K(() => {
2262
- if (!T || !B) return;
2263
- const D = T.userID;
2264
- D && le.current !== D && se();
2265
- }, [T, B, se]), K(() => {
2266
- if (!i || !T || !B) return;
2071
+ }, [N, F, S]);
2072
+ Z(() => {
2073
+ if (!N || !F) return;
2074
+ const z = N.userID;
2075
+ z && re.current !== z && q();
2076
+ }, [N, F, q]), Z(() => {
2077
+ if (!l || !N || !F) return;
2267
2078
  (async () => {
2268
- const X = T.userID;
2079
+ const X = N.userID;
2269
2080
  if (X)
2270
2081
  try {
2271
- P && console.log(
2082
+ S && console.log(
2272
2083
  "[MessagingShell] Loading initial conversation with:",
2273
- i
2084
+ l
2274
2085
  );
2275
- const V = await T.queryChannels(
2086
+ const Q = await N.queryChannels(
2276
2087
  {
2277
2088
  type: "messaging",
2278
- members: { $eq: [X, i] }
2089
+ members: { $eq: [X, l] }
2279
2090
  },
2280
2091
  {},
2281
2092
  { limit: 1 }
2282
2093
  );
2283
- if (V.length > 0)
2284
- Z(V[0]), te(!0), re(null), o && o(V[0]), P && console.log(
2094
+ if (Q.length > 0)
2095
+ V(Q[0]), R(!0), Y(null), o && o(Q[0]), S && console.log(
2285
2096
  "[MessagingShell] Initial conversation loaded:",
2286
- V[0].id
2097
+ Q[0].id
2287
2098
  );
2288
- else if (c && L) {
2289
- P && console.log(
2099
+ else if (i && _) {
2100
+ S && console.log(
2290
2101
  "[MessagingShell] No conversation found, creating one for:",
2291
- c
2102
+ i
2292
2103
  );
2293
2104
  try {
2294
- const Y = await L.startChannelWithParticipant({
2295
- id: c.id,
2296
- name: c.name,
2297
- email: c.email,
2298
- phone: c.phone
2105
+ const se = await _.startChannelWithParticipant({
2106
+ id: i.id,
2107
+ name: i.name,
2108
+ email: i.email,
2109
+ phone: i.phone
2299
2110
  });
2300
- Z(Y), te(!0), re(null), o && o(Y), P && console.log(
2111
+ V(se), R(!0), Y(null), o && o(se), S && console.log(
2301
2112
  "[MessagingShell] Channel created and loaded:",
2302
- Y.id
2113
+ se.id
2303
2114
  );
2304
- } catch (Y) {
2115
+ } catch (se) {
2305
2116
  console.error(
2306
2117
  "[MessagingShell] Failed to create conversation:",
2307
- Y
2308
- ), re("Failed to create conversation");
2118
+ se
2119
+ ), Y("Failed to create conversation");
2309
2120
  }
2310
2121
  } else
2311
- re(
2122
+ Y(
2312
2123
  "No conversation found with this account"
2313
- ), P && console.log(
2124
+ ), S && console.log(
2314
2125
  "[MessagingShell] No conversation found for:",
2315
- i
2126
+ l
2316
2127
  );
2317
- } catch (V) {
2128
+ } catch (Q) {
2318
2129
  console.error(
2319
2130
  "[MessagingShell] Failed to load initial conversation:",
2320
- V
2321
- ), re("Failed to load conversation");
2131
+ Q
2132
+ ), Y("Failed to load conversation");
2322
2133
  }
2323
2134
  })();
2324
2135
  }, [
2136
+ l,
2325
2137
  i,
2326
- c,
2327
- T,
2328
- B,
2329
- L,
2330
- P,
2138
+ N,
2139
+ F,
2140
+ _,
2141
+ S,
2331
2142
  o
2332
2143
  ]);
2333
- const we = U(
2334
- (D) => {
2335
- Z(D), o == null || o(D);
2144
+ const ie = G(
2145
+ (z) => {
2146
+ V(z), o == null || o(z);
2336
2147
  },
2337
2148
  [o]
2338
- ), ye = U(() => {
2339
- q || Z(null);
2340
- }, [q]), Ne = U(
2341
- async (D) => {
2342
- var X;
2343
- if (L)
2344
- try {
2345
- P && console.log(
2346
- "[MessagingShell] Starting conversation with:",
2347
- D.id
2348
- );
2349
- const V = await L.startChannelWithParticipant({
2350
- id: D.id,
2351
- name: D.name,
2352
- email: D.email,
2353
- phone: D.phone
2354
- });
2355
- try {
2356
- await V.show();
2357
- } catch (Y) {
2358
- console.warn("[MessagingShell] Failed to unhide channel:", Y);
2359
- }
2360
- Z(V), H(!1), (X = me.current) == null || X.close(), l == null || l(D);
2361
- } catch (V) {
2362
- console.error("[MessagingShell] Failed to start conversation:", V);
2363
- }
2149
+ ), pe = G(() => {
2150
+ p || V(null);
2151
+ }, [p]), ue = G(
2152
+ async (z) => {
2153
+ S && console.log("[MessagingShell] Leaving conversation:", z.id), V(null), R(!1), re.current = null, await q();
2364
2154
  },
2365
- [L, l, P]
2366
- ), ce = U(() => {
2367
- var D;
2368
- H(!1), (D = me.current) == null || D.close();
2369
- }, []), Ce = U(
2370
- (D) => {
2371
- D.target === me.current && ce();
2155
+ [q, S]
2156
+ ), xe = G(
2157
+ async (z) => {
2158
+ S && console.log("[MessagingShell] Blocking participant:", z), V(null), R(!1), re.current = null, await q();
2372
2159
  },
2373
- [ce]
2374
- ), _e = U(
2375
- async (D) => {
2376
- P && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), te(!1), le.current = null, await se();
2377
- },
2378
- [se, P]
2379
- ), Ee = U(
2380
- async (D) => {
2381
- P && console.log("[MessagingShell] Blocking participant:", D), Z(null), te(!1), le.current = null, await se();
2382
- },
2383
- [se, P]
2384
- ), de = !!W;
2385
- return O ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Me, {}) }) : G ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: G, onBack: $ }) }) : !B || !T ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
2386
- Ie,
2160
+ [q, S]
2161
+ ), K = !!$;
2162
+ return H ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : D ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(he, { message: D, onBack: B }) }) : !F || !N ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
2163
+ he,
2387
2164
  {
2388
2165
  message: "Not connected to messaging service",
2389
- onBack: $
2166
+ onBack: B
2390
2167
  }
2391
- ) }) : xe ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: xe }) }) : /* @__PURE__ */ d(
2168
+ ) }) : j ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
2392
2169
  "div",
2393
2170
  {
2394
- className: A(
2171
+ className: L(
2395
2172
  "messaging-shell h-full bg-background-primary overflow-hidden",
2396
2173
  s
2397
2174
  ),
2398
- children: [
2399
- /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
2400
- /* @__PURE__ */ e(
2401
- "div",
2402
- {
2403
- className: A(
2404
- "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2405
- {
2406
- "!hidden": u === !1 || q,
2407
- // Hide on mobile when channel selected, show on desktop with consistent wide width
2408
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !q && de,
2409
- // Show on mobile when no channel selected, use same wide width on desktop
2410
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !q && !de
2411
- }
2412
- ),
2413
- children: /* @__PURE__ */ e(
2414
- _t,
2415
- {
2416
- onChannelSelect: we,
2417
- selectedChannel: W || void 0,
2418
- filters: ve,
2419
- channelRenderFilterFn: f,
2420
- customEmptyStateIndicator: v,
2421
- renderMessagePreview: F
2422
- }
2423
- )
2424
- }
2425
- ),
2426
- /* @__PURE__ */ e(
2427
- "div",
2428
- {
2429
- className: A(
2430
- "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2431
- {
2432
- // In direct conversation mode (or waiting for it), always show (full width)
2433
- flex: q || de || i,
2434
- // Normal mode: hide on mobile when no channel selected
2435
- "hidden lg:flex": !q && !de && !i
2436
- }
2437
- ),
2438
- children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2439
- Mt,
2440
- {
2441
- channel: W,
2442
- onBack: ye,
2443
- showBackButton: !q,
2444
- renderMessageInputActions: n,
2445
- renderConversationFooter: r,
2446
- renderChannelBanner: N,
2447
- onLeaveConversation: _e,
2448
- onBlockParticipant: Ee,
2449
- CustomChannelEmptyState: h,
2450
- showDeleteConversation: ge,
2451
- onDeleteConversationClick: a,
2452
- onBlockParticipantClick: C,
2453
- onReportParticipantClick: g,
2454
- dmAgentEnabled: y,
2455
- messageMetadata: p,
2456
- onMessageSent: S,
2457
- showStarButton: w,
2458
- chatbotVotingEnabled: E,
2459
- customProfileContent: b,
2460
- customChannelActions: k,
2461
- renderMessage: R,
2462
- sendButton: I
2463
- },
2464
- W.id
2465
- ) }) : i ? (
2466
- // Show loading while creating/loading direct conversation channel
2467
- /* @__PURE__ */ e(Me, {})
2468
- ) : /* @__PURE__ */ e(
2469
- Tt,
2470
- {
2471
- hasChannels: ae,
2472
- channelsLoaded: x
2473
- }
2474
- )
2475
- }
2476
- )
2477
- ] }),
2478
- oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2175
+ children: /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
2176
+ /* @__PURE__ */ e(
2177
+ "div",
2178
+ {
2179
+ className: L(
2180
+ "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2181
+ {
2182
+ "!hidden": m === !1 || p,
2183
+ // Hide on mobile when channel selected, show on desktop with consistent wide width
2184
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p && K,
2185
+ // Show on mobile when no channel selected, use same wide width on desktop
2186
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !K
2187
+ }
2188
+ ),
2189
+ children: /* @__PURE__ */ e(
2190
+ wt,
2191
+ {
2192
+ onChannelSelect: ie,
2193
+ selectedChannel: $ || void 0,
2194
+ filters: de,
2195
+ channelRenderFilterFn: h,
2196
+ customEmptyStateIndicator: f,
2197
+ renderMessagePreview: E
2198
+ }
2199
+ )
2200
+ }
2201
+ ),
2479
2202
  /* @__PURE__ */ e(
2480
- "dialog",
2203
+ "div",
2481
2204
  {
2482
- ref: me,
2483
- className: "mes-dialog",
2484
- onClick: Ce,
2485
- onClose: ce,
2486
- children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2487
- $n,
2205
+ className: L(
2206
+ "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2207
+ {
2208
+ // In direct conversation mode (or waiting for it), always show (full width)
2209
+ flex: p || K || l,
2210
+ // Normal mode: hide on mobile when no channel selected
2211
+ "hidden lg:flex": !p && !K && !l
2212
+ }
2213
+ ),
2214
+ children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2215
+ yt,
2488
2216
  {
2489
- participantSource: oe,
2490
- onSelectParticipant: Ne,
2491
- onClose: ce,
2492
- existingParticipantIds: ee,
2493
- participantLabel: pe,
2494
- searchPlaceholder: `Search ${pe}...`
2217
+ channel: $,
2218
+ onBack: pe,
2219
+ showBackButton: !p,
2220
+ renderMessageInputActions: n,
2221
+ renderConversationFooter: r,
2222
+ renderChannelBanner: P,
2223
+ onLeaveConversation: ue,
2224
+ onBlockParticipant: xe,
2225
+ CustomChannelEmptyState: c,
2226
+ showDeleteConversation: ae,
2227
+ onDeleteConversationClick: v,
2228
+ onBlockParticipantClick: a,
2229
+ onReportParticipantClick: y,
2230
+ dmAgentEnabled: b,
2231
+ messageMetadata: C,
2232
+ onMessageSent: x,
2233
+ showStarButton: I,
2234
+ chatbotVotingEnabled: w,
2235
+ customProfileContent: U,
2236
+ customChannelActions: k,
2237
+ renderMessage: T,
2238
+ sendButton: M
2495
2239
  },
2496
- be
2497
- ) })
2240
+ $.id
2241
+ ) }) : l ? (
2242
+ // Show loading while creating/loading direct conversation channel
2243
+ /* @__PURE__ */ e(fe, {})
2244
+ ) : /* @__PURE__ */ e(
2245
+ Ct,
2246
+ {
2247
+ hasChannels: ee,
2248
+ channelsLoaded: W
2249
+ }
2250
+ )
2498
2251
  }
2499
2252
  )
2500
- ]
2253
+ ] })
2501
2254
  }
2502
2255
  );
2503
- }, jn = ({
2256
+ }, Ln = ({
2504
2257
  question: t,
2505
2258
  onClick: s,
2506
2259
  loading: n = !1,
@@ -2512,7 +2265,7 @@ const ga = ({
2512
2265
  onClick: s,
2513
2266
  disabled: n,
2514
2267
  style: { backgroundColor: "#E6E5E3" },
2515
- className: A(
2268
+ className: L(
2516
2269
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
2517
2270
  {
2518
2271
  "hover:brightness-95 active:brightness-90": !n,
@@ -2522,7 +2275,7 @@ const ga = ({
2522
2275
  ),
2523
2276
  children: t
2524
2277
  }
2525
- ), ba = ({
2278
+ ), la = ({
2526
2279
  faqs: t,
2527
2280
  onFaqClick: s,
2528
2281
  loadingFaqId: n,
@@ -2531,7 +2284,7 @@ const ga = ({
2531
2284
  avatarImage: l,
2532
2285
  avatarName: i
2533
2286
  }) => {
2534
- const c = t.filter((h) => h.enabled).sort((h, u) => (h.order ?? 0) - (u.order ?? 0));
2287
+ const c = t.filter((m) => m.enabled).sort((m, u) => (m.order ?? 0) - (u.order ?? 0));
2535
2288
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ d("div", { className: "flex gap-3 items-end", children: [
2536
2289
  (l || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2537
2290
  ne,
@@ -2550,20 +2303,20 @@ const ga = ({
2550
2303
  style: { backgroundColor: "#F1F0EE" },
2551
2304
  children: [
2552
2305
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2553
- c.map((h) => /* @__PURE__ */ e(
2554
- jn,
2306
+ c.map((m) => /* @__PURE__ */ e(
2307
+ Ln,
2555
2308
  {
2556
- question: h.question,
2557
- onClick: () => s(h.id),
2558
- loading: n === h.id
2309
+ question: m.question,
2310
+ onClick: () => s(m.id),
2311
+ loading: n === m.id
2559
2312
  },
2560
- h.id
2313
+ m.id
2561
2314
  ))
2562
2315
  ]
2563
2316
  }
2564
2317
  )
2565
2318
  ] }) });
2566
- }, Bn = [
2319
+ }, An = [
2567
2320
  [/pdf/, "pdf"],
2568
2321
  [/wordprocessingml|msword|\.doc/, "doc"],
2569
2322
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -2573,42 +2326,42 @@ const ga = ({
2573
2326
  [/plain|rtf/, "text"],
2574
2327
  [/markdown/, "markdown"]
2575
2328
  ];
2576
- function Re(t) {
2329
+ function be(t) {
2577
2330
  return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
2578
2331
  }
2579
- function Gn(t) {
2580
- const s = Bn.find(
2332
+ function Fn(t) {
2333
+ const s = An.find(
2581
2334
  ([n]) => n.test(t)
2582
2335
  );
2583
2336
  return s ? s[1] : "generic";
2584
2337
  }
2585
- const Vn = {
2586
- video: Is,
2587
- audio: Ss,
2588
- image: ks,
2589
- document: xt
2590
- }, Hn = {
2591
- pdf: Fs,
2592
- doc: As,
2593
- xls: Ps,
2594
- csv: Ls,
2595
- ppt: Rs,
2596
- zip: Ds,
2597
- text: Ts,
2598
- markdown: Ms,
2599
- generic: xt
2338
+ const On = {
2339
+ video: ws,
2340
+ audio: vs,
2341
+ image: xs,
2342
+ document: ht
2343
+ }, Pn = {
2344
+ pdf: ks,
2345
+ doc: Is,
2346
+ xls: Ss,
2347
+ csv: Es,
2348
+ ppt: Cs,
2349
+ zip: ys,
2350
+ text: _s,
2351
+ markdown: Ns,
2352
+ generic: ht
2600
2353
  };
2601
- function Yn(t) {
2602
- const s = Re(t);
2603
- return s !== "document" ? Vn[s] : Hn[Gn(t)];
2354
+ function Un(t) {
2355
+ const s = be(t);
2356
+ return s !== "document" ? On[s] : Pn[Fn(t)];
2604
2357
  }
2605
- function Te(t, s) {
2606
- return j.createElement(Yn(t), s);
2358
+ function ge(t, s) {
2359
+ return O.createElement(Un(t), s);
2607
2360
  }
2608
- const Wn = (t) => {
2361
+ const Bn = (t) => {
2609
2362
  var s, n;
2610
2363
  return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
2611
- }, qn = ({
2364
+ }, zn = ({
2612
2365
  source: t,
2613
2366
  mimeType: s,
2614
2367
  poster: n,
@@ -2617,81 +2370,81 @@ const Wn = (t) => {
2617
2370
  loop: l = !1,
2618
2371
  controls: i = !0,
2619
2372
  showProgress: c = !1,
2620
- muted: h = !1,
2373
+ muted: m = !1,
2621
2374
  onContainerClick: u
2622
2375
  }) => {
2623
- const m = Re(s), f = Q(null), v = Q(null), a = Q(null), C = Q(o), [g, y] = M(r), [p, S] = M(0), [w, E] = M(!1), [F, N] = M(!1), [b, k] = M(!1), [R, I] = M(!1), [L, T] = M(!0), [B, O] = M(null), G = U(() => {
2624
- k(!1), y(!0);
2625
- }, []), $ = U((x) => {
2626
- const _ = v.current;
2627
- if (!_) return 0;
2628
- const z = _.getBoundingClientRect();
2376
+ const h = be(s), f = J(null), v = J(null), a = J(null), y = J(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, _] = A(!1), [N, F] = A(!0), [H, D] = A(null), B = G(() => {
2377
+ T(!1), C(!0);
2378
+ }, []), S = G((g) => {
2379
+ const p = v.current;
2380
+ if (!p) return 0;
2381
+ const R = p.getBoundingClientRect();
2629
2382
  return Math.max(
2630
2383
  0,
2631
- Math.min(1, (Wn(x) - z.left) / z.width)
2384
+ Math.min(1, (Bn(g) - R.left) / R.width)
2632
2385
  );
2633
- }, []), P = U((x) => {
2634
- const _ = f.current;
2635
- _ && _.duration && (_.currentTime = x * _.duration);
2636
- }, []), W = (x) => {
2637
- x.stopPropagation(), E(!0);
2638
- const _ = $(x);
2639
- S(_), P(_);
2386
+ }, []), $ = G((g) => {
2387
+ const p = f.current;
2388
+ p && p.duration && (p.currentTime = g * p.duration);
2389
+ }, []), V = (g) => {
2390
+ g.stopPropagation(), E(!0);
2391
+ const p = S(g);
2392
+ I(p), $(p);
2640
2393
  };
2641
- K(() => {
2642
- o !== void 0 && o !== C.current && (C.current = o, y(o));
2643
- }, [o]), K(() => {
2644
- if (!g) {
2394
+ Z(() => {
2395
+ o !== void 0 && o !== y.current && (y.current = o, C(o));
2396
+ }, [o]), Z(() => {
2397
+ if (!b) {
2645
2398
  a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
2646
2399
  return;
2647
2400
  }
2648
- const x = () => {
2649
- const _ = f.current;
2650
- _ && _.duration && !w && S(_.currentTime / _.duration), a.current = requestAnimationFrame(x);
2401
+ const g = () => {
2402
+ const p = f.current;
2403
+ p && p.duration && !w && I(p.currentTime / p.duration), a.current = requestAnimationFrame(g);
2651
2404
  };
2652
- return a.current = requestAnimationFrame(x), () => {
2405
+ return a.current = requestAnimationFrame(g), () => {
2653
2406
  a.current !== null && cancelAnimationFrame(a.current);
2654
2407
  };
2655
- }, [g, w]), K(() => {
2656
- const x = f.current;
2657
- x && (g ? x.play().catch((_) => {
2658
- y(!1), k(!0);
2659
- }) : x.pause());
2660
- }, [g]), K(() => {
2408
+ }, [b, w]), Z(() => {
2409
+ const g = f.current;
2410
+ g && (b ? g.play().catch((p) => {
2411
+ C(!1), T(!0);
2412
+ }) : g.pause());
2413
+ }, [b]), Z(() => {
2661
2414
  if (!w) return;
2662
- const x = (z) => S($(z)), _ = (z) => {
2663
- E(!1), P($(z));
2415
+ const g = (R) => I(S(R)), p = (R) => {
2416
+ E(!1), $(S(R));
2664
2417
  };
2665
- return window.addEventListener("mousemove", x), window.addEventListener("mouseup", _), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", _), () => {
2666
- window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", _), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", _);
2418
+ return window.addEventListener("mousemove", g), window.addEventListener("mouseup", p), window.addEventListener("touchmove", g, { passive: !0 }), window.addEventListener("touchend", p), () => {
2419
+ window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", p), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", p);
2667
2420
  };
2668
- }, [w, $, P]);
2669
- const Z = B ? { aspectRatio: String(B) } : void 0, ae = B ? "" : " aspect-video", J = Math.round(p * 100);
2421
+ }, [w, S, $]);
2422
+ const ee = H ? { aspectRatio: String(H) } : void 0, te = H ? "" : " aspect-video", W = Math.round(x * 100);
2670
2423
  return /* @__PURE__ */ d(
2671
2424
  "div",
2672
2425
  {
2673
2426
  role: "button",
2674
2427
  tabIndex: 0,
2675
- className: `relative cursor-pointer overflow-hidden bg-black ${ae}`,
2676
- style: Z,
2677
- onClick: (x) => {
2428
+ className: `relative cursor-pointer overflow-hidden bg-black ${te}`,
2429
+ style: ee,
2430
+ onClick: (g) => {
2678
2431
  if (u) {
2679
- u(x);
2432
+ u(g);
2680
2433
  return;
2681
2434
  }
2682
- b || i && y((_) => !_);
2435
+ k || i && C((p) => !p);
2683
2436
  },
2684
- onKeyDown: (x) => {
2685
- if (!(x.key !== "Enter" && x.key !== " ")) {
2686
- if (x.preventDefault(), u) {
2687
- u(x);
2437
+ onKeyDown: (g) => {
2438
+ if (!(g.key !== "Enter" && g.key !== " ")) {
2439
+ if (g.preventDefault(), u) {
2440
+ u(g);
2688
2441
  return;
2689
2442
  }
2690
- b || i && y((_) => !_);
2443
+ k || i && C((p) => !p);
2691
2444
  }
2692
2445
  },
2693
2446
  children: [
2694
- n && (m === "audio" || L) && /* @__PURE__ */ e(
2447
+ n && (h === "audio" || N) && /* @__PURE__ */ e(
2695
2448
  "img",
2696
2449
  {
2697
2450
  src: n,
@@ -2699,26 +2452,26 @@ const Wn = (t) => {
2699
2452
  className: "absolute inset-0 h-full w-full object-cover"
2700
2453
  }
2701
2454
  ),
2702
- !n && (m === "audio" || L) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: Te(s, {
2455
+ !n && (h === "audio" || N) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(s, {
2703
2456
  className: "size-12 text-black/20",
2704
2457
  weight: "regular"
2705
2458
  }) }),
2706
- /* @__PURE__ */ e("div", { className: "absolute inset-0", children: m === "audio" ? /* @__PURE__ */ e(
2459
+ /* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
2707
2460
  "audio",
2708
2461
  {
2709
2462
  ref: f,
2710
2463
  src: t,
2711
2464
  loop: l,
2712
- muted: h,
2465
+ muted: m,
2713
2466
  style: { width: "100%", height: "100%" },
2714
- onLoadStart: () => I(!0),
2467
+ onLoadStart: () => _(!0),
2715
2468
  onCanPlay: () => {
2716
- I(!1), T(!1);
2469
+ _(!1), F(!1);
2717
2470
  },
2718
- onWaiting: () => I(!0),
2719
- onPlay: () => k(!1),
2471
+ onWaiting: () => _(!0),
2472
+ onPlay: () => T(!1),
2720
2473
  onEnded: () => {
2721
- l || (y(!1), S(0));
2474
+ l || (C(!1), I(0));
2722
2475
  },
2723
2476
  children: /* @__PURE__ */ e("track", { kind: "captions" })
2724
2477
  }
@@ -2728,46 +2481,46 @@ const Wn = (t) => {
2728
2481
  ref: f,
2729
2482
  src: t,
2730
2483
  loop: l,
2731
- muted: h,
2484
+ muted: m,
2732
2485
  playsInline: !0,
2733
2486
  style: { width: "100%", height: "100%" },
2734
- onLoadStart: () => I(!0),
2487
+ onLoadStart: () => _(!0),
2735
2488
  onCanPlay: () => {
2736
- I(!1), T(!1);
2489
+ _(!1), F(!1);
2737
2490
  },
2738
- onWaiting: () => I(!0),
2739
- onPlay: () => k(!1),
2491
+ onWaiting: () => _(!0),
2492
+ onPlay: () => T(!1),
2740
2493
  onLoadedMetadata: () => {
2741
- const x = f.current;
2742
- x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && O(x.videoWidth / x.videoHeight);
2494
+ const g = f.current;
2495
+ g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && D(g.videoWidth / g.videoHeight);
2743
2496
  },
2744
2497
  onEnded: () => {
2745
- l || (y(!1), S(0));
2498
+ l || (C(!1), I(0));
2746
2499
  },
2747
2500
  children: /* @__PURE__ */ e("track", { kind: "captions" })
2748
2501
  }
2749
2502
  ) }),
2750
- R && !b && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
2751
- pt,
2503
+ M && !k && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
2504
+ ft,
2752
2505
  {
2753
2506
  className: "size-8 animate-spin text-white/80",
2754
2507
  weight: "bold"
2755
2508
  }
2756
2509
  ) }),
2757
- b && !i && /* @__PURE__ */ e(
2510
+ k && !i && /* @__PURE__ */ e(
2758
2511
  "div",
2759
2512
  {
2760
2513
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
2761
2514
  role: "button",
2762
2515
  tabIndex: 0,
2763
2516
  "aria-label": "Play preview",
2764
- onClick: (x) => {
2765
- x.stopPropagation(), G();
2517
+ onClick: (g) => {
2518
+ g.stopPropagation(), B();
2766
2519
  },
2767
- onKeyDown: (x) => {
2768
- x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), G());
2520
+ onKeyDown: (g) => {
2521
+ g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), B());
2769
2522
  },
2770
- children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(rt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
2523
+ children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
2771
2524
  }
2772
2525
  ),
2773
2526
  c && !i && /* @__PURE__ */ e("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__ */ e(
@@ -2775,23 +2528,23 @@ const Wn = (t) => {
2775
2528
  {
2776
2529
  role: "slider",
2777
2530
  "aria-label": "Playback position",
2778
- "aria-valuenow": J,
2531
+ "aria-valuenow": W,
2779
2532
  "aria-valuemin": 0,
2780
2533
  "aria-valuemax": 100,
2781
2534
  tabIndex: 0,
2782
2535
  ref: v,
2783
2536
  className: "relative flex h-4 w-full cursor-pointer items-center",
2784
- onMouseDown: W,
2785
- onTouchStart: W,
2786
- onClick: (x) => x.stopPropagation(),
2787
- onKeyDown: (x) => {
2788
- x.key === "ArrowRight" && P(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, p - 0.05));
2537
+ onMouseDown: V,
2538
+ onTouchStart: V,
2539
+ onClick: (g) => g.stopPropagation(),
2540
+ onKeyDown: (g) => {
2541
+ g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
2789
2542
  },
2790
2543
  children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
2791
2544
  "div",
2792
2545
  {
2793
2546
  className: "h-full rounded-full bg-white",
2794
- style: { width: `${J}%` }
2547
+ style: { width: `${W}%` }
2795
2548
  }
2796
2549
  ) })
2797
2550
  }
@@ -2801,12 +2554,12 @@ const Wn = (t) => {
2801
2554
  "button",
2802
2555
  {
2803
2556
  type: "button",
2804
- onClick: (x) => {
2805
- x.stopPropagation(), y((_) => !_);
2557
+ onClick: (g) => {
2558
+ g.stopPropagation(), C((p) => !p);
2806
2559
  },
2807
2560
  className: "shrink-0 text-white",
2808
- "aria-label": g ? "Pause" : "Play",
2809
- children: g ? /* @__PURE__ */ e(Os, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(rt, { className: "size-5 translate-x-px", weight: "fill" })
2561
+ "aria-label": b ? "Pause" : "Play",
2562
+ children: b ? /* @__PURE__ */ e(Ms, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
2810
2563
  }
2811
2564
  ),
2812
2565
  /* @__PURE__ */ d(
@@ -2814,30 +2567,30 @@ const Wn = (t) => {
2814
2567
  {
2815
2568
  role: "slider",
2816
2569
  "aria-label": "Playback position",
2817
- "aria-valuenow": J,
2570
+ "aria-valuenow": W,
2818
2571
  "aria-valuemin": 0,
2819
2572
  "aria-valuemax": 100,
2820
2573
  tabIndex: 0,
2821
2574
  ref: v,
2822
2575
  className: "relative flex h-4 w-full cursor-pointer items-center",
2823
- onMouseDown: W,
2824
- onTouchStart: W,
2825
- onClick: (x) => x.stopPropagation(),
2826
- onMouseEnter: () => N(!0),
2827
- onMouseLeave: () => N(!1),
2828
- onKeyDown: (x) => {
2829
- x.key === "ArrowRight" && P(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, p - 0.05));
2576
+ onMouseDown: V,
2577
+ onTouchStart: V,
2578
+ onClick: (g) => g.stopPropagation(),
2579
+ onMouseEnter: () => U(!0),
2580
+ onMouseLeave: () => U(!1),
2581
+ onKeyDown: (g) => {
2582
+ g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
2830
2583
  },
2831
2584
  children: [
2832
2585
  /* @__PURE__ */ e(
2833
2586
  "div",
2834
2587
  {
2835
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${F || w ? "h-1.5" : "h-1"}`,
2588
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || w ? "h-1.5" : "h-1"}`,
2836
2589
  children: /* @__PURE__ */ e(
2837
2590
  "div",
2838
2591
  {
2839
2592
  className: "h-full rounded-full bg-white",
2840
- style: { width: `${J}%` }
2593
+ style: { width: `${W}%` }
2841
2594
  }
2842
2595
  )
2843
2596
  }
@@ -2845,8 +2598,8 @@ const Wn = (t) => {
2845
2598
  /* @__PURE__ */ e(
2846
2599
  "div",
2847
2600
  {
2848
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${F || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2849
- style: { left: `${J}%` }
2601
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2602
+ style: { left: `${W}%` }
2850
2603
  }
2851
2604
  )
2852
2605
  ]
@@ -2856,7 +2609,7 @@ const Wn = (t) => {
2856
2609
  ]
2857
2610
  }
2858
2611
  );
2859
- }, ut = (t) => t === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Xn = (t) => t === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Dt = ({
2612
+ }, it = (t) => t === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", $n = (t) => t === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Et = ({
2860
2613
  mimeType: t,
2861
2614
  sourceUrl: s,
2862
2615
  thumbnailUrl: n,
@@ -2865,9 +2618,9 @@ const Wn = (t) => {
2865
2618
  mediaPlayerProps: l,
2866
2619
  containedImage: i = !1
2867
2620
  }) => {
2868
- const c = Re(t), [h, u] = M(!1);
2621
+ const c = be(t), [m, u] = A(!1);
2869
2622
  return s && (c === "video" || c === "audio") ? /* @__PURE__ */ e(
2870
- qn,
2623
+ zn,
2871
2624
  {
2872
2625
  source: s,
2873
2626
  mimeType: t,
@@ -2880,7 +2633,7 @@ const Wn = (t) => {
2880
2633
  {
2881
2634
  src: s,
2882
2635
  alt: r ?? "",
2883
- className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${h ? "opacity-100" : "opacity-0"}`,
2636
+ className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
2884
2637
  draggable: !1,
2885
2638
  onLoad: () => u(!0)
2886
2639
  }
@@ -2897,7 +2650,7 @@ const Wn = (t) => {
2897
2650
  {
2898
2651
  src: n,
2899
2652
  alt: r ?? "",
2900
- className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${h ? "opacity-100" : "opacity-0"}`,
2653
+ className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
2901
2654
  draggable: !1,
2902
2655
  onLoad: () => u(!0)
2903
2656
  }
@@ -2913,12 +2666,12 @@ const Wn = (t) => {
2913
2666
  "div",
2914
2667
  {
2915
2668
  className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
2916
- children: Te(t, {
2917
- className: ut(o),
2669
+ children: ge(t, {
2670
+ className: it(o),
2918
2671
  weight: "regular"
2919
2672
  })
2920
2673
  }
2921
- ) : n ? /* @__PURE__ */ e("div", { className: `relative ${Xn(o)}`, children: /* @__PURE__ */ e(
2674
+ ) : n ? /* @__PURE__ */ e("div", { className: `relative ${$n(o)}`, children: /* @__PURE__ */ e(
2922
2675
  "img",
2923
2676
  {
2924
2677
  src: n,
@@ -2930,13 +2683,13 @@ const Wn = (t) => {
2930
2683
  "div",
2931
2684
  {
2932
2685
  className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
2933
- children: Te(t, {
2934
- className: ut(o),
2686
+ children: ge(t, {
2687
+ className: it(o),
2935
2688
  weight: "regular"
2936
2689
  })
2937
2690
  }
2938
2691
  );
2939
- }, Rt = ({
2692
+ }, St = ({
2940
2693
  variant: t,
2941
2694
  thumbnail: s,
2942
2695
  title: n,
@@ -2945,40 +2698,40 @@ const Wn = (t) => {
2945
2698
  detail: l,
2946
2699
  statusBadge: i,
2947
2700
  action: c,
2948
- topLeft: h,
2701
+ topLeft: m,
2949
2702
  topRight: u,
2950
- rootRef: m,
2703
+ rootRef: h,
2951
2704
  "data-testid": f
2952
2705
  }) => {
2953
- const v = t === "dark", a = v ? n ?? r : n ?? "", C = v && !n;
2706
+ const v = t === "dark", a = v ? n ?? r : n ?? "", y = v && !n;
2954
2707
  return /* @__PURE__ */ d(
2955
2708
  "div",
2956
2709
  {
2957
- ref: m,
2710
+ ref: h,
2958
2711
  "data-testid": f,
2959
- className: A(
2712
+ className: L(
2960
2713
  "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)]",
2961
2714
  v ? "bg-[#121110]" : "bg-white"
2962
2715
  ),
2963
2716
  children: [
2964
- h ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: h }) : null,
2717
+ m ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: m }) : null,
2965
2718
  u ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
2966
2719
  s,
2967
2720
  /* @__PURE__ */ d("div", { className: "px-4 pb-3 pt-3", children: [
2968
- /* @__PURE__ */ e(
2721
+ a.trim() !== "" && /* @__PURE__ */ e(
2969
2722
  "p",
2970
2723
  {
2971
- className: A("mb-0.5 truncate text-base font-medium", {
2724
+ className: L("mb-0.5 truncate text-base font-medium", {
2972
2725
  "text-black": !v,
2973
- "text-white/30": v && C,
2974
- "text-white": v && !C
2726
+ "text-white/30": v && y,
2727
+ "text-white": v && !y
2975
2728
  }),
2976
2729
  children: a
2977
2730
  }
2978
2731
  ),
2979
2732
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
2980
- Te(o, {
2981
- className: A(
2733
+ ge(o, {
2734
+ className: L(
2982
2735
  "size-5 shrink-0",
2983
2736
  v ? "text-white/55" : "text-black/55"
2984
2737
  ),
@@ -2987,7 +2740,7 @@ const Wn = (t) => {
2987
2740
  l != null && l !== "" && /* @__PURE__ */ e(
2988
2741
  "span",
2989
2742
  {
2990
- className: A(
2743
+ className: L(
2991
2744
  "text-xs font-medium",
2992
2745
  v ? "text-white/55" : "text-black/55"
2993
2746
  ),
@@ -3002,30 +2755,29 @@ const Wn = (t) => {
3002
2755
  }
3003
2756
  );
3004
2757
  };
3005
- function Lt(t) {
2758
+ function It(t) {
3006
2759
  return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
3007
2760
  }
3008
- function qe(t) {
2761
+ function Re(t) {
3009
2762
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
3010
2763
  }
3011
- function Zn(t) {
2764
+ function jn(t) {
3012
2765
  return t ? "bg-white/10" : "bg-black/5";
3013
2766
  }
3014
- function Kn(t) {
2767
+ function Gn(t) {
3015
2768
  return t ? "text-white" : "text-black";
3016
2769
  }
3017
- function Jn(t) {
2770
+ function Vn(t) {
3018
2771
  return t ? "text-white/55" : "text-black/55";
3019
2772
  }
3020
- function Qn(t) {
2773
+ function Hn(t) {
3021
2774
  return t ? "text-white/40" : "text-black/40";
3022
2775
  }
3023
- function ea(t) {
2776
+ function Yn(t) {
3024
2777
  return t ? "text-white/20" : "text-black/20";
3025
2778
  }
3026
- const Xe = ({ attachment: t, isMyMessage: s }) => {
3027
- const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i;
3028
- return /* @__PURE__ */ d("a", { href: c, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: [
2779
+ const Le = ({ attachment: t, isMyMessage: s }) => {
2780
+ const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i, m = typeof c == "string" && c.trim() !== "" ? c : void 0, u = /* @__PURE__ */ d(O.Fragment, { children: [
3029
2781
  /* @__PURE__ */ e("div", { className: "p-2", children: o ? /* @__PURE__ */ e(
3030
2782
  "img",
3031
2783
  {
@@ -3036,24 +2788,25 @@ const Xe = ({ attachment: t, isMyMessage: s }) => {
3036
2788
  ) : /* @__PURE__ */ e(
3037
2789
  "div",
3038
2790
  {
3039
- className: `aspect-video w-full rounded-[20px] ${Zn(s)} flex items-center justify-center`,
3040
- children: /* @__PURE__ */ e(Us, { className: `size-12 ${ea(s)}` })
2791
+ className: `aspect-video w-full rounded-[20px] ${jn(s)} flex items-center justify-center`,
2792
+ children: /* @__PURE__ */ e(Ts, { className: `size-12 ${Yn(s)}` })
3041
2793
  }
3042
2794
  ) }),
3043
2795
  /* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
3044
- n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Kn(s)}`, children: n }),
3045
- r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${Jn(s)}`, children: r }),
3046
- c && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Qn(s)}`, children: c })
2796
+ n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Gn(s)}`, children: n }),
2797
+ r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${Vn(s)}`, children: r }),
2798
+ m && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Hn(s)}`, children: m })
3047
2799
  ] })
3048
2800
  ] });
2801
+ return m ? /* @__PURE__ */ e("a", { href: m, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ e("div", { className: "block", children: u });
3049
2802
  };
3050
- function Ze(t) {
2803
+ function Ae(t) {
3051
2804
  var s;
3052
2805
  return (s = t.attachments) == null ? void 0 : s.find(
3053
- (n) => n.type === "link" || n.og_scrape_url != null && !n.asset_url
2806
+ (n) => n.type === "link" || !!n.og_scrape_url && !n.asset_url
3054
2807
  );
3055
2808
  }
3056
- async function ta(t, s) {
2809
+ async function Wn(t, s) {
3057
2810
  let n;
3058
2811
  try {
3059
2812
  n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
@@ -3065,11 +2818,11 @@ async function ta(t, s) {
3065
2818
  const o = await r.blob(), l = URL.createObjectURL(o), i = document.createElement("a");
3066
2819
  i.href = l, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(l);
3067
2820
  }
3068
- const sa = ({
2821
+ const qn = ({
3069
2822
  url: t,
3070
2823
  filename: s
3071
2824
  }) => {
3072
- const [n, r] = M(!1);
2825
+ const [n, r] = A(!1);
3073
2826
  return /* @__PURE__ */ e(
3074
2827
  "button",
3075
2828
  {
@@ -3077,7 +2830,7 @@ const sa = ({
3077
2830
  onClick: (l) => {
3078
2831
  l.stopPropagation();
3079
2832
  const i = window.open("", "_blank", "noopener,noreferrer");
3080
- r(!0), ta(t, s).then(() => {
2833
+ r(!0), Wn(t, s).then(() => {
3081
2834
  i == null || i.close();
3082
2835
  }).catch(() => {
3083
2836
  i && (i.location.href = t);
@@ -3085,51 +2838,52 @@ const sa = ({
3085
2838
  },
3086
2839
  disabled: n,
3087
2840
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
3088
- children: n ? /* @__PURE__ */ e(pt, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(j.Fragment, { children: [
3089
- /* @__PURE__ */ e($s, { className: "size-4 text-white", weight: "bold" }),
2841
+ children: n ? /* @__PURE__ */ e(ft, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
2842
+ /* @__PURE__ */ e(Ds, { className: "size-4 text-white", weight: "bold" }),
3090
2843
  "Download"
3091
2844
  ] })
3092
2845
  }
3093
2846
  );
3094
2847
  };
3095
- function Ke(t) {
3096
- var f, v, a, C;
2848
+ function Fe(t) {
2849
+ var f, v, a, y;
3097
2850
  const s = (f = t.attachments) == null ? void 0 : f.find(
3098
- (g) => g.type === "video" && g.asset_url
2851
+ (b) => b.type === "video" && b.asset_url
3099
2852
  ), n = (v = t.attachments) == null ? void 0 : v.find(
3100
- (g) => g.type === "image" && g.image_url
2853
+ (b) => b.type === "image" && b.image_url
3101
2854
  ), r = (a = t.attachments) == null ? void 0 : a.find(
3102
- (g) => g.type === "audio" && g.asset_url
3103
- ), o = (C = t.attachments) == null ? void 0 : C.find(
3104
- (g) => g.type === "file" && g.asset_url
2855
+ (b) => b.type === "audio" && b.asset_url
2856
+ ), o = (y = t.attachments) == null ? void 0 : y.find(
2857
+ (b) => b.type === "file" && b.asset_url
3105
2858
  ), l = s ?? n ?? r ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (r == null ? void 0 : r.asset_url) ?? (o == null ? void 0 : o.asset_url);
3106
2859
  if (!i) return null;
3107
- const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), h = l == null ? void 0 : l.title, u = l == null ? void 0 : l.file_size, m = s == null ? void 0 : s.thumb_url;
2860
+ const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), m = l == null ? void 0 : l.title, u = l == null ? void 0 : l.file_size, h = s == null ? void 0 : s.thumb_url;
3108
2861
  return {
3109
2862
  resolvedUrl: i,
3110
2863
  resolvedType: c,
3111
- title: h,
2864
+ title: m,
3112
2865
  fileSize: u,
3113
- thumbnailUrl: m
2866
+ thumbnailUrl: h
3114
2867
  };
3115
2868
  }
3116
- const Pt = ({
2869
+ const kt = ({
3117
2870
  resolvedUrl: t,
3118
2871
  resolvedType: s,
3119
2872
  title: n,
3120
2873
  fileSize: r,
3121
2874
  thumbnailUrl: o
3122
2875
  }) => {
3123
- const l = r !== void 0 ? Lt(r) : void 0;
2876
+ const l = r !== void 0 ? It(r) : void 0;
3124
2877
  return /* @__PURE__ */ e(
3125
- Rt,
2878
+ St,
3126
2879
  {
3127
2880
  variant: "dark",
3128
2881
  title: n,
2882
+ placeholderTitle: "",
3129
2883
  mimeType: s,
3130
2884
  detail: l,
3131
2885
  thumbnail: /* @__PURE__ */ e(
3132
- Dt,
2886
+ Et,
3133
2887
  {
3134
2888
  mimeType: s,
3135
2889
  sourceUrl: t,
@@ -3140,23 +2894,23 @@ const Pt = ({
3140
2894
  )
3141
2895
  }
3142
2896
  );
3143
- }, At = ({
2897
+ }, Mt = ({
3144
2898
  resolvedUrl: t,
3145
2899
  resolvedType: s,
3146
2900
  title: n,
3147
2901
  fileSize: r,
3148
2902
  thumbnailUrl: o
3149
2903
  }) => {
3150
- const l = Re(s), i = r !== void 0 ? Lt(r) : void 0;
2904
+ const l = be(s), i = r !== void 0 ? It(r) : void 0;
3151
2905
  return /* @__PURE__ */ e(
3152
- Rt,
2906
+ St,
3153
2907
  {
3154
2908
  variant: "light",
3155
2909
  title: n,
3156
2910
  mimeType: s,
3157
2911
  detail: i,
3158
2912
  thumbnail: /* @__PURE__ */ e(
3159
- Dt,
2913
+ Et,
3160
2914
  {
3161
2915
  mimeType: s,
3162
2916
  sourceUrl: t,
@@ -3166,14 +2920,14 @@ const Pt = ({
3166
2920
  containedImage: l === "image" || l === "document"
3167
2921
  }
3168
2922
  ),
3169
- action: /* @__PURE__ */ e(sa, { url: t, filename: n })
2923
+ action: /* @__PURE__ */ e(qn, { url: t, filename: n })
3170
2924
  }
3171
2925
  );
3172
- }, na = ({
2926
+ }, Xn = ({
3173
2927
  message: t,
3174
2928
  isMyMessage: s = !1
3175
2929
  }) => {
3176
- const n = Ze(t), r = Ke(t);
2930
+ const n = Ae(t), r = Fe(t);
3177
2931
  return !n && !r ? null : /* @__PURE__ */ d("div", { className: s ? "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: [
3178
2932
  !s && t.user && /* @__PURE__ */ e(
3179
2933
  ne,
@@ -3194,95 +2948,53 @@ const Pt = ({
3194
2948
  {
3195
2949
  className: "str-chat__message-bubble",
3196
2950
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
3197
- children: n ? /* @__PURE__ */ e("div", { className: qe(s), children: /* @__PURE__ */ e(Xe, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ e(Pt, { ...r }) : /* @__PURE__ */ e(At, { ...r })
2951
+ children: n ? /* @__PURE__ */ e("div", { className: Re(s), children: /* @__PURE__ */ e(Le, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ e(kt, { ...r }) : /* @__PURE__ */ e(Mt, { ...r })
3198
2952
  }
3199
2953
  ) })
3200
2954
  }
3201
2955
  )
3202
2956
  ] });
3203
- }, aa = ({
2957
+ }, Zn = ({
3204
2958
  message: t
3205
2959
  }) => {
3206
- const s = Ze(t);
2960
+ const s = Ae(t);
3207
2961
  if (s)
3208
- return /* @__PURE__ */ e("div", { className: qe(!0), children: /* @__PURE__ */ e(Xe, { attachment: s, isMyMessage: !0 }) });
3209
- const n = Ke(t);
3210
- return n ? /* @__PURE__ */ e(Pt, { ...n }) : null;
3211
- }, ra = ({
2962
+ return /* @__PURE__ */ e("div", { className: Re(!0), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !0 }) });
2963
+ const n = Fe(t);
2964
+ return n ? /* @__PURE__ */ e(kt, { ...n }) : null;
2965
+ }, Jn = ({
3212
2966
  message: t
3213
2967
  }) => {
3214
- const s = Ze(t);
2968
+ const s = Ae(t);
3215
2969
  if (s)
3216
- return /* @__PURE__ */ e("div", { className: qe(!1), children: /* @__PURE__ */ e(Xe, { attachment: s, isMyMessage: !1 }) });
3217
- const n = Ke(t);
3218
- return n ? /* @__PURE__ */ e(At, { ...n }) : null;
3219
- }, xa = Object.assign(na, {
3220
- Creator: aa,
3221
- Visitor: ra
3222
- }), pa = (t, s = {}) => {
3223
- const { initialSearch: n = "", pageSize: r = 20 } = s, [o, l] = M([]), [i, c] = M(!1), [h, u] = M(null), [m, f] = M(n), [v, a] = M(!0), [C, g] = M(), y = U(async (E = !1, F) => {
3224
- if (i) return;
3225
- const N = F !== void 0 ? F : m;
3226
- c(!0), u(null);
3227
- try {
3228
- const b = await t.loadParticipants({
3229
- search: N || void 0,
3230
- limit: r,
3231
- cursor: E ? void 0 : C
3232
- });
3233
- l(
3234
- (k) => E ? b.participants : [...k, ...b.participants]
3235
- ), a(b.hasMore), g(b.nextCursor);
3236
- } catch (b) {
3237
- const k = b instanceof Error ? b.message : "Failed to load participants";
3238
- u(k), console.error("[useParticipants] Load error:", b);
3239
- } finally {
3240
- c(!1);
3241
- }
3242
- }, [t, m, C, r, i]), p = U(() => {
3243
- v && !i && y(!1);
3244
- }, [v, i, y]), S = U((E) => {
3245
- f(E), g(void 0), y(!0, E);
3246
- }, [y]), w = U(() => {
3247
- g(void 0), y(!0);
3248
- }, [y]);
3249
- return K(() => {
3250
- y(!0);
3251
- }, [t.loadParticipants]), {
3252
- participants: o,
3253
- loading: i,
3254
- error: h,
3255
- searchQuery: m,
3256
- hasMore: v,
3257
- totalCount: t.totalCount,
3258
- loadMore: p,
3259
- search: S,
3260
- refresh: w
3261
- };
3262
- };
2970
+ return /* @__PURE__ */ e("div", { className: Re(!1), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !1 }) });
2971
+ const n = Fe(t);
2972
+ return n ? /* @__PURE__ */ e(Mt, { ...n }) : null;
2973
+ }, ca = Object.assign(Xn, {
2974
+ Creator: Zn,
2975
+ Visitor: Jn
2976
+ });
3263
2977
  export {
3264
- Rt as A,
3265
- Pn as C,
3266
- ba as F,
3267
- lt as L,
3268
- xa as M,
3269
- $n as P,
3270
- Dt as a,
3271
- ke as b,
2978
+ St as A,
2979
+ kn as C,
2980
+ la as F,
2981
+ nt as L,
2982
+ ca as M,
2983
+ Et as a,
2984
+ me as b,
3272
2985
  ne as c,
3273
- _t as d,
3274
- Mt as e,
3275
- fa as f,
3276
- jn as g,
3277
- fn as h,
3278
- ha as i,
3279
- ga as j,
3280
- Hs as k,
3281
- Ke as l,
3282
- nn as m,
3283
- zs as n,
3284
- pa as o,
3285
- Ze as r,
3286
- un as u
2986
+ wt as d,
2987
+ yt as e,
2988
+ ia as f,
2989
+ Ln as g,
2990
+ ln as h,
2991
+ ra as i,
2992
+ oa as j,
2993
+ Ps as k,
2994
+ Fe as l,
2995
+ Js as m,
2996
+ Rs as n,
2997
+ Ae as r,
2998
+ an as u
3287
2999
  };
3288
- //# sourceMappingURL=index-jnKl3mQ0.js.map
3000
+ //# sourceMappingURL=index-j4j9UfK1.js.map