@linktr.ee/messaging-react 1.11.3 โ 1.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
|
|
2
2
|
import p from "classnames";
|
|
3
|
-
import Z, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { XIcon as le, ArrowUpIcon as
|
|
3
|
+
import Z, { createContext as Ie, useContext as Se, useCallback as F, useState as v, useRef as z, useEffect as G } from "react";
|
|
4
|
+
import { StreamChatService as ke } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as pe, ChannelList as Re, useMessageComposer as De, useStateStore as _e, MessageInput as Me, useMessageInputContext as Fe, useMessageComposerHasSendableData as Te, SimpleAttachmentSelector as Pe, QuotedMessagePreview as Le, AttachmentPreviewList as Ue, TextareaComposer as Oe, MessageTimestamp as je, Channel as Ae, useChannelStateContext as fe, Window as Be, MessageList as ze } from "stream-chat-react";
|
|
6
|
+
import { XIcon as le, ArrowUpIcon as Ge, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as He, ProhibitInsetIcon as ce, FlagIcon as $e, MagnifyingGlassIcon as Ve, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as ue } from "stream-chat";
|
|
8
|
-
const ge =
|
|
8
|
+
const ge = Ie({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,223 +15,223 @@ const ge = Se({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), se = () =>
|
|
18
|
+
}), se = () => Se(ge), Is = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
23
|
-
capabilities:
|
|
24
|
-
debug:
|
|
22
|
+
apiKey: r,
|
|
23
|
+
capabilities: o = {},
|
|
24
|
+
debug: a = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(u, ...
|
|
28
|
-
|
|
26
|
+
const l = F(
|
|
27
|
+
(u, ...x) => {
|
|
28
|
+
a && console.log(`๐ฅ [MessagingProvider] ${u}`, ...x);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[a]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
l("๐ RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
|
-
capabilities: Object.keys(
|
|
36
|
+
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [c, m] =
|
|
38
|
+
const [c, m] = v(null), [g, E] = v(null), [h, f] = v(!1), [k, b] = v(!1), [w, y] = v(null), N = z(!1), I = z({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
|
-
capabilities:
|
|
42
|
+
capabilities: o
|
|
43
43
|
}), S = z(0);
|
|
44
|
-
S.current++,
|
|
44
|
+
S.current++, l("๐ RENDER INFO", {
|
|
45
45
|
renderCount: S.current,
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
48
|
userChanged: I.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
-
apiKeyChanged: I.current.apiKey !==
|
|
49
|
+
apiKeyChanged: I.current.apiKey !== r,
|
|
50
50
|
serviceConfigChanged: I.current.serviceConfig !== n,
|
|
51
|
-
capabilitiesChanged: I.current.capabilities !==
|
|
51
|
+
capabilitiesChanged: I.current.capabilities !== o
|
|
52
52
|
}
|
|
53
53
|
}), I.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
|
-
capabilities:
|
|
57
|
+
capabilities: o
|
|
58
58
|
}, G(() => {
|
|
59
59
|
const u = S.current;
|
|
60
|
-
if (
|
|
60
|
+
if (l("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
|
-
apiKey: !!
|
|
62
|
+
apiKey: !!r,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
67
|
serviceConfigStable: I.current.serviceConfig === n,
|
|
68
|
-
apiKeyStable: I.current.apiKey ===
|
|
68
|
+
apiKeyStable: I.current.apiKey === r
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
71
|
-
|
|
70
|
+
}), !r || !n) {
|
|
71
|
+
l("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: u,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
l("๐ CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: u,
|
|
79
|
-
apiKey: (
|
|
79
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: I.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const x = new ke({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
85
|
-
debug:
|
|
84
|
+
apiKey: r,
|
|
85
|
+
debug: a
|
|
86
86
|
});
|
|
87
|
-
return m(
|
|
87
|
+
return m(x), l("โ
SERVICE SET", {
|
|
88
88
|
renderCount: u,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!x
|
|
90
90
|
}), () => {
|
|
91
|
-
|
|
91
|
+
l("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: u,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), x.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
96
|
+
}, [r, n, a, l]);
|
|
97
97
|
const R = z(null);
|
|
98
98
|
G(() => {
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
99
|
+
var x, j;
|
|
100
|
+
if (l("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
104
|
+
isConnecting: N.current,
|
|
105
105
|
isConnected: h,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
|
-
|
|
108
|
+
l("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
111
|
+
if (N.current) {
|
|
112
|
+
l("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
116
|
-
|
|
115
|
+
if (((x = R.current) == null ? void 0 : x.serviceId) === c && ((j = R.current) == null ? void 0 : j.userId) === s.id) {
|
|
116
|
+
l(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
119
119
|
);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
|
|
123
|
+
l("๐ STARTING USER CONNECTION", { userId: s.id }), N.current = !0, b(!0), y(null);
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
l("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const A = await c.connectUser(s);
|
|
127
|
-
|
|
127
|
+
E(A), f(!0), R.current = { serviceId: c, userId: s.id }, l("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: A.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (A) {
|
|
132
132
|
const W = A instanceof Error ? A.message : "Connection failed";
|
|
133
|
-
|
|
133
|
+
y(W), l("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
135
|
error: W
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
b(!1), N.current = !1, l("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: h
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s,
|
|
144
|
+
}, [c, s, l, h]), G(() => (l("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
146
|
isConnected: h
|
|
147
147
|
}), () => {
|
|
148
|
-
c && h ? (
|
|
148
|
+
c && h ? (l(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
), R.current = null, c.disconnectUser().catch(console.error)) :
|
|
151
|
+
), R.current = null, c.disconnectUser().catch(console.error)) : l("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
153
|
isConnected: h
|
|
154
154
|
});
|
|
155
|
-
}), [c, h,
|
|
155
|
+
}), [c, h, l]);
|
|
156
156
|
const _ = F(async () => {
|
|
157
|
-
if (
|
|
157
|
+
if (l("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
160
160
|
}), !c || !s) {
|
|
161
|
-
|
|
161
|
+
l("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
l("๐ STARTING CONNECTION REFRESH", { userId: s.id }), b(!0);
|
|
165
165
|
try {
|
|
166
|
-
|
|
166
|
+
l("๐ DISCONNECTING FOR REFRESH"), await c.disconnectUser(), l("๐ RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await c.connectUser(s);
|
|
168
|
-
|
|
168
|
+
E(u), f(!0), y(null), l("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const x = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
+
y(x), l("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: x
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
b(!1), l("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s,
|
|
178
|
+
}, [c, s, l]), d = Z.useMemo(() => (l("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
|
-
hasClient: !!
|
|
180
|
+
hasClient: !!g,
|
|
181
181
|
isConnected: h,
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
184
|
-
capabilitiesKeys: Object.keys(
|
|
182
|
+
isLoading: k,
|
|
183
|
+
hasError: !!w,
|
|
184
|
+
capabilitiesKeys: Object.keys(o)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
|
-
client:
|
|
187
|
+
client: g,
|
|
188
188
|
isConnected: h,
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
191
|
-
capabilities:
|
|
189
|
+
isLoading: k,
|
|
190
|
+
error: w,
|
|
191
|
+
capabilities: o,
|
|
192
192
|
refreshConnection: _,
|
|
193
|
-
debug:
|
|
193
|
+
debug: a
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
|
-
|
|
196
|
+
g,
|
|
197
197
|
h,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
k,
|
|
199
|
+
w,
|
|
200
|
+
o,
|
|
201
201
|
_,
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
a,
|
|
203
|
+
l
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
205
|
+
return l("๐ RENDER END", {
|
|
206
206
|
renderCount: S.current,
|
|
207
|
-
willRenderChat: !!(
|
|
207
|
+
willRenderChat: !!(g && h),
|
|
208
208
|
contextValueReady: !!d
|
|
209
|
-
}), /* @__PURE__ */ e(ge.Provider, { value: d, children:
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(ge.Provider, { value: d, children: g && h ? /* @__PURE__ */ e(
|
|
210
|
+
pe,
|
|
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
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, We = () => se(), Ze = (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
|
-
return Math.floor(
|
|
226
|
-
},
|
|
225
|
+
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
226
|
+
}, qe = (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
|
|
231
|
-
return
|
|
230
|
+
const r = Ze(t, s);
|
|
231
|
+
return r === 0 ? t.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit"
|
|
234
|
-
}) :
|
|
234
|
+
}) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : t.toLocaleDateString("en-US", {
|
|
235
235
|
month: "numeric",
|
|
236
236
|
day: "numeric",
|
|
237
237
|
year: "2-digit"
|
|
@@ -264,33 +264,33 @@ const ge = Se({
|
|
|
264
264
|
"๐"
|
|
265
265
|
// Melon
|
|
266
266
|
];
|
|
267
|
-
function
|
|
267
|
+
function Ye(t) {
|
|
268
268
|
let s = 0;
|
|
269
269
|
for (let n = 0; n < t.length; n++) {
|
|
270
|
-
const
|
|
271
|
-
s = (s << 5) - s +
|
|
270
|
+
const r = t.charCodeAt(n);
|
|
271
|
+
s = (s << 5) - s + r, s = s & s;
|
|
272
272
|
}
|
|
273
273
|
return Math.abs(s);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
const n =
|
|
275
|
+
function Je(t) {
|
|
276
|
+
const n = Ye(t) % me.length;
|
|
277
277
|
return me[n];
|
|
278
278
|
}
|
|
279
279
|
const q = ({
|
|
280
280
|
id: t,
|
|
281
281
|
image: s,
|
|
282
282
|
size: n = 40,
|
|
283
|
-
className:
|
|
284
|
-
shape:
|
|
283
|
+
className: r,
|
|
284
|
+
shape: o = "squircle"
|
|
285
285
|
}) => {
|
|
286
|
-
const
|
|
286
|
+
const a = Je(t), c = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", m = o === "circle" ? { borderRadius: "50%" } : {
|
|
287
287
|
borderRadius: "33%",
|
|
288
288
|
"corner-shape": "superellipse(1.3)"
|
|
289
289
|
};
|
|
290
290
|
return /* @__PURE__ */ e(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
293
|
-
className: p("flex-shrink-0 overflow-hidden",
|
|
293
|
+
className: p("flex-shrink-0 overflow-hidden", r),
|
|
294
294
|
style: {
|
|
295
295
|
width: `${n}px`,
|
|
296
296
|
height: `${n}px`,
|
|
@@ -311,89 +311,89 @@ const q = ({
|
|
|
311
311
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
312
312
|
c
|
|
313
313
|
),
|
|
314
|
-
children:
|
|
314
|
+
children: a
|
|
315
315
|
}
|
|
316
316
|
)
|
|
317
317
|
}
|
|
318
318
|
);
|
|
319
|
-
},
|
|
320
|
-
var
|
|
321
|
-
const
|
|
319
|
+
}, Qe = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: o }) => {
|
|
320
|
+
var y, N, I, S, R, _;
|
|
321
|
+
const a = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
|
|
322
322
|
t && n(t);
|
|
323
|
-
}, m = Object.values(((
|
|
323
|
+
}, m = Object.values(((y = t == null ? void 0 : t.state) == null ? void 0 : y.members) || {}).find(
|
|
324
324
|
(d) => {
|
|
325
|
-
var u,
|
|
326
|
-
return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((
|
|
325
|
+
var u, x;
|
|
326
|
+
return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
|
|
327
327
|
}
|
|
328
|
-
),
|
|
328
|
+
), g = ((N = m == null ? void 0 : m.user) == null ? void 0 : N.name) || "Conversation", E = (I = m == null ? void 0 : m.user) == null ? void 0 : I.image, h = (R = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : R[t.state.messages.length - 1], k = (() => {
|
|
329
329
|
var u;
|
|
330
330
|
if (h != null && h.text) return h.text;
|
|
331
331
|
const d = (u = h == null ? void 0 : h.attachments) == null ? void 0 : u[0];
|
|
332
332
|
return d != null && d.asset_url ? d.asset_url : d != null && d.image_url ? d.image_url : d != null && d.og_scrape_url ? d.og_scrape_url : d != null && d.thumb_url ? d.thumb_url : "No messages yet";
|
|
333
|
-
})(),
|
|
334
|
-
return
|
|
333
|
+
})(), b = h != null && h.created_at ? qe(new Date(h.created_at)) : "", w = o ?? 0;
|
|
334
|
+
return r && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
335
335
|
channelId: t == null ? void 0 : t.id,
|
|
336
|
-
isSelected:
|
|
337
|
-
participantName:
|
|
338
|
-
unreadCount:
|
|
339
|
-
hasTimestamp: !!
|
|
336
|
+
isSelected: a,
|
|
337
|
+
participantName: g,
|
|
338
|
+
unreadCount: w,
|
|
339
|
+
hasTimestamp: !!b
|
|
340
340
|
}), /* @__PURE__ */ e(
|
|
341
341
|
"button",
|
|
342
342
|
{
|
|
343
343
|
type: "button",
|
|
344
|
-
onClick:
|
|
344
|
+
onClick: l,
|
|
345
345
|
className: p(
|
|
346
346
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
347
347
|
{
|
|
348
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
349
|
-
"hover:bg-sand": !
|
|
348
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": a,
|
|
349
|
+
"hover:bg-sand": !a
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
|
-
children: /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
353
353
|
/* @__PURE__ */ e(
|
|
354
354
|
q,
|
|
355
355
|
{
|
|
356
356
|
id: ((_ = m == null ? void 0 : m.user) == null ? void 0 : _.id) || t.id || "unknown",
|
|
357
|
-
name:
|
|
358
|
-
image:
|
|
357
|
+
name: g,
|
|
358
|
+
image: E,
|
|
359
359
|
size: 44,
|
|
360
360
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
361
361
|
}
|
|
362
362
|
),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
364
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
|
|
365
365
|
/* @__PURE__ */ e(
|
|
366
366
|
"h3",
|
|
367
367
|
{
|
|
368
368
|
className: p(
|
|
369
369
|
"text-sm font-medium truncate",
|
|
370
|
-
|
|
370
|
+
a ? "text-primary" : "text-charcoal"
|
|
371
371
|
),
|
|
372
|
-
children:
|
|
372
|
+
children: g
|
|
373
373
|
}
|
|
374
374
|
),
|
|
375
|
-
|
|
375
|
+
b && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: b })
|
|
376
376
|
] }),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children:
|
|
379
|
-
|
|
377
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
378
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: k }),
|
|
379
|
+
w > 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: w > 99 ? "99+" : w })
|
|
380
380
|
] })
|
|
381
381
|
] })
|
|
382
382
|
] })
|
|
383
383
|
}
|
|
384
384
|
);
|
|
385
|
-
},
|
|
385
|
+
}, Xe = ({
|
|
386
386
|
onChannelSelect: t,
|
|
387
387
|
selectedChannel: s,
|
|
388
388
|
filters: n,
|
|
389
|
-
className:
|
|
390
|
-
customEmptyStateIndicator:
|
|
389
|
+
className: r,
|
|
390
|
+
customEmptyStateIndicator: o
|
|
391
391
|
}) => {
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
const { debug:
|
|
395
|
-
return
|
|
396
|
-
renderCount:
|
|
392
|
+
const a = Z.useRef(0);
|
|
393
|
+
a.current++;
|
|
394
|
+
const { debug: l = !1 } = se();
|
|
395
|
+
return l && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
396
|
+
renderCount: a.current,
|
|
397
397
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
398
398
|
filters: n
|
|
399
399
|
}), /* @__PURE__ */ e(
|
|
@@ -401,34 +401,34 @@ const q = ({
|
|
|
401
401
|
{
|
|
402
402
|
className: p(
|
|
403
403
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
404
|
-
|
|
404
|
+
r
|
|
405
405
|
),
|
|
406
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (
|
|
407
|
-
renderCount:
|
|
406
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (l && console.log("๐บ [ChannelList] ๐ฌ RENDERING STREAM CHANNEL LIST", {
|
|
407
|
+
renderCount: a.current,
|
|
408
408
|
filters: n
|
|
409
409
|
}), /* @__PURE__ */ e(
|
|
410
|
-
|
|
410
|
+
Re,
|
|
411
411
|
{
|
|
412
412
|
filters: n,
|
|
413
413
|
sort: { last_message_at: -1 },
|
|
414
414
|
options: { limit: 30 },
|
|
415
415
|
Preview: (c) => {
|
|
416
|
-
var m,
|
|
417
|
-
return
|
|
416
|
+
var m, g;
|
|
417
|
+
return l && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
418
418
|
channelId: (m = c.channel) == null ? void 0 : m.id,
|
|
419
419
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
420
|
-
isSelected: (s == null ? void 0 : s.id) === ((
|
|
420
|
+
isSelected: (s == null ? void 0 : s.id) === ((g = c.channel) == null ? void 0 : g.id)
|
|
421
421
|
}), /* @__PURE__ */ e(
|
|
422
|
-
|
|
422
|
+
Qe,
|
|
423
423
|
{
|
|
424
424
|
...c,
|
|
425
425
|
selectedChannel: s,
|
|
426
426
|
onChannelSelect: t,
|
|
427
|
-
debug:
|
|
427
|
+
debug: l
|
|
428
428
|
}
|
|
429
429
|
);
|
|
430
430
|
},
|
|
431
|
-
EmptyStateIndicator:
|
|
431
|
+
EmptyStateIndicator: o
|
|
432
432
|
},
|
|
433
433
|
JSON.stringify(n)
|
|
434
434
|
)) })
|
|
@@ -438,7 +438,7 @@ const q = ({
|
|
|
438
438
|
variant: t = "default",
|
|
439
439
|
className: s,
|
|
440
440
|
children: n,
|
|
441
|
-
...
|
|
441
|
+
...r
|
|
442
442
|
}) => /* @__PURE__ */ e(
|
|
443
443
|
"button",
|
|
444
444
|
{
|
|
@@ -448,24 +448,24 @@ const q = ({
|
|
|
448
448
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
449
449
|
s
|
|
450
450
|
),
|
|
451
|
-
...
|
|
451
|
+
...r,
|
|
452
452
|
children: n
|
|
453
453
|
}
|
|
454
454
|
);
|
|
455
|
-
function xe({ label: t, className: s, children: n, ...
|
|
456
|
-
return /* @__PURE__ */
|
|
455
|
+
function xe({ label: t, className: s, children: n, ...r }) {
|
|
456
|
+
return /* @__PURE__ */ i(
|
|
457
457
|
"button",
|
|
458
458
|
{
|
|
459
459
|
type: "button",
|
|
460
460
|
className: p(
|
|
461
461
|
"rounded-full p-2 transition-colors focus-ring",
|
|
462
462
|
{
|
|
463
|
-
"cursor-not-allowed opacity-50":
|
|
464
|
-
"hover:bg-sand": !
|
|
463
|
+
"cursor-not-allowed opacity-50": r.disabled,
|
|
464
|
+
"hover:bg-sand": !r.disabled
|
|
465
465
|
},
|
|
466
466
|
s
|
|
467
467
|
),
|
|
468
|
-
...
|
|
468
|
+
...r,
|
|
469
469
|
children: [
|
|
470
470
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
471
471
|
n
|
|
@@ -473,19 +473,19 @@ function xe({ label: t, className: s, children: n, ...l }) {
|
|
|
473
473
|
}
|
|
474
474
|
);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Ce({ onClick: t }) {
|
|
477
477
|
return /* @__PURE__ */ e(xe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(le, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const Ke = (t) => ({
|
|
480
480
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
481
481
|
(s) => ue.previewIsLoaded(s) || ue.previewIsLoading(s)
|
|
482
482
|
)
|
|
483
|
-
}),
|
|
483
|
+
}), es = ({
|
|
484
484
|
link: t,
|
|
485
485
|
onDismiss: s
|
|
486
486
|
}) => {
|
|
487
|
-
const { og_scrape_url: n, title:
|
|
488
|
-
return /* @__PURE__ */
|
|
487
|
+
const { og_scrape_url: n, title: r, image_url: o } = t;
|
|
488
|
+
return /* @__PURE__ */ i(
|
|
489
489
|
"a",
|
|
490
490
|
{
|
|
491
491
|
href: n,
|
|
@@ -493,11 +493,11 @@ const es = (t) => ({
|
|
|
493
493
|
rel: "noopener noreferrer",
|
|
494
494
|
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
495
495
|
children: [
|
|
496
|
-
|
|
496
|
+
o && /* @__PURE__ */ e(
|
|
497
497
|
"img",
|
|
498
498
|
{
|
|
499
|
-
src:
|
|
500
|
-
alt:
|
|
499
|
+
src: o,
|
|
500
|
+
alt: r || "",
|
|
501
501
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
502
502
|
}
|
|
503
503
|
),
|
|
@@ -505,47 +505,47 @@ const es = (t) => ({
|
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
507
507
|
type: "button",
|
|
508
|
-
onClick: (
|
|
509
|
-
|
|
508
|
+
onClick: (l) => {
|
|
509
|
+
l.preventDefault(), s(n);
|
|
510
510
|
},
|
|
511
511
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl",
|
|
512
512
|
"aria-label": "Close link preview",
|
|
513
513
|
children: /* @__PURE__ */ e(le, { className: "size-4 text-black/90" })
|
|
514
514
|
}
|
|
515
515
|
),
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
|
|
516
|
+
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
517
|
+
r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
518
518
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
519
519
|
] })
|
|
520
520
|
]
|
|
521
521
|
}
|
|
522
522
|
);
|
|
523
|
-
},
|
|
524
|
-
const { linkPreviewsManager: t } =
|
|
523
|
+
}, ss = () => {
|
|
524
|
+
const { linkPreviewsManager: t } = De(), { linkPreviews: s } = _e(
|
|
525
525
|
t.state,
|
|
526
|
-
|
|
527
|
-
), n = (
|
|
528
|
-
t.dismissPreview(
|
|
526
|
+
Ke
|
|
527
|
+
), n = (o) => {
|
|
528
|
+
t.dismissPreview(o);
|
|
529
529
|
};
|
|
530
|
-
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((
|
|
531
|
-
|
|
530
|
+
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
|
|
531
|
+
es,
|
|
532
532
|
{
|
|
533
|
-
link:
|
|
533
|
+
link: o,
|
|
534
534
|
onDismiss: n
|
|
535
535
|
},
|
|
536
|
-
|
|
536
|
+
o.og_scrape_url
|
|
537
537
|
)) }) : null;
|
|
538
|
-
},
|
|
539
|
-
const { handleSubmit: t } =
|
|
540
|
-
return /* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
542
|
-
/* @__PURE__ */
|
|
538
|
+
}, ts = () => {
|
|
539
|
+
const { handleSubmit: t } = Fe(), s = Te();
|
|
540
|
+
return /* @__PURE__ */ i(he, { children: [
|
|
541
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Pe, {}) }),
|
|
542
|
+
/* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
543
|
+
/* @__PURE__ */ e(Le, {}),
|
|
544
|
+
/* @__PURE__ */ e(ss, {}),
|
|
543
545
|
/* @__PURE__ */ e(Ue, {}),
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */ e(Oe, {}),
|
|
546
|
-
/* @__PURE__ */ o("div", { className: "flex", children: [
|
|
546
|
+
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
547
547
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
548
|
-
|
|
548
|
+
Oe,
|
|
549
549
|
{
|
|
550
550
|
className: "w-full resize-none outline-none leading-6",
|
|
551
551
|
maxRows: 4
|
|
@@ -560,40 +560,37 @@ const es = (t) => ({
|
|
|
560
560
|
disabled: !s,
|
|
561
561
|
onClick: t,
|
|
562
562
|
type: "button",
|
|
563
|
-
children: /* @__PURE__ */ e(
|
|
563
|
+
children: /* @__PURE__ */ e(Ge, { className: "size-4" })
|
|
564
564
|
}
|
|
565
565
|
)
|
|
566
566
|
] })
|
|
567
567
|
] })
|
|
568
568
|
] });
|
|
569
|
-
},
|
|
569
|
+
}, ns = ({
|
|
570
570
|
renderActions: t
|
|
571
|
-
}) => /* @__PURE__ */
|
|
571
|
+
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
572
572
|
t && (t == null ? void 0 : t()),
|
|
573
|
-
/* @__PURE__ */ e(
|
|
574
|
-
] }),
|
|
573
|
+
/* @__PURE__ */ e(Me, { Input: ts })
|
|
574
|
+
] }), rs = (t) => {
|
|
575
575
|
const s = t.message.hide_date === !0;
|
|
576
|
-
return /* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
577
|
+
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
578
578
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
579
579
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
580
580
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
581
581
|
] }),
|
|
582
|
-
!s && /* @__PURE__ */ e(
|
|
582
|
+
!s && /* @__PURE__ */ e(je, { message: t.message })
|
|
583
583
|
] });
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
(g) => {
|
|
591
|
-
var v;
|
|
592
|
-
return ((v = g.user) == null ? void 0 : v.id) && g.user.id !== a._client.userID;
|
|
584
|
+
}, ls = () => null, os = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
|
|
585
|
+
var m, g, E, h, f;
|
|
586
|
+
const { channel: o } = fe(), a = Z.useMemo(() => Object.values(o.state.members || {}).find(
|
|
587
|
+
(b) => {
|
|
588
|
+
var w;
|
|
589
|
+
return ((w = b.user) == null ? void 0 : w.id) && b.user.id !== o._client.userID;
|
|
593
590
|
}
|
|
594
|
-
), [
|
|
595
|
-
return /* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
591
|
+
), [o._client.userID, o.state.members]), l = ((m = a == null ? void 0 : a.user) == null ? void 0 : m.name) || ((g = a == null ? void 0 : a.user) == null ? void 0 : g.id) || "Unknown member", c = (E = a == null ? void 0 : a.user) == null ? void 0 : E.image;
|
|
592
|
+
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
593
|
+
/* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
|
|
597
594
|
/* @__PURE__ */ e(
|
|
598
595
|
"button",
|
|
599
596
|
{
|
|
@@ -603,20 +600,20 @@ const es = (t) => ({
|
|
|
603
600
|
),
|
|
604
601
|
onClick: t || (() => {
|
|
605
602
|
}),
|
|
606
|
-
children: /* @__PURE__ */ e(
|
|
603
|
+
children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
|
|
607
604
|
}
|
|
608
605
|
),
|
|
609
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
610
607
|
/* @__PURE__ */ e(
|
|
611
608
|
q,
|
|
612
609
|
{
|
|
613
|
-
id: ((h =
|
|
614
|
-
name:
|
|
610
|
+
id: ((h = a == null ? void 0 : a.user) == null ? void 0 : h.id) || o.id || "unknown",
|
|
611
|
+
name: l,
|
|
615
612
|
image: c,
|
|
616
613
|
size: 40
|
|
617
614
|
}
|
|
618
615
|
),
|
|
619
|
-
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children:
|
|
616
|
+
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: l })
|
|
620
617
|
] }),
|
|
621
618
|
/* @__PURE__ */ e(
|
|
622
619
|
"button",
|
|
@@ -630,8 +627,8 @@ const es = (t) => ({
|
|
|
630
627
|
}
|
|
631
628
|
)
|
|
632
629
|
] }),
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
631
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
635
632
|
s && t && /* @__PURE__ */ e(
|
|
636
633
|
"button",
|
|
637
634
|
{
|
|
@@ -639,21 +636,21 @@ const es = (t) => ({
|
|
|
639
636
|
onClick: t,
|
|
640
637
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
641
638
|
"aria-label": "Back to conversations",
|
|
642
|
-
children: /* @__PURE__ */ e(
|
|
639
|
+
children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
|
|
643
640
|
}
|
|
644
641
|
),
|
|
645
642
|
/* @__PURE__ */ e(
|
|
646
643
|
q,
|
|
647
644
|
{
|
|
648
|
-
id: ((f =
|
|
649
|
-
name:
|
|
645
|
+
id: ((f = a == null ? void 0 : a.user) == null ? void 0 : f.id) || o.id || "unknown",
|
|
646
|
+
name: l,
|
|
650
647
|
image: c,
|
|
651
648
|
size: 40
|
|
652
649
|
}
|
|
653
650
|
),
|
|
654
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children:
|
|
651
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: l }) })
|
|
655
652
|
] }),
|
|
656
|
-
|
|
653
|
+
r && n && /* @__PURE__ */ e(
|
|
657
654
|
"button",
|
|
658
655
|
{
|
|
659
656
|
className: p(
|
|
@@ -665,22 +662,22 @@ const es = (t) => ({
|
|
|
665
662
|
)
|
|
666
663
|
] })
|
|
667
664
|
] });
|
|
668
|
-
},
|
|
665
|
+
}, as = ({
|
|
669
666
|
isOpen: t,
|
|
670
667
|
onClose: s,
|
|
671
668
|
participant: n,
|
|
672
|
-
channel:
|
|
673
|
-
followerStatusLabel:
|
|
674
|
-
onLeaveConversation:
|
|
675
|
-
onBlockParticipant:
|
|
669
|
+
channel: r,
|
|
670
|
+
followerStatusLabel: o,
|
|
671
|
+
onLeaveConversation: a,
|
|
672
|
+
onBlockParticipant: l
|
|
676
673
|
}) => {
|
|
677
674
|
var W, O, $, Y, H, V, J;
|
|
678
|
-
const { service: c, debug: m } = se(),
|
|
675
|
+
const { service: c, debug: m } = se(), g = z(null), [E, h] = v(!1), [f, k] = v(!1), [b, w] = v(!1);
|
|
679
676
|
G(() => {
|
|
680
|
-
const D =
|
|
677
|
+
const D = g.current;
|
|
681
678
|
D && (t ? D.showModal() : D.close());
|
|
682
679
|
}, [t]);
|
|
683
|
-
const
|
|
680
|
+
const y = F(async () => {
|
|
684
681
|
var D;
|
|
685
682
|
if (!(!c || !((D = n == null ? void 0 : n.user) != null && D.id)))
|
|
686
683
|
try {
|
|
@@ -699,43 +696,43 @@ const es = (t) => ({
|
|
|
699
696
|
}
|
|
700
697
|
}, [c, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
|
|
701
698
|
G(() => {
|
|
702
|
-
t &&
|
|
703
|
-
}, [t,
|
|
704
|
-
const
|
|
699
|
+
t && y();
|
|
700
|
+
}, [t, y]);
|
|
701
|
+
const N = async () => {
|
|
705
702
|
var D;
|
|
706
703
|
if (!f) {
|
|
707
|
-
m && console.log("[ChannelInfoDialog] Leave conversation",
|
|
704
|
+
m && console.log("[ChannelInfoDialog] Leave conversation", r.cid), k(!0);
|
|
708
705
|
try {
|
|
709
|
-
const T = ((D =
|
|
710
|
-
await
|
|
706
|
+
const T = ((D = r._client) == null ? void 0 : D.userID) ?? null;
|
|
707
|
+
await r.hide(T, !1), a && await a(r), s();
|
|
711
708
|
} catch (T) {
|
|
712
709
|
console.error("[ChannelInfoDialog] Failed to leave conversation", T);
|
|
713
710
|
} finally {
|
|
714
|
-
|
|
711
|
+
k(!1);
|
|
715
712
|
}
|
|
716
713
|
}
|
|
717
714
|
}, I = async () => {
|
|
718
715
|
var D, T, P;
|
|
719
|
-
if (!(
|
|
720
|
-
m && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id),
|
|
716
|
+
if (!(b || !c)) {
|
|
717
|
+
m && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), w(!0);
|
|
721
718
|
try {
|
|
722
|
-
await c.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id),
|
|
719
|
+
await c.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
|
|
723
720
|
} catch (L) {
|
|
724
721
|
console.error("[ChannelInfoDialog] Failed to block member", L);
|
|
725
722
|
} finally {
|
|
726
|
-
|
|
723
|
+
w(!1);
|
|
727
724
|
}
|
|
728
725
|
}
|
|
729
726
|
}, S = async () => {
|
|
730
727
|
var D, T, P;
|
|
731
|
-
if (!(
|
|
732
|
-
m && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id),
|
|
728
|
+
if (!(b || !c)) {
|
|
729
|
+
m && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), w(!0);
|
|
733
730
|
try {
|
|
734
|
-
await c.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id),
|
|
731
|
+
await c.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
|
|
735
732
|
} catch (L) {
|
|
736
733
|
console.error("[ChannelInfoDialog] Failed to unblock member", L);
|
|
737
734
|
} finally {
|
|
738
|
-
|
|
735
|
+
w(!1);
|
|
739
736
|
}
|
|
740
737
|
}
|
|
741
738
|
}, R = () => {
|
|
@@ -746,30 +743,30 @@ const es = (t) => ({
|
|
|
746
743
|
);
|
|
747
744
|
};
|
|
748
745
|
if (!n) return null;
|
|
749
|
-
const _ = ((O = n.user) == null ? void 0 : O.name) || (($ = n.user) == null ? void 0 : $.id) || "Unknown member", d = (Y = n.user) == null ? void 0 : Y.image, u = (H = n.user) == null ? void 0 : H.email,
|
|
746
|
+
const _ = ((O = n.user) == null ? void 0 : O.name) || (($ = n.user) == null ? void 0 : $.id) || "Unknown member", d = (Y = n.user) == null ? void 0 : Y.image, u = (H = n.user) == null ? void 0 : H.email, x = (V = n.user) == null ? void 0 : V.username, j = u || (x ? `linktr.ee/${x}` : void 0), A = ((J = n.user) == null ? void 0 : J.id) || "unknown";
|
|
750
747
|
return (
|
|
751
748
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
752
749
|
/* @__PURE__ */ e(
|
|
753
750
|
"dialog",
|
|
754
751
|
{
|
|
755
|
-
ref:
|
|
752
|
+
ref: g,
|
|
756
753
|
className: "mes-dialog group",
|
|
757
754
|
onClose: s,
|
|
758
755
|
onClick: (D) => {
|
|
759
|
-
D.target ===
|
|
756
|
+
D.target === g.current && s();
|
|
760
757
|
},
|
|
761
|
-
children: /* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
758
|
+
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: [
|
|
759
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
763
760
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
764
|
-
/* @__PURE__ */ e(
|
|
761
|
+
/* @__PURE__ */ e(Ce, { onClick: s })
|
|
765
762
|
] }),
|
|
766
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
767
764
|
/* @__PURE__ */ e(
|
|
768
765
|
"div",
|
|
769
766
|
{
|
|
770
767
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
771
768
|
style: { backgroundColor: "#FBFAF9" },
|
|
772
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
773
770
|
/* @__PURE__ */ e(
|
|
774
771
|
q,
|
|
775
772
|
{
|
|
@@ -780,65 +777,65 @@ const es = (t) => ({
|
|
|
780
777
|
shape: "circle"
|
|
781
778
|
}
|
|
782
779
|
),
|
|
783
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
784
781
|
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
|
|
785
782
|
j && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: j }),
|
|
786
|
-
|
|
783
|
+
o && /* @__PURE__ */ e(
|
|
787
784
|
"span",
|
|
788
785
|
{
|
|
789
786
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
790
787
|
style: {
|
|
791
788
|
padding: "4px 8px",
|
|
792
|
-
backgroundColor:
|
|
793
|
-
color:
|
|
789
|
+
backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
790
|
+
color: o === "Subscribed to you" ? "#008236" : "#78716C",
|
|
794
791
|
lineHeight: "133.333%",
|
|
795
792
|
letterSpacing: "0.21px"
|
|
796
793
|
},
|
|
797
|
-
children:
|
|
794
|
+
children: o
|
|
798
795
|
}
|
|
799
796
|
)
|
|
800
797
|
] })
|
|
801
798
|
] })
|
|
802
799
|
}
|
|
803
800
|
),
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
802
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
806
803
|
K,
|
|
807
804
|
{
|
|
808
|
-
onClick:
|
|
805
|
+
onClick: N,
|
|
809
806
|
disabled: f,
|
|
810
807
|
"aria-busy": f,
|
|
811
808
|
children: [
|
|
812
|
-
f ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
809
|
+
f ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(He, { className: "h-5 w-5" }),
|
|
813
810
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
814
811
|
]
|
|
815
812
|
}
|
|
816
813
|
) }),
|
|
817
|
-
/* @__PURE__ */ e("li", { children:
|
|
814
|
+
/* @__PURE__ */ e("li", { children: E ? /* @__PURE__ */ i(
|
|
818
815
|
K,
|
|
819
816
|
{
|
|
820
817
|
onClick: S,
|
|
821
|
-
disabled:
|
|
822
|
-
"aria-busy":
|
|
818
|
+
disabled: b,
|
|
819
|
+
"aria-busy": b,
|
|
823
820
|
children: [
|
|
824
|
-
|
|
821
|
+
b ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
|
|
825
822
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
826
823
|
]
|
|
827
824
|
}
|
|
828
|
-
) : /* @__PURE__ */
|
|
825
|
+
) : /* @__PURE__ */ i(
|
|
829
826
|
K,
|
|
830
827
|
{
|
|
831
828
|
onClick: I,
|
|
832
|
-
disabled:
|
|
833
|
-
"aria-busy":
|
|
829
|
+
disabled: b,
|
|
830
|
+
"aria-busy": b,
|
|
834
831
|
children: [
|
|
835
|
-
|
|
832
|
+
b ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ce, { className: "h-5 w-5" }),
|
|
836
833
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
837
834
|
]
|
|
838
835
|
}
|
|
839
836
|
) }),
|
|
840
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */ e(
|
|
837
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(K, { variant: "danger", onClick: R, children: [
|
|
838
|
+
/* @__PURE__ */ e($e, { className: "h-5 w-5" }),
|
|
842
839
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
843
840
|
] }) })
|
|
844
841
|
] })
|
|
@@ -851,62 +848,57 @@ const es = (t) => ({
|
|
|
851
848
|
onBack: t,
|
|
852
849
|
showBackButton: s,
|
|
853
850
|
renderMessageInputActions: n,
|
|
854
|
-
onLeaveConversation:
|
|
855
|
-
onBlockParticipant:
|
|
856
|
-
CustomChannelEmptyState: i = Ce
|
|
851
|
+
onLeaveConversation: r,
|
|
852
|
+
onBlockParticipant: o
|
|
857
853
|
}) => {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
return ((w = v.user) == null ? void 0 : w.id) && v.user.id !== r._client.userID;
|
|
854
|
+
const { channel: a } = fe(), [l, c] = v(!1), m = Z.useMemo(() => Object.values(a.state.members || {}).find(
|
|
855
|
+
(h) => {
|
|
856
|
+
var f;
|
|
857
|
+
return ((f = h.user) == null ? void 0 : f.id) && h.user.id !== a._client.userID;
|
|
863
858
|
}
|
|
864
|
-
), [
|
|
865
|
-
const
|
|
866
|
-
if (
|
|
867
|
-
return String(
|
|
868
|
-
if (
|
|
869
|
-
return
|
|
870
|
-
}, [
|
|
871
|
-
return /* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
859
|
+
), [a._client.userID, a.state.members]), g = Z.useMemo(() => {
|
|
860
|
+
const E = a.data ?? {};
|
|
861
|
+
if (E.followerStatus)
|
|
862
|
+
return String(E.followerStatus);
|
|
863
|
+
if (E.isFollower !== void 0)
|
|
864
|
+
return E.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
865
|
+
}, [a.data]);
|
|
866
|
+
return /* @__PURE__ */ i(he, { children: [
|
|
867
|
+
/* @__PURE__ */ i(Be, { children: [
|
|
873
868
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
874
|
-
|
|
869
|
+
os,
|
|
875
870
|
{
|
|
876
871
|
onBack: t,
|
|
877
872
|
showBackButton: s,
|
|
878
|
-
onShowInfo: () =>
|
|
879
|
-
canShowInfo: !!
|
|
873
|
+
onShowInfo: () => c(!0),
|
|
874
|
+
canShowInfo: !!m
|
|
875
|
+
}
|
|
876
|
+
) }),
|
|
877
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
878
|
+
ze,
|
|
879
|
+
{
|
|
880
|
+
hideDeletedMessages: !0,
|
|
881
|
+
hideNewMessageSeparator: !1,
|
|
882
|
+
messageActions: []
|
|
880
883
|
}
|
|
881
884
|
) }),
|
|
882
|
-
/* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
883
|
-
/* @__PURE__ */ e(
|
|
884
|
-
Ge,
|
|
885
|
-
{
|
|
886
|
-
hideDeletedMessages: !0,
|
|
887
|
-
hideNewMessageSeparator: !1,
|
|
888
|
-
messageActions: []
|
|
889
|
-
}
|
|
890
|
-
),
|
|
891
|
-
!x && i && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(i, {}) })
|
|
892
|
-
] }),
|
|
893
885
|
/* @__PURE__ */ e(
|
|
894
|
-
|
|
886
|
+
ns,
|
|
895
887
|
{
|
|
896
|
-
renderActions: () => n == null ? void 0 : n(
|
|
888
|
+
renderActions: () => n == null ? void 0 : n(a)
|
|
897
889
|
}
|
|
898
890
|
)
|
|
899
891
|
] }),
|
|
900
892
|
/* @__PURE__ */ e(
|
|
901
|
-
|
|
893
|
+
as,
|
|
902
894
|
{
|
|
903
|
-
isOpen:
|
|
904
|
-
onClose: () =>
|
|
905
|
-
participant:
|
|
906
|
-
channel:
|
|
907
|
-
followerStatusLabel:
|
|
908
|
-
onLeaveConversation:
|
|
909
|
-
onBlockParticipant:
|
|
895
|
+
isOpen: l,
|
|
896
|
+
onClose: () => c(!1),
|
|
897
|
+
participant: m,
|
|
898
|
+
channel: a,
|
|
899
|
+
followerStatusLabel: g,
|
|
900
|
+
onLeaveConversation: r,
|
|
901
|
+
onBlockParticipant: o
|
|
910
902
|
}
|
|
911
903
|
)
|
|
912
904
|
] });
|
|
@@ -914,29 +906,37 @@ const es = (t) => ({
|
|
|
914
906
|
channel: t,
|
|
915
907
|
onBack: s,
|
|
916
908
|
showBackButton: n = !1,
|
|
917
|
-
renderMessageInputActions:
|
|
918
|
-
onLeaveConversation:
|
|
919
|
-
onBlockParticipant:
|
|
920
|
-
className:
|
|
921
|
-
CustomChannelEmptyState: c =
|
|
909
|
+
renderMessageInputActions: r,
|
|
910
|
+
onLeaveConversation: o,
|
|
911
|
+
onBlockParticipant: a,
|
|
912
|
+
className: l,
|
|
913
|
+
CustomChannelEmptyState: c = ls
|
|
922
914
|
}) => /* @__PURE__ */ e(
|
|
923
915
|
"div",
|
|
924
916
|
{
|
|
925
917
|
className: p(
|
|
926
918
|
"messaging-channel-view h-full flex flex-col",
|
|
927
|
-
|
|
919
|
+
l
|
|
928
920
|
),
|
|
929
|
-
children: /* @__PURE__ */ e(
|
|
930
|
-
|
|
921
|
+
children: /* @__PURE__ */ e(
|
|
922
|
+
Ae,
|
|
931
923
|
{
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
924
|
+
channel: t,
|
|
925
|
+
MessageSystem: rs,
|
|
926
|
+
EmptyStateIndicator: c,
|
|
927
|
+
children: /* @__PURE__ */ e(
|
|
928
|
+
is,
|
|
929
|
+
{
|
|
930
|
+
onBack: s,
|
|
931
|
+
showBackButton: n,
|
|
932
|
+
renderMessageInputActions: r,
|
|
933
|
+
onLeaveConversation: o,
|
|
934
|
+
onBlockParticipant: a,
|
|
935
|
+
CustomChannelEmptyState: c
|
|
936
|
+
}
|
|
937
|
+
)
|
|
938
938
|
}
|
|
939
|
-
)
|
|
939
|
+
)
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
942
|
function ds({
|
|
@@ -944,10 +944,10 @@ function ds({
|
|
|
944
944
|
setSearchQuery: s,
|
|
945
945
|
placeholder: n
|
|
946
946
|
}) {
|
|
947
|
-
const
|
|
948
|
-
return /* @__PURE__ */
|
|
947
|
+
const r = z(null);
|
|
948
|
+
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
949
949
|
/* @__PURE__ */ e(
|
|
950
|
-
|
|
950
|
+
Ve,
|
|
951
951
|
{
|
|
952
952
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
953
953
|
weight: "bold"
|
|
@@ -956,11 +956,11 @@ function ds({
|
|
|
956
956
|
/* @__PURE__ */ e(
|
|
957
957
|
"input",
|
|
958
958
|
{
|
|
959
|
-
ref:
|
|
959
|
+
ref: r,
|
|
960
960
|
type: "text",
|
|
961
961
|
placeholder: n,
|
|
962
962
|
value: t,
|
|
963
|
-
onChange: (
|
|
963
|
+
onChange: (o) => s(o.target.value),
|
|
964
964
|
className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
|
|
965
965
|
}
|
|
966
966
|
),
|
|
@@ -969,8 +969,8 @@ function ds({
|
|
|
969
969
|
{
|
|
970
970
|
label: "Clear search",
|
|
971
971
|
onClick: () => {
|
|
972
|
-
var
|
|
973
|
-
s(""), (
|
|
972
|
+
var o;
|
|
973
|
+
s(""), (o = r.current) == null || o.focus();
|
|
974
974
|
},
|
|
975
975
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
976
976
|
children: /* @__PURE__ */ e(le, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -982,12 +982,12 @@ const us = ({
|
|
|
982
982
|
participantSource: t,
|
|
983
983
|
onSelectParticipant: s,
|
|
984
984
|
onClose: n,
|
|
985
|
-
existingParticipantIds:
|
|
986
|
-
participantLabel:
|
|
987
|
-
searchPlaceholder:
|
|
988
|
-
className:
|
|
985
|
+
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
986
|
+
participantLabel: o = "participants",
|
|
987
|
+
searchPlaceholder: a = "Search participants...",
|
|
988
|
+
className: l
|
|
989
989
|
}) => {
|
|
990
|
-
const { debug: c } = se(), [m,
|
|
990
|
+
const { debug: c } = se(), [m, g] = v(""), [E, h] = v([]), [f, k] = v(!1), [b, w] = v(null), [y, N] = v(
|
|
991
991
|
null
|
|
992
992
|
), I = z(!1);
|
|
993
993
|
G(() => {
|
|
@@ -999,7 +999,7 @@ const us = ({
|
|
|
999
999
|
}
|
|
1000
1000
|
if (I.current) return;
|
|
1001
1001
|
(async () => {
|
|
1002
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1002
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), k(!0), w(null);
|
|
1003
1003
|
try {
|
|
1004
1004
|
const u = await t.loadParticipants({
|
|
1005
1005
|
search: "",
|
|
@@ -1011,76 +1011,76 @@ const us = ({
|
|
|
1011
1011
|
u.participants.length
|
|
1012
1012
|
);
|
|
1013
1013
|
} catch (u) {
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1014
|
+
const x = u instanceof Error ? u.message : "Failed to load participants";
|
|
1015
|
+
w(x), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1016
1016
|
} finally {
|
|
1017
|
-
|
|
1017
|
+
k(!1);
|
|
1018
1018
|
}
|
|
1019
1019
|
})();
|
|
1020
1020
|
}, [t.loading, c]);
|
|
1021
|
-
const S =
|
|
1022
|
-
var
|
|
1021
|
+
const S = E.filter((d) => !r.has(d.id)).filter((d) => {
|
|
1022
|
+
var x;
|
|
1023
1023
|
if (!m) return !0;
|
|
1024
1024
|
const u = m.toLowerCase();
|
|
1025
|
-
return d.name.toLowerCase().includes(u) || ((
|
|
1025
|
+
return d.name.toLowerCase().includes(u) || ((x = d.email) == null ? void 0 : x.toLowerCase().includes(u)) || !1;
|
|
1026
1026
|
}), R = F(
|
|
1027
1027
|
async (d) => {
|
|
1028
|
-
if (!
|
|
1029
|
-
|
|
1028
|
+
if (!y) {
|
|
1029
|
+
N(d.id);
|
|
1030
1030
|
try {
|
|
1031
1031
|
await s(d);
|
|
1032
1032
|
} catch (u) {
|
|
1033
|
-
console.error("[ParticipantPicker] Failed to start chat:", u),
|
|
1033
|
+
console.error("[ParticipantPicker] Failed to start chat:", u), N(null);
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
1036
|
},
|
|
1037
|
-
[s,
|
|
1037
|
+
[s, y]
|
|
1038
1038
|
), _ = (d, u) => {
|
|
1039
1039
|
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), R(u));
|
|
1040
1040
|
};
|
|
1041
|
-
return /* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
/* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ i("div", { className: p("flex flex-col h-full", l), children: [
|
|
1042
|
+
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1043
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1044
1044
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1045
|
-
/* @__PURE__ */ e(
|
|
1045
|
+
/* @__PURE__ */ e(Ce, { onClick: n })
|
|
1046
1046
|
] }),
|
|
1047
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1048
1048
|
"Select a ",
|
|
1049
|
-
|
|
1049
|
+
o.slice(0, -1),
|
|
1050
1050
|
" to start messaging (",
|
|
1051
1051
|
S.length,
|
|
1052
1052
|
" available)",
|
|
1053
|
-
t.totalCount !== void 0 && ` โข ${t.totalCount} ${
|
|
1053
|
+
t.totalCount !== void 0 && ` โข ${t.totalCount} ${o} total`
|
|
1054
1054
|
] }),
|
|
1055
1055
|
/* @__PURE__ */ e(
|
|
1056
1056
|
ds,
|
|
1057
1057
|
{
|
|
1058
1058
|
searchQuery: m,
|
|
1059
|
-
setSearchQuery:
|
|
1060
|
-
placeholder:
|
|
1059
|
+
setSearchQuery: g,
|
|
1060
|
+
placeholder: a
|
|
1061
1061
|
}
|
|
1062
1062
|
)
|
|
1063
1063
|
] }),
|
|
1064
|
-
|
|
1064
|
+
b && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1065
1065
|
"Error loading ",
|
|
1066
|
-
|
|
1066
|
+
o,
|
|
1067
1067
|
": ",
|
|
1068
|
-
|
|
1068
|
+
b
|
|
1069
1069
|
] }),
|
|
1070
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && S.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: [
|
|
1071
1071
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1072
|
-
/* @__PURE__ */
|
|
1072
|
+
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1073
1073
|
"Loading ",
|
|
1074
|
-
|
|
1074
|
+
o,
|
|
1075
1075
|
"..."
|
|
1076
1076
|
] })
|
|
1077
|
-
] }) }) : S.length === 0 ? /* @__PURE__ */
|
|
1077
|
+
] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1078
1078
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(de, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1079
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: m ? `No ${
|
|
1080
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: m ? "Try a different search term" :
|
|
1081
|
-
] }) : /* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: m ? `No ${o} found` : E.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
|
|
1080
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: m ? "Try a different search term" : E.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
|
|
1081
|
+
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1082
1082
|
S.map((d) => {
|
|
1083
|
-
const u = d.name || d.email || d.id,
|
|
1083
|
+
const u = d.name || d.email || d.id, x = d.email && d.name ? d.email : d.phone;
|
|
1084
1084
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1085
1085
|
"button",
|
|
1086
1086
|
{
|
|
@@ -1088,8 +1088,8 @@ const us = ({
|
|
|
1088
1088
|
onClick: () => R(d),
|
|
1089
1089
|
onKeyDown: (j) => _(j, d),
|
|
1090
1090
|
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",
|
|
1091
|
-
children: /* @__PURE__ */
|
|
1092
|
-
/* @__PURE__ */
|
|
1091
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1092
|
+
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1093
1093
|
/* @__PURE__ */ e(
|
|
1094
1094
|
q,
|
|
1095
1095
|
{
|
|
@@ -1099,23 +1099,23 @@ const us = ({
|
|
|
1099
1099
|
size: 40
|
|
1100
1100
|
}
|
|
1101
1101
|
),
|
|
1102
|
-
/* @__PURE__ */
|
|
1102
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1103
1103
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
|
|
1104
|
-
|
|
1104
|
+
x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
|
|
1105
1105
|
] })
|
|
1106
1106
|
] }),
|
|
1107
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1107
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === d.id ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone" }) })
|
|
1108
1108
|
] })
|
|
1109
1109
|
}
|
|
1110
1110
|
) }, d.id);
|
|
1111
1111
|
}),
|
|
1112
|
-
f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */
|
|
1112
|
+
f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1113
1113
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1114
1114
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1115
1115
|
] }) })
|
|
1116
1116
|
] }) })
|
|
1117
1117
|
] });
|
|
1118
|
-
}, ms = ({ className: t }) => /* @__PURE__ */
|
|
1118
|
+
}, ms = ({ className: t }) => /* @__PURE__ */ i(
|
|
1119
1119
|
"svg",
|
|
1120
1120
|
{
|
|
1121
1121
|
width: "140",
|
|
@@ -1125,7 +1125,7 @@ const us = ({
|
|
|
1125
1125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1126
1126
|
className: t,
|
|
1127
1127
|
children: [
|
|
1128
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1129
1129
|
/* @__PURE__ */ e(
|
|
1130
1130
|
"path",
|
|
1131
1131
|
{
|
|
@@ -1154,7 +1154,7 @@ const us = ({
|
|
|
1154
1154
|
fill: "white"
|
|
1155
1155
|
}
|
|
1156
1156
|
),
|
|
1157
|
-
/* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1158
1158
|
/* @__PURE__ */ e(
|
|
1159
1159
|
"path",
|
|
1160
1160
|
{
|
|
@@ -1194,8 +1194,8 @@ const us = ({
|
|
|
1194
1194
|
}
|
|
1195
1195
|
)
|
|
1196
1196
|
] }),
|
|
1197
|
-
/* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ i("defs", { children: [
|
|
1198
|
+
/* @__PURE__ */ i(
|
|
1199
1199
|
"filter",
|
|
1200
1200
|
{
|
|
1201
1201
|
id: "filter0_empty_state",
|
|
@@ -1249,13 +1249,13 @@ const us = ({
|
|
|
1249
1249
|
] })
|
|
1250
1250
|
]
|
|
1251
1251
|
}
|
|
1252
|
-
), hs = ({ hasChannels: t }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */
|
|
1252
|
+
), hs = ({ hasChannels: t }) => /* @__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: [
|
|
1253
1253
|
/* @__PURE__ */ e(ms, {}),
|
|
1254
|
-
!t && /* @__PURE__ */
|
|
1254
|
+
!t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1255
1255
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1256
1256
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1257
1257
|
] })
|
|
1258
|
-
] }) }), re = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */
|
|
1258
|
+
] }) }), re = ({ 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: [
|
|
1259
1259
|
/* @__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: "โ ๏ธ" }) }),
|
|
1260
1260
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1261
1261
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1268,12 +1268,12 @@ const us = ({
|
|
|
1268
1268
|
children: "Go Back"
|
|
1269
1269
|
}
|
|
1270
1270
|
)
|
|
1271
|
-
] }) }), fs = ({ className: t, message: s }) => /* @__PURE__ */
|
|
1271
|
+
] }) }), fs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1272
1272
|
"div",
|
|
1273
1273
|
{
|
|
1274
1274
|
className: p("flex items-center justify-center h-full", t),
|
|
1275
1275
|
children: [
|
|
1276
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1277
1277
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1278
1278
|
"animateTransform",
|
|
1279
1279
|
{
|
|
@@ -1311,31 +1311,31 @@ const us = ({
|
|
|
1311
1311
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1312
1312
|
]
|
|
1313
1313
|
}
|
|
1314
|
-
), gs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */
|
|
1314
|
+
), gs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1315
1315
|
/* @__PURE__ */ e(fs, { className: "w-6 h-6" }),
|
|
1316
1316
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1317
1317
|
] }) }), Ss = ({
|
|
1318
1318
|
capabilities: t = {},
|
|
1319
1319
|
className: s,
|
|
1320
1320
|
renderMessageInputActions: n,
|
|
1321
|
-
onChannelSelect:
|
|
1322
|
-
onParticipantSelect:
|
|
1323
|
-
initialParticipantFilter:
|
|
1324
|
-
initialParticipantData:
|
|
1321
|
+
onChannelSelect: r,
|
|
1322
|
+
onParticipantSelect: o,
|
|
1323
|
+
initialParticipantFilter: a,
|
|
1324
|
+
initialParticipantData: l,
|
|
1325
1325
|
CustomChannelEmptyState: c,
|
|
1326
1326
|
showChannelList: m = !0,
|
|
1327
|
-
filters:
|
|
1328
|
-
channelListCustomEmptyStateIndicator:
|
|
1327
|
+
filters: g,
|
|
1328
|
+
channelListCustomEmptyStateIndicator: E
|
|
1329
1329
|
}) => {
|
|
1330
1330
|
const {
|
|
1331
1331
|
service: h,
|
|
1332
1332
|
client: f,
|
|
1333
|
-
isConnected:
|
|
1334
|
-
isLoading:
|
|
1335
|
-
error:
|
|
1336
|
-
refreshConnection:
|
|
1337
|
-
debug:
|
|
1338
|
-
} =
|
|
1333
|
+
isConnected: k,
|
|
1334
|
+
isLoading: b,
|
|
1335
|
+
error: w,
|
|
1336
|
+
refreshConnection: y,
|
|
1337
|
+
debug: N
|
|
1338
|
+
} = We(), [I, S] = v(null), [R, _] = v(!1), [d, u] = v(!1), [x, j] = v(/* @__PURE__ */ new Set()), [A, W] = v(0), [O, $] = v(!1), [Y, H] = v(null), V = z(null), { participantSource: J, participantLabel: D = "participants" } = t, T = Z.useMemo(() => {
|
|
1339
1339
|
const C = f == null ? void 0 : f.userID;
|
|
1340
1340
|
return {
|
|
1341
1341
|
...{
|
|
@@ -1346,14 +1346,14 @@ const us = ({
|
|
|
1346
1346
|
hidden: !1
|
|
1347
1347
|
}
|
|
1348
1348
|
},
|
|
1349
|
-
...
|
|
1349
|
+
...g
|
|
1350
1350
|
};
|
|
1351
|
-
}, [
|
|
1352
|
-
if (!f || !
|
|
1351
|
+
}, [g, f == null ? void 0 : f.userID]), P = z(null), L = F(async () => {
|
|
1352
|
+
if (!f || !k) return;
|
|
1353
1353
|
const C = f.userID;
|
|
1354
1354
|
if (C)
|
|
1355
1355
|
try {
|
|
1356
|
-
|
|
1356
|
+
N && console.log("[MessagingShell] Syncing channels for user:", C);
|
|
1357
1357
|
const U = await f.queryChannels(
|
|
1358
1358
|
{
|
|
1359
1359
|
type: "messaging",
|
|
@@ -1363,60 +1363,60 @@ const us = ({
|
|
|
1363
1363
|
{ limit: 100 }
|
|
1364
1364
|
), M = /* @__PURE__ */ new Set();
|
|
1365
1365
|
U.forEach((B) => {
|
|
1366
|
-
const
|
|
1367
|
-
Object.values(
|
|
1368
|
-
var
|
|
1369
|
-
const ne = (
|
|
1366
|
+
const Ee = B.state.members;
|
|
1367
|
+
Object.values(Ee).forEach((ye) => {
|
|
1368
|
+
var oe;
|
|
1369
|
+
const ne = (oe = ye.user) == null ? void 0 : oe.id;
|
|
1370
1370
|
ne && ne !== C && M.add(ne);
|
|
1371
1371
|
});
|
|
1372
|
-
}), j(M), _(U.length > 0), P.current = C,
|
|
1372
|
+
}), j(M), _(U.length > 0), P.current = C, N && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1373
1373
|
channelCount: U.length,
|
|
1374
1374
|
memberCount: M.size
|
|
1375
1375
|
});
|
|
1376
1376
|
} catch (U) {
|
|
1377
1377
|
console.error("[MessagingShell] Failed to sync channels:", U);
|
|
1378
1378
|
}
|
|
1379
|
-
}, [f,
|
|
1379
|
+
}, [f, k, N]);
|
|
1380
1380
|
G(() => {
|
|
1381
|
-
if (!f || !
|
|
1381
|
+
if (!f || !k) return;
|
|
1382
1382
|
const C = f.userID;
|
|
1383
1383
|
C && P.current !== C && L();
|
|
1384
|
-
}, [f,
|
|
1385
|
-
if (!
|
|
1384
|
+
}, [f, k, L]), G(() => {
|
|
1385
|
+
if (!a || !f || !k) return;
|
|
1386
1386
|
(async () => {
|
|
1387
1387
|
const U = f.userID;
|
|
1388
1388
|
if (U)
|
|
1389
1389
|
try {
|
|
1390
|
-
|
|
1390
|
+
N && console.log(
|
|
1391
1391
|
"[MessagingShell] Loading initial conversation with:",
|
|
1392
|
-
|
|
1392
|
+
a
|
|
1393
1393
|
);
|
|
1394
1394
|
const M = await f.queryChannels(
|
|
1395
1395
|
{
|
|
1396
1396
|
type: "messaging",
|
|
1397
|
-
members: { $eq: [U,
|
|
1397
|
+
members: { $eq: [U, a] }
|
|
1398
1398
|
},
|
|
1399
1399
|
{},
|
|
1400
1400
|
{ limit: 1 }
|
|
1401
1401
|
);
|
|
1402
1402
|
if (M.length > 0)
|
|
1403
|
-
S(M[0]), $(!0), H(null),
|
|
1403
|
+
S(M[0]), $(!0), H(null), r && r(M[0]), N && console.log(
|
|
1404
1404
|
"[MessagingShell] Initial conversation loaded:",
|
|
1405
1405
|
M[0].id
|
|
1406
1406
|
);
|
|
1407
|
-
else if (
|
|
1408
|
-
|
|
1407
|
+
else if (l && h) {
|
|
1408
|
+
N && console.log(
|
|
1409
1409
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1410
|
-
|
|
1410
|
+
l
|
|
1411
1411
|
);
|
|
1412
1412
|
try {
|
|
1413
1413
|
const B = await h.startChannelWithParticipant({
|
|
1414
|
-
id:
|
|
1415
|
-
name:
|
|
1416
|
-
email:
|
|
1417
|
-
phone:
|
|
1414
|
+
id: l.id,
|
|
1415
|
+
name: l.name,
|
|
1416
|
+
email: l.email,
|
|
1417
|
+
phone: l.phone
|
|
1418
1418
|
});
|
|
1419
|
-
S(B), $(!0), H(null),
|
|
1419
|
+
S(B), $(!0), H(null), r && r(B), N && console.log(
|
|
1420
1420
|
"[MessagingShell] Channel created and loaded:",
|
|
1421
1421
|
B.id
|
|
1422
1422
|
);
|
|
@@ -1429,9 +1429,9 @@ const us = ({
|
|
|
1429
1429
|
} else
|
|
1430
1430
|
H(
|
|
1431
1431
|
"No conversation found with this account"
|
|
1432
|
-
),
|
|
1432
|
+
), N && console.log(
|
|
1433
1433
|
"[MessagingShell] No conversation found for:",
|
|
1434
|
-
|
|
1434
|
+
a
|
|
1435
1435
|
);
|
|
1436
1436
|
} catch (M) {
|
|
1437
1437
|
console.error(
|
|
@@ -1441,27 +1441,27 @@ const us = ({
|
|
|
1441
1441
|
}
|
|
1442
1442
|
})();
|
|
1443
1443
|
}, [
|
|
1444
|
-
|
|
1445
|
-
|
|
1444
|
+
a,
|
|
1445
|
+
l,
|
|
1446
1446
|
f,
|
|
1447
|
-
|
|
1447
|
+
k,
|
|
1448
1448
|
h,
|
|
1449
|
-
|
|
1450
|
-
|
|
1449
|
+
N,
|
|
1450
|
+
r
|
|
1451
1451
|
]);
|
|
1452
1452
|
const Q = F(
|
|
1453
1453
|
(C) => {
|
|
1454
|
-
S(C),
|
|
1454
|
+
S(C), r == null || r(C);
|
|
1455
1455
|
},
|
|
1456
|
-
[
|
|
1457
|
-
),
|
|
1456
|
+
[r]
|
|
1457
|
+
), Ne = F(() => {
|
|
1458
1458
|
O || S(null);
|
|
1459
|
-
}, [O]),
|
|
1459
|
+
}, [O]), be = F(
|
|
1460
1460
|
async (C) => {
|
|
1461
1461
|
var U;
|
|
1462
1462
|
if (h)
|
|
1463
1463
|
try {
|
|
1464
|
-
|
|
1464
|
+
N && console.log(
|
|
1465
1465
|
"[MessagingShell] Starting conversation with:",
|
|
1466
1466
|
C.id
|
|
1467
1467
|
);
|
|
@@ -1476,33 +1476,33 @@ const us = ({
|
|
|
1476
1476
|
} catch (B) {
|
|
1477
1477
|
console.warn("[MessagingShell] Failed to unhide channel:", B);
|
|
1478
1478
|
}
|
|
1479
|
-
S(M), u(!1), (U = V.current) == null || U.close(),
|
|
1479
|
+
S(M), u(!1), (U = V.current) == null || U.close(), o == null || o(C);
|
|
1480
1480
|
} catch (M) {
|
|
1481
1481
|
console.error("[MessagingShell] Failed to start conversation:", M);
|
|
1482
1482
|
}
|
|
1483
1483
|
},
|
|
1484
|
-
[h,
|
|
1484
|
+
[h, o, N]
|
|
1485
1485
|
), te = F(() => {
|
|
1486
1486
|
var C;
|
|
1487
1487
|
u(!1), (C = V.current) == null || C.close();
|
|
1488
|
-
}, []),
|
|
1488
|
+
}, []), ve = F(
|
|
1489
1489
|
async (C) => {
|
|
1490
|
-
|
|
1490
|
+
N && console.log("[MessagingShell] Leaving conversation:", C.id), S(null), $(!1), P.current = null, await L();
|
|
1491
1491
|
},
|
|
1492
|
-
[L,
|
|
1493
|
-
),
|
|
1492
|
+
[L, N]
|
|
1493
|
+
), we = F(
|
|
1494
1494
|
async (C) => {
|
|
1495
|
-
|
|
1495
|
+
N && console.log("[MessagingShell] Blocking participant:", C), S(null), $(!1), P.current = null, await L();
|
|
1496
1496
|
},
|
|
1497
|
-
[L,
|
|
1497
|
+
[L, N]
|
|
1498
1498
|
), X = !!I;
|
|
1499
|
-
return
|
|
1499
|
+
return b ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(gs, {}) }) : w ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: w, onBack: y }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
|
|
1500
1500
|
re,
|
|
1501
1501
|
{
|
|
1502
1502
|
message: "Not connected to messaging service",
|
|
1503
|
-
onBack:
|
|
1503
|
+
onBack: y
|
|
1504
1504
|
}
|
|
1505
|
-
) }) : Y ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: Y }) }) : /* @__PURE__ */
|
|
1505
|
+
) }) : Y ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: Y }) }) : /* @__PURE__ */ i(
|
|
1506
1506
|
"div",
|
|
1507
1507
|
{
|
|
1508
1508
|
className: p(
|
|
@@ -1510,7 +1510,7 @@ const us = ({
|
|
|
1510
1510
|
s
|
|
1511
1511
|
),
|
|
1512
1512
|
children: [
|
|
1513
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
1514
1514
|
/* @__PURE__ */ e(
|
|
1515
1515
|
"div",
|
|
1516
1516
|
{
|
|
@@ -1526,12 +1526,12 @@ const us = ({
|
|
|
1526
1526
|
}
|
|
1527
1527
|
),
|
|
1528
1528
|
children: /* @__PURE__ */ e(
|
|
1529
|
-
|
|
1529
|
+
Xe,
|
|
1530
1530
|
{
|
|
1531
1531
|
onChannelSelect: Q,
|
|
1532
1532
|
selectedChannel: I || void 0,
|
|
1533
1533
|
filters: T,
|
|
1534
|
-
customEmptyStateIndicator:
|
|
1534
|
+
customEmptyStateIndicator: E
|
|
1535
1535
|
}
|
|
1536
1536
|
)
|
|
1537
1537
|
}
|
|
@@ -1552,11 +1552,11 @@ const us = ({
|
|
|
1552
1552
|
cs,
|
|
1553
1553
|
{
|
|
1554
1554
|
channel: I,
|
|
1555
|
-
onBack:
|
|
1555
|
+
onBack: Ne,
|
|
1556
1556
|
showBackButton: !O,
|
|
1557
1557
|
renderMessageInputActions: n,
|
|
1558
|
-
onLeaveConversation:
|
|
1559
|
-
onBlockParticipant:
|
|
1558
|
+
onLeaveConversation: ve,
|
|
1559
|
+
onBlockParticipant: we,
|
|
1560
1560
|
CustomChannelEmptyState: c
|
|
1561
1561
|
},
|
|
1562
1562
|
I.id
|
|
@@ -1578,9 +1578,9 @@ const us = ({
|
|
|
1578
1578
|
us,
|
|
1579
1579
|
{
|
|
1580
1580
|
participantSource: J,
|
|
1581
|
-
onSelectParticipant:
|
|
1581
|
+
onSelectParticipant: be,
|
|
1582
1582
|
onClose: te,
|
|
1583
|
-
existingParticipantIds:
|
|
1583
|
+
existingParticipantIds: x,
|
|
1584
1584
|
participantLabel: D,
|
|
1585
1585
|
searchPlaceholder: `Search ${D}...`
|
|
1586
1586
|
},
|
|
@@ -1595,7 +1595,7 @@ const us = ({
|
|
|
1595
1595
|
question: t,
|
|
1596
1596
|
onClick: s,
|
|
1597
1597
|
loading: n = !1,
|
|
1598
|
-
className:
|
|
1598
|
+
className: r
|
|
1599
1599
|
}) => /* @__PURE__ */ e(
|
|
1600
1600
|
"button",
|
|
1601
1601
|
{
|
|
@@ -1609,7 +1609,7 @@ const us = ({
|
|
|
1609
1609
|
"hover:brightness-95 active:brightness-90": !n,
|
|
1610
1610
|
"opacity-50 cursor-not-allowed": n
|
|
1611
1611
|
},
|
|
1612
|
-
|
|
1612
|
+
r
|
|
1613
1613
|
),
|
|
1614
1614
|
children: t
|
|
1615
1615
|
}
|
|
@@ -1617,30 +1617,30 @@ const us = ({
|
|
|
1617
1617
|
faqs: t,
|
|
1618
1618
|
onFaqClick: s,
|
|
1619
1619
|
loadingFaqId: n,
|
|
1620
|
-
headerText:
|
|
1621
|
-
className:
|
|
1622
|
-
avatarImage:
|
|
1623
|
-
avatarName:
|
|
1620
|
+
headerText: r,
|
|
1621
|
+
className: o,
|
|
1622
|
+
avatarImage: a,
|
|
1623
|
+
avatarName: l
|
|
1624
1624
|
}) => {
|
|
1625
|
-
const c = t.filter((m) => m.enabled).sort((m,
|
|
1626
|
-
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className:
|
|
1627
|
-
(
|
|
1625
|
+
const c = t.filter((m) => m.enabled).sort((m, g) => (m.order ?? 0) - (g.order ?? 0));
|
|
1626
|
+
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
1627
|
+
(a || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
1628
1628
|
q,
|
|
1629
1629
|
{
|
|
1630
|
-
id:
|
|
1631
|
-
name:
|
|
1632
|
-
image:
|
|
1630
|
+
id: l || "account",
|
|
1631
|
+
name: l || "Account",
|
|
1632
|
+
image: a,
|
|
1633
1633
|
size: 24,
|
|
1634
1634
|
shape: "circle"
|
|
1635
1635
|
}
|
|
1636
1636
|
) }),
|
|
1637
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ i(
|
|
1638
1638
|
"div",
|
|
1639
1639
|
{
|
|
1640
1640
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
1641
1641
|
style: { backgroundColor: "#F1F0EE" },
|
|
1642
1642
|
children: [
|
|
1643
|
-
|
|
1643
|
+
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
1644
1644
|
c.map((m) => /* @__PURE__ */ e(
|
|
1645
1645
|
xs,
|
|
1646
1646
|
{
|
|
@@ -1655,58 +1655,58 @@ const us = ({
|
|
|
1655
1655
|
)
|
|
1656
1656
|
] }) });
|
|
1657
1657
|
}, ps = (t, s = {}) => {
|
|
1658
|
-
const { initialSearch: n = "", pageSize:
|
|
1659
|
-
if (
|
|
1660
|
-
const d = _ !== void 0 ? _ :
|
|
1661
|
-
c(!0),
|
|
1658
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [o, a] = v([]), [l, c] = v(!1), [m, g] = v(null), [E, h] = v(n), [f, k] = v(!0), [b, w] = v(), y = F(async (R = !1, _) => {
|
|
1659
|
+
if (l) return;
|
|
1660
|
+
const d = _ !== void 0 ? _ : E;
|
|
1661
|
+
c(!0), g(null);
|
|
1662
1662
|
try {
|
|
1663
1663
|
const u = await t.loadParticipants({
|
|
1664
1664
|
search: d || void 0,
|
|
1665
|
-
limit:
|
|
1666
|
-
cursor: R ? void 0 :
|
|
1665
|
+
limit: r,
|
|
1666
|
+
cursor: R ? void 0 : b
|
|
1667
1667
|
});
|
|
1668
|
-
|
|
1669
|
-
(
|
|
1670
|
-
),
|
|
1668
|
+
a(
|
|
1669
|
+
(x) => R ? u.participants : [...x, ...u.participants]
|
|
1670
|
+
), k(u.hasMore), w(u.nextCursor);
|
|
1671
1671
|
} catch (u) {
|
|
1672
|
-
const
|
|
1673
|
-
x
|
|
1672
|
+
const x = u instanceof Error ? u.message : "Failed to load participants";
|
|
1673
|
+
g(x), console.error("[useParticipants] Load error:", u);
|
|
1674
1674
|
} finally {
|
|
1675
1675
|
c(!1);
|
|
1676
1676
|
}
|
|
1677
|
-
}, [t,
|
|
1678
|
-
f && !
|
|
1679
|
-
}, [f,
|
|
1680
|
-
h(R),
|
|
1681
|
-
}, [
|
|
1682
|
-
|
|
1683
|
-
}, [
|
|
1677
|
+
}, [t, E, b, r, l]), N = F(() => {
|
|
1678
|
+
f && !l && y(!1);
|
|
1679
|
+
}, [f, l, y]), I = F((R) => {
|
|
1680
|
+
h(R), w(void 0), y(!0, R);
|
|
1681
|
+
}, [y]), S = F(() => {
|
|
1682
|
+
w(void 0), y(!0);
|
|
1683
|
+
}, [y]);
|
|
1684
1684
|
return G(() => {
|
|
1685
|
-
|
|
1685
|
+
y(!0);
|
|
1686
1686
|
}, [t.loadParticipants]), {
|
|
1687
|
-
participants:
|
|
1688
|
-
loading:
|
|
1687
|
+
participants: o,
|
|
1688
|
+
loading: l,
|
|
1689
1689
|
error: m,
|
|
1690
|
-
searchQuery:
|
|
1690
|
+
searchQuery: E,
|
|
1691
1691
|
hasMore: f,
|
|
1692
1692
|
totalCount: t.totalCount,
|
|
1693
|
-
loadMore:
|
|
1693
|
+
loadMore: N,
|
|
1694
1694
|
search: I,
|
|
1695
1695
|
refresh: S
|
|
1696
1696
|
};
|
|
1697
1697
|
};
|
|
1698
1698
|
export {
|
|
1699
1699
|
q as Avatar,
|
|
1700
|
-
|
|
1701
|
-
|
|
1700
|
+
ls as ChannelEmptyState,
|
|
1701
|
+
Xe as ChannelList,
|
|
1702
1702
|
cs as ChannelView,
|
|
1703
1703
|
ks as FaqList,
|
|
1704
1704
|
xs as FaqListItem,
|
|
1705
1705
|
Is as MessagingProvider,
|
|
1706
1706
|
Ss as MessagingShell,
|
|
1707
1707
|
us as ParticipantPicker,
|
|
1708
|
-
|
|
1709
|
-
|
|
1708
|
+
qe as formatRelativeTime,
|
|
1709
|
+
We as useMessaging,
|
|
1710
1710
|
ps as useParticipants
|
|
1711
1711
|
};
|
|
1712
1712
|
//# sourceMappingURL=index.js.map
|