@mobilon-dev/chotto 0.3.117 → 0.3.118

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.
Files changed (25) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_icons/VerifiedBadge.vue.js +31 -0
  3. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
  4. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +197 -187
  5. package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +43 -40
  6. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
  7. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +243 -232
  8. package/dist/index.js +325 -323
  9. package/dist/themes/dark.css +1 -1
  10. package/dist/themes/default.css +1 -1
  11. package/dist/themes/glass.css +1 -1
  12. package/dist/themes/green.css +1 -1
  13. package/dist/themes/mobilon1.css +1 -1
  14. package/dist/types/src/components/1_icons/VerifiedBadge.vue.d.ts +2 -0
  15. package/dist/types/src/components/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +11 -1
  16. package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
  17. package/dist/types/src/components/2_chatlist_elements/ChatItem/styles/types.d.ts +35 -3
  18. package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
  19. package/dist/types/src/components/2_elements/ChatInfo/ChatInfo.vue.d.ts +2 -0
  20. package/dist/types/src/components/2_elements/ChatInfo/stories/ChatInfo.stories.d.ts +2 -0
  21. package/dist/types/src/components/2_elements/ChatInfo/styles/types.d.ts +20 -0
  22. package/dist/types/src/components/3_compounds/ChatInput/styles/types.d.ts +32 -0
  23. package/dist/types/src/components/index.d.ts +1 -0
  24. package/dist/types/src/test-utils/withSetup.d.ts +2 -0
  25. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ import { createElementBlock as t, openBlock as r, createElementVNode as e } from "vue";
2
+ /* empty css */
3
+ import i from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const o = {}, d = {
5
+ class: "verified-badge",
6
+ "data-testid": "verified-badge",
7
+ role: "img",
8
+ "aria-label": "verified",
9
+ title: "Verified"
10
+ };
11
+ function a(L, C) {
12
+ return r(), t("span", d, [...C[0] || (C[0] = [
13
+ e("svg", {
14
+ width: "16",
15
+ height: "16",
16
+ viewBox: "0 0 16 16",
17
+ fill: "none",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ "aria-hidden": "true"
20
+ }, [
21
+ e("path", {
22
+ d: "M10.0662 0.870195C9.79703 0.594736 9.47551 0.375856 9.12055 0.226418C8.76558 0.0769807 8.38433 0 7.9992 0C7.61406 0 7.23281 0.0769807 6.87784 0.226418C6.52288 0.375856 6.20137 0.594736 5.9322 0.870195L5.31019 1.5082L4.4202 1.4972C4.03495 1.49264 3.65267 1.56515 3.29586 1.71048C2.93904 1.85581 2.61489 2.07102 2.34245 2.34345C2.07002 2.61589 1.85481 2.94004 1.70948 3.29686C1.56415 3.65367 1.49164 4.03595 1.4962 4.4212L1.5062 5.3112L0.870195 5.9332C0.594736 6.20237 0.375856 6.52388 0.226418 6.87884C0.0769807 7.23381 0 7.61506 0 8.0002C0 8.38533 0.0769807 8.76659 0.226418 9.12155C0.375856 9.47651 0.594736 9.79803 0.870195 10.0672L1.5072 10.6892L1.4962 11.5792C1.49164 11.9644 1.56415 12.3467 1.70948 12.7035C1.85481 13.0603 2.07002 13.3845 2.34245 13.6569C2.61489 13.9294 2.93904 14.1446 3.29586 14.2899C3.65267 14.4352 4.03495 14.5078 4.4202 14.5032L5.31019 14.4932L5.9322 15.1292C6.20137 15.4047 6.52288 15.6235 6.87784 15.773C7.23281 15.9224 7.61406 15.9994 7.9992 15.9994C8.38433 15.9994 8.76558 15.9224 9.12055 15.773C9.47551 15.6235 9.79703 15.4047 10.0662 15.1292L10.6882 14.4922L11.5782 14.5032C11.9634 14.5078 12.3457 14.4352 12.7025 14.2899C13.0593 14.1446 13.3835 13.9294 13.6559 13.6569C13.9284 13.3845 14.1436 13.0603 14.2889 12.7035C14.4342 12.3467 14.5068 11.9644 14.5022 11.5792L14.4922 10.6892L15.1282 10.0672C15.4037 9.79803 15.6225 9.47651 15.772 9.12155C15.9214 8.76659 15.9984 8.38533 15.9984 8.0002C15.9984 7.61506 15.9214 7.23381 15.772 6.87884C15.6225 6.52388 15.4037 6.20237 15.1282 5.9332L14.4912 5.3112L14.5022 4.4212C14.5068 4.03595 14.4342 3.65367 14.2889 3.29686C14.1436 2.94004 13.9284 2.61589 13.6559 2.34345C13.3835 2.07102 13.0593 1.85581 12.7025 1.71048C12.3457 1.56515 11.9634 1.49264 11.5782 1.4972L10.6882 1.5072L10.0662 0.870195ZM10.3532 6.8542L7.3532 9.8542C7.30675 9.90076 7.25157 9.9377 7.19083 9.96291C7.13008 9.98811 7.06496 10.0011 6.9992 10.0011C6.93343 10.0011 6.86831 9.98811 6.80756 9.96291C6.74682 9.9377 6.69164 9.90076 6.6452 9.8542L5.1452 8.3542C5.09871 8.30771 5.06183 8.25252 5.03667 8.19178C5.01151 8.13104 4.99856 8.06594 4.99856 8.0002C4.99856 7.93445 5.01151 7.86935 5.03667 7.80861C5.06183 7.74787 5.09871 7.69268 5.1452 7.6462C5.19168 7.59971 5.24687 7.56283 5.30761 7.53767C5.36835 7.51251 5.43345 7.49956 5.4992 7.49956C5.56494 7.49956 5.63004 7.51251 5.69078 7.53767C5.75152 7.56283 5.80671 7.59971 5.8532 7.6462L6.9992 8.7932L9.6452 6.1462C9.73908 6.05231 9.86642 5.99956 9.9992 5.99956C10.132 5.99956 10.2593 6.05231 10.3532 6.1462C10.4471 6.24008 10.4998 6.36742 10.4998 6.5002C10.4998 6.63297 10.4471 6.76031 10.3532 6.8542Z",
23
+ fill: "currentColor"
24
+ })
25
+ ], -1)
26
+ ])]);
27
+ }
28
+ const f = /* @__PURE__ */ i(o, [["render", a], ["__scopeId", "data-v-6ea31684"]]);
29
+ export {
30
+ f as default
31
+ };
@@ -1,7 +1,7 @@
1
1
  import t from "./ChatItem.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-3345188c"]]);
4
+ const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f1c3ebdc"]]);
5
5
  export {
6
- p as default
6
+ c as default
7
7
  };
@@ -1,77 +1,78 @@
1
- import { defineComponent as Dt, inject as Ht, useId as Nt, ref as M, computed as u, watch as Ut, onMounted as Ft, nextTick as U, onUnmounted as Pt, createElementBlock as c, openBlock as o, createElementVNode as m, createCommentVNode as r, withModifiers as Rt, normalizeClass as F, normalizeStyle as et, createVNode as P, withCtx as R, toDisplayString as f, createBlock as d, resolveDynamicComponent as nt, unref as h, Teleport as Wt, Fragment as jt, renderList as Xt } from "vue";
2
- import { getStatus as Yt, statuses as $t } from "../../../functions/getStatusMessage.js";
1
+ import { defineComponent as Ht, inject as Nt, useId as Ut, ref as E, computed as l, watch as Ft, onMounted as Pt, nextTick as F, onUnmounted as Rt, createElementBlock as a, openBlock as o, createElementVNode as m, createCommentVNode as c, withModifiers as Wt, normalizeClass as P, normalizeStyle as nt, createVNode as R, createBlock as d, renderSlot as $t, withCtx as W, toDisplayString as f, resolveDynamicComponent as it, unref as h, Teleport as jt, Fragment as Xt, renderList as Yt } from "vue";
2
+ import { getStatus as zt, statuses as Ot } from "../../../functions/getStatusMessage.js";
3
3
  import "../../../functions/parseMarkdown.js";
4
- import { t as b } from "../../../locale/useLocale.js";
5
- import { resolveMessageDraftStore as zt } from "../../../hooks/useMessageDraft.js";
6
- import { useTheme as Ot } from "../../../hooks/useTheme.js";
7
- import { useEmojiNative as qt } from "../../../hooks/useEmojiNative.js";
4
+ import { t as A } from "../../../locale/useLocale.js";
5
+ import { resolveMessageDraftStore as qt } from "../../../hooks/useMessageDraft.js";
6
+ import { useTheme as Gt } from "../../../hooks/useTheme.js";
7
+ import { useEmojiNative as Jt } from "../../../hooks/useEmojiNative.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  import "../../../node_modules/linkifyjs/dist/linkify.js";
12
12
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
13
- import { textToAppleEmojiHtml as W, textContainsEmoji as it } from "../../../functions/renderAppleEmojis.js";
14
- import ot from "../../1_atoms/Tooltip/Tooltip.vue.js";
15
- import Gt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
16
- import Jt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
17
- import Kt from "../../1_icons/AvatarIcon.vue.js";
18
- import Qt from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
19
- import Zt from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
20
- import te from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
21
- import ee from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
22
- import ne from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
23
- import at from "./icons/AudioIcon.vue.js";
13
+ import { textToAppleEmojiHtml as $, textContainsEmoji as ot } from "../../../functions/renderAppleEmojis.js";
14
+ import at from "../../1_atoms/Tooltip/Tooltip.vue.js";
15
+ import Kt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
16
+ import Qt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
17
+ import Zt from "../../1_icons/AvatarIcon.vue.js";
18
+ import te from "../../1_icons/VerifiedBadge.vue.js";
19
+ import ee from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
20
+ import ne from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
21
+ import ie from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
22
+ import oe from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
23
+ import ae from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
24
+ import st from "./icons/AudioIcon.vue.js";
24
25
  import j from "./icons/FileIcon.vue.js";
25
26
  import ct from "./icons/ImageIcon.vue.js";
26
- import ie from "./icons/MissedCallIcon.vue.js";
27
+ import se from "./icons/MissedCallIcon.vue.js";
27
28
  import X from "./icons/StickerIcon.vue.js";
28
- import st from "./icons/VideoIcon.vue.js";
29
- import rt from "./icons/VoiceIcon.vue.js";
30
- const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce = ["src"], se = {
29
+ import rt from "./icons/VideoIcon.vue.js";
30
+ import lt from "./icons/VoiceIcon.vue.js";
31
+ const ce = ["data-chat-id"], re = { class: "chat-item__avatar-container" }, le = ["src"], ue = {
31
32
  key: 1,
32
33
  class: "chat-item__avatar-placeholder"
33
- }, re = { class: "chat-item__info-container" }, le = ["innerHTML"], ue = {
34
+ }, me = { class: "chat-item__info-container" }, de = { class: "chat-item__title-row" }, he = ["innerHTML"], fe = {
34
35
  key: 1,
35
36
  class: "chat-item__name"
36
- }, me = {
37
+ }, ve = {
37
38
  key: 0,
38
39
  class: "chat-item__last-message"
39
- }, de = {
40
+ }, ge = {
40
41
  key: 1,
41
42
  class: "chat-item__last-message-text chat-item__last-message-text--draft"
42
- }, he = { class: "chat-item__draft-label" }, fe = ["innerHTML"], ve = {
43
+ }, ye = { class: "chat-item__draft-label" }, pe = ["innerHTML"], _e = {
43
44
  key: 2,
44
45
  class: "chat-item__draft-text"
45
- }, ge = ["innerHTML"], ye = {
46
+ }, ke = ["innerHTML"], xe = {
46
47
  key: 3,
47
48
  class: "chat-item__last-message-text"
48
- }, pe = { class: "chat-item__details-container" }, _e = {
49
+ }, we = { class: "chat-item__details-container" }, Ce = {
49
50
  key: 0,
50
51
  class: "chat-item__time"
51
- }, ke = { class: "chat-item__status-unread-container" }, xe = {
52
+ }, Ie = { class: "chat-item__status-unread-container" }, Te = {
52
53
  key: 1,
53
54
  class: "chat-item__unread"
54
- }, we = {
55
+ }, Me = {
55
56
  key: 2,
56
57
  class: "chat-item__status-chat-container"
57
- }, Ce = {
58
+ }, Ee = {
58
59
  key: 0,
59
60
  class: "chat-item__fixed pi pi-thumbtack"
60
- }, Ie = {
61
+ }, Se = {
61
62
  key: 0,
62
63
  id: "noSelectButton",
63
64
  class: "chat-item__menu-button"
64
- }, Te = {
65
+ }, Le = {
65
66
  key: 1,
66
67
  id: "noSelectButton",
67
68
  class: "chat-item__menu-button"
68
- }, Me = {
69
+ }, be = {
69
70
  key: 0,
70
71
  class: "dialog__container"
71
- }, Ee = ["onClick"], Se = ["src"], Le = {
72
+ }, Ae = ["onClick"], Be = ["src"], Ve = {
72
73
  key: 1,
73
74
  class: "dialog__icon pi pi-user"
74
- }, be = { class: "dialog__text-container" }, Ae = { class: "dialog__name" }, Be = { class: "dialog__time" }, ln = /* @__PURE__ */ Dt({
75
+ }, De = { class: "dialog__text-container" }, He = { class: "dialog__name" }, Ne = { class: "dialog__time" }, fn = /* @__PURE__ */ Ht({
75
76
  __name: "ChatItem",
76
77
  props: {
77
78
  chat: {},
@@ -79,59 +80,64 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
79
80
  contextMenuTrigger: { default: "hover" }
80
81
  },
81
82
  emits: ["select", "action", "expand"],
82
- setup(a, { emit: lt }) {
83
- const E = Ht("chatAppId"), { getTheme: Y } = Ot(E), { isNative: $, emojiSrc: A } = qt(E), ut = zt(String(E ?? "")), n = a, S = lt, y = Nt(), p = M(!1), k = M(!1), B = M(!1), mt = M(null), dt = () => {
84
- B.value = !0;
85
- }, ht = (t) => {
86
- B.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && S("select", { chat: n.chat, dialog: null }), B.value = !1;
83
+ setup(s, { emit: ut }) {
84
+ const S = Nt("chatAppId"), { getTheme: Y } = Gt(S), { isNative: z, emojiSrc: B } = Jt(S), mt = qt(String(S ?? "")), n = s, L = ut, y = Ut(), p = E(!1), k = E(!1), V = E(!1), dt = E(null), x = l(
85
+ () => {
86
+ var t;
87
+ return (((t = n.chat.actions) == null ? void 0 : t.length) ?? 0) > 0;
88
+ }
89
+ ), ht = () => {
90
+ V.value = !0;
87
91
  }, ft = (t) => {
88
- S("select", { chat: n.chat, dialog: t });
89
- }, vt = () => n.chat.isSelected ? "chat-item__selected" : "", gt = (t) => t.isSelected ? "dialog__selected" : "", z = (t) => {
90
- n.contextMenuTrigger === "rightClick" && V(), S("action", { chat: n.chat, ...t });
91
- }, V = () => {
92
+ V.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && L("select", { chat: n.chat, dialog: null }), V.value = !1;
93
+ }, vt = (t) => {
94
+ L("select", { chat: n.chat, dialog: t });
95
+ }, gt = () => n.chat.isSelected ? "chat-item__selected" : "", yt = (t) => t.isSelected ? "dialog__selected" : "", O = (t) => {
96
+ n.contextMenuTrigger === "rightClick" && D(), L("action", { chat: n.chat, ...t });
97
+ }, D = () => {
92
98
  const t = document.getElementById("context-menu-rightclick-" + y);
93
99
  t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.display = "none"), k.value = !1;
94
- }, yt = () => {
100
+ }, pt = () => {
95
101
  document.querySelectorAll('[id^="context-menu-rightclick-"]').forEach((e) => {
96
102
  const i = e;
97
103
  i.id !== "context-menu-rightclick-" + y && (i.style.top = "0", i.style.left = "0", i.style.opacity = "0", i.style.display = "none");
98
104
  });
99
- }, pt = () => n.chat.dialogs ? [...n.chat.dialogs].sort((t, e) => Number(t["lastActivity.timestamp"]) > Number(e["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(e["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(e["lastActivity.timestamp"]), 0)) : [], _t = u(() => Yt(n.chat["lastMessage.status"])), kt = u(() => n.chat.showEmptyIndicator || n.chat.countUnread > 0), xt = u(() => n.chat.countUnread > 0 ? n.chat.countUnread > 99 ? "99+" : n.chat.countUnread : n.chat.showEmptyIndicator ? "" : void 0);
100
- let L;
101
- const _ = M(0), O = [b("component.ChatItem.typing") + ".", b("component.ChatItem.typing") + "..", b("component.ChatItem.typing") + "..."], q = (t) => {
102
- var l, s, v;
105
+ }, _t = () => n.chat.dialogs ? [...n.chat.dialogs].sort((t, e) => Number(t["lastActivity.timestamp"]) > Number(e["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(e["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(e["lastActivity.timestamp"]), 0)) : [], kt = l(() => zt(n.chat["lastMessage.status"])), xt = l(() => n.chat.showEmptyIndicator || n.chat.countUnread > 0), wt = l(() => n.chat.countUnread > 0 ? n.chat.countUnread > 99 ? "99+" : n.chat.countUnread : n.chat.showEmptyIndicator ? "" : void 0);
106
+ let b;
107
+ const _ = E(0), q = [A("component.ChatItem.typing") + ".", A("component.ChatItem.typing") + "..", A("component.ChatItem.typing") + "..."], G = (t) => {
108
+ var u, r, v;
103
109
  if (typeof t == "string")
104
110
  return t;
105
111
  if ((t == null ? void 0 : t.type) === "message.sticker")
106
112
  return "Стикер";
107
113
  if ((t == null ? void 0 : t.type) === "message.audio")
108
- return (t.isVoiceMessage || ((l = t == null ? void 0 : t.data) == null ? void 0 : l.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
114
+ return (t.isVoiceMessage || ((u = t == null ? void 0 : t.data) == null ? void 0 : u.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
109
115
  if ((t == null ? void 0 : t.type) === "message.missedCall")
110
116
  return "Пропущенный звонок";
111
- const e = (s = t == null ? void 0 : t.data) == null ? void 0 : s.text;
117
+ const e = (r = t == null ? void 0 : t.data) == null ? void 0 : r.text;
112
118
  if (e)
113
119
  return e;
114
120
  const i = (v = t == null ? void 0 : t.data) == null ? void 0 : v.filename;
115
121
  return i || "";
116
- }, wt = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, D = b("component.ChatItem.draft"), H = u(() => {
122
+ }, Ct = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, H = A("component.ChatItem.draft"), N = l(() => {
117
123
  var e;
118
- const t = ut.getChatDraft(String(E ?? ""), n.chat.chatId);
124
+ const t = mt.getChatDraft(String(S ?? ""), n.chat.chatId);
119
125
  if (!(!t || t.edit) && !(!t.listPreviewText && !t.listPreviewFile) && !(!(t.text || "").trim() && !t.file && !((e = t.files) != null && e.length)))
120
126
  return t;
121
- }), x = u(() => !!H.value), g = u(() => {
127
+ }), w = l(() => !!N.value), g = l(() => {
122
128
  var e;
123
- const t = H.value;
129
+ const t = N.value;
124
130
  return t ? t.file ? (((e = t.listPreviewFile) == null ? void 0 : e.name) || t.file.name || "").trim() : (t.listPreviewText || "").trim() : "";
125
- }), G = u(() => {
126
- const t = H.value;
131
+ }), J = l(() => {
132
+ const t = N.value;
127
133
  if (!(t != null && t.file)) return null;
128
- const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(), l = ((e == null ? void 0 : e.name) || t.file.name || "").toLowerCase();
129
- return i === "sticker" || l.endsWith(".tgs") || l.endsWith(".webp") ? X : i === "image" || i.includes("image") ? ct : i === "video" || i.includes("video") ? st : i === "audio" || i.includes("audio") ? l.includes("voice") || l.includes("голос") ? rt : at : i === "file" || l ? j : j;
130
- }), Ct = u(() => W(g.value || "", null, A.value)), J = u(() => {
131
- var e, i, l;
132
- if (n.chat.typing || x.value)
134
+ const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(), u = ((e == null ? void 0 : e.name) || t.file.name || "").toLowerCase();
135
+ return i === "sticker" || u.endsWith(".tgs") || u.endsWith(".webp") ? X : i === "image" || i.includes("image") ? ct : i === "video" || i.includes("video") ? rt : i === "audio" || i.includes("audio") ? u.includes("voice") || u.includes("голос") ? lt : st : i === "file" || u ? j : j;
136
+ }), It = l(() => $(g.value || "", null, B.value)), K = l(() => {
137
+ var e, i, u;
138
+ if (n.chat.typing || w.value)
133
139
  return null;
134
- const t = wt(n.chat.lastMessage);
140
+ const t = Ct(n.chat.lastMessage);
135
141
  if (!t)
136
142
  return null;
137
143
  if (t === "message.sticker")
@@ -139,226 +145,230 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
139
145
  if (t === "message.image")
140
146
  return ct;
141
147
  if (t === "message.video")
142
- return st;
148
+ return rt;
143
149
  if (t === "message.audio") {
144
- const s = n.chat.lastMessage;
145
- return (s.isVoiceMessage || ((e = s == null ? void 0 : s.data) == null ? void 0 : e.isVoiceMessage)) === !0 ? rt : at;
150
+ const r = n.chat.lastMessage;
151
+ return (r.isVoiceMessage || ((e = r == null ? void 0 : r.data) == null ? void 0 : e.isVoiceMessage)) === !0 ? lt : st;
146
152
  }
147
153
  if (t === "message.missedCall")
148
- return ie;
154
+ return se;
149
155
  if (t === "message.file") {
150
- const s = n.chat.lastMessage, v = ((l = (i = s == null ? void 0 : s.data) == null ? void 0 : i.filename) == null ? void 0 : l.toLowerCase()) || "";
156
+ const r = n.chat.lastMessage, v = ((u = (i = r == null ? void 0 : r.data) == null ? void 0 : i.filename) == null ? void 0 : u.toLowerCase()) || "";
151
157
  return v.endsWith(".tgs") || v.endsWith(".webp") ? X : j;
152
158
  }
153
159
  return null;
154
- }), It = u(() => n.chat.typing ? O[_.value] : x.value ? g.value ? `${D} ${g.value}` : D : q(n.chat.lastMessage)), N = u(() => n.chat.typing ? O[_.value] : q(n.chat.lastMessage)), K = u(
155
- () => !$.value && it(g.value || N.value || "")
156
- ), Tt = u(
157
- () => !$.value && it(n.chat.name || "")
158
- ), Mt = u(() => W(N.value || "", null, A.value)), Et = u(() => W(n.chat.name || "", null, A.value));
159
- Ut(
160
+ }), Tt = l(() => n.chat.typing ? q[_.value] : w.value ? g.value ? `${H} ${g.value}` : H : G(n.chat.lastMessage)), U = l(() => n.chat.typing ? q[_.value] : G(n.chat.lastMessage)), Q = l(
161
+ () => !z.value && ot(g.value || U.value || "")
162
+ ), Mt = l(
163
+ () => !z.value && ot(n.chat.name || "")
164
+ ), Et = l(() => $(U.value || "", null, B.value)), St = l(() => $(n.chat.name || "", null, B.value));
165
+ Ft(
160
166
  () => n.chat.typing,
161
167
  () => {
162
- n.chat.typing ? L = setInterval(() => {
168
+ n.chat.typing ? b = setInterval(() => {
163
169
  _.value < 2 ? _.value += 1 : _.value = 0;
164
- }, 1e3) : (_.value = 0, L && (clearInterval(L), L = void 0));
170
+ }, 1e3) : (_.value = 0, b && (clearInterval(b), b = void 0));
165
171
  },
166
172
  { immediate: !0 }
167
173
  );
168
- const St = () => {
169
- n.contextMenuTrigger === "hover" && (p.value = !0);
170
- }, Lt = (t) => {
171
- n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
174
+ const Lt = () => {
175
+ n.contextMenuTrigger === "hover" && x.value && (p.value = !0);
172
176
  }, bt = (t) => {
173
- n.contextMenuTrigger === "rightClick" && n.chat.actions && At(t);
177
+ n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
174
178
  }, At = (t) => {
175
- yt(), k.value = !0, U(() => {
179
+ n.contextMenuTrigger === "rightClick" && x.value && Bt(t);
180
+ }, Bt = (t) => {
181
+ pt(), k.value = !0, F(() => {
176
182
  const e = document.getElementById("context-menu-rightclick-" + y);
177
183
  if (e) {
178
- const i = t.clientX, l = t.clientY;
184
+ const i = t.clientX, u = t.clientY;
179
185
  e.style.display = "inherit";
180
- const s = e.getBoundingClientRect();
181
- e.style.display = "none", U(() => {
182
- const v = window.innerWidth, tt = window.innerHeight, w = window.scrollX || window.pageXOffset, C = window.scrollY || window.pageYOffset;
183
- let I = i + w, T = l + C;
184
- I + s.width > v + w && (I = i + w - s.width), T + s.height > tt + C && (T = l + C - s.height), I < w && (I = w), T < C && (T = C), e.style.top = T + "px", e.style.left = I + "px", e.style.opacity = "1", e.style.display = "inherit";
186
+ const r = e.getBoundingClientRect();
187
+ e.style.display = "none", F(() => {
188
+ const v = window.innerWidth, et = window.innerHeight, C = window.scrollX || window.pageXOffset, I = window.scrollY || window.pageYOffset;
189
+ let T = i + C, M = u + I;
190
+ T + r.width > v + C && (T = i + C - r.width), M + r.height > et + I && (M = u + I - r.height), T < C && (T = C), M < I && (M = I), e.style.top = M + "px", e.style.left = T + "px", e.style.opacity = "1", e.style.display = "inherit";
185
191
  });
186
192
  }
187
193
  });
188
- }, Bt = () => {
189
194
  }, Vt = () => {
190
- }, Q = (t) => {
195
+ }, Dt = () => {
196
+ }, Z = (t) => {
191
197
  if (n.contextMenuTrigger === "rightClick" && k.value) {
192
198
  const e = t.target, i = document.getElementById("context-menu-rightclick-" + y);
193
- (!i || !i.contains(e)) && V();
199
+ (!i || !i.contains(e)) && D();
194
200
  }
195
- }, Z = () => {
196
- n.contextMenuTrigger === "rightClick" && k.value && V();
201
+ }, tt = () => {
202
+ n.contextMenuTrigger === "rightClick" && k.value && D();
197
203
  };
198
- return Ft(() => {
199
- n.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Q), window.addEventListener("scroll", Z, !0), U(() => {
204
+ return Pt(() => {
205
+ n.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Z), window.addEventListener("scroll", tt, !0), F(() => {
200
206
  const t = document.getElementById("context-menu-rightclick-" + y);
201
207
  t && (t.style.display = "none", t.style.opacity = "0");
202
208
  }));
203
- }), Pt(() => {
204
- document.removeEventListener("click", Q), window.removeEventListener("scroll", Z, !0);
205
- }), (t, e) => (o(), c("div", null, [
209
+ }), Rt(() => {
210
+ document.removeEventListener("click", Z), window.removeEventListener("scroll", tt, !0);
211
+ }), (t, e) => (o(), a("div", null, [
206
212
  m("div", {
207
213
  ref_key: "containerRef",
208
- ref: mt,
209
- class: F(["chat-item__container", vt()]),
214
+ ref: dt,
215
+ class: P(["chat-item__container", gt()]),
210
216
  "data-testid": "chat-item",
211
217
  "data-chat-id": n.chat.chatId,
212
- onMouseenter: St,
213
- onMouseleave: Lt,
214
- onClick: ht,
215
- onContextmenu: Rt(bt, ["prevent"])
218
+ onMouseenter: Lt,
219
+ onMouseleave: bt,
220
+ onClick: ft,
221
+ onContextmenu: Wt(At, ["prevent"])
216
222
  }, [
217
- m("div", ae, [
223
+ m("div", re, [
218
224
  m("span", {
219
225
  class: "chat-item__status-user",
220
- style: et({ backgroundColor: n.chat.status })
226
+ style: nt({ backgroundColor: n.chat.status })
221
227
  }, null, 4),
222
- n.chat.avatar ? (o(), c("img", {
228
+ n.chat.avatar ? (o(), a("img", {
223
229
  key: 0,
224
230
  src: n.chat.avatar,
225
231
  height: "48",
226
232
  width: "48"
227
- }, null, 8, ce)) : (o(), c("div", se, [
228
- P(Kt)
233
+ }, null, 8, le)) : (o(), a("div", ue, [
234
+ R(Zt)
229
235
  ]))
230
236
  ]),
231
- m("div", re, [
232
- P(ot, {
233
- text: a.chat.name,
234
- position: "bottom"
235
- }, {
236
- default: R(() => [
237
- Tt.value ? (o(), c("div", {
238
- key: 0,
239
- class: "chat-item__name",
240
- innerHTML: Et.value
241
- }, null, 8, le)) : (o(), c("div", ue, f(a.chat.name), 1))
242
- ]),
243
- _: 1
244
- }, 8, ["text"]),
245
- P(ot, {
246
- text: It.value,
237
+ m("div", me, [
238
+ m("div", de, [
239
+ R(at, {
240
+ text: s.chat.name,
241
+ position: "bottom"
242
+ }, {
243
+ default: W(() => [
244
+ Mt.value ? (o(), a("div", {
245
+ key: 0,
246
+ class: "chat-item__name",
247
+ innerHTML: St.value
248
+ }, null, 8, he)) : (o(), a("div", fe, f(s.chat.name), 1))
249
+ ]),
250
+ _: 1
251
+ }, 8, ["text"]),
252
+ s.chat.verified ? (o(), d(te, { key: 0 })) : c("", !0),
253
+ $t(t.$slots, "name-suffix", {}, void 0, !0)
254
+ ]),
255
+ R(at, {
256
+ text: Tt.value,
247
257
  position: "bottom"
248
258
  }, {
249
- default: R(() => [
250
- a.chat.lastMessage || a.chat.typing || x.value ? (o(), c("div", me, [
251
- J.value && !x.value ? (o(), d(nt(J.value), {
259
+ default: W(() => [
260
+ s.chat.lastMessage || s.chat.typing || w.value ? (o(), a("div", ve, [
261
+ K.value && !w.value ? (o(), d(it(K.value), {
252
262
  key: 0,
253
263
  class: "chat-item__message-icon"
254
- })) : r("", !0),
255
- x.value ? (o(), c("span", de, [
256
- m("span", he, f(h(D)), 1),
257
- G.value ? (o(), d(nt(G.value), {
264
+ })) : c("", !0),
265
+ w.value ? (o(), a("span", ge, [
266
+ m("span", ye, f(h(H)), 1),
267
+ J.value ? (o(), d(it(J.value), {
258
268
  key: 0,
259
269
  class: "chat-item__message-icon"
260
- })) : r("", !0),
261
- g.value && K.value ? (o(), c("span", {
270
+ })) : c("", !0),
271
+ g.value && Q.value ? (o(), a("span", {
262
272
  key: 1,
263
273
  class: "chat-item__draft-text",
264
- innerHTML: Ct.value
265
- }, null, 8, fe)) : g.value ? (o(), c("span", ve, f(g.value), 1)) : r("", !0)
266
- ])) : K.value ? (o(), c("span", {
274
+ innerHTML: It.value
275
+ }, null, 8, pe)) : g.value ? (o(), a("span", _e, f(g.value), 1)) : c("", !0)
276
+ ])) : Q.value ? (o(), a("span", {
267
277
  key: 2,
268
278
  class: "chat-item__last-message-text",
269
- innerHTML: Mt.value
270
- }, null, 8, ge)) : (o(), c("span", ye, f(N.value), 1))
271
- ])) : r("", !0)
279
+ innerHTML: Et.value
280
+ }, null, 8, ke)) : (o(), a("span", xe, f(U.value), 1))
281
+ ])) : c("", !0)
272
282
  ]),
273
283
  _: 1
274
284
  }, 8, ["text"])
275
285
  ]),
276
- m("div", pe, [
277
- a.chat["lastActivity.time"] && (!a.chat.actions || !p.value) ? (o(), c("div", _e, f(a.chat["lastActivity.time"]), 1)) : r("", !0),
278
- p.value && a.chat.actions && a.contextMenuTrigger === "hover" ? (o(), d(Gt, {
286
+ m("div", we, [
287
+ s.chat["lastActivity.time"] && (!x.value || !p.value) ? (o(), a("div", Ce, f(s.chat["lastActivity.time"]), 1)) : c("", !0),
288
+ p.value && x.value && s.contextMenuTrigger === "hover" ? (o(), d(Kt, {
279
289
  key: 1,
280
290
  mode: "click",
281
291
  "menu-side": "bottom-right",
282
- actions: a.chat.actions,
283
- onClick: z,
284
- onButtonClick: dt,
292
+ actions: s.chat.actions,
293
+ onClick: O,
294
+ onButtonClick: ht,
285
295
  onMenuMouseLeave: e[0] || (e[0] = (i) => p.value = !1)
286
296
  }, {
287
- default: R(() => [...e[2] || (e[2] = [
297
+ default: W(() => [...e[2] || (e[2] = [
288
298
  m("span", { class: "pi pi-ellipsis-h chat-item__actions-trigger" }, null, -1)
289
299
  ])]),
290
300
  _: 1
291
- }, 8, ["actions"])) : r("", !0),
292
- (o(), d(Wt, { to: "body" }, [
293
- a.contextMenuTrigger === "rightClick" && a.chat.actions && k.value ? (o(), d(Jt, {
301
+ }, 8, ["actions"])) : c("", !0),
302
+ (o(), d(jt, { to: "body" }, [
303
+ s.contextMenuTrigger === "rightClick" && x.value && k.value ? (o(), d(Qt, {
294
304
  key: 0,
295
305
  id: "context-menu-rightclick-" + h(y),
296
- actions: a.chat.actions,
306
+ actions: s.chat.actions,
297
307
  "data-theme": h(Y)().theme ? h(Y)().theme : "light",
298
- onClick: z,
299
- onMouseenter: Bt,
300
- onMouseleave: Vt
301
- }, null, 8, ["id", "actions", "data-theme"])) : r("", !0)
308
+ onClick: O,
309
+ onMouseenter: Vt,
310
+ onMouseleave: Dt
311
+ }, null, 8, ["id", "actions", "data-theme"])) : c("", !0)
302
312
  ])),
303
- m("div", ke, [
304
- h($t).includes(a.chat["lastMessage.status"]) ? (o(), c("div", {
313
+ m("div", Ie, [
314
+ h(Ot).includes(s.chat["lastMessage.status"]) ? (o(), a("div", {
305
315
  key: 0,
306
- class: F(["chat-item__status-message", _t.value])
316
+ class: P(["chat-item__status-message", kt.value])
307
317
  }, [
308
- a.chat["lastMessage.status"] === "pending" ? (o(), d(h(Zt), { key: 0 })) : a.chat["lastMessage.status"] === "error" ? (o(), d(h(Qt), { key: 1 })) : a.chat["lastMessage.status"] === "read" ? (o(), d(h(te), { key: 2 })) : a.chat["lastMessage.status"] === "received" ? (o(), d(h(ee), { key: 3 })) : (o(), d(h(ne), { key: 4 }))
309
- ], 2)) : r("", !0),
310
- kt.value ? (o(), c("div", xe, f(xt.value), 1)) : r("", !0)
318
+ s.chat["lastMessage.status"] === "pending" ? (o(), d(h(ne), { key: 0 })) : s.chat["lastMessage.status"] === "error" ? (o(), d(h(ee), { key: 1 })) : s.chat["lastMessage.status"] === "read" ? (o(), d(h(ie), { key: 2 })) : s.chat["lastMessage.status"] === "received" ? (o(), d(h(oe), { key: 3 })) : (o(), d(h(ae), { key: 4 }))
319
+ ], 2)) : c("", !0),
320
+ xt.value ? (o(), a("div", Te, f(wt.value), 1)) : c("", !0)
311
321
  ]),
312
- a.chat.countUnread < 1 ? (o(), c("div", we, [
313
- a.chat.isFixedTop || a.chat.isFixedBottom ? (o(), c("span", Ce)) : r("", !0)
314
- ])) : r("", !0)
322
+ s.chat.countUnread < 1 ? (o(), a("div", Me, [
323
+ s.chat.isFixedTop || s.chat.isFixedBottom ? (o(), a("span", Ee)) : c("", !0)
324
+ ])) : c("", !0)
315
325
  ]),
316
- n.showDialogs && a.chat.dialogs ? (o(), c("div", {
326
+ n.showDialogs && s.chat.dialogs ? (o(), a("div", {
317
327
  key: 0,
318
328
  class: "chat-item__dialog-buttons",
319
- onClick: e[1] || (e[1] = (i) => S("expand", n.chat))
329
+ onClick: e[1] || (e[1] = (i) => L("expand", n.chat))
320
330
  }, [
321
- n.showDialogs && !a.chat.dialogsExpanded ? (o(), c("button", Ie, [...e[3] || (e[3] = [
331
+ n.showDialogs && !s.chat.dialogsExpanded ? (o(), a("button", Se, [...e[3] || (e[3] = [
322
332
  m("span", {
323
333
  id: "noSelectButton",
324
334
  class: "pi pi-angle-down"
325
335
  }, null, -1)
326
- ])])) : r("", !0),
327
- n.showDialogs && a.chat.dialogsExpanded ? (o(), c("button", Te, [...e[4] || (e[4] = [
336
+ ])])) : c("", !0),
337
+ n.showDialogs && s.chat.dialogsExpanded ? (o(), a("button", Le, [...e[4] || (e[4] = [
328
338
  m("span", {
329
339
  id: "noSelectButton",
330
340
  class: "pi pi-angle-up"
331
341
  }, null, -1)
332
- ])])) : r("", !0)
333
- ])) : r("", !0)
334
- ], 42, oe),
335
- n.showDialogs && a.chat.dialogsExpanded ? (o(), c("div", Me, [
336
- (o(!0), c(jt, null, Xt(pt(), (i) => (o(), c("div", {
342
+ ])])) : c("", !0)
343
+ ])) : c("", !0)
344
+ ], 42, ce),
345
+ n.showDialogs && s.chat.dialogsExpanded ? (o(), a("div", be, [
346
+ (o(!0), a(Xt, null, Yt(_t(), (i) => (o(), a("div", {
337
347
  key: i.dialogId,
338
- class: F(["dialog__item", gt(i)]),
339
- onClick: (l) => ft(i)
348
+ class: P(["dialog__item", yt(i)]),
349
+ onClick: (u) => vt(i)
340
350
  }, [
341
- i.icon ? (o(), c("img", {
351
+ i.icon ? (o(), a("img", {
342
352
  key: 0,
343
353
  class: "dialog__icon",
344
354
  src: i.icon,
345
355
  height: "16",
346
356
  width: "16"
347
- }, null, 8, Se)) : (o(), c("span", Le)),
348
- m("div", be, [
349
- m("div", Ae, f(i.name), 1),
350
- m("div", Be, f(i["lastActivity.time"]), 1)
357
+ }, null, 8, Be)) : (o(), a("span", Ve)),
358
+ m("div", De, [
359
+ m("div", He, f(i.name), 1),
360
+ m("div", Ne, f(i["lastActivity.time"]), 1)
351
361
  ]),
352
- i.countUnread > 0 ? (o(), c("div", {
362
+ i.countUnread > 0 ? (o(), a("div", {
353
363
  key: 2,
354
364
  class: "chat-item__unread",
355
- style: et(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
356
- }, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : r("", !0)
357
- ], 10, Ee))), 128))
358
- ])) : r("", !0)
365
+ style: nt(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
366
+ }, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : c("", !0)
367
+ ], 10, Ae))), 128))
368
+ ])) : c("", !0)
359
369
  ]));
360
370
  }
361
371
  });
362
372
  export {
363
- ln as default
373
+ fn as default
364
374
  };