@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,50 +1,47 @@
|
|
|
1
|
-
import { defineComponent as He, inject as re, computed as
|
|
2
|
-
import { useMessageActions as
|
|
1
|
+
import { defineComponent as He, inject as re, computed as r, unref as l, toRefs as Ge, ref as g, watch as ce, createElementBlock as i, openBlock as n, normalizeClass as G, createCommentVNode as f, createElementVNode as o, createVNode as Y, withCtx as U, createTextVNode as h, toDisplayString as d, createBlock as V, Fragment as x, withDirectives as Z, vShow as de, vModelText as Ye, Transition as me, nextTick as Ze } from "vue";
|
|
2
|
+
import { useMessageActions as qe } from "../../../hooks/messages/useMessageActions.js";
|
|
3
3
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
4
4
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
5
5
|
import "../../../functions/parseMarkdown.js";
|
|
6
|
-
import { useSubtextTooltip as
|
|
7
|
-
import
|
|
6
|
+
import { useSubtextTooltip as ze } from "../../../hooks/messages/useSubtextTooltip.js";
|
|
7
|
+
import Je from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
8
8
|
import ve from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
9
|
+
import Ke from "./icons/IncomingCallIcon.vue.js";
|
|
10
|
+
import Qe from "./icons/OutgoingCallIcon.vue.js";
|
|
11
|
+
const Xe = ["messageId"], We = ["src"], et = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "call-message__subtext"
|
|
14
|
-
},
|
|
14
|
+
}, tt = { class: "call-message__content" }, at = { class: "call-message__header-container" }, st = { class: "call-message__title-wrapper" }, lt = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "call-message__title"
|
|
17
|
-
},
|
|
17
|
+
}, nt = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "call-message__title call-message__title--missed"
|
|
20
|
-
},
|
|
20
|
+
}, ot = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "call-message__title"
|
|
23
|
-
},
|
|
23
|
+
}, ut = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "call-message__title call-message__title--missed"
|
|
26
|
-
},
|
|
26
|
+
}, it = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "call-message__missed-info"
|
|
29
|
-
},
|
|
29
|
+
}, rt = {
|
|
30
30
|
key: 1,
|
|
31
31
|
class: "call-message__audio-wrapper"
|
|
32
|
-
},
|
|
32
|
+
}, ct = ["src"], dt = { class: "call-message__audio-progress" }, mt = { class: "call-message__audio-progress-bar" }, vt = ["max"], pt = { class: "call-message__audio-time" }, _t = { class: "call-message__info-container" }, ft = { class: "call-message__actions" }, gt = { class: "call-message__time" }, yt = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "call-message__expand-panel"
|
|
35
|
-
},
|
|
35
|
+
}, Ct = { class: "call-message__expand-inner" }, ht = {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "call-message__expand-placeholder"
|
|
38
|
-
},
|
|
39
|
-
key: 0,
|
|
40
|
-
class: "call-message__expand-plain"
|
|
41
|
-
}, Mt = {
|
|
38
|
+
}, xt = ["innerHTML"], bt = {
|
|
42
39
|
key: 1,
|
|
43
40
|
class: "call-message__expand-plain"
|
|
44
|
-
},
|
|
41
|
+
}, wt = {
|
|
45
42
|
key: 0,
|
|
46
43
|
class: "call-message__expand-placeholder"
|
|
47
|
-
},
|
|
44
|
+
}, kt = ["innerHTML"], Tt = { class: "call-message__expand-close-wrap" }, Mt = "RECOGNITION_READY", Nt = "SUMMARY_READY", $t = /* @__PURE__ */ He({
|
|
48
45
|
__name: "CallMessage",
|
|
49
46
|
props: {
|
|
50
47
|
message: {
|
|
@@ -62,99 +59,78 @@ const at = ["messageId"], st = ["src"], lt = {
|
|
|
62
59
|
}
|
|
63
60
|
},
|
|
64
61
|
emits: ["action", "reply"],
|
|
65
|
-
setup(
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} catch {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function _e(e) {
|
|
79
|
-
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
80
|
-
const t = Math.floor(e), a = Math.floor(t / 60), u = t % 60;
|
|
81
|
-
return `${a}:${u.toString().padStart(2, "0")}`;
|
|
82
|
-
}
|
|
83
|
-
function ye(e) {
|
|
84
|
-
return e === "2" ? "right" : "left";
|
|
85
|
-
}
|
|
86
|
-
function z(e) {
|
|
87
|
-
const t = e.transcript;
|
|
88
|
-
return t && typeof t == "object" && "replies" in t ? t : typeof t == "string" && t.trim() ? q(t) : null;
|
|
89
|
-
}
|
|
90
|
-
function he(e) {
|
|
91
|
-
return e != null && e.length ? e.map((t) => {
|
|
92
|
-
const a = typeof t.timecode == "number" ? t.timecode : Number(t.timecode);
|
|
93
|
-
return {
|
|
94
|
-
time: _e(a),
|
|
95
|
-
text: t.text ?? "",
|
|
96
|
-
position: ye(String(t.user ?? ""))
|
|
97
|
-
};
|
|
98
|
-
}) : [];
|
|
99
|
-
}
|
|
100
|
-
function Ce(e) {
|
|
101
|
-
var a;
|
|
102
|
-
if (e == null) return null;
|
|
103
|
-
const t = String(e).trim();
|
|
104
|
-
if (!t) return null;
|
|
105
|
-
if (t.startsWith("{")) {
|
|
106
|
-
const u = q(t);
|
|
107
|
-
return ((a = u == null ? void 0 : u.summary) == null ? void 0 : a.trim()) || null;
|
|
108
|
-
}
|
|
109
|
-
return t;
|
|
110
|
-
}
|
|
111
|
-
function xe(e) {
|
|
112
|
-
const t = e.callSummary;
|
|
113
|
-
return t == null ? null : typeof t == "object" && t !== null && "summary" in t ? String(t.summary ?? "").trim() || null : typeof t == "string" ? Ce(t) : null;
|
|
114
|
-
}
|
|
115
|
-
const J = re("channels", void 0), H = re("selectedChat", void 0), be = m(() => {
|
|
116
|
-
if (J)
|
|
117
|
-
return l(J);
|
|
118
|
-
}), ke = m(() => {
|
|
119
|
-
if (H)
|
|
120
|
-
return l(H);
|
|
121
|
-
}), D = ge, T = fe, { message: s, applyStyle: we } = Ge(T), M = m(() => {
|
|
122
|
-
const e = s.value;
|
|
62
|
+
setup(pe, { emit: _e }) {
|
|
63
|
+
const q = re("channels", void 0), z = re("selectedChat", void 0), fe = r(() => {
|
|
64
|
+
if (q)
|
|
65
|
+
return l(q);
|
|
66
|
+
}), ge = r(() => {
|
|
67
|
+
if (z)
|
|
68
|
+
return l(z);
|
|
69
|
+
}), $ = _e, T = pe, { message: a, applyStyle: ye } = Ge(T), M = r(() => {
|
|
70
|
+
const e = a.value;
|
|
123
71
|
return e.url ? e.url : typeof e.recordUrl == "string" ? e.recordUrl : void 0;
|
|
124
72
|
}), {
|
|
125
|
-
isOpenMenu:
|
|
126
|
-
buttonMenuVisible:
|
|
127
|
-
showMenu:
|
|
128
|
-
hideMenu:
|
|
129
|
-
clickAction:
|
|
130
|
-
} =
|
|
131
|
-
var
|
|
132
|
-
const e =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const e =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const a = z(e);
|
|
144
|
-
return (u = a == null ? void 0 : a.replies) != null && u.length ? a.replies.map((d) => d.text).filter(Boolean).join(`
|
|
145
|
-
`) : "Текст недоступен";
|
|
146
|
-
}), Q = m(() => S.value.length ? [] : K.value.split(/\r?\n+/g).map((e) => e.trim()).filter(Boolean)), W = m(() => {
|
|
147
|
-
var t, a;
|
|
148
|
-
const e = (t = s.value) == null ? void 0 : t.transcript;
|
|
149
|
-
return e ? typeof e == "string" ? e.trim().length > 0 : !!(typeof e == "object" && ("dialog" in e && Array.isArray(e.dialog) && e.dialog.length || "text" in e && typeof e.text == "string" && e.text.trim() || "replies" in e && Array.isArray(e.replies) && ((a = e.replies) != null && a.length))) : !1;
|
|
150
|
-
}), X = m(() => {
|
|
73
|
+
isOpenMenu: P,
|
|
74
|
+
buttonMenuVisible: Ce,
|
|
75
|
+
showMenu: J,
|
|
76
|
+
hideMenu: j,
|
|
77
|
+
clickAction: he
|
|
78
|
+
} = qe(T.message, $), p = g(null), N = r(() => {
|
|
79
|
+
var t;
|
|
80
|
+
const e = (t = a.value) == null ? void 0 : t.transcript;
|
|
81
|
+
return !e || typeof e != "object" ? null : e;
|
|
82
|
+
}), I = r(() => {
|
|
83
|
+
var t;
|
|
84
|
+
const e = (t = a.value) == null ? void 0 : t.summary;
|
|
85
|
+
return !e || typeof e != "object" ? null : e;
|
|
86
|
+
}), K = r(() => {
|
|
87
|
+
var t;
|
|
88
|
+
const e = (t = N.value) == null ? void 0 : t.html;
|
|
89
|
+
return typeof e != "string" ? "" : e.trim();
|
|
90
|
+
}), Q = r(() => {
|
|
151
91
|
var t;
|
|
152
|
-
const e = (t =
|
|
153
|
-
return
|
|
154
|
-
}),
|
|
92
|
+
const e = (t = I.value) == null ? void 0 : t.html;
|
|
93
|
+
return typeof e != "string" ? "" : e.trim();
|
|
94
|
+
}), X = r(() => {
|
|
95
|
+
var e;
|
|
96
|
+
return ((e = N.value) == null ? void 0 : e.status) === Mt && K.value.length > 0;
|
|
97
|
+
}), W = r(() => {
|
|
98
|
+
var e;
|
|
99
|
+
return ((e = I.value) == null ? void 0 : e.status) === Nt && Q.value.length > 0;
|
|
100
|
+
}), R = g({
|
|
155
101
|
text: !1,
|
|
156
102
|
summary: !1
|
|
157
|
-
}),
|
|
103
|
+
}), E = r(() => {
|
|
104
|
+
var e, t;
|
|
105
|
+
return !!((e = N.value) != null && e.status) && !((t = a.value) != null && t.isMissedCall);
|
|
106
|
+
}), S = r(() => {
|
|
107
|
+
var e, t;
|
|
108
|
+
return !!((e = I.value) != null && e.status) && !((t = a.value) != null && t.isMissedCall);
|
|
109
|
+
}), xe = r(() => p.value === "text" ? E.value : p.value === "summary" ? S.value : !1), be = r(() => {
|
|
110
|
+
var e;
|
|
111
|
+
switch ((e = N.value) == null ? void 0 : e.status) {
|
|
112
|
+
case "RECOGNITION_PLANNED":
|
|
113
|
+
return "Распознаем звонок, пожалуйста подождите...";
|
|
114
|
+
case "RECOGNITION_ERROR":
|
|
115
|
+
return "Не удалось распознать звонок";
|
|
116
|
+
case "RECOGNITION_NOT_CONFIGURED":
|
|
117
|
+
return "Опция распознавания не включена";
|
|
118
|
+
default:
|
|
119
|
+
return "Текст звонка недоступен";
|
|
120
|
+
}
|
|
121
|
+
}), we = r(() => {
|
|
122
|
+
var e;
|
|
123
|
+
switch ((e = I.value) == null ? void 0 : e.status) {
|
|
124
|
+
case "SUMMARY_PLANNED":
|
|
125
|
+
return "Формируем резюме, пожалуйста подождите...";
|
|
126
|
+
case "SUMMARY_ERROR":
|
|
127
|
+
return "Не удалось сформировать резюме";
|
|
128
|
+
case "SUMMARY_NOT_CONFIGURED":
|
|
129
|
+
return "Опция формирования резюме не включена";
|
|
130
|
+
default:
|
|
131
|
+
return "Резюме недоступно";
|
|
132
|
+
}
|
|
133
|
+
}), s = g(null), b = g(void 0), m = g(!1), y = g(0), v = g(0), C = g(!1), O = g(0), B = [
|
|
158
134
|
{
|
|
159
135
|
text: "1.0x",
|
|
160
136
|
speed: 1
|
|
@@ -171,69 +147,69 @@ const at = ["messageId"], st = ["src"], lt = {
|
|
|
171
147
|
text: "2.0x",
|
|
172
148
|
speed: 2
|
|
173
149
|
}
|
|
174
|
-
],
|
|
150
|
+
], H = r(() => B[O.value] ?? B[0]), ke = (e) => {
|
|
175
151
|
if (!e) return;
|
|
176
|
-
const
|
|
177
|
-
if (!
|
|
178
|
-
const
|
|
179
|
-
if (!(Number.isNaN(
|
|
180
|
-
return
|
|
181
|
-
},
|
|
152
|
+
const u = e.trim().match(/^(\d+):([0-5]\d)$/);
|
|
153
|
+
if (!u) return;
|
|
154
|
+
const _ = Number(u[1]), c = Number(u[2]);
|
|
155
|
+
if (!(Number.isNaN(_) || Number.isNaN(c)))
|
|
156
|
+
return _ * 60 + c;
|
|
157
|
+
}, ee = () => {
|
|
182
158
|
var e;
|
|
183
|
-
|
|
159
|
+
m.value = !1, v.value = 0, y.value = ke((e = a.value) == null ? void 0 : e.callDuration) ?? 0, C.value = !1, O.value = 0;
|
|
184
160
|
};
|
|
185
|
-
|
|
161
|
+
ee(), ce(
|
|
186
162
|
M,
|
|
187
163
|
(e, t) => {
|
|
188
|
-
e !== t && (
|
|
164
|
+
e !== t && (ee(), b.value = void 0, s.value && (s.value.pause(), s.value.currentTime = 0, s.value.removeAttribute("src"), s.value.load()));
|
|
189
165
|
}
|
|
190
166
|
);
|
|
191
|
-
const
|
|
192
|
-
const t = Math.floor(e / 60),
|
|
193
|
-
return `${t.toString().padStart(2, "0")}:${
|
|
194
|
-
},
|
|
167
|
+
const te = (e) => {
|
|
168
|
+
const t = Math.floor(e / 60), u = Math.floor(e % 60);
|
|
169
|
+
return `${t.toString().padStart(2, "0")}:${u.toString().padStart(2, "0")}`;
|
|
170
|
+
}, Te = r(() => te(v.value)), Me = r(() => te(y.value)), ae = async () => {
|
|
195
171
|
const e = M.value;
|
|
196
|
-
if (!(!
|
|
197
|
-
if (
|
|
198
|
-
|
|
172
|
+
if (!(!s.value || !e))
|
|
173
|
+
if (m.value)
|
|
174
|
+
s.value.pause(), m.value = !1;
|
|
199
175
|
else
|
|
200
176
|
try {
|
|
201
|
-
b.value || (b.value = e, await
|
|
177
|
+
b.value || (b.value = e, await Ze(), s.value.load()), await s.value.play(), m.value = !0;
|
|
202
178
|
} catch (t) {
|
|
203
|
-
console.error("Не удалось воспроизвести запись звонка", t),
|
|
179
|
+
console.error("Не удалось воспроизвести запись звонка", t), m.value = !1;
|
|
204
180
|
}
|
|
205
|
-
},
|
|
206
|
-
|
|
181
|
+
}, Ne = () => {
|
|
182
|
+
O.value = (O.value + 1) % B.length, s.value && (s.value.playbackRate = H.value.speed);
|
|
207
183
|
};
|
|
208
|
-
|
|
209
|
-
() =>
|
|
184
|
+
ce(
|
|
185
|
+
() => v.value,
|
|
210
186
|
() => {
|
|
211
|
-
|
|
187
|
+
s.value && C.value && (s.value.duration !== 1 / 0 && !Number.isNaN(s.value.duration) && (s.value.currentTime = v.value), Math.abs(v.value - y.value) < 0.1 && (m.value = !1));
|
|
212
188
|
}
|
|
213
189
|
);
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
if (!
|
|
218
|
-
const e =
|
|
219
|
-
if (
|
|
190
|
+
const se = () => {
|
|
191
|
+
s.value && C.value && s.value.duration !== 1 / 0 && !Number.isNaN(s.value.duration) && (s.value.currentTime = v.value), C.value = !1;
|
|
192
|
+
}, Ie = () => {
|
|
193
|
+
if (!s.value) return;
|
|
194
|
+
const e = s.value;
|
|
195
|
+
if (y.value = 0, v.value = e.currentTime || 0, e.duration === 1 / 0 || Number.isNaN(e.duration)) {
|
|
220
196
|
e.currentTime = 1e101;
|
|
221
197
|
const t = () => {
|
|
222
|
-
|
|
198
|
+
s.value && (y.value = s.value.duration || 0, v.value = 0, s.value.currentTime = 0);
|
|
223
199
|
};
|
|
224
200
|
e.addEventListener("timeupdate", t, { once: !0 });
|
|
225
201
|
} else
|
|
226
|
-
|
|
227
|
-
e.playbackRate =
|
|
228
|
-
},
|
|
229
|
-
|
|
202
|
+
y.value = e.duration || 0;
|
|
203
|
+
e.playbackRate = H.value.speed;
|
|
204
|
+
}, Re = () => {
|
|
205
|
+
s.value && (C.value || (v.value = s.value.currentTime), s.value.ended && m.value && (m.value = !1));
|
|
230
206
|
}, Ee = () => {
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
console.error("Не удалось загрузить запись звонка"),
|
|
234
|
-
},
|
|
207
|
+
m.value = !1;
|
|
208
|
+
}, Se = () => {
|
|
209
|
+
console.error("Не удалось загрузить запись звонка"), m.value = !1, b.value = void 0, s.value && (s.value.pause(), s.value.currentTime = 0, s.value.removeAttribute("src"), s.value.load());
|
|
210
|
+
}, A = r(() => {
|
|
235
211
|
var e;
|
|
236
|
-
switch ((e =
|
|
212
|
+
switch ((e = a.value) == null ? void 0 : e.direction) {
|
|
237
213
|
case "incoming":
|
|
238
214
|
return "Входящий";
|
|
239
215
|
case "outgoing":
|
|
@@ -241,10 +217,10 @@ const at = ["messageId"], st = ["src"], lt = {
|
|
|
241
217
|
default:
|
|
242
218
|
return "Звонок";
|
|
243
219
|
}
|
|
244
|
-
}),
|
|
245
|
-
var t,
|
|
246
|
-
const e = (t =
|
|
247
|
-
switch ((
|
|
220
|
+
}), le = r(() => {
|
|
221
|
+
var t, u;
|
|
222
|
+
const e = (t = a.value) == null ? void 0 : t.isMissedCall;
|
|
223
|
+
switch ((u = a.value) == null ? void 0 : u.direction) {
|
|
248
224
|
case "incoming":
|
|
249
225
|
return e ? "#F84932" : "#00AC47";
|
|
250
226
|
case "outgoing":
|
|
@@ -252,52 +228,54 @@ const at = ["messageId"], st = ["src"], lt = {
|
|
|
252
228
|
default:
|
|
253
229
|
return e ? "#5F5F5F" : "#00AC47";
|
|
254
230
|
}
|
|
255
|
-
}),
|
|
231
|
+
}), Oe = r(() => {
|
|
256
232
|
var e;
|
|
257
|
-
return ((e =
|
|
258
|
-
}),
|
|
259
|
-
var
|
|
260
|
-
const e =
|
|
261
|
-
if (!(e != null && e.dialogId) || !t || !
|
|
233
|
+
return ((e = a.value) == null ? void 0 : e.direction) === "outgoing" ? "Без ответа" : "Пропущенный";
|
|
234
|
+
}), ne = r(() => {
|
|
235
|
+
var F;
|
|
236
|
+
const e = a.value, t = fe.value, u = ge.value;
|
|
237
|
+
if (!(e != null && e.dialogId) || !t || !u)
|
|
262
238
|
return null;
|
|
263
|
-
const
|
|
264
|
-
if (!(
|
|
239
|
+
const _ = (F = u.dialogs) == null ? void 0 : F.find((w) => w.dialogId === e.dialogId);
|
|
240
|
+
if (!(_ != null && _.channelId))
|
|
265
241
|
return null;
|
|
266
|
-
const
|
|
267
|
-
return (
|
|
268
|
-
}),
|
|
242
|
+
const c = t.find((w) => w.channelId === _.channelId);
|
|
243
|
+
return (c == null ? void 0 : c.title) || null;
|
|
244
|
+
}), Ae = ze(() => T.message, () => T.subtextTooltipData), Fe = {
|
|
269
245
|
message: "message"
|
|
270
246
|
};
|
|
271
|
-
function
|
|
272
|
-
const
|
|
247
|
+
function De(e, t) {
|
|
248
|
+
const u = e.position;
|
|
273
249
|
switch (t) {
|
|
274
250
|
case "message":
|
|
275
|
-
return
|
|
251
|
+
return u === "left" ? "call-message__left" : "call-message__right";
|
|
276
252
|
default:
|
|
277
253
|
return "";
|
|
278
254
|
}
|
|
279
255
|
}
|
|
280
|
-
const
|
|
256
|
+
const Le = () => {
|
|
281
257
|
alert("Перезвонить");
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
258
|
+
}, Ue = () => {
|
|
259
|
+
if (!E.value) return;
|
|
260
|
+
const e = p.value === "text" ? null : "text";
|
|
261
|
+
p.value = e, e === "text" && !X.value && !R.value.text && (R.value.text = !0, $("action", { action: "fetchTranscript", messageId: a.value.messageId }));
|
|
262
|
+
}, Ve = () => {
|
|
263
|
+
if (!S.value) return;
|
|
264
|
+
const e = p.value === "summary" ? null : "summary";
|
|
265
|
+
p.value = e, e === "summary" && !W.value && !R.value.summary && (R.value.summary = !0, $("action", { action: "fetchCallSummary", messageId: a.value.messageId }));
|
|
266
|
+
}, $e = async () => {
|
|
267
|
+
var t, u, _;
|
|
290
268
|
const e = M.value;
|
|
291
269
|
if (e)
|
|
292
270
|
try {
|
|
293
|
-
const
|
|
271
|
+
const c = await fetch(e, {
|
|
294
272
|
headers: {
|
|
295
273
|
Accept: "audio/*"
|
|
296
274
|
}
|
|
297
275
|
});
|
|
298
|
-
if (!
|
|
299
|
-
throw new Error(`HTTP error! status: ${
|
|
300
|
-
const
|
|
276
|
+
if (!c.ok)
|
|
277
|
+
throw new Error(`HTTP error! status: ${c.status}`);
|
|
278
|
+
const F = c.headers.get("content-type") || "", w = await c.blob(), D = ((u = (t = e.split(".").pop()) == null ? void 0 : t.split("?")[0]) == null ? void 0 : u.toLowerCase()) || "", je = {
|
|
301
279
|
"audio/mpeg": "mp3",
|
|
302
280
|
"audio/mp3": "mp3",
|
|
303
281
|
"audio/wav": "wav",
|
|
@@ -308,265 +286,261 @@ const at = ["messageId"], st = ["src"], lt = {
|
|
|
308
286
|
"audio/flac": "flac",
|
|
309
287
|
"audio/m4a": "m4a",
|
|
310
288
|
"audio/x-m4a": "m4a",
|
|
311
|
-
"application/octet-stream":
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
} catch (
|
|
315
|
-
console.error("Ошибка при скачивании аудио звонка:",
|
|
289
|
+
"application/octet-stream": D || "mp3"
|
|
290
|
+
}, oe = D && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes(D) ? D : je[F] || "mp3", ue = e.split("/"), L = decodeURIComponent(((_ = ue[ue.length - 1]) == null ? void 0 : _.split("?")[0]) || ""), Be = L ? L.includes(".") ? L : `${L}.${oe}` : `call-${a.value.messageId}.${oe}`, ie = window.URL.createObjectURL(w), k = document.createElement("a");
|
|
291
|
+
k.href = ie, k.download = Be, document.body.appendChild(k), k.click(), document.body.removeChild(k), window.URL.revokeObjectURL(ie);
|
|
292
|
+
} catch (c) {
|
|
293
|
+
console.error("Ошибка при скачивании аудио звонка:", c), e && window.open(e, "_blank");
|
|
316
294
|
}
|
|
317
|
-
},
|
|
318
|
-
e.action === "download" ? (
|
|
295
|
+
}, Pe = (e) => {
|
|
296
|
+
e.action === "download" ? ($e(), j()) : he(e);
|
|
319
297
|
};
|
|
320
|
-
return (e, t) => (
|
|
321
|
-
class:
|
|
322
|
-
|
|
323
|
-
l(
|
|
298
|
+
return (e, t) => (n(), i("div", {
|
|
299
|
+
class: G([
|
|
300
|
+
De(l(a), Fe.message),
|
|
301
|
+
l(ye)(l(a))
|
|
324
302
|
]),
|
|
325
|
-
messageId: l(
|
|
303
|
+
messageId: l(a).messageId,
|
|
326
304
|
onMouseenter: t[5] || (t[5] = //@ts-ignore
|
|
327
|
-
(...
|
|
305
|
+
(...u) => l(J) && l(J)(...u)),
|
|
328
306
|
onMouseleave: t[6] || (t[6] = //@ts-ignore
|
|
329
|
-
(...
|
|
307
|
+
(...u) => l(j) && l(j)(...u))
|
|
330
308
|
}, [
|
|
331
|
-
l(
|
|
309
|
+
l(a).avatar ? (n(), i("img", {
|
|
332
310
|
key: 0,
|
|
333
311
|
class: "call-message__avatar",
|
|
334
|
-
src: l(
|
|
312
|
+
src: l(a).avatar,
|
|
335
313
|
height: "32",
|
|
336
314
|
width: "32"
|
|
337
|
-
}, null, 8,
|
|
338
|
-
l(
|
|
339
|
-
|
|
340
|
-
text: l(
|
|
341
|
-
position: l(
|
|
315
|
+
}, null, 8, We)) : f("", !0),
|
|
316
|
+
l(a).subText ? (n(), i("p", et, [
|
|
317
|
+
Y(ve, {
|
|
318
|
+
text: l(Ae),
|
|
319
|
+
position: l(a).position === "left" ? "right" : "left",
|
|
342
320
|
offset: 8
|
|
343
321
|
}, {
|
|
344
|
-
default:
|
|
345
|
-
h(
|
|
322
|
+
default: U(() => [
|
|
323
|
+
h(d(l(a).subText), 1)
|
|
346
324
|
]),
|
|
347
325
|
_: 1
|
|
348
326
|
}, 8, ["text", "position"])
|
|
349
|
-
])) :
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
l(
|
|
327
|
+
])) : f("", !0),
|
|
328
|
+
o("div", tt, [
|
|
329
|
+
o("div", at, [
|
|
330
|
+
o("div", st, [
|
|
331
|
+
l(a).direction === "incoming" || !l(a).direction ? (n(), V(Ke, {
|
|
354
332
|
key: 0,
|
|
355
333
|
class: "call-message__direction-icon",
|
|
356
|
-
color:
|
|
357
|
-
}, null, 8, ["color"])) : (
|
|
334
|
+
color: le.value
|
|
335
|
+
}, null, 8, ["color"])) : (n(), V(Qe, {
|
|
358
336
|
key: 1,
|
|
359
337
|
class: "call-message__direction-icon",
|
|
360
|
-
color:
|
|
338
|
+
color: le.value
|
|
361
339
|
}, null, 8, ["color"])),
|
|
362
|
-
|
|
340
|
+
ne.value ? (n(), V(ve, {
|
|
363
341
|
key: 2,
|
|
364
|
-
text:
|
|
342
|
+
text: ne.value,
|
|
365
343
|
position: "top",
|
|
366
344
|
offset: 8
|
|
367
345
|
}, {
|
|
368
|
-
default:
|
|
369
|
-
l(
|
|
370
|
-
h(
|
|
371
|
-
l(
|
|
346
|
+
default: U(() => [
|
|
347
|
+
l(a).isMissedCall ? (n(), i("span", nt, [
|
|
348
|
+
h(d(A.value) + " ", 1),
|
|
349
|
+
l(a).direction !== "incoming" ? (n(), i(x, { key: 0 }, [
|
|
372
350
|
h(" звонок ")
|
|
373
|
-
], 64)) : (
|
|
351
|
+
], 64)) : (n(), i(x, { key: 1 }, [
|
|
374
352
|
h(" звонок ")
|
|
375
353
|
], 64))
|
|
376
|
-
])) : (
|
|
354
|
+
])) : (n(), i("span", lt, d(A.value) + " звонок ", 1))
|
|
377
355
|
]),
|
|
378
356
|
_: 1
|
|
379
|
-
}, 8, ["text"])) : (
|
|
380
|
-
l(
|
|
381
|
-
h(
|
|
382
|
-
l(
|
|
357
|
+
}, 8, ["text"])) : (n(), i(x, { key: 3 }, [
|
|
358
|
+
l(a).isMissedCall ? (n(), i("span", ut, [
|
|
359
|
+
h(d(A.value) + " ", 1),
|
|
360
|
+
l(a).direction !== "incoming" ? (n(), i(x, { key: 0 }, [
|
|
383
361
|
h(" звонок ")
|
|
384
|
-
], 64)) : (
|
|
362
|
+
], 64)) : (n(), i(x, { key: 1 }, [
|
|
385
363
|
h(" звонок ")
|
|
386
364
|
], 64))
|
|
387
|
-
])) : (
|
|
365
|
+
])) : (n(), i("span", ot, d(A.value) + " звонок ", 1))
|
|
388
366
|
], 64))
|
|
389
367
|
]),
|
|
390
|
-
l(
|
|
391
|
-
M.value && !l(
|
|
392
|
-
|
|
368
|
+
l(a).isMissedCall ? (n(), i("p", it, d(Oe.value) + ": " + d(l(a).callAttemptDuration), 1)) : f("", !0),
|
|
369
|
+
M.value && !l(a).isMissedCall ? (n(), i("div", rt, [
|
|
370
|
+
o("audio", {
|
|
393
371
|
ref_key: "player",
|
|
394
|
-
ref:
|
|
372
|
+
ref: s,
|
|
395
373
|
src: b.value,
|
|
396
374
|
type: "audio/webm",
|
|
397
|
-
onLoadedmetadata:
|
|
398
|
-
onTimeupdate:
|
|
375
|
+
onLoadedmetadata: Ie,
|
|
376
|
+
onTimeupdate: Re,
|
|
399
377
|
onEnded: Ee,
|
|
400
|
-
onError:
|
|
401
|
-
}, null, 40,
|
|
402
|
-
Z(
|
|
378
|
+
onError: Se
|
|
379
|
+
}, null, 40, ct),
|
|
380
|
+
Z(o("button", {
|
|
403
381
|
class: "call-message__audio-play",
|
|
404
382
|
type: "button",
|
|
405
|
-
onClick:
|
|
383
|
+
onClick: ae
|
|
406
384
|
}, [...t[7] || (t[7] = [
|
|
407
|
-
|
|
408
|
-
|
|
385
|
+
o("div", { class: "call-message__audio-play-icon" }, [
|
|
386
|
+
o("svg", {
|
|
409
387
|
width: "20",
|
|
410
388
|
height: "23",
|
|
411
389
|
viewBox: "0 0 20 23",
|
|
412
390
|
fill: "none",
|
|
413
391
|
xmlns: "http://www.w3.org/2000/svg"
|
|
414
392
|
}, [
|
|
415
|
-
|
|
393
|
+
o("path", {
|
|
416
394
|
d: "M18.99 12.9934L3.0825 22.2234C1.7325 23.0059 0 22.0584 0 20.4809V2.02087C0 0.44587 1.73 -0.50413 3.0825 0.28087L18.99 9.51087C19.2971 9.68618 19.5524 9.93959 19.7299 10.2454C19.9075 10.5512 20.001 10.8985 20.001 11.2521C20.001 11.6057 19.9075 11.953 19.7299 12.2589C19.5524 12.5647 19.2971 12.8181 18.99 12.9934Z",
|
|
417
395
|
fill: "#5F5F5F"
|
|
418
396
|
})
|
|
419
397
|
])
|
|
420
398
|
], -1)
|
|
421
399
|
])], 512), [
|
|
422
|
-
[
|
|
400
|
+
[de, !m.value]
|
|
423
401
|
]),
|
|
424
|
-
Z(
|
|
402
|
+
Z(o("button", {
|
|
425
403
|
class: "call-message__audio-pause",
|
|
426
404
|
type: "button",
|
|
427
|
-
onClick:
|
|
405
|
+
onClick: ae
|
|
428
406
|
}, [...t[8] || (t[8] = [
|
|
429
|
-
|
|
430
|
-
|
|
407
|
+
o("div", { class: "call-message__audio-pause-icon" }, [
|
|
408
|
+
o("svg", {
|
|
431
409
|
width: "20",
|
|
432
410
|
height: "23",
|
|
433
411
|
viewBox: "0 0 20 23",
|
|
434
412
|
fill: "none",
|
|
435
413
|
xmlns: "http://www.w3.org/2000/svg"
|
|
436
414
|
}, [
|
|
437
|
-
|
|
415
|
+
o("path", {
|
|
438
416
|
d: "M3.75 0C4.74456 0 5.69839 0.395088 6.40165 1.09835C7.10491 1.80161 7.5 2.75544 7.5 3.75V18.75C7.5 19.7446 7.10491 20.6984 6.40165 21.4017C5.69839 22.1049 4.74456 22.5 3.75 22.5C2.75544 22.5 1.80161 22.1049 1.09835 21.4017C0.395088 20.6984 0 19.7446 0 18.75V3.75C0 2.75544 0.395088 1.80161 1.09835 1.09835C1.80161 0.395088 2.75544 0 3.75 0ZM16.25 0C17.2446 0 18.1984 0.395088 18.9017 1.09835C19.6049 1.80161 20 2.75544 20 3.75V18.75C20 19.7446 19.6049 20.6984 18.9017 21.4017C18.1984 22.1049 17.2446 22.5 16.25 22.5C15.2554 22.5 14.3016 22.1049 13.5983 21.4017C12.8951 20.6984 12.5 19.7446 12.5 18.75V3.75C12.5 2.75544 12.8951 1.80161 13.5983 1.09835C14.3016 0.395088 15.2554 0 16.25 0Z",
|
|
439
417
|
fill: "#5F5F5F"
|
|
440
418
|
})
|
|
441
419
|
])
|
|
442
420
|
], -1)
|
|
443
421
|
])], 512), [
|
|
444
|
-
[
|
|
422
|
+
[de, m.value]
|
|
445
423
|
]),
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
Z(
|
|
449
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
424
|
+
o("div", dt, [
|
|
425
|
+
o("div", mt, [
|
|
426
|
+
Z(o("input", {
|
|
427
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => v.value = u),
|
|
450
428
|
class: "call-message__audio-slider",
|
|
451
429
|
type: "range",
|
|
452
430
|
min: 0,
|
|
453
|
-
max:
|
|
431
|
+
max: y.value,
|
|
454
432
|
step: "0.1",
|
|
455
|
-
onMousedown: t[1] || (t[1] = (
|
|
456
|
-
onMouseup:
|
|
457
|
-
onTouchstartPassive: t[2] || (t[2] = (
|
|
458
|
-
onTouchendPassive:
|
|
459
|
-
}, null, 40,
|
|
460
|
-
[
|
|
433
|
+
onMousedown: t[1] || (t[1] = (u) => C.value = !0),
|
|
434
|
+
onMouseup: se,
|
|
435
|
+
onTouchstartPassive: t[2] || (t[2] = (u) => C.value = !0),
|
|
436
|
+
onTouchendPassive: se
|
|
437
|
+
}, null, 40, vt), [
|
|
438
|
+
[Ye, v.value]
|
|
461
439
|
]),
|
|
462
|
-
|
|
440
|
+
o("button", {
|
|
463
441
|
type: "button",
|
|
464
442
|
class: "call-message__audio-speed-btn",
|
|
465
|
-
onClick:
|
|
466
|
-
},
|
|
443
|
+
onClick: Ne
|
|
444
|
+
}, d(H.value.text), 1)
|
|
467
445
|
]),
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
446
|
+
o("div", pt, [
|
|
447
|
+
o("span", null, d(Te.value), 1),
|
|
448
|
+
o("span", null, d(Me.value), 1)
|
|
471
449
|
])
|
|
472
450
|
])
|
|
473
|
-
])) :
|
|
451
|
+
])) : f("", !0)
|
|
474
452
|
]),
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
l(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
453
|
+
o("div", _t, [
|
|
454
|
+
o("div", ft, [
|
|
455
|
+
!l(a).isMissedCall && (E.value || S.value) ? (n(), i(x, { key: 0 }, [
|
|
456
|
+
E.value ? (n(), i("button", {
|
|
457
|
+
key: 0,
|
|
458
|
+
class: G([
|
|
459
|
+
"call-message__call-button",
|
|
460
|
+
{ "call-message__call-button--active": p.value === "text" }
|
|
461
|
+
]),
|
|
462
|
+
type: "button",
|
|
463
|
+
onClick: Ue
|
|
464
|
+
}, " Текст ", 2)) : f("", !0),
|
|
465
|
+
S.value ? (n(), i("button", {
|
|
466
|
+
key: 1,
|
|
467
|
+
class: G([
|
|
468
|
+
"call-message__call-button",
|
|
469
|
+
{ "call-message__call-button--active": p.value === "summary" }
|
|
470
|
+
]),
|
|
471
|
+
type: "button",
|
|
472
|
+
onClick: Ve
|
|
473
|
+
}, " Резюме ", 2)) : f("", !0)
|
|
474
|
+
], 64)) : f("", !0),
|
|
475
|
+
o("button", {
|
|
496
476
|
class: "call-message__call-button",
|
|
497
477
|
type: "button",
|
|
498
|
-
onClick:
|
|
478
|
+
onClick: Le
|
|
499
479
|
}, " Перезвонить ")
|
|
500
480
|
]),
|
|
501
|
-
|
|
481
|
+
o("span", gt, d(l(a).time), 1)
|
|
502
482
|
]),
|
|
503
|
-
|
|
504
|
-
default:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
Q.value.length ? p("", !0) : (o(), i("p", Tt, c(K.value), 1))
|
|
519
|
-
], 64))
|
|
520
|
-
], 64)) : (o(), i("p", Mt, [
|
|
521
|
-
X.value ? (o(), i(g, { key: 1 }, [
|
|
522
|
-
h(c(Se.value), 1)
|
|
523
|
-
], 64)) : (o(), i("span", St, c(pe)))
|
|
483
|
+
Y(me, { name: "call-message-expand" }, {
|
|
484
|
+
default: U(() => [
|
|
485
|
+
xe.value ? (n(), i("div", yt, [
|
|
486
|
+
o("div", Ct, [
|
|
487
|
+
p.value === "text" ? (n(), i(x, { key: 0 }, [
|
|
488
|
+
X.value ? (n(), i("p", {
|
|
489
|
+
key: 1,
|
|
490
|
+
class: "call-message__expand-plain",
|
|
491
|
+
innerHTML: K.value
|
|
492
|
+
}, null, 8, xt)) : (n(), i("p", ht, d(be.value), 1))
|
|
493
|
+
], 64)) : (n(), i("p", bt, [
|
|
494
|
+
W.value ? (n(), i("span", {
|
|
495
|
+
key: 1,
|
|
496
|
+
innerHTML: Q.value
|
|
497
|
+
}, null, 8, kt)) : (n(), i("span", wt, d(we.value), 1))
|
|
524
498
|
]))
|
|
525
499
|
]),
|
|
526
|
-
|
|
527
|
-
|
|
500
|
+
o("div", Tt, [
|
|
501
|
+
o("button", {
|
|
528
502
|
type: "button",
|
|
529
503
|
class: "call-message__expand-close",
|
|
530
|
-
onClick: t[3] || (t[3] = (
|
|
504
|
+
onClick: t[3] || (t[3] = (u) => p.value = null)
|
|
531
505
|
}, " Закрыть ")
|
|
532
506
|
])
|
|
533
|
-
])) :
|
|
507
|
+
])) : f("", !0)
|
|
534
508
|
]),
|
|
535
509
|
_: 1
|
|
536
510
|
}),
|
|
537
|
-
l(
|
|
511
|
+
l(Ce) && l(a).actions ? (n(), i("button", {
|
|
538
512
|
key: 0,
|
|
539
513
|
class: "call-message__menu-button",
|
|
540
|
-
onClick: t[4] || (t[4] = (
|
|
514
|
+
onClick: t[4] || (t[4] = (u) => P.value = !l(P))
|
|
541
515
|
}, [...t[9] || (t[9] = [
|
|
542
|
-
|
|
516
|
+
o("svg", {
|
|
543
517
|
width: "4",
|
|
544
518
|
height: "17",
|
|
545
519
|
viewBox: "0 0 4 17",
|
|
546
520
|
fill: "none",
|
|
547
521
|
xmlns: "http://www.w3.org/2000/svg"
|
|
548
522
|
}, [
|
|
549
|
-
|
|
523
|
+
o("path", {
|
|
550
524
|
d: "M3.75 14.375C3.75 14.8723 3.55246 15.3492 3.20083 15.7008C2.84919 16.0525 2.37228 16.25 1.875 16.25C1.37772 16.25 0.900805 16.0525 0.549175 15.7008C0.197544 15.3492 0 14.8723 0 14.375C0 13.8777 0.197544 13.4008 0.549175 13.0492C0.900805 12.6975 1.37772 12.5 1.875 12.5C2.37228 12.5 2.84919 12.6975 3.20083 13.0492C3.55246 13.4008 3.75 13.8777 3.75 14.375ZM3.75 8.125C3.75 8.62228 3.55246 9.09919 3.20083 9.45083C2.84919 9.80246 2.37228 10 1.875 10C1.37772 10 0.900805 9.80246 0.549175 9.45083C0.197544 9.09919 0 8.62228 0 8.125C0 7.62772 0.197544 7.15081 0.549175 6.79917C0.900805 6.44754 1.37772 6.25 1.875 6.25C2.37228 6.25 2.84919 6.44754 3.20083 6.79917C3.55246 7.15081 3.75 7.62772 3.75 8.125ZM3.75 1.875C3.75 2.37228 3.55246 2.84919 3.20083 3.20083C2.84919 3.55246 2.37228 3.75 1.875 3.75C1.37772 3.75 0.900805 3.55246 0.549175 3.20083C0.197544 2.84919 0 2.37228 0 1.875C0 1.37772 0.197544 0.900806 0.549175 0.549175C0.900805 0.197544 1.37772 0 1.875 0C2.37228 0 2.84919 0.197544 3.20083 0.549175C3.55246 0.900806 3.75 1.37772 3.75 1.875Z",
|
|
551
525
|
fill: "#5F5F5F"
|
|
552
526
|
})
|
|
553
527
|
], -1)
|
|
554
|
-
])])) :
|
|
555
|
-
|
|
556
|
-
default:
|
|
557
|
-
l(
|
|
528
|
+
])])) : f("", !0),
|
|
529
|
+
Y(me, null, {
|
|
530
|
+
default: U(() => [
|
|
531
|
+
l(P) && l(a).actions ? (n(), V(Je, {
|
|
558
532
|
key: 0,
|
|
559
533
|
class: "call-message__context-menu",
|
|
560
|
-
actions: l(
|
|
561
|
-
onClick:
|
|
562
|
-
}, null, 8, ["actions"])) :
|
|
534
|
+
actions: l(a).actions,
|
|
535
|
+
onClick: Pe
|
|
536
|
+
}, null, 8, ["actions"])) : f("", !0)
|
|
563
537
|
]),
|
|
564
538
|
_: 1
|
|
565
539
|
})
|
|
566
540
|
])
|
|
567
|
-
], 42,
|
|
541
|
+
], 42, Xe));
|
|
568
542
|
}
|
|
569
543
|
});
|
|
570
544
|
export {
|
|
571
|
-
|
|
545
|
+
$t as default
|
|
572
546
|
};
|