@linktr.ee/messaging-react 1.22.1 โ†’ 1.22.2

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,6 +1,6 @@
1
1
  import { jsx as e, jsxs as i, Fragment as ce } from "react/jsx-runtime";
2
- import T from "classnames";
3
- import B, { createContext as tt, useContext as st, useCallback as P, useState as I, useRef as q, useEffect as Y, useMemo as ye } from "react";
2
+ import R from "classnames";
3
+ import A, { createContext as tt, useContext as st, useCallback as P, useState as _, useRef as q, useEffect as Y, useMemo as ye } from "react";
4
4
  import { StreamChatService as nt } from "@linktr.ee/messaging-core";
5
5
  import { Chat as at, ChannelList as rt, DateSeparator as ot, useChannelStateContext as Ie, useChatContext as Be, areMessageUIPropsEqual as lt, useMessageReminder as it, useComponentContext as ct, Attachment as dt, EditMessageModal as ut, MessageBlocked as mt, MessageBouncePrompt as ht, MessageDeleted as ft, MessageIsThreadReplyInChannelButtonIndicator as gt, MessageRepliesCountButton as xt, ReminderNotification as bt, StreamedMessageText as Ct, messageHasAttachments as Nt, messageHasReactions as vt, isDateSeparatorMessage as wt, isMessageBlocked as pt, isMessageBounced as yt, MessageBounceModal as Et, Poll as _t, MessageText as It, MessageErrorIcon as St, useMessageContext as Mt, useMessageComposer as kt, useStateStore as Dt, MessageInput as Tt, useMessageInputContext as Rt, useMessageComposerHasSendableData as Lt, SimpleAttachmentSelector as Pt, QuotedMessagePreview as Ut, AttachmentPreviewList as Ft, TextareaComposer as Ot, MessageTimestamp as De, Channel as At, WithComponents as Bt, Window as $t, MessageList as jt } from "stream-chat-react";
6
6
  import { GiftIcon as Gt, XIcon as Se, ArrowUpIcon as Ht, SparkleIcon as zt, ArrowLeftIcon as Te, StarIcon as Re, DotsThreeIcon as Le, SpinnerGapIcon as xe, SignOutIcon as Vt, ProhibitInsetIcon as Pe, FlagIcon as Wt, MagnifyingGlassIcon as qt, ChatCircleDotsIcon as Ue } from "@phosphor-icons/react";
@@ -21,13 +21,13 @@ const $e = tt({
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
23
  capabilities: l = {},
24
- debug: d = !1
24
+ debug: u = !1
25
25
  }) => {
26
26
  const o = P(
27
- (c, ...b) => {
28
- d && console.log(`๐Ÿ”ฅ [MessagingProvider] ${c}`, ...b);
27
+ (c, ...d) => {
28
+ u && console.log(`๐Ÿ”ฅ [MessagingProvider] ${c}`, ...d);
29
29
  },
30
- [d]
30
+ [u]
31
31
  );
32
32
  o("๐Ÿ”„ RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
@@ -35,14 +35,14 @@ const $e = tt({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [u, g] = I(null), [f, C] = I(null), [x, w] = I(!1), [a, y] = I(!1), [S, v] = I(null), k = q(!1), N = q({
38
+ const [m, x] = _(null), [g, C] = _(null), [b, w] = _(!1), [a, y] = _(!1), [I, v] = _(null), S = q(!1), N = q({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), m = q(0);
44
- m.current++, o("๐Ÿ“Š RENDER INFO", {
45
- renderCount: m.current,
43
+ }), h = q(0);
44
+ h.current++, o("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: h.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: N.current.userId !== (s == null ? void 0 : s.id),
@@ -56,7 +56,7 @@ const $e = tt({
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
58
  }, Y(() => {
59
- const c = m.current;
59
+ const c = h.current;
60
60
  if (o("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: c,
62
62
  apiKey: !!r,
@@ -79,40 +79,40 @@ const $e = tt({
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: N.current.serviceConfig !== n
81
81
  });
82
- const b = new nt({
82
+ const d = new nt({
83
83
  ...n,
84
84
  apiKey: r,
85
- debug: d
85
+ debug: u
86
86
  });
87
- return g(b), o("โœ… SERVICE SET", {
87
+ return x(d), o("โœ… SERVICE SET", {
88
88
  renderCount: c,
89
- serviceInstance: !!b
89
+ serviceInstance: !!d
90
90
  }), () => {
91
91
  o("๐Ÿงน SERVICE CLEANUP", {
92
92
  renderCount: c,
93
93
  reason: "Effect cleanup"
94
- }), b.disconnectUser().catch(console.error);
94
+ }), d.disconnectUser().catch(console.error);
95
95
  };
96
- }, [r, n, d, o]);
96
+ }, [r, n, u, o]);
97
97
  const p = q(null);
98
98
  Y(() => {
99
- var b, A;
99
+ var d, M;
100
100
  if (o("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!u,
101
+ hasService: !!m,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: k.current,
105
- isConnected: x,
106
- dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
- }), !u || !s) {
104
+ isConnecting: S.current,
105
+ isConnected: b,
106
+ dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
+ }), !m || !s) {
108
108
  o("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (k.current) {
111
+ if (S.current) {
112
112
  o("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((b = p.current) == null ? void 0 : b.serviceId) === u && ((A = p.current) == null ? void 0 : A.userId) === s.id) {
115
+ if (((d = p.current) == null ? void 0 : d.serviceId) === m && ((M = p.current) == null ? void 0 : M.userId) === s.id) {
116
116
  o(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,96 +120,96 @@ const $e = tt({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- o("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), k.current = !0, y(!0), v(null);
123
+ o("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), S.current = !0, y(!0), v(null);
124
124
  try {
125
125
  o("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const _ = await u.connectUser(s);
127
- C(_), w(!0), p.current = { serviceId: u, userId: s.id }, o("โœ… USER CONNECTION SUCCESS", {
126
+ const k = await m.connectUser(s);
127
+ C(k), w(!0), p.current = { serviceId: m, userId: s.id }, o("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: _.userID
129
+ clientId: k.userID
130
130
  });
131
- } catch (_) {
132
- const R = _ instanceof Error ? _.message : "Connection failed";
133
- v(R), o("โŒ USER CONNECTION ERROR", {
131
+ } catch (k) {
132
+ const B = k instanceof Error ? k.message : "Connection failed";
133
+ v(B), o("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: R
135
+ error: B
136
136
  });
137
137
  } finally {
138
- y(!1), k.current = !1, o("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ y(!1), S.current = !1, o("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: x
140
+ isConnected: b
141
141
  });
142
142
  }
143
143
  })();
144
- }, [u, s, o, x]), Y(() => (o("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
- hasService: !!u,
146
- isConnected: x
144
+ }, [m, s, o, b]), Y(() => (o("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!m,
146
+ isConnected: b
147
147
  }), () => {
148
- u && x ? (o(
148
+ m && b ? (o(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), p.current = null, u.disconnectUser().catch(console.error)) : o("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
- hasService: !!u,
153
- isConnected: x
151
+ ), p.current = null, m.disconnectUser().catch(console.error)) : o("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!m,
153
+ isConnected: b
154
154
  });
155
- }), [u, x, o]);
156
- const D = P(async () => {
155
+ }), [m, b, o]);
156
+ const T = P(async () => {
157
157
  if (o("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
- hasService: !!u,
158
+ hasService: !!m,
159
159
  hasUser: !!s
160
- }), !u || !s) {
160
+ }), !m || !s) {
161
161
  o("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
164
  o("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
165
165
  try {
166
- o("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), o("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
- const c = await u.connectUser(s);
166
+ o("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await m.disconnectUser(), o("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
+ const c = await m.connectUser(s);
168
168
  C(c), w(!0), v(null), o("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (c) {
170
- const b = c instanceof Error ? c.message : "Refresh failed";
171
- v(b), o("โŒ CONNECTION REFRESH ERROR", {
170
+ const d = c instanceof Error ? c.message : "Refresh failed";
171
+ v(d), o("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: b
173
+ error: d
174
174
  });
175
175
  } finally {
176
176
  y(!1), o("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [u, s, o]), h = B.useMemo(() => (o("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!u,
180
- hasClient: !!f,
181
- isConnected: x,
178
+ }, [m, s, o]), f = A.useMemo(() => (o("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!m,
180
+ hasClient: !!g,
181
+ isConnected: b,
182
182
  isLoading: a,
183
- hasError: !!S,
183
+ hasError: !!I,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
- service: u,
187
- client: f,
188
- isConnected: x,
186
+ service: m,
187
+ client: g,
188
+ isConnected: b,
189
189
  isLoading: a,
190
- error: S,
190
+ error: I,
191
191
  capabilities: l,
192
- refreshConnection: D,
193
- debug: d
192
+ refreshConnection: T,
193
+ debug: u
194
194
  }), [
195
- u,
196
- f,
197
- x,
195
+ m,
196
+ g,
197
+ b,
198
198
  a,
199
- S,
199
+ I,
200
200
  l,
201
- D,
202
- d,
201
+ T,
202
+ u,
203
203
  o
204
204
  ]);
205
205
  return o("๐Ÿ”„ RENDER END", {
206
- renderCount: m.current,
207
- willRenderChat: !!(f && x),
208
- contextValueReady: !!h
209
- }), /* @__PURE__ */ e($e.Provider, { value: h, children: f && x ? /* @__PURE__ */ e(
206
+ renderCount: h.current,
207
+ willRenderChat: !!(g && b),
208
+ contextValueReady: !!f
209
+ }), /* @__PURE__ */ e($e.Provider, { value: f, children: g && b ? /* @__PURE__ */ e(
210
210
  at,
211
211
  {
212
- client: f,
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
  },
@@ -284,18 +284,18 @@ const ee = ({
284
284
  className: r,
285
285
  shape: l = "squircle"
286
286
  }) => {
287
- const d = Xt(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", g = l === "circle" ? { borderRadius: "50%" } : {
287
+ const u = Xt(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", x = l === "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: T("flex-shrink-0 overflow-hidden", r),
294
+ className: R("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
298
- ...g
298
+ ...x
299
299
  },
300
300
  children: s ? /* @__PURE__ */ e(
301
301
  "img",
@@ -308,11 +308,11 @@ const ee = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: T(
311
+ className: R(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- u
313
+ m
314
314
  ),
315
- children: d
315
+ children: u
316
316
  }
317
317
  )
318
318
  }
@@ -352,12 +352,12 @@ const ee = ({
352
352
  isMyMessage: n = !1,
353
353
  hasAttachment: r = !1
354
354
  }) => {
355
- var x;
356
- const l = je(t), d = Me(t);
357
- if (!l && !d)
355
+ var b;
356
+ const l = je(t), u = Me(t);
357
+ if (!l && !u)
358
358
  return null;
359
359
  if (l) {
360
- const w = (x = t.metadata) == null ? void 0 : x.amount_text;
360
+ const w = (b = t.metadata) == null ? void 0 : b.amount_text;
361
361
  if (!w) return null;
362
362
  const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${w} tip` : `Delivered with ${w} tip`;
363
363
  return /* @__PURE__ */ i("div", { className: a, children: [
@@ -365,58 +365,65 @@ const ee = ({
365
365
  /* @__PURE__ */ e("span", { children: y })
366
366
  ] });
367
367
  }
368
- const o = n && r, u = o ? "Sent with AI" : "Sent with DM Agent", g = [
368
+ const o = n && r, m = o ? "Sent with AI" : "Sent with DM Agent", x = [
369
369
  "message-chatbot-indicator",
370
370
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
371
371
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
372
- ].join(" "), f = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: u }), C = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Kt, { size: o ? 12 : 15 }) });
373
- return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ i(ce, { children: [
374
- f,
372
+ ].join(" "), g = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: m }), C = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Kt, { size: o ? 12 : 15 }) });
373
+ return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ i(ce, { children: [
374
+ g,
375
375
  C
376
376
  ] }) : /* @__PURE__ */ i(ce, { children: [
377
377
  C,
378
- f
378
+ g
379
379
  ] }) });
380
- }, Ge = B.memo(
380
+ }, Ge = A.memo(
381
381
  ({
382
382
  channel: t,
383
383
  selectedChannel: s,
384
384
  onChannelSelect: n,
385
385
  debug: r = !1,
386
386
  unread: l,
387
- renderMessagePreview: d
387
+ renderMessagePreview: u
388
388
  }) => {
389
- var p, D, h, c, b, A;
390
- const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
389
+ var p, T, f, c;
390
+ const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), m = () => {
391
391
  t && n(t);
392
- }, g = (_) => {
393
- const R = _.key === "Enter" || _.key === " ", M = _.repeat;
394
- !R || M || (_.preventDefault(), u());
392
+ }, x = (d) => {
393
+ const M = d.key === "Enter" || d.key === " ", k = d.repeat;
394
+ !M || k || (d.preventDefault(), m());
395
395
  }, C = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
396
- (_) => {
397
- var R, M;
398
- return ((R = _.user) == null ? void 0 : R.id) && _.user.id !== ((M = t == null ? void 0 : t._client) == null ? void 0 : M.userID);
396
+ (d) => {
397
+ var M, k;
398
+ return ((M = d.user) == null ? void 0 : M.id) && d.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
399
+ }
400
+ ), b = ((T = C == null ? void 0 : C.user) == null ? void 0 : T.name) || "Conversation", w = (f = C == null ? void 0 : C.user) == null ? void 0 : f.image, a = (() => {
401
+ var M;
402
+ const d = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
403
+ if (d != null && d.length) {
404
+ for (let k = d.length - 1; k >= 0; k--)
405
+ if (d[k].type !== "system") return d[k];
399
406
  }
400
- ), x = ((D = C == null ? void 0 : C.user) == null ? void 0 : D.name) || "Conversation", w = (h = C == null ? void 0 : C.user) == null ? void 0 : h.image, a = (b = (c = t == null ? void 0 : t.state) == null ? void 0 : c.messages) == null ? void 0 : b[t.state.messages.length - 1], S = (() => {
401
- var R;
407
+ })(), I = (() => {
408
+ var M;
402
409
  if (a != null && a.text) return a.text;
403
- const _ = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
404
- return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "๐Ÿ“ท Sent an image" : _.type === "video" ? "๐ŸŽฅ Sent a video" : _.type === "audio" ? "๐ŸŽต Sent audio" : _.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
405
- })(), v = a != null && a.created_at ? Jt(new Date(a.created_at)) : "", k = a ? Me(a) : !1, N = d ? d(a, S) : `${k ? "โœจ " : ""}${S}`, m = l ?? 0;
410
+ const d = (M = a == null ? void 0 : a.attachments) == null ? void 0 : M[0];
411
+ 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";
412
+ })(), v = a != null && a.created_at ? Jt(new Date(a.created_at)) : "", S = a ? Me(a) : !1, N = u ? u(a, I) : `${S ? "โœจ " : ""}${I}`, h = l ?? 0;
406
413
  return r && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
407
414
  channelId: t == null ? void 0 : t.id,
408
415
  isSelected: o,
409
- participantName: x,
410
- unreadCount: m,
416
+ participantName: b,
417
+ unreadCount: h,
411
418
  hasTimestamp: !!v
412
419
  }), /* @__PURE__ */ e(
413
420
  "div",
414
421
  {
415
422
  role: "button",
416
423
  tabIndex: 0,
417
- onClick: u,
418
- onKeyDown: g,
419
- className: T(
424
+ onClick: m,
425
+ onKeyDown: x,
426
+ className: R(
420
427
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
421
428
  {
422
429
  "bg-primary-alt/10 border-l-4 border-l-primary": o,
@@ -427,8 +434,8 @@ const ee = ({
427
434
  /* @__PURE__ */ e(
428
435
  ee,
429
436
  {
430
- id: ((A = C == null ? void 0 : C.user) == null ? void 0 : A.id) || t.id || "unknown",
431
- name: x,
437
+ id: ((c = C == null ? void 0 : C.user) == null ? void 0 : c.id) || t.id || "unknown",
438
+ name: b,
432
439
  image: w,
433
440
  size: 44,
434
441
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
@@ -439,18 +446,18 @@ const ee = ({
439
446
  /* @__PURE__ */ e(
440
447
  "h3",
441
448
  {
442
- className: T(
449
+ className: R(
443
450
  "text-sm font-medium truncate",
444
451
  o ? "text-primary" : "text-charcoal"
445
452
  ),
446
- children: x
453
+ children: b
447
454
  }
448
455
  ),
449
456
  v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
450
457
  ] }),
451
458
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
452
459
  /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
453
- m > 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: m > 99 ? "99+" : m })
460
+ h > 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: h > 99 ? "99+" : h })
454
461
  ] })
455
462
  ] })
456
463
  ] })
@@ -459,37 +466,37 @@ const ee = ({
459
466
  }
460
467
  );
461
468
  Ge.displayName = "CustomChannelPreview";
462
- const He = B.memo(
469
+ const He = A.memo(
463
470
  ({
464
471
  onChannelSelect: t,
465
472
  selectedChannel: s,
466
473
  filters: n,
467
474
  className: r,
468
475
  customEmptyStateIndicator: l,
469
- renderMessagePreview: d
476
+ renderMessagePreview: u
470
477
  }) => {
471
- const o = B.useRef(0);
478
+ const o = A.useRef(0);
472
479
  o.current++;
473
- const { debug: u = !1 } = Ne();
474
- u && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
480
+ const { debug: m = !1 } = Ne();
481
+ m && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
475
482
  renderCount: o.current,
476
483
  selectedChannelId: s == null ? void 0 : s.id,
477
484
  filters: n
478
485
  });
479
- const g = B.useMemo(() => (C) => /* @__PURE__ */ e(
486
+ const x = A.useMemo(() => (C) => /* @__PURE__ */ e(
480
487
  Ge,
481
488
  {
482
489
  ...C,
483
490
  selectedChannel: s,
484
491
  onChannelSelect: t,
485
- debug: u,
486
- renderMessagePreview: d
492
+ debug: m,
493
+ renderMessagePreview: u
487
494
  }
488
- ), [s, t, u, d]);
495
+ ), [s, t, m, u]);
489
496
  return /* @__PURE__ */ e(
490
497
  "div",
491
498
  {
492
- className: T(
499
+ className: R(
493
500
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
494
501
  r
495
502
  ),
@@ -499,7 +506,7 @@ const He = B.memo(
499
506
  filters: n,
500
507
  sort: { last_message_at: -1 },
501
508
  options: { limit: 30 },
502
- Preview: g,
509
+ Preview: x,
503
510
  EmptyStateIndicator: l
504
511
  },
505
512
  JSON.stringify(n)
@@ -518,7 +525,7 @@ const ge = ({
518
525
  "button",
519
526
  {
520
527
  type: "button",
521
- className: T(
528
+ className: R(
522
529
  "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",
523
530
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
524
531
  s
@@ -532,7 +539,7 @@ function ze({ label: t, className: s, children: n, ...r }) {
532
539
  "button",
533
540
  {
534
541
  type: "button",
535
- className: T(
542
+ className: R(
536
543
  "rounded-full p-2 transition-colors focus-ring",
537
544
  {
538
545
  "cursor-not-allowed opacity-50": r.disabled,
@@ -569,7 +576,7 @@ function rs(t) {
569
576
  );
570
577
  } catch {
571
578
  }
572
- }, [s, n == null ? void 0 : n.userID, t.id, r]), d = P(async () => {
579
+ }, [s, n == null ? void 0 : n.userID, t.id, r]), u = P(async () => {
573
580
  if (n != null && n.userID)
574
581
  try {
575
582
  r === "down" ? await s.deleteReaction(t.id, _e) : await s.sendReaction(
@@ -580,7 +587,7 @@ function rs(t) {
580
587
  } catch {
581
588
  }
582
589
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
583
- return { selected: r, voteUp: l, voteDown: d };
590
+ return { selected: r, voteUp: l, voteDown: u };
584
591
  }
585
592
  const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
586
593
  "path",
@@ -636,31 +643,31 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
636
643
  chatbotVotingEnabled: n,
637
644
  editing: r,
638
645
  endOfGroup: l,
639
- firstOfGroup: d,
646
+ firstOfGroup: u,
640
647
  groupedByUser: o,
641
- handleAction: u,
642
- handleOpenThread: g,
643
- handleRetry: f,
648
+ handleAction: m,
649
+ handleOpenThread: x,
650
+ handleRetry: g,
644
651
  highlighted: C,
645
- isMessageAIGenerated: x,
652
+ isMessageAIGenerated: b,
646
653
  isMyMessage: w,
647
654
  message: a,
648
655
  renderText: y,
649
- threadList: S
650
- } = t, { client: v } = Be("CustomMessage"), [k, N] = I(!1), m = it(a.id), { selected: p, voteUp: D, voteDown: h } = rs(a), {
656
+ threadList: I
657
+ } = t, { client: v } = Be("CustomMessage"), [S, N] = _(!1), h = it(a.id), { selected: p, voteUp: T, voteDown: f } = rs(a), {
651
658
  Attachment: c = dt,
652
- EditMessageModal: b = ut,
653
- MessageBlocked: A = mt,
654
- MessageBouncePrompt: _ = ht,
655
- MessageDeleted: R = ft,
656
- MessageIsThreadReplyInChannelButtonIndicator: M = gt,
659
+ EditMessageModal: d = ut,
660
+ MessageBlocked: M = mt,
661
+ MessageBouncePrompt: k = ht,
662
+ MessageDeleted: B = ft,
663
+ MessageIsThreadReplyInChannelButtonIndicator: D = gt,
657
664
  MessageRepliesCountButton: W = xt,
658
665
  ReminderNotification: z = bt,
659
666
  StreamedMessageText: te = Ct,
660
667
  PinIndicator: J
661
668
  } = ct("CustomMessage"), se = Nt(a), ne = vt(a), ie = ye(
662
- () => x == null ? void 0 : x(a),
663
- [x, a]
669
+ () => b == null ? void 0 : b(a),
670
+ [b, a]
664
671
  ), $ = ye(
665
672
  () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
666
673
  [a]
@@ -668,13 +675,13 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
668
675
  if (wt(a))
669
676
  return null;
670
677
  if (a.deleted_at || a.type === "deleted")
671
- return /* @__PURE__ */ e(R, { message: a });
678
+ return /* @__PURE__ */ e(B, { message: a });
672
679
  if (pt(a))
673
- return /* @__PURE__ */ e(A, {});
674
- const Q = !S && !!a.reply_count, U = !S && a.show_in_channel && a.parent_id, F = a.status === "failed" && ((me = a.error) == null ? void 0 : me.status) !== 403, V = yt(a);
680
+ return /* @__PURE__ */ e(M, {});
681
+ const Q = !I && !!a.reply_count, U = !I && a.show_in_channel && a.parent_id, F = a.status === "failed" && ((me = a.error) == null ? void 0 : me.status) !== 403, V = yt(a);
675
682
  let L;
676
- F ? L = () => f(a) : V && (L = () => N(!0));
677
- const G = w(), de = T(
683
+ F ? L = () => g(a) : V && (L = () => N(!0));
684
+ const G = w(), de = R(
678
685
  "str-chat__message str-chat__message-simple",
679
686
  `str-chat__message--${a.type}`,
680
687
  `str-chat__message--${a.status}`,
@@ -688,28 +695,28 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
688
695
  "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((K = a == null ? void 0 : a.error) == null ? void 0 : K.status) !== 403,
689
696
  "str-chat__message-with-thread-link": Q || U,
690
697
  "str-chat__virtual-message__wrapper--end": l,
691
- "str-chat__virtual-message__wrapper--first": d,
698
+ "str-chat__virtual-message__wrapper--first": u,
692
699
  "str-chat__virtual-message__wrapper--group": o
693
700
  }
694
701
  ), Z = a.poll_id && v.polls.fromState(a.poll_id), ae = ss(a), X = Me(a), re = !!($ != null && $.length && !a.quoted_message), ue = X && G && re;
695
702
  return /* @__PURE__ */ i(ce, { children: [
696
703
  r && /* @__PURE__ */ e(
697
- b,
704
+ d,
698
705
  {
699
706
  additionalMessageInputProps: s
700
707
  }
701
708
  ),
702
- k && /* @__PURE__ */ e(
709
+ S && /* @__PURE__ */ e(
703
710
  Et,
704
711
  {
705
- MessageBouncePrompt: _,
712
+ MessageBouncePrompt: k,
706
713
  onClose: () => N(!1),
707
- open: k
714
+ open: S
708
715
  }
709
716
  ),
710
717
  /* @__PURE__ */ i("div", { className: de, children: [
711
718
  J && /* @__PURE__ */ e(J, {}),
712
- !!m && /* @__PURE__ */ e(z, { reminder: m }),
719
+ !!h && /* @__PURE__ */ e(z, { reminder: h }),
713
720
  a.user && /* @__PURE__ */ e(
714
721
  ee,
715
722
  {
@@ -722,7 +729,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
722
729
  /* @__PURE__ */ e(
723
730
  "div",
724
731
  {
725
- className: T("str-chat__message-inner", {
732
+ className: R("str-chat__message-inner", {
726
733
  "str-chat__simple-message--error-failed": F || V
727
734
  }),
728
735
  "data-testid": "message-inner",
@@ -753,7 +760,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
753
760
  $ != null && $.length && !a.quoted_message ? /* @__PURE__ */ e(
754
761
  c,
755
762
  {
756
- actionHandler: u,
763
+ actionHandler: m,
757
764
  attachments: $
758
765
  }
759
766
  ) : null,
@@ -778,8 +785,8 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
778
785
  is,
779
786
  {
780
787
  selected: p,
781
- onVoteUp: D,
782
- onVoteDown: h
788
+ onVoteUp: T,
789
+ onVoteDown: f
783
790
  }
784
791
  )
785
792
  ] })
@@ -788,14 +795,14 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
788
795
  Q && /* @__PURE__ */ e(
789
796
  W,
790
797
  {
791
- onClick: g,
798
+ onClick: x,
792
799
  reply_count: a.reply_count
793
800
  }
794
801
  ),
795
- U && /* @__PURE__ */ e(M, {})
802
+ U && /* @__PURE__ */ e(D, {})
796
803
  ] }, a.id)
797
804
  ] });
798
- }, ds = B.memo(
805
+ }, ds = A.memo(
799
806
  cs,
800
807
  lt
801
808
  ), us = (t) => {
@@ -951,7 +958,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
951
958
  }, ws = () => null, ps = ({ className: t, message: s }) => /* @__PURE__ */ i(
952
959
  "div",
953
960
  {
954
- className: T("flex items-center justify-center h-full", t),
961
+ className: R("flex items-center justify-center h-full", t),
955
962
  children: [
956
963
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
957
964
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -991,7 +998,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
991
998
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
992
999
  ]
993
1000
  }
994
- ), Ce = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1001
+ ), Ce = A.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
995
1002
  /* @__PURE__ */ e(ps, { className: "w-6 h-6" }),
996
1003
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
997
1004
  ] }) }));
@@ -1003,29 +1010,29 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1003
1010
  canShowInfo: r,
1004
1011
  showStarButton: l = !1
1005
1012
  }) => {
1006
- var w, a, y, S, v, k;
1007
- const { channel: d } = Ie(), o = B.useMemo(() => Object.values(d.state.members || {}).find(
1008
- (m) => {
1013
+ var w, a, y, I, v, S;
1014
+ const { channel: u } = Ie(), o = A.useMemo(() => Object.values(u.state.members || {}).find(
1015
+ (h) => {
1009
1016
  var p;
1010
- return ((p = m.user) == null ? void 0 : p.id) && m.user.id !== d._client.userID;
1017
+ return ((p = h.user) == null ? void 0 : p.id) && h.user.id !== u._client.userID;
1011
1018
  }
1012
- ), [d._client.userID, d.state.members]), u = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member", g = (y = o == null ? void 0 : o.user) == null ? void 0 : y.image, [f, C] = I(
1013
- !!((S = d.state.membership) != null && S.pinned_at)
1019
+ ), [u._client.userID, u.state.members]), m = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member", x = (y = o == null ? void 0 : o.user) == null ? void 0 : y.image, [g, C] = _(
1020
+ !!((I = u.state.membership) != null && I.pinned_at)
1014
1021
  );
1015
1022
  Y(() => {
1016
- const N = (m) => {
1023
+ const N = (h) => {
1017
1024
  var p;
1018
1025
  C(
1019
- m != null && m.member ? !!m.member.pinned_at : !!((p = d.state.membership) != null && p.pinned_at)
1026
+ h != null && h.member ? !!h.member.pinned_at : !!((p = u.state.membership) != null && p.pinned_at)
1020
1027
  );
1021
1028
  };
1022
- return d.on("member.updated", N), () => {
1023
- d.off("member.updated", N);
1029
+ return u.on("member.updated", N), () => {
1030
+ u.off("member.updated", N);
1024
1031
  };
1025
- }, [d]);
1026
- const x = async () => {
1032
+ }, [u]);
1033
+ const b = async () => {
1027
1034
  try {
1028
- f ? await d.unpin() : await d.pin();
1035
+ g ? await u.unpin() : await u.pin();
1029
1036
  } catch (N) {
1030
1037
  console.error(
1031
1038
  "[CustomChannelHeader] Failed to update pinned status:",
@@ -1050,30 +1057,30 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1050
1057
  /* @__PURE__ */ e(
1051
1058
  ee,
1052
1059
  {
1053
- id: ((v = o == null ? void 0 : o.user) == null ? void 0 : v.id) || d.id || "unknown",
1054
- name: u,
1055
- image: g,
1060
+ id: ((v = o == null ? void 0 : o.user) == null ? void 0 : v.id) || u.id || "unknown",
1061
+ name: m,
1062
+ image: x,
1056
1063
  size: 40
1057
1064
  }
1058
1065
  ),
1059
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
1066
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: m })
1060
1067
  ] }),
1061
1068
  /* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
1062
1069
  l && /* @__PURE__ */ e(
1063
1070
  "button",
1064
1071
  {
1065
1072
  className: le,
1066
- onClick: x,
1073
+ onClick: b,
1067
1074
  type: "button",
1068
- "aria-label": f ? "Unstar conversation" : "Star conversation",
1075
+ "aria-label": g ? "Unstar conversation" : "Star conversation",
1069
1076
  children: /* @__PURE__ */ e(
1070
1077
  Re,
1071
1078
  {
1072
- className: T("size-5", {
1073
- "text-yellow-600": f,
1074
- "text-black/90": !f
1079
+ className: R("size-5", {
1080
+ "text-yellow-600": g,
1081
+ "text-black/90": !g
1075
1082
  }),
1076
- weight: f ? "duotone" : "regular"
1083
+ weight: g ? "duotone" : "regular"
1077
1084
  }
1078
1085
  )
1079
1086
  }
@@ -1105,30 +1112,30 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1105
1112
  /* @__PURE__ */ e(
1106
1113
  ee,
1107
1114
  {
1108
- id: ((k = o == null ? void 0 : o.user) == null ? void 0 : k.id) || d.id || "unknown",
1109
- name: u,
1110
- image: g,
1115
+ id: ((S = o == null ? void 0 : o.user) == null ? void 0 : S.id) || u.id || "unknown",
1116
+ name: m,
1117
+ image: x,
1111
1118
  size: 40
1112
1119
  }
1113
1120
  ),
1114
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
1121
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: m }) })
1115
1122
  ] }),
1116
1123
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
1117
1124
  l && /* @__PURE__ */ e(
1118
1125
  "button",
1119
1126
  {
1120
1127
  className: le,
1121
- onClick: x,
1128
+ onClick: b,
1122
1129
  type: "button",
1123
- "aria-label": f ? "Unstar conversation" : "Star conversation",
1130
+ "aria-label": g ? "Unstar conversation" : "Star conversation",
1124
1131
  children: /* @__PURE__ */ e(
1125
1132
  Re,
1126
1133
  {
1127
- className: T("size-5", {
1128
- "text-yellow-600": f,
1129
- "text-black/90": !f
1134
+ className: R("size-5", {
1135
+ "text-yellow-600": g,
1136
+ "text-black/90": !g
1130
1137
  }),
1131
- weight: f ? "duotone" : "regular"
1138
+ weight: g ? "duotone" : "regular"
1132
1139
  }
1133
1140
  )
1134
1141
  }
@@ -1152,16 +1159,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1152
1159
  participant: n,
1153
1160
  channel: r,
1154
1161
  followerStatusLabel: l,
1155
- onLeaveConversation: d,
1162
+ onLeaveConversation: u,
1156
1163
  onBlockParticipant: o,
1157
- showDeleteConversation: u = !0,
1158
- onDeleteConversationClick: g,
1159
- onBlockParticipantClick: f,
1164
+ showDeleteConversation: m = !0,
1165
+ onDeleteConversationClick: x,
1166
+ onBlockParticipantClick: g,
1160
1167
  onReportParticipantClick: C,
1161
- customChannelActions: x
1168
+ customChannelActions: b
1162
1169
  }) => {
1163
1170
  var te, J, se, ne, ie, $, Q;
1164
- const { service: w, debug: a } = Ne(), [y, S] = I(!1), [v, k] = I(!1), [N, m] = I(!1), p = P(async () => {
1171
+ const { service: w, debug: a } = Ne(), [y, I] = _(!1), [v, S] = _(!1), [N, h] = _(!1), p = P(async () => {
1165
1172
  var U;
1166
1173
  if (!(!w || !((U = n == null ? void 0 : n.user) != null && U.id)))
1167
1174
  try {
@@ -1171,7 +1178,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1171
1178
  return L.blocked_user_id === ((G = n == null ? void 0 : n.user) == null ? void 0 : G.id);
1172
1179
  }
1173
1180
  );
1174
- S(V);
1181
+ I(V);
1175
1182
  } catch (F) {
1176
1183
  console.error(
1177
1184
  "[ChannelInfoDialog] Failed to check blocked status:",
@@ -1182,44 +1189,44 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1182
1189
  Y(() => {
1183
1190
  p();
1184
1191
  }, [p]);
1185
- const D = async () => {
1192
+ const T = async () => {
1186
1193
  var U;
1187
1194
  if (!v) {
1188
- g == null || g(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), k(!0);
1195
+ x == null || x(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
1189
1196
  try {
1190
1197
  const F = ((U = r._client) == null ? void 0 : U.userID) ?? null;
1191
- await r.hide(F, !1), d && await d(r), s();
1198
+ await r.hide(F, !1), u && await u(r), s();
1192
1199
  } catch (F) {
1193
1200
  console.error("[ChannelInfoDialog] Failed to leave conversation", F);
1194
1201
  } finally {
1195
- k(!1);
1202
+ S(!1);
1196
1203
  }
1197
1204
  }
1198
- }, h = async () => {
1205
+ }, f = async () => {
1199
1206
  var U, F, V;
1200
1207
  if (!(N || !w)) {
1201
- f == null || f(), a && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), m(!0);
1208
+ g == null || g(), a && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
1202
1209
  try {
1203
1210
  await w.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
1204
1211
  } catch (L) {
1205
1212
  console.error("[ChannelInfoDialog] Failed to block member", L);
1206
1213
  } finally {
1207
- m(!1);
1214
+ h(!1);
1208
1215
  }
1209
1216
  }
1210
1217
  }, c = async () => {
1211
1218
  var U, F, V;
1212
1219
  if (!(N || !w)) {
1213
- f == null || f(), a && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), m(!0);
1220
+ g == null || g(), a && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
1214
1221
  try {
1215
1222
  await w.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((V = n == null ? void 0 : n.user) == null ? void 0 : V.id), s();
1216
1223
  } catch (L) {
1217
1224
  console.error("[ChannelInfoDialog] Failed to unblock member", L);
1218
1225
  } finally {
1219
- m(!1);
1226
+ h(!1);
1220
1227
  }
1221
1228
  }
1222
- }, b = () => {
1229
+ }, d = () => {
1223
1230
  C == null || C(), s(), window.open(
1224
1231
  "https://linktr.ee/s/about/trust-center/report",
1225
1232
  "_blank",
@@ -1227,7 +1234,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1227
1234
  );
1228
1235
  };
1229
1236
  if (!n) return null;
1230
- const A = ((J = n.user) == null ? void 0 : J.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", _ = (ne = n.user) == null ? void 0 : ne.image, R = (ie = n.user) == null ? void 0 : ie.email, M = ($ = n.user) == null ? void 0 : $.username, W = R || (M ? `linktr.ee/${M}` : void 0), z = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
1237
+ const M = ((J = n.user) == null ? void 0 : J.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", k = (ne = n.user) == null ? void 0 : ne.image, B = (ie = n.user) == null ? void 0 : ie.email, D = ($ = n.user) == null ? void 0 : $.username, W = B || (D ? `linktr.ee/${D}` : void 0), z = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
1231
1238
  return (
1232
1239
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1233
1240
  /* @__PURE__ */ e(
@@ -1255,14 +1262,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1255
1262
  ee,
1256
1263
  {
1257
1264
  id: z,
1258
- name: A,
1259
- image: _,
1265
+ name: M,
1266
+ image: k,
1260
1267
  size: 88,
1261
1268
  shape: "circle"
1262
1269
  }
1263
1270
  ),
1264
1271
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1265
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: A }),
1272
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
1266
1273
  W && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: W }),
1267
1274
  l && /* @__PURE__ */ e(
1268
1275
  "span",
@@ -1283,10 +1290,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1283
1290
  }
1284
1291
  ),
1285
1292
  /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
1286
- u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1293
+ m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1287
1294
  ge,
1288
1295
  {
1289
- onClick: D,
1296
+ onClick: T,
1290
1297
  disabled: v,
1291
1298
  "aria-busy": v,
1292
1299
  children: [
@@ -1309,7 +1316,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1309
1316
  ) : /* @__PURE__ */ i(
1310
1317
  ge,
1311
1318
  {
1312
- onClick: h,
1319
+ onClick: f,
1313
1320
  disabled: N,
1314
1321
  "aria-busy": N,
1315
1322
  children: [
@@ -1318,11 +1325,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1318
1325
  ]
1319
1326
  }
1320
1327
  ) }),
1321
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ge, { variant: "danger", onClick: b, children: [
1328
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ge, { variant: "danger", onClick: d, children: [
1322
1329
  /* @__PURE__ */ e(Wt, { className: "h-5 w-5" }),
1323
1330
  /* @__PURE__ */ e("span", { children: "Report" })
1324
1331
  ] }) }),
1325
- x
1332
+ b
1326
1333
  ] })
1327
1334
  ] })
1328
1335
  ] })
@@ -1335,39 +1342,39 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1335
1342
  renderMessageInputActions: n,
1336
1343
  onLeaveConversation: r,
1337
1344
  onBlockParticipant: l,
1338
- showDeleteConversation: d = !0,
1345
+ showDeleteConversation: u = !0,
1339
1346
  onDeleteConversationClick: o,
1340
- onBlockParticipantClick: u,
1341
- onReportParticipantClick: g,
1342
- showStarButton: f = !1,
1347
+ onBlockParticipantClick: m,
1348
+ onReportParticipantClick: x,
1349
+ showStarButton: g = !1,
1343
1350
  chatbotVotingEnabled: C = !1,
1344
- renderChannelBanner: x,
1351
+ renderChannelBanner: b,
1345
1352
  customChannelActions: w
1346
1353
  }) => {
1347
- const { channel: a } = Ie(), y = q(null), S = B.useMemo(() => Object.values(a.state.members || {}).find(
1354
+ const { channel: a } = Ie(), y = q(null), I = A.useMemo(() => Object.values(a.state.members || {}).find(
1348
1355
  (p) => {
1349
- var D;
1350
- return ((D = p.user) == null ? void 0 : D.id) && p.user.id !== a._client.userID;
1356
+ var T;
1357
+ return ((T = p.user) == null ? void 0 : T.id) && p.user.id !== a._client.userID;
1351
1358
  }
1352
- ), [a._client.userID, a.state.members]), v = B.useMemo(() => {
1353
- const m = a.data ?? {};
1354
- if (m.followerStatus)
1355
- return String(m.followerStatus);
1356
- if (m.isFollower !== void 0)
1357
- return m.isFollower ? "Subscribed to you" : "Not subscribed";
1358
- }, [a.data]), k = P(() => {
1359
- var m;
1360
- (m = y.current) == null || m.showModal();
1359
+ ), [a._client.userID, a.state.members]), v = A.useMemo(() => {
1360
+ const h = a.data ?? {};
1361
+ if (h.followerStatus)
1362
+ return String(h.followerStatus);
1363
+ if (h.isFollower !== void 0)
1364
+ return h.isFollower ? "Subscribed to you" : "Not subscribed";
1365
+ }, [a.data]), S = P(() => {
1366
+ var h;
1367
+ (h = y.current) == null || h.showModal();
1361
1368
  }, []), N = P(() => {
1362
- var m;
1363
- (m = y.current) == null || m.close();
1369
+ var h;
1370
+ (h = y.current) == null || h.close();
1364
1371
  }, []);
1365
1372
  return /* @__PURE__ */ i(ce, { children: [
1366
1373
  /* @__PURE__ */ e(
1367
1374
  Bt,
1368
1375
  {
1369
1376
  overrides: {
1370
- Message: (m) => /* @__PURE__ */ e(us, { ...m, chatbotVotingEnabled: C })
1377
+ Message: (h) => /* @__PURE__ */ e(us, { ...h, chatbotVotingEnabled: C })
1371
1378
  },
1372
1379
  children: /* @__PURE__ */ i($t, { children: [
1373
1380
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
@@ -1375,12 +1382,12 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1375
1382
  {
1376
1383
  onBack: t,
1377
1384
  showBackButton: s,
1378
- onShowInfo: k,
1379
- canShowInfo: !!S,
1380
- showStarButton: f
1385
+ onShowInfo: S,
1386
+ canShowInfo: !!I,
1387
+ showStarButton: g
1381
1388
  }
1382
1389
  ) }),
1383
- x == null ? void 0 : x(),
1390
+ b == null ? void 0 : b(),
1384
1391
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1385
1392
  jt,
1386
1393
  {
@@ -1403,65 +1410,65 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1403
1410
  {
1404
1411
  dialogRef: y,
1405
1412
  onClose: N,
1406
- participant: S,
1413
+ participant: I,
1407
1414
  channel: a,
1408
1415
  followerStatusLabel: v,
1409
1416
  onLeaveConversation: r,
1410
1417
  onBlockParticipant: l,
1411
- showDeleteConversation: d,
1418
+ showDeleteConversation: u,
1412
1419
  onDeleteConversationClick: o,
1413
- onBlockParticipantClick: u,
1414
- onReportParticipantClick: g,
1420
+ onBlockParticipantClick: m,
1421
+ onReportParticipantClick: x,
1415
1422
  customChannelActions: w
1416
1423
  }
1417
1424
  )
1418
1425
  ] });
1419
- }, We = B.memo(
1426
+ }, We = A.memo(
1420
1427
  ({
1421
1428
  channel: t,
1422
1429
  onBack: s,
1423
1430
  showBackButton: n = !1,
1424
1431
  renderMessageInputActions: r,
1425
1432
  onLeaveConversation: l,
1426
- onBlockParticipant: d,
1433
+ onBlockParticipant: u,
1427
1434
  className: o,
1428
- CustomChannelEmptyState: u = ws,
1429
- showDeleteConversation: g = !0,
1430
- onDeleteConversationClick: f,
1435
+ CustomChannelEmptyState: m = ws,
1436
+ showDeleteConversation: x = !0,
1437
+ onDeleteConversationClick: g,
1431
1438
  onBlockParticipantClick: C,
1432
- onReportParticipantClick: x,
1439
+ onReportParticipantClick: b,
1433
1440
  dmAgentEnabled: w,
1434
1441
  messageMetadata: a,
1435
1442
  onMessageSent: y,
1436
- showStarButton: S = !1,
1443
+ showStarButton: I = !1,
1437
1444
  chatbotVotingEnabled: v = !1,
1438
- renderChannelBanner: k,
1445
+ renderChannelBanner: S,
1439
1446
  customChannelActions: N
1440
1447
  }) => {
1441
- const m = P(
1442
- async (p, D, h) => {
1443
- var M;
1444
- const c = ((M = t.data) == null ? void 0 : M.chatbot_paused) === !0, b = w && !c, A = {
1445
- ...D,
1446
- ...b && { silent: !0 },
1448
+ const h = P(
1449
+ async (p, T, f) => {
1450
+ var D;
1451
+ const c = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, d = w && !c, M = {
1452
+ ...T,
1453
+ ...d && { silent: !0 },
1447
1454
  ...a && {
1448
1455
  metadata: {
1449
- ...D.metadata ?? {},
1456
+ ...T.metadata ?? {},
1450
1457
  ...a
1451
1458
  }
1452
1459
  }
1453
- }, _ = {
1454
- ...h,
1455
- ...b && { skip_push: !0 }
1456
- }, R = await t.sendMessage(A, _);
1457
- return y == null || y(R), R;
1460
+ }, k = {
1461
+ ...f,
1462
+ ...d && { skip_push: !0 }
1463
+ }, B = await t.sendMessage(M, k);
1464
+ return y == null || y(B), B;
1458
1465
  },
1459
1466
  [t, w, a, y]
1460
1467
  );
1461
1468
  return /* @__PURE__ */ e(
1462
1469
  "div",
1463
1470
  {
1464
- className: T(
1471
+ className: R(
1465
1472
  "messaging-channel-view h-full flex flex-col",
1466
1473
  o
1467
1474
  ),
@@ -1470,10 +1477,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1470
1477
  {
1471
1478
  channel: t,
1472
1479
  MessageSystem: vs,
1473
- EmptyStateIndicator: u,
1480
+ EmptyStateIndicator: m,
1474
1481
  LoadingIndicator: Ce,
1475
1482
  DateSeparator: ns,
1476
- doSendMessageRequest: m,
1483
+ doSendMessageRequest: h,
1477
1484
  children: /* @__PURE__ */ e(
1478
1485
  _s,
1479
1486
  {
@@ -1481,15 +1488,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1481
1488
  showBackButton: n,
1482
1489
  renderMessageInputActions: r,
1483
1490
  onLeaveConversation: l,
1484
- onBlockParticipant: d,
1485
- CustomChannelEmptyState: u,
1486
- showDeleteConversation: g,
1487
- onDeleteConversationClick: f,
1491
+ onBlockParticipant: u,
1492
+ CustomChannelEmptyState: m,
1493
+ showDeleteConversation: x,
1494
+ onDeleteConversationClick: g,
1488
1495
  onBlockParticipantClick: C,
1489
- onReportParticipantClick: x,
1490
- showStarButton: S,
1496
+ onReportParticipantClick: b,
1497
+ showStarButton: I,
1491
1498
  chatbotVotingEnabled: v,
1492
- renderChannelBanner: k,
1499
+ renderChannelBanner: S,
1493
1500
  customChannelActions: N
1494
1501
  }
1495
1502
  )
@@ -1545,61 +1552,61 @@ const Ss = ({
1545
1552
  onClose: n,
1546
1553
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
1547
1554
  participantLabel: l = "participants",
1548
- searchPlaceholder: d = "Search participants...",
1555
+ searchPlaceholder: u = "Search participants...",
1549
1556
  className: o
1550
1557
  }) => {
1551
- const { debug: u } = Ne(), [g, f] = I(""), [C, x] = I([]), [w, a] = I(!1), [y, S] = I(null), [v, k] = I(
1558
+ const { debug: m } = Ne(), [x, g] = _(""), [C, b] = _([]), [w, a] = _(!1), [y, I] = _(null), [v, S] = _(
1552
1559
  null
1553
1560
  ), N = q(!1);
1554
1561
  Y(() => {
1555
1562
  if (t.loading) {
1556
- u && console.log(
1563
+ m && console.log(
1557
1564
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1558
1565
  );
1559
1566
  return;
1560
1567
  }
1561
1568
  if (N.current) return;
1562
1569
  (async () => {
1563
- u && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), S(null);
1570
+ m && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), I(null);
1564
1571
  try {
1565
1572
  const c = await t.loadParticipants({
1566
1573
  search: "",
1567
1574
  // Load all participants initially
1568
1575
  limit: 100
1569
1576
  });
1570
- x(c.participants), N.current = !0, u && console.log(
1577
+ b(c.participants), N.current = !0, m && console.log(
1571
1578
  "[ParticipantPicker] Participants loaded successfully:",
1572
1579
  c.participants.length
1573
1580
  );
1574
1581
  } catch (c) {
1575
- const b = c instanceof Error ? c.message : "Failed to load participants";
1576
- S(b), console.error("[ParticipantPicker] Failed to load participants:", c);
1582
+ const d = c instanceof Error ? c.message : "Failed to load participants";
1583
+ I(d), console.error("[ParticipantPicker] Failed to load participants:", c);
1577
1584
  } finally {
1578
1585
  a(!1);
1579
1586
  }
1580
1587
  })();
1581
- }, [t.loading, u]);
1582
- const m = C.filter((h) => !r.has(h.id)).filter((h) => {
1583
- var b;
1584
- if (!g) return !0;
1585
- const c = g.toLowerCase();
1586
- return h.name.toLowerCase().includes(c) || ((b = h.email) == null ? void 0 : b.toLowerCase().includes(c)) || !1;
1588
+ }, [t.loading, m]);
1589
+ const h = C.filter((f) => !r.has(f.id)).filter((f) => {
1590
+ var d;
1591
+ if (!x) return !0;
1592
+ const c = x.toLowerCase();
1593
+ return f.name.toLowerCase().includes(c) || ((d = f.email) == null ? void 0 : d.toLowerCase().includes(c)) || !1;
1587
1594
  }), p = P(
1588
- async (h) => {
1595
+ async (f) => {
1589
1596
  if (!v) {
1590
- k(h.id);
1597
+ S(f.id);
1591
1598
  try {
1592
- await s(h);
1599
+ await s(f);
1593
1600
  } catch (c) {
1594
- console.error("[ParticipantPicker] Failed to start chat:", c), k(null);
1601
+ console.error("[ParticipantPicker] Failed to start chat:", c), S(null);
1595
1602
  }
1596
1603
  }
1597
1604
  },
1598
1605
  [s, v]
1599
- ), D = (h, c) => {
1600
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), p(c));
1606
+ ), T = (f, c) => {
1607
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), p(c));
1601
1608
  };
1602
- return /* @__PURE__ */ i("div", { className: T("flex flex-col h-full", o), children: [
1609
+ return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", o), children: [
1603
1610
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1604
1611
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1605
1612
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
@@ -1609,16 +1616,16 @@ const Ss = ({
1609
1616
  "Select a ",
1610
1617
  l.slice(0, -1),
1611
1618
  " to start messaging (",
1612
- m.length,
1619
+ h.length,
1613
1620
  " available)",
1614
1621
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${l} total`
1615
1622
  ] }),
1616
1623
  /* @__PURE__ */ e(
1617
1624
  Is,
1618
1625
  {
1619
- searchQuery: g,
1620
- setSearchQuery: f,
1621
- placeholder: d
1626
+ searchQuery: x,
1627
+ setSearchQuery: g,
1628
+ placeholder: u
1622
1629
  }
1623
1630
  )
1624
1631
  ] }),
@@ -1628,47 +1635,47 @@ const Ss = ({
1628
1635
  ": ",
1629
1636
  y
1630
1637
  ] }),
1631
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: w && m.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: [
1638
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: w && h.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: [
1632
1639
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1633
1640
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1634
1641
  "Loading ",
1635
1642
  l,
1636
1643
  "..."
1637
1644
  ] })
1638
- ] }) }) : m.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1645
+ ] }) }) : h.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1639
1646
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ue, { className: "h-8 w-8 text-charcoal" }) }),
1640
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : C.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1641
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : C.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1647
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : C.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1648
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : C.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1642
1649
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1643
- m.map((h) => {
1644
- const c = h.name || h.email || h.id, b = h.email && h.name ? h.email : h.phone;
1650
+ h.map((f) => {
1651
+ const c = f.name || f.email || f.id, d = f.email && f.name ? f.email : f.phone;
1645
1652
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1646
1653
  "button",
1647
1654
  {
1648
1655
  type: "button",
1649
- onClick: () => p(h),
1650
- onKeyDown: (A) => D(A, h),
1656
+ onClick: () => p(f),
1657
+ onKeyDown: (M) => T(M, f),
1651
1658
  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",
1652
1659
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1653
1660
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1654
1661
  /* @__PURE__ */ e(
1655
1662
  ee,
1656
1663
  {
1657
- id: h.id,
1664
+ id: f.id,
1658
1665
  name: c,
1659
- image: h.image,
1666
+ image: f.image,
1660
1667
  size: 40
1661
1668
  }
1662
1669
  ),
1663
1670
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1664
1671
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: c }),
1665
- b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1672
+ d && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: d })
1666
1673
  ] })
1667
1674
  ] }),
1668
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === h.id ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5 text-stone" }) })
1675
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === f.id ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5 text-stone" }) })
1669
1676
  ] })
1670
1677
  }
1671
- ) }, h.id);
1678
+ ) }, f.id);
1672
1679
  }),
1673
1680
  w && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1674
1681
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
@@ -1810,7 +1817,7 @@ const Ss = ({
1810
1817
  ] })
1811
1818
  ]
1812
1819
  }
1813
- ), qe = B.memo(
1820
+ ), qe = A.memo(
1814
1821
  ({ 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: [
1815
1822
  /* @__PURE__ */ e(Ms, {}),
1816
1823
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
@@ -1820,7 +1827,7 @@ const Ss = ({
1820
1827
  ] }) })
1821
1828
  );
1822
1829
  qe.displayName = "EmptyState";
1823
- const be = B.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: [
1830
+ const be = A.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: [
1824
1831
  /* @__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: "โš ๏ธ" }) }),
1825
1832
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1826
1833
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1841,37 +1848,37 @@ const As = ({
1841
1848
  renderMessageInputActions: n,
1842
1849
  onChannelSelect: r,
1843
1850
  onParticipantSelect: l,
1844
- initialParticipantFilter: d,
1851
+ initialParticipantFilter: u,
1845
1852
  initialParticipantData: o,
1846
- CustomChannelEmptyState: u,
1847
- showChannelList: g = !0,
1848
- filters: f,
1853
+ CustomChannelEmptyState: m,
1854
+ showChannelList: x = !0,
1855
+ filters: g,
1849
1856
  channelListCustomEmptyStateIndicator: C,
1850
- onDeleteConversationClick: x,
1857
+ onDeleteConversationClick: b,
1851
1858
  onBlockParticipantClick: w,
1852
1859
  onReportParticipantClick: a,
1853
1860
  dmAgentEnabled: y,
1854
- messageMetadata: S,
1861
+ messageMetadata: I,
1855
1862
  onMessageSent: v,
1856
- showStarButton: k = !1,
1863
+ showStarButton: S = !1,
1857
1864
  chatbotVotingEnabled: N = !1,
1858
- renderMessagePreview: m,
1865
+ renderMessagePreview: h,
1859
1866
  renderChannelBanner: p,
1860
- customChannelActions: D
1867
+ customChannelActions: T
1861
1868
  }) => {
1862
1869
  const {
1863
- service: h,
1870
+ service: f,
1864
1871
  client: c,
1865
- isConnected: b,
1866
- isLoading: A,
1867
- error: _,
1868
- refreshConnection: R,
1869
- debug: M
1870
- } = Yt(), [W, z] = I(null), [te, J] = I(!1), [se, ne] = I(!1), [ie, $] = I(!1), [Q, U] = I(/* @__PURE__ */ new Set()), [F, V] = I(0), [L, G] = I(!1), [de, Z] = I(null), ae = q(null), {
1872
+ isConnected: d,
1873
+ isLoading: M,
1874
+ error: k,
1875
+ refreshConnection: B,
1876
+ debug: D
1877
+ } = Yt(), [W, z] = _(null), [te, J] = _(!1), [se, ne] = _(!1), [ie, $] = _(!1), [Q, U] = _(/* @__PURE__ */ new Set()), [F, V] = _(0), [L, G] = _(!1), [de, Z] = _(null), ae = q(null), {
1871
1878
  participantSource: X,
1872
1879
  participantLabel: re = "participants",
1873
1880
  showDeleteConversation: ue = !0
1874
- } = t, me = B.useMemo(() => {
1881
+ } = t, me = A.useMemo(() => {
1875
1882
  const E = c == null ? void 0 : c.userID;
1876
1883
  return {
1877
1884
  ...{
@@ -1882,14 +1889,14 @@ const As = ({
1882
1889
  hidden: !1
1883
1890
  }
1884
1891
  },
1885
- ...f
1892
+ ...g
1886
1893
  };
1887
- }, [f, c == null ? void 0 : c.userID]), K = q(null), oe = P(async () => {
1888
- if (!c || !b) return;
1894
+ }, [g, c == null ? void 0 : c.userID]), K = q(null), oe = P(async () => {
1895
+ if (!c || !d) return;
1889
1896
  const E = c.userID;
1890
1897
  if (E)
1891
1898
  try {
1892
- M && console.log("[MessagingShell] Syncing channels for user:", E);
1899
+ D && console.log("[MessagingShell] Syncing channels for user:", E);
1893
1900
  const H = await c.queryChannels(
1894
1901
  {
1895
1902
  type: "messaging",
@@ -1905,54 +1912,54 @@ const As = ({
1905
1912
  const we = (ke = et.user) == null ? void 0 : ke.id;
1906
1913
  we && we !== E && O.add(we);
1907
1914
  });
1908
- }), U((j) => j.size === O.size && [...j].every((ve) => O.has(ve)) ? j : O), J(H.length > 0), ne(!0), K.current = E, M && console.log("[MessagingShell] Channels synced successfully:", {
1915
+ }), U((j) => j.size === O.size && [...j].every((ve) => O.has(ve)) ? j : O), J(H.length > 0), ne(!0), K.current = E, D && console.log("[MessagingShell] Channels synced successfully:", {
1909
1916
  channelCount: H.length,
1910
1917
  memberCount: O.size
1911
1918
  });
1912
1919
  } catch (H) {
1913
1920
  console.error("[MessagingShell] Failed to sync channels:", H);
1914
1921
  }
1915
- }, [c, b, M]);
1922
+ }, [c, d, D]);
1916
1923
  Y(() => {
1917
- if (!c || !b) return;
1924
+ if (!c || !d) return;
1918
1925
  const E = c.userID;
1919
1926
  E && K.current !== E && oe();
1920
- }, [c, b, oe]), Y(() => {
1921
- if (!d || !c || !b) return;
1927
+ }, [c, d, oe]), Y(() => {
1928
+ if (!u || !c || !d) return;
1922
1929
  (async () => {
1923
1930
  const H = c.userID;
1924
1931
  if (H)
1925
1932
  try {
1926
- M && console.log(
1933
+ D && console.log(
1927
1934
  "[MessagingShell] Loading initial conversation with:",
1928
- d
1935
+ u
1929
1936
  );
1930
1937
  const O = await c.queryChannels(
1931
1938
  {
1932
1939
  type: "messaging",
1933
- members: { $eq: [H, d] }
1940
+ members: { $eq: [H, u] }
1934
1941
  },
1935
1942
  {},
1936
1943
  { limit: 1 }
1937
1944
  );
1938
1945
  if (O.length > 0)
1939
- z(O[0]), G(!0), Z(null), r && r(O[0]), M && console.log(
1946
+ z(O[0]), G(!0), Z(null), r && r(O[0]), D && console.log(
1940
1947
  "[MessagingShell] Initial conversation loaded:",
1941
1948
  O[0].id
1942
1949
  );
1943
- else if (o && h) {
1944
- M && console.log(
1950
+ else if (o && f) {
1951
+ D && console.log(
1945
1952
  "[MessagingShell] No conversation found, creating one for:",
1946
1953
  o
1947
1954
  );
1948
1955
  try {
1949
- const j = await h.startChannelWithParticipant({
1956
+ const j = await f.startChannelWithParticipant({
1950
1957
  id: o.id,
1951
1958
  name: o.name,
1952
1959
  email: o.email,
1953
1960
  phone: o.phone
1954
1961
  });
1955
- z(j), G(!0), Z(null), r && r(j), M && console.log(
1962
+ z(j), G(!0), Z(null), r && r(j), D && console.log(
1956
1963
  "[MessagingShell] Channel created and loaded:",
1957
1964
  j.id
1958
1965
  );
@@ -1965,9 +1972,9 @@ const As = ({
1965
1972
  } else
1966
1973
  Z(
1967
1974
  "No conversation found with this account"
1968
- ), M && console.log(
1975
+ ), D && console.log(
1969
1976
  "[MessagingShell] No conversation found for:",
1970
- d
1977
+ u
1971
1978
  );
1972
1979
  } catch (O) {
1973
1980
  console.error(
@@ -1977,12 +1984,12 @@ const As = ({
1977
1984
  }
1978
1985
  })();
1979
1986
  }, [
1980
- d,
1987
+ u,
1981
1988
  o,
1982
1989
  c,
1983
- b,
1984
- h,
1985
- M,
1990
+ d,
1991
+ f,
1992
+ D,
1986
1993
  r
1987
1994
  ]);
1988
1995
  const Ye = P(
@@ -1995,13 +2002,13 @@ const As = ({
1995
2002
  }, [L]), Je = P(
1996
2003
  async (E) => {
1997
2004
  var H;
1998
- if (h)
2005
+ if (f)
1999
2006
  try {
2000
- M && console.log(
2007
+ D && console.log(
2001
2008
  "[MessagingShell] Starting conversation with:",
2002
2009
  E.id
2003
2010
  );
2004
- const O = await h.startChannelWithParticipant({
2011
+ const O = await f.startChannelWithParticipant({
2005
2012
  id: E.id,
2006
2013
  name: E.name,
2007
2014
  email: E.email,
@@ -2017,7 +2024,7 @@ const As = ({
2017
2024
  console.error("[MessagingShell] Failed to start conversation:", O);
2018
2025
  }
2019
2026
  },
2020
- [h, l, M]
2027
+ [f, l, D]
2021
2028
  ), he = P(() => {
2022
2029
  var E;
2023
2030
  $(!1), (E = ae.current) == null || E.close();
@@ -2028,25 +2035,25 @@ const As = ({
2028
2035
  [he]
2029
2036
  ), Xe = P(
2030
2037
  async (E) => {
2031
- M && console.log("[MessagingShell] Leaving conversation:", E.id), z(null), G(!1), K.current = null, await oe();
2038
+ D && console.log("[MessagingShell] Leaving conversation:", E.id), z(null), G(!1), K.current = null, await oe();
2032
2039
  },
2033
- [oe, M]
2040
+ [oe, D]
2034
2041
  ), Ke = P(
2035
2042
  async (E) => {
2036
- M && console.log("[MessagingShell] Blocking participant:", E), z(null), G(!1), K.current = null, await oe();
2043
+ D && console.log("[MessagingShell] Blocking participant:", E), z(null), G(!1), K.current = null, await oe();
2037
2044
  },
2038
- [oe, M]
2045
+ [oe, D]
2039
2046
  ), fe = !!W;
2040
- return A ? /* @__PURE__ */ e("div", { className: T("h-full", s), children: /* @__PURE__ */ e(Ce, {}) }) : _ ? /* @__PURE__ */ e("div", { className: T("h-full", s), children: /* @__PURE__ */ e(be, { message: _, onBack: R }) }) : !b || !c ? /* @__PURE__ */ e("div", { className: T("h-full", s), children: /* @__PURE__ */ e(
2047
+ return M ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, {}) }) : k ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(be, { message: k, onBack: B }) }) : !d || !c ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
2041
2048
  be,
2042
2049
  {
2043
2050
  message: "Not connected to messaging service",
2044
- onBack: R
2051
+ onBack: B
2045
2052
  }
2046
- ) }) : de ? /* @__PURE__ */ e("div", { className: T("h-full", s), children: /* @__PURE__ */ e(be, { message: de }) }) : /* @__PURE__ */ i(
2053
+ ) }) : de ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(be, { message: de }) }) : /* @__PURE__ */ i(
2047
2054
  "div",
2048
2055
  {
2049
- className: T(
2056
+ className: R(
2050
2057
  "messaging-shell h-full bg-background-primary overflow-hidden",
2051
2058
  s
2052
2059
  ),
@@ -2055,14 +2062,14 @@ const As = ({
2055
2062
  /* @__PURE__ */ e(
2056
2063
  "div",
2057
2064
  {
2058
- className: T(
2065
+ className: R(
2059
2066
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2060
2067
  {
2061
- "!hidden": g === !1 || L,
2068
+ "!hidden": x === !1 || L,
2062
2069
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2063
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !L && fe,
2070
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": x !== !1 && !L && fe,
2064
2071
  // Show on mobile when no channel selected, use same wide width on desktop
2065
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !L && !fe
2072
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": x !== !1 && !L && !fe
2066
2073
  }
2067
2074
  ),
2068
2075
  children: /* @__PURE__ */ e(
@@ -2072,7 +2079,7 @@ const As = ({
2072
2079
  selectedChannel: W || void 0,
2073
2080
  filters: me,
2074
2081
  customEmptyStateIndicator: C,
2075
- renderMessagePreview: m
2082
+ renderMessagePreview: h
2076
2083
  }
2077
2084
  )
2078
2085
  }
@@ -2080,13 +2087,13 @@ const As = ({
2080
2087
  /* @__PURE__ */ e(
2081
2088
  "div",
2082
2089
  {
2083
- className: T(
2090
+ className: R(
2084
2091
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2085
2092
  {
2086
2093
  // In direct conversation mode (or waiting for it), always show (full width)
2087
- flex: L || fe || d,
2094
+ flex: L || fe || u,
2088
2095
  // Normal mode: hide on mobile when no channel selected
2089
- "hidden lg:flex": !L && !fe && !d
2096
+ "hidden lg:flex": !L && !fe && !u
2090
2097
  }
2091
2098
  ),
2092
2099
  children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
@@ -2099,20 +2106,20 @@ const As = ({
2099
2106
  renderChannelBanner: p,
2100
2107
  onLeaveConversation: Xe,
2101
2108
  onBlockParticipant: Ke,
2102
- CustomChannelEmptyState: u,
2109
+ CustomChannelEmptyState: m,
2103
2110
  showDeleteConversation: ue,
2104
- onDeleteConversationClick: x,
2111
+ onDeleteConversationClick: b,
2105
2112
  onBlockParticipantClick: w,
2106
2113
  onReportParticipantClick: a,
2107
2114
  dmAgentEnabled: y,
2108
- messageMetadata: S,
2115
+ messageMetadata: I,
2109
2116
  onMessageSent: v,
2110
- showStarButton: k,
2117
+ showStarButton: S,
2111
2118
  chatbotVotingEnabled: N,
2112
- customChannelActions: D
2119
+ customChannelActions: T
2113
2120
  },
2114
2121
  W.id
2115
- ) }) : d ? (
2122
+ ) }) : u ? (
2116
2123
  // Show loading while creating/loading direct conversation channel
2117
2124
  /* @__PURE__ */ e(Ce, {})
2118
2125
  ) : /* @__PURE__ */ e(
@@ -2162,7 +2169,7 @@ const As = ({
2162
2169
  onClick: s,
2163
2170
  disabled: n,
2164
2171
  style: { backgroundColor: "#E6E5E3" },
2165
- className: T(
2172
+ className: R(
2166
2173
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
2167
2174
  {
2168
2175
  "hover:brightness-95 active:brightness-90": !n,
@@ -2178,17 +2185,17 @@ const As = ({
2178
2185
  loadingFaqId: n,
2179
2186
  headerText: r,
2180
2187
  className: l,
2181
- avatarImage: d,
2188
+ avatarImage: u,
2182
2189
  avatarName: o
2183
2190
  }) => {
2184
- const u = t.filter((g) => g.enabled).sort((g, f) => (g.order ?? 0) - (f.order ?? 0));
2185
- return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2186
- (d || o) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2191
+ const m = t.filter((x) => x.enabled).sort((x, g) => (x.order ?? 0) - (g.order ?? 0));
2192
+ return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2193
+ (u || o) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2187
2194
  ee,
2188
2195
  {
2189
2196
  id: o || "account",
2190
2197
  name: o || "Account",
2191
- image: d,
2198
+ image: u,
2192
2199
  size: 24,
2193
2200
  shape: "circle"
2194
2201
  }
@@ -2200,58 +2207,58 @@ const As = ({
2200
2207
  style: { backgroundColor: "#F1F0EE" },
2201
2208
  children: [
2202
2209
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
2203
- u.map((g) => /* @__PURE__ */ e(
2210
+ m.map((x) => /* @__PURE__ */ e(
2204
2211
  ks,
2205
2212
  {
2206
- question: g.question,
2207
- onClick: () => s(g.id),
2208
- loading: n === g.id
2213
+ question: x.question,
2214
+ onClick: () => s(x.id),
2215
+ loading: n === x.id
2209
2216
  },
2210
- g.id
2217
+ x.id
2211
2218
  ))
2212
2219
  ]
2213
2220
  }
2214
2221
  )
2215
2222
  ] }) });
2216
2223
  }, $s = (t, s = {}) => {
2217
- const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = I([]), [o, u] = I(!1), [g, f] = I(null), [C, x] = I(n), [w, a] = I(!0), [y, S] = I(), v = P(async (p = !1, D) => {
2224
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [l, u] = _([]), [o, m] = _(!1), [x, g] = _(null), [C, b] = _(n), [w, a] = _(!0), [y, I] = _(), v = P(async (p = !1, T) => {
2218
2225
  if (o) return;
2219
- const h = D !== void 0 ? D : C;
2220
- u(!0), f(null);
2226
+ const f = T !== void 0 ? T : C;
2227
+ m(!0), g(null);
2221
2228
  try {
2222
2229
  const c = await t.loadParticipants({
2223
- search: h || void 0,
2230
+ search: f || void 0,
2224
2231
  limit: r,
2225
2232
  cursor: p ? void 0 : y
2226
2233
  });
2227
- d(
2228
- (b) => p ? c.participants : [...b, ...c.participants]
2229
- ), a(c.hasMore), S(c.nextCursor);
2234
+ u(
2235
+ (d) => p ? c.participants : [...d, ...c.participants]
2236
+ ), a(c.hasMore), I(c.nextCursor);
2230
2237
  } catch (c) {
2231
- const b = c instanceof Error ? c.message : "Failed to load participants";
2232
- f(b), console.error("[useParticipants] Load error:", c);
2238
+ const d = c instanceof Error ? c.message : "Failed to load participants";
2239
+ g(d), console.error("[useParticipants] Load error:", c);
2233
2240
  } finally {
2234
- u(!1);
2241
+ m(!1);
2235
2242
  }
2236
- }, [t, C, y, r, o]), k = P(() => {
2243
+ }, [t, C, y, r, o]), S = P(() => {
2237
2244
  w && !o && v(!1);
2238
2245
  }, [w, o, v]), N = P((p) => {
2239
- x(p), S(void 0), v(!0, p);
2240
- }, [v]), m = P(() => {
2241
- S(void 0), v(!0);
2246
+ b(p), I(void 0), v(!0, p);
2247
+ }, [v]), h = P(() => {
2248
+ I(void 0), v(!0);
2242
2249
  }, [v]);
2243
2250
  return Y(() => {
2244
2251
  v(!0);
2245
2252
  }, [t.loadParticipants]), {
2246
2253
  participants: l,
2247
2254
  loading: o,
2248
- error: g,
2255
+ error: x,
2249
2256
  searchQuery: C,
2250
2257
  hasMore: w,
2251
2258
  totalCount: t.totalCount,
2252
- loadMore: k,
2259
+ loadMore: S,
2253
2260
  search: N,
2254
- refresh: m
2261
+ refresh: h
2255
2262
  };
2256
2263
  };
2257
2264
  export {