@linktr.ee/messaging-react 1.13.1 → 1.14.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.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as o, Fragment as ve } from "react/jsx-runtime";
2
- import p from "classnames";
3
- import U, { createContext as Pe, useContext as Oe, useCallback as M, useState as y, useRef as z, useEffect as G } from "react";
4
- import { StreamChatService as je } from "@linktr.ee/messaging-core";
5
- import { Chat as Ae, ChannelList as ze, DateSeparator as Be, useMessageComposer as $e, useStateStore as Ge, MessageInput as He, useMessageInputContext as Ve, useMessageComposerHasSendableData as We, SimpleAttachmentSelector as Ze, QuotedMessagePreview as qe, AttachmentPreviewList as Ye, TextareaComposer as Je, MessageTimestamp as Qe, Channel as Xe, useChannelStateContext as we, Window as Ke, MessageList as es } from "stream-chat-react";
6
- import { XIcon as me, ArrowUpIcon as ss, ArrowLeftIcon as fe, DotsThreeIcon as ge, SpinnerGapIcon as re, SignOutIcon as ts, ProhibitInsetIcon as xe, FlagIcon as ns, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as be } from "stream-chat";
8
- const ye = Pe({
1
+ import { jsx as e, jsxs as i, Fragment as Ne } from "react/jsx-runtime";
2
+ import S from "classnames";
3
+ import P, { createContext as $e, useContext as je, useCallback as D, useState as y, useRef as W, useEffect as q, useMemo as we } from "react";
4
+ import { StreamChatService as ze } from "@linktr.ee/messaging-core";
5
+ import { Chat as Ge, ChannelList as He, DateSeparator as Ve, areMessageUIPropsEqual as We, useChatContext as Ze, useTranslationContext as qe, useMessageReminder as Ye, useComponentContext as Je, Attachment as Qe, Avatar as Xe, EditMessageModal as Ke, MessageOptions as es, MessageBlocked as ss, MessageBouncePrompt as ts, MessageDeleted as ns, MessageIsThreadReplyInChannelButtonIndicator as rs, MessageRepliesCountButton as as, MessageStatus as ls, MessageTimestamp as ke, ReactionsList as os, ReminderNotification as is, StreamedMessageText as cs, messageHasAttachments as ds, messageHasReactions as ms, isDateSeparatorMessage as us, isMessageBlocked as hs, isMessageBounced as fs, isMessageEdited as gs, MessageBounceModal as xs, Poll as Cs, MessageText as Ns, MessageErrorIcon as bs, MessageEditedTimestamp as vs, useMessageContext as ws, useMessageComposer as ps, useStateStore as ys, MessageInput as Es, useMessageInputContext as Is, useMessageComposerHasSendableData as _s, SimpleAttachmentSelector as Ss, QuotedMessagePreview as Ms, AttachmentPreviewList as ks, TextareaComposer as Rs, Channel as Ts, useChannelStateContext as Re, WithComponents as Ds, Window as Fs, MessageList as Ls } from "stream-chat-react";
6
+ import { XIcon as be, GiftIcon as Os, ArrowUpIcon as Ps, ArrowLeftIcon as pe, DotsThreeIcon as ye, SpinnerGapIcon as ue, SignOutIcon as Us, ProhibitInsetIcon as Ee, FlagIcon as Bs, MagnifyingGlassIcon as As, ChatCircleDotsIcon as Ie } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as _e } from "stream-chat";
8
+ const Te = $e({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,50 +15,50 @@ const ye = Pe({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), oe = () => Oe(ye), Ts = ({
18
+ }), ge = () => je(Te), pt = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
- capabilities: a = {},
24
- debug: i = !1
23
+ capabilities: o = {},
24
+ debug: c = !1
25
25
  }) => {
26
- const l = M(
27
- (u, ...b) => {
28
- i && console.log(`🔥 [MessagingProvider] ${u}`, ...b);
26
+ const a = D(
27
+ (h, ...v) => {
28
+ c && console.log(`🔥 [MessagingProvider] ${h}`, ...v);
29
29
  },
30
- [i]
30
+ [c]
31
31
  );
32
- l("🔄 RENDER START", {
32
+ a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
34
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
- capabilities: Object.keys(a)
36
+ capabilities: Object.keys(o)
37
37
  });
38
- const [m, h] = y(null), [g, w] = y(null), [f, S] = y(!1), [_, v] = y(!1), [c, N] = y(null), E = z(!1), I = z({
38
+ const [u, g] = y(null), [x, w] = y(null), [f, l] = y(!1), [T, p] = y(!1), [d, N] = y(null), E = W(!1), I = W({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
- capabilities: a
43
- }), k = z(0);
44
- k.current++, l("📊 RENDER INFO", {
45
- renderCount: k.current,
42
+ capabilities: o
43
+ }), _ = W(0);
44
+ _.current++, a("📊 RENDER INFO", {
45
+ renderCount: _.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
49
  apiKeyChanged: I.current.apiKey !== r,
50
50
  serviceConfigChanged: I.current.serviceConfig !== n,
51
- capabilitiesChanged: I.current.capabilities !== a
51
+ capabilitiesChanged: I.current.capabilities !== o
52
52
  }
53
53
  }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
- capabilities: a
58
- }, G(() => {
59
- const u = k.current;
60
- if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: u,
57
+ capabilities: o
58
+ }, q(() => {
59
+ const h = _.current;
60
+ if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
+ renderCount: h,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
@@ -68,166 +68,166 @@ const ye = Pe({
68
68
  apiKeyStable: I.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
- l("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: u,
71
+ a("⚠️ SERVICE INIT SKIPPED", {
72
+ renderCount: h,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- l("🚀 CREATING NEW SERVICE", {
78
- renderCount: u,
77
+ a("🚀 CREATING NEW SERVICE", {
78
+ renderCount: h,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const b = new je({
82
+ const v = new ze({
83
83
  ...n,
84
84
  apiKey: r,
85
- debug: i
85
+ debug: c
86
86
  });
87
- return h(b), l("✅ SERVICE SET", {
88
- renderCount: u,
89
- serviceInstance: !!b
87
+ return g(v), a("✅ SERVICE SET", {
88
+ renderCount: h,
89
+ serviceInstance: !!v
90
90
  }), () => {
91
- l("🧹 SERVICE CLEANUP", {
92
- renderCount: u,
91
+ a("🧹 SERVICE CLEANUP", {
92
+ renderCount: h,
93
93
  reason: "Effect cleanup"
94
- }), b.disconnectUser().catch(console.error);
94
+ }), v.disconnectUser().catch(console.error);
95
95
  };
96
- }, [r, n, i, l]);
97
- const x = z(null);
98
- G(() => {
99
- var b, B;
100
- if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!m,
96
+ }, [r, n, c, a]);
97
+ const C = W(null);
98
+ q(() => {
99
+ var v, j;
100
+ if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
+ hasService: !!u,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
104
  isConnecting: E.current,
105
105
  isConnected: f,
106
- dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
- }), !m || !s) {
108
- l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
106
+ dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
+ }), !u || !s) {
108
+ a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
111
  if (E.current) {
112
- l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
112
+ a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((b = x.current) == null ? void 0 : b.serviceId) === m && ((B = x.current) == null ? void 0 : B.userId) === s.id) {
116
- l(
115
+ if (((v = C.current) == null ? void 0 : v.serviceId) === u && ((j = C.current) == null ? void 0 : j.userId) === s.id) {
116
+ a(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
119
119
  );
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- l("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, v(!0), N(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, p(!0), N(null);
124
124
  try {
125
- l("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const j = await m.connectUser(s);
127
- w(j), S(!0), x.current = { serviceId: m, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
125
+ a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
+ const A = await u.connectUser(s);
127
+ w(A), l(!0), C.current = { serviceId: u, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: j.userID
129
+ clientId: A.userID
130
130
  });
131
- } catch (j) {
132
- const W = j instanceof Error ? j.message : "Connection failed";
133
- N(W), l("❌ USER CONNECTION ERROR", {
131
+ } catch (A) {
132
+ const Z = A instanceof Error ? A.message : "Connection failed";
133
+ N(Z), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: W
135
+ error: Z
136
136
  });
137
137
  } finally {
138
- v(!1), E.current = !1, l("🔄 USER CONNECTION FINISHED", {
138
+ p(!1), E.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [m, s, l, f]), G(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
145
- hasService: !!m,
144
+ }, [u, s, a, f]), q(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!u,
146
146
  isConnected: f
147
147
  }), () => {
148
- m && f ? (l(
148
+ u && f ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), x.current = null, m.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
152
- hasService: !!m,
151
+ ), C.current = null, u.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!u,
153
153
  isConnected: f
154
154
  });
155
- }), [m, f, l]);
156
- const R = M(async () => {
157
- if (l("🔄 REFRESH CONNECTION CALLED", {
158
- hasService: !!m,
155
+ }), [u, f, a]);
156
+ const M = D(async () => {
157
+ if (a("🔄 REFRESH CONNECTION CALLED", {
158
+ hasService: !!u,
159
159
  hasUser: !!s
160
- }), !m || !s) {
161
- l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
160
+ }), !u || !s) {
161
+ a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), p(!0);
165
165
  try {
166
- l("🔌 DISCONNECTING FOR REFRESH"), await m.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
167
- const u = await m.connectUser(s);
168
- w(u), S(!0), N(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (u) {
170
- const b = u instanceof Error ? u.message : "Refresh failed";
171
- N(b), l("❌ CONNECTION REFRESH ERROR", {
166
+ a("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
+ const h = await u.connectUser(s);
168
+ w(h), l(!0), N(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (h) {
170
+ const v = h instanceof Error ? h.message : "Refresh failed";
171
+ N(v), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: b
173
+ error: v
174
174
  });
175
175
  } finally {
176
- v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ p(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [m, s, l]), d = U.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!m,
180
- hasClient: !!g,
178
+ }, [u, s, a]), m = P.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!u,
180
+ hasClient: !!x,
181
181
  isConnected: f,
182
- isLoading: _,
183
- hasError: !!c,
184
- capabilitiesKeys: Object.keys(a)
182
+ isLoading: T,
183
+ hasError: !!d,
184
+ capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
- service: m,
187
- client: g,
186
+ service: u,
187
+ client: x,
188
188
  isConnected: f,
189
- isLoading: _,
190
- error: c,
191
- capabilities: a,
192
- refreshConnection: R,
193
- debug: i
189
+ isLoading: T,
190
+ error: d,
191
+ capabilities: o,
192
+ refreshConnection: M,
193
+ debug: c
194
194
  }), [
195
- m,
196
- g,
195
+ u,
196
+ x,
197
197
  f,
198
- _,
198
+ T,
199
+ d,
200
+ o,
201
+ M,
199
202
  c,
200
- a,
201
- R,
202
- i,
203
- l
203
+ a
204
204
  ]);
205
- return l("🔄 RENDER END", {
206
- renderCount: k.current,
207
- willRenderChat: !!(g && f),
208
- contextValueReady: !!d
209
- }), /* @__PURE__ */ e(ye.Provider, { value: d, children: g && f ? /* @__PURE__ */ e(
210
- Ae,
205
+ return a("🔄 RENDER END", {
206
+ renderCount: _.current,
207
+ willRenderChat: !!(x && f),
208
+ contextValueReady: !!m
209
+ }), /* @__PURE__ */ e(Te.Provider, { value: m, children: x && f ? /* @__PURE__ */ e(
210
+ Ge,
211
211
  {
212
- client: g,
212
+ client: x,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, ls = () => oe(), as = (t, s) => {
219
+ }, $s = () => ge(), js = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
- ), a = new Date(
222
+ ), o = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
- return Math.floor(a / (1e3 * 60 * 60 * 24));
226
- }, os = (t) => {
225
+ return Math.floor(o / (1e3 * 60 * 60 * 24));
226
+ }, zs = (t) => {
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
229
  return "Just now";
230
- const r = as(t, s);
230
+ const r = js(t, s);
231
231
  return r === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
@@ -237,7 +237,7 @@ const ye = Pe({
237
237
  day: "numeric",
238
238
  year: "2-digit"
239
239
  });
240
- }, Ce = [
240
+ }, Se = [
241
241
  "🍎",
242
242
  // Apple
243
243
  "🍌",
@@ -265,7 +265,7 @@ const ye = Pe({
265
265
  "🍈"
266
266
  // Melon
267
267
  ];
268
- function is(t) {
268
+ function Gs(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
271
  const r = t.charCodeAt(n);
@@ -273,29 +273,29 @@ function is(t) {
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
276
- function cs(t) {
277
- const n = is(t) % Ce.length;
278
- return Ce[n];
276
+ function Hs(t) {
277
+ const n = Gs(t) % Se.length;
278
+ return Se[n];
279
279
  }
280
- const q = ({
280
+ const ne = ({
281
281
  id: t,
282
282
  image: s,
283
283
  size: n = 40,
284
284
  className: r,
285
- shape: a = "squircle"
285
+ shape: o = "squircle"
286
286
  }) => {
287
- const i = cs(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = a === "circle" ? { borderRadius: "50%" } : {
287
+ const c = Hs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", g = o === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: p("flex-shrink-0 overflow-hidden", r),
294
+ className: S("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
298
- ...h
298
+ ...g
299
299
  },
300
300
  children: s ? /* @__PURE__ */ e(
301
301
  "img",
@@ -308,77 +308,77 @@ const q = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: p(
311
+ className: S(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- m
313
+ u
314
314
  ),
315
- children: i
315
+ children: c
316
316
  }
317
317
  )
318
318
  }
319
319
  );
320
- }, Ee = U.memo(
321
- ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
322
- var N, E, I, k, x, R;
323
- const i = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
320
+ }, De = P.memo(
321
+ ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: o }) => {
322
+ var N, E, I, _, C, M;
323
+ const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
324
324
  t && n(t);
325
- }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
326
- (d) => {
327
- var u, b;
328
- return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
325
+ }, g = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
326
+ (m) => {
327
+ var h, v;
328
+ return ((h = m.user) == null ? void 0 : h.id) && m.user.id !== ((v = t == null ? void 0 : t._client) == null ? void 0 : v.userID);
329
329
  }
330
- ), g = ((E = h == null ? void 0 : h.user) == null ? void 0 : E.name) || "Conversation", w = (I = h == null ? void 0 : h.user) == null ? void 0 : I.image, f = (x = (k = t == null ? void 0 : t.state) == null ? void 0 : k.messages) == null ? void 0 : x[t.state.messages.length - 1], _ = (() => {
331
- var u;
330
+ ), x = ((E = g == null ? void 0 : g.user) == null ? void 0 : E.name) || "Conversation", w = (I = g == null ? void 0 : g.user) == null ? void 0 : I.image, f = (C = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages) == null ? void 0 : C[t.state.messages.length - 1], T = (() => {
331
+ var h;
332
332
  if (f != null && f.text) return f.text;
333
- const d = (u = f == null ? void 0 : f.attachments) == null ? void 0 : u[0];
334
- return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "📷 Sent an image" : d.type === "video" ? "🎥 Sent a video" : d.type === "audio" ? "🎵 Sent audio" : d.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
335
- })(), v = f != null && f.created_at ? os(new Date(f.created_at)) : "", c = a ?? 0;
333
+ const m = (h = f == null ? void 0 : f.attachments) == null ? void 0 : h[0];
334
+ return m ? m.og_scrape_url ? m.og_scrape_url : m.type === "image" ? "📷 Sent an image" : m.type === "video" ? "🎥 Sent a video" : m.type === "audio" ? "🎵 Sent audio" : m.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
335
+ })(), p = f != null && f.created_at ? zs(new Date(f.created_at)) : "", d = o ?? 0;
336
336
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
337
337
  channelId: t == null ? void 0 : t.id,
338
- isSelected: i,
339
- participantName: g,
340
- unreadCount: c,
341
- hasTimestamp: !!v
338
+ isSelected: c,
339
+ participantName: x,
340
+ unreadCount: d,
341
+ hasTimestamp: !!p
342
342
  }), /* @__PURE__ */ e(
343
343
  "button",
344
344
  {
345
345
  type: "button",
346
- onClick: l,
347
- className: p(
346
+ onClick: a,
347
+ className: S(
348
348
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
349
349
  {
350
- "bg-primary-alt/10 border-l-4 border-l-primary": i,
351
- "hover:bg-sand": !i
350
+ "bg-primary-alt/10 border-l-4 border-l-primary": c,
351
+ "hover:bg-sand": !c
352
352
  }
353
353
  ),
354
- children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
354
+ children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
355
355
  /* @__PURE__ */ e(
356
- q,
356
+ ne,
357
357
  {
358
- id: ((R = h == null ? void 0 : h.user) == null ? void 0 : R.id) || t.id || "unknown",
359
- name: g,
358
+ id: ((M = g == null ? void 0 : g.user) == null ? void 0 : M.id) || t.id || "unknown",
359
+ name: x,
360
360
  image: w,
361
361
  size: 44,
362
362
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
363
363
  }
364
364
  ),
365
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
366
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2", children: [
365
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
366
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
367
367
  /* @__PURE__ */ e(
368
368
  "h3",
369
369
  {
370
- className: p(
370
+ className: S(
371
371
  "text-sm font-medium truncate",
372
- i ? "text-primary" : "text-charcoal"
372
+ c ? "text-primary" : "text-charcoal"
373
373
  ),
374
- children: g
374
+ children: x
375
375
  }
376
376
  ),
377
- v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
377
+ p && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: p })
378
378
  ] }),
379
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
380
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: _ }),
381
- c > 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: c > 99 ? "99+" : c })
379
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
380
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: T }),
381
+ d > 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: d > 99 ? "99+" : d })
382
382
  ] })
383
383
  ] })
384
384
  ] })
@@ -386,47 +386,47 @@ const q = ({
386
386
  );
387
387
  }
388
388
  );
389
- Ee.displayName = "CustomChannelPreview";
390
- const Ie = U.memo(
389
+ De.displayName = "CustomChannelPreview";
390
+ const Fe = P.memo(
391
391
  ({
392
392
  onChannelSelect: t,
393
393
  selectedChannel: s,
394
394
  filters: n,
395
395
  className: r,
396
- customEmptyStateIndicator: a
396
+ customEmptyStateIndicator: o
397
397
  }) => {
398
- const i = U.useRef(0);
399
- i.current++;
400
- const { debug: l = !1 } = oe();
401
- l && console.log("📺 [ChannelList] 🔄 RENDER START", {
402
- renderCount: i.current,
398
+ const c = P.useRef(0);
399
+ c.current++;
400
+ const { debug: a = !1 } = ge();
401
+ a && console.log("📺 [ChannelList] 🔄 RENDER START", {
402
+ renderCount: c.current,
403
403
  selectedChannelId: s == null ? void 0 : s.id,
404
404
  filters: n
405
405
  });
406
- const m = U.useMemo(() => (g) => /* @__PURE__ */ e(
407
- Ee,
406
+ const u = P.useMemo(() => (x) => /* @__PURE__ */ e(
407
+ De,
408
408
  {
409
- ...g,
409
+ ...x,
410
410
  selectedChannel: s,
411
411
  onChannelSelect: t,
412
- debug: l
412
+ debug: a
413
413
  }
414
- ), [s, t, l]);
414
+ ), [s, t, a]);
415
415
  return /* @__PURE__ */ e(
416
416
  "div",
417
417
  {
418
- className: p(
418
+ className: S(
419
419
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
420
420
  r
421
421
  ),
422
422
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
423
- ze,
423
+ He,
424
424
  {
425
425
  filters: n,
426
426
  sort: { last_message_at: -1 },
427
427
  options: { limit: 30 },
428
- Preview: m,
429
- EmptyStateIndicator: a
428
+ Preview: u,
429
+ EmptyStateIndicator: o
430
430
  },
431
431
  JSON.stringify(n)
432
432
  ) })
@@ -434,8 +434,8 @@ const Ie = U.memo(
434
434
  );
435
435
  }
436
436
  );
437
- Ie.displayName = "ChannelList";
438
- const ne = ({
437
+ Fe.displayName = "ChannelList";
438
+ const me = ({
439
439
  variant: t = "default",
440
440
  className: s,
441
441
  children: n,
@@ -444,7 +444,7 @@ const ne = ({
444
444
  "button",
445
445
  {
446
446
  type: "button",
447
- className: p(
447
+ className: S(
448
448
  "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",
449
449
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
450
450
  s
@@ -453,12 +453,12 @@ const ne = ({
453
453
  children: n
454
454
  }
455
455
  );
456
- function Se({ label: t, className: s, children: n, ...r }) {
457
- return /* @__PURE__ */ o(
456
+ function Le({ label: t, className: s, children: n, ...r }) {
457
+ return /* @__PURE__ */ i(
458
458
  "button",
459
459
  {
460
460
  type: "button",
461
- className: p(
461
+ className: S(
462
462
  "rounded-full p-2 transition-colors focus-ring",
463
463
  {
464
464
  "cursor-not-allowed opacity-50": r.disabled,
@@ -474,19 +474,220 @@ function Se({ label: t, className: s, children: n, ...r }) {
474
474
  }
475
475
  );
476
476
  }
477
- function pe({ onClick: t }) {
478
- return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(me, { className: "h-5 w-5 text-stone", weight: "bold" }) });
477
+ function Oe({ onClick: t }) {
478
+ return /* @__PURE__ */ e(Le, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(be, { className: "h-5 w-5 text-stone", weight: "bold" }) });
479
479
  }
480
- const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t) => ({
480
+ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
481
+ "path",
482
+ {
483
+ d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
484
+ fill: "currentColor"
485
+ }
486
+ ) }), Zs = (t) => {
487
+ var s;
488
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
489
+ }, qs = (t) => {
490
+ var s;
491
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
492
+ }, Ys = (t) => {
493
+ var s;
494
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
495
+ }, Pe = (t) => Zs(t) || qs(t), Js = (t) => {
496
+ var s;
497
+ return Pe(t) && !((s = t.text) != null && s.trim());
498
+ }, Me = ({
499
+ message: t,
500
+ standalone: s = !1
501
+ }) => {
502
+ var o;
503
+ const n = Pe(t), r = Ys(t);
504
+ if (!n && !r)
505
+ return null;
506
+ if (n) {
507
+ const c = (o = t.metadata) == null ? void 0 : o.amount_text;
508
+ if (!c) return null;
509
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
510
+ return /* @__PURE__ */ i("div", { className: a, children: [
511
+ /* @__PURE__ */ e(Os, { size: s ? 14 : 12 }),
512
+ /* @__PURE__ */ e("span", { children: u })
513
+ ] });
514
+ }
515
+ return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
516
+ /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Ws, {}) }),
517
+ /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
518
+ ] });
519
+ }, Qs = (t) => {
520
+ var R, L;
521
+ const {
522
+ additionalMessageInputProps: s,
523
+ editing: n,
524
+ endOfGroup: r,
525
+ firstOfGroup: o,
526
+ groupedByUser: c,
527
+ handleAction: a,
528
+ handleOpenThread: u,
529
+ handleRetry: g,
530
+ highlighted: x,
531
+ isMessageAIGenerated: w,
532
+ isMyMessage: f,
533
+ message: l,
534
+ onUserClick: T,
535
+ onUserHover: p,
536
+ renderText: d,
537
+ threadList: N
538
+ } = t, { client: E } = Ze("CustomMessage"), { t: I } = qe("CustomMessage"), [_, C] = y(!1), [M, m] = y(!1), h = Ye(l.id), {
539
+ Attachment: v = Qe,
540
+ Avatar: j = Xe,
541
+ EditMessageModal: A = Ke,
542
+ MessageOptions: Z = es,
543
+ MessageActions: Y = Z,
544
+ MessageBlocked: re = ss,
545
+ MessageBouncePrompt: ee = ts,
546
+ MessageDeleted: se = ns,
547
+ MessageIsThreadReplyInChannelButtonIndicator: ae = rs,
548
+ MessageRepliesCountButton: U = as,
549
+ MessageStatus: G = ls,
550
+ MessageTimestamp: J = ke,
551
+ ReactionsList: z = os,
552
+ ReminderNotification: k = is,
553
+ StreamedMessageText: F = cs,
554
+ PinIndicator: B
555
+ } = Je("CustomMessage"), H = ds(l), Q = ms(l), X = we(
556
+ () => w == null ? void 0 : w(l),
557
+ [w, l]
558
+ ), $ = we(
559
+ () => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
560
+ [l]
561
+ );
562
+ if (us(l))
563
+ return null;
564
+ if (l.deleted_at || l.type === "deleted")
565
+ return /* @__PURE__ */ e(se, { message: l });
566
+ if (hs(l))
567
+ return /* @__PURE__ */ e(re, {});
568
+ const xe = !c || r, ie = !N && !!l.reply_count, ce = !N && l.show_in_channel && l.parent_id, K = l.status === "failed" && ((R = l.error) == null ? void 0 : R.status) !== 403, de = fs(l), le = gs(l) && !X;
569
+ let V;
570
+ K ? V = () => g(l) : de ? V = () => C(!0) : le && (V = () => m((oe) => !oe));
571
+ const te = S(
572
+ "str-chat__message str-chat__message-simple",
573
+ `str-chat__message--${l.type}`,
574
+ `str-chat__message--${l.status}`,
575
+ f() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
576
+ l.text ? "str-chat__message--has-text" : "has-no-text",
577
+ {
578
+ "str-chat__message--has-attachment": H,
579
+ "str-chat__message--highlighted": x,
580
+ "str-chat__message--pinned pinned-message": l.pinned,
581
+ "str-chat__message--with-reactions": Q,
582
+ "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((L = l == null ? void 0 : l.error) == null ? void 0 : L.status) !== 403,
583
+ "str-chat__message-with-thread-link": ie || ce,
584
+ "str-chat__virtual-message__wrapper--end": r,
585
+ "str-chat__virtual-message__wrapper--first": o,
586
+ "str-chat__virtual-message__wrapper--group": c
587
+ }
588
+ ), b = l.poll_id && E.polls.fromState(l.poll_id), O = Js(l);
589
+ return /* @__PURE__ */ i(Ne, { children: [
590
+ n && /* @__PURE__ */ e(
591
+ A,
592
+ {
593
+ additionalMessageInputProps: s
594
+ }
595
+ ),
596
+ _ && /* @__PURE__ */ e(
597
+ xs,
598
+ {
599
+ MessageBouncePrompt: ee,
600
+ onClose: () => C(!1),
601
+ open: _
602
+ }
603
+ ),
604
+ /* @__PURE__ */ i("div", { className: te, children: [
605
+ B && /* @__PURE__ */ e(B, {}),
606
+ !!h && /* @__PURE__ */ e(k, { reminder: h }),
607
+ l.user && /* @__PURE__ */ e(
608
+ j,
609
+ {
610
+ image: l.user.image,
611
+ name: l.user.name || l.user.id,
612
+ onClick: T,
613
+ onMouseOver: p,
614
+ user: l.user
615
+ }
616
+ ),
617
+ /* @__PURE__ */ i(
618
+ "div",
619
+ {
620
+ className: S("str-chat__message-inner", {
621
+ "str-chat__simple-message--error-failed": K || de
622
+ }),
623
+ "data-testid": "message-inner",
624
+ onClick: V,
625
+ onKeyDown: V,
626
+ role: V ? "button" : void 0,
627
+ tabIndex: V ? 0 : void 0,
628
+ children: [
629
+ /* @__PURE__ */ e(Y, {}),
630
+ /* @__PURE__ */ e("div", { className: "str-chat__message-reactions-host", children: Q && /* @__PURE__ */ e(z, { reverse: !0 }) }),
631
+ O ? (
632
+ /* Tip-only messages render as a standalone bubble */
633
+ /* @__PURE__ */ e(Me, { message: l, standalone: !0 })
634
+ ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
635
+ /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
636
+ b && /* @__PURE__ */ e(Cs, { poll: b }),
637
+ $ != null && $.length && !l.quoted_message ? /* @__PURE__ */ e(
638
+ v,
639
+ {
640
+ actionHandler: a,
641
+ attachments: $
642
+ }
643
+ ) : null,
644
+ X ? /* @__PURE__ */ e(
645
+ F,
646
+ {
647
+ message: l,
648
+ renderText: d
649
+ }
650
+ ) : /* @__PURE__ */ e(Ns, { message: l, renderText: d }),
651
+ /* @__PURE__ */ e(bs, {})
652
+ ] }),
653
+ /* @__PURE__ */ e(Me, { message: l })
654
+ ] })
655
+ ]
656
+ }
657
+ ),
658
+ ie && /* @__PURE__ */ e(
659
+ U,
660
+ {
661
+ onClick: u,
662
+ reply_count: l.reply_count
663
+ }
664
+ ),
665
+ ce && /* @__PURE__ */ e(ae, {}),
666
+ xe && /* @__PURE__ */ i("div", { className: "str-chat__message-metadata", children: [
667
+ /* @__PURE__ */ e(G, {}),
668
+ !f() && !!l.user && /* @__PURE__ */ e("span", { className: "str-chat__message-simple-name", children: l.user.name || l.user.id }),
669
+ /* @__PURE__ */ e(J, { customClass: "str-chat__message-simple-timestamp" }),
670
+ le && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: I("Edited") }),
671
+ le && /* @__PURE__ */ e(vs, { calendar: !0, open: M })
672
+ ] })
673
+ ] }, l.id)
674
+ ] });
675
+ }, Xs = P.memo(
676
+ Qs,
677
+ We
678
+ ), Ks = (t) => {
679
+ const s = ws("CustomMessage");
680
+ return /* @__PURE__ */ e(Xs, { ...s, ...t });
681
+ }, et = (t) => ({
481
682
  linkPreviews: Array.from(t.previews.values()).filter(
482
- (s) => be.previewIsLoaded(s) || be.previewIsLoading(s)
683
+ (s) => _e.previewIsLoaded(s) || _e.previewIsLoading(s)
483
684
  )
484
- }), ms = ({
685
+ }), st = ({
485
686
  link: t,
486
687
  onDismiss: s
487
688
  }) => {
488
- const { og_scrape_url: n, title: r, image_url: a } = t;
489
- return /* @__PURE__ */ o(
689
+ const { og_scrape_url: n, title: r, image_url: o } = t;
690
+ return /* @__PURE__ */ i(
490
691
  "a",
491
692
  {
492
693
  href: n,
@@ -494,10 +695,10 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
494
695
  rel: "noopener noreferrer",
495
696
  className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
496
697
  children: [
497
- a && /* @__PURE__ */ e(
698
+ o && /* @__PURE__ */ e(
498
699
  "img",
499
700
  {
500
- src: a,
701
+ src: o,
501
702
  alt: r || "",
502
703
  className: "h-[148px] w-full rounded-[20px] object-cover"
503
704
  }
@@ -506,47 +707,47 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
506
707
  "button",
507
708
  {
508
709
  type: "button",
509
- onClick: (l) => {
510
- l.preventDefault(), s(n);
710
+ onClick: (a) => {
711
+ a.preventDefault(), s(n);
511
712
  },
512
713
  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",
513
714
  "aria-label": "Close link preview",
514
- children: /* @__PURE__ */ e(me, { className: "size-4 text-black/90" })
715
+ children: /* @__PURE__ */ e(be, { className: "size-4 text-black/90" })
515
716
  }
516
717
  ),
517
- /* @__PURE__ */ o("div", { className: "p-2", children: [
718
+ /* @__PURE__ */ i("div", { className: "p-2", children: [
518
719
  r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
519
720
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
520
721
  ] })
521
722
  ]
522
723
  }
523
724
  );
524
- }, hs = () => {
525
- const { linkPreviewsManager: t } = $e(), { linkPreviews: s } = Ge(
725
+ }, tt = () => {
726
+ const { linkPreviewsManager: t } = ps(), { linkPreviews: s } = ys(
526
727
  t.state,
527
- us
528
- ), n = (a) => {
529
- t.dismissPreview(a);
728
+ et
729
+ ), n = (o) => {
730
+ t.dismissPreview(o);
530
731
  };
531
- return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((a) => /* @__PURE__ */ e(
532
- ms,
732
+ 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(
733
+ st,
533
734
  {
534
- link: a,
735
+ link: o,
535
736
  onDismiss: n
536
737
  },
537
- a.og_scrape_url
738
+ o.og_scrape_url
538
739
  )) }) : null;
539
- }, fs = () => {
540
- const { handleSubmit: t } = Ve(), s = We();
541
- return /* @__PURE__ */ o(ve, { children: [
542
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ze, {}) }),
543
- /* @__PURE__ */ o("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: [
544
- /* @__PURE__ */ e(qe, {}),
545
- /* @__PURE__ */ e(hs, {}),
546
- /* @__PURE__ */ e(Ye, {}),
547
- /* @__PURE__ */ o("div", { className: "flex", children: [
740
+ }, nt = () => {
741
+ const { handleSubmit: t } = Is(), s = _s();
742
+ return /* @__PURE__ */ i(Ne, { children: [
743
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ss, {}) }),
744
+ /* @__PURE__ */ i("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: [
745
+ /* @__PURE__ */ e(Ms, {}),
746
+ /* @__PURE__ */ e(tt, {}),
747
+ /* @__PURE__ */ e(ks, {}),
748
+ /* @__PURE__ */ i("div", { className: "flex", children: [
548
749
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
549
- Je,
750
+ Rs,
550
751
  {
551
752
  className: "w-full resize-none outline-none leading-6",
552
753
  autoFocus: !0,
@@ -562,33 +763,33 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
562
763
  disabled: !s,
563
764
  onClick: t,
564
765
  type: "button",
565
- children: /* @__PURE__ */ e(ss, { className: "size-4" })
766
+ children: /* @__PURE__ */ e(Ps, { className: "size-4" })
566
767
  }
567
768
  )
568
769
  ] })
569
770
  ] })
570
771
  ] });
571
- }, gs = ({
772
+ }, rt = ({
572
773
  renderActions: t
573
- }) => /* @__PURE__ */ o("div", { className: "message-input flex items-center gap-2 p-4", children: [
774
+ }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
574
775
  t && (t == null ? void 0 : t()),
575
- /* @__PURE__ */ e(He, { Input: fs })
576
- ] }), xs = (t) => {
776
+ /* @__PURE__ */ e(Es, { Input: nt })
777
+ ] }), at = (t) => {
577
778
  const s = t.message.hide_date === !0;
578
- return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
579
- /* @__PURE__ */ o("div", { className: "str-chat__message--system__text", children: [
779
+ return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
780
+ /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
580
781
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
581
782
  /* @__PURE__ */ e("p", { children: t.message.text }),
582
783
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
583
784
  ] }),
584
- !s && /* @__PURE__ */ e(Qe, { message: t.message })
785
+ !s && /* @__PURE__ */ e(ke, { message: t.message })
585
786
  ] });
586
- }, Ns = () => null, bs = ({ className: t, message: s }) => /* @__PURE__ */ o(
787
+ }, lt = () => null, ot = ({ className: t, message: s }) => /* @__PURE__ */ i(
587
788
  "div",
588
789
  {
589
- className: p("flex items-center justify-center h-full", t),
790
+ className: S("flex items-center justify-center h-full", t),
590
791
  children: [
591
- /* @__PURE__ */ o("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
792
+ /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
592
793
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
593
794
  "animateTransform",
594
795
  {
@@ -626,25 +827,25 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
626
827
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
627
828
  ]
628
829
  }
629
- ), ae = U.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ o("div", { className: "flex items-center", children: [
630
- /* @__PURE__ */ e(bs, { className: "w-6 h-6" }),
830
+ ), fe = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
831
+ /* @__PURE__ */ e(ot, { className: "w-6 h-6" }),
631
832
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
632
833
  ] }) }));
633
- ae.displayName = "LoadingState";
634
- const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
635
- var h, g, w, f, S;
636
- const { channel: a } = we(), i = U.useMemo(() => Object.values(a.state.members || {}).find(
637
- (v) => {
638
- var c;
639
- return ((c = v.user) == null ? void 0 : c.id) && v.user.id !== a._client.userID;
834
+ fe.displayName = "LoadingState";
835
+ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
836
+ var g, x, w, f, l;
837
+ const { channel: o } = Re(), c = P.useMemo(() => Object.values(o.state.members || {}).find(
838
+ (p) => {
839
+ var d;
840
+ return ((d = p.user) == null ? void 0 : d.id) && p.user.id !== o._client.userID;
640
841
  }
641
- ), [a._client.userID, a.state.members]), l = ((h = i == null ? void 0 : i.user) == null ? void 0 : h.name) || ((g = i == null ? void 0 : i.user) == null ? void 0 : g.id) || "Unknown member", m = (w = i == null ? void 0 : i.user) == null ? void 0 : w.image;
642
- return /* @__PURE__ */ o("div", { className: "@container", children: [
643
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center @lg:hidden", children: [
842
+ ), [o._client.userID, o.state.members]), a = ((g = c == null ? void 0 : c.user) == null ? void 0 : g.name) || ((x = c == null ? void 0 : c.user) == null ? void 0 : x.id) || "Unknown member", u = (w = c == null ? void 0 : c.user) == null ? void 0 : w.image;
843
+ return /* @__PURE__ */ i("div", { className: "@container", children: [
844
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
644
845
  /* @__PURE__ */ e(
645
846
  "button",
646
847
  {
647
- className: p(
848
+ className: S(
648
849
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
649
850
  !s && "invisible"
650
851
  ),
@@ -652,36 +853,36 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
652
853
  }),
653
854
  type: "button",
654
855
  "aria-label": "Back to conversations",
655
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
856
+ children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
656
857
  }
657
858
  ),
658
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-1 items-center", children: [
859
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
659
860
  /* @__PURE__ */ e(
660
- q,
861
+ ne,
661
862
  {
662
- id: ((f = i == null ? void 0 : i.user) == null ? void 0 : f.id) || a.id || "unknown",
663
- name: l,
664
- image: m,
863
+ id: ((f = c == null ? void 0 : c.user) == null ? void 0 : f.id) || o.id || "unknown",
864
+ name: a,
865
+ image: u,
665
866
  size: 40
666
867
  }
667
868
  ),
668
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: l })
869
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
669
870
  ] }),
670
871
  /* @__PURE__ */ e(
671
872
  "button",
672
873
  {
673
- className: p(
874
+ className: S(
674
875
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
675
876
  ),
676
877
  onClick: n,
677
878
  type: "button",
678
879
  "aria-label": "Show info",
679
- children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
880
+ children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
680
881
  }
681
882
  )
682
883
  ] }),
683
- /* @__PURE__ */ o("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
684
- /* @__PURE__ */ o("div", { className: "flex items-center gap-4 min-w-0", children: [
884
+ /* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
885
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
685
886
  s && t && /* @__PURE__ */ e(
686
887
  "button",
687
888
  {
@@ -689,105 +890,105 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
689
890
  onClick: t,
690
891
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
691
892
  "aria-label": "Back to conversations",
692
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
893
+ children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
693
894
  }
694
895
  ),
695
896
  /* @__PURE__ */ e(
696
- q,
897
+ ne,
697
898
  {
698
- id: ((S = i == null ? void 0 : i.user) == null ? void 0 : S.id) || a.id || "unknown",
699
- name: l,
700
- image: m,
899
+ id: ((l = c == null ? void 0 : c.user) == null ? void 0 : l.id) || o.id || "unknown",
900
+ name: a,
901
+ image: u,
701
902
  size: 40
702
903
  }
703
904
  ),
704
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: l }) })
905
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
705
906
  ] }),
706
907
  r && n && /* @__PURE__ */ e(
707
908
  "button",
708
909
  {
709
- className: p(
910
+ className: S(
710
911
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
711
912
  ),
712
913
  onClick: n,
713
- children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
914
+ children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
714
915
  }
715
916
  )
716
917
  ] })
717
918
  ] });
718
- }, vs = ({
919
+ }, ct = ({
719
920
  dialogRef: t,
720
921
  onClose: s,
721
922
  participant: n,
722
923
  channel: r,
723
- followerStatusLabel: a,
724
- onLeaveConversation: i,
725
- onBlockParticipant: l,
726
- showDeleteConversation: m = !0,
727
- onDeleteConversationClick: h,
728
- onBlockParticipantClick: g,
924
+ followerStatusLabel: o,
925
+ onLeaveConversation: c,
926
+ onBlockParticipant: a,
927
+ showDeleteConversation: u = !0,
928
+ onDeleteConversationClick: g,
929
+ onBlockParticipantClick: x,
729
930
  onReportParticipantClick: w
730
931
  }) => {
731
- var Q, X, ce, O, H, J, $;
732
- const { service: f, debug: S } = oe(), [_, v] = y(!1), [c, N] = y(!1), [E, I] = y(!1), k = M(async () => {
733
- var D;
734
- if (!(!f || !((D = n == null ? void 0 : n.user) != null && D.id)))
932
+ var ee, se, ae, U, G, J, z;
933
+ const { service: f, debug: l } = ge(), [T, p] = y(!1), [d, N] = y(!1), [E, I] = y(!1), _ = D(async () => {
934
+ var k;
935
+ if (!(!f || !((k = n == null ? void 0 : n.user) != null && k.id)))
735
936
  try {
736
- const A = (await f.getBlockedUsers()).some(
737
- (V) => {
738
- var K;
739
- return V.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
937
+ const B = (await f.getBlockedUsers()).some(
938
+ (H) => {
939
+ var Q;
940
+ return H.blocked_user_id === ((Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id);
740
941
  }
741
942
  );
742
- v(A);
743
- } catch (T) {
943
+ p(B);
944
+ } catch (F) {
744
945
  console.error(
745
946
  "[ChannelInfoDialog] Failed to check blocked status:",
746
- T
947
+ F
747
948
  );
748
949
  }
749
- }, [f, (Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id]);
750
- G(() => {
751
- k();
752
- }, [k]);
753
- const x = async () => {
754
- var D;
755
- if (!c) {
756
- h == null || h(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
950
+ }, [f, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
951
+ q(() => {
952
+ _();
953
+ }, [_]);
954
+ const C = async () => {
955
+ var k;
956
+ if (!d) {
957
+ g == null || g(), l && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
757
958
  try {
758
- const T = ((D = r._client) == null ? void 0 : D.userID) ?? null;
759
- await r.hide(T, !1), i && await i(r), s();
760
- } catch (T) {
761
- console.error("[ChannelInfoDialog] Failed to leave conversation", T);
959
+ const F = ((k = r._client) == null ? void 0 : k.userID) ?? null;
960
+ await r.hide(F, !1), c && await c(r), s();
961
+ } catch (F) {
962
+ console.error("[ChannelInfoDialog] Failed to leave conversation", F);
762
963
  } finally {
763
964
  N(!1);
764
965
  }
765
966
  }
766
- }, R = async () => {
767
- var D, T, A;
967
+ }, M = async () => {
968
+ var k, F, B;
768
969
  if (!(E || !f)) {
769
- g == null || g(), S && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), I(!0);
970
+ x == null || x(), l && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), I(!0);
770
971
  try {
771
- await f.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
772
- } catch (V) {
773
- console.error("[ChannelInfoDialog] Failed to block member", V);
972
+ await f.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
973
+ } catch (H) {
974
+ console.error("[ChannelInfoDialog] Failed to block member", H);
774
975
  } finally {
775
976
  I(!1);
776
977
  }
777
978
  }
778
- }, d = async () => {
779
- var D, T, A;
979
+ }, m = async () => {
980
+ var k, F, B;
780
981
  if (!(E || !f)) {
781
- g == null || g(), S && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), I(!0);
982
+ x == null || x(), l && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), I(!0);
782
983
  try {
783
- await f.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
784
- } catch (V) {
785
- console.error("[ChannelInfoDialog] Failed to unblock member", V);
984
+ await f.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
985
+ } catch (H) {
986
+ console.error("[ChannelInfoDialog] Failed to unblock member", H);
786
987
  } finally {
787
988
  I(!1);
788
989
  }
789
990
  }
790
- }, u = () => {
991
+ }, h = () => {
791
992
  w == null || w(), s(), window.open(
792
993
  "https://linktr.ee/s/about/trust-center/report",
793
994
  "_blank",
@@ -795,7 +996,7 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
795
996
  );
796
997
  };
797
998
  if (!n) return null;
798
- const b = ((X = n.user) == null ? void 0 : X.name) || ((ce = n.user) == null ? void 0 : ce.id) || "Unknown member", B = (O = n.user) == null ? void 0 : O.image, j = (H = n.user) == null ? void 0 : H.email, W = (J = n.user) == null ? void 0 : J.username, Y = j || (W ? `linktr.ee/${W}` : void 0), ie = (($ = n.user) == null ? void 0 : $.id) || "unknown";
999
+ const v = ((se = n.user) == null ? void 0 : se.name) || ((ae = n.user) == null ? void 0 : ae.id) || "Unknown member", j = (U = n.user) == null ? void 0 : U.image, A = (G = n.user) == null ? void 0 : G.email, Z = (J = n.user) == null ? void 0 : J.username, Y = A || (Z ? `linktr.ee/${Z}` : void 0), re = ((z = n.user) == null ? void 0 : z.id) || "unknown";
799
1000
  return (
800
1001
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
801
1002
  /* @__PURE__ */ e(
@@ -804,90 +1005,90 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
804
1005
  ref: t,
805
1006
  className: "mes-dialog group",
806
1007
  onClose: s,
807
- onClick: (D) => {
808
- D.target === t.current && s();
1008
+ onClick: (k) => {
1009
+ k.target === t.current && s();
809
1010
  },
810
- children: /* @__PURE__ */ o("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: [
811
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1011
+ children: /* @__PURE__ */ i("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: [
1012
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
812
1013
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
813
- /* @__PURE__ */ e(pe, { onClick: s })
1014
+ /* @__PURE__ */ e(Oe, { onClick: s })
814
1015
  ] }),
815
- /* @__PURE__ */ o("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1016
+ /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
816
1017
  /* @__PURE__ */ e(
817
1018
  "div",
818
1019
  {
819
1020
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
820
1021
  style: { backgroundColor: "#FBFAF9" },
821
- children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3 w-full", children: [
1022
+ children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
822
1023
  /* @__PURE__ */ e(
823
- q,
1024
+ ne,
824
1025
  {
825
- id: ie,
826
- name: b,
827
- image: B,
1026
+ id: re,
1027
+ name: v,
1028
+ image: j,
828
1029
  size: 88,
829
1030
  shape: "circle"
830
1031
  }
831
1032
  ),
832
- /* @__PURE__ */ o("div", { className: "flex flex-col min-w-0 flex-1", children: [
833
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: b }),
1033
+ /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1034
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
834
1035
  Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
835
- a && /* @__PURE__ */ e(
1036
+ o && /* @__PURE__ */ e(
836
1037
  "span",
837
1038
  {
838
1039
  className: "mt-1 rounded-full text-xs font-normal w-fit",
839
1040
  style: {
840
1041
  padding: "4px 8px",
841
- backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
842
- color: a === "Subscribed to you" ? "#008236" : "#78716C",
1042
+ backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1043
+ color: o === "Subscribed to you" ? "#008236" : "#78716C",
843
1044
  lineHeight: "133.333%",
844
1045
  letterSpacing: "0.21px"
845
1046
  },
846
- children: a
1047
+ children: o
847
1048
  }
848
1049
  )
849
1050
  ] })
850
1051
  ] })
851
1052
  }
852
1053
  ),
853
- /* @__PURE__ */ o("ul", { className: "flex flex-col gap-2 mt-2", children: [
854
- m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
855
- ne,
1054
+ /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
1055
+ u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1056
+ me,
856
1057
  {
857
- onClick: x,
858
- disabled: c,
859
- "aria-busy": c,
1058
+ onClick: C,
1059
+ disabled: d,
1060
+ "aria-busy": d,
860
1061
  children: [
861
- c ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
1062
+ d ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Us, { className: "h-5 w-5" }),
862
1063
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
863
1064
  ]
864
1065
  }
865
1066
  ) }),
866
- /* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ o(
867
- ne,
1067
+ /* @__PURE__ */ e("li", { children: T ? /* @__PURE__ */ i(
1068
+ me,
868
1069
  {
869
- onClick: d,
1070
+ onClick: m,
870
1071
  disabled: E,
871
1072
  "aria-busy": E,
872
1073
  children: [
873
- E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
1074
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ee, { className: "h-5 w-5" }),
874
1075
  /* @__PURE__ */ e("span", { children: "Unblock" })
875
1076
  ]
876
1077
  }
877
- ) : /* @__PURE__ */ o(
878
- ne,
1078
+ ) : /* @__PURE__ */ i(
1079
+ me,
879
1080
  {
880
- onClick: R,
1081
+ onClick: M,
881
1082
  disabled: E,
882
1083
  "aria-busy": E,
883
1084
  children: [
884
- E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
1085
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ee, { className: "h-5 w-5" }),
885
1086
  /* @__PURE__ */ e("span", { children: "Block" })
886
1087
  ]
887
1088
  }
888
1089
  ) }),
889
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(ne, { variant: "danger", onClick: u, children: [
890
- /* @__PURE__ */ e(ns, { className: "h-5 w-5" }),
1090
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(me, { variant: "danger", onClick: h, children: [
1091
+ /* @__PURE__ */ e(Bs, { className: "h-5 w-5" }),
891
1092
  /* @__PURE__ */ e("span", { children: "Report" })
892
1093
  ] }) })
893
1094
  ] })
@@ -896,118 +1097,126 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
896
1097
  }
897
1098
  )
898
1099
  );
899
- }, ws = ({
1100
+ }, dt = ({
900
1101
  onBack: t,
901
1102
  showBackButton: s,
902
1103
  renderMessageInputActions: n,
903
1104
  onLeaveConversation: r,
904
- onBlockParticipant: a,
905
- showDeleteConversation: i = !0,
906
- onDeleteConversationClick: l,
907
- onBlockParticipantClick: m,
908
- onReportParticipantClick: h
1105
+ onBlockParticipant: o,
1106
+ showDeleteConversation: c = !0,
1107
+ onDeleteConversationClick: a,
1108
+ onBlockParticipantClick: u,
1109
+ onReportParticipantClick: g
909
1110
  }) => {
910
- const { channel: g } = we(), w = z(null), f = U.useMemo(() => Object.values(g.state.members || {}).find(
1111
+ const { channel: x } = Re(), w = W(null), f = P.useMemo(() => Object.values(x.state.members || {}).find(
911
1112
  (N) => {
912
1113
  var E;
913
- return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
1114
+ return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== x._client.userID;
914
1115
  }
915
- ), [g._client.userID, g.state.members]), S = U.useMemo(() => {
916
- const c = g.data ?? {};
917
- if (c.followerStatus)
918
- return String(c.followerStatus);
919
- if (c.isFollower !== void 0)
920
- return c.isFollower ? "Subscribed to you" : "Not subscribed";
921
- }, [g.data]), _ = M(() => {
922
- var c;
923
- (c = w.current) == null || c.showModal();
924
- }, []), v = M(() => {
925
- var c;
926
- (c = w.current) == null || c.close();
1116
+ ), [x._client.userID, x.state.members]), l = P.useMemo(() => {
1117
+ const d = x.data ?? {};
1118
+ if (d.followerStatus)
1119
+ return String(d.followerStatus);
1120
+ if (d.isFollower !== void 0)
1121
+ return d.isFollower ? "Subscribed to you" : "Not subscribed";
1122
+ }, [x.data]), T = D(() => {
1123
+ var d;
1124
+ (d = w.current) == null || d.showModal();
1125
+ }, []), p = D(() => {
1126
+ var d;
1127
+ (d = w.current) == null || d.close();
927
1128
  }, []);
928
- return /* @__PURE__ */ o(ve, { children: [
929
- /* @__PURE__ */ o(Ke, { children: [
930
- /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
931
- Cs,
932
- {
933
- onBack: t,
934
- showBackButton: s,
935
- onShowInfo: _,
936
- canShowInfo: !!f
937
- }
938
- ) }),
939
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
940
- es,
941
- {
942
- hideDeletedMessages: !0,
943
- hideNewMessageSeparator: !1,
944
- messageActions: []
945
- }
946
- ) }),
947
- /* @__PURE__ */ e(
948
- gs,
949
- {
950
- renderActions: () => n == null ? void 0 : n(g)
951
- }
952
- )
953
- ] }),
1129
+ return /* @__PURE__ */ i(Ne, { children: [
954
1130
  /* @__PURE__ */ e(
955
- vs,
1131
+ Ds,
1132
+ {
1133
+ overrides: {
1134
+ Message: (d) => /* @__PURE__ */ e(Ks, { ...d })
1135
+ },
1136
+ children: /* @__PURE__ */ i(Fs, { children: [
1137
+ /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1138
+ it,
1139
+ {
1140
+ onBack: t,
1141
+ showBackButton: s,
1142
+ onShowInfo: T,
1143
+ canShowInfo: !!f
1144
+ }
1145
+ ) }),
1146
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1147
+ Ls,
1148
+ {
1149
+ hideDeletedMessages: !0,
1150
+ hideNewMessageSeparator: !1,
1151
+ messageActions: void 0
1152
+ }
1153
+ ) }),
1154
+ /* @__PURE__ */ e(
1155
+ rt,
1156
+ {
1157
+ renderActions: () => n == null ? void 0 : n(x)
1158
+ }
1159
+ )
1160
+ ] })
1161
+ }
1162
+ ),
1163
+ /* @__PURE__ */ e(
1164
+ ct,
956
1165
  {
957
1166
  dialogRef: w,
958
- onClose: v,
1167
+ onClose: p,
959
1168
  participant: f,
960
- channel: g,
961
- followerStatusLabel: S,
1169
+ channel: x,
1170
+ followerStatusLabel: l,
962
1171
  onLeaveConversation: r,
963
- onBlockParticipant: a,
964
- showDeleteConversation: i,
965
- onDeleteConversationClick: l,
966
- onBlockParticipantClick: m,
967
- onReportParticipantClick: h
1172
+ onBlockParticipant: o,
1173
+ showDeleteConversation: c,
1174
+ onDeleteConversationClick: a,
1175
+ onBlockParticipantClick: u,
1176
+ onReportParticipantClick: g
968
1177
  }
969
1178
  )
970
1179
  ] });
971
- }, ke = U.memo(
1180
+ }, Ue = P.memo(
972
1181
  ({
973
1182
  channel: t,
974
1183
  onBack: s,
975
1184
  showBackButton: n = !1,
976
1185
  renderMessageInputActions: r,
977
- onLeaveConversation: a,
978
- onBlockParticipant: i,
979
- className: l,
980
- CustomChannelEmptyState: m = Ns,
981
- showDeleteConversation: h = !0,
982
- onDeleteConversationClick: g,
1186
+ onLeaveConversation: o,
1187
+ onBlockParticipant: c,
1188
+ className: a,
1189
+ CustomChannelEmptyState: u = lt,
1190
+ showDeleteConversation: g = !0,
1191
+ onDeleteConversationClick: x,
983
1192
  onBlockParticipantClick: w,
984
1193
  onReportParticipantClick: f
985
1194
  }) => /* @__PURE__ */ e(
986
1195
  "div",
987
1196
  {
988
- className: p(
1197
+ className: S(
989
1198
  "messaging-channel-view h-full flex flex-col",
990
- l
1199
+ a
991
1200
  ),
992
1201
  children: /* @__PURE__ */ e(
993
- Xe,
1202
+ Ts,
994
1203
  {
995
1204
  channel: t,
996
- MessageSystem: xs,
997
- EmptyStateIndicator: m,
998
- LoadingIndicator: ae,
999
- DateSeparator: ds,
1205
+ MessageSystem: at,
1206
+ EmptyStateIndicator: u,
1207
+ LoadingIndicator: fe,
1208
+ DateSeparator: Vs,
1000
1209
  children: /* @__PURE__ */ e(
1001
- ws,
1210
+ dt,
1002
1211
  {
1003
1212
  onBack: s,
1004
1213
  showBackButton: n,
1005
1214
  renderMessageInputActions: r,
1006
- onLeaveConversation: a,
1007
- onBlockParticipant: i,
1008
- CustomChannelEmptyState: m,
1009
- showDeleteConversation: h,
1010
- onDeleteConversationClick: g,
1215
+ onLeaveConversation: o,
1216
+ onBlockParticipant: c,
1217
+ CustomChannelEmptyState: u,
1218
+ showDeleteConversation: g,
1219
+ onDeleteConversationClick: x,
1011
1220
  onBlockParticipantClick: w,
1012
1221
  onReportParticipantClick: f
1013
1222
  }
@@ -1017,16 +1226,16 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1017
1226
  }
1018
1227
  )
1019
1228
  );
1020
- ke.displayName = "ChannelView";
1021
- function ys({
1229
+ Ue.displayName = "ChannelView";
1230
+ function mt({
1022
1231
  searchQuery: t,
1023
1232
  setSearchQuery: s,
1024
1233
  placeholder: n
1025
1234
  }) {
1026
- const r = z(null);
1027
- return /* @__PURE__ */ o("div", { className: "relative", children: [
1235
+ const r = W(null);
1236
+ return /* @__PURE__ */ i("div", { className: "relative", children: [
1028
1237
  /* @__PURE__ */ e(
1029
- rs,
1238
+ As,
1030
1239
  {
1031
1240
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1032
1241
  weight: "bold"
@@ -1039,162 +1248,162 @@ function ys({
1039
1248
  type: "text",
1040
1249
  placeholder: n,
1041
1250
  value: t,
1042
- onChange: (a) => s(a.target.value),
1251
+ onChange: (o) => s(o.target.value),
1043
1252
  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"
1044
1253
  }
1045
1254
  ),
1046
1255
  t && /* @__PURE__ */ e(
1047
- Se,
1256
+ Le,
1048
1257
  {
1049
1258
  label: "Clear search",
1050
1259
  onClick: () => {
1051
- var a;
1052
- s(""), (a = r.current) == null || a.focus();
1260
+ var o;
1261
+ s(""), (o = r.current) == null || o.focus();
1053
1262
  },
1054
1263
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1055
- children: /* @__PURE__ */ e(me, { className: "h-4 w-4", weight: "bold" })
1264
+ children: /* @__PURE__ */ e(be, { className: "h-4 w-4", weight: "bold" })
1056
1265
  }
1057
1266
  )
1058
1267
  ] });
1059
1268
  }
1060
- const Es = ({
1269
+ const ut = ({
1061
1270
  participantSource: t,
1062
1271
  onSelectParticipant: s,
1063
1272
  onClose: n,
1064
1273
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
1065
- participantLabel: a = "participants",
1066
- searchPlaceholder: i = "Search participants...",
1067
- className: l
1274
+ participantLabel: o = "participants",
1275
+ searchPlaceholder: c = "Search participants...",
1276
+ className: a
1068
1277
  }) => {
1069
- const { debug: m } = oe(), [h, g] = y(""), [w, f] = y([]), [S, _] = y(!1), [v, c] = y(null), [N, E] = y(
1278
+ const { debug: u } = ge(), [g, x] = y(""), [w, f] = y([]), [l, T] = y(!1), [p, d] = y(null), [N, E] = y(
1070
1279
  null
1071
- ), I = z(!1);
1072
- G(() => {
1280
+ ), I = W(!1);
1281
+ q(() => {
1073
1282
  if (t.loading) {
1074
- m && console.log(
1283
+ u && console.log(
1075
1284
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1076
1285
  );
1077
1286
  return;
1078
1287
  }
1079
1288
  if (I.current) return;
1080
1289
  (async () => {
1081
- m && console.log("[ParticipantPicker] Loading initial participants..."), _(!0), c(null);
1290
+ u && console.log("[ParticipantPicker] Loading initial participants..."), T(!0), d(null);
1082
1291
  try {
1083
- const u = await t.loadParticipants({
1292
+ const h = await t.loadParticipants({
1084
1293
  search: "",
1085
1294
  // Load all participants initially
1086
1295
  limit: 100
1087
1296
  });
1088
- f(u.participants), I.current = !0, m && console.log(
1297
+ f(h.participants), I.current = !0, u && console.log(
1089
1298
  "[ParticipantPicker] Participants loaded successfully:",
1090
- u.participants.length
1299
+ h.participants.length
1091
1300
  );
1092
- } catch (u) {
1093
- const b = u instanceof Error ? u.message : "Failed to load participants";
1094
- c(b), console.error("[ParticipantPicker] Failed to load participants:", u);
1301
+ } catch (h) {
1302
+ const v = h instanceof Error ? h.message : "Failed to load participants";
1303
+ d(v), console.error("[ParticipantPicker] Failed to load participants:", h);
1095
1304
  } finally {
1096
- _(!1);
1305
+ T(!1);
1097
1306
  }
1098
1307
  })();
1099
- }, [t.loading, m]);
1100
- const k = w.filter((d) => !r.has(d.id)).filter((d) => {
1101
- var b;
1102
- if (!h) return !0;
1103
- const u = h.toLowerCase();
1104
- return d.name.toLowerCase().includes(u) || ((b = d.email) == null ? void 0 : b.toLowerCase().includes(u)) || !1;
1105
- }), x = M(
1106
- async (d) => {
1308
+ }, [t.loading, u]);
1309
+ const _ = w.filter((m) => !r.has(m.id)).filter((m) => {
1310
+ var v;
1311
+ if (!g) return !0;
1312
+ const h = g.toLowerCase();
1313
+ return m.name.toLowerCase().includes(h) || ((v = m.email) == null ? void 0 : v.toLowerCase().includes(h)) || !1;
1314
+ }), C = D(
1315
+ async (m) => {
1107
1316
  if (!N) {
1108
- E(d.id);
1317
+ E(m.id);
1109
1318
  try {
1110
- await s(d);
1111
- } catch (u) {
1112
- console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
1319
+ await s(m);
1320
+ } catch (h) {
1321
+ console.error("[ParticipantPicker] Failed to start chat:", h), E(null);
1113
1322
  }
1114
1323
  }
1115
1324
  },
1116
1325
  [s, N]
1117
- ), R = (d, u) => {
1118
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), x(u));
1326
+ ), M = (m, h) => {
1327
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), C(h));
1119
1328
  };
1120
- return /* @__PURE__ */ o("div", { className: p("flex flex-col h-full", l), children: [
1121
- /* @__PURE__ */ o("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1122
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-3", children: [
1329
+ return /* @__PURE__ */ i("div", { className: S("flex flex-col h-full", a), children: [
1330
+ /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1331
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1123
1332
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1124
- /* @__PURE__ */ e(pe, { onClick: n })
1333
+ /* @__PURE__ */ e(Oe, { onClick: n })
1125
1334
  ] }),
1126
- /* @__PURE__ */ o("p", { className: "text-xs text-stone mb-3", children: [
1335
+ /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1127
1336
  "Select a ",
1128
- a.slice(0, -1),
1337
+ o.slice(0, -1),
1129
1338
  " to start messaging (",
1130
- k.length,
1339
+ _.length,
1131
1340
  " available)",
1132
- t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
1341
+ t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
1133
1342
  ] }),
1134
1343
  /* @__PURE__ */ e(
1135
- ys,
1344
+ mt,
1136
1345
  {
1137
- searchQuery: h,
1138
- setSearchQuery: g,
1139
- placeholder: i
1346
+ searchQuery: g,
1347
+ setSearchQuery: x,
1348
+ placeholder: c
1140
1349
  }
1141
1350
  )
1142
1351
  ] }),
1143
- v && /* @__PURE__ */ o("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1352
+ p && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1144
1353
  "Error loading ",
1145
- a,
1354
+ o,
1146
1355
  ": ",
1147
- v
1356
+ p
1148
1357
  ] }),
1149
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && k.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1358
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: l && _.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1150
1359
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1151
- /* @__PURE__ */ o("span", { className: "text-sm text-stone", children: [
1360
+ /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1152
1361
  "Loading ",
1153
- a,
1362
+ o,
1154
1363
  "..."
1155
1364
  ] })
1156
- ] }) }) : k.length === 0 ? /* @__PURE__ */ o("div", { className: "p-6 text-center", children: [
1157
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
1158
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : w.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1159
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1160
- ] }) : /* @__PURE__ */ o("ul", { className: "space-y-0", children: [
1161
- k.map((d) => {
1162
- const u = d.name || d.email || d.id, b = d.email && d.name ? d.email : d.phone;
1365
+ ] }) }) : _.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1366
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ie, { className: "h-8 w-8 text-charcoal" }) }),
1367
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${o} found` : w.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1368
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1369
+ ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1370
+ _.map((m) => {
1371
+ const h = m.name || m.email || m.id, v = m.email && m.name ? m.email : m.phone;
1163
1372
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1164
1373
  "button",
1165
1374
  {
1166
1375
  type: "button",
1167
- onClick: () => x(d),
1168
- onKeyDown: (B) => R(B, d),
1376
+ onClick: () => C(m),
1377
+ onKeyDown: (j) => M(j, m),
1169
1378
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
1170
- children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
1171
- /* @__PURE__ */ o("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1379
+ children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1380
+ /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1172
1381
  /* @__PURE__ */ e(
1173
- q,
1382
+ ne,
1174
1383
  {
1175
- id: d.id,
1176
- name: u,
1177
- image: d.image,
1384
+ id: m.id,
1385
+ name: h,
1386
+ image: m.image,
1178
1387
  size: 40
1179
1388
  }
1180
1389
  ),
1181
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
1182
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1183
- b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1390
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1391
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: h }),
1392
+ v && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: v })
1184
1393
  ] })
1185
1394
  ] }),
1186
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === d.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
1395
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === m.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ie, { className: "h-5 w-5 text-stone" }) })
1187
1396
  ] })
1188
1397
  }
1189
- ) }, d.id);
1398
+ ) }, m.id);
1190
1399
  }),
1191
- S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1400
+ l && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1192
1401
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1193
1402
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1194
1403
  ] }) })
1195
1404
  ] }) })
1196
1405
  ] });
1197
- }, Is = ({ className: t }) => /* @__PURE__ */ o(
1406
+ }, ht = ({ className: t }) => /* @__PURE__ */ i(
1198
1407
  "svg",
1199
1408
  {
1200
1409
  width: "140",
@@ -1204,7 +1413,7 @@ const Es = ({
1204
1413
  xmlns: "http://www.w3.org/2000/svg",
1205
1414
  className: t,
1206
1415
  children: [
1207
- /* @__PURE__ */ o("g", { clipPath: "url(#clip0_empty_state)", children: [
1416
+ /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1208
1417
  /* @__PURE__ */ e(
1209
1418
  "path",
1210
1419
  {
@@ -1233,7 +1442,7 @@ const Es = ({
1233
1442
  fill: "white"
1234
1443
  }
1235
1444
  ),
1236
- /* @__PURE__ */ o("g", { filter: "url(#filter0_empty_state)", children: [
1445
+ /* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
1237
1446
  /* @__PURE__ */ e(
1238
1447
  "path",
1239
1448
  {
@@ -1273,8 +1482,8 @@ const Es = ({
1273
1482
  }
1274
1483
  )
1275
1484
  ] }),
1276
- /* @__PURE__ */ o("defs", { children: [
1277
- /* @__PURE__ */ o(
1485
+ /* @__PURE__ */ i("defs", { children: [
1486
+ /* @__PURE__ */ i(
1278
1487
  "filter",
1279
1488
  {
1280
1489
  id: "filter0_empty_state",
@@ -1328,17 +1537,17 @@ const Es = ({
1328
1537
  ] })
1329
1538
  ]
1330
1539
  }
1331
- ), Re = U.memo(
1332
- ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1333
- /* @__PURE__ */ e(Is, {}),
1334
- s && !t && /* @__PURE__ */ o("div", { className: "mt-8", children: [
1540
+ ), Be = P.memo(
1541
+ ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1542
+ /* @__PURE__ */ e(ht, {}),
1543
+ s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1335
1544
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1336
1545
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1337
1546
  ] })
1338
1547
  ] }) })
1339
1548
  );
1340
- Re.displayName = "EmptyState";
1341
- const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ o("div", { className: "text-center max-w-sm", children: [
1549
+ Be.displayName = "EmptyState";
1550
+ const he = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1342
1551
  /* @__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: "⚠️" }) }),
1343
1552
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1344
1553
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1352,117 +1561,117 @@ const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1352
1561
  }
1353
1562
  )
1354
1563
  ] }) }));
1355
- le.displayName = "ErrorState";
1356
- const Ls = ({
1564
+ he.displayName = "ErrorState";
1565
+ const yt = ({
1357
1566
  capabilities: t = {},
1358
1567
  className: s,
1359
1568
  renderMessageInputActions: n,
1360
1569
  onChannelSelect: r,
1361
- onParticipantSelect: a,
1362
- initialParticipantFilter: i,
1363
- initialParticipantData: l,
1364
- CustomChannelEmptyState: m,
1365
- showChannelList: h = !0,
1366
- filters: g,
1570
+ onParticipantSelect: o,
1571
+ initialParticipantFilter: c,
1572
+ initialParticipantData: a,
1573
+ CustomChannelEmptyState: u,
1574
+ showChannelList: g = !0,
1575
+ filters: x,
1367
1576
  channelListCustomEmptyStateIndicator: w,
1368
1577
  onDeleteConversationClick: f,
1369
- onBlockParticipantClick: S,
1370
- onReportParticipantClick: _
1578
+ onBlockParticipantClick: l,
1579
+ onReportParticipantClick: T
1371
1580
  }) => {
1372
1581
  const {
1373
- service: v,
1374
- client: c,
1582
+ service: p,
1583
+ client: d,
1375
1584
  isConnected: N,
1376
1585
  isLoading: E,
1377
1586
  error: I,
1378
- refreshConnection: k,
1379
- debug: x
1380
- } = ls(), [R, d] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [ie, Q] = y(/* @__PURE__ */ new Set()), [X, ce] = y(0), [O, H] = y(!1), [J, $] = y(null), D = z(null), {
1381
- participantSource: T,
1382
- participantLabel: A = "participants",
1383
- showDeleteConversation: V = !0
1384
- } = t, K = U.useMemo(() => {
1385
- const C = c == null ? void 0 : c.userID;
1587
+ refreshConnection: _,
1588
+ debug: C
1589
+ } = $s(), [M, m] = y(null), [h, v] = y(!1), [j, A] = y(!1), [Z, Y] = y(!1), [re, ee] = y(/* @__PURE__ */ new Set()), [se, ae] = y(0), [U, G] = y(!1), [J, z] = y(null), k = W(null), {
1590
+ participantSource: F,
1591
+ participantLabel: B = "participants",
1592
+ showDeleteConversation: H = !0
1593
+ } = t, Q = P.useMemo(() => {
1594
+ const b = d == null ? void 0 : d.userID;
1386
1595
  return {
1387
1596
  ...{
1388
1597
  type: "messaging",
1389
1598
  last_message_at: { $exists: !0 },
1390
- ...C && {
1391
- members: { $in: [C] },
1599
+ ...b && {
1600
+ members: { $in: [b] },
1392
1601
  hidden: !1
1393
1602
  }
1394
1603
  },
1395
- ...g
1604
+ ...x
1396
1605
  };
1397
- }, [g, c == null ? void 0 : c.userID]), ee = z(null), Z = M(async () => {
1398
- if (!c || !N) return;
1399
- const C = c.userID;
1400
- if (C)
1606
+ }, [x, d == null ? void 0 : d.userID]), X = W(null), $ = D(async () => {
1607
+ if (!d || !N) return;
1608
+ const b = d.userID;
1609
+ if (b)
1401
1610
  try {
1402
- x && console.log("[MessagingShell] Syncing channels for user:", C);
1403
- const P = await c.queryChannels(
1611
+ C && console.log("[MessagingShell] Syncing channels for user:", b);
1612
+ const O = await d.queryChannels(
1404
1613
  {
1405
1614
  type: "messaging",
1406
- members: { $in: [C] }
1615
+ members: { $in: [b] }
1407
1616
  },
1408
1617
  {},
1409
1618
  { limit: 100 }
1410
- ), F = /* @__PURE__ */ new Set();
1411
- P.forEach((L) => {
1412
- const de = L.state.members;
1413
- Object.values(de).forEach((Ue) => {
1414
- var he;
1415
- const ue = (he = Ue.user) == null ? void 0 : he.id;
1416
- ue && ue !== C && F.add(ue);
1619
+ ), R = /* @__PURE__ */ new Set();
1620
+ O.forEach((L) => {
1621
+ const oe = L.state.members;
1622
+ Object.values(oe).forEach((Ae) => {
1623
+ var ve;
1624
+ const Ce = (ve = Ae.user) == null ? void 0 : ve.id;
1625
+ Ce && Ce !== b && R.add(Ce);
1417
1626
  });
1418
- }), Q((L) => L.size === F.size && [...L].every((de) => F.has(de)) ? L : F), b(P.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
1419
- channelCount: P.length,
1420
- memberCount: F.size
1627
+ }), ee((L) => L.size === R.size && [...L].every((oe) => R.has(oe)) ? L : R), v(O.length > 0), A(!0), X.current = b, C && console.log("[MessagingShell] Channels synced successfully:", {
1628
+ channelCount: O.length,
1629
+ memberCount: R.size
1421
1630
  });
1422
- } catch (P) {
1423
- console.error("[MessagingShell] Failed to sync channels:", P);
1631
+ } catch (O) {
1632
+ console.error("[MessagingShell] Failed to sync channels:", O);
1424
1633
  }
1425
- }, [c, N, x]);
1426
- G(() => {
1427
- if (!c || !N) return;
1428
- const C = c.userID;
1429
- C && ee.current !== C && Z();
1430
- }, [c, N, Z]), G(() => {
1431
- if (!i || !c || !N) return;
1634
+ }, [d, N, C]);
1635
+ q(() => {
1636
+ if (!d || !N) return;
1637
+ const b = d.userID;
1638
+ b && X.current !== b && $();
1639
+ }, [d, N, $]), q(() => {
1640
+ if (!c || !d || !N) return;
1432
1641
  (async () => {
1433
- const P = c.userID;
1434
- if (P)
1642
+ const O = d.userID;
1643
+ if (O)
1435
1644
  try {
1436
- x && console.log(
1645
+ C && console.log(
1437
1646
  "[MessagingShell] Loading initial conversation with:",
1438
- i
1647
+ c
1439
1648
  );
1440
- const F = await c.queryChannels(
1649
+ const R = await d.queryChannels(
1441
1650
  {
1442
1651
  type: "messaging",
1443
- members: { $eq: [P, i] }
1652
+ members: { $eq: [O, c] }
1444
1653
  },
1445
1654
  {},
1446
1655
  { limit: 1 }
1447
1656
  );
1448
- if (F.length > 0)
1449
- d(F[0]), H(!0), $(null), r && r(F[0]), x && console.log(
1657
+ if (R.length > 0)
1658
+ m(R[0]), G(!0), z(null), r && r(R[0]), C && console.log(
1450
1659
  "[MessagingShell] Initial conversation loaded:",
1451
- F[0].id
1660
+ R[0].id
1452
1661
  );
1453
- else if (l && v) {
1454
- x && console.log(
1662
+ else if (a && p) {
1663
+ C && console.log(
1455
1664
  "[MessagingShell] No conversation found, creating one for:",
1456
- l
1665
+ a
1457
1666
  );
1458
1667
  try {
1459
- const L = await v.startChannelWithParticipant({
1460
- id: l.id,
1461
- name: l.name,
1462
- email: l.email,
1463
- phone: l.phone
1668
+ const L = await p.startChannelWithParticipant({
1669
+ id: a.id,
1670
+ name: a.name,
1671
+ email: a.email,
1672
+ phone: a.phone
1464
1673
  });
1465
- d(L), H(!0), $(null), r && r(L), x && console.log(
1674
+ m(L), G(!0), z(null), r && r(L), C && console.log(
1466
1675
  "[MessagingShell] Channel created and loaded:",
1467
1676
  L.id
1468
1677
  );
@@ -1470,117 +1679,117 @@ const Ls = ({
1470
1679
  console.error(
1471
1680
  "[MessagingShell] Failed to create conversation:",
1472
1681
  L
1473
- ), $("Failed to create conversation");
1682
+ ), z("Failed to create conversation");
1474
1683
  }
1475
1684
  } else
1476
- $(
1685
+ z(
1477
1686
  "No conversation found with this account"
1478
- ), x && console.log(
1687
+ ), C && console.log(
1479
1688
  "[MessagingShell] No conversation found for:",
1480
- i
1689
+ c
1481
1690
  );
1482
- } catch (F) {
1691
+ } catch (R) {
1483
1692
  console.error(
1484
1693
  "[MessagingShell] Failed to load initial conversation:",
1485
- F
1486
- ), $("Failed to load conversation");
1694
+ R
1695
+ ), z("Failed to load conversation");
1487
1696
  }
1488
1697
  })();
1489
1698
  }, [
1490
- i,
1491
- l,
1492
1699
  c,
1700
+ a,
1701
+ d,
1493
1702
  N,
1494
- v,
1495
- x,
1703
+ p,
1704
+ C,
1496
1705
  r
1497
1706
  ]);
1498
- const De = M(
1499
- (C) => {
1500
- d(C), r == null || r(C);
1707
+ const xe = D(
1708
+ (b) => {
1709
+ m(b), r == null || r(b);
1501
1710
  },
1502
1711
  [r]
1503
- ), Me = M(() => {
1504
- O || d(null);
1505
- }, [O]), _e = M(
1506
- async (C) => {
1507
- var P;
1508
- if (v)
1712
+ ), ie = D(() => {
1713
+ U || m(null);
1714
+ }, [U]), ce = D(
1715
+ async (b) => {
1716
+ var O;
1717
+ if (p)
1509
1718
  try {
1510
- x && console.log(
1719
+ C && console.log(
1511
1720
  "[MessagingShell] Starting conversation with:",
1512
- C.id
1721
+ b.id
1513
1722
  );
1514
- const F = await v.startChannelWithParticipant({
1515
- id: C.id,
1516
- name: C.name,
1517
- email: C.email,
1518
- phone: C.phone
1723
+ const R = await p.startChannelWithParticipant({
1724
+ id: b.id,
1725
+ name: b.name,
1726
+ email: b.email,
1727
+ phone: b.phone
1519
1728
  });
1520
1729
  try {
1521
- await F.show();
1730
+ await R.show();
1522
1731
  } catch (L) {
1523
1732
  console.warn("[MessagingShell] Failed to unhide channel:", L);
1524
1733
  }
1525
- d(F), Y(!1), (P = D.current) == null || P.close(), a == null || a(C);
1526
- } catch (F) {
1527
- console.error("[MessagingShell] Failed to start conversation:", F);
1734
+ m(R), Y(!1), (O = k.current) == null || O.close(), o == null || o(b);
1735
+ } catch (R) {
1736
+ console.error("[MessagingShell] Failed to start conversation:", R);
1528
1737
  }
1529
1738
  },
1530
- [v, a, x]
1531
- ), se = M(() => {
1532
- var C;
1533
- Y(!1), (C = D.current) == null || C.close();
1534
- }, []), Fe = M(
1535
- (C) => {
1536
- C.target === D.current && se();
1739
+ [p, o, C]
1740
+ ), K = D(() => {
1741
+ var b;
1742
+ Y(!1), (b = k.current) == null || b.close();
1743
+ }, []), de = D(
1744
+ (b) => {
1745
+ b.target === k.current && K();
1537
1746
  },
1538
- [se]
1539
- ), Te = M(
1540
- async (C) => {
1541
- x && console.log("[MessagingShell] Leaving conversation:", C.id), d(null), H(!1), ee.current = null, await Z();
1747
+ [K]
1748
+ ), le = D(
1749
+ async (b) => {
1750
+ C && console.log("[MessagingShell] Leaving conversation:", b.id), m(null), G(!1), X.current = null, await $();
1542
1751
  },
1543
- [Z, x]
1544
- ), Le = M(
1545
- async (C) => {
1546
- x && console.log("[MessagingShell] Blocking participant:", C), d(null), H(!1), ee.current = null, await Z();
1752
+ [$, C]
1753
+ ), V = D(
1754
+ async (b) => {
1755
+ C && console.log("[MessagingShell] Blocking participant:", b), m(null), G(!1), X.current = null, await $();
1547
1756
  },
1548
- [Z, x]
1549
- ), te = !!R;
1550
- return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !c ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1551
- le,
1757
+ [$, C]
1758
+ ), te = !!M;
1759
+ return E ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : I ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(he, { message: I, onBack: _ }) }) : !N || !d ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(
1760
+ he,
1552
1761
  {
1553
1762
  message: "Not connected to messaging service",
1554
- onBack: k
1763
+ onBack: _
1555
1764
  }
1556
- ) }) : J ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ o(
1765
+ ) }) : J ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(he, { message: J }) }) : /* @__PURE__ */ i(
1557
1766
  "div",
1558
1767
  {
1559
- className: p(
1768
+ className: S(
1560
1769
  "messaging-shell h-full bg-background-primary overflow-hidden",
1561
1770
  s
1562
1771
  ),
1563
1772
  children: [
1564
- /* @__PURE__ */ o("div", { className: "flex h-full min-h-0", children: [
1773
+ /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1565
1774
  /* @__PURE__ */ e(
1566
1775
  "div",
1567
1776
  {
1568
- className: p(
1777
+ className: S(
1569
1778
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1570
1779
  {
1571
- "!hidden": h === !1 || O,
1780
+ "!hidden": g === !1 || U,
1572
1781
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1573
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !O && te,
1782
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !U && te,
1574
1783
  // Show on mobile when no channel selected, use same wide width on desktop
1575
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !te
1784
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !U && !te
1576
1785
  }
1577
1786
  ),
1578
1787
  children: /* @__PURE__ */ e(
1579
- Ie,
1788
+ Fe,
1580
1789
  {
1581
- onChannelSelect: De,
1582
- selectedChannel: R || void 0,
1583
- filters: K,
1790
+ onChannelSelect: xe,
1791
+ selectedChannel: M || void 0,
1792
+ filters: Q,
1584
1793
  customEmptyStateIndicator: w
1585
1794
  }
1586
1795
  )
@@ -1589,70 +1798,70 @@ const Ls = ({
1589
1798
  /* @__PURE__ */ e(
1590
1799
  "div",
1591
1800
  {
1592
- className: p(
1801
+ className: S(
1593
1802
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1594
1803
  {
1595
1804
  // In direct conversation mode (or waiting for it), always show (full width)
1596
- flex: O || te || i,
1805
+ flex: U || te || c,
1597
1806
  // Normal mode: hide on mobile when no channel selected
1598
- "hidden lg:flex": !O && !te && !i
1807
+ "hidden lg:flex": !U && !te && !c
1599
1808
  }
1600
1809
  ),
1601
- children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1602
- ke,
1810
+ children: M ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1811
+ Ue,
1603
1812
  {
1604
- channel: R,
1605
- onBack: Me,
1606
- showBackButton: !O,
1813
+ channel: M,
1814
+ onBack: ie,
1815
+ showBackButton: !U,
1607
1816
  renderMessageInputActions: n,
1608
- onLeaveConversation: Te,
1609
- onBlockParticipant: Le,
1610
- CustomChannelEmptyState: m,
1611
- showDeleteConversation: V,
1817
+ onLeaveConversation: le,
1818
+ onBlockParticipant: V,
1819
+ CustomChannelEmptyState: u,
1820
+ showDeleteConversation: H,
1612
1821
  onDeleteConversationClick: f,
1613
- onBlockParticipantClick: S,
1614
- onReportParticipantClick: _
1822
+ onBlockParticipantClick: l,
1823
+ onReportParticipantClick: T
1615
1824
  },
1616
- R.id
1617
- ) }) : i ? (
1825
+ M.id
1826
+ ) }) : c ? (
1618
1827
  // Show loading while creating/loading direct conversation channel
1619
- /* @__PURE__ */ e(ae, {})
1828
+ /* @__PURE__ */ e(fe, {})
1620
1829
  ) : /* @__PURE__ */ e(
1621
- Re,
1830
+ Be,
1622
1831
  {
1623
- hasChannels: u,
1624
- channelsLoaded: B
1832
+ hasChannels: h,
1833
+ channelsLoaded: j
1625
1834
  }
1626
1835
  )
1627
1836
  }
1628
1837
  )
1629
1838
  ] }),
1630
- T && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1839
+ F && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1631
1840
  /* @__PURE__ */ e(
1632
1841
  "dialog",
1633
1842
  {
1634
- ref: D,
1843
+ ref: k,
1635
1844
  className: "mes-dialog",
1636
- onClick: Fe,
1637
- onClose: se,
1845
+ onClick: de,
1846
+ onClose: K,
1638
1847
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1639
- Es,
1848
+ ut,
1640
1849
  {
1641
- participantSource: T,
1642
- onSelectParticipant: _e,
1643
- onClose: se,
1644
- existingParticipantIds: ie,
1645
- participantLabel: A,
1646
- searchPlaceholder: `Search ${A}...`
1850
+ participantSource: F,
1851
+ onSelectParticipant: ce,
1852
+ onClose: K,
1853
+ existingParticipantIds: re,
1854
+ participantLabel: B,
1855
+ searchPlaceholder: `Search ${B}...`
1647
1856
  },
1648
- X
1857
+ se
1649
1858
  ) })
1650
1859
  }
1651
1860
  )
1652
1861
  ]
1653
1862
  }
1654
1863
  );
1655
- }, Ss = ({
1864
+ }, ft = ({
1656
1865
  question: t,
1657
1866
  onClick: s,
1658
1867
  loading: n = !1,
@@ -1664,7 +1873,7 @@ const Ls = ({
1664
1873
  onClick: s,
1665
1874
  disabled: n,
1666
1875
  style: { backgroundColor: "#E6E5E3" },
1667
- className: p(
1876
+ className: S(
1668
1877
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1669
1878
  {
1670
1879
  "hover:brightness-95 active:brightness-90": !n,
@@ -1674,100 +1883,100 @@ const Ls = ({
1674
1883
  ),
1675
1884
  children: t
1676
1885
  }
1677
- ), Us = ({
1886
+ ), Et = ({
1678
1887
  faqs: t,
1679
1888
  onFaqClick: s,
1680
1889
  loadingFaqId: n,
1681
1890
  headerText: r,
1682
- className: a,
1683
- avatarImage: i,
1684
- avatarName: l
1891
+ className: o,
1892
+ avatarImage: c,
1893
+ avatarName: a
1685
1894
  }) => {
1686
- const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
1687
- return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ o("div", { className: "flex gap-3 items-end", children: [
1688
- (i || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1689
- q,
1895
+ const u = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
1896
+ return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1897
+ (c || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1898
+ ne,
1690
1899
  {
1691
- id: l || "account",
1692
- name: l || "Account",
1693
- image: i,
1900
+ id: a || "account",
1901
+ name: a || "Account",
1902
+ image: c,
1694
1903
  size: 24,
1695
1904
  shape: "circle"
1696
1905
  }
1697
1906
  ) }),
1698
- /* @__PURE__ */ o(
1907
+ /* @__PURE__ */ i(
1699
1908
  "div",
1700
1909
  {
1701
1910
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1702
1911
  style: { backgroundColor: "#F1F0EE" },
1703
1912
  children: [
1704
1913
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1705
- m.map((h) => /* @__PURE__ */ e(
1706
- Ss,
1914
+ u.map((g) => /* @__PURE__ */ e(
1915
+ ft,
1707
1916
  {
1708
- question: h.question,
1709
- onClick: () => s(h.id),
1710
- loading: n === h.id
1917
+ question: g.question,
1918
+ onClick: () => s(g.id),
1919
+ loading: n === g.id
1711
1920
  },
1712
- h.id
1921
+ g.id
1713
1922
  ))
1714
1923
  ]
1715
1924
  }
1716
1925
  )
1717
1926
  ] }) });
1718
- }, Ps = (t, s = {}) => {
1719
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, i] = y([]), [l, m] = y(!1), [h, g] = y(null), [w, f] = y(n), [S, _] = y(!0), [v, c] = y(), N = M(async (x = !1, R) => {
1720
- if (l) return;
1721
- const d = R !== void 0 ? R : w;
1722
- m(!0), g(null);
1927
+ }, It = (t, s = {}) => {
1928
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [o, c] = y([]), [a, u] = y(!1), [g, x] = y(null), [w, f] = y(n), [l, T] = y(!0), [p, d] = y(), N = D(async (C = !1, M) => {
1929
+ if (a) return;
1930
+ const m = M !== void 0 ? M : w;
1931
+ u(!0), x(null);
1723
1932
  try {
1724
- const u = await t.loadParticipants({
1725
- search: d || void 0,
1933
+ const h = await t.loadParticipants({
1934
+ search: m || void 0,
1726
1935
  limit: r,
1727
- cursor: x ? void 0 : v
1936
+ cursor: C ? void 0 : p
1728
1937
  });
1729
- i(
1730
- (b) => x ? u.participants : [...b, ...u.participants]
1731
- ), _(u.hasMore), c(u.nextCursor);
1732
- } catch (u) {
1733
- const b = u instanceof Error ? u.message : "Failed to load participants";
1734
- g(b), console.error("[useParticipants] Load error:", u);
1938
+ c(
1939
+ (v) => C ? h.participants : [...v, ...h.participants]
1940
+ ), T(h.hasMore), d(h.nextCursor);
1941
+ } catch (h) {
1942
+ const v = h instanceof Error ? h.message : "Failed to load participants";
1943
+ x(v), console.error("[useParticipants] Load error:", h);
1735
1944
  } finally {
1736
- m(!1);
1945
+ u(!1);
1737
1946
  }
1738
- }, [t, w, v, r, l]), E = M(() => {
1739
- S && !l && N(!1);
1740
- }, [S, l, N]), I = M((x) => {
1741
- f(x), c(void 0), N(!0, x);
1742
- }, [N]), k = M(() => {
1743
- c(void 0), N(!0);
1947
+ }, [t, w, p, r, a]), E = D(() => {
1948
+ l && !a && N(!1);
1949
+ }, [l, a, N]), I = D((C) => {
1950
+ f(C), d(void 0), N(!0, C);
1951
+ }, [N]), _ = D(() => {
1952
+ d(void 0), N(!0);
1744
1953
  }, [N]);
1745
- return G(() => {
1954
+ return q(() => {
1746
1955
  N(!0);
1747
1956
  }, [t.loadParticipants]), {
1748
- participants: a,
1749
- loading: l,
1750
- error: h,
1957
+ participants: o,
1958
+ loading: a,
1959
+ error: g,
1751
1960
  searchQuery: w,
1752
- hasMore: S,
1961
+ hasMore: l,
1753
1962
  totalCount: t.totalCount,
1754
1963
  loadMore: E,
1755
1964
  search: I,
1756
- refresh: k
1965
+ refresh: _
1757
1966
  };
1758
1967
  };
1759
1968
  export {
1760
- q as Avatar,
1761
- Ns as ChannelEmptyState,
1762
- Ie as ChannelList,
1763
- ke as ChannelView,
1764
- Us as FaqList,
1765
- Ss as FaqListItem,
1766
- Ts as MessagingProvider,
1767
- Ls as MessagingShell,
1768
- Es as ParticipantPicker,
1769
- os as formatRelativeTime,
1770
- ls as useMessaging,
1771
- Ps as useParticipants
1969
+ ne as Avatar,
1970
+ lt as ChannelEmptyState,
1971
+ Fe as ChannelList,
1972
+ Ue as ChannelView,
1973
+ Et as FaqList,
1974
+ ft as FaqListItem,
1975
+ pt as MessagingProvider,
1976
+ yt as MessagingShell,
1977
+ ut as ParticipantPicker,
1978
+ zs as formatRelativeTime,
1979
+ $s as useMessaging,
1980
+ It as useParticipants
1772
1981
  };
1773
1982
  //# sourceMappingURL=index.js.map