padorixnpm 0.0.70 → 0.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-panel-BVGlOImf.js → chat-panel-N3AY-SGW.js} +1029 -1010
- package/dist/chat-panel-N3AY-SGW.js.map +1 -0
- package/dist/chat-panel-skeleton-Br7Bmq0L.js +420 -0
- package/dist/chat-panel-skeleton-Br7Bmq0L.js.map +1 -0
- package/dist/chats/chatScreen/chat-container.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-conversation-selector.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-conversation.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-lobby.d.ts.map +1 -1
- package/dist/chats/chatScreen/chat-panel-skeleton.d.ts +7 -0
- package/dist/chats/chatScreen/chat-panel-skeleton.d.ts.map +1 -0
- package/dist/chats/chatScreen/styles.d.ts +4 -0
- package/dist/chats/chatScreen/styles.d.ts.map +1 -1
- package/dist/chats/chatform/chat-form-component.d.ts +4 -0
- package/dist/chats/chatform/chat-form-component.d.ts.map +1 -1
- package/dist/chats/chatform/chat-form.d.ts +2 -2
- package/dist/chats/chatform/chat-form.d.ts.map +1 -1
- package/dist/chats/chatform/chat-image-upload.d.ts +2 -2
- package/dist/chats/chatform/chat-image-upload.d.ts.map +1 -1
- package/dist/chats/newchat/new-chat.d.ts.map +1 -1
- package/dist/config-Cgly4edG.js.map +1 -1
- package/dist/global.d.ts +8 -1
- package/dist/global.d.ts.map +1 -1
- package/dist/padorixnpm.css +1 -1
- package/dist/padorixnpm.js +116 -100
- package/dist/padorixnpm.js.map +1 -1
- package/dist/padorixnpm.umd.cjs +9 -9
- package/dist/padorixnpm.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/chat-panel-BVGlOImf.js.map +0 -1
- package/dist/widget-api-2bTO9wMA.js +0 -356
- package/dist/widget-api-2bTO9wMA.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o,
|
|
2
|
-
import
|
|
3
|
-
import { useDispatch as
|
|
4
|
-
import
|
|
5
|
-
import { Add as
|
|
6
|
-
import { Fade as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { MantineProvider as
|
|
1
|
+
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, P as s, S as c, T as l, _ as u, b as d, d as f, f as p, g as m, j as h, k as g, l as _, m as v, n as y, o as b, s as x, t as S, v as C, w, x as T, y as E } from "./chat-panel-skeleton-Br7Bmq0L.js";
|
|
2
|
+
import D, { i as O, n as ee, r as k, t as te } from "./notification-ChYfFRqp.js";
|
|
3
|
+
import { useDispatch as A, useSelector as j } from "react-redux";
|
|
4
|
+
import M, { createElement as N, forwardRef as P, useState as F } from "react";
|
|
5
|
+
import { Add as I, ArrowDown2 as L, ArrowForward as ne, ArrowLeft2 as re, Copy as ie, DocumentDownload as ae, EmojiHappy as oe, Global as R, Minus as se, Send as z, Star1 as ce, Trash as le } from "iconsax-reactjs";
|
|
6
|
+
import { Fade as B, JackInTheBox as ue, Slide as de } from "react-awesome-reveal";
|
|
7
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
8
|
+
import { MantineProvider as W, Modal as fe, Popover as G } from "@mantine/core";
|
|
9
9
|
import K from "dayjs";
|
|
10
|
-
import { useDisclosure as
|
|
11
|
-
import { useForm as
|
|
10
|
+
import { useDisclosure as pe } from "@mantine/hooks";
|
|
11
|
+
import { useForm as me } from "@mantine/form";
|
|
12
12
|
//#region lib/chats/chatform/chat-text-input.tsx
|
|
13
|
-
var q = 120, J = 2500,
|
|
14
|
-
let { sender: s } =
|
|
15
|
-
|
|
13
|
+
var q = 120, J = 2500, he = 1500, ge = P(({ setMessage: e, message: t, userType: n, onImagePasted: r, onSubmit: i, ...a }, o) => {
|
|
14
|
+
let { sender: s } = j((e) => e.data), c = M.useRef(null), l = M.useRef(0), u = M.useRef(!1);
|
|
15
|
+
M.useImperativeHandle(o, () => c.current), M.useLayoutEffect(() => {
|
|
16
16
|
let e = c.current;
|
|
17
17
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, q)}px`, e.style.overflowY = e.scrollHeight > q ? "auto" : "hidden");
|
|
18
18
|
}, [t]);
|
|
@@ -25,12 +25,12 @@ var q = 120, J = 2500, me = 1500, he = M(({ setMessage: e, message: t, userType:
|
|
|
25
25
|
r && n.push(r);
|
|
26
26
|
}
|
|
27
27
|
n.length > 0 && (e.preventDefault(), r?.(n));
|
|
28
|
-
}, f =
|
|
28
|
+
}, f = M.useCallback((t) => {
|
|
29
29
|
e(t.target.value);
|
|
30
|
-
}, [e]), p =
|
|
31
|
-
u.current && (u.current = !1, l.current = 0,
|
|
30
|
+
}, [e]), p = M.useCallback((e) => {
|
|
31
|
+
u.current && (u.current = !1, l.current = 0, O.emit(k.not_typing, e));
|
|
32
32
|
}, []);
|
|
33
|
-
|
|
33
|
+
M.useEffect(() => {
|
|
34
34
|
let e = s?.conversationId;
|
|
35
35
|
if (!e) return;
|
|
36
36
|
let r = {
|
|
@@ -43,8 +43,8 @@ var q = 120, J = 2500, me = 1500, he = M(({ setMessage: e, message: t, userType:
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
let i = Date.now();
|
|
46
|
-
i - l.current > J && (l.current = i, u.current = !0,
|
|
47
|
-
let a = window.setTimeout(() => p(r),
|
|
46
|
+
i - l.current > J && (l.current = i, u.current = !0, O.emit(k.is_typing, r));
|
|
47
|
+
let a = window.setTimeout(() => p(r), he);
|
|
48
48
|
return () => {
|
|
49
49
|
window.clearTimeout(a);
|
|
50
50
|
};
|
|
@@ -54,7 +54,7 @@ var q = 120, J = 2500, me = 1500, he = M(({ setMessage: e, message: t, userType:
|
|
|
54
54
|
s?.senderId,
|
|
55
55
|
n,
|
|
56
56
|
p
|
|
57
|
-
]),
|
|
57
|
+
]), M.useEffect(() => {
|
|
58
58
|
let e = s?.conversationId;
|
|
59
59
|
return () => {
|
|
60
60
|
e && p({
|
|
@@ -78,9 +78,9 @@ var q = 120, J = 2500, me = 1500, he = M(({ setMessage: e, message: t, userType:
|
|
|
78
78
|
userType: n
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ H("div", {
|
|
82
82
|
className: "padorix:w-full padorix:bg-slate-100 padorix:rounded-lg",
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ H("textarea", {
|
|
84
84
|
ref: c,
|
|
85
85
|
...a,
|
|
86
86
|
spellCheck: !0,
|
|
@@ -97,27 +97,27 @@ var q = 120, J = 2500, me = 1500, he = M(({ setMessage: e, message: t, userType:
|
|
|
97
97
|
rows: 1
|
|
98
98
|
})
|
|
99
99
|
});
|
|
100
|
-
}),
|
|
100
|
+
}), _e = {
|
|
101
101
|
color: void 0,
|
|
102
102
|
size: void 0,
|
|
103
103
|
className: void 0,
|
|
104
104
|
style: void 0,
|
|
105
105
|
attr: void 0
|
|
106
|
-
},
|
|
106
|
+
}, ve = M.createContext && /*#__PURE__*/ M.createContext(_e), ye = [
|
|
107
107
|
"attr",
|
|
108
108
|
"size",
|
|
109
109
|
"title"
|
|
110
110
|
];
|
|
111
|
-
function
|
|
111
|
+
function be(e, t) {
|
|
112
112
|
if (e == null) return {};
|
|
113
|
-
var n, r, i =
|
|
113
|
+
var n, r, i = xe(e, t);
|
|
114
114
|
if (Object.getOwnPropertySymbols) {
|
|
115
115
|
var a = Object.getOwnPropertySymbols(e);
|
|
116
116
|
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
117
117
|
}
|
|
118
118
|
return i;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function xe(e, t) {
|
|
121
121
|
if (e == null) return {};
|
|
122
122
|
var n = {};
|
|
123
123
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -126,16 +126,16 @@ function ye(e, t) {
|
|
|
126
126
|
}
|
|
127
127
|
return n;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
return
|
|
129
|
+
function Y() {
|
|
130
|
+
return Y = Object.assign ? Object.assign.bind() : function(e) {
|
|
131
131
|
for (var t = 1; t < arguments.length; t++) {
|
|
132
132
|
var n = arguments[t];
|
|
133
133
|
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
134
134
|
}
|
|
135
135
|
return e;
|
|
136
|
-
},
|
|
136
|
+
}, Y.apply(null, arguments);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Se(e, t) {
|
|
139
139
|
var n = Object.keys(e);
|
|
140
140
|
if (Object.getOwnPropertySymbols) {
|
|
141
141
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -145,30 +145,30 @@ function be(e, t) {
|
|
|
145
145
|
}
|
|
146
146
|
return n;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function X(e) {
|
|
149
149
|
for (var t = 1; t < arguments.length; t++) {
|
|
150
150
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
151
|
-
t % 2 ?
|
|
152
|
-
|
|
153
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
151
|
+
t % 2 ? Se(Object(n), !0).forEach(function(t) {
|
|
152
|
+
Ce(e, t, n[t]);
|
|
153
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Se(Object(n)).forEach(function(t) {
|
|
154
154
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
return e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
return (t =
|
|
159
|
+
function Ce(e, t, n) {
|
|
160
|
+
return (t = we(t)) in e ? Object.defineProperty(e, t, {
|
|
161
161
|
value: n,
|
|
162
162
|
enumerable: !0,
|
|
163
163
|
configurable: !0,
|
|
164
164
|
writable: !0
|
|
165
165
|
}) : e[t] = n, e;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
var t =
|
|
167
|
+
function we(e) {
|
|
168
|
+
var t = Te(e, "string");
|
|
169
169
|
return typeof t == "symbol" ? t : t + "";
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Te(e, t) {
|
|
172
172
|
if (typeof e != "object" || !e) return e;
|
|
173
173
|
var n = e[Symbol.toPrimitive];
|
|
174
174
|
if (n !== void 0) {
|
|
@@ -178,28 +178,28 @@ function we(e, t) {
|
|
|
178
178
|
}
|
|
179
179
|
return (t === "string" ? String : Number)(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return e && e.map((e, t) => /*#__PURE__*/
|
|
181
|
+
function Ee(e) {
|
|
182
|
+
return e && e.map((e, t) => /*#__PURE__*/ M.createElement(e.tag, X({ key: t }, e.attr), Ee(e.child)));
|
|
183
183
|
}
|
|
184
184
|
function Z(e) {
|
|
185
|
-
return (t) => /*#__PURE__*/
|
|
185
|
+
return (t) => /*#__PURE__*/ M.createElement(De, Y({ attr: X({}, e.attr) }, t), Ee(e.child));
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function De(e) {
|
|
188
188
|
var t = (t) => {
|
|
189
|
-
var { attr: n, size: r, title: i } = e, a =
|
|
190
|
-
return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/
|
|
189
|
+
var { attr: n, size: r, title: i } = e, a = be(e, ye), o = r || t.size || "1em", s;
|
|
190
|
+
return t.className && (s = t.className), e.className && (s = (s ? s + " " : "") + e.className), /*#__PURE__*/ M.createElement("svg", Y({
|
|
191
191
|
stroke: "currentColor",
|
|
192
192
|
fill: "currentColor",
|
|
193
193
|
strokeWidth: "0"
|
|
194
194
|
}, t.attr, n, a, {
|
|
195
195
|
className: s,
|
|
196
|
-
style:
|
|
196
|
+
style: X(X({ color: e.color || t.color }, t.style), e.style),
|
|
197
197
|
height: o,
|
|
198
198
|
width: o,
|
|
199
199
|
xmlns: "http://www.w3.org/2000/svg"
|
|
200
|
-
}), i && /*#__PURE__*/
|
|
200
|
+
}), i && /*#__PURE__*/ M.createElement("title", null, i), e.children);
|
|
201
201
|
};
|
|
202
|
-
return
|
|
202
|
+
return ve === void 0 ? t(_e) : /*#__PURE__*/ M.createElement(ve.Consumer, null, (e) => t(e));
|
|
203
203
|
}
|
|
204
204
|
//#endregion
|
|
205
205
|
//#region node_modules/react-icons/fi/index.mjs
|
|
@@ -235,7 +235,7 @@ function Q(e) {
|
|
|
235
235
|
}]
|
|
236
236
|
})(e);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Oe(e) {
|
|
239
239
|
return Z({
|
|
240
240
|
tag: "svg",
|
|
241
241
|
attr: {
|
|
@@ -258,7 +258,7 @@ function De(e) {
|
|
|
258
258
|
}]
|
|
259
259
|
})(e);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function ke(e) {
|
|
262
262
|
return Z({
|
|
263
263
|
tag: "svg",
|
|
264
264
|
attr: {
|
|
@@ -293,7 +293,7 @@ function Oe(e) {
|
|
|
293
293
|
]
|
|
294
294
|
})(e);
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Ae(e) {
|
|
297
297
|
return Z({
|
|
298
298
|
tag: "svg",
|
|
299
299
|
attr: {
|
|
@@ -311,7 +311,7 @@ function ke(e) {
|
|
|
311
311
|
}]
|
|
312
312
|
})(e);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function je(e) {
|
|
315
315
|
return Z({
|
|
316
316
|
tag: "svg",
|
|
317
317
|
attr: {
|
|
@@ -331,54 +331,54 @@ function Ae(e) {
|
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region lib/chats/chatmessages/chat-display-reply.tsx
|
|
334
|
-
function
|
|
335
|
-
let
|
|
336
|
-
function
|
|
337
|
-
n(
|
|
334
|
+
function Me(e) {
|
|
335
|
+
let t = A(), r = Array.isArray(e.data?.message) ? e.data.message.join(" ") : String(e.data?.message ?? "");
|
|
336
|
+
function i() {
|
|
337
|
+
t(n(void 0)), t(h(void 0));
|
|
338
338
|
}
|
|
339
|
-
if (
|
|
340
|
-
className:
|
|
341
|
-
children: /* @__PURE__ */
|
|
339
|
+
if (e.data?.id) return /* @__PURE__ */ H("div", {
|
|
340
|
+
className: e.styles.replyContainer,
|
|
341
|
+
children: /* @__PURE__ */ H("div", {
|
|
342
342
|
className: "padorix-fade-in padorix:bg-white padorix:w-[96%] padorix:mx-auto padorix:py-0.5",
|
|
343
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ H("div", { children: /* @__PURE__ */ H("div", {
|
|
344
344
|
className: "padorix:px-2",
|
|
345
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ U("div", {
|
|
346
346
|
className: "padorix:bg-white padorix:rounded-tl-lg padorix:rounded-tr-lg padorix:border-t padorix:border-x padorix:border-gray-200 padorix:shadow-inner padorix:text-zinc-600 padorix:px-4 padorix:flex padorix:items-center padorix:justify-between",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ U("div", {
|
|
348
348
|
className: "padorix:flex padorix:items-center padorix:py-2.5 padorix:text-sm",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
350
|
-
}), /* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ H(ne, { className: "padorix:inline padorix:size-6 padorix:mr-3" }), r.length > 0 && /* @__PURE__ */ U("span", { children: [r.slice(0, 30), r.length > 30 ? "..." : ""] })]
|
|
350
|
+
}), /* @__PURE__ */ U("div", {
|
|
351
351
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
352
|
-
children: [Number(
|
|
352
|
+
children: [Number(e.data?.images?.length) > 0 && /* @__PURE__ */ U("div", {
|
|
353
353
|
className: "padorix:flex padorix:gap-1 padorix:flex-row",
|
|
354
|
-
children: [Array.isArray(
|
|
354
|
+
children: [Array.isArray(e?.data?.images) && e?.data?.images?.slice(0, 2)?.map((e, t) => /* @__PURE__ */ H("img", {
|
|
355
355
|
src: e,
|
|
356
356
|
alt: "Padorix",
|
|
357
357
|
className: "padorix:size-10 padorix:bg-slate-800 padorix:inline padorix:object-contain"
|
|
358
|
-
}, t)), Number(
|
|
358
|
+
}, t)), Number(e.data?.images?.length) > 2 && /* @__PURE__ */ U("div", {
|
|
359
359
|
className: "padorix:flex padorix:items-center",
|
|
360
360
|
children: [
|
|
361
361
|
" ",
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ H(I, { className: "padorix:inline padorix:size-5" }),
|
|
363
363
|
" ",
|
|
364
|
-
Number(
|
|
364
|
+
Number(e.data?.images?.length) - 2,
|
|
365
365
|
" "
|
|
366
366
|
]
|
|
367
367
|
})]
|
|
368
|
-
}), /* @__PURE__ */
|
|
369
|
-
onClick:
|
|
368
|
+
}), /* @__PURE__ */ H("div", {
|
|
369
|
+
onClick: i,
|
|
370
370
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-95",
|
|
371
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ H(Q, { className: "padorix:inline padorix:size-6 padorix:mr-3" })
|
|
372
372
|
})]
|
|
373
373
|
})]
|
|
374
374
|
})
|
|
375
375
|
}) })
|
|
376
|
-
},
|
|
376
|
+
}, e.data.id)
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
//#endregion
|
|
380
380
|
//#region lib/chats/chatform/emoji-picker.tsx
|
|
381
|
-
var
|
|
381
|
+
var Ne = [
|
|
382
382
|
{
|
|
383
383
|
name: "Smileys",
|
|
384
384
|
icon: "😀",
|
|
@@ -429,18 +429,18 @@ var Me = [
|
|
|
429
429
|
icon: "✅",
|
|
430
430
|
emojis: "✅ ☑️ ✔️ ❌ ❎ ➕ ➖ ➗ ✖️ ❓ ❔ ❗ ❕ ‼️ ⁉️ ⚠️ 🚫 ⛔ 🔞 ♻️ 🆗 🆕 🆓 🆒 🆘 🔝 🔜 ⏩ ⏪ ▶️ ⏸️ ⏹️ 🔁 🔄 ⬆️ ⬇️ ⬅️ ➡️ ↩️ ℹ️ 🔴 🟠 🟡 🟢 🔵 🟣 ⚫ ⚪ 🟥 🟩 🟦 💲 ©️ ®️ ™️ 🔔 🔕 💬 💭 🗯️"
|
|
431
431
|
}
|
|
432
|
-
],
|
|
433
|
-
function
|
|
432
|
+
], Pe = "padorix-recent-emojis", Fe = 24;
|
|
433
|
+
function Ie() {
|
|
434
434
|
try {
|
|
435
|
-
let e = JSON.parse(localStorage.getItem(
|
|
436
|
-
return Array.isArray(e) ? e.filter((e) => typeof e == "string").slice(0,
|
|
435
|
+
let e = JSON.parse(localStorage.getItem(Pe) || "[]");
|
|
436
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "string").slice(0, Fe) : [];
|
|
437
437
|
} catch {
|
|
438
438
|
return [];
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
let [t, n] =
|
|
443
|
-
|
|
441
|
+
function Le(e) {
|
|
442
|
+
let [t, n] = M.useState(Ie), [r, i] = M.useState(() => Ie().length > 0 ? "Recent" : Ne[0].name), a = M.useRef(null);
|
|
443
|
+
M.useEffect(() => {
|
|
444
444
|
let t = (t) => {
|
|
445
445
|
let n = t.composedPath();
|
|
446
446
|
a.current && n.includes(a.current) || e.toggleRef?.current && n.includes(e.toggleRef.current) || e.onClose();
|
|
@@ -453,25 +453,25 @@ function Ie(e) {
|
|
|
453
453
|
}, [e.onClose, e.toggleRef]);
|
|
454
454
|
function o(r) {
|
|
455
455
|
e.onSelect(r);
|
|
456
|
-
let i = [r, ...t.filter((e) => e !== r)].slice(0,
|
|
456
|
+
let i = [r, ...t.filter((e) => e !== r)].slice(0, Fe);
|
|
457
457
|
n(i);
|
|
458
458
|
try {
|
|
459
|
-
localStorage.setItem(
|
|
459
|
+
localStorage.setItem(Pe, JSON.stringify(i));
|
|
460
460
|
} catch {}
|
|
461
461
|
}
|
|
462
462
|
let s = [...t.length > 0 ? [{
|
|
463
463
|
name: "Recent",
|
|
464
464
|
icon: "🕘"
|
|
465
|
-
}] : [], ...
|
|
466
|
-
return /* @__PURE__ */
|
|
465
|
+
}] : [], ...Ne], c = r === "Recent" ? t : Ne.find((e) => e.name === r)?.emojis.split(" ") ?? [];
|
|
466
|
+
return /* @__PURE__ */ U("div", {
|
|
467
467
|
ref: a,
|
|
468
468
|
role: "dialog",
|
|
469
469
|
"aria-label": "Emoji picker",
|
|
470
470
|
className: "padorix:w-[min(20rem,calc(100vw-2rem))] padorix:rounded-xl padorix:border padorix:border-gray-200 padorix:bg-white padorix:shadow-lg padorix:overflow-hidden",
|
|
471
471
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ H("div", {
|
|
473
473
|
className: "padorix:flex padorix:gap-0.5 padorix:overflow-x-auto padorix-scrolls padorix:border-b padorix:border-gray-200 padorix:px-1 padorix:py-1",
|
|
474
|
-
children: s.map((e) => /* @__PURE__ */
|
|
474
|
+
children: s.map((e) => /* @__PURE__ */ H("button", {
|
|
475
475
|
type: "button",
|
|
476
476
|
title: e.name,
|
|
477
477
|
"aria-pressed": r === e.name,
|
|
@@ -480,13 +480,13 @@ function Ie(e) {
|
|
|
480
480
|
children: e.icon
|
|
481
481
|
}, e.name))
|
|
482
482
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ H("div", {
|
|
484
484
|
className: "padorix:px-2 padorix:pt-1.5 padorix:text-xs padorix:text-gray-500",
|
|
485
485
|
children: r
|
|
486
486
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ H("div", {
|
|
488
488
|
className: "padorix:grid padorix:grid-cols-8 padorix:gap-0.5 padorix:p-1.5 padorix:h-52 padorix:overflow-y-auto padorix-scrolls",
|
|
489
|
-
children: c.map((e, t) => /* @__PURE__ */
|
|
489
|
+
children: c.map((e, t) => /* @__PURE__ */ H("button", {
|
|
490
490
|
type: "button",
|
|
491
491
|
onClick: () => o(e),
|
|
492
492
|
className: "padorix:size-8 padorix:rounded-md padorix:text-xl padorix:leading-none padorix:cursor-pointer padorix:hover:bg-gray-100",
|
|
@@ -498,8 +498,8 @@ function Ie(e) {
|
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region lib/chats/chatform/chat-form.tsx
|
|
501
|
-
function
|
|
502
|
-
let { sender: t, workspace: n, message: r } =
|
|
501
|
+
function Re(e) {
|
|
502
|
+
let { sender: t, workspace: n, message: r } = j((e) => e.data), [i, a] = M.useState(!1), o = M.useRef(null), s = M.useCallback(() => a(!1), []), [c, l] = M.useState(""), u = M.useRef(null), d = Number(e.previews?.length) < 1, f = Math.max(0, Number(n?.tier?.max_file_upload ?? 2)), p = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), m = n?.file_uploads_date === p ? Number(n?.file_uploads_used ?? 0) : 0, h = e.showFile && m + e.pendingFileCount < f;
|
|
503
503
|
function g(e) {
|
|
504
504
|
let t = u.current, n = t?.value ?? c, r = t && !(t.selectionStart === 0 && t.selectionEnd === 0 && n.length > 0), i = r ? t.selectionStart : n.length, a = r ? t.selectionEnd : n.length;
|
|
505
505
|
l(n.substring(0, i) + e + n.substring(a)), requestAnimationFrame(() => {
|
|
@@ -510,7 +510,7 @@ function Le(e) {
|
|
|
510
510
|
}
|
|
511
511
|
function _() {
|
|
512
512
|
if (d && !c || e.isSending) return;
|
|
513
|
-
t?.conversationId &&
|
|
513
|
+
t?.conversationId && O.emit(k.not_typing, {
|
|
514
514
|
conversationId: t.conversationId,
|
|
515
515
|
senderId: t.senderId,
|
|
516
516
|
userType: e.userType
|
|
@@ -524,29 +524,29 @@ function Le(e) {
|
|
|
524
524
|
};
|
|
525
525
|
e.sendChat(r), l("");
|
|
526
526
|
}
|
|
527
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ U("div", {
|
|
528
528
|
className: "padorix:relative",
|
|
529
|
-
children: [i && /* @__PURE__ */
|
|
529
|
+
children: [i && /* @__PURE__ */ H("div", {
|
|
530
530
|
className: e.styles.emojiContainer,
|
|
531
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ H(Le, {
|
|
532
532
|
onSelect: g,
|
|
533
533
|
onClose: s,
|
|
534
534
|
toggleRef: o
|
|
535
535
|
})
|
|
536
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ U("div", {
|
|
537
537
|
className: e.styles.formContainer,
|
|
538
|
-
children: [r?.id && /* @__PURE__ */
|
|
538
|
+
children: [r?.id && /* @__PURE__ */ H(Me, {
|
|
539
539
|
styles: e.styles,
|
|
540
540
|
data: r
|
|
541
|
-
}), /* @__PURE__ */
|
|
541
|
+
}), /* @__PURE__ */ U("div", {
|
|
542
542
|
className: "padorix:flex padorix:items-center padorix:justify-center padorix:rounded-lg padorix:p-0.5 padorix:relative padorix:gap-1",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
543
|
+
children: [/* @__PURE__ */ U("div", {
|
|
544
544
|
className: "padorix:flex padorix:items-center padorix:gap-1 padorix:bg-gray-100 padorix:w-full padorix:rounded-lg",
|
|
545
545
|
children: [
|
|
546
|
-
h && /* @__PURE__ */
|
|
546
|
+
h && /* @__PURE__ */ U("label", {
|
|
547
547
|
title: "Attach images",
|
|
548
548
|
className: "padorix:cursor-pointer padorix:px-1 padorix:text-[#99a1af]",
|
|
549
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ H(I, {}), /* @__PURE__ */ H("input", {
|
|
550
550
|
type: "file",
|
|
551
551
|
accept: ".png,.jpg,.jpeg,.webp",
|
|
552
552
|
hidden: !0,
|
|
@@ -554,7 +554,7 @@ function Le(e) {
|
|
|
554
554
|
multiple: !0
|
|
555
555
|
})]
|
|
556
556
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ U("div", {
|
|
558
558
|
ref: o,
|
|
559
559
|
role: "button",
|
|
560
560
|
"aria-label": "Insert emoji",
|
|
@@ -564,13 +564,13 @@ function Le(e) {
|
|
|
564
564
|
className: "padorix:text-[#99a1af] padorix:cursor-pointer padorix:px-1 padorix:transition-all",
|
|
565
565
|
children: [
|
|
566
566
|
" ",
|
|
567
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ H(oe, {}),
|
|
568
568
|
" "
|
|
569
569
|
]
|
|
570
570
|
}),
|
|
571
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ H("div", {
|
|
572
572
|
className: "padorix:w-full",
|
|
573
|
-
children: /* @__PURE__ */
|
|
573
|
+
children: /* @__PURE__ */ H(ge, {
|
|
574
574
|
ref: u,
|
|
575
575
|
message: c,
|
|
576
576
|
setMessage: l,
|
|
@@ -579,14 +579,14 @@ function Le(e) {
|
|
|
579
579
|
})
|
|
580
580
|
})
|
|
581
581
|
]
|
|
582
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ H("div", { children: /* @__PURE__ */ U("div", {
|
|
583
583
|
onClick: _,
|
|
584
584
|
style: {
|
|
585
585
|
background: d && !c || e.isSending ? "#9f9fa9" : String(n?.widget?.colorScheme),
|
|
586
586
|
cursor: d && !c || e.isSending ? "not-allowed" : "pointer"
|
|
587
587
|
},
|
|
588
588
|
className: "padorix:-mt-1 padorix:size-10 padorix:text-white padorix:rounded-lg padorix:flex padorix:last:items-center padorix:justify-center",
|
|
589
|
-
children: [" ", /* @__PURE__ */
|
|
589
|
+
children: [" ", /* @__PURE__ */ H(z, { className: "padorix:size-6" })]
|
|
590
590
|
}) })]
|
|
591
591
|
})]
|
|
592
592
|
})]
|
|
@@ -594,81 +594,81 @@ function Le(e) {
|
|
|
594
594
|
}
|
|
595
595
|
//#endregion
|
|
596
596
|
//#region lib/chats/chatform/chat-image-upload.tsx
|
|
597
|
-
function
|
|
598
|
-
let { workspace: t } =
|
|
599
|
-
|
|
600
|
-
image: e.previews?.[0]?.img
|
|
601
|
-
});
|
|
602
|
-
function s(t) {
|
|
597
|
+
function ze(e) {
|
|
598
|
+
let { workspace: t } = j((e) => e.data), n = Math.max(0, Number(t?.tier?.max_file_upload ?? 2)), r = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), i = t?.file_uploads_date === r ? Number(t?.file_uploads_used ?? 0) : 0, [a, o] = M.useState(e.previews?.[0]?.id), s = e.previews?.find((e) => e.id === a) ?? e.previews?.[0];
|
|
599
|
+
function c(t) {
|
|
603
600
|
e.sendChat(t);
|
|
604
601
|
}
|
|
605
|
-
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */
|
|
602
|
+
if (Number(e.previews?.length || 0) > 0) return /* @__PURE__ */ U("div", {
|
|
606
603
|
className: e.styles.imageUploadContainer,
|
|
607
604
|
children: [
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
className:
|
|
610
|
-
children: [/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ U("div", {
|
|
606
|
+
className: `padorix:relative padorix:border padorix:border-gray-300 padorix:py-3 padorix:bg-white ${e.styles.imagePreviewBox}`,
|
|
607
|
+
children: [/* @__PURE__ */ H("div", {
|
|
611
608
|
className: "padorix:py-0 padorix:px-2 padorix:pt-1.5 padorix:absolute padorix:top-0 padorix:right-0 padorix:w-full padorix:bg-white",
|
|
612
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ U("div", {
|
|
613
610
|
onClick: e.DiscardAllImages,
|
|
614
611
|
className: "padorix:size-fit padorix:ml-auto padorix:text-red-600 padorix:cursor-pointer padorix:text-xl",
|
|
615
612
|
children: [
|
|
616
613
|
" ",
|
|
617
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ H(Q, {}),
|
|
618
615
|
" "
|
|
619
616
|
]
|
|
620
617
|
})
|
|
621
|
-
}), /* @__PURE__ */
|
|
622
|
-
src:
|
|
623
|
-
loading: "lazy",
|
|
618
|
+
}), /* @__PURE__ */ H("img", {
|
|
619
|
+
src: s?.img,
|
|
624
620
|
className: "padorix:size-full padorix:mx-auto padorix:object-contain"
|
|
625
621
|
})]
|
|
626
622
|
}),
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1 padorix:max-w-[98%] padorix:mx-auto",
|
|
629
|
-
children: [/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ U("div", {
|
|
624
|
+
className: "padorix:shrink-0 padorix:flex padorix:items-center padorix:justify-center padorix:gap-1 padorix:max-w-[98%] padorix:mx-auto",
|
|
625
|
+
children: [/* @__PURE__ */ H("div", {
|
|
630
626
|
className: "padorix:overflow-y-hidden padorix:overflow-x-auto",
|
|
631
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ H("div", {
|
|
632
628
|
className: "padorix:w-fit",
|
|
633
|
-
children: /* @__PURE__ */
|
|
629
|
+
children: /* @__PURE__ */ H("div", {
|
|
634
630
|
className: "padorix:flex padorix:items-center padorix:justify-center padorix:gap-1",
|
|
635
|
-
children: e.previews?.map((n, r) => /* @__PURE__ */
|
|
636
|
-
style: { border: `3.5px solid ${
|
|
631
|
+
children: e.previews?.map((n, r) => /* @__PURE__ */ U("div", {
|
|
632
|
+
style: { border: `3.5px solid ${s?.id === n.id ? String(t?.widget?.colorScheme) : "transparent"}` },
|
|
637
633
|
className: "padorix:relative padorix:size-14 padorix:border-2 padorix:rounded-lg",
|
|
638
|
-
children: [
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
onClick: () => o({
|
|
651
|
-
index: r,
|
|
652
|
-
image: n?.img
|
|
634
|
+
children: [
|
|
635
|
+
/* @__PURE__ */ H("div", {
|
|
636
|
+
onClick: () => e.DiscardSingleImage(r),
|
|
637
|
+
className: "padorix:absolute padorix:top-0 padorix:left-0 padorix:w-full padorix:bg-slate-700 padorix:rounded-t-sm",
|
|
638
|
+
children: /* @__PURE__ */ U("div", {
|
|
639
|
+
className: "padorix:size-fit padorix:ml-auto padorix:cursor-pointer padorix:text-[#ef4444] padorix:text-sm",
|
|
640
|
+
children: [
|
|
641
|
+
" ",
|
|
642
|
+
/* @__PURE__ */ H(Q, {}),
|
|
643
|
+
" "
|
|
644
|
+
]
|
|
645
|
+
})
|
|
653
646
|
}),
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
647
|
+
/* @__PURE__ */ H("img", {
|
|
648
|
+
onClick: () => o(n.id),
|
|
649
|
+
src: n?.img,
|
|
650
|
+
className: "padorix:size-full padorix:cursor-pointer padorix:rounded-md padorix:object-cover"
|
|
651
|
+
}),
|
|
652
|
+
n.status === "uploading" && /* @__PURE__ */ H("div", {
|
|
653
|
+
title: "Uploading…",
|
|
654
|
+
className: "padorix:absolute padorix:inset-0 padorix:flex padorix:items-center padorix:justify-center padorix:bg-white/50 padorix:rounded-md padorix:pointer-events-none",
|
|
655
|
+
children: /* @__PURE__ */ H("div", { className: "padorix:size-5 padorix:rounded-full padorix:border-2 padorix:border-gray-300 padorix:border-t-gray-600 padorix:animate-spin" })
|
|
656
|
+
})
|
|
657
|
+
]
|
|
658
|
+
}, n.id))
|
|
659
659
|
})
|
|
660
660
|
})
|
|
661
|
-
}), i + e.pendingFileCount < n && /* @__PURE__ */
|
|
661
|
+
}), i + e.pendingFileCount < n && /* @__PURE__ */ H("div", {
|
|
662
662
|
className: "",
|
|
663
|
-
children: /* @__PURE__ */
|
|
663
|
+
children: /* @__PURE__ */ H("div", {
|
|
664
664
|
style: {
|
|
665
665
|
borderColor: `${t?.widget?.colorScheme}`,
|
|
666
666
|
color: String(t?.widget?.colorScheme)
|
|
667
667
|
},
|
|
668
668
|
className: "padorix:size-12 padorix:border padorix:sticky padorix:left-0 padorix:cursor-pointer padorix:rounded-md padorix:flex padorix:items-center padorix:justify-center",
|
|
669
|
-
children: /* @__PURE__ */
|
|
669
|
+
children: /* @__PURE__ */ U("label", {
|
|
670
670
|
className: "padorix:cursor-pointer",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ H(I, {}), /* @__PURE__ */ H("input", {
|
|
672
672
|
type: "file",
|
|
673
673
|
accept: ".png,.jpg,.jpeg,.webp",
|
|
674
674
|
hidden: !0,
|
|
@@ -679,23 +679,27 @@ function Re(e) {
|
|
|
679
679
|
})
|
|
680
680
|
})]
|
|
681
681
|
}),
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
682
|
+
/* @__PURE__ */ H("div", {
|
|
683
|
+
className: "padorix:shrink-0",
|
|
684
|
+
children: /* @__PURE__ */ H(Re, {
|
|
685
|
+
showFile: !1,
|
|
686
|
+
pendingFileCount: e.pendingFileCount,
|
|
687
|
+
sendChat: c,
|
|
688
|
+
styles: e.styles,
|
|
689
|
+
userType: e.userType,
|
|
690
|
+
handleFile: e.handleFile,
|
|
691
|
+
isSending: e.isSending,
|
|
692
|
+
previews: e.previews
|
|
693
|
+
})
|
|
690
694
|
})
|
|
691
695
|
]
|
|
692
696
|
});
|
|
693
697
|
}
|
|
694
698
|
//#endregion
|
|
695
699
|
//#region lib/utils/use-chat-identity.ts
|
|
696
|
-
function
|
|
697
|
-
let { sender: t, workspace: n, conversation: r } =
|
|
698
|
-
return
|
|
700
|
+
function Be(e) {
|
|
701
|
+
let { sender: t, workspace: n, conversation: r } = j((e) => e.data), i = t?.workspaceId || n?.id || r?.workspaceId, a = t?.conversationId, o = t?.senderId, s = t?.userType || e, c = t?.fullName;
|
|
702
|
+
return M.useMemo(() => !i || !a || !o ? null : {
|
|
699
703
|
workspaceId: String(i),
|
|
700
704
|
conversationId: String(a),
|
|
701
705
|
senderId: String(o),
|
|
@@ -711,80 +715,101 @@ function ze(e) {
|
|
|
711
715
|
}
|
|
712
716
|
//#endregion
|
|
713
717
|
//#region lib/chats/chatform/chat-form-component.tsx
|
|
714
|
-
function
|
|
715
|
-
let [
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
718
|
+
function Ve(e) {
|
|
719
|
+
let [t, n] = M.useState([]), r = M.useRef([]), i = M.useRef(/* @__PURE__ */ new Map()), [a, o] = M.useState(!1), { sender: l, workspace: u } = j((e) => e.data), d = M.useRef(u);
|
|
720
|
+
d.current = u;
|
|
721
|
+
let f = A(), p = Be(e.userType), m = Math.max(0, Number(u?.tier?.max_file_upload ?? 2)), h = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), g = u?.file_uploads_date === h ? Number(u?.file_uploads_used ?? 0) : 0, _ = t.filter((e) => e.status === "uploading").length, y = M.useCallback((e) => {
|
|
722
|
+
r.current = e(r.current), n(r.current);
|
|
723
|
+
}, []);
|
|
724
|
+
M.useEffect(() => () => r.current.forEach((e) => URL.revokeObjectURL(e.img)), []);
|
|
725
|
+
function b(e) {
|
|
726
|
+
!p || e.length === 0 || v.removeImages(p, e).catch((e) => console.log(e.message));
|
|
722
727
|
}
|
|
723
|
-
|
|
724
|
-
let
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
728
|
+
function x(e) {
|
|
729
|
+
let t = (async () => {
|
|
730
|
+
try {
|
|
731
|
+
let t = await w([e], String(d.current?.id ?? "")), n = (Array.isArray(t) ? t : t?.images)?.[0];
|
|
732
|
+
if (!n) throw Error("Upload returned no image URL");
|
|
733
|
+
let i = Array.isArray(t) ? null : t, a = d.current;
|
|
734
|
+
if (i?.file_uploads_used !== void 0 && a && f(s({
|
|
735
|
+
...a,
|
|
736
|
+
file_uploads_used: i.file_uploads_used,
|
|
737
|
+
file_uploads_date: i.file_uploads_date
|
|
738
|
+
})), !r.current.some((t) => t.id === e.id)) return b([n]);
|
|
739
|
+
y((t) => t.map((t) => t.id === e.id ? {
|
|
740
|
+
...t,
|
|
741
|
+
status: "uploaded",
|
|
742
|
+
url: n
|
|
743
|
+
} : t));
|
|
744
|
+
} catch (t) {
|
|
745
|
+
console.log(`Image upload failed: ${t.message}`), URL.revokeObjectURL(e.img), y((t) => t.filter((t) => t.id !== e.id));
|
|
746
|
+
} finally {
|
|
747
|
+
i.current.delete(e.id);
|
|
748
|
+
}
|
|
749
|
+
})();
|
|
750
|
+
i.current.set(e.id, t);
|
|
751
|
+
}
|
|
752
|
+
let S = (e) => {
|
|
753
|
+
let t = e.target, n = Array.from(t.files ?? []).filter((e) => e.type.startsWith("image/"));
|
|
754
|
+
t.value = "";
|
|
755
|
+
let i = r.current.filter((e) => e.status === "uploading").length, a = Math.max(0, m - g - i), o = n.slice(0, a);
|
|
756
|
+
if (n.length > o.length && c(`You can attach up to ${m} images.`, "info"), o.length === 0) return;
|
|
757
|
+
let s = o.map((e) => ({
|
|
758
|
+
id: crypto.randomUUID(),
|
|
759
|
+
file: e,
|
|
760
|
+
img: URL.createObjectURL(e),
|
|
761
|
+
status: "uploading"
|
|
762
|
+
}));
|
|
763
|
+
y((e) => [...e, ...s]), s.forEach(x);
|
|
746
764
|
};
|
|
747
|
-
function
|
|
748
|
-
|
|
765
|
+
async function C(t) {
|
|
766
|
+
i.current.size > 0 && (o(!0), await Promise.allSettled([...i.current.values()]), o(!1));
|
|
767
|
+
let n = r.current, a = n.map((e) => e.url).filter(Boolean);
|
|
768
|
+
a.length === 0 && !t.message || (e.sendChat({
|
|
769
|
+
...t,
|
|
770
|
+
images: a
|
|
771
|
+
}), n.forEach((e) => URL.revokeObjectURL(e.img)), y(() => []));
|
|
749
772
|
}
|
|
750
|
-
function
|
|
751
|
-
let t =
|
|
752
|
-
|
|
773
|
+
function T(e) {
|
|
774
|
+
let t = r.current[e];
|
|
775
|
+
t && (URL.revokeObjectURL(t.img), y((e) => e.filter((e) => e.id !== t.id)), t.url && b([t.url]));
|
|
753
776
|
}
|
|
754
|
-
function
|
|
755
|
-
|
|
777
|
+
function E() {
|
|
778
|
+
let e = r.current.map((e) => e.url).filter(Boolean);
|
|
779
|
+
r.current.forEach((e) => URL.revokeObjectURL(e.img)), y(() => []), b(e);
|
|
756
780
|
}
|
|
757
|
-
|
|
781
|
+
let D = e.isSending || a;
|
|
782
|
+
return /* @__PURE__ */ U("div", {
|
|
758
783
|
className: e.styles.formRoot,
|
|
759
|
-
children: [
|
|
760
|
-
previews:
|
|
761
|
-
DiscardSingleImage:
|
|
762
|
-
DiscardAllImages:
|
|
784
|
+
children: [t.length > 0 && /* @__PURE__ */ H(ze, {
|
|
785
|
+
previews: t,
|
|
786
|
+
DiscardSingleImage: T,
|
|
787
|
+
DiscardAllImages: E,
|
|
763
788
|
styles: e.styles,
|
|
764
|
-
sendChat:
|
|
789
|
+
sendChat: C,
|
|
765
790
|
userType: e.userType,
|
|
766
|
-
senderId: String(
|
|
767
|
-
handleFile:
|
|
768
|
-
isSending:
|
|
769
|
-
pendingFileCount:
|
|
770
|
-
}), /* @__PURE__ */
|
|
771
|
-
sendChat:
|
|
772
|
-
previews:
|
|
791
|
+
senderId: String(l?.senderId),
|
|
792
|
+
handleFile: S,
|
|
793
|
+
isSending: D,
|
|
794
|
+
pendingFileCount: _
|
|
795
|
+
}), /* @__PURE__ */ H(Re, {
|
|
796
|
+
sendChat: C,
|
|
797
|
+
previews: t,
|
|
773
798
|
showFile: !0,
|
|
774
|
-
pendingFileCount:
|
|
799
|
+
pendingFileCount: _,
|
|
775
800
|
styles: e.styles,
|
|
776
801
|
userType: e.userType,
|
|
777
|
-
handleFile:
|
|
778
|
-
isSending:
|
|
802
|
+
handleFile: S,
|
|
803
|
+
isSending: D
|
|
779
804
|
})]
|
|
780
805
|
});
|
|
781
806
|
}
|
|
782
807
|
//#endregion
|
|
783
808
|
//#region lib/assets/images/wd__user.png
|
|
784
|
-
var
|
|
809
|
+
var He = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fHK0Njt8vFVYIBTXn5KVnfn7e1UYIBVYIHIztZWYIHx9fRWYoKkrLtWYIFWYoNXYYJXX4FWYYFWYYJWYoJdZ4ZXYoJrdpHl6utVYIBVYH9rdZBWYYFVYIBWXX1UXnzn7OxUX4BVYIBbZoRWYYDh5ulVYYJWYYHu8/N+h57CydJ7hZ1VYYFeaYdWYYG/xtCpsL9aZIRaZYOLk6jw9PPl6etWYYLv8/fr9fC/zL+yusagqLjp7e6zucbX3eJPW3tRXH1gaoja4OSutMPGzNTk6Oqmrr1XV4dVX4Dn7O3n7O3n7O3m7Ozm6utVYH/o7O1WYYBUXn5WYYHm6+tVYH93gZq////a3+Tn6uywt8SOl6zl7O3T2N5oc49GUnbM0tllb4ypsL5dZ39ra4zV299RXH1VW35UYYDm6uuEjaNbZoXo6+/O1Nrq7/CZobO3vsiTnK+FjqRUXYJVYIHl6uu+xM6Xn7CcpLVRXH3l6+nn7O1kb4x5g5yeprekq7rc4eXs8vHj6Onq8PHm7Ozl6uvl6+vn6+1UYH7l6Ojn7e3m7Ozn6uxVX39gaohibIlteJPl6e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bX/gAlHvchocP7Bt2+lR3uzfRYOBwJPY6xp4NhupAe/ep0LB9Bx7c0LuLxNrU93MYEr786rO//s3Q3nWq53RdvddrNHq99XWne051tRv+8a8DX33J/yh23A/MEJv4fzZ+fvDv33y9f++nXwxLS1v3xV/27v/6m38enLeBL3cTNony/n9GHU2UlcLeHAAAAABJRU5ErkJggg==";
|
|
785
810
|
//#endregion
|
|
786
811
|
//#region node_modules/react-icons/io5/index.mjs
|
|
787
|
-
function
|
|
812
|
+
function Ue(e) {
|
|
788
813
|
return Z({
|
|
789
814
|
tag: "svg",
|
|
790
815
|
attr: { viewBox: "0 0 512 512" },
|
|
@@ -821,7 +846,7 @@ function He(e) {
|
|
|
821
846
|
}
|
|
822
847
|
//#endregion
|
|
823
848
|
//#region node_modules/react-icons/vsc/index.mjs
|
|
824
|
-
function
|
|
849
|
+
function We(e) {
|
|
825
850
|
return Z({
|
|
826
851
|
tag: "svg",
|
|
827
852
|
attr: {
|
|
@@ -845,22 +870,22 @@ function Ue(e) {
|
|
|
845
870
|
}
|
|
846
871
|
//#endregion
|
|
847
872
|
//#region lib/chats/chatheader/chat-header.tsx
|
|
848
|
-
function
|
|
849
|
-
let [t, { open:
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
873
|
+
function Ge(e) {
|
|
874
|
+
let [t, { open: n, close: r }] = pe(!1), { workspace: i, conversation: a, sender: s } = j((e) => e.data), l = f(i?.widget?.darkMode, !1), [u, d] = M.useState(!1), p = A(), m = Be(e.userType), h = e.userType === T.VISITOR, y = i?.widget?.notifications?.customerEndsConversation === E.true, b = M.useMemo(() => h ? i?.widget?.department : a?.fullName, [i, a]), x = M.useMemo(() => h ? i?.logo : He, [i]), S = M.useMemo(() => h ? i?.name : K(a?.createdAt).format("DD dddd MMMM YYYY"), [
|
|
875
|
+
h,
|
|
876
|
+
i?.name,
|
|
877
|
+
a?.createdAt
|
|
853
878
|
]);
|
|
854
879
|
function C() {
|
|
855
|
-
|
|
880
|
+
d(!1);
|
|
856
881
|
}
|
|
857
|
-
function
|
|
882
|
+
function w() {
|
|
858
883
|
let t = K(), n = [
|
|
859
|
-
|
|
884
|
+
b || "Chat transcript",
|
|
860
885
|
`Exported: ${t.format("YYYY-MM-DD HH:mm")}`,
|
|
861
886
|
"",
|
|
862
887
|
...e.messages.length > 0 ? e.messages.map((e) => {
|
|
863
|
-
let t = K(e.createdAt), n = e.senderName || e.senderType || "Unknown", r = e.deleted ===
|
|
888
|
+
let t = K(e.createdAt), n = e.senderName || e.senderType || "Unknown", r = e.deleted === E.true ? "[This message was deleted]" : Array.isArray(e.message) ? e.message.join("\n") : "", i = e.deleted === E.true ? [] : Array.isArray(e.images) ? e.images : [];
|
|
864
889
|
return [
|
|
865
890
|
`[${t.isValid() ? t.format("YYYY-MM-DD HH:mm") : e.createdAt}] ${n} (${e.senderType})`,
|
|
866
891
|
r,
|
|
@@ -870,142 +895,142 @@ function We(e) {
|
|
|
870
895
|
].join("\n\n"), r = URL.createObjectURL(new Blob([n], { type: "text/plain;charset=utf-8" })), i = document.createElement("a");
|
|
871
896
|
i.href = r, i.download = `padorix-chat-${t.format("YYYY-MM-DD-HHmmss")}.txt`, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(r), 1e3), C();
|
|
872
897
|
}
|
|
873
|
-
function
|
|
874
|
-
|
|
898
|
+
function D() {
|
|
899
|
+
p(o({
|
|
875
900
|
userType: String(e?.userType),
|
|
876
|
-
senderId: String(
|
|
877
|
-
workspaceId: String(
|
|
878
|
-
conversationId: String(
|
|
879
|
-
senderName: String(
|
|
880
|
-
isEndChat:
|
|
881
|
-
})),
|
|
901
|
+
senderId: String(s?.senderId),
|
|
902
|
+
workspaceId: String(a?.workspaceId),
|
|
903
|
+
conversationId: String(s?.conversationId),
|
|
904
|
+
senderName: String(s?.fullName),
|
|
905
|
+
isEndChat: E.true
|
|
906
|
+
})), d(!1), e.toBottom();
|
|
882
907
|
}
|
|
883
|
-
function
|
|
884
|
-
|
|
908
|
+
function O() {
|
|
909
|
+
d(!1), n();
|
|
885
910
|
}
|
|
886
|
-
function
|
|
887
|
-
|
|
911
|
+
function ee() {
|
|
912
|
+
r(), m && v.requestFeedback(m).then((e) => p(g(e))).catch((e) => c(e.message, "error")), e.toBottom();
|
|
888
913
|
}
|
|
889
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ H("div", {
|
|
890
915
|
className: e.styles.header,
|
|
891
|
-
children: /* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ U("div", {
|
|
892
917
|
className: "padorix:rounded-2xl",
|
|
893
|
-
children: [/* @__PURE__ */
|
|
918
|
+
children: [/* @__PURE__ */ H(fe, {
|
|
894
919
|
withCloseButton: !1,
|
|
895
920
|
opened: t,
|
|
896
|
-
onClose:
|
|
921
|
+
onClose: r,
|
|
897
922
|
centered: !0,
|
|
898
923
|
styles: { body: { padding: 0 } },
|
|
899
|
-
children: /* @__PURE__ */
|
|
900
|
-
className:
|
|
901
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ H("div", {
|
|
925
|
+
className: l ? "padorix-dark" : void 0,
|
|
926
|
+
children: /* @__PURE__ */ U("div", {
|
|
902
927
|
className: "padorix:dark:bg-[#2a3549] padorix:p-4 padorix:dark:text-white",
|
|
903
|
-
children: [/* @__PURE__ */
|
|
928
|
+
children: [/* @__PURE__ */ H("div", {
|
|
904
929
|
className: "",
|
|
905
930
|
children: "Confirm your action to stop chat session by requesting for feedback"
|
|
906
|
-
}), /* @__PURE__ */
|
|
931
|
+
}), /* @__PURE__ */ U("div", {
|
|
907
932
|
className: "padorix:border-t padorix:border-gray-200 padorix:dark:border-gray-600 padorix:pt-3 padorix:mt-3 padorix:flex padorix:items-center padorix:justify-end padorix:gap-3",
|
|
908
|
-
children: [/* @__PURE__ */
|
|
909
|
-
onClick:
|
|
933
|
+
children: [/* @__PURE__ */ H("button", {
|
|
934
|
+
onClick: r,
|
|
910
935
|
className: "padorix:py-1 padorix:cursor-pointer padorix:px-3 padorix:border padorix:border-slate-300 padorix:bg-slate-200/70 padorix:rounded-md",
|
|
911
936
|
children: "Cancel"
|
|
912
|
-
}), /* @__PURE__ */
|
|
913
|
-
onClick:
|
|
937
|
+
}), /* @__PURE__ */ H("button", {
|
|
938
|
+
onClick: ee,
|
|
914
939
|
className: "padorix:px-3 padorix:cursor-pointer padorix:py-1 padorix:rounded-md padorix:text-white",
|
|
915
|
-
style: { background: String(
|
|
940
|
+
style: { background: String(i?.widget?.colorScheme) },
|
|
916
941
|
children: "Proceed"
|
|
917
942
|
})]
|
|
918
943
|
})]
|
|
919
944
|
})
|
|
920
945
|
})
|
|
921
|
-
}), /* @__PURE__ */
|
|
922
|
-
style: { color:
|
|
946
|
+
}), /* @__PURE__ */ U("div", {
|
|
947
|
+
style: { color: i?.widget?.textColor || void 0 },
|
|
923
948
|
className: "padorix:px-2 padorix:py-2.5 padorix:transition-all.5 padorix:text-xs padorix:border-b padorix:border-[#d1d5dc] padorix:dark:border-gray-600 padorix:flex padorix:items-center padorix:justify-between",
|
|
924
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ U("div", {
|
|
925
950
|
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
926
951
|
children: [
|
|
927
|
-
|
|
952
|
+
h ? null : /* @__PURE__ */ H("div", {
|
|
928
953
|
onClick: e.goBack,
|
|
929
954
|
className: "padorix:cursor-pointer padorix:size-7 padorix:flex padorix:items-center padorix:justify-center padorix:rounded-full padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:active:scale-95 padorix:md:hidden",
|
|
930
|
-
children: /* @__PURE__ */
|
|
955
|
+
children: /* @__PURE__ */ H(re, { className: "padorix:size-5" })
|
|
931
956
|
}),
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
src:
|
|
957
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("img", {
|
|
958
|
+
src: x,
|
|
934
959
|
loading: "lazy",
|
|
935
960
|
className: "padorix:size-8 padorix:rounded-full"
|
|
936
961
|
}) }),
|
|
937
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ U("div", {
|
|
938
963
|
className: "padorix:text-gray-600",
|
|
939
|
-
children: [/* @__PURE__ */
|
|
964
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
940
965
|
className: "padorix:font-semibold",
|
|
941
|
-
children:
|
|
942
|
-
}) }), /* @__PURE__ */
|
|
966
|
+
children: b
|
|
967
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
943
968
|
className: "",
|
|
944
969
|
children: S
|
|
945
970
|
}) })]
|
|
946
971
|
})
|
|
947
972
|
]
|
|
948
|
-
}), /* @__PURE__ */
|
|
973
|
+
}), /* @__PURE__ */ U("div", {
|
|
949
974
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
950
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ H("div", {
|
|
951
976
|
className: "padorix:flex padorix:items-center padorix:gap-1",
|
|
952
|
-
children: /* @__PURE__ */
|
|
953
|
-
position:
|
|
954
|
-
opened:
|
|
955
|
-
onChange:
|
|
977
|
+
children: /* @__PURE__ */ U(G, {
|
|
978
|
+
position: h ? "bottom-end" : "bottom",
|
|
979
|
+
opened: u,
|
|
980
|
+
onChange: d,
|
|
956
981
|
withinPortal: !0,
|
|
957
|
-
portalProps: { target:
|
|
982
|
+
portalProps: { target: _() },
|
|
958
983
|
zIndex: 2147483647,
|
|
959
|
-
children: [/* @__PURE__ */
|
|
960
|
-
onClick: () =>
|
|
984
|
+
children: [/* @__PURE__ */ H(G.Target, { children: /* @__PURE__ */ H("div", {
|
|
985
|
+
onClick: () => d((e) => !e),
|
|
961
986
|
className: "padorix:cursor-pointer padorix:transition-all padorix:size-fit padorix:text-xl",
|
|
962
|
-
children: /* @__PURE__ */
|
|
963
|
-
}) }), /* @__PURE__ */
|
|
964
|
-
className:
|
|
987
|
+
children: /* @__PURE__ */ H(Ue, {})
|
|
988
|
+
}) }), /* @__PURE__ */ H(G.Dropdown, {
|
|
989
|
+
className: l ? "padorix-dark" : void 0,
|
|
965
990
|
styles: { dropdown: {
|
|
966
991
|
padding: 0,
|
|
967
992
|
minWidth: "12rem",
|
|
968
993
|
zIndex: 2147483647,
|
|
969
994
|
border: 0,
|
|
970
|
-
backgroundColor:
|
|
995
|
+
backgroundColor: l ? "#2a3549" : "#fff"
|
|
971
996
|
} },
|
|
972
|
-
children: /* @__PURE__ */
|
|
997
|
+
children: /* @__PURE__ */ U("div", {
|
|
973
998
|
className: "padorix:text-xs padori:flex padorix:flex-col padorix:dark:bg-[#2a3549] padorix:dark:text-white",
|
|
974
999
|
children: [
|
|
975
|
-
!
|
|
976
|
-
onClick:
|
|
1000
|
+
!h && /* @__PURE__ */ U("div", {
|
|
1001
|
+
onClick: w,
|
|
977
1002
|
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:flex padorix:items-center",
|
|
978
|
-
children: [/* @__PURE__ */
|
|
1003
|
+
children: [/* @__PURE__ */ H(ae, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:mr-1" }), "Download Chat transcript"]
|
|
979
1004
|
}),
|
|
980
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ U("a", {
|
|
981
1006
|
target: "_blank",
|
|
982
1007
|
href: "https://app.farmsac.com/signup",
|
|
983
1008
|
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:hidden padorix:items-center",
|
|
984
|
-
children: [/* @__PURE__ */
|
|
1009
|
+
children: [/* @__PURE__ */ H(R, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Add to your website"]
|
|
985
1010
|
}),
|
|
986
|
-
!
|
|
987
|
-
onClick:
|
|
1011
|
+
!h && a?.status === E.true && /* @__PURE__ */ U("div", {
|
|
1012
|
+
onClick: O,
|
|
988
1013
|
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:flex padorix:items-center",
|
|
989
|
-
children: [/* @__PURE__ */
|
|
1014
|
+
children: [/* @__PURE__ */ H(We, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "Request for Feedback"]
|
|
990
1015
|
}),
|
|
991
|
-
|
|
1016
|
+
a?.closed_at === null && (!h || y) && /* @__PURE__ */ H("div", {
|
|
992
1017
|
className: "padorix:border-t padorix:border-[#d1d5dc] padorix:dark:border-gray-600 padorix:mt-1",
|
|
993
|
-
children: /* @__PURE__ */
|
|
994
|
-
onClick:
|
|
1018
|
+
children: /* @__PURE__ */ U("div", {
|
|
1019
|
+
onClick: D,
|
|
995
1020
|
className: "padorix:px-2 padorix:py-2.5 padorix:hover:bg-slate-100 padorix:hover:dark:bg-slate-600 padorix:transition-all padorix:cursor-pointer padorix:rounded-1 padorix:flex padorix:items-center",
|
|
996
|
-
children: [/* @__PURE__ */
|
|
1021
|
+
children: [/* @__PURE__ */ H(Q, { className: "padorix:inline padorix:size-5 padorix:text-gray-700 padorix:dark:text-white padorix:mr-1" }), "End Chat Session"]
|
|
997
1022
|
})
|
|
998
1023
|
})
|
|
999
1024
|
]
|
|
1000
1025
|
})
|
|
1001
1026
|
})]
|
|
1002
1027
|
})
|
|
1003
|
-
}),
|
|
1028
|
+
}), h && /* @__PURE__ */ H("div", {
|
|
1004
1029
|
className: "padorix:size-8 padorix:ml-auto",
|
|
1005
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ H("div", {
|
|
1006
1031
|
className: "padorix:bg-slate-100 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
1007
1032
|
onClick: e.close,
|
|
1008
|
-
children: /* @__PURE__ */
|
|
1033
|
+
children: /* @__PURE__ */ H(L, {})
|
|
1009
1034
|
})
|
|
1010
1035
|
})]
|
|
1011
1036
|
})]
|
|
@@ -1015,7 +1040,7 @@ function We(e) {
|
|
|
1015
1040
|
}
|
|
1016
1041
|
//#endregion
|
|
1017
1042
|
//#region node_modules/react-icons/bs/index.mjs
|
|
1018
|
-
function
|
|
1043
|
+
function Ke(e) {
|
|
1019
1044
|
return Z({
|
|
1020
1045
|
tag: "svg",
|
|
1021
1046
|
attr: {
|
|
@@ -1029,7 +1054,7 @@ function Ge(e) {
|
|
|
1029
1054
|
}]
|
|
1030
1055
|
})(e);
|
|
1031
1056
|
}
|
|
1032
|
-
function
|
|
1057
|
+
function qe(e) {
|
|
1033
1058
|
return Z({
|
|
1034
1059
|
tag: "svg",
|
|
1035
1060
|
attr: {
|
|
@@ -1043,7 +1068,7 @@ function Ke(e) {
|
|
|
1043
1068
|
}]
|
|
1044
1069
|
})(e);
|
|
1045
1070
|
}
|
|
1046
|
-
function
|
|
1071
|
+
function Je(e) {
|
|
1047
1072
|
return Z({
|
|
1048
1073
|
tag: "svg",
|
|
1049
1074
|
attr: {
|
|
@@ -1057,7 +1082,7 @@ function qe(e) {
|
|
|
1057
1082
|
}]
|
|
1058
1083
|
})(e);
|
|
1059
1084
|
}
|
|
1060
|
-
function
|
|
1085
|
+
function Ye(e) {
|
|
1061
1086
|
return Z({
|
|
1062
1087
|
tag: "svg",
|
|
1063
1088
|
attr: {
|
|
@@ -1075,7 +1100,7 @@ function Je(e) {
|
|
|
1075
1100
|
}]
|
|
1076
1101
|
})(e);
|
|
1077
1102
|
}
|
|
1078
|
-
function
|
|
1103
|
+
function Xe(e) {
|
|
1079
1104
|
return Z({
|
|
1080
1105
|
tag: "svg",
|
|
1081
1106
|
attr: {
|
|
@@ -1091,11 +1116,11 @@ function Ye(e) {
|
|
|
1091
1116
|
}
|
|
1092
1117
|
//#endregion
|
|
1093
1118
|
//#region lib/chats/chatform/render-text.tsx
|
|
1094
|
-
function
|
|
1119
|
+
function Ze(e) {
|
|
1095
1120
|
if (!e) return "";
|
|
1096
1121
|
let t = /(https?:\/\/[^\s]+)/g, n = /\*(.*?)\*/g;
|
|
1097
1122
|
return e.split(t).map((e, r) => {
|
|
1098
|
-
if (t.test(e)) return /* @__PURE__ */
|
|
1123
|
+
if (t.test(e)) return /* @__PURE__ */ H("a", {
|
|
1099
1124
|
href: e,
|
|
1100
1125
|
target: "_blank",
|
|
1101
1126
|
rel: "noopener noreferrer",
|
|
@@ -1103,7 +1128,7 @@ function Xe(e) {
|
|
|
1103
1128
|
children: e
|
|
1104
1129
|
}, r);
|
|
1105
1130
|
let i = e.split(n);
|
|
1106
|
-
return e.match(n) ? i.map((e, t) => t % 2 == 1 ? /* @__PURE__ */
|
|
1131
|
+
return e.match(n) ? i.map((e, t) => t % 2 == 1 ? /* @__PURE__ */ H("strong", {
|
|
1107
1132
|
className: "padorix:font-bold",
|
|
1108
1133
|
children: e
|
|
1109
1134
|
}, `b-${t}`) : e) : e;
|
|
@@ -1111,58 +1136,58 @@ function Xe(e) {
|
|
|
1111
1136
|
}
|
|
1112
1137
|
//#endregion
|
|
1113
1138
|
//#region lib/chats/chatmessages/chat-message-cover.tsx
|
|
1114
|
-
function
|
|
1115
|
-
let { workspace: t } =
|
|
1116
|
-
if (e.isSender) return /* @__PURE__ */
|
|
1117
|
-
style: { background: e.data?.deleted ===
|
|
1139
|
+
function Qe(e) {
|
|
1140
|
+
let { workspace: t } = j((e) => e.data), n = "padorix:w-fit padorix:h-fit padorix:max-w-[91%] padorix:relative padorix:bottom-3 padorix:md:max-w-[80%]";
|
|
1141
|
+
if (e.isSender) return /* @__PURE__ */ H(B, {
|
|
1142
|
+
style: { background: e.data?.deleted === E.true ? "" : e.data?.message ? String(t?.widget?.colorScheme) : "" },
|
|
1118
1143
|
className: `
|
|
1119
1144
|
${n} padorix:ml-auto
|
|
1120
1145
|
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-bl-xl" : "padorix:rounded-xl"}
|
|
1121
|
-
${e.data?.deleted ===
|
|
1146
|
+
${e.data?.deleted === E.true ? "" : e.data?.message ? "padorix:text-white" : "padorix:text-black!"}`,
|
|
1122
1147
|
children: e.children
|
|
1123
1148
|
});
|
|
1124
|
-
if (!e.isSender) return /* @__PURE__ */
|
|
1149
|
+
if (!e.isSender) return /* @__PURE__ */ H(B, {
|
|
1125
1150
|
className: `${n} padorix:mr-auto
|
|
1126
1151
|
${e.isLastInGroup ? "padorix:rounded-t-xl padorix:rounded-br-xl" : "padorix:rounded-xl"}
|
|
1127
|
-
${e.data?.deleted ===
|
|
1152
|
+
${e.data?.deleted === E.true ? "" : e.data?.message ? "padorix:bg-[#f6f6f6] padorix:text-black" : "padorix:text-black!"}`,
|
|
1128
1153
|
children: e.children
|
|
1129
1154
|
});
|
|
1130
1155
|
}
|
|
1131
1156
|
//#endregion
|
|
1132
1157
|
//#region lib/chats/chatmessages/chat-avatar.tsx
|
|
1133
|
-
function
|
|
1134
|
-
return /* @__PURE__ */
|
|
1158
|
+
function $e(e) {
|
|
1159
|
+
return /* @__PURE__ */ H(de, {
|
|
1135
1160
|
direction: "up",
|
|
1136
|
-
children: /* @__PURE__ */
|
|
1161
|
+
children: /* @__PURE__ */ H("div", {
|
|
1137
1162
|
className: "padorix:self-end padorix:mb-3 padorix:w-10",
|
|
1138
|
-
children: e.isLastInGroup ? /* @__PURE__ */
|
|
1163
|
+
children: e.isLastInGroup ? /* @__PURE__ */ H("div", {
|
|
1139
1164
|
className: "padorix:size-8",
|
|
1140
|
-
children: /* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ H("img", {
|
|
1141
1166
|
src: e.img,
|
|
1142
1167
|
alt: "Padorix",
|
|
1143
1168
|
className: "padorix:size-8 padorix:border-2 padorix:rounded-full padorix:shadow-md padorix:border-white"
|
|
1144
1169
|
})
|
|
1145
|
-
}) : /* @__PURE__ */
|
|
1170
|
+
}) : /* @__PURE__ */ H("div", { className: "padorix:size-10" })
|
|
1146
1171
|
})
|
|
1147
1172
|
});
|
|
1148
1173
|
}
|
|
1149
1174
|
//#endregion
|
|
1150
1175
|
//#region lib/chats/chatmessages/chat-delete-selector.tsx
|
|
1151
|
-
function
|
|
1152
|
-
let { workspace: t } =
|
|
1153
|
-
return /* @__PURE__ */
|
|
1176
|
+
function et(e) {
|
|
1177
|
+
let { workspace: t } = j((e) => e.data), n = e.messagesToDelete?.find((t) => t === e.data?.id);
|
|
1178
|
+
return /* @__PURE__ */ H("div", {
|
|
1154
1179
|
style: { background: n ? String(t?.widget?.colorScheme) : "#e4e4e7" },
|
|
1155
1180
|
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1156
1181
|
className: "padorix:size-6 padorix:rounded-md padorix:border padorix:border-gray-300 padorix:text-base padorix:cursor-pointer padorix:transition-all padorix:mb-3 padorix:absolute padorix:top-0 padorix:z-10 padorix:active:scale-150",
|
|
1157
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ H("div", {
|
|
1158
1183
|
className: "padorix:size-6 padorix:flex padorix:items-center padorix:justify-center",
|
|
1159
|
-
children:
|
|
1184
|
+
children: H(n ? je : Oe, { className: "padorix:text-white" })
|
|
1160
1185
|
})
|
|
1161
1186
|
});
|
|
1162
1187
|
}
|
|
1163
1188
|
//#endregion
|
|
1164
1189
|
//#region lib/chats/chatmessages/chat-image-viewer.tsx
|
|
1165
|
-
function
|
|
1190
|
+
function tt(e) {
|
|
1166
1191
|
let t = e.data?.images, n = [];
|
|
1167
1192
|
if (Array.isArray(t)) n = t.filter((e) => typeof e == "string" && e.length > 0);
|
|
1168
1193
|
else if (typeof t == "string") try {
|
|
@@ -1171,11 +1196,11 @@ function et(e) {
|
|
|
1171
1196
|
} catch {
|
|
1172
1197
|
n = t.length > 0 ? [t] : [];
|
|
1173
1198
|
}
|
|
1174
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ H("div", {
|
|
1175
1200
|
className: "padorix:min-w-0 padorix:max-w-full",
|
|
1176
|
-
children: n.length > 0 && /* @__PURE__ */
|
|
1201
|
+
children: n.length > 0 && /* @__PURE__ */ H("div", {
|
|
1177
1202
|
className: "padorix:flex padorix:min-w-0 padorix:max-w-full padorix:flex-col padorix:items-end padorix:gap-1",
|
|
1178
|
-
children: n.map((e, t) => /* @__PURE__ */
|
|
1203
|
+
children: n.map((e, t) => /* @__PURE__ */ H("img", {
|
|
1179
1204
|
src: e,
|
|
1180
1205
|
alt: "Attachment",
|
|
1181
1206
|
loading: "lazy",
|
|
@@ -1187,7 +1212,7 @@ function et(e) {
|
|
|
1187
1212
|
}
|
|
1188
1213
|
//#endregion
|
|
1189
1214
|
//#region lib/chats/chatmessages/chat-reply.tsx
|
|
1190
|
-
function
|
|
1215
|
+
function nt(e) {
|
|
1191
1216
|
if (Array.isArray(e)) return e.filter((e) => typeof e == "string" && e.length > 0);
|
|
1192
1217
|
if (typeof e == "string" && e.length > 0) try {
|
|
1193
1218
|
let t = JSON.parse(e);
|
|
@@ -1197,17 +1222,17 @@ function tt(e) {
|
|
|
1197
1222
|
}
|
|
1198
1223
|
return [];
|
|
1199
1224
|
}
|
|
1200
|
-
function
|
|
1201
|
-
let t = e.data?.replies?.[0], n = t?.id ?
|
|
1202
|
-
if (t?.id) return /* @__PURE__ */
|
|
1225
|
+
function rt(e) {
|
|
1226
|
+
let t = e.data?.replies?.[0], n = t?.id ? nt(t?.repliedTo?.images) : [], r = nt(t?.repliedTo?.message).join(" ");
|
|
1227
|
+
if (t?.id) return /* @__PURE__ */ H("div", {
|
|
1203
1228
|
className: "padorix:px-0.5 padorix:pt-0.5",
|
|
1204
|
-
children: /* @__PURE__ */
|
|
1229
|
+
children: /* @__PURE__ */ U("div", {
|
|
1205
1230
|
onClick: () => e.handleScrollToTargetMessage(String(t?.replyId)),
|
|
1206
1231
|
className: `padorix:flex padorix:flex-row padorix:items-center padorix:gap-1 padorix:p-2 padorix:mb-1 padorix:text-xs padorix:rounded padorix:border-l-4 padorix:border-white padorix:cursor-pointer padorix:hover:brightness-95 padorix:transition-all ${e.isSender ? "padorix:bg-black/20 padorix:text-gray-200" : "padorix:bg-gray-200 padorix:text-gray-700"}`,
|
|
1207
|
-
children: [/* @__PURE__ */
|
|
1232
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1208
1233
|
className: "padorix:w-full",
|
|
1209
1234
|
children: [r.slice(0, 40), r.length > 40 ? "..." : ""]
|
|
1210
|
-
}), n?.length > 0 && /* @__PURE__ */
|
|
1235
|
+
}), n?.length > 0 && /* @__PURE__ */ H("div", { children: /* @__PURE__ */ H("img", {
|
|
1211
1236
|
src: n[0],
|
|
1212
1237
|
alt: "Padorix",
|
|
1213
1238
|
className: "padorix:size-6"
|
|
@@ -1217,107 +1242,107 @@ function nt(e) {
|
|
|
1217
1242
|
}
|
|
1218
1243
|
//#endregion
|
|
1219
1244
|
//#region lib/chats/chatmessages/single-message-pop.tsx
|
|
1220
|
-
function
|
|
1221
|
-
let
|
|
1222
|
-
function
|
|
1223
|
-
|
|
1245
|
+
function it(e) {
|
|
1246
|
+
let t = A(), { reply: r, conversation: i, workspace: a } = j((e) => e.data), o = f(a?.widget?.darkMode, !1);
|
|
1247
|
+
function s(t) {
|
|
1248
|
+
t.stopPropagation(), e.setOpens((e) => !e);
|
|
1224
1249
|
}
|
|
1225
|
-
function
|
|
1226
|
-
n(
|
|
1227
|
-
...
|
|
1228
|
-
messageId:
|
|
1229
|
-
})),
|
|
1250
|
+
function c() {
|
|
1251
|
+
t(n({
|
|
1252
|
+
...r,
|
|
1253
|
+
messageId: e.data?.id
|
|
1254
|
+
})), t(h(e.data)), e.handleClick();
|
|
1230
1255
|
}
|
|
1231
|
-
function
|
|
1232
|
-
|
|
1256
|
+
function l(t) {
|
|
1257
|
+
e.handleStarMessage(e.data?.id, t), e.handleClick();
|
|
1233
1258
|
}
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1259
|
+
function d() {
|
|
1260
|
+
u(String(e.data?.message)), e.handleClick();
|
|
1236
1261
|
}
|
|
1237
1262
|
async function p() {
|
|
1238
|
-
let
|
|
1239
|
-
for (let [
|
|
1240
|
-
let
|
|
1263
|
+
let t = Array.isArray(e.data.images) ? e.data.images : [];
|
|
1264
|
+
for (let [e, n] of t.entries()) {
|
|
1265
|
+
let t = (() => {
|
|
1241
1266
|
try {
|
|
1242
|
-
let
|
|
1243
|
-
return /\.[a-z0-9]+$/i.test(r) ? r : `image-${
|
|
1267
|
+
let t = new URL(n, window.location.href).pathname, r = decodeURIComponent(t.split("/").pop() || "");
|
|
1268
|
+
return /\.[a-z0-9]+$/i.test(r) ? r : `image-${e + 1}.jpg`;
|
|
1244
1269
|
} catch {
|
|
1245
|
-
return `image-${
|
|
1270
|
+
return `image-${e + 1}.jpg`;
|
|
1246
1271
|
}
|
|
1247
1272
|
})();
|
|
1248
1273
|
try {
|
|
1249
|
-
let
|
|
1250
|
-
if (!
|
|
1251
|
-
let r = URL.createObjectURL(await
|
|
1252
|
-
i.href = r, i.download =
|
|
1274
|
+
let e = await fetch(n);
|
|
1275
|
+
if (!e.ok) throw Error("Unable to download image");
|
|
1276
|
+
let r = URL.createObjectURL(await e.blob()), i = document.createElement("a");
|
|
1277
|
+
i.href = r, i.download = t, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(r), 1e3);
|
|
1253
1278
|
} catch {
|
|
1254
1279
|
let e = document.createElement("a");
|
|
1255
1280
|
e.href = n, e.target = "_blank", e.rel = "noopener noreferrer", e.click();
|
|
1256
1281
|
}
|
|
1257
1282
|
}
|
|
1258
|
-
|
|
1283
|
+
e.handleClick();
|
|
1259
1284
|
}
|
|
1260
|
-
let
|
|
1261
|
-
return /* @__PURE__ */
|
|
1262
|
-
opened:
|
|
1263
|
-
onChange:
|
|
1285
|
+
let m = Array.isArray(e.data.images) && e.data.images.length > 0;
|
|
1286
|
+
return /* @__PURE__ */ U(G, {
|
|
1287
|
+
opened: e.opens,
|
|
1288
|
+
onChange: e.setOpens,
|
|
1264
1289
|
position: "top",
|
|
1265
1290
|
withArrow: !0,
|
|
1266
1291
|
withinPortal: !0,
|
|
1267
|
-
portalProps: { target:
|
|
1292
|
+
portalProps: { target: _() },
|
|
1268
1293
|
zIndex: 2147483647,
|
|
1269
|
-
children: [/* @__PURE__ */
|
|
1270
|
-
onClick:
|
|
1271
|
-
className: `padorix:absolute padorix:top-0 padorix:cursor-pointer padorix:size-fit padorix:text-lg padorix:transition-all padorix:hover:scale-110 ${
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1273
|
-
}) }), /* @__PURE__ */
|
|
1274
|
-
className:
|
|
1294
|
+
children: [/* @__PURE__ */ H(G.Target, { children: /* @__PURE__ */ H("div", {
|
|
1295
|
+
onClick: s,
|
|
1296
|
+
className: `padorix:absolute padorix:top-0 padorix:cursor-pointer padorix:size-fit padorix:text-lg padorix:transition-all padorix:hover:scale-110 ${e.isSender, "padorix:-right-5"}`,
|
|
1297
|
+
children: /* @__PURE__ */ H(Ue, { style: { color: String(a?.widget?.colorScheme) } })
|
|
1298
|
+
}) }), /* @__PURE__ */ H(G.Dropdown, {
|
|
1299
|
+
className: o ? "padorix-dark" : void 0,
|
|
1275
1300
|
styles: { dropdown: {
|
|
1276
1301
|
padding: 0,
|
|
1277
1302
|
minWidth: "10rem",
|
|
1278
1303
|
zIndex: 2147483647,
|
|
1279
1304
|
border: 0,
|
|
1280
|
-
backgroundColor:
|
|
1305
|
+
backgroundColor: o ? "#2a3549" : "#fff"
|
|
1281
1306
|
} },
|
|
1282
|
-
children: /* @__PURE__ */
|
|
1307
|
+
children: /* @__PURE__ */ U("div", {
|
|
1283
1308
|
className: "padorix:text-xs padorix:text-gray-800 padorix:dark:bg-[#2a3549] padorix:dark:text-white padorix:rounded-lg",
|
|
1284
1309
|
children: [
|
|
1285
|
-
|
|
1286
|
-
onClick:
|
|
1310
|
+
i?.status === E.true && /* @__PURE__ */ U("div", {
|
|
1311
|
+
onClick: c,
|
|
1287
1312
|
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:rounded-tr-lg padorix:rounded-tl-lg padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1288
|
-
children: [/* @__PURE__ */
|
|
1313
|
+
children: [/* @__PURE__ */ H(ne, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Reply"]
|
|
1289
1314
|
}),
|
|
1290
|
-
|
|
1291
|
-
onClick:
|
|
1315
|
+
e.isMessage && /* @__PURE__ */ U("div", {
|
|
1316
|
+
onClick: d,
|
|
1292
1317
|
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1293
|
-
children: [/* @__PURE__ */
|
|
1318
|
+
children: [/* @__PURE__ */ H(ie, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Copy"]
|
|
1294
1319
|
}),
|
|
1295
|
-
|
|
1320
|
+
m && /* @__PURE__ */ U("div", {
|
|
1296
1321
|
onClick: p,
|
|
1297
1322
|
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1298
1323
|
children: [
|
|
1299
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ H(ke, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1300
1325
|
" Download image",
|
|
1301
|
-
|
|
1326
|
+
e.data.images.length > 1 ? "s" : ""
|
|
1302
1327
|
]
|
|
1303
1328
|
}),
|
|
1304
|
-
|
|
1305
|
-
onClick: () =>
|
|
1329
|
+
i?.status === E.true && /* @__PURE__ */ U("div", {
|
|
1330
|
+
onClick: () => l(e.data?.starred === E.true ? E.false : E.true),
|
|
1306
1331
|
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:hover:bg-gray-100 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1307
1332
|
children: [
|
|
1308
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ H(ce, { className: "padorix:inline padorix:size-4 padorix:mr-3" }),
|
|
1309
1334
|
" ",
|
|
1310
|
-
|
|
1311
|
-
|
|
1335
|
+
e.data?.starred === E.true ? "Unstar" : "Star",
|
|
1336
|
+
e.data?.starred === E.true && /* @__PURE__ */ H(Ke, { className: "padorix:size-2 padorix:inline padorix:text-amber-400 padorix:ml-1" })
|
|
1312
1337
|
]
|
|
1313
1338
|
}),
|
|
1314
|
-
|
|
1315
|
-
|
|
1339
|
+
e.moreActions,
|
|
1340
|
+
i?.status === E.true && e.isSender && e.canDeleteMessage && /* @__PURE__ */ H("div", {
|
|
1316
1341
|
className: "padorix:border-t padorix:border-gray-200 padorix:dark:border-gray-500",
|
|
1317
|
-
children: /* @__PURE__ */
|
|
1318
|
-
onClick: () =>
|
|
1342
|
+
children: /* @__PURE__ */ U("div", {
|
|
1343
|
+
onClick: () => e.handleDeleteAction(e.data?.id),
|
|
1319
1344
|
className: "padorix:p-2 padorix:cursor-pointer padorix:flex padorix:items-center padorix:rounded-br-lg padorix:rounded-bl-lg padorix:text-red-500 padorix:dark:text-red-400 padorix:hover:bg-red-50 padorix:hover:dark:bg-gray-600 padorix:transition-all",
|
|
1320
|
-
children: [/* @__PURE__ */
|
|
1345
|
+
children: [/* @__PURE__ */ H(le, { className: "padorix:inline padorix:size-4 padorix:mr-3" }), " Delete"]
|
|
1321
1346
|
})
|
|
1322
1347
|
})
|
|
1323
1348
|
]
|
|
@@ -1327,8 +1352,8 @@ function rt(t) {
|
|
|
1327
1352
|
}
|
|
1328
1353
|
//#endregion
|
|
1329
1354
|
//#region lib/chats/chatmessages/chat-single-message.tsx
|
|
1330
|
-
function
|
|
1331
|
-
let [s, c] =
|
|
1355
|
+
function at({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage: r, messages: i, userType: a, moreActions: o }) {
|
|
1356
|
+
let [s, c] = M.useState(!1), [l, u] = M.useState(!1), { workspace: d } = j((e) => e.data), f = String(e?.message ?? "").trim().length > 0, p = a === "VISITOR", m = d?.widget?.notifications?.customerDeletesMessage === E.true, h = !p || m, g = p ? e?.senderType === "VISITOR" : e?.senderType !== "VISITOR", _ = M.useMemo(() => {
|
|
1332
1357
|
if (!i?.length || !e?.id) return !1;
|
|
1333
1358
|
let t = i.findIndex((t) => t.id === e.id);
|
|
1334
1359
|
if (t === -1) return !1;
|
|
@@ -1340,11 +1365,11 @@ function it({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1340
1365
|
i,
|
|
1341
1366
|
e.id,
|
|
1342
1367
|
e.senderType
|
|
1343
|
-
]),
|
|
1368
|
+
]), v = M.useCallback(() => {
|
|
1344
1369
|
c(!1);
|
|
1345
|
-
}, []),
|
|
1346
|
-
n(e),
|
|
1347
|
-
}, [n,
|
|
1370
|
+
}, []), y = M.useCallback((e) => {
|
|
1371
|
+
n(e), v();
|
|
1372
|
+
}, [n, v]), b = M.useCallback((t) => {
|
|
1348
1373
|
if (!t) return;
|
|
1349
1374
|
let n = document.getElementById(`padorix-msg-${t}`);
|
|
1350
1375
|
if (n) {
|
|
@@ -1352,28 +1377,28 @@ function it({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1352
1377
|
behavior: "smooth",
|
|
1353
1378
|
block: "center"
|
|
1354
1379
|
}), e.id === t) {
|
|
1355
|
-
|
|
1380
|
+
u(!0);
|
|
1356
1381
|
return;
|
|
1357
1382
|
}
|
|
1358
1383
|
window.dispatchEvent(new CustomEvent(`padorix-flash-${t}`));
|
|
1359
1384
|
}
|
|
1360
1385
|
}, [e.id]);
|
|
1361
|
-
return
|
|
1386
|
+
return M.useEffect(() => {
|
|
1362
1387
|
let t = `padorix-flash-${e.id}`, n = () => {
|
|
1363
|
-
|
|
1388
|
+
u(!0);
|
|
1364
1389
|
};
|
|
1365
1390
|
return window.addEventListener(t, n), () => {
|
|
1366
1391
|
window.removeEventListener(t, n);
|
|
1367
1392
|
};
|
|
1368
|
-
}, [e.id]),
|
|
1369
|
-
if (!
|
|
1393
|
+
}, [e.id]), M.useEffect(() => {
|
|
1394
|
+
if (!l) return;
|
|
1370
1395
|
let e = window.setTimeout(() => {
|
|
1371
|
-
|
|
1396
|
+
u(!1);
|
|
1372
1397
|
}, 1500);
|
|
1373
1398
|
return () => {
|
|
1374
1399
|
window.clearTimeout(e);
|
|
1375
1400
|
};
|
|
1376
|
-
}, [
|
|
1401
|
+
}, [l]), /* @__PURE__ */ H(V, { children: /* @__PURE__ */ U("div", {
|
|
1377
1402
|
id: `padorix-msg-${e.id}`,
|
|
1378
1403
|
className: `
|
|
1379
1404
|
padorix:flex
|
|
@@ -1385,114 +1410,114 @@ function it({ data: e, messagesToDelete: t, deleteAction: n, handleStarMessage:
|
|
|
1385
1410
|
padorix:transition-all
|
|
1386
1411
|
padorix:duration-500
|
|
1387
1412
|
padorix:ease-in-out
|
|
1388
|
-
${
|
|
1413
|
+
${l ? "padorix:bg-gray-100/80 padorix:scale-[1.01]" : "padorix:bg-transparent"}
|
|
1389
1414
|
`,
|
|
1390
1415
|
children: [
|
|
1391
|
-
!
|
|
1392
|
-
isLastInGroup:
|
|
1393
|
-
img: String(
|
|
1416
|
+
!g && /* @__PURE__ */ H($e, {
|
|
1417
|
+
isLastInGroup: _,
|
|
1418
|
+
img: String(d?.logo ?? "")
|
|
1394
1419
|
}),
|
|
1395
|
-
|
|
1420
|
+
h && t?.length > 0 && e?.deleted === E.false && /* @__PURE__ */ H(et, {
|
|
1396
1421
|
data: e,
|
|
1397
|
-
handleDeleteAction:
|
|
1422
|
+
handleDeleteAction: y,
|
|
1398
1423
|
messagesToDelete: t
|
|
1399
1424
|
}),
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
isLastInGroup:
|
|
1402
|
-
isSender:
|
|
1425
|
+
/* @__PURE__ */ H(Qe, {
|
|
1426
|
+
isLastInGroup: _,
|
|
1427
|
+
isSender: g,
|
|
1403
1428
|
data: e,
|
|
1404
|
-
children: /* @__PURE__ */
|
|
1429
|
+
children: /* @__PURE__ */ U("div", {
|
|
1405
1430
|
className: "padorix:w-full padorix:px-1",
|
|
1406
|
-
children: [e?.deleted ===
|
|
1431
|
+
children: [e?.deleted === E.false && /* @__PURE__ */ H(it, {
|
|
1407
1432
|
data: e,
|
|
1408
1433
|
deleteAction: n,
|
|
1409
1434
|
handleStarMessage: r,
|
|
1410
|
-
isSender:
|
|
1411
|
-
isMessage:
|
|
1412
|
-
handleClick:
|
|
1413
|
-
handleDeleteAction:
|
|
1435
|
+
isSender: g,
|
|
1436
|
+
isMessage: f,
|
|
1437
|
+
handleClick: v,
|
|
1438
|
+
handleDeleteAction: y,
|
|
1414
1439
|
setOpens: c,
|
|
1415
1440
|
opens: s,
|
|
1416
1441
|
moreActions: o,
|
|
1417
|
-
canDeleteMessage:
|
|
1418
|
-
}), /* @__PURE__ */
|
|
1442
|
+
canDeleteMessage: h
|
|
1443
|
+
}), /* @__PURE__ */ H("div", {
|
|
1419
1444
|
className: "padorix:p-1 padorix:whitespace-pre-wrap",
|
|
1420
|
-
children: e?.deleted ===
|
|
1445
|
+
children: e?.deleted === E.true ? /* @__PURE__ */ U("div", {
|
|
1421
1446
|
className: "padorix:italic padorix:px-3 padorix:py-2 padorix:rounded-lg padorix:bg-gray-200/60 padorix:text-gray-500 padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
1422
|
-
children: [/* @__PURE__ */
|
|
1423
|
-
}) : /* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1447
|
+
children: [/* @__PURE__ */ H(Xe, {}), /* @__PURE__ */ H("span", { children: "This message was deleted" })]
|
|
1448
|
+
}) : /* @__PURE__ */ U(V, { children: [
|
|
1449
|
+
/* @__PURE__ */ H(rt, {
|
|
1425
1450
|
data: e,
|
|
1426
|
-
isSender:
|
|
1427
|
-
handleScrollToTargetMessage:
|
|
1451
|
+
isSender: g,
|
|
1452
|
+
handleScrollToTargetMessage: b
|
|
1428
1453
|
}),
|
|
1429
|
-
/* @__PURE__ */
|
|
1430
|
-
|
|
1454
|
+
/* @__PURE__ */ H(tt, { data: e }),
|
|
1455
|
+
f && /* @__PURE__ */ H("div", {
|
|
1431
1456
|
className: "padorix:text-[0.8rem] padorix:whitespace-pre-wrap padorix:mt-2",
|
|
1432
|
-
children:
|
|
1457
|
+
children: Ze(String(e.message))
|
|
1433
1458
|
}),
|
|
1434
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ U("div", {
|
|
1435
1460
|
className: "padorix:text-right padorix:text-[12px] padorix:mt-1 padorix:flex padorix:items-center padorix:justify-end padorix:gap-1 padorix:pl-2",
|
|
1436
1461
|
children: [
|
|
1437
|
-
!
|
|
1462
|
+
!p && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("span", {
|
|
1438
1463
|
className: "padorix:text-[0.65rem]",
|
|
1439
1464
|
children: e?.senderType
|
|
1440
|
-
}), /* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1465
|
+
}), /* @__PURE__ */ H(se, {})] }),
|
|
1466
|
+
/* @__PURE__ */ H("span", {
|
|
1442
1467
|
className: "padorix:text-[0.55rem]",
|
|
1443
1468
|
children: K(e?.createdAt).format("hh:mm A")
|
|
1444
1469
|
}),
|
|
1445
|
-
e?.starred ===
|
|
1446
|
-
|
|
1470
|
+
e?.starred === E.true && /* @__PURE__ */ H(ue, { children: /* @__PURE__ */ H(Ke, { className: "padorix:size-3 padorix:text-amber-400" }) }),
|
|
1471
|
+
g && /* @__PURE__ */ H(Ye, { className: "padorix:inline padorix:text-base padorix:size-3" })
|
|
1447
1472
|
]
|
|
1448
1473
|
})
|
|
1449
1474
|
] })
|
|
1450
1475
|
})]
|
|
1451
1476
|
})
|
|
1452
1477
|
}),
|
|
1453
|
-
|
|
1454
|
-
isLastInGroup:
|
|
1478
|
+
p ? e?.deleted === E.false && g && /* @__PURE__ */ H($e, {
|
|
1479
|
+
isLastInGroup: _,
|
|
1455
1480
|
img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAADAFBMVEVMaXFUVFRVYH8AAABTU6lVYID///9UX4B7e39VYH+qt/9VYIBVX4BMV3nm6+xVYIDn6+xKXH9OWnu0u8dtrq5JVXfm6+xVYIBJVHZNWXrm6+zq7+9VYIChqbhXY4JUX4ChqrlVX4Hd4uVRYICvt8NVYYFXYoJWYIFzfJZVYYFVYIFVYIFVYIDs8fHK0Njt8vFVYIBTXn5KVnfn7e1UYIBVYIHIztZWYIHx9fRWYoKkrLtWYIFWYoNXYYJXX4FWYYFWYYJWYoJdZ4ZXYoJrdpHl6utVYIBVYH9rdZBWYYFVYIBWXX1UXnzn7OxUX4BVYIBbZoRWYYDh5ulVYYJWYYHu8/N+h57CydJ7hZ1VYYFeaYdWYYG/xtCpsL9aZIRaZYOLk6jw9PPl6etWYYLv8/fr9fC/zL+yusagqLjp7e6zucbX3eJPW3tRXH1gaoja4OSutMPGzNTk6Oqmrr1XV4dVX4Dn7O3n7O3n7O3m7Ozm6utVYH/o7O1WYYBUXn5WYYHm6+tVYH93gZq////a3+Tn6uywt8SOl6zl7O3T2N5oc49GUnbM0tllb4ypsL5dZ39ra4zV299RXH1VW35UYYDm6uuEjaNbZoXo6+/O1Nrq7/CZobO3vsiTnK+FjqRUXYJVYIHl6uu+xM6Xn7CcpLVRXH3l6+nn7O1kb4x5g5yeprekq7rc4eXs8vHj6Onq8PHm7Ozl6uvl6+vn6+1UYH7l6Ojn7e3m7Ozn6uxVX39gaohibIlteJPl6eurssF2f5hncI3l6ut+h59mcIzm6uzn6u3n7O3m6uzm7O3o7Ozm7O2OmaXn7O1VYIBWYYHl6utYY4JXYoFXYoLk6evl6uxUX39XYoNaZojm6+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J/yh23A/MEJv4fzZ+fvDv33y9f++nXwxLS1v3xV/27v/6m38enLeBL3cTNony/n9GHU2UlcLeHAAAAABJRU5ErkJggg=="
|
|
1456
|
-
}) : /* @__PURE__ */
|
|
1481
|
+
}) : /* @__PURE__ */ H("div", { className: "padorix:size-7" })
|
|
1457
1482
|
]
|
|
1458
1483
|
}) });
|
|
1459
1484
|
}
|
|
1460
1485
|
//#endregion
|
|
1461
1486
|
//#region lib/chats/newchat/chat-input.tsx
|
|
1462
|
-
var $ =
|
|
1487
|
+
var $ = P(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
1463
1488
|
className: "padorix:mb-4",
|
|
1464
1489
|
children: [
|
|
1465
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ U("div", {
|
|
1466
1491
|
className: "padorix:mb-1 padorix:ml-2 padorix:text-[0.8rem] padorix:font-medium",
|
|
1467
1492
|
children: [
|
|
1468
1493
|
n.content,
|
|
1469
1494
|
" ",
|
|
1470
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ H("span", {
|
|
1471
1496
|
className: "padorix:text-red-600",
|
|
1472
1497
|
children: "*"
|
|
1473
1498
|
}),
|
|
1474
1499
|
" "
|
|
1475
1500
|
]
|
|
1476
1501
|
}),
|
|
1477
|
-
t === "input" && /* @__PURE__ */
|
|
1502
|
+
t === "input" && /* @__PURE__ */ H("input", {
|
|
1478
1503
|
type: e,
|
|
1479
1504
|
...n,
|
|
1480
1505
|
ref: r,
|
|
1481
1506
|
placeholder: n.placeholder,
|
|
1482
1507
|
className: `padorix:w-full padorix:bg-slate-100 padorix:rounded-md padorix:p-3 padorix:outline-none padorix:text-sm! padorix:max-md:text-base! padorix:border ${n.error ? "padorix:border-red-400" : "padorix:border-transparent"}`
|
|
1483
1508
|
}),
|
|
1484
|
-
t === "textarea" && /* @__PURE__ */
|
|
1509
|
+
t === "textarea" && /* @__PURE__ */ H("textarea", {
|
|
1485
1510
|
...n,
|
|
1486
1511
|
ref: r,
|
|
1487
1512
|
placeholder: "Leave a message",
|
|
1488
1513
|
className: `padorix:w-full padorix:bg-slate-100 padorix-scrolls padorix:rounded-md padorix:p-3 padorix:outline-none padorix:resize-none padorix:text-sm! padorix:max-md:text-base! padorix:h-24 padorix:border ${n.error ? "padorix:border-red-400" : "padorix:border-transparent"}`
|
|
1489
1514
|
}),
|
|
1490
|
-
n.error && /* @__PURE__ */
|
|
1515
|
+
n.error && /* @__PURE__ */ H("div", {
|
|
1491
1516
|
className: "padorix:text-red-400 padorix:text-xs",
|
|
1492
1517
|
children: n.error
|
|
1493
1518
|
})
|
|
1494
1519
|
]
|
|
1495
|
-
}) })),
|
|
1520
|
+
}) })), ot = [
|
|
1496
1521
|
{
|
|
1497
1522
|
index: 1,
|
|
1498
1523
|
color: "padorix:text-red-600"
|
|
@@ -1514,31 +1539,31 @@ var $ = M(({ type: e = "text", formtype: t = "input", ...n }, r) => /* @__PURE__
|
|
|
1514
1539
|
color: "padorix:text-green-400"
|
|
1515
1540
|
}
|
|
1516
1541
|
];
|
|
1517
|
-
function
|
|
1542
|
+
function st(e) {
|
|
1518
1543
|
function t(t) {
|
|
1519
1544
|
let n = t?.split("-")[1];
|
|
1520
1545
|
if (e.value !== t) return e.setFieldValue?.(e.valueName || "", t), e.setFieldValue2?.(e.valueName2 || "", n);
|
|
1521
1546
|
e.setFieldValue?.(e.valueName || "", ""), e.setFieldValue2?.(e.valueName2 || "", "");
|
|
1522
1547
|
}
|
|
1523
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ U("div", {
|
|
1524
1549
|
className: "padorix:mb-5",
|
|
1525
1550
|
children: [
|
|
1526
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ H("div", {
|
|
1527
1552
|
className: "",
|
|
1528
1553
|
children: e.content
|
|
1529
1554
|
}),
|
|
1530
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ H("div", {
|
|
1531
1556
|
className: "padorix:flex padorix:items-center padorix:gap-3",
|
|
1532
|
-
children: Object.values(
|
|
1533
|
-
let i = Object.values(
|
|
1534
|
-
return /* @__PURE__ */
|
|
1557
|
+
children: Object.values(m).map((n, r) => {
|
|
1558
|
+
let i = Object.values(m).findIndex((t) => t?.split("-")[1] === e.value2) + 1, a = r + 1 <= i, o = ot.find((e) => e.index === i);
|
|
1559
|
+
return /* @__PURE__ */ H("div", {
|
|
1535
1560
|
onClick: () => e.tag === "write" ? t(n) : {},
|
|
1536
1561
|
className: `${e.tag === "write" ? "padorix:cursor-pointer padorix:active:scale-125 padorix:transition-all padorix:hover:scale-110" : ""} padorix:text-3xl`,
|
|
1537
|
-
children: /* @__PURE__ */
|
|
1562
|
+
children: /* @__PURE__ */ H(Ke, { className: a ? o?.color : "padorix:text-gray-400" })
|
|
1538
1563
|
}, r);
|
|
1539
1564
|
})
|
|
1540
1565
|
}),
|
|
1541
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ H("div", {
|
|
1542
1567
|
className: "padorix:mt-2 padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1543
1568
|
children: e.value?.split("-")[0]?.replace("_", " ")
|
|
1544
1569
|
})
|
|
@@ -1547,8 +1572,8 @@ function ot(e) {
|
|
|
1547
1572
|
}
|
|
1548
1573
|
//#endregion
|
|
1549
1574
|
//#region lib/chats/chatmessages/chat-feedback-form.tsx
|
|
1550
|
-
function
|
|
1551
|
-
let { sender: e, conversation: t, workspace: n } =
|
|
1575
|
+
function ct() {
|
|
1576
|
+
let { sender: e, conversation: t, workspace: n } = j((e) => e.data), [r, i] = F(!1), a = A(), o = Be(T.VISITOR), s = me({
|
|
1552
1577
|
mode: "uncontrolled",
|
|
1553
1578
|
initialValues: {
|
|
1554
1579
|
workspaceId: t?.workspaceId,
|
|
@@ -1568,45 +1593,45 @@ function st() {
|
|
|
1568
1593
|
}
|
|
1569
1594
|
});
|
|
1570
1595
|
async function l(e) {
|
|
1571
|
-
if (
|
|
1596
|
+
if (o) {
|
|
1572
1597
|
i(!0);
|
|
1573
1598
|
try {
|
|
1574
|
-
a(
|
|
1599
|
+
a(g(await v.submitFeedback(o, {
|
|
1575
1600
|
comment: e.comment,
|
|
1576
1601
|
satisfactory: e.satisfactory?.split("-")[0]?.replace("_", " "),
|
|
1577
1602
|
rating: Number(e.rating)
|
|
1578
|
-
}))),
|
|
1603
|
+
}))), s.reset();
|
|
1579
1604
|
} catch (e) {
|
|
1580
|
-
i(!1),
|
|
1605
|
+
i(!1), c(e.message, "error");
|
|
1581
1606
|
}
|
|
1582
1607
|
}
|
|
1583
1608
|
}
|
|
1584
|
-
return r ? null : /* @__PURE__ */
|
|
1585
|
-
onSubmit:
|
|
1609
|
+
return r ? null : /* @__PURE__ */ U("form", {
|
|
1610
|
+
onSubmit: s.onSubmit(l),
|
|
1586
1611
|
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1587
1612
|
children: [
|
|
1588
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ H(st, {
|
|
1589
1614
|
content: "",
|
|
1590
|
-
value:
|
|
1591
|
-
value2:
|
|
1615
|
+
value: s.values.satisfactory,
|
|
1616
|
+
value2: s.values.rating,
|
|
1592
1617
|
tag: "write",
|
|
1593
1618
|
valueName: "satisfactory",
|
|
1594
1619
|
valueName2: "rating",
|
|
1595
|
-
setFieldValue:
|
|
1596
|
-
setFieldValue2:
|
|
1620
|
+
setFieldValue: s.setFieldValue,
|
|
1621
|
+
setFieldValue2: s.setFieldValue
|
|
1597
1622
|
}),
|
|
1598
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ N($, {
|
|
1599
1624
|
content: "",
|
|
1600
1625
|
formtype: "textarea",
|
|
1601
|
-
error:
|
|
1602
|
-
...
|
|
1603
|
-
key:
|
|
1626
|
+
error: s.errors.comment?.toString() || "",
|
|
1627
|
+
...s.getInputProps("comment"),
|
|
1628
|
+
key: s.key("comment")
|
|
1604
1629
|
}),
|
|
1605
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ H("div", {
|
|
1606
1631
|
className: "padorix:mt-5",
|
|
1607
|
-
children: /* @__PURE__ */
|
|
1608
|
-
style: { background:
|
|
1609
|
-
className: `padorix:cursor-pointer ${
|
|
1632
|
+
children: /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
1633
|
+
style: { background: s.submitting ? "" : String(n?.widget?.colorScheme) },
|
|
1634
|
+
className: `padorix:cursor-pointer ${s.submitting ? "padorix:bg-slate-500" : ""} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1610
1635
|
children: "Submit your feedback"
|
|
1611
1636
|
}) })
|
|
1612
1637
|
})
|
|
@@ -1615,47 +1640,47 @@ function st() {
|
|
|
1615
1640
|
}
|
|
1616
1641
|
//#endregion
|
|
1617
1642
|
//#region lib/chats/chatmessages/end-chat-confirmation.tsx
|
|
1618
|
-
function
|
|
1619
|
-
let { chatToEnd: e, workspace: t } =
|
|
1620
|
-
function
|
|
1621
|
-
|
|
1643
|
+
function lt() {
|
|
1644
|
+
let { chatToEnd: e, workspace: t } = j((e) => e.data), n = A(), [r, i] = M.useState(!1);
|
|
1645
|
+
function a() {
|
|
1646
|
+
n(o(void 0));
|
|
1622
1647
|
}
|
|
1623
|
-
async function
|
|
1648
|
+
async function s() {
|
|
1624
1649
|
if (e) {
|
|
1625
|
-
|
|
1650
|
+
i(!0);
|
|
1626
1651
|
try {
|
|
1627
|
-
|
|
1652
|
+
n(g(await v.endChat({
|
|
1628
1653
|
workspaceId: e.workspaceId,
|
|
1629
1654
|
conversationId: e.conversationId,
|
|
1630
1655
|
senderId: e.senderId,
|
|
1631
1656
|
userType: e.userType,
|
|
1632
1657
|
senderName: e.senderName
|
|
1633
|
-
}))),
|
|
1658
|
+
}))), n(o(void 0));
|
|
1634
1659
|
} catch (e) {
|
|
1635
|
-
|
|
1660
|
+
c(e.message, "error");
|
|
1636
1661
|
} finally {
|
|
1637
|
-
|
|
1662
|
+
i(!1);
|
|
1638
1663
|
}
|
|
1639
1664
|
}
|
|
1640
1665
|
}
|
|
1641
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ U("div", {
|
|
1642
1667
|
className: "padorix:w-[97%] padorix:mx-auto padorix:border padorix:border-gray-200 padorix:rounded-xl padorix:p-3",
|
|
1643
|
-
children: [/* @__PURE__ */
|
|
1668
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1644
1669
|
className: "padorix:text-center padorix:text-slate-500",
|
|
1645
1670
|
children: "Kindly confirm your request to end this chat session"
|
|
1646
|
-
}), /* @__PURE__ */
|
|
1671
|
+
}), /* @__PURE__ */ H("div", {
|
|
1647
1672
|
className: "padorix:border-t padorix:border-gray-200 padorix:mt-5",
|
|
1648
|
-
children: /* @__PURE__ */
|
|
1673
|
+
children: /* @__PURE__ */ U("div", {
|
|
1649
1674
|
className: "padorix:mt-2 padorix:size-fit padorix:ml-auto padorix:flex padorix:items-center padorix:gap-5",
|
|
1650
|
-
children: [/* @__PURE__ */
|
|
1651
|
-
onClick:
|
|
1652
|
-
className: `${
|
|
1675
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
1676
|
+
onClick: a,
|
|
1677
|
+
className: `${r ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:border padorix:border-gray-200 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1653
1678
|
children: "Cancel"
|
|
1654
|
-
}) }), /* @__PURE__ */
|
|
1655
|
-
onClick:
|
|
1656
|
-
disabled:
|
|
1679
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
1680
|
+
onClick: s,
|
|
1681
|
+
disabled: r,
|
|
1657
1682
|
style: { background: String(t?.widget?.colorScheme) },
|
|
1658
|
-
className: `${
|
|
1683
|
+
className: `${r ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
1659
1684
|
children: "End chat"
|
|
1660
1685
|
}) })]
|
|
1661
1686
|
})
|
|
@@ -1664,15 +1689,15 @@ function ct() {
|
|
|
1664
1689
|
}
|
|
1665
1690
|
//#endregion
|
|
1666
1691
|
//#region lib/chats/chatmessages/chat-messages.tsx
|
|
1667
|
-
function
|
|
1668
|
-
let { conversation: r, chatToEnd: i, workspace: a } =
|
|
1692
|
+
function ut({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
1693
|
+
let { conversation: r, chatToEnd: i, workspace: a } = j((e) => e.data), o = n.userType === "VISITOR";
|
|
1669
1694
|
function s(n) {
|
|
1670
1695
|
e.find((e) => e === n) ? t((e) => e.filter((e) => e !== n)) : t((e) => [...e, n]);
|
|
1671
1696
|
}
|
|
1672
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ U("div", {
|
|
1673
1698
|
className: "padorix:relative",
|
|
1674
1699
|
children: [
|
|
1675
|
-
n.messages.map((t) => /* @__PURE__ */
|
|
1700
|
+
n.messages.map((t) => /* @__PURE__ */ H(at, {
|
|
1676
1701
|
messagesToDelete: e,
|
|
1677
1702
|
handleStarMessage: n.handleStarMessage,
|
|
1678
1703
|
deleteAction: s,
|
|
@@ -1682,7 +1707,7 @@ function lt({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
|
1682
1707
|
userType: n.userType,
|
|
1683
1708
|
moreActions: n.moreActions
|
|
1684
1709
|
}, t.clientMessageId || t.id)),
|
|
1685
|
-
n.isTyping && /* @__PURE__ */
|
|
1710
|
+
n.isTyping && /* @__PURE__ */ H("div", {
|
|
1686
1711
|
role: "status",
|
|
1687
1712
|
"aria-label": "Typing",
|
|
1688
1713
|
style: n.isOwnTyping ? { backgroundColor: a?.widget?.colorScheme || "#6c63ff" } : void 0,
|
|
@@ -1691,19 +1716,19 @@ function lt({ messagesToDelete: e, setMessagesToDelete: t, ...n }) {
|
|
|
1691
1716
|
0,
|
|
1692
1717
|
1,
|
|
1693
1718
|
2
|
|
1694
|
-
].map((e) => /* @__PURE__ */
|
|
1719
|
+
].map((e) => /* @__PURE__ */ H("span", {
|
|
1695
1720
|
className: n.isOwnTyping ? "padorix:size-2 padorix:animate-bounce padorix:rounded-full padorix:bg-white" : "padorix:size-2 padorix:animate-bounce padorix:rounded-full padorix:bg-gray-500 padorix:dark:bg-gray-200",
|
|
1696
1721
|
style: { animationDelay: `${e * 120}ms` }
|
|
1697
1722
|
}, e))
|
|
1698
1723
|
}),
|
|
1699
|
-
o && r?.status ===
|
|
1700
|
-
i?.isEndChat ===
|
|
1724
|
+
o && r?.status === E.false && /* @__PURE__ */ H(ct, {}),
|
|
1725
|
+
i?.isEndChat === E.true && /* @__PURE__ */ H(lt, {})
|
|
1701
1726
|
]
|
|
1702
1727
|
});
|
|
1703
1728
|
}
|
|
1704
1729
|
//#endregion
|
|
1705
1730
|
//#region node_modules/react-icons/rx/index.mjs
|
|
1706
|
-
function
|
|
1731
|
+
function dt(e) {
|
|
1707
1732
|
return Z({
|
|
1708
1733
|
tag: "svg",
|
|
1709
1734
|
attr: {
|
|
@@ -1722,36 +1747,36 @@ function ut(e) {
|
|
|
1722
1747
|
}
|
|
1723
1748
|
//#endregion
|
|
1724
1749
|
//#region lib/chats/chatmessages/chat-message-skeleton.tsx
|
|
1725
|
-
function
|
|
1726
|
-
return /* @__PURE__ */
|
|
1750
|
+
function ft(e) {
|
|
1751
|
+
return /* @__PURE__ */ H(B, {
|
|
1727
1752
|
style: { width: `${Math.floor(Math.random() * 100 + (e.index + 15))}%` },
|
|
1728
1753
|
className: "padorix:w-fit padorix:h-fit padorix:max-w-[91%] padorix:relative padorix:bottom-3 padorix:md:max-w-[80%] padorix:mb-1.5 padorix:ml-auto padorix:rounded-t-xl padorix:rounded-bl-xl padorix:bg-gray-100 padorix:animate-pulse padorix:text-white",
|
|
1729
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ H("div", { className: "padorix:px-1 padorix:h-12" })
|
|
1730
1755
|
});
|
|
1731
1756
|
}
|
|
1732
1757
|
//#endregion
|
|
1733
1758
|
//#region lib/chats/chatScreen/chat-container.tsx
|
|
1734
|
-
var
|
|
1735
|
-
function
|
|
1759
|
+
var pt = 3500, mt = ["Invalid chat session", "No Active session found"];
|
|
1760
|
+
function ht(e) {
|
|
1736
1761
|
return e ? Array.isArray(e) ? e.join("\n") : String(e) : "";
|
|
1737
1762
|
}
|
|
1738
|
-
function
|
|
1739
|
-
let
|
|
1740
|
-
...
|
|
1741
|
-
workspaceId:
|
|
1742
|
-
userType:
|
|
1743
|
-
} :
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1763
|
+
function gt({ styles: e, userType: t, ...r }) {
|
|
1764
|
+
let a = A(), s = M.useRef(null), l = M.useRef(null), [u, f] = M.useState(!1), [p, m] = M.useState([]), [_, y] = M.useState(!1), [b, x] = M.useState(!1), [S, w] = M.useState(null), D = M.useRef(null), N = M.useRef(null), [P, F] = M.useState([]), I = M.useRef(/* @__PURE__ */ new Set()), { sender: L, workspace: ne, reply: re, conversation: ie } = j((e) => e.data), ae = S !== null, oe = !!(S?.senderId && S.senderId === L?.senderId), R = M.useMemo(() => t === T.VISITOR ? {
|
|
1765
|
+
...L,
|
|
1766
|
+
workspaceId: ne?.id,
|
|
1767
|
+
userType: t
|
|
1768
|
+
} : r.sender, [
|
|
1769
|
+
t,
|
|
1770
|
+
L,
|
|
1771
|
+
ne?.id,
|
|
1772
|
+
r.sender
|
|
1748
1773
|
]), se = JSON.stringify([
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
]),
|
|
1774
|
+
R?.workspaceId,
|
|
1775
|
+
R?.conversationId,
|
|
1776
|
+
R?.senderId,
|
|
1777
|
+
R?.userType ?? t,
|
|
1778
|
+
R?.fullName
|
|
1779
|
+
]), z = M.useMemo(() => {
|
|
1755
1780
|
let [e, t, n, r, i] = JSON.parse(se);
|
|
1756
1781
|
return !e || !t || !n ? null : {
|
|
1757
1782
|
workspaceId: String(e),
|
|
@@ -1760,218 +1785,239 @@ function mt({ styles: t, userType: i, ...a }) {
|
|
|
1760
1785
|
userType: String(r),
|
|
1761
1786
|
senderName: i ? String(i) : void 0
|
|
1762
1787
|
};
|
|
1763
|
-
}, [se]), ce = String(
|
|
1788
|
+
}, [se]), ce = String(R?.conversationId ?? ""), ue = M.useRef(ce);
|
|
1764
1789
|
ue.current = ce;
|
|
1765
|
-
let
|
|
1766
|
-
function
|
|
1767
|
-
|
|
1790
|
+
let V = M.useCallback((e) => e == null || e === "" ? !0 : String(e) === ue.current, []);
|
|
1791
|
+
function W() {
|
|
1792
|
+
d(s), l.current?.scrollIntoView({ behavior: "smooth" });
|
|
1768
1793
|
}
|
|
1769
|
-
let
|
|
1794
|
+
let fe = (e, t) => e.clientMessageId || !t.clientMessageId ? e : {
|
|
1770
1795
|
...e,
|
|
1771
1796
|
clientMessageId: t.clientMessageId
|
|
1772
|
-
}, G =
|
|
1797
|
+
}, G = M.useCallback((e) => {
|
|
1773
1798
|
let t = e.message;
|
|
1774
|
-
if (!t || !
|
|
1799
|
+
if (!t || !V(t.conversationId)) return;
|
|
1775
1800
|
let n = t.clientMessageId;
|
|
1776
|
-
n &&
|
|
1801
|
+
n && I.current.delete(n), F((e) => {
|
|
1777
1802
|
let r = e.findIndex((e) => e.id === t.id);
|
|
1778
|
-
if (r !== -1) return e.map((e, n) => n === r ?
|
|
1803
|
+
if (r !== -1) return e.map((e, n) => n === r ? fe(t, e) : e);
|
|
1779
1804
|
if (n) {
|
|
1780
1805
|
let r = e.findIndex((e) => e.clientMessageId === n || e.id === n);
|
|
1781
|
-
if (r !== -1) return e.map((e, n) => n === r ?
|
|
1806
|
+
if (r !== -1) return e.map((e, n) => n === r ? fe(t, e) : e);
|
|
1782
1807
|
}
|
|
1783
|
-
let i =
|
|
1784
|
-
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a =
|
|
1808
|
+
let i = ht(t.message), a = e.findIndex((e) => {
|
|
1809
|
+
let n = !!(e.id && e.id.length >= 32), r = String(e.senderId) === String(t.senderId), a = ht(e.message) === i;
|
|
1785
1810
|
return n && r && a;
|
|
1786
1811
|
});
|
|
1787
|
-
return a === -1 ? [...e, t] : e.map((e, n) => n === a ?
|
|
1812
|
+
return a === -1 ? [...e, t] : e.map((e, n) => n === a ? fe(t, e) : e);
|
|
1788
1813
|
}), x(!1), setTimeout(() => {
|
|
1789
|
-
|
|
1814
|
+
W();
|
|
1790
1815
|
}, 300);
|
|
1791
|
-
}, [
|
|
1816
|
+
}, [V]), K = M.useCallback((e) => {
|
|
1792
1817
|
G(e);
|
|
1793
|
-
}, [G]),
|
|
1794
|
-
if (!
|
|
1795
|
-
|
|
1818
|
+
}, [G]), pe = M.useCallback((e) => {
|
|
1819
|
+
if (!I.current.has(e)) return;
|
|
1820
|
+
I.current.delete(e);
|
|
1796
1821
|
let t = [e];
|
|
1797
|
-
|
|
1822
|
+
F((e) => e.filter((e) => !t.includes(e.id) && (!e.clientMessageId || !t.includes(e.clientMessageId)))), x(!1);
|
|
1798
1823
|
}, []);
|
|
1799
|
-
function
|
|
1800
|
-
let
|
|
1801
|
-
...
|
|
1802
|
-
clientMessageId:
|
|
1803
|
-
merchantId:
|
|
1804
|
-
...
|
|
1824
|
+
function me(e) {
|
|
1825
|
+
let r = !!re?.messageId, i = crypto.randomUUID(), o = {
|
|
1826
|
+
...e,
|
|
1827
|
+
clientMessageId: i,
|
|
1828
|
+
merchantId: ne?.userId,
|
|
1829
|
+
...r ? {
|
|
1805
1830
|
isReply: !0,
|
|
1806
1831
|
messageId: re?.messageId
|
|
1807
1832
|
} : {},
|
|
1808
|
-
message:
|
|
1809
|
-
},
|
|
1810
|
-
id:
|
|
1811
|
-
clientMessageId:
|
|
1833
|
+
message: e.message.trim()
|
|
1834
|
+
}, s = (/* @__PURE__ */ new Date()).toISOString(), l = {
|
|
1835
|
+
id: i,
|
|
1836
|
+
clientMessageId: i,
|
|
1812
1837
|
conversationId: o.conversationId,
|
|
1813
1838
|
workspaceId: o.workspaceId,
|
|
1814
|
-
senderName:
|
|
1815
|
-
senderType:
|
|
1839
|
+
senderName: L?.fullName ?? "",
|
|
1840
|
+
senderType: t,
|
|
1816
1841
|
senderId: o.senderId,
|
|
1817
1842
|
message: [o.message],
|
|
1818
1843
|
images: o.images ?? [],
|
|
1819
|
-
starred:
|
|
1820
|
-
deleted:
|
|
1821
|
-
createdAt:
|
|
1822
|
-
updatedAt:
|
|
1844
|
+
starred: E.false,
|
|
1845
|
+
deleted: E.false,
|
|
1846
|
+
createdAt: s,
|
|
1847
|
+
updatedAt: s
|
|
1823
1848
|
};
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
}),
|
|
1827
|
-
|
|
1849
|
+
I.current.add(i), F((e) => e.some((e) => e.id === i || e.clientMessageId && e.clientMessageId === i) ? e : [...e, l]), x(!0), z && v.sendMessage(z, o).then((e) => G({ message: e })).catch((e) => {
|
|
1850
|
+
pe(i), c(e.message || "Message not sent", "error");
|
|
1851
|
+
}), a(n(void 0)), a(h(void 0)), setTimeout(() => {
|
|
1852
|
+
W();
|
|
1828
1853
|
}, 50);
|
|
1829
1854
|
}
|
|
1830
|
-
let q =
|
|
1831
|
-
|
|
1855
|
+
let q = M.useCallback((e) => {
|
|
1856
|
+
F((t) => t.some((t) => t.id === e.messageId) ? t.map((t) => t.id === e.messageId ? {
|
|
1832
1857
|
...t,
|
|
1833
1858
|
starred: e.status
|
|
1834
1859
|
} : t) : t);
|
|
1835
|
-
}, []), J =
|
|
1836
|
-
|
|
1837
|
-
|
|
1860
|
+
}, []), J = M.useCallback((e) => {
|
|
1861
|
+
V(e?.id) && (a(g(e)), setTimeout(() => {
|
|
1862
|
+
W();
|
|
1838
1863
|
}, 1e3));
|
|
1839
|
-
}, [
|
|
1840
|
-
|
|
1864
|
+
}, [a, V]), he = M.useCallback(() => {
|
|
1865
|
+
localStorage.removeItem(C), a(i(void 0)), a(g(void 0));
|
|
1866
|
+
}, [a]), ge = M.useCallback((e) => {
|
|
1867
|
+
V(e?.id) && (a(g(e)), a(o(void 0)), localStorage.removeItem(C), t === T.VISITOR && ee(), r.closeModal());
|
|
1841
1868
|
}, [
|
|
1842
|
-
s,
|
|
1843
1869
|
a,
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
return
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1870
|
+
r,
|
|
1871
|
+
V,
|
|
1872
|
+
t
|
|
1873
|
+
]), _e = M.useCallback((e) => {
|
|
1874
|
+
if (V(e?.conversation?.id)) {
|
|
1875
|
+
if (t === T.VISITOR && e.conversation?.conversation_status === E.false) {
|
|
1876
|
+
he();
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
F((t) => {
|
|
1880
|
+
let n = new Map(t.map((e) => [e.id, e]));
|
|
1881
|
+
return (e.messages ?? []).map((e) => {
|
|
1882
|
+
let t = n.get(e.id);
|
|
1883
|
+
return t ? fe(e, t) : e;
|
|
1884
|
+
});
|
|
1885
|
+
}), new Set((e.messages ?? []).map((e) => e.clientMessageId).filter(Boolean)).forEach((e) => I.current.delete(e)), a(g(e.conversation)), setTimeout(() => {
|
|
1886
|
+
W();
|
|
1887
|
+
}, 1e3);
|
|
1888
|
+
}
|
|
1889
|
+
}, [
|
|
1890
|
+
a,
|
|
1891
|
+
V,
|
|
1892
|
+
t,
|
|
1893
|
+
he
|
|
1894
|
+
]);
|
|
1895
|
+
function ve(e, t) {
|
|
1896
|
+
z && v.starMessage(z, e, t).then(q).catch((e) => c(e.message, "error"));
|
|
1859
1897
|
}
|
|
1860
|
-
function
|
|
1898
|
+
function ye(e) {
|
|
1861
1899
|
let t = [];
|
|
1862
1900
|
e.forEach((e) => {
|
|
1863
|
-
let n =
|
|
1901
|
+
let n = P.find((t) => t.id === e);
|
|
1864
1902
|
n && t.push(n.id);
|
|
1865
|
-
}), !(!
|
|
1903
|
+
}), !(!z || t.length === 0) && v.deleteMessages(z, t).then(be).catch((e) => c(e.message, "error"));
|
|
1866
1904
|
}
|
|
1867
|
-
let
|
|
1905
|
+
let be = M.useCallback((e) => {
|
|
1868
1906
|
if (!e || e.length === 0) return;
|
|
1869
1907
|
let t = new Set(e);
|
|
1870
|
-
|
|
1908
|
+
F((e) => e.some((e) => t.has(e.id)) ? e.map((e) => t.has(e.id) ? {
|
|
1871
1909
|
...e,
|
|
1872
|
-
deleted:
|
|
1910
|
+
deleted: E.true
|
|
1873
1911
|
} : e) : e);
|
|
1874
|
-
}, []),
|
|
1912
|
+
}, []), xe = M.useCallback((e) => {
|
|
1875
1913
|
let t = typeof e == "object" && e ? e : {};
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
},
|
|
1879
|
-
}, [
|
|
1914
|
+
V(t.conversationId) && (D.current = t, w(t), N.current !== null && window.clearTimeout(N.current), N.current = window.setTimeout(() => {
|
|
1915
|
+
D.current = null, w(null), N.current = null;
|
|
1916
|
+
}, pt));
|
|
1917
|
+
}, [V]), Y = M.useCallback((e) => {
|
|
1880
1918
|
let t = typeof e == "object" && e ? e : {};
|
|
1881
|
-
|
|
1882
|
-
}, [
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
}, [ce]),
|
|
1886
|
-
|
|
1887
|
-
}), [
|
|
1888
|
-
ae && !
|
|
1889
|
-
}, [
|
|
1890
|
-
let e =
|
|
1919
|
+
V(t.conversationId) && (t.senderId && D.current?.senderId && t.senderId !== D.current.senderId || (N.current !== null && (window.clearTimeout(N.current), N.current = null), D.current = null, w(null)));
|
|
1920
|
+
}, [V]);
|
|
1921
|
+
M.useEffect(() => {
|
|
1922
|
+
N.current !== null && (window.clearTimeout(N.current), N.current = null), D.current = null, w(null);
|
|
1923
|
+
}, [ce]), M.useEffect(() => (O.on(k.is_typing, xe), O.on(k.not_typing, Y), () => {
|
|
1924
|
+
O.off(k.is_typing, xe), O.off(k.not_typing, Y), N.current !== null && window.clearTimeout(N.current);
|
|
1925
|
+
}), [Y, xe]), M.useEffect(() => {
|
|
1926
|
+
ae && !u && l.current?.scrollIntoView({ behavior: "smooth" });
|
|
1927
|
+
}, [u, ae]), M.useEffect(() => {
|
|
1928
|
+
let e = s.current;
|
|
1891
1929
|
if (!e) return;
|
|
1892
1930
|
let t = () => {
|
|
1893
1931
|
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e;
|
|
1894
|
-
n - t - r > 5 ?
|
|
1932
|
+
n - t - r > 5 ? f(!0) : f(!1);
|
|
1895
1933
|
};
|
|
1896
1934
|
return e.addEventListener("scroll", t, { passive: !0 }), () => {
|
|
1897
1935
|
e.removeEventListener("scroll", t);
|
|
1898
1936
|
};
|
|
1899
1937
|
}, []);
|
|
1900
|
-
function
|
|
1901
|
-
|
|
1938
|
+
function Se() {
|
|
1939
|
+
W(), setTimeout(() => W(), 100);
|
|
1902
1940
|
}
|
|
1903
|
-
function
|
|
1904
|
-
|
|
1941
|
+
function X() {
|
|
1942
|
+
m([]);
|
|
1905
1943
|
}
|
|
1906
|
-
function
|
|
1907
|
-
|
|
1908
|
-
|
|
1944
|
+
function Ce() {
|
|
1945
|
+
ye(p), setTimeout(() => {
|
|
1946
|
+
m([]);
|
|
1909
1947
|
}, 100);
|
|
1910
1948
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1949
|
+
M.useEffect(() => (O.on(k.delete_message, be), O.on(k.star_message, q), O.on(k.request_feedback, J), O.on(k.submit_feedback, J), O.on(k.end_chat_session, ge), () => {
|
|
1950
|
+
O.off(k.delete_message, be), O.off(k.star_message, q), O.off(k.request_feedback, J), O.off(k.submit_feedback, J), O.off(k.end_chat_session, ge);
|
|
1913
1951
|
}), [
|
|
1914
|
-
|
|
1952
|
+
be,
|
|
1915
1953
|
q,
|
|
1916
1954
|
J,
|
|
1917
|
-
|
|
1918
|
-
]),
|
|
1919
|
-
|
|
1920
|
-
}), [G, K]),
|
|
1921
|
-
if (!
|
|
1955
|
+
ge
|
|
1956
|
+
]), M.useEffect(() => (O.on(k.send_message, G), O.on(k.update_send_message, K), () => {
|
|
1957
|
+
O.off(k.update_send_message, K), O.off(k.send_message, G);
|
|
1958
|
+
}), [G, K]), M.useEffect(() => {
|
|
1959
|
+
if (!z) return;
|
|
1922
1960
|
let e = !1, t = () => {
|
|
1923
|
-
|
|
1961
|
+
v.history(z).then((t) => !e && _e(t)).catch((t) => {
|
|
1962
|
+
let n = t.message;
|
|
1963
|
+
if (!e && z.userType === T.VISITOR && mt.includes(n)) return he();
|
|
1964
|
+
console.log(n);
|
|
1965
|
+
});
|
|
1924
1966
|
}, n = () => {
|
|
1925
|
-
|
|
1967
|
+
O.emit(k.subscribe_conversation, z), t();
|
|
1926
1968
|
};
|
|
1927
|
-
return
|
|
1928
|
-
e = !0,
|
|
1969
|
+
return O.on(k.connected, n), O.connected ? n() : (t(), te(z.userType !== T.VISITOR)), () => {
|
|
1970
|
+
e = !0, O.off(k.connected, n);
|
|
1929
1971
|
};
|
|
1930
|
-
}, [
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1972
|
+
}, [
|
|
1973
|
+
z,
|
|
1974
|
+
_e,
|
|
1975
|
+
he
|
|
1976
|
+
]);
|
|
1977
|
+
let we = `calc(var(--padorix-vvh, 100dvh) * ${p.length > 0 || ie?.status === E.false ? .915 : .81})`;
|
|
1978
|
+
return /* @__PURE__ */ U("div", {
|
|
1979
|
+
className: e.chatScreen,
|
|
1934
1980
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
styles:
|
|
1937
|
-
userType:
|
|
1938
|
-
goBack:
|
|
1939
|
-
close:
|
|
1940
|
-
toBottom:
|
|
1941
|
-
messages:
|
|
1981
|
+
/* @__PURE__ */ H(Ge, {
|
|
1982
|
+
styles: e,
|
|
1983
|
+
userType: t,
|
|
1984
|
+
goBack: r.goBack,
|
|
1985
|
+
close: r.closeModal,
|
|
1986
|
+
toBottom: Se,
|
|
1987
|
+
messages: P
|
|
1942
1988
|
}),
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
ref:
|
|
1945
|
-
style: { height:
|
|
1946
|
-
className: `${
|
|
1989
|
+
/* @__PURE__ */ U("div", {
|
|
1990
|
+
ref: s,
|
|
1991
|
+
style: t === T.VISITOR ? void 0 : { height: we },
|
|
1992
|
+
className: `${e.chatContainerPadding}`,
|
|
1947
1993
|
children: [
|
|
1948
|
-
|
|
1994
|
+
u && /* @__PURE__ */ H(de, {
|
|
1949
1995
|
direction: "up",
|
|
1950
1996
|
className: "\r\n padorix:fixed\r\n padorix:right-2\r\n padorix:bottom-36\r\n padorix:z-10\r\n padorix:cursor-pointer\r\n padorix:transition-all\r\n padorix:active:scale-125\r\n ",
|
|
1951
|
-
children: /* @__PURE__ */
|
|
1997
|
+
children: /* @__PURE__ */ H("div", {
|
|
1952
1998
|
className: "\r\n padorix:transition-all\r\n padorix:rounded-full\r\n padorix:size-8\r\n padorix:text-slate-500\r\n padorix:border\r\n padorix:border-gray-200\r\n padorix:flex\r\n padorix:items-center\r\n padorix:justify-center\r\n padorix:bg-white\r\n padorix:shadow-lg\r\n ",
|
|
1953
|
-
onClick:
|
|
1954
|
-
children: /* @__PURE__ */
|
|
1999
|
+
onClick: W,
|
|
2000
|
+
children: /* @__PURE__ */ H(dt, {})
|
|
1955
2001
|
})
|
|
1956
2002
|
}),
|
|
1957
|
-
Number(
|
|
2003
|
+
Number(P?.length) < 1 && /* @__PURE__ */ H("div", {
|
|
1958
2004
|
className: "padorix:relative padorix:p-4",
|
|
1959
|
-
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */
|
|
2005
|
+
children: Array(8).fill(0).map((e, t) => /* @__PURE__ */ H(ft, { index: t }, t))
|
|
1960
2006
|
}),
|
|
1961
|
-
/* @__PURE__ */
|
|
1962
|
-
messages:
|
|
1963
|
-
deleteMessagesAction:
|
|
1964
|
-
handleStarMessage:
|
|
1965
|
-
styles:
|
|
1966
|
-
userType:
|
|
1967
|
-
messagesToDelete:
|
|
1968
|
-
setMessagesToDelete:
|
|
1969
|
-
moreActions:
|
|
2007
|
+
/* @__PURE__ */ H(ut, {
|
|
2008
|
+
messages: P,
|
|
2009
|
+
deleteMessagesAction: ye,
|
|
2010
|
+
handleStarMessage: ve,
|
|
2011
|
+
styles: e,
|
|
2012
|
+
userType: t,
|
|
2013
|
+
messagesToDelete: p,
|
|
2014
|
+
setMessagesToDelete: m,
|
|
2015
|
+
moreActions: r.moreActions,
|
|
1970
2016
|
isTyping: ae,
|
|
1971
2017
|
isOwnTyping: oe
|
|
1972
2018
|
}),
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
ref:
|
|
2019
|
+
/* @__PURE__ */ H("div", {
|
|
2020
|
+
ref: l,
|
|
1975
2021
|
style: {
|
|
1976
2022
|
float: "left",
|
|
1977
2023
|
clear: "both"
|
|
@@ -1979,58 +2025,58 @@ function mt({ styles: t, userType: i, ...a }) {
|
|
|
1979
2025
|
})
|
|
1980
2026
|
]
|
|
1981
2027
|
}),
|
|
1982
|
-
|
|
1983
|
-
className:
|
|
1984
|
-
children: [/* @__PURE__ */
|
|
2028
|
+
_ && p.length > 0 && /* @__PURE__ */ U("div", {
|
|
2029
|
+
className: e.messagesContainer,
|
|
2030
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1985
2031
|
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
1986
|
-
children: [/* @__PURE__ */
|
|
1987
|
-
onClick:
|
|
2032
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2033
|
+
onClick: X,
|
|
1988
2034
|
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
1989
|
-
children: /* @__PURE__ */
|
|
1990
|
-
}), /* @__PURE__ */
|
|
2035
|
+
children: /* @__PURE__ */ H(Q, {})
|
|
2036
|
+
}), /* @__PURE__ */ U("div", {
|
|
1991
2037
|
className: "padorix:space-x-0.5",
|
|
1992
2038
|
children: [
|
|
1993
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ H("span", { children: "Confirm to delete" }),
|
|
1994
2040
|
" ",
|
|
1995
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ U("span", {
|
|
1996
2042
|
className: "padorix:text-red-500",
|
|
1997
2043
|
children: [
|
|
1998
|
-
|
|
2044
|
+
p.length,
|
|
1999
2045
|
" message",
|
|
2000
|
-
|
|
2046
|
+
p.length === 1 ? "" : "s"
|
|
2001
2047
|
]
|
|
2002
2048
|
})
|
|
2003
2049
|
]
|
|
2004
2050
|
})]
|
|
2005
|
-
}), /* @__PURE__ */
|
|
2006
|
-
onClick:
|
|
2051
|
+
}), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2052
|
+
onClick: Ce,
|
|
2007
2053
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125 padorix:text-red-500",
|
|
2008
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ H(le, {})
|
|
2009
2055
|
}) })]
|
|
2010
2056
|
}),
|
|
2011
|
-
!
|
|
2012
|
-
className:
|
|
2013
|
-
children: [/* @__PURE__ */
|
|
2057
|
+
!_ && p.length > 0 && /* @__PURE__ */ U("div", {
|
|
2058
|
+
className: e.messagesContainer,
|
|
2059
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2014
2060
|
className: "padorix:flex padorix:items-center padorix:text-sm padorix:italic padorix:text-gray-600",
|
|
2015
2061
|
children: [
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
onClick:
|
|
2062
|
+
/* @__PURE__ */ H("div", {
|
|
2063
|
+
onClick: X,
|
|
2018
2064
|
className: "padorix:p-2 padorix:text-xl padorix:cursor-pointer padorix:transition-all",
|
|
2019
|
-
children: /* @__PURE__ */
|
|
2065
|
+
children: /* @__PURE__ */ H(Q, {})
|
|
2020
2066
|
}),
|
|
2021
|
-
|
|
2067
|
+
p.length,
|
|
2022
2068
|
" Selected"
|
|
2023
2069
|
]
|
|
2024
|
-
}), /* @__PURE__ */
|
|
2070
|
+
}), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2025
2071
|
onClick: () => y(!0),
|
|
2026
2072
|
className: "padorix:cursor-pointer padorix:transition-all padorix:active:scale-125",
|
|
2027
|
-
children: /* @__PURE__ */
|
|
2073
|
+
children: /* @__PURE__ */ H(le, {})
|
|
2028
2074
|
}) })]
|
|
2029
2075
|
}),
|
|
2030
|
-
|
|
2031
|
-
sendChat:
|
|
2032
|
-
styles:
|
|
2033
|
-
userType:
|
|
2076
|
+
p.length < 1 && ie?.status === E.true && /* @__PURE__ */ H(Ve, {
|
|
2077
|
+
sendChat: me,
|
|
2078
|
+
styles: e,
|
|
2079
|
+
userType: t,
|
|
2034
2080
|
isSending: b
|
|
2035
2081
|
})
|
|
2036
2082
|
]
|
|
@@ -2038,221 +2084,220 @@ function mt({ styles: t, userType: i, ...a }) {
|
|
|
2038
2084
|
}
|
|
2039
2085
|
//#endregion
|
|
2040
2086
|
//#region lib/assets/images/wave.png
|
|
2041
|
-
var
|
|
2042
|
-
function
|
|
2043
|
-
let { workspace:
|
|
2087
|
+
var _t = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAA7VBMVEUAAADro1Lro1Lro1Lro1L/3Wfvr1bvrlbro1Lro1Lro1JCreJCre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BoRMVFiIxNFNhcxRRVHEygbGR/9oACAEDAQE/AL7al4t3OkculUcqAAOFda3/AOS3Kutb/wDJblXWu0PyW5V1ptHGfqGx+hVhtO8e7hSSXUrsFII+9X/nbr5W/wBq3ga4lWNSBnxJ8ABvJr6C1CgkShdxLll8DxK+IFR2cCTCRUkHRSFDG2G1vwANbRu0eH6XOpkkDMw/jnByB7CtneetfkWr/wA7dfK3+1s2PPTuc4KiIAeJL8BmnjUvM+dLSroZndCAPZVySae4iWUI0qiRgRHvBCe7EcW5Vf2whdZEwEffpDA6DxG6tneetfkWrqGWa/u1jQselc7v3Vq13DHLDHZkur5LEHKnGKt7Ke4KkIwQkgtjcMUba4EYlMLaDxxRsZwu+Ng+oAJjgQTVjG8d7ZFlI1OpGeIqSSBJdqrLnvSjAU4O5jR2hFIQJIX0q6smlsHugLv/AOUdoxlxL0La0L6MNuw5J3j2zQv4xmTom6RkVG73dwuPAf1S3qB5GaNjm46UYOPDOBUNwLraVpKVwxdQ2/dkfarvYks1xLLFMoDtnDZ3E12fufWi512fufWi512fufWi512fufWi51Z7EkguI5pJlIQ5AXia/9k=", yt = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
2088
|
+
function bt(e) {
|
|
2089
|
+
let { workspace: n, tags: r } = j((e) => e.data), a = A(), [o, s] = M.useState(!1), l = M.useMemo(() => t(e.workspaceId), [e.workspaceId]), [u, d] = M.useState(e.openOptions ? 2 : r.length > 0 ? 1 : 2), f = M.useRef(0), p = me({
|
|
2044
2090
|
mode: "uncontrolled",
|
|
2045
2091
|
initialValues: {
|
|
2046
|
-
tagId:
|
|
2092
|
+
tagId: r.find((t) => t.tag.trim().toLowerCase() === e.openOptions?.tag?.trim().toLowerCase())?.id ?? "",
|
|
2047
2093
|
fullName: e.openOptions?.name ?? "",
|
|
2048
2094
|
email: e.openOptions?.email ?? "",
|
|
2049
2095
|
message: e.openOptions?.message ?? ""
|
|
2050
2096
|
},
|
|
2051
2097
|
validate: {
|
|
2052
|
-
fullName: (e) =>
|
|
2053
|
-
email: (e) =>
|
|
2054
|
-
message: (e) =>
|
|
2098
|
+
fullName: (e) => u === 2 && !e ? "Full name is required" : u === 2 && e.length <= 2 ? "Your name is expected to be more than 2 characters" : null,
|
|
2099
|
+
email: (e) => u === 2 && !e ? "Email address is required" : u === 2 && !yt(e) ? "Please enter a valid email address" : null,
|
|
2100
|
+
message: (e) => u === 4 && !e ? "Enquiry content is required" : null
|
|
2055
2101
|
}
|
|
2056
2102
|
});
|
|
2057
|
-
function
|
|
2058
|
-
if (
|
|
2059
|
-
if (
|
|
2060
|
-
|
|
2103
|
+
function m() {
|
|
2104
|
+
if (r.length > 0) {
|
|
2105
|
+
if (u === 1) return e.changeScreen(1);
|
|
2106
|
+
d((e) => e - 1);
|
|
2061
2107
|
}
|
|
2062
|
-
if (
|
|
2063
|
-
if (
|
|
2064
|
-
|
|
2108
|
+
if (r.length < 1) {
|
|
2109
|
+
if (u === 2) return e.changeScreen(1);
|
|
2110
|
+
d((e) => e - 1);
|
|
2065
2111
|
}
|
|
2066
2112
|
}
|
|
2067
|
-
function
|
|
2068
|
-
|
|
2113
|
+
function h(e) {
|
|
2114
|
+
p.setFieldValue("tagId", e), d((e) => e + 1);
|
|
2069
2115
|
}
|
|
2070
|
-
async function
|
|
2071
|
-
|
|
2116
|
+
async function _(e) {
|
|
2117
|
+
s(!0);
|
|
2072
2118
|
try {
|
|
2073
|
-
let t = await
|
|
2119
|
+
let t = await v.startConversation(e), n = {
|
|
2074
2120
|
conversationId: t.conversation.id,
|
|
2075
2121
|
senderId: t.senderId,
|
|
2076
2122
|
fullName: t.fullName,
|
|
2077
|
-
tagId: e.tagId
|
|
2078
|
-
expiresAt: K().add(1, "day").endOf("day").toDate().toString()
|
|
2123
|
+
tagId: e.tagId
|
|
2079
2124
|
};
|
|
2080
|
-
localStorage.setItem(
|
|
2125
|
+
localStorage.setItem(C, JSON.stringify(n)), a(g(t.conversation)), a(i(n));
|
|
2081
2126
|
} catch (e) {
|
|
2082
|
-
|
|
2127
|
+
c(e.message || "Unable to start the chat", "error"), window.dispatchEvent(new Event(b));
|
|
2083
2128
|
} finally {
|
|
2084
|
-
|
|
2129
|
+
s(!1);
|
|
2085
2130
|
}
|
|
2086
2131
|
}
|
|
2087
|
-
async function
|
|
2088
|
-
if (
|
|
2089
|
-
await
|
|
2132
|
+
async function y(t) {
|
|
2133
|
+
if (u < 3) return d((e) => e + 1);
|
|
2134
|
+
await _({
|
|
2090
2135
|
...t,
|
|
2091
2136
|
workspaceId: e.workspaceId,
|
|
2092
2137
|
userType: "VISITOR",
|
|
2093
|
-
visitorId:
|
|
2138
|
+
visitorId: l,
|
|
2094
2139
|
tag: e.openOptions?.tag
|
|
2095
2140
|
});
|
|
2096
2141
|
}
|
|
2097
|
-
return
|
|
2142
|
+
return M.useEffect(() => {
|
|
2098
2143
|
if (!e.openRequestId) return;
|
|
2099
2144
|
let t = e.openOptions;
|
|
2100
2145
|
if (!t) {
|
|
2101
|
-
|
|
2146
|
+
d(1);
|
|
2102
2147
|
return;
|
|
2103
2148
|
}
|
|
2104
|
-
let
|
|
2105
|
-
|
|
2106
|
-
tagId:
|
|
2149
|
+
let n = r.find((e) => e.tag.trim().toLowerCase() === t.tag?.trim().toLowerCase())?.id ?? "";
|
|
2150
|
+
p.setValues({
|
|
2151
|
+
tagId: n,
|
|
2107
2152
|
fullName: t.name ?? "",
|
|
2108
2153
|
email: t.email ?? "",
|
|
2109
2154
|
message: t.message ?? ""
|
|
2110
|
-
}),
|
|
2155
|
+
}), d(2), !(e.autoSubmitRequestId !== e.openRequestId || f.current === e.openRequestId || !x(t)) && (f.current = e.openRequestId, _({
|
|
2111
2156
|
workspaceId: e.workspaceId,
|
|
2112
2157
|
userType: "VISITOR",
|
|
2113
|
-
visitorId:
|
|
2158
|
+
visitorId: l,
|
|
2114
2159
|
fullName: t.name?.trim(),
|
|
2115
2160
|
email: t.email?.trim(),
|
|
2116
2161
|
message: t.message?.trim(),
|
|
2117
|
-
tagId:
|
|
2162
|
+
tagId: n || void 0,
|
|
2118
2163
|
tag: t.tag
|
|
2119
2164
|
}));
|
|
2120
|
-
}, [e.openRequestId]), /* @__PURE__ */
|
|
2165
|
+
}, [e.openRequestId]), /* @__PURE__ */ U("div", {
|
|
2121
2166
|
className: e.styles.container,
|
|
2122
|
-
children: [/* @__PURE__ */
|
|
2167
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2123
2168
|
style: {
|
|
2124
|
-
background: String(
|
|
2125
|
-
color:
|
|
2169
|
+
background: String(n?.widget?.colorScheme),
|
|
2170
|
+
color: n?.widget?.textColor || "#ffffff"
|
|
2126
2171
|
},
|
|
2127
2172
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:gap-2",
|
|
2128
|
-
children: [/* @__PURE__ */
|
|
2173
|
+
children: [/* @__PURE__ */ H(B, {
|
|
2129
2174
|
className: "",
|
|
2130
2175
|
children: "Kindly drop your enquiry and we will get back to you immediately"
|
|
2131
|
-
}), /* @__PURE__ */
|
|
2176
|
+
}), /* @__PURE__ */ H("div", {
|
|
2132
2177
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2133
|
-
children: /* @__PURE__ */
|
|
2178
|
+
children: /* @__PURE__ */ H("div", {
|
|
2134
2179
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2135
2180
|
onClick: e.close,
|
|
2136
|
-
children: /* @__PURE__ */
|
|
2181
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2137
2182
|
})
|
|
2138
2183
|
})]
|
|
2139
|
-
}), /* @__PURE__ */
|
|
2184
|
+
}), /* @__PURE__ */ U("div", {
|
|
2140
2185
|
className: "padorix:p-4",
|
|
2141
2186
|
children: [
|
|
2142
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ U("div", {
|
|
2143
2188
|
className: "padorix:flex padorix:items-center padorix:gap-2",
|
|
2144
|
-
children: [/* @__PURE__ */
|
|
2189
|
+
children: [/* @__PURE__ */ H(B, {
|
|
2145
2190
|
className: "padorix:size-10",
|
|
2146
|
-
children: /* @__PURE__ */
|
|
2191
|
+
children: /* @__PURE__ */ U("div", {
|
|
2147
2192
|
className: "",
|
|
2148
2193
|
children: [
|
|
2149
2194
|
" ",
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
src:
|
|
2152
|
-
alt:
|
|
2195
|
+
/* @__PURE__ */ H("img", {
|
|
2196
|
+
src: n?.logo,
|
|
2197
|
+
alt: n?.name,
|
|
2153
2198
|
loading: "lazy",
|
|
2154
2199
|
className: "padorix:size-10 padorix:object-contain"
|
|
2155
2200
|
}),
|
|
2156
2201
|
" "
|
|
2157
2202
|
]
|
|
2158
2203
|
})
|
|
2159
|
-
}), /* @__PURE__ */
|
|
2204
|
+
}), /* @__PURE__ */ H(B, {
|
|
2160
2205
|
className: "padorix:text-right padorix:w-full",
|
|
2161
|
-
children: /* @__PURE__ */
|
|
2206
|
+
children: /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("div", {
|
|
2162
2207
|
className: "padorix:font-medium padorix:text-right",
|
|
2163
|
-
children:
|
|
2164
|
-
}), /* @__PURE__ */
|
|
2208
|
+
children: n?.name
|
|
2209
|
+
}), /* @__PURE__ */ H("div", {
|
|
2165
2210
|
className: "padorix:text-sm padorix:text-right padorix:text-slate-500",
|
|
2166
|
-
children:
|
|
2211
|
+
children: n?.widget?.department
|
|
2167
2212
|
})] })
|
|
2168
2213
|
})]
|
|
2169
2214
|
}),
|
|
2170
|
-
/* @__PURE__ */
|
|
2171
|
-
onSubmit:
|
|
2172
|
-
children: [/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ U("form", {
|
|
2216
|
+
onSubmit: p.onSubmit(y),
|
|
2217
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2173
2218
|
className: "padorix:h-[35dvh] padorix:flex padorix:items-center padorix:justify-center",
|
|
2174
|
-
children: /* @__PURE__ */
|
|
2219
|
+
children: /* @__PURE__ */ U("div", {
|
|
2175
2220
|
className: "padorix:w-full",
|
|
2176
2221
|
children: [
|
|
2177
|
-
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2222
|
+
u === 1 && /* @__PURE__ */ U(V, { children: [
|
|
2223
|
+
/* @__PURE__ */ H(xt, { current: 1 }),
|
|
2224
|
+
/* @__PURE__ */ H("div", {
|
|
2180
2225
|
className: "padorix:font-bold padorix:mb-2",
|
|
2181
2226
|
children: "What is your enquiry about?"
|
|
2182
2227
|
}),
|
|
2183
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ H("div", {
|
|
2184
2229
|
className: "padorix:flex padorix:flex-wrap padorix:items-center padorix:gap-2",
|
|
2185
|
-
children:
|
|
2186
|
-
onClick: () =>
|
|
2187
|
-
style: { background:
|
|
2188
|
-
className: `padorix:text-xs padorix:py-1.5 padorix:px-2 padorix:rounded-md ${
|
|
2230
|
+
children: r?.map((e, t) => /* @__PURE__ */ H("div", {
|
|
2231
|
+
onClick: () => h(e.id),
|
|
2232
|
+
style: { background: p.values.tagId === e.id ? String(n?.widget?.colorScheme) : "#f1f5f9" },
|
|
2233
|
+
className: `padorix:text-xs padorix:py-1.5 padorix:px-2 padorix:rounded-md ${p.values.tagId === e.id ? "padorix:text-white" : "padorix:bg-slate-100 padorix:border padorix:border-gray-200"} padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all`,
|
|
2189
2234
|
children: e.tag
|
|
2190
|
-
},
|
|
2235
|
+
}, t))
|
|
2191
2236
|
}),
|
|
2192
|
-
|
|
2237
|
+
p.errors.tagId ? /* @__PURE__ */ H("div", {
|
|
2193
2238
|
className: "padorix:text-red-400 padorix:text-sm padorix:mt-2",
|
|
2194
|
-
children:
|
|
2239
|
+
children: p.errors.tagId?.toString()
|
|
2195
2240
|
}) : ""
|
|
2196
2241
|
] }),
|
|
2197
|
-
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
screen:
|
|
2201
|
-
tagId:
|
|
2202
|
-
tags:
|
|
2242
|
+
u === 2 && /* @__PURE__ */ U(V, { children: [
|
|
2243
|
+
/* @__PURE__ */ H(xt, { current: 2 }),
|
|
2244
|
+
/* @__PURE__ */ H(St, {
|
|
2245
|
+
screen: u,
|
|
2246
|
+
tagId: p.values.tagId,
|
|
2247
|
+
tags: r
|
|
2203
2248
|
}),
|
|
2204
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ H($, {
|
|
2205
2250
|
content: "Full name",
|
|
2206
2251
|
placeholder: "Enter your full name",
|
|
2207
|
-
error:
|
|
2208
|
-
...
|
|
2209
|
-
},
|
|
2210
|
-
/* @__PURE__ */
|
|
2252
|
+
error: p.errors.fullName?.toString() || "",
|
|
2253
|
+
...p.getInputProps("fullName")
|
|
2254
|
+
}, p.key("fullName")),
|
|
2255
|
+
/* @__PURE__ */ H($, {
|
|
2211
2256
|
content: "Email address",
|
|
2212
2257
|
placeholder: "name@example.com",
|
|
2213
|
-
error:
|
|
2214
|
-
...
|
|
2215
|
-
},
|
|
2258
|
+
error: p.errors.email?.toString() || "",
|
|
2259
|
+
...p.getInputProps("email")
|
|
2260
|
+
}, p.key("email"))
|
|
2216
2261
|
] }),
|
|
2217
|
-
|
|
2218
|
-
/* @__PURE__ */
|
|
2219
|
-
/* @__PURE__ */
|
|
2220
|
-
screen:
|
|
2221
|
-
tagId:
|
|
2222
|
-
tags:
|
|
2223
|
-
name:
|
|
2224
|
-
email:
|
|
2262
|
+
u === 3 && /* @__PURE__ */ U(V, { children: [
|
|
2263
|
+
/* @__PURE__ */ H(xt, { current: 3 }),
|
|
2264
|
+
/* @__PURE__ */ H(St, {
|
|
2265
|
+
screen: u,
|
|
2266
|
+
tagId: p.values.tagId,
|
|
2267
|
+
tags: r,
|
|
2268
|
+
name: p.values.fullName,
|
|
2269
|
+
email: p.values.email
|
|
2225
2270
|
}),
|
|
2226
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ H($, {
|
|
2227
2272
|
content: "Message",
|
|
2228
2273
|
formtype: "textarea",
|
|
2229
|
-
error:
|
|
2230
|
-
...
|
|
2231
|
-
},
|
|
2274
|
+
error: p.errors.message?.toString() || "",
|
|
2275
|
+
...p.getInputProps("message")
|
|
2276
|
+
}, p.key("message"))
|
|
2232
2277
|
] })
|
|
2233
2278
|
]
|
|
2234
2279
|
})
|
|
2235
|
-
}), /* @__PURE__ */
|
|
2280
|
+
}), /* @__PURE__ */ U("div", {
|
|
2236
2281
|
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2237
|
-
children: [/* @__PURE__ */
|
|
2282
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2238
2283
|
type: "button",
|
|
2239
|
-
onClick:
|
|
2284
|
+
onClick: m,
|
|
2240
2285
|
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2241
2286
|
children: "Back"
|
|
2242
|
-
}) }), /* @__PURE__ */
|
|
2243
|
-
disabled:
|
|
2244
|
-
style: { background:
|
|
2245
|
-
className: `${
|
|
2246
|
-
children:
|
|
2287
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2288
|
+
disabled: o,
|
|
2289
|
+
style: { background: o ? "#62748e" : String(n?.widget?.colorScheme) },
|
|
2290
|
+
className: `${o ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
2291
|
+
children: u < 3 ? "Next" : "Start Chat"
|
|
2247
2292
|
}) })]
|
|
2248
2293
|
})]
|
|
2249
2294
|
}),
|
|
2250
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
2251
2296
|
className: "padorix:mt-20 padorix:grayscale-100 padorix:text-sm padorix:flex padorix:items-center padorix:justify-center padorix:text-zinc-500 padorix:gap-2",
|
|
2252
2297
|
children: [
|
|
2253
2298
|
" ",
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
src:
|
|
2299
|
+
/* @__PURE__ */ H("img", {
|
|
2300
|
+
src: vt,
|
|
2256
2301
|
alt: "padorix",
|
|
2257
2302
|
loading: "lazy",
|
|
2258
2303
|
className: "padorix:size-6 padorix:inline"
|
|
@@ -2264,13 +2309,13 @@ function vt(e) {
|
|
|
2264
2309
|
})]
|
|
2265
2310
|
});
|
|
2266
2311
|
}
|
|
2267
|
-
function
|
|
2268
|
-
let { tags: t, workspace: n } =
|
|
2269
|
-
return /* @__PURE__ */
|
|
2312
|
+
function xt(e) {
|
|
2313
|
+
let { tags: t, workspace: n } = j((e) => e.data), r = t.length > 0 ? 3 : 2, i = t.length > 0 ? e.current : e.current - 1;
|
|
2314
|
+
return /* @__PURE__ */ U("div", {
|
|
2270
2315
|
className: "padorix:text-right padorix:text-sm padorix:text-gray-500 padorix:italic padorix:font-semibold",
|
|
2271
2316
|
children: [
|
|
2272
2317
|
"Step ",
|
|
2273
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ H("span", {
|
|
2274
2319
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2275
2320
|
children: i
|
|
2276
2321
|
}),
|
|
@@ -2279,36 +2324,36 @@ function yt(e) {
|
|
|
2279
2324
|
]
|
|
2280
2325
|
});
|
|
2281
2326
|
}
|
|
2282
|
-
function
|
|
2283
|
-
return /* @__PURE__ */
|
|
2327
|
+
function St(e) {
|
|
2328
|
+
return /* @__PURE__ */ U("div", {
|
|
2284
2329
|
className: "padorix:my-2",
|
|
2285
|
-
children: [e.tagId && e.screen > 1 && /* @__PURE__ */
|
|
2330
|
+
children: [e.tagId && e.screen > 1 && /* @__PURE__ */ U("div", {
|
|
2286
2331
|
className: "padorix:text-xs",
|
|
2287
2332
|
children: [
|
|
2288
2333
|
" ",
|
|
2289
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ H("span", {
|
|
2290
2335
|
className: "padorix:text-slate-500 padorix:mr-1",
|
|
2291
2336
|
children: "Enquiry: "
|
|
2292
2337
|
}),
|
|
2293
2338
|
" ",
|
|
2294
2339
|
e.tags?.find((t) => t.id === e.tagId)?.tag
|
|
2295
2340
|
]
|
|
2296
|
-
}), e.screen > 2 && /* @__PURE__ */
|
|
2341
|
+
}), e.screen > 2 && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
2297
2342
|
className: "padorix:text-xs",
|
|
2298
2343
|
children: [
|
|
2299
2344
|
" ",
|
|
2300
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ H("span", {
|
|
2301
2346
|
className: "padorix:text-slate-500 padorix:mr-3",
|
|
2302
2347
|
children: "Name: "
|
|
2303
2348
|
}),
|
|
2304
2349
|
" ",
|
|
2305
2350
|
e.name
|
|
2306
2351
|
]
|
|
2307
|
-
}), /* @__PURE__ */
|
|
2352
|
+
}), /* @__PURE__ */ U("div", {
|
|
2308
2353
|
className: "padorix:text-xs",
|
|
2309
2354
|
children: [
|
|
2310
2355
|
" ",
|
|
2311
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ H("span", {
|
|
2312
2357
|
className: "padorix:text-slate-500 padorix:mr-4",
|
|
2313
2358
|
children: "Email: "
|
|
2314
2359
|
}),
|
|
@@ -2320,129 +2365,129 @@ function bt(e) {
|
|
|
2320
2365
|
}
|
|
2321
2366
|
//#endregion
|
|
2322
2367
|
//#region lib/chats/chatScreen/not-available-banner.tsx
|
|
2323
|
-
function
|
|
2324
|
-
return /* @__PURE__ */
|
|
2368
|
+
function Ct() {
|
|
2369
|
+
return /* @__PURE__ */ H("div", {
|
|
2325
2370
|
className: "padorix:p-2 padorix:text-yellow-800 padorix:bg-yellow-100/50 padorix:border padorix:border-yellow-200 padorix:rounded-md padorix:text-center padorix:text-[0.75rem] padorix:whitespace-pre-line",
|
|
2326
2371
|
children: "We're currently unavailable. Leave us a message \n and we'll get back to you via email."
|
|
2327
2372
|
});
|
|
2328
2373
|
}
|
|
2329
2374
|
//#endregion
|
|
2330
2375
|
//#region lib/chats/chatScreen/chat-faqs.tsx
|
|
2331
|
-
function
|
|
2332
|
-
let { faqs: t, workspace: n } =
|
|
2376
|
+
function wt(e) {
|
|
2377
|
+
let { faqs: t, workspace: n } = j((e) => e.data), [r, i] = M.useState(), a = e.isOpen ? "Talk to an agent" : "Send us a message";
|
|
2333
2378
|
function o(e) {
|
|
2334
2379
|
i(e);
|
|
2335
2380
|
}
|
|
2336
|
-
return r?.question ? /* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */
|
|
2381
|
+
return r?.question ? /* @__PURE__ */ U(V, { children: [
|
|
2382
|
+
/* @__PURE__ */ U("div", {
|
|
2338
2383
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2339
2384
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2340
2385
|
children: [
|
|
2341
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2342
2387
|
className: "padorix:size-8",
|
|
2343
|
-
children: /* @__PURE__ */
|
|
2388
|
+
children: /* @__PURE__ */ U("div", {
|
|
2344
2389
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2345
2390
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2346
2391
|
children: [
|
|
2347
2392
|
" ",
|
|
2348
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ H(qe, { className: "padorix:size-7" }),
|
|
2349
2394
|
" "
|
|
2350
2395
|
]
|
|
2351
2396
|
})
|
|
2352
2397
|
}) }),
|
|
2353
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2354
2399
|
className: "",
|
|
2355
2400
|
children: "Our Frequently asked questions"
|
|
2356
2401
|
}) }),
|
|
2357
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ H("div", {
|
|
2358
2403
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2359
|
-
children: /* @__PURE__ */
|
|
2404
|
+
children: /* @__PURE__ */ H("div", {
|
|
2360
2405
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2361
2406
|
onClick: e.close,
|
|
2362
|
-
children: /* @__PURE__ */
|
|
2407
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2363
2408
|
})
|
|
2364
2409
|
})
|
|
2365
2410
|
]
|
|
2366
2411
|
}),
|
|
2367
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ U("div", {
|
|
2368
2413
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2369
2414
|
children: [
|
|
2370
|
-
!e.isOpen && /* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2415
|
+
!e.isOpen && /* @__PURE__ */ H(Ct, {}),
|
|
2416
|
+
/* @__PURE__ */ H("div", {
|
|
2372
2417
|
className: "padorix:font-bold padorix:text-xl padorix:mb-3",
|
|
2373
2418
|
children: r.question
|
|
2374
2419
|
}),
|
|
2375
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ H("div", {
|
|
2376
2421
|
className: "padorix:whitespace-pre-line padorix:pl-2 padorix:text-gray-600 padorix:text-sm",
|
|
2377
2422
|
children: r.answer
|
|
2378
2423
|
})
|
|
2379
2424
|
]
|
|
2380
2425
|
}),
|
|
2381
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ U("div", {
|
|
2382
2427
|
className: "padorix:flex padorix:items-center padorix:justify-end padorix:p-2 padorix:gap-5",
|
|
2383
|
-
children: [/* @__PURE__ */
|
|
2428
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2384
2429
|
type: "button",
|
|
2385
2430
|
onClick: () => o(void 0),
|
|
2386
2431
|
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2387
2432
|
children: "Back"
|
|
2388
|
-
}) }), /* @__PURE__ */
|
|
2433
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2389
2434
|
onClick: () => e.talkToTeam(!1),
|
|
2390
2435
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2391
2436
|
className: "padorix:cursor-pointer padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2392
2437
|
children: a
|
|
2393
2438
|
}) })]
|
|
2394
2439
|
})
|
|
2395
|
-
] }) : /* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2440
|
+
] }) : /* @__PURE__ */ U(V, { children: [
|
|
2441
|
+
/* @__PURE__ */ U("div", {
|
|
2397
2442
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2398
2443
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2399
2444
|
children: [
|
|
2400
|
-
/* @__PURE__ */
|
|
2445
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2401
2446
|
className: "padorix:size-8",
|
|
2402
|
-
children: /* @__PURE__ */
|
|
2447
|
+
children: /* @__PURE__ */ U("div", {
|
|
2403
2448
|
style: { color: String(n?.widget?.colorScheme) },
|
|
2404
2449
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2405
2450
|
children: [
|
|
2406
2451
|
" ",
|
|
2407
|
-
/* @__PURE__ */
|
|
2452
|
+
/* @__PURE__ */ H(qe, { className: "padorix:size-7" }),
|
|
2408
2453
|
" "
|
|
2409
2454
|
]
|
|
2410
2455
|
})
|
|
2411
2456
|
}) }),
|
|
2412
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2413
2458
|
className: "",
|
|
2414
2459
|
children: "Our Frequently asked questions"
|
|
2415
2460
|
}) }),
|
|
2416
|
-
/* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ H("div", {
|
|
2417
2462
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2418
|
-
children: /* @__PURE__ */
|
|
2463
|
+
children: /* @__PURE__ */ H("div", {
|
|
2419
2464
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2420
2465
|
onClick: e.close,
|
|
2421
|
-
children: /* @__PURE__ */
|
|
2466
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2422
2467
|
})
|
|
2423
2468
|
})
|
|
2424
2469
|
]
|
|
2425
2470
|
}),
|
|
2426
|
-
/* @__PURE__ */
|
|
2471
|
+
/* @__PURE__ */ U("div", {
|
|
2427
2472
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2428
|
-
children: [!e.isOpen && /* @__PURE__ */
|
|
2473
|
+
children: [!e.isOpen && /* @__PURE__ */ H(Ct, {}), t.map((e, t) => /* @__PURE__ */ U("div", {
|
|
2429
2474
|
onClick: () => o(e),
|
|
2430
2475
|
className: "padorix:p-2.5 padorix:flex padorix:items-center padorix:gap-2 padorix:transition-all padorix:cursor-pointer padorix:active:scale-95 padorix:border-b padorix:border-gray-200 padorix:last:border-0",
|
|
2431
|
-
children: [/* @__PURE__ */
|
|
2476
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2432
2477
|
className: "padorix:w-full",
|
|
2433
|
-
children: [/* @__PURE__ */
|
|
2478
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2434
2479
|
className: "padorix:font-semibold",
|
|
2435
2480
|
children: e.question
|
|
2436
|
-
}), /* @__PURE__ */
|
|
2481
|
+
}), /* @__PURE__ */ U("div", {
|
|
2437
2482
|
className: "padorix:text-sm padorix:text-gray-500",
|
|
2438
2483
|
children: [e.answer?.slice(0, 50), "..."]
|
|
2439
2484
|
})]
|
|
2440
|
-
}), /* @__PURE__ */
|
|
2485
|
+
}), /* @__PURE__ */ H(Ae, {})]
|
|
2441
2486
|
}, t))]
|
|
2442
2487
|
}),
|
|
2443
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ H("div", {
|
|
2444
2489
|
className: "padorix:size-fit padorix:ml-auto padorix:p-2",
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2490
|
+
children: /* @__PURE__ */ H("button", {
|
|
2446
2491
|
onClick: () => e.talkToTeam(!1),
|
|
2447
2492
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2448
2493
|
className: "padorix:cursor-pointer padorix:text-white padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
@@ -2453,11 +2498,11 @@ function St(e) {
|
|
|
2453
2498
|
}
|
|
2454
2499
|
//#endregion
|
|
2455
2500
|
//#region lib/chats/chatScreen/unavailable-form.tsx
|
|
2456
|
-
function
|
|
2457
|
-
let { workspace: t } =
|
|
2501
|
+
function Tt(e) {
|
|
2502
|
+
let { workspace: t } = j((e) => e.data), [n, i] = M.useState(!1), [a, o] = M.useState({
|
|
2458
2503
|
status: "success",
|
|
2459
2504
|
message: ""
|
|
2460
|
-
}),
|
|
2505
|
+
}), s = me({
|
|
2461
2506
|
mode: "uncontrolled",
|
|
2462
2507
|
initialValues: {
|
|
2463
2508
|
workspaceId: t?.id ?? "",
|
|
@@ -2467,104 +2512,104 @@ function Ct(e) {
|
|
|
2467
2512
|
},
|
|
2468
2513
|
validate: {
|
|
2469
2514
|
name: (e) => e ? e.length <= 2 ? "Your name is expected to be more than 2 characters" : null : "Full name is required",
|
|
2470
|
-
email: (e) => e ?
|
|
2515
|
+
email: (e) => e ? yt(e) ? null : "Please enter a valid email address" : "Email address is required",
|
|
2471
2516
|
message: (e) => e ? null : "Enquiry content is required"
|
|
2472
2517
|
}
|
|
2473
2518
|
});
|
|
2474
|
-
async function
|
|
2519
|
+
async function c(e) {
|
|
2475
2520
|
try {
|
|
2476
|
-
|
|
2521
|
+
i(!0), o({
|
|
2477
2522
|
status: "success",
|
|
2478
|
-
message: (await
|
|
2479
|
-
endpoint:
|
|
2523
|
+
message: (await r({
|
|
2524
|
+
endpoint: l.inquiries.inquiries,
|
|
2480
2525
|
method: "POST",
|
|
2481
2526
|
data: e
|
|
2482
2527
|
})).message
|
|
2483
2528
|
});
|
|
2484
2529
|
} catch {
|
|
2485
|
-
|
|
2530
|
+
o({
|
|
2486
2531
|
status: "error",
|
|
2487
2532
|
message: "There was an error sending your message."
|
|
2488
2533
|
});
|
|
2489
2534
|
} finally {
|
|
2490
|
-
|
|
2535
|
+
s.reset(), i(!1), setTimeout(() => o({
|
|
2491
2536
|
status: "success",
|
|
2492
2537
|
message: ""
|
|
2493
2538
|
}), 3e3);
|
|
2494
2539
|
}
|
|
2495
2540
|
}
|
|
2496
|
-
return /* @__PURE__ */
|
|
2541
|
+
return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
|
|
2497
2542
|
style: { background: String(t?.widget?.colorScheme) },
|
|
2498
2543
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2499
2544
|
children: [
|
|
2500
|
-
/* @__PURE__ */
|
|
2545
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2501
2546
|
className: "padorix:size-8",
|
|
2502
|
-
children: /* @__PURE__ */
|
|
2547
|
+
children: /* @__PURE__ */ U("div", {
|
|
2503
2548
|
style: { color: String(t?.widget?.colorScheme) },
|
|
2504
2549
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2505
2550
|
children: [
|
|
2506
2551
|
" ",
|
|
2507
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ H(Je, { className: "padorix:size-5" }),
|
|
2508
2553
|
" "
|
|
2509
2554
|
]
|
|
2510
2555
|
})
|
|
2511
2556
|
}) }),
|
|
2512
|
-
/* @__PURE__ */
|
|
2557
|
+
/* @__PURE__ */ U("div", {
|
|
2513
2558
|
className: "",
|
|
2514
|
-
children: [/* @__PURE__ */
|
|
2559
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2515
2560
|
className: "",
|
|
2516
2561
|
children: "Send us a message"
|
|
2517
|
-
}) }), /* @__PURE__ */
|
|
2562
|
+
}) }), /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2518
2563
|
className: "padorix:text-xs",
|
|
2519
2564
|
children: "Leave us a message and we'll reply via email."
|
|
2520
2565
|
}) })]
|
|
2521
2566
|
}),
|
|
2522
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ H("div", {
|
|
2523
2568
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2524
|
-
children: /* @__PURE__ */
|
|
2569
|
+
children: /* @__PURE__ */ H("div", {
|
|
2525
2570
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2526
2571
|
onClick: e.close,
|
|
2527
|
-
children: /* @__PURE__ */
|
|
2572
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2528
2573
|
})
|
|
2529
2574
|
})
|
|
2530
2575
|
]
|
|
2531
|
-
}), /* @__PURE__ */
|
|
2576
|
+
}), /* @__PURE__ */ H("div", {
|
|
2532
2577
|
className: "padorix:p-1.5 padorix:h-[70dvh] padorix-scrolls padorix:overflow-y-auto",
|
|
2533
|
-
children: /* @__PURE__ */
|
|
2534
|
-
onSubmit:
|
|
2578
|
+
children: /* @__PURE__ */ U("form", {
|
|
2579
|
+
onSubmit: s.onSubmit(c),
|
|
2535
2580
|
children: [
|
|
2536
|
-
/* @__PURE__ */
|
|
2581
|
+
/* @__PURE__ */ H($, {
|
|
2537
2582
|
content: "Full name",
|
|
2538
2583
|
placeholder: "Enter your full name",
|
|
2539
|
-
error:
|
|
2540
|
-
...
|
|
2541
|
-
},
|
|
2542
|
-
/* @__PURE__ */
|
|
2584
|
+
error: s.errors.name?.toString() || "",
|
|
2585
|
+
...s.getInputProps("name")
|
|
2586
|
+
}, s.key("name")),
|
|
2587
|
+
/* @__PURE__ */ H($, {
|
|
2543
2588
|
content: "Email address",
|
|
2544
2589
|
placeholder: "name@example.com",
|
|
2545
|
-
error:
|
|
2546
|
-
...
|
|
2547
|
-
},
|
|
2548
|
-
/* @__PURE__ */
|
|
2590
|
+
error: s.errors.email?.toString() || "",
|
|
2591
|
+
...s.getInputProps("email")
|
|
2592
|
+
}, s.key("email")),
|
|
2593
|
+
/* @__PURE__ */ H($, {
|
|
2549
2594
|
content: "Message",
|
|
2550
2595
|
formtype: "textarea",
|
|
2551
|
-
error:
|
|
2552
|
-
...
|
|
2553
|
-
},
|
|
2554
|
-
|
|
2555
|
-
className: `padorix:mt-4 padorix:text-sm padorix:p-2 padorix:rounded-md ${
|
|
2556
|
-
children:
|
|
2596
|
+
error: s.errors.message?.toString() || "",
|
|
2597
|
+
...s.getInputProps("message")
|
|
2598
|
+
}, s.key("message")),
|
|
2599
|
+
a.message && /* @__PURE__ */ H("div", {
|
|
2600
|
+
className: `padorix:mt-4 padorix:text-sm padorix:p-2 padorix:rounded-md ${a.status === "success" ? "padorix:bg-green-100 padorix:text-green-800" : "padorix:bg-red-100 padorix:text-red-800"}`,
|
|
2601
|
+
children: a.message
|
|
2557
2602
|
}),
|
|
2558
|
-
/* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ U("div", {
|
|
2559
2604
|
className: "padorix:mt-6 padorix:flex padorix:items-center padorix:gap-2",
|
|
2560
|
-
children: [/* @__PURE__ */
|
|
2605
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2561
2606
|
type: "button",
|
|
2562
2607
|
onClick: e.backAction,
|
|
2563
2608
|
className: "padorix:cursor-pointer padorix:border padorix:border-gray-300 padorix:bg-slate-100 padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md",
|
|
2564
2609
|
children: "Back"
|
|
2565
|
-
}) }), /* @__PURE__ */
|
|
2610
|
+
}) }), /* @__PURE__ */ H(B, {
|
|
2566
2611
|
className: "padorix:w-full",
|
|
2567
|
-
children: /* @__PURE__ */
|
|
2612
|
+
children: /* @__PURE__ */ H("button", {
|
|
2568
2613
|
disabled: n,
|
|
2569
2614
|
style: { background: n ? "#62748e" : String(t?.widget?.colorScheme) },
|
|
2570
2615
|
className: `${n ? "padorix:cursor-progress" : "padorix:cursor-pointer"} padorix:text-white padorix:w-full padorix:py-2 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:hover:-translate-y-2 padorix:transition-all padorix:hover:shadow-md`,
|
|
@@ -2578,49 +2623,49 @@ function Ct(e) {
|
|
|
2578
2623
|
}
|
|
2579
2624
|
//#endregion
|
|
2580
2625
|
//#region lib/chats/chatScreen/chat-lobby.tsx
|
|
2581
|
-
function
|
|
2582
|
-
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } =
|
|
2583
|
-
function
|
|
2626
|
+
function Et(e) {
|
|
2627
|
+
let { sender: t, faqs: n, faqsLoaded: r, workspace: i } = j((e) => e.data), a = JSON.parse(localStorage.getItem("pdx-sess") || "null"), [o, s] = M.useState(!0), [c, l] = M.useState(!1), u = f(i?.widget?.notifications?.showFaqBeforeConversation), d = p(i?.widget), m = !!(e.openOptions && Object.values(e.openOptions).some(Boolean));
|
|
2628
|
+
function h(e) {
|
|
2584
2629
|
s(e), l(!d);
|
|
2585
2630
|
}
|
|
2586
|
-
function
|
|
2631
|
+
function g() {
|
|
2587
2632
|
s(!0), l(!1);
|
|
2588
2633
|
}
|
|
2589
|
-
function
|
|
2634
|
+
function _() {
|
|
2590
2635
|
s(!0);
|
|
2591
2636
|
}
|
|
2592
|
-
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */
|
|
2593
|
-
if (!
|
|
2594
|
-
if (!
|
|
2637
|
+
if (t?.conversationId && a?.conversationId) return /* @__PURE__ */ H(gt, { ...e });
|
|
2638
|
+
if (!m && o && u && !r) return /* @__PURE__ */ H(S, { close: e.close });
|
|
2639
|
+
if (!m && o && u && n.length > 0) return /* @__PURE__ */ H("div", {
|
|
2595
2640
|
className: e.styles.container,
|
|
2596
|
-
children: /* @__PURE__ */
|
|
2597
|
-
talkToTeam:
|
|
2641
|
+
children: /* @__PURE__ */ H(wt, {
|
|
2642
|
+
talkToTeam: h,
|
|
2598
2643
|
isOpen: d,
|
|
2599
2644
|
...e
|
|
2600
2645
|
})
|
|
2601
2646
|
});
|
|
2602
|
-
if (c) return /* @__PURE__ */
|
|
2647
|
+
if (c) return /* @__PURE__ */ H("div", {
|
|
2603
2648
|
className: e.styles.container,
|
|
2604
|
-
children: /* @__PURE__ */
|
|
2649
|
+
children: /* @__PURE__ */ H(Tt, {
|
|
2605
2650
|
close: e.close,
|
|
2606
2651
|
isOpen: d,
|
|
2607
|
-
backAction:
|
|
2652
|
+
backAction: g
|
|
2608
2653
|
})
|
|
2609
2654
|
});
|
|
2610
|
-
if (!c) return /* @__PURE__ */
|
|
2611
|
-
openFaq:
|
|
2655
|
+
if (!c) return /* @__PURE__ */ H(Dt, {
|
|
2656
|
+
openFaq: _,
|
|
2612
2657
|
...e
|
|
2613
2658
|
});
|
|
2614
2659
|
}
|
|
2615
|
-
function
|
|
2616
|
-
let { workspace: n, faqs: r } =
|
|
2617
|
-
|
|
2660
|
+
function Dt({ openFaq: e, ...t }) {
|
|
2661
|
+
let { workspace: n, faqs: r } = j((e) => e.data), [i, a] = M.useState(t.openOptions ? 2 : 1), o = p(n?.widget), s = f(n?.widget?.notifications?.showFaqBeforeConversation) && r.length > 0, c = M.useMemo(() => n?.logo, [n]);
|
|
2662
|
+
M.useEffect(() => {
|
|
2618
2663
|
a(t.openOptions ? 2 : 1);
|
|
2619
2664
|
}, [t.openRequestId]);
|
|
2620
2665
|
function l(e) {
|
|
2621
2666
|
a(e);
|
|
2622
2667
|
}
|
|
2623
|
-
if (i === 2) return /* @__PURE__ */
|
|
2668
|
+
if (i === 2) return /* @__PURE__ */ H(bt, {
|
|
2624
2669
|
close: t.close,
|
|
2625
2670
|
styles: t.styles,
|
|
2626
2671
|
changeScreen: l,
|
|
@@ -2629,23 +2674,23 @@ function Tt({ openFaq: e, ...t }) {
|
|
|
2629
2674
|
openRequestId: t.openRequestId,
|
|
2630
2675
|
autoSubmitRequestId: t.autoSubmitRequestId
|
|
2631
2676
|
});
|
|
2632
|
-
if (i === 1) return /* @__PURE__ */
|
|
2677
|
+
if (i === 1) return /* @__PURE__ */ U("div", {
|
|
2633
2678
|
className: t.styles.container,
|
|
2634
|
-
children: [/* @__PURE__ */
|
|
2679
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2635
2680
|
style: {
|
|
2636
2681
|
background: String(n?.widget?.colorScheme),
|
|
2637
2682
|
color: n?.widget?.textColor || "#ffffff"
|
|
2638
2683
|
},
|
|
2639
2684
|
className: "padorix:px-3 padorix:py-5 padorix:md:rounded-t-xl padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2640
2685
|
children: [
|
|
2641
|
-
/* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2642
2687
|
className: "padorix:size-8",
|
|
2643
|
-
children: /* @__PURE__ */
|
|
2688
|
+
children: /* @__PURE__ */ U("div", {
|
|
2644
2689
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2645
2690
|
children: [
|
|
2646
2691
|
" ",
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
src:
|
|
2692
|
+
/* @__PURE__ */ H("img", {
|
|
2693
|
+
src: _t,
|
|
2649
2694
|
alt: n?.name,
|
|
2650
2695
|
loading: "lazy",
|
|
2651
2696
|
className: "padorix:size-6"
|
|
@@ -2654,29 +2699,29 @@ function Tt({ openFaq: e, ...t }) {
|
|
|
2654
2699
|
]
|
|
2655
2700
|
})
|
|
2656
2701
|
}) }),
|
|
2657
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2658
2703
|
className: "",
|
|
2659
2704
|
children: n?.widget?.widgetMessage
|
|
2660
2705
|
}) }),
|
|
2661
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ H("div", {
|
|
2662
2707
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2663
|
-
children: /* @__PURE__ */
|
|
2708
|
+
children: /* @__PURE__ */ H("div", {
|
|
2664
2709
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2665
2710
|
onClick: t.close,
|
|
2666
|
-
children: /* @__PURE__ */
|
|
2711
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2667
2712
|
})
|
|
2668
2713
|
})
|
|
2669
2714
|
]
|
|
2670
|
-
}), /* @__PURE__ */
|
|
2715
|
+
}), /* @__PURE__ */ H("div", {
|
|
2671
2716
|
className: "padorix:p-4 padorix:mt-5",
|
|
2672
|
-
children: /* @__PURE__ */
|
|
2717
|
+
children: /* @__PURE__ */ U("div", {
|
|
2673
2718
|
className: "padorix:flex padorix:flex-col padorix:items-center padorix:text-center padorix:h-full padorix:justify-center",
|
|
2674
2719
|
children: [
|
|
2675
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
2676
2721
|
className: "padorix:mb-3",
|
|
2677
2722
|
children: [
|
|
2678
2723
|
" ",
|
|
2679
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ H("img", {
|
|
2680
2725
|
src: c,
|
|
2681
2726
|
alt: n?.name,
|
|
2682
2727
|
loading: "lazy",
|
|
@@ -2685,33 +2730,33 @@ function Tt({ openFaq: e, ...t }) {
|
|
|
2685
2730
|
" "
|
|
2686
2731
|
]
|
|
2687
2732
|
}) }),
|
|
2688
|
-
/* @__PURE__ */
|
|
2733
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2689
2734
|
className: "padorix:font-semibold",
|
|
2690
2735
|
children: n?.widget?.department
|
|
2691
2736
|
}) }),
|
|
2692
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ U(B, { children: [/* @__PURE__ */ H("div", {
|
|
2693
2738
|
className: "padorix:mt-5",
|
|
2694
2739
|
children: n?.widget?.welcomeMessage || "Ask us anything - we will get back to you here or by email."
|
|
2695
|
-
}), !o && /* @__PURE__ */
|
|
2696
|
-
/* @__PURE__ */
|
|
2740
|
+
}), !o && /* @__PURE__ */ H(Ct, {})] }),
|
|
2741
|
+
/* @__PURE__ */ U("div", {
|
|
2697
2742
|
className: "padorix:mt-10",
|
|
2698
|
-
children: [/* @__PURE__ */
|
|
2743
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("button", {
|
|
2699
2744
|
onClick: () => o && l(2),
|
|
2700
2745
|
style: { background: String(n?.widget?.colorScheme) },
|
|
2701
2746
|
disabled: !o,
|
|
2702
2747
|
className: `padorix:text-white padorix:py-3 padorix:px-5 padorix:rounded-md padorix:text-shadow-lg padorix:transition-all ${o ? "padorix:cursor-pointer padorix:hover:-translate-y-2 padorix:hover:shadow-md" : "padorix:cursor-not-allowed padorix:opacity-50"}`,
|
|
2703
2748
|
children: "Start new conversation"
|
|
2704
|
-
}) }), s && /* @__PURE__ */
|
|
2749
|
+
}) }), s && /* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2705
2750
|
onClick: () => e?.(),
|
|
2706
2751
|
className: "padorix:underline padorix:mt-5 padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2707
2752
|
children: "Frequently asked questions?"
|
|
2708
2753
|
}) })]
|
|
2709
2754
|
}),
|
|
2710
|
-
|
|
2755
|
+
f(n?.widget?.notifications?.displaySourceLogoOnWidget) && /* @__PURE__ */ H(B, { children: /* @__PURE__ */ U("div", {
|
|
2711
2756
|
className: "padorix:mt-10 padorix:grayscale-100 padorix:text-sm padorix:flex padorix:items-center padorix:justify-center padorix:text-zinc-500 padorix:gap-2",
|
|
2712
2757
|
children: [
|
|
2713
2758
|
" ",
|
|
2714
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ H("img", {
|
|
2715
2760
|
src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABPCAMAAAAjvDDpAAADAFBMVEVMaXEAQf8AVvsAVv8CVaoAV/0AVvwAVf8AAP8Af/8AVv4AVvwIf38AVvwAV/wAXuAA//8AP79jAAAAV/0AV/4AV/8AV/0AVv0EVe1vLQgOTcIRRaYEU+UAWP8AWP4OUMIYVtUAV/wQ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d61IMJvvJL4J8LWyAb/Zi5Ivl1Oz1YNDCqLzgRgitXSSnpr+XDVoN7UKhy7ag2295kXTF4SgTajkI+6prkB2Ewt7ausfrA4Bth4Jdo1p4ZhlKE0NIRDxu5uBLd2kyeDuYUHdFmP7MwZhgrx/R9q8LLxy4cOHCK6NGHcpt5Lrzt6HXkhiCKDwEh/9u/wHzq1jxN2ehBgz8P+K/qzfIpxuSbGgAAAAASUVORK5CYII=",
|
|
2716
2761
|
alt: "padorix",
|
|
2717
2762
|
loading: "lazy",
|
|
@@ -2726,39 +2771,13 @@ function Tt({ openFaq: e, ...t }) {
|
|
|
2726
2771
|
});
|
|
2727
2772
|
}
|
|
2728
2773
|
//#endregion
|
|
2729
|
-
//#region lib/
|
|
2730
|
-
var
|
|
2731
|
-
visitor: {
|
|
2732
|
-
container: "padorix:z-50 padorix:fixed padorix:bottom-0 padorix:left-0 padorix:right-0 padorix:top-0 padorix:bg-[#fff] padorix:w-screen padorix:h-screen padorix:max-w-full padorix:pb-16 padorix:max-md:h-(--padorix-vvh,100dvh) padorix:max-md:translate-y-(--padorix-vvt,0px) padorix:md:top-auto padorix:md:left-auto padorix:md:bottom-5 padorix:md:right-2 padorix:md:h-[93dvh] padorix:md:w-[400px] padorix:md:max-w-[640px] padorix:md:rounded-xl padorix:md:border padorix:border-gray-200 padorix:md:shadow-lg padorix:overflow-y-hidden padorix:flex padorix:flex-col",
|
|
2733
|
-
backdrop: "padorix:hidden padorix:max-md:block padorix:fixed padorix:top-0 padorix:left-0 padorix:right-0 padorix:-bottom-[100lvh] padorix:z-49 padorix:bg-white padorix:touch-none",
|
|
2734
|
-
height: "80dvh",
|
|
2735
|
-
chatContainerPadding: "padorix:pt-3 padorix:flex-1 padorix:min-h-0 padorix:pb-10 padorix:overflow-y-auto padorix:overflow-x-hidden padorix-scrolls padorix:relative",
|
|
2736
|
-
header: "padorix:relative padorix:shrink-0 padorix:w-full padorix:bg-white padorix:z-10 padorix:border-x padorix:border-t padorix:border-gray-200 padorix:md:rounded-t-lg",
|
|
2737
|
-
emojiContainer: "padorix:fixed padorix:bottom-20 padorix:left-4 padorix:z-30 padorix:md:left-auto padorix:md:right-6",
|
|
2738
|
-
formContainer: "padorix:border-t padorix:border-gray-200 padorix:fixed padorix:bg-white padorix:z-10 padorix:right-0 padorix:bottom-5 padorix:w-dvw padorix:max-w-full padorix:text-sm padorix:px-4 padorix:py-2 padorix:md:max-w-160 padorix:md:w-100 padorix:md:right-2 padorix:md:rounded-b-xl",
|
|
2739
|
-
imageUploadContainer: "padorix:fixed padorix:top-12 padorix:left-0 padorix:right-0 padorix:w-dvw padorix:h-full padorix:bg-white padorix:z-20 padorix:p-0 padorix:ml-auto padorix:space-y-3 padorix:md:top-21 padorix:md:right-2 padorix:md:w-100 padorix:md:max-w-160 padorix:md:h-[90dvh]",
|
|
2740
|
-
messagesContainer: "padorix:fixed padorix:bottom-5 padorix:right-0 padorix:w-full padorix:z-30 padorix:bg-white padorix:flex padorix:items-center padorix:justify-between padorix:px-3 padorix:py-4 padorix:md:right-2 padorix:md:w-100 padorix:md:max-w-160 padorix:border padorix:border-gray-200 padorix:rounded-b-xl",
|
|
2741
|
-
replyContainer: "padorix:relative padorix:w-full padorix:mb-1",
|
|
2742
|
-
formRoot: "padorix:relative padorix:z-50"
|
|
2743
|
-
},
|
|
2744
|
-
nonVisitor: {
|
|
2745
|
-
container: "padorix:bg-[#fff] padorix:relative!",
|
|
2746
|
-
height: "",
|
|
2747
|
-
chatContainerPadding: "padorix:pt-5 padorix:pb-20 padorix:overflow-y-auto padorix:overflow-x-hidden padorix-scrolls padorix:relative",
|
|
2748
|
-
header: "padorix:sticky padorix:top-0 padorix:left-0 padorix:w-full padorix:bg-white padorix:z-10 padorix:border-x padorix:border-t padorix:border-gray-200",
|
|
2749
|
-
emojiContainer: "padorix:absolute padorix:bottom-full padorix:left-1 padorix:mb-1 padorix:z-40",
|
|
2750
|
-
formContainer: `padorix:border-t padorix:bg-white padorix:z-10 padorix:relative padorix:border-gray-200 padorix:bottom-0 padorix:left-0 padorix:w-full ${Et} padorix:ml-auto padorix:right-0 padorix:md:text-sm padorix:px-1.5 padorix:pt-1.5 padorix:pb-4`,
|
|
2751
|
-
imageUploadContainer: `padorix:absolute padorix:inset-0 padorix:bg-white padorix:z-30 padorix:space-y-3 padorix:overflow-y-auto padorix-scrolls ${Et}`,
|
|
2752
|
-
messagesContainer: "padorix:absolute padorix:border padorix:border-gray-200 padorix:bottom-0 padorix:right-0 padorix:w-full padorix:z-30 padorix:bg-white padorix:flex padorix:items-center padorix:justify-between padorix:px-3 padorix:py-4 padorix:md:right-2",
|
|
2753
|
-
replyContainer: `padorix:relative padorix:w-full padorix:mb-1 ${Et}`,
|
|
2754
|
-
formRoot: ""
|
|
2755
|
-
}
|
|
2756
|
-
}, Ot = "data:image/svg+xml,%3csvg%20width='122'%20height='123'%20viewBox='0%200%20122%20123'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M56.6201%2019.9004H65.3779C85.9345%2019.9004%20102.6%2036.5645%20102.6%2057.1211V65.8789C102.6%2086.4355%2085.9346%20103.101%2065.3779%20103.101H56.6201C36.0636%20103.101%2019.3994%2086.4355%2019.3994%2065.8789V57.1211C19.3995%2036.5646%2036.0636%2019.9005%2056.6201%2019.9004Z'%20stroke='%23667085'%20stroke-width='6.4'/%3e%3c/g%3e%3cg%20opacity='0.1'%3e%3cpath%20d='M40.6201%203.90039H81.3779C101.934%203.90039%20118.6%2020.5645%20118.6%2041.1211V81.8789C118.6%20102.436%20101.935%20119.101%2081.3779%20119.101H40.6201C20.0636%20119.101%203.39941%20102.435%203.39941%2081.8789V41.1211C3.39948%2020.5646%2020.0636%203.90048%2040.6201%203.90039Z'%20stroke='%23667085'%20stroke-width='6.4'/%3e%3c/g%3e%3cpath%20d='M51.6693%2070.8339L70.3359%2052.1673M53.0026%2040.1673V34.834M69.0026%2082.834V88.1673M39.6693%2053.5007H34.3359M82.3359%2069.5007H87.6693M42.1072%2042.6052L38.3359%2038.834M79.8981%2080.3958L83.6694%2084.1671M61.0027%2076.5854L55.3458%2082.2422C51.1803%2086.4078%2044.4265%2086.4078%2040.2609%2082.2422C36.0953%2078.0766%2036.0953%2071.3229%2040.2609%2067.1573L45.9178%2061.5004M76.0876%2061.5004L81.7445%2055.8436C85.9101%2051.678%2085.9101%2044.9242%2081.7445%2040.7586C77.5789%2036.593%2070.8251%2036.593%2066.6596%2040.7586L61.0027%2046.4155'%20stroke='%23667085'%20stroke-width='6.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", kt = "data:image/svg+xml,%3csvg%20width='122'%20height='122'%20viewBox='0%200%20122%20122'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M56.6209%2019.4002H65.3787C85.9353%2019.4002%20102.6%2036.0643%20102.6%2056.6209V65.3787C102.6%2085.9353%2085.9353%20102.6%2065.3787%20102.6H56.6209C36.0643%20102.6%2019.4002%2085.9353%2019.4002%2065.3787V56.6209C19.4003%2036.0644%2036.0644%2019.4003%2056.6209%2019.4002Z'%20stroke='%23D12C2C'%20stroke-width='6.4'/%3e%3c/g%3e%3cg%20opacity='0.1'%3e%3cpath%20d='M40.6209%203.40019H81.3787C101.935%203.40019%20118.6%2020.0643%20118.6%2040.6209V81.3787C118.6%20101.935%20101.935%20118.6%2081.3787%20118.6H40.6209C20.0643%20118.6%203.40019%20101.935%203.40019%2081.3787V40.6209C3.40026%2020.0644%2020.0644%203.40028%2040.6209%203.40019Z'%20stroke='%23FF7E7E'%20stroke-width='6.4'/%3e%3c/g%3e%3cpath%20d='M69%2053L53%2069M53%2053L69%2069M87.6667%2061C87.6667%2075.7276%2075.7276%2087.6667%2061%2087.6667C46.2724%2087.6667%2034.3333%2075.7276%2034.3333%2061C34.3333%2046.2724%2046.2724%2034.3333%2061%2034.3333C75.7276%2034.3333%2087.6667%2046.2724%2087.6667%2061Z'%20stroke='%23D12C2C'%20stroke-width='6.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
2774
|
+
//#region lib/assets/images/error.svg
|
|
2775
|
+
var Ot = "data:image/svg+xml,%3csvg%20width='122'%20height='123'%20viewBox='0%200%20122%20123'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M56.6201%2019.9004H65.3779C85.9345%2019.9004%20102.6%2036.5645%20102.6%2057.1211V65.8789C102.6%2086.4355%2085.9346%20103.101%2065.3779%20103.101H56.6201C36.0636%20103.101%2019.3994%2086.4355%2019.3994%2065.8789V57.1211C19.3995%2036.5646%2036.0636%2019.9005%2056.6201%2019.9004Z'%20stroke='%23667085'%20stroke-width='6.4'/%3e%3c/g%3e%3cg%20opacity='0.1'%3e%3cpath%20d='M40.6201%203.90039H81.3779C101.934%203.90039%20118.6%2020.5645%20118.6%2041.1211V81.8789C118.6%20102.436%20101.935%20119.101%2081.3779%20119.101H40.6201C20.0636%20119.101%203.39941%20102.435%203.39941%2081.8789V41.1211C3.39948%2020.5646%2020.0636%203.90048%2040.6201%203.90039Z'%20stroke='%23667085'%20stroke-width='6.4'/%3e%3c/g%3e%3cpath%20d='M51.6693%2070.8339L70.3359%2052.1673M53.0026%2040.1673V34.834M69.0026%2082.834V88.1673M39.6693%2053.5007H34.3359M82.3359%2069.5007H87.6693M42.1072%2042.6052L38.3359%2038.834M79.8981%2080.3958L83.6694%2084.1671M61.0027%2076.5854L55.3458%2082.2422C51.1803%2086.4078%2044.4265%2086.4078%2040.2609%2082.2422C36.0953%2078.0766%2036.0953%2071.3229%2040.2609%2067.1573L45.9178%2061.5004M76.0876%2061.5004L81.7445%2055.8436C85.9101%2051.678%2085.9101%2044.9242%2081.7445%2040.7586C77.5789%2036.593%2070.8251%2036.593%2066.6596%2040.7586L61.0027%2046.4155'%20stroke='%23667085'%20stroke-width='6.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", kt = "data:image/svg+xml,%3csvg%20width='122'%20height='122'%20viewBox='0%200%20122%20122'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.3'%3e%3cpath%20d='M56.6209%2019.4002H65.3787C85.9353%2019.4002%20102.6%2036.0643%20102.6%2056.6209V65.3787C102.6%2085.9353%2085.9353%20102.6%2065.3787%20102.6H56.6209C36.0643%20102.6%2019.4002%2085.9353%2019.4002%2065.3787V56.6209C19.4003%2036.0644%2036.0644%2019.4003%2056.6209%2019.4002Z'%20stroke='%23D12C2C'%20stroke-width='6.4'/%3e%3c/g%3e%3cg%20opacity='0.1'%3e%3cpath%20d='M40.6209%203.40019H81.3787C101.935%203.40019%20118.6%2020.0643%20118.6%2040.6209V81.3787C118.6%20101.935%20101.935%20118.6%2081.3787%20118.6H40.6209C20.0643%20118.6%203.40019%20101.935%203.40019%2081.3787V40.6209C3.40026%2020.0644%2020.0644%203.40028%2040.6209%203.40019Z'%20stroke='%23FF7E7E'%20stroke-width='6.4'/%3e%3c/g%3e%3cpath%20d='M69%2053L53%2069M53%2053L69%2069M87.6667%2061C87.6667%2075.7276%2075.7276%2087.6667%2061%2087.6667C46.2724%2087.6667%2034.3333%2075.7276%2034.3333%2061C34.3333%2046.2724%2046.2724%2034.3333%2061%2034.3333C75.7276%2034.3333%2087.6667%2046.2724%2087.6667%2061Z'%20stroke='%23D12C2C'%20stroke-width='6.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
2757
2776
|
//#endregion
|
|
2758
2777
|
//#region lib/chats/online-check/online-check.tsx
|
|
2759
2778
|
function At(e) {
|
|
2760
|
-
let t = e.userType ===
|
|
2761
|
-
return
|
|
2779
|
+
let t = e.userType === T.VISITOR ? y.visitor : y.nonVisitor, n = e.userType === T.VISITOR, [r, i] = M.useState(navigator.onLine);
|
|
2780
|
+
return M.useEffect(() => {
|
|
2762
2781
|
let e = () => {
|
|
2763
2782
|
i(!0);
|
|
2764
2783
|
}, t = () => {
|
|
@@ -2767,18 +2786,18 @@ function At(e) {
|
|
|
2767
2786
|
return window.addEventListener("online", e), window.addEventListener("offline", t), () => {
|
|
2768
2787
|
window.removeEventListener("online", e), window.removeEventListener("offline", t);
|
|
2769
2788
|
};
|
|
2770
|
-
}, []), r ? e.children : /* @__PURE__ */
|
|
2789
|
+
}, []), r ? e.children : /* @__PURE__ */ U("div", {
|
|
2771
2790
|
className: t.container,
|
|
2772
|
-
children: [/* @__PURE__ */
|
|
2791
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2773
2792
|
className: "padorix:px-3 padorix:py-5 padorix:bg-[#6c63ff] padorix:md:rounded-t-xl padorix:text-white padorix:text-sm padorix:flex padorix:items-center padorix:gap-2",
|
|
2774
2793
|
children: [
|
|
2775
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2776
2795
|
className: "padorix:size-8",
|
|
2777
|
-
children: /* @__PURE__ */
|
|
2796
|
+
children: /* @__PURE__ */ U("div", {
|
|
2778
2797
|
className: "padorix:size-8 padorix:rounded-full padorix:bg-white padorix:flex padorix:items-center padorix:justify-center",
|
|
2779
2798
|
children: [
|
|
2780
2799
|
" ",
|
|
2781
|
-
/* @__PURE__ */
|
|
2800
|
+
/* @__PURE__ */ H("img", {
|
|
2782
2801
|
src: kt,
|
|
2783
2802
|
alt: "Padorix",
|
|
2784
2803
|
loading: "lazy",
|
|
@@ -2788,39 +2807,39 @@ function At(e) {
|
|
|
2788
2807
|
]
|
|
2789
2808
|
})
|
|
2790
2809
|
}) }),
|
|
2791
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("div", {
|
|
2792
2811
|
className: "",
|
|
2793
2812
|
children: "Internet connected lost, try reconnecting your device network to proceed"
|
|
2794
2813
|
}) }),
|
|
2795
|
-
n && /* @__PURE__ */
|
|
2814
|
+
n && /* @__PURE__ */ H("div", {
|
|
2796
2815
|
className: "padorix:size-8 padorix:ml-auto",
|
|
2797
|
-
children: /* @__PURE__ */
|
|
2816
|
+
children: /* @__PURE__ */ H("div", {
|
|
2798
2817
|
className: "padorix:bg-black/10 padorix:size-8 padorix:self-center padorix:flex padorix:items-center padorix:justify-center padorix:rounded-md padorix:cursor-pointer padorix:active:scale-95 padorix:transition-all",
|
|
2799
2818
|
onClick: e.close,
|
|
2800
|
-
children: /* @__PURE__ */
|
|
2819
|
+
children: /* @__PURE__ */ H(L, {})
|
|
2801
2820
|
})
|
|
2802
2821
|
})
|
|
2803
2822
|
]
|
|
2804
|
-
}), /* @__PURE__ */
|
|
2823
|
+
}), /* @__PURE__ */ U("div", {
|
|
2805
2824
|
className: "padorix:flex padorix:flex-col padorix:items-center padorix:justify-center padorix:h-full padorix:text-center",
|
|
2806
|
-
children: [/* @__PURE__ */
|
|
2825
|
+
children: [/* @__PURE__ */ H(B, { children: /* @__PURE__ */ H("img", {
|
|
2807
2826
|
src: Ot,
|
|
2808
2827
|
alt: "",
|
|
2809
2828
|
className: ""
|
|
2810
|
-
}) }), /* @__PURE__ */
|
|
2811
|
-
/* @__PURE__ */
|
|
2829
|
+
}) }), /* @__PURE__ */ U(B, { children: [
|
|
2830
|
+
/* @__PURE__ */ H("div", {
|
|
2812
2831
|
className: "padorix:text-2xl padorix:font-bold padorix:mt-10 padorix:mb-3",
|
|
2813
2832
|
children: "Oops!"
|
|
2814
2833
|
}),
|
|
2815
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ H("div", {
|
|
2816
2835
|
className: "padorix:text-base padorix:text-zinc-500",
|
|
2817
2836
|
children: "Your internet is disconnected"
|
|
2818
2837
|
}),
|
|
2819
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ U("div", {
|
|
2820
2839
|
className: "padorix:text-zinc-500 padorix:text-sm",
|
|
2821
2840
|
children: [
|
|
2822
2841
|
"Do not worry your chat sessions are saved ",
|
|
2823
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ H("br", {}),
|
|
2824
2843
|
" till you are back online"
|
|
2825
2844
|
]
|
|
2826
2845
|
})
|
|
@@ -2830,57 +2849,57 @@ function At(e) {
|
|
|
2830
2849
|
}
|
|
2831
2850
|
//#endregion
|
|
2832
2851
|
//#region lib/chats/chatScreen/chat-conversation.tsx
|
|
2833
|
-
function jt(
|
|
2834
|
-
let
|
|
2835
|
-
if (
|
|
2836
|
-
if (!
|
|
2837
|
-
|
|
2852
|
+
function jt(t) {
|
|
2853
|
+
let n = t.userType === T.VISITOR, r = A(), { workspace: o } = j((e) => e.data);
|
|
2854
|
+
if (M.useEffect(() => {
|
|
2855
|
+
if (!n) {
|
|
2856
|
+
r(i(t.sender));
|
|
2838
2857
|
return;
|
|
2839
2858
|
}
|
|
2840
2859
|
try {
|
|
2841
|
-
let e = JSON.parse(localStorage.getItem("pdx-sess") ?? "null")
|
|
2842
|
-
|
|
2860
|
+
let e = JSON.parse(localStorage.getItem("pdx-sess") ?? "null");
|
|
2861
|
+
e?.conversationId && r(i(e));
|
|
2843
2862
|
} catch (e) {
|
|
2844
2863
|
console.log(e);
|
|
2845
2864
|
}
|
|
2846
2865
|
}, [
|
|
2866
|
+
r,
|
|
2847
2867
|
n,
|
|
2848
|
-
t
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
t || (n(a(e.workspace)), n(_(e.faqs)), n(i(e.tags)));
|
|
2868
|
+
t.sender
|
|
2869
|
+
]), M.useEffect(() => {
|
|
2870
|
+
if (!t.workspaceId) return;
|
|
2871
|
+
let n = !1;
|
|
2872
|
+
return v.config(t.workspaceId, t.userType).then((t) => {
|
|
2873
|
+
n || (r(s(t.workspace)), r(e(t.faqs)), r(a(t.tags)));
|
|
2855
2874
|
}).catch((e) => console.log(e.message, "error data")), () => {
|
|
2856
|
-
|
|
2875
|
+
n = !0;
|
|
2857
2876
|
};
|
|
2858
2877
|
}, [
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
]),
|
|
2863
|
-
if (
|
|
2864
|
-
let
|
|
2865
|
-
return
|
|
2866
|
-
|
|
2878
|
+
r,
|
|
2879
|
+
t.userType,
|
|
2880
|
+
t.workspaceId
|
|
2881
|
+
]), M.useEffect(() => {
|
|
2882
|
+
if (n || !t.workspaceId) return;
|
|
2883
|
+
let e = () => O.emit(k.subscribe_workspace, { workspaceId: t.workspaceId });
|
|
2884
|
+
return O.on(k.connected, e), te(!0), e(), () => {
|
|
2885
|
+
O.off(k.connected, e);
|
|
2867
2886
|
};
|
|
2868
|
-
}, [
|
|
2887
|
+
}, [n, t.workspaceId]), o?.id) return t.children;
|
|
2869
2888
|
}
|
|
2870
2889
|
//#endregion
|
|
2871
2890
|
//#region lib/chats/chatScreen/chat-panel.tsx
|
|
2872
2891
|
function Mt(e) {
|
|
2873
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H("div", {
|
|
2874
2893
|
"aria-hidden": !0,
|
|
2875
|
-
className:
|
|
2876
|
-
}), /* @__PURE__ */
|
|
2894
|
+
className: y.visitor.backdrop
|
|
2895
|
+
}), /* @__PURE__ */ H(At, {
|
|
2877
2896
|
...e,
|
|
2878
2897
|
close: e.close,
|
|
2879
|
-
children: /* @__PURE__ */
|
|
2898
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2880
2899
|
...e,
|
|
2881
|
-
children: /* @__PURE__ */
|
|
2900
|
+
children: /* @__PURE__ */ H(Et, {
|
|
2882
2901
|
close: e.close,
|
|
2883
|
-
styles:
|
|
2902
|
+
styles: y.visitor,
|
|
2884
2903
|
workspaceId: e.workspaceId,
|
|
2885
2904
|
moreActions: e.moreActions,
|
|
2886
2905
|
userType: e.userType,
|
|
@@ -2895,12 +2914,12 @@ function Mt(e) {
|
|
|
2895
2914
|
})] });
|
|
2896
2915
|
}
|
|
2897
2916
|
function Nt(e) {
|
|
2898
|
-
return /* @__PURE__ */
|
|
2917
|
+
return /* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H(D, {}), /* @__PURE__ */ H(At, {
|
|
2899
2918
|
...e,
|
|
2900
|
-
children: /* @__PURE__ */
|
|
2919
|
+
children: /* @__PURE__ */ H(jt, {
|
|
2901
2920
|
...e,
|
|
2902
|
-
children: /* @__PURE__ */
|
|
2903
|
-
styles:
|
|
2921
|
+
children: /* @__PURE__ */ H(gt, {
|
|
2922
|
+
styles: y.nonVisitor,
|
|
2904
2923
|
moreActions: e.moreActions,
|
|
2905
2924
|
userType: e.userType,
|
|
2906
2925
|
sender: e.sender,
|
|
@@ -2913,4 +2932,4 @@ function Nt(e) {
|
|
|
2913
2932
|
//#endregion
|
|
2914
2933
|
export { Nt as AgentChatPanel, Mt as VisitorChatPanel };
|
|
2915
2934
|
|
|
2916
|
-
//# sourceMappingURL=chat-panel-
|
|
2935
|
+
//# sourceMappingURL=chat-panel-N3AY-SGW.js.map
|