@linktr.ee/messaging-react 1.33.3 → 1.35.0-rc-1777516745
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/Card-BXKUE7JN.js +195 -0
- package/dist/Card-BXKUE7JN.js.map +1 -0
- package/dist/Card-J-rj8Q6w.js +167 -0
- package/dist/Card-J-rj8Q6w.js.map +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{index-Ydi1pTAi.js → index-B3H4GLek.js} +1067 -987
- package/dist/index-B3H4GLek.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +29 -0
- package/src/components/Avatar/index.tsx +43 -20
- package/src/components/ChannelView.stories.tsx +45 -1
- package/src/components/ChannelView.tsx +9 -5
- package/src/components/CustomMessage/CustomMessage.stories.tsx +75 -15
- package/src/components/CustomMessage/MessageTag.stories.tsx +1 -1
- package/src/components/CustomMessage/index.tsx +8 -5
- package/src/components/CustomTypingIndicator/CustomTypingIndicator.stories.tsx +114 -0
- package/src/components/CustomTypingIndicator/index.tsx +101 -0
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +94 -66
- package/src/components/LockedAttachment/components/Creator/Card.tsx +55 -23
- package/src/components/LockedAttachment/components/Creator/CardThumbnail.tsx +2 -2
- package/src/components/LockedAttachment/components/Visitor/Card.tsx +9 -16
- package/src/components/LockedAttachment/components/Visitor/CardActions.tsx +3 -12
- package/src/components/LockedAttachment/components/Visitor/CardThumbnail.tsx +2 -2
- package/src/components/MediaMessage/MediaMessage.stories.tsx +77 -71
- package/src/components/MediaMessage/index.tsx +1 -1
- package/src/styles.css +27 -5
- package/dist/Card-BfA8wq8O.js +0 -181
- package/dist/Card-BfA8wq8O.js.map +0 -1
- package/dist/Card-Bpud_enW.js +0 -177
- package/dist/Card-Bpud_enW.js.map +0 -1
- package/dist/index-Ydi1pTAi.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as se } from "react/jsx-runtime";
|
|
2
2
|
import O from "classnames";
|
|
3
|
-
import z, { createContext as ot, useContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import z, { createContext as ot, useContext as ct, useCallback as A, useState as k, useRef as X, useEffect as q, useMemo as Be, Suspense as dt } from "react";
|
|
4
|
+
import { StreamChatService as Dt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Rt, ChannelList as Pt, DateSeparator as Lt, useChannelStateContext as me, useChatContext as Ye, areMessageUIPropsEqual as Ft, useMessageReminder as At, useComponentContext as ut, Attachment as Ot, EditMessageModal as Ut, MessageBlocked as $t, MessageBouncePrompt as zt, MessageDeleted as Bt, MessageIsThreadReplyInChannelButtonIndicator as jt, MessageRepliesCountButton as Gt, ReminderNotification as Vt, StreamedMessageText as Ht, messageHasAttachments as Yt, messageHasReactions as Wt, isDateSeparatorMessage as qt, isMessageBlocked as Zt, isMessageBounced as Xt, MessageBounceModal as Kt, MessageText as Ke, Poll as Jt, MessageErrorIcon as Qt, useMessageContext as mt, useMessageComposer as es, useStateStore as ts, MessageInput as ss, useMessageInputContext as ns, useMessageComposerHasSendableData as as, SimpleAttachmentSelector as rs, QuotedMessagePreview as is, AttachmentPreviewList as ls, TextareaComposer as os, MessageTimestamp as Oe, useTypingContext as cs, Channel as ds, WithComponents as us, Window as ms, MessageList as hs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as je, GiftIcon as fs, XIcon as Re, SpinnerGapIcon as ke, SignOutIcon as gs, ProhibitInsetIcon as Je, FlagIcon as bs, ArrowUpIcon as ps, SparkleIcon as xs, ProhibitIcon as vs, ArrowLeftIcon as Qe, CaretRightIcon as et, DotsThreeIcon as tt, MagnifyingGlassIcon as ws, ChatCircleDotsIcon as st, FileIcon as ht, ImageIcon as Ns, SpeakerHighIcon as ys, VideoCameraIcon as Cs, FileMdIcon as _s, FileTextIcon as Es, FileZipIcon as Ss, FilePptIcon as Is, FileCsvIcon as ks, FileXlsIcon as Ts, FileDocIcon as Ms, FilePdfIcon as Ds, CircleNotchIcon as ft, PlayIcon as nt, PauseIcon as Rs, LinkIcon as Ps, DownloadSimpleIcon as Ls } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as at } from "stream-chat";
|
|
8
|
+
const gt = ot({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,59 +15,59 @@ const ft = ot({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), Pe = () => ct(gt), ra = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: i,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: u = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const r = A(
|
|
27
|
-
(m, ...
|
|
28
|
-
|
|
27
|
+
(m, ...b) => {
|
|
28
|
+
u && console.log(`🔥 [MessagingProvider] ${m}`, ...b);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[u]
|
|
31
31
|
);
|
|
32
32
|
r("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (i == null ? void 0 : i.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [
|
|
38
|
+
const [d, x] = k(null), [o, h] = k(null), [f, N] = k(!1), [a, _] = k(!1), [w, g] = k(null), y = X(!1), I = X({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: i,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
43
|
}), C = X(0);
|
|
44
44
|
C.current++, r("📊 RENDER INFO", {
|
|
45
45
|
renderCount: C.current,
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (i == null ? void 0 : i.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: I.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: I.current.apiKey !== i,
|
|
50
|
+
serviceConfigChanged: I.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: I.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), I.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: i,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
58
|
}, q(() => {
|
|
59
59
|
const m = C.current;
|
|
60
60
|
if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: m,
|
|
62
|
-
apiKey: !!
|
|
62
|
+
apiKey: !!i,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (i == null ? void 0 : i.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: I.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: I.current.apiKey === i
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
70
|
+
}), !i || !n) {
|
|
71
71
|
r("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: m,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
@@ -76,43 +76,43 @@ const ft = ot({
|
|
|
76
76
|
}
|
|
77
77
|
r("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: m,
|
|
79
|
-
apiKey: (
|
|
80
|
-
serviceConfigChanged:
|
|
79
|
+
apiKey: (i == null ? void 0 : i.substring(0, 8)) + "...",
|
|
80
|
+
serviceConfigChanged: I.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const b = new Dt({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
85
|
-
debug:
|
|
84
|
+
apiKey: i,
|
|
85
|
+
debug: u
|
|
86
86
|
});
|
|
87
|
-
return x(
|
|
87
|
+
return x(b), r("✅ SERVICE SET", {
|
|
88
88
|
renderCount: m,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!b
|
|
90
90
|
}), () => {
|
|
91
91
|
r("🧹 SERVICE CLEANUP", {
|
|
92
92
|
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), b.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
96
|
+
}, [i, n, u, r]);
|
|
97
|
+
const S = X(null);
|
|
98
98
|
q(() => {
|
|
99
|
-
var
|
|
99
|
+
var b, T;
|
|
100
100
|
if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!
|
|
101
|
+
hasService: !!d,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
104
|
+
isConnecting: y.current,
|
|
105
|
+
isConnected: f,
|
|
106
|
+
dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
|
|
107
|
+
}), !d || !s) {
|
|
108
108
|
r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (y.current) {
|
|
112
112
|
r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((b = S.current) == null ? void 0 : b.serviceId) === d && ((T = S.current) == null ? void 0 : T.userId) === s.id) {
|
|
116
116
|
r(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,119 +120,119 @@ const ft = ot({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
r("🚀 STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
r("🚀 STARTING USER CONNECTION", { userId: s.id }), y.current = !0, _(!0), g(null);
|
|
124
124
|
try {
|
|
125
125
|
r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const M = await
|
|
127
|
-
|
|
126
|
+
const M = await d.connectUser(s);
|
|
127
|
+
h(M), N(!0), S.current = { serviceId: d, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: M.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (M) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const P = M instanceof Error ? M.message : "Connection failed";
|
|
133
|
+
g(P), r("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: P
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
_(!1),
|
|
138
|
+
_(!1), y.current = !1, r("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: f
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
146
|
-
isConnected:
|
|
144
|
+
}, [d, s, r, f]), q(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!d,
|
|
146
|
+
isConnected: f
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
d && f ? (r(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
152
|
-
hasService: !!
|
|
153
|
-
isConnected:
|
|
151
|
+
), S.current = null, d.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!d,
|
|
153
|
+
isConnected: f
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const
|
|
155
|
+
}), [d, f, r]);
|
|
156
|
+
const L = A(async () => {
|
|
157
157
|
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!
|
|
158
|
+
hasService: !!d,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
160
|
+
}), !d || !s) {
|
|
161
161
|
r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), _(!0);
|
|
165
165
|
try {
|
|
166
|
-
r("🔌 DISCONNECTING FOR REFRESH"), await
|
|
167
|
-
const m = await
|
|
168
|
-
|
|
166
|
+
r("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
|
|
167
|
+
const m = await d.connectUser(s);
|
|
168
|
+
h(m), N(!0), g(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (m) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const b = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
g(b), r("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: b
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
176
|
_(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
178
|
+
}, [d, s, r]), v = z.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
|
+
hasService: !!d,
|
|
180
|
+
hasClient: !!o,
|
|
181
|
+
isConnected: f,
|
|
182
182
|
isLoading: a,
|
|
183
183
|
hasError: !!w,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
186
|
+
service: d,
|
|
187
|
+
client: o,
|
|
188
|
+
isConnected: f,
|
|
189
189
|
isLoading: a,
|
|
190
190
|
error: w,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: L,
|
|
193
|
+
debug: u
|
|
194
194
|
}), [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
d,
|
|
196
|
+
o,
|
|
197
|
+
f,
|
|
198
198
|
a,
|
|
199
199
|
w,
|
|
200
200
|
l,
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
L,
|
|
202
|
+
u,
|
|
203
203
|
r
|
|
204
204
|
]);
|
|
205
205
|
return r("🔄 RENDER END", {
|
|
206
206
|
renderCount: C.current,
|
|
207
|
-
willRenderChat: !!(
|
|
207
|
+
willRenderChat: !!(o && f),
|
|
208
208
|
contextValueReady: !!v
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(gt.Provider, { value: v, children: o && f ? /* @__PURE__ */ e(
|
|
210
|
+
Rt,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: o,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, Fs = () => Pe();
|
|
220
|
+
function As(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
t.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const bt = z.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
233
|
-
var
|
|
234
|
-
const [s, n] =
|
|
235
|
-
!!((l = (
|
|
232
|
+
}), Os = bt.Provider, Us = () => z.useContext(bt), pt = (t) => {
|
|
233
|
+
var i, l;
|
|
234
|
+
const [s, n] = k(
|
|
235
|
+
!!((l = (i = t == null ? void 0 : t.state) == null ? void 0 : i.membership) != null && l.pinned_at)
|
|
236
236
|
);
|
|
237
237
|
return q(() => {
|
|
238
238
|
var r;
|
|
@@ -241,38 +241,38 @@ const gt = z.createContext({
|
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
n(!!((r = t.state.membership) != null && r.pinned_at));
|
|
244
|
-
const
|
|
244
|
+
const u = (d) => {
|
|
245
245
|
var x;
|
|
246
246
|
n(
|
|
247
|
-
|
|
247
|
+
d != null && d.member ? !!d.member.pinned_at : !!((x = t.state.membership) != null && x.pinned_at)
|
|
248
248
|
);
|
|
249
249
|
};
|
|
250
|
-
return t.on("member.updated",
|
|
251
|
-
t.off("member.updated",
|
|
250
|
+
return t.on("member.updated", u), () => {
|
|
251
|
+
t.off("member.updated", u);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, $s = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
257
|
), l = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
260
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
261
|
-
},
|
|
261
|
+
}, zs = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const
|
|
266
|
-
return
|
|
265
|
+
const i = $s(t, s);
|
|
266
|
+
return i === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
269
269
|
hour12: !0
|
|
270
|
-
}) :
|
|
270
|
+
}) : i === 1 ? "Yesterday" : i < 7 ? `${i}d` : i < 28 ? `${Math.floor(i / 7)}w` : t.toLocaleDateString("en-US", {
|
|
271
271
|
month: "numeric",
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, rt = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,34 +300,55 @@ const gt = z.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function Bs(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
|
-
const
|
|
307
|
-
s = (s << 5) - s +
|
|
306
|
+
const i = t.charCodeAt(n);
|
|
307
|
+
s = (s << 5) - s + i, s = s & s;
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function js(t) {
|
|
312
|
+
const n = Bs(t) % rt.length;
|
|
313
|
+
return rt[n];
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const ae = ({
|
|
316
316
|
id: t,
|
|
317
317
|
image: s,
|
|
318
318
|
size: n = 40,
|
|
319
|
-
className:
|
|
319
|
+
className: i,
|
|
320
320
|
starred: l = !1,
|
|
321
|
-
shape:
|
|
321
|
+
shape: u = "squircle",
|
|
322
|
+
aiActive: r = !1
|
|
322
323
|
}) => {
|
|
323
|
-
const
|
|
324
|
+
const d = js(t), o = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = Math.max(1, Math.ceil(n / 40)), f = u === "circle" ? { borderRadius: "50%" } : {
|
|
324
325
|
borderRadius: "33%",
|
|
325
326
|
"corner-shape": "superellipse(1.3)"
|
|
326
|
-
}
|
|
327
|
-
|
|
327
|
+
}, N = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
|
|
328
|
+
"img",
|
|
329
|
+
{
|
|
330
|
+
src: s,
|
|
331
|
+
alt: "",
|
|
332
|
+
className: "aspect-square h-full w-full object-cover"
|
|
333
|
+
}
|
|
334
|
+
) : /* @__PURE__ */ e(
|
|
328
335
|
"div",
|
|
329
336
|
{
|
|
330
|
-
|
|
337
|
+
"aria-hidden": "true",
|
|
338
|
+
className: O(
|
|
339
|
+
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
340
|
+
o
|
|
341
|
+
),
|
|
342
|
+
children: d
|
|
343
|
+
}
|
|
344
|
+
) });
|
|
345
|
+
return /* @__PURE__ */ c(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
className: O(
|
|
349
|
+
"relative flex-shrink-0 !bg-transparent",
|
|
350
|
+
i
|
|
351
|
+
),
|
|
331
352
|
style: {
|
|
332
353
|
width: `${n}px`,
|
|
333
354
|
height: `${n}px`
|
|
@@ -338,31 +359,27 @@ const oe = ({
|
|
|
338
359
|
{
|
|
339
360
|
"aria-hidden": "true",
|
|
340
361
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
341
|
-
children: /* @__PURE__ */ e(
|
|
362
|
+
children: /* @__PURE__ */ e(je, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
342
363
|
}
|
|
343
364
|
),
|
|
344
|
-
/* @__PURE__ */ e(
|
|
345
|
-
"img",
|
|
346
|
-
{
|
|
347
|
-
src: s,
|
|
348
|
-
alt: "",
|
|
349
|
-
className: "aspect-square h-full w-full object-cover"
|
|
350
|
-
}
|
|
351
|
-
) : /* @__PURE__ */ e(
|
|
365
|
+
/* @__PURE__ */ e(
|
|
352
366
|
"div",
|
|
353
367
|
{
|
|
354
|
-
"aria-hidden": "true",
|
|
355
368
|
className: O(
|
|
356
|
-
"
|
|
357
|
-
|
|
369
|
+
"h-full w-full",
|
|
370
|
+
r ? "bg-[linear-gradient(135deg,#A855F7_0%,#8B5CF6_45%,#6D28D9_100%)]" : "bg-transparent"
|
|
358
371
|
),
|
|
359
|
-
|
|
372
|
+
style: {
|
|
373
|
+
...f,
|
|
374
|
+
padding: `${h}px`
|
|
375
|
+
},
|
|
376
|
+
children: N
|
|
360
377
|
}
|
|
361
|
-
)
|
|
378
|
+
)
|
|
362
379
|
]
|
|
363
380
|
}
|
|
364
381
|
);
|
|
365
|
-
},
|
|
382
|
+
}, Gs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
366
383
|
"svg",
|
|
367
384
|
{
|
|
368
385
|
width: t,
|
|
@@ -379,91 +396,91 @@ const oe = ({
|
|
|
379
396
|
}
|
|
380
397
|
)
|
|
381
398
|
}
|
|
382
|
-
),
|
|
399
|
+
), Vs = (t) => {
|
|
383
400
|
var s;
|
|
384
401
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
385
|
-
},
|
|
402
|
+
}, Hs = (t) => {
|
|
386
403
|
var s;
|
|
387
404
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
388
|
-
},
|
|
405
|
+
}, We = (t) => {
|
|
389
406
|
var s;
|
|
390
407
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
391
|
-
},
|
|
408
|
+
}, Ys = (t) => {
|
|
392
409
|
var s;
|
|
393
410
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
394
|
-
},
|
|
411
|
+
}, xt = (t) => Vs(t) || Hs(t), Ws = (t) => {
|
|
395
412
|
var s;
|
|
396
|
-
return
|
|
397
|
-
},
|
|
413
|
+
return xt(t) && !((s = t.text) != null && s.trim());
|
|
414
|
+
}, Ue = ({
|
|
398
415
|
message: t,
|
|
399
416
|
standalone: s = !1,
|
|
400
417
|
isMyMessage: n = !1,
|
|
401
|
-
hasAttachment:
|
|
418
|
+
hasAttachment: i = !1
|
|
402
419
|
}) => {
|
|
403
|
-
var
|
|
404
|
-
const l =
|
|
405
|
-
if (!l && !
|
|
420
|
+
var f;
|
|
421
|
+
const l = xt(t), u = We(t);
|
|
422
|
+
if (!l && !u)
|
|
406
423
|
return null;
|
|
407
424
|
if (l) {
|
|
408
|
-
const N = (
|
|
425
|
+
const N = (f = t.metadata) == null ? void 0 : f.amount_text;
|
|
409
426
|
if (!N) return null;
|
|
410
427
|
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${N} tip` : `Delivered with ${N} tip`;
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */ e(
|
|
428
|
+
return /* @__PURE__ */ c("div", { className: a, children: [
|
|
429
|
+
/* @__PURE__ */ e(fs, { size: s ? 14 : 12 }),
|
|
413
430
|
/* @__PURE__ */ e("span", { children: _ })
|
|
414
431
|
] });
|
|
415
432
|
}
|
|
416
|
-
const r = n &&
|
|
433
|
+
const r = n && i, d = r ? "Sent with AI" : "Sent with DM Agent", x = [
|
|
417
434
|
"message-chatbot-indicator",
|
|
418
435
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
419
436
|
r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
420
|
-
].join(" "),
|
|
421
|
-
return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
] }) : /* @__PURE__ */
|
|
425
|
-
|
|
426
|
-
|
|
437
|
+
].join(" "), o = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: d }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Gs, { size: r ? 12 : 15 }) });
|
|
438
|
+
return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ c(se, { children: [
|
|
439
|
+
o,
|
|
440
|
+
h
|
|
441
|
+
] }) : /* @__PURE__ */ c(se, { children: [
|
|
442
|
+
h,
|
|
443
|
+
o
|
|
427
444
|
] }) });
|
|
428
|
-
},
|
|
445
|
+
}, vt = z.memo(
|
|
429
446
|
({ channel: t, unread: s }) => {
|
|
430
|
-
var
|
|
431
|
-
const { selectedChannel: n, onChannelSelect:
|
|
432
|
-
t &&
|
|
447
|
+
var L, v, m, b;
|
|
448
|
+
const { selectedChannel: n, onChannelSelect: i, debug: l, renderMessagePreview: u } = Us(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), d = () => {
|
|
449
|
+
t && i(t);
|
|
433
450
|
}, x = (T) => {
|
|
434
|
-
const M = T.key === "Enter" || T.key === " ",
|
|
435
|
-
!M ||
|
|
436
|
-
},
|
|
451
|
+
const M = T.key === "Enter" || T.key === " ", P = T.repeat;
|
|
452
|
+
!M || P || (T.preventDefault(), d());
|
|
453
|
+
}, h = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
437
454
|
(T) => {
|
|
438
|
-
var M,
|
|
439
|
-
return ((M = T.user) == null ? void 0 : M.id) && T.user.id !== ((
|
|
455
|
+
var M, P;
|
|
456
|
+
return ((M = T.user) == null ? void 0 : M.id) && T.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
|
|
440
457
|
}
|
|
441
|
-
),
|
|
458
|
+
), f = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", N = (m = h == null ? void 0 : h.user) == null ? void 0 : m.image, a = (() => {
|
|
442
459
|
var M;
|
|
443
460
|
const T = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
|
|
444
461
|
if (T != null && T.length) {
|
|
445
|
-
for (let
|
|
446
|
-
if (T[
|
|
462
|
+
for (let P = T.length - 1; P >= 0; P--)
|
|
463
|
+
if (T[P].type !== "system") return T[P];
|
|
447
464
|
}
|
|
448
465
|
})(), w = (() => {
|
|
449
|
-
var
|
|
466
|
+
var P, R;
|
|
450
467
|
if (a != null && a.text) return a.text;
|
|
451
|
-
if (((
|
|
468
|
+
if (((P = a == null ? void 0 : a.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
452
469
|
const M = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
|
|
453
470
|
return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
454
|
-
})(),
|
|
471
|
+
})(), g = a != null && a.created_at ? zs(new Date(a.created_at)) : "", y = a ? We(a) : !1, I = u ? u(a, w) : `${y ? "✨ " : ""}${w}`, C = pt(t), S = s ?? 0;
|
|
455
472
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
456
473
|
channelId: t == null ? void 0 : t.id,
|
|
457
474
|
isSelected: r,
|
|
458
|
-
participantName:
|
|
459
|
-
unreadCount:
|
|
460
|
-
hasTimestamp: !!
|
|
475
|
+
participantName: f,
|
|
476
|
+
unreadCount: S,
|
|
477
|
+
hasTimestamp: !!g
|
|
461
478
|
}), /* @__PURE__ */ e(
|
|
462
479
|
"div",
|
|
463
480
|
{
|
|
464
481
|
role: "button",
|
|
465
482
|
tabIndex: 0,
|
|
466
|
-
onClick:
|
|
483
|
+
onClick: d,
|
|
467
484
|
onKeyDown: x,
|
|
468
485
|
className: O(
|
|
469
486
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
@@ -472,21 +489,21 @@ const oe = ({
|
|
|
472
489
|
"hover:bg-sand": !r
|
|
473
490
|
}
|
|
474
491
|
),
|
|
475
|
-
children: /* @__PURE__ */
|
|
492
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
|
|
476
493
|
/* @__PURE__ */ e(
|
|
477
|
-
|
|
494
|
+
ae,
|
|
478
495
|
{
|
|
479
|
-
id: ((
|
|
480
|
-
name:
|
|
496
|
+
id: ((b = h == null ? void 0 : h.user) == null ? void 0 : b.id) || t.id || "unknown",
|
|
497
|
+
name: f,
|
|
481
498
|
image: N,
|
|
482
499
|
size: 44,
|
|
483
500
|
starred: C,
|
|
484
501
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
485
502
|
}
|
|
486
503
|
),
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
505
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
|
|
506
|
+
/* @__PURE__ */ c(
|
|
490
507
|
"h3",
|
|
491
508
|
{
|
|
492
509
|
className: O(
|
|
@@ -495,15 +512,15 @@ const oe = ({
|
|
|
495
512
|
),
|
|
496
513
|
children: [
|
|
497
514
|
C && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
498
|
-
|
|
515
|
+
f
|
|
499
516
|
]
|
|
500
517
|
}
|
|
501
518
|
),
|
|
502
|
-
|
|
519
|
+
g && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: g })
|
|
503
520
|
] }),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
506
|
-
|
|
521
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
522
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
|
|
523
|
+
S > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: S > 99 ? "99+" : S })
|
|
507
524
|
] })
|
|
508
525
|
] })
|
|
509
526
|
] })
|
|
@@ -511,33 +528,33 @@ const oe = ({
|
|
|
511
528
|
);
|
|
512
529
|
}
|
|
513
530
|
);
|
|
514
|
-
|
|
515
|
-
const
|
|
531
|
+
vt.displayName = "CustomChannelPreview";
|
|
532
|
+
const qs = { last_message_at: -1 }, wt = z.memo(
|
|
516
533
|
({
|
|
517
534
|
onChannelSelect: t,
|
|
518
535
|
selectedChannel: s,
|
|
519
536
|
filters: n,
|
|
520
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
537
|
+
allowNewMessagesFromUnfilteredChannels: i = !1,
|
|
521
538
|
onMessageNew: l,
|
|
522
|
-
onAddedToChannel:
|
|
539
|
+
onAddedToChannel: u,
|
|
523
540
|
channelRenderFilterFn: r,
|
|
524
|
-
sort:
|
|
541
|
+
sort: d = qs,
|
|
525
542
|
className: x,
|
|
526
|
-
customEmptyStateIndicator:
|
|
527
|
-
renderMessagePreview:
|
|
543
|
+
customEmptyStateIndicator: o,
|
|
544
|
+
renderMessagePreview: h
|
|
528
545
|
}) => {
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
const { debug: N = !1 } =
|
|
546
|
+
const f = z.useRef(0);
|
|
547
|
+
f.current++;
|
|
548
|
+
const { debug: N = !1 } = Pe(), a = z.useCallback(
|
|
532
549
|
(w) => {
|
|
533
|
-
for (const
|
|
534
|
-
|
|
550
|
+
for (const g of w)
|
|
551
|
+
As(g);
|
|
535
552
|
return r ? r(w) : w;
|
|
536
553
|
},
|
|
537
554
|
[r]
|
|
538
555
|
);
|
|
539
556
|
N && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
540
|
-
renderCount:
|
|
557
|
+
renderCount: f.current,
|
|
541
558
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
542
559
|
filters: n
|
|
543
560
|
});
|
|
@@ -546,9 +563,9 @@ const Ys = { last_message_at: -1 }, vt = z.memo(
|
|
|
546
563
|
selectedChannel: s,
|
|
547
564
|
onChannelSelect: t,
|
|
548
565
|
debug: N,
|
|
549
|
-
renderMessagePreview:
|
|
566
|
+
renderMessagePreview: h
|
|
550
567
|
}),
|
|
551
|
-
[s, t, N,
|
|
568
|
+
[s, t, N, h]
|
|
552
569
|
);
|
|
553
570
|
return /* @__PURE__ */ e(
|
|
554
571
|
"div",
|
|
@@ -557,31 +574,31 @@ const Ys = { last_message_at: -1 }, vt = z.memo(
|
|
|
557
574
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
558
575
|
x
|
|
559
576
|
),
|
|
560
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
561
|
-
|
|
577
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Os, { value: _, children: /* @__PURE__ */ e(
|
|
578
|
+
Pt,
|
|
562
579
|
{
|
|
563
580
|
filters: n,
|
|
564
|
-
sort:
|
|
581
|
+
sort: d,
|
|
565
582
|
options: { limit: 30 },
|
|
566
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
583
|
+
allowNewMessagesFromUnfilteredChannels: i,
|
|
567
584
|
onMessageNew: l,
|
|
568
|
-
onAddedToChannel:
|
|
585
|
+
onAddedToChannel: u,
|
|
569
586
|
channelRenderFilterFn: a,
|
|
570
|
-
Preview:
|
|
571
|
-
EmptyStateIndicator:
|
|
587
|
+
Preview: vt,
|
|
588
|
+
EmptyStateIndicator: o
|
|
572
589
|
},
|
|
573
|
-
`${JSON.stringify(n)}:${JSON.stringify(
|
|
590
|
+
`${JSON.stringify(n)}:${JSON.stringify(d)}`
|
|
574
591
|
) }) })
|
|
575
592
|
}
|
|
576
593
|
);
|
|
577
594
|
}
|
|
578
595
|
);
|
|
579
|
-
|
|
580
|
-
const
|
|
596
|
+
wt.displayName = "ChannelList";
|
|
597
|
+
const Ie = ({
|
|
581
598
|
variant: t = "default",
|
|
582
599
|
className: s,
|
|
583
600
|
children: n,
|
|
584
|
-
...
|
|
601
|
+
...i
|
|
585
602
|
}) => /* @__PURE__ */ e(
|
|
586
603
|
"button",
|
|
587
604
|
{
|
|
@@ -591,24 +608,24 @@ const ke = ({
|
|
|
591
608
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
592
609
|
s
|
|
593
610
|
),
|
|
594
|
-
...
|
|
611
|
+
...i,
|
|
595
612
|
children: n
|
|
596
613
|
}
|
|
597
614
|
);
|
|
598
|
-
function
|
|
599
|
-
return /* @__PURE__ */
|
|
615
|
+
function Nt({ label: t, className: s, children: n, ...i }) {
|
|
616
|
+
return /* @__PURE__ */ c(
|
|
600
617
|
"button",
|
|
601
618
|
{
|
|
602
619
|
type: "button",
|
|
603
620
|
className: O(
|
|
604
621
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
605
622
|
{
|
|
606
|
-
"cursor-not-allowed opacity-50":
|
|
607
|
-
"hover:bg-sand": !
|
|
623
|
+
"cursor-not-allowed opacity-50": i.disabled,
|
|
624
|
+
"hover:bg-sand": !i.disabled
|
|
608
625
|
},
|
|
609
626
|
s
|
|
610
627
|
),
|
|
611
|
-
...
|
|
628
|
+
...i,
|
|
612
629
|
children: [
|
|
613
630
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
614
631
|
n
|
|
@@ -616,36 +633,36 @@ function wt({ label: t, className: s, children: n, ...o }) {
|
|
|
616
633
|
}
|
|
617
634
|
);
|
|
618
635
|
}
|
|
619
|
-
function
|
|
620
|
-
return /* @__PURE__ */ e(
|
|
636
|
+
function yt({ onClick: t }) {
|
|
637
|
+
return /* @__PURE__ */ e(Nt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
621
638
|
}
|
|
622
|
-
const
|
|
639
|
+
const Zs = ({
|
|
623
640
|
dialogRef: t,
|
|
624
641
|
onClose: s,
|
|
625
642
|
participant: n,
|
|
626
|
-
channel:
|
|
643
|
+
channel: i,
|
|
627
644
|
followerStatusLabel: l,
|
|
628
|
-
onLeaveConversation:
|
|
645
|
+
onLeaveConversation: u,
|
|
629
646
|
onBlockParticipant: r,
|
|
630
|
-
showDeleteConversation:
|
|
647
|
+
showDeleteConversation: d = !0,
|
|
631
648
|
onDeleteConversationClick: x,
|
|
632
|
-
onBlockParticipantClick:
|
|
633
|
-
onReportParticipantClick:
|
|
634
|
-
customProfileContent:
|
|
649
|
+
onBlockParticipantClick: o,
|
|
650
|
+
onReportParticipantClick: h,
|
|
651
|
+
customProfileContent: f,
|
|
635
652
|
customChannelActions: N
|
|
636
653
|
}) => {
|
|
637
|
-
var V, F, H, Z,
|
|
638
|
-
const { service: a, debug: _ } =
|
|
639
|
-
var
|
|
640
|
-
if (!(!a || !((
|
|
654
|
+
var V, F, H, Z, re, K, p;
|
|
655
|
+
const { service: a, debug: _ } = Pe(), [w, g] = k(!1), [y, I] = k(!1), [C, S] = k(!1), L = A(async () => {
|
|
656
|
+
var E;
|
|
657
|
+
if (!(!a || !((E = n == null ? void 0 : n.user) != null && E.id)))
|
|
641
658
|
try {
|
|
642
659
|
const j = (await a.getBlockedUsers()).some(
|
|
643
|
-
(
|
|
660
|
+
(ee) => {
|
|
644
661
|
var le;
|
|
645
|
-
return
|
|
662
|
+
return ee.blocked_user_id === ((le = n == null ? void 0 : n.user) == null ? void 0 : le.id);
|
|
646
663
|
}
|
|
647
664
|
);
|
|
648
|
-
|
|
665
|
+
g(j);
|
|
649
666
|
} catch (U) {
|
|
650
667
|
console.error(
|
|
651
668
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
@@ -654,54 +671,54 @@ const Ws = ({
|
|
|
654
671
|
}
|
|
655
672
|
}, [a, (V = n == null ? void 0 : n.user) == null ? void 0 : V.id]);
|
|
656
673
|
q(() => {
|
|
657
|
-
|
|
658
|
-
}, [
|
|
674
|
+
L();
|
|
675
|
+
}, [L]);
|
|
659
676
|
const v = async () => {
|
|
660
|
-
var
|
|
661
|
-
if (!
|
|
662
|
-
x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation",
|
|
677
|
+
var E;
|
|
678
|
+
if (!y) {
|
|
679
|
+
x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation", i.cid), I(!0);
|
|
663
680
|
try {
|
|
664
|
-
const U = ((
|
|
665
|
-
await
|
|
681
|
+
const U = ((E = i._client) == null ? void 0 : E.userID) ?? null;
|
|
682
|
+
await i.hide(U, !1), u && await u(i), s();
|
|
666
683
|
} catch (U) {
|
|
667
684
|
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
668
685
|
} finally {
|
|
669
|
-
|
|
686
|
+
I(!1);
|
|
670
687
|
}
|
|
671
688
|
}
|
|
672
689
|
}, m = async () => {
|
|
673
|
-
var
|
|
690
|
+
var E, U, j;
|
|
674
691
|
if (!(C || !a)) {
|
|
675
|
-
|
|
692
|
+
o == null || o(), _ && console.log("[ChannelInfoDialog] Block member", (E = n == null ? void 0 : n.user) == null ? void 0 : E.id), S(!0);
|
|
676
693
|
try {
|
|
677
694
|
await a.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
678
|
-
} catch (
|
|
679
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
695
|
+
} catch (ee) {
|
|
696
|
+
console.error("[ChannelInfoDialog] Failed to block member", ee);
|
|
680
697
|
} finally {
|
|
681
|
-
|
|
698
|
+
S(!1);
|
|
682
699
|
}
|
|
683
700
|
}
|
|
684
|
-
},
|
|
685
|
-
var
|
|
701
|
+
}, b = async () => {
|
|
702
|
+
var E, U, j;
|
|
686
703
|
if (!(C || !a)) {
|
|
687
|
-
|
|
704
|
+
o == null || o(), _ && console.log("[ChannelInfoDialog] Unblock member", (E = n == null ? void 0 : n.user) == null ? void 0 : E.id), S(!0);
|
|
688
705
|
try {
|
|
689
706
|
await a.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
690
|
-
} catch (
|
|
691
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
707
|
+
} catch (ee) {
|
|
708
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", ee);
|
|
692
709
|
} finally {
|
|
693
|
-
|
|
710
|
+
S(!1);
|
|
694
711
|
}
|
|
695
712
|
}
|
|
696
713
|
}, T = () => {
|
|
697
|
-
|
|
714
|
+
h == null || h(), s(), window.open(
|
|
698
715
|
"https://linktr.ee/s/about/trust-center/report",
|
|
699
716
|
"_blank",
|
|
700
717
|
"noopener,noreferrer"
|
|
701
718
|
);
|
|
702
719
|
};
|
|
703
720
|
if (!n) return null;
|
|
704
|
-
const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member",
|
|
721
|
+
const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member", P = (Z = n.user) == null ? void 0 : Z.image, R = (re = n.user) == null ? void 0 : re.email, B = (K = n.user) == null ? void 0 : K.username, Q = R || (B ? `linktr.ee/${B}` : void 0), J = ((p = n.user) == null ? void 0 : p.id) || "unknown";
|
|
705
722
|
return (
|
|
706
723
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
707
724
|
/* @__PURE__ */ e(
|
|
@@ -710,36 +727,36 @@ const Ws = ({
|
|
|
710
727
|
ref: t,
|
|
711
728
|
className: "mes-dialog group",
|
|
712
729
|
onClose: s,
|
|
713
|
-
onClick: (
|
|
714
|
-
|
|
730
|
+
onClick: (E) => {
|
|
731
|
+
E.target === t.current && s();
|
|
715
732
|
},
|
|
716
|
-
children: /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
733
|
+
children: /* @__PURE__ */ c("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: [
|
|
734
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
718
735
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
719
|
-
/* @__PURE__ */ e(
|
|
736
|
+
/* @__PURE__ */ e(yt, { onClick: s })
|
|
720
737
|
] }),
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
739
|
+
/* @__PURE__ */ c(
|
|
723
740
|
"div",
|
|
724
741
|
{
|
|
725
742
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
726
743
|
style: { backgroundColor: "#FBFAF9" },
|
|
727
744
|
children: [
|
|
728
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
|
|
729
746
|
/* @__PURE__ */ e(
|
|
730
|
-
|
|
747
|
+
ae,
|
|
731
748
|
{
|
|
732
749
|
id: J,
|
|
733
750
|
name: M,
|
|
734
|
-
image:
|
|
751
|
+
image: P,
|
|
735
752
|
size: 88,
|
|
736
753
|
shape: "circle"
|
|
737
754
|
}
|
|
738
755
|
),
|
|
739
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
740
757
|
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
|
|
741
|
-
|
|
742
|
-
l && !
|
|
758
|
+
Q && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Q }),
|
|
759
|
+
l && !f && /* @__PURE__ */ e(
|
|
743
760
|
"span",
|
|
744
761
|
{
|
|
745
762
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -755,48 +772,48 @@ const Ws = ({
|
|
|
755
772
|
)
|
|
756
773
|
] })
|
|
757
774
|
] }),
|
|
758
|
-
|
|
775
|
+
f && /* @__PURE__ */ e("div", { className: "w-full", children: f })
|
|
759
776
|
]
|
|
760
777
|
}
|
|
761
778
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
|
|
764
|
-
|
|
779
|
+
/* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
780
|
+
d && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
781
|
+
Ie,
|
|
765
782
|
{
|
|
766
783
|
onClick: v,
|
|
767
|
-
disabled:
|
|
768
|
-
"aria-busy":
|
|
784
|
+
disabled: y,
|
|
785
|
+
"aria-busy": y,
|
|
769
786
|
children: [
|
|
770
|
-
|
|
787
|
+
y ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(gs, { className: "h-5 w-5" }),
|
|
771
788
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
772
789
|
]
|
|
773
790
|
}
|
|
774
791
|
) }),
|
|
775
|
-
/* @__PURE__ */ e("li", { children: w ? /* @__PURE__ */
|
|
776
|
-
|
|
792
|
+
/* @__PURE__ */ e("li", { children: w ? /* @__PURE__ */ c(
|
|
793
|
+
Ie,
|
|
777
794
|
{
|
|
778
|
-
onClick:
|
|
795
|
+
onClick: b,
|
|
779
796
|
disabled: C,
|
|
780
797
|
"aria-busy": C,
|
|
781
798
|
children: [
|
|
782
|
-
C ? /* @__PURE__ */ e(
|
|
799
|
+
C ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "h-5 w-5" }),
|
|
783
800
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
784
801
|
]
|
|
785
802
|
}
|
|
786
|
-
) : /* @__PURE__ */
|
|
787
|
-
|
|
803
|
+
) : /* @__PURE__ */ c(
|
|
804
|
+
Ie,
|
|
788
805
|
{
|
|
789
806
|
onClick: m,
|
|
790
807
|
disabled: C,
|
|
791
808
|
"aria-busy": C,
|
|
792
809
|
children: [
|
|
793
|
-
C ? /* @__PURE__ */ e(
|
|
810
|
+
C ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "h-5 w-5" }),
|
|
794
811
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
795
812
|
]
|
|
796
813
|
}
|
|
797
814
|
) }),
|
|
798
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(Ie, { variant: "danger", onClick: T, children: [
|
|
816
|
+
/* @__PURE__ */ e(bs, { className: "h-5 w-5" }),
|
|
800
817
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
801
818
|
] }) }),
|
|
802
819
|
N
|
|
@@ -806,52 +823,52 @@ const Ws = ({
|
|
|
806
823
|
}
|
|
807
824
|
)
|
|
808
825
|
);
|
|
809
|
-
},
|
|
810
|
-
function
|
|
811
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
826
|
+
}, Xs = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ge = "vote_up", Ve = "vote_down";
|
|
827
|
+
function Ks(t) {
|
|
828
|
+
return t != null && t.length ? t.some((s) => s.type === Ve) ? "down" : t.some((s) => s.type === Ge) ? "up" : null : null;
|
|
812
829
|
}
|
|
813
|
-
function
|
|
814
|
-
const { channel: s } =
|
|
815
|
-
() =>
|
|
830
|
+
function Js(t) {
|
|
831
|
+
const { channel: s } = me(), { client: n } = Ye("useMessageVote"), i = Be(
|
|
832
|
+
() => Ks(t.own_reactions),
|
|
816
833
|
[t.own_reactions]
|
|
817
834
|
), l = A(async () => {
|
|
818
835
|
if (n != null && n.userID)
|
|
819
836
|
try {
|
|
820
|
-
|
|
837
|
+
i === "up" ? await s.deleteReaction(t.id, Ge) : await s.sendReaction(
|
|
821
838
|
t.id,
|
|
822
|
-
{ type:
|
|
839
|
+
{ type: Ge },
|
|
823
840
|
{ enforce_unique: !0, skip_push: !0 }
|
|
824
841
|
);
|
|
825
842
|
} catch {
|
|
826
843
|
}
|
|
827
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
844
|
+
}, [s, n == null ? void 0 : n.userID, t.id, i]), u = A(async () => {
|
|
828
845
|
if (n != null && n.userID)
|
|
829
846
|
try {
|
|
830
|
-
|
|
847
|
+
i === "down" ? await s.deleteReaction(t.id, Ve) : await s.sendReaction(
|
|
831
848
|
t.id,
|
|
832
|
-
{ type:
|
|
849
|
+
{ type: Ve },
|
|
833
850
|
{ enforce_unique: !0, skip_push: !0 }
|
|
834
851
|
);
|
|
835
852
|
} catch {
|
|
836
853
|
}
|
|
837
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
838
|
-
return { selected:
|
|
854
|
+
}, [s, n == null ? void 0 : n.userID, t.id, i]);
|
|
855
|
+
return { selected: i, voteUp: l, voteDown: u };
|
|
839
856
|
}
|
|
840
|
-
const
|
|
857
|
+
const Qs = z.lazy(() => import("./Card-BXKUE7JN.js")), en = z.lazy(() => import("./Card-J-rj8Q6w.js")), Ct = () => /* @__PURE__ */ e(
|
|
841
858
|
"div",
|
|
842
859
|
{
|
|
843
860
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
844
861
|
"aria-hidden": !0
|
|
845
862
|
}
|
|
846
|
-
),
|
|
863
|
+
), tn = (t) => /* @__PURE__ */ e(dt, { fallback: /* @__PURE__ */ e(Ct, {}), children: /* @__PURE__ */ e(Qs, { ...t }) }), sn = (t) => /* @__PURE__ */ e(dt, { fallback: /* @__PURE__ */ e(Ct, {}), children: /* @__PURE__ */ e(en, { ...t }) }), it = { Creator: tn, Visitor: sn }, nn = {
|
|
847
864
|
isUnlocking: () => !1
|
|
848
|
-
},
|
|
849
|
-
LockedAttachment:
|
|
850
|
-
},
|
|
851
|
-
function
|
|
852
|
-
return
|
|
865
|
+
}, an = {
|
|
866
|
+
LockedAttachment: nn
|
|
867
|
+
}, _t = ot({}), ia = _t.Provider;
|
|
868
|
+
function rn(t) {
|
|
869
|
+
return ct(_t)[t] ?? an[t];
|
|
853
870
|
}
|
|
854
|
-
const
|
|
871
|
+
const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
855
872
|
"path",
|
|
856
873
|
{
|
|
857
874
|
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",
|
|
@@ -861,7 +878,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
861
878
|
strokeLinejoin: "round",
|
|
862
879
|
fill: t ? "currentColor" : "none"
|
|
863
880
|
}
|
|
864
|
-
) }),
|
|
881
|
+
) }), on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
865
882
|
"path",
|
|
866
883
|
{
|
|
867
884
|
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",
|
|
@@ -871,11 +888,11 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
871
888
|
strokeLinejoin: "round",
|
|
872
889
|
fill: t ? "currentColor" : "none"
|
|
873
890
|
}
|
|
874
|
-
) }),
|
|
891
|
+
) }), cn = ({
|
|
875
892
|
selected: t,
|
|
876
893
|
onVoteUp: s,
|
|
877
894
|
onVoteDown: n
|
|
878
|
-
}) => /* @__PURE__ */
|
|
895
|
+
}) => /* @__PURE__ */ c("div", { className: "message-vote-buttons", children: [
|
|
879
896
|
/* @__PURE__ */ e(
|
|
880
897
|
"button",
|
|
881
898
|
{
|
|
@@ -884,7 +901,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
884
901
|
onClick: s,
|
|
885
902
|
"aria-label": "Helpful",
|
|
886
903
|
"aria-pressed": t === "up",
|
|
887
|
-
children: /* @__PURE__ */ e(
|
|
904
|
+
children: /* @__PURE__ */ e(ln, { filled: t === "up" })
|
|
888
905
|
}
|
|
889
906
|
),
|
|
890
907
|
/* @__PURE__ */ e(
|
|
@@ -895,92 +912,92 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
895
912
|
onClick: n,
|
|
896
913
|
"aria-label": "Not helpful",
|
|
897
914
|
"aria-pressed": t === "down",
|
|
898
|
-
children: /* @__PURE__ */ e(
|
|
915
|
+
children: /* @__PURE__ */ e(on, { filled: t === "down" })
|
|
899
916
|
}
|
|
900
917
|
)
|
|
901
|
-
] }),
|
|
918
|
+
] }), dn = (t) => {
|
|
902
919
|
var ce, ne, Ne, ye, Ce, de, _e, Ee, Se, ue, D, W, $, G;
|
|
903
920
|
const {
|
|
904
921
|
additionalMessageInputProps: s,
|
|
905
922
|
chatbotVotingEnabled: n,
|
|
906
|
-
editing:
|
|
923
|
+
editing: i,
|
|
907
924
|
endOfGroup: l,
|
|
908
|
-
firstOfGroup:
|
|
925
|
+
firstOfGroup: u,
|
|
909
926
|
groupedByUser: r,
|
|
910
|
-
handleAction:
|
|
927
|
+
handleAction: d,
|
|
911
928
|
handleOpenThread: x,
|
|
912
|
-
handleRetry:
|
|
913
|
-
highlighted:
|
|
914
|
-
isMessageAIGenerated:
|
|
929
|
+
handleRetry: o,
|
|
930
|
+
highlighted: h,
|
|
931
|
+
isMessageAIGenerated: f,
|
|
915
932
|
isMyMessage: N,
|
|
916
933
|
message: a,
|
|
917
934
|
renderText: _,
|
|
918
935
|
threadList: w
|
|
919
|
-
} = t, { client:
|
|
920
|
-
Attachment: R =
|
|
936
|
+
} = t, { client: g } = Ye("CustomMessage"), { channel: y } = me("CustomMessage"), { isUnlocking: I, onUnlockClick: C, onFetchSource: S, onDownloadClick: L } = rn("LockedAttachment"), [v, m] = k(!1), b = At(a.id), { selected: T, voteUp: M, voteDown: P } = Js(a), {
|
|
937
|
+
Attachment: R = Ot,
|
|
921
938
|
EditMessageModal: B = Ut,
|
|
922
|
-
MessageBlocked:
|
|
923
|
-
MessageBouncePrompt: J =
|
|
924
|
-
MessageDeleted: V =
|
|
925
|
-
MessageIsThreadReplyInChannelButtonIndicator: F =
|
|
926
|
-
MessageRepliesCountButton: H =
|
|
927
|
-
ReminderNotification: Z =
|
|
928
|
-
StreamedMessageText:
|
|
939
|
+
MessageBlocked: Q = $t,
|
|
940
|
+
MessageBouncePrompt: J = zt,
|
|
941
|
+
MessageDeleted: V = Bt,
|
|
942
|
+
MessageIsThreadReplyInChannelButtonIndicator: F = jt,
|
|
943
|
+
MessageRepliesCountButton: H = Gt,
|
|
944
|
+
ReminderNotification: Z = Vt,
|
|
945
|
+
StreamedMessageText: re = Ht,
|
|
929
946
|
PinIndicator: K
|
|
930
|
-
} =
|
|
931
|
-
() =>
|
|
932
|
-
[
|
|
933
|
-
), j =
|
|
947
|
+
} = ut("CustomMessage"), p = Yt(a), E = Wt(a), U = Be(
|
|
948
|
+
() => f == null ? void 0 : f(a),
|
|
949
|
+
[f, a]
|
|
950
|
+
), j = Be(
|
|
934
951
|
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
935
952
|
[a]
|
|
936
953
|
);
|
|
937
|
-
if (
|
|
954
|
+
if (qt(a))
|
|
938
955
|
return null;
|
|
939
956
|
if (a.deleted_at || a.type === "deleted")
|
|
940
957
|
return /* @__PURE__ */ e(V, { message: a });
|
|
941
|
-
if (
|
|
942
|
-
return /* @__PURE__ */ e(
|
|
943
|
-
const
|
|
958
|
+
if (Zt(a))
|
|
959
|
+
return /* @__PURE__ */ e(Q, {});
|
|
960
|
+
const ee = !w && !!a.reply_count, le = !w && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Le = Xt(a);
|
|
944
961
|
let Y;
|
|
945
|
-
pe ? Y = () =>
|
|
946
|
-
const
|
|
962
|
+
pe ? Y = () => o(a) : Le && (Y = () => m(!0));
|
|
963
|
+
const te = N(), xe = O(
|
|
947
964
|
"str-chat__message str-chat__message-simple",
|
|
948
965
|
`str-chat__message--${a.type}`,
|
|
949
966
|
`str-chat__message--${a.status}`,
|
|
950
|
-
|
|
967
|
+
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
951
968
|
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
952
969
|
{
|
|
953
|
-
"str-chat__message--has-attachment":
|
|
954
|
-
"str-chat__message--highlighted":
|
|
970
|
+
"str-chat__message--has-attachment": p,
|
|
971
|
+
"str-chat__message--highlighted": h,
|
|
955
972
|
"str-chat__message--pinned pinned-message": a.pinned,
|
|
956
|
-
"str-chat__message--with-reactions":
|
|
973
|
+
"str-chat__message--with-reactions": E,
|
|
957
974
|
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ne = a == null ? void 0 : a.error) == null ? void 0 : ne.status) !== 403,
|
|
958
|
-
"str-chat__message-with-thread-link":
|
|
975
|
+
"str-chat__message-with-thread-link": ee || le,
|
|
959
976
|
"str-chat__virtual-message__wrapper--end": l,
|
|
960
|
-
"str-chat__virtual-message__wrapper--first":
|
|
977
|
+
"str-chat__virtual-message__wrapper--first": u,
|
|
961
978
|
"str-chat__virtual-message__wrapper--group": r
|
|
962
979
|
}
|
|
963
|
-
),
|
|
964
|
-
return /* @__PURE__ */
|
|
965
|
-
|
|
980
|
+
), ie = a.poll_id && g.polls.fromState(a.poll_id), he = Ws(a), oe = We(a), ve = Ys(a), ge = !!(j != null && j.length && !a.quoted_message), we = oe && te && ge;
|
|
981
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
982
|
+
i && /* @__PURE__ */ e(
|
|
966
983
|
B,
|
|
967
984
|
{
|
|
968
985
|
additionalMessageInputProps: s
|
|
969
986
|
}
|
|
970
987
|
),
|
|
971
988
|
v && /* @__PURE__ */ e(
|
|
972
|
-
|
|
989
|
+
Kt,
|
|
973
990
|
{
|
|
974
991
|
MessageBouncePrompt: J,
|
|
975
992
|
onClose: () => m(!1),
|
|
976
993
|
open: v
|
|
977
994
|
}
|
|
978
995
|
),
|
|
979
|
-
/* @__PURE__ */
|
|
996
|
+
/* @__PURE__ */ c("div", { className: xe, children: [
|
|
980
997
|
K && /* @__PURE__ */ e(K, {}),
|
|
981
|
-
!!
|
|
998
|
+
!!b && /* @__PURE__ */ e(Z, { reminder: b }),
|
|
982
999
|
a.user && /* @__PURE__ */ e(
|
|
983
|
-
|
|
1000
|
+
ae,
|
|
984
1001
|
{
|
|
985
1002
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
986
1003
|
id: a.user.id,
|
|
@@ -992,7 +1009,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
992
1009
|
"div",
|
|
993
1010
|
{
|
|
994
1011
|
className: O("str-chat__message-inner", {
|
|
995
|
-
"str-chat__simple-message--error-failed": pe ||
|
|
1012
|
+
"str-chat__simple-message--error-failed": pe || Le
|
|
996
1013
|
}),
|
|
997
1014
|
"data-testid": "message-inner",
|
|
998
1015
|
onClick: Y,
|
|
@@ -1005,19 +1022,22 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1005
1022
|
marginInlineEnd: 0,
|
|
1006
1023
|
marginInlineStart: 0
|
|
1007
1024
|
},
|
|
1008
|
-
children: ve ? /* @__PURE__ */
|
|
1009
|
-
|
|
1010
|
-
|
|
1025
|
+
children: ve ? /* @__PURE__ */ c("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1026
|
+
te ? /* @__PURE__ */ e(
|
|
1027
|
+
it.Creator,
|
|
1011
1028
|
{
|
|
1012
1029
|
title: (Ne = a.metadata) == null ? void 0 : Ne.attachment_title,
|
|
1013
1030
|
mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
|
|
1014
1031
|
thumbnailUrl: (Ce = a.metadata) == null ? void 0 : Ce.attachment_thumbnail,
|
|
1015
1032
|
amountText: (de = a.metadata) == null ? void 0 : de.amount_text,
|
|
1016
1033
|
detail: (_e = a.metadata) == null ? void 0 : _e.attachment_detail,
|
|
1017
|
-
paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status
|
|
1034
|
+
paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status,
|
|
1035
|
+
isUnlocking: I(a.id),
|
|
1036
|
+
onPreviewClick: () => C == null ? void 0 : C(a, y),
|
|
1037
|
+
onFetchSource: async () => await (S == null ? void 0 : S(a, y))
|
|
1018
1038
|
}
|
|
1019
1039
|
) : /* @__PURE__ */ e(
|
|
1020
|
-
|
|
1040
|
+
it.Visitor,
|
|
1021
1041
|
{
|
|
1022
1042
|
title: (Se = a.metadata) == null ? void 0 : Se.attachment_title,
|
|
1023
1043
|
mimeType: (ue = a.metadata) == null ? void 0 : ue.attachment_mime_type,
|
|
@@ -1025,63 +1045,63 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1025
1045
|
amountText: (W = a.metadata) == null ? void 0 : W.amount_text,
|
|
1026
1046
|
detail: ($ = a.metadata) == null ? void 0 : $.attachment_detail,
|
|
1027
1047
|
paymentStatus: (G = a.metadata) == null ? void 0 : G.payment_status,
|
|
1028
|
-
isUnlocking:
|
|
1029
|
-
onUnlockClick: () => C == null ? void 0 : C(a,
|
|
1030
|
-
onFetchSource: async () => await (
|
|
1031
|
-
onDownloadClick: () =>
|
|
1048
|
+
isUnlocking: I(a.id),
|
|
1049
|
+
onUnlockClick: () => C == null ? void 0 : C(a, y),
|
|
1050
|
+
onFetchSource: async () => await (S == null ? void 0 : S(a, y)),
|
|
1051
|
+
onDownloadClick: () => L == null ? void 0 : L(a, y)
|
|
1032
1052
|
}
|
|
1033
1053
|
),
|
|
1034
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble
|
|
1035
|
-
] }) :
|
|
1054
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Ke, { message: a, renderText: _ }) })
|
|
1055
|
+
] }) : he ? (
|
|
1036
1056
|
/* Tip-only messages render as a standalone bubble */
|
|
1037
|
-
/* @__PURE__ */ e(
|
|
1038
|
-
) : /* @__PURE__ */
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
|
|
1041
|
-
|
|
1057
|
+
/* @__PURE__ */ e(Ue, { message: a, standalone: !0 })
|
|
1058
|
+
) : /* @__PURE__ */ c("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1059
|
+
/* @__PURE__ */ c("div", { className: "str-chat__message-bubble", children: [
|
|
1060
|
+
oe && !we && /* @__PURE__ */ e(
|
|
1061
|
+
Ue,
|
|
1042
1062
|
{
|
|
1043
1063
|
message: a,
|
|
1044
1064
|
hasAttachment: ge,
|
|
1045
|
-
isMyMessage:
|
|
1065
|
+
isMyMessage: te
|
|
1046
1066
|
}
|
|
1047
1067
|
),
|
|
1048
|
-
|
|
1068
|
+
ie && /* @__PURE__ */ e(Jt, { poll: ie }),
|
|
1049
1069
|
j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1050
1070
|
R,
|
|
1051
1071
|
{
|
|
1052
|
-
actionHandler:
|
|
1072
|
+
actionHandler: d,
|
|
1053
1073
|
attachments: j
|
|
1054
1074
|
}
|
|
1055
1075
|
) : null,
|
|
1056
1076
|
U ? /* @__PURE__ */ e(
|
|
1057
|
-
|
|
1077
|
+
re,
|
|
1058
1078
|
{
|
|
1059
1079
|
message: a,
|
|
1060
1080
|
renderText: _
|
|
1061
1081
|
}
|
|
1062
|
-
) : /* @__PURE__ */ e(
|
|
1063
|
-
/* @__PURE__ */ e(
|
|
1082
|
+
) : /* @__PURE__ */ e(Ke, { message: a, renderText: _ }),
|
|
1083
|
+
/* @__PURE__ */ e(Qt, {})
|
|
1064
1084
|
] }),
|
|
1065
|
-
(!
|
|
1066
|
-
|
|
1085
|
+
(!oe || we) && /* @__PURE__ */ e(
|
|
1086
|
+
Ue,
|
|
1067
1087
|
{
|
|
1068
1088
|
message: a,
|
|
1069
1089
|
hasAttachment: ge,
|
|
1070
|
-
isMyMessage:
|
|
1090
|
+
isMyMessage: te
|
|
1071
1091
|
}
|
|
1072
1092
|
),
|
|
1073
|
-
n &&
|
|
1074
|
-
|
|
1093
|
+
n && oe && /* @__PURE__ */ e(
|
|
1094
|
+
cn,
|
|
1075
1095
|
{
|
|
1076
1096
|
selected: T,
|
|
1077
1097
|
onVoteUp: M,
|
|
1078
|
-
onVoteDown:
|
|
1098
|
+
onVoteDown: P
|
|
1079
1099
|
}
|
|
1080
1100
|
)
|
|
1081
1101
|
] })
|
|
1082
1102
|
}
|
|
1083
1103
|
),
|
|
1084
|
-
|
|
1104
|
+
ee && /* @__PURE__ */ e(
|
|
1085
1105
|
H,
|
|
1086
1106
|
{
|
|
1087
1107
|
onClick: x,
|
|
@@ -1091,22 +1111,22 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1091
1111
|
le && /* @__PURE__ */ e(F, {})
|
|
1092
1112
|
] }, a.id)
|
|
1093
1113
|
] });
|
|
1094
|
-
},
|
|
1095
|
-
|
|
1096
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 :
|
|
1097
|
-
),
|
|
1098
|
-
const s =
|
|
1099
|
-
return /* @__PURE__ */ e(
|
|
1100
|
-
},
|
|
1114
|
+
}, un = z.memo(
|
|
1115
|
+
dn,
|
|
1116
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : Ft(t, s)
|
|
1117
|
+
), mn = (t) => {
|
|
1118
|
+
const s = mt("CustomMessage");
|
|
1119
|
+
return /* @__PURE__ */ e(un, { ...s, ...t });
|
|
1120
|
+
}, hn = (t) => ({
|
|
1101
1121
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1102
|
-
(s) =>
|
|
1122
|
+
(s) => at.previewIsLoaded(s) || at.previewIsLoading(s)
|
|
1103
1123
|
)
|
|
1104
|
-
}),
|
|
1124
|
+
}), fn = ({
|
|
1105
1125
|
link: t,
|
|
1106
1126
|
onDismiss: s
|
|
1107
1127
|
}) => {
|
|
1108
|
-
const { og_scrape_url: n, title:
|
|
1109
|
-
return /* @__PURE__ */
|
|
1128
|
+
const { og_scrape_url: n, title: i, image_url: l } = t;
|
|
1129
|
+
return /* @__PURE__ */ c(
|
|
1110
1130
|
"a",
|
|
1111
1131
|
{
|
|
1112
1132
|
href: n,
|
|
@@ -1118,7 +1138,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1118
1138
|
"img",
|
|
1119
1139
|
{
|
|
1120
1140
|
src: l,
|
|
1121
|
-
alt:
|
|
1141
|
+
alt: i || "",
|
|
1122
1142
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1123
1143
|
}
|
|
1124
1144
|
),
|
|
@@ -1134,29 +1154,29 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1134
1154
|
children: /* @__PURE__ */ e(Re, { className: "size-4 text-black/90" })
|
|
1135
1155
|
}
|
|
1136
1156
|
),
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
|
|
1157
|
+
/* @__PURE__ */ c("div", { className: "p-2", children: [
|
|
1158
|
+
i && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: i }),
|
|
1139
1159
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1140
1160
|
] })
|
|
1141
1161
|
]
|
|
1142
1162
|
}
|
|
1143
1163
|
);
|
|
1144
|
-
},
|
|
1145
|
-
const { linkPreviewsManager: t } =
|
|
1164
|
+
}, gn = () => {
|
|
1165
|
+
const { linkPreviewsManager: t } = es(), { linkPreviews: s } = ts(
|
|
1146
1166
|
t.state,
|
|
1147
|
-
|
|
1167
|
+
hn
|
|
1148
1168
|
), n = (l) => {
|
|
1149
1169
|
t.dismissPreview(l);
|
|
1150
1170
|
};
|
|
1151
1171
|
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
|
|
1152
|
-
|
|
1172
|
+
fn,
|
|
1153
1173
|
{
|
|
1154
1174
|
link: l,
|
|
1155
1175
|
onDismiss: n
|
|
1156
1176
|
},
|
|
1157
1177
|
l.og_scrape_url
|
|
1158
1178
|
)) }) : null;
|
|
1159
|
-
},
|
|
1179
|
+
}, bn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1160
1180
|
"button",
|
|
1161
1181
|
{
|
|
1162
1182
|
...n,
|
|
@@ -1164,22 +1184,22 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1164
1184
|
"aria-label": "Send",
|
|
1165
1185
|
disabled: s,
|
|
1166
1186
|
onClick: t,
|
|
1167
|
-
children: /* @__PURE__ */ e(
|
|
1187
|
+
children: /* @__PURE__ */ e(ps, { weight: "bold", className: "size-4" })
|
|
1168
1188
|
}
|
|
1169
|
-
),
|
|
1170
|
-
var
|
|
1171
|
-
const { channel: t } =
|
|
1189
|
+
), pn = () => {
|
|
1190
|
+
var d;
|
|
1191
|
+
const { channel: t } = me(), s = ((d = t == null ? void 0 : t.data) == null ? void 0 : d.frozen) === !0, { handleSubmit: n } = ns(), { SendButton: i } = ut(
|
|
1172
1192
|
"CustomMessageInput"
|
|
1173
|
-
), l =
|
|
1174
|
-
return /* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1176
|
-
/* @__PURE__ */
|
|
1177
|
-
/* @__PURE__ */ e(
|
|
1178
|
-
/* @__PURE__ */ e(
|
|
1179
|
-
/* @__PURE__ */ e(
|
|
1180
|
-
/* @__PURE__ */
|
|
1193
|
+
), l = i ?? bn, u = as();
|
|
1194
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
1195
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(rs, {}) }),
|
|
1196
|
+
/* @__PURE__ */ c("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: [
|
|
1197
|
+
/* @__PURE__ */ e(is, {}),
|
|
1198
|
+
/* @__PURE__ */ e(gn, {}),
|
|
1199
|
+
/* @__PURE__ */ e(ls, {}),
|
|
1200
|
+
/* @__PURE__ */ c("div", { className: "flex", children: [
|
|
1181
1201
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1182
|
-
|
|
1202
|
+
os,
|
|
1183
1203
|
{
|
|
1184
1204
|
"aria-disabled": s || void 0,
|
|
1185
1205
|
className: "w-full resize-none outline-none leading-6",
|
|
@@ -1196,19 +1216,19 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1196
1216
|
"aria-label": "Send",
|
|
1197
1217
|
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 focus-ring",
|
|
1198
1218
|
"data-testid": "send-button",
|
|
1199
|
-
disabled: s || !
|
|
1219
|
+
disabled: s || !u,
|
|
1200
1220
|
type: "button"
|
|
1201
1221
|
}
|
|
1202
1222
|
)
|
|
1203
1223
|
] })
|
|
1204
1224
|
] })
|
|
1205
1225
|
] });
|
|
1206
|
-
},
|
|
1226
|
+
}, xn = ({
|
|
1207
1227
|
renderActions: t
|
|
1208
1228
|
}) => {
|
|
1209
|
-
var
|
|
1210
|
-
const { channel: s } =
|
|
1211
|
-
return /* @__PURE__ */
|
|
1229
|
+
var i;
|
|
1230
|
+
const { channel: s } = me(), n = ((i = s == null ? void 0 : s.data) == null ? void 0 : i.frozen) === !0;
|
|
1231
|
+
return /* @__PURE__ */ c(
|
|
1212
1232
|
"div",
|
|
1213
1233
|
{
|
|
1214
1234
|
inert: n ? "" : void 0,
|
|
@@ -1216,50 +1236,50 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1216
1236
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1217
1237
|
children: [
|
|
1218
1238
|
t == null ? void 0 : t(),
|
|
1219
|
-
/* @__PURE__ */ e(
|
|
1239
|
+
/* @__PURE__ */ e(ss, { Input: pn })
|
|
1220
1240
|
]
|
|
1221
1241
|
}
|
|
1222
1242
|
);
|
|
1223
|
-
},
|
|
1243
|
+
}, vn = [
|
|
1224
1244
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1225
1245
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1226
|
-
],
|
|
1246
|
+
], wn = {
|
|
1227
1247
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1228
1248
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1229
|
-
},
|
|
1249
|
+
}, Nn = [
|
|
1230
1250
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1231
|
-
],
|
|
1251
|
+
], yn = {
|
|
1232
1252
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1233
|
-
}, $e = "age safety guidelines.",
|
|
1234
|
-
var
|
|
1235
|
-
const s = (
|
|
1236
|
-
if (
|
|
1253
|
+
}, $e = "age safety guidelines.", Cn = "https://linktr.ee/s/about/contact", lt = (t) => vn.includes(t), _n = (t) => Nn.includes(t), En = (t) => {
|
|
1254
|
+
var i;
|
|
1255
|
+
const s = (i = t.metadata) == null ? void 0 : i.custom_type;
|
|
1256
|
+
if (lt(s))
|
|
1237
1257
|
return {
|
|
1238
1258
|
kind: "dm-agent",
|
|
1239
1259
|
type: s
|
|
1240
1260
|
};
|
|
1241
|
-
if (
|
|
1261
|
+
if (_n(s))
|
|
1242
1262
|
return {
|
|
1243
1263
|
kind: "age-safety",
|
|
1244
1264
|
type: s
|
|
1245
1265
|
};
|
|
1246
1266
|
const n = t.dm_agent_system_type;
|
|
1247
|
-
if (
|
|
1267
|
+
if (lt(n))
|
|
1248
1268
|
return {
|
|
1249
1269
|
kind: "dm-agent",
|
|
1250
1270
|
type: n
|
|
1251
1271
|
};
|
|
1252
|
-
},
|
|
1272
|
+
}, Sn = (t) => {
|
|
1253
1273
|
const s = t.indexOf($e);
|
|
1254
1274
|
if (s === -1)
|
|
1255
1275
|
return t;
|
|
1256
1276
|
const n = s + $e.length;
|
|
1257
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
1258
1278
|
t.slice(0, s),
|
|
1259
1279
|
/* @__PURE__ */ e(
|
|
1260
1280
|
"a",
|
|
1261
1281
|
{
|
|
1262
|
-
href:
|
|
1282
|
+
href: Cn,
|
|
1263
1283
|
target: "_blank",
|
|
1264
1284
|
rel: "noopener noreferrer",
|
|
1265
1285
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1268,15 +1288,15 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1268
1288
|
),
|
|
1269
1289
|
t.slice(n)
|
|
1270
1290
|
] });
|
|
1271
|
-
},
|
|
1272
|
-
var
|
|
1273
|
-
const s = t.message.hide_date === !0, n =
|
|
1291
|
+
}, In = (t) => {
|
|
1292
|
+
var i, l;
|
|
1293
|
+
const s = t.message.hide_date === !0, n = En(
|
|
1274
1294
|
t.message
|
|
1275
1295
|
);
|
|
1276
1296
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1277
|
-
const
|
|
1278
|
-
return /* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1297
|
+
const u = ((i = t.message.text) == null ? void 0 : i.trim()) || wn[n.type];
|
|
1298
|
+
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1299
|
+
/* @__PURE__ */ c(
|
|
1280
1300
|
"div",
|
|
1281
1301
|
{
|
|
1282
1302
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
@@ -1284,7 +1304,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1284
1304
|
"data-dm-agent-system-type": n.type,
|
|
1285
1305
|
children: [
|
|
1286
1306
|
/* @__PURE__ */ e(
|
|
1287
|
-
|
|
1307
|
+
xs,
|
|
1288
1308
|
{
|
|
1289
1309
|
size: 16,
|
|
1290
1310
|
weight: "regular",
|
|
@@ -1292,17 +1312,17 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1292
1312
|
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1293
1313
|
}
|
|
1294
1314
|
),
|
|
1295
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children:
|
|
1315
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: u })
|
|
1296
1316
|
]
|
|
1297
1317
|
}
|
|
1298
1318
|
),
|
|
1299
|
-
!s && /* @__PURE__ */ e(
|
|
1319
|
+
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1300
1320
|
] });
|
|
1301
1321
|
}
|
|
1302
1322
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1303
|
-
const
|
|
1304
|
-
return /* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1323
|
+
const u = ((l = t.message.text) == null ? void 0 : l.trim()) || yn[n.type];
|
|
1324
|
+
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1325
|
+
/* @__PURE__ */ c(
|
|
1306
1326
|
"div",
|
|
1307
1327
|
{
|
|
1308
1328
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
@@ -1310,7 +1330,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1310
1330
|
"data-age-safety-system-type": n.type,
|
|
1311
1331
|
children: [
|
|
1312
1332
|
/* @__PURE__ */ e(
|
|
1313
|
-
|
|
1333
|
+
vs,
|
|
1314
1334
|
{
|
|
1315
1335
|
size: 24,
|
|
1316
1336
|
weight: "duotone",
|
|
@@ -1319,27 +1339,92 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1319
1339
|
"data-testid": "age-safety-system-message-icon"
|
|
1320
1340
|
}
|
|
1321
1341
|
),
|
|
1322
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1342
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Sn(u) }) })
|
|
1323
1343
|
]
|
|
1324
1344
|
}
|
|
1325
1345
|
),
|
|
1326
|
-
!s && /* @__PURE__ */ e(
|
|
1346
|
+
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1327
1347
|
] });
|
|
1328
1348
|
}
|
|
1329
|
-
return /* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1350
|
+
/* @__PURE__ */ c("div", { className: "str-chat__message--system__text", children: [
|
|
1331
1351
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
1332
1352
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1333
1353
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1334
1354
|
] }),
|
|
1335
|
-
!s && /* @__PURE__ */ e(
|
|
1355
|
+
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1336
1356
|
] });
|
|
1337
|
-
},
|
|
1357
|
+
}, ze = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { className: "fill-pebble", cx: t, cy: "4", r: "3.9", children: /* @__PURE__ */ e(
|
|
1358
|
+
"animateTransform",
|
|
1359
|
+
{
|
|
1360
|
+
attributeName: "transform",
|
|
1361
|
+
type: "translate",
|
|
1362
|
+
values: "0 0; 0 -2.25; 0 0;",
|
|
1363
|
+
dur: "900ms",
|
|
1364
|
+
begin: `${120 * s}ms`,
|
|
1365
|
+
repeatCount: "indefinite"
|
|
1366
|
+
}
|
|
1367
|
+
) }), kn = ({ threadList: t }) => {
|
|
1368
|
+
var _;
|
|
1369
|
+
const { channel: s, channelConfig: n, thread: i } = me(), { client: l } = Ye(), { typing: u = {} } = cs();
|
|
1370
|
+
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
1371
|
+
return null;
|
|
1372
|
+
const r = t ? [] : Object.values(u).filter(
|
|
1373
|
+
({ parent_id: w, user: g }) => {
|
|
1374
|
+
var y;
|
|
1375
|
+
return (g == null ? void 0 : g.id) !== ((y = l.user) == null ? void 0 : y.id) && !w;
|
|
1376
|
+
}
|
|
1377
|
+
), d = t ? Object.values(u).filter(
|
|
1378
|
+
({ parent_id: w, user: g }) => {
|
|
1379
|
+
var y;
|
|
1380
|
+
return (g == null ? void 0 : g.id) !== ((y = l.user) == null ? void 0 : y.id) && w === (i == null ? void 0 : i.id);
|
|
1381
|
+
}
|
|
1382
|
+
) : [], x = t ? d : r;
|
|
1383
|
+
if (!x.length)
|
|
1384
|
+
return null;
|
|
1385
|
+
const o = (_ = x[0]) == null ? void 0 : _.user, h = o != null && o.id && s.state.members[o.id] ? s.state.members[o.id].user : void 0, f = (o == null ? void 0 : o.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", N = (o == null ? void 0 : o.name) ?? (h == null ? void 0 : h.name) ?? (o == null ? void 0 : o.id) ?? "Typing user", a = (o == null ? void 0 : o.image) ?? (h == null ? void 0 : h.image);
|
|
1386
|
+
return /* @__PURE__ */ c(
|
|
1387
|
+
"div",
|
|
1388
|
+
{
|
|
1389
|
+
className: "str-chat__typing-indicator !items-end",
|
|
1390
|
+
"data-testid": "typing-indicator",
|
|
1391
|
+
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
1392
|
+
children: [
|
|
1393
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
1394
|
+
ae,
|
|
1395
|
+
{
|
|
1396
|
+
id: f,
|
|
1397
|
+
name: N,
|
|
1398
|
+
image: a,
|
|
1399
|
+
size: 24,
|
|
1400
|
+
shape: "circle"
|
|
1401
|
+
}
|
|
1402
|
+
) }),
|
|
1403
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#F1F0EE] h-12 flex flex-col justify-end", children: /* @__PURE__ */ c(
|
|
1404
|
+
"svg",
|
|
1405
|
+
{
|
|
1406
|
+
"aria-hidden": "true",
|
|
1407
|
+
className: "block overflow-visible",
|
|
1408
|
+
viewBox: "0 0 32 8",
|
|
1409
|
+
width: "32",
|
|
1410
|
+
height: "8",
|
|
1411
|
+
overflow: "visible",
|
|
1412
|
+
children: [
|
|
1413
|
+
/* @__PURE__ */ e(ze, { cx: "4", index: 0 }),
|
|
1414
|
+
/* @__PURE__ */ e(ze, { cx: "16", index: 1 }),
|
|
1415
|
+
/* @__PURE__ */ e(ze, { cx: "28", index: 2 })
|
|
1416
|
+
]
|
|
1417
|
+
}
|
|
1418
|
+
) })
|
|
1419
|
+
]
|
|
1420
|
+
}
|
|
1421
|
+
);
|
|
1422
|
+
}, Tn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ c(
|
|
1338
1423
|
"div",
|
|
1339
1424
|
{
|
|
1340
1425
|
className: O("flex items-center justify-center h-full", t),
|
|
1341
1426
|
children: [
|
|
1342
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1343
1428
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1344
1429
|
"animateTransform",
|
|
1345
1430
|
{
|
|
@@ -1377,88 +1462,88 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1377
1462
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1378
1463
|
]
|
|
1379
1464
|
}
|
|
1380
|
-
), De = z.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */ e(
|
|
1465
|
+
), De = z.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1466
|
+
/* @__PURE__ */ e(Mn, { className: "w-6 h-6" }),
|
|
1382
1467
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1383
1468
|
] }) }));
|
|
1384
1469
|
De.displayName = "LoadingState";
|
|
1385
|
-
const
|
|
1470
|
+
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Dn = ({
|
|
1386
1471
|
onBack: t,
|
|
1387
1472
|
showBackButton: s,
|
|
1388
1473
|
onShowInfo: n,
|
|
1389
|
-
canShowInfo:
|
|
1474
|
+
canShowInfo: i,
|
|
1390
1475
|
showStarButton: l = !1
|
|
1391
1476
|
}) => {
|
|
1392
|
-
var
|
|
1393
|
-
const { channel:
|
|
1394
|
-
(
|
|
1395
|
-
var
|
|
1396
|
-
return ((
|
|
1477
|
+
var f, N, a, _, w;
|
|
1478
|
+
const { channel: u } = me(), r = z.useMemo(() => Object.values(u.state.members || {}).find(
|
|
1479
|
+
(y) => {
|
|
1480
|
+
var I;
|
|
1481
|
+
return ((I = y.user) == null ? void 0 : I.id) && y.user.id !== u._client.userID;
|
|
1397
1482
|
}
|
|
1398
|
-
), [
|
|
1483
|
+
), [u._client.userID, u.state.members]), d = ((f = r == null ? void 0 : r.user) == null ? void 0 : f.name) || ((N = r == null ? void 0 : r.user) == null ? void 0 : N.id) || "Unknown member", x = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, o = pt(u), h = async () => {
|
|
1399
1484
|
try {
|
|
1400
|
-
|
|
1401
|
-
} catch (
|
|
1485
|
+
o ? await u.unpin() : await u.pin();
|
|
1486
|
+
} catch (g) {
|
|
1402
1487
|
console.error(
|
|
1403
1488
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1404
|
-
|
|
1489
|
+
g
|
|
1405
1490
|
);
|
|
1406
1491
|
}
|
|
1407
1492
|
};
|
|
1408
|
-
return /* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ c("div", { className: "@container", children: [
|
|
1494
|
+
/* @__PURE__ */ c("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
1410
1495
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1411
1496
|
"button",
|
|
1412
1497
|
{
|
|
1413
|
-
className:
|
|
1498
|
+
className: fe,
|
|
1414
1499
|
onClick: t || (() => {
|
|
1415
1500
|
}),
|
|
1416
1501
|
type: "button",
|
|
1417
1502
|
"aria-label": "Back to conversations",
|
|
1418
|
-
children: /* @__PURE__ */ e(
|
|
1503
|
+
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1419
1504
|
}
|
|
1420
1505
|
) }),
|
|
1421
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1422
1507
|
/* @__PURE__ */ e(
|
|
1423
|
-
|
|
1508
|
+
ae,
|
|
1424
1509
|
{
|
|
1425
|
-
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) ||
|
|
1426
|
-
name:
|
|
1510
|
+
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) || u.id || "unknown",
|
|
1511
|
+
name: d,
|
|
1427
1512
|
image: x,
|
|
1428
|
-
starred: l &&
|
|
1513
|
+
starred: l && o,
|
|
1429
1514
|
size: 40
|
|
1430
1515
|
}
|
|
1431
1516
|
),
|
|
1432
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ c(
|
|
1433
1518
|
"button",
|
|
1434
1519
|
{
|
|
1435
1520
|
type: "button",
|
|
1436
1521
|
onClick: n,
|
|
1437
1522
|
className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
|
|
1438
|
-
"aria-label": `View info for ${
|
|
1523
|
+
"aria-label": `View info for ${d}`,
|
|
1439
1524
|
children: [
|
|
1440
|
-
|
|
1441
|
-
/* @__PURE__ */ e(
|
|
1525
|
+
d,
|
|
1526
|
+
/* @__PURE__ */ e(et, { className: "size-3 shrink-0" })
|
|
1442
1527
|
]
|
|
1443
1528
|
}
|
|
1444
1529
|
)
|
|
1445
1530
|
] }),
|
|
1446
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ c("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1447
1532
|
l && /* @__PURE__ */ e(
|
|
1448
1533
|
"button",
|
|
1449
1534
|
{
|
|
1450
|
-
className:
|
|
1451
|
-
onClick:
|
|
1535
|
+
className: fe,
|
|
1536
|
+
onClick: h,
|
|
1452
1537
|
type: "button",
|
|
1453
|
-
"aria-label":
|
|
1538
|
+
"aria-label": o ? "Unstar conversation" : "Star conversation",
|
|
1454
1539
|
children: /* @__PURE__ */ e(
|
|
1455
|
-
|
|
1540
|
+
je,
|
|
1456
1541
|
{
|
|
1457
1542
|
className: O("size-5", {
|
|
1458
|
-
"text-yellow-600":
|
|
1459
|
-
"text-black/90": !
|
|
1543
|
+
"text-yellow-600": o,
|
|
1544
|
+
"text-black/90": !o
|
|
1460
1545
|
}),
|
|
1461
|
-
weight:
|
|
1546
|
+
weight: o ? "duotone" : "regular"
|
|
1462
1547
|
}
|
|
1463
1548
|
)
|
|
1464
1549
|
}
|
|
@@ -1466,210 +1551,204 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1466
1551
|
/* @__PURE__ */ e(
|
|
1467
1552
|
"button",
|
|
1468
1553
|
{
|
|
1469
|
-
className:
|
|
1554
|
+
className: fe,
|
|
1470
1555
|
onClick: n,
|
|
1471
1556
|
type: "button",
|
|
1472
1557
|
"aria-label": "Show info",
|
|
1473
|
-
children: /* @__PURE__ */ e(
|
|
1558
|
+
children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
|
|
1474
1559
|
}
|
|
1475
1560
|
)
|
|
1476
1561
|
] })
|
|
1477
1562
|
] }),
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ c("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1564
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1480
1565
|
s && t && /* @__PURE__ */ e(
|
|
1481
1566
|
"button",
|
|
1482
1567
|
{
|
|
1483
1568
|
type: "button",
|
|
1484
1569
|
onClick: t,
|
|
1485
|
-
className:
|
|
1570
|
+
className: fe,
|
|
1486
1571
|
"aria-label": "Back to conversations",
|
|
1487
|
-
children: /* @__PURE__ */ e(
|
|
1572
|
+
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1488
1573
|
}
|
|
1489
1574
|
),
|
|
1490
1575
|
/* @__PURE__ */ e(
|
|
1491
|
-
|
|
1576
|
+
ae,
|
|
1492
1577
|
{
|
|
1493
|
-
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) ||
|
|
1494
|
-
name:
|
|
1578
|
+
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || u.id || "unknown",
|
|
1579
|
+
name: d,
|
|
1495
1580
|
image: x,
|
|
1496
|
-
starred: l &&
|
|
1581
|
+
starred: l && o,
|
|
1497
1582
|
size: 40
|
|
1498
1583
|
}
|
|
1499
1584
|
),
|
|
1500
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children:
|
|
1585
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: i ? /* @__PURE__ */ c(
|
|
1501
1586
|
"button",
|
|
1502
1587
|
{
|
|
1503
1588
|
type: "button",
|
|
1504
1589
|
onClick: n,
|
|
1505
1590
|
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
1506
|
-
"aria-label": `View info for ${
|
|
1591
|
+
"aria-label": `View info for ${d}`,
|
|
1507
1592
|
children: [
|
|
1508
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
1509
|
-
/* @__PURE__ */ e(
|
|
1593
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: d }),
|
|
1594
|
+
/* @__PURE__ */ e(et, { className: "size-4 shrink-0" })
|
|
1510
1595
|
]
|
|
1511
1596
|
}
|
|
1512
|
-
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children:
|
|
1597
|
+
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: d }) })
|
|
1513
1598
|
] }),
|
|
1514
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1515
1600
|
l && /* @__PURE__ */ e(
|
|
1516
1601
|
"button",
|
|
1517
1602
|
{
|
|
1518
|
-
className:
|
|
1519
|
-
onClick:
|
|
1603
|
+
className: fe,
|
|
1604
|
+
onClick: h,
|
|
1520
1605
|
type: "button",
|
|
1521
|
-
"aria-label":
|
|
1606
|
+
"aria-label": o ? "Unstar conversation" : "Star conversation",
|
|
1522
1607
|
children: /* @__PURE__ */ e(
|
|
1523
|
-
|
|
1608
|
+
je,
|
|
1524
1609
|
{
|
|
1525
1610
|
className: O("size-5", {
|
|
1526
|
-
"text-yellow-600":
|
|
1527
|
-
"text-black/90": !
|
|
1611
|
+
"text-yellow-600": o,
|
|
1612
|
+
"text-black/90": !o
|
|
1528
1613
|
}),
|
|
1529
|
-
weight:
|
|
1614
|
+
weight: o ? "duotone" : "regular"
|
|
1530
1615
|
}
|
|
1531
1616
|
)
|
|
1532
1617
|
}
|
|
1533
1618
|
),
|
|
1534
|
-
|
|
1619
|
+
i && n && /* @__PURE__ */ e(
|
|
1535
1620
|
"button",
|
|
1536
1621
|
{
|
|
1537
|
-
className:
|
|
1622
|
+
className: fe,
|
|
1538
1623
|
onClick: n,
|
|
1539
1624
|
type: "button",
|
|
1540
1625
|
"aria-label": "Show info",
|
|
1541
|
-
children: /* @__PURE__ */ e(
|
|
1626
|
+
children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
|
|
1542
1627
|
}
|
|
1543
1628
|
)
|
|
1544
1629
|
] })
|
|
1545
1630
|
] })
|
|
1546
1631
|
] });
|
|
1547
|
-
},
|
|
1632
|
+
}, Rn = ({
|
|
1548
1633
|
onBack: t,
|
|
1549
1634
|
showBackButton: s,
|
|
1550
1635
|
renderMessageInputActions: n,
|
|
1551
|
-
renderConversationFooter:
|
|
1636
|
+
renderConversationFooter: i,
|
|
1552
1637
|
onLeaveConversation: l,
|
|
1553
|
-
onBlockParticipant:
|
|
1638
|
+
onBlockParticipant: u,
|
|
1554
1639
|
showDeleteConversation: r = !0,
|
|
1555
|
-
onDeleteConversationClick:
|
|
1640
|
+
onDeleteConversationClick: d,
|
|
1556
1641
|
onBlockParticipantClick: x,
|
|
1557
|
-
onReportParticipantClick:
|
|
1558
|
-
showStarButton:
|
|
1559
|
-
chatbotVotingEnabled:
|
|
1642
|
+
onReportParticipantClick: o,
|
|
1643
|
+
showStarButton: h = !1,
|
|
1644
|
+
chatbotVotingEnabled: f = !1,
|
|
1560
1645
|
renderChannelBanner: N,
|
|
1561
1646
|
customProfileContent: a,
|
|
1562
1647
|
customChannelActions: _,
|
|
1563
1648
|
renderMessage: w
|
|
1564
1649
|
}) => {
|
|
1565
|
-
const { channel:
|
|
1566
|
-
(
|
|
1650
|
+
const { channel: g } = me(), y = X(null), I = z.useMemo(() => Object.values(g.state.members || {}).find(
|
|
1651
|
+
(b) => {
|
|
1567
1652
|
var T;
|
|
1568
|
-
return ((T =
|
|
1653
|
+
return ((T = b.user) == null ? void 0 : T.id) && b.user.id !== g._client.userID;
|
|
1569
1654
|
}
|
|
1570
|
-
), [
|
|
1571
|
-
const m =
|
|
1655
|
+
), [g._client.userID, g.state.members]), C = z.useMemo(() => {
|
|
1656
|
+
const m = g.data ?? {};
|
|
1572
1657
|
if (m.followerStatus)
|
|
1573
1658
|
return String(m.followerStatus);
|
|
1574
1659
|
if (m.isFollower !== void 0)
|
|
1575
1660
|
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1576
|
-
}, [
|
|
1661
|
+
}, [g.data]), S = A(() => {
|
|
1577
1662
|
var m;
|
|
1578
|
-
(m =
|
|
1579
|
-
}, []),
|
|
1663
|
+
(m = y.current) == null || m.showModal();
|
|
1664
|
+
}, []), L = A(() => {
|
|
1580
1665
|
var m;
|
|
1581
|
-
(m =
|
|
1666
|
+
(m = y.current) == null || m.close();
|
|
1582
1667
|
}, []), v = A(
|
|
1583
1668
|
(m) => {
|
|
1584
|
-
const { message:
|
|
1585
|
-
|
|
1586
|
-
{
|
|
1587
|
-
...m,
|
|
1588
|
-
chatbotVotingEnabled: h
|
|
1589
|
-
}
|
|
1590
|
-
);
|
|
1591
|
-
return !w || !f ? T : w(T, f);
|
|
1669
|
+
const { message: b } = mt("ChannelView"), T = /* @__PURE__ */ e(mn, { ...m, chatbotVotingEnabled: f });
|
|
1670
|
+
return !w || !b ? T : w(T, b);
|
|
1592
1671
|
},
|
|
1593
|
-
[
|
|
1672
|
+
[f, w]
|
|
1594
1673
|
);
|
|
1595
|
-
return /* @__PURE__ */
|
|
1596
|
-
/* @__PURE__ */ e(
|
|
1674
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
1675
|
+
/* @__PURE__ */ e(us, { overrides: { Message: v }, children: /* @__PURE__ */ c(ms, { children: [
|
|
1597
1676
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1598
|
-
|
|
1677
|
+
Dn,
|
|
1599
1678
|
{
|
|
1600
1679
|
onBack: t,
|
|
1601
1680
|
showBackButton: s,
|
|
1602
|
-
onShowInfo:
|
|
1603
|
-
canShowInfo: !!
|
|
1604
|
-
showStarButton:
|
|
1681
|
+
onShowInfo: S,
|
|
1682
|
+
canShowInfo: !!I,
|
|
1683
|
+
showStarButton: h
|
|
1605
1684
|
}
|
|
1606
1685
|
) }),
|
|
1607
1686
|
N == null ? void 0 : N(),
|
|
1608
1687
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1609
|
-
|
|
1688
|
+
hs,
|
|
1610
1689
|
{
|
|
1611
1690
|
hideDeletedMessages: !0,
|
|
1612
1691
|
hideNewMessageSeparator: !1,
|
|
1613
1692
|
messageActions: void 0
|
|
1614
1693
|
}
|
|
1615
1694
|
) }),
|
|
1616
|
-
|
|
1695
|
+
i == null ? void 0 : i(g),
|
|
1617
1696
|
/* @__PURE__ */ e(
|
|
1618
|
-
|
|
1697
|
+
xn,
|
|
1619
1698
|
{
|
|
1620
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1699
|
+
renderActions: () => n == null ? void 0 : n(g)
|
|
1621
1700
|
}
|
|
1622
1701
|
)
|
|
1623
1702
|
] }) }),
|
|
1624
1703
|
/* @__PURE__ */ e(
|
|
1625
|
-
|
|
1704
|
+
Zs,
|
|
1626
1705
|
{
|
|
1627
|
-
dialogRef:
|
|
1628
|
-
onClose:
|
|
1629
|
-
participant:
|
|
1630
|
-
channel:
|
|
1706
|
+
dialogRef: y,
|
|
1707
|
+
onClose: L,
|
|
1708
|
+
participant: I,
|
|
1709
|
+
channel: g,
|
|
1631
1710
|
followerStatusLabel: C,
|
|
1632
1711
|
onLeaveConversation: l,
|
|
1633
|
-
onBlockParticipant:
|
|
1712
|
+
onBlockParticipant: u,
|
|
1634
1713
|
showDeleteConversation: r,
|
|
1635
|
-
onDeleteConversationClick:
|
|
1714
|
+
onDeleteConversationClick: d,
|
|
1636
1715
|
onBlockParticipantClick: x,
|
|
1637
|
-
onReportParticipantClick:
|
|
1716
|
+
onReportParticipantClick: o,
|
|
1638
1717
|
customProfileContent: a,
|
|
1639
1718
|
customChannelActions: _
|
|
1640
1719
|
}
|
|
1641
1720
|
)
|
|
1642
1721
|
] });
|
|
1643
|
-
},
|
|
1722
|
+
}, Et = z.memo(
|
|
1644
1723
|
({
|
|
1645
1724
|
channel: t,
|
|
1646
1725
|
onBack: s,
|
|
1647
1726
|
showBackButton: n = !1,
|
|
1648
|
-
renderMessageInputActions:
|
|
1727
|
+
renderMessageInputActions: i,
|
|
1649
1728
|
renderConversationFooter: l,
|
|
1650
|
-
onLeaveConversation:
|
|
1729
|
+
onLeaveConversation: u,
|
|
1651
1730
|
onBlockParticipant: r,
|
|
1652
|
-
className:
|
|
1653
|
-
CustomChannelEmptyState: x =
|
|
1654
|
-
showDeleteConversation:
|
|
1655
|
-
onDeleteConversationClick:
|
|
1656
|
-
onBlockParticipantClick:
|
|
1731
|
+
className: d,
|
|
1732
|
+
CustomChannelEmptyState: x = Tn,
|
|
1733
|
+
showDeleteConversation: o = !0,
|
|
1734
|
+
onDeleteConversationClick: h,
|
|
1735
|
+
onBlockParticipantClick: f,
|
|
1657
1736
|
onReportParticipantClick: N,
|
|
1658
1737
|
dmAgentEnabled: a,
|
|
1659
1738
|
messageMetadata: _,
|
|
1660
1739
|
onMessageSent: w,
|
|
1661
|
-
showStarButton:
|
|
1662
|
-
chatbotVotingEnabled:
|
|
1663
|
-
renderChannelBanner:
|
|
1740
|
+
showStarButton: g = !1,
|
|
1741
|
+
chatbotVotingEnabled: y = !1,
|
|
1742
|
+
renderChannelBanner: I,
|
|
1664
1743
|
customProfileContent: C,
|
|
1665
|
-
customChannelActions:
|
|
1666
|
-
renderMessage:
|
|
1744
|
+
customChannelActions: S,
|
|
1745
|
+
renderMessage: L,
|
|
1667
1746
|
sendButton: v
|
|
1668
1747
|
}) => {
|
|
1669
1748
|
const m = A(
|
|
1670
|
-
async (
|
|
1749
|
+
async (b, T, M) => {
|
|
1671
1750
|
var V;
|
|
1672
|
-
const
|
|
1751
|
+
const P = ((V = t.data) == null ? void 0 : V.chatbot_paused) === !0, R = a && !P, B = {
|
|
1673
1752
|
...T,
|
|
1674
1753
|
...R && { silent: !0 },
|
|
1675
1754
|
..._ && {
|
|
@@ -1678,10 +1757,10 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1678
1757
|
..._
|
|
1679
1758
|
}
|
|
1680
1759
|
}
|
|
1681
|
-
},
|
|
1760
|
+
}, Q = {
|
|
1682
1761
|
...M,
|
|
1683
1762
|
...R && { skip_push: !0 }
|
|
1684
|
-
}, J = await t.sendMessage(B,
|
|
1763
|
+
}, J = await t.sendMessage(B, Q);
|
|
1685
1764
|
return w == null || w(J), J;
|
|
1686
1765
|
},
|
|
1687
1766
|
[t, a, _, w]
|
|
@@ -1691,38 +1770,39 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1691
1770
|
{
|
|
1692
1771
|
className: O(
|
|
1693
1772
|
"messaging-channel-view h-full flex flex-col",
|
|
1694
|
-
|
|
1773
|
+
d
|
|
1695
1774
|
),
|
|
1696
1775
|
children: /* @__PURE__ */ e(
|
|
1697
|
-
|
|
1776
|
+
ds,
|
|
1698
1777
|
{
|
|
1699
1778
|
channel: t,
|
|
1700
|
-
MessageSystem:
|
|
1779
|
+
MessageSystem: In,
|
|
1701
1780
|
EmptyStateIndicator: x,
|
|
1702
1781
|
LoadingIndicator: De,
|
|
1703
|
-
DateSeparator:
|
|
1782
|
+
DateSeparator: Xs,
|
|
1783
|
+
TypingIndicator: kn,
|
|
1704
1784
|
doSendMessageRequest: m,
|
|
1705
1785
|
...v ? { SendButton: v } : {},
|
|
1706
1786
|
children: /* @__PURE__ */ e(
|
|
1707
|
-
|
|
1787
|
+
Rn,
|
|
1708
1788
|
{
|
|
1709
1789
|
onBack: s,
|
|
1710
1790
|
showBackButton: n,
|
|
1711
|
-
renderMessageInputActions:
|
|
1791
|
+
renderMessageInputActions: i,
|
|
1712
1792
|
renderConversationFooter: l,
|
|
1713
|
-
onLeaveConversation:
|
|
1793
|
+
onLeaveConversation: u,
|
|
1714
1794
|
onBlockParticipant: r,
|
|
1715
1795
|
CustomChannelEmptyState: x,
|
|
1716
|
-
showDeleteConversation:
|
|
1717
|
-
onDeleteConversationClick:
|
|
1718
|
-
onBlockParticipantClick:
|
|
1796
|
+
showDeleteConversation: o,
|
|
1797
|
+
onDeleteConversationClick: h,
|
|
1798
|
+
onBlockParticipantClick: f,
|
|
1719
1799
|
onReportParticipantClick: N,
|
|
1720
|
-
showStarButton:
|
|
1721
|
-
chatbotVotingEnabled:
|
|
1722
|
-
renderChannelBanner:
|
|
1800
|
+
showStarButton: g,
|
|
1801
|
+
chatbotVotingEnabled: y,
|
|
1802
|
+
renderChannelBanner: I,
|
|
1723
1803
|
customProfileContent: C,
|
|
1724
|
-
customChannelActions:
|
|
1725
|
-
renderMessage:
|
|
1804
|
+
customChannelActions: S,
|
|
1805
|
+
renderMessage: L
|
|
1726
1806
|
}
|
|
1727
1807
|
)
|
|
1728
1808
|
}
|
|
@@ -1731,16 +1811,16 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1731
1811
|
);
|
|
1732
1812
|
}
|
|
1733
1813
|
);
|
|
1734
|
-
|
|
1735
|
-
function
|
|
1814
|
+
Et.displayName = "ChannelView";
|
|
1815
|
+
function Pn({
|
|
1736
1816
|
searchQuery: t,
|
|
1737
1817
|
setSearchQuery: s,
|
|
1738
1818
|
placeholder: n
|
|
1739
1819
|
}) {
|
|
1740
|
-
const
|
|
1741
|
-
return /* @__PURE__ */
|
|
1820
|
+
const i = X(null);
|
|
1821
|
+
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1742
1822
|
/* @__PURE__ */ e(
|
|
1743
|
-
|
|
1823
|
+
ws,
|
|
1744
1824
|
{
|
|
1745
1825
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1746
1826
|
weight: "bold"
|
|
@@ -1749,7 +1829,7 @@ function Mn({
|
|
|
1749
1829
|
/* @__PURE__ */ e(
|
|
1750
1830
|
"input",
|
|
1751
1831
|
{
|
|
1752
|
-
ref:
|
|
1832
|
+
ref: i,
|
|
1753
1833
|
type: "text",
|
|
1754
1834
|
placeholder: n,
|
|
1755
1835
|
value: t,
|
|
@@ -1758,12 +1838,12 @@ function Mn({
|
|
|
1758
1838
|
}
|
|
1759
1839
|
),
|
|
1760
1840
|
t && /* @__PURE__ */ e(
|
|
1761
|
-
|
|
1841
|
+
Nt,
|
|
1762
1842
|
{
|
|
1763
1843
|
label: "Clear search",
|
|
1764
1844
|
onClick: () => {
|
|
1765
1845
|
var l;
|
|
1766
|
-
s(""), (l =
|
|
1846
|
+
s(""), (l = i.current) == null || l.focus();
|
|
1767
1847
|
},
|
|
1768
1848
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1769
1849
|
children: /* @__PURE__ */ e(Re, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -1771,75 +1851,75 @@ function Mn({
|
|
|
1771
1851
|
)
|
|
1772
1852
|
] });
|
|
1773
1853
|
}
|
|
1774
|
-
const
|
|
1854
|
+
const Ln = ({
|
|
1775
1855
|
participantSource: t,
|
|
1776
1856
|
onSelectParticipant: s,
|
|
1777
1857
|
onClose: n,
|
|
1778
|
-
existingParticipantIds:
|
|
1858
|
+
existingParticipantIds: i = /* @__PURE__ */ new Set(),
|
|
1779
1859
|
participantLabel: l = "participants",
|
|
1780
|
-
searchPlaceholder:
|
|
1860
|
+
searchPlaceholder: u = "Search participants...",
|
|
1781
1861
|
className: r
|
|
1782
1862
|
}) => {
|
|
1783
|
-
const { debug:
|
|
1863
|
+
const { debug: d } = Pe(), [x, o] = k(""), [h, f] = k([]), [N, a] = k(!1), [_, w] = k(null), [g, y] = k(
|
|
1784
1864
|
null
|
|
1785
|
-
),
|
|
1865
|
+
), I = X(!1);
|
|
1786
1866
|
q(() => {
|
|
1787
|
-
|
|
1867
|
+
I.current = !1;
|
|
1788
1868
|
}, [t]), q(() => {
|
|
1789
1869
|
if (t.loading) {
|
|
1790
|
-
|
|
1870
|
+
d && console.log(
|
|
1791
1871
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1792
1872
|
);
|
|
1793
1873
|
return;
|
|
1794
1874
|
}
|
|
1795
|
-
if (
|
|
1875
|
+
if (I.current) return;
|
|
1796
1876
|
(async () => {
|
|
1797
|
-
|
|
1877
|
+
d && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), w(null);
|
|
1798
1878
|
try {
|
|
1799
1879
|
const m = await t.loadParticipants({
|
|
1800
1880
|
search: "",
|
|
1801
1881
|
// Load all participants initially
|
|
1802
1882
|
limit: 100
|
|
1803
1883
|
});
|
|
1804
|
-
|
|
1884
|
+
f(m.participants), I.current = !0, d && console.log(
|
|
1805
1885
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1806
1886
|
m.participants.length
|
|
1807
1887
|
);
|
|
1808
1888
|
} catch (m) {
|
|
1809
|
-
const
|
|
1810
|
-
w(
|
|
1889
|
+
const b = m instanceof Error ? m.message : "Failed to load participants";
|
|
1890
|
+
w(b), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1811
1891
|
} finally {
|
|
1812
1892
|
a(!1);
|
|
1813
1893
|
}
|
|
1814
1894
|
})();
|
|
1815
|
-
}, [t,
|
|
1816
|
-
const C =
|
|
1817
|
-
var
|
|
1895
|
+
}, [t, d]);
|
|
1896
|
+
const C = h.filter((v) => !i.has(v.id)).filter((v) => {
|
|
1897
|
+
var b;
|
|
1818
1898
|
if (!x) return !0;
|
|
1819
1899
|
const m = x.toLowerCase();
|
|
1820
|
-
return v.name.toLowerCase().includes(m) || ((
|
|
1821
|
-
}),
|
|
1900
|
+
return v.name.toLowerCase().includes(m) || ((b = v.email) == null ? void 0 : b.toLowerCase().includes(m)) || !1;
|
|
1901
|
+
}), S = A(
|
|
1822
1902
|
async (v) => {
|
|
1823
|
-
if (!
|
|
1824
|
-
|
|
1903
|
+
if (!g) {
|
|
1904
|
+
y(v.id);
|
|
1825
1905
|
try {
|
|
1826
1906
|
await s(v);
|
|
1827
1907
|
} catch (m) {
|
|
1828
|
-
console.error("[ParticipantPicker] Failed to start chat:", m),
|
|
1908
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), y(null);
|
|
1829
1909
|
}
|
|
1830
1910
|
}
|
|
1831
1911
|
},
|
|
1832
|
-
[s,
|
|
1833
|
-
),
|
|
1834
|
-
(v.key === "Enter" || v.key === " ") && (v.preventDefault(),
|
|
1912
|
+
[s, g]
|
|
1913
|
+
), L = (v, m) => {
|
|
1914
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), S(m));
|
|
1835
1915
|
};
|
|
1836
|
-
return /* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ c("div", { className: O("flex flex-col h-full", r), children: [
|
|
1917
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1918
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1839
1919
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1840
|
-
/* @__PURE__ */ e(
|
|
1920
|
+
/* @__PURE__ */ e(yt, { onClick: n })
|
|
1841
1921
|
] }),
|
|
1842
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
|
|
1843
1923
|
"Select a ",
|
|
1844
1924
|
l.slice(0, -1),
|
|
1845
1925
|
" to start messaging (",
|
|
@@ -1848,45 +1928,45 @@ const Dn = ({
|
|
|
1848
1928
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1849
1929
|
] }),
|
|
1850
1930
|
/* @__PURE__ */ e(
|
|
1851
|
-
|
|
1931
|
+
Pn,
|
|
1852
1932
|
{
|
|
1853
1933
|
searchQuery: x,
|
|
1854
|
-
setSearchQuery:
|
|
1855
|
-
placeholder:
|
|
1934
|
+
setSearchQuery: o,
|
|
1935
|
+
placeholder: u
|
|
1856
1936
|
}
|
|
1857
1937
|
)
|
|
1858
1938
|
] }),
|
|
1859
|
-
_ && /* @__PURE__ */
|
|
1939
|
+
_ && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1860
1940
|
"Error loading ",
|
|
1861
1941
|
l,
|
|
1862
1942
|
": ",
|
|
1863
1943
|
_
|
|
1864
1944
|
] }),
|
|
1865
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1866
1946
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1867
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
|
|
1868
1948
|
"Loading ",
|
|
1869
1949
|
l,
|
|
1870
1950
|
"..."
|
|
1871
1951
|
] })
|
|
1872
|
-
] }) }) : C.length === 0 ? /* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1874
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` :
|
|
1875
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" :
|
|
1876
|
-
] }) : /* @__PURE__ */
|
|
1952
|
+
] }) }) : C.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
|
|
1953
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(st, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1954
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : h.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1955
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : h.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1956
|
+
] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
|
|
1877
1957
|
C.map((v) => {
|
|
1878
|
-
const m = v.name || v.email || v.id,
|
|
1958
|
+
const m = v.name || v.email || v.id, b = v.email && v.name ? v.email : v.phone;
|
|
1879
1959
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1880
1960
|
"button",
|
|
1881
1961
|
{
|
|
1882
1962
|
type: "button",
|
|
1883
|
-
onClick: () =>
|
|
1884
|
-
onKeyDown: (T) =>
|
|
1963
|
+
onClick: () => S(v),
|
|
1964
|
+
onKeyDown: (T) => L(T, v),
|
|
1885
1965
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1886
|
-
children: /* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1966
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
|
|
1967
|
+
/* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1888
1968
|
/* @__PURE__ */ e(
|
|
1889
|
-
|
|
1969
|
+
ae,
|
|
1890
1970
|
{
|
|
1891
1971
|
id: v.id,
|
|
1892
1972
|
name: m,
|
|
@@ -1894,23 +1974,23 @@ const Dn = ({
|
|
|
1894
1974
|
size: 40
|
|
1895
1975
|
}
|
|
1896
1976
|
),
|
|
1897
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
1898
1978
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1899
|
-
|
|
1979
|
+
b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
|
|
1900
1980
|
] })
|
|
1901
1981
|
] }),
|
|
1902
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1982
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: g === v.id ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(st, { className: "h-5 w-5 text-stone" }) })
|
|
1903
1983
|
] })
|
|
1904
1984
|
}
|
|
1905
1985
|
) }, v.id);
|
|
1906
1986
|
}),
|
|
1907
|
-
N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */
|
|
1987
|
+
N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1908
1988
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1909
1989
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1910
1990
|
] }) })
|
|
1911
1991
|
] }) })
|
|
1912
1992
|
] });
|
|
1913
|
-
},
|
|
1993
|
+
}, Fn = ({ className: t }) => /* @__PURE__ */ c(
|
|
1914
1994
|
"svg",
|
|
1915
1995
|
{
|
|
1916
1996
|
width: "140",
|
|
@@ -1920,7 +2000,7 @@ const Dn = ({
|
|
|
1920
2000
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1921
2001
|
className: t,
|
|
1922
2002
|
children: [
|
|
1923
|
-
/* @__PURE__ */
|
|
2003
|
+
/* @__PURE__ */ c("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1924
2004
|
/* @__PURE__ */ e(
|
|
1925
2005
|
"path",
|
|
1926
2006
|
{
|
|
@@ -1949,7 +2029,7 @@ const Dn = ({
|
|
|
1949
2029
|
fill: "white"
|
|
1950
2030
|
}
|
|
1951
2031
|
),
|
|
1952
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ c("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1953
2033
|
/* @__PURE__ */ e(
|
|
1954
2034
|
"path",
|
|
1955
2035
|
{
|
|
@@ -1989,8 +2069,8 @@ const Dn = ({
|
|
|
1989
2069
|
}
|
|
1990
2070
|
)
|
|
1991
2071
|
] }),
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
-
/* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ c("defs", { children: [
|
|
2073
|
+
/* @__PURE__ */ c(
|
|
1994
2074
|
"filter",
|
|
1995
2075
|
{
|
|
1996
2076
|
id: "filter0_empty_state",
|
|
@@ -2044,17 +2124,17 @@ const Dn = ({
|
|
|
2044
2124
|
] })
|
|
2045
2125
|
]
|
|
2046
2126
|
}
|
|
2047
|
-
),
|
|
2048
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */ e(
|
|
2050
|
-
s && !t && /* @__PURE__ */
|
|
2127
|
+
), St = z.memo(
|
|
2128
|
+
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2129
|
+
/* @__PURE__ */ e(Fn, {}),
|
|
2130
|
+
s && !t && /* @__PURE__ */ c("div", { className: "mt-8", children: [
|
|
2051
2131
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2052
2132
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2053
2133
|
] })
|
|
2054
2134
|
] }) })
|
|
2055
2135
|
);
|
|
2056
|
-
|
|
2057
|
-
const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */
|
|
2136
|
+
St.displayName = "EmptyState";
|
|
2137
|
+
const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
|
|
2058
2138
|
/* @__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: "⚠️" }) }),
|
|
2059
2139
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2060
2140
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -2069,45 +2149,45 @@ const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
2069
2149
|
)
|
|
2070
2150
|
] }) }));
|
|
2071
2151
|
Te.displayName = "ErrorState";
|
|
2072
|
-
const
|
|
2152
|
+
const la = ({
|
|
2073
2153
|
capabilities: t = {},
|
|
2074
2154
|
className: s,
|
|
2075
2155
|
renderMessageInputActions: n,
|
|
2076
|
-
renderConversationFooter:
|
|
2156
|
+
renderConversationFooter: i,
|
|
2077
2157
|
onChannelSelect: l,
|
|
2078
|
-
onParticipantSelect:
|
|
2158
|
+
onParticipantSelect: u,
|
|
2079
2159
|
initialParticipantFilter: r,
|
|
2080
|
-
initialParticipantData:
|
|
2160
|
+
initialParticipantData: d,
|
|
2081
2161
|
CustomChannelEmptyState: x,
|
|
2082
|
-
showChannelList:
|
|
2083
|
-
filters:
|
|
2084
|
-
channelRenderFilterFn:
|
|
2162
|
+
showChannelList: o = !0,
|
|
2163
|
+
filters: h,
|
|
2164
|
+
channelRenderFilterFn: f,
|
|
2085
2165
|
channelListCustomEmptyStateIndicator: N,
|
|
2086
2166
|
onDeleteConversationClick: a,
|
|
2087
2167
|
onBlockParticipantClick: _,
|
|
2088
2168
|
onReportParticipantClick: w,
|
|
2089
|
-
dmAgentEnabled:
|
|
2090
|
-
messageMetadata:
|
|
2091
|
-
onMessageSent:
|
|
2169
|
+
dmAgentEnabled: g,
|
|
2170
|
+
messageMetadata: y,
|
|
2171
|
+
onMessageSent: I,
|
|
2092
2172
|
showStarButton: C = !1,
|
|
2093
|
-
chatbotVotingEnabled:
|
|
2094
|
-
renderMessagePreview:
|
|
2173
|
+
chatbotVotingEnabled: S = !1,
|
|
2174
|
+
renderMessagePreview: L,
|
|
2095
2175
|
renderChannelBanner: v,
|
|
2096
2176
|
customProfileContent: m,
|
|
2097
|
-
customChannelActions:
|
|
2177
|
+
customChannelActions: b,
|
|
2098
2178
|
renderMessage: T,
|
|
2099
2179
|
sendButton: M
|
|
2100
2180
|
}) => {
|
|
2101
2181
|
const {
|
|
2102
|
-
service:
|
|
2182
|
+
service: P,
|
|
2103
2183
|
client: R,
|
|
2104
2184
|
isConnected: B,
|
|
2105
|
-
isLoading:
|
|
2185
|
+
isLoading: Q,
|
|
2106
2186
|
error: J,
|
|
2107
2187
|
refreshConnection: V,
|
|
2108
2188
|
debug: F
|
|
2109
|
-
} =
|
|
2110
|
-
participantSource:
|
|
2189
|
+
} = Fs(), [H, Z] = k(null), [re, K] = k(!1), [p, E] = k(!1), [U, j] = k(!1), [ee, le] = k(/* @__PURE__ */ new Set()), [pe, Le] = k(0), [Y, te] = k(!1), [xe, ie] = k(null), he = X(null), {
|
|
2190
|
+
participantSource: oe,
|
|
2111
2191
|
participantLabel: ve = "participants",
|
|
2112
2192
|
showDeleteConversation: ge = !0
|
|
2113
2193
|
} = t, we = z.useMemo(() => {
|
|
@@ -2121,9 +2201,9 @@ const aa = ({
|
|
|
2121
2201
|
hidden: !1
|
|
2122
2202
|
}
|
|
2123
2203
|
},
|
|
2124
|
-
...
|
|
2204
|
+
...h
|
|
2125
2205
|
};
|
|
2126
|
-
}, [
|
|
2206
|
+
}, [h, R == null ? void 0 : R.userID]), ce = X(null), ne = A(async () => {
|
|
2127
2207
|
if (!R || !B) return;
|
|
2128
2208
|
const D = R.userID;
|
|
2129
2209
|
if (D)
|
|
@@ -2139,12 +2219,12 @@ const aa = ({
|
|
|
2139
2219
|
), $ = /* @__PURE__ */ new Set();
|
|
2140
2220
|
W.forEach((G) => {
|
|
2141
2221
|
const Fe = G.state.members;
|
|
2142
|
-
Object.values(Fe).forEach((
|
|
2143
|
-
var
|
|
2144
|
-
const Ae = (
|
|
2222
|
+
Object.values(Fe).forEach((Mt) => {
|
|
2223
|
+
var Xe;
|
|
2224
|
+
const Ae = (Xe = Mt.user) == null ? void 0 : Xe.id;
|
|
2145
2225
|
Ae && Ae !== D && $.add(Ae);
|
|
2146
2226
|
});
|
|
2147
|
-
}), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0),
|
|
2227
|
+
}), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0), E(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2148
2228
|
channelCount: W.length,
|
|
2149
2229
|
memberCount: $.size
|
|
2150
2230
|
});
|
|
@@ -2175,23 +2255,23 @@ const aa = ({
|
|
|
2175
2255
|
{ limit: 1 }
|
|
2176
2256
|
);
|
|
2177
2257
|
if ($.length > 0)
|
|
2178
|
-
Z($[0]),
|
|
2258
|
+
Z($[0]), te(!0), ie(null), l && l($[0]), F && console.log(
|
|
2179
2259
|
"[MessagingShell] Initial conversation loaded:",
|
|
2180
2260
|
$[0].id
|
|
2181
2261
|
);
|
|
2182
|
-
else if (
|
|
2262
|
+
else if (d && P) {
|
|
2183
2263
|
F && console.log(
|
|
2184
2264
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2185
|
-
|
|
2265
|
+
d
|
|
2186
2266
|
);
|
|
2187
2267
|
try {
|
|
2188
|
-
const G = await
|
|
2189
|
-
id:
|
|
2190
|
-
name:
|
|
2191
|
-
email:
|
|
2192
|
-
phone:
|
|
2268
|
+
const G = await P.startChannelWithParticipant({
|
|
2269
|
+
id: d.id,
|
|
2270
|
+
name: d.name,
|
|
2271
|
+
email: d.email,
|
|
2272
|
+
phone: d.phone
|
|
2193
2273
|
});
|
|
2194
|
-
Z(G),
|
|
2274
|
+
Z(G), te(!0), ie(null), l && l(G), F && console.log(
|
|
2195
2275
|
"[MessagingShell] Channel created and loaded:",
|
|
2196
2276
|
G.id
|
|
2197
2277
|
);
|
|
@@ -2199,10 +2279,10 @@ const aa = ({
|
|
|
2199
2279
|
console.error(
|
|
2200
2280
|
"[MessagingShell] Failed to create conversation:",
|
|
2201
2281
|
G
|
|
2202
|
-
),
|
|
2282
|
+
), ie("Failed to create conversation");
|
|
2203
2283
|
}
|
|
2204
2284
|
} else
|
|
2205
|
-
|
|
2285
|
+
ie(
|
|
2206
2286
|
"No conversation found with this account"
|
|
2207
2287
|
), F && console.log(
|
|
2208
2288
|
"[MessagingShell] No conversation found for:",
|
|
@@ -2212,15 +2292,15 @@ const aa = ({
|
|
|
2212
2292
|
console.error(
|
|
2213
2293
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2214
2294
|
$
|
|
2215
|
-
),
|
|
2295
|
+
), ie("Failed to load conversation");
|
|
2216
2296
|
}
|
|
2217
2297
|
})();
|
|
2218
2298
|
}, [
|
|
2219
2299
|
r,
|
|
2220
|
-
|
|
2300
|
+
d,
|
|
2221
2301
|
R,
|
|
2222
2302
|
B,
|
|
2223
|
-
|
|
2303
|
+
P,
|
|
2224
2304
|
F,
|
|
2225
2305
|
l
|
|
2226
2306
|
]);
|
|
@@ -2234,13 +2314,13 @@ const aa = ({
|
|
|
2234
2314
|
}, [Y]), Ce = A(
|
|
2235
2315
|
async (D) => {
|
|
2236
2316
|
var W;
|
|
2237
|
-
if (
|
|
2317
|
+
if (P)
|
|
2238
2318
|
try {
|
|
2239
2319
|
F && console.log(
|
|
2240
2320
|
"[MessagingShell] Starting conversation with:",
|
|
2241
2321
|
D.id
|
|
2242
2322
|
);
|
|
2243
|
-
const $ = await
|
|
2323
|
+
const $ = await P.startChannelWithParticipant({
|
|
2244
2324
|
id: D.id,
|
|
2245
2325
|
name: D.name,
|
|
2246
2326
|
email: D.email,
|
|
@@ -2251,38 +2331,38 @@ const aa = ({
|
|
|
2251
2331
|
} catch (G) {
|
|
2252
2332
|
console.warn("[MessagingShell] Failed to unhide channel:", G);
|
|
2253
2333
|
}
|
|
2254
|
-
Z($), j(!1), (W =
|
|
2334
|
+
Z($), j(!1), (W = he.current) == null || W.close(), u == null || u(D);
|
|
2255
2335
|
} catch ($) {
|
|
2256
2336
|
console.error("[MessagingShell] Failed to start conversation:", $);
|
|
2257
2337
|
}
|
|
2258
2338
|
},
|
|
2259
|
-
[
|
|
2339
|
+
[P, u, F]
|
|
2260
2340
|
), de = A(() => {
|
|
2261
2341
|
var D;
|
|
2262
|
-
j(!1), (D =
|
|
2342
|
+
j(!1), (D = he.current) == null || D.close();
|
|
2263
2343
|
}, []), _e = A(
|
|
2264
2344
|
(D) => {
|
|
2265
|
-
D.target ===
|
|
2345
|
+
D.target === he.current && de();
|
|
2266
2346
|
},
|
|
2267
2347
|
[de]
|
|
2268
2348
|
), Ee = A(
|
|
2269
2349
|
async (D) => {
|
|
2270
|
-
F && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null),
|
|
2350
|
+
F && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), te(!1), ce.current = null, await ne();
|
|
2271
2351
|
},
|
|
2272
2352
|
[ne, F]
|
|
2273
2353
|
), Se = A(
|
|
2274
2354
|
async (D) => {
|
|
2275
|
-
F && console.log("[MessagingShell] Blocking participant:", D), Z(null),
|
|
2355
|
+
F && console.log("[MessagingShell] Blocking participant:", D), Z(null), te(!1), ce.current = null, await ne();
|
|
2276
2356
|
},
|
|
2277
2357
|
[ne, F]
|
|
2278
2358
|
), ue = !!H;
|
|
2279
|
-
return
|
|
2359
|
+
return Q ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : J ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: J, onBack: V }) }) : !B || !R ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(
|
|
2280
2360
|
Te,
|
|
2281
2361
|
{
|
|
2282
2362
|
message: "Not connected to messaging service",
|
|
2283
2363
|
onBack: V
|
|
2284
2364
|
}
|
|
2285
|
-
) }) : xe ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */
|
|
2365
|
+
) }) : xe ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */ c(
|
|
2286
2366
|
"div",
|
|
2287
2367
|
{
|
|
2288
2368
|
className: O(
|
|
@@ -2290,29 +2370,29 @@ const aa = ({
|
|
|
2290
2370
|
s
|
|
2291
2371
|
),
|
|
2292
2372
|
children: [
|
|
2293
|
-
/* @__PURE__ */
|
|
2373
|
+
/* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
|
|
2294
2374
|
/* @__PURE__ */ e(
|
|
2295
2375
|
"div",
|
|
2296
2376
|
{
|
|
2297
2377
|
className: O(
|
|
2298
2378
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2299
2379
|
{
|
|
2300
|
-
"!hidden":
|
|
2380
|
+
"!hidden": o === !1 || Y,
|
|
2301
2381
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2302
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2382
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": o !== !1 && !Y && ue,
|
|
2303
2383
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2304
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2384
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": o !== !1 && !Y && !ue
|
|
2305
2385
|
}
|
|
2306
2386
|
),
|
|
2307
2387
|
children: /* @__PURE__ */ e(
|
|
2308
|
-
|
|
2388
|
+
wt,
|
|
2309
2389
|
{
|
|
2310
2390
|
onChannelSelect: Ne,
|
|
2311
2391
|
selectedChannel: H || void 0,
|
|
2312
2392
|
filters: we,
|
|
2313
|
-
channelRenderFilterFn:
|
|
2393
|
+
channelRenderFilterFn: f,
|
|
2314
2394
|
customEmptyStateIndicator: N,
|
|
2315
|
-
renderMessagePreview:
|
|
2395
|
+
renderMessagePreview: L
|
|
2316
2396
|
}
|
|
2317
2397
|
)
|
|
2318
2398
|
}
|
|
@@ -2330,13 +2410,13 @@ const aa = ({
|
|
|
2330
2410
|
}
|
|
2331
2411
|
),
|
|
2332
2412
|
children: H ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2333
|
-
|
|
2413
|
+
Et,
|
|
2334
2414
|
{
|
|
2335
2415
|
channel: H,
|
|
2336
2416
|
onBack: ye,
|
|
2337
2417
|
showBackButton: !Y,
|
|
2338
2418
|
renderMessageInputActions: n,
|
|
2339
|
-
renderConversationFooter:
|
|
2419
|
+
renderConversationFooter: i,
|
|
2340
2420
|
renderChannelBanner: v,
|
|
2341
2421
|
onLeaveConversation: Ee,
|
|
2342
2422
|
onBlockParticipant: Se,
|
|
@@ -2345,13 +2425,13 @@ const aa = ({
|
|
|
2345
2425
|
onDeleteConversationClick: a,
|
|
2346
2426
|
onBlockParticipantClick: _,
|
|
2347
2427
|
onReportParticipantClick: w,
|
|
2348
|
-
dmAgentEnabled:
|
|
2349
|
-
messageMetadata:
|
|
2350
|
-
onMessageSent:
|
|
2428
|
+
dmAgentEnabled: g,
|
|
2429
|
+
messageMetadata: y,
|
|
2430
|
+
onMessageSent: I,
|
|
2351
2431
|
showStarButton: C,
|
|
2352
|
-
chatbotVotingEnabled:
|
|
2432
|
+
chatbotVotingEnabled: S,
|
|
2353
2433
|
customProfileContent: m,
|
|
2354
|
-
customChannelActions:
|
|
2434
|
+
customChannelActions: b,
|
|
2355
2435
|
renderMessage: T,
|
|
2356
2436
|
sendButton: M
|
|
2357
2437
|
},
|
|
@@ -2360,30 +2440,30 @@ const aa = ({
|
|
|
2360
2440
|
// Show loading while creating/loading direct conversation channel
|
|
2361
2441
|
/* @__PURE__ */ e(De, {})
|
|
2362
2442
|
) : /* @__PURE__ */ e(
|
|
2363
|
-
|
|
2443
|
+
St,
|
|
2364
2444
|
{
|
|
2365
|
-
hasChannels:
|
|
2366
|
-
channelsLoaded:
|
|
2445
|
+
hasChannels: re,
|
|
2446
|
+
channelsLoaded: p
|
|
2367
2447
|
}
|
|
2368
2448
|
)
|
|
2369
2449
|
}
|
|
2370
2450
|
)
|
|
2371
2451
|
] }),
|
|
2372
|
-
|
|
2452
|
+
oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2373
2453
|
/* @__PURE__ */ e(
|
|
2374
2454
|
"dialog",
|
|
2375
2455
|
{
|
|
2376
|
-
ref:
|
|
2456
|
+
ref: he,
|
|
2377
2457
|
className: "mes-dialog",
|
|
2378
2458
|
onClick: _e,
|
|
2379
2459
|
onClose: de,
|
|
2380
2460
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2381
|
-
|
|
2461
|
+
Ln,
|
|
2382
2462
|
{
|
|
2383
|
-
participantSource:
|
|
2463
|
+
participantSource: oe,
|
|
2384
2464
|
onSelectParticipant: Ce,
|
|
2385
2465
|
onClose: de,
|
|
2386
|
-
existingParticipantIds:
|
|
2466
|
+
existingParticipantIds: ee,
|
|
2387
2467
|
participantLabel: ve,
|
|
2388
2468
|
searchPlaceholder: `Search ${ve}...`
|
|
2389
2469
|
},
|
|
@@ -2394,11 +2474,11 @@ const aa = ({
|
|
|
2394
2474
|
]
|
|
2395
2475
|
}
|
|
2396
2476
|
);
|
|
2397
|
-
},
|
|
2477
|
+
}, An = ({
|
|
2398
2478
|
question: t,
|
|
2399
2479
|
onClick: s,
|
|
2400
2480
|
loading: n = !1,
|
|
2401
|
-
className:
|
|
2481
|
+
className: i
|
|
2402
2482
|
}) => /* @__PURE__ */ e(
|
|
2403
2483
|
"button",
|
|
2404
2484
|
{
|
|
@@ -2412,40 +2492,40 @@ const aa = ({
|
|
|
2412
2492
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2413
2493
|
"opacity-50 cursor-not-allowed": n
|
|
2414
2494
|
},
|
|
2415
|
-
|
|
2495
|
+
i
|
|
2416
2496
|
),
|
|
2417
2497
|
children: t
|
|
2418
2498
|
}
|
|
2419
|
-
),
|
|
2499
|
+
), oa = ({
|
|
2420
2500
|
faqs: t,
|
|
2421
2501
|
onFaqClick: s,
|
|
2422
2502
|
loadingFaqId: n,
|
|
2423
|
-
headerText:
|
|
2503
|
+
headerText: i,
|
|
2424
2504
|
className: l,
|
|
2425
|
-
avatarImage:
|
|
2505
|
+
avatarImage: u,
|
|
2426
2506
|
avatarName: r
|
|
2427
2507
|
}) => {
|
|
2428
|
-
const
|
|
2429
|
-
return
|
|
2430
|
-
(
|
|
2431
|
-
|
|
2508
|
+
const d = t.filter((x) => x.enabled).sort((x, o) => (x.order ?? 0) - (o.order ?? 0));
|
|
2509
|
+
return d.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
|
|
2510
|
+
(u || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2511
|
+
ae,
|
|
2432
2512
|
{
|
|
2433
2513
|
id: r || "account",
|
|
2434
2514
|
name: r || "Account",
|
|
2435
|
-
image:
|
|
2515
|
+
image: u,
|
|
2436
2516
|
size: 24,
|
|
2437
2517
|
shape: "circle"
|
|
2438
2518
|
}
|
|
2439
2519
|
) }),
|
|
2440
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ c(
|
|
2441
2521
|
"div",
|
|
2442
2522
|
{
|
|
2443
2523
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2444
2524
|
style: { backgroundColor: "#F1F0EE" },
|
|
2445
2525
|
children: [
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2526
|
+
i && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: i }),
|
|
2527
|
+
d.map((x) => /* @__PURE__ */ e(
|
|
2528
|
+
An,
|
|
2449
2529
|
{
|
|
2450
2530
|
question: x.question,
|
|
2451
2531
|
onClick: () => s(x.id),
|
|
@@ -2457,7 +2537,7 @@ const aa = ({
|
|
|
2457
2537
|
}
|
|
2458
2538
|
)
|
|
2459
2539
|
] }) });
|
|
2460
|
-
},
|
|
2540
|
+
}, On = [
|
|
2461
2541
|
[/pdf/, "pdf"],
|
|
2462
2542
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2463
2543
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -2467,125 +2547,125 @@ const aa = ({
|
|
|
2467
2547
|
[/plain|rtf/, "text"],
|
|
2468
2548
|
[/markdown/, "markdown"]
|
|
2469
2549
|
];
|
|
2470
|
-
function
|
|
2550
|
+
function qe(t) {
|
|
2471
2551
|
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2472
2552
|
}
|
|
2473
|
-
function
|
|
2474
|
-
const s =
|
|
2553
|
+
function Un(t) {
|
|
2554
|
+
const s = On.find(
|
|
2475
2555
|
([n]) => n.test(t)
|
|
2476
2556
|
);
|
|
2477
2557
|
return s ? s[1] : "generic";
|
|
2478
2558
|
}
|
|
2479
|
-
const
|
|
2480
|
-
video:
|
|
2481
|
-
audio:
|
|
2482
|
-
image:
|
|
2483
|
-
document:
|
|
2484
|
-
},
|
|
2485
|
-
pdf:
|
|
2486
|
-
doc:
|
|
2487
|
-
xls:
|
|
2488
|
-
csv:
|
|
2489
|
-
ppt:
|
|
2490
|
-
zip:
|
|
2491
|
-
text:
|
|
2492
|
-
markdown:
|
|
2493
|
-
generic:
|
|
2559
|
+
const $n = {
|
|
2560
|
+
video: Cs,
|
|
2561
|
+
audio: ys,
|
|
2562
|
+
image: Ns,
|
|
2563
|
+
document: ht
|
|
2564
|
+
}, zn = {
|
|
2565
|
+
pdf: Ds,
|
|
2566
|
+
doc: Ms,
|
|
2567
|
+
xls: Ts,
|
|
2568
|
+
csv: ks,
|
|
2569
|
+
ppt: Is,
|
|
2570
|
+
zip: Ss,
|
|
2571
|
+
text: Es,
|
|
2572
|
+
markdown: _s,
|
|
2573
|
+
generic: ht
|
|
2494
2574
|
};
|
|
2495
|
-
function
|
|
2496
|
-
const s =
|
|
2497
|
-
return s !== "document" ?
|
|
2575
|
+
function Bn(t) {
|
|
2576
|
+
const s = qe(t);
|
|
2577
|
+
return s !== "document" ? $n[s] : zn[Un(t)];
|
|
2498
2578
|
}
|
|
2499
|
-
function
|
|
2500
|
-
return z.createElement(
|
|
2579
|
+
function Ze(t, s) {
|
|
2580
|
+
return z.createElement(Bn(t), s);
|
|
2501
2581
|
}
|
|
2502
|
-
const
|
|
2582
|
+
const jn = (t) => {
|
|
2503
2583
|
var s, n;
|
|
2504
2584
|
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2505
|
-
},
|
|
2585
|
+
}, He = ({
|
|
2506
2586
|
source: t,
|
|
2507
2587
|
mimeType: s,
|
|
2508
2588
|
poster: n,
|
|
2509
|
-
autoPlay:
|
|
2589
|
+
autoPlay: i = !1,
|
|
2510
2590
|
playing: l,
|
|
2511
|
-
loop:
|
|
2591
|
+
loop: u = !1,
|
|
2512
2592
|
controls: r = !0,
|
|
2513
|
-
showProgress:
|
|
2593
|
+
showProgress: d = !1,
|
|
2514
2594
|
muted: x = !1,
|
|
2515
|
-
onContainerClick:
|
|
2595
|
+
onContainerClick: o
|
|
2516
2596
|
}) => {
|
|
2517
|
-
const
|
|
2518
|
-
|
|
2519
|
-
}, []), V = A((
|
|
2520
|
-
const
|
|
2521
|
-
if (!
|
|
2522
|
-
const U =
|
|
2597
|
+
const h = qe(s), f = X(null), N = X(null), a = X(null), _ = X(l), [w, g] = k(i), [y, I] = k(0), [C, S] = k(!1), [L, v] = k(!1), [m, b] = k(!1), [T, M] = k(!1), [P, R] = k(!0), [B, Q] = k(null), J = A(() => {
|
|
2598
|
+
b(!1), g(!0);
|
|
2599
|
+
}, []), V = A((p) => {
|
|
2600
|
+
const E = N.current;
|
|
2601
|
+
if (!E) return 0;
|
|
2602
|
+
const U = E.getBoundingClientRect();
|
|
2523
2603
|
return Math.max(
|
|
2524
2604
|
0,
|
|
2525
|
-
Math.min(1, (
|
|
2605
|
+
Math.min(1, (jn(p) - U.left) / U.width)
|
|
2526
2606
|
);
|
|
2527
|
-
}, []), F = A((
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2530
|
-
}, []), H = (
|
|
2531
|
-
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2607
|
+
}, []), F = A((p) => {
|
|
2608
|
+
const E = f.current;
|
|
2609
|
+
E && E.duration && (E.currentTime = p * E.duration);
|
|
2610
|
+
}, []), H = (p) => {
|
|
2611
|
+
p.stopPropagation(), S(!0);
|
|
2612
|
+
const E = V(p);
|
|
2613
|
+
I(E), F(E);
|
|
2534
2614
|
};
|
|
2535
2615
|
q(() => {
|
|
2536
|
-
l !== void 0 && l !== _.current && (_.current = l,
|
|
2616
|
+
l !== void 0 && l !== _.current && (_.current = l, g(l));
|
|
2537
2617
|
}, [l]), q(() => {
|
|
2538
2618
|
if (!w) {
|
|
2539
2619
|
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2540
2620
|
return;
|
|
2541
2621
|
}
|
|
2542
|
-
const
|
|
2543
|
-
const
|
|
2544
|
-
|
|
2622
|
+
const p = () => {
|
|
2623
|
+
const E = f.current;
|
|
2624
|
+
E && E.duration && !C && I(E.currentTime / E.duration), a.current = requestAnimationFrame(p);
|
|
2545
2625
|
};
|
|
2546
|
-
return a.current = requestAnimationFrame(
|
|
2626
|
+
return a.current = requestAnimationFrame(p), () => {
|
|
2547
2627
|
a.current !== null && cancelAnimationFrame(a.current);
|
|
2548
2628
|
};
|
|
2549
2629
|
}, [w, C]), q(() => {
|
|
2550
|
-
const
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
}) :
|
|
2630
|
+
const p = f.current;
|
|
2631
|
+
p && (w ? p.play().catch((E) => {
|
|
2632
|
+
g(!1), b(!0);
|
|
2633
|
+
}) : p.pause());
|
|
2554
2634
|
}, [w]), q(() => {
|
|
2555
2635
|
if (!C) return;
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2636
|
+
const p = (U) => I(V(U)), E = (U) => {
|
|
2637
|
+
S(!1), F(V(U));
|
|
2558
2638
|
};
|
|
2559
|
-
return window.addEventListener("mousemove",
|
|
2560
|
-
window.removeEventListener("mousemove",
|
|
2639
|
+
return window.addEventListener("mousemove", p), window.addEventListener("mouseup", E), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", E), () => {
|
|
2640
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", E), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", E);
|
|
2561
2641
|
};
|
|
2562
2642
|
}, [C, V, F]);
|
|
2563
|
-
const Z = B ? { aspectRatio: String(B) } : void 0,
|
|
2564
|
-
return /* @__PURE__ */
|
|
2643
|
+
const Z = B ? { aspectRatio: String(B) } : void 0, re = B ? "" : " aspect-video", K = Math.round(y * 100);
|
|
2644
|
+
return /* @__PURE__ */ c(
|
|
2565
2645
|
"div",
|
|
2566
2646
|
{
|
|
2567
2647
|
role: "button",
|
|
2568
2648
|
tabIndex: 0,
|
|
2569
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
2649
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${re}`,
|
|
2570
2650
|
style: Z,
|
|
2571
|
-
onClick: (
|
|
2572
|
-
if (
|
|
2573
|
-
|
|
2651
|
+
onClick: (p) => {
|
|
2652
|
+
if (o) {
|
|
2653
|
+
o(p);
|
|
2574
2654
|
return;
|
|
2575
2655
|
}
|
|
2576
|
-
m || r &&
|
|
2656
|
+
m || r && g((E) => !E);
|
|
2577
2657
|
},
|
|
2578
|
-
onKeyDown: (
|
|
2579
|
-
if (!(
|
|
2580
|
-
if (
|
|
2581
|
-
|
|
2658
|
+
onKeyDown: (p) => {
|
|
2659
|
+
if (!(p.key !== "Enter" && p.key !== " ")) {
|
|
2660
|
+
if (p.preventDefault(), o) {
|
|
2661
|
+
o(p);
|
|
2582
2662
|
return;
|
|
2583
2663
|
}
|
|
2584
|
-
m || r &&
|
|
2664
|
+
m || r && g((E) => !E);
|
|
2585
2665
|
}
|
|
2586
2666
|
},
|
|
2587
2667
|
children: [
|
|
2588
|
-
n && (
|
|
2668
|
+
n && (h === "audio" || P) && /* @__PURE__ */ e(
|
|
2589
2669
|
"img",
|
|
2590
2670
|
{
|
|
2591
2671
|
src: n,
|
|
@@ -2593,16 +2673,16 @@ const $n = (t) => {
|
|
|
2593
2673
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
2594
2674
|
}
|
|
2595
2675
|
),
|
|
2596
|
-
!n && (
|
|
2676
|
+
!n && (h === "audio" || P) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: Ze(s, {
|
|
2597
2677
|
className: "size-12 text-black/20",
|
|
2598
2678
|
weight: "regular"
|
|
2599
2679
|
}) }),
|
|
2600
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0", children:
|
|
2680
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
|
|
2601
2681
|
"audio",
|
|
2602
2682
|
{
|
|
2603
|
-
ref:
|
|
2683
|
+
ref: f,
|
|
2604
2684
|
src: t,
|
|
2605
|
-
loop:
|
|
2685
|
+
loop: u,
|
|
2606
2686
|
muted: x,
|
|
2607
2687
|
style: { width: "100%", height: "100%" },
|
|
2608
2688
|
onLoadStart: () => M(!0),
|
|
@@ -2610,18 +2690,18 @@ const $n = (t) => {
|
|
|
2610
2690
|
M(!1), R(!1);
|
|
2611
2691
|
},
|
|
2612
2692
|
onWaiting: () => M(!0),
|
|
2613
|
-
onPlay: () =>
|
|
2693
|
+
onPlay: () => b(!1),
|
|
2614
2694
|
onEnded: () => {
|
|
2615
|
-
|
|
2695
|
+
u || (g(!1), I(0));
|
|
2616
2696
|
},
|
|
2617
2697
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2618
2698
|
}
|
|
2619
2699
|
) : /* @__PURE__ */ e(
|
|
2620
2700
|
"video",
|
|
2621
2701
|
{
|
|
2622
|
-
ref:
|
|
2702
|
+
ref: f,
|
|
2623
2703
|
src: t,
|
|
2624
|
-
loop:
|
|
2704
|
+
loop: u,
|
|
2625
2705
|
muted: x,
|
|
2626
2706
|
playsInline: !0,
|
|
2627
2707
|
style: { width: "100%", height: "100%" },
|
|
@@ -2630,19 +2710,19 @@ const $n = (t) => {
|
|
|
2630
2710
|
M(!1), R(!1);
|
|
2631
2711
|
},
|
|
2632
2712
|
onWaiting: () => M(!0),
|
|
2633
|
-
onPlay: () =>
|
|
2713
|
+
onPlay: () => b(!1),
|
|
2634
2714
|
onLoadedMetadata: () => {
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2715
|
+
const p = f.current;
|
|
2716
|
+
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && Q(p.videoWidth / p.videoHeight);
|
|
2637
2717
|
},
|
|
2638
2718
|
onEnded: () => {
|
|
2639
|
-
|
|
2719
|
+
u || (g(!1), I(0));
|
|
2640
2720
|
},
|
|
2641
2721
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2642
2722
|
}
|
|
2643
2723
|
) }),
|
|
2644
2724
|
T && !m && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2645
|
-
|
|
2725
|
+
ft,
|
|
2646
2726
|
{
|
|
2647
2727
|
className: "size-8 animate-spin text-white/80",
|
|
2648
2728
|
weight: "bold"
|
|
@@ -2655,16 +2735,16 @@ const $n = (t) => {
|
|
|
2655
2735
|
role: "button",
|
|
2656
2736
|
tabIndex: 0,
|
|
2657
2737
|
"aria-label": "Play preview",
|
|
2658
|
-
onClick: (
|
|
2659
|
-
|
|
2738
|
+
onClick: (p) => {
|
|
2739
|
+
p.stopPropagation(), J();
|
|
2660
2740
|
},
|
|
2661
|
-
onKeyDown: (
|
|
2662
|
-
|
|
2741
|
+
onKeyDown: (p) => {
|
|
2742
|
+
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), J());
|
|
2663
2743
|
},
|
|
2664
|
-
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(
|
|
2744
|
+
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(nt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2665
2745
|
}
|
|
2666
2746
|
),
|
|
2667
|
-
|
|
2747
|
+
d && !r && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ e(
|
|
2668
2748
|
"div",
|
|
2669
2749
|
{
|
|
2670
2750
|
role: "slider",
|
|
@@ -2677,9 +2757,9 @@ const $n = (t) => {
|
|
|
2677
2757
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2678
2758
|
onMouseDown: H,
|
|
2679
2759
|
onTouchStart: H,
|
|
2680
|
-
onClick: (
|
|
2681
|
-
onKeyDown: (
|
|
2682
|
-
|
|
2760
|
+
onClick: (p) => p.stopPropagation(),
|
|
2761
|
+
onKeyDown: (p) => {
|
|
2762
|
+
p.key === "ArrowRight" && F(Math.min(1, y + 0.05)), p.key === "ArrowLeft" && F(Math.max(0, y - 0.05));
|
|
2683
2763
|
},
|
|
2684
2764
|
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
2685
2765
|
"div",
|
|
@@ -2690,20 +2770,20 @@ const $n = (t) => {
|
|
|
2690
2770
|
) })
|
|
2691
2771
|
}
|
|
2692
2772
|
) }),
|
|
2693
|
-
r && /* @__PURE__ */
|
|
2773
|
+
r && /* @__PURE__ */ c("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
2694
2774
|
/* @__PURE__ */ e(
|
|
2695
2775
|
"button",
|
|
2696
2776
|
{
|
|
2697
2777
|
type: "button",
|
|
2698
|
-
onClick: (
|
|
2699
|
-
|
|
2778
|
+
onClick: (p) => {
|
|
2779
|
+
p.stopPropagation(), g((E) => !E);
|
|
2700
2780
|
},
|
|
2701
2781
|
className: "shrink-0 text-white",
|
|
2702
2782
|
"aria-label": w ? "Pause" : "Play",
|
|
2703
|
-
children: w ? /* @__PURE__ */ e(
|
|
2783
|
+
children: w ? /* @__PURE__ */ e(Rs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(nt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2704
2784
|
}
|
|
2705
2785
|
),
|
|
2706
|
-
/* @__PURE__ */
|
|
2786
|
+
/* @__PURE__ */ c(
|
|
2707
2787
|
"div",
|
|
2708
2788
|
{
|
|
2709
2789
|
role: "slider",
|
|
@@ -2716,17 +2796,17 @@ const $n = (t) => {
|
|
|
2716
2796
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2717
2797
|
onMouseDown: H,
|
|
2718
2798
|
onTouchStart: H,
|
|
2719
|
-
onClick: (
|
|
2799
|
+
onClick: (p) => p.stopPropagation(),
|
|
2720
2800
|
onMouseEnter: () => v(!0),
|
|
2721
2801
|
onMouseLeave: () => v(!1),
|
|
2722
|
-
onKeyDown: (
|
|
2723
|
-
|
|
2802
|
+
onKeyDown: (p) => {
|
|
2803
|
+
p.key === "ArrowRight" && F(Math.min(1, y + 0.05)), p.key === "ArrowLeft" && F(Math.max(0, y - 0.05));
|
|
2724
2804
|
},
|
|
2725
2805
|
children: [
|
|
2726
2806
|
/* @__PURE__ */ e(
|
|
2727
2807
|
"div",
|
|
2728
2808
|
{
|
|
2729
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
2809
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || C ? "h-1.5" : "h-1"}`,
|
|
2730
2810
|
children: /* @__PURE__ */ e(
|
|
2731
2811
|
"div",
|
|
2732
2812
|
{
|
|
@@ -2739,7 +2819,7 @@ const $n = (t) => {
|
|
|
2739
2819
|
/* @__PURE__ */ e(
|
|
2740
2820
|
"div",
|
|
2741
2821
|
{
|
|
2742
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
2822
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || C ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
2743
2823
|
style: { left: `${K}%` }
|
|
2744
2824
|
}
|
|
2745
2825
|
)
|
|
@@ -2751,96 +2831,96 @@ const $n = (t) => {
|
|
|
2751
2831
|
}
|
|
2752
2832
|
);
|
|
2753
2833
|
};
|
|
2754
|
-
function
|
|
2834
|
+
function Gn(t) {
|
|
2755
2835
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
2756
2836
|
}
|
|
2757
|
-
function
|
|
2837
|
+
function Vn(t) {
|
|
2758
2838
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
2759
2839
|
}
|
|
2760
|
-
function
|
|
2840
|
+
function It(t) {
|
|
2761
2841
|
return t ? "text-white" : "text-black";
|
|
2762
2842
|
}
|
|
2763
2843
|
function be(t) {
|
|
2764
2844
|
return t ? "text-white/55" : "text-black/55";
|
|
2765
2845
|
}
|
|
2766
|
-
function
|
|
2846
|
+
function Hn(t) {
|
|
2767
2847
|
return t ? "text-white/40" : "text-black/40";
|
|
2768
2848
|
}
|
|
2769
2849
|
function kt(t) {
|
|
2770
2850
|
return t ? "bg-white/10" : "bg-black/5";
|
|
2771
2851
|
}
|
|
2772
|
-
function
|
|
2852
|
+
function Tt(t) {
|
|
2773
2853
|
return t ? "text-white/20" : "text-black/20";
|
|
2774
2854
|
}
|
|
2775
|
-
function
|
|
2855
|
+
function Yn(t) {
|
|
2776
2856
|
return t ? "bg-white/10 hover:bg-white/15" : "bg-black/[0.06] hover:bg-black/10";
|
|
2777
2857
|
}
|
|
2778
|
-
async function
|
|
2858
|
+
async function Wn(t, s) {
|
|
2779
2859
|
let n;
|
|
2780
2860
|
try {
|
|
2781
2861
|
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
2782
2862
|
} catch {
|
|
2783
2863
|
n = s ?? "download";
|
|
2784
2864
|
}
|
|
2785
|
-
const
|
|
2786
|
-
if (!
|
|
2787
|
-
const l = await
|
|
2788
|
-
r.href =
|
|
2865
|
+
const i = await fetch(t, { mode: "cors" });
|
|
2866
|
+
if (!i.ok) throw new Error(`HTTP ${i.status}`);
|
|
2867
|
+
const l = await i.blob(), u = URL.createObjectURL(l), r = document.createElement("a");
|
|
2868
|
+
r.href = u, r.download = n, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(u);
|
|
2789
2869
|
}
|
|
2790
|
-
const
|
|
2870
|
+
const qn = ({
|
|
2791
2871
|
url: t,
|
|
2792
2872
|
filename: s,
|
|
2793
2873
|
isMyMessage: n
|
|
2794
2874
|
}) => {
|
|
2795
|
-
const [
|
|
2875
|
+
const [i, l] = k(!1);
|
|
2796
2876
|
return /* @__PURE__ */ e(
|
|
2797
2877
|
"button",
|
|
2798
2878
|
{
|
|
2799
2879
|
type: "button",
|
|
2800
2880
|
onClick: (r) => {
|
|
2801
2881
|
r.stopPropagation();
|
|
2802
|
-
const
|
|
2803
|
-
l(!0),
|
|
2804
|
-
|
|
2882
|
+
const d = window.open("", "_blank", "noopener,noreferrer");
|
|
2883
|
+
l(!0), Wn(t, s).then(() => {
|
|
2884
|
+
d == null || d.close();
|
|
2805
2885
|
}).catch(() => {
|
|
2806
|
-
|
|
2886
|
+
d && (d.location.href = t);
|
|
2807
2887
|
}).finally(() => l(!1));
|
|
2808
2888
|
},
|
|
2809
|
-
disabled:
|
|
2810
|
-
className: `flex size-8 items-center justify-center rounded-full ${
|
|
2889
|
+
disabled: i,
|
|
2890
|
+
className: `flex size-8 items-center justify-center rounded-full ${Yn(n)} disabled:opacity-50`,
|
|
2811
2891
|
"aria-label": "Download",
|
|
2812
|
-
children:
|
|
2892
|
+
children: i ? /* @__PURE__ */ e(ft, { className: `size-4 animate-spin ${be(n)}`, weight: "bold" }) : /* @__PURE__ */ e(Ls, { className: `size-4 ${be(n)}`, weight: "bold" })
|
|
2813
2893
|
}
|
|
2814
2894
|
);
|
|
2815
|
-
}, Me = ({ mimeType: t, title: s, fileSize: n, url:
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
s && /* @__PURE__ */ e("p", { className: `
|
|
2818
|
-
n !== void 0 && /* @__PURE__ */
|
|
2819
|
-
|
|
2895
|
+
}, Me = ({ mimeType: t, title: s, fileSize: n, url: i, isMyMessage: l }) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2 px-4 pb-3 pt-3", children: [
|
|
2896
|
+
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
2897
|
+
s && /* @__PURE__ */ e("p", { className: `truncate text-base font-medium ${It(l)}`, children: s }),
|
|
2898
|
+
n !== void 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
2899
|
+
Ze(t, {
|
|
2820
2900
|
className: `size-5 shrink-0 ${be(l)}`,
|
|
2821
2901
|
weight: "regular"
|
|
2822
2902
|
}),
|
|
2823
|
-
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children:
|
|
2903
|
+
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children: Gn(n) })
|
|
2824
2904
|
] })
|
|
2825
2905
|
] }),
|
|
2826
|
-
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(
|
|
2827
|
-
] }),
|
|
2906
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(qn, { url: i, filename: s, isMyMessage: l }) })
|
|
2907
|
+
] }), Zn = ({ url: t, mimeType: s, title: n, fileSize: i, isMyMessage: l, onExpand: u }) => {
|
|
2828
2908
|
const r = /* @__PURE__ */ e(
|
|
2829
2909
|
"div",
|
|
2830
2910
|
{
|
|
2831
2911
|
className: `aspect-video w-full ${kt(l)} flex items-center justify-center`,
|
|
2832
|
-
children:
|
|
2833
|
-
className: `size-12 ${
|
|
2912
|
+
children: Ze(s, {
|
|
2913
|
+
className: `size-12 ${Tt(l)}`,
|
|
2834
2914
|
weight: "regular"
|
|
2835
2915
|
})
|
|
2836
2916
|
}
|
|
2837
2917
|
);
|
|
2838
|
-
return /* @__PURE__ */
|
|
2839
|
-
|
|
2918
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
2919
|
+
u ? /* @__PURE__ */ e(
|
|
2840
2920
|
"button",
|
|
2841
2921
|
{
|
|
2842
2922
|
type: "button",
|
|
2843
|
-
onClick:
|
|
2923
|
+
onClick: u,
|
|
2844
2924
|
className: "block w-full",
|
|
2845
2925
|
"aria-label": "Open PDF viewer",
|
|
2846
2926
|
children: r
|
|
@@ -2851,15 +2931,15 @@ const Hn = ({
|
|
|
2851
2931
|
{
|
|
2852
2932
|
mimeType: s,
|
|
2853
2933
|
title: n,
|
|
2854
|
-
fileSize:
|
|
2934
|
+
fileSize: i,
|
|
2855
2935
|
url: t,
|
|
2856
2936
|
isMyMessage: l
|
|
2857
2937
|
}
|
|
2858
2938
|
)
|
|
2859
2939
|
] });
|
|
2860
|
-
},
|
|
2861
|
-
const { title: n, text:
|
|
2862
|
-
return /* @__PURE__ */
|
|
2940
|
+
}, Xn = ({ attachment: t, isMyMessage: s }) => {
|
|
2941
|
+
const { title: n, text: i, image_url: l, og_scrape_url: u, title_link: r } = t, d = u ?? r;
|
|
2942
|
+
return /* @__PURE__ */ c("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: [
|
|
2863
2943
|
/* @__PURE__ */ e("div", { className: "p-2", children: l ? /* @__PURE__ */ e(
|
|
2864
2944
|
"img",
|
|
2865
2945
|
{
|
|
@@ -2871,21 +2951,21 @@ const Hn = ({
|
|
|
2871
2951
|
"div",
|
|
2872
2952
|
{
|
|
2873
2953
|
className: `aspect-video w-full rounded-[20px] ${kt(s)} flex items-center justify-center`,
|
|
2874
|
-
children: /* @__PURE__ */ e(
|
|
2954
|
+
children: /* @__PURE__ */ e(Ps, { className: `size-12 ${Tt(s)}` })
|
|
2875
2955
|
}
|
|
2876
2956
|
) }),
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
2879
|
-
|
|
2880
|
-
|
|
2957
|
+
/* @__PURE__ */ c("div", { className: "px-3 pb-3", children: [
|
|
2958
|
+
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${It(s)}`, children: n }),
|
|
2959
|
+
i && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${be(s)}`, children: i }),
|
|
2960
|
+
d && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Hn(s)}`, children: d })
|
|
2881
2961
|
] })
|
|
2882
2962
|
] });
|
|
2883
|
-
},
|
|
2963
|
+
}, Kn = ({ sourceType: t, url: s, mimeType: n, title: i, poster: l, onClose: u }) => {
|
|
2884
2964
|
const r = X(null);
|
|
2885
2965
|
return q(() => {
|
|
2886
|
-
const
|
|
2887
|
-
return
|
|
2888
|
-
|
|
2966
|
+
const o = r.current;
|
|
2967
|
+
return o == null || o.showModal(), () => {
|
|
2968
|
+
o != null && o.open && o.close();
|
|
2889
2969
|
};
|
|
2890
2970
|
}, []), // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2891
2971
|
/* @__PURE__ */ e(
|
|
@@ -2893,16 +2973,16 @@ const Hn = ({
|
|
|
2893
2973
|
{
|
|
2894
2974
|
ref: r,
|
|
2895
2975
|
className: "mes-media-viewer",
|
|
2896
|
-
onClose:
|
|
2897
|
-
onClick: (
|
|
2898
|
-
|
|
2976
|
+
onClose: u,
|
|
2977
|
+
onClick: (o) => {
|
|
2978
|
+
o.target === r.current && u();
|
|
2899
2979
|
},
|
|
2900
|
-
children: /* @__PURE__ */
|
|
2980
|
+
children: /* @__PURE__ */ c("div", { className: "relative flex h-full w-full items-center justify-center p-6", children: [
|
|
2901
2981
|
/* @__PURE__ */ e(
|
|
2902
2982
|
"button",
|
|
2903
2983
|
{
|
|
2904
2984
|
type: "button",
|
|
2905
|
-
onClick:
|
|
2985
|
+
onClick: u,
|
|
2906
2986
|
className: "absolute right-4 top-4 z-10 flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20",
|
|
2907
2987
|
"aria-label": "Close",
|
|
2908
2988
|
children: /* @__PURE__ */ e(Re, { className: "size-5", weight: "bold" })
|
|
@@ -2912,48 +2992,48 @@ const Hn = ({
|
|
|
2912
2992
|
"img",
|
|
2913
2993
|
{
|
|
2914
2994
|
src: s,
|
|
2915
|
-
alt:
|
|
2995
|
+
alt: i ?? "",
|
|
2916
2996
|
className: "max-h-[90vh] max-w-[90vw] rounded-2xl object-contain"
|
|
2917
2997
|
}
|
|
2918
|
-
) : n === "application/pdf" ? /* @__PURE__ */
|
|
2919
|
-
|
|
2998
|
+
) : n === "application/pdf" ? /* @__PURE__ */ c("div", { className: "flex h-full w-full max-w-4xl flex-col pt-14", children: [
|
|
2999
|
+
i && /* @__PURE__ */ e("p", { className: "mb-2 shrink-0 truncate text-sm font-medium text-white/70", children: i }),
|
|
2920
3000
|
/* @__PURE__ */ e(
|
|
2921
3001
|
"iframe",
|
|
2922
3002
|
{
|
|
2923
3003
|
src: s,
|
|
2924
|
-
title:
|
|
3004
|
+
title: i ?? "Document",
|
|
2925
3005
|
className: "w-full flex-1 rounded-xl"
|
|
2926
3006
|
}
|
|
2927
3007
|
)
|
|
2928
|
-
] }) : /* @__PURE__ */
|
|
2929
|
-
|
|
2930
|
-
/* @__PURE__ */ e(
|
|
3008
|
+
] }) : /* @__PURE__ */ c("div", { className: "w-full max-w-2xl", children: [
|
|
3009
|
+
i && /* @__PURE__ */ e("p", { className: "mb-4 text-center text-sm font-medium text-white/70", children: i }),
|
|
3010
|
+
/* @__PURE__ */ e(He, { source: s, mimeType: n, poster: l, controls: !0 })
|
|
2931
3011
|
] })
|
|
2932
3012
|
] })
|
|
2933
3013
|
}
|
|
2934
3014
|
);
|
|
2935
|
-
},
|
|
3015
|
+
}, ca = ({
|
|
2936
3016
|
message: t,
|
|
2937
3017
|
isMyMessage: s = !1
|
|
2938
3018
|
}) => {
|
|
2939
|
-
var C,
|
|
2940
|
-
const [n,
|
|
2941
|
-
(
|
|
2942
|
-
),
|
|
2943
|
-
(
|
|
2944
|
-
), r = (
|
|
2945
|
-
(
|
|
2946
|
-
),
|
|
2947
|
-
(
|
|
3019
|
+
var C, S, L, v, m;
|
|
3020
|
+
const [n, i] = k(!1), l = (C = t.attachments) == null ? void 0 : C.find(
|
|
3021
|
+
(b) => b.type === "link" || b.og_scrape_url && !b.asset_url
|
|
3022
|
+
), u = (S = t.attachments) == null ? void 0 : S.find(
|
|
3023
|
+
(b) => b.type === "video" && b.asset_url
|
|
3024
|
+
), r = (L = t.attachments) == null ? void 0 : L.find(
|
|
3025
|
+
(b) => b.type === "image" && b.image_url
|
|
3026
|
+
), d = (v = t.attachments) == null ? void 0 : v.find(
|
|
3027
|
+
(b) => b.type === "audio" && b.asset_url
|
|
2948
3028
|
), x = (m = t.attachments) == null ? void 0 : m.find(
|
|
2949
|
-
(
|
|
2950
|
-
),
|
|
2951
|
-
if (!l && !
|
|
2952
|
-
const N =
|
|
2953
|
-
return /* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
3029
|
+
(b) => b.type === "file" && b.asset_url
|
|
3030
|
+
), o = u ?? r ?? d ?? x, h = (u == null ? void 0 : u.asset_url) ?? (r == null ? void 0 : r.image_url) ?? (d == null ? void 0 : d.asset_url) ?? (x == null ? void 0 : x.asset_url), f = (o == null ? void 0 : o.mime_type) ?? ((o == null ? void 0 : o.type) === "image" ? "image/jpeg" : (o == null ? void 0 : o.type) === "video" ? "video/mp4" : (o == null ? void 0 : o.type) === "audio" ? "audio/mpeg" : "application/octet-stream");
|
|
3031
|
+
if (!l && !h) return null;
|
|
3032
|
+
const N = h ? qe(f) : null, a = o == null ? void 0 : o.title, _ = o == null ? void 0 : o.file_size, w = u == null ? void 0 : u.thumb_url, g = f === "application/pdf", y = s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", I = N === "image" || N === "video" || g;
|
|
3033
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
3034
|
+
/* @__PURE__ */ c("div", { className: y, children: [
|
|
2955
3035
|
!s && t.user && /* @__PURE__ */ e(
|
|
2956
|
-
|
|
3036
|
+
ae,
|
|
2957
3037
|
{
|
|
2958
3038
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2959
3039
|
id: t.user.id,
|
|
@@ -2971,77 +3051,77 @@ const Hn = ({
|
|
|
2971
3051
|
{
|
|
2972
3052
|
className: "str-chat__message-bubble",
|
|
2973
3053
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
2974
|
-
children: /* @__PURE__ */ e("div", { className:
|
|
3054
|
+
children: /* @__PURE__ */ e("div", { className: Vn(s), children: l ? /* @__PURE__ */ e(Xn, { attachment: l, isMyMessage: s }) : N === "image" ? /* @__PURE__ */ c(se, { children: [
|
|
2975
3055
|
/* @__PURE__ */ e(
|
|
2976
3056
|
"button",
|
|
2977
3057
|
{
|
|
2978
3058
|
type: "button",
|
|
2979
|
-
onClick: () =>
|
|
3059
|
+
onClick: () => i(!0),
|
|
2980
3060
|
className: "block w-full cursor-zoom-in",
|
|
2981
|
-
children: /* @__PURE__ */ e("img", { src:
|
|
3061
|
+
children: /* @__PURE__ */ e("img", { src: h, alt: a ?? "", className: "block w-full" })
|
|
2982
3062
|
}
|
|
2983
3063
|
),
|
|
2984
3064
|
/* @__PURE__ */ e(
|
|
2985
3065
|
Me,
|
|
2986
3066
|
{
|
|
2987
|
-
mimeType:
|
|
3067
|
+
mimeType: f,
|
|
2988
3068
|
title: a,
|
|
2989
3069
|
fileSize: _,
|
|
2990
|
-
url:
|
|
3070
|
+
url: h,
|
|
2991
3071
|
isMyMessage: s
|
|
2992
3072
|
}
|
|
2993
3073
|
)
|
|
2994
|
-
] }) : N === "video" ? /* @__PURE__ */
|
|
3074
|
+
] }) : N === "video" ? /* @__PURE__ */ c(se, { children: [
|
|
2995
3075
|
/* @__PURE__ */ e(
|
|
2996
|
-
|
|
3076
|
+
He,
|
|
2997
3077
|
{
|
|
2998
|
-
source:
|
|
2999
|
-
mimeType:
|
|
3078
|
+
source: h,
|
|
3079
|
+
mimeType: f,
|
|
3000
3080
|
poster: w,
|
|
3001
3081
|
controls: !0,
|
|
3002
|
-
onContainerClick: () =>
|
|
3082
|
+
onContainerClick: () => i(!0)
|
|
3003
3083
|
}
|
|
3004
3084
|
),
|
|
3005
3085
|
/* @__PURE__ */ e(
|
|
3006
3086
|
Me,
|
|
3007
3087
|
{
|
|
3008
|
-
mimeType:
|
|
3088
|
+
mimeType: f,
|
|
3009
3089
|
title: a,
|
|
3010
3090
|
fileSize: _,
|
|
3011
|
-
url:
|
|
3091
|
+
url: h,
|
|
3012
3092
|
isMyMessage: s
|
|
3013
3093
|
}
|
|
3014
3094
|
)
|
|
3015
|
-
] }) : N === "audio" ? /* @__PURE__ */
|
|
3095
|
+
] }) : N === "audio" ? /* @__PURE__ */ c(se, { children: [
|
|
3016
3096
|
/* @__PURE__ */ e(
|
|
3017
|
-
|
|
3097
|
+
He,
|
|
3018
3098
|
{
|
|
3019
|
-
source:
|
|
3020
|
-
mimeType:
|
|
3099
|
+
source: h,
|
|
3100
|
+
mimeType: f,
|
|
3021
3101
|
controls: !0
|
|
3022
3102
|
}
|
|
3023
3103
|
),
|
|
3024
3104
|
/* @__PURE__ */ e(
|
|
3025
3105
|
Me,
|
|
3026
3106
|
{
|
|
3027
|
-
mimeType:
|
|
3107
|
+
mimeType: f,
|
|
3028
3108
|
title: a,
|
|
3029
3109
|
fileSize: _,
|
|
3030
|
-
url:
|
|
3110
|
+
url: h,
|
|
3031
3111
|
isMyMessage: s
|
|
3032
3112
|
}
|
|
3033
3113
|
)
|
|
3034
3114
|
] }) : (
|
|
3035
3115
|
// document: PDF gets viewer, unknown gets link-only thumbnail
|
|
3036
3116
|
/* @__PURE__ */ e(
|
|
3037
|
-
|
|
3117
|
+
Zn,
|
|
3038
3118
|
{
|
|
3039
|
-
url:
|
|
3040
|
-
mimeType:
|
|
3119
|
+
url: h,
|
|
3120
|
+
mimeType: f,
|
|
3041
3121
|
title: a,
|
|
3042
3122
|
fileSize: _,
|
|
3043
3123
|
isMyMessage: s,
|
|
3044
|
-
onExpand:
|
|
3124
|
+
onExpand: g ? () => i(!0) : void 0
|
|
3045
3125
|
}
|
|
3046
3126
|
)
|
|
3047
3127
|
) })
|
|
@@ -3050,81 +3130,81 @@ const Hn = ({
|
|
|
3050
3130
|
}
|
|
3051
3131
|
)
|
|
3052
3132
|
] }),
|
|
3053
|
-
n &&
|
|
3054
|
-
|
|
3133
|
+
n && I && h && /* @__PURE__ */ e(
|
|
3134
|
+
Kn,
|
|
3055
3135
|
{
|
|
3056
3136
|
sourceType: N,
|
|
3057
|
-
url:
|
|
3058
|
-
mimeType:
|
|
3137
|
+
url: h,
|
|
3138
|
+
mimeType: f,
|
|
3059
3139
|
title: a,
|
|
3060
3140
|
poster: w,
|
|
3061
|
-
onClose: () =>
|
|
3141
|
+
onClose: () => i(!1)
|
|
3062
3142
|
}
|
|
3063
3143
|
)
|
|
3064
3144
|
] });
|
|
3065
|
-
},
|
|
3066
|
-
const { initialSearch: n = "", pageSize:
|
|
3145
|
+
}, da = (t, s = {}) => {
|
|
3146
|
+
const { initialSearch: n = "", pageSize: i = 20 } = s, [l, u] = k([]), [r, d] = k(!1), [x, o] = k(null), [h, f] = k(n), [N, a] = k(!0), [_, w] = k(), g = A(async (S = !1, L) => {
|
|
3067
3147
|
if (r) return;
|
|
3068
|
-
const v =
|
|
3069
|
-
|
|
3148
|
+
const v = L !== void 0 ? L : h;
|
|
3149
|
+
d(!0), o(null);
|
|
3070
3150
|
try {
|
|
3071
3151
|
const m = await t.loadParticipants({
|
|
3072
3152
|
search: v || void 0,
|
|
3073
|
-
limit:
|
|
3074
|
-
cursor:
|
|
3153
|
+
limit: i,
|
|
3154
|
+
cursor: S ? void 0 : _
|
|
3075
3155
|
});
|
|
3076
|
-
|
|
3077
|
-
(
|
|
3156
|
+
u(
|
|
3157
|
+
(b) => S ? m.participants : [...b, ...m.participants]
|
|
3078
3158
|
), a(m.hasMore), w(m.nextCursor);
|
|
3079
3159
|
} catch (m) {
|
|
3080
|
-
const
|
|
3081
|
-
|
|
3160
|
+
const b = m instanceof Error ? m.message : "Failed to load participants";
|
|
3161
|
+
o(b), console.error("[useParticipants] Load error:", m);
|
|
3082
3162
|
} finally {
|
|
3083
|
-
|
|
3163
|
+
d(!1);
|
|
3084
3164
|
}
|
|
3085
|
-
}, [t,
|
|
3086
|
-
N && !r &&
|
|
3087
|
-
}, [N, r,
|
|
3088
|
-
|
|
3089
|
-
}, [
|
|
3090
|
-
w(void 0),
|
|
3091
|
-
}, [
|
|
3165
|
+
}, [t, h, _, i, r]), y = A(() => {
|
|
3166
|
+
N && !r && g(!1);
|
|
3167
|
+
}, [N, r, g]), I = A((S) => {
|
|
3168
|
+
f(S), w(void 0), g(!0, S);
|
|
3169
|
+
}, [g]), C = A(() => {
|
|
3170
|
+
w(void 0), g(!0);
|
|
3171
|
+
}, [g]);
|
|
3092
3172
|
return q(() => {
|
|
3093
|
-
|
|
3173
|
+
g(!0);
|
|
3094
3174
|
}, [t.loadParticipants]), {
|
|
3095
3175
|
participants: l,
|
|
3096
3176
|
loading: r,
|
|
3097
3177
|
error: x,
|
|
3098
|
-
searchQuery:
|
|
3178
|
+
searchQuery: h,
|
|
3099
3179
|
hasMore: N,
|
|
3100
3180
|
totalCount: t.totalCount,
|
|
3101
|
-
loadMore:
|
|
3102
|
-
search:
|
|
3181
|
+
loadMore: y,
|
|
3182
|
+
search: I,
|
|
3103
3183
|
refresh: C
|
|
3104
3184
|
};
|
|
3105
3185
|
};
|
|
3106
3186
|
export {
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3187
|
+
Ie as A,
|
|
3188
|
+
Tn as C,
|
|
3189
|
+
oa as F,
|
|
3190
|
+
it as L,
|
|
3191
|
+
He as M,
|
|
3192
|
+
Ln as P,
|
|
3193
|
+
ae as a,
|
|
3194
|
+
wt as b,
|
|
3195
|
+
Et as c,
|
|
3196
|
+
ia as d,
|
|
3197
|
+
An as e,
|
|
3198
|
+
ca as f,
|
|
3199
|
+
qe as g,
|
|
3200
|
+
cn as h,
|
|
3201
|
+
ra as i,
|
|
3202
|
+
la as j,
|
|
3203
|
+
zs as k,
|
|
3204
|
+
Js as l,
|
|
3205
|
+
Fs as m,
|
|
3206
|
+
da as n,
|
|
3207
|
+
Ze as r,
|
|
3208
|
+
rn as u
|
|
3129
3209
|
};
|
|
3130
|
-
//# sourceMappingURL=index-
|
|
3210
|
+
//# sourceMappingURL=index-B3H4GLek.js.map
|