@mobilon-dev/chotto 0.3.72 → 0.3.73
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/chotto.css +1 -1
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +265 -248
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +298 -324
- package/dist/types/apps/data/messages.d.ts +296 -78
- package/dist/types/components/2_feed_elements/AudioMessage/stories/AudioMessage.stories.d.ts +8 -35
- package/dist/types/components/2_feed_elements/CallMessage/stories/CallMessage.stories.d.ts +7 -0
- package/dist/types/components/2_feed_elements/types/messages.d.ts +20 -21
- package/package.json +1 -1
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as Ue, ref as p, computed as l, watch as j, createElementBlock as m, openBlock as i, unref as r, normalizeStyle as ue, normalizeClass as C, createCommentVNode as c, createElementVNode as o, createVNode as k, withCtx as G, createTextVNode as Ve, toDisplayString as h, createBlock as O, withDirectives as Y, vShow as le, vModelText as Be, Transition as re, Fragment as He, nextTick as je } from "vue";
|
|
2
|
+
import Ge from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
|
+
import Ye from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
|
+
import Ze from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
5
5
|
import qe from "../BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
6
6
|
import ze from "../MessageReactions/MessageReactions.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useMessageActions as
|
|
11
|
-
import { useMessageLinks as
|
|
12
|
-
import { useChannelAccentColor as
|
|
13
|
-
import { useSubtextTooltip as
|
|
14
|
-
import { getStatus as
|
|
15
|
-
import { getMessageClass as
|
|
16
|
-
import { createReactionHandlers as
|
|
7
|
+
import We from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
|
|
8
|
+
import Je from "../MessageSmsInvite/MessageSmsInvite.vue.js";
|
|
9
|
+
import Ke from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
10
|
+
import { useMessageActions as Qe } from "../../../hooks/messages/useMessageActions.js";
|
|
11
|
+
import { useMessageLinks as Xe } from "../../../hooks/messages/useMessageLinks.js";
|
|
12
|
+
import { useChannelAccentColor as et } from "../../../hooks/messages/useChannelAccentColor.js";
|
|
13
|
+
import { useSubtextTooltip as tt } from "../../../hooks/messages/useSubtextTooltip.js";
|
|
14
|
+
import { getStatus as st, getStatusTitle as at } from "../../../functions/getStatusMessage.js";
|
|
15
|
+
import { getMessageClass as nt } from "../../../functions/getMessageClass.js";
|
|
16
|
+
import { createReactionHandlers as ot } from "../../../functions/createReactionHandlers.js";
|
|
17
17
|
import "../../../functions/parseMarkdown.js";
|
|
18
|
-
const
|
|
18
|
+
const it = ["messageId"], ut = ["src"], lt = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "audio-message__subtext"
|
|
21
|
-
},
|
|
21
|
+
}, rt = { class: "audio-message__audio-container" }, mt = ["src"], ct = { class: "audio-message__progress-wrapper" }, dt = ["max"], vt = { class: "audio-message__speed-btn-container" }, gt = { class: "audio-message__player-controls" }, ft = { class: "audio-message__current-time" }, pt = { class: "audio-message__duration" }, yt = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "audio-message__text-container"
|
|
24
|
-
},
|
|
24
|
+
}, ht = ["innerHTML"], bt = { class: "audio-message__info-container" }, Ct = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "audio-message__actions"
|
|
27
|
+
}, wt = { class: "audio-message__time" }, xt = {
|
|
25
28
|
key: 0,
|
|
26
29
|
class: "audio-message__expand-panel"
|
|
27
|
-
},
|
|
30
|
+
}, kt = { class: "audio-message__expand-inner" }, Tt = {
|
|
28
31
|
key: 0,
|
|
29
32
|
class: "audio-message__expand-placeholder"
|
|
30
|
-
},
|
|
33
|
+
}, Rt = ["innerHTML"], Mt = {
|
|
31
34
|
key: 1,
|
|
32
35
|
class: "audio-message__expand-plain"
|
|
33
36
|
}, St = {
|
|
34
37
|
key: 0,
|
|
35
38
|
class: "audio-message__expand-placeholder"
|
|
36
|
-
},
|
|
39
|
+
}, Nt = ["innerHTML"], _t = { class: "audio-message__expand-close-wrap" }, It = "RECOGNITION_READY", Et = "SUMMARY_READY", Jt = /* @__PURE__ */ Ue({
|
|
37
40
|
__name: "AudioMessage",
|
|
38
41
|
props: {
|
|
39
42
|
message: {
|
|
@@ -64,36 +67,8 @@ const nt = ["messageId"], ot = ["src"], it = {
|
|
|
64
67
|
}
|
|
65
68
|
},
|
|
66
69
|
emits: ["action", "reply", "sms-invite"],
|
|
67
|
-
setup(s, { emit:
|
|
68
|
-
|
|
69
|
-
if (e == null) return null;
|
|
70
|
-
if (typeof e == "object") return e;
|
|
71
|
-
if (typeof e != "string") return null;
|
|
72
|
-
const t = e.trim();
|
|
73
|
-
if (!t) return null;
|
|
74
|
-
try {
|
|
75
|
-
return JSON.parse(t);
|
|
76
|
-
} catch {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function H(e) {
|
|
81
|
-
var t;
|
|
82
|
-
if (e == null) return null;
|
|
83
|
-
if (typeof e == "object" && e !== null && "summary" in e)
|
|
84
|
-
return String(e.summary ?? "").trim() || null;
|
|
85
|
-
if (typeof e == "string") {
|
|
86
|
-
const a = e.trim();
|
|
87
|
-
if (!a) return null;
|
|
88
|
-
if (a.startsWith("{")) {
|
|
89
|
-
const m = Z(a);
|
|
90
|
-
return ((t = m == null ? void 0 : m.summary) == null ? void 0 : t.trim()) || null;
|
|
91
|
-
}
|
|
92
|
-
return a;
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
}
|
|
96
|
-
const i = s, _ = p([
|
|
70
|
+
setup(s, { emit: me }) {
|
|
71
|
+
const u = s, F = p([
|
|
97
72
|
{
|
|
98
73
|
text: "1.0x",
|
|
99
74
|
speed: 1
|
|
@@ -110,79 +85,116 @@ const nt = ["messageId"], ot = ["src"], it = {
|
|
|
110
85
|
text: "2.0x",
|
|
111
86
|
speed: 2
|
|
112
87
|
}
|
|
113
|
-
]),
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
var t,
|
|
117
|
-
const e =
|
|
118
|
-
return e.url || (typeof ((t = e.meta) == null ? void 0 : t.url) == "string" ? e.meta.url : void 0) || ((
|
|
119
|
-
}),
|
|
88
|
+
]), L = p(0), D = l(() => F.value[L.value] ?? F.value[0]), ce = () => {
|
|
89
|
+
L.value = (L.value + 1) % F.value.length, a.value && (a.value.playbackRate = D.value.speed);
|
|
90
|
+
}, T = me, a = p(null), w = p(void 0), d = p(!1), y = p(0), g = p(0), b = p(!1), P = l(() => {
|
|
91
|
+
var t, n;
|
|
92
|
+
const e = u.message;
|
|
93
|
+
return e.url || (typeof ((t = e.meta) == null ? void 0 : t.url) == "string" ? e.meta.url : void 0) || ((n = e.data) == null ? void 0 : n.url);
|
|
94
|
+
}), $ = (e) => {
|
|
120
95
|
if (e == null) return;
|
|
121
96
|
if (typeof e == "number")
|
|
122
97
|
return !Number.isFinite(e) || e < 0 ? void 0 : Math.floor(e);
|
|
123
98
|
const t = String(e).trim();
|
|
124
99
|
if (!t) return;
|
|
125
100
|
if (/^\d+$/.test(t)) {
|
|
126
|
-
const
|
|
127
|
-
return Number.isFinite(
|
|
101
|
+
const v = Number(t);
|
|
102
|
+
return Number.isFinite(v) && v >= 0 ? Math.floor(v) : void 0;
|
|
128
103
|
}
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
return
|
|
104
|
+
const n = t.match(/^(\d+):([0-5]\d):([0-5]\d)$/);
|
|
105
|
+
if (n) {
|
|
106
|
+
const v = Number(n[1]), B = Number(n[2]), H = Number(n[3]);
|
|
107
|
+
return v * 3600 + B * 60 + H;
|
|
133
108
|
}
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
},
|
|
137
|
-
d.value = !1,
|
|
109
|
+
const x = t.match(/^(\d+):([0-5]\d)$/);
|
|
110
|
+
if (x) return Number(x[1]) * 60 + Number(x[2]);
|
|
111
|
+
}, Z = () => {
|
|
112
|
+
d.value = !1, g.value = 0, y.value = $(u.message.duration) ?? 0, b.value = !1;
|
|
138
113
|
};
|
|
139
|
-
|
|
140
|
-
() =>
|
|
114
|
+
Z(), j(
|
|
115
|
+
() => P.value,
|
|
141
116
|
(e, t) => {
|
|
142
|
-
e !== t && (
|
|
117
|
+
e !== t && (Z(), w.value = void 0, a.value && (a.value.pause(), a.value.currentTime = 0, a.value.removeAttribute("src"), a.value.load()));
|
|
143
118
|
}
|
|
144
|
-
),
|
|
145
|
-
() =>
|
|
119
|
+
), j(
|
|
120
|
+
() => u.message.duration,
|
|
146
121
|
() => {
|
|
147
|
-
w.value === void 0 && (
|
|
122
|
+
w.value === void 0 && (y.value = $(u.message.duration) ?? 0);
|
|
148
123
|
}
|
|
149
124
|
);
|
|
150
125
|
const {
|
|
151
|
-
isOpenMenu:
|
|
152
|
-
buttonMenuVisible:
|
|
153
|
-
showMenu:
|
|
154
|
-
hideMenu:
|
|
126
|
+
isOpenMenu: U,
|
|
127
|
+
buttonMenuVisible: de,
|
|
128
|
+
showMenu: q,
|
|
129
|
+
hideMenu: V,
|
|
155
130
|
clickAction: ve,
|
|
156
|
-
viewsAction:
|
|
157
|
-
handleClickReplied:
|
|
158
|
-
} =
|
|
159
|
-
var
|
|
160
|
-
const e =
|
|
161
|
-
return t
|
|
162
|
-
}),
|
|
163
|
-
var
|
|
164
|
-
const e =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
131
|
+
viewsAction: z,
|
|
132
|
+
handleClickReplied: ge
|
|
133
|
+
} = Qe(u.message, T), f = p(null), M = p({ text: !1, summary: !1 }), S = l(() => {
|
|
134
|
+
var n;
|
|
135
|
+
const e = u.message, t = e.transcript ?? ((n = e.meta) == null ? void 0 : n.transcript);
|
|
136
|
+
return !t || typeof t != "object" ? null : t;
|
|
137
|
+
}), N = l(() => {
|
|
138
|
+
var n;
|
|
139
|
+
const e = u.message, t = e.summary ?? ((n = e.meta) == null ? void 0 : n.summary);
|
|
140
|
+
return !t || typeof t != "object" ? null : t;
|
|
141
|
+
}), W = l(() => {
|
|
142
|
+
var t;
|
|
143
|
+
const e = (t = S.value) == null ? void 0 : t.html;
|
|
144
|
+
return typeof e != "string" ? "" : e.trim();
|
|
145
|
+
}), J = l(() => {
|
|
146
|
+
var e;
|
|
147
|
+
return ((e = S.value) == null ? void 0 : e.status) === It && W.value.length > 0;
|
|
148
|
+
}), K = l(() => {
|
|
170
149
|
var t;
|
|
171
|
-
const e =
|
|
172
|
-
return
|
|
173
|
-
}), Q =
|
|
174
|
-
var
|
|
175
|
-
|
|
150
|
+
const e = (t = N.value) == null ? void 0 : t.html;
|
|
151
|
+
return typeof e != "string" ? "" : e.trim();
|
|
152
|
+
}), Q = l(() => {
|
|
153
|
+
var e;
|
|
154
|
+
return ((e = N.value) == null ? void 0 : e.status) === Et && K.value.length > 0;
|
|
155
|
+
}), _ = l(() => {
|
|
156
|
+
var e;
|
|
157
|
+
return !!((e = S.value) != null && e.status);
|
|
158
|
+
}), I = l(() => {
|
|
159
|
+
var e;
|
|
160
|
+
return !!((e = N.value) != null && e.status);
|
|
161
|
+
}), fe = l(() => f.value === "text" ? _.value : f.value === "summary" ? I.value : !1), pe = l(() => {
|
|
162
|
+
var e;
|
|
163
|
+
switch ((e = S.value) == null ? void 0 : e.status) {
|
|
164
|
+
case "RECOGNITION_PLANNED":
|
|
165
|
+
return "Распознаем сообщение, пожалуйста подождите...";
|
|
166
|
+
case "RECOGNITION_ERROR":
|
|
167
|
+
return "Не удалось распознать сообщение";
|
|
168
|
+
case "RECOGNITION_NOT_CONFIGURED":
|
|
169
|
+
return "Опция распознавания не включена";
|
|
170
|
+
default:
|
|
171
|
+
return "Текст сообщения недоступен";
|
|
172
|
+
}
|
|
173
|
+
}), ye = l(() => {
|
|
174
|
+
var e;
|
|
175
|
+
switch ((e = N.value) == null ? void 0 : e.status) {
|
|
176
|
+
case "SUMMARY_PLANNED":
|
|
177
|
+
return "Формируем резюме, пожалуйста подождите...";
|
|
178
|
+
case "SUMMARY_ERROR":
|
|
179
|
+
return "Не удалось сформировать резюме";
|
|
180
|
+
case "SUMMARY_NOT_CONFIGURED":
|
|
181
|
+
return "Опция формирования резюме не включена";
|
|
182
|
+
default:
|
|
183
|
+
return "Резюме недоступно";
|
|
184
|
+
}
|
|
185
|
+
}), he = async () => {
|
|
186
|
+
var t, n, x;
|
|
187
|
+
const e = P.value;
|
|
176
188
|
if (e)
|
|
177
189
|
try {
|
|
178
|
-
const
|
|
190
|
+
const v = await fetch(e, {
|
|
179
191
|
headers: {
|
|
180
192
|
Accept: "audio/*"
|
|
181
193
|
}
|
|
182
194
|
});
|
|
183
|
-
if (!
|
|
184
|
-
throw new Error(`HTTP error! status: ${
|
|
185
|
-
const B =
|
|
195
|
+
if (!v.ok)
|
|
196
|
+
throw new Error(`HTTP error! status: ${v.status}`);
|
|
197
|
+
const B = v.headers.get("content-type") || "", H = await v.blob(), E = ((n = (t = e.split(".").pop()) == null ? void 0 : t.split("?")[0]) == null ? void 0 : n.toLowerCase()) || "", Pe = {
|
|
186
198
|
"audio/mpeg": "mp3",
|
|
187
199
|
"audio/mp3": "mp3",
|
|
188
200
|
"audio/wav": "wav",
|
|
@@ -193,129 +205,131 @@ const nt = ["messageId"], ot = ["src"], it = {
|
|
|
193
205
|
"audio/flac": "flac",
|
|
194
206
|
"audio/m4a": "m4a",
|
|
195
207
|
"audio/x-m4a": "m4a",
|
|
196
|
-
"application/octet-stream":
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
} catch (
|
|
200
|
-
console.error("Ошибка при скачивании аудио:",
|
|
208
|
+
"application/octet-stream": E || "mp3"
|
|
209
|
+
}, ne = E && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes(E) ? E : Pe[B] || "mp3", oe = e.split("/"), A = decodeURIComponent(((x = oe[oe.length - 1]) == null ? void 0 : x.split("?")[0]) || ""), $e = A ? A.includes(".") ? A : `${A}.${ne}` : `audio-${u.message.messageId}.${ne}`, ie = window.URL.createObjectURL(H), R = document.createElement("a");
|
|
210
|
+
R.href = ie, R.download = $e, document.body.appendChild(R), R.click(), document.body.removeChild(R), window.URL.revokeObjectURL(ie);
|
|
211
|
+
} catch (v) {
|
|
212
|
+
console.error("Ошибка при скачивании аудио:", v), e && window.open(e, "_blank");
|
|
201
213
|
}
|
|
202
214
|
}, be = (e) => {
|
|
203
|
-
e.action === "download" ? (
|
|
204
|
-
}, { linkedHtml:
|
|
205
|
-
|
|
215
|
+
e.action === "download" ? (he(), V()) : ve(e);
|
|
216
|
+
}, { linkedHtml: Ce, inNewWindow: X } = Xe(() => u.message.text), we = l(() => st(u.message.status)), xe = l(() => at(u.message.status, u.message.statusMsg)), { bubbleStyle: ke } = et(
|
|
217
|
+
l(() => u.message),
|
|
206
218
|
{ cssVariable: "--chotto-audiomessage-right-background-color", position: "right" }
|
|
207
|
-
),
|
|
208
|
-
const e =
|
|
209
|
-
if (!(!
|
|
219
|
+
), ee = async () => {
|
|
220
|
+
const e = P.value;
|
|
221
|
+
if (!(!a.value || !e))
|
|
210
222
|
if (d.value)
|
|
211
|
-
|
|
223
|
+
a.value.pause(), d.value = !1;
|
|
212
224
|
else
|
|
213
225
|
try {
|
|
214
|
-
w.value || (w.value = e, await
|
|
226
|
+
w.value || (w.value = e, await je(), a.value.load()), await a.value.play(), d.value = !0;
|
|
215
227
|
} catch (t) {
|
|
216
228
|
console.error("Не удалось воспроизвести аудио", t), d.value = !1;
|
|
217
229
|
}
|
|
218
|
-
},
|
|
219
|
-
const t = Math.floor(e / 60),
|
|
220
|
-
return `${t.toString().padStart(2, "0")}:${
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
() =>
|
|
230
|
+
}, te = (e) => {
|
|
231
|
+
const t = Math.floor(e / 60), n = Math.floor(e % 60);
|
|
232
|
+
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
233
|
+
}, Te = l(() => te(g.value));
|
|
234
|
+
j(
|
|
235
|
+
() => g.value,
|
|
224
236
|
() => {
|
|
225
|
-
|
|
237
|
+
a.value && b.value && (a.value.duration != 1 / 0 && !Number.isNaN(a.value.duration) && (a.value.currentTime = g.value), Math.abs(g.value - y.value) < 0.1 && (d.value = !1));
|
|
226
238
|
}
|
|
227
239
|
);
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
if (!
|
|
232
|
-
const e =
|
|
233
|
-
if (
|
|
240
|
+
const se = () => {
|
|
241
|
+
a.value && b.value && a.value.duration != 1 / 0 && !Number.isNaN(a.value.duration) && (a.value.currentTime = g.value), b.value = !1;
|
|
242
|
+
}, Re = l(() => te(y.value)), Me = () => {
|
|
243
|
+
if (!a.value) return;
|
|
244
|
+
const e = a.value;
|
|
245
|
+
if (g.value = e.currentTime || 0, e.duration === 1 / 0 || Number.isNaN(e.duration)) {
|
|
234
246
|
e.currentTime = 1e101;
|
|
235
247
|
const t = () => {
|
|
236
|
-
|
|
248
|
+
a.value && (y.value = a.value.duration || 0, g.value = 0, a.value.currentTime = 0);
|
|
237
249
|
};
|
|
238
250
|
e.addEventListener("timeupdate", t, { once: !0 });
|
|
239
251
|
} else
|
|
240
|
-
|
|
241
|
-
e.playbackRate =
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
},
|
|
252
|
+
y.value = e.duration || 0;
|
|
253
|
+
e.playbackRate = D.value.speed;
|
|
254
|
+
}, Se = () => {
|
|
255
|
+
a.value && (b.value || (g.value = a.value.currentTime), a.value.ended && d.value && (d.value = !1));
|
|
256
|
+
}, Ne = () => {
|
|
245
257
|
d.value = !1;
|
|
246
|
-
},
|
|
247
|
-
console.error("Не удалось загрузить аудио"), d.value = !1, w.value = void 0,
|
|
258
|
+
}, _e = () => {
|
|
259
|
+
console.error("Не удалось загрузить аудио"), d.value = !1, w.value = void 0, a.value && (a.value.pause(), a.value.currentTime = 0, a.value.removeAttribute("src"), a.value.load()), y.value = $(u.message.duration) ?? 0;
|
|
248
260
|
};
|
|
249
|
-
function
|
|
250
|
-
return
|
|
261
|
+
function ae(e) {
|
|
262
|
+
return nt(e.position, "audio-message");
|
|
251
263
|
}
|
|
252
|
-
const { onToggleReaction:
|
|
253
|
-
function
|
|
254
|
-
|
|
264
|
+
const { onToggleReaction: Ie, onAddReaction: Ee, onRemoveReaction: Ae } = ot(T), Oe = tt(() => u.message, () => u.subtextTooltipData);
|
|
265
|
+
function Fe() {
|
|
266
|
+
T("sms-invite", u.message);
|
|
255
267
|
}
|
|
256
268
|
const Le = () => {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
269
|
+
if (!_.value) return;
|
|
270
|
+
const e = f.value === "text" ? null : "text";
|
|
271
|
+
f.value = e, e === "text" && !J.value && !M.value.text && (M.value.text = !0, T("action", { action: "fetchTranscript", messageId: u.message.messageId }));
|
|
272
|
+
}, De = () => {
|
|
273
|
+
if (!I.value) return;
|
|
274
|
+
const e = f.value === "summary" ? null : "summary";
|
|
275
|
+
f.value = e, e === "summary" && !Q.value && !M.value.summary && (M.value.summary = !0, T("action", { action: "fetchSummary", messageId: u.message.messageId }));
|
|
262
276
|
};
|
|
263
|
-
return (e, t) => (
|
|
277
|
+
return (e, t) => (i(), m("div", {
|
|
264
278
|
class: C(["audio-message", [
|
|
265
|
-
|
|
279
|
+
ae(s.message),
|
|
266
280
|
s.applyStyle(s.message)
|
|
267
281
|
]]),
|
|
268
282
|
messageId: s.message.messageId,
|
|
269
|
-
style:
|
|
283
|
+
style: ue(r(ke)),
|
|
270
284
|
onMouseleave: t[8] || (t[8] = //@ts-ignore
|
|
271
|
-
(...
|
|
285
|
+
(...n) => r(V) && r(V)(...n))
|
|
272
286
|
}, [
|
|
273
|
-
s.message.avatar && s.isFirstInSeries ? (
|
|
287
|
+
s.message.avatar && s.isFirstInSeries ? (i(), m("img", {
|
|
274
288
|
key: 0,
|
|
275
289
|
class: "audio-message__avatar",
|
|
276
290
|
src: s.message.avatar,
|
|
277
291
|
height: "32",
|
|
278
292
|
width: "32",
|
|
279
|
-
style:
|
|
280
|
-
}, null, 12,
|
|
281
|
-
s.message.subText && s.isFirstInSeries ? (
|
|
282
|
-
k(
|
|
283
|
-
text:
|
|
293
|
+
style: ue({ gridRow: s.message.subText ? "2" : "1" })
|
|
294
|
+
}, null, 12, ut)) : c("", !0),
|
|
295
|
+
s.message.subText && s.isFirstInSeries ? (i(), m("p", lt, [
|
|
296
|
+
k(Ke, {
|
|
297
|
+
text: r(Oe),
|
|
284
298
|
position: s.message.position === "left" ? "right" : "left",
|
|
285
299
|
offset: 8
|
|
286
300
|
}, {
|
|
287
|
-
default:
|
|
288
|
-
|
|
301
|
+
default: G(() => [
|
|
302
|
+
Ve(h(s.message.subText), 1)
|
|
289
303
|
]),
|
|
290
304
|
_: 1
|
|
291
305
|
}, 8, ["text", "position"])
|
|
292
|
-
])) :
|
|
306
|
+
])) : c("", !0),
|
|
293
307
|
o("div", {
|
|
294
308
|
class: C(["audio-message__content", { "is-first": s.isFirstInSeries, "with-avatar-indent": !s.isFirstInSeries && s.message.avatar }]),
|
|
295
309
|
onMouseenter: t[7] || (t[7] = //@ts-ignore
|
|
296
|
-
(...
|
|
310
|
+
(...n) => r(q) && r(q)(...n))
|
|
297
311
|
}, [
|
|
298
|
-
s.message.reply ? (
|
|
312
|
+
s.message.reply ? (i(), O(qe, {
|
|
299
313
|
key: 0,
|
|
300
314
|
style: { "grid-column": "1/3" },
|
|
301
315
|
message: s.message.reply,
|
|
302
316
|
class: C(s.message.position),
|
|
303
|
-
onReply:
|
|
304
|
-
}, null, 8, ["message", "class", "onReply"])) :
|
|
305
|
-
o("div",
|
|
317
|
+
onReply: r(ge)
|
|
318
|
+
}, null, 8, ["message", "class", "onReply"])) : c("", !0),
|
|
319
|
+
o("div", rt, [
|
|
306
320
|
o("audio", {
|
|
307
321
|
ref_key: "player",
|
|
308
|
-
ref:
|
|
322
|
+
ref: a,
|
|
309
323
|
src: w.value,
|
|
310
324
|
type: "audio/webm",
|
|
311
|
-
onLoadedmetadata:
|
|
312
|
-
onTimeupdate:
|
|
313
|
-
onEnded:
|
|
314
|
-
onError:
|
|
315
|
-
}, null, 40,
|
|
316
|
-
|
|
325
|
+
onLoadedmetadata: Me,
|
|
326
|
+
onTimeupdate: Se,
|
|
327
|
+
onEnded: Ne,
|
|
328
|
+
onError: _e
|
|
329
|
+
}, null, 40, mt),
|
|
330
|
+
Y(o("button", {
|
|
317
331
|
class: "audio-message__play",
|
|
318
|
-
onClick:
|
|
332
|
+
onClick: ee
|
|
319
333
|
}, [...t[9] || (t[9] = [
|
|
320
334
|
o("div", { class: "audio-message__play-icon" }, [
|
|
321
335
|
o("svg", {
|
|
@@ -332,11 +346,11 @@ const nt = ["messageId"], ot = ["src"], it = {
|
|
|
332
346
|
])
|
|
333
347
|
], -1)
|
|
334
348
|
])], 512), [
|
|
335
|
-
[
|
|
349
|
+
[le, !d.value]
|
|
336
350
|
]),
|
|
337
|
-
|
|
351
|
+
Y(o("button", {
|
|
338
352
|
class: "audio-message__pause",
|
|
339
|
-
onClick:
|
|
353
|
+
onClick: ee
|
|
340
354
|
}, [...t[10] || (t[10] = [
|
|
341
355
|
o("div", { class: "audio-message__pause-icon" }, [
|
|
342
356
|
o("svg", {
|
|
@@ -353,135 +367,138 @@ const nt = ["messageId"], ot = ["src"], it = {
|
|
|
353
367
|
])
|
|
354
368
|
], -1)
|
|
355
369
|
])], 512), [
|
|
356
|
-
[
|
|
370
|
+
[le, d.value]
|
|
357
371
|
]),
|
|
358
|
-
o("div",
|
|
359
|
-
|
|
360
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
372
|
+
o("div", ct, [
|
|
373
|
+
Y(o("input", {
|
|
374
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => g.value = n),
|
|
361
375
|
class: "audio-message__progress-bar-container",
|
|
362
376
|
type: "range",
|
|
363
377
|
min: 0,
|
|
364
|
-
max:
|
|
378
|
+
max: y.value,
|
|
365
379
|
step: "0.1",
|
|
366
|
-
onMousedown: t[1] || (t[1] = (
|
|
367
|
-
onMouseup:
|
|
368
|
-
onTouchstartPassive: t[2] || (t[2] = (
|
|
369
|
-
onTouchendPassive:
|
|
370
|
-
}, null, 40,
|
|
371
|
-
[
|
|
380
|
+
onMousedown: t[1] || (t[1] = (n) => b.value = !0),
|
|
381
|
+
onMouseup: se,
|
|
382
|
+
onTouchstartPassive: t[2] || (t[2] = (n) => b.value = !0),
|
|
383
|
+
onTouchendPassive: se
|
|
384
|
+
}, null, 40, dt), [
|
|
385
|
+
[Be, g.value]
|
|
372
386
|
]),
|
|
373
|
-
o("div",
|
|
387
|
+
o("div", vt, [
|
|
374
388
|
o("button", {
|
|
375
389
|
type: "button",
|
|
376
390
|
class: "audio-message__speed-btn",
|
|
377
|
-
onClick:
|
|
378
|
-
},
|
|
391
|
+
onClick: ce
|
|
392
|
+
}, h(D.value.text), 1)
|
|
379
393
|
])
|
|
380
394
|
]),
|
|
381
|
-
o("div",
|
|
382
|
-
o("p",
|
|
383
|
-
o("p",
|
|
395
|
+
o("div", gt, [
|
|
396
|
+
o("p", ft, h(Te.value), 1),
|
|
397
|
+
o("p", pt, h(Re.value), 1)
|
|
384
398
|
])
|
|
385
399
|
]),
|
|
386
|
-
s.message.text ? (
|
|
400
|
+
s.message.text ? (i(), m("div", yt, [
|
|
387
401
|
o("p", {
|
|
388
402
|
onClick: t[3] || (t[3] = //@ts-ignore
|
|
389
|
-
(...
|
|
390
|
-
innerHTML:
|
|
391
|
-
}, null, 8,
|
|
392
|
-
])) :
|
|
393
|
-
s.message.linkPreview ? (
|
|
403
|
+
(...n) => r(X) && r(X)(...n)),
|
|
404
|
+
innerHTML: r(Ce)
|
|
405
|
+
}, null, 8, ht)
|
|
406
|
+
])) : c("", !0),
|
|
407
|
+
s.message.linkPreview ? (i(), O(Ye, {
|
|
394
408
|
key: 2,
|
|
395
409
|
class: C(["audio-message__link-preview", s.message.position]),
|
|
396
410
|
"link-preview": s.message.linkPreview
|
|
397
|
-
}, null, 8, ["class", "link-preview"])) :
|
|
398
|
-
s.message.embed ? (
|
|
411
|
+
}, null, 8, ["class", "link-preview"])) : c("", !0),
|
|
412
|
+
s.message.embed ? (i(), O(Ze, {
|
|
399
413
|
key: 3,
|
|
400
414
|
class: C(s.message.position),
|
|
401
415
|
embed: s.message.embed
|
|
402
|
-
}, null, 8, ["class", "embed"])) :
|
|
416
|
+
}, null, 8, ["class", "embed"])) : c("", !0),
|
|
403
417
|
k(ze, {
|
|
404
418
|
reactions: s.message.reactions,
|
|
405
419
|
"message-id": s.message.messageId,
|
|
406
420
|
enabled: s.reactionsEnabled,
|
|
407
|
-
onToggleReaction:
|
|
408
|
-
onAddReaction:
|
|
409
|
-
onRemoveReaction:
|
|
421
|
+
onToggleReaction: r(Ie),
|
|
422
|
+
onAddReaction: r(Ee),
|
|
423
|
+
onRemoveReaction: r(Ae)
|
|
410
424
|
}, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"]),
|
|
411
|
-
o("div",
|
|
412
|
-
|
|
413
|
-
|
|
425
|
+
o("div", bt, [
|
|
426
|
+
_.value || I.value ? (i(), m("div", Ct, [
|
|
427
|
+
_.value ? (i(), m("button", {
|
|
428
|
+
key: 0,
|
|
414
429
|
class: C([
|
|
415
430
|
"audio-message__action-button",
|
|
416
|
-
{ "audio-message__action-button--active":
|
|
431
|
+
{ "audio-message__action-button--active": f.value === "text" }
|
|
417
432
|
]),
|
|
418
433
|
type: "button",
|
|
419
434
|
onClick: Le
|
|
420
|
-
}, " Текст ", 2),
|
|
421
|
-
|
|
435
|
+
}, " Текст ", 2)) : c("", !0),
|
|
436
|
+
I.value ? (i(), m("button", {
|
|
437
|
+
key: 1,
|
|
422
438
|
class: C([
|
|
423
439
|
"audio-message__action-button",
|
|
424
|
-
{ "audio-message__action-button--active":
|
|
440
|
+
{ "audio-message__action-button--active": f.value === "summary" }
|
|
425
441
|
]),
|
|
426
442
|
type: "button",
|
|
427
|
-
onClick:
|
|
428
|
-
}, " Резюме ", 2)
|
|
429
|
-
]),
|
|
430
|
-
s.message.views ? (
|
|
431
|
-
key:
|
|
443
|
+
onClick: De
|
|
444
|
+
}, " Резюме ", 2)) : c("", !0)
|
|
445
|
+
])) : c("", !0),
|
|
446
|
+
s.message.views ? (i(), m("div", {
|
|
447
|
+
key: 1,
|
|
432
448
|
class: "audio-message__views",
|
|
433
449
|
onClick: t[4] || (t[4] = //@ts-ignore
|
|
434
|
-
(...
|
|
450
|
+
(...n) => r(z) && r(z)(...n))
|
|
435
451
|
}, [
|
|
436
452
|
t[11] || (t[11] = o("span", { class: "pi pi-eye" }, null, -1)),
|
|
437
|
-
o("p", null,
|
|
438
|
-
])) :
|
|
439
|
-
o("span",
|
|
440
|
-
k(
|
|
453
|
+
o("p", null, h(s.message.views), 1)
|
|
454
|
+
])) : c("", !0),
|
|
455
|
+
o("span", wt, h(s.message.time), 1),
|
|
456
|
+
k(We, {
|
|
441
457
|
"base-class": "audio-message",
|
|
442
|
-
"message-class":
|
|
458
|
+
"message-class": ae(s.message),
|
|
443
459
|
"message-status": s.message.status,
|
|
444
|
-
"status-class":
|
|
445
|
-
"status-title":
|
|
460
|
+
"status-class": we.value,
|
|
461
|
+
"status-title": xe.value
|
|
446
462
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
447
463
|
]),
|
|
448
464
|
k(re, { name: "audio-message-expand" }, {
|
|
449
|
-
default:
|
|
450
|
-
|
|
451
|
-
o("div",
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
},
|
|
458
|
-
], 64)) : (
|
|
459
|
-
Q.value ? (
|
|
460
|
-
|
|
461
|
-
|
|
465
|
+
default: G(() => [
|
|
466
|
+
fe.value ? (i(), m("div", xt, [
|
|
467
|
+
o("div", kt, [
|
|
468
|
+
f.value === "text" ? (i(), m(He, { key: 0 }, [
|
|
469
|
+
J.value ? (i(), m("p", {
|
|
470
|
+
key: 1,
|
|
471
|
+
class: "audio-message__expand-plain",
|
|
472
|
+
innerHTML: W.value
|
|
473
|
+
}, null, 8, Rt)) : (i(), m("p", Tt, h(pe.value), 1))
|
|
474
|
+
], 64)) : (i(), m("p", Mt, [
|
|
475
|
+
Q.value ? (i(), m("span", {
|
|
476
|
+
key: 1,
|
|
477
|
+
innerHTML: K.value
|
|
478
|
+
}, null, 8, Nt)) : (i(), m("span", St, h(ye.value), 1))
|
|
462
479
|
]))
|
|
463
480
|
]),
|
|
464
|
-
o("div",
|
|
481
|
+
o("div", _t, [
|
|
465
482
|
o("button", {
|
|
466
483
|
type: "button",
|
|
467
484
|
class: "audio-message__expand-close",
|
|
468
|
-
onClick: t[5] || (t[5] = (
|
|
485
|
+
onClick: t[5] || (t[5] = (n) => f.value = null)
|
|
469
486
|
}, " Закрыть ")
|
|
470
487
|
])
|
|
471
|
-
])) :
|
|
488
|
+
])) : c("", !0)
|
|
472
489
|
]),
|
|
473
490
|
_: 1
|
|
474
491
|
}),
|
|
475
|
-
k(
|
|
492
|
+
k(Je, {
|
|
476
493
|
status: s.message.status,
|
|
477
494
|
"has-messenger-account": s.message.hasMessengerAccount,
|
|
478
495
|
channel: s.channel,
|
|
479
|
-
onSmsInvite:
|
|
496
|
+
onSmsInvite: Fe
|
|
480
497
|
}, null, 8, ["status", "has-messenger-account", "channel"]),
|
|
481
|
-
|
|
498
|
+
r(de) && s.message.actions ? (i(), m("button", {
|
|
482
499
|
key: 4,
|
|
483
500
|
class: "audio-message__menu-button",
|
|
484
|
-
onClick: t[6] || (t[6] = (
|
|
501
|
+
onClick: t[6] || (t[6] = (n) => U.value = !r(U))
|
|
485
502
|
}, [...t[12] || (t[12] = [
|
|
486
503
|
o("svg", {
|
|
487
504
|
width: "4",
|
|
@@ -495,22 +512,22 @@ const nt = ["messageId"], ot = ["src"], it = {
|
|
|
495
512
|
fill: "#5F5F5F"
|
|
496
513
|
})
|
|
497
514
|
], -1)
|
|
498
|
-
])])) :
|
|
515
|
+
])])) : c("", !0),
|
|
499
516
|
k(re, null, {
|
|
500
|
-
default:
|
|
501
|
-
|
|
517
|
+
default: G(() => [
|
|
518
|
+
r(U) && s.message.actions ? (i(), O(Ge, {
|
|
502
519
|
key: 0,
|
|
503
520
|
class: "audio-message__context-menu",
|
|
504
521
|
actions: s.message.actions,
|
|
505
522
|
onClick: be
|
|
506
|
-
}, null, 8, ["actions"])) :
|
|
523
|
+
}, null, 8, ["actions"])) : c("", !0)
|
|
507
524
|
]),
|
|
508
525
|
_: 1
|
|
509
526
|
})
|
|
510
527
|
], 34)
|
|
511
|
-
], 46,
|
|
528
|
+
], 46, it));
|
|
512
529
|
}
|
|
513
530
|
});
|
|
514
531
|
export {
|
|
515
|
-
|
|
532
|
+
Jt as default
|
|
516
533
|
};
|