@linktr.ee/messaging-react 1.11.5 โ†’ 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as i, Fragment as ge } from "react/jsx-runtime";
2
- import R from "classnames";
3
- import L, { createContext as Fe, useContext as Pe, useCallback as _, useState as v, useRef as z, useEffect as G } from "react";
4
- import { StreamChatService as Te } from "@linktr.ee/messaging-core";
5
- import { Chat as Le, ChannelList as Ue, useMessageComposer as Oe, useStateStore as je, MessageInput as Be, useMessageInputContext as Ae, useMessageComposerHasSendableData as ze, SimpleAttachmentSelector as $e, QuotedMessagePreview as Ge, AttachmentPreviewList as He, TextareaComposer as Ve, MessageTimestamp as We, Channel as Ze, useChannelStateContext as xe, Window as qe, MessageList as Ye } from "stream-chat-react";
6
- import { XIcon as oe, ArrowUpIcon as Je, ArrowLeftIcon as ce, DotsThreeIcon as de, SpinnerGapIcon as se, SignOutIcon as Qe, ProhibitInsetIcon as ue, FlagIcon as Xe, MagnifyingGlassIcon as Ke, ChatCircleDotsIcon as me } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as he } from "stream-chat";
8
- const Ce = Fe({
1
+ import { jsx as e, jsxs as i, Fragment as Ce } from "react/jsx-runtime";
2
+ import p from "classnames";
3
+ import P, { createContext as Ue, useContext as Oe, useCallback as D, 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, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as ve, Window as Xe, MessageList as Ke } from "stream-chat-react";
6
+ import { XIcon as ue, ArrowUpIcon as es, ArrowLeftIcon as he, DotsThreeIcon as fe, SpinnerGapIcon as re, SignOutIcon as ss, ProhibitInsetIcon as ge, FlagIcon as ts, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as xe } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as Ne } from "stream-chat";
8
+ const we = Ue({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,19 +15,19 @@ const Ce = Fe({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ne = () => Pe(Ce), Ss = ({
18
+ }), ae = () => Oe(we), Ms = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
23
  capabilities: a = {},
24
- debug: o = !1
24
+ debug: d = !1
25
25
  }) => {
26
- const l = _(
27
- (m, ...N) => {
28
- o && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...N);
26
+ const l = D(
27
+ (u, ...b) => {
28
+ d && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...b);
29
29
  },
30
- [o]
30
+ [d]
31
31
  );
32
32
  l("๐Ÿ”„ RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
@@ -35,14 +35,14 @@ const Ce = Fe({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(a)
37
37
  });
38
- const [d, h] = v(null), [b, k] = v(null), [u, f] = v(!1), [g, w] = v(!1), [y, E] = v(null), C = z(!1), I = z({
38
+ const [m, h] = y(null), [g, w] = y(null), [f, S] = y(!1), [M, v] = y(!1), [c, N] = y(null), E = z(!1), I = z({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: a
43
- }), p = z(0);
44
- p.current++, l("๐Ÿ“Š RENDER INFO", {
45
- renderCount: p.current,
43
+ }), k = z(0);
44
+ k.current++, l("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: k.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),
@@ -56,9 +56,9 @@ const Ce = Fe({
56
56
  serviceConfig: n,
57
57
  capabilities: a
58
58
  }, G(() => {
59
- const m = p.current;
59
+ const u = k.current;
60
60
  if (l("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: m,
61
+ renderCount: u,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
@@ -69,50 +69,50 @@ const Ce = Fe({
69
69
  }
70
70
  }), !r || !n) {
71
71
  l("โš ๏ธ SERVICE INIT SKIPPED", {
72
- renderCount: m,
72
+ renderCount: u,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  l("๐Ÿš€ CREATING NEW SERVICE", {
78
- renderCount: m,
78
+ renderCount: u,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const N = new Te({
82
+ const b = new je({
83
83
  ...n,
84
84
  apiKey: r,
85
- debug: o
85
+ debug: d
86
86
  });
87
- return h(N), l("โœ… SERVICE SET", {
88
- renderCount: m,
89
- serviceInstance: !!N
87
+ return h(b), l("โœ… SERVICE SET", {
88
+ renderCount: u,
89
+ serviceInstance: !!b
90
90
  }), () => {
91
91
  l("๐Ÿงน SERVICE CLEANUP", {
92
- renderCount: m,
92
+ renderCount: u,
93
93
  reason: "Effect cleanup"
94
- }), N.disconnectUser().catch(console.error);
94
+ }), b.disconnectUser().catch(console.error);
95
95
  };
96
- }, [r, n, o, l]);
97
- const S = z(null);
96
+ }, [r, n, d, l]);
97
+ const x = z(null);
98
98
  G(() => {
99
- var N, A;
99
+ var b, B;
100
100
  if (l("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!d,
101
+ hasService: !!m,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: C.current,
105
- isConnected: u,
106
- dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
107
- }), !d || !s) {
104
+ isConnecting: E.current,
105
+ isConnected: f,
106
+ dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
+ }), !m || !s) {
108
108
  l("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (C.current) {
111
+ if (E.current) {
112
112
  l("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = S.current) == null ? void 0 : N.serviceId) === d && ((A = S.current) == null ? void 0 : A.userId) === s.id) {
115
+ if (((b = x.current) == null ? void 0 : b.serviceId) === m && ((B = x.current) == null ? void 0 : B.userId) === s.id) {
116
116
  l(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,114 +120,114 @@ const Ce = Fe({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- l("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), C.current = !0, w(!0), E(null);
123
+ l("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), E.current = !0, v(!0), N(null);
124
124
  try {
125
125
  l("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const j = await d.connectUser(s);
127
- k(j), f(!0), S.current = { serviceId: d, userId: s.id }, l("โœ… USER CONNECTION SUCCESS", {
126
+ const j = await m.connectUser(s);
127
+ w(j), S(!0), x.current = { serviceId: m, userId: s.id }, l("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: j.userID
130
130
  });
131
131
  } catch (j) {
132
- const H = j instanceof Error ? j.message : "Connection failed";
133
- E(H), l("โŒ USER CONNECTION ERROR", {
132
+ const W = j instanceof Error ? j.message : "Connection failed";
133
+ N(W), l("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: H
135
+ error: W
136
136
  });
137
137
  } finally {
138
- w(!1), C.current = !1, l("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ v(!1), E.current = !1, l("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: u
140
+ isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [d, s, l, u]), G(() => (l("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
- hasService: !!d,
146
- isConnected: u
144
+ }, [m, s, l, f]), G(() => (l("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!m,
146
+ isConnected: f
147
147
  }), () => {
148
- d && u ? (l(
148
+ m && f ? (l(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), S.current = null, d.disconnectUser().catch(console.error)) : l("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
- hasService: !!d,
153
- isConnected: u
151
+ ), x.current = null, m.disconnectUser().catch(console.error)) : l("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!m,
153
+ isConnected: f
154
154
  });
155
- }), [d, u, l]);
156
- const P = _(async () => {
155
+ }), [m, f, l]);
156
+ const R = D(async () => {
157
157
  if (l("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
- hasService: !!d,
158
+ hasService: !!m,
159
159
  hasUser: !!s
160
- }), !d || !s) {
160
+ }), !m || !s) {
161
161
  l("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- l("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
164
+ l("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
165
165
  try {
166
- l("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await d.disconnectUser(), l("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
- const m = await d.connectUser(s);
168
- k(m), f(!0), E(null), l("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (m) {
170
- const N = m instanceof Error ? m.message : "Refresh failed";
171
- E(N), l("โŒ CONNECTION REFRESH ERROR", {
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", {
172
172
  userId: s.id,
173
- error: N
173
+ error: b
174
174
  });
175
175
  } finally {
176
- w(!1), l("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ v(!1), l("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [d, s, l]), c = L.useMemo(() => (l("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!d,
180
- hasClient: !!b,
181
- isConnected: u,
182
- isLoading: g,
183
- hasError: !!y,
178
+ }, [m, s, l]), o = P.useMemo(() => (l("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!m,
180
+ hasClient: !!g,
181
+ isConnected: f,
182
+ isLoading: M,
183
+ hasError: !!c,
184
184
  capabilitiesKeys: Object.keys(a)
185
185
  }), {
186
- service: d,
187
- client: b,
188
- isConnected: u,
189
- isLoading: g,
190
- error: y,
186
+ service: m,
187
+ client: g,
188
+ isConnected: f,
189
+ isLoading: M,
190
+ error: c,
191
191
  capabilities: a,
192
- refreshConnection: P,
193
- debug: o
192
+ refreshConnection: R,
193
+ debug: d
194
194
  }), [
195
- d,
196
- b,
197
- u,
195
+ m,
198
196
  g,
199
- y,
197
+ f,
198
+ M,
199
+ c,
200
200
  a,
201
- P,
202
- o,
201
+ R,
202
+ d,
203
203
  l
204
204
  ]);
205
205
  return l("๐Ÿ”„ RENDER END", {
206
- renderCount: p.current,
207
- willRenderChat: !!(b && u),
208
- contextValueReady: !!c
209
- }), /* @__PURE__ */ e(Ce.Provider, { value: c, children: b && u ? /* @__PURE__ */ e(
210
- Le,
206
+ renderCount: k.current,
207
+ willRenderChat: !!(g && f),
208
+ contextValueReady: !!o
209
+ }), /* @__PURE__ */ e(we.Provider, { value: o, children: g && f ? /* @__PURE__ */ e(
210
+ Ae,
211
211
  {
212
- client: b,
212
+ client: g,
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
- }, es = () => ne(), ss = (t, s) => {
219
+ }, rs = () => ae(), ls = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
222
  ), a = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
225
  return Math.floor(a / (1e3 * 60 * 60 * 24));
226
- }, ts = (t) => {
226
+ }, as = (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 = ss(t, s);
230
+ const r = ls(t, s);
231
231
  return r === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit"
@@ -236,7 +236,7 @@ const Ce = Fe({
236
236
  day: "numeric",
237
237
  year: "2-digit"
238
238
  });
239
- }, fe = [
239
+ }, be = [
240
240
  "๐ŸŽ",
241
241
  // Apple
242
242
  "๐ŸŒ",
@@ -264,7 +264,7 @@ const Ce = Fe({
264
264
  "๐Ÿˆ"
265
265
  // Melon
266
266
  ];
267
- function ns(t) {
267
+ function os(t) {
268
268
  let s = 0;
269
269
  for (let n = 0; n < t.length; n++) {
270
270
  const r = t.charCodeAt(n);
@@ -272,25 +272,25 @@ function ns(t) {
272
272
  }
273
273
  return Math.abs(s);
274
274
  }
275
- function rs(t) {
276
- const n = ns(t) % fe.length;
277
- return fe[n];
275
+ function is(t) {
276
+ const n = os(t) % be.length;
277
+ return be[n];
278
278
  }
279
- const Z = ({
279
+ const q = ({
280
280
  id: t,
281
281
  image: s,
282
282
  size: n = 40,
283
283
  className: r,
284
284
  shape: a = "squircle"
285
285
  }) => {
286
- const o = rs(t), d = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = a === "circle" ? { borderRadius: "50%" } : {
286
+ const d = is(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = a === "circle" ? { borderRadius: "50%" } : {
287
287
  borderRadius: "33%",
288
288
  "corner-shape": "superellipse(1.3)"
289
289
  };
290
290
  return /* @__PURE__ */ e(
291
291
  "div",
292
292
  {
293
- className: R("flex-shrink-0 overflow-hidden", r),
293
+ className: p("flex-shrink-0 overflow-hidden", r),
294
294
  style: {
295
295
  width: `${n}px`,
296
296
  height: `${n}px`,
@@ -307,56 +307,56 @@ const Z = ({
307
307
  "div",
308
308
  {
309
309
  "aria-hidden": "true",
310
- className: R(
310
+ className: p(
311
311
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
312
- d
312
+ m
313
313
  ),
314
- children: o
314
+ children: d
315
315
  }
316
316
  )
317
317
  }
318
318
  );
319
- }, Ne = L.memo(
319
+ }, ye = P.memo(
320
320
  ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
321
- var E, C, I, p, S, P;
322
- const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
321
+ var N, E, I, k, x, R;
322
+ const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
323
323
  t && n(t);
324
- }, h = Object.values(((E = t == null ? void 0 : t.state) == null ? void 0 : E.members) || {}).find(
325
- (c) => {
326
- var m, N;
327
- return ((m = c.user) == null ? void 0 : m.id) && c.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
324
+ }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
325
+ (o) => {
326
+ var u, b;
327
+ return ((u = o.user) == null ? void 0 : u.id) && o.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
328
328
  }
329
- ), b = ((C = h == null ? void 0 : h.user) == null ? void 0 : C.name) || "Conversation", k = (I = h == null ? void 0 : h.user) == null ? void 0 : I.image, u = (S = (p = t == null ? void 0 : t.state) == null ? void 0 : p.messages) == null ? void 0 : S[t.state.messages.length - 1], g = (() => {
330
- var m;
331
- if (u != null && u.text) return u.text;
332
- const c = (m = u == null ? void 0 : u.attachments) == null ? void 0 : m[0];
333
- return c != null && c.asset_url ? c.asset_url : c != null && c.image_url ? c.image_url : c != null && c.og_scrape_url ? c.og_scrape_url : c != null && c.thumb_url ? c.thumb_url : "No messages yet";
334
- })(), w = u != null && u.created_at ? ts(new Date(u.created_at)) : "", y = a ?? 0;
329
+ ), 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], M = (() => {
330
+ var u;
331
+ if (f != null && f.text) return f.text;
332
+ const o = (u = f == null ? void 0 : f.attachments) == null ? void 0 : u[0];
333
+ return o != null && o.asset_url ? o.asset_url : o != null && o.image_url ? o.image_url : o != null && o.og_scrape_url ? o.og_scrape_url : o != null && o.thumb_url ? o.thumb_url : "No messages yet";
334
+ })(), v = f != null && f.created_at ? as(new Date(f.created_at)) : "", c = a ?? 0;
335
335
  return r && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
336
336
  channelId: t == null ? void 0 : t.id,
337
- isSelected: o,
338
- participantName: b,
339
- unreadCount: y,
340
- hasTimestamp: !!w
337
+ isSelected: d,
338
+ participantName: g,
339
+ unreadCount: c,
340
+ hasTimestamp: !!v
341
341
  }), /* @__PURE__ */ e(
342
342
  "button",
343
343
  {
344
344
  type: "button",
345
345
  onClick: l,
346
- className: R(
346
+ className: p(
347
347
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
348
348
  {
349
- "bg-primary-alt/10 border-l-4 border-l-primary": o,
350
- "hover:bg-sand": !o
349
+ "bg-primary-alt/10 border-l-4 border-l-primary": d,
350
+ "hover:bg-sand": !d
351
351
  }
352
352
  ),
353
353
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
354
354
  /* @__PURE__ */ e(
355
- Z,
355
+ q,
356
356
  {
357
- id: ((P = h == null ? void 0 : h.user) == null ? void 0 : P.id) || t.id || "unknown",
358
- name: b,
359
- image: k,
357
+ id: ((R = h == null ? void 0 : h.user) == null ? void 0 : R.id) || t.id || "unknown",
358
+ name: g,
359
+ image: w,
360
360
  size: 44,
361
361
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
362
362
  }
@@ -366,18 +366,18 @@ const Z = ({
366
366
  /* @__PURE__ */ e(
367
367
  "h3",
368
368
  {
369
- className: R(
369
+ className: p(
370
370
  "text-sm font-medium truncate",
371
- o ? "text-primary" : "text-charcoal"
371
+ d ? "text-primary" : "text-charcoal"
372
372
  ),
373
- children: b
373
+ children: g
374
374
  }
375
375
  ),
376
- w && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: w })
376
+ v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
377
377
  ] }),
378
378
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
379
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: g }),
380
- y > 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: y > 99 ? "99+" : y })
379
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: M }),
380
+ 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 })
381
381
  ] })
382
382
  ] })
383
383
  ] })
@@ -385,8 +385,8 @@ const Z = ({
385
385
  );
386
386
  }
387
387
  );
388
- Ne.displayName = "CustomChannelPreview";
389
- const be = L.memo(
388
+ ye.displayName = "CustomChannelPreview";
389
+ const Ee = P.memo(
390
390
  ({
391
391
  onChannelSelect: t,
392
392
  selectedChannel: s,
@@ -394,18 +394,18 @@ const be = L.memo(
394
394
  className: r,
395
395
  customEmptyStateIndicator: a
396
396
  }) => {
397
- const o = L.useRef(0);
398
- o.current++;
399
- const { debug: l = !1 } = ne();
397
+ const d = P.useRef(0);
398
+ d.current++;
399
+ const { debug: l = !1 } = ae();
400
400
  l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
401
- renderCount: o.current,
401
+ renderCount: d.current,
402
402
  selectedChannelId: s == null ? void 0 : s.id,
403
403
  filters: n
404
404
  });
405
- const d = L.useMemo(() => (b) => /* @__PURE__ */ e(
406
- Ne,
405
+ const m = P.useMemo(() => (g) => /* @__PURE__ */ e(
406
+ ye,
407
407
  {
408
- ...b,
408
+ ...g,
409
409
  selectedChannel: s,
410
410
  onChannelSelect: t,
411
411
  debug: l
@@ -414,17 +414,17 @@ const be = L.memo(
414
414
  return /* @__PURE__ */ e(
415
415
  "div",
416
416
  {
417
- className: R(
417
+ className: p(
418
418
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
419
419
  r
420
420
  ),
421
421
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
422
- Ue,
422
+ ze,
423
423
  {
424
424
  filters: n,
425
425
  sort: { last_message_at: -1 },
426
426
  options: { limit: 30 },
427
- Preview: d,
427
+ Preview: m,
428
428
  EmptyStateIndicator: a
429
429
  },
430
430
  JSON.stringify(n)
@@ -433,8 +433,8 @@ const be = L.memo(
433
433
  );
434
434
  }
435
435
  );
436
- be.displayName = "ChannelList";
437
- const ee = ({
436
+ Ee.displayName = "ChannelList";
437
+ const ne = ({
438
438
  variant: t = "default",
439
439
  className: s,
440
440
  children: n,
@@ -443,7 +443,7 @@ const ee = ({
443
443
  "button",
444
444
  {
445
445
  type: "button",
446
- className: R(
446
+ className: p(
447
447
  "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",
448
448
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
449
449
  s
@@ -452,12 +452,12 @@ const ee = ({
452
452
  children: n
453
453
  }
454
454
  );
455
- function ve({ label: t, className: s, children: n, ...r }) {
455
+ function Ie({ label: t, className: s, children: n, ...r }) {
456
456
  return /* @__PURE__ */ i(
457
457
  "button",
458
458
  {
459
459
  type: "button",
460
- className: R(
460
+ className: p(
461
461
  "rounded-full p-2 transition-colors focus-ring",
462
462
  {
463
463
  "cursor-not-allowed opacity-50": r.disabled,
@@ -473,14 +473,14 @@ function ve({ label: t, className: s, children: n, ...r }) {
473
473
  }
474
474
  );
475
475
  }
476
- function we({ onClick: t }) {
477
- return /* @__PURE__ */ e(ve, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
476
+ function Se({ onClick: t }) {
477
+ return /* @__PURE__ */ e(Ie, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-stone", weight: "bold" }) });
478
478
  }
479
- const ls = (t) => ({
479
+ const cs = (t) => ({
480
480
  linkPreviews: Array.from(t.previews.values()).filter(
481
- (s) => he.previewIsLoaded(s) || he.previewIsLoading(s)
481
+ (s) => Ne.previewIsLoaded(s) || Ne.previewIsLoading(s)
482
482
  )
483
- }), as = ({
483
+ }), ds = ({
484
484
  link: t,
485
485
  onDismiss: s
486
486
  }) => {
@@ -510,7 +510,7 @@ const ls = (t) => ({
510
510
  },
511
511
  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",
512
512
  "aria-label": "Close link preview",
513
- children: /* @__PURE__ */ e(oe, { className: "size-4 text-black/90" })
513
+ children: /* @__PURE__ */ e(ue, { className: "size-4 text-black/90" })
514
514
  }
515
515
  ),
516
516
  /* @__PURE__ */ i("div", { className: "p-2", children: [
@@ -520,32 +520,32 @@ const ls = (t) => ({
520
520
  ]
521
521
  }
522
522
  );
523
- }, os = () => {
524
- const { linkPreviewsManager: t } = Oe(), { linkPreviews: s } = je(
523
+ }, us = () => {
524
+ const { linkPreviewsManager: t } = Be(), { linkPreviews: s } = $e(
525
525
  t.state,
526
- ls
526
+ cs
527
527
  ), n = (a) => {
528
528
  t.dismissPreview(a);
529
529
  };
530
530
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((a) => /* @__PURE__ */ e(
531
- as,
531
+ ds,
532
532
  {
533
533
  link: a,
534
534
  onDismiss: n
535
535
  },
536
536
  a.og_scrape_url
537
537
  )) }) : null;
538
- }, is = () => {
539
- const { handleSubmit: t } = Ae(), s = ze();
540
- return /* @__PURE__ */ i(ge, { children: [
541
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e($e, {}) }),
538
+ }, ms = () => {
539
+ const { handleSubmit: t } = He(), s = Ve();
540
+ return /* @__PURE__ */ i(Ce, { children: [
541
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(We, {}) }),
542
542
  /* @__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: [
543
- /* @__PURE__ */ e(Ge, {}),
544
- /* @__PURE__ */ e(os, {}),
545
- /* @__PURE__ */ e(He, {}),
543
+ /* @__PURE__ */ e(Ze, {}),
544
+ /* @__PURE__ */ e(us, {}),
545
+ /* @__PURE__ */ e(qe, {}),
546
546
  /* @__PURE__ */ i("div", { className: "flex", children: [
547
547
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
548
- Ve,
548
+ Ye,
549
549
  {
550
550
  className: "w-full resize-none outline-none leading-6",
551
551
  maxRows: 4
@@ -560,18 +560,18 @@ const ls = (t) => ({
560
560
  disabled: !s,
561
561
  onClick: t,
562
562
  type: "button",
563
- children: /* @__PURE__ */ e(Je, { className: "size-4" })
563
+ children: /* @__PURE__ */ e(es, { className: "size-4" })
564
564
  }
565
565
  )
566
566
  ] })
567
567
  ] })
568
568
  ] });
569
- }, cs = ({
569
+ }, hs = ({
570
570
  renderActions: t
571
571
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
572
572
  t && (t == null ? void 0 : t()),
573
- /* @__PURE__ */ e(Be, { Input: is })
574
- ] }), ds = (t) => {
573
+ /* @__PURE__ */ e(Ge, { Input: ms })
574
+ ] }), fs = (t) => {
575
575
  const s = t.message.hide_date === !0;
576
576
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
577
577
  /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
@@ -579,22 +579,22 @@ const ls = (t) => ({
579
579
  /* @__PURE__ */ e("p", { children: t.message.text }),
580
580
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
581
581
  ] }),
582
- !s && /* @__PURE__ */ e(We, { message: t.message })
582
+ !s && /* @__PURE__ */ e(Je, { message: t.message })
583
583
  ] });
584
- }, us = () => null, ms = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
585
- var h, b, k, u, f;
586
- const { channel: a } = xe(), o = L.useMemo(() => Object.values(a.state.members || {}).find(
587
- (w) => {
588
- var y;
589
- return ((y = w.user) == null ? void 0 : y.id) && w.user.id !== a._client.userID;
584
+ }, gs = () => null, xs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
585
+ var h, g, w, f, S;
586
+ const { channel: a } = ve(), d = P.useMemo(() => Object.values(a.state.members || {}).find(
587
+ (v) => {
588
+ var c;
589
+ return ((c = v.user) == null ? void 0 : c.id) && v.user.id !== a._client.userID;
590
590
  }
591
- ), [a._client.userID, a.state.members]), l = ((h = o == null ? void 0 : o.user) == null ? void 0 : h.name) || ((b = o == null ? void 0 : o.user) == null ? void 0 : b.id) || "Unknown member", d = (k = o == null ? void 0 : o.user) == null ? void 0 : k.image;
591
+ ), [a._client.userID, a.state.members]), l = ((h = d == null ? void 0 : d.user) == null ? void 0 : h.name) || ((g = d == null ? void 0 : d.user) == null ? void 0 : g.id) || "Unknown member", m = (w = d == null ? void 0 : d.user) == null ? void 0 : w.image;
592
592
  return /* @__PURE__ */ i("div", { className: "@container", children: [
593
593
  /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
594
594
  /* @__PURE__ */ e(
595
595
  "button",
596
596
  {
597
- className: R(
597
+ className: p(
598
598
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
599
599
  !s && "invisible"
600
600
  ),
@@ -602,16 +602,16 @@ const ls = (t) => ({
602
602
  }),
603
603
  type: "button",
604
604
  "aria-label": "Back to conversations",
605
- children: /* @__PURE__ */ e(ce, { className: "size-5 text-black/90" })
605
+ children: /* @__PURE__ */ e(he, { className: "size-5 text-black/90" })
606
606
  }
607
607
  ),
608
608
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
609
609
  /* @__PURE__ */ e(
610
- Z,
610
+ q,
611
611
  {
612
- id: ((u = o == null ? void 0 : o.user) == null ? void 0 : u.id) || a.id || "unknown",
612
+ id: ((f = d == null ? void 0 : d.user) == null ? void 0 : f.id) || a.id || "unknown",
613
613
  name: l,
614
- image: d,
614
+ image: m,
615
615
  size: 40
616
616
  }
617
617
  ),
@@ -620,13 +620,13 @@ const ls = (t) => ({
620
620
  /* @__PURE__ */ e(
621
621
  "button",
622
622
  {
623
- className: R(
623
+ className: p(
624
624
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
625
625
  ),
626
626
  onClick: n,
627
627
  type: "button",
628
628
  "aria-label": "Show info",
629
- children: /* @__PURE__ */ e(de, { className: "size-5 text-black/90" })
629
+ children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
630
630
  }
631
631
  )
632
632
  ] }),
@@ -639,15 +639,15 @@ const ls = (t) => ({
639
639
  onClick: t,
640
640
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
641
641
  "aria-label": "Back to conversations",
642
- children: /* @__PURE__ */ e(ce, { className: "size-5 text-black/90" })
642
+ children: /* @__PURE__ */ e(he, { className: "size-5 text-black/90" })
643
643
  }
644
644
  ),
645
645
  /* @__PURE__ */ e(
646
- Z,
646
+ q,
647
647
  {
648
- id: ((f = o == null ? void 0 : o.user) == null ? void 0 : f.id) || a.id || "unknown",
648
+ id: ((S = d == null ? void 0 : d.user) == null ? void 0 : S.id) || a.id || "unknown",
649
649
  name: l,
650
- image: d,
650
+ image: m,
651
651
  size: 40
652
652
  }
653
653
  ),
@@ -656,92 +656,96 @@ const ls = (t) => ({
656
656
  r && n && /* @__PURE__ */ e(
657
657
  "button",
658
658
  {
659
- className: R(
659
+ className: p(
660
660
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
661
661
  ),
662
662
  onClick: n,
663
- children: /* @__PURE__ */ e(de, { className: "size-5 text-black/90" })
663
+ children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
664
664
  }
665
665
  )
666
666
  ] })
667
667
  ] });
668
- }, hs = ({
668
+ }, Ns = ({
669
669
  dialogRef: t,
670
670
  onClose: s,
671
671
  participant: n,
672
672
  channel: r,
673
673
  followerStatusLabel: a,
674
- onLeaveConversation: o,
675
- onBlockParticipant: l
674
+ onLeaveConversation: d,
675
+ onBlockParticipant: l,
676
+ showDeleteConversation: m = !0,
677
+ onDeleteConversationClick: h,
678
+ onBlockParticipantClick: g,
679
+ onReportParticipantClick: w
676
680
  }) => {
677
- var j, H, Y, re, O, V, q;
678
- const { service: d, debug: h } = ne(), [b, k] = v(!1), [u, f] = v(!1), [g, w] = v(!1), y = _(async () => {
679
- var D;
680
- if (!(!d || !((D = n == null ? void 0 : n.user) != null && D.id)))
681
+ var Q, X, ie, O, H, J, $;
682
+ const { service: f, debug: S } = ae(), [M, v] = y(!1), [c, N] = y(!1), [E, I] = y(!1), k = D(async () => {
683
+ var _;
684
+ if (!(!f || !((_ = n == null ? void 0 : n.user) != null && _.id)))
681
685
  try {
682
- const B = (await d.getBlockedUsers()).some(
683
- ($) => {
684
- var J;
685
- return $.blocked_user_id === ((J = n == null ? void 0 : n.user) == null ? void 0 : J.id);
686
+ const A = (await f.getBlockedUsers()).some(
687
+ (V) => {
688
+ var K;
689
+ return V.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
686
690
  }
687
691
  );
688
- k(B);
689
- } catch (M) {
692
+ v(A);
693
+ } catch (T) {
690
694
  console.error(
691
695
  "[ChannelInfoDialog] Failed to check blocked status:",
692
- M
696
+ T
693
697
  );
694
698
  }
695
- }, [d, (j = n == null ? void 0 : n.user) == null ? void 0 : j.id]);
699
+ }, [f, (Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id]);
696
700
  G(() => {
697
- y();
698
- }, [y]);
699
- const E = async () => {
700
- var D;
701
- if (!u) {
702
- h && console.log("[ChannelInfoDialog] Leave conversation", r.cid), f(!0);
701
+ k();
702
+ }, [k]);
703
+ const x = async () => {
704
+ var _;
705
+ if (!c) {
706
+ h == null || h(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
703
707
  try {
704
- const M = ((D = r._client) == null ? void 0 : D.userID) ?? null;
705
- await r.hide(M, !1), o && await o(r), s();
706
- } catch (M) {
707
- console.error("[ChannelInfoDialog] Failed to leave conversation", M);
708
+ const T = ((_ = r._client) == null ? void 0 : _.userID) ?? null;
709
+ await r.hide(T, !1), d && await d(r), s();
710
+ } catch (T) {
711
+ console.error("[ChannelInfoDialog] Failed to leave conversation", T);
708
712
  } finally {
709
- f(!1);
713
+ N(!1);
710
714
  }
711
715
  }
712
- }, C = async () => {
713
- var D, M, B;
714
- if (!(g || !d)) {
715
- h && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), w(!0);
716
+ }, R = async () => {
717
+ var _, T, A;
718
+ if (!(E || !f)) {
719
+ g == null || g(), S && console.log("[ChannelInfoDialog] Block member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), I(!0);
716
720
  try {
717
- await d.blockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), l && await l((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
718
- } catch ($) {
719
- console.error("[ChannelInfoDialog] Failed to block member", $);
721
+ 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();
722
+ } catch (V) {
723
+ console.error("[ChannelInfoDialog] Failed to block member", V);
720
724
  } finally {
721
- w(!1);
725
+ I(!1);
722
726
  }
723
727
  }
724
- }, I = async () => {
725
- var D, M, B;
726
- if (!(g || !d)) {
727
- h && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), w(!0);
728
+ }, o = async () => {
729
+ var _, T, A;
730
+ if (!(E || !f)) {
731
+ g == null || g(), S && console.log("[ChannelInfoDialog] Unblock member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), I(!0);
728
732
  try {
729
- await d.unBlockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), l && await l((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
730
- } catch ($) {
731
- console.error("[ChannelInfoDialog] Failed to unblock member", $);
733
+ 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();
734
+ } catch (V) {
735
+ console.error("[ChannelInfoDialog] Failed to unblock member", V);
732
736
  } finally {
733
- w(!1);
737
+ I(!1);
734
738
  }
735
739
  }
736
- }, p = () => {
737
- s(), window.open(
740
+ }, u = () => {
741
+ w == null || w(), s(), window.open(
738
742
  "https://linktr.ee/s/about/trust-center/report",
739
743
  "_blank",
740
744
  "noopener,noreferrer"
741
745
  );
742
746
  };
743
747
  if (!n) return null;
744
- const S = ((H = n.user) == null ? void 0 : H.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", P = (re = n.user) == null ? void 0 : re.image, c = (O = n.user) == null ? void 0 : O.email, m = (V = n.user) == null ? void 0 : V.username, N = c || (m ? `linktr.ee/${m}` : void 0), A = ((q = n.user) == null ? void 0 : q.id) || "unknown";
748
+ const b = ((X = n.user) == null ? void 0 : X.name) || ((ie = n.user) == null ? void 0 : ie.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), oe = (($ = n.user) == null ? void 0 : $.id) || "unknown";
745
749
  return (
746
750
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
747
751
  /* @__PURE__ */ e(
@@ -750,13 +754,13 @@ const ls = (t) => ({
750
754
  ref: t,
751
755
  className: "mes-dialog group",
752
756
  onClose: s,
753
- onClick: (D) => {
754
- D.target === t.current && s();
757
+ onClick: (_) => {
758
+ _.target === t.current && s();
755
759
  },
756
760
  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: [
757
761
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
758
762
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
759
- /* @__PURE__ */ e(we, { onClick: s })
763
+ /* @__PURE__ */ e(Se, { onClick: s })
760
764
  ] }),
761
765
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
762
766
  /* @__PURE__ */ e(
@@ -766,18 +770,18 @@ const ls = (t) => ({
766
770
  style: { backgroundColor: "#FBFAF9" },
767
771
  children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
768
772
  /* @__PURE__ */ e(
769
- Z,
773
+ q,
770
774
  {
771
- id: A,
772
- name: S,
773
- image: P,
775
+ id: oe,
776
+ name: b,
777
+ image: B,
774
778
  size: 88,
775
779
  shape: "circle"
776
780
  }
777
781
  ),
778
782
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
779
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: S }),
780
- N && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: N }),
783
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: b }),
784
+ Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
781
785
  a && /* @__PURE__ */ e(
782
786
  "span",
783
787
  {
@@ -797,43 +801,43 @@ const ls = (t) => ({
797
801
  }
798
802
  ),
799
803
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
800
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
801
- ee,
804
+ m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
805
+ ne,
802
806
  {
803
- onClick: E,
804
- disabled: u,
805
- "aria-busy": u,
807
+ onClick: x,
808
+ disabled: c,
809
+ "aria-busy": c,
806
810
  children: [
807
- u ? /* @__PURE__ */ e(se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Qe, { className: "h-5 w-5" }),
811
+ c ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
808
812
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
809
813
  ]
810
814
  }
811
815
  ) }),
812
- /* @__PURE__ */ e("li", { children: b ? /* @__PURE__ */ i(
813
- ee,
816
+ /* @__PURE__ */ e("li", { children: M ? /* @__PURE__ */ i(
817
+ ne,
814
818
  {
815
- onClick: I,
816
- disabled: g,
817
- "aria-busy": g,
819
+ onClick: o,
820
+ disabled: E,
821
+ "aria-busy": E,
818
822
  children: [
819
- g ? /* @__PURE__ */ e(se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ue, { className: "h-5 w-5" }),
823
+ E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ge, { className: "h-5 w-5" }),
820
824
  /* @__PURE__ */ e("span", { children: "Unblock" })
821
825
  ]
822
826
  }
823
827
  ) : /* @__PURE__ */ i(
824
- ee,
828
+ ne,
825
829
  {
826
- onClick: C,
827
- disabled: g,
828
- "aria-busy": g,
830
+ onClick: R,
831
+ disabled: E,
832
+ "aria-busy": E,
829
833
  children: [
830
- g ? /* @__PURE__ */ e(se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ue, { className: "h-5 w-5" }),
834
+ E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ge, { className: "h-5 w-5" }),
831
835
  /* @__PURE__ */ e("span", { children: "Block" })
832
836
  ]
833
837
  }
834
838
  ) }),
835
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ee, { variant: "danger", onClick: p, children: [
836
- /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
839
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ne, { variant: "danger", onClick: u, children: [
840
+ /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
837
841
  /* @__PURE__ */ e("span", { children: "Report" })
838
842
  ] }) })
839
843
  ] })
@@ -842,44 +846,48 @@ const ls = (t) => ({
842
846
  }
843
847
  )
844
848
  );
845
- }, fs = ({
849
+ }, bs = ({
846
850
  onBack: t,
847
851
  showBackButton: s,
848
852
  renderMessageInputActions: n,
849
853
  onLeaveConversation: r,
850
- onBlockParticipant: a
854
+ onBlockParticipant: a,
855
+ showDeleteConversation: d = !0,
856
+ onDeleteConversationClick: l,
857
+ onBlockParticipantClick: m,
858
+ onReportParticipantClick: h
851
859
  }) => {
852
- const { channel: o } = xe(), l = z(null), d = L.useMemo(() => Object.values(o.state.members || {}).find(
853
- (f) => {
854
- var g;
855
- return ((g = f.user) == null ? void 0 : g.id) && f.user.id !== o._client.userID;
860
+ const { channel: g } = ve(), w = z(null), f = P.useMemo(() => Object.values(g.state.members || {}).find(
861
+ (N) => {
862
+ var E;
863
+ return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
856
864
  }
857
- ), [o._client.userID, o.state.members]), h = L.useMemo(() => {
858
- const u = o.data ?? {};
859
- if (u.followerStatus)
860
- return String(u.followerStatus);
861
- if (u.isFollower !== void 0)
862
- return u.isFollower ? "Subscribed to you" : "Not subscribed";
863
- }, [o.data]), b = _(() => {
864
- var u;
865
- (u = l.current) == null || u.showModal();
866
- }, []), k = _(() => {
867
- var u;
868
- (u = l.current) == null || u.close();
865
+ ), [g._client.userID, g.state.members]), S = P.useMemo(() => {
866
+ const c = g.data ?? {};
867
+ if (c.followerStatus)
868
+ return String(c.followerStatus);
869
+ if (c.isFollower !== void 0)
870
+ return c.isFollower ? "Subscribed to you" : "Not subscribed";
871
+ }, [g.data]), M = D(() => {
872
+ var c;
873
+ (c = w.current) == null || c.showModal();
874
+ }, []), v = D(() => {
875
+ var c;
876
+ (c = w.current) == null || c.close();
869
877
  }, []);
870
- return /* @__PURE__ */ i(ge, { children: [
871
- /* @__PURE__ */ i(qe, { children: [
878
+ return /* @__PURE__ */ i(Ce, { children: [
879
+ /* @__PURE__ */ i(Xe, { children: [
872
880
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
873
- ms,
881
+ xs,
874
882
  {
875
883
  onBack: t,
876
884
  showBackButton: s,
877
- onShowInfo: b,
878
- canShowInfo: !!d
885
+ onShowInfo: M,
886
+ canShowInfo: !!f
879
887
  }
880
888
  ) }),
881
889
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
882
- Ye,
890
+ Ke,
883
891
  {
884
892
  hideDeletedMessages: !0,
885
893
  hideNewMessageSeparator: !1,
@@ -887,57 +895,69 @@ const ls = (t) => ({
887
895
  }
888
896
  ) }),
889
897
  /* @__PURE__ */ e(
890
- cs,
898
+ hs,
891
899
  {
892
- renderActions: () => n == null ? void 0 : n(o)
900
+ renderActions: () => n == null ? void 0 : n(g)
893
901
  }
894
902
  )
895
903
  ] }),
896
904
  /* @__PURE__ */ e(
897
- hs,
905
+ Ns,
898
906
  {
899
- dialogRef: l,
900
- onClose: k,
901
- participant: d,
902
- channel: o,
903
- followerStatusLabel: h,
907
+ dialogRef: w,
908
+ onClose: v,
909
+ participant: f,
910
+ channel: g,
911
+ followerStatusLabel: S,
904
912
  onLeaveConversation: r,
905
- onBlockParticipant: a
913
+ onBlockParticipant: a,
914
+ showDeleteConversation: d,
915
+ onDeleteConversationClick: l,
916
+ onBlockParticipantClick: m,
917
+ onReportParticipantClick: h
906
918
  }
907
919
  )
908
920
  ] });
909
- }, ye = L.memo(
921
+ }, pe = P.memo(
910
922
  ({
911
923
  channel: t,
912
924
  onBack: s,
913
925
  showBackButton: n = !1,
914
926
  renderMessageInputActions: r,
915
927
  onLeaveConversation: a,
916
- onBlockParticipant: o,
928
+ onBlockParticipant: d,
917
929
  className: l,
918
- CustomChannelEmptyState: d = us
930
+ CustomChannelEmptyState: m = gs,
931
+ showDeleteConversation: h = !0,
932
+ onDeleteConversationClick: g,
933
+ onBlockParticipantClick: w,
934
+ onReportParticipantClick: f
919
935
  }) => /* @__PURE__ */ e(
920
936
  "div",
921
937
  {
922
- className: R(
938
+ className: p(
923
939
  "messaging-channel-view h-full flex flex-col",
924
940
  l
925
941
  ),
926
942
  children: /* @__PURE__ */ e(
927
- Ze,
943
+ Qe,
928
944
  {
929
945
  channel: t,
930
- MessageSystem: ds,
931
- EmptyStateIndicator: d,
946
+ MessageSystem: fs,
947
+ EmptyStateIndicator: m,
932
948
  children: /* @__PURE__ */ e(
933
- fs,
949
+ bs,
934
950
  {
935
951
  onBack: s,
936
952
  showBackButton: n,
937
953
  renderMessageInputActions: r,
938
954
  onLeaveConversation: a,
939
- onBlockParticipant: o,
940
- CustomChannelEmptyState: d
955
+ onBlockParticipant: d,
956
+ CustomChannelEmptyState: m,
957
+ showDeleteConversation: h,
958
+ onDeleteConversationClick: g,
959
+ onBlockParticipantClick: w,
960
+ onReportParticipantClick: f
941
961
  }
942
962
  )
943
963
  }
@@ -945,8 +965,8 @@ const ls = (t) => ({
945
965
  }
946
966
  )
947
967
  );
948
- ye.displayName = "ChannelView";
949
- function gs({
968
+ pe.displayName = "ChannelView";
969
+ function Cs({
950
970
  searchQuery: t,
951
971
  setSearchQuery: s,
952
972
  placeholder: n
@@ -954,7 +974,7 @@ function gs({
954
974
  const r = z(null);
955
975
  return /* @__PURE__ */ i("div", { className: "relative", children: [
956
976
  /* @__PURE__ */ e(
957
- Ke,
977
+ ns,
958
978
  {
959
979
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
960
980
  weight: "bold"
@@ -972,7 +992,7 @@ function gs({
972
992
  }
973
993
  ),
974
994
  t && /* @__PURE__ */ e(
975
- ve,
995
+ Ie,
976
996
  {
977
997
  label: "Clear search",
978
998
  onClick: () => {
@@ -980,149 +1000,149 @@ function gs({
980
1000
  s(""), (a = r.current) == null || a.focus();
981
1001
  },
982
1002
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
983
- children: /* @__PURE__ */ e(oe, { className: "h-4 w-4", weight: "bold" })
1003
+ children: /* @__PURE__ */ e(ue, { className: "h-4 w-4", weight: "bold" })
984
1004
  }
985
1005
  )
986
1006
  ] });
987
1007
  }
988
- const xs = ({
1008
+ const vs = ({
989
1009
  participantSource: t,
990
1010
  onSelectParticipant: s,
991
1011
  onClose: n,
992
1012
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
993
1013
  participantLabel: a = "participants",
994
- searchPlaceholder: o = "Search participants...",
1014
+ searchPlaceholder: d = "Search participants...",
995
1015
  className: l
996
1016
  }) => {
997
- const { debug: d } = ne(), [h, b] = v(""), [k, u] = v([]), [f, g] = v(!1), [w, y] = v(null), [E, C] = v(
1017
+ const { debug: m } = ae(), [h, g] = y(""), [w, f] = y([]), [S, M] = y(!1), [v, c] = y(null), [N, E] = y(
998
1018
  null
999
1019
  ), I = z(!1);
1000
1020
  G(() => {
1001
1021
  if (t.loading) {
1002
- d && console.log(
1022
+ m && console.log(
1003
1023
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1004
1024
  );
1005
1025
  return;
1006
1026
  }
1007
1027
  if (I.current) return;
1008
1028
  (async () => {
1009
- d && console.log("[ParticipantPicker] Loading initial participants..."), g(!0), y(null);
1029
+ m && console.log("[ParticipantPicker] Loading initial participants..."), M(!0), c(null);
1010
1030
  try {
1011
- const m = await t.loadParticipants({
1031
+ const u = await t.loadParticipants({
1012
1032
  search: "",
1013
1033
  // Load all participants initially
1014
1034
  limit: 100
1015
1035
  });
1016
- u(m.participants), I.current = !0, d && console.log(
1036
+ f(u.participants), I.current = !0, m && console.log(
1017
1037
  "[ParticipantPicker] Participants loaded successfully:",
1018
- m.participants.length
1038
+ u.participants.length
1019
1039
  );
1020
- } catch (m) {
1021
- const N = m instanceof Error ? m.message : "Failed to load participants";
1022
- y(N), console.error("[ParticipantPicker] Failed to load participants:", m);
1040
+ } catch (u) {
1041
+ const b = u instanceof Error ? u.message : "Failed to load participants";
1042
+ c(b), console.error("[ParticipantPicker] Failed to load participants:", u);
1023
1043
  } finally {
1024
- g(!1);
1044
+ M(!1);
1025
1045
  }
1026
1046
  })();
1027
- }, [t.loading, d]);
1028
- const p = k.filter((c) => !r.has(c.id)).filter((c) => {
1029
- var N;
1047
+ }, [t.loading, m]);
1048
+ const k = w.filter((o) => !r.has(o.id)).filter((o) => {
1049
+ var b;
1030
1050
  if (!h) return !0;
1031
- const m = h.toLowerCase();
1032
- return c.name.toLowerCase().includes(m) || ((N = c.email) == null ? void 0 : N.toLowerCase().includes(m)) || !1;
1033
- }), S = _(
1034
- async (c) => {
1035
- if (!E) {
1036
- C(c.id);
1051
+ const u = h.toLowerCase();
1052
+ return o.name.toLowerCase().includes(u) || ((b = o.email) == null ? void 0 : b.toLowerCase().includes(u)) || !1;
1053
+ }), x = D(
1054
+ async (o) => {
1055
+ if (!N) {
1056
+ E(o.id);
1037
1057
  try {
1038
- await s(c);
1039
- } catch (m) {
1040
- console.error("[ParticipantPicker] Failed to start chat:", m), C(null);
1058
+ await s(o);
1059
+ } catch (u) {
1060
+ console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
1041
1061
  }
1042
1062
  }
1043
1063
  },
1044
- [s, E]
1045
- ), P = (c, m) => {
1046
- (c.key === "Enter" || c.key === " ") && (c.preventDefault(), S(m));
1064
+ [s, N]
1065
+ ), R = (o, u) => {
1066
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), x(u));
1047
1067
  };
1048
- return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", l), children: [
1068
+ return /* @__PURE__ */ i("div", { className: p("flex flex-col h-full", l), children: [
1049
1069
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1050
1070
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1051
1071
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1052
- /* @__PURE__ */ e(we, { onClick: n })
1072
+ /* @__PURE__ */ e(Se, { onClick: n })
1053
1073
  ] }),
1054
1074
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1055
1075
  "Select a ",
1056
1076
  a.slice(0, -1),
1057
1077
  " to start messaging (",
1058
- p.length,
1078
+ k.length,
1059
1079
  " available)",
1060
1080
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${a} total`
1061
1081
  ] }),
1062
1082
  /* @__PURE__ */ e(
1063
- gs,
1083
+ Cs,
1064
1084
  {
1065
1085
  searchQuery: h,
1066
- setSearchQuery: b,
1067
- placeholder: o
1086
+ setSearchQuery: g,
1087
+ placeholder: d
1068
1088
  }
1069
1089
  )
1070
1090
  ] }),
1071
- w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1091
+ v && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1072
1092
  "Error loading ",
1073
1093
  a,
1074
1094
  ": ",
1075
- w
1095
+ v
1076
1096
  ] }),
1077
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && p.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: [
1097
+ /* @__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__ */ i("div", { className: "flex items-center space-x-2", children: [
1078
1098
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1079
1099
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1080
1100
  "Loading ",
1081
1101
  a,
1082
1102
  "..."
1083
1103
  ] })
1084
- ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1085
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(me, { className: "h-8 w-8 text-charcoal" }) }),
1086
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : k.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1087
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : k.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1104
+ ] }) }) : k.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1105
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(xe, { className: "h-8 w-8 text-charcoal" }) }),
1106
+ /* @__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` }),
1107
+ /* @__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` })
1088
1108
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1089
- p.map((c) => {
1090
- const m = c.name || c.email || c.id, N = c.email && c.name ? c.email : c.phone;
1109
+ k.map((o) => {
1110
+ const u = o.name || o.email || o.id, b = o.email && o.name ? o.email : o.phone;
1091
1111
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1092
1112
  "button",
1093
1113
  {
1094
1114
  type: "button",
1095
- onClick: () => S(c),
1096
- onKeyDown: (A) => P(A, c),
1115
+ onClick: () => x(o),
1116
+ onKeyDown: (B) => R(B, o),
1097
1117
  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",
1098
1118
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1099
1119
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1100
1120
  /* @__PURE__ */ e(
1101
- Z,
1121
+ q,
1102
1122
  {
1103
- id: c.id,
1104
- name: m,
1105
- image: c.image,
1123
+ id: o.id,
1124
+ name: u,
1125
+ image: o.image,
1106
1126
  size: 40
1107
1127
  }
1108
1128
  ),
1109
1129
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1110
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1111
- N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1130
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1131
+ b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1112
1132
  ] })
1113
1133
  ] }),
1114
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: E === c.id ? /* @__PURE__ */ e(se, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(me, { className: "h-5 w-5 text-stone" }) })
1134
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === o.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5 text-stone" }) })
1115
1135
  ] })
1116
1136
  }
1117
- ) }, c.id);
1137
+ ) }, o.id);
1118
1138
  }),
1119
- f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1139
+ S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1120
1140
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1121
1141
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1122
1142
  ] }) })
1123
1143
  ] }) })
1124
1144
  ] });
1125
- }, Cs = ({ className: t }) => /* @__PURE__ */ i(
1145
+ }, ws = ({ className: t }) => /* @__PURE__ */ i(
1126
1146
  "svg",
1127
1147
  {
1128
1148
  width: "140",
@@ -1256,17 +1276,17 @@ const xs = ({
1256
1276
  ] })
1257
1277
  ]
1258
1278
  }
1259
- ), Ee = L.memo(
1279
+ ), ke = P.memo(
1260
1280
  ({ 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: [
1261
- /* @__PURE__ */ e(Cs, {}),
1281
+ /* @__PURE__ */ e(ws, {}),
1262
1282
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1263
1283
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1264
1284
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1265
1285
  ] })
1266
1286
  ] }) })
1267
1287
  );
1268
- Ee.displayName = "EmptyState";
1269
- const te = L.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: [
1288
+ ke.displayName = "EmptyState";
1289
+ const le = 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: [
1270
1290
  /* @__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: "โš ๏ธ" }) }),
1271
1291
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1272
1292
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1280,11 +1300,11 @@ const te = L.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1280
1300
  }
1281
1301
  )
1282
1302
  ] }) }));
1283
- te.displayName = "ErrorState";
1284
- const Ns = ({ className: t, message: s }) => /* @__PURE__ */ i(
1303
+ le.displayName = "ErrorState";
1304
+ const ys = ({ className: t, message: s }) => /* @__PURE__ */ i(
1285
1305
  "div",
1286
1306
  {
1287
- className: R("flex items-center justify-center h-full", t),
1307
+ className: p("flex items-center justify-center h-full", t),
1288
1308
  children: [
1289
1309
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1290
1310
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1324,208 +1344,215 @@ const Ns = ({ className: t, message: s }) => /* @__PURE__ */ i(
1324
1344
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1325
1345
  ]
1326
1346
  }
1327
- ), Ie = L.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1328
- /* @__PURE__ */ e(Ns, { className: "w-6 h-6" }),
1347
+ ), Re = 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: [
1348
+ /* @__PURE__ */ e(ys, { className: "w-6 h-6" }),
1329
1349
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1330
1350
  ] }) }));
1331
- Ie.displayName = "LoadingState";
1332
- const Rs = ({
1351
+ Re.displayName = "LoadingState";
1352
+ const Fs = ({
1333
1353
  capabilities: t = {},
1334
1354
  className: s,
1335
1355
  renderMessageInputActions: n,
1336
1356
  onChannelSelect: r,
1337
1357
  onParticipantSelect: a,
1338
- initialParticipantFilter: o,
1358
+ initialParticipantFilter: d,
1339
1359
  initialParticipantData: l,
1340
- CustomChannelEmptyState: d,
1360
+ CustomChannelEmptyState: m,
1341
1361
  showChannelList: h = !0,
1342
- filters: b,
1343
- channelListCustomEmptyStateIndicator: k
1362
+ filters: g,
1363
+ channelListCustomEmptyStateIndicator: w,
1364
+ onDeleteConversationClick: f,
1365
+ onBlockParticipantClick: S,
1366
+ onReportParticipantClick: M
1344
1367
  }) => {
1345
1368
  const {
1346
- service: u,
1347
- client: f,
1348
- isConnected: g,
1349
- isLoading: w,
1350
- error: y,
1351
- refreshConnection: E,
1352
- debug: C
1353
- } = es(), [I, p] = v(null), [S, P] = v(!1), [c, m] = v(!1), [N, A] = v(!1), [j, H] = v(/* @__PURE__ */ new Set()), [Y, re] = v(0), [O, V] = v(!1), [q, D] = v(null), M = z(null), { participantSource: B, participantLabel: $ = "participants" } = t, J = L.useMemo(() => {
1354
- const x = f == null ? void 0 : f.userID;
1369
+ service: v,
1370
+ client: c,
1371
+ isConnected: N,
1372
+ isLoading: E,
1373
+ error: I,
1374
+ refreshConnection: k,
1375
+ debug: x
1376
+ } = rs(), [R, o] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [oe, Q] = y(/* @__PURE__ */ new Set()), [X, ie] = y(0), [O, H] = y(!1), [J, $] = y(null), _ = z(null), {
1377
+ participantSource: T,
1378
+ participantLabel: A = "participants",
1379
+ showDeleteConversation: V = !0
1380
+ } = t, K = P.useMemo(() => {
1381
+ const C = c == null ? void 0 : c.userID;
1355
1382
  return {
1356
1383
  ...{
1357
1384
  type: "messaging",
1358
1385
  last_message_at: { $exists: !0 },
1359
- ...x && {
1360
- members: { $in: [x] },
1386
+ ...C && {
1387
+ members: { $in: [C] },
1361
1388
  hidden: !1
1362
1389
  }
1363
1390
  },
1364
- ...b
1391
+ ...g
1365
1392
  };
1366
- }, [b, f == null ? void 0 : f.userID]), Q = z(null), W = _(async () => {
1367
- if (!f || !g) return;
1368
- const x = f.userID;
1369
- if (x)
1393
+ }, [g, c == null ? void 0 : c.userID]), ee = z(null), Z = D(async () => {
1394
+ if (!c || !N) return;
1395
+ const C = c.userID;
1396
+ if (C)
1370
1397
  try {
1371
- C && console.log("[MessagingShell] Syncing channels for user:", x);
1372
- const U = await f.queryChannels(
1398
+ x && console.log("[MessagingShell] Syncing channels for user:", C);
1399
+ const U = await c.queryChannels(
1373
1400
  {
1374
1401
  type: "messaging",
1375
- members: { $in: [x] }
1402
+ members: { $in: [C] }
1376
1403
  },
1377
1404
  {},
1378
1405
  { limit: 100 }
1379
1406
  ), F = /* @__PURE__ */ new Set();
1380
- U.forEach((T) => {
1381
- const le = T.state.members;
1382
- Object.values(le).forEach((Me) => {
1383
- var ie;
1384
- const ae = (ie = Me.user) == null ? void 0 : ie.id;
1385
- ae && ae !== x && F.add(ae);
1407
+ U.forEach((L) => {
1408
+ const ce = L.state.members;
1409
+ Object.values(ce).forEach((Pe) => {
1410
+ var me;
1411
+ const de = (me = Pe.user) == null ? void 0 : me.id;
1412
+ de && de !== C && F.add(de);
1386
1413
  });
1387
- }), H((T) => T.size === F.size && [...T].every((le) => F.has(le)) ? T : F), P(U.length > 0), m(!0), Q.current = x, C && console.log("[MessagingShell] Channels synced successfully:", {
1414
+ }), Q((L) => L.size === F.size && [...L].every((ce) => F.has(ce)) ? L : F), b(U.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
1388
1415
  channelCount: U.length,
1389
1416
  memberCount: F.size
1390
1417
  });
1391
1418
  } catch (U) {
1392
1419
  console.error("[MessagingShell] Failed to sync channels:", U);
1393
1420
  }
1394
- }, [f, g, C]);
1421
+ }, [c, N, x]);
1395
1422
  G(() => {
1396
- if (!f || !g) return;
1397
- const x = f.userID;
1398
- x && Q.current !== x && W();
1399
- }, [f, g, W]), G(() => {
1400
- if (!o || !f || !g) return;
1423
+ if (!c || !N) return;
1424
+ const C = c.userID;
1425
+ C && ee.current !== C && Z();
1426
+ }, [c, N, Z]), G(() => {
1427
+ if (!d || !c || !N) return;
1401
1428
  (async () => {
1402
- const U = f.userID;
1429
+ const U = c.userID;
1403
1430
  if (U)
1404
1431
  try {
1405
- C && console.log(
1432
+ x && console.log(
1406
1433
  "[MessagingShell] Loading initial conversation with:",
1407
- o
1434
+ d
1408
1435
  );
1409
- const F = await f.queryChannels(
1436
+ const F = await c.queryChannels(
1410
1437
  {
1411
1438
  type: "messaging",
1412
- members: { $eq: [U, o] }
1439
+ members: { $eq: [U, d] }
1413
1440
  },
1414
1441
  {},
1415
1442
  { limit: 1 }
1416
1443
  );
1417
1444
  if (F.length > 0)
1418
- p(F[0]), V(!0), D(null), r && r(F[0]), C && console.log(
1445
+ o(F[0]), H(!0), $(null), r && r(F[0]), x && console.log(
1419
1446
  "[MessagingShell] Initial conversation loaded:",
1420
1447
  F[0].id
1421
1448
  );
1422
- else if (l && u) {
1423
- C && console.log(
1449
+ else if (l && v) {
1450
+ x && console.log(
1424
1451
  "[MessagingShell] No conversation found, creating one for:",
1425
1452
  l
1426
1453
  );
1427
1454
  try {
1428
- const T = await u.startChannelWithParticipant({
1455
+ const L = await v.startChannelWithParticipant({
1429
1456
  id: l.id,
1430
1457
  name: l.name,
1431
1458
  email: l.email,
1432
1459
  phone: l.phone
1433
1460
  });
1434
- p(T), V(!0), D(null), r && r(T), C && console.log(
1461
+ o(L), H(!0), $(null), r && r(L), x && console.log(
1435
1462
  "[MessagingShell] Channel created and loaded:",
1436
- T.id
1463
+ L.id
1437
1464
  );
1438
- } catch (T) {
1465
+ } catch (L) {
1439
1466
  console.error(
1440
1467
  "[MessagingShell] Failed to create conversation:",
1441
- T
1442
- ), D("Failed to create conversation");
1468
+ L
1469
+ ), $("Failed to create conversation");
1443
1470
  }
1444
1471
  } else
1445
- D(
1472
+ $(
1446
1473
  "No conversation found with this account"
1447
- ), C && console.log(
1474
+ ), x && console.log(
1448
1475
  "[MessagingShell] No conversation found for:",
1449
- o
1476
+ d
1450
1477
  );
1451
1478
  } catch (F) {
1452
1479
  console.error(
1453
1480
  "[MessagingShell] Failed to load initial conversation:",
1454
1481
  F
1455
- ), D("Failed to load conversation");
1482
+ ), $("Failed to load conversation");
1456
1483
  }
1457
1484
  })();
1458
1485
  }, [
1459
- o,
1486
+ d,
1460
1487
  l,
1461
- f,
1462
- g,
1463
- u,
1464
- C,
1488
+ c,
1489
+ N,
1490
+ v,
1491
+ x,
1465
1492
  r
1466
1493
  ]);
1467
- const pe = _(
1468
- (x) => {
1469
- p(x), r == null || r(x);
1494
+ const _e = D(
1495
+ (C) => {
1496
+ o(C), r == null || r(C);
1470
1497
  },
1471
1498
  [r]
1472
- ), ke = _(() => {
1473
- O || p(null);
1474
- }, [O]), Se = _(
1475
- async (x) => {
1499
+ ), De = D(() => {
1500
+ O || o(null);
1501
+ }, [O]), Me = D(
1502
+ async (C) => {
1476
1503
  var U;
1477
- if (u)
1504
+ if (v)
1478
1505
  try {
1479
- C && console.log(
1506
+ x && console.log(
1480
1507
  "[MessagingShell] Starting conversation with:",
1481
- x.id
1508
+ C.id
1482
1509
  );
1483
- const F = await u.startChannelWithParticipant({
1484
- id: x.id,
1485
- name: x.name,
1486
- email: x.email,
1487
- phone: x.phone
1510
+ const F = await v.startChannelWithParticipant({
1511
+ id: C.id,
1512
+ name: C.name,
1513
+ email: C.email,
1514
+ phone: C.phone
1488
1515
  });
1489
1516
  try {
1490
1517
  await F.show();
1491
- } catch (T) {
1492
- console.warn("[MessagingShell] Failed to unhide channel:", T);
1518
+ } catch (L) {
1519
+ console.warn("[MessagingShell] Failed to unhide channel:", L);
1493
1520
  }
1494
- p(F), A(!1), (U = M.current) == null || U.close(), a == null || a(x);
1521
+ o(F), Y(!1), (U = _.current) == null || U.close(), a == null || a(C);
1495
1522
  } catch (F) {
1496
1523
  console.error("[MessagingShell] Failed to start conversation:", F);
1497
1524
  }
1498
1525
  },
1499
- [u, a, C]
1500
- ), X = _(() => {
1501
- var x;
1502
- A(!1), (x = M.current) == null || x.close();
1503
- }, []), Re = _(
1504
- (x) => {
1505
- x.target === M.current && X();
1526
+ [v, a, x]
1527
+ ), se = D(() => {
1528
+ var C;
1529
+ Y(!1), (C = _.current) == null || C.close();
1530
+ }, []), Fe = D(
1531
+ (C) => {
1532
+ C.target === _.current && se();
1506
1533
  },
1507
- [X]
1508
- ), De = _(
1509
- async (x) => {
1510
- C && console.log("[MessagingShell] Leaving conversation:", x.id), p(null), V(!1), Q.current = null, await W();
1534
+ [se]
1535
+ ), Te = D(
1536
+ async (C) => {
1537
+ x && console.log("[MessagingShell] Leaving conversation:", C.id), o(null), H(!1), ee.current = null, await Z();
1511
1538
  },
1512
- [W, C]
1513
- ), _e = _(
1514
- async (x) => {
1515
- C && console.log("[MessagingShell] Blocking participant:", x), p(null), V(!1), Q.current = null, await W();
1539
+ [Z, x]
1540
+ ), Le = D(
1541
+ async (C) => {
1542
+ x && console.log("[MessagingShell] Blocking participant:", C), o(null), H(!1), ee.current = null, await Z();
1516
1543
  },
1517
- [W, C]
1518
- ), K = !!I;
1519
- return w ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ie, {}) }) : y ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(te, { message: y, onBack: E }) }) : !g || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1520
- te,
1544
+ [Z, x]
1545
+ ), te = !!R;
1546
+ return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(Re, {}) }) : 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(
1547
+ le,
1521
1548
  {
1522
1549
  message: "Not connected to messaging service",
1523
- onBack: E
1550
+ onBack: k
1524
1551
  }
1525
- ) }) : q ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(te, { message: q }) }) : /* @__PURE__ */ i(
1552
+ ) }) : J ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ i(
1526
1553
  "div",
1527
1554
  {
1528
- className: R(
1555
+ className: p(
1529
1556
  "messaging-shell h-full bg-background-secondary overflow-hidden",
1530
1557
  s
1531
1558
  ),
@@ -1534,24 +1561,24 @@ const Rs = ({
1534
1561
  /* @__PURE__ */ e(
1535
1562
  "div",
1536
1563
  {
1537
- className: R(
1564
+ className: p(
1538
1565
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1539
1566
  {
1540
1567
  // Explicitly hidden via prop or in direct conversation mode
1541
1568
  "!hidden": h === !1 || O,
1542
1569
  // Normal mode: hide on mobile when channel selected, show on desktop
1543
- "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && K,
1570
+ "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && te,
1544
1571
  // Normal mode: show when no channel selected
1545
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !K
1572
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !te
1546
1573
  }
1547
1574
  ),
1548
1575
  children: /* @__PURE__ */ e(
1549
- be,
1576
+ Ee,
1550
1577
  {
1551
- onChannelSelect: pe,
1552
- selectedChannel: I || void 0,
1553
- filters: J,
1554
- customEmptyStateIndicator: k
1578
+ onChannelSelect: _e,
1579
+ selectedChannel: R || void 0,
1580
+ filters: K,
1581
+ customEmptyStateIndicator: w
1555
1582
  }
1556
1583
  )
1557
1584
  }
@@ -1559,63 +1586,67 @@ const Rs = ({
1559
1586
  /* @__PURE__ */ e(
1560
1587
  "div",
1561
1588
  {
1562
- className: R(
1589
+ className: p(
1563
1590
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1564
1591
  {
1565
1592
  // In direct conversation mode, always show (full width)
1566
- flex: O || K,
1593
+ flex: O || te,
1567
1594
  // Normal mode: hide on mobile when no channel selected
1568
- "hidden lg:flex": !O && !K
1595
+ "hidden lg:flex": !O && !te
1569
1596
  }
1570
1597
  ),
1571
- children: I ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1572
- ye,
1598
+ children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1599
+ pe,
1573
1600
  {
1574
- channel: I,
1575
- onBack: ke,
1601
+ channel: R,
1602
+ onBack: De,
1576
1603
  showBackButton: !O,
1577
1604
  renderMessageInputActions: n,
1578
- onLeaveConversation: De,
1579
- onBlockParticipant: _e,
1580
- CustomChannelEmptyState: d
1605
+ onLeaveConversation: Te,
1606
+ onBlockParticipant: Le,
1607
+ CustomChannelEmptyState: m,
1608
+ showDeleteConversation: V,
1609
+ onDeleteConversationClick: f,
1610
+ onBlockParticipantClick: S,
1611
+ onReportParticipantClick: M
1581
1612
  },
1582
- I.id
1613
+ R.id
1583
1614
  ) }) : /* @__PURE__ */ e(
1584
- Ee,
1615
+ ke,
1585
1616
  {
1586
- hasChannels: S,
1587
- channelsLoaded: c
1617
+ hasChannels: u,
1618
+ channelsLoaded: B
1588
1619
  }
1589
1620
  )
1590
1621
  }
1591
1622
  )
1592
1623
  ] }),
1593
- B && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1624
+ T && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1594
1625
  /* @__PURE__ */ e(
1595
1626
  "dialog",
1596
1627
  {
1597
- ref: M,
1628
+ ref: _,
1598
1629
  className: "mes-dialog",
1599
- onClick: Re,
1600
- onClose: X,
1630
+ onClick: Fe,
1631
+ onClose: se,
1601
1632
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1602
- xs,
1633
+ vs,
1603
1634
  {
1604
- participantSource: B,
1605
- onSelectParticipant: Se,
1606
- onClose: X,
1607
- existingParticipantIds: j,
1608
- participantLabel: $,
1609
- searchPlaceholder: `Search ${$}...`
1635
+ participantSource: T,
1636
+ onSelectParticipant: Me,
1637
+ onClose: se,
1638
+ existingParticipantIds: oe,
1639
+ participantLabel: A,
1640
+ searchPlaceholder: `Search ${A}...`
1610
1641
  },
1611
- Y
1642
+ X
1612
1643
  ) })
1613
1644
  }
1614
1645
  )
1615
1646
  ]
1616
1647
  }
1617
1648
  );
1618
- }, bs = ({
1649
+ }, Es = ({
1619
1650
  question: t,
1620
1651
  onClick: s,
1621
1652
  loading: n = !1,
@@ -1627,7 +1658,7 @@ const Rs = ({
1627
1658
  onClick: s,
1628
1659
  disabled: n,
1629
1660
  style: { backgroundColor: "#E6E5E3" },
1630
- className: R(
1661
+ className: p(
1631
1662
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1632
1663
  {
1633
1664
  "hover:brightness-95 active:brightness-90": !n,
@@ -1637,23 +1668,23 @@ const Rs = ({
1637
1668
  ),
1638
1669
  children: t
1639
1670
  }
1640
- ), Ds = ({
1671
+ ), Ts = ({
1641
1672
  faqs: t,
1642
1673
  onFaqClick: s,
1643
1674
  loadingFaqId: n,
1644
1675
  headerText: r,
1645
1676
  className: a,
1646
- avatarImage: o,
1677
+ avatarImage: d,
1647
1678
  avatarName: l
1648
1679
  }) => {
1649
- const d = t.filter((h) => h.enabled).sort((h, b) => (h.order ?? 0) - (b.order ?? 0));
1650
- return d.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1651
- (o || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1652
- Z,
1680
+ const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
1681
+ return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1682
+ (d || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1683
+ q,
1653
1684
  {
1654
1685
  id: l || "account",
1655
1686
  name: l || "Account",
1656
- image: o,
1687
+ image: d,
1657
1688
  size: 24,
1658
1689
  shape: "circle"
1659
1690
  }
@@ -1665,8 +1696,8 @@ const Rs = ({
1665
1696
  style: { backgroundColor: "#F1F0EE" },
1666
1697
  children: [
1667
1698
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1668
- d.map((h) => /* @__PURE__ */ e(
1669
- bs,
1699
+ m.map((h) => /* @__PURE__ */ e(
1700
+ Es,
1670
1701
  {
1671
1702
  question: h.question,
1672
1703
  onClick: () => s(h.id),
@@ -1678,59 +1709,59 @@ const Rs = ({
1678
1709
  }
1679
1710
  )
1680
1711
  ] }) });
1681
- }, _s = (t, s = {}) => {
1682
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, o] = v([]), [l, d] = v(!1), [h, b] = v(null), [k, u] = v(n), [f, g] = v(!0), [w, y] = v(), E = _(async (S = !1, P) => {
1712
+ }, Ls = (t, s = {}) => {
1713
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [a, d] = y([]), [l, m] = y(!1), [h, g] = y(null), [w, f] = y(n), [S, M] = y(!0), [v, c] = y(), N = D(async (x = !1, R) => {
1683
1714
  if (l) return;
1684
- const c = P !== void 0 ? P : k;
1685
- d(!0), b(null);
1715
+ const o = R !== void 0 ? R : w;
1716
+ m(!0), g(null);
1686
1717
  try {
1687
- const m = await t.loadParticipants({
1688
- search: c || void 0,
1718
+ const u = await t.loadParticipants({
1719
+ search: o || void 0,
1689
1720
  limit: r,
1690
- cursor: S ? void 0 : w
1721
+ cursor: x ? void 0 : v
1691
1722
  });
1692
- o(
1693
- (N) => S ? m.participants : [...N, ...m.participants]
1694
- ), g(m.hasMore), y(m.nextCursor);
1695
- } catch (m) {
1696
- const N = m instanceof Error ? m.message : "Failed to load participants";
1697
- b(N), console.error("[useParticipants] Load error:", m);
1723
+ d(
1724
+ (b) => x ? u.participants : [...b, ...u.participants]
1725
+ ), M(u.hasMore), c(u.nextCursor);
1726
+ } catch (u) {
1727
+ const b = u instanceof Error ? u.message : "Failed to load participants";
1728
+ g(b), console.error("[useParticipants] Load error:", u);
1698
1729
  } finally {
1699
- d(!1);
1730
+ m(!1);
1700
1731
  }
1701
- }, [t, k, w, r, l]), C = _(() => {
1702
- f && !l && E(!1);
1703
- }, [f, l, E]), I = _((S) => {
1704
- u(S), y(void 0), E(!0, S);
1705
- }, [E]), p = _(() => {
1706
- y(void 0), E(!0);
1707
- }, [E]);
1732
+ }, [t, w, v, r, l]), E = D(() => {
1733
+ S && !l && N(!1);
1734
+ }, [S, l, N]), I = D((x) => {
1735
+ f(x), c(void 0), N(!0, x);
1736
+ }, [N]), k = D(() => {
1737
+ c(void 0), N(!0);
1738
+ }, [N]);
1708
1739
  return G(() => {
1709
- E(!0);
1740
+ N(!0);
1710
1741
  }, [t.loadParticipants]), {
1711
1742
  participants: a,
1712
1743
  loading: l,
1713
1744
  error: h,
1714
- searchQuery: k,
1715
- hasMore: f,
1745
+ searchQuery: w,
1746
+ hasMore: S,
1716
1747
  totalCount: t.totalCount,
1717
- loadMore: C,
1748
+ loadMore: E,
1718
1749
  search: I,
1719
- refresh: p
1750
+ refresh: k
1720
1751
  };
1721
1752
  };
1722
1753
  export {
1723
- Z as Avatar,
1724
- us as ChannelEmptyState,
1725
- be as ChannelList,
1726
- ye as ChannelView,
1727
- Ds as FaqList,
1728
- bs as FaqListItem,
1729
- Ss as MessagingProvider,
1730
- Rs as MessagingShell,
1731
- xs as ParticipantPicker,
1732
- ts as formatRelativeTime,
1733
- es as useMessaging,
1734
- _s as useParticipants
1754
+ q as Avatar,
1755
+ gs as ChannelEmptyState,
1756
+ Ee as ChannelList,
1757
+ pe as ChannelView,
1758
+ Ts as FaqList,
1759
+ Es as FaqListItem,
1760
+ Ms as MessagingProvider,
1761
+ Fs as MessagingShell,
1762
+ vs as ParticipantPicker,
1763
+ as as formatRelativeTime,
1764
+ rs as useMessaging,
1765
+ Ls as useParticipants
1735
1766
  };
1736
1767
  //# sourceMappingURL=index.js.map