@mobilon-dev/chotto 0.3.41 → 0.3.43

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 (47) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +2 -2
  3. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +60 -52
  4. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
  5. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +99 -89
  6. package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +7 -0
  7. package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +64 -0
  8. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +7 -0
  9. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +109 -0
  10. package/dist/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.js +34 -0
  11. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
  12. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +74 -64
  13. package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +43 -10
  14. package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +19 -0
  15. package/dist/components/3_compounds/Feed/Feed.vue.js +1 -1
  16. package/dist/components/3_compounds/Feed/Feed.vue2.js +134 -127
  17. package/dist/components/3_compounds/Feed/composables/useFeedComponents.js +10 -8
  18. package/dist/index.js +147 -145
  19. package/dist/locale/en.js +2 -1
  20. package/dist/locale/ru.js +2 -1
  21. package/dist/themes/dark.css +1 -1
  22. package/dist/themes/default.css +1 -1
  23. package/dist/themes/glass.css +1 -1
  24. package/dist/themes/green.css +1 -1
  25. package/dist/themes/mobilon1.css +1 -1
  26. package/dist/types/apps/data/messages.d.ts +166 -7
  27. package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +9 -0
  28. package/dist/types/components/1_atoms/Tooltip/styles/types.d.ts +2 -0
  29. package/dist/types/components/2_feed_elements/FileMessage/FileMessage.vue.d.ts +2 -0
  30. package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +2 -0
  31. package/dist/types/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.d.ts +11 -0
  32. package/dist/types/components/2_feed_elements/MessageSmsInvite/styles/types.d.ts +49 -0
  33. package/dist/types/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.d.ts +40 -0
  34. package/dist/types/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.d.ts +2 -0
  35. package/dist/types/components/2_feed_elements/MissedCallMessage/stories/MissedCallMessage.stories.d.ts +12 -0
  36. package/dist/types/components/2_feed_elements/TextMessage/TextMessage.vue.d.ts +2 -0
  37. package/dist/types/components/2_feed_elements/types/messages.d.ts +22 -0
  38. package/dist/types/components/3_compounds/ChatList/ChatListHeader.vue.d.ts +6 -0
  39. package/dist/types/components/3_compounds/ChatList/icons/LogoIcon.vue.d.ts +2 -0
  40. package/dist/types/components/3_compounds/ChatList/styles/types.d.ts +44 -0
  41. package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +4 -2
  42. package/dist/types/components/index.d.ts +1 -0
  43. package/dist/types/hooks/validators/messages/types.d.ts +1 -0
  44. package/dist/types/locale/en.d.ts +1 -0
  45. package/dist/types/locale/ru.d.ts +1 -0
  46. package/dist/types/main.d.ts +3 -0
  47. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import o from "./Tooltip.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-16a60fe9"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d13721a4"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as S, inject as k, ref as s, computed as N, createElementBlock as w, openBlock as h, Fragment as A, createElementVNode as D, createBlock as R, renderSlot as V, Teleport as E, createVNode as I, Transition as L, withCtx as M, createCommentVNode as $, normalizeClass as j, unref as u, toDisplayString as q, nextTick as m } from "vue";
1
+ import { defineComponent as k, inject as N, ref as c, computed as A, onUnmounted as D, createElementBlock as d, openBlock as m, Fragment as R, createElementVNode as V, createBlock as E, renderSlot as I, Teleport as L, createVNode as M, Transition as $, withCtx as j, createCommentVNode as q, normalizeClass as z, unref as v, toDisplayString as F, nextTick as g } from "vue";
2
2
  import "../../../hooks/useMessageDraft.js";
3
3
  import "../../../hooks/useSearchModel.js";
4
- import { useTheme as z } from "../../../hooks/useTheme.js";
4
+ import { useTheme as P } from "../../../hooks/useTheme.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import "../../../node_modules/linkifyjs/dist/linkify.js";
8
8
  import "../../../functions/parseMarkdown.js";
9
- const F = ["data-theme"], W = /* @__PURE__ */ S({
9
+ const U = ["data-theme"], Y = /* @__PURE__ */ k({
10
10
  __name: "Tooltip",
11
11
  props: {
12
12
  text: {
@@ -28,71 +28,79 @@ const F = ["data-theme"], W = /* @__PURE__ */ S({
28
28
  autoShowDuration: {
29
29
  type: Number,
30
30
  default: 0
31
+ },
32
+ delay: {
33
+ type: Number,
34
+ default: 600
31
35
  }
32
36
  },
33
- setup(g, { expose: T }) {
34
- const d = k("chatAppId"), { getTheme: v } = z(d), p = s(), r = s(), a = s(!1), n = s(null), e = g, x = N(() => ({
37
+ setup(y, { expose: w }) {
38
+ const x = N("chatAppId"), { getTheme: T } = P(x), p = c(), a = c(), n = c(!1), s = c(null), f = c(null), e = y, _ = A(() => ({
35
39
  tooltip__text: !0,
36
40
  [`tooltip--${e.position}`]: !0
37
- })), _ = () => {
38
- e.trigger !== "auto" && (a.value = !0, m(() => {
39
- if (p.value && r.value) {
40
- const l = r.value, t = p.value.getBoundingClientRect(), o = r.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, f = o.top < 0 ? o.top : 0, c = {
41
- left: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
42
- right: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
43
- bottom: { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) - i },
44
- top: { top: t.top - o.height - e.offset - f, left: (t == null ? void 0 : t.left) - i },
45
- "bottom-left": { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
46
- };
47
- l.style.top = c[e.position].top + "px", l.style.left = c[e.position].left + "px";
48
- }
49
- }));
50
- }, B = () => {
51
- e.trigger !== "auto" && (a.value = !1, m(() => {
52
- const l = u(r);
41
+ })), B = () => {
42
+ e.trigger !== "auto" && (f.value && (clearTimeout(f.value), f.value = null), f.value = setTimeout(() => {
43
+ n.value = !0, g(() => {
44
+ if (p.value && a.value) {
45
+ const l = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, r = o.top < 0 ? o.top : 0, u = {
46
+ left: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
47
+ right: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
48
+ bottom: { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) - i },
49
+ top: { top: t.top - o.height - e.offset - r, left: (t == null ? void 0 : t.left) - i },
50
+ "bottom-left": { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
51
+ };
52
+ l.style.top = u[e.position].top + "px", l.style.left = u[e.position].left + "px";
53
+ }
54
+ }), f.value = null;
55
+ }, e.delay));
56
+ }, C = () => {
57
+ e.trigger !== "auto" && (f.value && (clearTimeout(f.value), f.value = null), n.value = !1, g(() => {
58
+ const l = v(a);
53
59
  l && (l.style.top = "0", l.style.left = "0");
54
60
  }));
55
- }, C = () => {
56
- y(), a.value = !0, m(() => {
57
- if (p.value && r.value) {
58
- const l = r.value, t = p.value.getBoundingClientRect(), o = r.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, f = o.top < 0 ? o.top : 0, c = {
59
- left: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
60
- right: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
61
- bottom: { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) - i },
62
- top: { top: t.top - o.height - e.offset - f, left: (t == null ? void 0 : t.left) - i },
63
- "bottom-left": { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
61
+ }, S = () => {
62
+ h(), n.value = !0, g(() => {
63
+ if (p.value && a.value) {
64
+ const l = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, r = o.top < 0 ? o.top : 0, u = {
65
+ left: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
66
+ right: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
67
+ bottom: { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) - i },
68
+ top: { top: t.top - o.height - e.offset - r, left: (t == null ? void 0 : t.left) - i },
69
+ "bottom-left": { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
64
70
  };
65
- l.style.top = c[e.position].top + "px", l.style.left = c[e.position].left + "px";
71
+ l.style.top = u[e.position].top + "px", l.style.left = u[e.position].left + "px";
66
72
  }
67
- }), e.autoShowDuration > 0 && (n.value = setTimeout(() => {
68
- a.value = !1;
73
+ }), e.autoShowDuration > 0 && (s.value = setTimeout(() => {
74
+ n.value = !1;
69
75
  }, e.autoShowDuration));
70
- }, y = () => {
71
- n.value && (clearTimeout(n.value), n.value = null);
76
+ }, h = () => {
77
+ s.value && (clearTimeout(s.value), s.value = null);
72
78
  };
73
- return T({
74
- startAutoShow: C,
75
- clearAutoTimer: y
76
- }), (l, t) => (h(), w(A, null, [
77
- D("div", {
79
+ return D(() => {
80
+ f.value && clearTimeout(f.value), h();
81
+ }), w({
82
+ startAutoShow: S,
83
+ clearAutoTimer: h
84
+ }), (l, t) => (m(), d(R, null, [
85
+ V("div", {
78
86
  ref_key: "container",
79
87
  ref: p,
80
88
  class: "tooltip-wrapper",
81
- onMouseover: _,
82
- onMouseout: B
89
+ onMouseover: B,
90
+ onMouseout: C
83
91
  }, [
84
- V(l.$slots, "default", {}, void 0, !0)
92
+ I(l.$slots, "default", {}, void 0, !0)
85
93
  ], 544),
86
- (h(), R(E, { to: "body" }, [
87
- I(L, null, {
88
- default: M(() => [
89
- a.value ? (h(), w("span", {
94
+ (m(), E(L, { to: "body" }, [
95
+ M($, null, {
96
+ default: j(() => [
97
+ n.value ? (m(), d("span", {
90
98
  key: 0,
91
99
  ref_key: "tooltip",
92
- ref: r,
93
- "data-theme": u(v)().theme ? u(v)().theme : "light",
94
- class: j(x.value)
95
- }, q(g.text), 11, F)) : $("", !0)
100
+ ref: a,
101
+ "data-theme": v(T)().theme ? v(T)().theme : "light",
102
+ class: z(_.value)
103
+ }, F(y.text), 11, U)) : q("", !0)
96
104
  ]),
97
105
  _: 1
98
106
  })
@@ -101,5 +109,5 @@ const F = ["data-theme"], W = /* @__PURE__ */ S({
101
109
  }
102
110
  });
103
111
  export {
104
- W as default
112
+ Y as default
105
113
  };
@@ -1,7 +1,7 @@
1
- import a from "./FileMessage.vue2.js";
1
+ import o from "./FileMessage.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ o(a, [["__scopeId", "data-v-aad85a6d"]]);
3
+ import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ a(o, [["__scopeId", "data-v-2f66aab8"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,26 +1,27 @@
1
- import { defineComponent as p, computed as y, createElementBlock as r, openBlock as o, unref as t, normalizeStyle as k, normalizeClass as u, createCommentVNode as l, createElementVNode as n, createVNode as d, withCtx as S, createTextVNode as D, toDisplayString as f, createBlock as b, withModifiers as q, Transition as z } from "vue";
2
- import W from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
- import G from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
- import J from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
5
- import K from "../BaseReplyMessage/BaseReplyMessage.vue.js";
6
- import Q from "../MessageReactions/MessageReactions.vue.js";
7
- import X from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
8
- import Y from "../../1_atoms/Tooltip/Tooltip.vue.js";
9
- import { useMessageActions as Z } from "../../../hooks/messages/useMessageActions.js";
10
- import { useMessageLinks as _ } from "../../../hooks/messages/useMessageLinks.js";
11
- import { useChannelAccentColor as ee } from "../../../hooks/messages/useChannelAccentColor.js";
12
- import { useSubtextTooltip as se } from "../../../hooks/messages/useSubtextTooltip.js";
13
- import { getStatus as te, getStatusTitle as ie } from "../../../functions/getStatusMessage.js";
14
- import { getMessageClass as ae } from "../../../functions/getMessageClass.js";
15
- import { createReactionHandlers as ne } from "../../../functions/createReactionHandlers.js";
1
+ import { defineComponent as z, computed as y, createElementBlock as r, openBlock as o, unref as s, normalizeStyle as k, normalizeClass as u, createCommentVNode as l, createElementVNode as n, createVNode as d, withCtx as T, createTextVNode as p, toDisplayString as f, createBlock as b, withModifiers as W, Transition as G } from "vue";
2
+ import J from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
+ import K from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
+ import Q from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
5
+ import X from "../BaseReplyMessage/BaseReplyMessage.vue.js";
6
+ import Y from "../MessageReactions/MessageReactions.vue.js";
7
+ import Z from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
8
+ import _ from "../MessageSmsInvite/MessageSmsInvite.vue.js";
9
+ import ee from "../../1_atoms/Tooltip/Tooltip.vue.js";
10
+ import { useMessageActions as se } from "../../../hooks/messages/useMessageActions.js";
11
+ import { useMessageLinks as te } from "../../../hooks/messages/useMessageLinks.js";
12
+ import { useChannelAccentColor as ae } from "../../../hooks/messages/useChannelAccentColor.js";
13
+ import { useSubtextTooltip as ie } from "../../../hooks/messages/useSubtextTooltip.js";
14
+ import { getStatus as ne, getStatusTitle as oe } from "../../../functions/getStatusMessage.js";
15
+ import { getMessageClass as le } from "../../../functions/getMessageClass.js";
16
+ import { createReactionHandlers as me } from "../../../functions/createReactionHandlers.js";
16
17
  import "../../../functions/parseMarkdown.js";
17
- const oe = ["messageId"], le = ["src"], me = {
18
+ const re = ["messageId"], ge = ["src"], ce = {
18
19
  key: 1,
19
20
  class: "file-message__subtext"
20
- }, re = ["href"], ge = { class: "file-message__filename-text" }, ce = {
21
+ }, ue = ["href"], de = { class: "file-message__filename-text" }, fe = {
21
22
  key: 1,
22
23
  class: "file-message__text-container"
23
- }, ue = ["innerHTML"], de = { class: "file-message__info-container" }, fe = { class: "file-message__time" }, Ae = /* @__PURE__ */ p({
24
+ }, be = ["innerHTML"], we = { class: "file-message__info-container" }, ve = { class: "file-message__time" }, Ve = /* @__PURE__ */ z({
24
25
  __name: "FileMessage",
25
26
  props: {
26
27
  message: {
@@ -45,50 +46,53 @@ const oe = ["messageId"], le = ["src"], me = {
45
46
  default: () => ({})
46
47
  }
47
48
  },
48
- emits: ["action", "reply"],
49
+ emits: ["action", "reply", "sms-invite"],
49
50
  setup(e, { emit: I }) {
50
- const i = e, v = I, { linkedHtml: L, inNewWindow: R } = _(() => i.message.text), {
51
- isOpenMenu: w,
52
- buttonMenuVisible: E,
53
- showMenu: h,
54
- hideMenu: x,
55
- clickAction: F,
56
- viewsAction: C,
57
- handleClickReplied: A
58
- } = Z(i.message, v), B = y(() => te(i.message.status)), O = y(() => ie(i.message.status, i.message.statusMsg)), { bubbleStyle: U } = ee(
59
- y(() => i.message),
51
+ const a = e, w = I, { linkedHtml: L, inNewWindow: h } = te(() => a.message.text), {
52
+ isOpenMenu: v,
53
+ buttonMenuVisible: A,
54
+ showMenu: R,
55
+ hideMenu: C,
56
+ clickAction: E,
57
+ viewsAction: x,
58
+ handleClickReplied: F
59
+ } = se(a.message, w), B = y(() => ne(a.message.status)), O = y(() => oe(a.message.status, a.message.statusMsg)), { bubbleStyle: U, messageChannelId: V } = ae(
60
+ y(() => a.message),
60
61
  { cssVariable: "--chotto-filemessage-right-bg", position: "right" }
61
62
  );
62
- function T(m) {
63
- return ae(m.position, "file-message");
63
+ function S(m) {
64
+ return le(m.position, "file-message");
64
65
  }
65
- const { onToggleReaction: V, onAddReaction: H, onRemoveReaction: N } = ne(v), P = async () => {
66
- if (i.message.url)
66
+ const { onToggleReaction: H, onAddReaction: N, onRemoveReaction: P } = me(w), $ = async () => {
67
+ if (a.message.url)
67
68
  try {
68
- const m = new URL(i.message.url, window.location.href);
69
+ const m = new URL(a.message.url, window.location.href);
69
70
  if (m.origin === window.location.origin) {
70
71
  const c = document.createElement("a");
71
- c.href = m.toString(), c.download = i.message.filename || `file-${i.message.messageId}`, document.body.appendChild(c), c.click(), document.body.removeChild(c);
72
+ c.href = m.toString(), c.download = a.message.filename || `file-${a.message.messageId}`, document.body.appendChild(c), c.click(), document.body.removeChild(c);
72
73
  return;
73
74
  }
74
- const a = await fetch(i.message.url);
75
- if (!a.ok)
76
- throw new Error(`HTTP error! status: ${a.status}`);
77
- const j = await a.blob(), M = window.URL.createObjectURL(j), g = document.createElement("a");
78
- g.href = M, g.download = i.message.filename || `file-${i.message.messageId}`, document.body.appendChild(g), g.click(), document.body.removeChild(g), window.URL.revokeObjectURL(M);
75
+ const i = await fetch(a.message.url);
76
+ if (!i.ok)
77
+ throw new Error(`HTTP error! status: ${i.status}`);
78
+ const q = await i.blob(), M = window.URL.createObjectURL(q), g = document.createElement("a");
79
+ g.href = M, g.download = a.message.filename || `file-${a.message.messageId}`, document.body.appendChild(g), g.click(), document.body.removeChild(g), window.URL.revokeObjectURL(M);
79
80
  } catch (m) {
80
- console.error("Ошибка при скачивании файла:", m), window.open(i.message.url, "_blank");
81
+ console.error("Ошибка при скачивании файла:", m), window.open(a.message.url, "_blank");
81
82
  }
82
- }, $ = se(() => i.message, () => i.subtextTooltipData);
83
- return (m, s) => (o(), r("div", {
83
+ }, j = ie(() => a.message, () => a.subtextTooltipData);
84
+ function D() {
85
+ w("sms-invite", a.message);
86
+ }
87
+ return (m, t) => (o(), r("div", {
84
88
  class: u(["file-message", [
85
- T(e.message),
89
+ S(e.message),
86
90
  e.applyStyle(e.message)
87
91
  ]]),
88
92
  messageId: e.message.messageId,
89
- style: k(t(U)),
90
- onMouseleave: s[4] || (s[4] = //@ts-ignore
91
- (...a) => t(x) && t(x)(...a))
93
+ style: k(s(U)),
94
+ onMouseleave: t[4] || (t[4] = //@ts-ignore
95
+ (...i) => s(C) && s(C)(...i))
92
96
  }, [
93
97
  e.message.avatar && e.isFirstInSeries ? (o(), r("img", {
94
98
  key: 0,
@@ -97,15 +101,15 @@ const oe = ["messageId"], le = ["src"], me = {
97
101
  height: "32",
98
102
  width: "32",
99
103
  style: k({ gridRow: e.message.subText ? "2" : "1" })
100
- }, null, 12, le)) : l("", !0),
101
- e.message.subText && e.isFirstInSeries ? (o(), r("p", me, [
102
- d(Y, {
103
- text: t($),
104
+ }, null, 12, ge)) : l("", !0),
105
+ e.message.subText && e.isFirstInSeries ? (o(), r("p", ce, [
106
+ d(ee, {
107
+ text: s(j),
104
108
  position: e.message.position === "left" ? "right" : "left",
105
109
  offset: 8
106
110
  }, {
107
- default: S(() => [
108
- D(f(e.message.subText), 1)
111
+ default: T(() => [
112
+ p(f(e.message.subText), 1)
109
113
  ]),
110
114
  _: 1
111
115
  }, 8, ["text", "position"])
@@ -113,92 +117,98 @@ const oe = ["messageId"], le = ["src"], me = {
113
117
  n("div", {
114
118
  class: u(["file-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }]),
115
119
  style: k({ gridRow: e.message.subText ? "2" : "1" }),
116
- onMouseenter: s[3] || (s[3] = //@ts-ignore
117
- (...a) => t(h) && t(h)(...a))
120
+ onMouseenter: t[3] || (t[3] = //@ts-ignore
121
+ (...i) => s(R) && s(R)(...i))
118
122
  }, [
119
- e.message.reply ? (o(), b(K, {
123
+ e.message.reply ? (o(), b(X, {
120
124
  key: 0,
121
125
  message: e.message.reply,
122
126
  class: u(e.message.position),
123
- onReply: t(A)
127
+ onReply: s(F)
124
128
  }, null, 8, ["message", "class", "onReply"])) : l("", !0),
125
129
  n("a", {
126
130
  class: "file-message__link",
127
131
  href: e.message.url,
128
- onClick: q(P, ["prevent"])
132
+ onClick: W($, ["prevent"])
129
133
  }, [
130
- s[5] || (s[5] = n("span", { class: "pi pi-file" }, null, -1)),
131
- n("p", ge, f(e.message.filename), 1),
132
- s[6] || (s[6] = n("div", { class: "file-message__download-button" }, [
134
+ t[5] || (t[5] = n("span", { class: "pi pi-file" }, null, -1)),
135
+ n("p", de, f(e.message.filename), 1),
136
+ t[6] || (t[6] = n("div", { class: "file-message__download-button" }, [
133
137
  n("span", { class: "pi pi-download" })
134
138
  ], -1))
135
- ], 8, re),
136
- e.message.text ? (o(), r("div", ce, [
139
+ ], 8, ue),
140
+ e.message.text ? (o(), r("div", fe, [
137
141
  n("p", {
138
- onClick: s[0] || (s[0] = //@ts-ignore
139
- (...a) => t(R) && t(R)(...a)),
140
- innerHTML: t(L)
141
- }, null, 8, ue)
142
+ onClick: t[0] || (t[0] = //@ts-ignore
143
+ (...i) => s(h) && s(h)(...i)),
144
+ innerHTML: s(L)
145
+ }, null, 8, be)
142
146
  ])) : l("", !0),
143
- e.message.linkPreview ? (o(), b(G, {
147
+ e.message.linkPreview ? (o(), b(K, {
144
148
  key: 2,
145
149
  class: u(e.message.position),
146
150
  "link-preview": e.message.linkPreview
147
151
  }, null, 8, ["class", "link-preview"])) : l("", !0),
148
- e.message.embed ? (o(), b(J, {
152
+ e.message.embed ? (o(), b(Q, {
149
153
  key: 3,
150
154
  class: u(e.message.position),
151
155
  embed: e.message.embed
152
156
  }, null, 8, ["class", "embed"])) : l("", !0),
153
- d(Q, {
157
+ d(Y, {
154
158
  reactions: e.message.reactions,
155
159
  "message-id": e.message.messageId,
156
160
  enabled: e.reactionsEnabled,
157
- onToggleReaction: t(V),
158
- onAddReaction: t(H),
159
- onRemoveReaction: t(N)
161
+ onToggleReaction: s(H),
162
+ onAddReaction: s(N),
163
+ onRemoveReaction: s(P)
160
164
  }, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"]),
161
- n("div", de, [
165
+ n("div", we, [
162
166
  e.message.views ? (o(), r("div", {
163
167
  key: 0,
164
168
  class: "file-message__views",
165
- onClick: s[1] || (s[1] = //@ts-ignore
166
- (...a) => t(C) && t(C)(...a))
169
+ onClick: t[1] || (t[1] = //@ts-ignore
170
+ (...i) => s(x) && s(x)(...i))
167
171
  }, [
168
- s[7] || (s[7] = n("span", { class: "pi pi-eye" }, null, -1)),
172
+ t[7] || (t[7] = n("span", { class: "pi pi-eye" }, null, -1)),
169
173
  n("p", null, f(e.message.views), 1)
170
174
  ])) : l("", !0),
171
- n("span", fe, f(e.message.time), 1),
172
- d(X, {
175
+ n("span", ve, f(e.message.time), 1),
176
+ d(Z, {
173
177
  "base-class": "file-message",
174
- "message-class": T(e.message),
178
+ "message-class": S(e.message),
175
179
  "message-status": e.message.status,
176
180
  "status-class": B.value,
177
181
  "status-title": O.value
178
182
  }, null, 8, ["message-class", "message-status", "status-class", "status-title"])
179
183
  ]),
180
- t(E) && e.message.actions ? (o(), r("button", {
184
+ d(_, {
185
+ status: e.message.status,
186
+ "has-messenger-account": e.message.hasMessengerAccount,
187
+ channel: s(V),
188
+ onSmsInvite: D
189
+ }, null, 8, ["status", "has-messenger-account", "channel"]),
190
+ s(A) && e.message.actions ? (o(), r("button", {
181
191
  key: 4,
182
192
  class: "file-message__menu-button",
183
- onClick: s[2] || (s[2] = (a) => w.value = !t(w))
184
- }, [...s[8] || (s[8] = [
193
+ onClick: t[2] || (t[2] = (i) => v.value = !s(v))
194
+ }, [...t[8] || (t[8] = [
185
195
  n("span", { class: "pi pi-ellipsis-h" }, null, -1)
186
196
  ])])) : l("", !0),
187
- d(z, null, {
188
- default: S(() => [
189
- t(w) && e.message.actions ? (o(), b(W, {
197
+ d(G, null, {
198
+ default: T(() => [
199
+ s(v) && e.message.actions ? (o(), b(J, {
190
200
  key: 0,
191
201
  class: "file-message__context-menu",
192
202
  actions: e.message.actions,
193
- onClick: t(F)
203
+ onClick: s(E)
194
204
  }, null, 8, ["actions", "onClick"])) : l("", !0)
195
205
  ]),
196
206
  _: 1
197
207
  })
198
208
  ], 38)
199
- ], 46, oe));
209
+ ], 46, re));
200
210
  }
201
211
  });
202
212
  export {
203
- Ae as default
213
+ Ve as default
204
214
  };
@@ -0,0 +1,7 @@
1
+ import o from "./MessageSmsInvite.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-97de4533"]]);
5
+ export {
6
+ r as default
7
+ };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as _, inject as m, computed as p, createElementBlock as b, createCommentVNode as C, openBlock as M, createElementVNode as k, toDisplayString as D, unref as A } from "vue";
2
+ import { useLocale as T } from "../../../locale/useLocale.js";
3
+ import { useMessageDraft as $ } from "../../../hooks/useMessageDraft.js";
4
+ import "../../../hooks/useSearchModel.js";
5
+ import "../../../hooks/useTheme.js";
6
+ /* empty css */
7
+ /* empty css */
8
+ import "../../../node_modules/linkifyjs/dist/linkify.js";
9
+ import "../../../functions/parseMarkdown.js";
10
+ const I = ["data-channel-type"], j = { class: "message-sms-invite__text" }, F = /* @__PURE__ */ _({
11
+ __name: "MessageSmsInvite",
12
+ props: {
13
+ status: {},
14
+ hasMessengerAccount: { type: Boolean },
15
+ channel: {}
16
+ },
17
+ emits: ["sms-invite"],
18
+ setup(h, { emit: f }) {
19
+ const i = h, d = f, { t: v } = T(), g = m("chatAppId"), c = m("selectedChat"), { setMessageText: r } = $(g || ""), x = p(() => i.status === "error" && i.hasMessengerAccount === !1), s = p(() => {
20
+ var a;
21
+ const n = ((a = i.channel) == null ? void 0 : a.toLowerCase()) ?? "";
22
+ return n.includes("whatsapp") || n.includes("waba") ? "whatsapp" : n.includes("max") ? "max" : "telegram";
23
+ }), u = p(() => {
24
+ const n = c && c.value ? c.value : null;
25
+ if (!n || !n.contact || !n.contact.attributes) return null;
26
+ const a = n.contact.attributes, l = (e) => {
27
+ if (!e) return null;
28
+ if (typeof e == "string")
29
+ return e.startsWith("+") ? e : `+${e}`;
30
+ if (typeof e == "object") {
31
+ const t = e;
32
+ if (t.phone)
33
+ return t.phone.startsWith("+") ? t.phone : `+${t.phone}`;
34
+ }
35
+ return null;
36
+ };
37
+ let o = null;
38
+ if (s.value === "whatsapp") {
39
+ const e = a.find((t) => t.type === "whatsapp" || t.type === "waba");
40
+ o = l((e == null ? void 0 : e.data) ?? (e == null ? void 0 : e.value));
41
+ } else if (s.value === "telegram") {
42
+ const e = a.find((t) => t.type === "telegram");
43
+ o = l((e == null ? void 0 : e.data) ?? (e == null ? void 0 : e.value));
44
+ } else if (s.value === "max") {
45
+ const e = a.find((t) => t.type === "max");
46
+ o = l((e == null ? void 0 : e.data) ?? (e == null ? void 0 : e.value));
47
+ }
48
+ return o ? s.value === "whatsapp" ? `Перейдите в WhatsApp https://wa.me/+${o.replace("+", "")}, чтобы продолжить общение` : s.value === "telegram" ? `Перейдите в Telegram https://t.me/+${o.replace("+", "")}, чтобы продолжить общение` : s.value === "max" ? `Перейдите в Max https://max.ru/ и найдите нас по номеру ${o}, чтобы продолжить общение` : null : null;
49
+ }), y = () => {
50
+ u.value && r && r(u.value), d("sms-invite");
51
+ };
52
+ return (n, a) => x.value ? (M(), b("div", {
53
+ key: 0,
54
+ class: "message-sms-invite",
55
+ "data-channel-type": s.value,
56
+ onClick: y
57
+ }, [
58
+ k("span", j, D(A(v)("component.TextMessage.sendSmsInvite")), 1)
59
+ ], 8, I)) : C("", !0);
60
+ }
61
+ });
62
+ export {
63
+ F as default
64
+ };
@@ -0,0 +1,7 @@
1
+ import e from "./MissedCallMessage.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ o(e, [["__scopeId", "data-v-ec21e79d"]]);
5
+ export {
6
+ r as default
7
+ };