@mobilon-dev/chotto 0.3.46 → 0.3.48

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.
@@ -1,7 +1,7 @@
1
1
  import o from "./MessageSmsInvite.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-97de4533"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dfac27a5"]]);
5
5
  export {
6
- r as default
6
+ m as default
7
7
  };
@@ -1,13 +1,6 @@
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__ */ _({
1
+ import { defineComponent as p, computed as n, createElementBlock as u, createCommentVNode as d, openBlock as h, createElementVNode as _, toDisplayString as f, unref as v } from "vue";
2
+ import { useLocale as g } from "../../../locale/useLocale.js";
3
+ const x = ["data-channel-type"], y = { class: "message-sms-invite__text" }, w = /* @__PURE__ */ p({
11
4
  __name: "MessageSmsInvite",
12
5
  props: {
13
6
  status: {},
@@ -15,50 +8,24 @@ const I = ["data-channel-type"], j = { class: "message-sms-invite__text" }, F =
15
8
  channel: {}
16
9
  },
17
10
  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");
11
+ setup(a, { emit: o }) {
12
+ const t = a, c = o, { t: i } = g(), r = n(() => t.status === "error" && t.hasMessengerAccount === !1), m = n(() => {
13
+ var s;
14
+ const e = ((s = t.channel) == null ? void 0 : s.toLowerCase()) ?? "";
15
+ return e.includes("whatsapp") || e.includes("waba") ? "whatsapp" : e.includes("max") ? "max" : "telegram";
16
+ }), l = () => {
17
+ c("sms-invite");
51
18
  };
52
- return (n, a) => x.value ? (M(), b("div", {
19
+ return (e, s) => r.value ? (h(), u("div", {
53
20
  key: 0,
54
21
  class: "message-sms-invite",
55
- "data-channel-type": s.value,
56
- onClick: y
22
+ "data-channel-type": m.value,
23
+ onClick: l
57
24
  }, [
58
- k("span", j, D(A(v)("component.TextMessage.sendSmsInvite")), 1)
59
- ], 8, I)) : C("", !0);
25
+ _("span", y, f(v(i)("component.TextMessage.sendSmsInvite")), 1)
26
+ ], 8, x)) : d("", !0);
60
27
  }
61
28
  });
62
29
  export {
63
- F as default
30
+ w as default
64
31
  };
@@ -33,7 +33,7 @@ const n = ["read", "received", "sent", "pending", "error"], s = (r) => {
33
33
  return "";
34
34
  }
35
35
  const a = t == null ? void 0 : t.trim();
36
- return a ? `${e}: ${a}` : e;
36
+ return a || e;
37
37
  };
38
38
  export {
39
39
  s as getStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.3.46",
3
+ "version": "0.3.48",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",