@linktr.ee/messaging-react 3.2.0 → 3.3.0
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-bdnjL_4d.js → Card-BAc2cgtn.js} +3 -3
- package/dist/{Card-bdnjL_4d.js.map → Card-BAc2cgtn.js.map} +1 -1
- package/dist/{Card-CO089n1e.cjs → Card-Cn1cBVnr.cjs} +2 -2
- package/dist/{Card-CO089n1e.cjs.map → Card-Cn1cBVnr.cjs.map} +1 -1
- package/dist/{Card-B5TCecD6.cjs → Card-DAyszUxa.cjs} +2 -2
- package/dist/{Card-B5TCecD6.cjs.map → Card-DAyszUxa.cjs.map} +1 -1
- package/dist/{Card-DQYLHbDI.js → Card-D_2VQScd.js} +2 -2
- package/dist/{Card-DQYLHbDI.js.map → Card-D_2VQScd.js.map} +1 -1
- package/dist/{Card-DTaHgygz.js → Card-D_G8133I.js} +2 -2
- package/dist/{Card-DTaHgygz.js.map → Card-D_G8133I.js.map} +1 -1
- package/dist/{Card-aO1qZWDU.cjs → Card-gYxPXe_W.cjs} +2 -2
- package/dist/{Card-aO1qZWDU.cjs.map → Card-gYxPXe_W.cjs.map} +1 -1
- package/dist/{LockedThumbnail-nsFA3DjA.js → LockedThumbnail-C7tWpOQr.js} +2 -2
- package/dist/{LockedThumbnail-nsFA3DjA.js.map → LockedThumbnail-C7tWpOQr.js.map} +1 -1
- package/dist/{LockedThumbnail-CWVybsBb.cjs → LockedThumbnail-DtOTZl3l.cjs} +2 -2
- package/dist/{LockedThumbnail-CWVybsBb.cjs.map → LockedThumbnail-DtOTZl3l.cjs.map} +1 -1
- package/dist/{index-DJKFVBkP.js → index-C_NFzAB9.js} +1356 -1382
- package/dist/index-C_NFzAB9.js.map +1 -0
- package/dist/index-_Se6ovQm.cjs +2 -0
- package/dist/index-_Se6ovQm.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -15
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/components/ChannelActionsMenu/ChannelActionsMenu.test.tsx +305 -0
- package/src/components/ChannelActionsMenu/index.tsx +221 -0
- package/src/components/ChannelView.stories.tsx +3 -73
- package/src/components/ChannelView.test.tsx +30 -57
- package/src/components/ChannelView.tsx +66 -115
- package/src/hooks/useChannelModerationActions.ts +227 -0
- package/src/types.ts +20 -15
- package/dist/index-BO2VfA-M.cjs +0 -2
- package/dist/index-BO2VfA-M.cjs.map +0 -1
- package/dist/index-DJKFVBkP.js.map +0 -1
- package/src/components/ChannelInfoDialog/ChannelInfoDialog.test.tsx +0 -333
- package/src/components/ChannelInfoDialog/index.tsx +0 -336
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import z, { createContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { Chat as In, DateSeparator as
|
|
5
|
-
import { StarIcon as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import z, { createContext as Ge, useContext as Te, useCallback as W, useState as D, useRef as H, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
|
|
3
|
+
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { Chat as In, DateSeparator as Tn, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as An, useMessageReminder as Mn, useComponentContext as Ut, Attachment as Rn, EditMessageModal as Ln, MessageBlocked as Dn, MessageBouncePrompt as Pn, MessageDeleted as On, MessageIsThreadReplyInChannelButtonIndicator as zn, MessageRepliesCountButton as $n, ReminderNotification as Fn, StreamedMessageText as Bn, messageHasAttachments as Un, messageHasReactions as jn, isDateSeparatorMessage as Vn, isMessageBlocked as Gn, isMessageBounced as Hn, MessageBounceModal as Yn, MessageText as Tt, Poll as qn, MessageErrorIcon as Wn, useMessageContext as pe, useMessageComposer as Xn, useStateStore as Kn, MessageInput as Jn, useMessageInputContext as Zn, useMessageComposerHasSendableData as Qn, AttachmentPreviewList as es, QuotedMessagePreview as ts, TextareaComposer as ns, MessageTimestamp as Le, AIStates as De, useTypingContext as ss, useAIState as as, Channel as rs, WithComponents as is, Window as os, MessageList as ls, ChannelList as cs } from "stream-chat-react";
|
|
5
|
+
import { StarIcon as Fe, DotsThreeIcon as ds, SpinnerGapIcon as Ce, SignOutIcon as us, ProhibitInsetIcon as At, FlagIcon as jt, FileIcon as Vt, ImageIcon as ms, SpeakerHighIcon as hs, VideoCameraIcon as Gt, FileMdIcon as fs, FileTextIcon as gs, FileZipIcon as bs, FilePptIcon as ps, FileCsvIcon as vs, FileXlsIcon as xs, FileDocIcon as ws, FilePdfIcon as Ns, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as _s, LinkIcon as ys, DownloadSimpleIcon as be, GiftIcon as Cs, ThumbsUpIcon as ks, ThumbsDownIcon as Es, TrashSimpleIcon as Ss, XIcon as Ae, ArrowUpIcon as Is, SparkleIcon as Ue, ProhibitIcon as Ts, ArrowLeftIcon as Mt, PencilSimpleIcon as As, CaretLeftIcon as Ms, CaretRightIcon as Rs } from "@phosphor-icons/react";
|
|
6
6
|
import C from "classnames";
|
|
7
|
-
import { MessageActions as
|
|
8
|
-
import { LinkPreviewsManager as
|
|
9
|
-
const
|
|
7
|
+
import { MessageActions as Ls, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
|
|
8
|
+
import { LinkPreviewsManager as Rt } from "stream-chat";
|
|
9
|
+
const Yt = Ge({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const qt = He({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), qe = () => Te(Yt), wi = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -25,8 +25,8 @@ const qt = He({
|
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
27
|
const o = W(
|
|
28
|
-
(
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
28
|
+
(E, ...A) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${E}`, ...A);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
@@ -36,84 +36,84 @@ const qt = He({
|
|
|
36
36
|
serviceConfig: !!s,
|
|
37
37
|
capabilities: Object.keys(r)
|
|
38
38
|
});
|
|
39
|
-
const [l, d] =
|
|
39
|
+
const [l, d] = D(null), [m, b] = D(null), [u, f] = D(!1), [c, g] = D(!1), [v, p] = D(null), N = H(!1), x = H({
|
|
40
40
|
userId: t == null ? void 0 : t.id,
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
renderCount:
|
|
44
|
+
}), T = H(0);
|
|
45
|
+
T.current++, o("📊 RENDER INFO", {
|
|
46
|
+
renderCount: T.current,
|
|
47
47
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
48
48
|
propChanges: {
|
|
49
|
-
userChanged:
|
|
50
|
-
apiKeyChanged:
|
|
51
|
-
serviceConfigChanged:
|
|
52
|
-
capabilitiesChanged:
|
|
49
|
+
userChanged: x.current.userId !== (t == null ? void 0 : t.id),
|
|
50
|
+
apiKeyChanged: x.current.apiKey !== a,
|
|
51
|
+
serviceConfigChanged: x.current.serviceConfig !== s,
|
|
52
|
+
capabilitiesChanged: x.current.capabilities !== r
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), x.current = {
|
|
55
55
|
userId: t == null ? void 0 : t.id,
|
|
56
56
|
apiKey: a,
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
|
-
},
|
|
60
|
-
const
|
|
59
|
+
}, Y(() => {
|
|
60
|
+
const E = T.current;
|
|
61
61
|
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
|
-
renderCount:
|
|
62
|
+
renderCount: E,
|
|
63
63
|
apiKey: !!a,
|
|
64
64
|
serviceConfig: !!s,
|
|
65
65
|
dependencies: {
|
|
66
66
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
67
67
|
serviceConfigRef: s,
|
|
68
|
-
serviceConfigStable:
|
|
69
|
-
apiKeyStable:
|
|
68
|
+
serviceConfigStable: x.current.serviceConfig === s,
|
|
69
|
+
apiKeyStable: x.current.apiKey === a
|
|
70
70
|
}
|
|
71
71
|
}), !a || !s) {
|
|
72
72
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
73
|
-
renderCount:
|
|
73
|
+
renderCount: E,
|
|
74
74
|
reason: "Missing apiKey or serviceConfig"
|
|
75
75
|
});
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
o("🚀 CREATING NEW SERVICE", {
|
|
79
|
-
renderCount:
|
|
79
|
+
renderCount: E,
|
|
80
80
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
|
-
serviceConfigChanged:
|
|
81
|
+
serviceConfigChanged: x.current.serviceConfig !== s
|
|
82
82
|
});
|
|
83
|
-
const
|
|
83
|
+
const A = new Sn({
|
|
84
84
|
...s,
|
|
85
85
|
apiKey: a,
|
|
86
86
|
debug: i
|
|
87
87
|
});
|
|
88
|
-
return d(
|
|
89
|
-
renderCount:
|
|
90
|
-
serviceInstance: !!
|
|
88
|
+
return d(A), o("✅ SERVICE SET", {
|
|
89
|
+
renderCount: E,
|
|
90
|
+
serviceInstance: !!A
|
|
91
91
|
}), () => {
|
|
92
92
|
o("🧹 SERVICE CLEANUP", {
|
|
93
|
-
renderCount:
|
|
93
|
+
renderCount: E,
|
|
94
94
|
reason: "Effect cleanup"
|
|
95
|
-
}),
|
|
95
|
+
}), A.disconnectUser().catch(console.error);
|
|
96
96
|
};
|
|
97
97
|
}, [a, s, i, o]);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
var
|
|
98
|
+
const S = H(null);
|
|
99
|
+
Y(() => {
|
|
100
|
+
var A, y;
|
|
101
101
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
102
|
hasService: !!l,
|
|
103
103
|
hasUser: !!t,
|
|
104
104
|
userId: t == null ? void 0 : t.id,
|
|
105
|
-
isConnecting:
|
|
105
|
+
isConnecting: N.current,
|
|
106
106
|
isConnected: u,
|
|
107
107
|
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
108
108
|
}), !l || !t) {
|
|
109
109
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
if (
|
|
112
|
+
if (N.current) {
|
|
113
113
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (((
|
|
116
|
+
if (((A = S.current) == null ? void 0 : A.serviceId) === l && ((y = S.current) == null ? void 0 : y.userId) === t.id) {
|
|
117
117
|
o(
|
|
118
118
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
119
|
"Already connected this user with this service"
|
|
@@ -121,40 +121,40 @@ const qt = He({
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
(async () => {
|
|
124
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
124
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0), p(null);
|
|
125
125
|
try {
|
|
126
126
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const _ = await l.connectUser(t);
|
|
128
|
+
b(_), f(!0), S.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
130
|
+
clientId: _.userID
|
|
131
131
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const I =
|
|
134
|
-
|
|
132
|
+
} catch (_) {
|
|
133
|
+
const I = _ instanceof Error ? _.message : "Connection failed";
|
|
134
|
+
p(I), o("❌ USER CONNECTION ERROR", {
|
|
135
135
|
userId: t.id,
|
|
136
136
|
error: I
|
|
137
137
|
});
|
|
138
138
|
} finally {
|
|
139
|
-
|
|
139
|
+
g(!1), N.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
140
140
|
userId: t.id,
|
|
141
141
|
isConnected: u
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
})();
|
|
145
|
-
}, [l, t, o, u]),
|
|
145
|
+
}, [l, t, o, u]), Y(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
|
|
146
146
|
hasService: !!l,
|
|
147
147
|
isConnected: u
|
|
148
148
|
}), () => {
|
|
149
149
|
l && u ? (o(
|
|
150
150
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
151
151
|
"Cleaning up connection on unmount"
|
|
152
|
-
),
|
|
152
|
+
), S.current = null, l.disconnectUser().catch(console.error)) : o("🔇 CLEANUP EFFECT SKIPPED", {
|
|
153
153
|
hasService: !!l,
|
|
154
154
|
isConnected: u
|
|
155
155
|
});
|
|
156
156
|
}), [l, u, o]);
|
|
157
|
-
const
|
|
157
|
+
const R = W(async () => {
|
|
158
158
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
159
159
|
hasService: !!l,
|
|
160
160
|
hasUser: !!t
|
|
@@ -162,52 +162,52 @@ const qt = He({
|
|
|
162
162
|
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
|
-
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
165
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), g(!0);
|
|
166
166
|
try {
|
|
167
167
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
} catch (
|
|
171
|
-
const
|
|
172
|
-
|
|
168
|
+
const E = await l.connectUser(t);
|
|
169
|
+
b(E), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
170
|
+
} catch (E) {
|
|
171
|
+
const A = E instanceof Error ? E.message : "Refresh failed";
|
|
172
|
+
p(A), o("❌ CONNECTION REFRESH ERROR", {
|
|
173
173
|
userId: t.id,
|
|
174
|
-
error:
|
|
174
|
+
error: A
|
|
175
175
|
});
|
|
176
176
|
} finally {
|
|
177
|
-
|
|
177
|
+
g(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
178
|
}
|
|
179
|
-
}, [l, t, o]),
|
|
179
|
+
}, [l, t, o]), O = z.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
180
180
|
hasService: !!l,
|
|
181
181
|
hasClient: !!m,
|
|
182
182
|
isConnected: u,
|
|
183
183
|
isLoading: c,
|
|
184
|
-
hasError: !!
|
|
184
|
+
hasError: !!v,
|
|
185
185
|
capabilitiesKeys: Object.keys(r)
|
|
186
186
|
}), {
|
|
187
187
|
service: l,
|
|
188
188
|
client: m,
|
|
189
189
|
isConnected: u,
|
|
190
190
|
isLoading: c,
|
|
191
|
-
error:
|
|
191
|
+
error: v,
|
|
192
192
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
193
|
+
refreshConnection: R,
|
|
194
194
|
debug: i
|
|
195
195
|
}), [
|
|
196
196
|
l,
|
|
197
197
|
m,
|
|
198
198
|
u,
|
|
199
199
|
c,
|
|
200
|
-
|
|
200
|
+
v,
|
|
201
201
|
r,
|
|
202
|
-
|
|
202
|
+
R,
|
|
203
203
|
i,
|
|
204
204
|
o
|
|
205
205
|
]);
|
|
206
206
|
return o("🔄 RENDER END", {
|
|
207
|
-
renderCount:
|
|
207
|
+
renderCount: T.current,
|
|
208
208
|
willRenderChat: !!(m && u),
|
|
209
|
-
contextValueReady: !!
|
|
210
|
-
}), /* @__PURE__ */ n(
|
|
209
|
+
contextValueReady: !!O
|
|
210
|
+
}), /* @__PURE__ */ n(Yt.Provider, { value: O, children: m && u ? /* @__PURE__ */ n(
|
|
211
211
|
In,
|
|
212
212
|
{
|
|
213
213
|
client: m,
|
|
@@ -217,12 +217,12 @@ const qt = He({
|
|
|
217
217
|
children: e
|
|
218
218
|
}
|
|
219
219
|
) : e });
|
|
220
|
-
}, Ds = () =>
|
|
220
|
+
}, Ds = () => qe(), qt = (e) => {
|
|
221
221
|
var a, r;
|
|
222
|
-
const [t, s] =
|
|
222
|
+
const [t, s] = D(
|
|
223
223
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
224
224
|
);
|
|
225
|
-
return
|
|
225
|
+
return Y(() => {
|
|
226
226
|
var o;
|
|
227
227
|
if (!e) {
|
|
228
228
|
s(!1);
|
|
@@ -239,18 +239,18 @@ const qt = He({
|
|
|
239
239
|
e.off("member.updated", i);
|
|
240
240
|
};
|
|
241
241
|
}, [e]), t;
|
|
242
|
-
},
|
|
243
|
-
function
|
|
244
|
-
return
|
|
242
|
+
}, Ps = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
243
|
+
function Os(e) {
|
|
244
|
+
return Ps.test(e.trim());
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Lt(e, t) {
|
|
247
247
|
const s = e == null ? void 0 : e.trim();
|
|
248
|
-
return !s || t && s === t ? !1 : !
|
|
248
|
+
return !s || t && s === t ? !1 : !Os(s);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
250
|
+
function Wt(e) {
|
|
251
|
+
return Lt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Lt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
252
252
|
}
|
|
253
|
-
const
|
|
253
|
+
const Dt = [
|
|
254
254
|
"🍎",
|
|
255
255
|
// Apple
|
|
256
256
|
"🍌",
|
|
@@ -278,7 +278,7 @@ const Ot = [
|
|
|
278
278
|
"🍈"
|
|
279
279
|
// Melon
|
|
280
280
|
];
|
|
281
|
-
function
|
|
281
|
+
function zs(e) {
|
|
282
282
|
let t = 0;
|
|
283
283
|
for (let s = 0; s < e.length; s++) {
|
|
284
284
|
const a = e.charCodeAt(s);
|
|
@@ -286,11 +286,11 @@ function Ps(e) {
|
|
|
286
286
|
}
|
|
287
287
|
return Math.abs(t);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
const s =
|
|
291
|
-
return
|
|
289
|
+
function $s(e) {
|
|
290
|
+
const s = zs(e) % Dt.length;
|
|
291
|
+
return Dt[s];
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const ae = ({
|
|
294
294
|
id: e,
|
|
295
295
|
image: t,
|
|
296
296
|
size: s = 40,
|
|
@@ -299,7 +299,7 @@ const re = ({
|
|
|
299
299
|
shape: i = "squircle",
|
|
300
300
|
dmAgentEnabled: o = !1
|
|
301
301
|
}) => {
|
|
302
|
-
const l =
|
|
302
|
+
const l = $s(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", b = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
303
303
|
"img",
|
|
304
304
|
{
|
|
305
305
|
src: t,
|
|
@@ -335,7 +335,7 @@ const re = ({
|
|
|
335
335
|
{
|
|
336
336
|
"aria-hidden": "true",
|
|
337
337
|
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)]",
|
|
338
|
-
children: /* @__PURE__ */ n(
|
|
338
|
+
children: /* @__PURE__ */ n(Fe, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
341
|
/* @__PURE__ */ n(
|
|
@@ -349,7 +349,7 @@ const re = ({
|
|
|
349
349
|
style: {
|
|
350
350
|
...u,
|
|
351
351
|
...o && {
|
|
352
|
-
borderWidth: `${
|
|
352
|
+
borderWidth: `${b}px`,
|
|
353
353
|
borderStyle: "solid",
|
|
354
354
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
355
355
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
@@ -361,7 +361,96 @@ const re = ({
|
|
|
361
361
|
]
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
|
-
},
|
|
364
|
+
}, Fs = "https://linktr.ee/s/about/trust-center/report", Bs = ({
|
|
365
|
+
channel: e,
|
|
366
|
+
participant: t,
|
|
367
|
+
showBlockParticipant: s = !0,
|
|
368
|
+
enabled: a = !0,
|
|
369
|
+
onLeaveConversation: r,
|
|
370
|
+
onBlockParticipant: i,
|
|
371
|
+
onDeleteConversationClick: o,
|
|
372
|
+
onBlockParticipantClick: l,
|
|
373
|
+
onReportParticipantClick: d,
|
|
374
|
+
onActionComplete: m,
|
|
375
|
+
logLabel: b = "useChannelModerationActions"
|
|
376
|
+
}) => {
|
|
377
|
+
var y;
|
|
378
|
+
const { service: u, debug: f } = qe(), [c, g] = D(!1), [v, p] = D(!1), [N, x] = D(!1), [T, S] = D(!1);
|
|
379
|
+
return Y(() => {
|
|
380
|
+
var L;
|
|
381
|
+
if (!a || !s || !u || !((L = t == null ? void 0 : t.user) != null && L.id)) {
|
|
382
|
+
g(!1), p(!1);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
let _ = !1;
|
|
386
|
+
const I = t.user.id;
|
|
387
|
+
return p(!0), (async () => {
|
|
388
|
+
try {
|
|
389
|
+
const M = await u.getBlockedUsers();
|
|
390
|
+
if (_) return;
|
|
391
|
+
g(
|
|
392
|
+
M.some(
|
|
393
|
+
(j) => j.blocked_user_id === I
|
|
394
|
+
)
|
|
395
|
+
);
|
|
396
|
+
} catch (M) {
|
|
397
|
+
_ || console.error(`[${b}] Failed to check blocked status:`, M);
|
|
398
|
+
} finally {
|
|
399
|
+
_ || p(!1);
|
|
400
|
+
}
|
|
401
|
+
})(), () => {
|
|
402
|
+
_ = !0;
|
|
403
|
+
};
|
|
404
|
+
}, [a, u, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id, s, b]), {
|
|
405
|
+
isParticipantBlocked: c,
|
|
406
|
+
isCheckingBlockedStatus: v,
|
|
407
|
+
isLeaving: N,
|
|
408
|
+
isUpdatingBlockStatus: T,
|
|
409
|
+
handleLeaveConversation: async () => {
|
|
410
|
+
var _;
|
|
411
|
+
if (!N) {
|
|
412
|
+
o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), x(!0);
|
|
413
|
+
try {
|
|
414
|
+
const I = ((_ = e._client) == null ? void 0 : _.userID) ?? null;
|
|
415
|
+
await e.hide(I, !1), r && await r(e), m == null || m();
|
|
416
|
+
} catch (I) {
|
|
417
|
+
console.error(`[${b}] Failed to leave conversation`, I);
|
|
418
|
+
} finally {
|
|
419
|
+
x(!1);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
handleBlockUser: async () => {
|
|
424
|
+
var _, I, L;
|
|
425
|
+
if (!(T || !u)) {
|
|
426
|
+
l == null || l(), f && console.log(`[${b}] Block member`, (_ = t == null ? void 0 : t.user) == null ? void 0 : _.id), S(!0);
|
|
427
|
+
try {
|
|
428
|
+
await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), m == null || m();
|
|
429
|
+
} catch (M) {
|
|
430
|
+
console.error(`[${b}] Failed to block member`, M);
|
|
431
|
+
} finally {
|
|
432
|
+
S(!1);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
handleUnblockUser: async () => {
|
|
437
|
+
var _, I, L;
|
|
438
|
+
if (!(T || !u)) {
|
|
439
|
+
l == null || l(), f && console.log(`[${b}] Unblock member`, (_ = t == null ? void 0 : t.user) == null ? void 0 : _.id), S(!0);
|
|
440
|
+
try {
|
|
441
|
+
await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), m == null || m();
|
|
442
|
+
} catch (M) {
|
|
443
|
+
console.error(`[${b}] Failed to unblock member`, M);
|
|
444
|
+
} finally {
|
|
445
|
+
S(!1);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
handleReportUser: () => {
|
|
450
|
+
d == null || d(), m == null || m(), window.open(Fs, "_blank", "noopener,noreferrer");
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}, he = ({
|
|
365
454
|
variant: e = "default",
|
|
366
455
|
className: t,
|
|
367
456
|
children: s,
|
|
@@ -378,235 +467,143 @@ const re = ({
|
|
|
378
467
|
...a,
|
|
379
468
|
children: s
|
|
380
469
|
}
|
|
381
|
-
)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
),
|
|
395
|
-
...a,
|
|
396
|
-
children: [
|
|
397
|
-
/* @__PURE__ */ n("span", { className: "sr-only", children: e }),
|
|
398
|
-
s
|
|
399
|
-
]
|
|
400
|
-
}
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
function Fs({ onClick: e }) {
|
|
404
|
-
return /* @__PURE__ */ n(zs, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(ve, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
405
|
-
}
|
|
406
|
-
const $s = ({
|
|
407
|
-
dialogRef: e,
|
|
408
|
-
onClose: t,
|
|
409
|
-
participant: s,
|
|
410
|
-
participantDisplayName: a,
|
|
411
|
-
channel: r,
|
|
412
|
-
followerStatusLabel: i,
|
|
413
|
-
onLeaveConversation: o,
|
|
414
|
-
onBlockParticipant: l,
|
|
415
|
-
showDeleteConversation: d = !0,
|
|
416
|
-
showBlockParticipant: m = !0,
|
|
417
|
-
showReportParticipant: g = !0,
|
|
418
|
-
onDeleteConversationClick: u,
|
|
419
|
-
onBlockParticipantClick: f,
|
|
420
|
-
onReportParticipantClick: c,
|
|
421
|
-
customProfileContent: b,
|
|
422
|
-
customChannelActions: _
|
|
470
|
+
), Pt = ({
|
|
471
|
+
channel: e,
|
|
472
|
+
participant: t,
|
|
473
|
+
showDeleteConversation: s = !0,
|
|
474
|
+
showBlockParticipant: a = !0,
|
|
475
|
+
showReportParticipant: r = !0,
|
|
476
|
+
onLeaveConversation: i,
|
|
477
|
+
onBlockParticipant: o,
|
|
478
|
+
onDeleteConversationClick: l,
|
|
479
|
+
onBlockParticipantClick: d,
|
|
480
|
+
onReportParticipantClick: m,
|
|
481
|
+
customChannelActions: b,
|
|
482
|
+
triggerClassName: u
|
|
423
483
|
}) => {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
}, I = async () => {
|
|
472
|
-
var p, x, L;
|
|
473
|
-
if (!(D || !v)) {
|
|
474
|
-
f == null || f(), w && console.log("[ChannelInfoDialog] Unblock member", (p = s == null ? void 0 : s.user) == null ? void 0 : p.id), T(!0);
|
|
475
|
-
try {
|
|
476
|
-
await v.unBlockUser((x = s == null ? void 0 : s.user) == null ? void 0 : x.id), l && await l((L = s == null ? void 0 : s.user) == null ? void 0 : L.id), t();
|
|
477
|
-
} catch (U) {
|
|
478
|
-
console.error("[ChannelInfoDialog] Failed to unblock member", U);
|
|
479
|
-
} finally {
|
|
480
|
-
T(!1);
|
|
484
|
+
const [f, c] = D(!1), g = H(null), v = En(), p = W(() => c(!1), []), {
|
|
485
|
+
isParticipantBlocked: N,
|
|
486
|
+
isCheckingBlockedStatus: x,
|
|
487
|
+
isLeaving: T,
|
|
488
|
+
isUpdatingBlockStatus: S,
|
|
489
|
+
handleLeaveConversation: R,
|
|
490
|
+
handleBlockUser: O,
|
|
491
|
+
handleUnblockUser: E,
|
|
492
|
+
handleReportUser: A
|
|
493
|
+
} = Bs({
|
|
494
|
+
channel: e,
|
|
495
|
+
participant: t,
|
|
496
|
+
showBlockParticipant: a,
|
|
497
|
+
enabled: f,
|
|
498
|
+
onLeaveConversation: i,
|
|
499
|
+
onBlockParticipant: o,
|
|
500
|
+
onDeleteConversationClick: l,
|
|
501
|
+
onBlockParticipantClick: d,
|
|
502
|
+
onReportParticipantClick: m,
|
|
503
|
+
onActionComplete: p,
|
|
504
|
+
logLabel: "ChannelActionsMenu"
|
|
505
|
+
});
|
|
506
|
+
return Y(() => {
|
|
507
|
+
if (!f) return;
|
|
508
|
+
const _ = (L) => {
|
|
509
|
+
g.current && !g.current.contains(L.target) && c(!1);
|
|
510
|
+
}, I = (L) => {
|
|
511
|
+
L.key === "Escape" && c(!1);
|
|
512
|
+
};
|
|
513
|
+
return document.addEventListener("mousedown", _), document.addEventListener("keydown", I), () => {
|
|
514
|
+
document.removeEventListener("mousedown", _), document.removeEventListener("keydown", I);
|
|
515
|
+
};
|
|
516
|
+
}, [f]), !t || !(s || a || r || !!b) ? null : /* @__PURE__ */ h("div", { ref: g, className: "relative", children: [
|
|
517
|
+
/* @__PURE__ */ h(
|
|
518
|
+
"button",
|
|
519
|
+
{
|
|
520
|
+
className: u,
|
|
521
|
+
type: "button",
|
|
522
|
+
"aria-haspopup": "true",
|
|
523
|
+
"aria-expanded": f,
|
|
524
|
+
"aria-controls": f ? v : void 0,
|
|
525
|
+
onClick: () => c((_) => !_),
|
|
526
|
+
children: [
|
|
527
|
+
/* @__PURE__ */ n(ds, { className: "size-5 text-black/90" }),
|
|
528
|
+
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
529
|
+
]
|
|
481
530
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
"https://linktr.ee/s/about/trust-center/report",
|
|
486
|
-
"_blank",
|
|
487
|
-
"noopener,noreferrer"
|
|
488
|
-
);
|
|
489
|
-
};
|
|
490
|
-
if (!s) return null;
|
|
491
|
-
const P = a ?? Ae(s.user), Z = (Y = s.user) == null ? void 0 : Y.image, G = (q = s.user) == null ? void 0 : q.username, H = G ? `linktr.ee/${G}` : void 0, j = (($ = s.user) == null ? void 0 : $.id) || "unknown";
|
|
492
|
-
return (
|
|
493
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
494
|
-
/* @__PURE__ */ n(
|
|
495
|
-
"dialog",
|
|
531
|
+
),
|
|
532
|
+
f && /* @__PURE__ */ n(
|
|
533
|
+
"div",
|
|
496
534
|
{
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
children: /* @__PURE__ */ h("
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
size: 88,
|
|
523
|
-
shape: "circle"
|
|
524
|
-
}
|
|
525
|
-
),
|
|
526
|
-
/* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
527
|
-
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: P }),
|
|
528
|
-
H && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: H }),
|
|
529
|
-
i && !b && /* @__PURE__ */ n(
|
|
530
|
-
"span",
|
|
531
|
-
{
|
|
532
|
-
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
533
|
-
style: {
|
|
534
|
-
padding: "4px 8px",
|
|
535
|
-
backgroundColor: i === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
536
|
-
color: i === "Subscribed to you" ? "#008236" : "#78716C",
|
|
537
|
-
lineHeight: "133.333%",
|
|
538
|
-
letterSpacing: "0.21px"
|
|
539
|
-
},
|
|
540
|
-
children: i
|
|
541
|
-
}
|
|
542
|
-
)
|
|
543
|
-
] })
|
|
544
|
-
] }),
|
|
545
|
-
b && /* @__PURE__ */ n("div", { className: "w-full", children: b })
|
|
546
|
-
]
|
|
547
|
-
}
|
|
548
|
-
),
|
|
549
|
-
/* @__PURE__ */ h("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
550
|
-
d && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
551
|
-
Ce,
|
|
552
|
-
{
|
|
553
|
-
onClick: N,
|
|
554
|
-
disabled: k,
|
|
555
|
-
"aria-busy": k,
|
|
556
|
-
children: [
|
|
557
|
-
k ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(cs, { className: "h-5 w-5" }),
|
|
558
|
-
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
) }),
|
|
562
|
-
m && /* @__PURE__ */ n("li", { children: y ? /* @__PURE__ */ h(
|
|
563
|
-
Ce,
|
|
564
|
-
{
|
|
565
|
-
onClick: I,
|
|
566
|
-
disabled: D,
|
|
567
|
-
"aria-busy": D,
|
|
568
|
-
children: [
|
|
569
|
-
D ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
570
|
-
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
571
|
-
]
|
|
572
|
-
}
|
|
573
|
-
) : /* @__PURE__ */ h(
|
|
574
|
-
Ce,
|
|
575
|
-
{
|
|
576
|
-
onClick: E,
|
|
577
|
-
disabled: D,
|
|
578
|
-
"aria-busy": D,
|
|
579
|
-
children: [
|
|
580
|
-
D ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
581
|
-
/* @__PURE__ */ n("span", { children: "Block" })
|
|
582
|
-
]
|
|
583
|
-
}
|
|
584
|
-
) }),
|
|
585
|
-
g && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(Ce, { variant: "danger", onClick: B, children: [
|
|
586
|
-
/* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
|
|
587
|
-
/* @__PURE__ */ n("span", { children: "Report" })
|
|
588
|
-
] }) }),
|
|
589
|
-
_
|
|
535
|
+
id: v,
|
|
536
|
+
"aria-label": "Conversation options",
|
|
537
|
+
className: C(
|
|
538
|
+
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
539
|
+
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
540
|
+
),
|
|
541
|
+
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
542
|
+
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
543
|
+
he,
|
|
544
|
+
{
|
|
545
|
+
onClick: R,
|
|
546
|
+
disabled: T,
|
|
547
|
+
"aria-busy": T,
|
|
548
|
+
children: [
|
|
549
|
+
T ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(us, { className: "h-5 w-5" }),
|
|
550
|
+
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
) }),
|
|
554
|
+
a && /* @__PURE__ */ n("li", { children: x ? (
|
|
555
|
+
// Block status not yet resolved — show a disabled placeholder
|
|
556
|
+
// so a premature click can't act on a stale block state.
|
|
557
|
+
/* @__PURE__ */ h(he, { disabled: !0, "aria-busy": !0, children: [
|
|
558
|
+
/* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }),
|
|
559
|
+
/* @__PURE__ */ n("span", { children: "Block" })
|
|
590
560
|
] })
|
|
591
|
-
|
|
561
|
+
) : N ? /* @__PURE__ */ h(
|
|
562
|
+
he,
|
|
563
|
+
{
|
|
564
|
+
onClick: E,
|
|
565
|
+
disabled: S,
|
|
566
|
+
"aria-busy": S,
|
|
567
|
+
children: [
|
|
568
|
+
S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
|
|
569
|
+
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
) : /* @__PURE__ */ h(
|
|
573
|
+
he,
|
|
574
|
+
{
|
|
575
|
+
onClick: O,
|
|
576
|
+
disabled: S,
|
|
577
|
+
"aria-busy": S,
|
|
578
|
+
children: [
|
|
579
|
+
S ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(At, { className: "h-5 w-5" }),
|
|
580
|
+
/* @__PURE__ */ n("span", { children: "Block" })
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
) }),
|
|
584
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: A, children: [
|
|
585
|
+
/* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
|
|
586
|
+
/* @__PURE__ */ n("span", { children: "Report" })
|
|
587
|
+
] }) }),
|
|
588
|
+
b
|
|
592
589
|
] })
|
|
593
590
|
}
|
|
594
591
|
)
|
|
595
|
-
);
|
|
596
|
-
},
|
|
592
|
+
] });
|
|
593
|
+
}, Us = (e) => /* @__PURE__ */ n(Tn, { ...e, position: "center" }), je = "vote_up", Ve = "vote_down";
|
|
597
594
|
function js(e) {
|
|
598
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
595
|
+
return e != null && e.length ? e.some((t) => t.type === Ve) ? "down" : e.some((t) => t.type === je) ? "up" : null : null;
|
|
599
596
|
}
|
|
600
|
-
function
|
|
601
|
-
const { channel: t } =
|
|
597
|
+
function Vs(e) {
|
|
598
|
+
const { channel: t } = ce(), { client: s } = Ye("useMessageVote"), a = ee(
|
|
602
599
|
() => js(e.own_reactions),
|
|
603
600
|
[e.own_reactions]
|
|
604
601
|
), r = W(async () => {
|
|
605
602
|
if (s != null && s.userID)
|
|
606
603
|
try {
|
|
607
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
604
|
+
a === "up" ? await t.deleteReaction(e.id, je) : await t.sendReaction(
|
|
608
605
|
e.id,
|
|
609
|
-
{ type:
|
|
606
|
+
{ type: je },
|
|
610
607
|
{ enforce_unique: !0, skip_push: !0 }
|
|
611
608
|
);
|
|
612
609
|
} catch {
|
|
@@ -614,9 +611,9 @@ function Us(e) {
|
|
|
614
611
|
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = W(async () => {
|
|
615
612
|
if (s != null && s.userID)
|
|
616
613
|
try {
|
|
617
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
614
|
+
a === "down" ? await t.deleteReaction(e.id, Ve) : await t.sendReaction(
|
|
618
615
|
e.id,
|
|
619
|
-
{ type:
|
|
616
|
+
{ type: Ve },
|
|
620
617
|
{ enforce_unique: !0, skip_push: !0 }
|
|
621
618
|
);
|
|
622
619
|
} catch {
|
|
@@ -624,7 +621,7 @@ function Us(e) {
|
|
|
624
621
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
625
622
|
return { selected: a, voteUp: r, voteDown: i };
|
|
626
623
|
}
|
|
627
|
-
function
|
|
624
|
+
function Gs(e) {
|
|
628
625
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
629
626
|
}
|
|
630
627
|
function Xt({
|
|
@@ -632,16 +629,16 @@ function Xt({
|
|
|
632
629
|
viewerLanguage: t
|
|
633
630
|
}) {
|
|
634
631
|
var r;
|
|
635
|
-
const s = e == null ? void 0 : e.text, a =
|
|
632
|
+
const s = e == null ? void 0 : e.text, a = Gs(t);
|
|
636
633
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
637
634
|
}
|
|
638
|
-
const
|
|
635
|
+
const Hs = z.lazy(() => import("./Card-D_2VQScd.js")), Ys = z.lazy(() => import("./Card-D_G8133I.js")), qs = z.lazy(() => import("./Card-BAc2cgtn.js")), We = () => /* @__PURE__ */ n(
|
|
639
636
|
"div",
|
|
640
637
|
{
|
|
641
638
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
642
639
|
"aria-hidden": !0
|
|
643
640
|
}
|
|
644
|
-
),
|
|
641
|
+
), Ws = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Hs, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Ys, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Xs = Kt, Ks = Jt, Ot = { Composer: Ws, Sent: Kt, Received: Jt, Creator: Xs, Visitor: Ks }, Js = [
|
|
645
642
|
[/pdf/, "pdf"],
|
|
646
643
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
647
644
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -651,42 +648,42 @@ const Gs = z.lazy(() => import("./Card-DQYLHbDI.js")), Hs = z.lazy(() => import(
|
|
|
651
648
|
[/plain|rtf/, "text"],
|
|
652
649
|
[/markdown/, "markdown"]
|
|
653
650
|
];
|
|
654
|
-
function
|
|
651
|
+
function ne(e) {
|
|
655
652
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
656
653
|
}
|
|
657
654
|
function Zt(e) {
|
|
658
|
-
const t =
|
|
655
|
+
const t = Js.find(
|
|
659
656
|
([s]) => s.test(e)
|
|
660
657
|
);
|
|
661
658
|
return t ? t[1] : "generic";
|
|
662
659
|
}
|
|
663
|
-
const
|
|
664
|
-
video:
|
|
665
|
-
audio:
|
|
666
|
-
image:
|
|
667
|
-
document:
|
|
668
|
-
},
|
|
669
|
-
pdf:
|
|
670
|
-
doc:
|
|
671
|
-
xls:
|
|
672
|
-
csv:
|
|
673
|
-
ppt:
|
|
674
|
-
zip:
|
|
675
|
-
text:
|
|
676
|
-
markdown:
|
|
677
|
-
generic:
|
|
660
|
+
const Zs = {
|
|
661
|
+
video: Gt,
|
|
662
|
+
audio: hs,
|
|
663
|
+
image: ms,
|
|
664
|
+
document: Vt
|
|
665
|
+
}, Qs = {
|
|
666
|
+
pdf: Ns,
|
|
667
|
+
doc: ws,
|
|
668
|
+
xls: xs,
|
|
669
|
+
csv: vs,
|
|
670
|
+
ppt: ps,
|
|
671
|
+
zip: bs,
|
|
672
|
+
text: gs,
|
|
673
|
+
markdown: fs,
|
|
674
|
+
generic: Vt
|
|
678
675
|
};
|
|
679
|
-
function
|
|
680
|
-
const t =
|
|
681
|
-
return t !== "document" ?
|
|
676
|
+
function ea(e) {
|
|
677
|
+
const t = ne(e);
|
|
678
|
+
return t !== "document" ? Zs[t] : Qs[Zt(e)];
|
|
682
679
|
}
|
|
683
|
-
function
|
|
684
|
-
return z.createElement(
|
|
680
|
+
function le(e, t) {
|
|
681
|
+
return z.createElement(ea(e), t);
|
|
685
682
|
}
|
|
686
|
-
const
|
|
683
|
+
const ta = (e) => {
|
|
687
684
|
var t, s;
|
|
688
685
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
689
|
-
},
|
|
686
|
+
}, na = ({
|
|
690
687
|
source: e,
|
|
691
688
|
mimeType: t,
|
|
692
689
|
poster: s,
|
|
@@ -698,78 +695,78 @@ const ea = (e) => {
|
|
|
698
695
|
muted: d = !1,
|
|
699
696
|
onContainerClick: m
|
|
700
697
|
}) => {
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
}, []),
|
|
704
|
-
const
|
|
705
|
-
if (!
|
|
706
|
-
const
|
|
698
|
+
const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [v, p] = D(a), [N, x] = D(0), [T, S] = D(!1), [R, O] = D(!1), [E, A] = D(!1), [y, _] = D(!1), [I, L] = D(!0), [M, j] = D(null), V = W(() => {
|
|
699
|
+
A(!1), p(!0);
|
|
700
|
+
}, []), G = W((w) => {
|
|
701
|
+
const k = f.current;
|
|
702
|
+
if (!k) return 0;
|
|
703
|
+
const B = k.getBoundingClientRect();
|
|
707
704
|
return Math.max(
|
|
708
705
|
0,
|
|
709
|
-
Math.min(1, (
|
|
706
|
+
Math.min(1, (ta(w) - B.left) / B.width)
|
|
710
707
|
);
|
|
711
|
-
}, []),
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
}, []), F = (
|
|
715
|
-
|
|
716
|
-
const
|
|
717
|
-
|
|
708
|
+
}, []), $ = W((w) => {
|
|
709
|
+
const k = u.current;
|
|
710
|
+
k && k.duration && (k.currentTime = w * k.duration);
|
|
711
|
+
}, []), F = (w) => {
|
|
712
|
+
w.stopPropagation(), S(!0);
|
|
713
|
+
const k = G(w);
|
|
714
|
+
x(k), $(k);
|
|
718
715
|
};
|
|
719
|
-
|
|
720
|
-
r !== void 0 && r !==
|
|
721
|
-
}, [r]),
|
|
722
|
-
if (!
|
|
716
|
+
Y(() => {
|
|
717
|
+
r !== void 0 && r !== g.current && (g.current = r, p(r));
|
|
718
|
+
}, [r]), Y(() => {
|
|
719
|
+
if (!v) {
|
|
723
720
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
724
721
|
return;
|
|
725
722
|
}
|
|
726
|
-
const
|
|
727
|
-
const
|
|
728
|
-
|
|
723
|
+
const w = () => {
|
|
724
|
+
const k = u.current;
|
|
725
|
+
k && k.duration && !T && x(k.currentTime / k.duration), c.current = requestAnimationFrame(w);
|
|
729
726
|
};
|
|
730
|
-
return c.current = requestAnimationFrame(
|
|
727
|
+
return c.current = requestAnimationFrame(w), () => {
|
|
731
728
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
732
729
|
};
|
|
733
|
-
}, [
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}) :
|
|
738
|
-
}, [
|
|
739
|
-
if (!
|
|
740
|
-
const
|
|
741
|
-
|
|
730
|
+
}, [v, T]), Y(() => {
|
|
731
|
+
const w = u.current;
|
|
732
|
+
w && (v ? w.play().catch((k) => {
|
|
733
|
+
p(!1), A(!0);
|
|
734
|
+
}) : w.pause());
|
|
735
|
+
}, [v]), Y(() => {
|
|
736
|
+
if (!T) return;
|
|
737
|
+
const w = (B) => x(G(B)), k = (B) => {
|
|
738
|
+
S(!1), $(G(B));
|
|
742
739
|
};
|
|
743
|
-
return window.addEventListener("mousemove",
|
|
744
|
-
window.removeEventListener("mousemove",
|
|
740
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", k), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", k), () => {
|
|
741
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", k);
|
|
745
742
|
};
|
|
746
|
-
}, [
|
|
747
|
-
const
|
|
743
|
+
}, [T, G, $]);
|
|
744
|
+
const X = M ? { aspectRatio: String(M) } : void 0, U = M ? "" : " aspect-video", P = Math.round(N * 100);
|
|
748
745
|
return /* @__PURE__ */ h(
|
|
749
746
|
"div",
|
|
750
747
|
{
|
|
751
748
|
role: "button",
|
|
752
749
|
tabIndex: 0,
|
|
753
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
754
|
-
style:
|
|
755
|
-
onClick: (
|
|
750
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${U}`,
|
|
751
|
+
style: X,
|
|
752
|
+
onClick: (w) => {
|
|
756
753
|
if (m) {
|
|
757
|
-
m(
|
|
754
|
+
m(w);
|
|
758
755
|
return;
|
|
759
756
|
}
|
|
760
|
-
|
|
757
|
+
E || o && p((k) => !k);
|
|
761
758
|
},
|
|
762
|
-
onKeyDown: (
|
|
763
|
-
if (!(
|
|
764
|
-
if (
|
|
765
|
-
m(
|
|
759
|
+
onKeyDown: (w) => {
|
|
760
|
+
if (!(w.key !== "Enter" && w.key !== " ")) {
|
|
761
|
+
if (w.preventDefault(), m) {
|
|
762
|
+
m(w);
|
|
766
763
|
return;
|
|
767
764
|
}
|
|
768
|
-
|
|
765
|
+
E || o && p((k) => !k);
|
|
769
766
|
}
|
|
770
767
|
},
|
|
771
768
|
children: [
|
|
772
|
-
s && (
|
|
769
|
+
s && (b === "audio" || I) && /* @__PURE__ */ n(
|
|
773
770
|
"img",
|
|
774
771
|
{
|
|
775
772
|
src: s,
|
|
@@ -777,11 +774,11 @@ const ea = (e) => {
|
|
|
777
774
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
778
775
|
}
|
|
779
776
|
),
|
|
780
|
-
!s && (
|
|
777
|
+
!s && (b === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
|
|
781
778
|
className: "size-12 text-black/20",
|
|
782
779
|
weight: "regular"
|
|
783
780
|
}) }),
|
|
784
|
-
/* @__PURE__ */ n("div", { className: "absolute inset-0", children:
|
|
781
|
+
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: b === "audio" ? /* @__PURE__ */ n(
|
|
785
782
|
"audio",
|
|
786
783
|
{
|
|
787
784
|
ref: u,
|
|
@@ -789,14 +786,14 @@ const ea = (e) => {
|
|
|
789
786
|
loop: i,
|
|
790
787
|
muted: d,
|
|
791
788
|
style: { width: "100%", height: "100%" },
|
|
792
|
-
onLoadStart: () =>
|
|
789
|
+
onLoadStart: () => _(!0),
|
|
793
790
|
onCanPlay: () => {
|
|
794
|
-
|
|
791
|
+
_(!1), L(!1);
|
|
795
792
|
},
|
|
796
|
-
onWaiting: () =>
|
|
797
|
-
onPlay: () =>
|
|
793
|
+
onWaiting: () => _(!0),
|
|
794
|
+
onPlay: () => A(!1),
|
|
798
795
|
onEnded: () => {
|
|
799
|
-
i || (
|
|
796
|
+
i || (p(!1), x(0));
|
|
800
797
|
},
|
|
801
798
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
802
799
|
}
|
|
@@ -809,43 +806,43 @@ const ea = (e) => {
|
|
|
809
806
|
muted: d,
|
|
810
807
|
playsInline: !0,
|
|
811
808
|
style: { width: "100%", height: "100%" },
|
|
812
|
-
onLoadStart: () =>
|
|
809
|
+
onLoadStart: () => _(!0),
|
|
813
810
|
onCanPlay: () => {
|
|
814
|
-
|
|
811
|
+
_(!1), L(!1);
|
|
815
812
|
},
|
|
816
|
-
onWaiting: () =>
|
|
817
|
-
onPlay: () =>
|
|
813
|
+
onWaiting: () => _(!0),
|
|
814
|
+
onPlay: () => A(!1),
|
|
818
815
|
onLoadedMetadata: () => {
|
|
819
|
-
const
|
|
820
|
-
|
|
816
|
+
const w = u.current;
|
|
817
|
+
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && j(w.videoWidth / w.videoHeight);
|
|
821
818
|
},
|
|
822
819
|
onEnded: () => {
|
|
823
|
-
i || (
|
|
820
|
+
i || (p(!1), x(0));
|
|
824
821
|
},
|
|
825
822
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
826
823
|
}
|
|
827
824
|
) }),
|
|
828
|
-
|
|
825
|
+
y && !E && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
829
826
|
ge,
|
|
830
827
|
{
|
|
831
828
|
className: "size-8 animate-spin text-white/80",
|
|
832
829
|
weight: "bold"
|
|
833
830
|
}
|
|
834
831
|
) }),
|
|
835
|
-
|
|
832
|
+
E && !o && /* @__PURE__ */ n(
|
|
836
833
|
"div",
|
|
837
834
|
{
|
|
838
835
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
839
836
|
role: "button",
|
|
840
837
|
tabIndex: 0,
|
|
841
838
|
"aria-label": "Play preview",
|
|
842
|
-
onClick: (
|
|
843
|
-
|
|
839
|
+
onClick: (w) => {
|
|
840
|
+
w.stopPropagation(), V();
|
|
844
841
|
},
|
|
845
|
-
onKeyDown: (
|
|
846
|
-
|
|
842
|
+
onKeyDown: (w) => {
|
|
843
|
+
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), V());
|
|
847
844
|
},
|
|
848
|
-
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(
|
|
845
|
+
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
849
846
|
}
|
|
850
847
|
),
|
|
851
848
|
l && !o && /* @__PURE__ */ n("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__ */ n(
|
|
@@ -853,7 +850,7 @@ const ea = (e) => {
|
|
|
853
850
|
{
|
|
854
851
|
role: "slider",
|
|
855
852
|
"aria-label": "Playback position",
|
|
856
|
-
"aria-valuenow":
|
|
853
|
+
"aria-valuenow": P,
|
|
857
854
|
"aria-valuemin": 0,
|
|
858
855
|
"aria-valuemax": 100,
|
|
859
856
|
tabIndex: 0,
|
|
@@ -861,15 +858,15 @@ const ea = (e) => {
|
|
|
861
858
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
862
859
|
onMouseDown: F,
|
|
863
860
|
onTouchStart: F,
|
|
864
|
-
onClick: (
|
|
865
|
-
onKeyDown: (
|
|
866
|
-
|
|
861
|
+
onClick: (w) => w.stopPropagation(),
|
|
862
|
+
onKeyDown: (w) => {
|
|
863
|
+
w.key === "ArrowRight" && $(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, N - 0.05));
|
|
867
864
|
},
|
|
868
865
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
869
866
|
"div",
|
|
870
867
|
{
|
|
871
868
|
className: "h-full rounded-full bg-white",
|
|
872
|
-
style: { width: `${
|
|
869
|
+
style: { width: `${P}%` }
|
|
873
870
|
}
|
|
874
871
|
) })
|
|
875
872
|
}
|
|
@@ -879,12 +876,12 @@ const ea = (e) => {
|
|
|
879
876
|
"button",
|
|
880
877
|
{
|
|
881
878
|
type: "button",
|
|
882
|
-
onClick: (
|
|
883
|
-
|
|
879
|
+
onClick: (w) => {
|
|
880
|
+
w.stopPropagation(), p((k) => !k);
|
|
884
881
|
},
|
|
885
882
|
className: "shrink-0 text-white",
|
|
886
|
-
"aria-label":
|
|
887
|
-
children:
|
|
883
|
+
"aria-label": v ? "Pause" : "Play",
|
|
884
|
+
children: v ? /* @__PURE__ */ n(_s, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Be, { className: "size-5 translate-x-px", weight: "fill" })
|
|
888
885
|
}
|
|
889
886
|
),
|
|
890
887
|
/* @__PURE__ */ h(
|
|
@@ -892,7 +889,7 @@ const ea = (e) => {
|
|
|
892
889
|
{
|
|
893
890
|
role: "slider",
|
|
894
891
|
"aria-label": "Playback position",
|
|
895
|
-
"aria-valuenow":
|
|
892
|
+
"aria-valuenow": P,
|
|
896
893
|
"aria-valuemin": 0,
|
|
897
894
|
"aria-valuemax": 100,
|
|
898
895
|
tabIndex: 0,
|
|
@@ -900,22 +897,22 @@ const ea = (e) => {
|
|
|
900
897
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
901
898
|
onMouseDown: F,
|
|
902
899
|
onTouchStart: F,
|
|
903
|
-
onClick: (
|
|
904
|
-
onMouseEnter: () =>
|
|
905
|
-
onMouseLeave: () =>
|
|
906
|
-
onKeyDown: (
|
|
907
|
-
|
|
900
|
+
onClick: (w) => w.stopPropagation(),
|
|
901
|
+
onMouseEnter: () => O(!0),
|
|
902
|
+
onMouseLeave: () => O(!1),
|
|
903
|
+
onKeyDown: (w) => {
|
|
904
|
+
w.key === "ArrowRight" && $(Math.min(1, N + 0.05)), w.key === "ArrowLeft" && $(Math.max(0, N - 0.05));
|
|
908
905
|
},
|
|
909
906
|
children: [
|
|
910
907
|
/* @__PURE__ */ n(
|
|
911
908
|
"div",
|
|
912
909
|
{
|
|
913
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
910
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${R || T ? "h-1.5" : "h-1"}`,
|
|
914
911
|
children: /* @__PURE__ */ n(
|
|
915
912
|
"div",
|
|
916
913
|
{
|
|
917
914
|
className: "h-full rounded-full bg-white",
|
|
918
|
-
style: { width: `${
|
|
915
|
+
style: { width: `${P}%` }
|
|
919
916
|
}
|
|
920
917
|
)
|
|
921
918
|
}
|
|
@@ -923,8 +920,8 @@ const ea = (e) => {
|
|
|
923
920
|
/* @__PURE__ */ n(
|
|
924
921
|
"div",
|
|
925
922
|
{
|
|
926
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
927
|
-
style: { left: `${
|
|
923
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${R || T ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
924
|
+
style: { left: `${P}%` }
|
|
928
925
|
}
|
|
929
926
|
)
|
|
930
927
|
]
|
|
@@ -934,7 +931,7 @@ const ea = (e) => {
|
|
|
934
931
|
]
|
|
935
932
|
}
|
|
936
933
|
);
|
|
937
|
-
},
|
|
934
|
+
}, zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", sa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Qt = ({
|
|
938
935
|
mimeType: e,
|
|
939
936
|
sourceUrl: t,
|
|
940
937
|
thumbnailUrl: s,
|
|
@@ -943,9 +940,9 @@ const ea = (e) => {
|
|
|
943
940
|
mediaPlayerProps: i,
|
|
944
941
|
containedImage: o = !1
|
|
945
942
|
}) => {
|
|
946
|
-
const l =
|
|
943
|
+
const l = ne(e), [d, m] = D(!1);
|
|
947
944
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
948
|
-
|
|
945
|
+
na,
|
|
949
946
|
{
|
|
950
947
|
source: t,
|
|
951
948
|
mimeType: e,
|
|
@@ -991,12 +988,12 @@ const ea = (e) => {
|
|
|
991
988
|
"div",
|
|
992
989
|
{
|
|
993
990
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
994
|
-
children:
|
|
995
|
-
className:
|
|
991
|
+
children: le(e, {
|
|
992
|
+
className: zt(r),
|
|
996
993
|
weight: "regular"
|
|
997
994
|
})
|
|
998
995
|
}
|
|
999
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
996
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${sa(r)}`, children: /* @__PURE__ */ n(
|
|
1000
997
|
"img",
|
|
1001
998
|
{
|
|
1002
999
|
src: s,
|
|
@@ -1008,8 +1005,8 @@ const ea = (e) => {
|
|
|
1008
1005
|
"div",
|
|
1009
1006
|
{
|
|
1010
1007
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1011
|
-
children:
|
|
1012
|
-
className:
|
|
1008
|
+
children: le(e, {
|
|
1009
|
+
className: zt(r),
|
|
1013
1010
|
weight: "regular"
|
|
1014
1011
|
})
|
|
1015
1012
|
}
|
|
@@ -1025,14 +1022,14 @@ const ea = (e) => {
|
|
|
1025
1022
|
action: l,
|
|
1026
1023
|
topLeft: d,
|
|
1027
1024
|
topRight: m,
|
|
1028
|
-
rootRef:
|
|
1025
|
+
rootRef: b,
|
|
1029
1026
|
"data-testid": u
|
|
1030
1027
|
}) => {
|
|
1031
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1028
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", g = f && !s;
|
|
1032
1029
|
return /* @__PURE__ */ h(
|
|
1033
1030
|
"div",
|
|
1034
1031
|
{
|
|
1035
|
-
ref:
|
|
1032
|
+
ref: b,
|
|
1036
1033
|
"data-testid": u,
|
|
1037
1034
|
className: C(
|
|
1038
1035
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
@@ -1048,14 +1045,14 @@ const ea = (e) => {
|
|
|
1048
1045
|
{
|
|
1049
1046
|
className: C("mb-0.5 truncate text-base font-medium", {
|
|
1050
1047
|
"text-black": !f,
|
|
1051
|
-
"text-white/30": f &&
|
|
1052
|
-
"text-white": f && !
|
|
1048
|
+
"text-white/30": f && g,
|
|
1049
|
+
"text-white": f && !g
|
|
1053
1050
|
}),
|
|
1054
1051
|
children: c
|
|
1055
1052
|
}
|
|
1056
1053
|
),
|
|
1057
1054
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1058
|
-
|
|
1055
|
+
le(r, {
|
|
1059
1056
|
className: C(
|
|
1060
1057
|
"size-5 shrink-0",
|
|
1061
1058
|
f ? "text-white/55" : "text-black/55"
|
|
@@ -1083,25 +1080,25 @@ const ea = (e) => {
|
|
|
1083
1080
|
function tn(e) {
|
|
1084
1081
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1085
1082
|
}
|
|
1086
|
-
function
|
|
1083
|
+
function Xe(e) {
|
|
1087
1084
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1088
1085
|
}
|
|
1089
|
-
function
|
|
1086
|
+
function aa(e) {
|
|
1090
1087
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1091
1088
|
}
|
|
1092
|
-
function
|
|
1089
|
+
function ra(e) {
|
|
1093
1090
|
return e ? "text-white" : "text-black";
|
|
1094
1091
|
}
|
|
1095
|
-
function
|
|
1092
|
+
function ia(e) {
|
|
1096
1093
|
return e ? "text-white/55" : "text-black/55";
|
|
1097
1094
|
}
|
|
1098
|
-
function
|
|
1095
|
+
function oa(e) {
|
|
1099
1096
|
return e ? "text-white/40" : "text-black/40";
|
|
1100
1097
|
}
|
|
1101
|
-
function
|
|
1098
|
+
function la(e) {
|
|
1102
1099
|
return e ? "text-white/20" : "text-black/20";
|
|
1103
1100
|
}
|
|
1104
|
-
const
|
|
1101
|
+
const Ke = ({ attachment: e, isMyMessage: t }) => {
|
|
1105
1102
|
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(z.Fragment, { children: [
|
|
1106
1103
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1107
1104
|
"img",
|
|
@@ -1113,14 +1110,14 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1113
1110
|
) : /* @__PURE__ */ n(
|
|
1114
1111
|
"div",
|
|
1115
1112
|
{
|
|
1116
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1117
|
-
children: /* @__PURE__ */ n(
|
|
1113
|
+
className: `aspect-video w-full rounded-[20px] ${aa(t)} flex items-center justify-center`,
|
|
1114
|
+
children: /* @__PURE__ */ n(ys, { className: `size-12 ${la(t)}` })
|
|
1118
1115
|
}
|
|
1119
1116
|
) }),
|
|
1120
1117
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1121
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1122
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1123
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1118
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${ra(t)}`, children: s }),
|
|
1119
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${ia(t)}`, children: a }),
|
|
1120
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${oa(t)}`, children: d })
|
|
1124
1121
|
] })
|
|
1125
1122
|
] });
|
|
1126
1123
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
|
|
@@ -1128,11 +1125,11 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1128
1125
|
function nn(e) {
|
|
1129
1126
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1130
1127
|
}
|
|
1131
|
-
function
|
|
1128
|
+
function Je(e) {
|
|
1132
1129
|
var t;
|
|
1133
1130
|
return (t = e.attachments) == null ? void 0 : t.find(nn);
|
|
1134
1131
|
}
|
|
1135
|
-
async function
|
|
1132
|
+
async function ca(e, t) {
|
|
1136
1133
|
let s;
|
|
1137
1134
|
try {
|
|
1138
1135
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1144,11 +1141,11 @@ async function la(e, t) {
|
|
|
1144
1141
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1145
1142
|
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1146
1143
|
}
|
|
1147
|
-
const
|
|
1144
|
+
const da = ({
|
|
1148
1145
|
url: e,
|
|
1149
1146
|
filename: t
|
|
1150
1147
|
}) => {
|
|
1151
|
-
const [s, a] =
|
|
1148
|
+
const [s, a] = D(!1);
|
|
1152
1149
|
return /* @__PURE__ */ n(
|
|
1153
1150
|
"button",
|
|
1154
1151
|
{
|
|
@@ -1156,7 +1153,7 @@ const ca = ({
|
|
|
1156
1153
|
onClick: (i) => {
|
|
1157
1154
|
i.stopPropagation();
|
|
1158
1155
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1159
|
-
a(!0),
|
|
1156
|
+
a(!0), ca(e, t).then(() => {
|
|
1160
1157
|
o == null || o.close();
|
|
1161
1158
|
}).catch(() => {
|
|
1162
1159
|
o && (o.location.href = e);
|
|
@@ -1171,25 +1168,25 @@ const ca = ({
|
|
|
1171
1168
|
}
|
|
1172
1169
|
);
|
|
1173
1170
|
};
|
|
1174
|
-
function
|
|
1175
|
-
var u, f, c,
|
|
1171
|
+
function Ze(e) {
|
|
1172
|
+
var u, f, c, g;
|
|
1176
1173
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1177
|
-
(
|
|
1174
|
+
(v) => v.type === "video" && v.asset_url
|
|
1178
1175
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1179
|
-
(
|
|
1176
|
+
(v) => v.type === "image" && v.image_url
|
|
1180
1177
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1181
|
-
(
|
|
1182
|
-
), r = (
|
|
1183
|
-
(
|
|
1178
|
+
(v) => v.type === "audio" && v.asset_url
|
|
1179
|
+
), r = (g = e.attachments) == null ? void 0 : g.find(
|
|
1180
|
+
(v) => v.type === "file" && v.asset_url
|
|
1184
1181
|
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1185
1182
|
if (!o) return null;
|
|
1186
|
-
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size,
|
|
1183
|
+
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, b = t == null ? void 0 : t.thumb_url;
|
|
1187
1184
|
return {
|
|
1188
1185
|
resolvedUrl: o,
|
|
1189
1186
|
resolvedType: l,
|
|
1190
1187
|
title: d,
|
|
1191
1188
|
fileSize: m,
|
|
1192
|
-
thumbnailUrl:
|
|
1189
|
+
thumbnailUrl: b
|
|
1193
1190
|
};
|
|
1194
1191
|
}
|
|
1195
1192
|
const sn = ({
|
|
@@ -1227,7 +1224,7 @@ const sn = ({
|
|
|
1227
1224
|
fileSize: a,
|
|
1228
1225
|
thumbnailUrl: r
|
|
1229
1226
|
}) => {
|
|
1230
|
-
const i =
|
|
1227
|
+
const i = ne(t), o = a !== void 0 ? tn(a) : void 0;
|
|
1231
1228
|
return /* @__PURE__ */ n(
|
|
1232
1229
|
en,
|
|
1233
1230
|
{
|
|
@@ -1246,17 +1243,17 @@ const sn = ({
|
|
|
1246
1243
|
containedImage: i === "image" || i === "document"
|
|
1247
1244
|
}
|
|
1248
1245
|
),
|
|
1249
|
-
action: /* @__PURE__ */ n(
|
|
1246
|
+
action: /* @__PURE__ */ n(da, { url: e, filename: s })
|
|
1250
1247
|
}
|
|
1251
1248
|
);
|
|
1252
|
-
},
|
|
1249
|
+
}, ua = ({
|
|
1253
1250
|
message: e,
|
|
1254
1251
|
isMyMessage: t = !1
|
|
1255
1252
|
}) => {
|
|
1256
|
-
const s =
|
|
1253
|
+
const s = Je(e), a = Ze(e);
|
|
1257
1254
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "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", children: [
|
|
1258
1255
|
!t && e.user && /* @__PURE__ */ n(
|
|
1259
|
-
|
|
1256
|
+
ae,
|
|
1260
1257
|
{
|
|
1261
1258
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1262
1259
|
id: e.user.id,
|
|
@@ -1274,40 +1271,40 @@ const sn = ({
|
|
|
1274
1271
|
{
|
|
1275
1272
|
className: "str-chat__message-bubble",
|
|
1276
1273
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1277
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1274
|
+
children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(Ke, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
|
|
1278
1275
|
}
|
|
1279
1276
|
) })
|
|
1280
1277
|
}
|
|
1281
1278
|
)
|
|
1282
1279
|
] });
|
|
1283
|
-
},
|
|
1280
|
+
}, ma = ({
|
|
1284
1281
|
message: e
|
|
1285
1282
|
}) => {
|
|
1286
|
-
const t =
|
|
1283
|
+
const t = Je(e);
|
|
1287
1284
|
if (t)
|
|
1288
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1289
|
-
const s =
|
|
1285
|
+
return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !0 }) });
|
|
1286
|
+
const s = Ze(e);
|
|
1290
1287
|
return s ? /* @__PURE__ */ n(sn, { ...s }) : null;
|
|
1291
|
-
},
|
|
1288
|
+
}, ha = ({
|
|
1292
1289
|
message: e
|
|
1293
1290
|
}) => {
|
|
1294
|
-
const t =
|
|
1291
|
+
const t = Je(e);
|
|
1295
1292
|
if (t)
|
|
1296
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1297
|
-
const s =
|
|
1293
|
+
return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(Ke, { attachment: t, isMyMessage: !1 }) });
|
|
1294
|
+
const s = Ze(e);
|
|
1298
1295
|
return s ? /* @__PURE__ */ n(an, { ...s }) : null;
|
|
1299
|
-
},
|
|
1300
|
-
Creator:
|
|
1301
|
-
Visitor:
|
|
1302
|
-
}),
|
|
1296
|
+
}, Ni = Object.assign(ua, {
|
|
1297
|
+
Creator: ma,
|
|
1298
|
+
Visitor: ha
|
|
1299
|
+
}), fa = {
|
|
1303
1300
|
isUnlocking: () => !1
|
|
1304
|
-
},
|
|
1305
|
-
LockedAttachment:
|
|
1306
|
-
}, rn =
|
|
1307
|
-
function
|
|
1308
|
-
return Te(rn)[e] ??
|
|
1301
|
+
}, ga = {
|
|
1302
|
+
LockedAttachment: fa
|
|
1303
|
+
}, rn = Ge({}), _i = rn.Provider;
|
|
1304
|
+
function ba(e) {
|
|
1305
|
+
return Te(rn)[e] ?? ga[e];
|
|
1309
1306
|
}
|
|
1310
|
-
const
|
|
1307
|
+
const pa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1311
1308
|
"svg",
|
|
1312
1309
|
{
|
|
1313
1310
|
width: e,
|
|
@@ -1324,22 +1321,22 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1324
1321
|
}
|
|
1325
1322
|
)
|
|
1326
1323
|
}
|
|
1327
|
-
),
|
|
1324
|
+
), va = (e) => {
|
|
1328
1325
|
var t;
|
|
1329
1326
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1330
|
-
},
|
|
1327
|
+
}, xa = (e) => {
|
|
1331
1328
|
var t;
|
|
1332
1329
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1333
1330
|
}, ke = (e) => {
|
|
1334
1331
|
var t;
|
|
1335
1332
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1336
|
-
},
|
|
1333
|
+
}, wa = (e) => {
|
|
1337
1334
|
var t;
|
|
1338
1335
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1339
|
-
}, on = (e) =>
|
|
1336
|
+
}, on = (e) => va(e) || xa(e), Na = (e) => {
|
|
1340
1337
|
var t;
|
|
1341
1338
|
return on(e) && !((t = e.text) != null && t.trim());
|
|
1342
|
-
},
|
|
1339
|
+
}, Pe = ({
|
|
1343
1340
|
message: e,
|
|
1344
1341
|
standalone: t = !1,
|
|
1345
1342
|
isMyMessage: s = !1,
|
|
@@ -1352,25 +1349,25 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1352
1349
|
if (r) {
|
|
1353
1350
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1354
1351
|
if (!f) return null;
|
|
1355
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1352
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", g = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1356
1353
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1357
|
-
/* @__PURE__ */ n(
|
|
1358
|
-
/* @__PURE__ */ n("span", { children:
|
|
1354
|
+
/* @__PURE__ */ n(Cs, { size: t ? 14 : 12 }),
|
|
1355
|
+
/* @__PURE__ */ n("span", { children: g })
|
|
1359
1356
|
] });
|
|
1360
1357
|
}
|
|
1361
1358
|
const o = s && a, l = o ? "Sent with AI" : "Sent with DM Agent", d = [
|
|
1362
1359
|
"message-chatbot-indicator",
|
|
1363
1360
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1364
1361
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1365
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }),
|
|
1366
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(
|
|
1362
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), b = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(pa, { size: o ? 12 : 15 }) });
|
|
1363
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(te, { children: [
|
|
1367
1364
|
m,
|
|
1368
|
-
|
|
1369
|
-
] }) : /* @__PURE__ */ h(
|
|
1370
|
-
|
|
1365
|
+
b
|
|
1366
|
+
] }) : /* @__PURE__ */ h(te, { children: [
|
|
1367
|
+
b,
|
|
1371
1368
|
m
|
|
1372
1369
|
] }) });
|
|
1373
|
-
},
|
|
1370
|
+
}, _a = ({
|
|
1374
1371
|
selected: e,
|
|
1375
1372
|
onVoteUp: t,
|
|
1376
1373
|
onVoteDown: s
|
|
@@ -1386,7 +1383,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1386
1383
|
"aria-label": "Good response",
|
|
1387
1384
|
"aria-pressed": e === "up",
|
|
1388
1385
|
"data-tooltip": "Good response",
|
|
1389
|
-
children: /* @__PURE__ */ n(
|
|
1386
|
+
children: /* @__PURE__ */ n(ks, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1390
1387
|
}
|
|
1391
1388
|
),
|
|
1392
1389
|
/* @__PURE__ */ n(
|
|
@@ -1400,11 +1397,11 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1400
1397
|
"aria-label": "Bad response",
|
|
1401
1398
|
"aria-pressed": e === "down",
|
|
1402
1399
|
"data-tooltip": "Bad response",
|
|
1403
|
-
children: /* @__PURE__ */ n(
|
|
1400
|
+
children: /* @__PURE__ */ n(Es, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1404
1401
|
}
|
|
1405
1402
|
)
|
|
1406
|
-
] }),
|
|
1407
|
-
var ft, gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et
|
|
1403
|
+
] }), ya = (e) => {
|
|
1404
|
+
var ht, ft, gt, bt, pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et;
|
|
1408
1405
|
const {
|
|
1409
1406
|
additionalMessageInputProps: t,
|
|
1410
1407
|
chatbotVotingEnabled: s,
|
|
@@ -1415,77 +1412,77 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1415
1412
|
handleAction: l,
|
|
1416
1413
|
handleOpenThread: d,
|
|
1417
1414
|
handleRetry: m,
|
|
1418
|
-
highlighted:
|
|
1415
|
+
highlighted: b,
|
|
1419
1416
|
isMessageAIGenerated: u,
|
|
1420
1417
|
isMyMessage: f,
|
|
1421
1418
|
message: c,
|
|
1422
|
-
renderText:
|
|
1423
|
-
threadList:
|
|
1424
|
-
viewerLanguage:
|
|
1425
|
-
} = e, { client:
|
|
1426
|
-
Attachment:
|
|
1427
|
-
EditMessageModal:
|
|
1428
|
-
MessageActions:
|
|
1429
|
-
MessageBlocked:
|
|
1430
|
-
MessageBouncePrompt:
|
|
1431
|
-
MessageDeleted: F =
|
|
1432
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1433
|
-
MessageRepliesCountButton:
|
|
1434
|
-
ReminderNotification:
|
|
1435
|
-
StreamedMessageText:
|
|
1436
|
-
PinIndicator:
|
|
1437
|
-
} = Ut("CustomMessage"),
|
|
1419
|
+
renderText: g,
|
|
1420
|
+
threadList: v,
|
|
1421
|
+
viewerLanguage: p
|
|
1422
|
+
} = e, { client: N } = Ye("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking: T, onUnlockClick: S, onFetchSource: R, onDownloadClick: O } = ba("LockedAttachment"), [E, A] = D(!1), y = Mn(c.id), { selected: _, voteUp: I, voteDown: L } = Vs(c), {
|
|
1423
|
+
Attachment: M = Rn,
|
|
1424
|
+
EditMessageModal: j = Ln,
|
|
1425
|
+
MessageActions: V,
|
|
1426
|
+
MessageBlocked: G = Dn,
|
|
1427
|
+
MessageBouncePrompt: $ = Pn,
|
|
1428
|
+
MessageDeleted: F = On,
|
|
1429
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = zn,
|
|
1430
|
+
MessageRepliesCountButton: U = $n,
|
|
1431
|
+
ReminderNotification: P = Fn,
|
|
1432
|
+
StreamedMessageText: w = Bn,
|
|
1433
|
+
PinIndicator: k
|
|
1434
|
+
} = Ut("CustomMessage"), B = Un(c), q = jn(c), _e = ee(
|
|
1438
1435
|
() => u == null ? void 0 : u(c),
|
|
1439
1436
|
[u, c]
|
|
1440
|
-
),
|
|
1441
|
-
const
|
|
1437
|
+
), K = ee(() => {
|
|
1438
|
+
const me = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...me] : me;
|
|
1442
1439
|
if (!ke(c)) return ye;
|
|
1443
|
-
const St = ye.filter((
|
|
1440
|
+
const St = ye.filter((It) => !("type" in It) || !nn(It));
|
|
1444
1441
|
return St.length === ye.length ? ye : St;
|
|
1445
|
-
}, [c]),
|
|
1446
|
-
const
|
|
1447
|
-
return
|
|
1448
|
-
}, [c,
|
|
1449
|
-
if (
|
|
1442
|
+
}, [c]), re = ee(() => {
|
|
1443
|
+
const me = Xt({ message: c, viewerLanguage: p });
|
|
1444
|
+
return me === c.text ? c : { ...c, text: me };
|
|
1445
|
+
}, [c, p]);
|
|
1446
|
+
if (Vn(c))
|
|
1450
1447
|
return null;
|
|
1451
1448
|
if (c.deleted_at || c.type === "deleted")
|
|
1452
1449
|
return /* @__PURE__ */ n(F, { message: c });
|
|
1453
|
-
if (
|
|
1454
|
-
return /* @__PURE__ */ n(
|
|
1455
|
-
const
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
const
|
|
1450
|
+
if (Gn(c))
|
|
1451
|
+
return /* @__PURE__ */ n(G, {});
|
|
1452
|
+
const J = !v && !!c.reply_count, se = !v && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Hn(c);
|
|
1453
|
+
let ie;
|
|
1454
|
+
Q ? ie = () => m(c) : lt && (ie = () => A(!0));
|
|
1455
|
+
const de = f(), kn = C(
|
|
1459
1456
|
"str-chat__message str-chat__message-simple",
|
|
1460
1457
|
`str-chat__message--${c.type}`,
|
|
1461
1458
|
`str-chat__message--${c.status}`,
|
|
1462
|
-
|
|
1459
|
+
de ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1463
1460
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1464
1461
|
{
|
|
1465
|
-
"str-chat__message--has-attachment":
|
|
1466
|
-
"str-chat__message--highlighted":
|
|
1462
|
+
"str-chat__message--has-attachment": B,
|
|
1463
|
+
"str-chat__message--highlighted": b,
|
|
1467
1464
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1468
|
-
"str-chat__message--with-reactions":
|
|
1469
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1470
|
-
"str-chat__message-with-thread-link":
|
|
1465
|
+
"str-chat__message--with-reactions": q,
|
|
1466
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((ft = c == null ? void 0 : c.error) == null ? void 0 : ft.status) !== 403,
|
|
1467
|
+
"str-chat__message-with-thread-link": J || se,
|
|
1471
1468
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1472
1469
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1473
1470
|
"str-chat__virtual-message__wrapper--group": o
|
|
1474
1471
|
}
|
|
1475
|
-
),
|
|
1476
|
-
return /* @__PURE__ */ h(
|
|
1472
|
+
), ct = c.poll_id && N.polls.fromState(c.poll_id), dt = Na(c), ue = ke(c), ut = wa(c), Re = !!(K != null && K.length && !c.quoted_message), mt = ue && de && Re;
|
|
1473
|
+
return /* @__PURE__ */ h(te, { children: [
|
|
1477
1474
|
a && /* @__PURE__ */ n(
|
|
1478
|
-
|
|
1475
|
+
j,
|
|
1479
1476
|
{
|
|
1480
1477
|
additionalMessageInputProps: t
|
|
1481
1478
|
}
|
|
1482
1479
|
),
|
|
1483
|
-
|
|
1484
|
-
|
|
1480
|
+
E && /* @__PURE__ */ n(
|
|
1481
|
+
Yn,
|
|
1485
1482
|
{
|
|
1486
|
-
MessageBouncePrompt:
|
|
1487
|
-
onClose: () =>
|
|
1488
|
-
open:
|
|
1483
|
+
MessageBouncePrompt: $,
|
|
1484
|
+
onClose: () => A(!1),
|
|
1485
|
+
open: E
|
|
1489
1486
|
}
|
|
1490
1487
|
),
|
|
1491
1488
|
/* @__PURE__ */ h(
|
|
@@ -1494,10 +1491,10 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1494
1491
|
className: kn,
|
|
1495
1492
|
"data-message-id": c.id,
|
|
1496
1493
|
children: [
|
|
1497
|
-
|
|
1498
|
-
!!
|
|
1494
|
+
k && /* @__PURE__ */ n(k, {}),
|
|
1495
|
+
!!y && /* @__PURE__ */ n(P, { reminder: y }),
|
|
1499
1496
|
c.user && /* @__PURE__ */ n(
|
|
1500
|
-
|
|
1497
|
+
ae,
|
|
1501
1498
|
{
|
|
1502
1499
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1503
1500
|
id: c.user.id,
|
|
@@ -1505,183 +1502,183 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1505
1502
|
name: c.user.name || c.user.id,
|
|
1506
1503
|
size: 24,
|
|
1507
1504
|
shape: "circle",
|
|
1508
|
-
dmAgentEnabled:
|
|
1505
|
+
dmAgentEnabled: ue
|
|
1509
1506
|
}
|
|
1510
1507
|
),
|
|
1511
1508
|
/* @__PURE__ */ n(
|
|
1512
1509
|
"div",
|
|
1513
1510
|
{
|
|
1514
1511
|
className: C("str-chat__message-inner", {
|
|
1515
|
-
"str-chat__simple-message--error-failed":
|
|
1512
|
+
"str-chat__simple-message--error-failed": Q || lt
|
|
1516
1513
|
}),
|
|
1517
1514
|
"data-testid": "message-inner",
|
|
1518
|
-
onClick:
|
|
1519
|
-
onKeyDown:
|
|
1520
|
-
role:
|
|
1521
|
-
tabIndex:
|
|
1515
|
+
onClick: ie,
|
|
1516
|
+
onKeyDown: ie,
|
|
1517
|
+
role: ie ? "button" : void 0,
|
|
1518
|
+
tabIndex: ie ? 0 : void 0,
|
|
1522
1519
|
style: {
|
|
1523
1520
|
// Force margins to 0 to prevent hover layout shift
|
|
1524
1521
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1525
1522
|
marginInlineEnd: 0,
|
|
1526
1523
|
marginInlineStart: 0
|
|
1527
1524
|
},
|
|
1528
|
-
children:
|
|
1529
|
-
|
|
1530
|
-
|
|
1525
|
+
children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1526
|
+
de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1527
|
+
V && /* @__PURE__ */ n(V, {}),
|
|
1531
1528
|
/* @__PURE__ */ n(
|
|
1532
|
-
|
|
1529
|
+
Ot.Sent,
|
|
1533
1530
|
{
|
|
1534
|
-
title: (
|
|
1535
|
-
mimeType: (
|
|
1536
|
-
thumbnailUrl: (
|
|
1537
|
-
amountText: (
|
|
1538
|
-
detail: (
|
|
1539
|
-
paymentStatus: (
|
|
1540
|
-
onPreviewClick: () =>
|
|
1541
|
-
onFetchSource: async () => await (
|
|
1531
|
+
title: (gt = c.metadata) == null ? void 0 : gt.attachment_title,
|
|
1532
|
+
mimeType: (bt = c.metadata) == null ? void 0 : bt.attachment_mime_type,
|
|
1533
|
+
thumbnailUrl: (pt = c.metadata) == null ? void 0 : pt.attachment_thumbnail,
|
|
1534
|
+
amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
|
|
1535
|
+
detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
|
|
1536
|
+
paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
|
|
1537
|
+
onPreviewClick: () => S == null ? void 0 : S(c, x),
|
|
1538
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, x))
|
|
1542
1539
|
}
|
|
1543
1540
|
)
|
|
1544
1541
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1545
1542
|
/* @__PURE__ */ n(
|
|
1546
|
-
|
|
1543
|
+
Ot.Received,
|
|
1547
1544
|
{
|
|
1548
|
-
title: (
|
|
1549
|
-
mimeType: (
|
|
1550
|
-
thumbnailUrl: (
|
|
1551
|
-
amountText: (
|
|
1552
|
-
detail: (
|
|
1553
|
-
paymentStatus: (
|
|
1554
|
-
isUnlocking:
|
|
1555
|
-
onUnlockClick: () =>
|
|
1556
|
-
onFetchSource: async () => await (
|
|
1557
|
-
onDownloadClick: () =>
|
|
1545
|
+
title: (Nt = c.metadata) == null ? void 0 : Nt.attachment_title,
|
|
1546
|
+
mimeType: (_t = c.metadata) == null ? void 0 : _t.attachment_mime_type,
|
|
1547
|
+
thumbnailUrl: (yt = c.metadata) == null ? void 0 : yt.attachment_thumbnail,
|
|
1548
|
+
amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
|
|
1549
|
+
detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
|
|
1550
|
+
paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
|
|
1551
|
+
isUnlocking: T(c.id),
|
|
1552
|
+
onUnlockClick: () => S == null ? void 0 : S(c, x),
|
|
1553
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, x)),
|
|
1554
|
+
onDownloadClick: () => O == null ? void 0 : O(c, x)
|
|
1558
1555
|
}
|
|
1559
1556
|
),
|
|
1560
|
-
|
|
1557
|
+
V && /* @__PURE__ */ n(V, {})
|
|
1561
1558
|
] }),
|
|
1562
1559
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1563
|
-
|
|
1560
|
+
Tt,
|
|
1564
1561
|
{
|
|
1565
|
-
message:
|
|
1566
|
-
renderText:
|
|
1562
|
+
message: re,
|
|
1563
|
+
renderText: g
|
|
1567
1564
|
}
|
|
1568
1565
|
) })
|
|
1569
|
-
] }) :
|
|
1566
|
+
] }) : dt ? (
|
|
1570
1567
|
/* Tip-only messages render as a standalone bubble */
|
|
1571
|
-
/* @__PURE__ */ n(
|
|
1568
|
+
/* @__PURE__ */ n(Pe, { message: c, standalone: !0 })
|
|
1572
1569
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1573
|
-
|
|
1574
|
-
|
|
1570
|
+
ue && !mt && /* @__PURE__ */ n(
|
|
1571
|
+
Pe,
|
|
1575
1572
|
{
|
|
1576
1573
|
message: c,
|
|
1577
|
-
hasAttachment:
|
|
1578
|
-
isMyMessage:
|
|
1574
|
+
hasAttachment: Re,
|
|
1575
|
+
isMyMessage: de
|
|
1579
1576
|
}
|
|
1580
1577
|
),
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1578
|
+
ct && /* @__PURE__ */ n(qn, { poll: ct }),
|
|
1579
|
+
K != null && K.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1580
|
+
M,
|
|
1584
1581
|
{
|
|
1585
1582
|
actionHandler: l,
|
|
1586
|
-
attachments:
|
|
1583
|
+
attachments: K
|
|
1587
1584
|
}
|
|
1588
1585
|
) : null,
|
|
1589
|
-
|
|
1590
|
-
|
|
1586
|
+
_e ? /* @__PURE__ */ n(
|
|
1587
|
+
w,
|
|
1591
1588
|
{
|
|
1592
|
-
message:
|
|
1593
|
-
renderText:
|
|
1589
|
+
message: re,
|
|
1590
|
+
renderText: g
|
|
1594
1591
|
}
|
|
1595
1592
|
) : /* @__PURE__ */ n(
|
|
1596
|
-
|
|
1593
|
+
Tt,
|
|
1597
1594
|
{
|
|
1598
|
-
message:
|
|
1599
|
-
renderText:
|
|
1595
|
+
message: re,
|
|
1596
|
+
renderText: g
|
|
1600
1597
|
}
|
|
1601
1598
|
),
|
|
1602
|
-
/* @__PURE__ */ n(
|
|
1599
|
+
/* @__PURE__ */ n(Wn, {})
|
|
1603
1600
|
] }) })
|
|
1604
1601
|
}
|
|
1605
1602
|
),
|
|
1606
|
-
!
|
|
1607
|
-
(!
|
|
1608
|
-
|
|
1603
|
+
!ut && !dt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1604
|
+
(!ue || mt) && /* @__PURE__ */ n(
|
|
1605
|
+
Pe,
|
|
1609
1606
|
{
|
|
1610
1607
|
message: c,
|
|
1611
|
-
hasAttachment:
|
|
1612
|
-
isMyMessage:
|
|
1608
|
+
hasAttachment: Re,
|
|
1609
|
+
isMyMessage: de
|
|
1613
1610
|
}
|
|
1614
1611
|
),
|
|
1615
|
-
s &&
|
|
1616
|
-
|
|
1612
|
+
s && ue && /* @__PURE__ */ n(
|
|
1613
|
+
_a,
|
|
1617
1614
|
{
|
|
1618
|
-
selected:
|
|
1615
|
+
selected: _,
|
|
1619
1616
|
onVoteUp: I,
|
|
1620
|
-
onVoteDown:
|
|
1617
|
+
onVoteDown: L
|
|
1621
1618
|
}
|
|
1622
1619
|
)
|
|
1623
1620
|
] }),
|
|
1624
|
-
|
|
1625
|
-
|
|
1621
|
+
J && /* @__PURE__ */ n(
|
|
1622
|
+
U,
|
|
1626
1623
|
{
|
|
1627
1624
|
onClick: d,
|
|
1628
1625
|
reply_count: c.reply_count
|
|
1629
1626
|
}
|
|
1630
1627
|
),
|
|
1631
|
-
|
|
1628
|
+
se && /* @__PURE__ */ n(X, {})
|
|
1632
1629
|
]
|
|
1633
1630
|
},
|
|
1634
1631
|
c.id
|
|
1635
1632
|
)
|
|
1636
1633
|
] });
|
|
1637
|
-
},
|
|
1638
|
-
|
|
1639
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1640
|
-
),
|
|
1634
|
+
}, Ca = z.memo(
|
|
1635
|
+
ya,
|
|
1636
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : An(e, t)
|
|
1637
|
+
), ka = (e) => {
|
|
1641
1638
|
const t = pe("CustomMessage");
|
|
1642
|
-
return /* @__PURE__ */ n(
|
|
1643
|
-
},
|
|
1639
|
+
return /* @__PURE__ */ n(Ca, { ...t, ...e });
|
|
1640
|
+
}, Ea = () => {
|
|
1644
1641
|
var s;
|
|
1645
1642
|
const { handleDelete: e, message: t } = pe("CustomMessageActions");
|
|
1646
1643
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1647
|
-
|
|
1644
|
+
Ht,
|
|
1648
1645
|
{
|
|
1649
1646
|
onClick: e,
|
|
1650
1647
|
"aria-label": "Delete",
|
|
1651
1648
|
title: "Delete",
|
|
1652
1649
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1653
|
-
children: /* @__PURE__ */ n(
|
|
1650
|
+
children: /* @__PURE__ */ n(Ss, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1654
1651
|
}
|
|
1655
1652
|
);
|
|
1656
|
-
},
|
|
1653
|
+
}, Sa = () => {
|
|
1657
1654
|
const { handleFlag: e } = pe("CustomMessageActions");
|
|
1658
1655
|
return /* @__PURE__ */ n(
|
|
1659
|
-
|
|
1656
|
+
Ht,
|
|
1660
1657
|
{
|
|
1661
1658
|
onClick: e,
|
|
1662
1659
|
"aria-label": "Report",
|
|
1663
1660
|
title: "Report",
|
|
1664
1661
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1665
|
-
children: /* @__PURE__ */ n(
|
|
1662
|
+
children: /* @__PURE__ */ n(jt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1666
1663
|
}
|
|
1667
1664
|
);
|
|
1668
1665
|
}, Ia = () => {
|
|
1669
1666
|
var t;
|
|
1670
1667
|
const { message: e } = pe("CustomMessageActions");
|
|
1671
1668
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1672
|
-
|
|
1669
|
+
Ls,
|
|
1673
1670
|
{
|
|
1674
1671
|
messageActionSet: [
|
|
1675
|
-
{ Component:
|
|
1676
|
-
{ Component:
|
|
1672
|
+
{ Component: Ea, placement: "quick", type: "delete" },
|
|
1673
|
+
{ Component: Sa, placement: "quick", type: "flag" }
|
|
1677
1674
|
]
|
|
1678
1675
|
}
|
|
1679
1676
|
);
|
|
1680
|
-
},
|
|
1677
|
+
}, Ta = (e) => ({
|
|
1681
1678
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1682
|
-
(t) =>
|
|
1679
|
+
(t) => Rt.previewIsLoaded(t) || Rt.previewIsLoading(t)
|
|
1683
1680
|
)
|
|
1684
|
-
}),
|
|
1681
|
+
}), Aa = ({
|
|
1685
1682
|
link: e,
|
|
1686
1683
|
onDismiss: t
|
|
1687
1684
|
}) => {
|
|
@@ -1711,7 +1708,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1711
1708
|
},
|
|
1712
1709
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1713
1710
|
"aria-label": "Close link preview",
|
|
1714
|
-
children: /* @__PURE__ */ n(
|
|
1711
|
+
children: /* @__PURE__ */ n(Ae, { className: "size-4 text-black/90" })
|
|
1715
1712
|
}
|
|
1716
1713
|
),
|
|
1717
1714
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1721,22 +1718,22 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1721
1718
|
]
|
|
1722
1719
|
}
|
|
1723
1720
|
);
|
|
1724
|
-
},
|
|
1725
|
-
const { linkPreviewsManager: e } =
|
|
1721
|
+
}, Ma = () => {
|
|
1722
|
+
const { linkPreviewsManager: e } = Xn(), { linkPreviews: t } = Kn(
|
|
1726
1723
|
e.state,
|
|
1727
|
-
|
|
1724
|
+
Ta
|
|
1728
1725
|
), s = (r) => {
|
|
1729
1726
|
e.dismissPreview(r);
|
|
1730
1727
|
};
|
|
1731
1728
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1732
|
-
|
|
1729
|
+
Aa,
|
|
1733
1730
|
{
|
|
1734
1731
|
link: r,
|
|
1735
1732
|
onDismiss: s
|
|
1736
1733
|
},
|
|
1737
1734
|
r.og_scrape_url
|
|
1738
1735
|
)) }) : null;
|
|
1739
|
-
}, ln = z.createContext(!1),
|
|
1736
|
+
}, ln = z.createContext(!1), Ra = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1740
1737
|
"button",
|
|
1741
1738
|
{
|
|
1742
1739
|
...s,
|
|
@@ -1744,20 +1741,20 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1744
1741
|
"aria-label": "Send",
|
|
1745
1742
|
disabled: t,
|
|
1746
1743
|
onClick: e,
|
|
1747
|
-
children: /* @__PURE__ */ n(
|
|
1744
|
+
children: /* @__PURE__ */ n(Is, { weight: "bold", className: "size-4" })
|
|
1748
1745
|
}
|
|
1749
|
-
),
|
|
1750
|
-
const e = Te(ln), { handleSubmit: t } =
|
|
1751
|
-
SendButton: r =
|
|
1752
|
-
AttachmentPreviewList: i =
|
|
1746
|
+
), La = () => {
|
|
1747
|
+
const e = Te(ln), { handleSubmit: t } = Zn(), s = Qn(), a = e || !s, {
|
|
1748
|
+
SendButton: r = Ra,
|
|
1749
|
+
AttachmentPreviewList: i = es
|
|
1753
1750
|
} = Ut("CustomMessageInput");
|
|
1754
1751
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 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: [
|
|
1755
|
-
/* @__PURE__ */ n(
|
|
1756
|
-
/* @__PURE__ */ n(
|
|
1752
|
+
/* @__PURE__ */ n(ts, {}),
|
|
1753
|
+
/* @__PURE__ */ n(Ma, {}),
|
|
1757
1754
|
/* @__PURE__ */ n(i, {}),
|
|
1758
1755
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1759
1756
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1760
|
-
|
|
1757
|
+
ns,
|
|
1761
1758
|
{
|
|
1762
1759
|
"aria-disabled": e || void 0,
|
|
1763
1760
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1780,15 +1777,15 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1780
1777
|
)
|
|
1781
1778
|
] })
|
|
1782
1779
|
] });
|
|
1783
|
-
},
|
|
1780
|
+
}, Da = ({
|
|
1784
1781
|
renderActions: e,
|
|
1785
1782
|
renderFooter: t,
|
|
1786
1783
|
disabled: s = !1,
|
|
1787
1784
|
disabledReason: a
|
|
1788
1785
|
}) => {
|
|
1789
1786
|
var o;
|
|
1790
|
-
const { channel: r } =
|
|
1791
|
-
return s ? /* @__PURE__ */ h(
|
|
1787
|
+
const { channel: r } = ce(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
|
|
1788
|
+
return s ? /* @__PURE__ */ h(te, { children: [
|
|
1792
1789
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1793
1790
|
t == null ? void 0 : t()
|
|
1794
1791
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1800,23 +1797,23 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1800
1797
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1801
1798
|
children: [
|
|
1802
1799
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1803
|
-
/* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(
|
|
1800
|
+
/* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(Jn, { Input: La }) })
|
|
1804
1801
|
]
|
|
1805
1802
|
}
|
|
1806
1803
|
),
|
|
1807
1804
|
t == null ? void 0 : t()
|
|
1808
1805
|
] });
|
|
1809
|
-
},
|
|
1806
|
+
}, Pa = [
|
|
1810
1807
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1811
1808
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1812
|
-
],
|
|
1809
|
+
], Oa = {
|
|
1813
1810
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1814
1811
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1815
|
-
},
|
|
1812
|
+
}, za = [
|
|
1816
1813
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1817
|
-
],
|
|
1814
|
+
], $a = {
|
|
1818
1815
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1819
|
-
},
|
|
1816
|
+
}, Oe = "age safety guidelines.", Fa = "https://linktr.ee/s/about/contact", $t = (e) => Pa.includes(e), Ba = (e) => za.includes(e), Ua = (e) => {
|
|
1820
1817
|
var a;
|
|
1821
1818
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1822
1819
|
if ($t(t))
|
|
@@ -1824,7 +1821,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1824
1821
|
kind: "dm-agent",
|
|
1825
1822
|
type: t
|
|
1826
1823
|
};
|
|
1827
|
-
if (
|
|
1824
|
+
if (Ba(t))
|
|
1828
1825
|
return {
|
|
1829
1826
|
kind: "age-safety",
|
|
1830
1827
|
type: t
|
|
@@ -1836,11 +1833,11 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1836
1833
|
type: s
|
|
1837
1834
|
};
|
|
1838
1835
|
}, ja = (e) => {
|
|
1839
|
-
const t = e.indexOf(
|
|
1836
|
+
const t = e.indexOf(Oe);
|
|
1840
1837
|
if (t === -1)
|
|
1841
1838
|
return e;
|
|
1842
|
-
const s = t +
|
|
1843
|
-
return /* @__PURE__ */ h(
|
|
1839
|
+
const s = t + Oe.length;
|
|
1840
|
+
return /* @__PURE__ */ h(te, { children: [
|
|
1844
1841
|
e.slice(0, t),
|
|
1845
1842
|
/* @__PURE__ */ n(
|
|
1846
1843
|
"a",
|
|
@@ -1849,18 +1846,18 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1849
1846
|
target: "_blank",
|
|
1850
1847
|
rel: "noopener noreferrer",
|
|
1851
1848
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1852
|
-
children:
|
|
1849
|
+
children: Oe
|
|
1853
1850
|
}
|
|
1854
1851
|
),
|
|
1855
1852
|
e.slice(s)
|
|
1856
1853
|
] });
|
|
1857
|
-
},
|
|
1854
|
+
}, Va = (e) => {
|
|
1858
1855
|
var a, r;
|
|
1859
|
-
const t = e.message.hide_date === !0, s =
|
|
1856
|
+
const t = e.message.hide_date === !0, s = Ua(
|
|
1860
1857
|
e.message
|
|
1861
1858
|
);
|
|
1862
1859
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1863
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1860
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Oa[s.type];
|
|
1864
1861
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1865
1862
|
/* @__PURE__ */ h(
|
|
1866
1863
|
"div",
|
|
@@ -1882,11 +1879,11 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1882
1879
|
]
|
|
1883
1880
|
}
|
|
1884
1881
|
),
|
|
1885
|
-
!t && /* @__PURE__ */ n(
|
|
1882
|
+
!t && /* @__PURE__ */ n(Le, { message: e.message })
|
|
1886
1883
|
] });
|
|
1887
1884
|
}
|
|
1888
1885
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1889
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1886
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || $a[s.type];
|
|
1890
1887
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1891
1888
|
/* @__PURE__ */ h(
|
|
1892
1889
|
"div",
|
|
@@ -1896,7 +1893,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1896
1893
|
"data-age-safety-system-type": s.type,
|
|
1897
1894
|
children: [
|
|
1898
1895
|
/* @__PURE__ */ n(
|
|
1899
|
-
|
|
1896
|
+
Ts,
|
|
1900
1897
|
{
|
|
1901
1898
|
size: 24,
|
|
1902
1899
|
weight: "duotone",
|
|
@@ -1909,7 +1906,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1909
1906
|
]
|
|
1910
1907
|
}
|
|
1911
1908
|
),
|
|
1912
|
-
!t && /* @__PURE__ */ n(
|
|
1909
|
+
!t && /* @__PURE__ */ n(Le, { message: e.message })
|
|
1913
1910
|
] });
|
|
1914
1911
|
}
|
|
1915
1912
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1918,9 +1915,9 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1918
1915
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
1919
1916
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
1920
1917
|
] }),
|
|
1921
|
-
!t && /* @__PURE__ */ n(
|
|
1918
|
+
!t && /* @__PURE__ */ n(Le, { message: e.message })
|
|
1922
1919
|
] });
|
|
1923
|
-
}, cn =
|
|
1920
|
+
}, cn = Ge(!1), ze = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1924
1921
|
"animateTransform",
|
|
1925
1922
|
{
|
|
1926
1923
|
attributeName: "transform",
|
|
@@ -1930,21 +1927,21 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1930
1927
|
begin: `${120 * t}ms`,
|
|
1931
1928
|
repeatCount: "indefinite"
|
|
1932
1929
|
}
|
|
1933
|
-
) }),
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
]),
|
|
1938
|
-
var
|
|
1939
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
1940
|
-
if (!e && l &&
|
|
1941
|
-
const
|
|
1930
|
+
) }), Ga = /* @__PURE__ */ new Set([
|
|
1931
|
+
De.Thinking,
|
|
1932
|
+
De.Generating,
|
|
1933
|
+
De.ExternalSources
|
|
1934
|
+
]), Ha = ({ threadList: e }) => {
|
|
1935
|
+
var g, v;
|
|
1936
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Ye(), { typing: i = {} } = ss(), { aiState: o } = as(t), l = Te(cn);
|
|
1937
|
+
if (!e && l && Ga.has(o)) {
|
|
1938
|
+
const p = Ya(t, (g = r.user) == null ? void 0 : g.id);
|
|
1942
1939
|
return /* @__PURE__ */ n(
|
|
1943
|
-
|
|
1940
|
+
Ft,
|
|
1944
1941
|
{
|
|
1945
|
-
avatarId: (
|
|
1946
|
-
avatarName: (
|
|
1947
|
-
avatarImage:
|
|
1942
|
+
avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
|
|
1943
|
+
avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
|
|
1944
|
+
avatarImage: p == null ? void 0 : p.image,
|
|
1948
1945
|
testId: "typing-indicator-ai"
|
|
1949
1946
|
}
|
|
1950
1947
|
);
|
|
@@ -1952,21 +1949,21 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1952
1949
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1953
1950
|
return null;
|
|
1954
1951
|
const m = e ? [] : Object.values(i).filter(
|
|
1955
|
-
({ parent_id:
|
|
1956
|
-
var
|
|
1957
|
-
return (
|
|
1952
|
+
({ parent_id: p, user: N }) => {
|
|
1953
|
+
var x;
|
|
1954
|
+
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && !p;
|
|
1958
1955
|
}
|
|
1959
|
-
),
|
|
1960
|
-
({ parent_id:
|
|
1961
|
-
var
|
|
1962
|
-
return (
|
|
1956
|
+
), b = e ? Object.values(i).filter(
|
|
1957
|
+
({ parent_id: p, user: N }) => {
|
|
1958
|
+
var x;
|
|
1959
|
+
return (N == null ? void 0 : N.id) !== ((x = r.user) == null ? void 0 : x.id) && p === (a == null ? void 0 : a.id);
|
|
1963
1960
|
}
|
|
1964
|
-
) : [], u = e ?
|
|
1961
|
+
) : [], u = e ? b : m;
|
|
1965
1962
|
if (!u.length)
|
|
1966
1963
|
return null;
|
|
1967
|
-
const f = (
|
|
1964
|
+
const f = (v = u[0]) == null ? void 0 : v.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1968
1965
|
return /* @__PURE__ */ n(
|
|
1969
|
-
|
|
1966
|
+
Ft,
|
|
1970
1967
|
{
|
|
1971
1968
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1972
1969
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1974,7 +1971,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1974
1971
|
testId: "typing-indicator"
|
|
1975
1972
|
}
|
|
1976
1973
|
);
|
|
1977
|
-
},
|
|
1974
|
+
}, Ft = ({
|
|
1978
1975
|
avatarId: e,
|
|
1979
1976
|
avatarName: t,
|
|
1980
1977
|
avatarImage: s,
|
|
@@ -1987,7 +1984,7 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1987
1984
|
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
1988
1985
|
children: [
|
|
1989
1986
|
/* @__PURE__ */ n("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1990
|
-
|
|
1987
|
+
ae,
|
|
1991
1988
|
{
|
|
1992
1989
|
id: e,
|
|
1993
1990
|
name: t,
|
|
@@ -2006,16 +2003,16 @@ const ba = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2006
2003
|
height: "8",
|
|
2007
2004
|
overflow: "visible",
|
|
2008
2005
|
children: [
|
|
2009
|
-
/* @__PURE__ */ n(
|
|
2010
|
-
/* @__PURE__ */ n(
|
|
2011
|
-
/* @__PURE__ */ n(
|
|
2006
|
+
/* @__PURE__ */ n(ze, { cx: "4", index: 0 }),
|
|
2007
|
+
/* @__PURE__ */ n(ze, { cx: "16", index: 1 }),
|
|
2008
|
+
/* @__PURE__ */ n(ze, { cx: "28", index: 2 })
|
|
2012
2009
|
]
|
|
2013
2010
|
}
|
|
2014
2011
|
) })
|
|
2015
2012
|
]
|
|
2016
2013
|
}
|
|
2017
2014
|
);
|
|
2018
|
-
function
|
|
2015
|
+
function Ya(e, t) {
|
|
2019
2016
|
var a;
|
|
2020
2017
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2021
2018
|
for (const r of Object.values(s)) {
|
|
@@ -2024,7 +2021,7 @@ function Ha(e, t) {
|
|
|
2024
2021
|
return i;
|
|
2025
2022
|
}
|
|
2026
2023
|
}
|
|
2027
|
-
const
|
|
2024
|
+
const qa = () => null, Wa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2028
2025
|
"div",
|
|
2029
2026
|
{
|
|
2030
2027
|
className: C("flex items-center justify-center h-full", e),
|
|
@@ -2068,35 +2065,43 @@ const Ya = () => null, qa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2068
2065
|
]
|
|
2069
2066
|
}
|
|
2070
2067
|
), Ee = z.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2071
|
-
/* @__PURE__ */ n(
|
|
2068
|
+
/* @__PURE__ */ n(Wa, { className: "w-6 h-6" }),
|
|
2072
2069
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2073
2070
|
] }) }));
|
|
2074
2071
|
Ee.displayName = "LoadingState";
|
|
2075
|
-
const
|
|
2072
|
+
const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bt = "Replies instantly with AI assistant", Xa = ({
|
|
2076
2073
|
onBack: e,
|
|
2077
2074
|
showBackButton: t,
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2075
|
+
showStarButton: s = !1,
|
|
2076
|
+
dmAgentEnabled: a = !1,
|
|
2077
|
+
onLeaveConversation: r,
|
|
2078
|
+
onBlockParticipant: i,
|
|
2079
|
+
showDeleteConversation: o = !0,
|
|
2080
|
+
showBlockParticipant: l = !0,
|
|
2081
|
+
showReportParticipant: d = !0,
|
|
2082
|
+
onDeleteConversationClick: m,
|
|
2083
|
+
onBlockParticipantClick: b,
|
|
2084
|
+
onReportParticipantClick: u,
|
|
2085
|
+
customChannelActions: f,
|
|
2086
|
+
showActionsMenu: c = !0
|
|
2082
2087
|
}) => {
|
|
2083
|
-
var
|
|
2084
|
-
const { channel:
|
|
2085
|
-
var
|
|
2086
|
-
const
|
|
2087
|
-
return
|
|
2088
|
-
(
|
|
2089
|
-
var
|
|
2090
|
-
return ((
|
|
2088
|
+
var S, R, O, E, A;
|
|
2089
|
+
const { channel: g } = ce(), v = z.useMemo(() => {
|
|
2090
|
+
var I, L;
|
|
2091
|
+
const y = (I = g._client) == null ? void 0 : I.userID;
|
|
2092
|
+
return y ? Object.values(((L = g.state) == null ? void 0 : L.members) || {}).find(
|
|
2093
|
+
(M) => {
|
|
2094
|
+
var j;
|
|
2095
|
+
return ((j = M.user) == null ? void 0 : j.id) && M.user.id !== y;
|
|
2091
2096
|
}
|
|
2092
2097
|
) : void 0;
|
|
2093
|
-
}, [(
|
|
2098
|
+
}, [(S = g._client) == null ? void 0 : S.userID, (R = g.state) == null ? void 0 : R.members]), p = Wt(v == null ? void 0 : v.user), N = (O = v == null ? void 0 : v.user) == null ? void 0 : O.image, x = qt(g), T = async () => {
|
|
2094
2099
|
try {
|
|
2095
|
-
|
|
2096
|
-
} catch (
|
|
2100
|
+
x ? await g.unpin() : await g.pin();
|
|
2101
|
+
} catch (y) {
|
|
2097
2102
|
console.error(
|
|
2098
2103
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2099
|
-
|
|
2104
|
+
y
|
|
2100
2105
|
);
|
|
2101
2106
|
}
|
|
2102
2107
|
};
|
|
@@ -2106,62 +2111,69 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2106
2111
|
"button",
|
|
2107
2112
|
{
|
|
2108
2113
|
className: C(
|
|
2109
|
-
|
|
2114
|
+
oe,
|
|
2110
2115
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2111
2116
|
),
|
|
2112
2117
|
onClick: e || (() => {
|
|
2113
2118
|
}),
|
|
2114
2119
|
type: "button",
|
|
2115
2120
|
"aria-label": "Back to conversations",
|
|
2116
|
-
children: /* @__PURE__ */ n(
|
|
2121
|
+
children: /* @__PURE__ */ n(Mt, { className: "size-5 text-black/90" })
|
|
2117
2122
|
}
|
|
2118
2123
|
) }),
|
|
2119
2124
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2120
2125
|
/* @__PURE__ */ n(
|
|
2121
|
-
|
|
2126
|
+
ae,
|
|
2122
2127
|
{
|
|
2123
|
-
id: ((
|
|
2124
|
-
name:
|
|
2125
|
-
image:
|
|
2126
|
-
starred:
|
|
2127
|
-
dmAgentEnabled:
|
|
2128
|
+
id: ((E = v == null ? void 0 : v.user) == null ? void 0 : E.id) || g.id || "unknown",
|
|
2129
|
+
name: p,
|
|
2130
|
+
image: N,
|
|
2131
|
+
starred: s && x,
|
|
2132
|
+
dmAgentEnabled: a,
|
|
2128
2133
|
size: 48
|
|
2129
2134
|
}
|
|
2130
2135
|
),
|
|
2131
|
-
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children:
|
|
2132
|
-
|
|
2136
|
+
/* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: p }),
|
|
2137
|
+
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2133
2138
|
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2134
|
-
/* @__PURE__ */ n("span", { children:
|
|
2139
|
+
/* @__PURE__ */ n("span", { children: Bt })
|
|
2135
2140
|
] })
|
|
2136
2141
|
] }),
|
|
2137
2142
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
2138
|
-
|
|
2143
|
+
s && /* @__PURE__ */ n(
|
|
2139
2144
|
"button",
|
|
2140
2145
|
{
|
|
2141
|
-
className:
|
|
2142
|
-
onClick:
|
|
2146
|
+
className: oe,
|
|
2147
|
+
onClick: T,
|
|
2143
2148
|
type: "button",
|
|
2144
|
-
"aria-label":
|
|
2149
|
+
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
2145
2150
|
children: /* @__PURE__ */ n(
|
|
2146
|
-
|
|
2151
|
+
Fe,
|
|
2147
2152
|
{
|
|
2148
2153
|
className: C("size-5", {
|
|
2149
|
-
"text-yellow-600":
|
|
2150
|
-
"text-black/90": !
|
|
2154
|
+
"text-yellow-600": x,
|
|
2155
|
+
"text-black/90": !x
|
|
2151
2156
|
}),
|
|
2152
|
-
weight:
|
|
2157
|
+
weight: x ? "duotone" : "regular"
|
|
2153
2158
|
}
|
|
2154
2159
|
)
|
|
2155
2160
|
}
|
|
2156
2161
|
),
|
|
2157
|
-
|
|
2158
|
-
|
|
2162
|
+
c && /* @__PURE__ */ n(
|
|
2163
|
+
Pt,
|
|
2159
2164
|
{
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
+
channel: g,
|
|
2166
|
+
participant: v,
|
|
2167
|
+
showDeleteConversation: o,
|
|
2168
|
+
showBlockParticipant: l,
|
|
2169
|
+
showReportParticipant: d,
|
|
2170
|
+
onLeaveConversation: r,
|
|
2171
|
+
onBlockParticipant: i,
|
|
2172
|
+
onDeleteConversationClick: m,
|
|
2173
|
+
onBlockParticipantClick: b,
|
|
2174
|
+
onReportParticipantClick: u,
|
|
2175
|
+
customChannelActions: f,
|
|
2176
|
+
triggerClassName: C(oe, "bg-[#F1F0EE]")
|
|
2165
2177
|
}
|
|
2166
2178
|
)
|
|
2167
2179
|
] })
|
|
@@ -2172,77 +2184,75 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2172
2184
|
"button",
|
|
2173
2185
|
{
|
|
2174
2186
|
className: C(
|
|
2175
|
-
|
|
2187
|
+
oe,
|
|
2176
2188
|
"messaging-channel-view-back-button-desktop"
|
|
2177
2189
|
),
|
|
2178
2190
|
type: "button",
|
|
2179
2191
|
onClick: e,
|
|
2180
2192
|
"aria-label": "Back to conversations",
|
|
2181
|
-
children: /* @__PURE__ */ n(
|
|
2193
|
+
children: /* @__PURE__ */ n(Mt, { className: "size-5 text-black/90" })
|
|
2182
2194
|
}
|
|
2183
2195
|
),
|
|
2184
2196
|
/* @__PURE__ */ n(
|
|
2185
|
-
|
|
2197
|
+
ae,
|
|
2186
2198
|
{
|
|
2187
|
-
id: ((
|
|
2188
|
-
name:
|
|
2189
|
-
image:
|
|
2190
|
-
starred:
|
|
2191
|
-
dmAgentEnabled:
|
|
2199
|
+
id: ((A = v == null ? void 0 : v.user) == null ? void 0 : A.id) || g.id || "unknown",
|
|
2200
|
+
name: p,
|
|
2201
|
+
image: N,
|
|
2202
|
+
starred: s && x,
|
|
2203
|
+
dmAgentEnabled: a,
|
|
2192
2204
|
size: 48
|
|
2193
2205
|
}
|
|
2194
2206
|
),
|
|
2195
2207
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
{
|
|
2199
|
-
type: "button",
|
|
2200
|
-
onClick: s,
|
|
2201
|
-
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
2202
|
-
"aria-label": `View info for ${d}`,
|
|
2203
|
-
children: /* @__PURE__ */ n("span", { className: "truncate", children: d })
|
|
2204
|
-
}
|
|
2205
|
-
) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: d }),
|
|
2206
|
-
i && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2208
|
+
/* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: p }),
|
|
2209
|
+
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2207
2210
|
/* @__PURE__ */ n(Ue, { className: "size-3 shrink-0 text-black/55" }),
|
|
2208
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2211
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Bt })
|
|
2209
2212
|
] })
|
|
2210
2213
|
] })
|
|
2211
2214
|
] }),
|
|
2212
2215
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
2213
|
-
|
|
2216
|
+
s && /* @__PURE__ */ n(
|
|
2214
2217
|
"button",
|
|
2215
2218
|
{
|
|
2216
|
-
className:
|
|
2217
|
-
onClick:
|
|
2219
|
+
className: oe,
|
|
2220
|
+
onClick: T,
|
|
2218
2221
|
type: "button",
|
|
2219
|
-
"aria-label":
|
|
2222
|
+
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
2220
2223
|
children: /* @__PURE__ */ n(
|
|
2221
|
-
|
|
2224
|
+
Fe,
|
|
2222
2225
|
{
|
|
2223
2226
|
className: C("size-6", {
|
|
2224
|
-
"text-yellow-600":
|
|
2225
|
-
"text-black/90": !
|
|
2227
|
+
"text-yellow-600": x,
|
|
2228
|
+
"text-black/90": !x
|
|
2226
2229
|
}),
|
|
2227
|
-
weight:
|
|
2230
|
+
weight: x ? "duotone" : "regular"
|
|
2228
2231
|
}
|
|
2229
2232
|
)
|
|
2230
2233
|
}
|
|
2231
2234
|
),
|
|
2232
|
-
|
|
2233
|
-
|
|
2235
|
+
c && /* @__PURE__ */ n(
|
|
2236
|
+
Pt,
|
|
2234
2237
|
{
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2238
|
+
channel: g,
|
|
2239
|
+
participant: v,
|
|
2240
|
+
showDeleteConversation: o,
|
|
2241
|
+
showBlockParticipant: l,
|
|
2242
|
+
showReportParticipant: d,
|
|
2243
|
+
onLeaveConversation: r,
|
|
2244
|
+
onBlockParticipant: i,
|
|
2245
|
+
onDeleteConversationClick: m,
|
|
2246
|
+
onBlockParticipantClick: b,
|
|
2247
|
+
onReportParticipantClick: u,
|
|
2248
|
+
customChannelActions: f,
|
|
2249
|
+
triggerClassName: oe
|
|
2240
2250
|
}
|
|
2241
2251
|
)
|
|
2242
2252
|
] })
|
|
2243
2253
|
] })
|
|
2244
2254
|
] });
|
|
2245
|
-
},
|
|
2255
|
+
}, Ka = ({
|
|
2246
2256
|
onBack: e,
|
|
2247
2257
|
showBackButton: t,
|
|
2248
2258
|
renderMessageInputActions: s,
|
|
@@ -2253,135 +2263,103 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2253
2263
|
showDeleteConversation: l = !0,
|
|
2254
2264
|
onDeleteConversationClick: d,
|
|
2255
2265
|
onBlockParticipantClick: m,
|
|
2256
|
-
onReportParticipantClick:
|
|
2266
|
+
onReportParticipantClick: b,
|
|
2257
2267
|
showBlockParticipant: u = !0,
|
|
2258
2268
|
showReportParticipant: f = !0,
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
composerDisabledReason: _,
|
|
2269
|
+
composerDisabled: c = !1,
|
|
2270
|
+
composerDisabledReason: g,
|
|
2262
2271
|
showStarButton: v = !1,
|
|
2263
|
-
chatbotVotingEnabled:
|
|
2264
|
-
renderChannelBanner:
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
showChannelInfo: M = !0
|
|
2272
|
+
chatbotVotingEnabled: p = !1,
|
|
2273
|
+
renderChannelBanner: N,
|
|
2274
|
+
customChannelActions: x,
|
|
2275
|
+
renderMessage: T,
|
|
2276
|
+
dmAgentEnabled: S = !1,
|
|
2277
|
+
viewerLanguage: R,
|
|
2278
|
+
showChannelInfo: O = !0
|
|
2271
2279
|
}) => {
|
|
2272
|
-
var
|
|
2273
|
-
const { channel:
|
|
2274
|
-
var
|
|
2275
|
-
const
|
|
2276
|
-
return
|
|
2277
|
-
(
|
|
2278
|
-
var
|
|
2279
|
-
return ((
|
|
2280
|
+
var j, V, G, $, F, X;
|
|
2281
|
+
const { channel: E } = ce(), A = z.useMemo(() => {
|
|
2282
|
+
var w, k;
|
|
2283
|
+
const U = (w = E._client) == null ? void 0 : w.userID;
|
|
2284
|
+
return U ? Object.values(((k = E.state) == null ? void 0 : k.members) || {}).find(
|
|
2285
|
+
(B) => {
|
|
2286
|
+
var q;
|
|
2287
|
+
return ((q = B.user) == null ? void 0 : q.id) && B.user.id !== U;
|
|
2280
2288
|
}
|
|
2281
2289
|
) : void 0;
|
|
2282
|
-
}, [(
|
|
2283
|
-
var
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2286
|
-
var
|
|
2287
|
-
return ((
|
|
2290
|
+
}, [(j = E._client) == null ? void 0 : j.userID, (V = E.state) == null ? void 0 : V.members]), y = z.useMemo(() => {
|
|
2291
|
+
var w, k;
|
|
2292
|
+
const U = (w = E._client) == null ? void 0 : w.userID;
|
|
2293
|
+
return U ? Object.values(((k = E.state) == null ? void 0 : k.members) || {}).find((B) => {
|
|
2294
|
+
var q;
|
|
2295
|
+
return ((q = B.user) == null ? void 0 : q.id) === U;
|
|
2288
2296
|
}) : void 0;
|
|
2289
|
-
}, [(
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
return String(R.followerStatus);
|
|
2294
|
-
if (R.isFollower !== void 0)
|
|
2295
|
-
return R.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2296
|
-
}, [N.data, c]), j = W(() => {
|
|
2297
|
-
var R;
|
|
2298
|
-
(R = E.current) == null || R.showModal();
|
|
2299
|
-
}, []), F = W(() => {
|
|
2300
|
-
var R;
|
|
2301
|
-
(R = E.current) == null || R.close();
|
|
2302
|
-
}, []), Y = W(
|
|
2303
|
-
(R) => {
|
|
2304
|
-
const { message: V } = pe("ChannelView"), X = /* @__PURE__ */ n(
|
|
2305
|
-
Ca,
|
|
2297
|
+
}, [(G = E._client) == null ? void 0 : G.userID, ($ = E.state) == null ? void 0 : $.members]), _ = ((F = y == null ? void 0 : y.user) == null ? void 0 : F.is_account) ?? (y == null ? void 0 : y.is_account), I = ((X = A == null ? void 0 : A.user) == null ? void 0 : X.is_account) ?? (A == null ? void 0 : A.is_account), L = S && _ === !1 && I === !0, M = W(
|
|
2298
|
+
(U) => {
|
|
2299
|
+
const { message: P } = pe("ChannelView"), w = /* @__PURE__ */ n(
|
|
2300
|
+
ka,
|
|
2306
2301
|
{
|
|
2307
|
-
...
|
|
2308
|
-
chatbotVotingEnabled:
|
|
2309
|
-
viewerLanguage:
|
|
2302
|
+
...U,
|
|
2303
|
+
chatbotVotingEnabled: p,
|
|
2304
|
+
viewerLanguage: R
|
|
2310
2305
|
}
|
|
2311
2306
|
);
|
|
2312
|
-
return !
|
|
2307
|
+
return !T || !P ? w : T(w, P);
|
|
2313
2308
|
},
|
|
2314
|
-
[
|
|
2309
|
+
[p, T, R]
|
|
2315
2310
|
);
|
|
2316
|
-
return /* @__PURE__ */
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
{
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
{
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
},
|
|
2352
|
-
renderFooter: () => a == null ? void 0 : a(N),
|
|
2353
|
-
disabled: b,
|
|
2354
|
-
disabledReason: _
|
|
2355
|
-
},
|
|
2356
|
-
"lt-channel-message-input"
|
|
2357
|
-
)
|
|
2358
|
-
] })
|
|
2359
|
-
}
|
|
2360
|
-
),
|
|
2361
|
-
M && /* @__PURE__ */ n(
|
|
2362
|
-
$s,
|
|
2363
|
-
{
|
|
2364
|
-
dialogRef: E,
|
|
2365
|
-
onClose: F,
|
|
2366
|
-
participant: I,
|
|
2367
|
-
participantDisplayName: Ae(
|
|
2368
|
-
I == null ? void 0 : I.user
|
|
2311
|
+
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
2312
|
+
is,
|
|
2313
|
+
{
|
|
2314
|
+
overrides: {
|
|
2315
|
+
Message: M,
|
|
2316
|
+
MessageActions: Ia
|
|
2317
|
+
},
|
|
2318
|
+
children: /* @__PURE__ */ h(os, { children: [
|
|
2319
|
+
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2320
|
+
Xa,
|
|
2321
|
+
{
|
|
2322
|
+
onBack: e,
|
|
2323
|
+
showBackButton: t,
|
|
2324
|
+
showActionsMenu: O,
|
|
2325
|
+
showStarButton: v,
|
|
2326
|
+
dmAgentEnabled: L,
|
|
2327
|
+
onLeaveConversation: i,
|
|
2328
|
+
onBlockParticipant: o,
|
|
2329
|
+
showDeleteConversation: l,
|
|
2330
|
+
showBlockParticipant: u,
|
|
2331
|
+
showReportParticipant: f,
|
|
2332
|
+
onDeleteConversationClick: d,
|
|
2333
|
+
onBlockParticipantClick: m,
|
|
2334
|
+
onReportParticipantClick: b,
|
|
2335
|
+
customChannelActions: x
|
|
2336
|
+
}
|
|
2337
|
+
) }, "lt-channel-header"),
|
|
2338
|
+
N ? /* @__PURE__ */ n(z.Fragment, { children: N() }, "lt-channel-banner") : null,
|
|
2339
|
+
/* @__PURE__ */ n(
|
|
2340
|
+
"div",
|
|
2341
|
+
{
|
|
2342
|
+
className: "flex-1 overflow-hidden relative",
|
|
2343
|
+
children: /* @__PURE__ */ n(ls, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2344
|
+
},
|
|
2345
|
+
"lt-channel-message-list"
|
|
2369
2346
|
),
|
|
2370
|
-
channel:
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2347
|
+
r ? /* @__PURE__ */ n(z.Fragment, { children: r(E) }, "lt-channel-conversation-footer") : null,
|
|
2348
|
+
/* @__PURE__ */ n(
|
|
2349
|
+
Da,
|
|
2350
|
+
{
|
|
2351
|
+
...s && {
|
|
2352
|
+
renderActions: () => s == null ? void 0 : s(E)
|
|
2353
|
+
},
|
|
2354
|
+
renderFooter: () => a == null ? void 0 : a(E),
|
|
2355
|
+
disabled: c,
|
|
2356
|
+
disabledReason: g
|
|
2357
|
+
},
|
|
2358
|
+
"lt-channel-message-input"
|
|
2359
|
+
)
|
|
2360
|
+
] })
|
|
2361
|
+
}
|
|
2362
|
+
) });
|
|
2385
2363
|
}, dn = z.memo(
|
|
2386
2364
|
({
|
|
2387
2365
|
channel: e,
|
|
@@ -2393,84 +2371,82 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2393
2371
|
onLeaveConversation: o,
|
|
2394
2372
|
onBlockParticipant: l,
|
|
2395
2373
|
className: d,
|
|
2396
|
-
CustomChannelEmptyState: m =
|
|
2397
|
-
showDeleteConversation:
|
|
2374
|
+
CustomChannelEmptyState: m = qa,
|
|
2375
|
+
showDeleteConversation: b = !0,
|
|
2398
2376
|
onDeleteConversationClick: u,
|
|
2399
2377
|
onBlockParticipantClick: f,
|
|
2400
2378
|
onReportParticipantClick: c,
|
|
2401
|
-
showBlockParticipant:
|
|
2402
|
-
showReportParticipant:
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
viewerLanguage: G,
|
|
2419
|
-
showChannelInfo: H = !0
|
|
2379
|
+
showBlockParticipant: g = !0,
|
|
2380
|
+
showReportParticipant: v = !0,
|
|
2381
|
+
composerDisabled: p = !1,
|
|
2382
|
+
composerDisabledReason: N,
|
|
2383
|
+
dmAgentEnabled: x,
|
|
2384
|
+
messageMetadata: T,
|
|
2385
|
+
onMessageSent: S,
|
|
2386
|
+
showStarButton: R = !1,
|
|
2387
|
+
chatbotVotingEnabled: O = !1,
|
|
2388
|
+
renderChannelBanner: E,
|
|
2389
|
+
customChannelActions: A,
|
|
2390
|
+
renderMessage: y,
|
|
2391
|
+
onMessageLinkClick: _,
|
|
2392
|
+
sendButton: I,
|
|
2393
|
+
attachmentPreviewList: L,
|
|
2394
|
+
viewerLanguage: M,
|
|
2395
|
+
showChannelInfo: j = !0
|
|
2420
2396
|
}) => {
|
|
2421
|
-
const
|
|
2422
|
-
async (
|
|
2423
|
-
var
|
|
2424
|
-
const
|
|
2425
|
-
...
|
|
2426
|
-
...
|
|
2427
|
-
...
|
|
2397
|
+
const V = W(
|
|
2398
|
+
async ($, F, X) => {
|
|
2399
|
+
var q;
|
|
2400
|
+
const U = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, P = x && !U, w = {
|
|
2401
|
+
...F,
|
|
2402
|
+
...P && { silent: !0 },
|
|
2403
|
+
...T && {
|
|
2428
2404
|
metadata: {
|
|
2429
|
-
...
|
|
2430
|
-
...
|
|
2405
|
+
...F.metadata ?? {},
|
|
2406
|
+
...T
|
|
2431
2407
|
}
|
|
2432
2408
|
}
|
|
2433
|
-
},
|
|
2434
|
-
|
|
2435
|
-
...
|
|
2436
|
-
},
|
|
2437
|
-
return
|
|
2409
|
+
}, k = {
|
|
2410
|
+
...X,
|
|
2411
|
+
...P && { skip_push: !0 }
|
|
2412
|
+
}, B = await e.sendMessage(w, k);
|
|
2413
|
+
return S == null || S(B), B;
|
|
2438
2414
|
},
|
|
2439
|
-
[e,
|
|
2440
|
-
),
|
|
2441
|
-
return
|
|
2442
|
-
if (!
|
|
2443
|
-
const
|
|
2444
|
-
if (
|
|
2445
|
-
const
|
|
2446
|
-
const
|
|
2447
|
-
if (!
|
|
2448
|
-
const
|
|
2449
|
-
|
|
2415
|
+
[e, x, T, S]
|
|
2416
|
+
), G = H(null);
|
|
2417
|
+
return Y(() => {
|
|
2418
|
+
if (!_) return;
|
|
2419
|
+
const $ = G.current;
|
|
2420
|
+
if (!$) return;
|
|
2421
|
+
const F = (X) => {
|
|
2422
|
+
const U = X.target, P = U == null ? void 0 : U.closest("a[href]"), w = P == null ? void 0 : P.getAttribute("href");
|
|
2423
|
+
if (!w) return;
|
|
2424
|
+
const k = P == null ? void 0 : P.closest("[data-message-id]"), B = k == null ? void 0 : k.getAttribute("data-message-id"), q = B ? e.state.messages.find((_e) => _e.id === B) : void 0;
|
|
2425
|
+
_(w, q);
|
|
2450
2426
|
};
|
|
2451
|
-
return
|
|
2452
|
-
}, [
|
|
2427
|
+
return $.addEventListener("click", F), () => $.removeEventListener("click", F);
|
|
2428
|
+
}, [_, e]), /* @__PURE__ */ n(
|
|
2453
2429
|
"div",
|
|
2454
2430
|
{
|
|
2455
|
-
ref:
|
|
2431
|
+
ref: G,
|
|
2456
2432
|
className: C(
|
|
2457
2433
|
"messaging-channel-view h-full flex flex-col",
|
|
2458
2434
|
d
|
|
2459
2435
|
),
|
|
2460
|
-
children: /* @__PURE__ */ n(cn.Provider, { value:
|
|
2461
|
-
|
|
2436
|
+
children: /* @__PURE__ */ n(cn.Provider, { value: x ?? !1, children: /* @__PURE__ */ n(
|
|
2437
|
+
rs,
|
|
2462
2438
|
{
|
|
2463
2439
|
channel: e,
|
|
2464
|
-
MessageSystem:
|
|
2440
|
+
MessageSystem: Va,
|
|
2465
2441
|
EmptyStateIndicator: m,
|
|
2466
2442
|
LoadingIndicator: Ee,
|
|
2467
|
-
DateSeparator:
|
|
2468
|
-
TypingIndicator:
|
|
2469
|
-
doSendMessageRequest:
|
|
2470
|
-
...
|
|
2471
|
-
...
|
|
2443
|
+
DateSeparator: Us,
|
|
2444
|
+
TypingIndicator: Ha,
|
|
2445
|
+
doSendMessageRequest: V,
|
|
2446
|
+
...I ? { SendButton: I } : {},
|
|
2447
|
+
...L ? { AttachmentPreviewList: L } : {},
|
|
2472
2448
|
children: /* @__PURE__ */ n(
|
|
2473
|
-
|
|
2449
|
+
Ka,
|
|
2474
2450
|
{
|
|
2475
2451
|
onBack: t,
|
|
2476
2452
|
showBackButton: s,
|
|
@@ -2480,24 +2456,22 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2480
2456
|
onLeaveConversation: o,
|
|
2481
2457
|
onBlockParticipant: l,
|
|
2482
2458
|
CustomChannelEmptyState: m,
|
|
2483
|
-
showDeleteConversation:
|
|
2459
|
+
showDeleteConversation: b,
|
|
2484
2460
|
onDeleteConversationClick: u,
|
|
2485
2461
|
onBlockParticipantClick: f,
|
|
2486
2462
|
onReportParticipantClick: c,
|
|
2487
|
-
showBlockParticipant:
|
|
2488
|
-
showReportParticipant:
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
viewerLanguage: G,
|
|
2500
|
-
showChannelInfo: H
|
|
2463
|
+
showBlockParticipant: g,
|
|
2464
|
+
showReportParticipant: v,
|
|
2465
|
+
composerDisabled: p,
|
|
2466
|
+
composerDisabledReason: N,
|
|
2467
|
+
showStarButton: R,
|
|
2468
|
+
dmAgentEnabled: x,
|
|
2469
|
+
chatbotVotingEnabled: O,
|
|
2470
|
+
renderChannelBanner: E,
|
|
2471
|
+
customChannelActions: A,
|
|
2472
|
+
renderMessage: y,
|
|
2473
|
+
viewerLanguage: M,
|
|
2474
|
+
showChannelInfo: j
|
|
2501
2475
|
}
|
|
2502
2476
|
)
|
|
2503
2477
|
}
|
|
@@ -2522,7 +2496,7 @@ const fe = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2522
2496
|
)
|
|
2523
2497
|
] }) }));
|
|
2524
2498
|
fe.displayName = "ErrorState";
|
|
2525
|
-
const
|
|
2499
|
+
const yi = ({
|
|
2526
2500
|
capabilities: e = {},
|
|
2527
2501
|
renderMessageInputActions: t,
|
|
2528
2502
|
renderConversationFooter: s,
|
|
@@ -2533,133 +2507,133 @@ const _i = ({
|
|
|
2533
2507
|
CustomChannelEmptyState: l,
|
|
2534
2508
|
onBlockParticipantClick: d,
|
|
2535
2509
|
onReportParticipantClick: m,
|
|
2536
|
-
dmAgentEnabled:
|
|
2510
|
+
dmAgentEnabled: b,
|
|
2537
2511
|
onMessageSent: u,
|
|
2538
2512
|
chatbotVotingEnabled: f = !1,
|
|
2539
2513
|
viewerLanguage: c,
|
|
2540
|
-
renderChannelBanner:
|
|
2541
|
-
customChannelActions:
|
|
2542
|
-
renderMessage:
|
|
2543
|
-
onMessageLinkClick:
|
|
2544
|
-
showChannelInfo:
|
|
2514
|
+
renderChannelBanner: g,
|
|
2515
|
+
customChannelActions: v,
|
|
2516
|
+
renderMessage: p,
|
|
2517
|
+
onMessageLinkClick: N,
|
|
2518
|
+
showChannelInfo: x
|
|
2545
2519
|
}) => {
|
|
2546
2520
|
const {
|
|
2547
|
-
client:
|
|
2548
|
-
isConnected:
|
|
2549
|
-
isLoading:
|
|
2550
|
-
error:
|
|
2551
|
-
refreshConnection:
|
|
2552
|
-
service:
|
|
2553
|
-
debug:
|
|
2554
|
-
} = Ds(), [
|
|
2555
|
-
|
|
2556
|
-
const F =
|
|
2521
|
+
client: T,
|
|
2522
|
+
isConnected: S,
|
|
2523
|
+
isLoading: R,
|
|
2524
|
+
error: O,
|
|
2525
|
+
refreshConnection: E,
|
|
2526
|
+
service: A,
|
|
2527
|
+
debug: y
|
|
2528
|
+
} = Ds(), [_, I] = D(null), [L, M] = D(null), [j, V] = D(!1), { showDeleteConversation: G = !0 } = e, $ = H(o);
|
|
2529
|
+
$.current = o;
|
|
2530
|
+
const F = H(a);
|
|
2557
2531
|
F.current = a;
|
|
2558
|
-
const
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
}, [
|
|
2562
|
-
if (!
|
|
2563
|
-
const
|
|
2564
|
-
if (!
|
|
2565
|
-
const
|
|
2566
|
-
if (
|
|
2567
|
-
|
|
2568
|
-
const
|
|
2569
|
-
|
|
2532
|
+
const X = H(null), U = H(null);
|
|
2533
|
+
Y(() => {
|
|
2534
|
+
U.current = _;
|
|
2535
|
+
}, [_]), Y(() => {
|
|
2536
|
+
if (!T || !S) return;
|
|
2537
|
+
const k = T.userID;
|
|
2538
|
+
if (!k) return;
|
|
2539
|
+
const B = `${k}::${i}`;
|
|
2540
|
+
if (X.current === B) return;
|
|
2541
|
+
X.current = B;
|
|
2542
|
+
const q = () => {
|
|
2543
|
+
X.current === B && (X.current = null);
|
|
2570
2544
|
};
|
|
2571
2545
|
(async () => {
|
|
2572
|
-
var
|
|
2546
|
+
var K, re;
|
|
2573
2547
|
try {
|
|
2574
|
-
|
|
2548
|
+
y && console.log(
|
|
2575
2549
|
"[MessagingShell] Loading initial conversation with:",
|
|
2576
2550
|
i
|
|
2577
2551
|
);
|
|
2578
|
-
const
|
|
2552
|
+
const J = await T.queryChannels(
|
|
2579
2553
|
{
|
|
2580
2554
|
type: "messaging",
|
|
2581
|
-
members: { $eq: [
|
|
2555
|
+
members: { $eq: [k, i] }
|
|
2582
2556
|
},
|
|
2583
2557
|
{},
|
|
2584
2558
|
{ limit: 1 }
|
|
2585
2559
|
);
|
|
2586
|
-
if (
|
|
2587
|
-
I(
|
|
2560
|
+
if (J.length > 0) {
|
|
2561
|
+
I(J[0]), M(null), (K = F.current) == null || K.call(F, J[0]), y && console.log(
|
|
2588
2562
|
"[MessagingShell] Initial conversation loaded:",
|
|
2589
|
-
|
|
2563
|
+
J[0].id
|
|
2590
2564
|
);
|
|
2591
2565
|
return;
|
|
2592
2566
|
}
|
|
2593
|
-
const
|
|
2594
|
-
if (!
|
|
2595
|
-
|
|
2567
|
+
const se = $.current;
|
|
2568
|
+
if (!se || !A) {
|
|
2569
|
+
q(), M("No conversation found with this account"), y && console.log(
|
|
2596
2570
|
"[MessagingShell] No conversation found for:",
|
|
2597
2571
|
i
|
|
2598
2572
|
);
|
|
2599
2573
|
return;
|
|
2600
2574
|
}
|
|
2601
2575
|
try {
|
|
2602
|
-
const
|
|
2603
|
-
id:
|
|
2604
|
-
name:
|
|
2605
|
-
phone:
|
|
2576
|
+
const Q = await A.startChannelWithParticipant({
|
|
2577
|
+
id: se.id,
|
|
2578
|
+
name: se.name,
|
|
2579
|
+
phone: se.phone
|
|
2606
2580
|
});
|
|
2607
|
-
I(
|
|
2581
|
+
I(Q), M(null), (re = F.current) == null || re.call(F, Q), y && console.log(
|
|
2608
2582
|
"[MessagingShell] Channel created and loaded:",
|
|
2609
|
-
|
|
2583
|
+
Q.id
|
|
2610
2584
|
);
|
|
2611
|
-
} catch (
|
|
2585
|
+
} catch (Q) {
|
|
2612
2586
|
console.error(
|
|
2613
2587
|
"[MessagingShell] Failed to create conversation:",
|
|
2614
|
-
|
|
2615
|
-
),
|
|
2588
|
+
Q
|
|
2589
|
+
), q(), M("Failed to create conversation");
|
|
2616
2590
|
}
|
|
2617
|
-
} catch (
|
|
2591
|
+
} catch (J) {
|
|
2618
2592
|
console.error(
|
|
2619
2593
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2620
|
-
|
|
2621
|
-
),
|
|
2594
|
+
J
|
|
2595
|
+
), q(), U.current || M("Failed to load conversation");
|
|
2622
2596
|
}
|
|
2623
2597
|
})();
|
|
2624
|
-
}, [i,
|
|
2625
|
-
const
|
|
2626
|
-
|
|
2627
|
-
const
|
|
2628
|
-
var
|
|
2629
|
-
I(null),
|
|
2598
|
+
}, [i, T, S, A, y]);
|
|
2599
|
+
const P = H(r);
|
|
2600
|
+
P.current = r;
|
|
2601
|
+
const w = W(() => {
|
|
2602
|
+
var k;
|
|
2603
|
+
I(null), V(!0), (k = P.current) == null || k.call(P);
|
|
2630
2604
|
}, []);
|
|
2631
|
-
return
|
|
2605
|
+
return R ? /* @__PURE__ */ n(Ee, {}) : O ? /* @__PURE__ */ n(fe, { message: O, onBack: E }) : !S || !T ? /* @__PURE__ */ n(
|
|
2632
2606
|
fe,
|
|
2633
2607
|
{
|
|
2634
2608
|
message: "Not connected to messaging service",
|
|
2635
|
-
onBack:
|
|
2609
|
+
onBack: E
|
|
2636
2610
|
}
|
|
2637
|
-
) :
|
|
2611
|
+
) : L ? /* @__PURE__ */ n(fe, { message: L }) : j && !_ ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : _ ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2638
2612
|
dn,
|
|
2639
2613
|
{
|
|
2640
|
-
channel:
|
|
2614
|
+
channel: _,
|
|
2641
2615
|
renderMessageInputActions: t,
|
|
2642
2616
|
renderConversationFooter: s,
|
|
2643
|
-
renderChannelBanner:
|
|
2644
|
-
onLeaveConversation:
|
|
2645
|
-
onBlockParticipant:
|
|
2617
|
+
renderChannelBanner: g,
|
|
2618
|
+
onLeaveConversation: w,
|
|
2619
|
+
onBlockParticipant: w,
|
|
2646
2620
|
CustomChannelEmptyState: l,
|
|
2647
|
-
showDeleteConversation:
|
|
2621
|
+
showDeleteConversation: G,
|
|
2648
2622
|
onBlockParticipantClick: d,
|
|
2649
2623
|
onReportParticipantClick: m,
|
|
2650
|
-
dmAgentEnabled:
|
|
2624
|
+
dmAgentEnabled: b,
|
|
2651
2625
|
onMessageSent: u,
|
|
2652
2626
|
chatbotVotingEnabled: f,
|
|
2653
2627
|
viewerLanguage: c,
|
|
2654
|
-
customChannelActions:
|
|
2655
|
-
renderMessage:
|
|
2656
|
-
onMessageLinkClick:
|
|
2657
|
-
showChannelInfo:
|
|
2628
|
+
customChannelActions: v,
|
|
2629
|
+
renderMessage: p,
|
|
2630
|
+
onMessageLinkClick: N,
|
|
2631
|
+
showChannelInfo: x
|
|
2658
2632
|
},
|
|
2659
|
-
|
|
2633
|
+
_.id
|
|
2660
2634
|
) }) }) : /* @__PURE__ */ n(Ee, {});
|
|
2661
2635
|
};
|
|
2662
|
-
function
|
|
2636
|
+
function Ja(e) {
|
|
2663
2637
|
const t = e.state.pending_messages;
|
|
2664
2638
|
if (t != null && t.length)
|
|
2665
2639
|
for (const s of t)
|
|
@@ -2672,18 +2646,18 @@ const un = z.createContext({
|
|
|
2672
2646
|
debug: !1,
|
|
2673
2647
|
renderMessagePreview: void 0,
|
|
2674
2648
|
viewerLanguage: void 0
|
|
2675
|
-
}),
|
|
2649
|
+
}), Za = un.Provider, Qa = () => z.useContext(un), er = (e, t) => {
|
|
2676
2650
|
const s = new Date(
|
|
2677
2651
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2678
2652
|
), r = new Date(
|
|
2679
2653
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2680
2654
|
).getTime() - s.getTime();
|
|
2681
2655
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2682
|
-
},
|
|
2656
|
+
}, tr = (e) => {
|
|
2683
2657
|
const t = /* @__PURE__ */ new Date();
|
|
2684
2658
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2685
2659
|
return "Just now";
|
|
2686
|
-
const a =
|
|
2660
|
+
const a = er(e, t);
|
|
2687
2661
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2688
2662
|
hour: "numeric",
|
|
2689
2663
|
minute: "2-digit",
|
|
@@ -2695,49 +2669,49 @@ const un = z.createContext({
|
|
|
2695
2669
|
});
|
|
2696
2670
|
}, mn = z.memo(
|
|
2697
2671
|
({ channel: e, unread: t }) => {
|
|
2698
|
-
var
|
|
2672
|
+
var O, E, A;
|
|
2699
2673
|
const {
|
|
2700
2674
|
selectedChannel: s,
|
|
2701
2675
|
onChannelSelect: a,
|
|
2702
2676
|
debug: r,
|
|
2703
2677
|
renderMessagePreview: i,
|
|
2704
2678
|
viewerLanguage: o
|
|
2705
|
-
} =
|
|
2679
|
+
} = Qa(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2706
2680
|
e && a(e);
|
|
2707
|
-
}, m = (
|
|
2708
|
-
const
|
|
2709
|
-
!
|
|
2710
|
-
}, u = Object.values(((
|
|
2711
|
-
(
|
|
2712
|
-
var
|
|
2713
|
-
return ((
|
|
2681
|
+
}, m = (y) => {
|
|
2682
|
+
const _ = y.key === "Enter" || y.key === " ", I = y.repeat;
|
|
2683
|
+
!_ || I || (y.preventDefault(), d());
|
|
2684
|
+
}, u = Object.values(((O = e == null ? void 0 : e.state) == null ? void 0 : O.members) || {}).find(
|
|
2685
|
+
(y) => {
|
|
2686
|
+
var _, I;
|
|
2687
|
+
return ((_ = y.user) == null ? void 0 : _.id) && y.user.id !== ((I = e == null ? void 0 : e._client) == null ? void 0 : I.userID);
|
|
2714
2688
|
}
|
|
2715
|
-
), f =
|
|
2716
|
-
var
|
|
2717
|
-
const
|
|
2718
|
-
if (
|
|
2719
|
-
for (let I =
|
|
2720
|
-
if (
|
|
2689
|
+
), f = Wt(u == null ? void 0 : u.user), c = (E = u == null ? void 0 : u.user) == null ? void 0 : E.image, g = (() => {
|
|
2690
|
+
var _;
|
|
2691
|
+
const y = (_ = e == null ? void 0 : e.state) == null ? void 0 : _.messages;
|
|
2692
|
+
if (y != null && y.length) {
|
|
2693
|
+
for (let I = y.length - 1; I >= 0; I--)
|
|
2694
|
+
if (y[I].type !== "system") return y[I];
|
|
2721
2695
|
}
|
|
2722
|
-
})(),
|
|
2723
|
-
var
|
|
2724
|
-
const
|
|
2725
|
-
message:
|
|
2696
|
+
})(), p = (() => {
|
|
2697
|
+
var j, V, G, $;
|
|
2698
|
+
const y = Xt({
|
|
2699
|
+
message: g,
|
|
2726
2700
|
viewerLanguage: o
|
|
2727
2701
|
});
|
|
2728
|
-
if (((
|
|
2729
|
-
if (((
|
|
2730
|
-
if (((
|
|
2731
|
-
if (
|
|
2732
|
-
const
|
|
2733
|
-
return
|
|
2734
|
-
})(),
|
|
2702
|
+
if (((j = g == null ? void 0 : g.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_TIP") return y ? `💵 ${y}` : "💵 Sent a tip";
|
|
2703
|
+
if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_PAID") return y ? `💰 ${y}` : "💰 Sent a message";
|
|
2704
|
+
if (((G = g == null ? void 0 : g.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_ATTACHMENT") return y ? `📎 ${y}` : "📎 Sent an attachment";
|
|
2705
|
+
if (y) return y;
|
|
2706
|
+
const M = ($ = g == null ? void 0 : g.attachments) == null ? void 0 : $[0];
|
|
2707
|
+
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";
|
|
2708
|
+
})(), N = g != null && g.created_at ? tr(new Date(g.created_at)) : "", x = g ? ke(g) : !1, T = i ? i(g, p) : `${x ? "✨ " : ""}${p}`, S = qt(e), R = t ?? 0;
|
|
2735
2709
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2736
2710
|
channelId: e == null ? void 0 : e.id,
|
|
2737
2711
|
isSelected: l,
|
|
2738
2712
|
participantName: f,
|
|
2739
|
-
unreadCount:
|
|
2740
|
-
hasTimestamp: !!
|
|
2713
|
+
unreadCount: R,
|
|
2714
|
+
hasTimestamp: !!N
|
|
2741
2715
|
}), /* @__PURE__ */ n(
|
|
2742
2716
|
"div",
|
|
2743
2717
|
{
|
|
@@ -2754,13 +2728,13 @@ const un = z.createContext({
|
|
|
2754
2728
|
),
|
|
2755
2729
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2756
2730
|
/* @__PURE__ */ n(
|
|
2757
|
-
|
|
2731
|
+
ae,
|
|
2758
2732
|
{
|
|
2759
|
-
id: ((
|
|
2733
|
+
id: ((A = u == null ? void 0 : u.user) == null ? void 0 : A.id) || e.id || "unknown",
|
|
2760
2734
|
name: f,
|
|
2761
2735
|
image: c,
|
|
2762
2736
|
size: 48,
|
|
2763
|
-
starred:
|
|
2737
|
+
starred: S
|
|
2764
2738
|
}
|
|
2765
2739
|
),
|
|
2766
2740
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2772,16 +2746,16 @@ const un = z.createContext({
|
|
|
2772
2746
|
"text-sm font-medium truncate text-[#191918]"
|
|
2773
2747
|
),
|
|
2774
2748
|
children: [
|
|
2775
|
-
|
|
2749
|
+
S && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2776
2750
|
f
|
|
2777
2751
|
]
|
|
2778
2752
|
}
|
|
2779
2753
|
),
|
|
2780
|
-
|
|
2754
|
+
N && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
|
|
2781
2755
|
] }),
|
|
2782
2756
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2783
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2784
|
-
|
|
2757
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: T }),
|
|
2758
|
+
R > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: R > 99 ? "99+" : R })
|
|
2785
2759
|
] })
|
|
2786
2760
|
] })
|
|
2787
2761
|
] })
|
|
@@ -2790,31 +2764,31 @@ const un = z.createContext({
|
|
|
2790
2764
|
}
|
|
2791
2765
|
);
|
|
2792
2766
|
mn.displayName = "CustomChannelPreview";
|
|
2793
|
-
const
|
|
2767
|
+
const nr = { last_message_at: -1 }, sr = z.memo(
|
|
2794
2768
|
({
|
|
2795
2769
|
onChannelSelect: e,
|
|
2796
2770
|
selectedChannel: t,
|
|
2797
2771
|
filters: s,
|
|
2798
2772
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2799
2773
|
channelRenderFilterFn: r,
|
|
2800
|
-
sort: i =
|
|
2774
|
+
sort: i = nr,
|
|
2801
2775
|
className: o,
|
|
2802
2776
|
customEmptyStateIndicator: l,
|
|
2803
2777
|
renderMessagePreview: d,
|
|
2804
2778
|
viewerLanguage: m
|
|
2805
2779
|
}) => {
|
|
2806
|
-
const
|
|
2807
|
-
|
|
2808
|
-
const { debug: u = !1 } =
|
|
2809
|
-
(
|
|
2810
|
-
for (const
|
|
2811
|
-
|
|
2812
|
-
return r ? r(
|
|
2780
|
+
const b = z.useRef(0);
|
|
2781
|
+
b.current++;
|
|
2782
|
+
const { debug: u = !1 } = qe(), f = z.useCallback(
|
|
2783
|
+
(g) => {
|
|
2784
|
+
for (const v of g)
|
|
2785
|
+
Ja(v);
|
|
2786
|
+
return r ? r(g) : g;
|
|
2813
2787
|
},
|
|
2814
2788
|
[r]
|
|
2815
2789
|
);
|
|
2816
2790
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
2817
|
-
renderCount:
|
|
2791
|
+
renderCount: b.current,
|
|
2818
2792
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2819
2793
|
filters: s
|
|
2820
2794
|
});
|
|
@@ -2841,8 +2815,8 @@ const tr = { last_message_at: -1 }, nr = z.memo(
|
|
|
2841
2815
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2842
2816
|
o
|
|
2843
2817
|
),
|
|
2844
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2845
|
-
|
|
2818
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Za, { value: c, children: /* @__PURE__ */ n(
|
|
2819
|
+
cs,
|
|
2846
2820
|
{
|
|
2847
2821
|
filters: s,
|
|
2848
2822
|
sort: i,
|
|
@@ -2858,27 +2832,27 @@ const tr = { last_message_at: -1 }, nr = z.memo(
|
|
|
2858
2832
|
);
|
|
2859
2833
|
}
|
|
2860
2834
|
);
|
|
2861
|
-
|
|
2862
|
-
const
|
|
2863
|
-
function
|
|
2835
|
+
sr.displayName = "ChannelList";
|
|
2836
|
+
const ar = /^([a-z][a-z0-9+.-]*):/i, rr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2837
|
+
function Qe(e) {
|
|
2864
2838
|
if (typeof e != "string") return;
|
|
2865
2839
|
const t = e.trim();
|
|
2866
2840
|
if (t === "") return;
|
|
2867
|
-
const s =
|
|
2841
|
+
const s = ar.exec(t);
|
|
2868
2842
|
if (s) {
|
|
2869
2843
|
const a = s[1].toLowerCase();
|
|
2870
|
-
return
|
|
2844
|
+
return rr.has(a) ? t : void 0;
|
|
2871
2845
|
}
|
|
2872
2846
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2873
2847
|
}
|
|
2874
|
-
const
|
|
2848
|
+
const ir = {
|
|
2875
2849
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2876
2850
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2877
|
-
},
|
|
2851
|
+
}, or = ({ variant: e, cta: t }) => {
|
|
2878
2852
|
const s = C(
|
|
2879
2853
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2880
|
-
|
|
2881
|
-
), a =
|
|
2854
|
+
ir[e]
|
|
2855
|
+
), a = Qe(t.href);
|
|
2882
2856
|
return a ? /* @__PURE__ */ n(
|
|
2883
2857
|
"a",
|
|
2884
2858
|
{
|
|
@@ -2904,13 +2878,13 @@ const rr = {
|
|
|
2904
2878
|
children: t.label
|
|
2905
2879
|
}
|
|
2906
2880
|
);
|
|
2907
|
-
},
|
|
2881
|
+
}, lr = {
|
|
2908
2882
|
dark: "text-white",
|
|
2909
2883
|
light: "text-black/90"
|
|
2910
|
-
},
|
|
2884
|
+
}, cr = "text-white/30", dr = {
|
|
2911
2885
|
dark: "text-white/55",
|
|
2912
2886
|
light: "text-black/55"
|
|
2913
|
-
},
|
|
2887
|
+
}, et = ({
|
|
2914
2888
|
variant: e,
|
|
2915
2889
|
title: t,
|
|
2916
2890
|
placeholderTitle: s,
|
|
@@ -2920,39 +2894,39 @@ const rr = {
|
|
|
2920
2894
|
cta: o,
|
|
2921
2895
|
trailingAction: l
|
|
2922
2896
|
}) => {
|
|
2923
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "",
|
|
2924
|
-
if (!
|
|
2925
|
-
const
|
|
2897
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", b = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", g = o != null;
|
|
2898
|
+
if (!b && !u && !c && !g) return null;
|
|
2899
|
+
const p = C(
|
|
2926
2900
|
"truncate text-base font-medium leading-6",
|
|
2927
|
-
d && !t ?
|
|
2928
|
-
),
|
|
2901
|
+
d && !t ? cr : lr[e]
|
|
2902
|
+
), N = C(
|
|
2929
2903
|
"truncate text-xs leading-4",
|
|
2930
|
-
|
|
2904
|
+
dr[e]
|
|
2931
2905
|
);
|
|
2932
2906
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2933
2907
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
2934
2908
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2935
2909
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2936
|
-
|
|
2910
|
+
b && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2937
2911
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2938
|
-
/* @__PURE__ */ n("p", { className: C("min-w-0",
|
|
2912
|
+
/* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
|
|
2939
2913
|
] }),
|
|
2940
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2914
|
+
u && /* @__PURE__ */ n("p", { className: N, children: a })
|
|
2941
2915
|
] }),
|
|
2942
|
-
!
|
|
2916
|
+
!g && c && /* @__PURE__ */ n("p", { className: N, children: f })
|
|
2943
2917
|
] }),
|
|
2944
2918
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2945
2919
|
] }),
|
|
2946
|
-
o && /* @__PURE__ */ n(
|
|
2920
|
+
o && /* @__PURE__ */ n(or, { variant: e, cta: o })
|
|
2947
2921
|
] });
|
|
2948
|
-
},
|
|
2922
|
+
}, ur = C(
|
|
2949
2923
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2950
2924
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2951
2925
|
// the messaging design system's "small border around link attachments"
|
|
2952
2926
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2953
2927
|
"border border-black/[0.08]",
|
|
2954
2928
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2955
|
-
),
|
|
2929
|
+
), Se = ({
|
|
2956
2930
|
variant: e,
|
|
2957
2931
|
children: t,
|
|
2958
2932
|
href: s,
|
|
@@ -2963,8 +2937,8 @@ const rr = {
|
|
|
2963
2937
|
bgClassName: l,
|
|
2964
2938
|
"data-testid": d
|
|
2965
2939
|
}) => {
|
|
2966
|
-
const m = s != null || a != null,
|
|
2967
|
-
|
|
2940
|
+
const m = s != null || a != null, b = C(
|
|
2941
|
+
ur,
|
|
2968
2942
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2969
2943
|
// `focus-ring` is a design-system utility from the component-library
|
|
2970
2944
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2980,7 +2954,7 @@ const rr = {
|
|
|
2980
2954
|
rel: "noopener noreferrer",
|
|
2981
2955
|
onClick: a,
|
|
2982
2956
|
"data-testid": d,
|
|
2983
|
-
className:
|
|
2957
|
+
className: b,
|
|
2984
2958
|
children: [
|
|
2985
2959
|
t,
|
|
2986
2960
|
u
|
|
@@ -2994,7 +2968,7 @@ const rr = {
|
|
|
2994
2968
|
onClick: a,
|
|
2995
2969
|
"aria-label": r,
|
|
2996
2970
|
"data-testid": d,
|
|
2997
|
-
className: C(
|
|
2971
|
+
className: C(b, "text-left"),
|
|
2998
2972
|
children: [
|
|
2999
2973
|
t,
|
|
3000
2974
|
u
|
|
@@ -3005,24 +2979,24 @@ const rr = {
|
|
|
3005
2979
|
{
|
|
3006
2980
|
ref: i,
|
|
3007
2981
|
"data-testid": d,
|
|
3008
|
-
className:
|
|
2982
|
+
className: b,
|
|
3009
2983
|
children: [
|
|
3010
2984
|
t,
|
|
3011
2985
|
u
|
|
3012
2986
|
]
|
|
3013
2987
|
}
|
|
3014
2988
|
);
|
|
3015
|
-
},
|
|
2989
|
+
}, mr = {
|
|
3016
2990
|
dark: "bg-white/10",
|
|
3017
2991
|
light: "bg-black/5"
|
|
3018
|
-
},
|
|
2992
|
+
}, hr = {
|
|
3019
2993
|
dark: "size-16 text-white/25",
|
|
3020
2994
|
light: "size-16 text-black/25"
|
|
3021
|
-
}, Me = (e, t) => !!t && !!e &&
|
|
2995
|
+
}, Me = (e, t) => !!t && !!e && ne(e) === "audio", hn = (e, t) => {
|
|
3022
2996
|
if (!t || !e) return !1;
|
|
3023
|
-
const s =
|
|
2997
|
+
const s = ne(e);
|
|
3024
2998
|
return s === "video" || s === "audio";
|
|
3025
|
-
},
|
|
2999
|
+
}, tt = "bg-[#F2F3F4]", Ie = ({
|
|
3026
3000
|
variant: e,
|
|
3027
3001
|
thumbnailUrl: t,
|
|
3028
3002
|
sourceUrl: s,
|
|
@@ -3031,7 +3005,7 @@ const rr = {
|
|
|
3031
3005
|
topLeft: i,
|
|
3032
3006
|
topRight: o
|
|
3033
3007
|
}) => {
|
|
3034
|
-
const l =
|
|
3008
|
+
const l = ne(r), d = !!s && l === "video";
|
|
3035
3009
|
return Me(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3036
3010
|
"audio",
|
|
3037
3011
|
{
|
|
@@ -3073,10 +3047,10 @@ const rr = {
|
|
|
3073
3047
|
{
|
|
3074
3048
|
className: C(
|
|
3075
3049
|
"flex h-full w-full items-center justify-center",
|
|
3076
|
-
|
|
3050
|
+
mr[e]
|
|
3077
3051
|
),
|
|
3078
|
-
children:
|
|
3079
|
-
className:
|
|
3052
|
+
children: le(r, {
|
|
3053
|
+
className: hr[e],
|
|
3080
3054
|
weight: "regular"
|
|
3081
3055
|
})
|
|
3082
3056
|
}
|
|
@@ -3086,7 +3060,7 @@ const rr = {
|
|
|
3086
3060
|
]
|
|
3087
3061
|
}
|
|
3088
3062
|
);
|
|
3089
|
-
},
|
|
3063
|
+
}, fr = ({
|
|
3090
3064
|
title: e,
|
|
3091
3065
|
placeholderTitle: t,
|
|
3092
3066
|
description: s,
|
|
@@ -3097,31 +3071,31 @@ const rr = {
|
|
|
3097
3071
|
layout: l = "featured",
|
|
3098
3072
|
appIcon: d,
|
|
3099
3073
|
cta: m,
|
|
3100
|
-
onDismiss:
|
|
3074
|
+
onDismiss: b,
|
|
3101
3075
|
onEditClick: u
|
|
3102
3076
|
}) => {
|
|
3103
|
-
const f = l === "classic", c = Me(r, o),
|
|
3077
|
+
const f = l === "classic", c = Me(r, o), g = b ? /* @__PURE__ */ n(
|
|
3104
3078
|
"button",
|
|
3105
3079
|
{
|
|
3106
3080
|
type: "button",
|
|
3107
|
-
onClick:
|
|
3081
|
+
onClick: b,
|
|
3108
3082
|
"aria-label": "Dismiss attachment",
|
|
3109
3083
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3110
|
-
children: /* @__PURE__ */ n(
|
|
3084
|
+
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3111
3085
|
}
|
|
3112
|
-
) : void 0,
|
|
3086
|
+
) : void 0, v = u ? /* @__PURE__ */ n(
|
|
3113
3087
|
"button",
|
|
3114
3088
|
{
|
|
3115
3089
|
type: "button",
|
|
3116
3090
|
onClick: u,
|
|
3117
3091
|
"aria-label": "Edit attachment",
|
|
3118
3092
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3119
|
-
children: /* @__PURE__ */ n(
|
|
3093
|
+
children: /* @__PURE__ */ n(As, { className: "size-5", weight: "regular" })
|
|
3120
3094
|
}
|
|
3121
3095
|
) : void 0;
|
|
3122
|
-
return c ? /* @__PURE__ */ n(
|
|
3096
|
+
return c ? /* @__PURE__ */ n(Se, { variant: "dark", bgClassName: tt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3123
3097
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3124
|
-
|
|
3098
|
+
Ie,
|
|
3125
3099
|
{
|
|
3126
3100
|
variant: "dark",
|
|
3127
3101
|
sourceUrl: o,
|
|
@@ -3129,26 +3103,26 @@ const rr = {
|
|
|
3129
3103
|
mimeType: r
|
|
3130
3104
|
}
|
|
3131
3105
|
) }),
|
|
3132
|
-
|
|
3106
|
+
g && /* @__PURE__ */ n("div", { className: "shrink-0", children: g })
|
|
3133
3107
|
] }) }) : /* @__PURE__ */ h(
|
|
3134
|
-
|
|
3108
|
+
Se,
|
|
3135
3109
|
{
|
|
3136
3110
|
variant: "dark",
|
|
3137
|
-
topRight: f ?
|
|
3111
|
+
topRight: f ? g : void 0,
|
|
3138
3112
|
children: [
|
|
3139
3113
|
!f && /* @__PURE__ */ n(
|
|
3140
|
-
|
|
3114
|
+
Ie,
|
|
3141
3115
|
{
|
|
3142
3116
|
variant: "dark",
|
|
3143
3117
|
thumbnailUrl: i,
|
|
3144
3118
|
sourceUrl: o,
|
|
3145
3119
|
title: e,
|
|
3146
3120
|
mimeType: r,
|
|
3147
|
-
topRight:
|
|
3121
|
+
topRight: g
|
|
3148
3122
|
}
|
|
3149
3123
|
),
|
|
3150
3124
|
/* @__PURE__ */ n(
|
|
3151
|
-
|
|
3125
|
+
et,
|
|
3152
3126
|
{
|
|
3153
3127
|
variant: "dark",
|
|
3154
3128
|
title: e,
|
|
@@ -3157,13 +3131,13 @@ const rr = {
|
|
|
3157
3131
|
url: a,
|
|
3158
3132
|
appIcon: d,
|
|
3159
3133
|
cta: m,
|
|
3160
|
-
trailingAction:
|
|
3134
|
+
trailingAction: v
|
|
3161
3135
|
}
|
|
3162
3136
|
)
|
|
3163
3137
|
]
|
|
3164
3138
|
}
|
|
3165
3139
|
);
|
|
3166
|
-
},
|
|
3140
|
+
}, gr = ({
|
|
3167
3141
|
title: e,
|
|
3168
3142
|
description: t,
|
|
3169
3143
|
url: s,
|
|
@@ -3175,25 +3149,25 @@ const rr = {
|
|
|
3175
3149
|
cta: d,
|
|
3176
3150
|
onClick: m
|
|
3177
3151
|
}) => {
|
|
3178
|
-
const
|
|
3152
|
+
const b = hn(a, i), u = Qe(s), f = d == null && u != null && !b ? u : void 0, c = d == null && !b ? m : void 0, g = Me(a, i) ? tt : void 0, v = d && m ? {
|
|
3179
3153
|
...d,
|
|
3180
3154
|
onClick: () => {
|
|
3181
|
-
var
|
|
3182
|
-
m(), (
|
|
3155
|
+
var p;
|
|
3156
|
+
m(), (p = d.onClick) == null || p.call(d);
|
|
3183
3157
|
}
|
|
3184
3158
|
} : d;
|
|
3185
3159
|
return /* @__PURE__ */ h(
|
|
3186
|
-
|
|
3160
|
+
Se,
|
|
3187
3161
|
{
|
|
3188
3162
|
variant: "light",
|
|
3189
3163
|
href: f,
|
|
3190
3164
|
onClick: c,
|
|
3191
3165
|
ariaLabel: e ?? "Open attachment preview",
|
|
3192
|
-
bgClassName:
|
|
3166
|
+
bgClassName: g,
|
|
3193
3167
|
"data-testid": "link-attachment",
|
|
3194
3168
|
children: [
|
|
3195
3169
|
o === "featured" && /* @__PURE__ */ n(
|
|
3196
|
-
|
|
3170
|
+
Ie,
|
|
3197
3171
|
{
|
|
3198
3172
|
variant: "light",
|
|
3199
3173
|
thumbnailUrl: r,
|
|
@@ -3203,20 +3177,20 @@ const rr = {
|
|
|
3203
3177
|
}
|
|
3204
3178
|
),
|
|
3205
3179
|
/* @__PURE__ */ n(
|
|
3206
|
-
|
|
3180
|
+
et,
|
|
3207
3181
|
{
|
|
3208
3182
|
variant: "light",
|
|
3209
3183
|
title: e,
|
|
3210
3184
|
description: t,
|
|
3211
3185
|
url: s,
|
|
3212
3186
|
appIcon: l,
|
|
3213
|
-
cta:
|
|
3187
|
+
cta: v
|
|
3214
3188
|
}
|
|
3215
3189
|
)
|
|
3216
3190
|
]
|
|
3217
3191
|
}
|
|
3218
3192
|
);
|
|
3219
|
-
},
|
|
3193
|
+
}, br = ({
|
|
3220
3194
|
title: e,
|
|
3221
3195
|
placeholderTitle: t,
|
|
3222
3196
|
description: s,
|
|
@@ -3227,19 +3201,19 @@ const rr = {
|
|
|
3227
3201
|
layout: l = "featured",
|
|
3228
3202
|
appIcon: d,
|
|
3229
3203
|
cta: m,
|
|
3230
|
-
onClick:
|
|
3204
|
+
onClick: b
|
|
3231
3205
|
}) => {
|
|
3232
|
-
const u = hn(r, o), f =
|
|
3206
|
+
const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0, g = m == null && !u && c != null ? b : void 0;
|
|
3233
3207
|
return /* @__PURE__ */ h(
|
|
3234
|
-
|
|
3208
|
+
Se,
|
|
3235
3209
|
{
|
|
3236
3210
|
variant: "dark",
|
|
3237
3211
|
href: c,
|
|
3238
|
-
onClick:
|
|
3239
|
-
bgClassName: Me(r, o) ?
|
|
3212
|
+
onClick: g,
|
|
3213
|
+
bgClassName: Me(r, o) ? tt : void 0,
|
|
3240
3214
|
children: [
|
|
3241
3215
|
l === "featured" && /* @__PURE__ */ n(
|
|
3242
|
-
|
|
3216
|
+
Ie,
|
|
3243
3217
|
{
|
|
3244
3218
|
variant: "dark",
|
|
3245
3219
|
thumbnailUrl: i,
|
|
@@ -3249,7 +3223,7 @@ const rr = {
|
|
|
3249
3223
|
}
|
|
3250
3224
|
),
|
|
3251
3225
|
/* @__PURE__ */ n(
|
|
3252
|
-
|
|
3226
|
+
et,
|
|
3253
3227
|
{
|
|
3254
3228
|
variant: "dark",
|
|
3255
3229
|
title: e,
|
|
@@ -3263,20 +3237,20 @@ const rr = {
|
|
|
3263
3237
|
]
|
|
3264
3238
|
}
|
|
3265
3239
|
);
|
|
3266
|
-
},
|
|
3267
|
-
Composer:
|
|
3268
|
-
Sent:
|
|
3269
|
-
Received:
|
|
3270
|
-
},
|
|
3240
|
+
}, Ci = {
|
|
3241
|
+
Composer: fr,
|
|
3242
|
+
Sent: br,
|
|
3243
|
+
Received: gr
|
|
3244
|
+
}, pr = {
|
|
3271
3245
|
dark: "bg-[#121110]",
|
|
3272
3246
|
light: "bg-[#e9eaed]"
|
|
3273
|
-
},
|
|
3247
|
+
}, vr = {
|
|
3274
3248
|
dark: "text-white",
|
|
3275
3249
|
light: "text-[#080707]"
|
|
3276
|
-
},
|
|
3250
|
+
}, xr = {
|
|
3277
3251
|
dark: "border-white/[0.08]",
|
|
3278
3252
|
light: "border-black/[0.08]"
|
|
3279
|
-
},
|
|
3253
|
+
}, wr = (e) => e === "dark" ? "sender" : "receiver", Nr = {
|
|
3280
3254
|
sender: {
|
|
3281
3255
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3282
3256
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3289,7 +3263,7 @@ const rr = {
|
|
|
3289
3263
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3290
3264
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3291
3265
|
}
|
|
3292
|
-
},
|
|
3266
|
+
}, ve = ({
|
|
3293
3267
|
variant: e,
|
|
3294
3268
|
text: t,
|
|
3295
3269
|
bordered: s = !0,
|
|
@@ -3298,7 +3272,7 @@ const rr = {
|
|
|
3298
3272
|
children: i,
|
|
3299
3273
|
"data-testid": o
|
|
3300
3274
|
}) => {
|
|
3301
|
-
const l = t != null && t !== "", d = wr
|
|
3275
|
+
const l = t != null && t !== "", d = Nr[wr(e)][a];
|
|
3302
3276
|
return /* @__PURE__ */ h(
|
|
3303
3277
|
"div",
|
|
3304
3278
|
{
|
|
@@ -3313,10 +3287,10 @@ const rr = {
|
|
|
3313
3287
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3314
3288
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3315
3289
|
d,
|
|
3316
|
-
br[e],
|
|
3317
3290
|
pr[e],
|
|
3291
|
+
vr[e],
|
|
3318
3292
|
s && "border",
|
|
3319
|
-
s &&
|
|
3293
|
+
s && xr[e],
|
|
3320
3294
|
r
|
|
3321
3295
|
),
|
|
3322
3296
|
children: [
|
|
@@ -3341,7 +3315,7 @@ const rr = {
|
|
|
3341
3315
|
]
|
|
3342
3316
|
}
|
|
3343
3317
|
);
|
|
3344
|
-
},
|
|
3318
|
+
}, xe = ({
|
|
3345
3319
|
onClick: e,
|
|
3346
3320
|
variant: t = "overlay",
|
|
3347
3321
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3357,18 +3331,18 @@ const rr = {
|
|
|
3357
3331
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3358
3332
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3359
3333
|
),
|
|
3360
|
-
children: /* @__PURE__ */ n(
|
|
3334
|
+
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3361
3335
|
}
|
|
3362
|
-
),
|
|
3336
|
+
), we = (e) => e === "received" ? "light" : "dark", ki = ({
|
|
3363
3337
|
firstOfGroup: e,
|
|
3364
3338
|
endOfGroup: t,
|
|
3365
3339
|
groupedByUser: s
|
|
3366
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3340
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", _r = ({
|
|
3367
3341
|
src: e,
|
|
3368
3342
|
mimeType: t,
|
|
3369
3343
|
filename: s,
|
|
3370
3344
|
items: a
|
|
3371
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3345
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], yr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3372
3346
|
/* @__PURE__ */ n(
|
|
3373
3347
|
"audio",
|
|
3374
3348
|
{
|
|
@@ -3380,7 +3354,7 @@ const rr = {
|
|
|
3380
3354
|
}
|
|
3381
3355
|
),
|
|
3382
3356
|
s ?? null
|
|
3383
|
-
] }),
|
|
3357
|
+
] }), nt = ({
|
|
3384
3358
|
state: e,
|
|
3385
3359
|
src: t,
|
|
3386
3360
|
mimeType: s,
|
|
@@ -3391,41 +3365,41 @@ const rr = {
|
|
|
3391
3365
|
preload: l,
|
|
3392
3366
|
onDismiss: d
|
|
3393
3367
|
}) => {
|
|
3394
|
-
const m =
|
|
3368
|
+
const m = we(e), b = e === "composer" && !!d, u = _r({ src: t, mimeType: s, filename: a, items: r });
|
|
3395
3369
|
if (u.length === 0)
|
|
3396
3370
|
return null;
|
|
3397
3371
|
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
3398
3372
|
return /* @__PURE__ */ n(
|
|
3399
|
-
|
|
3373
|
+
ve,
|
|
3400
3374
|
{
|
|
3401
3375
|
variant: m,
|
|
3402
3376
|
text: i,
|
|
3403
3377
|
groupPosition: o,
|
|
3404
3378
|
"data-testid": "audio-attachment",
|
|
3405
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3406
|
-
|
|
3379
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, g) => /* @__PURE__ */ n(
|
|
3380
|
+
yr,
|
|
3407
3381
|
{
|
|
3408
3382
|
item: c,
|
|
3409
3383
|
preload: f,
|
|
3410
3384
|
trailingAction: (
|
|
3411
3385
|
// Composer only supports a single attachment, so the
|
|
3412
3386
|
// dismiss control sits on the only player.
|
|
3413
|
-
|
|
3387
|
+
b && g === 0 ? /* @__PURE__ */ n(xe, { onClick: d, variant: "inline" }) : void 0
|
|
3414
3388
|
)
|
|
3415
3389
|
},
|
|
3416
|
-
`${c.src}-${
|
|
3390
|
+
`${c.src}-${g}`
|
|
3417
3391
|
)) })
|
|
3418
3392
|
}
|
|
3419
3393
|
);
|
|
3420
|
-
},
|
|
3421
|
-
Composer:
|
|
3422
|
-
Sent:
|
|
3423
|
-
Received:
|
|
3394
|
+
}, Cr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "composer" }), kr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "sent" }), Er = (e) => /* @__PURE__ */ n(nt, { ...e, state: "received" }), Sr = {
|
|
3395
|
+
Composer: Cr,
|
|
3396
|
+
Sent: kr,
|
|
3397
|
+
Received: Er
|
|
3424
3398
|
};
|
|
3425
3399
|
function Ir(e) {
|
|
3426
3400
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
3427
3401
|
}
|
|
3428
|
-
const
|
|
3402
|
+
const Tr = {
|
|
3429
3403
|
pdf: "PDF",
|
|
3430
3404
|
doc: "DOC",
|
|
3431
3405
|
xls: "XLS",
|
|
@@ -3435,7 +3409,7 @@ const Sr = {
|
|
|
3435
3409
|
text: "TXT",
|
|
3436
3410
|
markdown: "MD"
|
|
3437
3411
|
};
|
|
3438
|
-
function
|
|
3412
|
+
function Ar(e, t) {
|
|
3439
3413
|
if (t) {
|
|
3440
3414
|
const r = t.lastIndexOf(".");
|
|
3441
3415
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3444,8 +3418,8 @@ function Tr(e, t) {
|
|
|
3444
3418
|
}
|
|
3445
3419
|
}
|
|
3446
3420
|
if (!e) return;
|
|
3447
|
-
if (
|
|
3448
|
-
const r = Zt(e), i =
|
|
3421
|
+
if (ne(e) === "document") {
|
|
3422
|
+
const r = Zt(e), i = Tr[r];
|
|
3449
3423
|
if (i) return i;
|
|
3450
3424
|
if (e === "application/octet-stream") return;
|
|
3451
3425
|
}
|
|
@@ -3453,11 +3427,11 @@ function Tr(e, t) {
|
|
|
3453
3427
|
if (!(!a || a === "*"))
|
|
3454
3428
|
return a.toUpperCase();
|
|
3455
3429
|
}
|
|
3456
|
-
function
|
|
3457
|
-
const a =
|
|
3430
|
+
function Mr(e, t, s) {
|
|
3431
|
+
const a = Ar(e, t), r = typeof s == "number" && s > 0 ? Ir(s) : void 0;
|
|
3458
3432
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3459
3433
|
}
|
|
3460
|
-
function
|
|
3434
|
+
function Z(e) {
|
|
3461
3435
|
try {
|
|
3462
3436
|
const s = new URL(e).pathname.split("/").pop();
|
|
3463
3437
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -3465,13 +3439,13 @@ function ne(e) {
|
|
|
3465
3439
|
return "download";
|
|
3466
3440
|
}
|
|
3467
3441
|
}
|
|
3468
|
-
const
|
|
3442
|
+
const Rr = {
|
|
3469
3443
|
dark: "text-white/55",
|
|
3470
3444
|
light: "text-black/65"
|
|
3471
|
-
},
|
|
3445
|
+
}, Lr = {
|
|
3472
3446
|
dark: "bg-white/10",
|
|
3473
3447
|
light: "bg-black/5"
|
|
3474
|
-
},
|
|
3448
|
+
}, Dr = {
|
|
3475
3449
|
dark: "text-white/85",
|
|
3476
3450
|
light: "text-black/85"
|
|
3477
3451
|
}, fn = ({
|
|
@@ -3484,16 +3458,16 @@ const Mr = {
|
|
|
3484
3458
|
activateLabel: o,
|
|
3485
3459
|
trailingAction: l
|
|
3486
3460
|
}) => {
|
|
3487
|
-
const d = s ?? t ?? "File", m =
|
|
3461
|
+
const d = s ?? t ?? "File", m = Mr(a, t, r), b = /* @__PURE__ */ n(
|
|
3488
3462
|
"div",
|
|
3489
3463
|
{
|
|
3490
3464
|
className: C(
|
|
3491
3465
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3492
|
-
|
|
3466
|
+
Lr[e]
|
|
3493
3467
|
),
|
|
3494
3468
|
"aria-hidden": !0,
|
|
3495
|
-
children:
|
|
3496
|
-
className: C("size-6",
|
|
3469
|
+
children: le(a, {
|
|
3470
|
+
className: C("size-6", Dr[e]),
|
|
3497
3471
|
weight: "regular"
|
|
3498
3472
|
})
|
|
3499
3473
|
}
|
|
@@ -3504,7 +3478,7 @@ const Mr = {
|
|
|
3504
3478
|
{
|
|
3505
3479
|
className: C(
|
|
3506
3480
|
"truncate text-xs leading-4",
|
|
3507
|
-
|
|
3481
|
+
Rr[e]
|
|
3508
3482
|
),
|
|
3509
3483
|
children: m
|
|
3510
3484
|
}
|
|
@@ -3520,12 +3494,12 @@ const Mr = {
|
|
|
3520
3494
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3521
3495
|
),
|
|
3522
3496
|
children: [
|
|
3523
|
-
|
|
3497
|
+
b,
|
|
3524
3498
|
u
|
|
3525
3499
|
]
|
|
3526
3500
|
}
|
|
3527
|
-
) : /* @__PURE__ */ h(
|
|
3528
|
-
|
|
3501
|
+
) : /* @__PURE__ */ h(te, { children: [
|
|
3502
|
+
b,
|
|
3529
3503
|
u
|
|
3530
3504
|
] });
|
|
3531
3505
|
return /* @__PURE__ */ h("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
@@ -3534,7 +3508,7 @@ const Mr = {
|
|
|
3534
3508
|
] });
|
|
3535
3509
|
};
|
|
3536
3510
|
async function gn(e, t) {
|
|
3537
|
-
const s = t ??
|
|
3511
|
+
const s = t ?? Z(e);
|
|
3538
3512
|
try {
|
|
3539
3513
|
const a = await fetch(e, { mode: "cors" });
|
|
3540
3514
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -3547,21 +3521,21 @@ async function gn(e, t) {
|
|
|
3547
3521
|
}
|
|
3548
3522
|
}
|
|
3549
3523
|
}
|
|
3550
|
-
const
|
|
3524
|
+
const Pr = ({
|
|
3551
3525
|
src: e,
|
|
3552
3526
|
filename: t,
|
|
3553
3527
|
fileSize: s,
|
|
3554
3528
|
mimeType: a,
|
|
3555
3529
|
title: r,
|
|
3556
3530
|
items: i
|
|
3557
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3531
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Or = ({
|
|
3558
3532
|
variant: e,
|
|
3559
3533
|
item: t,
|
|
3560
3534
|
index: s,
|
|
3561
3535
|
onActivate: a,
|
|
3562
3536
|
trailingAction: r
|
|
3563
3537
|
}) => {
|
|
3564
|
-
const i = t.filename ??
|
|
3538
|
+
const i = t.filename ?? Z(t.src);
|
|
3565
3539
|
return /* @__PURE__ */ n(
|
|
3566
3540
|
fn,
|
|
3567
3541
|
{
|
|
@@ -3575,7 +3549,7 @@ const Lr = ({
|
|
|
3575
3549
|
trailingAction: r
|
|
3576
3550
|
}
|
|
3577
3551
|
);
|
|
3578
|
-
},
|
|
3552
|
+
}, st = ({
|
|
3579
3553
|
state: e,
|
|
3580
3554
|
src: t,
|
|
3581
3555
|
filename: s,
|
|
@@ -3586,25 +3560,25 @@ const Lr = ({
|
|
|
3586
3560
|
text: l,
|
|
3587
3561
|
groupPosition: d,
|
|
3588
3562
|
onClick: m,
|
|
3589
|
-
onDismiss:
|
|
3563
|
+
onDismiss: b
|
|
3590
3564
|
}) => {
|
|
3591
|
-
const u =
|
|
3565
|
+
const u = we(e), f = e === "composer" && !!b, c = Pr({
|
|
3592
3566
|
src: t,
|
|
3593
3567
|
filename: s,
|
|
3594
3568
|
fileSize: a,
|
|
3595
3569
|
mimeType: r,
|
|
3596
3570
|
title: i,
|
|
3597
3571
|
items: o
|
|
3598
|
-
}),
|
|
3599
|
-
if ((m == null ? void 0 : m(
|
|
3600
|
-
const
|
|
3601
|
-
if (!
|
|
3602
|
-
const
|
|
3603
|
-
gn(
|
|
3572
|
+
}), g = (p) => {
|
|
3573
|
+
if ((m == null ? void 0 : m(p)) === !1) return;
|
|
3574
|
+
const N = c[p];
|
|
3575
|
+
if (!N) return;
|
|
3576
|
+
const x = N.filename ?? Z(N.src);
|
|
3577
|
+
gn(N.src, x);
|
|
3604
3578
|
};
|
|
3605
3579
|
if (c.length === 0)
|
|
3606
3580
|
return null;
|
|
3607
|
-
const
|
|
3581
|
+
const v = /* @__PURE__ */ n(
|
|
3608
3582
|
"span",
|
|
3609
3583
|
{
|
|
3610
3584
|
className: C(
|
|
@@ -3616,35 +3590,35 @@ const Lr = ({
|
|
|
3616
3590
|
}
|
|
3617
3591
|
);
|
|
3618
3592
|
return /* @__PURE__ */ n(
|
|
3619
|
-
|
|
3593
|
+
ve,
|
|
3620
3594
|
{
|
|
3621
3595
|
variant: u,
|
|
3622
3596
|
text: l,
|
|
3623
3597
|
groupPosition: d,
|
|
3624
3598
|
"data-testid": "file-attachment",
|
|
3625
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3626
|
-
|
|
3599
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, N) => /* @__PURE__ */ n(
|
|
3600
|
+
Or,
|
|
3627
3601
|
{
|
|
3628
3602
|
variant: u,
|
|
3629
|
-
item:
|
|
3630
|
-
index:
|
|
3631
|
-
onActivate:
|
|
3632
|
-
trailingAction: f &&
|
|
3603
|
+
item: p,
|
|
3604
|
+
index: N,
|
|
3605
|
+
onActivate: g,
|
|
3606
|
+
trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : v
|
|
3633
3607
|
},
|
|
3634
|
-
`${
|
|
3608
|
+
`${p.src}-${N}`
|
|
3635
3609
|
)) })
|
|
3636
3610
|
}
|
|
3637
3611
|
);
|
|
3638
|
-
},
|
|
3639
|
-
Composer:
|
|
3640
|
-
Sent:
|
|
3612
|
+
}, zr = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), $r = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), Fr = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), Br = {
|
|
3613
|
+
Composer: zr,
|
|
3614
|
+
Sent: $r,
|
|
3641
3615
|
Received: Fr
|
|
3642
|
-
},
|
|
3616
|
+
}, at = ({
|
|
3643
3617
|
onPrev: e,
|
|
3644
3618
|
onNext: t,
|
|
3645
3619
|
prevLabel: s = "Previous",
|
|
3646
3620
|
nextLabel: a = "Next"
|
|
3647
|
-
}) => /* @__PURE__ */ h(
|
|
3621
|
+
}) => /* @__PURE__ */ h(te, { children: [
|
|
3648
3622
|
/* @__PURE__ */ n(
|
|
3649
3623
|
"button",
|
|
3650
3624
|
{
|
|
@@ -3652,7 +3626,7 @@ const Lr = ({
|
|
|
3652
3626
|
onClick: e,
|
|
3653
3627
|
"aria-label": s,
|
|
3654
3628
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3655
|
-
children: /* @__PURE__ */ n(
|
|
3629
|
+
children: /* @__PURE__ */ n(Ms, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3656
3630
|
}
|
|
3657
3631
|
),
|
|
3658
3632
|
/* @__PURE__ */ n(
|
|
@@ -3662,7 +3636,7 @@ const Lr = ({
|
|
|
3662
3636
|
onClick: t,
|
|
3663
3637
|
"aria-label": a,
|
|
3664
3638
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3665
|
-
children: /* @__PURE__ */ n(
|
|
3639
|
+
children: /* @__PURE__ */ n(Rs, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3666
3640
|
}
|
|
3667
3641
|
)
|
|
3668
3642
|
] }), bn = ({
|
|
@@ -3674,7 +3648,7 @@ const Lr = ({
|
|
|
3674
3648
|
tone: i = "dark",
|
|
3675
3649
|
onTriggered: o
|
|
3676
3650
|
}) => {
|
|
3677
|
-
const [l, d] =
|
|
3651
|
+
const [l, d] = D(!1), m = W(
|
|
3678
3652
|
(c) => {
|
|
3679
3653
|
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3680
3654
|
}).finally(() => {
|
|
@@ -3682,7 +3656,7 @@ const Lr = ({
|
|
|
3682
3656
|
}));
|
|
3683
3657
|
},
|
|
3684
3658
|
[l, e, t, o]
|
|
3685
|
-
),
|
|
3659
|
+
), b = r ?? s !== "pill", f = { className: C(
|
|
3686
3660
|
s === "pill" ? "size-4" : "size-5",
|
|
3687
3661
|
"shrink-0"
|
|
3688
3662
|
), weight: "bold" };
|
|
@@ -3732,7 +3706,7 @@ const Lr = ({
|
|
|
3732
3706
|
type: "button",
|
|
3733
3707
|
onClick: m,
|
|
3734
3708
|
disabled: l,
|
|
3735
|
-
"aria-label":
|
|
3709
|
+
"aria-label": b ? a : void 0,
|
|
3736
3710
|
className: C(
|
|
3737
3711
|
"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
|
|
3738
3712
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
@@ -3746,19 +3720,19 @@ const Lr = ({
|
|
|
3746
3720
|
"aria-hidden": !0
|
|
3747
3721
|
}
|
|
3748
3722
|
) : /* @__PURE__ */ n(be, { ...f, "aria-hidden": !0 }),
|
|
3749
|
-
|
|
3723
|
+
b ? null : a
|
|
3750
3724
|
]
|
|
3751
3725
|
}
|
|
3752
3726
|
);
|
|
3753
|
-
}, $e = (e, t, s) => Math.min(Math.max(e, t), s),
|
|
3727
|
+
}, $e = (e, t, s) => Math.min(Math.max(e, t), s), rt = ({
|
|
3754
3728
|
length: e,
|
|
3755
3729
|
initialIndex: t,
|
|
3756
3730
|
open: s
|
|
3757
3731
|
}) => {
|
|
3758
|
-
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3759
|
-
|
|
3732
|
+
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = D(a);
|
|
3733
|
+
Y(() => {
|
|
3760
3734
|
s && i($e(t, 0, Math.max(e - 1, 0)));
|
|
3761
|
-
}, [s, t, e]),
|
|
3735
|
+
}, [s, t, e]), Y(() => {
|
|
3762
3736
|
i((d) => $e(d, 0, Math.max(e - 1, 0)));
|
|
3763
3737
|
}, [e]);
|
|
3764
3738
|
const o = W(() => {
|
|
@@ -3766,16 +3740,16 @@ const Lr = ({
|
|
|
3766
3740
|
}, [e]), l = W(() => {
|
|
3767
3741
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3768
3742
|
}, [e]);
|
|
3769
|
-
return
|
|
3743
|
+
return Y(() => {
|
|
3770
3744
|
if (!s || e <= 1) return;
|
|
3771
3745
|
const d = (m) => {
|
|
3772
3746
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
3773
|
-
const
|
|
3774
|
-
|
|
3747
|
+
const b = document.activeElement;
|
|
3748
|
+
b && (b.tagName === "VIDEO" || b.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
|
|
3775
3749
|
};
|
|
3776
3750
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3777
3751
|
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
3778
|
-
},
|
|
3752
|
+
}, it = ({
|
|
3779
3753
|
open: e,
|
|
3780
3754
|
onClose: t,
|
|
3781
3755
|
ariaLabel: s,
|
|
@@ -3784,8 +3758,8 @@ const Lr = ({
|
|
|
3784
3758
|
children: i,
|
|
3785
3759
|
"data-testid": o
|
|
3786
3760
|
}) => {
|
|
3787
|
-
const l =
|
|
3788
|
-
return
|
|
3761
|
+
const l = H(null), d = H(null);
|
|
3762
|
+
return Y(() => {
|
|
3789
3763
|
var f;
|
|
3790
3764
|
const u = l.current;
|
|
3791
3765
|
if (u) {
|
|
@@ -3856,7 +3830,7 @@ const Lr = ({
|
|
|
3856
3830
|
onClick: t,
|
|
3857
3831
|
"aria-label": "Close viewer",
|
|
3858
3832
|
className: "mes-media-viewer__action",
|
|
3859
|
-
children: /* @__PURE__ */ n(
|
|
3833
|
+
children: /* @__PURE__ */ n(Ae, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3860
3834
|
}
|
|
3861
3835
|
)
|
|
3862
3836
|
] })
|
|
@@ -3871,16 +3845,16 @@ const Lr = ({
|
|
|
3871
3845
|
initialIndex: s = 0,
|
|
3872
3846
|
onClose: a
|
|
3873
3847
|
}) => {
|
|
3874
|
-
const { index: r, prev: i, next: o } =
|
|
3848
|
+
const { index: r, prev: i, next: o } = rt({
|
|
3875
3849
|
length: t.length,
|
|
3876
3850
|
initialIndex: s,
|
|
3877
3851
|
open: e
|
|
3878
|
-
}), l = t[r], d =
|
|
3879
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3852
|
+
}), l = t[r], d = ee(
|
|
3853
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "image"),
|
|
3880
3854
|
[l]
|
|
3881
3855
|
);
|
|
3882
3856
|
return l ? /* @__PURE__ */ h(
|
|
3883
|
-
|
|
3857
|
+
it,
|
|
3884
3858
|
{
|
|
3885
3859
|
open: e,
|
|
3886
3860
|
onClose: a,
|
|
@@ -3910,7 +3884,7 @@ const Lr = ({
|
|
|
3910
3884
|
`${r}:${l.src}`
|
|
3911
3885
|
),
|
|
3912
3886
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3913
|
-
|
|
3887
|
+
at,
|
|
3914
3888
|
{
|
|
3915
3889
|
onPrev: i,
|
|
3916
3890
|
onNext: o,
|
|
@@ -3921,7 +3895,7 @@ const Lr = ({
|
|
|
3921
3895
|
]
|
|
3922
3896
|
}
|
|
3923
3897
|
) : null;
|
|
3924
|
-
},
|
|
3898
|
+
}, Ur = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", vn = ({
|
|
3925
3899
|
tiles: e,
|
|
3926
3900
|
onTileActivate: t,
|
|
3927
3901
|
maxVisible: s = 4,
|
|
@@ -3929,8 +3903,8 @@ const Lr = ({
|
|
|
3929
3903
|
}) => {
|
|
3930
3904
|
const r = e.length;
|
|
3931
3905
|
if (r === 0) return null;
|
|
3932
|
-
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m,
|
|
3933
|
-
const u = C(
|
|
3906
|
+
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, b) => {
|
|
3907
|
+
const u = C(Ur, "h-full w-full");
|
|
3934
3908
|
return t ? /* @__PURE__ */ h(
|
|
3935
3909
|
"button",
|
|
3936
3910
|
{
|
|
@@ -3940,13 +3914,13 @@ const Lr = ({
|
|
|
3940
3914
|
className: C(u, "cursor-zoom-in"),
|
|
3941
3915
|
children: [
|
|
3942
3916
|
d.content,
|
|
3943
|
-
|
|
3917
|
+
b
|
|
3944
3918
|
]
|
|
3945
3919
|
},
|
|
3946
3920
|
m
|
|
3947
3921
|
) : /* @__PURE__ */ h("div", { className: u, children: [
|
|
3948
3922
|
d.content,
|
|
3949
|
-
|
|
3923
|
+
b
|
|
3950
3924
|
] }, m);
|
|
3951
3925
|
};
|
|
3952
3926
|
return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
@@ -3979,11 +3953,11 @@ const Lr = ({
|
|
|
3979
3953
|
a
|
|
3980
3954
|
),
|
|
3981
3955
|
children: i.map((d, m) => {
|
|
3982
|
-
const
|
|
3956
|
+
const b = o > 0 && m === i.length - 1;
|
|
3983
3957
|
return l(
|
|
3984
3958
|
d,
|
|
3985
3959
|
m,
|
|
3986
|
-
|
|
3960
|
+
b ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
3987
3961
|
"+",
|
|
3988
3962
|
o
|
|
3989
3963
|
] }) : null
|
|
@@ -3991,8 +3965,8 @@ const Lr = ({
|
|
|
3991
3965
|
})
|
|
3992
3966
|
}
|
|
3993
3967
|
);
|
|
3994
|
-
},
|
|
3995
|
-
const [t, s] =
|
|
3968
|
+
}, Ne = (e) => {
|
|
3969
|
+
const [t, s] = D(!1), [a, r] = D(0), i = W(
|
|
3996
3970
|
(l) => {
|
|
3997
3971
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3998
3972
|
},
|
|
@@ -4014,7 +3988,7 @@ const Lr = ({
|
|
|
4014
3988
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4015
3989
|
}
|
|
4016
3990
|
)
|
|
4017
|
-
}),
|
|
3991
|
+
}), Vr = ({
|
|
4018
3992
|
src: e,
|
|
4019
3993
|
alt: t,
|
|
4020
3994
|
items: s
|
|
@@ -4022,8 +3996,8 @@ const Lr = ({
|
|
|
4022
3996
|
src: s.src,
|
|
4023
3997
|
alt: s.alt,
|
|
4024
3998
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4025
|
-
})),
|
|
4026
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } =
|
|
3999
|
+
})), Gr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4000
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ne(
|
|
4027
4001
|
r
|
|
4028
4002
|
);
|
|
4029
4003
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4047,7 +4021,7 @@ const Lr = ({
|
|
|
4047
4021
|
)
|
|
4048
4022
|
}
|
|
4049
4023
|
),
|
|
4050
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4024
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: i }) }) : null,
|
|
4051
4025
|
/* @__PURE__ */ n(
|
|
4052
4026
|
pn,
|
|
4053
4027
|
{
|
|
@@ -4069,58 +4043,58 @@ const Lr = ({
|
|
|
4069
4043
|
loading: l = "lazy",
|
|
4070
4044
|
onClick: d
|
|
4071
4045
|
}) => {
|
|
4072
|
-
const m =
|
|
4046
|
+
const m = Vr({ src: t, alt: s, items: r }), b = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: g } = Ne(
|
|
4073
4047
|
d
|
|
4074
4048
|
);
|
|
4075
4049
|
if (m.length === 0)
|
|
4076
4050
|
return null;
|
|
4077
|
-
const
|
|
4078
|
-
(
|
|
4051
|
+
const v = m.map(
|
|
4052
|
+
(p, N) => jr(p, N, m.length, l)
|
|
4079
4053
|
);
|
|
4080
4054
|
return /* @__PURE__ */ h(
|
|
4081
|
-
|
|
4055
|
+
ve,
|
|
4082
4056
|
{
|
|
4083
|
-
variant:
|
|
4057
|
+
variant: b,
|
|
4084
4058
|
text: i,
|
|
4085
4059
|
groupPosition: o,
|
|
4086
4060
|
"data-testid": "image-attachment",
|
|
4087
4061
|
children: [
|
|
4088
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles:
|
|
4062
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(vn, { tiles: v, onTileActivate: c }) }),
|
|
4089
4063
|
/* @__PURE__ */ n(
|
|
4090
4064
|
pn,
|
|
4091
4065
|
{
|
|
4092
4066
|
open: u,
|
|
4093
4067
|
items: xn(m, a),
|
|
4094
4068
|
initialIndex: f,
|
|
4095
|
-
onClose:
|
|
4069
|
+
onClose: g
|
|
4096
4070
|
}
|
|
4097
4071
|
)
|
|
4098
4072
|
]
|
|
4099
4073
|
}
|
|
4100
4074
|
);
|
|
4101
|
-
},
|
|
4102
|
-
Composer:
|
|
4103
|
-
Sent:
|
|
4104
|
-
Received:
|
|
4105
|
-
},
|
|
4075
|
+
}, Hr = (e) => /* @__PURE__ */ n(Gr, { ...e }), Yr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), qr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), Wr = {
|
|
4076
|
+
Composer: Hr,
|
|
4077
|
+
Sent: Yr,
|
|
4078
|
+
Received: qr
|
|
4079
|
+
}, Xr = ({
|
|
4106
4080
|
open: e,
|
|
4107
4081
|
items: t,
|
|
4108
4082
|
initialIndex: s = 0,
|
|
4109
4083
|
onClose: a
|
|
4110
4084
|
}) => {
|
|
4111
|
-
const { index: r, prev: i, next: o } =
|
|
4085
|
+
const { index: r, prev: i, next: o } = rt({
|
|
4112
4086
|
length: t.length,
|
|
4113
4087
|
initialIndex: s,
|
|
4114
4088
|
open: e
|
|
4115
|
-
}), l = t[r], d =
|
|
4116
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4089
|
+
}), l = t[r], d = ee(
|
|
4090
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "document"),
|
|
4117
4091
|
[l]
|
|
4118
|
-
), m =
|
|
4119
|
-
() => l ?
|
|
4092
|
+
), m = ee(
|
|
4093
|
+
() => l ? Kr(l.src) : void 0,
|
|
4120
4094
|
[l]
|
|
4121
4095
|
);
|
|
4122
4096
|
return !l || !m ? null : /* @__PURE__ */ h(
|
|
4123
|
-
|
|
4097
|
+
it,
|
|
4124
4098
|
{
|
|
4125
4099
|
open: e,
|
|
4126
4100
|
onClose: a,
|
|
@@ -4139,7 +4113,7 @@ const Lr = ({
|
|
|
4139
4113
|
`${r}:${l.src}`
|
|
4140
4114
|
),
|
|
4141
4115
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4142
|
-
|
|
4116
|
+
at,
|
|
4143
4117
|
{
|
|
4144
4118
|
onPrev: i,
|
|
4145
4119
|
onNext: o,
|
|
@@ -4150,23 +4124,23 @@ const Lr = ({
|
|
|
4150
4124
|
]
|
|
4151
4125
|
}
|
|
4152
4126
|
);
|
|
4153
|
-
},
|
|
4127
|
+
}, Kr = (e) => {
|
|
4154
4128
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4155
4129
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4156
|
-
},
|
|
4130
|
+
}, Jr = ({
|
|
4157
4131
|
src: e,
|
|
4158
4132
|
filename: t,
|
|
4159
4133
|
fileSize: s,
|
|
4160
4134
|
title: a,
|
|
4161
4135
|
items: r
|
|
4162
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4136
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], Zr = ({
|
|
4163
4137
|
variant: e,
|
|
4164
4138
|
item: t,
|
|
4165
4139
|
index: s,
|
|
4166
4140
|
onActivate: a,
|
|
4167
4141
|
trailingAction: r
|
|
4168
4142
|
}) => {
|
|
4169
|
-
const i = t.filename ??
|
|
4143
|
+
const i = t.filename ?? Z(t.src);
|
|
4170
4144
|
return /* @__PURE__ */ n(
|
|
4171
4145
|
fn,
|
|
4172
4146
|
{
|
|
@@ -4180,7 +4154,7 @@ const Lr = ({
|
|
|
4180
4154
|
trailingAction: r
|
|
4181
4155
|
}
|
|
4182
4156
|
);
|
|
4183
|
-
},
|
|
4157
|
+
}, ot = ({
|
|
4184
4158
|
state: e,
|
|
4185
4159
|
src: t,
|
|
4186
4160
|
filename: s,
|
|
@@ -4192,78 +4166,78 @@ const Lr = ({
|
|
|
4192
4166
|
onClick: d,
|
|
4193
4167
|
onDismiss: m
|
|
4194
4168
|
}) => {
|
|
4195
|
-
const
|
|
4169
|
+
const b = we(e), u = Jr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: v } = Ne(
|
|
4196
4170
|
d
|
|
4197
|
-
),
|
|
4171
|
+
), p = e === "composer" && !!m;
|
|
4198
4172
|
if (u.length === 0)
|
|
4199
4173
|
return null;
|
|
4200
|
-
const
|
|
4201
|
-
src:
|
|
4202
|
-
filename:
|
|
4174
|
+
const N = u.map((x) => ({
|
|
4175
|
+
src: x.src,
|
|
4176
|
+
filename: x.filename ?? Z(x.src)
|
|
4203
4177
|
}));
|
|
4204
4178
|
return /* @__PURE__ */ h(
|
|
4205
|
-
|
|
4179
|
+
ve,
|
|
4206
4180
|
{
|
|
4207
|
-
variant:
|
|
4181
|
+
variant: b,
|
|
4208
4182
|
text: o,
|
|
4209
4183
|
groupPosition: l,
|
|
4210
4184
|
"data-testid": "pdf-attachment",
|
|
4211
4185
|
children: [
|
|
4212
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4213
|
-
const
|
|
4186
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x, T) => {
|
|
4187
|
+
const S = x.filename ?? Z(x.src), R = p && T === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4214
4188
|
bn,
|
|
4215
4189
|
{
|
|
4216
|
-
url:
|
|
4217
|
-
filename:
|
|
4190
|
+
url: x.src,
|
|
4191
|
+
filename: S,
|
|
4218
4192
|
variant: "inline",
|
|
4219
|
-
label: `Download ${
|
|
4220
|
-
tone:
|
|
4193
|
+
label: `Download ${S}`,
|
|
4194
|
+
tone: b
|
|
4221
4195
|
}
|
|
4222
4196
|
);
|
|
4223
4197
|
return /* @__PURE__ */ n(
|
|
4224
|
-
|
|
4198
|
+
Zr,
|
|
4225
4199
|
{
|
|
4226
|
-
variant:
|
|
4227
|
-
item:
|
|
4228
|
-
index:
|
|
4229
|
-
onActivate:
|
|
4230
|
-
trailingAction:
|
|
4200
|
+
variant: b,
|
|
4201
|
+
item: x,
|
|
4202
|
+
index: T,
|
|
4203
|
+
onActivate: g,
|
|
4204
|
+
trailingAction: R
|
|
4231
4205
|
},
|
|
4232
|
-
`${
|
|
4206
|
+
`${x.src}-${T}`
|
|
4233
4207
|
);
|
|
4234
4208
|
}) }),
|
|
4235
4209
|
/* @__PURE__ */ n(
|
|
4236
|
-
|
|
4210
|
+
Xr,
|
|
4237
4211
|
{
|
|
4238
4212
|
open: f,
|
|
4239
|
-
items:
|
|
4213
|
+
items: N,
|
|
4240
4214
|
initialIndex: c,
|
|
4241
|
-
onClose:
|
|
4215
|
+
onClose: v
|
|
4242
4216
|
}
|
|
4243
4217
|
)
|
|
4244
4218
|
]
|
|
4245
4219
|
}
|
|
4246
4220
|
);
|
|
4247
|
-
},
|
|
4248
|
-
Composer:
|
|
4249
|
-
Sent:
|
|
4250
|
-
Received:
|
|
4221
|
+
}, Qr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), ei = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), ti = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), ni = {
|
|
4222
|
+
Composer: Qr,
|
|
4223
|
+
Sent: ei,
|
|
4224
|
+
Received: ti
|
|
4251
4225
|
}, Nn = ({
|
|
4252
4226
|
open: e,
|
|
4253
4227
|
items: t,
|
|
4254
4228
|
initialIndex: s = 0,
|
|
4255
4229
|
onClose: a
|
|
4256
4230
|
}) => {
|
|
4257
|
-
const { index: r, prev: i, next: o } =
|
|
4231
|
+
const { index: r, prev: i, next: o } = rt({
|
|
4258
4232
|
length: t.length,
|
|
4259
4233
|
initialIndex: s,
|
|
4260
4234
|
open: e
|
|
4261
|
-
}), l = t[r], d =
|
|
4262
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
4235
|
+
}), l = t[r], d = ee(
|
|
4236
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "video"),
|
|
4263
4237
|
[l]
|
|
4264
4238
|
);
|
|
4265
4239
|
return l ? /* @__PURE__ */ h(
|
|
4266
|
-
|
|
4240
|
+
it,
|
|
4267
4241
|
{
|
|
4268
4242
|
open: e,
|
|
4269
4243
|
onClose: a,
|
|
@@ -4287,7 +4261,7 @@ const Lr = ({
|
|
|
4287
4261
|
`${r}:${l.src}`
|
|
4288
4262
|
),
|
|
4289
4263
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4290
|
-
|
|
4264
|
+
at,
|
|
4291
4265
|
{
|
|
4292
4266
|
onPrev: i,
|
|
4293
4267
|
onNext: o,
|
|
@@ -4298,7 +4272,7 @@ const Lr = ({
|
|
|
4298
4272
|
]
|
|
4299
4273
|
}
|
|
4300
4274
|
) : null;
|
|
4301
|
-
},
|
|
4275
|
+
}, si = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(Be, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), _n = ({
|
|
4302
4276
|
item: e,
|
|
4303
4277
|
index: t
|
|
4304
4278
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4313,18 +4287,18 @@ const Lr = ({
|
|
|
4313
4287
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4314
4288
|
}
|
|
4315
4289
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4316
|
-
|
|
4290
|
+
Gt,
|
|
4317
4291
|
{
|
|
4318
4292
|
className: "size-16 rounded-md text-white/30",
|
|
4319
4293
|
weight: "regular",
|
|
4320
4294
|
"aria-hidden": !0
|
|
4321
4295
|
}
|
|
4322
4296
|
) }),
|
|
4323
|
-
/* @__PURE__ */ n(
|
|
4324
|
-
] }),
|
|
4297
|
+
/* @__PURE__ */ n(si, {})
|
|
4298
|
+
] }), ai = (e, t, s) => ({
|
|
4325
4299
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4326
4300
|
content: /* @__PURE__ */ n(_n, { item: e, index: t })
|
|
4327
|
-
}),
|
|
4301
|
+
}), ri = ({
|
|
4328
4302
|
src: e,
|
|
4329
4303
|
poster: t,
|
|
4330
4304
|
mimeType: s,
|
|
@@ -4336,8 +4310,8 @@ const Lr = ({
|
|
|
4336
4310
|
mimeType: s.mimeType,
|
|
4337
4311
|
preload: s.preload,
|
|
4338
4312
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4339
|
-
})),
|
|
4340
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer:
|
|
4313
|
+
})), ii = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4314
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: b } = Ne(
|
|
4341
4315
|
i
|
|
4342
4316
|
);
|
|
4343
4317
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4351,7 +4325,7 @@ const Lr = ({
|
|
|
4351
4325
|
children: /* @__PURE__ */ n(_n, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4352
4326
|
}
|
|
4353
4327
|
),
|
|
4354
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4328
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(xe, { onClick: o }) }) : null,
|
|
4355
4329
|
/* @__PURE__ */ n(
|
|
4356
4330
|
Nn,
|
|
4357
4331
|
{
|
|
@@ -4361,7 +4335,7 @@ const Lr = ({
|
|
|
4361
4335
|
a
|
|
4362
4336
|
),
|
|
4363
4337
|
initialIndex: d,
|
|
4364
|
-
onClose:
|
|
4338
|
+
onClose: b
|
|
4365
4339
|
}
|
|
4366
4340
|
)
|
|
4367
4341
|
] });
|
|
@@ -4377,16 +4351,16 @@ const Lr = ({
|
|
|
4377
4351
|
preload: d,
|
|
4378
4352
|
onClick: m
|
|
4379
4353
|
}) => {
|
|
4380
|
-
const
|
|
4354
|
+
const b = ri({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: v } = Ne(
|
|
4381
4355
|
m
|
|
4382
4356
|
);
|
|
4383
|
-
if (
|
|
4357
|
+
if (b.length === 0)
|
|
4384
4358
|
return null;
|
|
4385
|
-
const
|
|
4386
|
-
(
|
|
4359
|
+
const p = b.map(
|
|
4360
|
+
(N, x) => ai(N, x, b.length)
|
|
4387
4361
|
);
|
|
4388
4362
|
return /* @__PURE__ */ h(
|
|
4389
|
-
|
|
4363
|
+
ve,
|
|
4390
4364
|
{
|
|
4391
4365
|
variant: u,
|
|
4392
4366
|
text: o,
|
|
@@ -4396,8 +4370,8 @@ const Lr = ({
|
|
|
4396
4370
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4397
4371
|
vn,
|
|
4398
4372
|
{
|
|
4399
|
-
tiles:
|
|
4400
|
-
onTileActivate:
|
|
4373
|
+
tiles: p,
|
|
4374
|
+
onTileActivate: g,
|
|
4401
4375
|
className: "overflow-hidden rounded-md"
|
|
4402
4376
|
}
|
|
4403
4377
|
) }),
|
|
@@ -4405,25 +4379,25 @@ const Lr = ({
|
|
|
4405
4379
|
Nn,
|
|
4406
4380
|
{
|
|
4407
4381
|
open: f,
|
|
4408
|
-
items: yn(
|
|
4382
|
+
items: yn(b, r),
|
|
4409
4383
|
initialIndex: c,
|
|
4410
|
-
onClose:
|
|
4384
|
+
onClose: v
|
|
4411
4385
|
}
|
|
4412
4386
|
)
|
|
4413
4387
|
]
|
|
4414
4388
|
}
|
|
4415
4389
|
);
|
|
4416
|
-
},
|
|
4417
|
-
Composer:
|
|
4418
|
-
Sent:
|
|
4419
|
-
Received:
|
|
4420
|
-
},
|
|
4421
|
-
Image:
|
|
4422
|
-
Video:
|
|
4423
|
-
Audio:
|
|
4424
|
-
Pdf:
|
|
4425
|
-
File:
|
|
4426
|
-
},
|
|
4390
|
+
}, oi = (e) => /* @__PURE__ */ n(ii, { ...e }), li = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "sent" }), ci = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "received" }), di = {
|
|
4391
|
+
Composer: oi,
|
|
4392
|
+
Sent: li,
|
|
4393
|
+
Received: ci
|
|
4394
|
+
}, Ei = {
|
|
4395
|
+
Image: Wr,
|
|
4396
|
+
Video: di,
|
|
4397
|
+
Audio: Sr,
|
|
4398
|
+
Pdf: ni,
|
|
4399
|
+
File: Br
|
|
4400
|
+
}, ui = ({
|
|
4427
4401
|
question: e,
|
|
4428
4402
|
onClick: t,
|
|
4429
4403
|
loading: s = !1,
|
|
@@ -4445,7 +4419,7 @@ const Lr = ({
|
|
|
4445
4419
|
),
|
|
4446
4420
|
children: e
|
|
4447
4421
|
}
|
|
4448
|
-
),
|
|
4422
|
+
), Si = ({
|
|
4449
4423
|
faqs: e,
|
|
4450
4424
|
onFaqClick: t,
|
|
4451
4425
|
loadingFaqId: s,
|
|
@@ -4457,7 +4431,7 @@ const Lr = ({
|
|
|
4457
4431
|
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4458
4432
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4459
4433
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4460
|
-
|
|
4434
|
+
ae,
|
|
4461
4435
|
{
|
|
4462
4436
|
id: o || "account",
|
|
4463
4437
|
name: o || "Account",
|
|
@@ -4474,7 +4448,7 @@ const Lr = ({
|
|
|
4474
4448
|
children: [
|
|
4475
4449
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4476
4450
|
l.map((d) => /* @__PURE__ */ n(
|
|
4477
|
-
|
|
4451
|
+
ui,
|
|
4478
4452
|
{
|
|
4479
4453
|
question: d.question,
|
|
4480
4454
|
onClick: () => t(d.id),
|
|
@@ -4489,37 +4463,37 @@ const Lr = ({
|
|
|
4489
4463
|
};
|
|
4490
4464
|
export {
|
|
4491
4465
|
Qt as A,
|
|
4492
|
-
|
|
4493
|
-
|
|
4466
|
+
Vs as B,
|
|
4467
|
+
qa as C,
|
|
4494
4468
|
Ds as D,
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4469
|
+
Si as F,
|
|
4470
|
+
Ci as L,
|
|
4471
|
+
Ni as M,
|
|
4472
|
+
he as a,
|
|
4473
|
+
ae as b,
|
|
4474
|
+
sr as c,
|
|
4501
4475
|
dn as d,
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4476
|
+
_i as e,
|
|
4477
|
+
ui as f,
|
|
4478
|
+
ne as g,
|
|
4479
|
+
Ot as h,
|
|
4480
|
+
Ei as i,
|
|
4481
|
+
_a as j,
|
|
4482
|
+
wi as k,
|
|
4483
|
+
yi as l,
|
|
4484
|
+
Mr as m,
|
|
4511
4485
|
Ir as n,
|
|
4512
|
-
|
|
4513
|
-
|
|
4486
|
+
tr as o,
|
|
4487
|
+
Ar as p,
|
|
4514
4488
|
Xt as q,
|
|
4515
|
-
|
|
4489
|
+
le as r,
|
|
4516
4490
|
nn as s,
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4491
|
+
Os as t,
|
|
4492
|
+
ki as u,
|
|
4493
|
+
Gs as v,
|
|
4494
|
+
Je as w,
|
|
4495
|
+
Ze as x,
|
|
4496
|
+
Wt as y,
|
|
4497
|
+
ba as z
|
|
4524
4498
|
};
|
|
4525
|
-
//# sourceMappingURL=index-
|
|
4499
|
+
//# sourceMappingURL=index-C_NFzAB9.js.map
|