@linktr.ee/messaging-react 2.0.0 → 2.0.1-rc-1778694826
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-CFFNq49v.js +163 -0
- package/dist/Card-CFFNq49v.js.map +1 -0
- package/dist/Card-CsJvUF_b.js +107 -0
- package/dist/Card-CsJvUF_b.js.map +1 -0
- package/dist/Card-D32U6KfZ.js +85 -0
- package/dist/Card-D32U6KfZ.js.map +1 -0
- package/dist/Card-DlMSDSdm.js +132 -0
- package/dist/Card-DlMSDSdm.js.map +1 -0
- package/dist/Card-DlSSJPip.js +60 -0
- package/dist/Card-DlSSJPip.js.map +1 -0
- package/dist/Card-zGbhRBwv.js +48 -0
- package/dist/Card-zGbhRBwv.js.map +1 -0
- package/dist/CardThumbnail-DTBuRQHF.js +239 -0
- package/dist/CardThumbnail-DTBuRQHF.js.map +1 -0
- package/dist/LockedThumbnail-DpJx169C.js +220 -0
- package/dist/LockedThumbnail-DpJx169C.js.map +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{index-Brz9orsI.js → index-DfcRe-Hj.js} +939 -889
- package/dist/index-DfcRe-Hj.js.map +1 -0
- package/dist/index.d.ts +217 -28
- package/dist/index.js +16 -15
- package/package.json +1 -1
- package/src/components/ChannelView.test.tsx +11 -0
- package/src/components/ChannelView.tsx +35 -32
- package/src/components/CustomMessage/index.tsx +2 -3
- package/src/components/CustomTypingIndicator/CustomTypingIndicator.stories.tsx +57 -17
- package/src/components/CustomTypingIndicator/CustomTypingIndicator.test.tsx +187 -0
- package/src/components/CustomTypingIndicator/DmAgentContext.ts +3 -0
- package/src/components/CustomTypingIndicator/index.tsx +101 -37
- package/src/components/LinkAttachment/LinkAttachment.stories.tsx +307 -0
- package/src/components/LinkAttachment/components/Composer/Card.tsx +117 -0
- package/src/components/LinkAttachment/components/Composer/index.ts +2 -0
- package/src/components/LinkAttachment/components/Received/Card.tsx +132 -0
- package/src/components/LinkAttachment/components/Received/index.ts +2 -0
- package/src/components/LinkAttachment/components/Sent/Card.tsx +57 -0
- package/src/components/LinkAttachment/components/Sent/index.ts +2 -0
- package/src/components/LinkAttachment/components/_shared/CardBody.tsx +117 -0
- package/src/components/LinkAttachment/components/_shared/CardCta.tsx +69 -0
- package/src/components/LinkAttachment/components/_shared/CardShell.tsx +120 -0
- package/src/components/LinkAttachment/components/_shared/CardThumbnail.tsx +156 -0
- package/src/components/LinkAttachment/components/_shared/normalizeExternalHref.ts +56 -0
- package/src/components/LinkAttachment/index.tsx +68 -0
- package/src/components/LinkAttachment/types.ts +69 -0
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +230 -89
- package/src/components/LockedAttachment/components/Composer/Card.tsx +221 -0
- package/src/components/LockedAttachment/components/Composer/index.ts +2 -0
- package/src/components/LockedAttachment/components/Received/Card.tsx +191 -0
- package/src/components/LockedAttachment/components/Received/CardActions.tsx +91 -0
- package/src/components/LockedAttachment/components/Received/index.ts +2 -0
- package/src/components/LockedAttachment/components/Sent/Card.tsx +177 -0
- package/src/components/LockedAttachment/components/Sent/index.ts +2 -0
- package/src/components/LockedAttachment/components/_shared/CardBody.tsx +94 -0
- package/src/components/LockedAttachment/components/_shared/GalleryThumbnail.tsx +178 -0
- package/src/components/LockedAttachment/components/_shared/LockBadge.tsx +39 -0
- package/src/components/LockedAttachment/components/_shared/LockedCardShell.tsx +36 -0
- package/src/components/LockedAttachment/components/_shared/LockedThumbnail.tsx +128 -0
- package/src/components/LockedAttachment/index.tsx +43 -12
- package/src/components/LockedAttachment/types.ts +17 -0
- package/src/components/MediaMessage/index.tsx +8 -2
- package/src/index.ts +15 -1
- package/src/styles.css +7 -0
- package/dist/Card-BHknCeHw.js +0 -138
- package/dist/Card-BHknCeHw.js.map +0 -1
- package/dist/Card-DT7_ms2p.js +0 -127
- package/dist/Card-DT7_ms2p.js.map +0 -1
- package/dist/index-Brz9orsI.js.map +0 -1
- package/src/components/LockedAttachment/components/Creator/Card.tsx +0 -210
- package/src/components/LockedAttachment/components/Creator/index.tsx +0 -2
- package/src/components/LockedAttachment/components/Visitor/Card.tsx +0 -155
- package/src/components/LockedAttachment/components/Visitor/CardActions.tsx +0 -62
- package/src/components/LockedAttachment/components/Visitor/LockBadge.tsx +0 -12
- package/src/components/LockedAttachment/components/Visitor/index.ts +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as t, jsxs as d, Fragment as de } from "react/jsx-runtime";
|
|
2
2
|
import D from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import L, { createContext as Fe, useContext as Oe, useCallback as G, useState as P, useRef as J, useEffect as q, useMemo as xe, Suspense as ue } from "react";
|
|
4
|
+
import { StreamChatService as Vt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Ht, ChannelList as Yt, DateSeparator as qt, useChannelStateContext as oe, useChatContext as Pe, areMessageUIPropsEqual as Wt, useMessageReminder as Xt, useComponentContext as wt, Attachment as Zt, EditMessageModal as Jt, MessageBlocked as Kt, MessageBouncePrompt as Qt, MessageDeleted as es, MessageIsThreadReplyInChannelButtonIndicator as ts, MessageRepliesCountButton as ss, ReminderNotification as ns, StreamedMessageText as as, messageHasAttachments as rs, messageHasReactions as is, isDateSeparatorMessage as os, isMessageBlocked as ls, isMessageBounced as cs, MessageBounceModal as ds, MessageText as ot, Poll as us, MessageErrorIcon as ms, useMessageContext as _t, useMessageComposer as hs, useStateStore as fs, MessageInput as gs, useMessageInputContext as bs, useMessageComposerHasSendableData as ps, SimpleAttachmentSelector as xs, QuotedMessagePreview as vs, AttachmentPreviewList as ws, TextareaComposer as _s, MessageTimestamp as Ee, AIStates as Se, useTypingContext as ys, useAIState as Ns, Channel as Cs, WithComponents as Es, Window as Ss, MessageList as Is } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as De, GiftIcon as ks, XIcon as yt, SpinnerGapIcon as Ie, SignOutIcon as Ts, ProhibitInsetIcon as lt, FlagIcon as Ms, FileIcon as Nt, ImageIcon as Ds, SpeakerHighIcon as Rs, VideoCameraIcon as Ls, FileMdIcon as As, FileTextIcon as Fs, FileZipIcon as Os, FilePptIcon as Ps, FileCsvIcon as zs, FileXlsIcon as $s, FileDocIcon as Bs, FilePdfIcon as Us, CircleNotchIcon as Ct, PlayIcon as ct, PauseIcon as js, LinkIcon as Gs, DownloadSimpleIcon as Vs, ThumbsUpIcon as Hs, ThumbsDownIcon as Ys, ArrowUpIcon as qs, SparkleIcon as Re, ProhibitIcon as Ws, ArrowLeftIcon as dt, CaretRightIcon as ut, DotsThreeIcon as mt } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as ht } from "stream-chat";
|
|
8
|
+
const Et = Fe({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const yt = ht({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), ze = () => Oe(Et), Da = ({
|
|
19
19
|
children: e,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -24,8 +24,8 @@ const yt = ht({
|
|
|
24
24
|
debug: l = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const i = G(
|
|
27
|
-
(k, ...
|
|
28
|
-
l && console.log(`🔥 [MessagingProvider] ${k}`, ...
|
|
27
|
+
(k, ...M) => {
|
|
28
|
+
l && console.log(`🔥 [MessagingProvider] ${k}`, ...M);
|
|
29
29
|
},
|
|
30
30
|
[l]
|
|
31
31
|
);
|
|
@@ -35,28 +35,28 @@ const yt = ht({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [c, f] =
|
|
38
|
+
const [c, f] = P(null), [g, _] = P(null), [m, h] = P(!1), [r, b] = P(!1), [w, x] = P(null), N = J(!1), p = J({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: a,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: o
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), I = J(0);
|
|
44
|
+
I.current++, i("📊 RENDER INFO", {
|
|
45
|
+
renderCount: I.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: p.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: p.current.apiKey !== a,
|
|
50
|
+
serviceConfigChanged: p.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: p.current.capabilities !== o
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), p.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: a,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: o
|
|
58
58
|
}, q(() => {
|
|
59
|
-
const k =
|
|
59
|
+
const k = I.current;
|
|
60
60
|
if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: k,
|
|
62
62
|
apiKey: !!a,
|
|
@@ -64,8 +64,8 @@ const yt = ht({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: p.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: p.current.apiKey === a
|
|
69
69
|
}
|
|
70
70
|
}), !a || !n) {
|
|
71
71
|
i("⚠️ SERVICE INIT SKIPPED", {
|
|
@@ -77,32 +77,32 @@ const yt = ht({
|
|
|
77
77
|
i("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: k,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: p.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const M = new Vt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: a,
|
|
85
85
|
debug: l
|
|
86
86
|
});
|
|
87
|
-
return f(
|
|
87
|
+
return f(M), i("✅ SERVICE SET", {
|
|
88
88
|
renderCount: k,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!M
|
|
90
90
|
}), () => {
|
|
91
91
|
i("🧹 SERVICE CLEANUP", {
|
|
92
92
|
renderCount: k,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), M.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [a, n, l, i]);
|
|
97
|
-
const
|
|
97
|
+
const S = J(null);
|
|
98
98
|
q(() => {
|
|
99
|
-
var
|
|
99
|
+
var M, j;
|
|
100
100
|
if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
104
|
isConnecting: N.current,
|
|
105
|
-
isConnected:
|
|
105
|
+
isConnected: m,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
108
|
i("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
@@ -112,7 +112,7 @@ const yt = ht({
|
|
|
112
112
|
i("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((M = S.current) == null ? void 0 : M.serviceId) === c && ((j = S.current) == null ? void 0 : j.userId) === s.id) {
|
|
116
116
|
i(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,40 +120,40 @@ const yt = ht({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
i("🚀 STARTING USER CONNECTION", { userId: s.id }), N.current = !0,
|
|
123
|
+
i("🚀 STARTING USER CONNECTION", { userId: s.id }), N.current = !0, b(!0), x(null);
|
|
124
124
|
try {
|
|
125
125
|
i("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const y = await c.connectUser(s);
|
|
127
|
+
_(y), h(!0), S.current = { serviceId: c, userId: s.id }, i("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: y.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (y) {
|
|
132
|
+
const A = y instanceof Error ? y.message : "Connection failed";
|
|
133
|
+
x(A), i("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: A
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
b(!1), N.current = !1, i("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: m
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, i,
|
|
144
|
+
}, [c, s, i, m]), q(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: m
|
|
147
147
|
}), () => {
|
|
148
|
-
c &&
|
|
148
|
+
c && m ? (i(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), S.current = null, c.disconnectUser().catch(console.error)) : i("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: m
|
|
154
154
|
});
|
|
155
|
-
}), [c,
|
|
156
|
-
const
|
|
155
|
+
}), [c, m, i]);
|
|
156
|
+
const T = G(async () => {
|
|
157
157
|
if (i("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,78 +161,78 @@ const yt = ht({
|
|
|
161
161
|
i("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
i("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), b(!0);
|
|
165
165
|
try {
|
|
166
166
|
i("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), i("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const k = await c.connectUser(s);
|
|
168
|
-
|
|
168
|
+
_(k), h(!0), x(null), i("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (k) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const M = k instanceof Error ? k.message : "Refresh failed";
|
|
171
|
+
x(M), i("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: M
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
b(!1), i("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s, i]),
|
|
178
|
+
}, [c, s, i]), U = L.useMemo(() => (i("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
180
|
+
hasClient: !!g,
|
|
181
|
+
isConnected: m,
|
|
182
182
|
isLoading: r,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!w,
|
|
184
184
|
capabilitiesKeys: Object.keys(o)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
187
|
+
client: g,
|
|
188
|
+
isConnected: m,
|
|
189
189
|
isLoading: r,
|
|
190
|
-
error:
|
|
190
|
+
error: w,
|
|
191
191
|
capabilities: o,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: T,
|
|
193
193
|
debug: l
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
g,
|
|
197
|
+
m,
|
|
198
198
|
r,
|
|
199
|
-
|
|
199
|
+
w,
|
|
200
200
|
o,
|
|
201
|
-
|
|
201
|
+
T,
|
|
202
202
|
l,
|
|
203
203
|
i
|
|
204
204
|
]);
|
|
205
205
|
return i("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady:
|
|
209
|
-
}), /* @__PURE__ */ t(
|
|
210
|
-
|
|
206
|
+
renderCount: I.current,
|
|
207
|
+
willRenderChat: !!(g && m),
|
|
208
|
+
contextValueReady: !!U
|
|
209
|
+
}), /* @__PURE__ */ t(Et.Provider, { value: U, children: g && m ? /* @__PURE__ */ t(
|
|
210
|
+
Ht,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: g,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: e
|
|
217
217
|
}
|
|
218
218
|
) : e });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, Xs = () => ze();
|
|
220
|
+
function Zs(e) {
|
|
221
221
|
const s = e.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
e.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const St = L.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0,
|
|
232
232
|
viewerLanguage: void 0
|
|
233
|
-
}),
|
|
233
|
+
}), Js = St.Provider, Ks = () => L.useContext(St), It = (e) => {
|
|
234
234
|
var a, o;
|
|
235
|
-
const [s, n] =
|
|
235
|
+
const [s, n] = P(
|
|
236
236
|
!!((o = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && o.pinned_at)
|
|
237
237
|
);
|
|
238
238
|
return q(() => {
|
|
@@ -252,18 +252,18 @@ const _t = B.createContext({
|
|
|
252
252
|
e.off("member.updated", l);
|
|
253
253
|
};
|
|
254
254
|
}, [e]), s;
|
|
255
|
-
},
|
|
255
|
+
}, Qs = (e, s) => {
|
|
256
256
|
const n = new Date(
|
|
257
257
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
258
258
|
), o = new Date(
|
|
259
259
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
260
260
|
).getTime() - n.getTime();
|
|
261
261
|
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
262
|
-
},
|
|
262
|
+
}, en = (e) => {
|
|
263
263
|
const s = /* @__PURE__ */ new Date();
|
|
264
264
|
if (Math.floor((s.getTime() - e.getTime()) / 1e3) < 60)
|
|
265
265
|
return "Just now";
|
|
266
|
-
const a =
|
|
266
|
+
const a = Qs(e, s);
|
|
267
267
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
268
268
|
hour: "numeric",
|
|
269
269
|
minute: "2-digit",
|
|
@@ -274,18 +274,18 @@ const _t = B.createContext({
|
|
|
274
274
|
year: "2-digit"
|
|
275
275
|
});
|
|
276
276
|
};
|
|
277
|
-
function
|
|
277
|
+
function tn(e) {
|
|
278
278
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function kt({
|
|
281
281
|
message: e,
|
|
282
282
|
viewerLanguage: s
|
|
283
283
|
}) {
|
|
284
284
|
var o;
|
|
285
|
-
const n = e == null ? void 0 : e.text, a =
|
|
285
|
+
const n = e == null ? void 0 : e.text, a = tn(s);
|
|
286
286
|
return a ? ((o = e == null ? void 0 : e.i18n) == null ? void 0 : o[`${a}_text`]) ?? n : n;
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const ft = [
|
|
289
289
|
"🍎",
|
|
290
290
|
// Apple
|
|
291
291
|
"🍌",
|
|
@@ -313,7 +313,7 @@ const lt = [
|
|
|
313
313
|
"🍈"
|
|
314
314
|
// Melon
|
|
315
315
|
];
|
|
316
|
-
function
|
|
316
|
+
function sn(e) {
|
|
317
317
|
let s = 0;
|
|
318
318
|
for (let n = 0; n < e.length; n++) {
|
|
319
319
|
const a = e.charCodeAt(n);
|
|
@@ -321,9 +321,9 @@ function Xs(e) {
|
|
|
321
321
|
}
|
|
322
322
|
return Math.abs(s);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const n =
|
|
326
|
-
return
|
|
324
|
+
function nn(e) {
|
|
325
|
+
const n = sn(e) % ft.length;
|
|
326
|
+
return ft[n];
|
|
327
327
|
}
|
|
328
328
|
const ae = ({
|
|
329
329
|
id: e,
|
|
@@ -334,10 +334,10 @@ const ae = ({
|
|
|
334
334
|
shape: l = "squircle",
|
|
335
335
|
dmAgentEnabled: i = !1
|
|
336
336
|
}) => {
|
|
337
|
-
const c =
|
|
337
|
+
const c = nn(e), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", _ = n >= 40 ? 2 : 1, m = l === "circle" ? { borderRadius: "50%" } : {
|
|
338
338
|
borderRadius: "33%",
|
|
339
339
|
cornerShape: "superellipse(1.3)"
|
|
340
|
-
},
|
|
340
|
+
}, h = /* @__PURE__ */ t("div", { className: "h-full w-full overflow-hidden", style: m, children: s ? /* @__PURE__ */ t(
|
|
341
341
|
"img",
|
|
342
342
|
{
|
|
343
343
|
src: s,
|
|
@@ -350,7 +350,7 @@ const ae = ({
|
|
|
350
350
|
"aria-hidden": "true",
|
|
351
351
|
className: D(
|
|
352
352
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
353
|
-
|
|
353
|
+
g
|
|
354
354
|
),
|
|
355
355
|
children: c
|
|
356
356
|
}
|
|
@@ -373,7 +373,7 @@ const ae = ({
|
|
|
373
373
|
{
|
|
374
374
|
"aria-hidden": "true",
|
|
375
375
|
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)]",
|
|
376
|
-
children: /* @__PURE__ */ t(
|
|
376
|
+
children: /* @__PURE__ */ t(De, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
377
377
|
}
|
|
378
378
|
),
|
|
379
379
|
/* @__PURE__ */ t(
|
|
@@ -385,21 +385,21 @@ const ae = ({
|
|
|
385
385
|
"bg-transparent"
|
|
386
386
|
),
|
|
387
387
|
style: {
|
|
388
|
-
...
|
|
388
|
+
...m,
|
|
389
389
|
...i && {
|
|
390
|
-
borderWidth: `${
|
|
390
|
+
borderWidth: `${_}px`,
|
|
391
391
|
borderStyle: "solid",
|
|
392
392
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
393
393
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
394
394
|
}
|
|
395
395
|
},
|
|
396
|
-
children:
|
|
396
|
+
children: h
|
|
397
397
|
}
|
|
398
398
|
)
|
|
399
399
|
]
|
|
400
400
|
}
|
|
401
401
|
);
|
|
402
|
-
},
|
|
402
|
+
}, an = ({ size: e = 15 }) => /* @__PURE__ */ t(
|
|
403
403
|
"svg",
|
|
404
404
|
{
|
|
405
405
|
width: e,
|
|
@@ -416,94 +416,94 @@ const ae = ({
|
|
|
416
416
|
}
|
|
417
417
|
)
|
|
418
418
|
}
|
|
419
|
-
),
|
|
419
|
+
), rn = (e) => {
|
|
420
420
|
var s;
|
|
421
421
|
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
422
|
-
},
|
|
422
|
+
}, on = (e) => {
|
|
423
423
|
var s;
|
|
424
424
|
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
425
|
-
},
|
|
425
|
+
}, we = (e) => {
|
|
426
426
|
var s;
|
|
427
427
|
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
428
|
-
},
|
|
428
|
+
}, ln = (e) => {
|
|
429
429
|
var s;
|
|
430
430
|
return ((s = e.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
431
|
-
},
|
|
431
|
+
}, Tt = (e) => rn(e) || on(e), cn = (e) => {
|
|
432
432
|
var s;
|
|
433
|
-
return
|
|
434
|
-
},
|
|
433
|
+
return Tt(e) && !((s = e.text) != null && s.trim());
|
|
434
|
+
}, ke = ({
|
|
435
435
|
message: e,
|
|
436
436
|
standalone: s = !1,
|
|
437
437
|
isMyMessage: n = !1,
|
|
438
438
|
hasAttachment: a = !1
|
|
439
439
|
}) => {
|
|
440
|
-
var
|
|
441
|
-
const o =
|
|
440
|
+
var m;
|
|
441
|
+
const o = Tt(e), l = we(e);
|
|
442
442
|
if (!o && !l)
|
|
443
443
|
return null;
|
|
444
444
|
if (o) {
|
|
445
|
-
const
|
|
446
|
-
if (!
|
|
447
|
-
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
445
|
+
const h = (m = e.metadata) == null ? void 0 : m.amount_text;
|
|
446
|
+
if (!h) return null;
|
|
447
|
+
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", b = s ? `${h} tip` : `Delivered with ${h} tip`;
|
|
448
448
|
return /* @__PURE__ */ d("div", { className: r, children: [
|
|
449
|
-
/* @__PURE__ */ t(
|
|
450
|
-
/* @__PURE__ */ t("span", { children:
|
|
449
|
+
/* @__PURE__ */ t(ks, { size: s ? 14 : 12 }),
|
|
450
|
+
/* @__PURE__ */ t("span", { children: b })
|
|
451
451
|
] });
|
|
452
452
|
}
|
|
453
453
|
const i = n && a, c = i ? "Sent with AI" : "Sent with DM Agent", f = [
|
|
454
454
|
"message-chatbot-indicator",
|
|
455
455
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
456
456
|
i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
457
|
-
].join(" "),
|
|
457
|
+
].join(" "), g = /* @__PURE__ */ t("span", { className: "message-chatbot-indicator__label", children: c }), _ = /* @__PURE__ */ t("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ t(an, { size: i ? 12 : 15 }) });
|
|
458
458
|
return /* @__PURE__ */ t("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(de, { children: [
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
g,
|
|
460
|
+
_
|
|
461
461
|
] }) : /* @__PURE__ */ d(de, { children: [
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
_,
|
|
463
|
+
g
|
|
464
464
|
] }) });
|
|
465
|
-
},
|
|
465
|
+
}, Mt = L.memo(
|
|
466
466
|
({ channel: e, unread: s }) => {
|
|
467
|
-
var
|
|
467
|
+
var U, k, M, j;
|
|
468
468
|
const {
|
|
469
469
|
selectedChannel: n,
|
|
470
470
|
onChannelSelect: a,
|
|
471
471
|
debug: o,
|
|
472
472
|
renderMessagePreview: l,
|
|
473
473
|
viewerLanguage: i
|
|
474
|
-
} =
|
|
474
|
+
} = Ks(), c = (n == null ? void 0 : n.id) === (e == null ? void 0 : e.id), f = () => {
|
|
475
475
|
e && a(e);
|
|
476
|
-
},
|
|
477
|
-
const
|
|
478
|
-
!
|
|
479
|
-
},
|
|
480
|
-
(
|
|
481
|
-
var
|
|
482
|
-
return ((
|
|
476
|
+
}, g = (y) => {
|
|
477
|
+
const A = y.key === "Enter" || y.key === " ", v = y.repeat;
|
|
478
|
+
!A || v || (y.preventDefault(), f());
|
|
479
|
+
}, m = Object.values(((U = e == null ? void 0 : e.state) == null ? void 0 : U.members) || {}).find(
|
|
480
|
+
(y) => {
|
|
481
|
+
var A, v;
|
|
482
|
+
return ((A = y.user) == null ? void 0 : A.id) && y.user.id !== ((v = e == null ? void 0 : e._client) == null ? void 0 : v.userID);
|
|
483
483
|
}
|
|
484
|
-
),
|
|
485
|
-
var
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
for (let v =
|
|
489
|
-
if (
|
|
484
|
+
), h = ((k = m == null ? void 0 : m.user) == null ? void 0 : k.name) || "Conversation", r = (M = m == null ? void 0 : m.user) == null ? void 0 : M.image, b = (() => {
|
|
485
|
+
var A;
|
|
486
|
+
const y = (A = e == null ? void 0 : e.state) == null ? void 0 : A.messages;
|
|
487
|
+
if (y != null && y.length) {
|
|
488
|
+
for (let v = y.length - 1; v >= 0; v--)
|
|
489
|
+
if (y[v].type !== "system") return y[v];
|
|
490
490
|
}
|
|
491
|
-
})(),
|
|
492
|
-
var
|
|
493
|
-
const
|
|
494
|
-
message:
|
|
491
|
+
})(), x = (() => {
|
|
492
|
+
var F, V;
|
|
493
|
+
const y = kt({
|
|
494
|
+
message: b,
|
|
495
495
|
viewerLanguage: i
|
|
496
496
|
});
|
|
497
|
-
if (
|
|
498
|
-
if (((
|
|
499
|
-
const v = (V =
|
|
497
|
+
if (y) return y;
|
|
498
|
+
if (((F = b == null ? void 0 : b.metadata) == null ? void 0 : F.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
499
|
+
const v = (V = b == null ? void 0 : b.attachments) == null ? void 0 : V[0];
|
|
500
500
|
return v ? v.og_scrape_url ? v.og_scrape_url : v.type === "image" ? "📷 Sent an image" : v.type === "video" ? "🎥 Sent a video" : v.type === "audio" ? "🎵 Sent audio" : v.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
501
|
-
})(), N =
|
|
501
|
+
})(), N = b != null && b.created_at ? en(new Date(b.created_at)) : "", p = b ? we(b) : !1, I = l ? l(b, x) : `${p ? "✨ " : ""}${x}`, S = It(e), T = s ?? 0;
|
|
502
502
|
return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
503
503
|
channelId: e == null ? void 0 : e.id,
|
|
504
504
|
isSelected: c,
|
|
505
|
-
participantName:
|
|
506
|
-
unreadCount:
|
|
505
|
+
participantName: h,
|
|
506
|
+
unreadCount: T,
|
|
507
507
|
hasTimestamp: !!N
|
|
508
508
|
}), /* @__PURE__ */ t(
|
|
509
509
|
"div",
|
|
@@ -511,7 +511,7 @@ const ae = ({
|
|
|
511
511
|
role: "button",
|
|
512
512
|
tabIndex: 0,
|
|
513
513
|
onClick: f,
|
|
514
|
-
onKeyDown:
|
|
514
|
+
onKeyDown: g,
|
|
515
515
|
className: D(
|
|
516
516
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
517
517
|
{
|
|
@@ -523,11 +523,11 @@ const ae = ({
|
|
|
523
523
|
/* @__PURE__ */ t(
|
|
524
524
|
ae,
|
|
525
525
|
{
|
|
526
|
-
id: ((j =
|
|
527
|
-
name:
|
|
526
|
+
id: ((j = m == null ? void 0 : m.user) == null ? void 0 : j.id) || e.id || "unknown",
|
|
527
|
+
name: h,
|
|
528
528
|
image: r,
|
|
529
529
|
size: 44,
|
|
530
|
-
starred:
|
|
530
|
+
starred: S,
|
|
531
531
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
532
532
|
}
|
|
533
533
|
),
|
|
@@ -541,16 +541,16 @@ const ae = ({
|
|
|
541
541
|
c ? "text-primary" : "text-charcoal"
|
|
542
542
|
),
|
|
543
543
|
children: [
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
S && /* @__PURE__ */ t("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
545
|
+
h
|
|
546
546
|
]
|
|
547
547
|
}
|
|
548
548
|
),
|
|
549
549
|
N && /* @__PURE__ */ t("span", { className: "text-xs text-stone flex-shrink-0", children: N })
|
|
550
550
|
] }),
|
|
551
551
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
552
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
553
|
-
|
|
552
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
|
|
553
|
+
T > 0 && /* @__PURE__ */ t("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: T > 99 ? "99+" : T })
|
|
554
554
|
] })
|
|
555
555
|
] })
|
|
556
556
|
] })
|
|
@@ -558,8 +558,8 @@ const ae = ({
|
|
|
558
558
|
);
|
|
559
559
|
}
|
|
560
560
|
);
|
|
561
|
-
|
|
562
|
-
const
|
|
561
|
+
Mt.displayName = "CustomChannelPreview";
|
|
562
|
+
const dn = { last_message_at: -1 }, Dt = L.memo(
|
|
563
563
|
({
|
|
564
564
|
onChannelSelect: e,
|
|
565
565
|
selectedChannel: s,
|
|
@@ -568,41 +568,41 @@ const sn = { last_message_at: -1 }, It = B.memo(
|
|
|
568
568
|
onMessageNew: o,
|
|
569
569
|
onAddedToChannel: l,
|
|
570
570
|
channelRenderFilterFn: i,
|
|
571
|
-
sort: c =
|
|
571
|
+
sort: c = dn,
|
|
572
572
|
className: f,
|
|
573
|
-
customEmptyStateIndicator:
|
|
574
|
-
renderMessagePreview:
|
|
575
|
-
viewerLanguage:
|
|
573
|
+
customEmptyStateIndicator: g,
|
|
574
|
+
renderMessagePreview: _,
|
|
575
|
+
viewerLanguage: m
|
|
576
576
|
}) => {
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
const { debug: r = !1 } =
|
|
580
|
-
(
|
|
581
|
-
for (const N of
|
|
582
|
-
|
|
583
|
-
return i ? i(
|
|
577
|
+
const h = L.useRef(0);
|
|
578
|
+
h.current++;
|
|
579
|
+
const { debug: r = !1 } = ze(), b = L.useCallback(
|
|
580
|
+
(x) => {
|
|
581
|
+
for (const N of x)
|
|
582
|
+
Zs(N);
|
|
583
|
+
return i ? i(x) : x;
|
|
584
584
|
},
|
|
585
585
|
[i]
|
|
586
586
|
);
|
|
587
587
|
r && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
588
|
-
renderCount:
|
|
588
|
+
renderCount: h.current,
|
|
589
589
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
590
590
|
filters: n
|
|
591
591
|
});
|
|
592
|
-
const
|
|
592
|
+
const w = L.useMemo(
|
|
593
593
|
() => ({
|
|
594
594
|
selectedChannel: s,
|
|
595
595
|
onChannelSelect: e,
|
|
596
596
|
debug: r,
|
|
597
|
-
renderMessagePreview:
|
|
598
|
-
viewerLanguage:
|
|
597
|
+
renderMessagePreview: _,
|
|
598
|
+
viewerLanguage: m
|
|
599
599
|
}),
|
|
600
600
|
[
|
|
601
601
|
s,
|
|
602
602
|
e,
|
|
603
603
|
r,
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
_,
|
|
605
|
+
m
|
|
606
606
|
]
|
|
607
607
|
);
|
|
608
608
|
return /* @__PURE__ */ t(
|
|
@@ -612,8 +612,8 @@ const sn = { last_message_at: -1 }, It = B.memo(
|
|
|
612
612
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
613
613
|
f
|
|
614
614
|
),
|
|
615
|
-
children: /* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ t(
|
|
616
|
-
|
|
615
|
+
children: /* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ t(Js, { value: w, children: /* @__PURE__ */ t(
|
|
616
|
+
Yt,
|
|
617
617
|
{
|
|
618
618
|
filters: n,
|
|
619
619
|
sort: c,
|
|
@@ -621,9 +621,9 @@ const sn = { last_message_at: -1 }, It = B.memo(
|
|
|
621
621
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
622
622
|
onMessageNew: o,
|
|
623
623
|
onAddedToChannel: l,
|
|
624
|
-
channelRenderFilterFn:
|
|
625
|
-
Preview:
|
|
626
|
-
EmptyStateIndicator:
|
|
624
|
+
channelRenderFilterFn: b,
|
|
625
|
+
Preview: Mt,
|
|
626
|
+
EmptyStateIndicator: g
|
|
627
627
|
},
|
|
628
628
|
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
629
629
|
) }) })
|
|
@@ -631,8 +631,8 @@ const sn = { last_message_at: -1 }, It = B.memo(
|
|
|
631
631
|
);
|
|
632
632
|
}
|
|
633
633
|
);
|
|
634
|
-
|
|
635
|
-
const
|
|
634
|
+
Dt.displayName = "ChannelList";
|
|
635
|
+
const pe = ({
|
|
636
636
|
variant: e = "default",
|
|
637
637
|
className: s,
|
|
638
638
|
children: n,
|
|
@@ -650,7 +650,7 @@ const be = ({
|
|
|
650
650
|
children: n
|
|
651
651
|
}
|
|
652
652
|
);
|
|
653
|
-
function
|
|
653
|
+
function un({ label: e, className: s, children: n, ...a }) {
|
|
654
654
|
return /* @__PURE__ */ d(
|
|
655
655
|
"button",
|
|
656
656
|
{
|
|
@@ -671,10 +671,10 @@ function nn({ label: e, className: s, children: n, ...a }) {
|
|
|
671
671
|
}
|
|
672
672
|
);
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
return /* @__PURE__ */ t(
|
|
674
|
+
function mn({ onClick: e }) {
|
|
675
|
+
return /* @__PURE__ */ t(un, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ t(yt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
676
676
|
}
|
|
677
|
-
const
|
|
677
|
+
const hn = ({
|
|
678
678
|
dialogRef: e,
|
|
679
679
|
onClose: s,
|
|
680
680
|
participant: n,
|
|
@@ -684,79 +684,79 @@ const rn = ({
|
|
|
684
684
|
onBlockParticipant: i,
|
|
685
685
|
showDeleteConversation: c = !0,
|
|
686
686
|
onDeleteConversationClick: f,
|
|
687
|
-
onBlockParticipantClick:
|
|
688
|
-
onReportParticipantClick:
|
|
689
|
-
customProfileContent:
|
|
690
|
-
customChannelActions:
|
|
687
|
+
onBlockParticipantClick: g,
|
|
688
|
+
onReportParticipantClick: _,
|
|
689
|
+
customProfileContent: m,
|
|
690
|
+
customChannelActions: h
|
|
691
691
|
}) => {
|
|
692
|
-
var R,
|
|
693
|
-
const { service: r, debug:
|
|
694
|
-
var
|
|
695
|
-
if (!(!r || !((
|
|
692
|
+
var R, z, E, H, Y, te;
|
|
693
|
+
const { service: r, debug: b } = ze(), [w, x] = P(!1), [N, p] = P(!1), [I, S] = P(!1), T = G(async () => {
|
|
694
|
+
var $;
|
|
695
|
+
if (!(!r || !(($ = n == null ? void 0 : n.user) != null && $.id)))
|
|
696
696
|
try {
|
|
697
697
|
const C = (await r.getBlockedUsers()).some(
|
|
698
|
-
(
|
|
698
|
+
(B) => {
|
|
699
699
|
var K;
|
|
700
|
-
return
|
|
700
|
+
return B.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
|
|
701
701
|
}
|
|
702
702
|
);
|
|
703
|
-
|
|
704
|
-
} catch (
|
|
703
|
+
x(C);
|
|
704
|
+
} catch (u) {
|
|
705
705
|
console.error(
|
|
706
706
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
707
|
-
|
|
707
|
+
u
|
|
708
708
|
);
|
|
709
709
|
}
|
|
710
710
|
}, [r, (R = n == null ? void 0 : n.user) == null ? void 0 : R.id]);
|
|
711
711
|
q(() => {
|
|
712
|
-
|
|
713
|
-
}, [
|
|
714
|
-
const
|
|
715
|
-
var
|
|
712
|
+
T();
|
|
713
|
+
}, [T]);
|
|
714
|
+
const U = async () => {
|
|
715
|
+
var $;
|
|
716
716
|
if (!N) {
|
|
717
|
-
f == null || f(),
|
|
717
|
+
f == null || f(), b && console.log("[ChannelInfoDialog] Leave conversation", a.cid), p(!0);
|
|
718
718
|
try {
|
|
719
|
-
const
|
|
720
|
-
await a.hide(
|
|
721
|
-
} catch (
|
|
722
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
719
|
+
const u = (($ = a._client) == null ? void 0 : $.userID) ?? null;
|
|
720
|
+
await a.hide(u, !1), l && await l(a), s();
|
|
721
|
+
} catch (u) {
|
|
722
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", u);
|
|
723
723
|
} finally {
|
|
724
|
-
|
|
724
|
+
p(!1);
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
}, k = async () => {
|
|
728
|
-
var
|
|
729
|
-
if (!(
|
|
730
|
-
|
|
728
|
+
var $, u, C;
|
|
729
|
+
if (!(I || !r)) {
|
|
730
|
+
g == null || g(), b && console.log("[ChannelInfoDialog] Block member", ($ = n == null ? void 0 : n.user) == null ? void 0 : $.id), S(!0);
|
|
731
731
|
try {
|
|
732
|
-
await r.blockUser((
|
|
733
|
-
} catch (
|
|
734
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
732
|
+
await r.blockUser((u = n == null ? void 0 : n.user) == null ? void 0 : u.id), i && await i((C = n == null ? void 0 : n.user) == null ? void 0 : C.id), s();
|
|
733
|
+
} catch (B) {
|
|
734
|
+
console.error("[ChannelInfoDialog] Failed to block member", B);
|
|
735
735
|
} finally {
|
|
736
|
-
|
|
736
|
+
S(!1);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
},
|
|
740
|
-
var
|
|
741
|
-
if (!(
|
|
742
|
-
|
|
739
|
+
}, M = async () => {
|
|
740
|
+
var $, u, C;
|
|
741
|
+
if (!(I || !r)) {
|
|
742
|
+
g == null || g(), b && console.log("[ChannelInfoDialog] Unblock member", ($ = n == null ? void 0 : n.user) == null ? void 0 : $.id), S(!0);
|
|
743
743
|
try {
|
|
744
|
-
await r.unBlockUser((
|
|
745
|
-
} catch (
|
|
746
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
744
|
+
await r.unBlockUser((u = n == null ? void 0 : n.user) == null ? void 0 : u.id), i && await i((C = n == null ? void 0 : n.user) == null ? void 0 : C.id), s();
|
|
745
|
+
} catch (B) {
|
|
746
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", B);
|
|
747
747
|
} finally {
|
|
748
|
-
|
|
748
|
+
S(!1);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
751
|
}, j = () => {
|
|
752
|
-
|
|
752
|
+
_ == null || _(), s(), window.open(
|
|
753
753
|
"https://linktr.ee/s/about/trust-center/report",
|
|
754
754
|
"_blank",
|
|
755
755
|
"noopener,noreferrer"
|
|
756
756
|
);
|
|
757
757
|
};
|
|
758
758
|
if (!n) return null;
|
|
759
|
-
const
|
|
759
|
+
const y = ((z = n.user) == null ? void 0 : z.name) || ((E = n.user) == null ? void 0 : E.id) || "Unknown member", A = (H = n.user) == null ? void 0 : H.image, v = (Y = n.user) == null ? void 0 : Y.username, F = v ? `linktr.ee/${v}` : void 0, V = ((te = n.user) == null ? void 0 : te.id) || "unknown";
|
|
760
760
|
return (
|
|
761
761
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
762
762
|
/* @__PURE__ */ t(
|
|
@@ -765,13 +765,13 @@ const rn = ({
|
|
|
765
765
|
ref: e,
|
|
766
766
|
className: "mes-dialog group",
|
|
767
767
|
onClose: s,
|
|
768
|
-
onClick: (
|
|
769
|
-
|
|
768
|
+
onClick: ($) => {
|
|
769
|
+
$.target === e.current && s();
|
|
770
770
|
},
|
|
771
771
|
children: /* @__PURE__ */ d("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
772
772
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
773
773
|
/* @__PURE__ */ t("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
774
|
-
/* @__PURE__ */ t(
|
|
774
|
+
/* @__PURE__ */ t(mn, { onClick: s })
|
|
775
775
|
] }),
|
|
776
776
|
/* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
777
777
|
/* @__PURE__ */ d(
|
|
@@ -785,16 +785,16 @@ const rn = ({
|
|
|
785
785
|
ae,
|
|
786
786
|
{
|
|
787
787
|
id: V,
|
|
788
|
-
name:
|
|
789
|
-
image:
|
|
788
|
+
name: y,
|
|
789
|
+
image: A,
|
|
790
790
|
size: 88,
|
|
791
791
|
shape: "circle"
|
|
792
792
|
}
|
|
793
793
|
),
|
|
794
794
|
/* @__PURE__ */ d("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
795
|
-
/* @__PURE__ */ t("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
796
|
-
|
|
797
|
-
o && !
|
|
795
|
+
/* @__PURE__ */ t("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
|
|
796
|
+
F && /* @__PURE__ */ t("p", { className: "truncate text-sm text-[#00000055]", children: F }),
|
|
797
|
+
o && !m && /* @__PURE__ */ t(
|
|
798
798
|
"span",
|
|
799
799
|
{
|
|
800
800
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -810,71 +810,71 @@ const rn = ({
|
|
|
810
810
|
)
|
|
811
811
|
] })
|
|
812
812
|
] }),
|
|
813
|
-
|
|
813
|
+
m && /* @__PURE__ */ t("div", { className: "w-full", children: m })
|
|
814
814
|
]
|
|
815
815
|
}
|
|
816
816
|
),
|
|
817
817
|
/* @__PURE__ */ d("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
818
818
|
c && /* @__PURE__ */ t("li", { children: /* @__PURE__ */ d(
|
|
819
|
-
|
|
819
|
+
pe,
|
|
820
820
|
{
|
|
821
|
-
onClick:
|
|
821
|
+
onClick: U,
|
|
822
822
|
disabled: N,
|
|
823
823
|
"aria-busy": N,
|
|
824
824
|
children: [
|
|
825
|
-
N ? /* @__PURE__ */ t(
|
|
825
|
+
N ? /* @__PURE__ */ t(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ t(Ts, { className: "h-5 w-5" }),
|
|
826
826
|
/* @__PURE__ */ t("span", { children: "Delete Conversation" })
|
|
827
827
|
]
|
|
828
828
|
}
|
|
829
829
|
) }),
|
|
830
|
-
/* @__PURE__ */ t("li", { children:
|
|
831
|
-
|
|
830
|
+
/* @__PURE__ */ t("li", { children: w ? /* @__PURE__ */ d(
|
|
831
|
+
pe,
|
|
832
832
|
{
|
|
833
|
-
onClick:
|
|
834
|
-
disabled:
|
|
835
|
-
"aria-busy":
|
|
833
|
+
onClick: M,
|
|
834
|
+
disabled: I,
|
|
835
|
+
"aria-busy": I,
|
|
836
836
|
children: [
|
|
837
|
-
|
|
837
|
+
I ? /* @__PURE__ */ t(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ t(lt, { className: "h-5 w-5" }),
|
|
838
838
|
/* @__PURE__ */ t("span", { children: "Unblock" })
|
|
839
839
|
]
|
|
840
840
|
}
|
|
841
841
|
) : /* @__PURE__ */ d(
|
|
842
|
-
|
|
842
|
+
pe,
|
|
843
843
|
{
|
|
844
844
|
onClick: k,
|
|
845
|
-
disabled:
|
|
846
|
-
"aria-busy":
|
|
845
|
+
disabled: I,
|
|
846
|
+
"aria-busy": I,
|
|
847
847
|
children: [
|
|
848
|
-
|
|
848
|
+
I ? /* @__PURE__ */ t(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ t(lt, { className: "h-5 w-5" }),
|
|
849
849
|
/* @__PURE__ */ t("span", { children: "Block" })
|
|
850
850
|
]
|
|
851
851
|
}
|
|
852
852
|
) }),
|
|
853
|
-
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ d(
|
|
854
|
-
/* @__PURE__ */ t(
|
|
853
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ d(pe, { variant: "danger", onClick: j, children: [
|
|
854
|
+
/* @__PURE__ */ t(Ms, { className: "h-5 w-5" }),
|
|
855
855
|
/* @__PURE__ */ t("span", { children: "Report" })
|
|
856
856
|
] }) }),
|
|
857
|
-
|
|
857
|
+
h
|
|
858
858
|
] })
|
|
859
859
|
] })
|
|
860
860
|
] })
|
|
861
861
|
}
|
|
862
862
|
)
|
|
863
863
|
);
|
|
864
|
-
},
|
|
865
|
-
function
|
|
866
|
-
return e != null && e.length ? e.some((s) => s.type ===
|
|
864
|
+
}, fn = (e) => /* @__PURE__ */ t(qt, { ...e, position: "center" }), Le = "vote_up", Ae = "vote_down";
|
|
865
|
+
function gn(e) {
|
|
866
|
+
return e != null && e.length ? e.some((s) => s.type === Ae) ? "down" : e.some((s) => s.type === Le) ? "up" : null : null;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
869
|
-
const { channel: s } = oe(), { client: n } =
|
|
870
|
-
() =>
|
|
868
|
+
function bn(e) {
|
|
869
|
+
const { channel: s } = oe(), { client: n } = Pe("useMessageVote"), a = xe(
|
|
870
|
+
() => gn(e.own_reactions),
|
|
871
871
|
[e.own_reactions]
|
|
872
872
|
), o = G(async () => {
|
|
873
873
|
if (n != null && n.userID)
|
|
874
874
|
try {
|
|
875
|
-
a === "up" ? await s.deleteReaction(e.id,
|
|
875
|
+
a === "up" ? await s.deleteReaction(e.id, Le) : await s.sendReaction(
|
|
876
876
|
e.id,
|
|
877
|
-
{ type:
|
|
877
|
+
{ type: Le },
|
|
878
878
|
{ enforce_unique: !0, skip_push: !0 }
|
|
879
879
|
);
|
|
880
880
|
} catch {
|
|
@@ -882,9 +882,9 @@ function cn(e) {
|
|
|
882
882
|
}, [s, n == null ? void 0 : n.userID, e.id, a]), l = G(async () => {
|
|
883
883
|
if (n != null && n.userID)
|
|
884
884
|
try {
|
|
885
|
-
a === "down" ? await s.deleteReaction(e.id,
|
|
885
|
+
a === "down" ? await s.deleteReaction(e.id, Ae) : await s.sendReaction(
|
|
886
886
|
e.id,
|
|
887
|
-
{ type:
|
|
887
|
+
{ type: Ae },
|
|
888
888
|
{ enforce_unique: !0, skip_push: !0 }
|
|
889
889
|
);
|
|
890
890
|
} catch {
|
|
@@ -892,13 +892,13 @@ function cn(e) {
|
|
|
892
892
|
}, [s, n == null ? void 0 : n.userID, e.id, a]);
|
|
893
893
|
return { selected: a, voteUp: o, voteDown: l };
|
|
894
894
|
}
|
|
895
|
-
const
|
|
895
|
+
const pn = L.lazy(() => import("./Card-DlMSDSdm.js")), xn = L.lazy(() => import("./Card-CsJvUF_b.js")), vn = L.lazy(() => import("./Card-CFFNq49v.js")), $e = () => /* @__PURE__ */ t(
|
|
896
896
|
"div",
|
|
897
897
|
{
|
|
898
|
-
className: "w-[280px] min-h-[200px] animate-pulse rounded-
|
|
898
|
+
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)]",
|
|
899
899
|
"aria-hidden": !0
|
|
900
900
|
}
|
|
901
|
-
),
|
|
901
|
+
), wn = (e) => /* @__PURE__ */ t(ue, { fallback: /* @__PURE__ */ t($e, {}), children: /* @__PURE__ */ t(pn, { ...e }) }), Rt = (e) => /* @__PURE__ */ t(ue, { fallback: /* @__PURE__ */ t($e, {}), children: /* @__PURE__ */ t(xn, { ...e }) }), Lt = (e) => /* @__PURE__ */ t(ue, { fallback: /* @__PURE__ */ t($e, {}), children: /* @__PURE__ */ t(vn, { ...e }) }), _n = Rt, yn = Lt, gt = { Composer: wn, Sent: Rt, Received: Lt, Creator: _n, Visitor: yn }, Nn = [
|
|
902
902
|
[/pdf/, "pdf"],
|
|
903
903
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
904
904
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -908,42 +908,42 @@ const dn = B.lazy(() => import("./Card-BHknCeHw.js")), un = B.lazy(() => import(
|
|
|
908
908
|
[/plain|rtf/, "text"],
|
|
909
909
|
[/markdown/, "markdown"]
|
|
910
910
|
];
|
|
911
|
-
function
|
|
911
|
+
function Ne(e) {
|
|
912
912
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
913
913
|
}
|
|
914
|
-
function
|
|
915
|
-
const s =
|
|
914
|
+
function Cn(e) {
|
|
915
|
+
const s = Nn.find(
|
|
916
916
|
([n]) => n.test(e)
|
|
917
917
|
);
|
|
918
918
|
return s ? s[1] : "generic";
|
|
919
919
|
}
|
|
920
|
-
const
|
|
921
|
-
video:
|
|
922
|
-
audio:
|
|
923
|
-
image:
|
|
924
|
-
document:
|
|
925
|
-
},
|
|
926
|
-
pdf:
|
|
927
|
-
doc:
|
|
928
|
-
xls:
|
|
929
|
-
csv:
|
|
930
|
-
ppt:
|
|
931
|
-
zip:
|
|
932
|
-
text:
|
|
933
|
-
markdown:
|
|
934
|
-
generic:
|
|
920
|
+
const En = {
|
|
921
|
+
video: Ls,
|
|
922
|
+
audio: Rs,
|
|
923
|
+
image: Ds,
|
|
924
|
+
document: Nt
|
|
925
|
+
}, Sn = {
|
|
926
|
+
pdf: Us,
|
|
927
|
+
doc: Bs,
|
|
928
|
+
xls: $s,
|
|
929
|
+
csv: zs,
|
|
930
|
+
ppt: Ps,
|
|
931
|
+
zip: Os,
|
|
932
|
+
text: Fs,
|
|
933
|
+
markdown: As,
|
|
934
|
+
generic: Nt
|
|
935
935
|
};
|
|
936
|
-
function
|
|
937
|
-
const s =
|
|
938
|
-
return s !== "document" ?
|
|
936
|
+
function In(e) {
|
|
937
|
+
const s = Ne(e);
|
|
938
|
+
return s !== "document" ? En[s] : Sn[Cn(e)];
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
return
|
|
940
|
+
function _e(e, s) {
|
|
941
|
+
return L.createElement(In(e), s);
|
|
942
942
|
}
|
|
943
|
-
const
|
|
943
|
+
const kn = (e) => {
|
|
944
944
|
var s, n;
|
|
945
945
|
return "touches" in e ? ((s = e.touches[0]) == null ? void 0 : s.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
|
|
946
|
-
},
|
|
946
|
+
}, Tn = ({
|
|
947
947
|
source: e,
|
|
948
948
|
mimeType: s,
|
|
949
949
|
poster: n,
|
|
@@ -953,55 +953,55 @@ const vn = (e) => {
|
|
|
953
953
|
controls: i = !0,
|
|
954
954
|
showProgress: c = !1,
|
|
955
955
|
muted: f = !1,
|
|
956
|
-
onContainerClick:
|
|
956
|
+
onContainerClick: g
|
|
957
957
|
}) => {
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
}, []),
|
|
961
|
-
const C =
|
|
958
|
+
const _ = Ne(s), m = J(null), h = J(null), r = J(null), b = J(o), [w, x] = P(a), [N, p] = P(0), [I, S] = P(!1), [T, U] = P(!1), [k, M] = P(!1), [j, y] = P(!1), [A, v] = P(!0), [F, V] = P(null), R = G(() => {
|
|
959
|
+
M(!1), x(!0);
|
|
960
|
+
}, []), z = G((u) => {
|
|
961
|
+
const C = h.current;
|
|
962
962
|
if (!C) return 0;
|
|
963
|
-
const
|
|
963
|
+
const B = C.getBoundingClientRect();
|
|
964
964
|
return Math.max(
|
|
965
965
|
0,
|
|
966
|
-
Math.min(1, (
|
|
966
|
+
Math.min(1, (kn(u) - B.left) / B.width)
|
|
967
967
|
);
|
|
968
|
-
}, []), E = G((
|
|
969
|
-
const C =
|
|
970
|
-
C && C.duration && (C.currentTime =
|
|
971
|
-
}, []), H = (
|
|
972
|
-
|
|
973
|
-
const C =
|
|
974
|
-
|
|
968
|
+
}, []), E = G((u) => {
|
|
969
|
+
const C = m.current;
|
|
970
|
+
C && C.duration && (C.currentTime = u * C.duration);
|
|
971
|
+
}, []), H = (u) => {
|
|
972
|
+
u.stopPropagation(), S(!0);
|
|
973
|
+
const C = z(u);
|
|
974
|
+
p(C), E(C);
|
|
975
975
|
};
|
|
976
976
|
q(() => {
|
|
977
|
-
o !== void 0 && o !==
|
|
977
|
+
o !== void 0 && o !== b.current && (b.current = o, x(o));
|
|
978
978
|
}, [o]), q(() => {
|
|
979
|
-
if (!
|
|
979
|
+
if (!w) {
|
|
980
980
|
r.current !== null && (cancelAnimationFrame(r.current), r.current = null);
|
|
981
981
|
return;
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
const C =
|
|
985
|
-
C && C.duration && !
|
|
983
|
+
const u = () => {
|
|
984
|
+
const C = m.current;
|
|
985
|
+
C && C.duration && !I && p(C.currentTime / C.duration), r.current = requestAnimationFrame(u);
|
|
986
986
|
};
|
|
987
|
-
return r.current = requestAnimationFrame(
|
|
987
|
+
return r.current = requestAnimationFrame(u), () => {
|
|
988
988
|
r.current !== null && cancelAnimationFrame(r.current);
|
|
989
989
|
};
|
|
990
|
-
}, [
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}) :
|
|
995
|
-
}, [
|
|
996
|
-
if (!
|
|
997
|
-
const
|
|
998
|
-
|
|
990
|
+
}, [w, I]), q(() => {
|
|
991
|
+
const u = m.current;
|
|
992
|
+
u && (w ? u.play().catch((C) => {
|
|
993
|
+
x(!1), M(!0);
|
|
994
|
+
}) : u.pause());
|
|
995
|
+
}, [w]), q(() => {
|
|
996
|
+
if (!I) return;
|
|
997
|
+
const u = (B) => p(z(B)), C = (B) => {
|
|
998
|
+
S(!1), E(z(B));
|
|
999
999
|
};
|
|
1000
|
-
return window.addEventListener("mousemove",
|
|
1001
|
-
window.removeEventListener("mousemove",
|
|
1000
|
+
return window.addEventListener("mousemove", u), window.addEventListener("mouseup", C), window.addEventListener("touchmove", u, { passive: !0 }), window.addEventListener("touchend", C), () => {
|
|
1001
|
+
window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", u), window.removeEventListener("touchend", C);
|
|
1002
1002
|
};
|
|
1003
|
-
}, [
|
|
1004
|
-
const Y =
|
|
1003
|
+
}, [I, z, E]);
|
|
1004
|
+
const Y = F ? { aspectRatio: String(F) } : void 0, te = F ? "" : " aspect-video", $ = Math.round(N * 100);
|
|
1005
1005
|
return /* @__PURE__ */ d(
|
|
1006
1006
|
"div",
|
|
1007
1007
|
{
|
|
@@ -1009,24 +1009,24 @@ const vn = (e) => {
|
|
|
1009
1009
|
tabIndex: 0,
|
|
1010
1010
|
className: `relative cursor-pointer overflow-hidden bg-black ${te}`,
|
|
1011
1011
|
style: Y,
|
|
1012
|
-
onClick: (
|
|
1013
|
-
if (
|
|
1014
|
-
u
|
|
1012
|
+
onClick: (u) => {
|
|
1013
|
+
if (g) {
|
|
1014
|
+
g(u);
|
|
1015
1015
|
return;
|
|
1016
1016
|
}
|
|
1017
|
-
k || i &&
|
|
1017
|
+
k || i && x((C) => !C);
|
|
1018
1018
|
},
|
|
1019
|
-
onKeyDown: (
|
|
1020
|
-
if (!(
|
|
1021
|
-
if (
|
|
1022
|
-
u
|
|
1019
|
+
onKeyDown: (u) => {
|
|
1020
|
+
if (!(u.key !== "Enter" && u.key !== " ")) {
|
|
1021
|
+
if (u.preventDefault(), g) {
|
|
1022
|
+
g(u);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
k || i &&
|
|
1025
|
+
k || i && x((C) => !C);
|
|
1026
1026
|
}
|
|
1027
1027
|
},
|
|
1028
1028
|
children: [
|
|
1029
|
-
n && (
|
|
1029
|
+
n && (_ === "audio" || A) && /* @__PURE__ */ t(
|
|
1030
1030
|
"img",
|
|
1031
1031
|
{
|
|
1032
1032
|
src: n,
|
|
@@ -1034,56 +1034,56 @@ const vn = (e) => {
|
|
|
1034
1034
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
1035
1035
|
}
|
|
1036
1036
|
),
|
|
1037
|
-
!n && (
|
|
1037
|
+
!n && (_ === "audio" || A) && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center", children: _e(s, {
|
|
1038
1038
|
className: "size-12 text-black/20",
|
|
1039
1039
|
weight: "regular"
|
|
1040
1040
|
}) }),
|
|
1041
|
-
/* @__PURE__ */ t("div", { className: "absolute inset-0", children:
|
|
1041
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-0", children: _ === "audio" ? /* @__PURE__ */ t(
|
|
1042
1042
|
"audio",
|
|
1043
1043
|
{
|
|
1044
|
-
ref:
|
|
1044
|
+
ref: m,
|
|
1045
1045
|
src: e,
|
|
1046
1046
|
loop: l,
|
|
1047
1047
|
muted: f,
|
|
1048
1048
|
style: { width: "100%", height: "100%" },
|
|
1049
|
-
onLoadStart: () =>
|
|
1049
|
+
onLoadStart: () => y(!0),
|
|
1050
1050
|
onCanPlay: () => {
|
|
1051
|
-
|
|
1051
|
+
y(!1), v(!1);
|
|
1052
1052
|
},
|
|
1053
|
-
onWaiting: () =>
|
|
1054
|
-
onPlay: () =>
|
|
1053
|
+
onWaiting: () => y(!0),
|
|
1054
|
+
onPlay: () => M(!1),
|
|
1055
1055
|
onEnded: () => {
|
|
1056
|
-
l || (
|
|
1056
|
+
l || (x(!1), p(0));
|
|
1057
1057
|
},
|
|
1058
1058
|
children: /* @__PURE__ */ t("track", { kind: "captions" })
|
|
1059
1059
|
}
|
|
1060
1060
|
) : /* @__PURE__ */ t(
|
|
1061
1061
|
"video",
|
|
1062
1062
|
{
|
|
1063
|
-
ref:
|
|
1063
|
+
ref: m,
|
|
1064
1064
|
src: e,
|
|
1065
1065
|
loop: l,
|
|
1066
1066
|
muted: f,
|
|
1067
1067
|
playsInline: !0,
|
|
1068
1068
|
style: { width: "100%", height: "100%" },
|
|
1069
|
-
onLoadStart: () =>
|
|
1069
|
+
onLoadStart: () => y(!0),
|
|
1070
1070
|
onCanPlay: () => {
|
|
1071
|
-
|
|
1071
|
+
y(!1), v(!1);
|
|
1072
1072
|
},
|
|
1073
|
-
onWaiting: () =>
|
|
1074
|
-
onPlay: () =>
|
|
1073
|
+
onWaiting: () => y(!0),
|
|
1074
|
+
onPlay: () => M(!1),
|
|
1075
1075
|
onLoadedMetadata: () => {
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1076
|
+
const u = m.current;
|
|
1077
|
+
u instanceof HTMLVideoElement && u.videoWidth && u.videoHeight && V(u.videoWidth / u.videoHeight);
|
|
1078
1078
|
},
|
|
1079
1079
|
onEnded: () => {
|
|
1080
|
-
l || (
|
|
1080
|
+
l || (x(!1), p(0));
|
|
1081
1081
|
},
|
|
1082
1082
|
children: /* @__PURE__ */ t("track", { kind: "captions" })
|
|
1083
1083
|
}
|
|
1084
1084
|
) }),
|
|
1085
1085
|
j && !k && /* @__PURE__ */ t("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ t(
|
|
1086
|
-
|
|
1086
|
+
Ct,
|
|
1087
1087
|
{
|
|
1088
1088
|
className: "size-8 animate-spin text-white/80",
|
|
1089
1089
|
weight: "bold"
|
|
@@ -1096,13 +1096,13 @@ const vn = (e) => {
|
|
|
1096
1096
|
role: "button",
|
|
1097
1097
|
tabIndex: 0,
|
|
1098
1098
|
"aria-label": "Play preview",
|
|
1099
|
-
onClick: (
|
|
1100
|
-
|
|
1099
|
+
onClick: (u) => {
|
|
1100
|
+
u.stopPropagation(), R();
|
|
1101
1101
|
},
|
|
1102
|
-
onKeyDown: (
|
|
1103
|
-
|
|
1102
|
+
onKeyDown: (u) => {
|
|
1103
|
+
u.key !== "Enter" && u.key !== " " || (u.preventDefault(), u.stopPropagation(), R());
|
|
1104
1104
|
},
|
|
1105
|
-
children: /* @__PURE__ */ t("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ t(
|
|
1105
|
+
children: /* @__PURE__ */ t("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ t(ct, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1106
1106
|
}
|
|
1107
1107
|
),
|
|
1108
1108
|
c && !i && /* @__PURE__ */ t("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__ */ t(
|
|
@@ -1110,23 +1110,23 @@ const vn = (e) => {
|
|
|
1110
1110
|
{
|
|
1111
1111
|
role: "slider",
|
|
1112
1112
|
"aria-label": "Playback position",
|
|
1113
|
-
"aria-valuenow":
|
|
1113
|
+
"aria-valuenow": $,
|
|
1114
1114
|
"aria-valuemin": 0,
|
|
1115
1115
|
"aria-valuemax": 100,
|
|
1116
1116
|
tabIndex: 0,
|
|
1117
|
-
ref:
|
|
1117
|
+
ref: h,
|
|
1118
1118
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1119
1119
|
onMouseDown: H,
|
|
1120
1120
|
onTouchStart: H,
|
|
1121
|
-
onClick: (
|
|
1122
|
-
onKeyDown: (
|
|
1123
|
-
|
|
1121
|
+
onClick: (u) => u.stopPropagation(),
|
|
1122
|
+
onKeyDown: (u) => {
|
|
1123
|
+
u.key === "ArrowRight" && E(Math.min(1, N + 0.05)), u.key === "ArrowLeft" && E(Math.max(0, N - 0.05));
|
|
1124
1124
|
},
|
|
1125
1125
|
children: /* @__PURE__ */ t("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ t(
|
|
1126
1126
|
"div",
|
|
1127
1127
|
{
|
|
1128
1128
|
className: "h-full rounded-full bg-white",
|
|
1129
|
-
style: { width: `${
|
|
1129
|
+
style: { width: `${$}%` }
|
|
1130
1130
|
}
|
|
1131
1131
|
) })
|
|
1132
1132
|
}
|
|
@@ -1136,12 +1136,12 @@ const vn = (e) => {
|
|
|
1136
1136
|
"button",
|
|
1137
1137
|
{
|
|
1138
1138
|
type: "button",
|
|
1139
|
-
onClick: (
|
|
1140
|
-
|
|
1139
|
+
onClick: (u) => {
|
|
1140
|
+
u.stopPropagation(), x((C) => !C);
|
|
1141
1141
|
},
|
|
1142
1142
|
className: "shrink-0 text-white",
|
|
1143
|
-
"aria-label":
|
|
1144
|
-
children:
|
|
1143
|
+
"aria-label": w ? "Pause" : "Play",
|
|
1144
|
+
children: w ? /* @__PURE__ */ t(js, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ t(ct, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1145
1145
|
}
|
|
1146
1146
|
),
|
|
1147
1147
|
/* @__PURE__ */ d(
|
|
@@ -1149,30 +1149,30 @@ const vn = (e) => {
|
|
|
1149
1149
|
{
|
|
1150
1150
|
role: "slider",
|
|
1151
1151
|
"aria-label": "Playback position",
|
|
1152
|
-
"aria-valuenow":
|
|
1152
|
+
"aria-valuenow": $,
|
|
1153
1153
|
"aria-valuemin": 0,
|
|
1154
1154
|
"aria-valuemax": 100,
|
|
1155
1155
|
tabIndex: 0,
|
|
1156
|
-
ref:
|
|
1156
|
+
ref: h,
|
|
1157
1157
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1158
1158
|
onMouseDown: H,
|
|
1159
1159
|
onTouchStart: H,
|
|
1160
|
-
onClick: (
|
|
1161
|
-
onMouseEnter: () =>
|
|
1162
|
-
onMouseLeave: () =>
|
|
1163
|
-
onKeyDown: (
|
|
1164
|
-
|
|
1160
|
+
onClick: (u) => u.stopPropagation(),
|
|
1161
|
+
onMouseEnter: () => U(!0),
|
|
1162
|
+
onMouseLeave: () => U(!1),
|
|
1163
|
+
onKeyDown: (u) => {
|
|
1164
|
+
u.key === "ArrowRight" && E(Math.min(1, N + 0.05)), u.key === "ArrowLeft" && E(Math.max(0, N - 0.05));
|
|
1165
1165
|
},
|
|
1166
1166
|
children: [
|
|
1167
1167
|
/* @__PURE__ */ t(
|
|
1168
1168
|
"div",
|
|
1169
1169
|
{
|
|
1170
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
1170
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || I ? "h-1.5" : "h-1"}`,
|
|
1171
1171
|
children: /* @__PURE__ */ t(
|
|
1172
1172
|
"div",
|
|
1173
1173
|
{
|
|
1174
1174
|
className: "h-full rounded-full bg-white",
|
|
1175
|
-
style: { width: `${
|
|
1175
|
+
style: { width: `${$}%` }
|
|
1176
1176
|
}
|
|
1177
1177
|
)
|
|
1178
1178
|
}
|
|
@@ -1180,8 +1180,8 @@ const vn = (e) => {
|
|
|
1180
1180
|
/* @__PURE__ */ t(
|
|
1181
1181
|
"div",
|
|
1182
1182
|
{
|
|
1183
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
1184
|
-
style: { left: `${
|
|
1183
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || I ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1184
|
+
style: { left: `${$}%` }
|
|
1185
1185
|
}
|
|
1186
1186
|
)
|
|
1187
1187
|
]
|
|
@@ -1191,7 +1191,7 @@ const vn = (e) => {
|
|
|
1191
1191
|
]
|
|
1192
1192
|
}
|
|
1193
1193
|
);
|
|
1194
|
-
},
|
|
1194
|
+
}, bt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Mn = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", At = ({
|
|
1195
1195
|
mimeType: e,
|
|
1196
1196
|
sourceUrl: s,
|
|
1197
1197
|
thumbnailUrl: n,
|
|
@@ -1200,9 +1200,9 @@ const vn = (e) => {
|
|
|
1200
1200
|
mediaPlayerProps: l,
|
|
1201
1201
|
containedImage: i = !1
|
|
1202
1202
|
}) => {
|
|
1203
|
-
const c =
|
|
1203
|
+
const c = Ne(e), [f, g] = P(!1);
|
|
1204
1204
|
return s && (c === "video" || c === "audio") ? /* @__PURE__ */ t(
|
|
1205
|
-
|
|
1205
|
+
Tn,
|
|
1206
1206
|
{
|
|
1207
1207
|
source: s,
|
|
1208
1208
|
mimeType: e,
|
|
@@ -1217,7 +1217,7 @@ const vn = (e) => {
|
|
|
1217
1217
|
alt: a ?? "",
|
|
1218
1218
|
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${f ? "opacity-100" : "opacity-0"}`,
|
|
1219
1219
|
draggable: !1,
|
|
1220
|
-
onLoad: () =>
|
|
1220
|
+
onLoad: () => g(!0)
|
|
1221
1221
|
}
|
|
1222
1222
|
) }) : /* @__PURE__ */ t(
|
|
1223
1223
|
"img",
|
|
@@ -1234,7 +1234,7 @@ const vn = (e) => {
|
|
|
1234
1234
|
alt: a ?? "",
|
|
1235
1235
|
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${f ? "opacity-100" : "opacity-0"}`,
|
|
1236
1236
|
draggable: !1,
|
|
1237
|
-
onLoad: () =>
|
|
1237
|
+
onLoad: () => g(!0)
|
|
1238
1238
|
}
|
|
1239
1239
|
) }) : /* @__PURE__ */ t(
|
|
1240
1240
|
"img",
|
|
@@ -1248,12 +1248,12 @@ const vn = (e) => {
|
|
|
1248
1248
|
"div",
|
|
1249
1249
|
{
|
|
1250
1250
|
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1251
|
-
children:
|
|
1252
|
-
className:
|
|
1251
|
+
children: _e(e, {
|
|
1252
|
+
className: bt(o),
|
|
1253
1253
|
weight: "regular"
|
|
1254
1254
|
})
|
|
1255
1255
|
}
|
|
1256
|
-
) : n ? /* @__PURE__ */ t("div", { className: `relative ${
|
|
1256
|
+
) : n ? /* @__PURE__ */ t("div", { className: `relative ${Mn(o)}`, children: /* @__PURE__ */ t(
|
|
1257
1257
|
"img",
|
|
1258
1258
|
{
|
|
1259
1259
|
src: n,
|
|
@@ -1265,13 +1265,13 @@ const vn = (e) => {
|
|
|
1265
1265
|
"div",
|
|
1266
1266
|
{
|
|
1267
1267
|
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1268
|
-
children:
|
|
1269
|
-
className:
|
|
1268
|
+
children: _e(e, {
|
|
1269
|
+
className: bt(o),
|
|
1270
1270
|
weight: "regular"
|
|
1271
1271
|
})
|
|
1272
1272
|
}
|
|
1273
1273
|
);
|
|
1274
|
-
},
|
|
1274
|
+
}, Ft = ({
|
|
1275
1275
|
variant: e,
|
|
1276
1276
|
thumbnail: s,
|
|
1277
1277
|
title: n,
|
|
@@ -1281,41 +1281,41 @@ const vn = (e) => {
|
|
|
1281
1281
|
statusBadge: i,
|
|
1282
1282
|
action: c,
|
|
1283
1283
|
topLeft: f,
|
|
1284
|
-
topRight:
|
|
1285
|
-
rootRef:
|
|
1286
|
-
"data-testid":
|
|
1284
|
+
topRight: g,
|
|
1285
|
+
rootRef: _,
|
|
1286
|
+
"data-testid": m
|
|
1287
1287
|
}) => {
|
|
1288
|
-
const
|
|
1288
|
+
const h = e === "dark", r = h ? n ?? a : n ?? "", b = h && !n;
|
|
1289
1289
|
return /* @__PURE__ */ d(
|
|
1290
1290
|
"div",
|
|
1291
1291
|
{
|
|
1292
|
-
ref:
|
|
1293
|
-
"data-testid":
|
|
1292
|
+
ref: _,
|
|
1293
|
+
"data-testid": m,
|
|
1294
1294
|
className: D(
|
|
1295
1295
|
"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)]",
|
|
1296
|
-
|
|
1296
|
+
h ? "bg-[#121110]" : "bg-white"
|
|
1297
1297
|
),
|
|
1298
1298
|
children: [
|
|
1299
1299
|
f ? /* @__PURE__ */ t("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: f }) : null,
|
|
1300
|
-
|
|
1300
|
+
g ? /* @__PURE__ */ t("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: g }) : null,
|
|
1301
1301
|
s,
|
|
1302
1302
|
/* @__PURE__ */ d("div", { className: "px-4 pb-3 pt-3", children: [
|
|
1303
1303
|
r.trim() !== "" && /* @__PURE__ */ t(
|
|
1304
1304
|
"p",
|
|
1305
1305
|
{
|
|
1306
1306
|
className: D("mb-0.5 truncate text-base font-medium", {
|
|
1307
|
-
"text-black": !
|
|
1308
|
-
"text-white/30":
|
|
1309
|
-
"text-white":
|
|
1307
|
+
"text-black": !h,
|
|
1308
|
+
"text-white/30": h && b,
|
|
1309
|
+
"text-white": h && !b
|
|
1310
1310
|
}),
|
|
1311
1311
|
children: r
|
|
1312
1312
|
}
|
|
1313
1313
|
),
|
|
1314
1314
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1315
|
-
|
|
1315
|
+
_e(o, {
|
|
1316
1316
|
className: D(
|
|
1317
1317
|
"size-5 shrink-0",
|
|
1318
|
-
|
|
1318
|
+
h ? "text-white/55" : "text-black/55"
|
|
1319
1319
|
),
|
|
1320
1320
|
weight: "regular"
|
|
1321
1321
|
}),
|
|
@@ -1324,7 +1324,7 @@ const vn = (e) => {
|
|
|
1324
1324
|
{
|
|
1325
1325
|
className: D(
|
|
1326
1326
|
"text-xs font-medium",
|
|
1327
|
-
|
|
1327
|
+
h ? "text-white/55" : "text-black/55"
|
|
1328
1328
|
),
|
|
1329
1329
|
children: l
|
|
1330
1330
|
}
|
|
@@ -1337,29 +1337,29 @@ const vn = (e) => {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
);
|
|
1339
1339
|
};
|
|
1340
|
-
function
|
|
1340
|
+
function Ot(e) {
|
|
1341
1341
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function Be(e) {
|
|
1344
1344
|
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)]`;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function Dn(e) {
|
|
1347
1347
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1349
|
+
function Rn(e) {
|
|
1350
1350
|
return e ? "text-white" : "text-black";
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function Ln(e) {
|
|
1353
1353
|
return e ? "text-white/55" : "text-black/55";
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1355
|
+
function An(e) {
|
|
1356
1356
|
return e ? "text-white/40" : "text-black/40";
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function Fn(e) {
|
|
1359
1359
|
return e ? "text-white/20" : "text-black/20";
|
|
1360
1360
|
}
|
|
1361
|
-
const
|
|
1362
|
-
const { title: n, text: a, image_url: o, og_scrape_url: l, title_link: i } = e, c = l ?? i, f = typeof c == "string" && c.trim() !== "" ? c : void 0,
|
|
1361
|
+
const Ue = ({ attachment: e, isMyMessage: s }) => {
|
|
1362
|
+
const { title: n, text: a, image_url: o, og_scrape_url: l, title_link: i } = e, c = l ?? i, f = typeof c == "string" && c.trim() !== "" ? c : void 0, g = /* @__PURE__ */ d(L.Fragment, { children: [
|
|
1363
1363
|
/* @__PURE__ */ t("div", { className: "p-2", children: o ? /* @__PURE__ */ t(
|
|
1364
1364
|
"img",
|
|
1365
1365
|
{
|
|
@@ -1370,26 +1370,26 @@ const Oe = ({ attachment: e, isMyMessage: s }) => {
|
|
|
1370
1370
|
) : /* @__PURE__ */ t(
|
|
1371
1371
|
"div",
|
|
1372
1372
|
{
|
|
1373
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1374
|
-
children: /* @__PURE__ */ t(
|
|
1373
|
+
className: `aspect-video w-full rounded-[20px] ${Dn(s)} flex items-center justify-center`,
|
|
1374
|
+
children: /* @__PURE__ */ t(Gs, { className: `size-12 ${Fn(s)}` })
|
|
1375
1375
|
}
|
|
1376
1376
|
) }),
|
|
1377
1377
|
/* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
|
|
1378
|
-
n && /* @__PURE__ */ t("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1379
|
-
a && /* @__PURE__ */ t("p", { className: `truncate text-[12px] leading-4 ${
|
|
1380
|
-
f && /* @__PURE__ */ t("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1378
|
+
n && /* @__PURE__ */ t("p", { className: `truncate text-[14px] font-medium leading-5 ${Rn(s)}`, children: n }),
|
|
1379
|
+
a && /* @__PURE__ */ t("p", { className: `truncate text-[12px] leading-4 ${Ln(s)}`, children: a }),
|
|
1380
|
+
f && /* @__PURE__ */ t("p", { className: `mt-1 truncate text-[12px] leading-4 ${An(s)}`, children: f })
|
|
1381
1381
|
] })
|
|
1382
1382
|
] });
|
|
1383
|
-
return f ? /* @__PURE__ */ t("a", { href: f, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children:
|
|
1383
|
+
return f ? /* @__PURE__ */ t("a", { href: f, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: g }) : /* @__PURE__ */ t("div", { className: "block", children: g });
|
|
1384
1384
|
};
|
|
1385
|
-
function
|
|
1385
|
+
function Pt(e) {
|
|
1386
1386
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1388
|
+
function je(e) {
|
|
1389
1389
|
var s;
|
|
1390
|
-
return (s = e.attachments) == null ? void 0 : s.find(
|
|
1390
|
+
return (s = e.attachments) == null ? void 0 : s.find(Pt);
|
|
1391
1391
|
}
|
|
1392
|
-
async function
|
|
1392
|
+
async function On(e, s) {
|
|
1393
1393
|
let n;
|
|
1394
1394
|
try {
|
|
1395
1395
|
n = s ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1401,11 +1401,11 @@ async function In(e, s) {
|
|
|
1401
1401
|
const o = await a.blob(), l = URL.createObjectURL(o), i = document.createElement("a");
|
|
1402
1402
|
i.href = l, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(l);
|
|
1403
1403
|
}
|
|
1404
|
-
const
|
|
1404
|
+
const Pn = ({
|
|
1405
1405
|
url: e,
|
|
1406
1406
|
filename: s
|
|
1407
1407
|
}) => {
|
|
1408
|
-
const [n, a] =
|
|
1408
|
+
const [n, a] = P(!1);
|
|
1409
1409
|
return /* @__PURE__ */ t(
|
|
1410
1410
|
"button",
|
|
1411
1411
|
{
|
|
@@ -1413,7 +1413,7 @@ const kn = ({
|
|
|
1413
1413
|
onClick: (l) => {
|
|
1414
1414
|
l.stopPropagation();
|
|
1415
1415
|
const i = window.open("", "_blank", "noopener,noreferrer");
|
|
1416
|
-
a(!0),
|
|
1416
|
+
a(!0), On(e, s).then(() => {
|
|
1417
1417
|
i == null || i.close();
|
|
1418
1418
|
}).catch(() => {
|
|
1419
1419
|
i && (i.location.href = e);
|
|
@@ -1421,44 +1421,44 @@ const kn = ({
|
|
|
1421
1421
|
},
|
|
1422
1422
|
disabled: n,
|
|
1423
1423
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1424
|
-
children: n ? /* @__PURE__ */ t(
|
|
1425
|
-
/* @__PURE__ */ t(
|
|
1424
|
+
children: n ? /* @__PURE__ */ t(Ct, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(L.Fragment, { children: [
|
|
1425
|
+
/* @__PURE__ */ t(Vs, { className: "size-4 text-white", weight: "bold" }),
|
|
1426
1426
|
"Download"
|
|
1427
1427
|
] })
|
|
1428
1428
|
}
|
|
1429
1429
|
);
|
|
1430
1430
|
};
|
|
1431
|
-
function
|
|
1432
|
-
var
|
|
1433
|
-
const s = (
|
|
1434
|
-
(
|
|
1435
|
-
), n = (
|
|
1436
|
-
(
|
|
1431
|
+
function Ge(e) {
|
|
1432
|
+
var m, h, r, b;
|
|
1433
|
+
const s = (m = e.attachments) == null ? void 0 : m.find(
|
|
1434
|
+
(w) => w.type === "video" && w.asset_url
|
|
1435
|
+
), n = (h = e.attachments) == null ? void 0 : h.find(
|
|
1436
|
+
(w) => w.type === "image" && w.image_url
|
|
1437
1437
|
), a = (r = e.attachments) == null ? void 0 : r.find(
|
|
1438
|
-
(
|
|
1439
|
-
), o = (
|
|
1440
|
-
(
|
|
1438
|
+
(w) => w.type === "audio" && w.asset_url
|
|
1439
|
+
), o = (b = e.attachments) == null ? void 0 : b.find(
|
|
1440
|
+
(w) => w.type === "file" && w.asset_url
|
|
1441
1441
|
), l = s ?? n ?? a ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (o == null ? void 0 : o.asset_url);
|
|
1442
1442
|
if (!i) return null;
|
|
1443
|
-
const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), f = l == null ? void 0 : l.title,
|
|
1443
|
+
const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), f = l == null ? void 0 : l.title, g = l == null ? void 0 : l.file_size, _ = s == null ? void 0 : s.thumb_url;
|
|
1444
1444
|
return {
|
|
1445
1445
|
resolvedUrl: i,
|
|
1446
1446
|
resolvedType: c,
|
|
1447
1447
|
title: f,
|
|
1448
|
-
fileSize:
|
|
1449
|
-
thumbnailUrl:
|
|
1448
|
+
fileSize: g,
|
|
1449
|
+
thumbnailUrl: _
|
|
1450
1450
|
};
|
|
1451
1451
|
}
|
|
1452
|
-
const
|
|
1452
|
+
const zt = ({
|
|
1453
1453
|
resolvedUrl: e,
|
|
1454
1454
|
resolvedType: s,
|
|
1455
1455
|
title: n,
|
|
1456
1456
|
fileSize: a,
|
|
1457
1457
|
thumbnailUrl: o
|
|
1458
1458
|
}) => {
|
|
1459
|
-
const l = a !== void 0 ?
|
|
1459
|
+
const l = a !== void 0 ? Ot(a) : void 0;
|
|
1460
1460
|
return /* @__PURE__ */ t(
|
|
1461
|
-
|
|
1461
|
+
Ft,
|
|
1462
1462
|
{
|
|
1463
1463
|
variant: "dark",
|
|
1464
1464
|
title: n,
|
|
@@ -1466,7 +1466,7 @@ const Lt = ({
|
|
|
1466
1466
|
mimeType: s,
|
|
1467
1467
|
detail: l,
|
|
1468
1468
|
thumbnail: /* @__PURE__ */ t(
|
|
1469
|
-
|
|
1469
|
+
At,
|
|
1470
1470
|
{
|
|
1471
1471
|
mimeType: s,
|
|
1472
1472
|
sourceUrl: e,
|
|
@@ -1477,23 +1477,23 @@ const Lt = ({
|
|
|
1477
1477
|
)
|
|
1478
1478
|
}
|
|
1479
1479
|
);
|
|
1480
|
-
},
|
|
1480
|
+
}, $t = ({
|
|
1481
1481
|
resolvedUrl: e,
|
|
1482
1482
|
resolvedType: s,
|
|
1483
1483
|
title: n,
|
|
1484
1484
|
fileSize: a,
|
|
1485
1485
|
thumbnailUrl: o
|
|
1486
1486
|
}) => {
|
|
1487
|
-
const l =
|
|
1487
|
+
const l = Ne(s), i = a !== void 0 ? Ot(a) : void 0;
|
|
1488
1488
|
return /* @__PURE__ */ t(
|
|
1489
|
-
|
|
1489
|
+
Ft,
|
|
1490
1490
|
{
|
|
1491
1491
|
variant: "light",
|
|
1492
1492
|
title: n,
|
|
1493
1493
|
mimeType: s,
|
|
1494
1494
|
detail: i,
|
|
1495
1495
|
thumbnail: /* @__PURE__ */ t(
|
|
1496
|
-
|
|
1496
|
+
At,
|
|
1497
1497
|
{
|
|
1498
1498
|
mimeType: s,
|
|
1499
1499
|
sourceUrl: e,
|
|
@@ -1503,14 +1503,14 @@ const Lt = ({
|
|
|
1503
1503
|
containedImage: l === "image" || l === "document"
|
|
1504
1504
|
}
|
|
1505
1505
|
),
|
|
1506
|
-
action: /* @__PURE__ */ t(
|
|
1506
|
+
action: /* @__PURE__ */ t(Pn, { url: e, filename: n })
|
|
1507
1507
|
}
|
|
1508
1508
|
);
|
|
1509
|
-
},
|
|
1509
|
+
}, zn = ({
|
|
1510
1510
|
message: e,
|
|
1511
1511
|
isMyMessage: s = !1
|
|
1512
1512
|
}) => {
|
|
1513
|
-
const n =
|
|
1513
|
+
const n = je(e), a = Ge(e);
|
|
1514
1514
|
return !n && !a ? null : /* @__PURE__ */ d("div", { className: s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
1515
1515
|
!s && e.user && /* @__PURE__ */ t(
|
|
1516
1516
|
ae,
|
|
@@ -1531,40 +1531,40 @@ const Lt = ({
|
|
|
1531
1531
|
{
|
|
1532
1532
|
className: "str-chat__message-bubble",
|
|
1533
1533
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1534
|
-
children: n ? /* @__PURE__ */ t("div", { className:
|
|
1534
|
+
children: n ? /* @__PURE__ */ t("div", { className: Be(s), children: /* @__PURE__ */ t(Ue, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ t(zt, { ...a }) : /* @__PURE__ */ t($t, { ...a })
|
|
1535
1535
|
}
|
|
1536
1536
|
) })
|
|
1537
1537
|
}
|
|
1538
1538
|
)
|
|
1539
1539
|
] });
|
|
1540
|
-
},
|
|
1540
|
+
}, $n = ({
|
|
1541
1541
|
message: e
|
|
1542
1542
|
}) => {
|
|
1543
|
-
const s =
|
|
1543
|
+
const s = je(e);
|
|
1544
1544
|
if (s)
|
|
1545
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1546
|
-
const n =
|
|
1547
|
-
return n ? /* @__PURE__ */ t(
|
|
1548
|
-
},
|
|
1545
|
+
return /* @__PURE__ */ t("div", { className: Be(!0), children: /* @__PURE__ */ t(Ue, { attachment: s, isMyMessage: !0 }) });
|
|
1546
|
+
const n = Ge(e);
|
|
1547
|
+
return n ? /* @__PURE__ */ t(zt, { ...n }) : null;
|
|
1548
|
+
}, Bn = ({
|
|
1549
1549
|
message: e
|
|
1550
1550
|
}) => {
|
|
1551
|
-
const s =
|
|
1551
|
+
const s = je(e);
|
|
1552
1552
|
if (s)
|
|
1553
|
-
return /* @__PURE__ */ t("div", { className:
|
|
1554
|
-
const n =
|
|
1555
|
-
return n ? /* @__PURE__ */ t(
|
|
1556
|
-
},
|
|
1557
|
-
Creator:
|
|
1558
|
-
Visitor:
|
|
1559
|
-
}),
|
|
1553
|
+
return /* @__PURE__ */ t("div", { className: Be(!1), children: /* @__PURE__ */ t(Ue, { attachment: s, isMyMessage: !1 }) });
|
|
1554
|
+
const n = Ge(e);
|
|
1555
|
+
return n ? /* @__PURE__ */ t($t, { ...n }) : null;
|
|
1556
|
+
}, Ra = Object.assign(zn, {
|
|
1557
|
+
Creator: $n,
|
|
1558
|
+
Visitor: Bn
|
|
1559
|
+
}), Un = {
|
|
1560
1560
|
isUnlocking: () => !1
|
|
1561
|
-
},
|
|
1562
|
-
LockedAttachment:
|
|
1563
|
-
},
|
|
1564
|
-
function
|
|
1565
|
-
return
|
|
1561
|
+
}, jn = {
|
|
1562
|
+
LockedAttachment: Un
|
|
1563
|
+
}, Bt = Fe({}), La = Bt.Provider;
|
|
1564
|
+
function Gn(e) {
|
|
1565
|
+
return Oe(Bt)[e] ?? jn[e];
|
|
1566
1566
|
}
|
|
1567
|
-
const
|
|
1567
|
+
const Vn = ({
|
|
1568
1568
|
selected: e,
|
|
1569
1569
|
onVoteUp: s,
|
|
1570
1570
|
onVoteDown: n
|
|
@@ -1580,7 +1580,7 @@ const Fn = ({
|
|
|
1580
1580
|
"aria-label": "Good response",
|
|
1581
1581
|
"aria-pressed": e === "up",
|
|
1582
1582
|
"data-tooltip": "Good response",
|
|
1583
|
-
children: /* @__PURE__ */ t(
|
|
1583
|
+
children: /* @__PURE__ */ t(Hs, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
1586
|
/* @__PURE__ */ t(
|
|
@@ -1594,11 +1594,11 @@ const Fn = ({
|
|
|
1594
1594
|
"aria-label": "Bad response",
|
|
1595
1595
|
"aria-pressed": e === "down",
|
|
1596
1596
|
"data-tooltip": "Bad response",
|
|
1597
|
-
children: /* @__PURE__ */ t(
|
|
1597
|
+
children: /* @__PURE__ */ t(Ys, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1598
1598
|
}
|
|
1599
1599
|
)
|
|
1600
|
-
] }),
|
|
1601
|
-
var
|
|
1600
|
+
] }), Hn = (e) => {
|
|
1601
|
+
var He, Ye, qe, We, Xe, Ze, Je, Ke, Qe, et, tt, st, nt, at;
|
|
1602
1602
|
const {
|
|
1603
1603
|
additionalMessageInputProps: s,
|
|
1604
1604
|
chatbotVotingEnabled: n,
|
|
@@ -1608,47 +1608,47 @@ const Fn = ({
|
|
|
1608
1608
|
groupedByUser: i,
|
|
1609
1609
|
handleAction: c,
|
|
1610
1610
|
handleOpenThread: f,
|
|
1611
|
-
handleRetry:
|
|
1612
|
-
highlighted:
|
|
1613
|
-
isMessageAIGenerated:
|
|
1614
|
-
isMyMessage:
|
|
1611
|
+
handleRetry: g,
|
|
1612
|
+
highlighted: _,
|
|
1613
|
+
isMessageAIGenerated: m,
|
|
1614
|
+
isMyMessage: h,
|
|
1615
1615
|
message: r,
|
|
1616
|
-
renderText:
|
|
1617
|
-
threadList:
|
|
1618
|
-
viewerLanguage:
|
|
1619
|
-
} = e, { client: N } =
|
|
1620
|
-
Attachment:
|
|
1621
|
-
EditMessageModal: V =
|
|
1622
|
-
MessageBlocked: R =
|
|
1623
|
-
MessageBouncePrompt:
|
|
1624
|
-
MessageDeleted: E =
|
|
1625
|
-
MessageIsThreadReplyInChannelButtonIndicator: H =
|
|
1626
|
-
MessageRepliesCountButton: Y =
|
|
1627
|
-
ReminderNotification: te =
|
|
1628
|
-
StreamedMessageText:
|
|
1629
|
-
PinIndicator:
|
|
1630
|
-
} =
|
|
1631
|
-
() =>
|
|
1632
|
-
[
|
|
1633
|
-
), W =
|
|
1634
|
-
const
|
|
1635
|
-
if (!
|
|
1636
|
-
const
|
|
1637
|
-
return
|
|
1638
|
-
}, [r]), Q =
|
|
1639
|
-
const
|
|
1640
|
-
return
|
|
1641
|
-
}, [r,
|
|
1642
|
-
if (
|
|
1616
|
+
renderText: b,
|
|
1617
|
+
threadList: w,
|
|
1618
|
+
viewerLanguage: x
|
|
1619
|
+
} = e, { client: N } = Pe("CustomMessage"), { channel: p } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: S, onFetchSource: T, onDownloadClick: U } = Gn("LockedAttachment"), [k, M] = P(!1), j = Xt(r.id), { selected: y, voteUp: A, voteDown: v } = bn(r), {
|
|
1620
|
+
Attachment: F = Zt,
|
|
1621
|
+
EditMessageModal: V = Jt,
|
|
1622
|
+
MessageBlocked: R = Kt,
|
|
1623
|
+
MessageBouncePrompt: z = Qt,
|
|
1624
|
+
MessageDeleted: E = es,
|
|
1625
|
+
MessageIsThreadReplyInChannelButtonIndicator: H = ts,
|
|
1626
|
+
MessageRepliesCountButton: Y = ss,
|
|
1627
|
+
ReminderNotification: te = ns,
|
|
1628
|
+
StreamedMessageText: $ = as,
|
|
1629
|
+
PinIndicator: u
|
|
1630
|
+
} = wt("CustomMessage"), C = rs(r), B = is(r), K = xe(
|
|
1631
|
+
() => m == null ? void 0 : m(r),
|
|
1632
|
+
[m, r]
|
|
1633
|
+
), W = xe(() => {
|
|
1634
|
+
const me = r.attachments ?? [], be = r.shared_location ? [r.shared_location, ...me] : me;
|
|
1635
|
+
if (!we(r)) return be;
|
|
1636
|
+
const rt = be.filter((it) => !("type" in it) || !Pt(it));
|
|
1637
|
+
return rt.length === be.length ? be : rt;
|
|
1638
|
+
}, [r]), Q = xe(() => {
|
|
1639
|
+
const me = kt({ message: r, viewerLanguage: x });
|
|
1640
|
+
return me === r.text ? r : { ...r, text: me };
|
|
1641
|
+
}, [r, x]);
|
|
1642
|
+
if (os(r))
|
|
1643
1643
|
return null;
|
|
1644
1644
|
if (r.deleted_at || r.type === "deleted")
|
|
1645
1645
|
return /* @__PURE__ */ t(E, { message: r });
|
|
1646
|
-
if (
|
|
1646
|
+
if (ls(r))
|
|
1647
1647
|
return /* @__PURE__ */ t(R, {});
|
|
1648
|
-
const
|
|
1648
|
+
const he = !w && !!r.reply_count, fe = !w && r.show_in_channel && r.parent_id, re = r.status === "failed" && ((He = r.error) == null ? void 0 : He.status) !== 403, ee = cs(r);
|
|
1649
1649
|
let se;
|
|
1650
|
-
re ? se = () =>
|
|
1651
|
-
const ie =
|
|
1650
|
+
re ? se = () => g(r) : ee && (se = () => M(!0));
|
|
1651
|
+
const ie = h(), Ce = D(
|
|
1652
1652
|
"str-chat__message str-chat__message-simple",
|
|
1653
1653
|
`str-chat__message--${r.type}`,
|
|
1654
1654
|
`str-chat__message--${r.status}`,
|
|
@@ -1656,16 +1656,16 @@ const Fn = ({
|
|
|
1656
1656
|
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1657
1657
|
{
|
|
1658
1658
|
"str-chat__message--has-attachment": C,
|
|
1659
|
-
"str-chat__message--highlighted":
|
|
1659
|
+
"str-chat__message--highlighted": _,
|
|
1660
1660
|
"str-chat__message--pinned pinned-message": r.pinned,
|
|
1661
|
-
"str-chat__message--with-reactions":
|
|
1662
|
-
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((
|
|
1663
|
-
"str-chat__message-with-thread-link":
|
|
1661
|
+
"str-chat__message--with-reactions": B,
|
|
1662
|
+
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((Ye = r == null ? void 0 : r.error) == null ? void 0 : Ye.status) !== 403,
|
|
1663
|
+
"str-chat__message-with-thread-link": he || fe,
|
|
1664
1664
|
"str-chat__virtual-message__wrapper--end": o,
|
|
1665
1665
|
"str-chat__virtual-message__wrapper--first": l,
|
|
1666
1666
|
"str-chat__virtual-message__wrapper--group": i
|
|
1667
1667
|
}
|
|
1668
|
-
),
|
|
1668
|
+
), ge = r.poll_id && N.polls.fromState(r.poll_id), le = cn(r), O = we(r), X = ln(r), Z = !!(W != null && W.length && !r.quoted_message), ne = O && ie && Z;
|
|
1669
1669
|
return /* @__PURE__ */ d(de, { children: [
|
|
1670
1670
|
a && /* @__PURE__ */ t(
|
|
1671
1671
|
V,
|
|
@@ -1674,15 +1674,15 @@ const Fn = ({
|
|
|
1674
1674
|
}
|
|
1675
1675
|
),
|
|
1676
1676
|
k && /* @__PURE__ */ t(
|
|
1677
|
-
|
|
1677
|
+
ds,
|
|
1678
1678
|
{
|
|
1679
|
-
MessageBouncePrompt:
|
|
1680
|
-
onClose: () =>
|
|
1679
|
+
MessageBouncePrompt: z,
|
|
1680
|
+
onClose: () => M(!1),
|
|
1681
1681
|
open: k
|
|
1682
1682
|
}
|
|
1683
1683
|
),
|
|
1684
|
-
/* @__PURE__ */ d("div", { className:
|
|
1685
|
-
|
|
1684
|
+
/* @__PURE__ */ d("div", { className: Ce, children: [
|
|
1685
|
+
u && /* @__PURE__ */ t(u, {}),
|
|
1686
1686
|
!!j && /* @__PURE__ */ t(te, { reminder: j }),
|
|
1687
1687
|
r.user && /* @__PURE__ */ t(
|
|
1688
1688
|
ae,
|
|
@@ -1691,9 +1691,9 @@ const Fn = ({
|
|
|
1691
1691
|
id: r.user.id,
|
|
1692
1692
|
image: r.user.image,
|
|
1693
1693
|
name: r.user.name || r.user.id,
|
|
1694
|
-
size:
|
|
1694
|
+
size: O ? 24 : 28,
|
|
1695
1695
|
shape: "circle",
|
|
1696
|
-
dmAgentEnabled:
|
|
1696
|
+
dmAgentEnabled: O
|
|
1697
1697
|
}
|
|
1698
1698
|
),
|
|
1699
1699
|
/* @__PURE__ */ t(
|
|
@@ -1715,20 +1715,7 @@ const Fn = ({
|
|
|
1715
1715
|
},
|
|
1716
1716
|
children: X ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1717
1717
|
ie ? /* @__PURE__ */ t(
|
|
1718
|
-
|
|
1719
|
-
{
|
|
1720
|
-
title: ($e = r.metadata) == null ? void 0 : $e.attachment_title,
|
|
1721
|
-
mimeType: (je = r.metadata) == null ? void 0 : je.attachment_mime_type,
|
|
1722
|
-
thumbnailUrl: (Ge = r.metadata) == null ? void 0 : Ge.attachment_thumbnail,
|
|
1723
|
-
amountText: (Ve = r.metadata) == null ? void 0 : Ve.amount_text,
|
|
1724
|
-
detail: (He = r.metadata) == null ? void 0 : He.attachment_detail,
|
|
1725
|
-
paymentStatus: (Ye = r.metadata) == null ? void 0 : Ye.payment_status,
|
|
1726
|
-
isUnlocking: S(r.id),
|
|
1727
|
-
onPreviewClick: () => I == null ? void 0 : I(r, w),
|
|
1728
|
-
onFetchSource: async () => await (M == null ? void 0 : M(r, w))
|
|
1729
|
-
}
|
|
1730
|
-
) : /* @__PURE__ */ t(
|
|
1731
|
-
ct.Visitor,
|
|
1718
|
+
gt.Sent,
|
|
1732
1719
|
{
|
|
1733
1720
|
title: (qe = r.metadata) == null ? void 0 : qe.attachment_title,
|
|
1734
1721
|
mimeType: (We = r.metadata) == null ? void 0 : We.attachment_mime_type,
|
|
@@ -1736,95 +1723,107 @@ const Fn = ({
|
|
|
1736
1723
|
amountText: (Ze = r.metadata) == null ? void 0 : Ze.amount_text,
|
|
1737
1724
|
detail: (Je = r.metadata) == null ? void 0 : Je.attachment_detail,
|
|
1738
1725
|
paymentStatus: (Ke = r.metadata) == null ? void 0 : Ke.payment_status,
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1726
|
+
onPreviewClick: () => S == null ? void 0 : S(r, p),
|
|
1727
|
+
onFetchSource: async () => await (T == null ? void 0 : T(r, p))
|
|
1728
|
+
}
|
|
1729
|
+
) : /* @__PURE__ */ t(
|
|
1730
|
+
gt.Received,
|
|
1731
|
+
{
|
|
1732
|
+
title: (Qe = r.metadata) == null ? void 0 : Qe.attachment_title,
|
|
1733
|
+
mimeType: (et = r.metadata) == null ? void 0 : et.attachment_mime_type,
|
|
1734
|
+
thumbnailUrl: (tt = r.metadata) == null ? void 0 : tt.attachment_thumbnail,
|
|
1735
|
+
amountText: (st = r.metadata) == null ? void 0 : st.amount_text,
|
|
1736
|
+
detail: (nt = r.metadata) == null ? void 0 : nt.attachment_detail,
|
|
1737
|
+
paymentStatus: (at = r.metadata) == null ? void 0 : at.payment_status,
|
|
1738
|
+
isUnlocking: I(r.id),
|
|
1739
|
+
onUnlockClick: () => S == null ? void 0 : S(r, p),
|
|
1740
|
+
onFetchSource: async () => await (T == null ? void 0 : T(r, p)),
|
|
1741
|
+
onDownloadClick: () => U == null ? void 0 : U(r, p)
|
|
1743
1742
|
}
|
|
1744
1743
|
),
|
|
1745
1744
|
r.text && /* @__PURE__ */ t("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ t(
|
|
1746
|
-
|
|
1745
|
+
ot,
|
|
1747
1746
|
{
|
|
1748
1747
|
message: Q,
|
|
1749
|
-
renderText:
|
|
1748
|
+
renderText: b
|
|
1750
1749
|
}
|
|
1751
1750
|
) })
|
|
1752
1751
|
] }) : le ? (
|
|
1753
1752
|
/* Tip-only messages render as a standalone bubble */
|
|
1754
|
-
/* @__PURE__ */ t(
|
|
1753
|
+
/* @__PURE__ */ t(ke, { message: r, standalone: !0 })
|
|
1755
1754
|
) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1756
1755
|
/* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
|
|
1757
|
-
|
|
1758
|
-
|
|
1756
|
+
O && !ne && /* @__PURE__ */ t(
|
|
1757
|
+
ke,
|
|
1759
1758
|
{
|
|
1760
1759
|
message: r,
|
|
1761
1760
|
hasAttachment: Z,
|
|
1762
1761
|
isMyMessage: ie
|
|
1763
1762
|
}
|
|
1764
1763
|
),
|
|
1765
|
-
|
|
1764
|
+
ge && /* @__PURE__ */ t(us, { poll: ge }),
|
|
1766
1765
|
W != null && W.length && !r.quoted_message ? /* @__PURE__ */ t(
|
|
1767
|
-
|
|
1766
|
+
F,
|
|
1768
1767
|
{
|
|
1769
1768
|
actionHandler: c,
|
|
1770
1769
|
attachments: W
|
|
1771
1770
|
}
|
|
1772
1771
|
) : null,
|
|
1773
1772
|
K ? /* @__PURE__ */ t(
|
|
1774
|
-
|
|
1773
|
+
$,
|
|
1775
1774
|
{
|
|
1776
1775
|
message: Q,
|
|
1777
|
-
renderText:
|
|
1776
|
+
renderText: b
|
|
1778
1777
|
}
|
|
1779
1778
|
) : /* @__PURE__ */ t(
|
|
1780
|
-
|
|
1779
|
+
ot,
|
|
1781
1780
|
{
|
|
1782
1781
|
message: Q,
|
|
1783
|
-
renderText:
|
|
1782
|
+
renderText: b
|
|
1784
1783
|
}
|
|
1785
1784
|
),
|
|
1786
|
-
/* @__PURE__ */ t(
|
|
1785
|
+
/* @__PURE__ */ t(ms, {})
|
|
1787
1786
|
] }),
|
|
1788
|
-
(!
|
|
1789
|
-
|
|
1787
|
+
(!O || ne) && /* @__PURE__ */ t(
|
|
1788
|
+
ke,
|
|
1790
1789
|
{
|
|
1791
1790
|
message: r,
|
|
1792
1791
|
hasAttachment: Z,
|
|
1793
1792
|
isMyMessage: ie
|
|
1794
1793
|
}
|
|
1795
1794
|
),
|
|
1796
|
-
n &&
|
|
1797
|
-
|
|
1795
|
+
n && O && /* @__PURE__ */ t(
|
|
1796
|
+
Vn,
|
|
1798
1797
|
{
|
|
1799
|
-
selected:
|
|
1800
|
-
onVoteUp:
|
|
1798
|
+
selected: y,
|
|
1799
|
+
onVoteUp: A,
|
|
1801
1800
|
onVoteDown: v
|
|
1802
1801
|
}
|
|
1803
1802
|
)
|
|
1804
1803
|
] })
|
|
1805
1804
|
}
|
|
1806
1805
|
),
|
|
1807
|
-
|
|
1806
|
+
he && /* @__PURE__ */ t(
|
|
1808
1807
|
Y,
|
|
1809
1808
|
{
|
|
1810
1809
|
onClick: f,
|
|
1811
1810
|
reply_count: r.reply_count
|
|
1812
1811
|
}
|
|
1813
1812
|
),
|
|
1814
|
-
|
|
1813
|
+
fe && /* @__PURE__ */ t(H, {})
|
|
1815
1814
|
] }, r.id)
|
|
1816
1815
|
] });
|
|
1817
|
-
},
|
|
1818
|
-
|
|
1819
|
-
(e, s) => e.chatbotVotingEnabled !== s.chatbotVotingEnabled || e.viewerLanguage !== s.viewerLanguage ? !1 :
|
|
1820
|
-
),
|
|
1821
|
-
const s =
|
|
1822
|
-
return /* @__PURE__ */ t(
|
|
1823
|
-
},
|
|
1816
|
+
}, Yn = L.memo(
|
|
1817
|
+
Hn,
|
|
1818
|
+
(e, s) => e.chatbotVotingEnabled !== s.chatbotVotingEnabled || e.viewerLanguage !== s.viewerLanguage ? !1 : Wt(e, s)
|
|
1819
|
+
), qn = (e) => {
|
|
1820
|
+
const s = _t("CustomMessage");
|
|
1821
|
+
return /* @__PURE__ */ t(Yn, { ...s, ...e });
|
|
1822
|
+
}, Wn = (e) => ({
|
|
1824
1823
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1825
|
-
(s) =>
|
|
1824
|
+
(s) => ht.previewIsLoaded(s) || ht.previewIsLoading(s)
|
|
1826
1825
|
)
|
|
1827
|
-
}),
|
|
1826
|
+
}), Xn = ({
|
|
1828
1827
|
link: e,
|
|
1829
1828
|
onDismiss: s
|
|
1830
1829
|
}) => {
|
|
@@ -1854,7 +1853,7 @@ const Fn = ({
|
|
|
1854
1853
|
},
|
|
1855
1854
|
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",
|
|
1856
1855
|
"aria-label": "Close link preview",
|
|
1857
|
-
children: /* @__PURE__ */ t(
|
|
1856
|
+
children: /* @__PURE__ */ t(yt, { className: "size-4 text-black/90" })
|
|
1858
1857
|
}
|
|
1859
1858
|
),
|
|
1860
1859
|
/* @__PURE__ */ d("div", { className: "p-2", children: [
|
|
@@ -1864,22 +1863,22 @@ const Fn = ({
|
|
|
1864
1863
|
]
|
|
1865
1864
|
}
|
|
1866
1865
|
);
|
|
1867
|
-
},
|
|
1868
|
-
const { linkPreviewsManager: e } =
|
|
1866
|
+
}, Zn = () => {
|
|
1867
|
+
const { linkPreviewsManager: e } = hs(), { linkPreviews: s } = fs(
|
|
1869
1868
|
e.state,
|
|
1870
|
-
|
|
1869
|
+
Wn
|
|
1871
1870
|
), n = (o) => {
|
|
1872
1871
|
e.dismissPreview(o);
|
|
1873
1872
|
};
|
|
1874
1873
|
return s.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ t(
|
|
1875
|
-
|
|
1874
|
+
Xn,
|
|
1876
1875
|
{
|
|
1877
1876
|
link: o,
|
|
1878
1877
|
onDismiss: n
|
|
1879
1878
|
},
|
|
1880
1879
|
o.og_scrape_url
|
|
1881
1880
|
)) }) : null;
|
|
1882
|
-
},
|
|
1881
|
+
}, Jn = ({ sendMessage: e, disabled: s, ...n }) => /* @__PURE__ */ t(
|
|
1883
1882
|
"button",
|
|
1884
1883
|
{
|
|
1885
1884
|
...n,
|
|
@@ -1887,22 +1886,22 @@ const Fn = ({
|
|
|
1887
1886
|
"aria-label": "Send",
|
|
1888
1887
|
disabled: s,
|
|
1889
1888
|
onClick: e,
|
|
1890
|
-
children: /* @__PURE__ */ t(
|
|
1889
|
+
children: /* @__PURE__ */ t(qs, { weight: "bold", className: "size-4" })
|
|
1891
1890
|
}
|
|
1892
|
-
),
|
|
1891
|
+
), Kn = () => {
|
|
1893
1892
|
var c;
|
|
1894
|
-
const { channel: e } = oe(), s = ((c = e == null ? void 0 : e.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } =
|
|
1893
|
+
const { channel: e } = oe(), s = ((c = e == null ? void 0 : e.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = bs(), { SendButton: a } = wt(
|
|
1895
1894
|
"CustomMessageInput"
|
|
1896
|
-
), o = a ??
|
|
1895
|
+
), o = a ?? Jn, l = ps();
|
|
1897
1896
|
return /* @__PURE__ */ d(de, { children: [
|
|
1898
|
-
/* @__PURE__ */ t("div", { className: "left-container", children: /* @__PURE__ */ t(
|
|
1897
|
+
/* @__PURE__ */ t("div", { className: "left-container", children: /* @__PURE__ */ t(xs, {}) }),
|
|
1899
1898
|
/* @__PURE__ */ d("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1900
|
-
/* @__PURE__ */ t(
|
|
1901
|
-
/* @__PURE__ */ t(
|
|
1902
|
-
/* @__PURE__ */ t(
|
|
1899
|
+
/* @__PURE__ */ t(vs, {}),
|
|
1900
|
+
/* @__PURE__ */ t(Zn, {}),
|
|
1901
|
+
/* @__PURE__ */ t(ws, {}),
|
|
1903
1902
|
/* @__PURE__ */ d("div", { className: "flex", children: [
|
|
1904
1903
|
/* @__PURE__ */ t("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ t(
|
|
1905
|
-
|
|
1904
|
+
_s,
|
|
1906
1905
|
{
|
|
1907
1906
|
"aria-disabled": s || void 0,
|
|
1908
1907
|
className: "w-full resize-none outline-none leading-6",
|
|
@@ -1926,7 +1925,7 @@ const Fn = ({
|
|
|
1926
1925
|
] })
|
|
1927
1926
|
] })
|
|
1928
1927
|
] });
|
|
1929
|
-
},
|
|
1928
|
+
}, Qn = ({
|
|
1930
1929
|
renderActions: e
|
|
1931
1930
|
}) => {
|
|
1932
1931
|
var a;
|
|
@@ -1939,65 +1938,65 @@ const Fn = ({
|
|
|
1939
1938
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1940
1939
|
children: [
|
|
1941
1940
|
e == null ? void 0 : e(),
|
|
1942
|
-
/* @__PURE__ */ t(
|
|
1941
|
+
/* @__PURE__ */ t(gs, { Input: Kn })
|
|
1943
1942
|
]
|
|
1944
1943
|
}
|
|
1945
1944
|
);
|
|
1946
|
-
},
|
|
1945
|
+
}, ea = [
|
|
1947
1946
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1948
1947
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1949
|
-
],
|
|
1948
|
+
], ta = {
|
|
1950
1949
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1951
1950
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1952
|
-
},
|
|
1951
|
+
}, sa = [
|
|
1953
1952
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1954
|
-
],
|
|
1953
|
+
], na = {
|
|
1955
1954
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1956
|
-
},
|
|
1955
|
+
}, Te = "age safety guidelines.", aa = "https://linktr.ee/s/about/contact", pt = (e) => ea.includes(e), ra = (e) => sa.includes(e), ia = (e) => {
|
|
1957
1956
|
var a;
|
|
1958
1957
|
const s = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1959
|
-
if (
|
|
1958
|
+
if (pt(s))
|
|
1960
1959
|
return {
|
|
1961
1960
|
kind: "dm-agent",
|
|
1962
1961
|
type: s
|
|
1963
1962
|
};
|
|
1964
|
-
if (
|
|
1963
|
+
if (ra(s))
|
|
1965
1964
|
return {
|
|
1966
1965
|
kind: "age-safety",
|
|
1967
1966
|
type: s
|
|
1968
1967
|
};
|
|
1969
1968
|
const n = e.dm_agent_system_type;
|
|
1970
|
-
if (
|
|
1969
|
+
if (pt(n))
|
|
1971
1970
|
return {
|
|
1972
1971
|
kind: "dm-agent",
|
|
1973
1972
|
type: n
|
|
1974
1973
|
};
|
|
1975
|
-
},
|
|
1976
|
-
const s = e.indexOf(
|
|
1974
|
+
}, oa = (e) => {
|
|
1975
|
+
const s = e.indexOf(Te);
|
|
1977
1976
|
if (s === -1)
|
|
1978
1977
|
return e;
|
|
1979
|
-
const n = s +
|
|
1978
|
+
const n = s + Te.length;
|
|
1980
1979
|
return /* @__PURE__ */ d(de, { children: [
|
|
1981
1980
|
e.slice(0, s),
|
|
1982
1981
|
/* @__PURE__ */ t(
|
|
1983
1982
|
"a",
|
|
1984
1983
|
{
|
|
1985
|
-
href:
|
|
1984
|
+
href: aa,
|
|
1986
1985
|
target: "_blank",
|
|
1987
1986
|
rel: "noopener noreferrer",
|
|
1988
1987
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1989
|
-
children:
|
|
1988
|
+
children: Te
|
|
1990
1989
|
}
|
|
1991
1990
|
),
|
|
1992
1991
|
e.slice(n)
|
|
1993
1992
|
] });
|
|
1994
|
-
},
|
|
1993
|
+
}, la = (e) => {
|
|
1995
1994
|
var a, o;
|
|
1996
|
-
const s = e.message.hide_date === !0, n =
|
|
1995
|
+
const s = e.message.hide_date === !0, n = ia(
|
|
1997
1996
|
e.message
|
|
1998
1997
|
);
|
|
1999
1998
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
2000
|
-
const l = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1999
|
+
const l = ((a = e.message.text) == null ? void 0 : a.trim()) || ta[n.type];
|
|
2001
2000
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
2002
2001
|
/* @__PURE__ */ d(
|
|
2003
2002
|
"div",
|
|
@@ -2007,7 +2006,7 @@ const Fn = ({
|
|
|
2007
2006
|
"data-dm-agent-system-type": n.type,
|
|
2008
2007
|
children: [
|
|
2009
2008
|
/* @__PURE__ */ t(
|
|
2010
|
-
|
|
2009
|
+
Re,
|
|
2011
2010
|
{
|
|
2012
2011
|
size: 16,
|
|
2013
2012
|
weight: "regular",
|
|
@@ -2019,11 +2018,11 @@ const Fn = ({
|
|
|
2019
2018
|
]
|
|
2020
2019
|
}
|
|
2021
2020
|
),
|
|
2022
|
-
!s && /* @__PURE__ */ t(
|
|
2021
|
+
!s && /* @__PURE__ */ t(Ee, { message: e.message })
|
|
2023
2022
|
] });
|
|
2024
2023
|
}
|
|
2025
2024
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
2026
|
-
const l = ((o = e.message.text) == null ? void 0 : o.trim()) ||
|
|
2025
|
+
const l = ((o = e.message.text) == null ? void 0 : o.trim()) || na[n.type];
|
|
2027
2026
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
2028
2027
|
/* @__PURE__ */ d(
|
|
2029
2028
|
"div",
|
|
@@ -2033,7 +2032,7 @@ const Fn = ({
|
|
|
2033
2032
|
"data-age-safety-system-type": n.type,
|
|
2034
2033
|
children: [
|
|
2035
2034
|
/* @__PURE__ */ t(
|
|
2036
|
-
|
|
2035
|
+
Ws,
|
|
2037
2036
|
{
|
|
2038
2037
|
size: 24,
|
|
2039
2038
|
weight: "duotone",
|
|
@@ -2042,11 +2041,11 @@ const Fn = ({
|
|
|
2042
2041
|
"data-testid": "age-safety-system-message-icon"
|
|
2043
2042
|
}
|
|
2044
2043
|
),
|
|
2045
|
-
/* @__PURE__ */ t("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ t("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
2044
|
+
/* @__PURE__ */ t("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ t("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: oa(l) }) })
|
|
2046
2045
|
]
|
|
2047
2046
|
}
|
|
2048
2047
|
),
|
|
2049
|
-
!s && /* @__PURE__ */ t(
|
|
2048
|
+
!s && /* @__PURE__ */ t(Ee, { message: e.message })
|
|
2050
2049
|
] });
|
|
2051
2050
|
}
|
|
2052
2051
|
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -2055,9 +2054,9 @@ const Fn = ({
|
|
|
2055
2054
|
/* @__PURE__ */ t("p", { children: e.message.text }),
|
|
2056
2055
|
/* @__PURE__ */ t("div", { className: "str-chat__message--system__line" })
|
|
2057
2056
|
] }),
|
|
2058
|
-
!s && /* @__PURE__ */ t(
|
|
2057
|
+
!s && /* @__PURE__ */ t(Ee, { message: e.message })
|
|
2059
2058
|
] });
|
|
2060
|
-
},
|
|
2059
|
+
}, Ut = Fe(!1), Me = ({ cx: e, index: s }) => /* @__PURE__ */ t("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ t(
|
|
2061
2060
|
"animateTransform",
|
|
2062
2061
|
{
|
|
2063
2062
|
attributeName: "transform",
|
|
@@ -2067,62 +2066,101 @@ const Fn = ({
|
|
|
2067
2066
|
begin: `${120 * s}ms`,
|
|
2068
2067
|
repeatCount: "indefinite"
|
|
2069
2068
|
}
|
|
2070
|
-
) }),
|
|
2071
|
-
|
|
2072
|
-
|
|
2069
|
+
) }), ca = /* @__PURE__ */ new Set([
|
|
2070
|
+
Se.Thinking,
|
|
2071
|
+
Se.Generating,
|
|
2072
|
+
Se.ExternalSources
|
|
2073
|
+
]), da = ({ threadList: e }) => {
|
|
2074
|
+
var b, w;
|
|
2075
|
+
const { channel: s, channelConfig: n, thread: a } = oe(), { client: o } = Pe(), { typing: l = {} } = ys(), { aiState: i } = Ns(s), c = Oe(Ut);
|
|
2076
|
+
if (!e && c && ca.has(i)) {
|
|
2077
|
+
const x = ua(s, (b = o.user) == null ? void 0 : b.id);
|
|
2078
|
+
return /* @__PURE__ */ t(
|
|
2079
|
+
xt,
|
|
2080
|
+
{
|
|
2081
|
+
avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
|
|
2082
|
+
avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
|
|
2083
|
+
avatarImage: x == null ? void 0 : x.image,
|
|
2084
|
+
testId: "typing-indicator-ai"
|
|
2085
|
+
}
|
|
2086
|
+
);
|
|
2087
|
+
}
|
|
2073
2088
|
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
2074
2089
|
return null;
|
|
2075
|
-
const
|
|
2076
|
-
({ parent_id: x, user:
|
|
2077
|
-
var
|
|
2078
|
-
return (
|
|
2090
|
+
const g = e ? [] : Object.values(l).filter(
|
|
2091
|
+
({ parent_id: x, user: N }) => {
|
|
2092
|
+
var p;
|
|
2093
|
+
return (N == null ? void 0 : N.id) !== ((p = o.user) == null ? void 0 : p.id) && !x;
|
|
2079
2094
|
}
|
|
2080
|
-
),
|
|
2081
|
-
({ parent_id: x, user:
|
|
2082
|
-
var
|
|
2083
|
-
return (
|
|
2095
|
+
), _ = e ? Object.values(l).filter(
|
|
2096
|
+
({ parent_id: x, user: N }) => {
|
|
2097
|
+
var p;
|
|
2098
|
+
return (N == null ? void 0 : N.id) !== ((p = o.user) == null ? void 0 : p.id) && x === (a == null ? void 0 : a.id);
|
|
2084
2099
|
}
|
|
2085
|
-
) : [],
|
|
2086
|
-
if (!
|
|
2100
|
+
) : [], m = e ? _ : g;
|
|
2101
|
+
if (!m.length)
|
|
2087
2102
|
return null;
|
|
2088
|
-
const
|
|
2089
|
-
return /* @__PURE__ */
|
|
2090
|
-
|
|
2103
|
+
const h = (w = m[0]) == null ? void 0 : w.user, r = h != null && h.id && s.state.members[h.id] ? s.state.members[h.id].user : void 0;
|
|
2104
|
+
return /* @__PURE__ */ t(
|
|
2105
|
+
xt,
|
|
2091
2106
|
{
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
/* @__PURE__ */ t("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ t(
|
|
2097
|
-
ae,
|
|
2098
|
-
{
|
|
2099
|
-
id: h,
|
|
2100
|
-
name: p,
|
|
2101
|
-
image: r,
|
|
2102
|
-
size: 24,
|
|
2103
|
-
shape: "circle"
|
|
2104
|
-
}
|
|
2105
|
-
) }),
|
|
2106
|
-
/* @__PURE__ */ t("div", { className: "px-4 py-3 rounded-lg bg-[#E9EAED] h-12 flex flex-col justify-end", children: /* @__PURE__ */ d(
|
|
2107
|
-
"svg",
|
|
2108
|
-
{
|
|
2109
|
-
"aria-hidden": "true",
|
|
2110
|
-
className: "block overflow-visible mb-[0.2rem]",
|
|
2111
|
-
viewBox: "0 0 32 8",
|
|
2112
|
-
width: "32",
|
|
2113
|
-
height: "8",
|
|
2114
|
-
overflow: "visible",
|
|
2115
|
-
children: [
|
|
2116
|
-
/* @__PURE__ */ t(ke, { cx: "4", index: 0 }),
|
|
2117
|
-
/* @__PURE__ */ t(ke, { cx: "16", index: 1 }),
|
|
2118
|
-
/* @__PURE__ */ t(ke, { cx: "28", index: 2 })
|
|
2119
|
-
]
|
|
2120
|
-
}
|
|
2121
|
-
) })
|
|
2122
|
-
]
|
|
2107
|
+
avatarId: (h == null ? void 0 : h.id) ?? (r == null ? void 0 : r.id) ?? "typing-user",
|
|
2108
|
+
avatarName: (h == null ? void 0 : h.name) ?? (r == null ? void 0 : r.name) ?? (h == null ? void 0 : h.id) ?? "Typing user",
|
|
2109
|
+
avatarImage: (h == null ? void 0 : h.image) ?? (r == null ? void 0 : r.image),
|
|
2110
|
+
testId: "typing-indicator"
|
|
2123
2111
|
}
|
|
2124
2112
|
);
|
|
2125
|
-
},
|
|
2113
|
+
}, xt = ({
|
|
2114
|
+
avatarId: e,
|
|
2115
|
+
avatarName: s,
|
|
2116
|
+
avatarImage: n,
|
|
2117
|
+
testId: a
|
|
2118
|
+
}) => /* @__PURE__ */ d(
|
|
2119
|
+
"div",
|
|
2120
|
+
{
|
|
2121
|
+
className: "str-chat__typing-indicator !items-end !bg-transparent",
|
|
2122
|
+
"data-testid": a,
|
|
2123
|
+
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
2124
|
+
children: [
|
|
2125
|
+
/* @__PURE__ */ t("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ t(
|
|
2126
|
+
ae,
|
|
2127
|
+
{
|
|
2128
|
+
id: e,
|
|
2129
|
+
name: s,
|
|
2130
|
+
image: n ?? void 0,
|
|
2131
|
+
size: 24,
|
|
2132
|
+
shape: "circle"
|
|
2133
|
+
}
|
|
2134
|
+
) }),
|
|
2135
|
+
/* @__PURE__ */ t("div", { className: "px-4 py-3 rounded-lg bg-[#E9EAED] h-12 flex flex-col justify-end", children: /* @__PURE__ */ d(
|
|
2136
|
+
"svg",
|
|
2137
|
+
{
|
|
2138
|
+
"aria-hidden": "true",
|
|
2139
|
+
className: "block overflow-visible mb-[0.2rem]",
|
|
2140
|
+
viewBox: "0 0 32 8",
|
|
2141
|
+
width: "32",
|
|
2142
|
+
height: "8",
|
|
2143
|
+
overflow: "visible",
|
|
2144
|
+
children: [
|
|
2145
|
+
/* @__PURE__ */ t(Me, { cx: "4", index: 0 }),
|
|
2146
|
+
/* @__PURE__ */ t(Me, { cx: "16", index: 1 }),
|
|
2147
|
+
/* @__PURE__ */ t(Me, { cx: "28", index: 2 })
|
|
2148
|
+
]
|
|
2149
|
+
}
|
|
2150
|
+
) })
|
|
2151
|
+
]
|
|
2152
|
+
}
|
|
2153
|
+
);
|
|
2154
|
+
function ua(e, s) {
|
|
2155
|
+
var a;
|
|
2156
|
+
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2157
|
+
for (const o of Object.values(n)) {
|
|
2158
|
+
const l = o == null ? void 0 : o.user;
|
|
2159
|
+
if (l && l.id !== s)
|
|
2160
|
+
return l;
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
const ma = () => null, ha = ({ className: e, message: s }) => /* @__PURE__ */ d(
|
|
2126
2164
|
"div",
|
|
2127
2165
|
{
|
|
2128
2166
|
className: D("flex items-center justify-center h-full", e),
|
|
@@ -2165,12 +2203,12 @@ const Fn = ({
|
|
|
2165
2203
|
s && /* @__PURE__ */ t("span", { className: "text-stone", children: s })
|
|
2166
2204
|
]
|
|
2167
2205
|
}
|
|
2168
|
-
), ye =
|
|
2169
|
-
/* @__PURE__ */ t(
|
|
2206
|
+
), ye = L.memo(() => /* @__PURE__ */ t("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
|
|
2207
|
+
/* @__PURE__ */ t(ha, { className: "w-6 h-6" }),
|
|
2170
2208
|
/* @__PURE__ */ t("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2171
2209
|
] }) }));
|
|
2172
2210
|
ye.displayName = "LoadingState";
|
|
2173
|
-
const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
2211
|
+
const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", vt = "Replies instantly with AI assistant", fa = ({
|
|
2174
2212
|
onBack: e,
|
|
2175
2213
|
showBackButton: s,
|
|
2176
2214
|
onShowInfo: n,
|
|
@@ -2178,15 +2216,15 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2178
2216
|
showStarButton: o = !1,
|
|
2179
2217
|
dmAgentEnabled: l = !1
|
|
2180
2218
|
}) => {
|
|
2181
|
-
var
|
|
2182
|
-
const { channel: i } = oe(), c =
|
|
2183
|
-
(
|
|
2184
|
-
var
|
|
2185
|
-
return ((
|
|
2219
|
+
var h, r, b, w, x;
|
|
2220
|
+
const { channel: i } = oe(), c = L.useMemo(() => Object.values(i.state.members || {}).find(
|
|
2221
|
+
(p) => {
|
|
2222
|
+
var I;
|
|
2223
|
+
return ((I = p.user) == null ? void 0 : I.id) && p.user.id !== i._client.userID;
|
|
2186
2224
|
}
|
|
2187
|
-
), [i._client.userID, i.state.members]), f = ((
|
|
2225
|
+
), [i._client.userID, i.state.members]), f = ((h = c == null ? void 0 : c.user) == null ? void 0 : h.name) || ((r = c == null ? void 0 : c.user) == null ? void 0 : r.id) || "Unknown member", g = (b = c == null ? void 0 : c.user) == null ? void 0 : b.image, _ = It(i), m = async () => {
|
|
2188
2226
|
try {
|
|
2189
|
-
|
|
2227
|
+
_ ? await i.unpin() : await i.pin();
|
|
2190
2228
|
} catch (N) {
|
|
2191
2229
|
console.error(
|
|
2192
2230
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -2204,17 +2242,17 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2204
2242
|
}),
|
|
2205
2243
|
type: "button",
|
|
2206
2244
|
"aria-label": "Back to conversations",
|
|
2207
|
-
children: /* @__PURE__ */ t(
|
|
2245
|
+
children: /* @__PURE__ */ t(dt, { className: "size-5 text-black/90" })
|
|
2208
2246
|
}
|
|
2209
2247
|
) }),
|
|
2210
2248
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2211
2249
|
/* @__PURE__ */ t(
|
|
2212
2250
|
ae,
|
|
2213
2251
|
{
|
|
2214
|
-
id: ((
|
|
2252
|
+
id: ((w = c == null ? void 0 : c.user) == null ? void 0 : w.id) || i.id || "unknown",
|
|
2215
2253
|
name: f,
|
|
2216
|
-
image:
|
|
2217
|
-
starred: o &&
|
|
2254
|
+
image: g,
|
|
2255
|
+
starred: o && _,
|
|
2218
2256
|
dmAgentEnabled: l,
|
|
2219
2257
|
size: 40
|
|
2220
2258
|
}
|
|
@@ -2228,13 +2266,13 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2228
2266
|
"aria-label": `View info for ${f}`,
|
|
2229
2267
|
children: [
|
|
2230
2268
|
f,
|
|
2231
|
-
/* @__PURE__ */ t(
|
|
2269
|
+
/* @__PURE__ */ t(ut, { className: "size-3 shrink-0" })
|
|
2232
2270
|
]
|
|
2233
2271
|
}
|
|
2234
2272
|
),
|
|
2235
2273
|
l && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2236
|
-
/* @__PURE__ */ t(
|
|
2237
|
-
/* @__PURE__ */ t("span", { children:
|
|
2274
|
+
/* @__PURE__ */ t(Re, { className: "size-3 shrink-0 text-black/55" }),
|
|
2275
|
+
/* @__PURE__ */ t("span", { children: vt })
|
|
2238
2276
|
] })
|
|
2239
2277
|
] }),
|
|
2240
2278
|
/* @__PURE__ */ d("div", { className: "flex justify-end items-center gap-2", children: [
|
|
@@ -2242,17 +2280,17 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2242
2280
|
"button",
|
|
2243
2281
|
{
|
|
2244
2282
|
className: ce,
|
|
2245
|
-
onClick:
|
|
2283
|
+
onClick: m,
|
|
2246
2284
|
type: "button",
|
|
2247
|
-
"aria-label":
|
|
2285
|
+
"aria-label": _ ? "Unstar conversation" : "Star conversation",
|
|
2248
2286
|
children: /* @__PURE__ */ t(
|
|
2249
|
-
|
|
2287
|
+
De,
|
|
2250
2288
|
{
|
|
2251
2289
|
className: D("size-5", {
|
|
2252
|
-
"text-yellow-600":
|
|
2253
|
-
"text-black/90": !
|
|
2290
|
+
"text-yellow-600": _,
|
|
2291
|
+
"text-black/90": !_
|
|
2254
2292
|
}),
|
|
2255
|
-
weight:
|
|
2293
|
+
weight: _ ? "duotone" : "regular"
|
|
2256
2294
|
}
|
|
2257
2295
|
)
|
|
2258
2296
|
}
|
|
@@ -2264,7 +2302,7 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2264
2302
|
onClick: n,
|
|
2265
2303
|
type: "button",
|
|
2266
2304
|
"aria-label": "Show info",
|
|
2267
|
-
children: /* @__PURE__ */ t(
|
|
2305
|
+
children: /* @__PURE__ */ t(mt, { className: "size-5 text-black/90" })
|
|
2268
2306
|
}
|
|
2269
2307
|
)
|
|
2270
2308
|
] })
|
|
@@ -2278,16 +2316,16 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2278
2316
|
onClick: e,
|
|
2279
2317
|
className: ce,
|
|
2280
2318
|
"aria-label": "Back to conversations",
|
|
2281
|
-
children: /* @__PURE__ */ t(
|
|
2319
|
+
children: /* @__PURE__ */ t(dt, { className: "size-5 text-black/90" })
|
|
2282
2320
|
}
|
|
2283
2321
|
),
|
|
2284
2322
|
/* @__PURE__ */ t(
|
|
2285
2323
|
ae,
|
|
2286
2324
|
{
|
|
2287
|
-
id: ((
|
|
2325
|
+
id: ((x = c == null ? void 0 : c.user) == null ? void 0 : x.id) || i.id || "unknown",
|
|
2288
2326
|
name: f,
|
|
2289
|
-
image:
|
|
2290
|
-
starred: o &&
|
|
2327
|
+
image: g,
|
|
2328
|
+
starred: o && _,
|
|
2291
2329
|
dmAgentEnabled: l,
|
|
2292
2330
|
size: 40
|
|
2293
2331
|
}
|
|
@@ -2302,13 +2340,13 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2302
2340
|
"aria-label": `View info for ${f}`,
|
|
2303
2341
|
children: [
|
|
2304
2342
|
/* @__PURE__ */ t("span", { className: "truncate", children: f }),
|
|
2305
|
-
/* @__PURE__ */ t(
|
|
2343
|
+
/* @__PURE__ */ t(ut, { className: "size-4 shrink-0" })
|
|
2306
2344
|
]
|
|
2307
2345
|
}
|
|
2308
2346
|
) : /* @__PURE__ */ t("h1", { className: "font-medium text-black/90 truncate", children: f }),
|
|
2309
2347
|
l && /* @__PURE__ */ d("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2310
|
-
/* @__PURE__ */ t(
|
|
2311
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
2348
|
+
/* @__PURE__ */ t(Re, { className: "size-3 shrink-0 text-black/55" }),
|
|
2349
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: vt })
|
|
2312
2350
|
] })
|
|
2313
2351
|
] })
|
|
2314
2352
|
] }),
|
|
@@ -2317,17 +2355,17 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2317
2355
|
"button",
|
|
2318
2356
|
{
|
|
2319
2357
|
className: ce,
|
|
2320
|
-
onClick:
|
|
2358
|
+
onClick: m,
|
|
2321
2359
|
type: "button",
|
|
2322
|
-
"aria-label":
|
|
2360
|
+
"aria-label": _ ? "Unstar conversation" : "Star conversation",
|
|
2323
2361
|
children: /* @__PURE__ */ t(
|
|
2324
|
-
|
|
2362
|
+
De,
|
|
2325
2363
|
{
|
|
2326
2364
|
className: D("size-5", {
|
|
2327
|
-
"text-yellow-600":
|
|
2328
|
-
"text-black/90": !
|
|
2365
|
+
"text-yellow-600": _,
|
|
2366
|
+
"text-black/90": !_
|
|
2329
2367
|
}),
|
|
2330
|
-
weight:
|
|
2368
|
+
weight: _ ? "duotone" : "regular"
|
|
2331
2369
|
}
|
|
2332
2370
|
)
|
|
2333
2371
|
}
|
|
@@ -2339,13 +2377,13 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2339
2377
|
onClick: n,
|
|
2340
2378
|
type: "button",
|
|
2341
2379
|
"aria-label": "Show info",
|
|
2342
|
-
children: /* @__PURE__ */ t(
|
|
2380
|
+
children: /* @__PURE__ */ t(mt, { className: "size-5 text-black/90" })
|
|
2343
2381
|
}
|
|
2344
2382
|
)
|
|
2345
2383
|
] })
|
|
2346
2384
|
] })
|
|
2347
2385
|
] });
|
|
2348
|
-
},
|
|
2386
|
+
}, ga = ({
|
|
2349
2387
|
onBack: e,
|
|
2350
2388
|
showBackButton: s,
|
|
2351
2389
|
renderMessageInputActions: n,
|
|
@@ -2355,101 +2393,101 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2355
2393
|
showDeleteConversation: i = !0,
|
|
2356
2394
|
onDeleteConversationClick: c,
|
|
2357
2395
|
onBlockParticipantClick: f,
|
|
2358
|
-
onReportParticipantClick:
|
|
2359
|
-
showStarButton:
|
|
2360
|
-
chatbotVotingEnabled:
|
|
2361
|
-
renderChannelBanner:
|
|
2396
|
+
onReportParticipantClick: g,
|
|
2397
|
+
showStarButton: _ = !1,
|
|
2398
|
+
chatbotVotingEnabled: m = !1,
|
|
2399
|
+
renderChannelBanner: h,
|
|
2362
2400
|
customProfileContent: r,
|
|
2363
|
-
customChannelActions:
|
|
2364
|
-
renderMessage:
|
|
2365
|
-
dmAgentEnabled:
|
|
2401
|
+
customChannelActions: b,
|
|
2402
|
+
renderMessage: w,
|
|
2403
|
+
dmAgentEnabled: x = !1,
|
|
2366
2404
|
viewerLanguage: N
|
|
2367
2405
|
}) => {
|
|
2368
|
-
var
|
|
2369
|
-
const { channel:
|
|
2370
|
-
(
|
|
2406
|
+
var F, V;
|
|
2407
|
+
const { channel: p } = oe(), I = J(null), S = L.useMemo(() => Object.values(p.state.members || {}).find(
|
|
2408
|
+
(z) => {
|
|
2371
2409
|
var E;
|
|
2372
|
-
return ((E =
|
|
2410
|
+
return ((E = z.user) == null ? void 0 : E.id) && z.user.id !== p._client.userID;
|
|
2373
2411
|
}
|
|
2374
|
-
), [
|
|
2412
|
+
), [p._client.userID, p.state.members]), T = L.useMemo(() => Object.values(p.state.members || {}).find((z) => {
|
|
2375
2413
|
var E;
|
|
2376
|
-
return ((E =
|
|
2377
|
-
}), [
|
|
2378
|
-
const R =
|
|
2414
|
+
return ((E = z.user) == null ? void 0 : E.id) === p._client.userID;
|
|
2415
|
+
}), [p._client.userID, p.state.members]), U = ((F = T == null ? void 0 : T.user) == null ? void 0 : F.is_account) ?? (T == null ? void 0 : T.is_account), k = ((V = S == null ? void 0 : S.user) == null ? void 0 : V.is_account) ?? (S == null ? void 0 : S.is_account), M = x && U === !1 && k === !0, j = L.useMemo(() => {
|
|
2416
|
+
const R = p.data ?? {};
|
|
2379
2417
|
if (R.followerStatus)
|
|
2380
2418
|
return String(R.followerStatus);
|
|
2381
2419
|
if (R.isFollower !== void 0)
|
|
2382
2420
|
return R.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2383
|
-
}, [
|
|
2421
|
+
}, [p.data]), y = G(() => {
|
|
2384
2422
|
var R;
|
|
2385
|
-
(R =
|
|
2386
|
-
}, []),
|
|
2423
|
+
(R = I.current) == null || R.showModal();
|
|
2424
|
+
}, []), A = G(() => {
|
|
2387
2425
|
var R;
|
|
2388
|
-
(R =
|
|
2426
|
+
(R = I.current) == null || R.close();
|
|
2389
2427
|
}, []), v = G(
|
|
2390
2428
|
(R) => {
|
|
2391
|
-
const { message:
|
|
2392
|
-
|
|
2429
|
+
const { message: z } = _t("ChannelView"), E = /* @__PURE__ */ t(
|
|
2430
|
+
qn,
|
|
2393
2431
|
{
|
|
2394
2432
|
...R,
|
|
2395
|
-
chatbotVotingEnabled:
|
|
2433
|
+
chatbotVotingEnabled: m,
|
|
2396
2434
|
viewerLanguage: N
|
|
2397
2435
|
}
|
|
2398
2436
|
);
|
|
2399
|
-
return !
|
|
2437
|
+
return !w || !z ? E : w(E, z);
|
|
2400
2438
|
},
|
|
2401
|
-
[
|
|
2439
|
+
[m, w, N]
|
|
2402
2440
|
);
|
|
2403
2441
|
return /* @__PURE__ */ d(de, { children: [
|
|
2404
|
-
/* @__PURE__ */ t(
|
|
2442
|
+
/* @__PURE__ */ t(Es, { overrides: { Message: v }, children: /* @__PURE__ */ d(Ss, { children: [
|
|
2405
2443
|
/* @__PURE__ */ t("div", { className: "p-4", children: /* @__PURE__ */ t(
|
|
2406
|
-
|
|
2444
|
+
fa,
|
|
2407
2445
|
{
|
|
2408
2446
|
onBack: e,
|
|
2409
2447
|
showBackButton: s,
|
|
2410
|
-
onShowInfo:
|
|
2411
|
-
canShowInfo: !!
|
|
2412
|
-
showStarButton:
|
|
2413
|
-
dmAgentEnabled:
|
|
2448
|
+
onShowInfo: y,
|
|
2449
|
+
canShowInfo: !!S,
|
|
2450
|
+
showStarButton: _,
|
|
2451
|
+
dmAgentEnabled: M
|
|
2414
2452
|
}
|
|
2415
2453
|
) }),
|
|
2416
|
-
|
|
2454
|
+
h == null ? void 0 : h(),
|
|
2417
2455
|
/* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ t(
|
|
2418
|
-
|
|
2456
|
+
Is,
|
|
2419
2457
|
{
|
|
2420
2458
|
hideDeletedMessages: !0,
|
|
2421
2459
|
hideNewMessageSeparator: !1,
|
|
2422
2460
|
messageActions: void 0
|
|
2423
2461
|
}
|
|
2424
2462
|
) }),
|
|
2425
|
-
a == null ? void 0 : a(
|
|
2463
|
+
a == null ? void 0 : a(p),
|
|
2426
2464
|
/* @__PURE__ */ t(
|
|
2427
|
-
|
|
2465
|
+
Qn,
|
|
2428
2466
|
{
|
|
2429
|
-
renderActions: () => n == null ? void 0 : n(
|
|
2467
|
+
renderActions: () => n == null ? void 0 : n(p)
|
|
2430
2468
|
}
|
|
2431
2469
|
)
|
|
2432
2470
|
] }) }),
|
|
2433
2471
|
/* @__PURE__ */ t(
|
|
2434
|
-
|
|
2472
|
+
hn,
|
|
2435
2473
|
{
|
|
2436
|
-
dialogRef:
|
|
2437
|
-
onClose:
|
|
2438
|
-
participant:
|
|
2439
|
-
channel:
|
|
2474
|
+
dialogRef: I,
|
|
2475
|
+
onClose: A,
|
|
2476
|
+
participant: S,
|
|
2477
|
+
channel: p,
|
|
2440
2478
|
followerStatusLabel: j,
|
|
2441
2479
|
onLeaveConversation: o,
|
|
2442
2480
|
onBlockParticipant: l,
|
|
2443
2481
|
showDeleteConversation: i,
|
|
2444
2482
|
onDeleteConversationClick: c,
|
|
2445
2483
|
onBlockParticipantClick: f,
|
|
2446
|
-
onReportParticipantClick:
|
|
2484
|
+
onReportParticipantClick: g,
|
|
2447
2485
|
customProfileContent: r,
|
|
2448
|
-
customChannelActions:
|
|
2486
|
+
customChannelActions: b
|
|
2449
2487
|
}
|
|
2450
2488
|
)
|
|
2451
2489
|
] });
|
|
2452
|
-
},
|
|
2490
|
+
}, jt = L.memo(
|
|
2453
2491
|
({
|
|
2454
2492
|
channel: e,
|
|
2455
2493
|
onBack: s,
|
|
@@ -2459,42 +2497,42 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2459
2497
|
onLeaveConversation: l,
|
|
2460
2498
|
onBlockParticipant: i,
|
|
2461
2499
|
className: c,
|
|
2462
|
-
CustomChannelEmptyState: f =
|
|
2463
|
-
showDeleteConversation:
|
|
2464
|
-
onDeleteConversationClick:
|
|
2465
|
-
onBlockParticipantClick:
|
|
2466
|
-
onReportParticipantClick:
|
|
2500
|
+
CustomChannelEmptyState: f = ma,
|
|
2501
|
+
showDeleteConversation: g = !0,
|
|
2502
|
+
onDeleteConversationClick: _,
|
|
2503
|
+
onBlockParticipantClick: m,
|
|
2504
|
+
onReportParticipantClick: h,
|
|
2467
2505
|
dmAgentEnabled: r,
|
|
2468
|
-
messageMetadata:
|
|
2469
|
-
onMessageSent:
|
|
2470
|
-
showStarButton:
|
|
2506
|
+
messageMetadata: b,
|
|
2507
|
+
onMessageSent: w,
|
|
2508
|
+
showStarButton: x = !1,
|
|
2471
2509
|
chatbotVotingEnabled: N = !1,
|
|
2472
|
-
renderChannelBanner:
|
|
2473
|
-
customProfileContent:
|
|
2474
|
-
customChannelActions:
|
|
2475
|
-
renderMessage:
|
|
2476
|
-
sendButton:
|
|
2510
|
+
renderChannelBanner: p,
|
|
2511
|
+
customProfileContent: I,
|
|
2512
|
+
customChannelActions: S,
|
|
2513
|
+
renderMessage: T,
|
|
2514
|
+
sendButton: U,
|
|
2477
2515
|
viewerLanguage: k
|
|
2478
2516
|
}) => {
|
|
2479
|
-
const
|
|
2480
|
-
async (j,
|
|
2517
|
+
const M = G(
|
|
2518
|
+
async (j, y, A) => {
|
|
2481
2519
|
var E;
|
|
2482
|
-
const v = ((E = e.data) == null ? void 0 : E.chatbot_paused) === !0,
|
|
2483
|
-
...
|
|
2484
|
-
...
|
|
2485
|
-
...
|
|
2520
|
+
const v = ((E = e.data) == null ? void 0 : E.chatbot_paused) === !0, F = r && !v, V = {
|
|
2521
|
+
...y,
|
|
2522
|
+
...F && { silent: !0 },
|
|
2523
|
+
...b && {
|
|
2486
2524
|
metadata: {
|
|
2487
|
-
...
|
|
2488
|
-
...
|
|
2525
|
+
...y.metadata ?? {},
|
|
2526
|
+
...b
|
|
2489
2527
|
}
|
|
2490
2528
|
}
|
|
2491
2529
|
}, R = {
|
|
2492
|
-
...
|
|
2493
|
-
...
|
|
2494
|
-
},
|
|
2495
|
-
return
|
|
2530
|
+
...A,
|
|
2531
|
+
...F && { skip_push: !0 }
|
|
2532
|
+
}, z = await e.sendMessage(V, R);
|
|
2533
|
+
return w == null || w(z), z;
|
|
2496
2534
|
},
|
|
2497
|
-
[e, r,
|
|
2535
|
+
[e, r, b, w]
|
|
2498
2536
|
);
|
|
2499
2537
|
return /* @__PURE__ */ t(
|
|
2500
2538
|
"div",
|
|
@@ -2503,19 +2541,19 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2503
2541
|
"messaging-channel-view h-full flex flex-col",
|
|
2504
2542
|
c
|
|
2505
2543
|
),
|
|
2506
|
-
children: /* @__PURE__ */ t(
|
|
2507
|
-
|
|
2544
|
+
children: /* @__PURE__ */ t(Ut.Provider, { value: r ?? !1, children: /* @__PURE__ */ t(
|
|
2545
|
+
Cs,
|
|
2508
2546
|
{
|
|
2509
2547
|
channel: e,
|
|
2510
|
-
MessageSystem:
|
|
2548
|
+
MessageSystem: la,
|
|
2511
2549
|
EmptyStateIndicator: f,
|
|
2512
2550
|
LoadingIndicator: ye,
|
|
2513
|
-
DateSeparator:
|
|
2514
|
-
TypingIndicator:
|
|
2515
|
-
doSendMessageRequest:
|
|
2516
|
-
|
|
2551
|
+
DateSeparator: fn,
|
|
2552
|
+
TypingIndicator: da,
|
|
2553
|
+
doSendMessageRequest: M,
|
|
2554
|
+
...U ? { SendButton: U } : {},
|
|
2517
2555
|
children: /* @__PURE__ */ t(
|
|
2518
|
-
|
|
2556
|
+
ga,
|
|
2519
2557
|
{
|
|
2520
2558
|
onBack: s,
|
|
2521
2559
|
showBackButton: n,
|
|
@@ -2524,28 +2562,28 @@ const ce = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2524
2562
|
onLeaveConversation: l,
|
|
2525
2563
|
onBlockParticipant: i,
|
|
2526
2564
|
CustomChannelEmptyState: f,
|
|
2527
|
-
showDeleteConversation:
|
|
2528
|
-
onDeleteConversationClick:
|
|
2529
|
-
onBlockParticipantClick:
|
|
2530
|
-
onReportParticipantClick:
|
|
2531
|
-
showStarButton:
|
|
2565
|
+
showDeleteConversation: g,
|
|
2566
|
+
onDeleteConversationClick: _,
|
|
2567
|
+
onBlockParticipantClick: m,
|
|
2568
|
+
onReportParticipantClick: h,
|
|
2569
|
+
showStarButton: x,
|
|
2532
2570
|
dmAgentEnabled: r,
|
|
2533
2571
|
chatbotVotingEnabled: N,
|
|
2534
|
-
renderChannelBanner:
|
|
2535
|
-
customProfileContent:
|
|
2536
|
-
customChannelActions:
|
|
2537
|
-
renderMessage:
|
|
2572
|
+
renderChannelBanner: p,
|
|
2573
|
+
customProfileContent: I,
|
|
2574
|
+
customChannelActions: S,
|
|
2575
|
+
renderMessage: T,
|
|
2538
2576
|
viewerLanguage: k
|
|
2539
2577
|
}
|
|
2540
2578
|
)
|
|
2541
2579
|
}
|
|
2542
|
-
)
|
|
2580
|
+
) })
|
|
2543
2581
|
}
|
|
2544
2582
|
);
|
|
2545
2583
|
}
|
|
2546
2584
|
);
|
|
2547
|
-
|
|
2548
|
-
const
|
|
2585
|
+
jt.displayName = "ChannelView";
|
|
2586
|
+
const ba = ({ className: e }) => /* @__PURE__ */ d(
|
|
2549
2587
|
"svg",
|
|
2550
2588
|
{
|
|
2551
2589
|
width: "140",
|
|
@@ -2679,17 +2717,17 @@ const ra = ({ className: e }) => /* @__PURE__ */ d(
|
|
|
2679
2717
|
] })
|
|
2680
2718
|
]
|
|
2681
2719
|
}
|
|
2682
|
-
),
|
|
2720
|
+
), Gt = L.memo(
|
|
2683
2721
|
({ hasChannels: e, channelsLoaded: s }) => /* @__PURE__ */ t("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2684
|
-
/* @__PURE__ */ t(
|
|
2722
|
+
/* @__PURE__ */ t(ba, {}),
|
|
2685
2723
|
s && !e && /* @__PURE__ */ d("div", { className: "mt-8", children: [
|
|
2686
2724
|
/* @__PURE__ */ t("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2687
2725
|
/* @__PURE__ */ t("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2688
2726
|
] })
|
|
2689
2727
|
] }) })
|
|
2690
2728
|
);
|
|
2691
|
-
|
|
2692
|
-
const
|
|
2729
|
+
Gt.displayName = "EmptyState";
|
|
2730
|
+
const ve = L.memo(({ message: e, onBack: s }) => /* @__PURE__ */ t("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
|
|
2693
2731
|
/* @__PURE__ */ t("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ t("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2694
2732
|
/* @__PURE__ */ t("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2695
2733
|
/* @__PURE__ */ t("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2703,8 +2741,8 @@ const xe = B.memo(({ message: e, onBack: s }) => /* @__PURE__ */ t("div", { clas
|
|
|
2703
2741
|
}
|
|
2704
2742
|
)
|
|
2705
2743
|
] }) }));
|
|
2706
|
-
|
|
2707
|
-
const
|
|
2744
|
+
ve.displayName = "ErrorState";
|
|
2745
|
+
const Aa = ({
|
|
2708
2746
|
capabilities: e = {},
|
|
2709
2747
|
className: s,
|
|
2710
2748
|
renderMessageInputActions: n,
|
|
@@ -2714,73 +2752,73 @@ const pa = ({
|
|
|
2714
2752
|
initialParticipantData: i,
|
|
2715
2753
|
CustomChannelEmptyState: c,
|
|
2716
2754
|
showChannelList: f = !0,
|
|
2717
|
-
filters:
|
|
2718
|
-
channelRenderFilterFn:
|
|
2719
|
-
channelListCustomEmptyStateIndicator:
|
|
2720
|
-
onDeleteConversationClick:
|
|
2755
|
+
filters: g,
|
|
2756
|
+
channelRenderFilterFn: _,
|
|
2757
|
+
channelListCustomEmptyStateIndicator: m,
|
|
2758
|
+
onDeleteConversationClick: h,
|
|
2721
2759
|
onBlockParticipantClick: r,
|
|
2722
|
-
onReportParticipantClick:
|
|
2723
|
-
dmAgentEnabled:
|
|
2724
|
-
messageMetadata:
|
|
2760
|
+
onReportParticipantClick: b,
|
|
2761
|
+
dmAgentEnabled: w,
|
|
2762
|
+
messageMetadata: x,
|
|
2725
2763
|
onMessageSent: N,
|
|
2726
|
-
showStarButton:
|
|
2727
|
-
chatbotVotingEnabled:
|
|
2728
|
-
viewerLanguage:
|
|
2729
|
-
renderMessagePreview:
|
|
2730
|
-
renderChannelBanner:
|
|
2764
|
+
showStarButton: p = !1,
|
|
2765
|
+
chatbotVotingEnabled: I = !1,
|
|
2766
|
+
viewerLanguage: S,
|
|
2767
|
+
renderMessagePreview: T,
|
|
2768
|
+
renderChannelBanner: U,
|
|
2731
2769
|
customProfileContent: k,
|
|
2732
|
-
customChannelActions:
|
|
2770
|
+
customChannelActions: M,
|
|
2733
2771
|
renderMessage: j,
|
|
2734
|
-
sendButton:
|
|
2772
|
+
sendButton: y
|
|
2735
2773
|
}) => {
|
|
2736
2774
|
const {
|
|
2737
|
-
service:
|
|
2775
|
+
service: A,
|
|
2738
2776
|
client: v,
|
|
2739
|
-
isConnected:
|
|
2777
|
+
isConnected: F,
|
|
2740
2778
|
isLoading: V,
|
|
2741
2779
|
error: R,
|
|
2742
|
-
refreshConnection:
|
|
2780
|
+
refreshConnection: z,
|
|
2743
2781
|
debug: E
|
|
2744
|
-
} =
|
|
2745
|
-
const
|
|
2782
|
+
} = Xs(), [H, Y] = P(null), [te, $] = P(!1), [u, C] = P(!1), [B, K] = P(!1), [W, Q] = P(null), { showDeleteConversation: he = !0 } = e, fe = L.useMemo(() => {
|
|
2783
|
+
const O = v == null ? void 0 : v.userID;
|
|
2746
2784
|
return {
|
|
2747
2785
|
...{
|
|
2748
2786
|
type: "messaging",
|
|
2749
2787
|
last_message_at: { $exists: !0 },
|
|
2750
|
-
...
|
|
2751
|
-
members: { $in: [
|
|
2788
|
+
...O && {
|
|
2789
|
+
members: { $in: [O] },
|
|
2752
2790
|
hidden: !1
|
|
2753
2791
|
}
|
|
2754
2792
|
},
|
|
2755
|
-
...
|
|
2793
|
+
...g
|
|
2756
2794
|
};
|
|
2757
|
-
}, [
|
|
2758
|
-
if (!v || !
|
|
2759
|
-
const
|
|
2760
|
-
if (
|
|
2795
|
+
}, [g, v == null ? void 0 : v.userID]), re = J(null), ee = G(async () => {
|
|
2796
|
+
if (!v || !F) return;
|
|
2797
|
+
const O = v.userID;
|
|
2798
|
+
if (O)
|
|
2761
2799
|
try {
|
|
2762
|
-
E && console.log("[MessagingShell] Syncing channels for user:",
|
|
2800
|
+
E && console.log("[MessagingShell] Syncing channels for user:", O);
|
|
2763
2801
|
const X = await v.queryChannels(
|
|
2764
2802
|
{
|
|
2765
2803
|
type: "messaging",
|
|
2766
|
-
members: { $in: [
|
|
2804
|
+
members: { $in: [O] }
|
|
2767
2805
|
},
|
|
2768
2806
|
{},
|
|
2769
2807
|
{ limit: 100 }
|
|
2770
2808
|
);
|
|
2771
|
-
|
|
2809
|
+
$(X.length > 0), C(!0), re.current = O, E && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2772
2810
|
channelCount: X.length
|
|
2773
2811
|
});
|
|
2774
2812
|
} catch (X) {
|
|
2775
2813
|
console.error("[MessagingShell] Failed to sync channels:", X);
|
|
2776
2814
|
}
|
|
2777
|
-
}, [v,
|
|
2815
|
+
}, [v, F, E]);
|
|
2778
2816
|
q(() => {
|
|
2779
|
-
if (!v || !
|
|
2780
|
-
const
|
|
2781
|
-
|
|
2782
|
-
}, [v,
|
|
2783
|
-
if (!l || !v || !
|
|
2817
|
+
if (!v || !F) return;
|
|
2818
|
+
const O = v.userID;
|
|
2819
|
+
O && re.current !== O && ee();
|
|
2820
|
+
}, [v, F, ee]), q(() => {
|
|
2821
|
+
if (!l || !v || !F) return;
|
|
2784
2822
|
(async () => {
|
|
2785
2823
|
const X = v.userID;
|
|
2786
2824
|
if (X)
|
|
@@ -2802,13 +2840,13 @@ const pa = ({
|
|
|
2802
2840
|
"[MessagingShell] Initial conversation loaded:",
|
|
2803
2841
|
Z[0].id
|
|
2804
2842
|
);
|
|
2805
|
-
else if (i &&
|
|
2843
|
+
else if (i && A) {
|
|
2806
2844
|
E && console.log(
|
|
2807
2845
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2808
2846
|
i
|
|
2809
2847
|
);
|
|
2810
2848
|
try {
|
|
2811
|
-
const ne = await
|
|
2849
|
+
const ne = await A.startChannelWithParticipant({
|
|
2812
2850
|
id: i.id,
|
|
2813
2851
|
name: i.name,
|
|
2814
2852
|
phone: i.phone
|
|
@@ -2841,36 +2879,36 @@ const pa = ({
|
|
|
2841
2879
|
l,
|
|
2842
2880
|
i,
|
|
2843
2881
|
v,
|
|
2882
|
+
F,
|
|
2844
2883
|
A,
|
|
2845
|
-
L,
|
|
2846
2884
|
E,
|
|
2847
2885
|
o
|
|
2848
2886
|
]);
|
|
2849
2887
|
const se = G(
|
|
2850
|
-
(
|
|
2851
|
-
Y(
|
|
2888
|
+
(O) => {
|
|
2889
|
+
Y(O), o == null || o(O);
|
|
2852
2890
|
},
|
|
2853
2891
|
[o]
|
|
2854
2892
|
), ie = G(() => {
|
|
2855
|
-
|
|
2856
|
-
}, [
|
|
2857
|
-
async (
|
|
2858
|
-
E && console.log("[MessagingShell] Leaving conversation:",
|
|
2893
|
+
B || Y(null);
|
|
2894
|
+
}, [B]), Ce = G(
|
|
2895
|
+
async (O) => {
|
|
2896
|
+
E && console.log("[MessagingShell] Leaving conversation:", O.id), Y(null), K(!1), re.current = null, await ee();
|
|
2859
2897
|
},
|
|
2860
2898
|
[ee, E]
|
|
2861
|
-
),
|
|
2862
|
-
async (
|
|
2863
|
-
E && console.log("[MessagingShell] Blocking participant:",
|
|
2899
|
+
), ge = G(
|
|
2900
|
+
async (O) => {
|
|
2901
|
+
E && console.log("[MessagingShell] Blocking participant:", O), Y(null), K(!1), re.current = null, await ee();
|
|
2864
2902
|
},
|
|
2865
2903
|
[ee, E]
|
|
2866
2904
|
), le = !!H;
|
|
2867
|
-
return V ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(ye, {}) }) : R ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(
|
|
2868
|
-
|
|
2905
|
+
return V ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(ye, {}) }) : R ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(ve, { message: R, onBack: z }) }) : !F || !v ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(
|
|
2906
|
+
ve,
|
|
2869
2907
|
{
|
|
2870
2908
|
message: "Not connected to messaging service",
|
|
2871
|
-
onBack:
|
|
2909
|
+
onBack: z
|
|
2872
2910
|
}
|
|
2873
|
-
) }) : W ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(
|
|
2911
|
+
) }) : W ? /* @__PURE__ */ t("div", { className: D("h-full", s), children: /* @__PURE__ */ t(ve, { message: W }) }) : /* @__PURE__ */ t(
|
|
2874
2912
|
"div",
|
|
2875
2913
|
{
|
|
2876
2914
|
className: D(
|
|
@@ -2884,23 +2922,23 @@ const pa = ({
|
|
|
2884
2922
|
className: D(
|
|
2885
2923
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2886
2924
|
{
|
|
2887
|
-
"!hidden": f === !1 ||
|
|
2925
|
+
"!hidden": f === !1 || B,
|
|
2888
2926
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2889
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !
|
|
2927
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !B && le,
|
|
2890
2928
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2891
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !
|
|
2929
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !B && !le
|
|
2892
2930
|
}
|
|
2893
2931
|
),
|
|
2894
2932
|
children: /* @__PURE__ */ t(
|
|
2895
|
-
|
|
2933
|
+
Dt,
|
|
2896
2934
|
{
|
|
2897
2935
|
onChannelSelect: se,
|
|
2898
2936
|
selectedChannel: H || void 0,
|
|
2899
|
-
filters:
|
|
2900
|
-
channelRenderFilterFn:
|
|
2901
|
-
customEmptyStateIndicator:
|
|
2902
|
-
renderMessagePreview:
|
|
2903
|
-
viewerLanguage:
|
|
2937
|
+
filters: fe,
|
|
2938
|
+
channelRenderFilterFn: _,
|
|
2939
|
+
customEmptyStateIndicator: m,
|
|
2940
|
+
renderMessagePreview: T,
|
|
2941
|
+
viewerLanguage: S
|
|
2904
2942
|
}
|
|
2905
2943
|
)
|
|
2906
2944
|
}
|
|
@@ -2912,47 +2950,47 @@ const pa = ({
|
|
|
2912
2950
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2913
2951
|
{
|
|
2914
2952
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2915
|
-
flex:
|
|
2953
|
+
flex: B || le || l,
|
|
2916
2954
|
// Normal mode: hide on mobile when no channel selected
|
|
2917
|
-
"hidden lg:flex": !
|
|
2955
|
+
"hidden lg:flex": !B && !le && !l
|
|
2918
2956
|
}
|
|
2919
2957
|
),
|
|
2920
2958
|
children: H ? /* @__PURE__ */ t("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ t(
|
|
2921
|
-
|
|
2959
|
+
jt,
|
|
2922
2960
|
{
|
|
2923
2961
|
channel: H,
|
|
2924
2962
|
onBack: ie,
|
|
2925
|
-
showBackButton: !
|
|
2963
|
+
showBackButton: !B,
|
|
2926
2964
|
renderMessageInputActions: n,
|
|
2927
2965
|
renderConversationFooter: a,
|
|
2928
|
-
renderChannelBanner:
|
|
2929
|
-
onLeaveConversation:
|
|
2930
|
-
onBlockParticipant:
|
|
2966
|
+
renderChannelBanner: U,
|
|
2967
|
+
onLeaveConversation: Ce,
|
|
2968
|
+
onBlockParticipant: ge,
|
|
2931
2969
|
CustomChannelEmptyState: c,
|
|
2932
|
-
showDeleteConversation:
|
|
2933
|
-
onDeleteConversationClick:
|
|
2970
|
+
showDeleteConversation: he,
|
|
2971
|
+
onDeleteConversationClick: h,
|
|
2934
2972
|
onBlockParticipantClick: r,
|
|
2935
|
-
onReportParticipantClick:
|
|
2936
|
-
dmAgentEnabled:
|
|
2937
|
-
messageMetadata:
|
|
2973
|
+
onReportParticipantClick: b,
|
|
2974
|
+
dmAgentEnabled: w,
|
|
2975
|
+
messageMetadata: x,
|
|
2938
2976
|
onMessageSent: N,
|
|
2939
|
-
showStarButton:
|
|
2940
|
-
chatbotVotingEnabled:
|
|
2941
|
-
viewerLanguage:
|
|
2977
|
+
showStarButton: p,
|
|
2978
|
+
chatbotVotingEnabled: I,
|
|
2979
|
+
viewerLanguage: S,
|
|
2942
2980
|
customProfileContent: k,
|
|
2943
|
-
customChannelActions:
|
|
2981
|
+
customChannelActions: M,
|
|
2944
2982
|
renderMessage: j,
|
|
2945
|
-
sendButton:
|
|
2983
|
+
sendButton: y
|
|
2946
2984
|
},
|
|
2947
2985
|
H.id
|
|
2948
2986
|
) }) : l ? (
|
|
2949
2987
|
// Show loading while creating/loading direct conversation channel
|
|
2950
2988
|
/* @__PURE__ */ t(ye, {})
|
|
2951
2989
|
) : /* @__PURE__ */ t(
|
|
2952
|
-
|
|
2990
|
+
Gt,
|
|
2953
2991
|
{
|
|
2954
2992
|
hasChannels: te,
|
|
2955
|
-
channelsLoaded:
|
|
2993
|
+
channelsLoaded: u
|
|
2956
2994
|
}
|
|
2957
2995
|
)
|
|
2958
2996
|
}
|
|
@@ -2960,7 +2998,17 @@ const pa = ({
|
|
|
2960
2998
|
] })
|
|
2961
2999
|
}
|
|
2962
3000
|
);
|
|
2963
|
-
},
|
|
3001
|
+
}, pa = L.lazy(
|
|
3002
|
+
() => import("./Card-D32U6KfZ.js")
|
|
3003
|
+
), xa = L.lazy(() => import("./Card-zGbhRBwv.js")), va = L.lazy(
|
|
3004
|
+
() => import("./Card-DlSSJPip.js")
|
|
3005
|
+
), Ve = () => /* @__PURE__ */ t(
|
|
3006
|
+
"div",
|
|
3007
|
+
{
|
|
3008
|
+
className: "h-[280px] w-[280px] 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)]",
|
|
3009
|
+
"aria-hidden": !0
|
|
3010
|
+
}
|
|
3011
|
+
), wa = (e) => /* @__PURE__ */ t(ue, { fallback: /* @__PURE__ */ t(Ve, {}), children: /* @__PURE__ */ t(pa, { ...e }) }), _a = (e) => /* @__PURE__ */ t(ue, { fallback: /* @__PURE__ */ t(Ve, {}), children: /* @__PURE__ */ t(xa, { ...e }) }), ya = (e) => /* @__PURE__ */ t(ue, { fallback: /* @__PURE__ */ t(Ve, {}), children: /* @__PURE__ */ t(va, { ...e }) }), Fa = { Composer: wa, Sent: _a, Received: ya }, Na = ({
|
|
2964
3012
|
question: e,
|
|
2965
3013
|
onClick: s,
|
|
2966
3014
|
loading: n = !1,
|
|
@@ -2982,7 +3030,7 @@ const pa = ({
|
|
|
2982
3030
|
),
|
|
2983
3031
|
children: e
|
|
2984
3032
|
}
|
|
2985
|
-
),
|
|
3033
|
+
), Oa = ({
|
|
2986
3034
|
faqs: e,
|
|
2987
3035
|
onFaqClick: s,
|
|
2988
3036
|
loadingFaqId: n,
|
|
@@ -2991,7 +3039,7 @@ const pa = ({
|
|
|
2991
3039
|
avatarImage: l,
|
|
2992
3040
|
avatarName: i
|
|
2993
3041
|
}) => {
|
|
2994
|
-
const c = e.filter((f) => f.enabled).sort((f,
|
|
3042
|
+
const c = e.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
|
|
2995
3043
|
return c.length === 0 ? null : /* @__PURE__ */ t("div", { className: o, children: /* @__PURE__ */ d("div", { className: "flex gap-3 items-end", children: [
|
|
2996
3044
|
(l || i) && /* @__PURE__ */ t("div", { className: "flex-none", children: /* @__PURE__ */ t(
|
|
2997
3045
|
ae,
|
|
@@ -3011,7 +3059,7 @@ const pa = ({
|
|
|
3011
3059
|
children: [
|
|
3012
3060
|
a && /* @__PURE__ */ t("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
3013
3061
|
c.map((f) => /* @__PURE__ */ t(
|
|
3014
|
-
|
|
3062
|
+
Na,
|
|
3015
3063
|
{
|
|
3016
3064
|
question: f.question,
|
|
3017
3065
|
onClick: () => s(f.id),
|
|
@@ -3025,29 +3073,31 @@ const pa = ({
|
|
|
3025
3073
|
] }) });
|
|
3026
3074
|
};
|
|
3027
3075
|
export {
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3076
|
+
At as A,
|
|
3077
|
+
ma as C,
|
|
3078
|
+
Oa as F,
|
|
3079
|
+
Fa as L,
|
|
3080
|
+
Ra as M,
|
|
3081
|
+
pe as a,
|
|
3082
|
+
ae as b,
|
|
3083
|
+
Dt as c,
|
|
3084
|
+
jt as d,
|
|
3085
|
+
La as e,
|
|
3086
|
+
Na as f,
|
|
3087
|
+
Ne as g,
|
|
3088
|
+
gt as h,
|
|
3089
|
+
Vn as i,
|
|
3090
|
+
Da as j,
|
|
3091
|
+
Aa as k,
|
|
3092
|
+
en as l,
|
|
3093
|
+
kt as m,
|
|
3094
|
+
Pt as n,
|
|
3095
|
+
tn as o,
|
|
3096
|
+
je as p,
|
|
3097
|
+
Ge as q,
|
|
3098
|
+
_e as r,
|
|
3099
|
+
bn as s,
|
|
3100
|
+
Xs as t,
|
|
3101
|
+
Gn as u
|
|
3052
3102
|
};
|
|
3053
|
-
//# sourceMappingURL=index-
|
|
3103
|
+
//# sourceMappingURL=index-DfcRe-Hj.js.map
|