@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
|
|
3
|
-
import
|
|
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:
|
|
24
|
+
debug: u = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const o = P(
|
|
27
|
-
(c, ...
|
|
28
|
-
|
|
27
|
+
(c, ...d) => {
|
|
28
|
+
u && console.log(`๐ฅ [MessagingProvider] ${c}`, ...d);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
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 [
|
|
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
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
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 =
|
|
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
|
|
82
|
+
const d = new nt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
|
-
debug:
|
|
85
|
+
debug: u
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return x(d), o("โ
SERVICE SET", {
|
|
88
88
|
renderCount: c,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!d
|
|
90
90
|
}), () => {
|
|
91
91
|
o("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: c,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), d.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [r, n,
|
|
96
|
+
}, [r, n, u, o]);
|
|
97
97
|
const p = q(null);
|
|
98
98
|
Y(() => {
|
|
99
|
-
var
|
|
99
|
+
var d, M;
|
|
100
100
|
if (o("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!
|
|
101
|
+
hasService: !!m,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
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 (
|
|
111
|
+
if (S.current) {
|
|
112
112
|
o("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
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 }),
|
|
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
|
|
127
|
-
C(
|
|
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:
|
|
129
|
+
clientId: k.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
v(
|
|
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:
|
|
135
|
+
error: B
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
y(!1),
|
|
138
|
+
y(!1), S.current = !1, o("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: b
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
146
|
-
isConnected:
|
|
144
|
+
}, [m, s, o, b]), Y(() => (o("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!m,
|
|
146
|
+
isConnected: b
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
m && b ? (o(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
), p.current = null,
|
|
152
|
-
hasService: !!
|
|
153
|
-
isConnected:
|
|
151
|
+
), p.current = null, m.disconnectUser().catch(console.error)) : o("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!m,
|
|
153
|
+
isConnected: b
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const
|
|
155
|
+
}), [m, b, o]);
|
|
156
|
+
const T = P(async () => {
|
|
157
157
|
if (o("๐ REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!
|
|
158
|
+
hasService: !!m,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
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
|
|
167
|
-
const c = await
|
|
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
|
|
171
|
-
v(
|
|
170
|
+
const d = c instanceof Error ? c.message : "Refresh failed";
|
|
171
|
+
v(d), o("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: d
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
176
|
y(!1), o("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
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: !!
|
|
183
|
+
hasError: !!I,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
186
|
+
service: m,
|
|
187
|
+
client: g,
|
|
188
|
+
isConnected: b,
|
|
189
189
|
isLoading: a,
|
|
190
|
-
error:
|
|
190
|
+
error: I,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: T,
|
|
193
|
+
debug: u
|
|
194
194
|
}), [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
m,
|
|
196
|
+
g,
|
|
197
|
+
b,
|
|
198
198
|
a,
|
|
199
|
-
|
|
199
|
+
I,
|
|
200
200
|
l,
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
T,
|
|
202
|
+
u,
|
|
203
203
|
o
|
|
204
204
|
]);
|
|
205
205
|
return o("๐ RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e($e.Provider, { value:
|
|
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:
|
|
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
|
|
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:
|
|
294
|
+
className: R("flex-shrink-0 overflow-hidden", r),
|
|
295
295
|
style: {
|
|
296
296
|
width: `${n}px`,
|
|
297
297
|
height: `${n}px`,
|
|
298
|
-
...
|
|
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:
|
|
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
|
-
|
|
313
|
+
m
|
|
314
314
|
),
|
|
315
|
-
children:
|
|
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
|
|
356
|
-
const l = je(t),
|
|
357
|
-
if (!l && !
|
|
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 = (
|
|
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,
|
|
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(" "),
|
|
373
|
-
return /* @__PURE__ */ e("div", { className:
|
|
374
|
-
|
|
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
|
-
|
|
378
|
+
g
|
|
379
379
|
] }) });
|
|
380
|
-
}, Ge =
|
|
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:
|
|
387
|
+
renderMessagePreview: u
|
|
388
388
|
}) => {
|
|
389
|
-
var p,
|
|
390
|
-
const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id),
|
|
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
|
-
},
|
|
393
|
-
const
|
|
394
|
-
!
|
|
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
|
|
398
|
-
return ((
|
|
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
|
-
)
|
|
401
|
-
var
|
|
407
|
+
})(), I = (() => {
|
|
408
|
+
var M;
|
|
402
409
|
if (a != null && a.text) return a.text;
|
|
403
|
-
const
|
|
404
|
-
return
|
|
405
|
-
})(), v = a != null && a.created_at ? Jt(new Date(a.created_at)) : "",
|
|
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:
|
|
410
|
-
unreadCount:
|
|
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:
|
|
418
|
-
onKeyDown:
|
|
419
|
-
className:
|
|
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: ((
|
|
431
|
-
name:
|
|
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:
|
|
449
|
+
className: R(
|
|
443
450
|
"text-sm font-medium truncate",
|
|
444
451
|
o ? "text-primary" : "text-charcoal"
|
|
445
452
|
),
|
|
446
|
-
children:
|
|
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
|
-
|
|
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 =
|
|
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:
|
|
476
|
+
renderMessagePreview: u
|
|
470
477
|
}) => {
|
|
471
|
-
const o =
|
|
478
|
+
const o = A.useRef(0);
|
|
472
479
|
o.current++;
|
|
473
|
-
const { debug:
|
|
474
|
-
|
|
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
|
|
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:
|
|
486
|
-
renderMessagePreview:
|
|
492
|
+
debug: m,
|
|
493
|
+
renderMessagePreview: u
|
|
487
494
|
}
|
|
488
|
-
), [s, t,
|
|
495
|
+
), [s, t, m, u]);
|
|
489
496
|
return /* @__PURE__ */ e(
|
|
490
497
|
"div",
|
|
491
498
|
{
|
|
492
|
-
className:
|
|
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:
|
|
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:
|
|
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:
|
|
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]),
|
|
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:
|
|
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:
|
|
646
|
+
firstOfGroup: u,
|
|
640
647
|
groupedByUser: o,
|
|
641
|
-
handleAction:
|
|
642
|
-
handleOpenThread:
|
|
643
|
-
handleRetry:
|
|
648
|
+
handleAction: m,
|
|
649
|
+
handleOpenThread: x,
|
|
650
|
+
handleRetry: g,
|
|
644
651
|
highlighted: C,
|
|
645
|
-
isMessageAIGenerated:
|
|
652
|
+
isMessageAIGenerated: b,
|
|
646
653
|
isMyMessage: w,
|
|
647
654
|
message: a,
|
|
648
655
|
renderText: y,
|
|
649
|
-
threadList:
|
|
650
|
-
} = t, { client: v } = Be("CustomMessage"), [
|
|
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:
|
|
653
|
-
MessageBlocked:
|
|
654
|
-
MessageBouncePrompt:
|
|
655
|
-
MessageDeleted:
|
|
656
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
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
|
-
() =>
|
|
663
|
-
[
|
|
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(
|
|
678
|
+
return /* @__PURE__ */ e(B, { message: a });
|
|
672
679
|
if (pt(a))
|
|
673
|
-
return /* @__PURE__ */ e(
|
|
674
|
-
const Q = !
|
|
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 = () =>
|
|
677
|
-
const G = w(), de =
|
|
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":
|
|
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
|
-
|
|
704
|
+
d,
|
|
698
705
|
{
|
|
699
706
|
additionalMessageInputProps: s
|
|
700
707
|
}
|
|
701
708
|
),
|
|
702
|
-
|
|
709
|
+
S && /* @__PURE__ */ e(
|
|
703
710
|
Et,
|
|
704
711
|
{
|
|
705
|
-
MessageBouncePrompt:
|
|
712
|
+
MessageBouncePrompt: k,
|
|
706
713
|
onClose: () => N(!1),
|
|
707
|
-
open:
|
|
714
|
+
open: S
|
|
708
715
|
}
|
|
709
716
|
),
|
|
710
717
|
/* @__PURE__ */ i("div", { className: de, children: [
|
|
711
718
|
J && /* @__PURE__ */ e(J, {}),
|
|
712
|
-
!!
|
|
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:
|
|
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:
|
|
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:
|
|
782
|
-
onVoteDown:
|
|
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:
|
|
798
|
+
onClick: x,
|
|
792
799
|
reply_count: a.reply_count
|
|
793
800
|
}
|
|
794
801
|
),
|
|
795
|
-
U && /* @__PURE__ */ e(
|
|
802
|
+
U && /* @__PURE__ */ e(D, {})
|
|
796
803
|
] }, a.id)
|
|
797
804
|
] });
|
|
798
|
-
}, ds =
|
|
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:
|
|
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 =
|
|
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,
|
|
1007
|
-
const { channel:
|
|
1008
|
-
(
|
|
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 =
|
|
1017
|
+
return ((p = h.user) == null ? void 0 : p.id) && h.user.id !== u._client.userID;
|
|
1011
1018
|
}
|
|
1012
|
-
), [
|
|
1013
|
-
!!((
|
|
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 = (
|
|
1023
|
+
const N = (h) => {
|
|
1017
1024
|
var p;
|
|
1018
1025
|
C(
|
|
1019
|
-
|
|
1026
|
+
h != null && h.member ? !!h.member.pinned_at : !!((p = u.state.membership) != null && p.pinned_at)
|
|
1020
1027
|
);
|
|
1021
1028
|
};
|
|
1022
|
-
return
|
|
1023
|
-
|
|
1029
|
+
return u.on("member.updated", N), () => {
|
|
1030
|
+
u.off("member.updated", N);
|
|
1024
1031
|
};
|
|
1025
|
-
}, [
|
|
1026
|
-
const
|
|
1032
|
+
}, [u]);
|
|
1033
|
+
const b = async () => {
|
|
1027
1034
|
try {
|
|
1028
|
-
|
|
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) ||
|
|
1054
|
-
name:
|
|
1055
|
-
image:
|
|
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:
|
|
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:
|
|
1073
|
+
onClick: b,
|
|
1067
1074
|
type: "button",
|
|
1068
|
-
"aria-label":
|
|
1075
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
1069
1076
|
children: /* @__PURE__ */ e(
|
|
1070
1077
|
Re,
|
|
1071
1078
|
{
|
|
1072
|
-
className:
|
|
1073
|
-
"text-yellow-600":
|
|
1074
|
-
"text-black/90": !
|
|
1079
|
+
className: R("size-5", {
|
|
1080
|
+
"text-yellow-600": g,
|
|
1081
|
+
"text-black/90": !g
|
|
1075
1082
|
}),
|
|
1076
|
-
weight:
|
|
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: ((
|
|
1109
|
-
name:
|
|
1110
|
-
image:
|
|
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:
|
|
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:
|
|
1128
|
+
onClick: b,
|
|
1122
1129
|
type: "button",
|
|
1123
|
-
"aria-label":
|
|
1130
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
1124
1131
|
children: /* @__PURE__ */ e(
|
|
1125
1132
|
Re,
|
|
1126
1133
|
{
|
|
1127
|
-
className:
|
|
1128
|
-
"text-yellow-600":
|
|
1129
|
-
"text-black/90": !
|
|
1134
|
+
className: R("size-5", {
|
|
1135
|
+
"text-yellow-600": g,
|
|
1136
|
+
"text-black/90": !g
|
|
1130
1137
|
}),
|
|
1131
|
-
weight:
|
|
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:
|
|
1162
|
+
onLeaveConversation: u,
|
|
1156
1163
|
onBlockParticipant: o,
|
|
1157
|
-
showDeleteConversation:
|
|
1158
|
-
onDeleteConversationClick:
|
|
1159
|
-
onBlockParticipantClick:
|
|
1164
|
+
showDeleteConversation: m = !0,
|
|
1165
|
+
onDeleteConversationClick: x,
|
|
1166
|
+
onBlockParticipantClick: g,
|
|
1160
1167
|
onReportParticipantClick: C,
|
|
1161
|
-
customChannelActions:
|
|
1168
|
+
customChannelActions: b
|
|
1162
1169
|
}) => {
|
|
1163
1170
|
var te, J, se, ne, ie, $, Q;
|
|
1164
|
-
const { service: w, debug: a } = Ne(), [y,
|
|
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
|
-
|
|
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
|
|
1192
|
+
const T = async () => {
|
|
1186
1193
|
var U;
|
|
1187
1194
|
if (!v) {
|
|
1188
|
-
|
|
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),
|
|
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
|
-
|
|
1202
|
+
S(!1);
|
|
1196
1203
|
}
|
|
1197
1204
|
}
|
|
1198
|
-
},
|
|
1205
|
+
}, f = async () => {
|
|
1199
1206
|
var U, F, V;
|
|
1200
1207
|
if (!(N || !w)) {
|
|
1201
|
-
|
|
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
|
-
|
|
1214
|
+
h(!1);
|
|
1208
1215
|
}
|
|
1209
1216
|
}
|
|
1210
1217
|
}, c = async () => {
|
|
1211
1218
|
var U, F, V;
|
|
1212
1219
|
if (!(N || !w)) {
|
|
1213
|
-
|
|
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
|
-
|
|
1226
|
+
h(!1);
|
|
1220
1227
|
}
|
|
1221
1228
|
}
|
|
1222
|
-
},
|
|
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
|
|
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:
|
|
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:
|
|
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
|
-
|
|
1293
|
+
m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1287
1294
|
ge,
|
|
1288
1295
|
{
|
|
1289
|
-
onClick:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
1345
|
+
showDeleteConversation: u = !0,
|
|
1339
1346
|
onDeleteConversationClick: o,
|
|
1340
|
-
onBlockParticipantClick:
|
|
1341
|
-
onReportParticipantClick:
|
|
1342
|
-
showStarButton:
|
|
1347
|
+
onBlockParticipantClick: m,
|
|
1348
|
+
onReportParticipantClick: x,
|
|
1349
|
+
showStarButton: g = !1,
|
|
1343
1350
|
chatbotVotingEnabled: C = !1,
|
|
1344
|
-
renderChannelBanner:
|
|
1351
|
+
renderChannelBanner: b,
|
|
1345
1352
|
customChannelActions: w
|
|
1346
1353
|
}) => {
|
|
1347
|
-
const { channel: a } = Ie(), y = q(null),
|
|
1354
|
+
const { channel: a } = Ie(), y = q(null), I = A.useMemo(() => Object.values(a.state.members || {}).find(
|
|
1348
1355
|
(p) => {
|
|
1349
|
-
var
|
|
1350
|
-
return ((
|
|
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 =
|
|
1353
|
-
const
|
|
1354
|
-
if (
|
|
1355
|
-
return String(
|
|
1356
|
-
if (
|
|
1357
|
-
return
|
|
1358
|
-
}, [a.data]),
|
|
1359
|
-
var
|
|
1360
|
-
(
|
|
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
|
|
1363
|
-
(
|
|
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: (
|
|
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:
|
|
1379
|
-
canShowInfo: !!
|
|
1380
|
-
showStarButton:
|
|
1385
|
+
onShowInfo: S,
|
|
1386
|
+
canShowInfo: !!I,
|
|
1387
|
+
showStarButton: g
|
|
1381
1388
|
}
|
|
1382
1389
|
) }),
|
|
1383
|
-
|
|
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:
|
|
1413
|
+
participant: I,
|
|
1407
1414
|
channel: a,
|
|
1408
1415
|
followerStatusLabel: v,
|
|
1409
1416
|
onLeaveConversation: r,
|
|
1410
1417
|
onBlockParticipant: l,
|
|
1411
|
-
showDeleteConversation:
|
|
1418
|
+
showDeleteConversation: u,
|
|
1412
1419
|
onDeleteConversationClick: o,
|
|
1413
|
-
onBlockParticipantClick:
|
|
1414
|
-
onReportParticipantClick:
|
|
1420
|
+
onBlockParticipantClick: m,
|
|
1421
|
+
onReportParticipantClick: x,
|
|
1415
1422
|
customChannelActions: w
|
|
1416
1423
|
}
|
|
1417
1424
|
)
|
|
1418
1425
|
] });
|
|
1419
|
-
}, We =
|
|
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:
|
|
1433
|
+
onBlockParticipant: u,
|
|
1427
1434
|
className: o,
|
|
1428
|
-
CustomChannelEmptyState:
|
|
1429
|
-
showDeleteConversation:
|
|
1430
|
-
onDeleteConversationClick:
|
|
1435
|
+
CustomChannelEmptyState: m = ws,
|
|
1436
|
+
showDeleteConversation: x = !0,
|
|
1437
|
+
onDeleteConversationClick: g,
|
|
1431
1438
|
onBlockParticipantClick: C,
|
|
1432
|
-
onReportParticipantClick:
|
|
1439
|
+
onReportParticipantClick: b,
|
|
1433
1440
|
dmAgentEnabled: w,
|
|
1434
1441
|
messageMetadata: a,
|
|
1435
1442
|
onMessageSent: y,
|
|
1436
|
-
showStarButton:
|
|
1443
|
+
showStarButton: I = !1,
|
|
1437
1444
|
chatbotVotingEnabled: v = !1,
|
|
1438
|
-
renderChannelBanner:
|
|
1445
|
+
renderChannelBanner: S,
|
|
1439
1446
|
customChannelActions: N
|
|
1440
1447
|
}) => {
|
|
1441
|
-
const
|
|
1442
|
-
async (p,
|
|
1443
|
-
var
|
|
1444
|
-
const c = ((
|
|
1445
|
-
...
|
|
1446
|
-
...
|
|
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
|
-
...
|
|
1456
|
+
...T.metadata ?? {},
|
|
1450
1457
|
...a
|
|
1451
1458
|
}
|
|
1452
1459
|
}
|
|
1453
|
-
},
|
|
1454
|
-
...
|
|
1455
|
-
...
|
|
1456
|
-
},
|
|
1457
|
-
return y == null || y(
|
|
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:
|
|
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:
|
|
1480
|
+
EmptyStateIndicator: m,
|
|
1474
1481
|
LoadingIndicator: Ce,
|
|
1475
1482
|
DateSeparator: ns,
|
|
1476
|
-
doSendMessageRequest:
|
|
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:
|
|
1485
|
-
CustomChannelEmptyState:
|
|
1486
|
-
showDeleteConversation:
|
|
1487
|
-
onDeleteConversationClick:
|
|
1491
|
+
onBlockParticipant: u,
|
|
1492
|
+
CustomChannelEmptyState: m,
|
|
1493
|
+
showDeleteConversation: x,
|
|
1494
|
+
onDeleteConversationClick: g,
|
|
1488
1495
|
onBlockParticipantClick: C,
|
|
1489
|
-
onReportParticipantClick:
|
|
1490
|
-
showStarButton:
|
|
1496
|
+
onReportParticipantClick: b,
|
|
1497
|
+
showStarButton: I,
|
|
1491
1498
|
chatbotVotingEnabled: v,
|
|
1492
|
-
renderChannelBanner:
|
|
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:
|
|
1555
|
+
searchPlaceholder: u = "Search participants...",
|
|
1549
1556
|
className: o
|
|
1550
1557
|
}) => {
|
|
1551
|
-
const { debug:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
1576
|
-
|
|
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,
|
|
1582
|
-
const
|
|
1583
|
-
var
|
|
1584
|
-
if (!
|
|
1585
|
-
const c =
|
|
1586
|
-
return
|
|
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 (
|
|
1595
|
+
async (f) => {
|
|
1589
1596
|
if (!v) {
|
|
1590
|
-
|
|
1597
|
+
S(f.id);
|
|
1591
1598
|
try {
|
|
1592
|
-
await s(
|
|
1599
|
+
await s(f);
|
|
1593
1600
|
} catch (c) {
|
|
1594
|
-
console.error("[ParticipantPicker] Failed to start chat:", c),
|
|
1601
|
+
console.error("[ParticipantPicker] Failed to start chat:", c), S(null);
|
|
1595
1602
|
}
|
|
1596
1603
|
}
|
|
1597
1604
|
},
|
|
1598
1605
|
[s, v]
|
|
1599
|
-
),
|
|
1600
|
-
(
|
|
1606
|
+
), T = (f, c) => {
|
|
1607
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), p(c));
|
|
1601
1608
|
};
|
|
1602
|
-
return /* @__PURE__ */ i("div", { className:
|
|
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
|
-
|
|
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:
|
|
1620
|
-
setSearchQuery:
|
|
1621
|
-
placeholder:
|
|
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 &&
|
|
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
|
-
] }) }) :
|
|
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:
|
|
1641
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
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
|
-
|
|
1644
|
-
const c =
|
|
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(
|
|
1650
|
-
onKeyDown: (
|
|
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:
|
|
1664
|
+
id: f.id,
|
|
1658
1665
|
name: c,
|
|
1659
|
-
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
|
-
|
|
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 ===
|
|
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
|
-
) },
|
|
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 =
|
|
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 =
|
|
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:
|
|
1851
|
+
initialParticipantFilter: u,
|
|
1845
1852
|
initialParticipantData: o,
|
|
1846
|
-
CustomChannelEmptyState:
|
|
1847
|
-
showChannelList:
|
|
1848
|
-
filters:
|
|
1853
|
+
CustomChannelEmptyState: m,
|
|
1854
|
+
showChannelList: x = !0,
|
|
1855
|
+
filters: g,
|
|
1849
1856
|
channelListCustomEmptyStateIndicator: C,
|
|
1850
|
-
onDeleteConversationClick:
|
|
1857
|
+
onDeleteConversationClick: b,
|
|
1851
1858
|
onBlockParticipantClick: w,
|
|
1852
1859
|
onReportParticipantClick: a,
|
|
1853
1860
|
dmAgentEnabled: y,
|
|
1854
|
-
messageMetadata:
|
|
1861
|
+
messageMetadata: I,
|
|
1855
1862
|
onMessageSent: v,
|
|
1856
|
-
showStarButton:
|
|
1863
|
+
showStarButton: S = !1,
|
|
1857
1864
|
chatbotVotingEnabled: N = !1,
|
|
1858
|
-
renderMessagePreview:
|
|
1865
|
+
renderMessagePreview: h,
|
|
1859
1866
|
renderChannelBanner: p,
|
|
1860
|
-
customChannelActions:
|
|
1867
|
+
customChannelActions: T
|
|
1861
1868
|
}) => {
|
|
1862
1869
|
const {
|
|
1863
|
-
service:
|
|
1870
|
+
service: f,
|
|
1864
1871
|
client: c,
|
|
1865
|
-
isConnected:
|
|
1866
|
-
isLoading:
|
|
1867
|
-
error:
|
|
1868
|
-
refreshConnection:
|
|
1869
|
-
debug:
|
|
1870
|
-
} = Yt(), [W, z] =
|
|
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 =
|
|
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
|
-
...
|
|
1892
|
+
...g
|
|
1886
1893
|
};
|
|
1887
|
-
}, [
|
|
1888
|
-
if (!c || !
|
|
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
|
-
|
|
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,
|
|
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,
|
|
1922
|
+
}, [c, d, D]);
|
|
1916
1923
|
Y(() => {
|
|
1917
|
-
if (!c || !
|
|
1924
|
+
if (!c || !d) return;
|
|
1918
1925
|
const E = c.userID;
|
|
1919
1926
|
E && K.current !== E && oe();
|
|
1920
|
-
}, [c,
|
|
1921
|
-
if (!
|
|
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
|
-
|
|
1933
|
+
D && console.log(
|
|
1927
1934
|
"[MessagingShell] Loading initial conversation with:",
|
|
1928
|
-
|
|
1935
|
+
u
|
|
1929
1936
|
);
|
|
1930
1937
|
const O = await c.queryChannels(
|
|
1931
1938
|
{
|
|
1932
1939
|
type: "messaging",
|
|
1933
|
-
members: { $eq: [H,
|
|
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]),
|
|
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 &&
|
|
1944
|
-
|
|
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
|
|
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),
|
|
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
|
-
),
|
|
1975
|
+
), D && console.log(
|
|
1969
1976
|
"[MessagingShell] No conversation found for:",
|
|
1970
|
-
|
|
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
|
-
|
|
1987
|
+
u,
|
|
1981
1988
|
o,
|
|
1982
1989
|
c,
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
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 (
|
|
2005
|
+
if (f)
|
|
1999
2006
|
try {
|
|
2000
|
-
|
|
2007
|
+
D && console.log(
|
|
2001
2008
|
"[MessagingShell] Starting conversation with:",
|
|
2002
2009
|
E.id
|
|
2003
2010
|
);
|
|
2004
|
-
const O = await
|
|
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
|
-
[
|
|
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
|
-
|
|
2038
|
+
D && console.log("[MessagingShell] Leaving conversation:", E.id), z(null), G(!1), K.current = null, await oe();
|
|
2032
2039
|
},
|
|
2033
|
-
[oe,
|
|
2040
|
+
[oe, D]
|
|
2034
2041
|
), Ke = P(
|
|
2035
2042
|
async (E) => {
|
|
2036
|
-
|
|
2043
|
+
D && console.log("[MessagingShell] Blocking participant:", E), z(null), G(!1), K.current = null, await oe();
|
|
2037
2044
|
},
|
|
2038
|
-
[oe,
|
|
2045
|
+
[oe, D]
|
|
2039
2046
|
), fe = !!W;
|
|
2040
|
-
return
|
|
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:
|
|
2051
|
+
onBack: B
|
|
2045
2052
|
}
|
|
2046
|
-
) }) : de ? /* @__PURE__ */ e("div", { className:
|
|
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:
|
|
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:
|
|
2065
|
+
className: R(
|
|
2059
2066
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2060
2067
|
{
|
|
2061
|
-
"!hidden":
|
|
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":
|
|
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":
|
|
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:
|
|
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:
|
|
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 ||
|
|
2094
|
+
flex: L || fe || u,
|
|
2088
2095
|
// Normal mode: hide on mobile when no channel selected
|
|
2089
|
-
"hidden lg:flex": !L && !fe && !
|
|
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:
|
|
2109
|
+
CustomChannelEmptyState: m,
|
|
2103
2110
|
showDeleteConversation: ue,
|
|
2104
|
-
onDeleteConversationClick:
|
|
2111
|
+
onDeleteConversationClick: b,
|
|
2105
2112
|
onBlockParticipantClick: w,
|
|
2106
2113
|
onReportParticipantClick: a,
|
|
2107
2114
|
dmAgentEnabled: y,
|
|
2108
|
-
messageMetadata:
|
|
2115
|
+
messageMetadata: I,
|
|
2109
2116
|
onMessageSent: v,
|
|
2110
|
-
showStarButton:
|
|
2117
|
+
showStarButton: S,
|
|
2111
2118
|
chatbotVotingEnabled: N,
|
|
2112
|
-
customChannelActions:
|
|
2119
|
+
customChannelActions: T
|
|
2113
2120
|
},
|
|
2114
2121
|
W.id
|
|
2115
|
-
) }) :
|
|
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:
|
|
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:
|
|
2188
|
+
avatarImage: u,
|
|
2182
2189
|
avatarName: o
|
|
2183
2190
|
}) => {
|
|
2184
|
-
const
|
|
2185
|
-
return
|
|
2186
|
-
(
|
|
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:
|
|
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
|
-
|
|
2210
|
+
m.map((x) => /* @__PURE__ */ e(
|
|
2204
2211
|
ks,
|
|
2205
2212
|
{
|
|
2206
|
-
question:
|
|
2207
|
-
onClick: () => s(
|
|
2208
|
-
loading: n ===
|
|
2213
|
+
question: x.question,
|
|
2214
|
+
onClick: () => s(x.id),
|
|
2215
|
+
loading: n === x.id
|
|
2209
2216
|
},
|
|
2210
|
-
|
|
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,
|
|
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
|
|
2220
|
-
|
|
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:
|
|
2230
|
+
search: f || void 0,
|
|
2224
2231
|
limit: r,
|
|
2225
2232
|
cursor: p ? void 0 : y
|
|
2226
2233
|
});
|
|
2227
|
-
|
|
2228
|
-
(
|
|
2229
|
-
), a(c.hasMore),
|
|
2234
|
+
u(
|
|
2235
|
+
(d) => p ? c.participants : [...d, ...c.participants]
|
|
2236
|
+
), a(c.hasMore), I(c.nextCursor);
|
|
2230
2237
|
} catch (c) {
|
|
2231
|
-
const
|
|
2232
|
-
|
|
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
|
-
|
|
2241
|
+
m(!1);
|
|
2235
2242
|
}
|
|
2236
|
-
}, [t, C, y, r, o]),
|
|
2243
|
+
}, [t, C, y, r, o]), S = P(() => {
|
|
2237
2244
|
w && !o && v(!1);
|
|
2238
2245
|
}, [w, o, v]), N = P((p) => {
|
|
2239
|
-
|
|
2240
|
-
}, [v]),
|
|
2241
|
-
|
|
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:
|
|
2255
|
+
error: x,
|
|
2249
2256
|
searchQuery: C,
|
|
2250
2257
|
hasMore: w,
|
|
2251
2258
|
totalCount: t.totalCount,
|
|
2252
|
-
loadMore:
|
|
2259
|
+
loadMore: S,
|
|
2253
2260
|
search: N,
|
|
2254
|
-
refresh:
|
|
2261
|
+
refresh: h
|
|
2255
2262
|
};
|
|
2256
2263
|
};
|
|
2257
2264
|
export {
|