@linktr.ee/messaging-react 1.21.2 → 1.22.0-rc-1771558667
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/assets/index.css +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +817 -767
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CustomSystemMessage/CustomSystemMessage.stories.tsx +56 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.test.tsx +96 -0
- package/src/components/CustomSystemMessage/index.tsx +69 -1
- package/src/stream-custom-data.ts +16 -1
- package/src/styles.css +41 -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
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
2
|
+
import D from "classnames";
|
|
3
|
+
import B, { createContext as es, useContext as ss, useCallback as L, useState as I, useRef as Y, useEffect as q, useMemo as be } from "react";
|
|
4
|
+
import { StreamChatService as ts } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as ns, ChannelList as rs, DateSeparator as as, useChannelStateContext as we, useChatContext as Ue, areMessageUIPropsEqual as ls, useMessageReminder as os, useComponentContext as is, Attachment as cs, EditMessageModal as ds, MessageBlocked as us, MessageBouncePrompt as ms, MessageDeleted as hs, MessageIsThreadReplyInChannelButtonIndicator as fs, MessageRepliesCountButton as gs, ReminderNotification as xs, StreamedMessageText as bs, messageHasAttachments as Ns, messageHasReactions as Cs, isDateSeparatorMessage as vs, isMessageBlocked as ws, isMessageBounced as ys, MessageBounceModal as ps, Poll as Es, MessageText as _s, MessageErrorIcon as Is, useMessageContext as Ss, useMessageComposer as Ms, useStateStore as ks, MessageInput as Ds, useMessageInputContext as Ts, useMessageComposerHasSendableData as Rs, SimpleAttachmentSelector as Fs, QuotedMessagePreview as Ls, AttachmentPreviewList as Ps, TextareaComposer as Us, MessageTimestamp as Ie, Channel as Os, WithComponents as As, Window as Bs, MessageList as js } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as $s, XIcon as ye, ArrowUpIcon as zs, Sparkle as Gs, X as Hs, ArrowLeftIcon as Se, StarIcon as Me, DotsThreeIcon as ke, SpinnerGapIcon as ue, SignOutIcon as Vs, ProhibitInsetIcon as De, FlagIcon as Ws, MagnifyingGlassIcon as Ys, ChatCircleDotsIcon as Te } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as Re } from "stream-chat";
|
|
8
|
+
const Oe = es({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,229 +15,229 @@ const Pe = Xe({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), fe = () =>
|
|
19
|
-
children:
|
|
20
|
-
user:
|
|
18
|
+
}), fe = () => ss(Oe), Ot = ({
|
|
19
|
+
children: s,
|
|
20
|
+
user: t,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
23
|
-
capabilities:
|
|
22
|
+
apiKey: r,
|
|
23
|
+
capabilities: o = {},
|
|
24
24
|
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
26
|
+
const l = L(
|
|
27
27
|
(c, ...x) => {
|
|
28
28
|
d && console.log(`🔥 [MessagingProvider] ${c}`, ...x);
|
|
29
29
|
},
|
|
30
30
|
[d]
|
|
31
31
|
);
|
|
32
|
-
|
|
33
|
-
userId:
|
|
34
|
-
apiKey: (
|
|
32
|
+
l("🔄 RENDER START", {
|
|
33
|
+
userId: t == null ? void 0 : t.id,
|
|
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 [u, f] =
|
|
39
|
-
userId:
|
|
40
|
-
apiKey:
|
|
38
|
+
const [u, f] = I(null), [g, C] = I(null), [N, y] = I(!1), [a, E] = I(!1), [S, v] = I(null), k = Y(!1), b = Y({
|
|
39
|
+
userId: t == null ? void 0 : t.id,
|
|
40
|
+
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
|
-
capabilities:
|
|
43
|
-
}), m =
|
|
44
|
-
m.current++,
|
|
42
|
+
capabilities: o
|
|
43
|
+
}), m = Y(0);
|
|
44
|
+
m.current++, l("📊 RENDER INFO", {
|
|
45
45
|
renderCount: m.current,
|
|
46
|
-
currentProps: { userId:
|
|
46
|
+
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged: b.current.userId !== (
|
|
49
|
-
apiKeyChanged: b.current.apiKey !==
|
|
48
|
+
userChanged: b.current.userId !== (t == null ? void 0 : t.id),
|
|
49
|
+
apiKeyChanged: b.current.apiKey !== r,
|
|
50
50
|
serviceConfigChanged: b.current.serviceConfig !== n,
|
|
51
|
-
capabilitiesChanged: b.current.capabilities !==
|
|
51
|
+
capabilitiesChanged: b.current.capabilities !== o
|
|
52
52
|
}
|
|
53
53
|
}), b.current = {
|
|
54
|
-
userId:
|
|
55
|
-
apiKey:
|
|
54
|
+
userId: t == null ? void 0 : t.id,
|
|
55
|
+
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
|
-
capabilities:
|
|
58
|
-
},
|
|
57
|
+
capabilities: o
|
|
58
|
+
}, q(() => {
|
|
59
59
|
const c = m.current;
|
|
60
|
-
if (
|
|
60
|
+
if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: c,
|
|
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: b.current.serviceConfig === n,
|
|
68
|
-
apiKeyStable: b.current.apiKey ===
|
|
68
|
+
apiKeyStable: b.current.apiKey === r
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
71
|
-
|
|
70
|
+
}), !r || !n) {
|
|
71
|
+
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: c,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
l("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: c,
|
|
79
|
-
apiKey: (
|
|
79
|
+
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: b.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const x = new
|
|
82
|
+
const x = new ts({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
84
|
+
apiKey: r,
|
|
85
85
|
debug: d
|
|
86
86
|
});
|
|
87
|
-
return f(x),
|
|
87
|
+
return f(x), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: c,
|
|
89
89
|
serviceInstance: !!x
|
|
90
90
|
}), () => {
|
|
91
|
-
|
|
91
|
+
l("🧹 SERVICE CLEANUP", {
|
|
92
92
|
renderCount: c,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
94
|
}), x.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const w =
|
|
98
|
-
|
|
99
|
-
var x,
|
|
100
|
-
if (
|
|
96
|
+
}, [r, n, d, l]);
|
|
97
|
+
const w = Y(null);
|
|
98
|
+
q(() => {
|
|
99
|
+
var x, A;
|
|
100
|
+
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!u,
|
|
102
|
-
hasUser: !!
|
|
103
|
-
userId:
|
|
102
|
+
hasUser: !!t,
|
|
103
|
+
userId: t == null ? void 0 : t.id,
|
|
104
104
|
isConnecting: k.current,
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!u, userId:
|
|
107
|
-
}), !u || !
|
|
108
|
-
|
|
105
|
+
isConnected: N,
|
|
106
|
+
dependencies: { service: !!u, userId: t == null ? void 0 : t.id }
|
|
107
|
+
}), !u || !t) {
|
|
108
|
+
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
if (k.current) {
|
|
112
|
-
|
|
112
|
+
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((x = w.current) == null ? void 0 : x.serviceId) === u && ((
|
|
116
|
-
|
|
115
|
+
if (((x = w.current) == null ? void 0 : x.serviceId) === u && ((A = w.current) == null ? void 0 : A.userId) === t.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: t.id }), k.current = !0, E(!0), v(null);
|
|
124
124
|
try {
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
userId:
|
|
129
|
-
clientId:
|
|
125
|
+
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
126
|
+
const _ = await u.connectUser(t);
|
|
127
|
+
C(_), y(!0), w.current = { serviceId: u, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
128
|
+
userId: t.id,
|
|
129
|
+
clientId: _.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
v(
|
|
134
|
-
userId:
|
|
135
|
-
error:
|
|
131
|
+
} catch (_) {
|
|
132
|
+
const R = _ instanceof Error ? _.message : "Connection failed";
|
|
133
|
+
v(R), l("❌ USER CONNECTION ERROR", {
|
|
134
|
+
userId: t.id,
|
|
135
|
+
error: R
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
E(!1), k.current = !1,
|
|
139
|
-
userId:
|
|
140
|
-
isConnected:
|
|
138
|
+
E(!1), k.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
139
|
+
userId: t.id,
|
|
140
|
+
isConnected: N
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [u,
|
|
144
|
+
}, [u, t, l, N]), q(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!u,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: N
|
|
147
147
|
}), () => {
|
|
148
|
-
u &&
|
|
148
|
+
u && N ? (l(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
), w.current = null, u.disconnectUser().catch(console.error)) :
|
|
151
|
+
), w.current = null, u.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!u,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: N
|
|
154
154
|
});
|
|
155
|
-
}), [u,
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
155
|
+
}), [u, N, l]);
|
|
156
|
+
const T = L(async () => {
|
|
157
|
+
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!u,
|
|
159
|
-
hasUser: !!
|
|
160
|
-
}), !u || !
|
|
161
|
-
|
|
159
|
+
hasUser: !!t
|
|
160
|
+
}), !u || !t) {
|
|
161
|
+
l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), E(!0);
|
|
165
165
|
try {
|
|
166
|
-
|
|
167
|
-
const c = await u.connectUser(
|
|
168
|
-
|
|
166
|
+
l("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
167
|
+
const c = await u.connectUser(t);
|
|
168
|
+
C(c), y(!0), v(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
169
169
|
} catch (c) {
|
|
170
170
|
const x = c instanceof Error ? c.message : "Refresh failed";
|
|
171
|
-
v(x),
|
|
172
|
-
userId:
|
|
171
|
+
v(x), l("❌ CONNECTION REFRESH ERROR", {
|
|
172
|
+
userId: t.id,
|
|
173
173
|
error: x
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
E(!1),
|
|
176
|
+
E(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
177
177
|
}
|
|
178
|
-
}, [u,
|
|
178
|
+
}, [u, t, l]), h = B.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!u,
|
|
180
180
|
hasClient: !!g,
|
|
181
|
-
isConnected:
|
|
182
|
-
isLoading:
|
|
181
|
+
isConnected: N,
|
|
182
|
+
isLoading: a,
|
|
183
183
|
hasError: !!S,
|
|
184
|
-
capabilitiesKeys: Object.keys(
|
|
184
|
+
capabilitiesKeys: Object.keys(o)
|
|
185
185
|
}), {
|
|
186
186
|
service: u,
|
|
187
187
|
client: g,
|
|
188
|
-
isConnected:
|
|
189
|
-
isLoading:
|
|
188
|
+
isConnected: N,
|
|
189
|
+
isLoading: a,
|
|
190
190
|
error: S,
|
|
191
|
-
capabilities:
|
|
192
|
-
refreshConnection:
|
|
191
|
+
capabilities: o,
|
|
192
|
+
refreshConnection: T,
|
|
193
193
|
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
u,
|
|
196
196
|
g,
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
N,
|
|
198
|
+
a,
|
|
199
199
|
S,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
o,
|
|
201
|
+
T,
|
|
202
202
|
d,
|
|
203
|
-
|
|
203
|
+
l
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
205
|
+
return l("🔄 RENDER END", {
|
|
206
206
|
renderCount: m.current,
|
|
207
|
-
willRenderChat: !!(g &&
|
|
207
|
+
willRenderChat: !!(g && N),
|
|
208
208
|
contextValueReady: !!h
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(Oe.Provider, { value: h, children: g && N ? /* @__PURE__ */ e(
|
|
210
|
+
ns,
|
|
211
211
|
{
|
|
212
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
|
-
children:
|
|
216
|
+
children: s
|
|
217
217
|
}
|
|
218
|
-
) :
|
|
219
|
-
},
|
|
218
|
+
) : s });
|
|
219
|
+
}, qs = () => fe(), Zs = (s, t) => {
|
|
220
220
|
const n = new Date(
|
|
221
|
-
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
|
-
), l = new Date(
|
|
223
221
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
222
|
+
), o = new Date(
|
|
223
|
+
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
|
-
return Math.floor(
|
|
226
|
-
},
|
|
227
|
-
const
|
|
228
|
-
if (Math.floor((
|
|
225
|
+
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
226
|
+
}, Xs = (s) => {
|
|
227
|
+
const t = /* @__PURE__ */ new Date();
|
|
228
|
+
if (Math.floor((t.getTime() - s.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
230
|
-
const
|
|
231
|
-
return
|
|
230
|
+
const r = Zs(s, t);
|
|
231
|
+
return r === 0 ? s.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit",
|
|
234
234
|
hour12: !0
|
|
235
|
-
}) :
|
|
235
|
+
}) : r === 1 ? "Yesterday" : r < 7 ? `${r}d` : r < 28 ? `${Math.floor(r / 7)}w` : s.toLocaleDateString("en-US", {
|
|
236
236
|
month: "numeric",
|
|
237
237
|
day: "numeric",
|
|
238
238
|
year: "2-digit"
|
|
239
239
|
});
|
|
240
|
-
},
|
|
240
|
+
}, Fe = [
|
|
241
241
|
"🍎",
|
|
242
242
|
// Apple
|
|
243
243
|
"🍌",
|
|
@@ -265,42 +265,42 @@ const Pe = Xe({
|
|
|
265
265
|
"🍈"
|
|
266
266
|
// Melon
|
|
267
267
|
];
|
|
268
|
-
function
|
|
269
|
-
let
|
|
270
|
-
for (let n = 0; n <
|
|
271
|
-
const
|
|
272
|
-
|
|
268
|
+
function Js(s) {
|
|
269
|
+
let t = 0;
|
|
270
|
+
for (let n = 0; n < s.length; n++) {
|
|
271
|
+
const r = s.charCodeAt(n);
|
|
272
|
+
t = (t << 5) - t + r, t = t & t;
|
|
273
273
|
}
|
|
274
|
-
return Math.abs(
|
|
274
|
+
return Math.abs(t);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
278
|
-
return
|
|
276
|
+
function Qs(s) {
|
|
277
|
+
const n = Js(s) % Fe.length;
|
|
278
|
+
return Fe[n];
|
|
279
279
|
}
|
|
280
280
|
const K = ({
|
|
281
|
-
id:
|
|
282
|
-
image:
|
|
281
|
+
id: s,
|
|
282
|
+
image: t,
|
|
283
283
|
size: n = 40,
|
|
284
|
-
className:
|
|
285
|
-
shape:
|
|
284
|
+
className: r,
|
|
285
|
+
shape: o = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const d =
|
|
287
|
+
const d = Qs(s), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", f = o === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
291
291
|
return /* @__PURE__ */ e(
|
|
292
292
|
"div",
|
|
293
293
|
{
|
|
294
|
-
className:
|
|
294
|
+
className: D("flex-shrink-0 overflow-hidden", r),
|
|
295
295
|
style: {
|
|
296
296
|
width: `${n}px`,
|
|
297
297
|
height: `${n}px`,
|
|
298
298
|
...f
|
|
299
299
|
},
|
|
300
|
-
children:
|
|
300
|
+
children: t ? /* @__PURE__ */ e(
|
|
301
301
|
"img",
|
|
302
302
|
{
|
|
303
|
-
src:
|
|
303
|
+
src: t,
|
|
304
304
|
alt: "",
|
|
305
305
|
className: "h-full w-full object-cover aspect-square"
|
|
306
306
|
}
|
|
@@ -308,7 +308,7 @@ const K = ({
|
|
|
308
308
|
"div",
|
|
309
309
|
{
|
|
310
310
|
"aria-hidden": "true",
|
|
311
|
-
className:
|
|
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
|
),
|
|
@@ -317,75 +317,75 @@ const K = ({
|
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, Ks = () => /* @__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
|
-
) }),
|
|
327
|
-
var
|
|
328
|
-
return ((
|
|
329
|
-
},
|
|
330
|
-
var
|
|
331
|
-
return ((
|
|
332
|
-
},
|
|
333
|
-
var
|
|
334
|
-
return ((
|
|
335
|
-
},
|
|
336
|
-
var
|
|
337
|
-
return
|
|
338
|
-
},
|
|
339
|
-
message:
|
|
340
|
-
standalone:
|
|
326
|
+
) }), et = (s) => {
|
|
327
|
+
var t;
|
|
328
|
+
return ((t = s.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
329
|
+
}, st = (s) => {
|
|
330
|
+
var t;
|
|
331
|
+
return ((t = s.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
332
|
+
}, pe = (s) => {
|
|
333
|
+
var t;
|
|
334
|
+
return ((t = s.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
335
|
+
}, Ae = (s) => et(s) || st(s), tt = (s) => {
|
|
336
|
+
var t;
|
|
337
|
+
return Ae(s) && !((t = s.text) != null && t.trim());
|
|
338
|
+
}, Le = ({
|
|
339
|
+
message: s,
|
|
340
|
+
standalone: t = !1
|
|
341
341
|
}) => {
|
|
342
|
-
var
|
|
343
|
-
const n =
|
|
344
|
-
if (!n && !
|
|
342
|
+
var o;
|
|
343
|
+
const n = Ae(s), r = pe(s);
|
|
344
|
+
if (!n && !r)
|
|
345
345
|
return null;
|
|
346
346
|
if (n) {
|
|
347
|
-
const d = (
|
|
347
|
+
const d = (o = s.metadata) == null ? void 0 : o.amount_text;
|
|
348
348
|
if (!d) return null;
|
|
349
|
-
const
|
|
350
|
-
return /* @__PURE__ */ i("div", { className:
|
|
351
|
-
/* @__PURE__ */ e(
|
|
349
|
+
const l = t ? "message-tip-standalone" : "message-tag message-tag--tip", u = t ? `${d} tip` : `Delivered with ${d} tip`;
|
|
350
|
+
return /* @__PURE__ */ i("div", { className: l, children: [
|
|
351
|
+
/* @__PURE__ */ e($s, { size: t ? 14 : 12 }),
|
|
352
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(Ks, {}) }),
|
|
357
357
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
358
358
|
] });
|
|
359
|
-
},
|
|
359
|
+
}, Be = B.memo(
|
|
360
360
|
({
|
|
361
|
-
channel:
|
|
362
|
-
selectedChannel:
|
|
361
|
+
channel: s,
|
|
362
|
+
selectedChannel: t,
|
|
363
363
|
onChannelSelect: n,
|
|
364
|
-
debug:
|
|
365
|
-
unread:
|
|
364
|
+
debug: r = !1,
|
|
365
|
+
unread: o,
|
|
366
366
|
renderMessagePreview: d
|
|
367
367
|
}) => {
|
|
368
|
-
var w,
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
}, f = (
|
|
372
|
-
const
|
|
373
|
-
!
|
|
374
|
-
},
|
|
375
|
-
(
|
|
376
|
-
var
|
|
377
|
-
return ((
|
|
368
|
+
var w, T, h, c, x, A;
|
|
369
|
+
const l = (t == null ? void 0 : t.id) === (s == null ? void 0 : s.id), u = () => {
|
|
370
|
+
s && n(s);
|
|
371
|
+
}, f = (_) => {
|
|
372
|
+
const R = _.key === "Enter" || _.key === " ", M = _.repeat;
|
|
373
|
+
!R || M || (_.preventDefault(), u());
|
|
374
|
+
}, C = Object.values(((w = s == null ? void 0 : s.state) == null ? void 0 : w.members) || {}).find(
|
|
375
|
+
(_) => {
|
|
376
|
+
var R, M;
|
|
377
|
+
return ((R = _.user) == null ? void 0 : R.id) && _.user.id !== ((M = s == null ? void 0 : s._client) == null ? void 0 : M.userID);
|
|
378
378
|
}
|
|
379
|
-
),
|
|
380
|
-
var
|
|
381
|
-
if (
|
|
382
|
-
const
|
|
383
|
-
return
|
|
384
|
-
})(), v =
|
|
385
|
-
return
|
|
386
|
-
channelId:
|
|
387
|
-
isSelected:
|
|
388
|
-
participantName:
|
|
379
|
+
), N = ((T = C == null ? void 0 : C.user) == null ? void 0 : T.name) || "Conversation", y = (h = C == null ? void 0 : C.user) == null ? void 0 : h.image, a = (x = (c = s == null ? void 0 : s.state) == null ? void 0 : c.messages) == null ? void 0 : x[s.state.messages.length - 1], S = (() => {
|
|
380
|
+
var R;
|
|
381
|
+
if (a != null && a.text) return a.text;
|
|
382
|
+
const _ = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
|
|
383
|
+
return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
384
|
+
})(), v = a != null && a.created_at ? Xs(new Date(a.created_at)) : "", k = a ? pe(a) : !1, b = d ? d(a, S) : `${k ? "✨ " : ""}${S}`, m = o ?? 0;
|
|
385
|
+
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
386
|
+
channelId: s == null ? void 0 : s.id,
|
|
387
|
+
isSelected: l,
|
|
388
|
+
participantName: N,
|
|
389
389
|
unreadCount: m,
|
|
390
390
|
hasTimestamp: !!v
|
|
391
391
|
}), /* @__PURE__ */ e(
|
|
@@ -395,20 +395,20 @@ const K = ({
|
|
|
395
395
|
tabIndex: 0,
|
|
396
396
|
onClick: u,
|
|
397
397
|
onKeyDown: f,
|
|
398
|
-
className:
|
|
398
|
+
className: D(
|
|
399
399
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
400
400
|
{
|
|
401
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
402
|
-
"hover:bg-sand": !
|
|
401
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": l,
|
|
402
|
+
"hover:bg-sand": !l
|
|
403
403
|
}
|
|
404
404
|
),
|
|
405
405
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
406
406
|
/* @__PURE__ */ e(
|
|
407
407
|
K,
|
|
408
408
|
{
|
|
409
|
-
id: ((
|
|
410
|
-
name:
|
|
411
|
-
image:
|
|
409
|
+
id: ((A = C == null ? void 0 : C.user) == null ? void 0 : A.id) || s.id || "unknown",
|
|
410
|
+
name: N,
|
|
411
|
+
image: y,
|
|
412
412
|
size: 44,
|
|
413
413
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
414
414
|
}
|
|
@@ -418,11 +418,11 @@ const K = ({
|
|
|
418
418
|
/* @__PURE__ */ e(
|
|
419
419
|
"h3",
|
|
420
420
|
{
|
|
421
|
-
className:
|
|
421
|
+
className: D(
|
|
422
422
|
"text-sm font-medium truncate",
|
|
423
|
-
|
|
423
|
+
l ? "text-primary" : "text-charcoal"
|
|
424
424
|
),
|
|
425
|
-
children:
|
|
425
|
+
children: N
|
|
426
426
|
}
|
|
427
427
|
),
|
|
428
428
|
v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
|
|
@@ -437,49 +437,49 @@ const K = ({
|
|
|
437
437
|
);
|
|
438
438
|
}
|
|
439
439
|
);
|
|
440
|
-
|
|
441
|
-
const
|
|
440
|
+
Be.displayName = "CustomChannelPreview";
|
|
441
|
+
const je = B.memo(
|
|
442
442
|
({
|
|
443
|
-
onChannelSelect:
|
|
444
|
-
selectedChannel:
|
|
443
|
+
onChannelSelect: s,
|
|
444
|
+
selectedChannel: t,
|
|
445
445
|
filters: n,
|
|
446
|
-
className:
|
|
447
|
-
customEmptyStateIndicator:
|
|
446
|
+
className: r,
|
|
447
|
+
customEmptyStateIndicator: o,
|
|
448
448
|
renderMessagePreview: d
|
|
449
449
|
}) => {
|
|
450
|
-
const
|
|
451
|
-
|
|
450
|
+
const l = B.useRef(0);
|
|
451
|
+
l.current++;
|
|
452
452
|
const { debug: u = !1 } = fe();
|
|
453
453
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
454
|
-
renderCount:
|
|
455
|
-
selectedChannelId:
|
|
454
|
+
renderCount: l.current,
|
|
455
|
+
selectedChannelId: t == null ? void 0 : t.id,
|
|
456
456
|
filters: n
|
|
457
457
|
});
|
|
458
|
-
const f =
|
|
459
|
-
|
|
458
|
+
const f = B.useMemo(() => (C) => /* @__PURE__ */ e(
|
|
459
|
+
Be,
|
|
460
460
|
{
|
|
461
|
-
...
|
|
462
|
-
selectedChannel:
|
|
463
|
-
onChannelSelect:
|
|
461
|
+
...C,
|
|
462
|
+
selectedChannel: t,
|
|
463
|
+
onChannelSelect: s,
|
|
464
464
|
debug: u,
|
|
465
465
|
renderMessagePreview: d
|
|
466
466
|
}
|
|
467
|
-
), [
|
|
467
|
+
), [t, s, u, d]);
|
|
468
468
|
return /* @__PURE__ */ e(
|
|
469
469
|
"div",
|
|
470
470
|
{
|
|
471
|
-
className:
|
|
471
|
+
className: D(
|
|
472
472
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
473
|
-
|
|
473
|
+
r
|
|
474
474
|
),
|
|
475
475
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
476
|
-
|
|
476
|
+
rs,
|
|
477
477
|
{
|
|
478
478
|
filters: n,
|
|
479
479
|
sort: { last_message_at: -1 },
|
|
480
480
|
options: { limit: 30 },
|
|
481
481
|
Preview: f,
|
|
482
|
-
EmptyStateIndicator:
|
|
482
|
+
EmptyStateIndicator: o
|
|
483
483
|
},
|
|
484
484
|
JSON.stringify(n)
|
|
485
485
|
) })
|
|
@@ -487,81 +487,81 @@ const Be = j.memo(
|
|
|
487
487
|
);
|
|
488
488
|
}
|
|
489
489
|
);
|
|
490
|
-
|
|
490
|
+
je.displayName = "ChannelList";
|
|
491
491
|
const de = ({
|
|
492
|
-
variant:
|
|
493
|
-
className:
|
|
492
|
+
variant: s = "default",
|
|
493
|
+
className: t,
|
|
494
494
|
children: n,
|
|
495
|
-
...
|
|
495
|
+
...r
|
|
496
496
|
}) => /* @__PURE__ */ e(
|
|
497
497
|
"button",
|
|
498
498
|
{
|
|
499
499
|
type: "button",
|
|
500
|
-
className:
|
|
500
|
+
className: D(
|
|
501
501
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
s === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
503
|
+
t
|
|
504
504
|
),
|
|
505
|
-
...
|
|
505
|
+
...r,
|
|
506
506
|
children: n
|
|
507
507
|
}
|
|
508
508
|
);
|
|
509
|
-
function
|
|
509
|
+
function $e({ label: s, className: t, children: n, ...r }) {
|
|
510
510
|
return /* @__PURE__ */ i(
|
|
511
511
|
"button",
|
|
512
512
|
{
|
|
513
513
|
type: "button",
|
|
514
|
-
className:
|
|
514
|
+
className: D(
|
|
515
515
|
"rounded-full p-2 transition-colors focus-ring",
|
|
516
516
|
{
|
|
517
|
-
"cursor-not-allowed opacity-50":
|
|
518
|
-
"hover:bg-sand": !
|
|
517
|
+
"cursor-not-allowed opacity-50": r.disabled,
|
|
518
|
+
"hover:bg-sand": !r.disabled
|
|
519
519
|
},
|
|
520
|
-
|
|
520
|
+
t
|
|
521
521
|
),
|
|
522
|
-
...
|
|
522
|
+
...r,
|
|
523
523
|
children: [
|
|
524
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children:
|
|
524
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: s }),
|
|
525
525
|
n
|
|
526
526
|
]
|
|
527
527
|
}
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
return /* @__PURE__ */ e(
|
|
530
|
+
function ze({ onClick: s }) {
|
|
531
|
+
return /* @__PURE__ */ e($e, { label: "Close", onClick: s, className: "p-1", children: /* @__PURE__ */ e(ye, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
532
532
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
535
|
-
return
|
|
533
|
+
const nt = (s) => /* @__PURE__ */ e(as, { ...s, position: "center" }), Ne = "vote_up", Ce = "vote_down";
|
|
534
|
+
function rt(s) {
|
|
535
|
+
return s != null && s.length ? s.some((t) => t.type === Ce) ? "down" : s.some((t) => t.type === Ne) ? "up" : null : null;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
const { channel:
|
|
539
|
-
() =>
|
|
540
|
-
[
|
|
541
|
-
),
|
|
537
|
+
function at(s) {
|
|
538
|
+
const { channel: t } = we(), { client: n } = Ue("useMessageVote"), r = be(
|
|
539
|
+
() => rt(s.own_reactions),
|
|
540
|
+
[s.own_reactions]
|
|
541
|
+
), o = L(async () => {
|
|
542
542
|
if (n != null && n.userID)
|
|
543
543
|
try {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
{ type:
|
|
544
|
+
r === "up" ? await t.deleteReaction(s.id, Ne) : await t.sendReaction(
|
|
545
|
+
s.id,
|
|
546
|
+
{ type: Ne },
|
|
547
547
|
{ enforce_unique: !0, skip_push: !0 }
|
|
548
548
|
);
|
|
549
549
|
} catch {
|
|
550
550
|
}
|
|
551
|
-
}, [
|
|
551
|
+
}, [t, n == null ? void 0 : n.userID, s.id, r]), d = L(async () => {
|
|
552
552
|
if (n != null && n.userID)
|
|
553
553
|
try {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
{ type:
|
|
554
|
+
r === "down" ? await t.deleteReaction(s.id, Ce) : await t.sendReaction(
|
|
555
|
+
s.id,
|
|
556
|
+
{ type: Ce },
|
|
557
557
|
{ enforce_unique: !0, skip_push: !0 }
|
|
558
558
|
);
|
|
559
559
|
} catch {
|
|
560
560
|
}
|
|
561
|
-
}, [
|
|
562
|
-
return { selected:
|
|
561
|
+
}, [t, n == null ? void 0 : n.userID, s.id, r]);
|
|
562
|
+
return { selected: r, voteUp: o, voteDown: d };
|
|
563
563
|
}
|
|
564
|
-
const
|
|
564
|
+
const lt = ({ filled: s }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
565
565
|
"path",
|
|
566
566
|
{
|
|
567
567
|
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",
|
|
@@ -569,9 +569,9 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
569
569
|
strokeWidth: "1.33",
|
|
570
570
|
strokeLinecap: "round",
|
|
571
571
|
strokeLinejoin: "round",
|
|
572
|
-
fill:
|
|
572
|
+
fill: s ? "currentColor" : "none"
|
|
573
573
|
}
|
|
574
|
-
) }),
|
|
574
|
+
) }), ot = ({ filled: s }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
575
575
|
"path",
|
|
576
576
|
{
|
|
577
577
|
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",
|
|
@@ -579,130 +579,130 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
579
579
|
strokeWidth: "1.33",
|
|
580
580
|
strokeLinecap: "round",
|
|
581
581
|
strokeLinejoin: "round",
|
|
582
|
-
fill:
|
|
582
|
+
fill: s ? "currentColor" : "none"
|
|
583
583
|
}
|
|
584
|
-
) }),
|
|
585
|
-
selected:
|
|
586
|
-
onVoteUp:
|
|
584
|
+
) }), it = ({
|
|
585
|
+
selected: s,
|
|
586
|
+
onVoteUp: t,
|
|
587
587
|
onVoteDown: n
|
|
588
588
|
}) => /* @__PURE__ */ i("div", { className: "message-vote-buttons", children: [
|
|
589
589
|
/* @__PURE__ */ e(
|
|
590
590
|
"button",
|
|
591
591
|
{
|
|
592
592
|
type: "button",
|
|
593
|
-
className: `message-vote-button${
|
|
594
|
-
onClick:
|
|
593
|
+
className: `message-vote-button${s === "up" ? " message-vote-button--selected" : ""}`,
|
|
594
|
+
onClick: t,
|
|
595
595
|
"aria-label": "Helpful",
|
|
596
|
-
"aria-pressed":
|
|
597
|
-
children: /* @__PURE__ */ e(
|
|
596
|
+
"aria-pressed": s === "up",
|
|
597
|
+
children: /* @__PURE__ */ e(lt, { filled: s === "up" })
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
600
|
/* @__PURE__ */ e(
|
|
601
601
|
"button",
|
|
602
602
|
{
|
|
603
603
|
type: "button",
|
|
604
|
-
className: `message-vote-button${
|
|
604
|
+
className: `message-vote-button${s === "down" ? " message-vote-button--selected" : ""}`,
|
|
605
605
|
onClick: n,
|
|
606
606
|
"aria-label": "Not helpful",
|
|
607
|
-
"aria-pressed":
|
|
608
|
-
children: /* @__PURE__ */ e(
|
|
607
|
+
"aria-pressed": s === "down",
|
|
608
|
+
children: /* @__PURE__ */ e(ot, { filled: s === "down" })
|
|
609
609
|
}
|
|
610
610
|
)
|
|
611
|
-
] }),
|
|
612
|
-
var
|
|
611
|
+
] }), ct = (s) => {
|
|
612
|
+
var Q, le;
|
|
613
613
|
const {
|
|
614
|
-
additionalMessageInputProps:
|
|
614
|
+
additionalMessageInputProps: t,
|
|
615
615
|
chatbotVotingEnabled: n,
|
|
616
|
-
editing:
|
|
617
|
-
endOfGroup:
|
|
616
|
+
editing: r,
|
|
617
|
+
endOfGroup: o,
|
|
618
618
|
firstOfGroup: d,
|
|
619
|
-
groupedByUser:
|
|
619
|
+
groupedByUser: l,
|
|
620
620
|
handleAction: u,
|
|
621
621
|
handleOpenThread: f,
|
|
622
622
|
handleRetry: g,
|
|
623
|
-
highlighted:
|
|
624
|
-
isMessageAIGenerated:
|
|
625
|
-
isMyMessage:
|
|
626
|
-
message:
|
|
623
|
+
highlighted: C,
|
|
624
|
+
isMessageAIGenerated: N,
|
|
625
|
+
isMyMessage: y,
|
|
626
|
+
message: a,
|
|
627
627
|
renderText: E,
|
|
628
628
|
threadList: S
|
|
629
|
-
} =
|
|
630
|
-
Attachment: c =
|
|
631
|
-
EditMessageModal: x =
|
|
632
|
-
MessageBlocked:
|
|
633
|
-
MessageBouncePrompt:
|
|
634
|
-
MessageDeleted:
|
|
635
|
-
MessageIsThreadReplyInChannelButtonIndicator: M =
|
|
636
|
-
MessageRepliesCountButton:
|
|
637
|
-
ReminderNotification: z =
|
|
638
|
-
StreamedMessageText: ee =
|
|
639
|
-
PinIndicator:
|
|
640
|
-
} =
|
|
641
|
-
() =>
|
|
642
|
-
[
|
|
629
|
+
} = s, { client: v } = Ue("CustomMessage"), [k, b] = I(!1), m = os(a.id), { selected: w, voteUp: T, voteDown: h } = at(a), {
|
|
630
|
+
Attachment: c = cs,
|
|
631
|
+
EditMessageModal: x = ds,
|
|
632
|
+
MessageBlocked: A = us,
|
|
633
|
+
MessageBouncePrompt: _ = ms,
|
|
634
|
+
MessageDeleted: R = hs,
|
|
635
|
+
MessageIsThreadReplyInChannelButtonIndicator: M = fs,
|
|
636
|
+
MessageRepliesCountButton: H = gs,
|
|
637
|
+
ReminderNotification: z = xs,
|
|
638
|
+
StreamedMessageText: ee = bs,
|
|
639
|
+
PinIndicator: Z
|
|
640
|
+
} = is("CustomMessage"), se = Ns(a), te = Cs(a), re = be(
|
|
641
|
+
() => N == null ? void 0 : N(a),
|
|
642
|
+
[N, a]
|
|
643
643
|
), V = be(
|
|
644
|
-
() => !
|
|
645
|
-
[
|
|
644
|
+
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
645
|
+
[a]
|
|
646
646
|
);
|
|
647
|
-
if (
|
|
647
|
+
if (vs(a))
|
|
648
648
|
return null;
|
|
649
|
-
if (
|
|
650
|
-
return /* @__PURE__ */ e(
|
|
651
|
-
if (
|
|
652
|
-
return /* @__PURE__ */ e(
|
|
653
|
-
const
|
|
649
|
+
if (a.deleted_at || a.type === "deleted")
|
|
650
|
+
return /* @__PURE__ */ e(R, { message: a });
|
|
651
|
+
if (ws(a))
|
|
652
|
+
return /* @__PURE__ */ e(A, {});
|
|
653
|
+
const X = !S && !!a.reply_count, P = !S && a.show_in_channel && a.parent_id, U = a.status === "failed" && ((Q = a.error) == null ? void 0 : Q.status) !== 403, G = ys(a);
|
|
654
654
|
let F;
|
|
655
|
-
|
|
656
|
-
const W =
|
|
655
|
+
U ? F = () => g(a) : G && (F = () => b(!0));
|
|
656
|
+
const W = D(
|
|
657
657
|
"str-chat__message str-chat__message-simple",
|
|
658
|
-
`str-chat__message--${
|
|
659
|
-
`str-chat__message--${
|
|
660
|
-
|
|
661
|
-
|
|
658
|
+
`str-chat__message--${a.type}`,
|
|
659
|
+
`str-chat__message--${a.status}`,
|
|
660
|
+
y() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
661
|
+
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
662
662
|
{
|
|
663
663
|
"str-chat__message--has-attachment": se,
|
|
664
|
-
"str-chat__message--highlighted":
|
|
665
|
-
"str-chat__message--pinned pinned-message":
|
|
664
|
+
"str-chat__message--highlighted": C,
|
|
665
|
+
"str-chat__message--pinned pinned-message": a.pinned,
|
|
666
666
|
"str-chat__message--with-reactions": te,
|
|
667
|
-
"str-chat__message-send-can-be-retried": (
|
|
668
|
-
"str-chat__message-with-thread-link":
|
|
669
|
-
"str-chat__virtual-message__wrapper--end":
|
|
667
|
+
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((le = a == null ? void 0 : a.error) == null ? void 0 : le.status) !== 403,
|
|
668
|
+
"str-chat__message-with-thread-link": X || P,
|
|
669
|
+
"str-chat__virtual-message__wrapper--end": o,
|
|
670
670
|
"str-chat__virtual-message__wrapper--first": d,
|
|
671
|
-
"str-chat__virtual-message__wrapper--group":
|
|
671
|
+
"str-chat__virtual-message__wrapper--group": l
|
|
672
672
|
}
|
|
673
|
-
), ae =
|
|
673
|
+
), ae = a.poll_id && v.polls.fromState(a.poll_id), J = tt(a);
|
|
674
674
|
return /* @__PURE__ */ i(ve, { children: [
|
|
675
|
-
|
|
675
|
+
r && /* @__PURE__ */ e(
|
|
676
676
|
x,
|
|
677
677
|
{
|
|
678
|
-
additionalMessageInputProps:
|
|
678
|
+
additionalMessageInputProps: t
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
681
|
k && /* @__PURE__ */ e(
|
|
682
|
-
|
|
682
|
+
ps,
|
|
683
683
|
{
|
|
684
|
-
MessageBouncePrompt:
|
|
684
|
+
MessageBouncePrompt: _,
|
|
685
685
|
onClose: () => b(!1),
|
|
686
686
|
open: k
|
|
687
687
|
}
|
|
688
688
|
),
|
|
689
689
|
/* @__PURE__ */ i("div", { className: W, children: [
|
|
690
|
-
|
|
690
|
+
Z && /* @__PURE__ */ e(Z, {}),
|
|
691
691
|
!!m && /* @__PURE__ */ e(z, { reminder: m }),
|
|
692
|
-
|
|
692
|
+
a.user && /* @__PURE__ */ e(
|
|
693
693
|
K,
|
|
694
694
|
{
|
|
695
695
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
696
|
-
id:
|
|
697
|
-
image:
|
|
698
|
-
name:
|
|
696
|
+
id: a.user.id,
|
|
697
|
+
image: a.user.image,
|
|
698
|
+
name: a.user.name || a.user.id
|
|
699
699
|
}
|
|
700
700
|
),
|
|
701
701
|
/* @__PURE__ */ e(
|
|
702
702
|
"div",
|
|
703
703
|
{
|
|
704
|
-
className:
|
|
705
|
-
"str-chat__simple-message--error-failed":
|
|
704
|
+
className: D("str-chat__message-inner", {
|
|
705
|
+
"str-chat__simple-message--error-failed": U || G
|
|
706
706
|
}),
|
|
707
707
|
"data-testid": "message-inner",
|
|
708
708
|
onClick: F,
|
|
@@ -715,13 +715,13 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
715
715
|
marginInlineEnd: 0,
|
|
716
716
|
marginInlineStart: 0
|
|
717
717
|
},
|
|
718
|
-
children:
|
|
718
|
+
children: J ? (
|
|
719
719
|
/* Tip-only messages render as a standalone bubble */
|
|
720
|
-
/* @__PURE__ */ e(
|
|
720
|
+
/* @__PURE__ */ e(Le, { message: a, standalone: !0 })
|
|
721
721
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
722
722
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
723
|
-
ae && /* @__PURE__ */ e(
|
|
724
|
-
V != null && V.length && !
|
|
723
|
+
ae && /* @__PURE__ */ e(Es, { poll: ae }),
|
|
724
|
+
V != null && V.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
725
725
|
c,
|
|
726
726
|
{
|
|
727
727
|
actionHandler: u,
|
|
@@ -731,49 +731,49 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
731
731
|
re ? /* @__PURE__ */ e(
|
|
732
732
|
ee,
|
|
733
733
|
{
|
|
734
|
-
message:
|
|
734
|
+
message: a,
|
|
735
735
|
renderText: E
|
|
736
736
|
}
|
|
737
|
-
) : /* @__PURE__ */ e(
|
|
738
|
-
/* @__PURE__ */ e(
|
|
737
|
+
) : /* @__PURE__ */ e(_s, { message: a, renderText: E }),
|
|
738
|
+
/* @__PURE__ */ e(Is, {})
|
|
739
739
|
] }),
|
|
740
|
-
/* @__PURE__ */ e(
|
|
741
|
-
n &&
|
|
742
|
-
|
|
740
|
+
/* @__PURE__ */ e(Le, { message: a }),
|
|
741
|
+
n && pe(a) && /* @__PURE__ */ e(
|
|
742
|
+
it,
|
|
743
743
|
{
|
|
744
744
|
selected: w,
|
|
745
|
-
onVoteUp:
|
|
745
|
+
onVoteUp: T,
|
|
746
746
|
onVoteDown: h
|
|
747
747
|
}
|
|
748
748
|
)
|
|
749
749
|
] })
|
|
750
750
|
}
|
|
751
751
|
),
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
X && /* @__PURE__ */ e(
|
|
753
|
+
H,
|
|
754
754
|
{
|
|
755
755
|
onClick: f,
|
|
756
|
-
reply_count:
|
|
756
|
+
reply_count: a.reply_count
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
759
|
P && /* @__PURE__ */ e(M, {})
|
|
760
|
-
] },
|
|
760
|
+
] }, a.id)
|
|
761
761
|
] });
|
|
762
|
-
},
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
),
|
|
766
|
-
const
|
|
767
|
-
return /* @__PURE__ */ e(
|
|
768
|
-
},
|
|
769
|
-
linkPreviews: Array.from(
|
|
770
|
-
(
|
|
762
|
+
}, dt = B.memo(
|
|
763
|
+
ct,
|
|
764
|
+
ls
|
|
765
|
+
), ut = (s) => {
|
|
766
|
+
const t = Ss("CustomMessage");
|
|
767
|
+
return /* @__PURE__ */ e(dt, { ...t, ...s });
|
|
768
|
+
}, mt = (s) => ({
|
|
769
|
+
linkPreviews: Array.from(s.previews.values()).filter(
|
|
770
|
+
(t) => Re.previewIsLoaded(t) || Re.previewIsLoading(t)
|
|
771
771
|
)
|
|
772
|
-
}),
|
|
773
|
-
link:
|
|
774
|
-
onDismiss:
|
|
772
|
+
}), ht = ({
|
|
773
|
+
link: s,
|
|
774
|
+
onDismiss: t
|
|
775
775
|
}) => {
|
|
776
|
-
const { og_scrape_url: n, title:
|
|
776
|
+
const { og_scrape_url: n, title: r, image_url: o } = s;
|
|
777
777
|
return /* @__PURE__ */ i(
|
|
778
778
|
"a",
|
|
779
779
|
{
|
|
@@ -782,11 +782,11 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
782
782
|
rel: "noopener noreferrer",
|
|
783
783
|
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
784
784
|
children: [
|
|
785
|
-
|
|
785
|
+
o && /* @__PURE__ */ e(
|
|
786
786
|
"img",
|
|
787
787
|
{
|
|
788
|
-
src:
|
|
789
|
-
alt:
|
|
788
|
+
src: o,
|
|
789
|
+
alt: r || "",
|
|
790
790
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
791
791
|
}
|
|
792
792
|
),
|
|
@@ -794,47 +794,47 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
794
794
|
"button",
|
|
795
795
|
{
|
|
796
796
|
type: "button",
|
|
797
|
-
onClick: (
|
|
798
|
-
|
|
797
|
+
onClick: (l) => {
|
|
798
|
+
l.preventDefault(), t(n);
|
|
799
799
|
},
|
|
800
800
|
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",
|
|
801
801
|
"aria-label": "Close link preview",
|
|
802
|
-
children: /* @__PURE__ */ e(
|
|
802
|
+
children: /* @__PURE__ */ e(ye, { className: "size-4 text-black/90" })
|
|
803
803
|
}
|
|
804
804
|
),
|
|
805
805
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
806
|
-
|
|
806
|
+
r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
807
807
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
808
808
|
] })
|
|
809
809
|
]
|
|
810
810
|
}
|
|
811
811
|
);
|
|
812
|
-
},
|
|
813
|
-
const { linkPreviewsManager:
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
), n = (
|
|
817
|
-
|
|
812
|
+
}, ft = () => {
|
|
813
|
+
const { linkPreviewsManager: s } = Ms(), { linkPreviews: t } = ks(
|
|
814
|
+
s.state,
|
|
815
|
+
mt
|
|
816
|
+
), n = (o) => {
|
|
817
|
+
s.dismissPreview(o);
|
|
818
818
|
};
|
|
819
|
-
return
|
|
820
|
-
|
|
819
|
+
return t.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: t.map((o) => /* @__PURE__ */ e(
|
|
820
|
+
ht,
|
|
821
821
|
{
|
|
822
|
-
link:
|
|
822
|
+
link: o,
|
|
823
823
|
onDismiss: n
|
|
824
824
|
},
|
|
825
|
-
|
|
825
|
+
o.og_scrape_url
|
|
826
826
|
)) }) : null;
|
|
827
|
-
},
|
|
828
|
-
const { handleSubmit:
|
|
827
|
+
}, gt = () => {
|
|
828
|
+
const { handleSubmit: s } = Ts(), t = Rs();
|
|
829
829
|
return /* @__PURE__ */ i(ve, { children: [
|
|
830
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
830
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Fs, {}) }),
|
|
831
831
|
/* @__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: [
|
|
832
|
-
/* @__PURE__ */ e(
|
|
833
|
-
/* @__PURE__ */ e(
|
|
834
|
-
/* @__PURE__ */ e(
|
|
832
|
+
/* @__PURE__ */ e(Ls, {}),
|
|
833
|
+
/* @__PURE__ */ e(ft, {}),
|
|
834
|
+
/* @__PURE__ */ e(Ps, {}),
|
|
835
835
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
836
836
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
837
|
-
|
|
837
|
+
Us,
|
|
838
838
|
{
|
|
839
839
|
className: "w-full resize-none outline-none leading-6",
|
|
840
840
|
autoFocus: !0,
|
|
@@ -847,34 +847,84 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
847
847
|
"aria-label": "Send",
|
|
848
848
|
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white",
|
|
849
849
|
"data-testid": "send-button",
|
|
850
|
-
disabled: !
|
|
851
|
-
onClick:
|
|
850
|
+
disabled: !t,
|
|
851
|
+
onClick: s,
|
|
852
852
|
type: "button",
|
|
853
|
-
children: /* @__PURE__ */ e(
|
|
853
|
+
children: /* @__PURE__ */ e(zs, { className: "size-4" })
|
|
854
854
|
}
|
|
855
855
|
)
|
|
856
856
|
] })
|
|
857
857
|
] })
|
|
858
858
|
] });
|
|
859
|
-
},
|
|
860
|
-
renderActions:
|
|
859
|
+
}, xt = ({
|
|
860
|
+
renderActions: s
|
|
861
861
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
862
|
-
|
|
863
|
-
/* @__PURE__ */ e(
|
|
864
|
-
] }),
|
|
865
|
-
|
|
862
|
+
s && (s == null ? void 0 : s()),
|
|
863
|
+
/* @__PURE__ */ e(Ds, { Input: gt })
|
|
864
|
+
] }), bt = [
|
|
865
|
+
"SYSTEM_DM_AGENT_PAUSED",
|
|
866
|
+
"SYSTEM_DM_AGENT_RESUMED"
|
|
867
|
+
], Nt = {
|
|
868
|
+
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
869
|
+
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
870
|
+
}, Pe = (s) => bt.includes(s), Ct = (s) => {
|
|
871
|
+
var r;
|
|
872
|
+
const t = (r = s.metadata) == null ? void 0 : r.custom_type;
|
|
873
|
+
if (Pe(t))
|
|
874
|
+
return t;
|
|
875
|
+
const n = s.dm_agent_system_type;
|
|
876
|
+
if (Pe(n))
|
|
877
|
+
return n;
|
|
878
|
+
}, vt = (s) => {
|
|
879
|
+
var r;
|
|
880
|
+
const t = s.message.hide_date === !0, n = Ct(s.message);
|
|
881
|
+
if (n) {
|
|
882
|
+
const o = ((r = s.message.text) == null ? void 0 : r.trim()) || Nt[n];
|
|
883
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
884
|
+
/* @__PURE__ */ i(
|
|
885
|
+
"div",
|
|
886
|
+
{
|
|
887
|
+
className: "mes-dm-agent-system-message",
|
|
888
|
+
"data-testid": "dm-agent-system-message",
|
|
889
|
+
"data-dm-agent-system-type": n,
|
|
890
|
+
children: [
|
|
891
|
+
/* @__PURE__ */ e(
|
|
892
|
+
Gs,
|
|
893
|
+
{
|
|
894
|
+
size: 16,
|
|
895
|
+
weight: "regular",
|
|
896
|
+
"aria-hidden": !0,
|
|
897
|
+
className: "mes-dm-agent-system-message__sparkle"
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text", children: o }),
|
|
901
|
+
/* @__PURE__ */ e(
|
|
902
|
+
"span",
|
|
903
|
+
{
|
|
904
|
+
className: "mes-dm-agent-system-message__close",
|
|
905
|
+
"aria-hidden": !0,
|
|
906
|
+
"data-testid": "dm-agent-system-message-close",
|
|
907
|
+
children: /* @__PURE__ */ e(Hs, { size: 14, weight: "regular", "aria-hidden": !0 })
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
]
|
|
911
|
+
}
|
|
912
|
+
),
|
|
913
|
+
!t && /* @__PURE__ */ e(Ie, { message: s.message })
|
|
914
|
+
] });
|
|
915
|
+
}
|
|
866
916
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
867
917
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
868
918
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
869
|
-
/* @__PURE__ */ e("p", { children:
|
|
919
|
+
/* @__PURE__ */ e("p", { children: s.message.text }),
|
|
870
920
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
871
921
|
] }),
|
|
872
|
-
!
|
|
922
|
+
!t && /* @__PURE__ */ e(Ie, { message: s.message })
|
|
873
923
|
] });
|
|
874
|
-
},
|
|
924
|
+
}, wt = () => null, yt = ({ className: s, message: t }) => /* @__PURE__ */ i(
|
|
875
925
|
"div",
|
|
876
926
|
{
|
|
877
|
-
className:
|
|
927
|
+
className: D("flex items-center justify-center h-full", s),
|
|
878
928
|
children: [
|
|
879
929
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
880
930
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -911,34 +961,34 @@ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
911
961
|
}
|
|
912
962
|
) })
|
|
913
963
|
] }),
|
|
914
|
-
|
|
964
|
+
t && /* @__PURE__ */ e("span", { className: "text-stone", children: t })
|
|
915
965
|
]
|
|
916
966
|
}
|
|
917
|
-
), he =
|
|
918
|
-
/* @__PURE__ */ e(
|
|
967
|
+
), he = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
968
|
+
/* @__PURE__ */ e(yt, { className: "w-6 h-6" }),
|
|
919
969
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
920
970
|
] }) }));
|
|
921
971
|
he.displayName = "LoadingState";
|
|
922
|
-
const
|
|
923
|
-
onBack:
|
|
924
|
-
showBackButton:
|
|
972
|
+
const pt = ({
|
|
973
|
+
onBack: s,
|
|
974
|
+
showBackButton: t,
|
|
925
975
|
onShowInfo: n,
|
|
926
|
-
canShowInfo:
|
|
927
|
-
showStarButton:
|
|
976
|
+
canShowInfo: r,
|
|
977
|
+
showStarButton: o = !1
|
|
928
978
|
}) => {
|
|
929
|
-
var
|
|
930
|
-
const { channel: d } = we(),
|
|
979
|
+
var y, a, E, S, v, k;
|
|
980
|
+
const { channel: d } = we(), l = B.useMemo(() => Object.values(d.state.members || {}).find(
|
|
931
981
|
(m) => {
|
|
932
982
|
var w;
|
|
933
983
|
return ((w = m.user) == null ? void 0 : w.id) && m.user.id !== d._client.userID;
|
|
934
984
|
}
|
|
935
|
-
), [d._client.userID, d.state.members]), u = ((
|
|
985
|
+
), [d._client.userID, d.state.members]), u = ((y = l == null ? void 0 : l.user) == null ? void 0 : y.name) || ((a = l == null ? void 0 : l.user) == null ? void 0 : a.id) || "Unknown member", f = (E = l == null ? void 0 : l.user) == null ? void 0 : E.image, [g, C] = I(
|
|
936
986
|
!!((S = d.state.membership) != null && S.pinned_at)
|
|
937
987
|
);
|
|
938
|
-
|
|
988
|
+
q(() => {
|
|
939
989
|
const b = (m) => {
|
|
940
990
|
var w;
|
|
941
|
-
|
|
991
|
+
C(
|
|
942
992
|
m != null && m.member ? !!m.member.pinned_at : !!((w = d.state.membership) != null && w.pinned_at)
|
|
943
993
|
);
|
|
944
994
|
};
|
|
@@ -946,7 +996,7 @@ const bt = ({
|
|
|
946
996
|
d.off("member.updated", b);
|
|
947
997
|
};
|
|
948
998
|
}, [d]);
|
|
949
|
-
const
|
|
999
|
+
const N = async () => {
|
|
950
1000
|
try {
|
|
951
1001
|
g ? await d.unpin() : await d.pin();
|
|
952
1002
|
} catch (b) {
|
|
@@ -958,24 +1008,24 @@ const bt = ({
|
|
|
958
1008
|
};
|
|
959
1009
|
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
960
1010
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
961
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children:
|
|
1011
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ e(
|
|
962
1012
|
"button",
|
|
963
1013
|
{
|
|
964
|
-
className:
|
|
1014
|
+
className: D(
|
|
965
1015
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
966
1016
|
),
|
|
967
|
-
onClick:
|
|
1017
|
+
onClick: s || (() => {
|
|
968
1018
|
}),
|
|
969
1019
|
type: "button",
|
|
970
1020
|
"aria-label": "Back to conversations",
|
|
971
|
-
children: /* @__PURE__ */ e(
|
|
1021
|
+
children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
|
|
972
1022
|
}
|
|
973
1023
|
) }),
|
|
974
1024
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
975
1025
|
/* @__PURE__ */ e(
|
|
976
1026
|
K,
|
|
977
1027
|
{
|
|
978
|
-
id: ((v =
|
|
1028
|
+
id: ((v = l == null ? void 0 : l.user) == null ? void 0 : v.id) || d.id || "unknown",
|
|
979
1029
|
name: u,
|
|
980
1030
|
image: f,
|
|
981
1031
|
size: 40
|
|
@@ -984,17 +1034,17 @@ const bt = ({
|
|
|
984
1034
|
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
|
|
985
1035
|
] }),
|
|
986
1036
|
/* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
|
|
987
|
-
|
|
1037
|
+
o && /* @__PURE__ */ e(
|
|
988
1038
|
"button",
|
|
989
1039
|
{
|
|
990
1040
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
991
|
-
onClick:
|
|
1041
|
+
onClick: N,
|
|
992
1042
|
type: "button",
|
|
993
1043
|
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
994
1044
|
children: /* @__PURE__ */ e(
|
|
995
|
-
|
|
1045
|
+
Me,
|
|
996
1046
|
{
|
|
997
|
-
className:
|
|
1047
|
+
className: D("size-5", {
|
|
998
1048
|
"text-yellow-600": g,
|
|
999
1049
|
"text-black/90": !g
|
|
1000
1050
|
}),
|
|
@@ -1010,27 +1060,27 @@ const bt = ({
|
|
|
1010
1060
|
onClick: n,
|
|
1011
1061
|
type: "button",
|
|
1012
1062
|
"aria-label": "Show info",
|
|
1013
|
-
children: /* @__PURE__ */ e(
|
|
1063
|
+
children: /* @__PURE__ */ e(ke, { className: "size-5 text-black/90" })
|
|
1014
1064
|
}
|
|
1015
1065
|
)
|
|
1016
1066
|
] })
|
|
1017
1067
|
] }),
|
|
1018
1068
|
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1019
1069
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1020
|
-
|
|
1070
|
+
t && s && /* @__PURE__ */ e(
|
|
1021
1071
|
"button",
|
|
1022
1072
|
{
|
|
1023
1073
|
type: "button",
|
|
1024
|
-
onClick:
|
|
1074
|
+
onClick: s,
|
|
1025
1075
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1026
1076
|
"aria-label": "Back to conversations",
|
|
1027
|
-
children: /* @__PURE__ */ e(
|
|
1077
|
+
children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
|
|
1028
1078
|
}
|
|
1029
1079
|
),
|
|
1030
1080
|
/* @__PURE__ */ e(
|
|
1031
1081
|
K,
|
|
1032
1082
|
{
|
|
1033
|
-
id: ((k =
|
|
1083
|
+
id: ((k = l == null ? void 0 : l.user) == null ? void 0 : k.id) || d.id || "unknown",
|
|
1034
1084
|
name: u,
|
|
1035
1085
|
image: f,
|
|
1036
1086
|
size: 40
|
|
@@ -1039,17 +1089,17 @@ const bt = ({
|
|
|
1039
1089
|
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
|
|
1040
1090
|
] }),
|
|
1041
1091
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1042
|
-
|
|
1092
|
+
o && /* @__PURE__ */ e(
|
|
1043
1093
|
"button",
|
|
1044
1094
|
{
|
|
1045
1095
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1046
|
-
onClick:
|
|
1096
|
+
onClick: N,
|
|
1047
1097
|
type: "button",
|
|
1048
1098
|
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
1049
1099
|
children: /* @__PURE__ */ e(
|
|
1050
|
-
|
|
1100
|
+
Me,
|
|
1051
1101
|
{
|
|
1052
|
-
className:
|
|
1102
|
+
className: D("size-5", {
|
|
1053
1103
|
"text-yellow-600": g,
|
|
1054
1104
|
"text-black/90": !g
|
|
1055
1105
|
}),
|
|
@@ -1058,74 +1108,74 @@ const bt = ({
|
|
|
1058
1108
|
)
|
|
1059
1109
|
}
|
|
1060
1110
|
),
|
|
1061
|
-
|
|
1111
|
+
r && n && /* @__PURE__ */ e(
|
|
1062
1112
|
"button",
|
|
1063
1113
|
{
|
|
1064
1114
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1065
1115
|
onClick: n,
|
|
1066
1116
|
type: "button",
|
|
1067
1117
|
"aria-label": "Show info",
|
|
1068
|
-
children: /* @__PURE__ */ e(
|
|
1118
|
+
children: /* @__PURE__ */ e(ke, { className: "size-5 text-black/90" })
|
|
1069
1119
|
}
|
|
1070
1120
|
)
|
|
1071
1121
|
] })
|
|
1072
1122
|
] })
|
|
1073
1123
|
] });
|
|
1074
|
-
},
|
|
1075
|
-
dialogRef:
|
|
1076
|
-
onClose:
|
|
1124
|
+
}, Et = ({
|
|
1125
|
+
dialogRef: s,
|
|
1126
|
+
onClose: t,
|
|
1077
1127
|
participant: n,
|
|
1078
|
-
channel:
|
|
1079
|
-
followerStatusLabel:
|
|
1128
|
+
channel: r,
|
|
1129
|
+
followerStatusLabel: o,
|
|
1080
1130
|
onLeaveConversation: d,
|
|
1081
|
-
onBlockParticipant:
|
|
1131
|
+
onBlockParticipant: l,
|
|
1082
1132
|
showDeleteConversation: u = !0,
|
|
1083
1133
|
onDeleteConversationClick: f,
|
|
1084
1134
|
onBlockParticipantClick: g,
|
|
1085
|
-
onReportParticipantClick:
|
|
1086
|
-
customChannelActions:
|
|
1135
|
+
onReportParticipantClick: C,
|
|
1136
|
+
customChannelActions: N
|
|
1087
1137
|
}) => {
|
|
1088
|
-
var ee,
|
|
1089
|
-
const { service:
|
|
1138
|
+
var ee, Z, se, te, re, V, X;
|
|
1139
|
+
const { service: y, debug: a } = fe(), [E, S] = I(!1), [v, k] = I(!1), [b, m] = I(!1), w = L(async () => {
|
|
1090
1140
|
var P;
|
|
1091
|
-
if (!(!
|
|
1141
|
+
if (!(!y || !((P = n == null ? void 0 : n.user) != null && P.id)))
|
|
1092
1142
|
try {
|
|
1093
|
-
const
|
|
1143
|
+
const G = (await y.getBlockedUsers()).some(
|
|
1094
1144
|
(F) => {
|
|
1095
1145
|
var W;
|
|
1096
1146
|
return F.blocked_user_id === ((W = n == null ? void 0 : n.user) == null ? void 0 : W.id);
|
|
1097
1147
|
}
|
|
1098
1148
|
);
|
|
1099
|
-
S(
|
|
1100
|
-
} catch (
|
|
1149
|
+
S(G);
|
|
1150
|
+
} catch (U) {
|
|
1101
1151
|
console.error(
|
|
1102
1152
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1103
|
-
|
|
1153
|
+
U
|
|
1104
1154
|
);
|
|
1105
1155
|
}
|
|
1106
|
-
}, [
|
|
1107
|
-
|
|
1156
|
+
}, [y, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
|
|
1157
|
+
q(() => {
|
|
1108
1158
|
w();
|
|
1109
1159
|
}, [w]);
|
|
1110
|
-
const
|
|
1160
|
+
const T = async () => {
|
|
1111
1161
|
var P;
|
|
1112
1162
|
if (!v) {
|
|
1113
|
-
f == null || f(),
|
|
1163
|
+
f == null || f(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), k(!0);
|
|
1114
1164
|
try {
|
|
1115
|
-
const
|
|
1116
|
-
await
|
|
1117
|
-
} catch (
|
|
1118
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
1165
|
+
const U = ((P = r._client) == null ? void 0 : P.userID) ?? null;
|
|
1166
|
+
await r.hide(U, !1), d && await d(r), t();
|
|
1167
|
+
} catch (U) {
|
|
1168
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
1119
1169
|
} finally {
|
|
1120
1170
|
k(!1);
|
|
1121
1171
|
}
|
|
1122
1172
|
}
|
|
1123
1173
|
}, h = async () => {
|
|
1124
|
-
var P,
|
|
1125
|
-
if (!(b || !
|
|
1126
|
-
g == null || g(),
|
|
1174
|
+
var P, U, G;
|
|
1175
|
+
if (!(b || !y)) {
|
|
1176
|
+
g == null || g(), a && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
|
|
1127
1177
|
try {
|
|
1128
|
-
await
|
|
1178
|
+
await y.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), l && await l((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), t();
|
|
1129
1179
|
} catch (F) {
|
|
1130
1180
|
console.error("[ChannelInfoDialog] Failed to block member", F);
|
|
1131
1181
|
} finally {
|
|
@@ -1133,11 +1183,11 @@ const bt = ({
|
|
|
1133
1183
|
}
|
|
1134
1184
|
}
|
|
1135
1185
|
}, c = async () => {
|
|
1136
|
-
var P,
|
|
1137
|
-
if (!(b || !
|
|
1138
|
-
g == null || g(),
|
|
1186
|
+
var P, U, G;
|
|
1187
|
+
if (!(b || !y)) {
|
|
1188
|
+
g == null || g(), a && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
|
|
1139
1189
|
try {
|
|
1140
|
-
await
|
|
1190
|
+
await y.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), l && await l((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), t();
|
|
1141
1191
|
} catch (F) {
|
|
1142
1192
|
console.error("[ChannelInfoDialog] Failed to unblock member", F);
|
|
1143
1193
|
} finally {
|
|
@@ -1145,29 +1195,29 @@ const bt = ({
|
|
|
1145
1195
|
}
|
|
1146
1196
|
}
|
|
1147
1197
|
}, x = () => {
|
|
1148
|
-
|
|
1198
|
+
C == null || C(), t(), window.open(
|
|
1149
1199
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1150
1200
|
"_blank",
|
|
1151
1201
|
"noopener,noreferrer"
|
|
1152
1202
|
);
|
|
1153
1203
|
};
|
|
1154
1204
|
if (!n) return null;
|
|
1155
|
-
const
|
|
1205
|
+
const A = ((Z = n.user) == null ? void 0 : Z.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", _ = (te = n.user) == null ? void 0 : te.image, R = (re = n.user) == null ? void 0 : re.email, M = (V = n.user) == null ? void 0 : V.username, H = R || (M ? `linktr.ee/${M}` : void 0), z = ((X = n.user) == null ? void 0 : X.id) || "unknown";
|
|
1156
1206
|
return (
|
|
1157
1207
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1158
1208
|
/* @__PURE__ */ e(
|
|
1159
1209
|
"dialog",
|
|
1160
1210
|
{
|
|
1161
|
-
ref:
|
|
1211
|
+
ref: s,
|
|
1162
1212
|
className: "mes-dialog group",
|
|
1163
|
-
onClose:
|
|
1213
|
+
onClose: t,
|
|
1164
1214
|
onClick: (P) => {
|
|
1165
|
-
P.target ===
|
|
1215
|
+
P.target === s.current && t();
|
|
1166
1216
|
},
|
|
1167
1217
|
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: [
|
|
1168
1218
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1169
1219
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1170
|
-
/* @__PURE__ */ e(
|
|
1220
|
+
/* @__PURE__ */ e(ze, { onClick: t })
|
|
1171
1221
|
] }),
|
|
1172
1222
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1173
1223
|
/* @__PURE__ */ e(
|
|
@@ -1180,27 +1230,27 @@ const bt = ({
|
|
|
1180
1230
|
K,
|
|
1181
1231
|
{
|
|
1182
1232
|
id: z,
|
|
1183
|
-
name:
|
|
1184
|
-
image:
|
|
1233
|
+
name: A,
|
|
1234
|
+
image: _,
|
|
1185
1235
|
size: 88,
|
|
1186
1236
|
shape: "circle"
|
|
1187
1237
|
}
|
|
1188
1238
|
),
|
|
1189
1239
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1190
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1191
|
-
|
|
1192
|
-
|
|
1240
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: A }),
|
|
1241
|
+
H && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: H }),
|
|
1242
|
+
o && /* @__PURE__ */ e(
|
|
1193
1243
|
"span",
|
|
1194
1244
|
{
|
|
1195
1245
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
1196
1246
|
style: {
|
|
1197
1247
|
padding: "4px 8px",
|
|
1198
|
-
backgroundColor:
|
|
1199
|
-
color:
|
|
1248
|
+
backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
1249
|
+
color: o === "Subscribed to you" ? "#008236" : "#78716C",
|
|
1200
1250
|
lineHeight: "133.333%",
|
|
1201
1251
|
letterSpacing: "0.21px"
|
|
1202
1252
|
},
|
|
1203
|
-
children:
|
|
1253
|
+
children: o
|
|
1204
1254
|
}
|
|
1205
1255
|
)
|
|
1206
1256
|
] })
|
|
@@ -1211,11 +1261,11 @@ const bt = ({
|
|
|
1211
1261
|
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1212
1262
|
de,
|
|
1213
1263
|
{
|
|
1214
|
-
onClick:
|
|
1264
|
+
onClick: T,
|
|
1215
1265
|
disabled: v,
|
|
1216
1266
|
"aria-busy": v,
|
|
1217
1267
|
children: [
|
|
1218
|
-
v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
1268
|
+
v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Vs, { className: "h-5 w-5" }),
|
|
1219
1269
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1220
1270
|
]
|
|
1221
1271
|
}
|
|
@@ -1227,7 +1277,7 @@ const bt = ({
|
|
|
1227
1277
|
disabled: b,
|
|
1228
1278
|
"aria-busy": b,
|
|
1229
1279
|
children: [
|
|
1230
|
-
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
1280
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "h-5 w-5" }),
|
|
1231
1281
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1232
1282
|
]
|
|
1233
1283
|
}
|
|
@@ -1238,49 +1288,49 @@ const bt = ({
|
|
|
1238
1288
|
disabled: b,
|
|
1239
1289
|
"aria-busy": b,
|
|
1240
1290
|
children: [
|
|
1241
|
-
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
1291
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "h-5 w-5" }),
|
|
1242
1292
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1243
1293
|
]
|
|
1244
1294
|
}
|
|
1245
1295
|
) }),
|
|
1246
1296
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: x, children: [
|
|
1247
|
-
/* @__PURE__ */ e(
|
|
1297
|
+
/* @__PURE__ */ e(Ws, { className: "h-5 w-5" }),
|
|
1248
1298
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1249
1299
|
] }) }),
|
|
1250
|
-
|
|
1300
|
+
N
|
|
1251
1301
|
] })
|
|
1252
1302
|
] })
|
|
1253
1303
|
] })
|
|
1254
1304
|
}
|
|
1255
1305
|
)
|
|
1256
1306
|
);
|
|
1257
|
-
},
|
|
1258
|
-
onBack:
|
|
1259
|
-
showBackButton:
|
|
1307
|
+
}, _t = ({
|
|
1308
|
+
onBack: s,
|
|
1309
|
+
showBackButton: t,
|
|
1260
1310
|
renderMessageInputActions: n,
|
|
1261
|
-
onLeaveConversation:
|
|
1262
|
-
onBlockParticipant:
|
|
1311
|
+
onLeaveConversation: r,
|
|
1312
|
+
onBlockParticipant: o,
|
|
1263
1313
|
showDeleteConversation: d = !0,
|
|
1264
|
-
onDeleteConversationClick:
|
|
1314
|
+
onDeleteConversationClick: l,
|
|
1265
1315
|
onBlockParticipantClick: u,
|
|
1266
1316
|
onReportParticipantClick: f,
|
|
1267
1317
|
showStarButton: g = !1,
|
|
1268
|
-
chatbotVotingEnabled:
|
|
1269
|
-
renderChannelBanner:
|
|
1270
|
-
customChannelActions:
|
|
1318
|
+
chatbotVotingEnabled: C = !1,
|
|
1319
|
+
renderChannelBanner: N,
|
|
1320
|
+
customChannelActions: y
|
|
1271
1321
|
}) => {
|
|
1272
|
-
const { channel:
|
|
1322
|
+
const { channel: a } = we(), E = Y(null), S = B.useMemo(() => Object.values(a.state.members || {}).find(
|
|
1273
1323
|
(w) => {
|
|
1274
|
-
var
|
|
1275
|
-
return ((
|
|
1324
|
+
var T;
|
|
1325
|
+
return ((T = w.user) == null ? void 0 : T.id) && w.user.id !== a._client.userID;
|
|
1276
1326
|
}
|
|
1277
|
-
), [
|
|
1278
|
-
const m =
|
|
1327
|
+
), [a._client.userID, a.state.members]), v = B.useMemo(() => {
|
|
1328
|
+
const m = a.data ?? {};
|
|
1279
1329
|
if (m.followerStatus)
|
|
1280
1330
|
return String(m.followerStatus);
|
|
1281
1331
|
if (m.isFollower !== void 0)
|
|
1282
1332
|
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1283
|
-
}, [
|
|
1333
|
+
}, [a.data]), k = L(() => {
|
|
1284
1334
|
var m;
|
|
1285
1335
|
(m = E.current) == null || m.showModal();
|
|
1286
1336
|
}, []), b = L(() => {
|
|
@@ -1289,23 +1339,23 @@ const bt = ({
|
|
|
1289
1339
|
}, []);
|
|
1290
1340
|
return /* @__PURE__ */ i(ve, { children: [
|
|
1291
1341
|
/* @__PURE__ */ e(
|
|
1292
|
-
|
|
1342
|
+
As,
|
|
1293
1343
|
{
|
|
1294
1344
|
overrides: {
|
|
1295
|
-
Message: (m) => /* @__PURE__ */ e(
|
|
1345
|
+
Message: (m) => /* @__PURE__ */ e(ut, { ...m, chatbotVotingEnabled: C })
|
|
1296
1346
|
},
|
|
1297
1347
|
children: /* @__PURE__ */ i(Bs, { children: [
|
|
1298
1348
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1299
|
-
|
|
1349
|
+
pt,
|
|
1300
1350
|
{
|
|
1301
|
-
onBack:
|
|
1302
|
-
showBackButton:
|
|
1351
|
+
onBack: s,
|
|
1352
|
+
showBackButton: t,
|
|
1303
1353
|
onShowInfo: k,
|
|
1304
1354
|
canShowInfo: !!S,
|
|
1305
1355
|
showStarButton: g
|
|
1306
1356
|
}
|
|
1307
1357
|
) }),
|
|
1308
|
-
|
|
1358
|
+
N == null ? void 0 : N(),
|
|
1309
1359
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1310
1360
|
js,
|
|
1311
1361
|
{
|
|
@@ -1315,48 +1365,48 @@ const bt = ({
|
|
|
1315
1365
|
}
|
|
1316
1366
|
) }),
|
|
1317
1367
|
/* @__PURE__ */ e(
|
|
1318
|
-
|
|
1368
|
+
xt,
|
|
1319
1369
|
{
|
|
1320
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1370
|
+
renderActions: () => n == null ? void 0 : n(a)
|
|
1321
1371
|
}
|
|
1322
1372
|
)
|
|
1323
1373
|
] })
|
|
1324
1374
|
}
|
|
1325
1375
|
),
|
|
1326
1376
|
/* @__PURE__ */ e(
|
|
1327
|
-
|
|
1377
|
+
Et,
|
|
1328
1378
|
{
|
|
1329
1379
|
dialogRef: E,
|
|
1330
1380
|
onClose: b,
|
|
1331
1381
|
participant: S,
|
|
1332
|
-
channel:
|
|
1382
|
+
channel: a,
|
|
1333
1383
|
followerStatusLabel: v,
|
|
1334
|
-
onLeaveConversation:
|
|
1335
|
-
onBlockParticipant:
|
|
1384
|
+
onLeaveConversation: r,
|
|
1385
|
+
onBlockParticipant: o,
|
|
1336
1386
|
showDeleteConversation: d,
|
|
1337
|
-
onDeleteConversationClick:
|
|
1387
|
+
onDeleteConversationClick: l,
|
|
1338
1388
|
onBlockParticipantClick: u,
|
|
1339
1389
|
onReportParticipantClick: f,
|
|
1340
|
-
customChannelActions:
|
|
1390
|
+
customChannelActions: y
|
|
1341
1391
|
}
|
|
1342
1392
|
)
|
|
1343
1393
|
] });
|
|
1344
|
-
},
|
|
1394
|
+
}, Ge = B.memo(
|
|
1345
1395
|
({
|
|
1346
|
-
channel:
|
|
1347
|
-
onBack:
|
|
1396
|
+
channel: s,
|
|
1397
|
+
onBack: t,
|
|
1348
1398
|
showBackButton: n = !1,
|
|
1349
|
-
renderMessageInputActions:
|
|
1350
|
-
onLeaveConversation:
|
|
1399
|
+
renderMessageInputActions: r,
|
|
1400
|
+
onLeaveConversation: o,
|
|
1351
1401
|
onBlockParticipant: d,
|
|
1352
|
-
className:
|
|
1353
|
-
CustomChannelEmptyState: u =
|
|
1402
|
+
className: l,
|
|
1403
|
+
CustomChannelEmptyState: u = wt,
|
|
1354
1404
|
showDeleteConversation: f = !0,
|
|
1355
1405
|
onDeleteConversationClick: g,
|
|
1356
|
-
onBlockParticipantClick:
|
|
1357
|
-
onReportParticipantClick:
|
|
1358
|
-
dmAgentEnabled:
|
|
1359
|
-
messageMetadata:
|
|
1406
|
+
onBlockParticipantClick: C,
|
|
1407
|
+
onReportParticipantClick: N,
|
|
1408
|
+
dmAgentEnabled: y,
|
|
1409
|
+
messageMetadata: a,
|
|
1360
1410
|
onMessageSent: E,
|
|
1361
1411
|
showStarButton: S = !1,
|
|
1362
1412
|
chatbotVotingEnabled: v = !1,
|
|
@@ -1364,54 +1414,54 @@ const bt = ({
|
|
|
1364
1414
|
customChannelActions: b
|
|
1365
1415
|
}) => {
|
|
1366
1416
|
const m = L(
|
|
1367
|
-
async (w,
|
|
1417
|
+
async (w, T, h) => {
|
|
1368
1418
|
var M;
|
|
1369
|
-
const c = ((M =
|
|
1370
|
-
...
|
|
1419
|
+
const c = ((M = s.data) == null ? void 0 : M.chatbot_paused) === !0, x = y && !c, A = {
|
|
1420
|
+
...T,
|
|
1371
1421
|
...x && { silent: !0 },
|
|
1372
|
-
...
|
|
1422
|
+
...a && {
|
|
1373
1423
|
metadata: {
|
|
1374
|
-
...
|
|
1375
|
-
...
|
|
1424
|
+
...T.metadata ?? {},
|
|
1425
|
+
...a
|
|
1376
1426
|
}
|
|
1377
1427
|
}
|
|
1378
|
-
},
|
|
1428
|
+
}, _ = {
|
|
1379
1429
|
...h,
|
|
1380
1430
|
...x && { skip_push: !0 }
|
|
1381
|
-
},
|
|
1382
|
-
return E == null || E(
|
|
1431
|
+
}, R = await s.sendMessage(A, _);
|
|
1432
|
+
return E == null || E(R), R;
|
|
1383
1433
|
},
|
|
1384
|
-
[
|
|
1434
|
+
[s, y, a, E]
|
|
1385
1435
|
);
|
|
1386
1436
|
return /* @__PURE__ */ e(
|
|
1387
1437
|
"div",
|
|
1388
1438
|
{
|
|
1389
|
-
className:
|
|
1439
|
+
className: D(
|
|
1390
1440
|
"messaging-channel-view h-full flex flex-col",
|
|
1391
|
-
|
|
1441
|
+
l
|
|
1392
1442
|
),
|
|
1393
1443
|
children: /* @__PURE__ */ e(
|
|
1394
1444
|
Os,
|
|
1395
1445
|
{
|
|
1396
|
-
channel:
|
|
1397
|
-
MessageSystem:
|
|
1446
|
+
channel: s,
|
|
1447
|
+
MessageSystem: vt,
|
|
1398
1448
|
EmptyStateIndicator: u,
|
|
1399
1449
|
LoadingIndicator: he,
|
|
1400
|
-
DateSeparator:
|
|
1450
|
+
DateSeparator: nt,
|
|
1401
1451
|
doSendMessageRequest: m,
|
|
1402
1452
|
children: /* @__PURE__ */ e(
|
|
1403
|
-
|
|
1453
|
+
_t,
|
|
1404
1454
|
{
|
|
1405
|
-
onBack:
|
|
1455
|
+
onBack: t,
|
|
1406
1456
|
showBackButton: n,
|
|
1407
|
-
renderMessageInputActions:
|
|
1408
|
-
onLeaveConversation:
|
|
1457
|
+
renderMessageInputActions: r,
|
|
1458
|
+
onLeaveConversation: o,
|
|
1409
1459
|
onBlockParticipant: d,
|
|
1410
1460
|
CustomChannelEmptyState: u,
|
|
1411
1461
|
showDeleteConversation: f,
|
|
1412
1462
|
onDeleteConversationClick: g,
|
|
1413
|
-
onBlockParticipantClick:
|
|
1414
|
-
onReportParticipantClick:
|
|
1463
|
+
onBlockParticipantClick: C,
|
|
1464
|
+
onReportParticipantClick: N,
|
|
1415
1465
|
showStarButton: S,
|
|
1416
1466
|
chatbotVotingEnabled: v,
|
|
1417
1467
|
renderChannelBanner: k,
|
|
@@ -1424,16 +1474,16 @@ const bt = ({
|
|
|
1424
1474
|
);
|
|
1425
1475
|
}
|
|
1426
1476
|
);
|
|
1427
|
-
|
|
1428
|
-
function
|
|
1429
|
-
searchQuery:
|
|
1430
|
-
setSearchQuery:
|
|
1477
|
+
Ge.displayName = "ChannelView";
|
|
1478
|
+
function It({
|
|
1479
|
+
searchQuery: s,
|
|
1480
|
+
setSearchQuery: t,
|
|
1431
1481
|
placeholder: n
|
|
1432
1482
|
}) {
|
|
1433
|
-
const
|
|
1483
|
+
const r = Y(null);
|
|
1434
1484
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1435
1485
|
/* @__PURE__ */ e(
|
|
1436
|
-
|
|
1486
|
+
Ys,
|
|
1437
1487
|
{
|
|
1438
1488
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1439
1489
|
weight: "bold"
|
|
@@ -1442,42 +1492,42 @@ function vt({
|
|
|
1442
1492
|
/* @__PURE__ */ e(
|
|
1443
1493
|
"input",
|
|
1444
1494
|
{
|
|
1445
|
-
ref:
|
|
1495
|
+
ref: r,
|
|
1446
1496
|
type: "text",
|
|
1447
1497
|
placeholder: n,
|
|
1448
|
-
value:
|
|
1449
|
-
onChange: (
|
|
1498
|
+
value: s,
|
|
1499
|
+
onChange: (o) => t(o.target.value),
|
|
1450
1500
|
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"
|
|
1451
1501
|
}
|
|
1452
1502
|
),
|
|
1453
|
-
|
|
1454
|
-
|
|
1503
|
+
s && /* @__PURE__ */ e(
|
|
1504
|
+
$e,
|
|
1455
1505
|
{
|
|
1456
1506
|
label: "Clear search",
|
|
1457
1507
|
onClick: () => {
|
|
1458
|
-
var
|
|
1459
|
-
|
|
1508
|
+
var o;
|
|
1509
|
+
t(""), (o = r.current) == null || o.focus();
|
|
1460
1510
|
},
|
|
1461
1511
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1462
|
-
children: /* @__PURE__ */ e(
|
|
1512
|
+
children: /* @__PURE__ */ e(ye, { className: "h-4 w-4", weight: "bold" })
|
|
1463
1513
|
}
|
|
1464
1514
|
)
|
|
1465
1515
|
] });
|
|
1466
1516
|
}
|
|
1467
|
-
const
|
|
1468
|
-
participantSource:
|
|
1469
|
-
onSelectParticipant:
|
|
1517
|
+
const St = ({
|
|
1518
|
+
participantSource: s,
|
|
1519
|
+
onSelectParticipant: t,
|
|
1470
1520
|
onClose: n,
|
|
1471
|
-
existingParticipantIds:
|
|
1472
|
-
participantLabel:
|
|
1521
|
+
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1522
|
+
participantLabel: o = "participants",
|
|
1473
1523
|
searchPlaceholder: d = "Search participants...",
|
|
1474
|
-
className:
|
|
1524
|
+
className: l
|
|
1475
1525
|
}) => {
|
|
1476
|
-
const { debug: u } = fe(), [f, g] =
|
|
1526
|
+
const { debug: u } = fe(), [f, g] = I(""), [C, N] = I([]), [y, a] = I(!1), [E, S] = I(null), [v, k] = I(
|
|
1477
1527
|
null
|
|
1478
|
-
), b =
|
|
1479
|
-
|
|
1480
|
-
if (
|
|
1528
|
+
), b = Y(!1);
|
|
1529
|
+
q(() => {
|
|
1530
|
+
if (s.loading) {
|
|
1481
1531
|
u && console.log(
|
|
1482
1532
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1483
1533
|
);
|
|
@@ -1485,14 +1535,14 @@ const wt = ({
|
|
|
1485
1535
|
}
|
|
1486
1536
|
if (b.current) return;
|
|
1487
1537
|
(async () => {
|
|
1488
|
-
u && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1538
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), S(null);
|
|
1489
1539
|
try {
|
|
1490
|
-
const c = await
|
|
1540
|
+
const c = await s.loadParticipants({
|
|
1491
1541
|
search: "",
|
|
1492
1542
|
// Load all participants initially
|
|
1493
1543
|
limit: 100
|
|
1494
1544
|
});
|
|
1495
|
-
|
|
1545
|
+
N(c.participants), b.current = !0, u && console.log(
|
|
1496
1546
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1497
1547
|
c.participants.length
|
|
1498
1548
|
);
|
|
@@ -1500,11 +1550,11 @@ const wt = ({
|
|
|
1500
1550
|
const x = c instanceof Error ? c.message : "Failed to load participants";
|
|
1501
1551
|
S(x), console.error("[ParticipantPicker] Failed to load participants:", c);
|
|
1502
1552
|
} finally {
|
|
1503
|
-
|
|
1553
|
+
a(!1);
|
|
1504
1554
|
}
|
|
1505
1555
|
})();
|
|
1506
|
-
}, [
|
|
1507
|
-
const m =
|
|
1556
|
+
}, [s.loading, u]);
|
|
1557
|
+
const m = C.filter((h) => !r.has(h.id)).filter((h) => {
|
|
1508
1558
|
var x;
|
|
1509
1559
|
if (!f) return !0;
|
|
1510
1560
|
const c = f.toLowerCase();
|
|
@@ -1514,32 +1564,32 @@ const wt = ({
|
|
|
1514
1564
|
if (!v) {
|
|
1515
1565
|
k(h.id);
|
|
1516
1566
|
try {
|
|
1517
|
-
await
|
|
1567
|
+
await t(h);
|
|
1518
1568
|
} catch (c) {
|
|
1519
1569
|
console.error("[ParticipantPicker] Failed to start chat:", c), k(null);
|
|
1520
1570
|
}
|
|
1521
1571
|
}
|
|
1522
1572
|
},
|
|
1523
|
-
[
|
|
1524
|
-
),
|
|
1573
|
+
[t, v]
|
|
1574
|
+
), T = (h, c) => {
|
|
1525
1575
|
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(c));
|
|
1526
1576
|
};
|
|
1527
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1577
|
+
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", l), children: [
|
|
1528
1578
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1529
1579
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1530
1580
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1531
|
-
/* @__PURE__ */ e(
|
|
1581
|
+
/* @__PURE__ */ e(ze, { onClick: n })
|
|
1532
1582
|
] }),
|
|
1533
1583
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1534
1584
|
"Select a ",
|
|
1535
|
-
|
|
1585
|
+
o.slice(0, -1),
|
|
1536
1586
|
" to start messaging (",
|
|
1537
1587
|
m.length,
|
|
1538
1588
|
" available)",
|
|
1539
|
-
|
|
1589
|
+
s.totalCount !== void 0 && ` • ${s.totalCount} ${o} total`
|
|
1540
1590
|
] }),
|
|
1541
1591
|
/* @__PURE__ */ e(
|
|
1542
|
-
|
|
1592
|
+
It,
|
|
1543
1593
|
{
|
|
1544
1594
|
searchQuery: f,
|
|
1545
1595
|
setSearchQuery: g,
|
|
@@ -1549,21 +1599,21 @@ const wt = ({
|
|
|
1549
1599
|
] }),
|
|
1550
1600
|
E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1551
1601
|
"Error loading ",
|
|
1552
|
-
|
|
1602
|
+
o,
|
|
1553
1603
|
": ",
|
|
1554
1604
|
E
|
|
1555
1605
|
] }),
|
|
1556
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1606
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: y && m.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1557
1607
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1558
1608
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1559
1609
|
"Loading ",
|
|
1560
|
-
|
|
1610
|
+
o,
|
|
1561
1611
|
"..."
|
|
1562
1612
|
] })
|
|
1563
1613
|
] }) }) : m.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1564
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1565
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${
|
|
1566
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" :
|
|
1614
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Te, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1615
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${o} found` : C.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
|
|
1616
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : C.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
|
|
1567
1617
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1568
1618
|
m.map((h) => {
|
|
1569
1619
|
const c = h.name || h.email || h.id, x = h.email && h.name ? h.email : h.phone;
|
|
@@ -1572,7 +1622,7 @@ const wt = ({
|
|
|
1572
1622
|
{
|
|
1573
1623
|
type: "button",
|
|
1574
1624
|
onClick: () => w(h),
|
|
1575
|
-
onKeyDown: (
|
|
1625
|
+
onKeyDown: (A) => T(A, h),
|
|
1576
1626
|
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",
|
|
1577
1627
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1578
1628
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
@@ -1590,18 +1640,18 @@ const wt = ({
|
|
|
1590
1640
|
x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
|
|
1591
1641
|
] })
|
|
1592
1642
|
] }),
|
|
1593
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === h.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(
|
|
1643
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === h.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Te, { className: "h-5 w-5 text-stone" }) })
|
|
1594
1644
|
] })
|
|
1595
1645
|
}
|
|
1596
1646
|
) }, h.id);
|
|
1597
1647
|
}),
|
|
1598
|
-
|
|
1648
|
+
y && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1599
1649
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1600
1650
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1601
1651
|
] }) })
|
|
1602
1652
|
] }) })
|
|
1603
1653
|
] });
|
|
1604
|
-
},
|
|
1654
|
+
}, Mt = ({ className: s }) => /* @__PURE__ */ i(
|
|
1605
1655
|
"svg",
|
|
1606
1656
|
{
|
|
1607
1657
|
width: "140",
|
|
@@ -1609,7 +1659,7 @@ const wt = ({
|
|
|
1609
1659
|
viewBox: "44 -2 144 126",
|
|
1610
1660
|
fill: "none",
|
|
1611
1661
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1612
|
-
className:
|
|
1662
|
+
className: s,
|
|
1613
1663
|
children: [
|
|
1614
1664
|
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1615
1665
|
/* @__PURE__ */ e(
|
|
@@ -1735,46 +1785,46 @@ const wt = ({
|
|
|
1735
1785
|
] })
|
|
1736
1786
|
]
|
|
1737
1787
|
}
|
|
1738
|
-
),
|
|
1739
|
-
({ hasChannels:
|
|
1740
|
-
/* @__PURE__ */ e(
|
|
1741
|
-
|
|
1788
|
+
), He = B.memo(
|
|
1789
|
+
({ hasChannels: s, channelsLoaded: 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: [
|
|
1790
|
+
/* @__PURE__ */ e(Mt, {}),
|
|
1791
|
+
t && !s && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1742
1792
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1743
1793
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1744
1794
|
] })
|
|
1745
1795
|
] }) })
|
|
1746
1796
|
);
|
|
1747
|
-
|
|
1748
|
-
const me =
|
|
1797
|
+
He.displayName = "EmptyState";
|
|
1798
|
+
const me = B.memo(({ message: s, onBack: t }) => /* @__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: [
|
|
1749
1799
|
/* @__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: "⚠️" }) }),
|
|
1750
1800
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1751
|
-
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children:
|
|
1752
|
-
|
|
1801
|
+
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: s }),
|
|
1802
|
+
t && /* @__PURE__ */ e(
|
|
1753
1803
|
"button",
|
|
1754
1804
|
{
|
|
1755
1805
|
type: "button",
|
|
1756
|
-
onClick:
|
|
1806
|
+
onClick: t,
|
|
1757
1807
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[#7f22fe] hover:bg-primary-alt rounded-lg focus:outline-none focus:ring-2 focus:ring-primary transition-colors",
|
|
1758
1808
|
children: "Go Back"
|
|
1759
1809
|
}
|
|
1760
1810
|
)
|
|
1761
1811
|
] }) }));
|
|
1762
1812
|
me.displayName = "ErrorState";
|
|
1763
|
-
const
|
|
1764
|
-
capabilities:
|
|
1765
|
-
className:
|
|
1813
|
+
const At = ({
|
|
1814
|
+
capabilities: s = {},
|
|
1815
|
+
className: t,
|
|
1766
1816
|
renderMessageInputActions: n,
|
|
1767
|
-
onChannelSelect:
|
|
1768
|
-
onParticipantSelect:
|
|
1817
|
+
onChannelSelect: r,
|
|
1818
|
+
onParticipantSelect: o,
|
|
1769
1819
|
initialParticipantFilter: d,
|
|
1770
|
-
initialParticipantData:
|
|
1820
|
+
initialParticipantData: l,
|
|
1771
1821
|
CustomChannelEmptyState: u,
|
|
1772
1822
|
showChannelList: f = !0,
|
|
1773
1823
|
filters: g,
|
|
1774
|
-
channelListCustomEmptyStateIndicator:
|
|
1775
|
-
onDeleteConversationClick:
|
|
1776
|
-
onBlockParticipantClick:
|
|
1777
|
-
onReportParticipantClick:
|
|
1824
|
+
channelListCustomEmptyStateIndicator: C,
|
|
1825
|
+
onDeleteConversationClick: N,
|
|
1826
|
+
onBlockParticipantClick: y,
|
|
1827
|
+
onReportParticipantClick: a,
|
|
1778
1828
|
dmAgentEnabled: E,
|
|
1779
1829
|
messageMetadata: S,
|
|
1780
1830
|
onMessageSent: v,
|
|
@@ -1782,67 +1832,67 @@ const Tt = ({
|
|
|
1782
1832
|
chatbotVotingEnabled: b = !1,
|
|
1783
1833
|
renderMessagePreview: m,
|
|
1784
1834
|
renderChannelBanner: w,
|
|
1785
|
-
customChannelActions:
|
|
1835
|
+
customChannelActions: T
|
|
1786
1836
|
}) => {
|
|
1787
1837
|
const {
|
|
1788
1838
|
service: h,
|
|
1789
1839
|
client: c,
|
|
1790
1840
|
isConnected: x,
|
|
1791
|
-
isLoading:
|
|
1792
|
-
error:
|
|
1793
|
-
refreshConnection:
|
|
1841
|
+
isLoading: A,
|
|
1842
|
+
error: _,
|
|
1843
|
+
refreshConnection: R,
|
|
1794
1844
|
debug: M
|
|
1795
|
-
} =
|
|
1796
|
-
participantSource:
|
|
1845
|
+
} = qs(), [H, z] = I(null), [ee, Z] = I(!1), [se, te] = I(!1), [re, V] = I(!1), [X, P] = I(/* @__PURE__ */ new Set()), [U, G] = I(0), [F, W] = I(!1), [ae, J] = I(null), Q = Y(null), {
|
|
1846
|
+
participantSource: le,
|
|
1797
1847
|
participantLabel: Ee = "participants",
|
|
1798
|
-
showDeleteConversation:
|
|
1799
|
-
} =
|
|
1800
|
-
const
|
|
1848
|
+
showDeleteConversation: Ve = !0
|
|
1849
|
+
} = s, We = B.useMemo(() => {
|
|
1850
|
+
const p = c == null ? void 0 : c.userID;
|
|
1801
1851
|
return {
|
|
1802
1852
|
...{
|
|
1803
1853
|
type: "messaging",
|
|
1804
1854
|
last_message_at: { $exists: !0 },
|
|
1805
|
-
...
|
|
1806
|
-
members: { $in: [
|
|
1855
|
+
...p && {
|
|
1856
|
+
members: { $in: [p] },
|
|
1807
1857
|
hidden: !1
|
|
1808
1858
|
}
|
|
1809
1859
|
},
|
|
1810
1860
|
...g
|
|
1811
1861
|
};
|
|
1812
|
-
}, [g, c == null ? void 0 : c.userID]),
|
|
1862
|
+
}, [g, c == null ? void 0 : c.userID]), oe = Y(null), ne = L(async () => {
|
|
1813
1863
|
if (!c || !x) return;
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1864
|
+
const p = c.userID;
|
|
1865
|
+
if (p)
|
|
1816
1866
|
try {
|
|
1817
|
-
M && console.log("[MessagingShell] Syncing channels for user:",
|
|
1867
|
+
M && console.log("[MessagingShell] Syncing channels for user:", p);
|
|
1818
1868
|
const $ = await c.queryChannels(
|
|
1819
1869
|
{
|
|
1820
1870
|
type: "messaging",
|
|
1821
|
-
members: { $in: [
|
|
1871
|
+
members: { $in: [p] }
|
|
1822
1872
|
},
|
|
1823
1873
|
{},
|
|
1824
1874
|
{ limit: 100 }
|
|
1825
|
-
),
|
|
1826
|
-
$.forEach((
|
|
1827
|
-
const ge =
|
|
1828
|
-
Object.values(ge).forEach((
|
|
1829
|
-
var
|
|
1830
|
-
const xe = (
|
|
1831
|
-
xe && xe !==
|
|
1875
|
+
), O = /* @__PURE__ */ new Set();
|
|
1876
|
+
$.forEach((j) => {
|
|
1877
|
+
const ge = j.state.members;
|
|
1878
|
+
Object.values(ge).forEach((Ke) => {
|
|
1879
|
+
var _e;
|
|
1880
|
+
const xe = (_e = Ke.user) == null ? void 0 : _e.id;
|
|
1881
|
+
xe && xe !== p && O.add(xe);
|
|
1832
1882
|
});
|
|
1833
|
-
}), P((
|
|
1883
|
+
}), P((j) => j.size === O.size && [...j].every((ge) => O.has(ge)) ? j : O), Z($.length > 0), te(!0), oe.current = p, M && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1834
1884
|
channelCount: $.length,
|
|
1835
|
-
memberCount:
|
|
1885
|
+
memberCount: O.size
|
|
1836
1886
|
});
|
|
1837
1887
|
} catch ($) {
|
|
1838
1888
|
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
1839
1889
|
}
|
|
1840
1890
|
}, [c, x, M]);
|
|
1841
|
-
|
|
1891
|
+
q(() => {
|
|
1842
1892
|
if (!c || !x) return;
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1845
|
-
}, [c, x, ne]),
|
|
1893
|
+
const p = c.userID;
|
|
1894
|
+
p && oe.current !== p && ne();
|
|
1895
|
+
}, [c, x, ne]), q(() => {
|
|
1846
1896
|
if (!d || !c || !x) return;
|
|
1847
1897
|
(async () => {
|
|
1848
1898
|
const $ = c.userID;
|
|
@@ -1852,7 +1902,7 @@ const Tt = ({
|
|
|
1852
1902
|
"[MessagingShell] Loading initial conversation with:",
|
|
1853
1903
|
d
|
|
1854
1904
|
);
|
|
1855
|
-
const
|
|
1905
|
+
const O = await c.queryChannels(
|
|
1856
1906
|
{
|
|
1857
1907
|
type: "messaging",
|
|
1858
1908
|
members: { $eq: [$, d] }
|
|
@@ -1860,127 +1910,127 @@ const Tt = ({
|
|
|
1860
1910
|
{},
|
|
1861
1911
|
{ limit: 1 }
|
|
1862
1912
|
);
|
|
1863
|
-
if (
|
|
1864
|
-
z(
|
|
1913
|
+
if (O.length > 0)
|
|
1914
|
+
z(O[0]), W(!0), J(null), r && r(O[0]), M && console.log(
|
|
1865
1915
|
"[MessagingShell] Initial conversation loaded:",
|
|
1866
|
-
|
|
1916
|
+
O[0].id
|
|
1867
1917
|
);
|
|
1868
|
-
else if (
|
|
1918
|
+
else if (l && h) {
|
|
1869
1919
|
M && console.log(
|
|
1870
1920
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1871
|
-
|
|
1921
|
+
l
|
|
1872
1922
|
);
|
|
1873
1923
|
try {
|
|
1874
|
-
const
|
|
1875
|
-
id:
|
|
1876
|
-
name:
|
|
1877
|
-
email:
|
|
1878
|
-
phone:
|
|
1924
|
+
const j = await h.startChannelWithParticipant({
|
|
1925
|
+
id: l.id,
|
|
1926
|
+
name: l.name,
|
|
1927
|
+
email: l.email,
|
|
1928
|
+
phone: l.phone
|
|
1879
1929
|
});
|
|
1880
|
-
z(
|
|
1930
|
+
z(j), W(!0), J(null), r && r(j), M && console.log(
|
|
1881
1931
|
"[MessagingShell] Channel created and loaded:",
|
|
1882
|
-
|
|
1932
|
+
j.id
|
|
1883
1933
|
);
|
|
1884
|
-
} catch (
|
|
1934
|
+
} catch (j) {
|
|
1885
1935
|
console.error(
|
|
1886
1936
|
"[MessagingShell] Failed to create conversation:",
|
|
1887
|
-
|
|
1888
|
-
),
|
|
1937
|
+
j
|
|
1938
|
+
), J("Failed to create conversation");
|
|
1889
1939
|
}
|
|
1890
1940
|
} else
|
|
1891
|
-
|
|
1941
|
+
J(
|
|
1892
1942
|
"No conversation found with this account"
|
|
1893
1943
|
), M && console.log(
|
|
1894
1944
|
"[MessagingShell] No conversation found for:",
|
|
1895
1945
|
d
|
|
1896
1946
|
);
|
|
1897
|
-
} catch (
|
|
1947
|
+
} catch (O) {
|
|
1898
1948
|
console.error(
|
|
1899
1949
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1900
|
-
|
|
1901
|
-
),
|
|
1950
|
+
O
|
|
1951
|
+
), J("Failed to load conversation");
|
|
1902
1952
|
}
|
|
1903
1953
|
})();
|
|
1904
1954
|
}, [
|
|
1905
1955
|
d,
|
|
1906
|
-
|
|
1956
|
+
l,
|
|
1907
1957
|
c,
|
|
1908
1958
|
x,
|
|
1909
1959
|
h,
|
|
1910
1960
|
M,
|
|
1911
|
-
|
|
1961
|
+
r
|
|
1912
1962
|
]);
|
|
1913
|
-
const
|
|
1914
|
-
(
|
|
1915
|
-
z(
|
|
1963
|
+
const Ye = L(
|
|
1964
|
+
(p) => {
|
|
1965
|
+
z(p), r == null || r(p);
|
|
1916
1966
|
},
|
|
1917
|
-
[
|
|
1918
|
-
),
|
|
1967
|
+
[r]
|
|
1968
|
+
), qe = L(() => {
|
|
1919
1969
|
F || z(null);
|
|
1920
|
-
}, [F]),
|
|
1921
|
-
async (
|
|
1970
|
+
}, [F]), Ze = L(
|
|
1971
|
+
async (p) => {
|
|
1922
1972
|
var $;
|
|
1923
1973
|
if (h)
|
|
1924
1974
|
try {
|
|
1925
1975
|
M && console.log(
|
|
1926
1976
|
"[MessagingShell] Starting conversation with:",
|
|
1927
|
-
|
|
1977
|
+
p.id
|
|
1928
1978
|
);
|
|
1929
|
-
const
|
|
1930
|
-
id:
|
|
1931
|
-
name:
|
|
1932
|
-
email:
|
|
1933
|
-
phone:
|
|
1979
|
+
const O = await h.startChannelWithParticipant({
|
|
1980
|
+
id: p.id,
|
|
1981
|
+
name: p.name,
|
|
1982
|
+
email: p.email,
|
|
1983
|
+
phone: p.phone
|
|
1934
1984
|
});
|
|
1935
1985
|
try {
|
|
1936
|
-
await
|
|
1937
|
-
} catch (
|
|
1938
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
1986
|
+
await O.show();
|
|
1987
|
+
} catch (j) {
|
|
1988
|
+
console.warn("[MessagingShell] Failed to unhide channel:", j);
|
|
1939
1989
|
}
|
|
1940
|
-
z(
|
|
1941
|
-
} catch (
|
|
1942
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
1990
|
+
z(O), V(!1), ($ = Q.current) == null || $.close(), o == null || o(p);
|
|
1991
|
+
} catch (O) {
|
|
1992
|
+
console.error("[MessagingShell] Failed to start conversation:", O);
|
|
1943
1993
|
}
|
|
1944
1994
|
},
|
|
1945
|
-
[h,
|
|
1995
|
+
[h, o, M]
|
|
1946
1996
|
), ie = L(() => {
|
|
1947
|
-
var
|
|
1948
|
-
V(!1), (
|
|
1949
|
-
}, []),
|
|
1950
|
-
(
|
|
1951
|
-
|
|
1997
|
+
var p;
|
|
1998
|
+
V(!1), (p = Q.current) == null || p.close();
|
|
1999
|
+
}, []), Xe = L(
|
|
2000
|
+
(p) => {
|
|
2001
|
+
p.target === Q.current && ie();
|
|
1952
2002
|
},
|
|
1953
2003
|
[ie]
|
|
1954
|
-
),
|
|
1955
|
-
async (
|
|
1956
|
-
M && console.log("[MessagingShell] Leaving conversation:",
|
|
2004
|
+
), Je = L(
|
|
2005
|
+
async (p) => {
|
|
2006
|
+
M && console.log("[MessagingShell] Leaving conversation:", p.id), z(null), W(!1), oe.current = null, await ne();
|
|
1957
2007
|
},
|
|
1958
2008
|
[ne, M]
|
|
1959
|
-
),
|
|
1960
|
-
async (
|
|
1961
|
-
M && console.log("[MessagingShell] Blocking participant:",
|
|
2009
|
+
), Qe = L(
|
|
2010
|
+
async (p) => {
|
|
2011
|
+
M && console.log("[MessagingShell] Blocking participant:", p), z(null), W(!1), oe.current = null, await ne();
|
|
1962
2012
|
},
|
|
1963
2013
|
[ne, M]
|
|
1964
|
-
), ce = !!
|
|
1965
|
-
return
|
|
2014
|
+
), ce = !!H;
|
|
2015
|
+
return A ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(he, {}) }) : _ ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(me, { message: _, onBack: R }) }) : !x || !c ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(
|
|
1966
2016
|
me,
|
|
1967
2017
|
{
|
|
1968
2018
|
message: "Not connected to messaging service",
|
|
1969
|
-
onBack:
|
|
2019
|
+
onBack: R
|
|
1970
2020
|
}
|
|
1971
|
-
) }) : ae ? /* @__PURE__ */ e("div", { className:
|
|
2021
|
+
) }) : ae ? /* @__PURE__ */ e("div", { className: D("h-full", t), children: /* @__PURE__ */ e(me, { message: ae }) }) : /* @__PURE__ */ i(
|
|
1972
2022
|
"div",
|
|
1973
2023
|
{
|
|
1974
|
-
className:
|
|
2024
|
+
className: D(
|
|
1975
2025
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
1976
|
-
|
|
2026
|
+
t
|
|
1977
2027
|
),
|
|
1978
2028
|
children: [
|
|
1979
2029
|
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
1980
2030
|
/* @__PURE__ */ e(
|
|
1981
2031
|
"div",
|
|
1982
2032
|
{
|
|
1983
|
-
className:
|
|
2033
|
+
className: D(
|
|
1984
2034
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1985
2035
|
{
|
|
1986
2036
|
"!hidden": f === !1 || F,
|
|
@@ -1991,12 +2041,12 @@ const Tt = ({
|
|
|
1991
2041
|
}
|
|
1992
2042
|
),
|
|
1993
2043
|
children: /* @__PURE__ */ e(
|
|
1994
|
-
|
|
2044
|
+
je,
|
|
1995
2045
|
{
|
|
1996
|
-
onChannelSelect:
|
|
1997
|
-
selectedChannel:
|
|
1998
|
-
filters:
|
|
1999
|
-
customEmptyStateIndicator:
|
|
2046
|
+
onChannelSelect: Ye,
|
|
2047
|
+
selectedChannel: H || void 0,
|
|
2048
|
+
filters: We,
|
|
2049
|
+
customEmptyStateIndicator: C,
|
|
2000
2050
|
renderMessagePreview: m
|
|
2001
2051
|
}
|
|
2002
2052
|
)
|
|
@@ -2005,7 +2055,7 @@ const Tt = ({
|
|
|
2005
2055
|
/* @__PURE__ */ e(
|
|
2006
2056
|
"div",
|
|
2007
2057
|
{
|
|
2008
|
-
className:
|
|
2058
|
+
className: D(
|
|
2009
2059
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2010
2060
|
{
|
|
2011
2061
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
@@ -2014,34 +2064,34 @@ const Tt = ({
|
|
|
2014
2064
|
"hidden lg:flex": !F && !ce && !d
|
|
2015
2065
|
}
|
|
2016
2066
|
),
|
|
2017
|
-
children:
|
|
2018
|
-
|
|
2067
|
+
children: H ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2068
|
+
Ge,
|
|
2019
2069
|
{
|
|
2020
|
-
channel:
|
|
2021
|
-
onBack:
|
|
2070
|
+
channel: H,
|
|
2071
|
+
onBack: qe,
|
|
2022
2072
|
showBackButton: !F,
|
|
2023
2073
|
renderMessageInputActions: n,
|
|
2024
2074
|
renderChannelBanner: w,
|
|
2025
|
-
onLeaveConversation:
|
|
2026
|
-
onBlockParticipant:
|
|
2075
|
+
onLeaveConversation: Je,
|
|
2076
|
+
onBlockParticipant: Qe,
|
|
2027
2077
|
CustomChannelEmptyState: u,
|
|
2028
|
-
showDeleteConversation:
|
|
2029
|
-
onDeleteConversationClick:
|
|
2030
|
-
onBlockParticipantClick:
|
|
2031
|
-
onReportParticipantClick:
|
|
2078
|
+
showDeleteConversation: Ve,
|
|
2079
|
+
onDeleteConversationClick: N,
|
|
2080
|
+
onBlockParticipantClick: y,
|
|
2081
|
+
onReportParticipantClick: a,
|
|
2032
2082
|
dmAgentEnabled: E,
|
|
2033
2083
|
messageMetadata: S,
|
|
2034
2084
|
onMessageSent: v,
|
|
2035
2085
|
showStarButton: k,
|
|
2036
2086
|
chatbotVotingEnabled: b,
|
|
2037
|
-
customChannelActions:
|
|
2087
|
+
customChannelActions: T
|
|
2038
2088
|
},
|
|
2039
|
-
|
|
2089
|
+
H.id
|
|
2040
2090
|
) }) : d ? (
|
|
2041
2091
|
// Show loading while creating/loading direct conversation channel
|
|
2042
2092
|
/* @__PURE__ */ e(he, {})
|
|
2043
2093
|
) : /* @__PURE__ */ e(
|
|
2044
|
-
|
|
2094
|
+
He,
|
|
2045
2095
|
{
|
|
2046
2096
|
hasChannels: ee,
|
|
2047
2097
|
channelsLoaded: se
|
|
@@ -2050,69 +2100,69 @@ const Tt = ({
|
|
|
2050
2100
|
}
|
|
2051
2101
|
)
|
|
2052
2102
|
] }),
|
|
2053
|
-
|
|
2103
|
+
le && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2054
2104
|
/* @__PURE__ */ e(
|
|
2055
2105
|
"dialog",
|
|
2056
2106
|
{
|
|
2057
|
-
ref:
|
|
2107
|
+
ref: Q,
|
|
2058
2108
|
className: "mes-dialog",
|
|
2059
|
-
onClick:
|
|
2109
|
+
onClick: Xe,
|
|
2060
2110
|
onClose: ie,
|
|
2061
2111
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2062
|
-
|
|
2112
|
+
St,
|
|
2063
2113
|
{
|
|
2064
|
-
participantSource:
|
|
2065
|
-
onSelectParticipant:
|
|
2114
|
+
participantSource: le,
|
|
2115
|
+
onSelectParticipant: Ze,
|
|
2066
2116
|
onClose: ie,
|
|
2067
|
-
existingParticipantIds:
|
|
2117
|
+
existingParticipantIds: X,
|
|
2068
2118
|
participantLabel: Ee,
|
|
2069
2119
|
searchPlaceholder: `Search ${Ee}...`
|
|
2070
2120
|
},
|
|
2071
|
-
|
|
2121
|
+
U
|
|
2072
2122
|
) })
|
|
2073
2123
|
}
|
|
2074
2124
|
)
|
|
2075
2125
|
]
|
|
2076
2126
|
}
|
|
2077
2127
|
);
|
|
2078
|
-
},
|
|
2079
|
-
question:
|
|
2080
|
-
onClick:
|
|
2128
|
+
}, kt = ({
|
|
2129
|
+
question: s,
|
|
2130
|
+
onClick: t,
|
|
2081
2131
|
loading: n = !1,
|
|
2082
|
-
className:
|
|
2132
|
+
className: r
|
|
2083
2133
|
}) => /* @__PURE__ */ e(
|
|
2084
2134
|
"button",
|
|
2085
2135
|
{
|
|
2086
2136
|
type: "button",
|
|
2087
|
-
onClick:
|
|
2137
|
+
onClick: t,
|
|
2088
2138
|
disabled: n,
|
|
2089
2139
|
style: { backgroundColor: "#E6E5E3" },
|
|
2090
|
-
className:
|
|
2140
|
+
className: D(
|
|
2091
2141
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
|
|
2092
2142
|
{
|
|
2093
2143
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2094
2144
|
"opacity-50 cursor-not-allowed": n
|
|
2095
2145
|
},
|
|
2096
|
-
|
|
2146
|
+
r
|
|
2097
2147
|
),
|
|
2098
|
-
children:
|
|
2148
|
+
children: s
|
|
2099
2149
|
}
|
|
2100
|
-
),
|
|
2101
|
-
faqs:
|
|
2102
|
-
onFaqClick:
|
|
2150
|
+
), Bt = ({
|
|
2151
|
+
faqs: s,
|
|
2152
|
+
onFaqClick: t,
|
|
2103
2153
|
loadingFaqId: n,
|
|
2104
|
-
headerText:
|
|
2105
|
-
className:
|
|
2154
|
+
headerText: r,
|
|
2155
|
+
className: o,
|
|
2106
2156
|
avatarImage: d,
|
|
2107
|
-
avatarName:
|
|
2157
|
+
avatarName: l
|
|
2108
2158
|
}) => {
|
|
2109
|
-
const u =
|
|
2110
|
-
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className:
|
|
2111
|
-
(d ||
|
|
2159
|
+
const u = s.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
|
|
2160
|
+
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2161
|
+
(d || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2112
2162
|
K,
|
|
2113
2163
|
{
|
|
2114
|
-
id:
|
|
2115
|
-
name:
|
|
2164
|
+
id: l || "account",
|
|
2165
|
+
name: l || "Account",
|
|
2116
2166
|
image: d,
|
|
2117
2167
|
size: 24,
|
|
2118
2168
|
shape: "circle"
|
|
@@ -2124,12 +2174,12 @@ const Tt = ({
|
|
|
2124
2174
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2125
2175
|
style: { backgroundColor: "#F1F0EE" },
|
|
2126
2176
|
children: [
|
|
2127
|
-
|
|
2177
|
+
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2128
2178
|
u.map((f) => /* @__PURE__ */ e(
|
|
2129
|
-
|
|
2179
|
+
kt,
|
|
2130
2180
|
{
|
|
2131
2181
|
question: f.question,
|
|
2132
|
-
onClick: () =>
|
|
2182
|
+
onClick: () => t(f.id),
|
|
2133
2183
|
loading: n === f.id
|
|
2134
2184
|
},
|
|
2135
2185
|
f.id
|
|
@@ -2138,42 +2188,42 @@ const Tt = ({
|
|
|
2138
2188
|
}
|
|
2139
2189
|
)
|
|
2140
2190
|
] }) });
|
|
2141
|
-
},
|
|
2142
|
-
const { initialSearch: n = "", pageSize:
|
|
2143
|
-
if (
|
|
2144
|
-
const h =
|
|
2191
|
+
}, jt = (s, t = {}) => {
|
|
2192
|
+
const { initialSearch: n = "", pageSize: r = 20 } = t, [o, d] = I([]), [l, u] = I(!1), [f, g] = I(null), [C, N] = I(n), [y, a] = I(!0), [E, S] = I(), v = L(async (w = !1, T) => {
|
|
2193
|
+
if (l) return;
|
|
2194
|
+
const h = T !== void 0 ? T : C;
|
|
2145
2195
|
u(!0), g(null);
|
|
2146
2196
|
try {
|
|
2147
|
-
const c = await
|
|
2197
|
+
const c = await s.loadParticipants({
|
|
2148
2198
|
search: h || void 0,
|
|
2149
|
-
limit:
|
|
2199
|
+
limit: r,
|
|
2150
2200
|
cursor: w ? void 0 : E
|
|
2151
2201
|
});
|
|
2152
2202
|
d(
|
|
2153
2203
|
(x) => w ? c.participants : [...x, ...c.participants]
|
|
2154
|
-
),
|
|
2204
|
+
), a(c.hasMore), S(c.nextCursor);
|
|
2155
2205
|
} catch (c) {
|
|
2156
2206
|
const x = c instanceof Error ? c.message : "Failed to load participants";
|
|
2157
2207
|
g(x), console.error("[useParticipants] Load error:", c);
|
|
2158
2208
|
} finally {
|
|
2159
2209
|
u(!1);
|
|
2160
2210
|
}
|
|
2161
|
-
}, [
|
|
2162
|
-
|
|
2163
|
-
}, [
|
|
2164
|
-
|
|
2211
|
+
}, [s, C, E, r, l]), k = L(() => {
|
|
2212
|
+
y && !l && v(!1);
|
|
2213
|
+
}, [y, l, v]), b = L((w) => {
|
|
2214
|
+
N(w), S(void 0), v(!0, w);
|
|
2165
2215
|
}, [v]), m = L(() => {
|
|
2166
2216
|
S(void 0), v(!0);
|
|
2167
2217
|
}, [v]);
|
|
2168
|
-
return
|
|
2218
|
+
return q(() => {
|
|
2169
2219
|
v(!0);
|
|
2170
|
-
}, [
|
|
2171
|
-
participants:
|
|
2172
|
-
loading:
|
|
2220
|
+
}, [s.loadParticipants]), {
|
|
2221
|
+
participants: o,
|
|
2222
|
+
loading: l,
|
|
2173
2223
|
error: f,
|
|
2174
|
-
searchQuery:
|
|
2175
|
-
hasMore:
|
|
2176
|
-
totalCount:
|
|
2224
|
+
searchQuery: C,
|
|
2225
|
+
hasMore: y,
|
|
2226
|
+
totalCount: s.totalCount,
|
|
2177
2227
|
loadMore: k,
|
|
2178
2228
|
search: b,
|
|
2179
2229
|
refresh: m
|
|
@@ -2182,18 +2232,18 @@ const Tt = ({
|
|
|
2182
2232
|
export {
|
|
2183
2233
|
de as ActionButton,
|
|
2184
2234
|
K as Avatar,
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2235
|
+
wt as ChannelEmptyState,
|
|
2236
|
+
je as ChannelList,
|
|
2237
|
+
Ge as ChannelView,
|
|
2238
|
+
Bt as FaqList,
|
|
2239
|
+
kt as FaqListItem,
|
|
2240
|
+
it as MessageVoteButtons,
|
|
2241
|
+
Ot as MessagingProvider,
|
|
2242
|
+
At as MessagingShell,
|
|
2243
|
+
St as ParticipantPicker,
|
|
2244
|
+
Xs as formatRelativeTime,
|
|
2245
|
+
at as useMessageVote,
|
|
2246
|
+
qs as useMessaging,
|
|
2247
|
+
jt as useParticipants
|
|
2198
2248
|
};
|
|
2199
2249
|
//# sourceMappingURL=index.js.map
|