@linktr.ee/messaging-react 1.21.0-rc-1771294922 โ 1.21.0-rc-1771296053
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 +648 -646
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MessagingShell/index.tsx +2 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
|
|
2
2
|
import D from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
3
|
+
import j, { createContext as Qe, useContext as Xe, useCallback as F, useState as M, useRef as W, useEffect as q, useMemo as be } from "react";
|
|
4
|
+
import { StreamChatService as Ke } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as es, ChannelList as ss, DateSeparator as ts, useChannelStateContext as we, useChatContext as Fe, areMessageUIPropsEqual as ns, useMessageReminder as rs, useComponentContext as as, Attachment as ls, EditMessageModal as os, MessageBlocked as is, MessageBouncePrompt as cs, MessageDeleted as ds, MessageIsThreadReplyInChannelButtonIndicator as us, MessageRepliesCountButton as ms, ReminderNotification as hs, StreamedMessageText as fs, messageHasAttachments as gs, messageHasReactions as xs, isDateSeparatorMessage as bs, isMessageBlocked as Cs, isMessageBounced as Ns, MessageBounceModal as vs, Poll as ws, MessageText as ps, MessageErrorIcon as ys, useMessageContext as Es, useMessageComposer as Is, useStateStore as _s, MessageInput as Ss, useMessageInputContext as Ms, useMessageComposerHasSendableData as ks, SimpleAttachmentSelector as Rs, QuotedMessagePreview as Ds, AttachmentPreviewList as Ts, TextareaComposer as Fs, MessageTimestamp as Ls, Channel as Ps, WithComponents as Os, Window as Us, MessageList as Bs } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as js, XIcon as pe, ArrowUpIcon as As, ArrowLeftIcon as Ie, StarIcon as _e, DotsThreeIcon as Se, SpinnerGapIcon as ue, SignOutIcon as $s, ProhibitInsetIcon as Me, FlagIcon as zs, MagnifyingGlassIcon as Hs, ChatCircleDotsIcon as ke } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as Re } from "stream-chat";
|
|
8
|
-
const Le =
|
|
8
|
+
const Le = Qe({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const Le = Je({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), fe = () =>
|
|
18
|
+
}), fe = () => Xe(Le), Rt = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -23,9 +23,9 @@ const Le = Je({
|
|
|
23
23
|
capabilities: o = {},
|
|
24
24
|
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const r =
|
|
27
|
-
(
|
|
28
|
-
c && console.log(`๐ฅ [MessagingProvider] ${
|
|
26
|
+
const r = F(
|
|
27
|
+
(m, ...C) => {
|
|
28
|
+
c && console.log(`๐ฅ [MessagingProvider] ${m}`, ...C);
|
|
29
29
|
},
|
|
30
30
|
[c]
|
|
31
31
|
);
|
|
@@ -35,84 +35,84 @@ const Le = Je({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [
|
|
38
|
+
const [u, b] = M(null), [h, _] = M(null), [x, g] = M(!1), [l, y] = M(!1), [E, w] = M(null), p = W(!1), f = W({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: a,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: o
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), N = W(0);
|
|
44
|
+
N.current++, r("๐ RENDER INFO", {
|
|
45
|
+
renderCount: N.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: f.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: f.current.apiKey !== a,
|
|
50
|
+
serviceConfigChanged: f.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: f.current.capabilities !== o
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), f.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: a,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: o
|
|
58
|
-
},
|
|
59
|
-
const
|
|
58
|
+
}, q(() => {
|
|
59
|
+
const m = N.current;
|
|
60
60
|
if (r("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
61
|
+
renderCount: m,
|
|
62
62
|
apiKey: !!a,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: f.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: f.current.apiKey === a
|
|
69
69
|
}
|
|
70
70
|
}), !a || !n) {
|
|
71
71
|
r("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: m,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
r("๐ CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: m,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: f.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const C = new Ke({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: a,
|
|
85
85
|
debug: c
|
|
86
86
|
});
|
|
87
|
-
return b(
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return b(C), r("โ
SERVICE SET", {
|
|
88
|
+
renderCount: m,
|
|
89
|
+
serviceInstance: !!C
|
|
90
90
|
}), () => {
|
|
91
91
|
r("๐งน SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), C.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [a, n, c, r]);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
97
|
+
const v = W(null);
|
|
98
|
+
q(() => {
|
|
99
|
+
var C, k;
|
|
100
100
|
if (r("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!
|
|
101
|
+
hasService: !!u,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
104
|
+
isConnecting: p.current,
|
|
105
105
|
isConnected: x,
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
106
|
+
dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
|
|
107
|
+
}), !u || !s) {
|
|
108
108
|
r("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (p.current) {
|
|
112
112
|
r("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((C = v.current) == null ? void 0 : C.serviceId) === u && ((k = v.current) == null ? void 0 : k.userId) === s.id) {
|
|
116
116
|
r(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,114 +120,114 @@ const Le = Je({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
r("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
r("๐ STARTING USER CONNECTION", { userId: s.id }), p.current = !0, y(!0), w(null);
|
|
124
124
|
try {
|
|
125
125
|
r("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const T = await u.connectUser(s);
|
|
127
|
+
_(T), g(!0), v.current = { serviceId: u, userId: s.id }, r("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: T.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (T) {
|
|
132
|
+
const S = T instanceof Error ? T.message : "Connection failed";
|
|
133
|
+
w(S), r("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: S
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
y(!1), p.current = !1, r("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: x
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
144
|
+
}, [u, s, r, x]), q(() => (r("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!u,
|
|
146
146
|
isConnected: x
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
u && x ? (r(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
152
|
-
hasService: !!
|
|
151
|
+
), v.current = null, u.disconnectUser().catch(console.error)) : r("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!u,
|
|
153
153
|
isConnected: x
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const
|
|
155
|
+
}), [u, x, r]);
|
|
156
|
+
const R = F(async () => {
|
|
157
157
|
if (r("๐ REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!
|
|
158
|
+
hasService: !!u,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
160
|
+
}), !u || !s) {
|
|
161
161
|
r("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
r("๐ STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
r("๐ STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
|
|
165
165
|
try {
|
|
166
|
-
r("๐ DISCONNECTING FOR REFRESH"), await
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
166
|
+
r("๐ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), r("๐ RECONNECTING FOR REFRESH");
|
|
167
|
+
const m = await u.connectUser(s);
|
|
168
|
+
_(m), g(!0), w(null), r("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (m) {
|
|
170
|
+
const C = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
w(C), r("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: C
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
y(!1), r("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
178
|
+
}, [u, s, r]), d = j.useMemo(() => (r("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
|
+
hasService: !!u,
|
|
180
|
+
hasClient: !!h,
|
|
181
181
|
isConnected: x,
|
|
182
182
|
isLoading: l,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!E,
|
|
184
184
|
capabilitiesKeys: Object.keys(o)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
186
|
+
service: u,
|
|
187
|
+
client: h,
|
|
188
188
|
isConnected: x,
|
|
189
189
|
isLoading: l,
|
|
190
|
-
error:
|
|
190
|
+
error: E,
|
|
191
191
|
capabilities: o,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: R,
|
|
193
193
|
debug: c
|
|
194
194
|
}), [
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
u,
|
|
196
|
+
h,
|
|
197
197
|
x,
|
|
198
198
|
l,
|
|
199
|
-
|
|
199
|
+
E,
|
|
200
200
|
o,
|
|
201
|
-
|
|
201
|
+
R,
|
|
202
202
|
c,
|
|
203
203
|
r
|
|
204
204
|
]);
|
|
205
205
|
return r("๐ RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(Le.Provider, { value:
|
|
210
|
-
|
|
206
|
+
renderCount: N.current,
|
|
207
|
+
willRenderChat: !!(h && x),
|
|
208
|
+
contextValueReady: !!d
|
|
209
|
+
}), /* @__PURE__ */ e(Le.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
|
|
210
|
+
es,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: h,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, Gs = () => fe(), Vs = (t, s) => {
|
|
220
220
|
const n = new Date(
|
|
221
221
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
222
|
), o = new Date(
|
|
223
223
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
225
|
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
226
|
-
},
|
|
226
|
+
}, Ws = (t) => {
|
|
227
227
|
const s = /* @__PURE__ */ new Date();
|
|
228
228
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
230
|
-
const a =
|
|
230
|
+
const a = Vs(t, s);
|
|
231
231
|
return a === 0 ? t.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit",
|
|
@@ -265,7 +265,7 @@ const Le = Je({
|
|
|
265
265
|
"๐"
|
|
266
266
|
// Melon
|
|
267
267
|
];
|
|
268
|
-
function
|
|
268
|
+
function qs(t) {
|
|
269
269
|
let s = 0;
|
|
270
270
|
for (let n = 0; n < t.length; n++) {
|
|
271
271
|
const a = t.charCodeAt(n);
|
|
@@ -273,8 +273,8 @@ function Ws(t) {
|
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
276
|
+
function Zs(t) {
|
|
277
|
+
const n = qs(t) % De.length;
|
|
278
278
|
return De[n];
|
|
279
279
|
}
|
|
280
280
|
const Q = ({
|
|
@@ -284,7 +284,7 @@ const Q = ({
|
|
|
284
284
|
className: a,
|
|
285
285
|
shape: o = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const c =
|
|
287
|
+
const c = Zs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", b = o === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
@@ -310,29 +310,29 @@ const Q = ({
|
|
|
310
310
|
"aria-hidden": "true",
|
|
311
311
|
className: D(
|
|
312
312
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
313
|
-
|
|
313
|
+
u
|
|
314
314
|
),
|
|
315
315
|
children: c
|
|
316
316
|
}
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, Ys = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
|
|
321
321
|
"path",
|
|
322
322
|
{
|
|
323
323
|
d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
|
|
324
324
|
fill: "currentColor"
|
|
325
325
|
}
|
|
326
|
-
) }),
|
|
326
|
+
) }), Js = (t) => {
|
|
327
327
|
var s;
|
|
328
328
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
329
|
-
},
|
|
329
|
+
}, Qs = (t) => {
|
|
330
330
|
var s;
|
|
331
331
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
332
332
|
}, ye = (t) => {
|
|
333
333
|
var s;
|
|
334
334
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
335
|
-
}, Pe = (t) =>
|
|
335
|
+
}, Pe = (t) => Js(t) || Qs(t), Xs = (t) => {
|
|
336
336
|
var s;
|
|
337
337
|
return Pe(t) && !((s = t.text) != null && s.trim());
|
|
338
338
|
}, Te = ({
|
|
@@ -346,17 +346,17 @@ const Q = ({
|
|
|
346
346
|
if (n) {
|
|
347
347
|
const c = (o = t.metadata) == null ? void 0 : o.amount_text;
|
|
348
348
|
if (!c) return null;
|
|
349
|
-
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
349
|
+
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
|
|
350
350
|
return /* @__PURE__ */ i("div", { className: r, children: [
|
|
351
|
-
/* @__PURE__ */ e(
|
|
352
|
-
/* @__PURE__ */ e("span", { children:
|
|
351
|
+
/* @__PURE__ */ e(js, { size: s ? 14 : 12 }),
|
|
352
|
+
/* @__PURE__ */ e("span", { children: u })
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
|
|
356
|
-
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(
|
|
356
|
+
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Ys, {}) }),
|
|
357
357
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
358
358
|
] });
|
|
359
|
-
}, Oe =
|
|
359
|
+
}, Oe = j.memo(
|
|
360
360
|
({
|
|
361
361
|
channel: t,
|
|
362
362
|
selectedChannel: s,
|
|
@@ -365,31 +365,31 @@ const Q = ({
|
|
|
365
365
|
unread: o,
|
|
366
366
|
renderMessagePreview: c
|
|
367
367
|
}) => {
|
|
368
|
-
var
|
|
369
|
-
const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id),
|
|
368
|
+
var N, v, R, d, m, C;
|
|
369
|
+
const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
|
|
370
370
|
t && n(t);
|
|
371
|
-
},
|
|
372
|
-
(
|
|
373
|
-
var
|
|
374
|
-
return ((
|
|
371
|
+
}, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
|
|
372
|
+
(k) => {
|
|
373
|
+
var T, S;
|
|
374
|
+
return ((T = k.user) == null ? void 0 : T.id) && k.user.id !== ((S = t == null ? void 0 : t._client) == null ? void 0 : S.userID);
|
|
375
375
|
}
|
|
376
|
-
),
|
|
377
|
-
var
|
|
376
|
+
), _ = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", x = (R = h == null ? void 0 : h.user) == null ? void 0 : R.image, g = (m = (d = t == null ? void 0 : t.state) == null ? void 0 : d.messages) == null ? void 0 : m[t.state.messages.length - 1], y = (() => {
|
|
377
|
+
var T;
|
|
378
378
|
if (g != null && g.text) return g.text;
|
|
379
|
-
const
|
|
380
|
-
return
|
|
381
|
-
})(),
|
|
379
|
+
const k = (T = g == null ? void 0 : g.attachments) == null ? void 0 : T[0];
|
|
380
|
+
return k ? k.og_scrape_url ? k.og_scrape_url : k.type === "image" ? "๐ท Sent an image" : k.type === "video" ? "๐ฅ Sent a video" : k.type === "audio" ? "๐ต Sent audio" : k.type === "file" ? "๐ Sent a file" : "๐ Sent an attachment" : "No messages yet";
|
|
381
|
+
})(), E = g != null && g.created_at ? Ws(new Date(g.created_at)) : "", w = g ? ye(g) : !1, p = c ? c(g, y) : `${w ? "โจ " : ""}${y}`, f = o ?? 0;
|
|
382
382
|
return a && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
383
383
|
channelId: t == null ? void 0 : t.id,
|
|
384
384
|
isSelected: r,
|
|
385
|
-
participantName:
|
|
386
|
-
unreadCount:
|
|
387
|
-
hasTimestamp: !!
|
|
385
|
+
participantName: _,
|
|
386
|
+
unreadCount: f,
|
|
387
|
+
hasTimestamp: !!E
|
|
388
388
|
}), /* @__PURE__ */ e(
|
|
389
389
|
"button",
|
|
390
390
|
{
|
|
391
391
|
type: "button",
|
|
392
|
-
onClick:
|
|
392
|
+
onClick: u,
|
|
393
393
|
className: D(
|
|
394
394
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
395
395
|
{
|
|
@@ -401,8 +401,8 @@ const Q = ({
|
|
|
401
401
|
/* @__PURE__ */ e(
|
|
402
402
|
Q,
|
|
403
403
|
{
|
|
404
|
-
id: ((
|
|
405
|
-
name:
|
|
404
|
+
id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
|
|
405
|
+
name: _,
|
|
406
406
|
image: x,
|
|
407
407
|
size: 44,
|
|
408
408
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
@@ -417,14 +417,14 @@ const Q = ({
|
|
|
417
417
|
"text-sm font-medium truncate",
|
|
418
418
|
r ? "text-primary" : "text-charcoal"
|
|
419
419
|
),
|
|
420
|
-
children:
|
|
420
|
+
children: _
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
|
|
423
|
+
E && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: E })
|
|
424
424
|
] }),
|
|
425
425
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
426
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
427
|
-
|
|
426
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: p }),
|
|
427
|
+
f > 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: f > 99 ? "99+" : f })
|
|
428
428
|
] })
|
|
429
429
|
] })
|
|
430
430
|
] })
|
|
@@ -433,7 +433,7 @@ const Q = ({
|
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
435
|
Oe.displayName = "CustomChannelPreview";
|
|
436
|
-
const Ue =
|
|
436
|
+
const Ue = j.memo(
|
|
437
437
|
({
|
|
438
438
|
onChannelSelect: t,
|
|
439
439
|
selectedChannel: s,
|
|
@@ -442,24 +442,24 @@ const Ue = B.memo(
|
|
|
442
442
|
customEmptyStateIndicator: o,
|
|
443
443
|
renderMessagePreview: c
|
|
444
444
|
}) => {
|
|
445
|
-
const r =
|
|
445
|
+
const r = j.useRef(0);
|
|
446
446
|
r.current++;
|
|
447
|
-
const { debug:
|
|
448
|
-
|
|
447
|
+
const { debug: u = !1 } = fe();
|
|
448
|
+
u && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
449
449
|
renderCount: r.current,
|
|
450
450
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
451
451
|
filters: n
|
|
452
452
|
});
|
|
453
|
-
const b =
|
|
453
|
+
const b = j.useMemo(() => (_) => /* @__PURE__ */ e(
|
|
454
454
|
Oe,
|
|
455
455
|
{
|
|
456
|
-
...
|
|
456
|
+
..._,
|
|
457
457
|
selectedChannel: s,
|
|
458
458
|
onChannelSelect: t,
|
|
459
|
-
debug:
|
|
459
|
+
debug: u,
|
|
460
460
|
renderMessagePreview: c
|
|
461
461
|
}
|
|
462
|
-
), [s, t,
|
|
462
|
+
), [s, t, u, c]);
|
|
463
463
|
return /* @__PURE__ */ e(
|
|
464
464
|
"div",
|
|
465
465
|
{
|
|
@@ -468,7 +468,7 @@ const Ue = B.memo(
|
|
|
468
468
|
a
|
|
469
469
|
),
|
|
470
470
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
471
|
-
|
|
471
|
+
ss,
|
|
472
472
|
{
|
|
473
473
|
filters: n,
|
|
474
474
|
sort: { last_message_at: -1 },
|
|
@@ -525,15 +525,15 @@ function Be({ label: t, className: s, children: n, ...a }) {
|
|
|
525
525
|
function je({ onClick: t }) {
|
|
526
526
|
return /* @__PURE__ */ e(Be, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
function
|
|
528
|
+
const Ks = (t) => /* @__PURE__ */ e(ts, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
|
|
529
|
+
function et(t) {
|
|
530
530
|
return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function st(t) {
|
|
533
533
|
const { channel: s } = we(), { client: n } = Fe("useMessageVote"), a = be(
|
|
534
|
-
() =>
|
|
534
|
+
() => et(t.own_reactions),
|
|
535
535
|
[t.own_reactions]
|
|
536
|
-
), o =
|
|
536
|
+
), o = F(async () => {
|
|
537
537
|
if (n != null && n.userID)
|
|
538
538
|
try {
|
|
539
539
|
a === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
|
|
@@ -543,7 +543,7 @@ function et(t) {
|
|
|
543
543
|
);
|
|
544
544
|
} catch {
|
|
545
545
|
}
|
|
546
|
-
}, [s, n == null ? void 0 : n.userID, t.id, a]), c =
|
|
546
|
+
}, [s, n == null ? void 0 : n.userID, t.id, a]), c = F(async () => {
|
|
547
547
|
if (n != null && n.userID)
|
|
548
548
|
try {
|
|
549
549
|
a === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
|
|
@@ -556,7 +556,7 @@ function et(t) {
|
|
|
556
556
|
}, [s, n == null ? void 0 : n.userID, t.id, a]);
|
|
557
557
|
return { selected: a, voteUp: o, voteDown: c };
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
560
560
|
"path",
|
|
561
561
|
{
|
|
562
562
|
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
@@ -566,7 +566,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
566
566
|
strokeLinejoin: "round",
|
|
567
567
|
fill: t ? "currentColor" : "none"
|
|
568
568
|
}
|
|
569
|
-
) }),
|
|
569
|
+
) }), nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
570
570
|
"path",
|
|
571
571
|
{
|
|
572
572
|
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
@@ -576,7 +576,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
576
576
|
strokeLinejoin: "round",
|
|
577
577
|
fill: t ? "currentColor" : "none"
|
|
578
578
|
}
|
|
579
|
-
) }),
|
|
579
|
+
) }), rt = ({
|
|
580
580
|
selected: t,
|
|
581
581
|
onVoteUp: s,
|
|
582
582
|
onVoteDown: n
|
|
@@ -589,7 +589,7 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
589
589
|
onClick: s,
|
|
590
590
|
"aria-label": "Helpful",
|
|
591
591
|
"aria-pressed": t === "up",
|
|
592
|
-
children: /* @__PURE__ */ e(
|
|
592
|
+
children: /* @__PURE__ */ e(tt, { filled: t === "up" })
|
|
593
593
|
}
|
|
594
594
|
),
|
|
595
595
|
/* @__PURE__ */ e(
|
|
@@ -600,11 +600,11 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
600
600
|
onClick: n,
|
|
601
601
|
"aria-label": "Not helpful",
|
|
602
602
|
"aria-pressed": t === "down",
|
|
603
|
-
children: /* @__PURE__ */ e(
|
|
603
|
+
children: /* @__PURE__ */ e(nt, { filled: t === "down" })
|
|
604
604
|
}
|
|
605
605
|
)
|
|
606
|
-
] }),
|
|
607
|
-
var re,
|
|
606
|
+
] }), at = (t) => {
|
|
607
|
+
var re, ae;
|
|
608
608
|
const {
|
|
609
609
|
additionalMessageInputProps: s,
|
|
610
610
|
chatbotVotingEnabled: n,
|
|
@@ -612,78 +612,78 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
612
612
|
endOfGroup: o,
|
|
613
613
|
firstOfGroup: c,
|
|
614
614
|
groupedByUser: r,
|
|
615
|
-
handleAction:
|
|
615
|
+
handleAction: u,
|
|
616
616
|
handleOpenThread: b,
|
|
617
|
-
handleRetry:
|
|
618
|
-
highlighted:
|
|
617
|
+
handleRetry: h,
|
|
618
|
+
highlighted: _,
|
|
619
619
|
isMessageAIGenerated: x,
|
|
620
620
|
isMyMessage: g,
|
|
621
621
|
message: l,
|
|
622
|
-
renderText:
|
|
623
|
-
threadList:
|
|
624
|
-
} = t, { client:
|
|
625
|
-
Attachment:
|
|
626
|
-
EditMessageModal:
|
|
627
|
-
MessageBlocked:
|
|
628
|
-
MessageBouncePrompt:
|
|
629
|
-
MessageDeleted:
|
|
630
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
631
|
-
MessageRepliesCountButton:
|
|
632
|
-
ReminderNotification: X =
|
|
633
|
-
StreamedMessageText: K =
|
|
634
|
-
PinIndicator:
|
|
635
|
-
} =
|
|
622
|
+
renderText: y,
|
|
623
|
+
threadList: E
|
|
624
|
+
} = t, { client: w } = Fe("CustomMessage"), [p, f] = M(!1), N = rs(l.id), { selected: v, voteUp: R, voteDown: d } = st(l), {
|
|
625
|
+
Attachment: m = ls,
|
|
626
|
+
EditMessageModal: C = os,
|
|
627
|
+
MessageBlocked: k = is,
|
|
628
|
+
MessageBouncePrompt: T = cs,
|
|
629
|
+
MessageDeleted: S = ds,
|
|
630
|
+
MessageIsThreadReplyInChannelButtonIndicator: G = us,
|
|
631
|
+
MessageRepliesCountButton: z = ms,
|
|
632
|
+
ReminderNotification: X = hs,
|
|
633
|
+
StreamedMessageText: K = fs,
|
|
634
|
+
PinIndicator: Y
|
|
635
|
+
} = as("CustomMessage"), ee = gs(l), ne = xs(l), J = be(
|
|
636
636
|
() => x == null ? void 0 : x(l),
|
|
637
637
|
[x, l]
|
|
638
|
-
),
|
|
638
|
+
), V = be(
|
|
639
639
|
() => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
|
|
640
640
|
[l]
|
|
641
641
|
);
|
|
642
|
-
if (
|
|
642
|
+
if (bs(l))
|
|
643
643
|
return null;
|
|
644
644
|
if (l.deleted_at || l.type === "deleted")
|
|
645
|
-
return /* @__PURE__ */ e(
|
|
646
|
-
if (
|
|
647
|
-
return /* @__PURE__ */ e(
|
|
648
|
-
const
|
|
649
|
-
let
|
|
650
|
-
|
|
651
|
-
const
|
|
645
|
+
return /* @__PURE__ */ e(S, { message: l });
|
|
646
|
+
if (Cs(l))
|
|
647
|
+
return /* @__PURE__ */ e(k, {});
|
|
648
|
+
const L = !E && !!l.reply_count, P = !E && l.show_in_channel && l.parent_id, H = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, O = Ns(l);
|
|
649
|
+
let B;
|
|
650
|
+
H ? B = () => h(l) : O && (B = () => f(!0));
|
|
651
|
+
const le = D(
|
|
652
652
|
"str-chat__message str-chat__message-simple",
|
|
653
653
|
`str-chat__message--${l.type}`,
|
|
654
654
|
`str-chat__message--${l.status}`,
|
|
655
655
|
g() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
656
656
|
l.text ? "str-chat__message--has-text" : "has-no-text",
|
|
657
657
|
{
|
|
658
|
-
"str-chat__message--has-attachment":
|
|
659
|
-
"str-chat__message--highlighted":
|
|
658
|
+
"str-chat__message--has-attachment": ee,
|
|
659
|
+
"str-chat__message--highlighted": _,
|
|
660
660
|
"str-chat__message--pinned pinned-message": l.pinned,
|
|
661
|
-
"str-chat__message--with-reactions":
|
|
662
|
-
"str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((
|
|
663
|
-
"str-chat__message-with-thread-link":
|
|
661
|
+
"str-chat__message--with-reactions": ne,
|
|
662
|
+
"str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((ae = l == null ? void 0 : l.error) == null ? void 0 : ae.status) !== 403,
|
|
663
|
+
"str-chat__message-with-thread-link": L || P,
|
|
664
664
|
"str-chat__virtual-message__wrapper--end": o,
|
|
665
665
|
"str-chat__virtual-message__wrapper--first": c,
|
|
666
666
|
"str-chat__virtual-message__wrapper--group": r
|
|
667
667
|
}
|
|
668
|
-
),
|
|
668
|
+
), Z = l.poll_id && w.polls.fromState(l.poll_id), se = Xs(l);
|
|
669
669
|
return /* @__PURE__ */ i(ve, { children: [
|
|
670
670
|
a && /* @__PURE__ */ e(
|
|
671
|
-
|
|
671
|
+
C,
|
|
672
672
|
{
|
|
673
673
|
additionalMessageInputProps: s
|
|
674
674
|
}
|
|
675
675
|
),
|
|
676
|
-
|
|
677
|
-
|
|
676
|
+
p && /* @__PURE__ */ e(
|
|
677
|
+
vs,
|
|
678
678
|
{
|
|
679
|
-
MessageBouncePrompt:
|
|
680
|
-
onClose: () =>
|
|
681
|
-
open:
|
|
679
|
+
MessageBouncePrompt: T,
|
|
680
|
+
onClose: () => f(!1),
|
|
681
|
+
open: p
|
|
682
682
|
}
|
|
683
683
|
),
|
|
684
|
-
/* @__PURE__ */ i("div", { className:
|
|
685
|
-
|
|
686
|
-
!!
|
|
684
|
+
/* @__PURE__ */ i("div", { className: le, children: [
|
|
685
|
+
Y && /* @__PURE__ */ e(Y, {}),
|
|
686
|
+
!!N && /* @__PURE__ */ e(X, { reminder: N }),
|
|
687
687
|
l.user && /* @__PURE__ */ e(
|
|
688
688
|
Q,
|
|
689
689
|
{
|
|
@@ -697,74 +697,74 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
697
697
|
"div",
|
|
698
698
|
{
|
|
699
699
|
className: D("str-chat__message-inner", {
|
|
700
|
-
"str-chat__simple-message--error-failed":
|
|
700
|
+
"str-chat__simple-message--error-failed": H || O
|
|
701
701
|
}),
|
|
702
702
|
"data-testid": "message-inner",
|
|
703
|
-
onClick:
|
|
704
|
-
onKeyDown:
|
|
705
|
-
role:
|
|
706
|
-
tabIndex:
|
|
703
|
+
onClick: B,
|
|
704
|
+
onKeyDown: B,
|
|
705
|
+
role: B ? "button" : void 0,
|
|
706
|
+
tabIndex: B ? 0 : void 0,
|
|
707
707
|
style: {
|
|
708
708
|
// Force margins to 0 to prevent hover layout shift
|
|
709
709
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
710
710
|
marginInlineEnd: 0,
|
|
711
711
|
marginInlineStart: 0
|
|
712
712
|
},
|
|
713
|
-
children:
|
|
713
|
+
children: se ? (
|
|
714
714
|
/* Tip-only messages render as a standalone bubble */
|
|
715
715
|
/* @__PURE__ */ e(Te, { message: l, standalone: !0 })
|
|
716
716
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
717
717
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
718
|
+
Z && /* @__PURE__ */ e(ws, { poll: Z }),
|
|
719
|
+
V != null && V.length && !l.quoted_message ? /* @__PURE__ */ e(
|
|
720
|
+
m,
|
|
721
721
|
{
|
|
722
|
-
actionHandler:
|
|
723
|
-
attachments:
|
|
722
|
+
actionHandler: u,
|
|
723
|
+
attachments: V
|
|
724
724
|
}
|
|
725
725
|
) : null,
|
|
726
|
-
|
|
726
|
+
J ? /* @__PURE__ */ e(
|
|
727
727
|
K,
|
|
728
728
|
{
|
|
729
729
|
message: l,
|
|
730
|
-
renderText:
|
|
730
|
+
renderText: y
|
|
731
731
|
}
|
|
732
|
-
) : /* @__PURE__ */ e(
|
|
733
|
-
/* @__PURE__ */ e(
|
|
732
|
+
) : /* @__PURE__ */ e(ps, { message: l, renderText: y }),
|
|
733
|
+
/* @__PURE__ */ e(ys, {})
|
|
734
734
|
] }),
|
|
735
735
|
/* @__PURE__ */ e(Te, { message: l }),
|
|
736
736
|
n && ye(l) && /* @__PURE__ */ e(
|
|
737
|
-
|
|
737
|
+
rt,
|
|
738
738
|
{
|
|
739
|
-
selected:
|
|
740
|
-
onVoteUp:
|
|
741
|
-
onVoteDown:
|
|
739
|
+
selected: v,
|
|
740
|
+
onVoteUp: R,
|
|
741
|
+
onVoteDown: d
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
] })
|
|
745
745
|
}
|
|
746
746
|
),
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
L && /* @__PURE__ */ e(
|
|
748
|
+
z,
|
|
749
749
|
{
|
|
750
750
|
onClick: b,
|
|
751
751
|
reply_count: l.reply_count
|
|
752
752
|
}
|
|
753
753
|
),
|
|
754
|
-
|
|
754
|
+
P && /* @__PURE__ */ e(G, {})
|
|
755
755
|
] }, l.id)
|
|
756
756
|
] });
|
|
757
|
-
},
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
),
|
|
761
|
-
const s =
|
|
762
|
-
return /* @__PURE__ */ e(
|
|
763
|
-
},
|
|
757
|
+
}, lt = j.memo(
|
|
758
|
+
at,
|
|
759
|
+
ns
|
|
760
|
+
), ot = (t) => {
|
|
761
|
+
const s = Es("CustomMessage");
|
|
762
|
+
return /* @__PURE__ */ e(lt, { ...s, ...t });
|
|
763
|
+
}, it = (t) => ({
|
|
764
764
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
765
765
|
(s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
|
|
766
766
|
)
|
|
767
|
-
}),
|
|
767
|
+
}), ct = ({
|
|
768
768
|
link: t,
|
|
769
769
|
onDismiss: s
|
|
770
770
|
}) => {
|
|
@@ -804,32 +804,32 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
804
804
|
]
|
|
805
805
|
}
|
|
806
806
|
);
|
|
807
|
-
},
|
|
808
|
-
const { linkPreviewsManager: t } =
|
|
807
|
+
}, dt = () => {
|
|
808
|
+
const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
|
|
809
809
|
t.state,
|
|
810
|
-
|
|
810
|
+
it
|
|
811
811
|
), n = (o) => {
|
|
812
812
|
t.dismissPreview(o);
|
|
813
813
|
};
|
|
814
814
|
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
|
|
815
|
-
|
|
815
|
+
ct,
|
|
816
816
|
{
|
|
817
817
|
link: o,
|
|
818
818
|
onDismiss: n
|
|
819
819
|
},
|
|
820
820
|
o.og_scrape_url
|
|
821
821
|
)) }) : null;
|
|
822
|
-
},
|
|
823
|
-
const { handleSubmit: t } =
|
|
822
|
+
}, ut = () => {
|
|
823
|
+
const { handleSubmit: t } = Ms(), s = ks();
|
|
824
824
|
return /* @__PURE__ */ i(ve, { children: [
|
|
825
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
825
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Rs, {}) }),
|
|
826
826
|
/* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
827
|
-
/* @__PURE__ */ e(Rs, {}),
|
|
828
|
-
/* @__PURE__ */ e(ct, {}),
|
|
829
827
|
/* @__PURE__ */ e(Ds, {}),
|
|
828
|
+
/* @__PURE__ */ e(dt, {}),
|
|
829
|
+
/* @__PURE__ */ e(Ts, {}),
|
|
830
830
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
831
831
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
832
|
-
|
|
832
|
+
Fs,
|
|
833
833
|
{
|
|
834
834
|
className: "w-full resize-none outline-none leading-6",
|
|
835
835
|
autoFocus: !0,
|
|
@@ -845,18 +845,18 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
845
845
|
disabled: !s,
|
|
846
846
|
onClick: t,
|
|
847
847
|
type: "button",
|
|
848
|
-
children: /* @__PURE__ */ e(
|
|
848
|
+
children: /* @__PURE__ */ e(As, { className: "size-4" })
|
|
849
849
|
}
|
|
850
850
|
)
|
|
851
851
|
] })
|
|
852
852
|
] })
|
|
853
853
|
] });
|
|
854
|
-
},
|
|
854
|
+
}, mt = ({
|
|
855
855
|
renderActions: t
|
|
856
856
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
857
857
|
t && (t == null ? void 0 : t()),
|
|
858
|
-
/* @__PURE__ */ e(
|
|
859
|
-
] }),
|
|
858
|
+
/* @__PURE__ */ e(Ss, { Input: ut })
|
|
859
|
+
] }), ht = (t) => {
|
|
860
860
|
const s = t.message.hide_date === !0;
|
|
861
861
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
862
862
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
@@ -864,9 +864,9 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
864
864
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
865
865
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
866
866
|
] }),
|
|
867
|
-
!s && /* @__PURE__ */ e(
|
|
867
|
+
!s && /* @__PURE__ */ e(Ls, { message: t.message })
|
|
868
868
|
] });
|
|
869
|
-
},
|
|
869
|
+
}, ft = () => null, gt = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
870
870
|
"div",
|
|
871
871
|
{
|
|
872
872
|
className: D("flex items-center justify-center h-full", t),
|
|
@@ -909,45 +909,45 @@ const st = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
909
909
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
910
910
|
]
|
|
911
911
|
}
|
|
912
|
-
), he =
|
|
913
|
-
/* @__PURE__ */ e(
|
|
912
|
+
), he = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
913
|
+
/* @__PURE__ */ e(gt, { className: "w-6 h-6" }),
|
|
914
914
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
915
915
|
] }) }));
|
|
916
916
|
he.displayName = "LoadingState";
|
|
917
|
-
const
|
|
917
|
+
const xt = ({
|
|
918
918
|
onBack: t,
|
|
919
919
|
showBackButton: s,
|
|
920
920
|
onShowInfo: n,
|
|
921
921
|
canShowInfo: a,
|
|
922
922
|
showStarButton: o = !1
|
|
923
923
|
}) => {
|
|
924
|
-
var g, l,
|
|
925
|
-
const { channel: c } = we(), r =
|
|
926
|
-
(
|
|
927
|
-
var
|
|
928
|
-
return ((
|
|
924
|
+
var g, l, y, E, w, p;
|
|
925
|
+
const { channel: c } = we(), r = j.useMemo(() => Object.values(c.state.members || {}).find(
|
|
926
|
+
(N) => {
|
|
927
|
+
var v;
|
|
928
|
+
return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== c._client.userID;
|
|
929
929
|
}
|
|
930
|
-
), [c._client.userID, c.state.members]),
|
|
931
|
-
!!((
|
|
930
|
+
), [c._client.userID, c.state.members]), u = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (y = r == null ? void 0 : r.user) == null ? void 0 : y.image, [h, _] = M(
|
|
931
|
+
!!((E = c.state.membership) != null && E.pinned_at)
|
|
932
932
|
);
|
|
933
|
-
|
|
934
|
-
const
|
|
935
|
-
var
|
|
936
|
-
|
|
937
|
-
|
|
933
|
+
q(() => {
|
|
934
|
+
const f = (N) => {
|
|
935
|
+
var v;
|
|
936
|
+
_(
|
|
937
|
+
N != null && N.member ? !!N.member.pinned_at : !!((v = c.state.membership) != null && v.pinned_at)
|
|
938
938
|
);
|
|
939
939
|
};
|
|
940
|
-
return c.on("member.updated",
|
|
941
|
-
c.off("member.updated",
|
|
940
|
+
return c.on("member.updated", f), () => {
|
|
941
|
+
c.off("member.updated", f);
|
|
942
942
|
};
|
|
943
943
|
}, [c]);
|
|
944
944
|
const x = async () => {
|
|
945
945
|
try {
|
|
946
|
-
|
|
947
|
-
} catch (
|
|
946
|
+
h ? await c.unpin() : await c.pin();
|
|
947
|
+
} catch (f) {
|
|
948
948
|
console.error(
|
|
949
949
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
950
|
-
|
|
950
|
+
f
|
|
951
951
|
);
|
|
952
952
|
}
|
|
953
953
|
};
|
|
@@ -970,13 +970,13 @@ const gt = ({
|
|
|
970
970
|
/* @__PURE__ */ e(
|
|
971
971
|
Q,
|
|
972
972
|
{
|
|
973
|
-
id: ((
|
|
974
|
-
name:
|
|
973
|
+
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || c.id || "unknown",
|
|
974
|
+
name: u,
|
|
975
975
|
image: b,
|
|
976
976
|
size: 40
|
|
977
977
|
}
|
|
978
978
|
),
|
|
979
|
-
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children:
|
|
979
|
+
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
|
|
980
980
|
] }),
|
|
981
981
|
/* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
|
|
982
982
|
o && /* @__PURE__ */ e(
|
|
@@ -985,15 +985,15 @@ const gt = ({
|
|
|
985
985
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
986
986
|
onClick: x,
|
|
987
987
|
type: "button",
|
|
988
|
-
"aria-label":
|
|
988
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
989
989
|
children: /* @__PURE__ */ e(
|
|
990
990
|
_e,
|
|
991
991
|
{
|
|
992
992
|
className: D("size-5", {
|
|
993
|
-
"text-yellow-600":
|
|
994
|
-
"text-black/90": !
|
|
993
|
+
"text-yellow-600": h,
|
|
994
|
+
"text-black/90": !h
|
|
995
995
|
}),
|
|
996
|
-
weight:
|
|
996
|
+
weight: h ? "duotone" : "regular"
|
|
997
997
|
}
|
|
998
998
|
)
|
|
999
999
|
}
|
|
@@ -1025,13 +1025,13 @@ const gt = ({
|
|
|
1025
1025
|
/* @__PURE__ */ e(
|
|
1026
1026
|
Q,
|
|
1027
1027
|
{
|
|
1028
|
-
id: ((
|
|
1029
|
-
name:
|
|
1028
|
+
id: ((p = r == null ? void 0 : r.user) == null ? void 0 : p.id) || c.id || "unknown",
|
|
1029
|
+
name: u,
|
|
1030
1030
|
image: b,
|
|
1031
1031
|
size: 40
|
|
1032
1032
|
}
|
|
1033
1033
|
),
|
|
1034
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children:
|
|
1034
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
|
|
1035
1035
|
] }),
|
|
1036
1036
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1037
1037
|
o && /* @__PURE__ */ e(
|
|
@@ -1040,15 +1040,15 @@ const gt = ({
|
|
|
1040
1040
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1041
1041
|
onClick: x,
|
|
1042
1042
|
type: "button",
|
|
1043
|
-
"aria-label":
|
|
1043
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1044
1044
|
children: /* @__PURE__ */ e(
|
|
1045
1045
|
_e,
|
|
1046
1046
|
{
|
|
1047
1047
|
className: D("size-5", {
|
|
1048
|
-
"text-yellow-600":
|
|
1049
|
-
"text-black/90": !
|
|
1048
|
+
"text-yellow-600": h,
|
|
1049
|
+
"text-black/90": !h
|
|
1050
1050
|
}),
|
|
1051
|
-
weight:
|
|
1051
|
+
weight: h ? "duotone" : "regular"
|
|
1052
1052
|
}
|
|
1053
1053
|
)
|
|
1054
1054
|
}
|
|
@@ -1066,7 +1066,7 @@ const gt = ({
|
|
|
1066
1066
|
] })
|
|
1067
1067
|
] })
|
|
1068
1068
|
] });
|
|
1069
|
-
},
|
|
1069
|
+
}, bt = ({
|
|
1070
1070
|
dialogRef: t,
|
|
1071
1071
|
onClose: s,
|
|
1072
1072
|
participant: n,
|
|
@@ -1074,79 +1074,79 @@ const gt = ({
|
|
|
1074
1074
|
followerStatusLabel: o,
|
|
1075
1075
|
onLeaveConversation: c,
|
|
1076
1076
|
onBlockParticipant: r,
|
|
1077
|
-
showDeleteConversation:
|
|
1077
|
+
showDeleteConversation: u = !0,
|
|
1078
1078
|
onDeleteConversationClick: b,
|
|
1079
|
-
onBlockParticipantClick:
|
|
1080
|
-
onReportParticipantClick:
|
|
1079
|
+
onBlockParticipantClick: h,
|
|
1080
|
+
onReportParticipantClick: _
|
|
1081
1081
|
}) => {
|
|
1082
|
-
var X, K,
|
|
1083
|
-
const { service: x, debug: g } = fe(), [l,
|
|
1084
|
-
var
|
|
1085
|
-
if (!(!x || !((
|
|
1082
|
+
var X, K, Y, ee, ne, J, V;
|
|
1083
|
+
const { service: x, debug: g } = fe(), [l, y] = M(!1), [E, w] = M(!1), [p, f] = M(!1), N = F(async () => {
|
|
1084
|
+
var L;
|
|
1085
|
+
if (!(!x || !((L = n == null ? void 0 : n.user) != null && L.id)))
|
|
1086
1086
|
try {
|
|
1087
|
-
const
|
|
1088
|
-
(
|
|
1089
|
-
var
|
|
1090
|
-
return
|
|
1087
|
+
const H = (await x.getBlockedUsers()).some(
|
|
1088
|
+
(O) => {
|
|
1089
|
+
var B;
|
|
1090
|
+
return O.blocked_user_id === ((B = n == null ? void 0 : n.user) == null ? void 0 : B.id);
|
|
1091
1091
|
}
|
|
1092
1092
|
);
|
|
1093
|
-
|
|
1094
|
-
} catch (
|
|
1093
|
+
y(H);
|
|
1094
|
+
} catch (P) {
|
|
1095
1095
|
console.error(
|
|
1096
1096
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1097
|
-
|
|
1097
|
+
P
|
|
1098
1098
|
);
|
|
1099
1099
|
}
|
|
1100
1100
|
}, [x, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
}, [
|
|
1104
|
-
const
|
|
1105
|
-
var
|
|
1106
|
-
if (!
|
|
1107
|
-
b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid),
|
|
1101
|
+
q(() => {
|
|
1102
|
+
N();
|
|
1103
|
+
}, [N]);
|
|
1104
|
+
const v = async () => {
|
|
1105
|
+
var L;
|
|
1106
|
+
if (!E) {
|
|
1107
|
+
b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
|
|
1108
1108
|
try {
|
|
1109
|
-
const
|
|
1110
|
-
await a.hide(
|
|
1111
|
-
} catch (
|
|
1112
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
1109
|
+
const P = ((L = a._client) == null ? void 0 : L.userID) ?? null;
|
|
1110
|
+
await a.hide(P, !1), c && await c(a), s();
|
|
1111
|
+
} catch (P) {
|
|
1112
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", P);
|
|
1113
1113
|
} finally {
|
|
1114
|
-
|
|
1114
|
+
w(!1);
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
|
-
},
|
|
1118
|
-
var
|
|
1119
|
-
if (!(
|
|
1120
|
-
|
|
1117
|
+
}, R = async () => {
|
|
1118
|
+
var L, P, H;
|
|
1119
|
+
if (!(p || !x)) {
|
|
1120
|
+
h == null || h(), g && console.log("[ChannelInfoDialog] Block member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
|
|
1121
1121
|
try {
|
|
1122
|
-
await x.blockUser((
|
|
1123
|
-
} catch (
|
|
1124
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
1122
|
+
await x.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
1123
|
+
} catch (O) {
|
|
1124
|
+
console.error("[ChannelInfoDialog] Failed to block member", O);
|
|
1125
1125
|
} finally {
|
|
1126
|
-
|
|
1126
|
+
f(!1);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
},
|
|
1130
|
-
var
|
|
1131
|
-
if (!(
|
|
1132
|
-
|
|
1129
|
+
}, d = async () => {
|
|
1130
|
+
var L, P, H;
|
|
1131
|
+
if (!(p || !x)) {
|
|
1132
|
+
h == null || h(), g && console.log("[ChannelInfoDialog] Unblock member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
|
|
1133
1133
|
try {
|
|
1134
|
-
await x.unBlockUser((
|
|
1135
|
-
} catch (
|
|
1136
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
1134
|
+
await x.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
1135
|
+
} catch (O) {
|
|
1136
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", O);
|
|
1137
1137
|
} finally {
|
|
1138
|
-
|
|
1138
|
+
f(!1);
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
|
-
},
|
|
1142
|
-
|
|
1141
|
+
}, m = () => {
|
|
1142
|
+
_ == null || _(), s(), window.open(
|
|
1143
1143
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1144
1144
|
"_blank",
|
|
1145
1145
|
"noopener,noreferrer"
|
|
1146
1146
|
);
|
|
1147
1147
|
};
|
|
1148
1148
|
if (!n) return null;
|
|
1149
|
-
const
|
|
1149
|
+
const C = ((K = n.user) == null ? void 0 : K.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", k = (ee = n.user) == null ? void 0 : ee.image, T = (ne = n.user) == null ? void 0 : ne.email, S = (J = n.user) == null ? void 0 : J.username, G = T || (S ? `linktr.ee/${S}` : void 0), z = ((V = n.user) == null ? void 0 : V.id) || "unknown";
|
|
1150
1150
|
return (
|
|
1151
1151
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1152
1152
|
/* @__PURE__ */ e(
|
|
@@ -1155,8 +1155,8 @@ const gt = ({
|
|
|
1155
1155
|
ref: t,
|
|
1156
1156
|
className: "mes-dialog group",
|
|
1157
1157
|
onClose: s,
|
|
1158
|
-
onClick: (
|
|
1159
|
-
|
|
1158
|
+
onClick: (L) => {
|
|
1159
|
+
L.target === t.current && s();
|
|
1160
1160
|
},
|
|
1161
1161
|
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
1162
1162
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
@@ -1173,16 +1173,16 @@ const gt = ({
|
|
|
1173
1173
|
/* @__PURE__ */ e(
|
|
1174
1174
|
Q,
|
|
1175
1175
|
{
|
|
1176
|
-
id:
|
|
1177
|
-
name:
|
|
1178
|
-
image:
|
|
1176
|
+
id: z,
|
|
1177
|
+
name: C,
|
|
1178
|
+
image: k,
|
|
1179
1179
|
size: 88,
|
|
1180
1180
|
shape: "circle"
|
|
1181
1181
|
}
|
|
1182
1182
|
),
|
|
1183
1183
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1184
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1185
|
-
|
|
1184
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
|
|
1185
|
+
G && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: G }),
|
|
1186
1186
|
o && /* @__PURE__ */ e(
|
|
1187
1187
|
"span",
|
|
1188
1188
|
{
|
|
@@ -1202,14 +1202,14 @@ const gt = ({
|
|
|
1202
1202
|
}
|
|
1203
1203
|
),
|
|
1204
1204
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1205
|
-
|
|
1205
|
+
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1206
1206
|
de,
|
|
1207
1207
|
{
|
|
1208
|
-
onClick:
|
|
1209
|
-
disabled:
|
|
1210
|
-
"aria-busy":
|
|
1208
|
+
onClick: v,
|
|
1209
|
+
disabled: E,
|
|
1210
|
+
"aria-busy": E,
|
|
1211
1211
|
children: [
|
|
1212
|
-
|
|
1212
|
+
E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
|
|
1213
1213
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1214
1214
|
]
|
|
1215
1215
|
}
|
|
@@ -1217,28 +1217,28 @@ const gt = ({
|
|
|
1217
1217
|
/* @__PURE__ */ e("li", { children: l ? /* @__PURE__ */ i(
|
|
1218
1218
|
de,
|
|
1219
1219
|
{
|
|
1220
|
-
onClick:
|
|
1221
|
-
disabled:
|
|
1222
|
-
"aria-busy":
|
|
1220
|
+
onClick: d,
|
|
1221
|
+
disabled: p,
|
|
1222
|
+
"aria-busy": p,
|
|
1223
1223
|
children: [
|
|
1224
|
-
|
|
1224
|
+
p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
|
|
1225
1225
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1226
1226
|
]
|
|
1227
1227
|
}
|
|
1228
1228
|
) : /* @__PURE__ */ i(
|
|
1229
1229
|
de,
|
|
1230
1230
|
{
|
|
1231
|
-
onClick:
|
|
1232
|
-
disabled:
|
|
1233
|
-
"aria-busy":
|
|
1231
|
+
onClick: R,
|
|
1232
|
+
disabled: p,
|
|
1233
|
+
"aria-busy": p,
|
|
1234
1234
|
children: [
|
|
1235
|
-
|
|
1235
|
+
p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
|
|
1236
1236
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1237
1237
|
]
|
|
1238
1238
|
}
|
|
1239
1239
|
) }),
|
|
1240
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick:
|
|
1241
|
-
/* @__PURE__ */ e(
|
|
1240
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
|
|
1241
|
+
/* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
|
|
1242
1242
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1243
1243
|
] }) })
|
|
1244
1244
|
] })
|
|
@@ -1247,7 +1247,7 @@ const gt = ({
|
|
|
1247
1247
|
}
|
|
1248
1248
|
)
|
|
1249
1249
|
);
|
|
1250
|
-
},
|
|
1250
|
+
}, Ct = ({
|
|
1251
1251
|
onBack: t,
|
|
1252
1252
|
showBackButton: s,
|
|
1253
1253
|
renderMessageInputActions: n,
|
|
@@ -1255,51 +1255,51 @@ const gt = ({
|
|
|
1255
1255
|
onBlockParticipant: o,
|
|
1256
1256
|
showDeleteConversation: c = !0,
|
|
1257
1257
|
onDeleteConversationClick: r,
|
|
1258
|
-
onBlockParticipantClick:
|
|
1258
|
+
onBlockParticipantClick: u,
|
|
1259
1259
|
onReportParticipantClick: b,
|
|
1260
|
-
showStarButton:
|
|
1261
|
-
chatbotVotingEnabled:
|
|
1260
|
+
showStarButton: h = !1,
|
|
1261
|
+
chatbotVotingEnabled: _ = !1,
|
|
1262
1262
|
renderChannelBanner: x
|
|
1263
1263
|
}) => {
|
|
1264
|
-
const { channel: g } = we(), l =
|
|
1265
|
-
(
|
|
1266
|
-
var
|
|
1267
|
-
return ((
|
|
1264
|
+
const { channel: g } = we(), l = W(null), y = j.useMemo(() => Object.values(g.state.members || {}).find(
|
|
1265
|
+
(N) => {
|
|
1266
|
+
var v;
|
|
1267
|
+
return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== g._client.userID;
|
|
1268
1268
|
}
|
|
1269
|
-
), [g._client.userID, g.state.members]),
|
|
1270
|
-
const
|
|
1271
|
-
if (
|
|
1272
|
-
return String(
|
|
1273
|
-
if (
|
|
1274
|
-
return
|
|
1275
|
-
}, [g.data]),
|
|
1276
|
-
var
|
|
1277
|
-
(
|
|
1278
|
-
}, []),
|
|
1279
|
-
var
|
|
1280
|
-
(
|
|
1269
|
+
), [g._client.userID, g.state.members]), E = j.useMemo(() => {
|
|
1270
|
+
const f = g.data ?? {};
|
|
1271
|
+
if (f.followerStatus)
|
|
1272
|
+
return String(f.followerStatus);
|
|
1273
|
+
if (f.isFollower !== void 0)
|
|
1274
|
+
return f.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1275
|
+
}, [g.data]), w = F(() => {
|
|
1276
|
+
var f;
|
|
1277
|
+
(f = l.current) == null || f.showModal();
|
|
1278
|
+
}, []), p = F(() => {
|
|
1279
|
+
var f;
|
|
1280
|
+
(f = l.current) == null || f.close();
|
|
1281
1281
|
}, []);
|
|
1282
1282
|
return /* @__PURE__ */ i(ve, { children: [
|
|
1283
1283
|
/* @__PURE__ */ e(
|
|
1284
|
-
|
|
1284
|
+
Os,
|
|
1285
1285
|
{
|
|
1286
1286
|
overrides: {
|
|
1287
|
-
Message: (
|
|
1287
|
+
Message: (f) => /* @__PURE__ */ e(ot, { ...f, chatbotVotingEnabled: _ })
|
|
1288
1288
|
},
|
|
1289
|
-
children: /* @__PURE__ */ i(
|
|
1289
|
+
children: /* @__PURE__ */ i(Us, { children: [
|
|
1290
1290
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1291
|
-
|
|
1291
|
+
xt,
|
|
1292
1292
|
{
|
|
1293
1293
|
onBack: t,
|
|
1294
1294
|
showBackButton: s,
|
|
1295
|
-
onShowInfo:
|
|
1296
|
-
canShowInfo: !!
|
|
1297
|
-
showStarButton:
|
|
1295
|
+
onShowInfo: w,
|
|
1296
|
+
canShowInfo: !!y,
|
|
1297
|
+
showStarButton: h
|
|
1298
1298
|
}
|
|
1299
1299
|
) }),
|
|
1300
1300
|
x == null ? void 0 : x(),
|
|
1301
1301
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1302
|
-
|
|
1302
|
+
Bs,
|
|
1303
1303
|
{
|
|
1304
1304
|
hideDeletedMessages: !0,
|
|
1305
1305
|
hideNewMessageSeparator: !1,
|
|
@@ -1307,7 +1307,7 @@ const gt = ({
|
|
|
1307
1307
|
}
|
|
1308
1308
|
) }),
|
|
1309
1309
|
/* @__PURE__ */ e(
|
|
1310
|
-
|
|
1310
|
+
mt,
|
|
1311
1311
|
{
|
|
1312
1312
|
renderActions: () => n == null ? void 0 : n(g)
|
|
1313
1313
|
}
|
|
@@ -1316,23 +1316,23 @@ const gt = ({
|
|
|
1316
1316
|
}
|
|
1317
1317
|
),
|
|
1318
1318
|
/* @__PURE__ */ e(
|
|
1319
|
-
|
|
1319
|
+
bt,
|
|
1320
1320
|
{
|
|
1321
1321
|
dialogRef: l,
|
|
1322
|
-
onClose:
|
|
1323
|
-
participant:
|
|
1322
|
+
onClose: p,
|
|
1323
|
+
participant: y,
|
|
1324
1324
|
channel: g,
|
|
1325
|
-
followerStatusLabel:
|
|
1325
|
+
followerStatusLabel: E,
|
|
1326
1326
|
onLeaveConversation: a,
|
|
1327
1327
|
onBlockParticipant: o,
|
|
1328
1328
|
showDeleteConversation: c,
|
|
1329
1329
|
onDeleteConversationClick: r,
|
|
1330
|
-
onBlockParticipantClick:
|
|
1330
|
+
onBlockParticipantClick: u,
|
|
1331
1331
|
onReportParticipantClick: b
|
|
1332
1332
|
}
|
|
1333
1333
|
)
|
|
1334
1334
|
] });
|
|
1335
|
-
}, Ae =
|
|
1335
|
+
}, Ae = j.memo(
|
|
1336
1336
|
({
|
|
1337
1337
|
channel: t,
|
|
1338
1338
|
onBack: s,
|
|
@@ -1341,37 +1341,37 @@ const gt = ({
|
|
|
1341
1341
|
onLeaveConversation: o,
|
|
1342
1342
|
onBlockParticipant: c,
|
|
1343
1343
|
className: r,
|
|
1344
|
-
CustomChannelEmptyState:
|
|
1344
|
+
CustomChannelEmptyState: u = ft,
|
|
1345
1345
|
showDeleteConversation: b = !0,
|
|
1346
|
-
onDeleteConversationClick:
|
|
1347
|
-
onBlockParticipantClick:
|
|
1346
|
+
onDeleteConversationClick: h,
|
|
1347
|
+
onBlockParticipantClick: _,
|
|
1348
1348
|
onReportParticipantClick: x,
|
|
1349
1349
|
dmAgentEnabled: g,
|
|
1350
1350
|
messageMetadata: l,
|
|
1351
|
-
onMessageSent:
|
|
1352
|
-
showStarButton:
|
|
1353
|
-
chatbotVotingEnabled:
|
|
1354
|
-
renderChannelBanner:
|
|
1351
|
+
onMessageSent: y,
|
|
1352
|
+
showStarButton: E = !1,
|
|
1353
|
+
chatbotVotingEnabled: w = !1,
|
|
1354
|
+
renderChannelBanner: p
|
|
1355
1355
|
}) => {
|
|
1356
|
-
const
|
|
1357
|
-
async (
|
|
1358
|
-
var
|
|
1359
|
-
const
|
|
1360
|
-
...
|
|
1361
|
-
...
|
|
1356
|
+
const f = F(
|
|
1357
|
+
async (N, v, R) => {
|
|
1358
|
+
var S;
|
|
1359
|
+
const d = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, m = g && !d, C = {
|
|
1360
|
+
...v,
|
|
1361
|
+
...m && { silent: !0 },
|
|
1362
1362
|
...l && {
|
|
1363
1363
|
metadata: {
|
|
1364
|
-
...
|
|
1364
|
+
...v.metadata ?? {},
|
|
1365
1365
|
...l
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
},
|
|
1369
|
-
...
|
|
1370
|
-
...
|
|
1371
|
-
},
|
|
1372
|
-
return
|
|
1368
|
+
}, k = {
|
|
1369
|
+
...R,
|
|
1370
|
+
...m && { skip_push: !0 }
|
|
1371
|
+
}, T = await t.sendMessage(C, k);
|
|
1372
|
+
return y == null || y(T), T;
|
|
1373
1373
|
},
|
|
1374
|
-
[t, g, l,
|
|
1374
|
+
[t, g, l, y]
|
|
1375
1375
|
);
|
|
1376
1376
|
return /* @__PURE__ */ e(
|
|
1377
1377
|
"div",
|
|
@@ -1381,30 +1381,30 @@ const gt = ({
|
|
|
1381
1381
|
r
|
|
1382
1382
|
),
|
|
1383
1383
|
children: /* @__PURE__ */ e(
|
|
1384
|
-
|
|
1384
|
+
Ps,
|
|
1385
1385
|
{
|
|
1386
1386
|
channel: t,
|
|
1387
|
-
MessageSystem:
|
|
1388
|
-
EmptyStateIndicator:
|
|
1387
|
+
MessageSystem: ht,
|
|
1388
|
+
EmptyStateIndicator: u,
|
|
1389
1389
|
LoadingIndicator: he,
|
|
1390
|
-
DateSeparator:
|
|
1391
|
-
doSendMessageRequest:
|
|
1390
|
+
DateSeparator: Ks,
|
|
1391
|
+
doSendMessageRequest: f,
|
|
1392
1392
|
children: /* @__PURE__ */ e(
|
|
1393
|
-
|
|
1393
|
+
Ct,
|
|
1394
1394
|
{
|
|
1395
1395
|
onBack: s,
|
|
1396
1396
|
showBackButton: n,
|
|
1397
1397
|
renderMessageInputActions: a,
|
|
1398
1398
|
onLeaveConversation: o,
|
|
1399
1399
|
onBlockParticipant: c,
|
|
1400
|
-
CustomChannelEmptyState:
|
|
1400
|
+
CustomChannelEmptyState: u,
|
|
1401
1401
|
showDeleteConversation: b,
|
|
1402
|
-
onDeleteConversationClick:
|
|
1403
|
-
onBlockParticipantClick:
|
|
1402
|
+
onDeleteConversationClick: h,
|
|
1403
|
+
onBlockParticipantClick: _,
|
|
1404
1404
|
onReportParticipantClick: x,
|
|
1405
|
-
showStarButton:
|
|
1406
|
-
chatbotVotingEnabled:
|
|
1407
|
-
renderChannelBanner:
|
|
1405
|
+
showStarButton: E,
|
|
1406
|
+
chatbotVotingEnabled: w,
|
|
1407
|
+
renderChannelBanner: p
|
|
1408
1408
|
}
|
|
1409
1409
|
)
|
|
1410
1410
|
}
|
|
@@ -1414,15 +1414,15 @@ const gt = ({
|
|
|
1414
1414
|
}
|
|
1415
1415
|
);
|
|
1416
1416
|
Ae.displayName = "ChannelView";
|
|
1417
|
-
function
|
|
1417
|
+
function Nt({
|
|
1418
1418
|
searchQuery: t,
|
|
1419
1419
|
setSearchQuery: s,
|
|
1420
1420
|
placeholder: n
|
|
1421
1421
|
}) {
|
|
1422
|
-
const a =
|
|
1422
|
+
const a = W(null);
|
|
1423
1423
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1424
1424
|
/* @__PURE__ */ e(
|
|
1425
|
-
|
|
1425
|
+
Hs,
|
|
1426
1426
|
{
|
|
1427
1427
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1428
1428
|
weight: "bold"
|
|
@@ -1453,7 +1453,7 @@ function Ct({
|
|
|
1453
1453
|
)
|
|
1454
1454
|
] });
|
|
1455
1455
|
}
|
|
1456
|
-
const
|
|
1456
|
+
const vt = ({
|
|
1457
1457
|
participantSource: t,
|
|
1458
1458
|
onSelectParticipant: s,
|
|
1459
1459
|
onClose: n,
|
|
@@ -1462,56 +1462,56 @@ const Nt = ({
|
|
|
1462
1462
|
searchPlaceholder: c = "Search participants...",
|
|
1463
1463
|
className: r
|
|
1464
1464
|
}) => {
|
|
1465
|
-
const { debug:
|
|
1465
|
+
const { debug: u } = fe(), [b, h] = M(""), [_, x] = M([]), [g, l] = M(!1), [y, E] = M(null), [w, p] = M(
|
|
1466
1466
|
null
|
|
1467
|
-
),
|
|
1468
|
-
|
|
1467
|
+
), f = W(!1);
|
|
1468
|
+
q(() => {
|
|
1469
1469
|
if (t.loading) {
|
|
1470
|
-
|
|
1470
|
+
u && console.log(
|
|
1471
1471
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1472
1472
|
);
|
|
1473
1473
|
return;
|
|
1474
1474
|
}
|
|
1475
|
-
if (
|
|
1475
|
+
if (f.current) return;
|
|
1476
1476
|
(async () => {
|
|
1477
|
-
|
|
1477
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), E(null);
|
|
1478
1478
|
try {
|
|
1479
|
-
const
|
|
1479
|
+
const m = await t.loadParticipants({
|
|
1480
1480
|
search: "",
|
|
1481
1481
|
// Load all participants initially
|
|
1482
1482
|
limit: 100
|
|
1483
1483
|
});
|
|
1484
|
-
x(
|
|
1484
|
+
x(m.participants), f.current = !0, u && console.log(
|
|
1485
1485
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1486
|
-
|
|
1486
|
+
m.participants.length
|
|
1487
1487
|
);
|
|
1488
|
-
} catch (
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1488
|
+
} catch (m) {
|
|
1489
|
+
const C = m instanceof Error ? m.message : "Failed to load participants";
|
|
1490
|
+
E(C), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1491
1491
|
} finally {
|
|
1492
1492
|
l(!1);
|
|
1493
1493
|
}
|
|
1494
1494
|
})();
|
|
1495
|
-
}, [t.loading,
|
|
1496
|
-
const
|
|
1497
|
-
var
|
|
1495
|
+
}, [t.loading, u]);
|
|
1496
|
+
const N = _.filter((d) => !a.has(d.id)).filter((d) => {
|
|
1497
|
+
var C;
|
|
1498
1498
|
if (!b) return !0;
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
}),
|
|
1502
|
-
async (
|
|
1503
|
-
if (!
|
|
1504
|
-
|
|
1499
|
+
const m = b.toLowerCase();
|
|
1500
|
+
return d.name.toLowerCase().includes(m) || ((C = d.email) == null ? void 0 : C.toLowerCase().includes(m)) || !1;
|
|
1501
|
+
}), v = F(
|
|
1502
|
+
async (d) => {
|
|
1503
|
+
if (!w) {
|
|
1504
|
+
p(d.id);
|
|
1505
1505
|
try {
|
|
1506
|
-
await s(
|
|
1507
|
-
} catch (
|
|
1508
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1506
|
+
await s(d);
|
|
1507
|
+
} catch (m) {
|
|
1508
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), p(null);
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
1511
|
},
|
|
1512
|
-
[s,
|
|
1513
|
-
),
|
|
1514
|
-
(
|
|
1512
|
+
[s, w]
|
|
1513
|
+
), R = (d, m) => {
|
|
1514
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), v(m));
|
|
1515
1515
|
};
|
|
1516
1516
|
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
|
|
1517
1517
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
@@ -1523,66 +1523,66 @@ const Nt = ({
|
|
|
1523
1523
|
"Select a ",
|
|
1524
1524
|
o.slice(0, -1),
|
|
1525
1525
|
" to start messaging (",
|
|
1526
|
-
|
|
1526
|
+
N.length,
|
|
1527
1527
|
" available)",
|
|
1528
1528
|
t.totalCount !== void 0 && ` โข ${t.totalCount} ${o} total`
|
|
1529
1529
|
] }),
|
|
1530
1530
|
/* @__PURE__ */ e(
|
|
1531
|
-
|
|
1531
|
+
Nt,
|
|
1532
1532
|
{
|
|
1533
1533
|
searchQuery: b,
|
|
1534
|
-
setSearchQuery:
|
|
1534
|
+
setSearchQuery: h,
|
|
1535
1535
|
placeholder: c
|
|
1536
1536
|
}
|
|
1537
1537
|
)
|
|
1538
1538
|
] }),
|
|
1539
|
-
|
|
1539
|
+
y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1540
1540
|
"Error loading ",
|
|
1541
1541
|
o,
|
|
1542
1542
|
": ",
|
|
1543
|
-
|
|
1543
|
+
y
|
|
1544
1544
|
] }),
|
|
1545
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g &&
|
|
1545
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g && N.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: [
|
|
1546
1546
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1547
1547
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1548
1548
|
"Loading ",
|
|
1549
1549
|
o,
|
|
1550
1550
|
"..."
|
|
1551
1551
|
] })
|
|
1552
|
-
] }) }) :
|
|
1552
|
+
] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1553
1553
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ke, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1554
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` :
|
|
1555
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" :
|
|
1554
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : _.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
|
|
1555
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : _.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
|
|
1556
1556
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1557
|
+
N.map((d) => {
|
|
1558
|
+
const m = d.name || d.email || d.id, C = d.email && d.name ? d.email : d.phone;
|
|
1559
1559
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1560
1560
|
"button",
|
|
1561
1561
|
{
|
|
1562
1562
|
type: "button",
|
|
1563
|
-
onClick: () =>
|
|
1564
|
-
onKeyDown: (
|
|
1563
|
+
onClick: () => v(d),
|
|
1564
|
+
onKeyDown: (k) => R(k, d),
|
|
1565
1565
|
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",
|
|
1566
1566
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1567
1567
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1568
1568
|
/* @__PURE__ */ e(
|
|
1569
1569
|
Q,
|
|
1570
1570
|
{
|
|
1571
|
-
id:
|
|
1572
|
-
name:
|
|
1573
|
-
image:
|
|
1571
|
+
id: d.id,
|
|
1572
|
+
name: m,
|
|
1573
|
+
image: d.image,
|
|
1574
1574
|
size: 40
|
|
1575
1575
|
}
|
|
1576
1576
|
),
|
|
1577
1577
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1578
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1579
|
-
|
|
1578
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1579
|
+
C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
|
|
1580
1580
|
] })
|
|
1581
1581
|
] }),
|
|
1582
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1582
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === d.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
|
|
1583
1583
|
] })
|
|
1584
1584
|
}
|
|
1585
|
-
) },
|
|
1585
|
+
) }, d.id);
|
|
1586
1586
|
}),
|
|
1587
1587
|
g && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1588
1588
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
@@ -1590,7 +1590,7 @@ const Nt = ({
|
|
|
1590
1590
|
] }) })
|
|
1591
1591
|
] }) })
|
|
1592
1592
|
] });
|
|
1593
|
-
},
|
|
1593
|
+
}, wt = ({ className: t }) => /* @__PURE__ */ i(
|
|
1594
1594
|
"svg",
|
|
1595
1595
|
{
|
|
1596
1596
|
width: "140",
|
|
@@ -1724,9 +1724,9 @@ const Nt = ({
|
|
|
1724
1724
|
] })
|
|
1725
1725
|
]
|
|
1726
1726
|
}
|
|
1727
|
-
), $e =
|
|
1727
|
+
), $e = j.memo(
|
|
1728
1728
|
({ 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: [
|
|
1729
|
-
/* @__PURE__ */ e(
|
|
1729
|
+
/* @__PURE__ */ e(wt, {}),
|
|
1730
1730
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1731
1731
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1732
1732
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
@@ -1734,7 +1734,7 @@ const Nt = ({
|
|
|
1734
1734
|
] }) })
|
|
1735
1735
|
);
|
|
1736
1736
|
$e.displayName = "EmptyState";
|
|
1737
|
-
const me =
|
|
1737
|
+
const me = j.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: [
|
|
1738
1738
|
/* @__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: "โ ๏ธ" }) }),
|
|
1739
1739
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1740
1740
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1749,7 +1749,7 @@ const me = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1749
1749
|
)
|
|
1750
1750
|
] }) }));
|
|
1751
1751
|
me.displayName = "ErrorState";
|
|
1752
|
-
const
|
|
1752
|
+
const Dt = ({
|
|
1753
1753
|
capabilities: t = {},
|
|
1754
1754
|
className: s,
|
|
1755
1755
|
renderMessageInputActions: n,
|
|
@@ -1757,114 +1757,115 @@ const Rt = ({
|
|
|
1757
1757
|
onParticipantSelect: o,
|
|
1758
1758
|
initialParticipantFilter: c,
|
|
1759
1759
|
initialParticipantData: r,
|
|
1760
|
-
CustomChannelEmptyState:
|
|
1760
|
+
CustomChannelEmptyState: u,
|
|
1761
1761
|
showChannelList: b = !0,
|
|
1762
|
-
filters:
|
|
1763
|
-
channelListCustomEmptyStateIndicator:
|
|
1762
|
+
filters: h,
|
|
1763
|
+
channelListCustomEmptyStateIndicator: _,
|
|
1764
1764
|
onDeleteConversationClick: x,
|
|
1765
1765
|
onBlockParticipantClick: g,
|
|
1766
1766
|
onReportParticipantClick: l,
|
|
1767
|
-
dmAgentEnabled:
|
|
1768
|
-
messageMetadata:
|
|
1769
|
-
onMessageSent:
|
|
1770
|
-
showStarButton:
|
|
1771
|
-
chatbotVotingEnabled:
|
|
1772
|
-
renderMessagePreview:
|
|
1767
|
+
dmAgentEnabled: y,
|
|
1768
|
+
messageMetadata: E,
|
|
1769
|
+
onMessageSent: w,
|
|
1770
|
+
showStarButton: p = !1,
|
|
1771
|
+
chatbotVotingEnabled: f = !1,
|
|
1772
|
+
renderMessagePreview: N,
|
|
1773
|
+
renderChannelBanner: v
|
|
1773
1774
|
}) => {
|
|
1774
1775
|
const {
|
|
1775
|
-
service:
|
|
1776
|
-
client:
|
|
1777
|
-
isConnected:
|
|
1778
|
-
isLoading:
|
|
1779
|
-
error:
|
|
1780
|
-
refreshConnection:
|
|
1781
|
-
debug:
|
|
1782
|
-
} =
|
|
1783
|
-
participantSource:
|
|
1784
|
-
participantLabel:
|
|
1785
|
-
showDeleteConversation:
|
|
1786
|
-
} = t,
|
|
1787
|
-
const
|
|
1776
|
+
service: R,
|
|
1777
|
+
client: d,
|
|
1778
|
+
isConnected: m,
|
|
1779
|
+
isLoading: C,
|
|
1780
|
+
error: k,
|
|
1781
|
+
refreshConnection: T,
|
|
1782
|
+
debug: S
|
|
1783
|
+
} = Gs(), [G, z] = M(null), [X, K] = M(!1), [Y, ee] = M(!1), [ne, J] = M(!1), [V, L] = M(/* @__PURE__ */ new Set()), [P, H] = M(0), [O, B] = M(!1), [le, Z] = M(null), se = W(null), {
|
|
1784
|
+
participantSource: re,
|
|
1785
|
+
participantLabel: ae = "participants",
|
|
1786
|
+
showDeleteConversation: ze = !0
|
|
1787
|
+
} = t, He = j.useMemo(() => {
|
|
1788
|
+
const I = d == null ? void 0 : d.userID;
|
|
1788
1789
|
return {
|
|
1789
1790
|
...{
|
|
1790
1791
|
type: "messaging",
|
|
1791
1792
|
last_message_at: { $exists: !0 },
|
|
1792
|
-
...
|
|
1793
|
-
members: { $in: [
|
|
1793
|
+
...I && {
|
|
1794
|
+
members: { $in: [I] },
|
|
1794
1795
|
hidden: !1
|
|
1795
1796
|
}
|
|
1796
1797
|
},
|
|
1797
|
-
...
|
|
1798
|
+
...h
|
|
1798
1799
|
};
|
|
1799
|
-
}, [
|
|
1800
|
-
if (!
|
|
1801
|
-
const
|
|
1802
|
-
if (
|
|
1800
|
+
}, [h, d == null ? void 0 : d.userID]), oe = W(null), te = F(async () => {
|
|
1801
|
+
if (!d || !m) return;
|
|
1802
|
+
const I = d.userID;
|
|
1803
|
+
if (I)
|
|
1803
1804
|
try {
|
|
1804
|
-
|
|
1805
|
-
const
|
|
1805
|
+
S && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
1806
|
+
const $ = await d.queryChannels(
|
|
1806
1807
|
{
|
|
1807
1808
|
type: "messaging",
|
|
1808
|
-
members: { $in: [
|
|
1809
|
+
members: { $in: [I] }
|
|
1809
1810
|
},
|
|
1810
1811
|
{},
|
|
1811
1812
|
{ limit: 100 }
|
|
1812
|
-
),
|
|
1813
|
-
|
|
1813
|
+
), U = /* @__PURE__ */ new Set();
|
|
1814
|
+
$.forEach((A) => {
|
|
1814
1815
|
const ge = A.state.members;
|
|
1815
|
-
Object.values(ge).forEach((
|
|
1816
|
+
Object.values(ge).forEach((Je) => {
|
|
1816
1817
|
var Ee;
|
|
1817
|
-
const xe = (Ee =
|
|
1818
|
-
xe && xe !==
|
|
1818
|
+
const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
|
|
1819
|
+
xe && xe !== I && U.add(xe);
|
|
1819
1820
|
});
|
|
1820
|
-
}),
|
|
1821
|
-
channelCount:
|
|
1822
|
-
memberCount:
|
|
1821
|
+
}), L((A) => A.size === U.size && [...A].every((ge) => U.has(ge)) ? A : U), K($.length > 0), ee(!0), oe.current = I, S && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1822
|
+
channelCount: $.length,
|
|
1823
|
+
memberCount: U.size
|
|
1823
1824
|
});
|
|
1824
|
-
} catch (
|
|
1825
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1825
|
+
} catch ($) {
|
|
1826
|
+
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
1826
1827
|
}
|
|
1827
|
-
}, [
|
|
1828
|
-
|
|
1829
|
-
if (!
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1832
|
-
}, [
|
|
1833
|
-
if (!c || !
|
|
1828
|
+
}, [d, m, S]);
|
|
1829
|
+
q(() => {
|
|
1830
|
+
if (!d || !m) return;
|
|
1831
|
+
const I = d.userID;
|
|
1832
|
+
I && oe.current !== I && te();
|
|
1833
|
+
}, [d, m, te]), q(() => {
|
|
1834
|
+
if (!c || !d || !m) return;
|
|
1834
1835
|
(async () => {
|
|
1835
|
-
const
|
|
1836
|
-
if (
|
|
1836
|
+
const $ = d.userID;
|
|
1837
|
+
if ($)
|
|
1837
1838
|
try {
|
|
1838
|
-
|
|
1839
|
+
S && console.log(
|
|
1839
1840
|
"[MessagingShell] Loading initial conversation with:",
|
|
1840
1841
|
c
|
|
1841
1842
|
);
|
|
1842
|
-
const
|
|
1843
|
+
const U = await d.queryChannels(
|
|
1843
1844
|
{
|
|
1844
1845
|
type: "messaging",
|
|
1845
|
-
members: { $eq: [
|
|
1846
|
+
members: { $eq: [$, c] }
|
|
1846
1847
|
},
|
|
1847
1848
|
{},
|
|
1848
1849
|
{ limit: 1 }
|
|
1849
1850
|
);
|
|
1850
|
-
if (
|
|
1851
|
-
|
|
1851
|
+
if (U.length > 0)
|
|
1852
|
+
z(U[0]), B(!0), Z(null), a && a(U[0]), S && console.log(
|
|
1852
1853
|
"[MessagingShell] Initial conversation loaded:",
|
|
1853
|
-
|
|
1854
|
+
U[0].id
|
|
1854
1855
|
);
|
|
1855
|
-
else if (r &&
|
|
1856
|
-
|
|
1856
|
+
else if (r && R) {
|
|
1857
|
+
S && console.log(
|
|
1857
1858
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1858
1859
|
r
|
|
1859
1860
|
);
|
|
1860
1861
|
try {
|
|
1861
|
-
const A = await
|
|
1862
|
+
const A = await R.startChannelWithParticipant({
|
|
1862
1863
|
id: r.id,
|
|
1863
1864
|
name: r.name,
|
|
1864
1865
|
email: r.email,
|
|
1865
1866
|
phone: r.phone
|
|
1866
1867
|
});
|
|
1867
|
-
|
|
1868
|
+
z(A), B(!0), Z(null), a && a(A), S && console.log(
|
|
1868
1869
|
"[MessagingShell] Channel created and loaded:",
|
|
1869
1870
|
A.id
|
|
1870
1871
|
);
|
|
@@ -1872,90 +1873,90 @@ const Rt = ({
|
|
|
1872
1873
|
console.error(
|
|
1873
1874
|
"[MessagingShell] Failed to create conversation:",
|
|
1874
1875
|
A
|
|
1875
|
-
),
|
|
1876
|
+
), Z("Failed to create conversation");
|
|
1876
1877
|
}
|
|
1877
1878
|
} else
|
|
1878
|
-
|
|
1879
|
+
Z(
|
|
1879
1880
|
"No conversation found with this account"
|
|
1880
|
-
),
|
|
1881
|
+
), S && console.log(
|
|
1881
1882
|
"[MessagingShell] No conversation found for:",
|
|
1882
1883
|
c
|
|
1883
1884
|
);
|
|
1884
|
-
} catch (
|
|
1885
|
+
} catch (U) {
|
|
1885
1886
|
console.error(
|
|
1886
1887
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1887
|
-
|
|
1888
|
-
),
|
|
1888
|
+
U
|
|
1889
|
+
), Z("Failed to load conversation");
|
|
1889
1890
|
}
|
|
1890
1891
|
})();
|
|
1891
1892
|
}, [
|
|
1892
1893
|
c,
|
|
1893
1894
|
r,
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1895
|
+
d,
|
|
1896
|
+
m,
|
|
1897
|
+
R,
|
|
1898
|
+
S,
|
|
1898
1899
|
a
|
|
1899
1900
|
]);
|
|
1900
|
-
const
|
|
1901
|
-
(
|
|
1902
|
-
|
|
1901
|
+
const Ge = F(
|
|
1902
|
+
(I) => {
|
|
1903
|
+
z(I), a == null || a(I);
|
|
1903
1904
|
},
|
|
1904
1905
|
[a]
|
|
1905
|
-
),
|
|
1906
|
-
|
|
1907
|
-
}, [
|
|
1908
|
-
async (
|
|
1909
|
-
var
|
|
1910
|
-
if (
|
|
1906
|
+
), Ve = F(() => {
|
|
1907
|
+
O || z(null);
|
|
1908
|
+
}, [O]), We = F(
|
|
1909
|
+
async (I) => {
|
|
1910
|
+
var $;
|
|
1911
|
+
if (R)
|
|
1911
1912
|
try {
|
|
1912
|
-
|
|
1913
|
+
S && console.log(
|
|
1913
1914
|
"[MessagingShell] Starting conversation with:",
|
|
1914
|
-
|
|
1915
|
+
I.id
|
|
1915
1916
|
);
|
|
1916
|
-
const
|
|
1917
|
-
id:
|
|
1918
|
-
name:
|
|
1919
|
-
email:
|
|
1920
|
-
phone:
|
|
1917
|
+
const U = await R.startChannelWithParticipant({
|
|
1918
|
+
id: I.id,
|
|
1919
|
+
name: I.name,
|
|
1920
|
+
email: I.email,
|
|
1921
|
+
phone: I.phone
|
|
1921
1922
|
});
|
|
1922
1923
|
try {
|
|
1923
|
-
await
|
|
1924
|
+
await U.show();
|
|
1924
1925
|
} catch (A) {
|
|
1925
1926
|
console.warn("[MessagingShell] Failed to unhide channel:", A);
|
|
1926
1927
|
}
|
|
1927
|
-
|
|
1928
|
-
} catch (
|
|
1929
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
1928
|
+
z(U), J(!1), ($ = se.current) == null || $.close(), o == null || o(I);
|
|
1929
|
+
} catch (U) {
|
|
1930
|
+
console.error("[MessagingShell] Failed to start conversation:", U);
|
|
1930
1931
|
}
|
|
1931
1932
|
},
|
|
1932
|
-
[
|
|
1933
|
-
), ie =
|
|
1934
|
-
var
|
|
1935
|
-
|
|
1936
|
-
}, []),
|
|
1937
|
-
(
|
|
1938
|
-
|
|
1933
|
+
[R, o, S]
|
|
1934
|
+
), ie = F(() => {
|
|
1935
|
+
var I;
|
|
1936
|
+
J(!1), (I = se.current) == null || I.close();
|
|
1937
|
+
}, []), qe = F(
|
|
1938
|
+
(I) => {
|
|
1939
|
+
I.target === se.current && ie();
|
|
1939
1940
|
},
|
|
1940
1941
|
[ie]
|
|
1941
|
-
),
|
|
1942
|
-
async (
|
|
1943
|
-
|
|
1942
|
+
), Ze = F(
|
|
1943
|
+
async (I) => {
|
|
1944
|
+
S && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), B(!1), oe.current = null, await te();
|
|
1944
1945
|
},
|
|
1945
|
-
[
|
|
1946
|
-
),
|
|
1947
|
-
async (
|
|
1948
|
-
|
|
1946
|
+
[te, S]
|
|
1947
|
+
), Ye = F(
|
|
1948
|
+
async (I) => {
|
|
1949
|
+
S && console.log("[MessagingShell] Blocking participant:", I), z(null), B(!1), oe.current = null, await te();
|
|
1949
1950
|
},
|
|
1950
|
-
[
|
|
1951
|
-
), ce = !!
|
|
1952
|
-
return
|
|
1951
|
+
[te, S]
|
|
1952
|
+
), ce = !!G;
|
|
1953
|
+
return C ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : k ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: k, onBack: T }) }) : !m || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
1953
1954
|
me,
|
|
1954
1955
|
{
|
|
1955
1956
|
message: "Not connected to messaging service",
|
|
1956
|
-
onBack:
|
|
1957
|
+
onBack: T
|
|
1957
1958
|
}
|
|
1958
|
-
) }) :
|
|
1959
|
+
) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: le }) }) : /* @__PURE__ */ i(
|
|
1959
1960
|
"div",
|
|
1960
1961
|
{
|
|
1961
1962
|
className: D(
|
|
@@ -1970,21 +1971,21 @@ const Rt = ({
|
|
|
1970
1971
|
className: D(
|
|
1971
1972
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1972
1973
|
{
|
|
1973
|
-
"!hidden": b === !1 ||
|
|
1974
|
+
"!hidden": b === !1 || O,
|
|
1974
1975
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
1975
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !
|
|
1976
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !O && ce,
|
|
1976
1977
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
1977
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !
|
|
1978
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !O && !ce
|
|
1978
1979
|
}
|
|
1979
1980
|
),
|
|
1980
1981
|
children: /* @__PURE__ */ e(
|
|
1981
1982
|
Ue,
|
|
1982
1983
|
{
|
|
1983
|
-
onChannelSelect:
|
|
1984
|
-
selectedChannel:
|
|
1985
|
-
filters:
|
|
1986
|
-
customEmptyStateIndicator:
|
|
1987
|
-
renderMessagePreview:
|
|
1984
|
+
onChannelSelect: Ge,
|
|
1985
|
+
selectedChannel: G || void 0,
|
|
1986
|
+
filters: He,
|
|
1987
|
+
customEmptyStateIndicator: _,
|
|
1988
|
+
renderMessagePreview: N
|
|
1988
1989
|
}
|
|
1989
1990
|
)
|
|
1990
1991
|
}
|
|
@@ -1996,62 +1997,63 @@ const Rt = ({
|
|
|
1996
1997
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1997
1998
|
{
|
|
1998
1999
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
1999
|
-
flex:
|
|
2000
|
+
flex: O || ce || c,
|
|
2000
2001
|
// Normal mode: hide on mobile when no channel selected
|
|
2001
|
-
"hidden lg:flex": !
|
|
2002
|
+
"hidden lg:flex": !O && !ce && !c
|
|
2002
2003
|
}
|
|
2003
2004
|
),
|
|
2004
|
-
children:
|
|
2005
|
+
children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2005
2006
|
Ae,
|
|
2006
2007
|
{
|
|
2007
|
-
channel:
|
|
2008
|
-
onBack:
|
|
2009
|
-
showBackButton: !
|
|
2008
|
+
channel: G,
|
|
2009
|
+
onBack: Ve,
|
|
2010
|
+
showBackButton: !O,
|
|
2010
2011
|
renderMessageInputActions: n,
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2012
|
+
renderChannelBanner: v,
|
|
2013
|
+
onLeaveConversation: Ze,
|
|
2014
|
+
onBlockParticipant: Ye,
|
|
2015
|
+
CustomChannelEmptyState: u,
|
|
2016
|
+
showDeleteConversation: ze,
|
|
2015
2017
|
onDeleteConversationClick: x,
|
|
2016
2018
|
onBlockParticipantClick: g,
|
|
2017
2019
|
onReportParticipantClick: l,
|
|
2018
|
-
dmAgentEnabled:
|
|
2019
|
-
messageMetadata:
|
|
2020
|
-
onMessageSent:
|
|
2021
|
-
showStarButton:
|
|
2022
|
-
chatbotVotingEnabled:
|
|
2020
|
+
dmAgentEnabled: y,
|
|
2021
|
+
messageMetadata: E,
|
|
2022
|
+
onMessageSent: w,
|
|
2023
|
+
showStarButton: p,
|
|
2024
|
+
chatbotVotingEnabled: f
|
|
2023
2025
|
},
|
|
2024
|
-
|
|
2026
|
+
G.id
|
|
2025
2027
|
) }) : c ? (
|
|
2026
2028
|
// Show loading while creating/loading direct conversation channel
|
|
2027
2029
|
/* @__PURE__ */ e(he, {})
|
|
2028
2030
|
) : /* @__PURE__ */ e(
|
|
2029
2031
|
$e,
|
|
2030
2032
|
{
|
|
2031
|
-
hasChannels:
|
|
2032
|
-
channelsLoaded:
|
|
2033
|
+
hasChannels: X,
|
|
2034
|
+
channelsLoaded: Y
|
|
2033
2035
|
}
|
|
2034
2036
|
)
|
|
2035
2037
|
}
|
|
2036
2038
|
)
|
|
2037
2039
|
] }),
|
|
2038
|
-
|
|
2040
|
+
re && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2039
2041
|
/* @__PURE__ */ e(
|
|
2040
2042
|
"dialog",
|
|
2041
2043
|
{
|
|
2042
|
-
ref:
|
|
2044
|
+
ref: se,
|
|
2043
2045
|
className: "mes-dialog",
|
|
2044
|
-
onClick:
|
|
2046
|
+
onClick: qe,
|
|
2045
2047
|
onClose: ie,
|
|
2046
2048
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2047
|
-
|
|
2049
|
+
vt,
|
|
2048
2050
|
{
|
|
2049
|
-
participantSource:
|
|
2050
|
-
onSelectParticipant:
|
|
2051
|
+
participantSource: re,
|
|
2052
|
+
onSelectParticipant: We,
|
|
2051
2053
|
onClose: ie,
|
|
2052
|
-
existingParticipantIds:
|
|
2053
|
-
participantLabel:
|
|
2054
|
-
searchPlaceholder: `Search ${
|
|
2054
|
+
existingParticipantIds: V,
|
|
2055
|
+
participantLabel: ae,
|
|
2056
|
+
searchPlaceholder: `Search ${ae}...`
|
|
2055
2057
|
},
|
|
2056
2058
|
P
|
|
2057
2059
|
) })
|
|
@@ -2060,7 +2062,7 @@ const Rt = ({
|
|
|
2060
2062
|
]
|
|
2061
2063
|
}
|
|
2062
2064
|
);
|
|
2063
|
-
},
|
|
2065
|
+
}, pt = ({
|
|
2064
2066
|
question: t,
|
|
2065
2067
|
onClick: s,
|
|
2066
2068
|
loading: n = !1,
|
|
@@ -2082,7 +2084,7 @@ const Rt = ({
|
|
|
2082
2084
|
),
|
|
2083
2085
|
children: t
|
|
2084
2086
|
}
|
|
2085
|
-
),
|
|
2087
|
+
), Tt = ({
|
|
2086
2088
|
faqs: t,
|
|
2087
2089
|
onFaqClick: s,
|
|
2088
2090
|
loadingFaqId: n,
|
|
@@ -2091,8 +2093,8 @@ const Rt = ({
|
|
|
2091
2093
|
avatarImage: c,
|
|
2092
2094
|
avatarName: r
|
|
2093
2095
|
}) => {
|
|
2094
|
-
const
|
|
2095
|
-
return
|
|
2096
|
+
const u = t.filter((b) => b.enabled).sort((b, h) => (b.order ?? 0) - (h.order ?? 0));
|
|
2097
|
+
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2096
2098
|
(c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2097
2099
|
Q,
|
|
2098
2100
|
{
|
|
@@ -2110,8 +2112,8 @@ const Rt = ({
|
|
|
2110
2112
|
style: { backgroundColor: "#F1F0EE" },
|
|
2111
2113
|
children: [
|
|
2112
2114
|
a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
+
u.map((b) => /* @__PURE__ */ e(
|
|
2116
|
+
pt,
|
|
2115
2117
|
{
|
|
2116
2118
|
question: b.question,
|
|
2117
2119
|
onClick: () => s(b.id),
|
|
@@ -2123,61 +2125,61 @@ const Rt = ({
|
|
|
2123
2125
|
}
|
|
2124
2126
|
)
|
|
2125
2127
|
] }) });
|
|
2126
|
-
},
|
|
2127
|
-
const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] =
|
|
2128
|
+
}, Ft = (t, s = {}) => {
|
|
2129
|
+
const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = M([]), [r, u] = M(!1), [b, h] = M(null), [_, x] = M(n), [g, l] = M(!0), [y, E] = M(), w = F(async (v = !1, R) => {
|
|
2128
2130
|
if (r) return;
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
+
const d = R !== void 0 ? R : _;
|
|
2132
|
+
u(!0), h(null);
|
|
2131
2133
|
try {
|
|
2132
|
-
const
|
|
2133
|
-
search:
|
|
2134
|
+
const m = await t.loadParticipants({
|
|
2135
|
+
search: d || void 0,
|
|
2134
2136
|
limit: a,
|
|
2135
|
-
cursor:
|
|
2137
|
+
cursor: v ? void 0 : y
|
|
2136
2138
|
});
|
|
2137
2139
|
c(
|
|
2138
|
-
(
|
|
2139
|
-
), l(
|
|
2140
|
-
} catch (
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2140
|
+
(C) => v ? m.participants : [...C, ...m.participants]
|
|
2141
|
+
), l(m.hasMore), E(m.nextCursor);
|
|
2142
|
+
} catch (m) {
|
|
2143
|
+
const C = m instanceof Error ? m.message : "Failed to load participants";
|
|
2144
|
+
h(C), console.error("[useParticipants] Load error:", m);
|
|
2143
2145
|
} finally {
|
|
2144
|
-
|
|
2146
|
+
u(!1);
|
|
2145
2147
|
}
|
|
2146
|
-
}, [t,
|
|
2147
|
-
g && !r &&
|
|
2148
|
-
}, [g, r,
|
|
2149
|
-
x(
|
|
2150
|
-
}, [
|
|
2151
|
-
|
|
2152
|
-
}, [
|
|
2153
|
-
return
|
|
2154
|
-
|
|
2148
|
+
}, [t, _, y, a, r]), p = F(() => {
|
|
2149
|
+
g && !r && w(!1);
|
|
2150
|
+
}, [g, r, w]), f = F((v) => {
|
|
2151
|
+
x(v), E(void 0), w(!0, v);
|
|
2152
|
+
}, [w]), N = F(() => {
|
|
2153
|
+
E(void 0), w(!0);
|
|
2154
|
+
}, [w]);
|
|
2155
|
+
return q(() => {
|
|
2156
|
+
w(!0);
|
|
2155
2157
|
}, [t.loadParticipants]), {
|
|
2156
2158
|
participants: o,
|
|
2157
2159
|
loading: r,
|
|
2158
2160
|
error: b,
|
|
2159
|
-
searchQuery:
|
|
2161
|
+
searchQuery: _,
|
|
2160
2162
|
hasMore: g,
|
|
2161
2163
|
totalCount: t.totalCount,
|
|
2162
|
-
loadMore:
|
|
2163
|
-
search:
|
|
2164
|
-
refresh:
|
|
2164
|
+
loadMore: p,
|
|
2165
|
+
search: f,
|
|
2166
|
+
refresh: N
|
|
2165
2167
|
};
|
|
2166
2168
|
};
|
|
2167
2169
|
export {
|
|
2168
2170
|
Q as Avatar,
|
|
2169
|
-
|
|
2171
|
+
ft as ChannelEmptyState,
|
|
2170
2172
|
Ue as ChannelList,
|
|
2171
2173
|
Ae as ChannelView,
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2174
|
+
Tt as FaqList,
|
|
2175
|
+
pt as FaqListItem,
|
|
2176
|
+
rt as MessageVoteButtons,
|
|
2177
|
+
Rt as MessagingProvider,
|
|
2178
|
+
Dt as MessagingShell,
|
|
2179
|
+
vt as ParticipantPicker,
|
|
2180
|
+
Ws as formatRelativeTime,
|
|
2181
|
+
st as useMessageVote,
|
|
2182
|
+
Gs as useMessaging,
|
|
2183
|
+
Ft as useParticipants
|
|
2182
2184
|
};
|
|
2183
2185
|
//# sourceMappingURL=index.js.map
|