@vunex/support-chat 1.0.6 → 1.0.8

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,241 +1,434 @@
1
- import { ref as c, defineComponent as B, computed as Y, openBlock as f, createElementBlock as w, normalizeClass as L, createElementVNode as s, createTextVNode as O, toDisplayString as R, createCommentVNode as $, onMounted as N, onUnmounted as V, normalizeStyle as A, createStaticVNode as P, withModifiers as D, Fragment as j, renderList as F, createBlock as K, withDirectives as q, withKeys as J, vModelText as Q, nextTick as Z, createVNode as _, Transition as ee, withCtx as te, unref as k } from "vue";
2
- import { defineStore as se } from "pinia";
3
- import { io as ne } from "socket.io-client";
4
- const ie = se("gigSupportChat", () => {
5
- const e = c(null), v = c([]), t = c(!1), g = c(!1), i = c(0), l = c(""), r = c([]), u = c(!1), p = c(null), o = c(null), b = (d) => {
6
- o.value = d;
7
- }, I = () => {
8
- var d;
9
- (d = e.value) != null && d.connected || !o.value || (e.value = ne(o.value.apiUrl, {
10
- path: o.value.path || "/ws",
1
+ import { ref as w, defineComponent as q, computed as j, openBlock as c, createElementBlock as v, normalizeClass as L, createElementVNode as e, toDisplayString as T, createTextVNode as re, createCommentVNode as I, Fragment as N, onMounted as ie, onUnmounted as ne, normalizeStyle as ue, createStaticVNode as ge, withModifiers as D, renderList as se, createBlock as oe, unref as y, createVNode as _, Transition as G, withCtx as A, withDirectives as de, withKeys as ce, vModelText as ve, nextTick as me } from "vue";
2
+ import { defineStore as he } from "pinia";
3
+ import { io as pe } from "socket.io-client";
4
+ const J = he("gigSupportChat", () => {
5
+ const n = w(null), k = w([]), l = w(!1), C = w(!1), r = w(0), m = w(""), U = w([]), b = w(!1), a = w(null), p = w(null), z = (g) => {
6
+ p.value = g;
7
+ }, $ = () => {
8
+ var g;
9
+ (g = n.value) != null && g.connected || !p.value || (n.value = pe(p.value.apiUrl, {
10
+ path: p.value.path || "/ws",
11
11
  transports: ["websocket", "polling"],
12
12
  auth: {
13
- apiKey: o.value.apiKey,
14
- uuid: o.value.uuid,
15
- metaUser: o.value.metaUser
13
+ apiKey: p.value.apiKey,
14
+ uuid: p.value.uuid,
15
+ metaUser: p.value.metaUser
16
16
  }
17
- }), e.value.on("connect", () => {
18
- console.log("[GigSupportChat] Connected"), t.value = !0;
19
- }), e.value.on("connected", (n) => {
20
- console.log("[GigSupportChat] Registered as:", n.userId), l.value = n.userId, M();
21
- }), e.value.on("disconnect", () => {
22
- console.log("[GigSupportChat] Disconnected"), t.value = !1;
23
- }), e.value.on("new_message", (n) => {
24
- n.status === "SUCCESS" && (v.value.find((m) => m.id === n.message.id) || (v.value.push(n.message), g.value || i.value++));
25
- }), e.value.on("message_sent", (n) => {
26
- n.status === "SUCCESS" && (v.value.find((m) => m.id === n.message.id) || v.value.push(n.message));
27
- }), e.value.on("history", (n) => {
28
- n.status === "SUCCESS" && (v.value = n.messages);
29
- }), e.value.on("error", (n) => {
30
- console.error("[GigSupportChat] Socket error:", n);
17
+ }), n.value.on("connect", () => {
18
+ console.log("[GigSupportChat] Connected"), l.value = !0;
19
+ }), n.value.on("connected", (o) => {
20
+ console.log("[GigSupportChat] Registered as:", o.userId), m.value = o.userId, R();
21
+ }), n.value.on("disconnect", () => {
22
+ console.log("[GigSupportChat] Disconnected"), l.value = !1;
23
+ }), n.value.on("new_message", (o) => {
24
+ var d;
25
+ o.status === "SUCCESS" && (k.value.find((M) => M.id === o.message.id) || (k.value.push(o.message), C.value ? o.message.userId !== m.value && ((d = n.value) == null || d.emit("mark_read", { messageIds: [o.message.id] }), o.message.isRead = !0) : o.message.userId !== m.value && r.value++));
26
+ }), n.value.on("message_sent", (o) => {
27
+ o.status === "SUCCESS" && (k.value.find((d) => d.id === o.message.id) || k.value.push(o.message));
28
+ }), n.value.on("history", (o) => {
29
+ if (o.status === "SUCCESS" && (k.value = o.messages, !C.value)) {
30
+ const d = k.value.filter((M) => !M.isRead && M.userId !== m.value);
31
+ r.value = d.length;
32
+ }
33
+ }), n.value.on("error", (o) => {
34
+ console.error("[GigSupportChat] Socket error:", o);
31
35
  }));
32
- }, C = () => {
33
- e.value && (e.value.disconnect(), e.value = null), t.value = !1, v.value = [], i.value = 0, l.value = "";
34
- }, S = (d) => {
35
- var n, m;
36
- !e.value || !t.value || (e.value.emit("send_message", {
37
- userId: l.value,
38
- text: d,
39
- replyToMessageId: (n = p.value) == null ? void 0 : n.id,
40
- metaUser: (m = o.value) == null ? void 0 : m.metaUser
41
- }), p.value = null);
42
- }, M = () => {
43
- !e.value || !l.value || e.value.emit("get_history", {
44
- userId: l.value,
36
+ }, S = () => {
37
+ n.value && (n.value.disconnect(), n.value = null), l.value = !1, k.value = [], r.value = 0, m.value = "";
38
+ }, H = (g) => {
39
+ var o, d;
40
+ !n.value || !l.value || (n.value.emit("send_message", {
41
+ userId: m.value,
42
+ text: g,
43
+ replyToMessageId: (o = a.value) == null ? void 0 : o.id,
44
+ metaUser: (d = p.value) == null ? void 0 : d.metaUser
45
+ }), a.value = null);
46
+ }, R = () => {
47
+ !n.value || !m.value || n.value.emit("get_history", {
48
+ userId: m.value,
45
49
  limit: 50,
46
50
  offset: 0
47
51
  });
48
52
  };
49
53
  return {
50
- messages: v,
51
- isConnected: t,
52
- isWidgetOpen: g,
53
- unreadCount: i,
54
- currentUserId: l,
55
- stickers: r,
56
- isLoadingStickers: u,
57
- replyingToMessage: p,
58
- init: b,
59
- connect: I,
60
- disconnect: C,
61
- sendMessage: S,
62
- sendSticker: (d) => {
63
- var n, m;
64
- !e.value || !t.value || (e.value.emit("send_message", {
65
- userId: l.value,
66
- stickerId: d,
54
+ messages: k,
55
+ isConnected: l,
56
+ isWidgetOpen: C,
57
+ unreadCount: r,
58
+ currentUserId: m,
59
+ stickers: U,
60
+ isLoadingStickers: b,
61
+ replyingToMessage: a,
62
+ init: z,
63
+ connect: $,
64
+ disconnect: S,
65
+ sendMessage: H,
66
+ sendSticker: (g) => {
67
+ var o, d;
68
+ !n.value || !l.value || (n.value.emit("send_message", {
69
+ userId: m.value,
70
+ stickerId: g,
67
71
  messageType: "sticker",
68
- replyToMessageId: (n = p.value) == null ? void 0 : n.id,
69
- metaUser: (m = o.value) == null ? void 0 : m.metaUser
70
- }), p.value = null);
72
+ replyToMessageId: (o = a.value) == null ? void 0 : o.id,
73
+ metaUser: (d = p.value) == null ? void 0 : d.metaUser
74
+ }), a.value = null);
71
75
  },
72
76
  fetchStickers: async () => {
73
- var d;
74
- if ((d = o.value) != null && d.apiUrl) {
75
- u.value = !0;
77
+ var g;
78
+ if ((g = p.value) != null && g.apiUrl) {
79
+ b.value = !0;
76
80
  try {
77
- const m = await (await fetch(`${o.value.apiUrl}/api/v1.0/stickers?activeOnly=true`, {
81
+ const d = await (await fetch(`${p.value.apiUrl}/api/v1.0/stickers?activeOnly=true`, {
78
82
  headers: {
79
- "x-api-key": o.value.apiKey || ""
83
+ "x-api-key": p.value.apiKey || ""
80
84
  }
81
85
  })).json();
82
- m.status === "SUCCESS" && (r.value = m.content);
83
- } catch (n) {
84
- console.error("[GigSupportChat] Error fetching stickers:", n);
86
+ d.status === "SUCCESS" && (U.value = d.content);
87
+ } catch (o) {
88
+ console.error("[GigSupportChat] Error fetching stickers:", o);
85
89
  } finally {
86
- u.value = !1;
90
+ b.value = !1;
87
91
  }
88
92
  }
89
93
  },
90
94
  toggleWidget: () => {
91
- g.value = !g.value, g.value && (i.value = 0);
95
+ if (C.value = !C.value, C.value) {
96
+ r.value = 0;
97
+ const g = k.value.filter((o) => !o.isRead && o.userId !== m.value);
98
+ if (g.length > 0 && n.value) {
99
+ const o = g.map((d) => d.id);
100
+ n.value.emit("mark_read", { messageIds: o }), k.value.forEach((d) => {
101
+ o.includes(d.id) && (d.isRead = !0);
102
+ });
103
+ }
104
+ }
92
105
  },
93
- loadHistory: M,
94
- startReply: (d) => {
95
- p.value = d;
106
+ loadHistory: R,
107
+ startReply: (g) => {
108
+ a.value = g;
96
109
  },
97
110
  cancelReply: () => {
98
- p.value = null;
111
+ a.value = null;
99
112
  }
100
113
  };
101
- }), ae = ["data-message-id"], oe = {
114
+ }), fe = ["data-message-id"], ye = { class: "gig-message-group" }, we = {
102
115
  key: 0,
103
116
  class: "gig-message-author"
104
- }, le = ["src", "alt"], re = ["innerHTML"], ue = { class: "gig-message-time" }, ge = /* @__PURE__ */ B({
117
+ }, ke = { class: "gig-author-avatar" }, xe = { style: { "font-size": "10px", "font-weight": "700", opacity: "0.7", "margin-bottom": "2px" } }, Ce = { style: { "font-size": "11px", opacity: "0.8", "white-space": "nowrap", overflow: "hidden", "text-overflow": "ellipsis", "max-width": "200px" } }, be = ["src", "alt"], Me = ["src", "alt"], $e = {
118
+ key: 1,
119
+ class: "gig-message-attachment-file"
120
+ }, Se = { class: "gig-file-info" }, Te = ["title"], Ie = { class: "gig-file-size" }, Ue = ["innerHTML"], ze = ["innerHTML"], Be = { class: "gig-message-meta-out" }, Re = {
121
+ key: 0,
122
+ viewBox: "0 0 24 24",
123
+ width: "14",
124
+ height: "14",
125
+ fill: "none",
126
+ stroke: "currentColor",
127
+ "stroke-width": "2"
128
+ }, He = {
129
+ key: 1,
130
+ viewBox: "0 0 24 24",
131
+ width: "14",
132
+ height: "14",
133
+ fill: "none",
134
+ stroke: "currentColor",
135
+ "stroke-width": "2"
136
+ }, We = /* @__PURE__ */ q({
105
137
  __name: "ChatMessage",
106
138
  props: {
107
139
  message: {},
108
140
  currentUserId: {}
109
141
  },
110
- emits: ["reply", "scroll-to"],
111
- setup(e) {
112
- const v = e, t = Y(() => v.message.userId === v.currentUserId), g = (r) => r ? new Date(r).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "", i = (r) => {
113
- const u = r.trim().split(/\s+/);
114
- return u.length >= 2 ? `${u[0]} ${u[1][0]}.` : r;
115
- }, l = (r) => {
116
- if (!r) return "";
117
- const u = r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), p = /(https?:\/\/[^\s]+)/g;
118
- return u.replace(p, (o) => `<a href="${o}" target="_blank" style="color: inherit; text-decoration: underline;">${o}</a>`);
142
+ emits: ["reply", "scroll-to", "open-image"],
143
+ setup(n, { emit: k }) {
144
+ const l = n, C = J(), r = j(() => l.message.userId === l.currentUserId), m = (i) => C.messages.find((t) => t.id === i), U = (i) => i.userId === l.currentUserId ? "Вы" : R(i.userName || "Support"), b = (i) => i.messageType === "sticker" ? "[Стикер]" : i.attachmentName || i.attachmentBase64 || i.attachmentUrl || i.attachment ? "[Вложение]" : i.text || "", a = j(() => {
145
+ const i = l.message, t = i.attachment || i.Attachment || {}, f = l.message.attachmentName || t.name || t.attachmentName || t.attachment_name || "Вложение", g = l.message.attachmentMimeType || t.mimeType || t.mime_type || "application/octet-stream", o = l.message.attachmentSize || t.size || t.attachmentSize || t.attachment_size || 0, d = l.message.attachmentBase64 || t.base64 || t.attachmentBase64 || t.attachment_base64 || null, M = l.message.attachmentUrl || t.url || t.attachmentUrl || t.attachment_url || null;
146
+ if (f !== "Вложение" || o > 0 || d || M) {
147
+ let E = M;
148
+ return d && (E = `data:${g};base64,${d}`), { name: f, mimeType: g, size: Number(o), base64: d, url: M, previewUrl: E };
149
+ }
150
+ return null;
151
+ }), p = j(() => {
152
+ var i;
153
+ return ((i = a.value) == null ? void 0 : i.mimeType.startsWith("image/")) || !1;
154
+ }), z = () => {
155
+ if (!a.value) return;
156
+ const i = a.value, t = document.createElement("a");
157
+ if (t.download = i.name, i.previewUrl)
158
+ t.href = i.previewUrl;
159
+ else if (i.url)
160
+ t.href = i.url, t.target = "_blank", t.rel = "noopener";
161
+ else
162
+ return;
163
+ document.body.appendChild(t), t.click(), document.body.removeChild(t);
164
+ }, $ = (i) => {
165
+ if (i === 0) return "0 B";
166
+ const t = 1024, f = ["B", "KB", "MB", "GB"], g = Math.floor(Math.log(i) / Math.log(t));
167
+ return parseFloat((i / Math.pow(t, g)).toFixed(1)) + " " + f[g];
168
+ }, S = (i, t = 22) => {
169
+ if (!i || i.length <= t) return i;
170
+ const f = i.lastIndexOf(".");
171
+ if (f <= 0) return i.substring(0, t - 3) + "...";
172
+ const g = i.substring(f), o = i.substring(0, f);
173
+ return o.length + g.length <= t ? i : o.substring(0, t - g.length - 3) + "..." + g;
174
+ }, H = (i) => i ? new Date(i).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "", R = (i) => {
175
+ if (!i) return "Support";
176
+ const t = i.trim().split(/\s+/);
177
+ return t.length >= 2 ? `${t[0]} ${t[1][0]}.` : i;
178
+ }, V = (i) => {
179
+ if (i.toLowerCase() === "support") return "GP";
180
+ const t = i.trim().split(/\s+/);
181
+ return t.length >= 2 ? `${t[0][0]}${t[1][0]}`.toUpperCase() : t.length === 1 && t[0].length >= 2 ? t[0].substring(0, 2).toUpperCase() : t[0] ? t[0][0].toUpperCase() : "GP";
182
+ }, W = (i) => {
183
+ if (!i) return "";
184
+ const t = i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), f = /(https?:\/\/[^\s]+)/g;
185
+ return t.replace(f, (g) => `<a href="${g}" target="_blank" style="color: inherit; text-decoration: underline;">${g}</a>`);
119
186
  };
120
- return (r, u) => (f(), w("div", {
121
- class: L(["gig-message-row", t.value ? "sent" : "received"]),
122
- "data-message-id": e.message.id
187
+ return (i, t) => (c(), v("div", {
188
+ class: L(["gig-message-row", r.value ? "sent" : "received"]),
189
+ "data-message-id": n.message.id
123
190
  }, [
124
- s("div", {
125
- class: L(["gig-message-bubble", { "is-sticker": e.message.messageType === "sticker" }])
126
- }, [
127
- t.value ? $("", !0) : (f(), w("div", oe, [
128
- u[1] || (u[1] = s("div", { class: "gig-author-avatar" }, "GP", -1)),
129
- O(" " + R(i(e.message.userName || "Support")), 1)
130
- ])),
131
- e.message.replyToMessageId ? (f(), w("div", {
132
- key: 1,
133
- class: "gig-message-reply-preview",
134
- onClick: u[0] || (u[0] = (p) => r.$emit("scroll-to", e.message.replyToMessageId))
135
- })) : $("", !0),
136
- e.message.messageType === "sticker" && e.message.sticker ? (f(), w("img", {
137
- key: 2,
138
- src: `data:${e.message.sticker.mimeType || "image/png"};base64,${e.message.sticker.base64}`,
139
- class: "gig-sticker-img",
140
- alt: e.message.sticker.name
141
- }, null, 8, le)) : (f(), w("div", {
142
- key: 3,
143
- innerHTML: l(e.message.text || "")
144
- }, null, 8, re)),
145
- s("div", ue, R(g(e.message.createdAt)), 1)
146
- ], 2)
147
- ], 10, ae));
191
+ e("div", ye, [
192
+ e("div", {
193
+ class: L(["gig-message-bubble", { "is-sticker": n.message.messageType === "sticker" }])
194
+ }, [
195
+ r.value ? I("", !0) : (c(), v("div", we, [
196
+ e("div", ke, T(V(n.message.userName || "Support")), 1),
197
+ re(" " + T(R(n.message.userName || "Support")), 1)
198
+ ])),
199
+ n.message.replyToMessageId && m(n.message.replyToMessageId) ? (c(), v("div", {
200
+ key: 1,
201
+ class: "gig-message-reply-preview",
202
+ onClick: t[0] || (t[0] = (f) => i.$emit("scroll-to", n.message.replyToMessageId))
203
+ }, [
204
+ e("div", xe, T(U(m(n.message.replyToMessageId))), 1),
205
+ e("div", Ce, T(b(m(n.message.replyToMessageId))), 1)
206
+ ])) : I("", !0),
207
+ n.message.messageType === "sticker" && n.message.sticker ? (c(), v("img", {
208
+ key: 2,
209
+ src: `data:${n.message.sticker.mimeType || "image/png"};base64,${n.message.sticker.base64}`,
210
+ class: "gig-sticker-img",
211
+ alt: n.message.sticker.name
212
+ }, null, 8, be)) : a.value ? (c(), v(N, { key: 3 }, [
213
+ p.value ? (c(), v("div", {
214
+ key: 0,
215
+ class: "gig-message-attachment-image",
216
+ onClick: t[1] || (t[1] = (f) => i.$emit("open-image", a.value.previewUrl))
217
+ }, [
218
+ e("img", {
219
+ src: a.value.previewUrl,
220
+ alt: a.value.name
221
+ }, null, 8, Me)
222
+ ])) : (c(), v("div", $e, [
223
+ t[4] || (t[4] = e("div", { class: "gig-file-icon" }, [
224
+ e("svg", {
225
+ viewBox: "0 0 24 24",
226
+ width: "24",
227
+ height: "24",
228
+ fill: "none",
229
+ stroke: "currentColor",
230
+ "stroke-width": "2"
231
+ }, [
232
+ e("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
233
+ e("polyline", { points: "13 2 13 9 20 9" })
234
+ ])
235
+ ], -1)),
236
+ e("div", Se, [
237
+ e("div", {
238
+ class: "gig-file-name",
239
+ title: a.value.name
240
+ }, T(S(a.value.name)), 9, Te),
241
+ e("div", Ie, T($(a.value.size)), 1)
242
+ ]),
243
+ e("button", {
244
+ class: "gig-btn-icon gig-file-download",
245
+ onClick: z
246
+ }, [...t[3] || (t[3] = [
247
+ e("svg", {
248
+ viewBox: "0 0 24 24",
249
+ width: "20",
250
+ height: "20",
251
+ fill: "none",
252
+ stroke: "currentColor",
253
+ "stroke-width": "2"
254
+ }, [
255
+ e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
256
+ e("polyline", { points: "7 10 12 15 17 10" }),
257
+ e("line", {
258
+ x1: "12",
259
+ y1: "15",
260
+ x2: "12",
261
+ y2: "3"
262
+ })
263
+ ], -1)
264
+ ])])
265
+ ])),
266
+ n.message.text ? (c(), v("div", {
267
+ key: 2,
268
+ innerHTML: W(n.message.text),
269
+ style: { "margin-top": "8px" }
270
+ }, null, 8, Ue)) : I("", !0)
271
+ ], 64)) : (c(), v("div", {
272
+ key: 4,
273
+ innerHTML: W(n.message.text || "")
274
+ }, null, 8, ze)),
275
+ e("button", {
276
+ class: L(["gig-message-reply-btn", r.value ? "left-side" : "right-side"]),
277
+ onClick: t[2] || (t[2] = (f) => i.$emit("reply", n.message))
278
+ }, [...t[5] || (t[5] = [
279
+ e("svg", {
280
+ viewBox: "0 0 24 24",
281
+ width: "14",
282
+ height: "14",
283
+ fill: "none",
284
+ stroke: "currentColor",
285
+ "stroke-width": "2.5"
286
+ }, [
287
+ e("polyline", { points: "9 17 4 12 9 7" }),
288
+ e("path", { d: "M20 18v-2a4 4 0 0 0-4-4H4" })
289
+ ], -1)
290
+ ])], 2)
291
+ ], 2),
292
+ e("div", Be, [
293
+ e("span", null, T(H(n.message.createdAt)), 1),
294
+ r.value ? (c(), v(N, { key: 0 }, [
295
+ n.message.isRead ? (c(), v("svg", Re, [...t[6] || (t[6] = [
296
+ e("polyline", { points: "18 6 11 15 7 11" }, null, -1),
297
+ e("polyline", { points: "22 6 15 15 13 13" }, null, -1)
298
+ ])])) : (c(), v("svg", He, [...t[7] || (t[7] = [
299
+ e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
300
+ ])]))
301
+ ], 64)) : I("", !0)
302
+ ])
303
+ ])
304
+ ], 10, fe));
148
305
  }
149
- }), ce = (e, v) => {
150
- const t = e.__vccOpts || e;
151
- for (const [g, i] of v)
152
- t[g] = i;
153
- return t;
154
- }, de = /* @__PURE__ */ ce(ge, [["__scopeId", "data-v-ca90faac"]]), ve = {
306
+ }), Ee = (n, k) => {
307
+ const l = n.__vccOpts || n;
308
+ for (const [C, r] of k)
309
+ l[C] = r;
310
+ return l;
311
+ }, Le = /* @__PURE__ */ Ee(We, [["__scopeId", "data-v-85f97065"]]), _e = {
155
312
  key: 0,
156
313
  style: { "text-align": "center", color: "#94a3b8", "padding-top": "40px" }
157
- }, me = { class: "gig-input-area" }, pe = { class: "gig-input-box" }, he = ["onKeydown"], fe = ["disabled"], ye = {
314
+ }, Ge = {
315
+ key: 0,
316
+ class: "gig-sticker-picker"
317
+ }, Ae = { class: "gig-sticker-header" }, Ve = { class: "gig-sticker-body" }, De = {
318
+ key: 0,
319
+ style: { "text-align": "center", color: "#94a3b8", padding: "30px" }
320
+ }, Ne = {
321
+ key: 1,
322
+ style: { "text-align": "center", color: "#94a3b8", padding: "30px" }
323
+ }, Oe = {
324
+ key: 2,
325
+ class: "gig-sticker-grid"
326
+ }, Xe = ["onClick"], Ye = ["src", "alt"], Ke = { class: "gig-input-area" }, Pe = {
327
+ key: 0,
328
+ class: "gig-reply-preview-container"
329
+ }, Fe = { class: "gig-reply-content" }, je = { class: "gig-reply-author" }, qe = { class: "gig-reply-text" }, Je = { class: "gig-input-box" }, Qe = ["onKeydown"], Ze = ["disabled"], et = {
158
330
  viewBox: "0 0 24 24",
159
331
  width: "18",
160
332
  height: "18",
161
333
  fill: "none",
162
334
  stroke: "currentColor",
163
335
  "stroke-width": "2",
164
- style: { transform: "rotate(45deg)", "margin-bottom": "2px" }
165
- }, we = /* @__PURE__ */ B({
336
+ style: { transform: "rotate(45deg) translate(-1px, 2px)" }
337
+ }, tt = ["src"], st = /* @__PURE__ */ q({
166
338
  __name: "ChatWindow",
167
339
  props: {
168
340
  messages: {},
169
341
  currentUserId: {}
170
342
  },
171
343
  emits: ["close", "send"],
172
- setup(e, { emit: v }) {
173
- const t = v, g = c(""), i = c(null), l = c(null), r = c({ x: 32, y: 112 }), u = c({ width: 440, height: 600 }), p = c(!1), o = c(null), b = c(!1), I = () => {
174
- b.value = !b.value;
344
+ setup(n, { emit: k }) {
345
+ const l = n, C = k, r = J(), m = w(""), U = w(null), b = w(null), a = w({ x: 32, y: 112 }), p = w({ width: 440, height: 600 }), z = w(!1), $ = w(null), S = w(!1), H = () => {
346
+ S.value = !S.value, S.value && r.stickers.length === 0 && r.fetchStickers();
347
+ }, R = (u) => {
348
+ r.sendSticker(u), S.value = !1, F();
349
+ }, V = (u) => {
350
+ const s = u.trim().split(/\s+/);
351
+ return s.length >= 2 ? `${s[0]} ${s[1][0]}.` : u;
352
+ }, W = (u) => u.userId === l.currentUserId ? "Вы" : V(u.userName || "Support"), i = (u) => u.messageType === "sticker" ? "[Стикер]" : u.text || "", t = (u) => {
353
+ const s = document.querySelector(`.gig-message-row[data-message-id="${u}"]`);
354
+ s && (s.scrollIntoView({ behavior: "smooth", block: "center" }), s.classList.add("gig-highlighted"), setTimeout(() => s.classList.remove("gig-highlighted"), 1500));
355
+ }, f = w(null), g = (u) => {
356
+ f.value = u;
357
+ }, o = () => {
358
+ f.value = null;
175
359
  };
176
- let C = 0, S = 0, M = 0, z = 0, U = 0, T = 0;
177
- const G = (h) => {
178
- h.button === 0 && (p.value = !0, C = h.clientX, S = h.clientY, U = r.value.x, T = r.value.y, window.addEventListener("mousemove", E), window.addEventListener("mouseup", m));
179
- }, E = (h) => {
180
- p.value && (r.value = {
181
- x: U - (h.clientX - C),
182
- y: T - (h.clientY - S)
183
- });
184
- }, d = (h, a) => {
185
- h.preventDefault(), o.value = a, C = h.clientX, S = h.clientY, M = u.value.width, z = u.value.height, U = r.value.x, T = r.value.y, window.addEventListener("mousemove", n), window.addEventListener("mouseup", m);
186
- }, n = (h) => {
187
- if (!o.value) return;
188
- const a = C - h.clientX, y = S - h.clientY;
189
- if (o.value === "left" || o.value === "corner") {
190
- const x = M + a;
191
- x > 320 && x < 800 && (u.value.width = x);
360
+ let d = 0, M = 0, E = 0, Q = 0, O = 0, X = 0;
361
+ const ae = (u) => {
362
+ u.button === 0 && (z.value = !0, d = u.clientX, M = u.clientY, O = a.value.x, X = a.value.y, window.addEventListener("mousemove", Z), window.addEventListener("mouseup", K));
363
+ }, Z = (u) => {
364
+ if (!z.value) return;
365
+ let s = O - (u.clientX - d), h = X - (u.clientY - M);
366
+ const x = window.innerWidth - p.value.width, B = window.innerHeight - p.value.height;
367
+ s < 0 && (s = 0), s > x && (s = x), h < 0 && (h = 0), h > B && (h = B), a.value = { x: s, y: h };
368
+ }, Y = (u, s) => {
369
+ u.preventDefault(), $.value = s, d = u.clientX, M = u.clientY, E = p.value.width, Q = p.value.height, O = a.value.x, X = a.value.y, window.addEventListener("mousemove", ee), window.addEventListener("mouseup", K);
370
+ }, ee = (u) => {
371
+ if (!$.value) return;
372
+ const s = d - u.clientX, h = M - u.clientY;
373
+ if ($.value === "left" || $.value === "corner") {
374
+ let x = E + s;
375
+ const B = window.innerWidth - a.value.x;
376
+ x > B && (x = B), x >= 320 && (p.value.width = x);
192
377
  }
193
- if (o.value === "top" || o.value === "corner") {
194
- const x = z + y;
195
- x > 400 && x < 900 && (u.value.height = x);
378
+ if ($.value === "top" || $.value === "corner") {
379
+ let x = Q + h;
380
+ const B = window.innerHeight - a.value.y;
381
+ x > B && (x = B), x >= 400 && (p.value.height = x);
196
382
  }
197
- }, m = () => {
198
- p.value = !1, o.value = null, window.removeEventListener("mousemove", E), window.removeEventListener("mousemove", n);
199
- }, H = () => {
200
- g.value.trim() && (t("send", g.value), g.value = "", l.value && (l.value.style.height = "auto"), W());
201
- }, X = () => {
202
- l.value && (l.value.style.height = "auto", l.value.style.height = Math.min(l.value.scrollHeight, 120) + "px");
203
- }, W = async () => {
204
- await Z(), i.value && (i.value.scrollTop = i.value.scrollHeight);
383
+ }, K = () => {
384
+ z.value = !1, $.value = null, window.removeEventListener("mousemove", Z), window.removeEventListener("mousemove", ee);
385
+ }, P = () => {
386
+ const u = window.innerWidth - p.value.width, s = window.innerHeight - p.value.height;
387
+ a.value.x < 0 && (a.value.x = 0), a.value.x > u && u > 0 ? a.value.x = u : a.value.x > window.innerWidth && (a.value.x = 0), a.value.y < 0 && (a.value.y = 0), a.value.y > s && s > 0 ? a.value.y = s : a.value.y > window.innerHeight && (a.value.y = 0);
388
+ }, te = () => {
389
+ m.value.trim() && (C("send", m.value), m.value = "", b.value && (b.value.style.height = "auto"), F());
390
+ }, le = () => {
391
+ b.value && (b.value.style.height = "auto", b.value.style.height = Math.min(b.value.scrollHeight, 120) + "px");
392
+ }, F = async () => {
393
+ await me(), U.value && (U.value.scrollTop = U.value.scrollHeight);
205
394
  };
206
- return N(W), V(m), (h, a) => (f(), w("div", {
395
+ return ie(() => {
396
+ F(), window.addEventListener("resize", P), P();
397
+ }), ne(() => {
398
+ K(), window.removeEventListener("resize", P);
399
+ }), (u, s) => (c(), v("div", {
207
400
  class: "gig-chat-window",
208
- style: A({
209
- width: u.value.width + "px",
210
- height: u.value.height + "px",
211
- bottom: r.value.y + "px",
212
- right: r.value.x + "px",
213
- cursor: p.value ? "grabbing" : "auto"
401
+ style: ue({
402
+ width: p.value.width + "px",
403
+ height: p.value.height + "px",
404
+ bottom: a.value.y + "px",
405
+ right: a.value.x + "px",
406
+ cursor: z.value ? "grabbing" : "auto"
214
407
  })
215
408
  }, [
216
- s("div", {
409
+ e("div", {
217
410
  class: "gig-resizer gig-resizer-l",
218
- onMousedown: a[0] || (a[0] = (y) => d(y, "left"))
411
+ onMousedown: s[0] || (s[0] = (h) => Y(h, "left"))
219
412
  }, null, 32),
220
- s("div", {
413
+ e("div", {
221
414
  class: "gig-resizer gig-resizer-t",
222
- onMousedown: a[1] || (a[1] = (y) => d(y, "top"))
415
+ onMousedown: s[1] || (s[1] = (h) => Y(h, "top"))
223
416
  }, null, 32),
224
- s("div", {
417
+ e("div", {
225
418
  class: "gig-resizer gig-resizer-tl",
226
- onMousedown: a[2] || (a[2] = (y) => d(y, "corner"))
419
+ onMousedown: s[2] || (s[2] = (h) => Y(h, "corner"))
227
420
  }, null, 32),
228
- s("div", {
421
+ e("div", {
229
422
  class: "gig-chat-header",
230
- onMousedown: G
423
+ onMousedown: ae
231
424
  }, [
232
- a[6] || (a[6] = P('<div class="gig-header-left"><div class="gig-header-icon"><svg viewBox="0 0 24 24" width="22" height="22" stroke="currentColor" fill="none" stroke-width="2"><path d="M3 18v-6a9 9 0 0 1 18 0v6"></path><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"></path></svg></div><div><h3 class="gig-header-title">Чат поддержки</h3><div class="gig-header-status"><div class="gig-status-dot"></div><span>Мы онлайн!</span></div></div></div>', 1)),
233
- s("button", {
425
+ s[10] || (s[10] = ge('<div class="gig-header-left"><div class="gig-header-icon"><svg viewBox="0 0 24 24" width="22" height="22" stroke="currentColor" fill="none" stroke-width="2"><path d="M3 18v-6a9 9 0 0 1 18 0v6"></path><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"></path></svg></div><div><h3 class="gig-header-title">Чат поддержки</h3><div class="gig-header-status"><div class="gig-status-dot"></div><span>Мы онлайн!</span></div></div></div>', 1)),
426
+ e("button", {
234
427
  class: "gig-btn-icon",
235
- onClick: a[3] || (a[3] = D((y) => h.$emit("close"), ["stop"])),
428
+ onClick: s[3] || (s[3] = D((h) => u.$emit("close"), ["stop"])),
236
429
  style: { opacity: "0.8" }
237
- }, [...a[5] || (a[5] = [
238
- s("svg", {
430
+ }, [...s[9] || (s[9] = [
431
+ e("svg", {
239
432
  viewBox: "0 0 24 24",
240
433
  width: "22",
241
434
  height: "22",
@@ -243,13 +436,13 @@ const ie = se("gigSupportChat", () => {
243
436
  fill: "none",
244
437
  "stroke-width": "2.5"
245
438
  }, [
246
- s("line", {
439
+ e("line", {
247
440
  x1: "18",
248
441
  y1: "6",
249
442
  x2: "6",
250
443
  y2: "18"
251
444
  }),
252
- s("line", {
445
+ e("line", {
253
446
  x1: "6",
254
447
  y1: "6",
255
448
  x2: "18",
@@ -258,25 +451,131 @@ const ie = se("gigSupportChat", () => {
258
451
  ], -1)
259
452
  ])])
260
453
  ], 32),
261
- s("div", {
454
+ e("div", {
262
455
  ref_key: "messagesArea",
263
- ref: i,
456
+ ref: U,
264
457
  class: "gig-messages-area"
265
458
  }, [
266
- e.messages.length === 0 ? (f(), w("div", ve, " Здесь будет история переписки ")) : $("", !0),
267
- (f(!0), w(j, null, F(e.messages, (y) => (f(), K(de, {
268
- key: y.id,
269
- message: y,
270
- "current-user-id": e.currentUserId
459
+ n.messages.length === 0 ? (c(), v("div", _e, " Здесь будет история переписки ")) : I("", !0),
460
+ (c(!0), v(N, null, se(n.messages, (h) => (c(), oe(Le, {
461
+ key: h.id,
462
+ message: h,
463
+ "current-user-id": n.currentUserId,
464
+ onReply: s[4] || (s[4] = (x) => y(r).replyingToMessage = x),
465
+ onScrollTo: t,
466
+ onOpenImage: g
271
467
  }, null, 8, ["message", "current-user-id"]))), 128))
272
468
  ], 512),
273
- s("div", me, [
274
- s("div", pe, [
275
- s("div", {
469
+ _(G, { name: "gig-fade" }, {
470
+ default: A(() => [
471
+ S.value ? (c(), v("div", Ge, [
472
+ e("div", Ae, [
473
+ s[12] || (s[12] = e("span", { style: { "font-size": "11px", "font-weight": "700", color: "#94a3b8", "text-transform": "uppercase" } }, "Выберите стикер", -1)),
474
+ e("button", {
475
+ class: "gig-btn-icon",
476
+ style: { color: "#94a3b8", width: "24px", height: "24px" },
477
+ onClick: s[5] || (s[5] = (h) => S.value = !1)
478
+ }, [...s[11] || (s[11] = [
479
+ e("svg", {
480
+ viewBox: "0 0 24 24",
481
+ width: "20",
482
+ height: "20",
483
+ stroke: "currentColor",
484
+ fill: "none",
485
+ "stroke-width": "2.5"
486
+ }, [
487
+ e("line", {
488
+ x1: "18",
489
+ y1: "6",
490
+ x2: "6",
491
+ y2: "18"
492
+ }),
493
+ e("line", {
494
+ x1: "6",
495
+ y1: "6",
496
+ x2: "18",
497
+ y2: "18"
498
+ })
499
+ ], -1)
500
+ ])])
501
+ ]),
502
+ e("div", Ve, [
503
+ y(r).isLoadingStickers ? (c(), v("div", De, " Загрузка... ")) : y(r).stickers.length === 0 ? (c(), v("div", Ne, " Стикеры не найдены ")) : (c(), v("div", Oe, [
504
+ (c(!0), v(N, null, se(y(r).stickers, (h) => (c(), v("div", {
505
+ key: h.id,
506
+ class: "gig-sticker-item",
507
+ onClick: (x) => R(h.id)
508
+ }, [
509
+ e("img", {
510
+ src: `data:${h.mimeType || "image/png"};base64,${h.base64}`,
511
+ class: "gig-sticker-thumbnail",
512
+ alt: h.name
513
+ }, null, 8, Ye)
514
+ ], 8, Xe))), 128))
515
+ ]))
516
+ ])
517
+ ])) : I("", !0)
518
+ ]),
519
+ _: 1
520
+ }),
521
+ e("div", Ke, [
522
+ _(G, { name: "gig-fade" }, {
523
+ default: A(() => [
524
+ y(r).replyingToMessage ? (c(), v("div", Pe, [
525
+ s[14] || (s[14] = e("div", { class: "gig-reply-icon" }, [
526
+ e("svg", {
527
+ viewBox: "0 0 24 24",
528
+ width: "16",
529
+ height: "16",
530
+ fill: "none",
531
+ stroke: "var(--gig-brand-dark-green)",
532
+ "stroke-width": "2.5"
533
+ }, [
534
+ e("polyline", { points: "9 17 4 12 9 7" }),
535
+ e("path", { d: "M20 18v-2a4 4 0 0 0-4-4H4" })
536
+ ])
537
+ ], -1)),
538
+ e("div", Fe, [
539
+ e("div", je, T(W(y(r).replyingToMessage)), 1),
540
+ e("div", qe, T(i(y(r).replyingToMessage)), 1)
541
+ ]),
542
+ e("button", {
543
+ class: "gig-btn-icon gig-reply-close",
544
+ style: { color: "#94a3b8", width: "20px", height: "20px", "flex-shrink": "0" },
545
+ onClick: s[6] || (s[6] = (h) => y(r).replyingToMessage = null)
546
+ }, [...s[13] || (s[13] = [
547
+ e("svg", {
548
+ viewBox: "0 0 24 24",
549
+ width: "16",
550
+ height: "16",
551
+ stroke: "currentColor",
552
+ fill: "none",
553
+ "stroke-width": "2.5"
554
+ }, [
555
+ e("line", {
556
+ x1: "18",
557
+ y1: "6",
558
+ x2: "6",
559
+ y2: "18"
560
+ }),
561
+ e("line", {
562
+ x1: "6",
563
+ y1: "6",
564
+ x2: "18",
565
+ y2: "18"
566
+ })
567
+ ], -1)
568
+ ])])
569
+ ])) : I("", !0)
570
+ ]),
571
+ _: 1
572
+ }),
573
+ e("div", Je, [
574
+ e("div", {
276
575
  class: "gig-input-star",
277
- onClick: I
278
- }, [...a[7] || (a[7] = [
279
- s("svg", {
576
+ onClick: H
577
+ }, [...s[15] || (s[15] = [
578
+ e("svg", {
280
579
  viewBox: "0 0 24 24",
281
580
  width: "20",
282
581
  height: "20",
@@ -284,114 +583,166 @@ const ie = se("gigSupportChat", () => {
284
583
  stroke: "currentColor",
285
584
  "stroke-width": "2"
286
585
  }, [
287
- s("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })
586
+ e("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })
288
587
  ], -1)
289
588
  ])]),
290
- q(s("textarea", {
589
+ de(e("textarea", {
291
590
  ref_key: "textareaRef",
292
- ref: l,
293
- "onUpdate:modelValue": a[4] || (a[4] = (y) => g.value = y),
591
+ ref: b,
592
+ "onUpdate:modelValue": s[7] || (s[7] = (h) => m.value = h),
294
593
  placeholder: "Напишите сообщение...",
295
594
  class: "gig-textarea",
296
595
  rows: "1",
297
- onKeydown: J(D(H, ["exact", "prevent"]), ["enter"]),
298
- onInput: X
299
- }, null, 40, he), [
300
- [Q, g.value]
596
+ onKeydown: ce(D(te, ["exact", "prevent"]), ["enter"]),
597
+ onInput: le
598
+ }, null, 40, Qe), [
599
+ [ve, m.value]
301
600
  ]),
302
- s("button", {
303
- class: L(["gig-send-btn", { active: g.value.trim() }]),
304
- disabled: !g.value.trim(),
305
- onClick: H
601
+ e("button", {
602
+ class: L(["gig-send-btn", { active: m.value.trim() }]),
603
+ disabled: !m.value.trim(),
604
+ onClick: te
306
605
  }, [
307
- (f(), w("svg", ye, [...a[8] || (a[8] = [
308
- s("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" }, null, -1)
606
+ (c(), v("svg", et, [...s[16] || (s[16] = [
607
+ e("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" }, null, -1)
309
608
  ])]))
310
- ], 10, fe)
609
+ ], 10, Ze)
311
610
  ]),
312
- a[9] || (a[9] = s("div", { class: "gig-footer" }, [
313
- s("div", { class: "gig-footer-line" }),
314
- s("span", { class: "gig-footer-text" }, "Работает на GigSupport"),
315
- s("div", { class: "gig-footer-line" })
611
+ s[17] || (s[17] = e("div", { class: "gig-footer" }, [
612
+ e("div", { class: "gig-footer-line" }),
613
+ e("span", { class: "gig-footer-text" }, "Работает на GigSupport"),
614
+ e("div", { class: "gig-footer-line" })
316
615
  ], -1))
317
- ])
616
+ ]),
617
+ _(G, { name: "gig-fade" }, {
618
+ default: A(() => [
619
+ f.value ? (c(), v("div", {
620
+ key: 0,
621
+ class: "gig-image-viewer",
622
+ onClick: o
623
+ }, [
624
+ e("button", {
625
+ class: "gig-btn-icon gig-image-viewer-close",
626
+ onClick: D(o, ["stop"])
627
+ }, [...s[18] || (s[18] = [
628
+ e("svg", {
629
+ viewBox: "0 0 24 24",
630
+ width: "28",
631
+ height: "28",
632
+ stroke: "currentColor",
633
+ fill: "none",
634
+ "stroke-width": "2"
635
+ }, [
636
+ e("line", {
637
+ x1: "18",
638
+ y1: "6",
639
+ x2: "6",
640
+ y2: "18"
641
+ }),
642
+ e("line", {
643
+ x1: "6",
644
+ y1: "6",
645
+ x2: "18",
646
+ y2: "18"
647
+ })
648
+ ], -1)
649
+ ])]),
650
+ e("img", {
651
+ src: f.value,
652
+ alt: "Просмотр",
653
+ onClick: s[8] || (s[8] = D(() => {
654
+ }, ["stop"]))
655
+ }, null, 8, tt)
656
+ ])) : I("", !0)
657
+ ]),
658
+ _: 1
659
+ })
318
660
  ], 4));
319
661
  }
320
- }), ke = { class: "gig-chat-wrapper" }, xe = {
662
+ }), it = { class: "gig-chat-wrapper" }, nt = {
321
663
  key: 0,
322
664
  class: "gig-chat-badge"
323
- }, Ce = {
324
- key: 1,
665
+ }, ot = { class: "gig-trigger-icon-wrapper" }, at = {
666
+ key: 0,
667
+ class: "gig-trigger-icon",
325
668
  viewBox: "0 0 24 24",
326
- width: "32",
327
- height: "32",
669
+ width: "36",
670
+ height: "36",
328
671
  fill: "none",
329
672
  stroke: "white",
330
673
  "stroke-width": "2"
331
- }, Se = {
332
- key: 2,
674
+ }, lt = {
675
+ key: 1,
676
+ class: "gig-trigger-icon",
333
677
  viewBox: "0 0 24 24",
334
- width: "32",
335
- height: "32",
678
+ width: "36",
679
+ height: "36",
336
680
  fill: "none",
337
681
  stroke: "white",
338
682
  "stroke-width": "2"
339
- }, Me = /* @__PURE__ */ B({
683
+ }, rt = /* @__PURE__ */ q({
340
684
  __name: "GigSupportChat",
341
685
  props: {
342
686
  config: {}
343
687
  },
344
- setup(e) {
345
- const v = e, t = ie();
346
- return N(() => {
347
- t.init(v.config), t.connect();
348
- }), V(() => {
349
- t.disconnect();
350
- }), (g, i) => (f(), w("div", ke, [
351
- _(ee, { name: "gig-fade" }, {
352
- default: te(() => [
353
- k(t).isWidgetOpen ? (f(), K(we, {
688
+ setup(n) {
689
+ const k = n, l = J();
690
+ return ie(() => {
691
+ l.init(k.config), l.connect();
692
+ }), ne(() => {
693
+ l.disconnect();
694
+ }), (C, r) => (c(), v("div", it, [
695
+ _(G, { name: "gig-popup" }, {
696
+ default: A(() => [
697
+ y(l).isWidgetOpen ? (c(), oe(st, {
354
698
  key: 0,
355
- messages: k(t).messages,
356
- "is-connected": k(t).isConnected,
357
- "current-user-id": k(t).currentUserId,
358
- onSend: i[0] || (i[0] = (l) => k(t).sendMessage(l)),
359
- onClose: i[1] || (i[1] = (l) => k(t).toggleWidget())
360
- }, null, 8, ["messages", "is-connected", "current-user-id"])) : $("", !0)
699
+ messages: y(l).messages,
700
+ "is-connected": y(l).isConnected,
701
+ "current-user-id": y(l).currentUserId,
702
+ onSend: r[0] || (r[0] = (m) => y(l).sendMessage(m)),
703
+ onClose: r[1] || (r[1] = (m) => y(l).toggleWidget())
704
+ }, null, 8, ["messages", "is-connected", "current-user-id"])) : I("", !0)
361
705
  ]),
362
706
  _: 1
363
707
  }),
364
- s("button", {
365
- class: "gig-chat-trigger",
366
- onClick: i[2] || (i[2] = (l) => k(t).toggleWidget())
708
+ e("button", {
709
+ class: L(["gig-chat-trigger", { "is-open": y(l).isWidgetOpen }]),
710
+ onClick: r[2] || (r[2] = (m) => y(l).toggleWidget())
367
711
  }, [
368
- k(t).unreadCount > 0 ? (f(), w("div", xe, R(k(t).unreadCount), 1)) : $("", !0),
369
- k(t).isWidgetOpen ? (f(), w("svg", Se, [...i[4] || (i[4] = [
370
- s("line", {
371
- x1: "18",
372
- y1: "6",
373
- x2: "6",
374
- y2: "18"
375
- }, null, -1),
376
- s("line", {
377
- x1: "6",
378
- y1: "6",
379
- x2: "18",
380
- y2: "18"
381
- }, null, -1)
382
- ])])) : (f(), w("svg", Ce, [...i[3] || (i[3] = [
383
- s("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }, null, -1)
384
- ])]))
385
- ])
712
+ y(l).unreadCount > 0 ? (c(), v("div", nt, T(y(l).unreadCount), 1)) : I("", !0),
713
+ e("div", ot, [
714
+ _(G, { name: "gig-icon-spin" }, {
715
+ default: A(() => [
716
+ y(l).isWidgetOpen ? (c(), v("svg", lt, [...r[4] || (r[4] = [
717
+ e("line", {
718
+ x1: "18",
719
+ y1: "6",
720
+ x2: "6",
721
+ y2: "18"
722
+ }, null, -1),
723
+ e("line", {
724
+ x1: "6",
725
+ y1: "6",
726
+ x2: "18",
727
+ y2: "18"
728
+ }, null, -1)
729
+ ])])) : (c(), v("svg", at, [...r[3] || (r[3] = [
730
+ e("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }, null, -1)
731
+ ])]))
732
+ ]),
733
+ _: 1
734
+ })
735
+ ])
736
+ ], 2)
386
737
  ]));
387
738
  }
388
- }), Te = {
389
- install: (e) => {
390
- e.component("GigSupportChat", Me);
739
+ }), ct = {
740
+ install: (n) => {
741
+ n.component("GigSupportChat", rt);
391
742
  }
392
743
  };
393
744
  export {
394
- Me as GigSupportChat,
395
- Te as default,
396
- ie as useSupportChat
745
+ rt as GigSupportChat,
746
+ ct as default,
747
+ J as useSupportChat
397
748
  };